## MODIFIED Requirements

### Requirement: Tool Type Model

The system SHALL provide a `ToolType` model to store tool definitions.

#### Scenario: Model structure
- GIVEN a tool type definition
- THEN the model SHALL have:
  - `id`: UUID primary key
  - `name`: unique string (e.g., "code-server")
  - `display_name`: human-readable string (e.g., "VS Code Server")
  - `description`: optional text
  - `category`: string (e.g., "editor", "notebook")
  - `interface_type`: single string — "web" or "terminal"
  - `requires_port`: boolean indicating if port/tunnel configuration is needed
  - `compose_template`: Docker Compose YAML string
  - `dockerfile_template`: Dockerfile string
  - `definition_type`: string — "compose" or "dockerfile"
  - `required_variables`: list of required template variables
  - `startup_command`: optional text — command to run before interactive shell for terminal sessions
  - `is_builtin`: boolean flag for system-defined types
  - `created_at`/`updated_at`: timestamps

### Requirement: CRUD API Endpoints

The system SHALL provide REST API endpoints for tool type management.

#### Scenario: Create tool type
- GIVEN an admin user
- WHEN they POST /api/tool-types with valid data
- THEN the system creates a new tool type
- AND validates `interface_type` is "web" or "terminal"
- AND validates `requires_port` is boolean
- AND validates the compose template YAML (if definition_type is "compose")
- AND validates all required variables are present in template
- AND accepts optional `startup_command` field
- AND returns 201 Created with the new tool type

#### Scenario: Update tool type
- GIVEN an admin user
- WHEN they PUT /api/tool-types/{id} with valid data
- THEN the system updates the tool type
- AND accepts optional `startup_command` field
- AND returns 200 OK with updated tool type

#### Scenario: Get tool type includes startup command
- GIVEN an authenticated user
- WHEN they GET /api/tool-types/{id}
- THEN the response includes `startup_command` if set
