diff --git a/apps/engine/docs/openapi.yaml b/apps/engine/docs/openapi.yaml index a594b387..2ffeaf70 100644 --- a/apps/engine/docs/openapi.yaml +++ b/apps/engine/docs/openapi.yaml @@ -686,6 +686,12 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" + "504": + description: Gateway Timeout + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" /v1/config: get: description: Get the Engine configuration @@ -1413,6 +1419,12 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" + "409": + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" "500": description: Internal Server Error content: @@ -1532,86 +1544,131 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" + "409": + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" "500": description: Internal Server Error content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - /v1/plugins: + "/v1/orgs/{org_id}/projects/{project_id}/scheduled_tools": get: security: - Bearer: [] - description: Returns all plugins for the current binding + description: Returns a page of scheduled tool executions tags: - - Plugins - summary: List plugins - operationId: plugins-list + - Tools + summary: List scheduled tool executions + operationId: tool-scheduled-list parameters: - - description: Limit + - description: Organization ID + name: org_id + in: path + required: true + schema: + type: string + - description: Project ID + name: project_id + in: path + required: true + schema: + type: string + - description: "Number of items to return (default: 25, max: 100)" name: limit in: query schema: type: integer - - description: Offset + - description: "Offset from the start of the list (default: 0)" name: offset in: query schema: type: integer - - description: Binding type filter (e.g., 'tenant') - name: binding_type - in: query - schema: - type: string responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/schemas.OffsetPage-schemas_PluginResponse" + $ref: "#/components/schemas/schemas.OffsetPage-schemas_ToolExecutionListRespons\ + e" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "415": + description: Unsupported Media Type + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" "500": description: Internal Server Error content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - post: + "/v1/orgs/{org_id}/projects/{project_id}/scheduled_tools/{id}": + get: security: - Bearer: [] - description: Creates a new plugin with optional inline hooks + description: Returns the details for a specific scheduled tool execution tags: - - Plugins - summary: Create a plugin - operationId: plugins-create - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/schemas.CreatePluginRequest" - description: Plugin configuration - required: true + - Tools + summary: Get scheduled tool execution details + operationId: tool-scheduled-get + parameters: + - description: Organization ID + name: org_id + in: path + required: true + schema: + type: string + - description: Project ID + name: project_id + in: path + required: true + schema: + type: string + - description: Scheduled execution ID + name: id + in: path + required: true + schema: + type: string responses: - "201": - description: Created + "200": + description: OK content: application/json: schema: - $ref: "#/components/schemas/schemas.CreatePluginResponse" + $ref: "#/components/schemas/schemas.ToolExecutionDetailResponse" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "409": - description: Conflict + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "415": + description: Unsupported Media Type content: application/json: schema: @@ -1622,37 +1679,99 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "/v1/plugins/{plugin_id}": + "/v1/orgs/{org_id}/projects/{project_id}/tool_executions": get: security: - Bearer: [] - description: Returns a single plugin by ID + description: Returns a paginated list of the project's tool executions tags: - - Plugins - summary: Get a plugin - operationId: plugins-get + - Tools + summary: List tool executions + operationId: tool-executions-list parameters: - - description: Plugin ID - name: plugin_id + - description: Organization ID + name: org_id in: path required: true schema: type: string + - description: Project ID + name: project_id + in: path + required: true + schema: + type: string + - description: "Number of items to return (default: 100, max: 25000)" + name: limit + in: query + schema: + type: integer + - description: "Offset from the start of the list (default: 0)" + name: offset + in: query + schema: + type: integer + - description: Filter by tool name (case-insensitive substring match) + name: tool_name + in: query + schema: + type: string + - description: Filter by exact toolkit name + name: toolkit_name + in: query + schema: + type: string + - description: Filter by the user the execution ran for + name: user_id + in: query + schema: + type: string + - description: Filter by outcome + name: outcome + in: query + schema: + type: string + enum: + - success + - failure + - description: Filter to runs with a failed attempt whose error message contains + this text (case-insensitive) + name: failure_reason + in: query + schema: + type: string + - description: Only executions recorded at or after this RFC 3339 timestamp + name: start_time + in: query + schema: + type: string + - description: Only executions recorded at or before this RFC 3339 timestamp + name: end_time + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/schemas.PluginResponse" + $ref: "#/components/schemas/schemas.OffsetPage-schemas_ToolExecutionListRespons\ + e" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "404": - description: Not Found + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "403": + description: Forbidden content: application/json: schema: @@ -1663,38 +1782,77 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" - delete: + "/v1/orgs/{org_id}/projects/{project_id}/tool_executions/count": + get: security: - Bearer: [] - description: Deletes a plugin by ID + description: Returns the number of the project's tool executions matching the filters tags: - - Plugins - summary: Delete a plugin - operationId: plugins-delete + - Tools + summary: Count tool executions + operationId: tool-executions-count parameters: - - description: Plugin ID - name: plugin_id + - description: Organization ID + name: org_id in: path required: true schema: type: string + - description: Project ID + name: project_id + in: path + required: true + schema: + type: string + - description: Filter by tool name (case-insensitive substring match) + name: tool_name + in: query + schema: + type: string + - description: Filter by exact toolkit name + name: toolkit_name + in: query + schema: + type: string + - description: Filter by outcome + name: outcome + in: query + schema: + type: string + enum: + - success + - failure + - description: Only executions recorded at or after this RFC 3339 timestamp + name: start_time + in: query + schema: + type: string + - description: Only executions recorded at or before this RFC 3339 timestamp + name: end_time + in: query + schema: + type: string responses: - "204": - description: No Content + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/api.ToolExecutionCountResponse" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "404": - description: Not Found + "401": + description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "409": - description: Conflict + "403": + description: Forbidden content: application/json: schema: @@ -1705,41 +1863,69 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" - patch: + "/v1/orgs/{org_id}/projects/{project_id}/tool_executions/{id}": + get: security: - Bearer: [] - description: Updates an existing plugin configuration + description: Returns the details for a single tool execution tags: - - Plugins - summary: Update a plugin - operationId: plugins-update + - Tools + summary: Get tool execution details + operationId: tool-executions-get parameters: - - description: Plugin ID - name: plugin_id + - description: Organization ID + name: org_id in: path required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/schemas.PatchPluginRequest" - description: Plugin configuration to update - required: true + - description: Project ID + name: project_id + in: path + required: true + schema: + type: string + - description: Tool execution ID + name: id + in: path + required: true + schema: + type: string + - description: "Include the tool inputs in the response (default: false)" + name: include_inputs + in: query + schema: + type: boolean + - description: "Include the tool outputs in the response (default: false)" + name: include_outputs + in: query + schema: + type: boolean responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/schemas.PluginResponse" + $ref: "#/components/schemas/schemas.ToolExecutionDetailResponse" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" "404": description: Not Found content: @@ -1752,48 +1938,80 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" - /v1/scheduled_tools: + /v1/plugins: get: security: - Bearer: [] - description: Returns a page of scheduled tool executions + description: Returns all plugins for the current binding tags: - - Tools - summary: List scheduled tool executions - operationId: tool-scheduled-list + - Plugins + summary: List plugins + operationId: plugins-list parameters: - - description: "Number of items to return (default: 25, max: 100)" + - description: Limit name: limit in: query schema: type: integer - - description: "Offset from the start of the list (default: 0)" + - description: Offset name: offset in: query schema: type: integer + - description: Binding type filter (e.g., 'tenant') + name: binding_type + in: query + schema: + type: string responses: "200": description: OK content: application/json: schema: - $ref: "#/components/schemas/schemas.OffsetPage-schemas_ToolExecutionListRespons\ - e" + $ref: "#/components/schemas/schemas.OffsetPage-schemas_PluginResponse" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "401": - description: Unauthorized + "500": + description: Internal Server Error content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "415": - description: Unsupported Media Type + post: + security: + - Bearer: [] + description: Creates a new plugin with optional inline hooks + tags: + - Plugins + summary: Create a plugin + operationId: plugins-create + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.CreatePluginRequest" + description: Plugin configuration + required: true + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.CreatePluginResponse" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "409": + description: Conflict content: application/json: schema: @@ -1804,18 +2022,18 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "/v1/scheduled_tools/{id}": + "/v1/plugins/{plugin_id}": get: security: - Bearer: [] - description: Returns the details for a specific scheduled tool execution + description: Returns a single plugin by ID tags: - - Tools - summary: Get scheduled tool execution details - operationId: tool-scheduled-get + - Plugins + summary: Get a plugin + operationId: plugins-get parameters: - - description: Scheduled execution ID - name: id + - description: Plugin ID + name: plugin_id in: path required: true schema: @@ -1826,21 +2044,104 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/schemas.ToolExecutionDetailResponse" + $ref: "#/components/schemas/schemas.PluginResponse" "400": description: Bad Request content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "401": - description: Unauthorized + "404": + description: Not Found content: application/json: schema: $ref: "#/components/schemas/schemas.Error" - "415": - description: Unsupported Media Type + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + delete: + security: + - Bearer: [] + description: Deletes a plugin by ID + tags: + - Plugins + summary: Delete a plugin + operationId: plugins-delete + parameters: + - description: Plugin ID + name: plugin_id + in: path + required: true + schema: + type: string + responses: + "204": + description: No Content + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "409": + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + patch: + security: + - Bearer: [] + description: Updates an existing plugin configuration + tags: + - Plugins + summary: Update a plugin + operationId: plugins-update + parameters: + - description: Plugin ID + name: plugin_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.PatchPluginRequest" + description: Plugin configuration to update + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.PluginResponse" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" + "404": + description: Not Found content: application/json: schema: @@ -2066,6 +2367,12 @@ paths: application/json: schema: $ref: "#/components/schemas/schemas.Error" + "504": + description: Gateway Timeout + content: + application/json: + schema: + $ref: "#/components/schemas/schemas.Error" /v1/tools/requirements: post: security: @@ -2486,6 +2793,11 @@ components: name: Authorization in: header schemas: + api.ToolExecutionCountResponse: + type: object + properties: + count: + type: integer auth.AuthorizationContext: type: object properties: @@ -3285,6 +3597,19 @@ components: schemas.Error: type: object properties: + field_errors: + description: >- + FieldErrors carries machine-actionable, per-field detail for a + request-body + + validation failure so a client can map each failure to a specific input + + field. It is empty (and omitted) for every other error, keeping Message + + the single source of truth for those. + type: array + items: + $ref: "#/components/schemas/schemas.FieldError" message: type: string name: @@ -3302,6 +3627,11 @@ components: description: JSON input to the tool, if any allOf: - $ref: "#/components/schemas/tool.RawInputs" + query_id: + description: Optional Condex selection query_id that surfaced this tool. When + set, the execution is correlated to the selection query as training + data. Ignored if empty. + type: string run_at: description: "The time at which the tool should be run (optional). If not provided, the tool is run immediately. Format ISO 8601: @@ -3342,6 +3672,30 @@ components: For scheduled requests, this will be true if the request was scheduled successfully. type: boolean + schemas.FieldError: + type: object + properties: + field: + description: >- + Field is the json field path of the offending value, rooted at the + request + + body with inline-embed levels flattened (e.g. "oauth2.token_request.endpoint"). + type: string + message: + description: Message is the human-readable, per-field explanation. + type: string + param: + description: >- + Param is the rule's parameter when it has one (e.g. "500" for max), + omitted + + otherwise. + type: string + rule: + description: Rule is the validation rule that failed (e.g. "required", "max", + "url"). + type: string schemas.GatewayResponse: type: object properties: @@ -4777,6 +5131,7 @@ components: type: boolean verifier_url: type: string + maxLength: 2048 schemas.UpdateToolFilterRequest: type: object properties: @@ -5325,8 +5680,6 @@ components: type: string inner_properties: type: object - additionalProperties: - $ref: "#/components/schemas/tool.ValueSchema" inner_required_keys: type: array items: @@ -5339,8 +5692,6 @@ components: type: boolean properties: type: object - additionalProperties: - $ref: "#/components/schemas/tool.ValueSchema" required_keys: type: array items: