"""Tool instance request/response schemas."""

from pydantic import BaseModel, Field


class CreateInstanceRequest(BaseModel):
    """Request body for creating a tool instance."""

    model_config = {"extra": "ignore"}

    tool_type_id: str = Field(description="UUID of the tool type to instantiate")
    display_name: str | None = Field(
        default=None, description="Optional display name for the instance"
    )
    workspace_id: str | None = Field(
        default=None, description="UUID of workspace to mount"
    )
    config_profile_id: str | None = Field(
        default=None, description="Optional config profile ID for launch"
    )
    ssh_key_ids: list[str] = Field(
        default_factory=list, description="SSH key IDs to mount into container ~/.ssh"
    )


class CreateWorkspaceInstanceRequest(BaseModel):
    """Request body for creating a tool instance directly on a workspace."""

    model_config = {"extra": "ignore"}

    tool_type_id: str = Field(description="UUID of the tool type to instantiate")
    display_name: str | None = Field(
        default=None, description="Optional display name for the instance"
    )
    config_profile_id: str | None = Field(
        default=None, description="Optional config profile ID for launch"
    )
    ssh_key_ids: list[str] = Field(
        default_factory=list, description="SSH key IDs to mount into container ~/.ssh"
    )


class StartInstanceRequest(BaseModel):
    """Request body for starting a tool instance."""

    model_config = {"extra": "ignore"}

    config_profile_id: str | None = Field(
        default=None, description="Config profile ID to apply, or null for none"
    )
    ssh_key_ids: list[str] = Field(
        default_factory=list, description="SSH key IDs to mount into container ~/.ssh"
    )
