79aabd6f43
- Remove clone_mode/branch from API responses and make DB columns nullable - Remove legacy clone-mode branches from create_tool_instance - Add WORKSPACE_PATH compose variable alongside REPO_PATH - Add workspace migration helpers in WorkspaceManager Remaining: POST /workspaces/:id/instances, frontend clone_mode cleanup, tests
54 lines
1.8 KiB
Python
54 lines
1.8 KiB
Python
"""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"
|
|
)
|