merge: align dev branch with main
This commit is contained in:
@@ -11,14 +11,8 @@ The system SHALL provide a `ToolType` model to store tool definitions.
|
||||
- `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
|
||||
|
||||
@@ -36,11 +30,8 @@ The system SHALL provide REST API endpoints for tool type management.
|
||||
- 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 the compose template YAML
|
||||
- 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: Get tool type
|
||||
@@ -53,14 +44,9 @@ The system SHALL provide REST API endpoints for tool type management.
|
||||
- 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 re-validates the compose template
|
||||
- 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
|
||||
|
||||
#### Scenario: Delete tool type
|
||||
- GIVEN an admin user
|
||||
- WHEN they DELETE /api/tool-types/{id}
|
||||
@@ -112,33 +98,3 @@ The system SHALL validate Docker Compose templates.
|
||||
- THEN the system SHALL require:
|
||||
- `services` key present
|
||||
- At least one service defined
|
||||
|
||||
### Requirement: Port requirement indication
|
||||
The system SHALL allow tool types to indicate whether they require port configuration.
|
||||
|
||||
#### Scenario: Web tool requires port
|
||||
- GIVEN a tool type with `interface_type` = "web"
|
||||
- WHEN the tool type is created or updated
|
||||
- THEN `requires_port` SHALL default to true
|
||||
- AND port-related configuration is shown in the UI
|
||||
|
||||
#### Scenario: Terminal tool does not require port
|
||||
- GIVEN a tool type with `interface_type` = "terminal"
|
||||
- WHEN the tool type is created or updated
|
||||
- THEN `requires_port` SHALL default to false
|
||||
- AND port-related configuration is hidden in the UI
|
||||
|
||||
### Requirement: Single interface validation
|
||||
The system SHALL enforce that each tool type has exactly one interface type.
|
||||
|
||||
#### Scenario: Invalid interface type
|
||||
- GIVEN a tool type creation request with `interface_type` = "invalid"
|
||||
- WHEN the request is processed
|
||||
- THEN the system returns 400 Bad Request
|
||||
- AND the error message indicates valid values are "web" or "terminal"
|
||||
|
||||
#### Scenario: Missing interface type
|
||||
- GIVEN a tool type creation request without `interface_type`
|
||||
- WHEN the request is processed
|
||||
- THEN the system returns 400 Bad Request
|
||||
- AND the error message indicates interface_type is required
|
||||
|
||||
Reference in New Issue
Block a user