diff --git a/openapi.json b/openapi.json index e66e163..040f14b 100644 --- a/openapi.json +++ b/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.1.0", "info": { "title": "Mission Control API", - "version": "1.2.0", + "version": "1.3.0", "description": "AI Agent Orchestration Platform API" }, "servers": [ @@ -75,9 +75,1656 @@ { "name": "Connections", "description": "Direct CLI tool connections" + }, + { + "name": "Projects", + "description": "Project management and task grouping" + }, + { + "name": "Mentions", + "description": "User and agent mention autocomplete" + }, + { + "name": "Quality", + "description": "Quality review gate for tasks" + }, + { + "name": "Releases", + "description": "Release and version checking" + }, + { + "name": "Docs", + "description": "API documentation" } ], "paths": { + "/api/activities": { + "get": { + "tags": [ + "Monitoring" + ], + "summary": "List activities", + "operationId": "listActivities", + "parameters": [ + { + "name": "type", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "actor", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "entity_type", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "Activity list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "activities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "entity_type": { + "type": "string" + }, + "entity_id": { + "type": "integer" + }, + "actor": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "created_at": { + "type": "integer" + } + } + } + }, + "total": { + "type": "integer" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + }, + "/api/agents": { + "get": { + "tags": [ + "Agents" + ], + "summary": "List agents", + "operationId": "listAgents", + "parameters": [ + { + "name": "status", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "online", + "offline", + "busy", + "idle", + "error" + ] + } + }, + { + "name": "role", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 50, + "maximum": 200 + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "Paginated agent list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Agent" + } + }, + "total": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "limit": { + "type": "integer" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Agents" + ], + "summary": "Create agent", + "operationId": "createAgent", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "session_key": { + "type": "string" + }, + "soul_content": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "online", + "offline", + "busy", + "idle", + "error" + ], + "default": "offline" + }, + "config": { + "type": "object" + }, + "template": { + "type": "string" + }, + "gateway_config": { + "type": "object" + }, + "write_to_gateway": { + "type": "boolean" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Agent created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agent": { + "$ref": "#/components/schemas/Agent" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "409": { + "description": "Agent name already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + }, + "put": { + "tags": [ + "Agents" + ], + "summary": "Update agent by name", + "operationId": "updateAgentByName", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "online", + "offline", + "busy", + "idle", + "error" + ] + }, + "last_activity": { + "type": "string" + }, + "config": { + "type": "object" + }, + "session_key": { + "type": "string" + }, + "soul_content": { + "type": "string" + }, + "role": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Agent updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + } + }, + "/api/agents/comms": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Get agent communications", + "operationId": "getAgentComms", + "parameters": [ + { + "name": "agent", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 50 + } + } + ], + "responses": { + "200": { + "description": "Agent communication log", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "from_agent": { + "type": "string" + }, + "to_agent": { + "type": "string" + }, + "content": { + "type": "string" + }, + "type": { + "type": "string" + }, + "created_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + }, + "/api/agents/message": { + "post": { + "tags": [ + "Agents" + ], + "summary": "Send message between agents", + "operationId": "sendAgentMessage", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "from", + "to", + "content" + ], + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + }, + "content": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Message sent", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "id": { + "type": "integer" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/agents/sync": { + "post": { + "tags": [ + "Agents" + ], + "summary": "Sync agents from gateway config", + "operationId": "syncAgents", + "responses": { + "200": { + "description": "Sync results", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "synced": { + "type": "integer" + }, + "created": { + "type": "integer" + }, + "updated": { + "type": "integer" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/agents/{id}": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Get agent by ID", + "operationId": "getAgent", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Agent details", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agent": { + "$ref": "#/components/schemas/Agent" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "put": { + "tags": [ + "Agents" + ], + "summary": "Update agent by ID", + "operationId": "updateAgent", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "status": { + "type": "string" + }, + "config": { + "type": "object" + }, + "session_key": { + "type": "string" + }, + "soul_content": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Agent updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agent": { + "$ref": "#/components/schemas/Agent" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + }, + "delete": { + "tags": [ + "Agents" + ], + "summary": "Delete agent", + "operationId": "deleteAgent", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Agent deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/agents/{id}/heartbeat": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Check agent work items", + "operationId": "getAgentHeartbeat", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Heartbeat data with pending work items", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agent": { + "type": "string" + }, + "pending_tasks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Task" + } + }, + "messages": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "post": { + "tags": [ + "Agents" + ], + "summary": "Trigger manual heartbeat", + "operationId": "triggerAgentHeartbeat", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Heartbeat triggered", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/agents/{id}/memory": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Get agent memory", + "operationId": "getAgentMemory", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Agent memory data", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "put": { + "tags": [ + "Agents" + ], + "summary": "Update agent memory", + "operationId": "updateAgentMemory", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Memory updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/agents/{id}/soul": { + "get": { + "tags": [ + "Agents" + ], + "summary": "Get agent soul config", + "operationId": "getAgentSoul", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Soul configuration", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "soul_content": { + "type": "string" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "put": { + "tags": [ + "Agents" + ], + "summary": "Update agent soul config", + "operationId": "updateAgentSoul", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "soul_content" + ], + "properties": { + "soul_content": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Soul updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/agents/{id}/wake": { + "post": { + "tags": [ + "Agents" + ], + "summary": "Wake an agent", + "operationId": "wakeAgent", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Agent woken", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "summary": "List alert rules", + "operationId": "listAlertRules", + "responses": { + "200": { + "description": "Alert rule list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AlertRule" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Alerts" + ], + "summary": "Create alert rule or evaluate rules", + "operationId": "createAlertRule", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "title": "CreateRule", + "required": [ + "name", + "entity_type", + "condition_field", + "condition_operator", + "condition_value" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "entity_type": { + "type": "string", + "enum": [ + "agent", + "task", + "session", + "activity" + ] + }, + "condition_field": { + "type": "string" + }, + "condition_operator": { + "type": "string", + "enum": [ + "equals", + "not_equals", + "greater_than", + "less_than", + "contains", + "count_above", + "count_below", + "age_minutes_above" + ] + }, + "condition_value": { + "type": "string" + }, + "action_type": { + "type": "string", + "default": "notification" + }, + "action_config": { + "type": "object" + }, + "cooldown_minutes": { + "type": "integer", + "default": 60 + } + } + }, + { + "type": "object", + "title": "EvaluateRules", + "required": [ + "action" + ], + "properties": { + "action": { + "type": "string", + "const": "evaluate" + } + } + } + ] + } + } + } + }, + "responses": { + "201": { + "description": "Rule created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "rule": { + "$ref": "#/components/schemas/AlertRule" + } + } + } + } + } + }, + "200": { + "description": "Rules evaluated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "evaluated": { + "type": "integer" + }, + "triggered": { + "type": "integer" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "rule_id": { + "type": "integer" + }, + "rule_name": { + "type": "string" + }, + "triggered": { + "type": "boolean" + }, + "reason": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + }, + "put": { + "tags": [ + "Alerts" + ], + "summary": "Update alert rule", + "operationId": "updateAlertRule", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "entity_type": { + "type": "string" + }, + "condition_field": { + "type": "string" + }, + "condition_operator": { + "type": "string" + }, + "condition_value": { + "type": "string" + }, + "action_type": { + "type": "string" + }, + "action_config": { + "type": "object" + }, + "cooldown_minutes": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Rule updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "rule": { + "$ref": "#/components/schemas/AlertRule" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + }, + "delete": { + "tags": [ + "Alerts" + ], + "summary": "Delete alert rule", + "operationId": "deleteAlertRule", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Rule deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + } + }, + "/api/audit": { + "get": { + "tags": [ + "Monitoring" + ], + "summary": "Get audit log", + "operationId": "getAuditLog", + "parameters": [ + { + "name": "action", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "actor", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 100 + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "Audit log entries", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "entries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "action": { + "type": "string" + }, + "actor": { + "type": "string" + }, + "target_type": { + "type": "string" + }, + "target_id": { + "type": "integer" + }, + "detail": { + "type": "object" + }, + "ip_address": { + "type": "string" + }, + "created_at": { + "type": "integer" + } + } + } + }, + "total": { + "type": "integer" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/auth/access-requests": { + "get": { + "tags": [ + "Auth" + ], + "summary": "List access requests", + "operationId": "listAccessRequests", + "responses": { + "200": { + "description": "Access request list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "requests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "approved", + "rejected" + ] + }, + "created_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + }, + "post": { + "tags": [ + "Auth" + ], + "summary": "Approve or reject access request", + "operationId": "handleAccessRequest", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "action" + ], + "properties": { + "id": { + "type": "integer" + }, + "action": { + "type": "string", + "enum": [ + "approve", + "reject" + ] + }, + "role": { + "type": "string", + "enum": [ + "admin", + "operator", + "viewer" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Request processed", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/auth/google": { + "get": { + "tags": [ + "Auth" + ], + "summary": "Google OAuth callback", + "operationId": "googleOAuthCallback", + "security": [], + "parameters": [ + { + "name": "code", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "state", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "302": { + "description": "Redirects to dashboard after successful auth" + }, + "400": { + "$ref": "#/components/responses/BadRequest" + } + } + } + }, "/api/auth/login": { "post": { "tags": [ @@ -434,22 +2081,60 @@ } } }, - "/api/auth/access-requests": { - "get": { + "/api/backup": { + "post": { "tags": [ - "Auth" + "Admin" ], - "summary": "List access requests", - "operationId": "listAccessRequests", + "summary": "Trigger backup", + "operationId": "triggerBackup", "responses": { "200": { - "description": "Access request list", + "description": "Backup completed", "content": { "application/json": { "schema": { "type": "object", "properties": { - "requests": { + "success": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "size_bytes": { + "type": "integer" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/chat/conversations": { + "get": { + "tags": [ + "Chat" + ], + "summary": "List conversations", + "operationId": "listConversations", + "responses": { + "200": { + "description": "Conversation list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "conversations": { "type": "array", "items": { "type": "object", @@ -457,23 +2142,473 @@ "id": { "type": "integer" }, - "username": { + "participants": { + "type": "array", + "items": { + "type": "string" + } + }, + "last_message": { "type": "string" }, - "email": { + "updated_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + }, + "/api/chat/messages": { + "get": { + "tags": [ + "Chat" + ], + "summary": "List messages", + "operationId": "listMessages", + "parameters": [ + { + "name": "conversation_id", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "integer", + "default": 0 + } + } + ], + "responses": { + "200": { + "description": "Message list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "conversation_id": { + "type": "integer" + }, + "sender": { "type": "string" }, - "reason": { + "content": { "type": "string" }, + "created_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Chat" + ], + "summary": "Send message", + "operationId": "sendMessage", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "conversation_id": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "recipient": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Message sent", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "object" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/chat/messages/{id}": { + "get": { + "tags": [ + "Chat" + ], + "summary": "Get message by ID", + "operationId": "getMessage", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Message details", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": [ + "Chat" + ], + "summary": "Delete message", + "operationId": "deleteMessage", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Message deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/claude/sessions": { + "get": { + "tags": [ + "Sessions" + ], + "summary": "List Claude CLI sessions", + "operationId": "listClaudeSessions", + "responses": { + "200": { + "description": "Session list" + } + } + }, + "post": { + "tags": [ + "Sessions" + ], + "summary": "Register a Claude CLI session", + "operationId": "registerClaudeSession", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "session_id": { + "type": "string" + }, + "agent_name": { + "type": "string" + }, + "model": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Session registered" + } + } + } + }, + "/api/cleanup": { + "post": { + "tags": [ + "Admin" + ], + "summary": "Trigger cleanup of old data", + "operationId": "triggerCleanup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "older_than_days": { + "type": "integer", + "default": 30 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Cleanup results", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "deleted": { + "type": "object" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/connect": { + "post": { + "tags": [ + "Connections" + ], + "summary": "Register a direct CLI connection", + "description": "Registers a CLI tool directly without a gateway. Auto-creates agent if name doesn't exist.", + "operationId": "registerConnection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "tool_name", + "agent_name" + ], + "properties": { + "tool_name": { + "type": "string" + }, + "tool_version": { + "type": "string" + }, + "agent_name": { + "type": "string" + }, + "agent_role": { + "type": "string" + }, + "metadata": { + "type": "object" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Connection registered", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connection_id": { + "type": "string", + "format": "uuid" + }, + "agent_id": { + "type": "integer" + }, + "agent_name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "connected" + ] + }, + "sse_url": { + "type": "string" + }, + "heartbeat_url": { + "type": "string" + }, + "token_report_url": { + "type": "string" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "get": { + "tags": [ + "Connections" + ], + "summary": "List all direct connections", + "operationId": "listConnections", + "responses": { + "200": { + "description": "List of connections", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "connections": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "agent_id": { + "type": "integer" + }, + "agent_name": { + "type": "string" + }, + "tool_name": { + "type": "string" + }, + "tool_version": { + "type": "string" + }, + "connection_id": { + "type": "string", + "format": "uuid" + }, "status": { "type": "string", "enum": [ - "pending", - "approved", - "rejected" + "connected", + "disconnected" ] }, + "last_heartbeat": { + "type": "integer" + }, "created_at": { "type": "integer" } @@ -485,6 +2620,127 @@ } } }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "delete": { + "tags": [ + "Connections" + ], + "summary": "Disconnect a CLI connection", + "operationId": "disconnectConnection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "connection_id" + ], + "properties": { + "connection_id": { + "type": "string", + "format": "uuid" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Disconnected", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "disconnected" + ] + }, + "connection_id": { + "type": "string" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/cron": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Get cron jobs", + "operationId": "getCronJobs", + "parameters": [ + { + "name": "action", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "list", + "logs" + ], + "default": "list" + } + } + ], + "responses": { + "200": { + "description": "Cron job list or logs", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "schedule": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "last_run": { + "type": "integer" + }, + "last_status": { + "type": "string" + } + } + } + } + } + } + } + } + }, "401": { "$ref": "#/components/responses/Unauthorized" }, @@ -495,10 +2751,10 @@ }, "post": { "tags": [ - "Auth" + "Admin" ], - "summary": "Approve or reject access request", - "operationId": "handleAccessRequest", + "summary": "Manage cron jobs", + "operationId": "manageCronJobs", "requestBody": { "required": true, "content": { @@ -506,225 +2762,28 @@ "schema": { "type": "object", "required": [ - "id", "action" ], "properties": { - "id": { - "type": "integer" - }, "action": { "type": "string", "enum": [ - "approve", - "reject" + "toggle", + "trigger", + "add", + "remove" ] }, - "role": { - "type": "string", - "enum": [ - "admin", - "operator", - "viewer" - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Request processed", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/auth/google": { - "get": { - "tags": [ - "Auth" - ], - "summary": "Google OAuth callback", - "operationId": "googleOAuthCallback", - "security": [], - "parameters": [ - { - "name": "code", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "state", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "302": { - "description": "Redirects to dashboard after successful auth" - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - } - } - }, - "/api/agents": { - "get": { - "tags": [ - "Agents" - ], - "summary": "List agents", - "operationId": "listAgents", - "parameters": [ - { - "name": "status", - "in": "query", - "schema": { - "type": "string", - "enum": [ - "online", - "offline", - "busy", - "idle", - "error" - ] - } - }, - { - "name": "role", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 50, - "maximum": 200 - } - }, - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "Paginated agent list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "agents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Agent" - } - }, - "total": { - "type": "integer" - }, - "page": { - "type": "integer" - }, - "limit": { - "type": "integer" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Agents" - ], - "summary": "Create agent", - "operationId": "createAgent", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name", - "role" - ], - "properties": { "name": { "type": "string" }, - "role": { + "schedule": { "type": "string" }, - "session_key": { + "command": { "type": "string" }, - "soul_content": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "online", - "offline", - "busy", - "idle", - "error" - ], - "default": "offline" - }, - "config": { - "type": "object" - }, - "template": { - "type": "string" - }, - "gateway_config": { - "type": "object" - }, - "write_to_gateway": { + "enabled": { "type": "boolean" } } @@ -732,98 +2791,9 @@ } } }, - "responses": { - "201": { - "description": "Agent created", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "agent": { - "$ref": "#/components/schemas/Agent" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "409": { - "description": "Agent name already exists", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "429": { - "$ref": "#/components/responses/RateLimited" - } - } - }, - "put": { - "tags": [ - "Agents" - ], - "summary": "Update agent by name", - "operationId": "updateAgentByName", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "online", - "offline", - "busy", - "idle", - "error" - ] - }, - "last_activity": { - "type": "string" - }, - "config": { - "type": "object" - }, - "session_key": { - "type": "string" - }, - "soul_content": { - "type": "string" - }, - "role": { - "type": "string" - } - } - } - } - } - }, "responses": { "200": { - "description": "Agent updated", + "description": "Action applied", "content": { "application/json": { "schema": { @@ -845,115 +2815,95 @@ }, "403": { "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "429": { - "$ref": "#/components/responses/RateLimited" } } } }, - "/api/agents/{id}": { + "/api/docs": { "get": { "tags": [ - "Agents" - ], - "summary": "Get agent by ID", - "operationId": "getAgent", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } + "Docs" ], + "summary": "Get OpenAPI specification", + "operationId": "getOpenApiSpec", + "security": [], "responses": { "200": { - "description": "Agent details", + "description": "OpenAPI 3.1 JSON spec" + } + } + } + }, + "/api/events": { + "get": { + "tags": [ + "Monitoring" + ], + "summary": "SSE stream for real-time events", + "operationId": "getEventStream", + "responses": { + "200": { + "description": "Server-Sent Events stream", "content": { - "application/json": { + "text/event-stream": { "schema": { - "type": "object", - "properties": { - "agent": { - "$ref": "#/components/schemas/Agent" - } - } + "type": "string" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" - }, - "404": { - "$ref": "#/components/responses/NotFound" } } - }, - "put": { + } + }, + "/api/export": { + "get": { "tags": [ - "Agents" + "Admin" ], - "summary": "Update agent by ID", - "operationId": "updateAgent", + "summary": "Export data", + "operationId": "exportData", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "type", + "in": "query", "schema": { - "type": "integer" + "type": "string", + "enum": [ + "tasks", + "agents", + "activities", + "all" + ] + } + }, + { + "name": "format", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "json", + "csv" + ], + "default": "json" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "status": { - "type": "string" - }, - "config": { - "type": "object" - }, - "session_key": { - "type": "string" - }, - "soul_content": { - "type": "string" - } - } - } - } - } - }, "responses": { "200": { - "description": "Agent updated", + "description": "Exported data", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "agent": { - "$ref": "#/components/schemas/Agent" - } - } + "type": "object" + } + }, + "text/csv": { + "schema": { + "type": "string" } } } @@ -963,276 +2913,20 @@ }, "403": { "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "429": { - "$ref": "#/components/responses/RateLimited" - } - } - }, - "delete": { - "tags": [ - "Agents" - ], - "summary": "Delete agent", - "operationId": "deleteAgent", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Agent deleted", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" } } } }, - "/api/agents/{id}/heartbeat": { + "/api/gateway-config": { "get": { "tags": [ - "Agents" - ], - "summary": "Check agent work items", - "operationId": "getAgentHeartbeat", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } + "Admin" ], + "summary": "Read gateway config", + "operationId": "getGatewayConfig", "responses": { "200": { - "description": "Heartbeat data with pending work items", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "agent": { - "type": "string" - }, - "pending_tasks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Task" - } - }, - "messages": { - "type": "array", - "items": { - "type": "object" - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - }, - "post": { - "tags": [ - "Agents" - ], - "summary": "Trigger manual heartbeat", - "operationId": "triggerAgentHeartbeat", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Heartbeat triggered", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/agents/{id}/soul": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Get agent soul config", - "operationId": "getAgentSoul", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Soul configuration", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "soul_content": { - "type": "string" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - }, - "put": { - "tags": [ - "Agents" - ], - "summary": "Update agent soul config", - "operationId": "updateAgentSoul", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "soul_content" - ], - "properties": { - "soul_content": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Soul updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/agents/{id}/memory": { - "get": { - "tags": [ - "Agents" - ], - "summary": "Get agent memory", - "operationId": "getAgentMemory", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Agent memory data", + "description": "Gateway configuration", "content": { "application/json": { "schema": { @@ -1244,27 +2938,17 @@ "401": { "$ref": "#/components/responses/Unauthorized" }, - "404": { - "$ref": "#/components/responses/NotFound" + "403": { + "$ref": "#/components/responses/Forbidden" } } }, - "put": { + "post": { "tags": [ - "Agents" - ], - "summary": "Update agent memory", - "operationId": "updateAgentMemory", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } + "Admin" ], + "summary": "Update gateway config", + "operationId": "updateGatewayConfig", "requestBody": { "required": true, "content": { @@ -1275,6 +2959,559 @@ } } }, + "responses": { + "200": { + "description": "Config updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/gateways": { + "get": { + "tags": [ + "Admin" + ], + "summary": "List gateways", + "operationId": "listGateways", + "responses": { + "200": { + "description": "Gateway list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "gateways": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + }, + "last_health_check": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Admin" + ], + "summary": "Add gateway", + "operationId": "addGateway", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name", + "url" + ], + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Gateway added", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + }, + "put": { + "tags": [ + "Admin" + ], + "summary": "Update gateway", + "operationId": "updateGateway", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Gateway updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": [ + "Admin" + ], + "summary": "Delete gateway", + "operationId": "deleteGateway", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Gateway deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/gateways/health": { + "post": { + "tags": [ + "Admin" + ], + "summary": "Probe gateway health", + "operationId": "probeGatewayHealth", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "gateway_id": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Health check results", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "healthy": { + "type": "boolean" + }, + "latency_ms": { + "type": "number" + }, + "details": { + "type": "object" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/github": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Get GitHub integration status", + "operationId": "getGithubStatus", + "responses": { + "200": { + "description": "GitHub integration status" + } + } + }, + "post": { + "tags": [ + "Admin" + ], + "summary": "Sync GitHub issues", + "operationId": "syncGithubIssues", + "responses": { + "200": { + "description": "Sync result" + } + } + } + }, + "/api/integrations": { + "get": { + "tags": [ + "Admin" + ], + "summary": "List integrations", + "operationId": "listIntegrations", + "responses": { + "200": { + "description": "Integration list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "integrations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "config": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Admin" + ], + "summary": "Integration actions (enable, disable, test, configure)", + "operationId": "integrationAction", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "action", + "id" + ], + "properties": { + "action": { + "type": "string", + "enum": [ + "enable", + "disable", + "test", + "configure" + ] + }, + "id": { + "type": "string" + }, + "config": { + "type": "object" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Action applied", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/logs": { + "get": { + "tags": [ + "Monitoring" + ], + "summary": "Get system logs", + "operationId": "getSystemLogs", + "parameters": [ + { + "name": "level", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "info", + "warn", + "error", + "debug" + ] + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 100 + } + } + ], + "responses": { + "200": { + "description": "Log entries", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "logs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "timestamp": { + "type": "string" + }, + "level": { + "type": "string" + }, + "message": { + "type": "string" + }, + "source": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/memory": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Get memory files", + "operationId": "getMemoryFiles", + "parameters": [ + { + "name": "path", + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Memory file contents", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Admin" + ], + "summary": "Update memory file", + "operationId": "updateMemoryFile", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "path", + "content" + ], + "properties": { + "path": { + "type": "string" + }, + "content": { + "type": "string" + } + } + } + } + } + }, "responses": { "200": { "description": "Memory updated", @@ -1296,37 +3533,167 @@ }, "403": { "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" } } } }, - "/api/agents/{id}/wake": { - "post": { + "/api/mentions": { + "get": { "tags": [ - "Agents" + "Mentions" ], - "summary": "Wake an agent", - "operationId": "wakeAgent", + "summary": "Get mention autocomplete targets", + "operationId": "getMentionTargets", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "q", + "in": "query", "schema": { - "type": "integer" + "type": "string" + }, + "description": "Search query" + }, + { + "name": "type", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "user", + "agent" + ] + }, + "description": "Filter by type" + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 20 + }, + "description": "Max results" + } + ], + "responses": { + "200": { + "description": "Mention targets list" + } + } + } + }, + "/api/notifications": { + "get": { + "tags": [ + "Monitoring" + ], + "summary": "List notifications", + "operationId": "listNotifications", + "parameters": [ + { + "name": "recipient", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "unread", + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 50 } } ], + "responses": { + "200": { + "description": "Notification list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "recipient": { + "type": "string" + }, + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "message": { + "type": "string" + }, + "read": { + "type": "boolean" + }, + "source_type": { + "type": "string" + }, + "source_id": { + "type": "integer" + }, + "created_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Monitoring" + ], + "summary": "Notification actions (mark read, dismiss)", + "operationId": "notificationAction", "requestBody": { + "required": true, "content": { "application/json": { "schema": { "type": "object", + "required": [ + "action" + ], "properties": { - "reason": { + "action": { + "type": "string", + "enum": [ + "mark_read", + "mark_all_read", + "dismiss" + ] + }, + "id": { + "type": "integer" + }, + "recipient": { "type": "string" } } @@ -1336,7 +3703,7 @@ }, "responses": { "200": { - "description": "Agent woken", + "description": "Action applied", "content": { "application/json": { "schema": { @@ -1350,25 +3717,22 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" } } } }, - "/api/agents/message": { + "/api/notifications/deliver": { "post": { "tags": [ - "Agents" + "Monitoring" ], - "summary": "Send message between agents", - "operationId": "sendAgentMessage", + "summary": "Deliver notification to agent", + "operationId": "deliverNotification", "requestBody": { "required": true, "content": { @@ -1376,18 +3740,18 @@ "schema": { "type": "object", "required": [ - "from", - "to", - "content" + "agent", + "title", + "message" ], "properties": { - "from": { + "agent": { "type": "string" }, - "to": { + "title": { "type": "string" }, - "content": { + "message": { "type": "string" }, "type": { @@ -1400,7 +3764,7 @@ }, "responses": { "200": { - "description": "Message sent", + "description": "Notification delivered", "content": { "application/json": { "schema": { @@ -1408,9 +3772,6 @@ "properties": { "success": { "type": "boolean" - }, - "id": { - "type": "integer" } } } @@ -1429,13 +3790,793 @@ } } }, - "/api/agents/comms": { + "/api/pipelines": { "get": { "tags": [ - "Agents" + "Pipelines" ], - "summary": "Get agent communications", - "operationId": "getAgentComms", + "summary": "List pipelines", + "operationId": "listPipelines", + "responses": { + "200": { + "description": "Pipeline list with enriched step data and run counts", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pipelines": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "template_id": { + "type": "integer" + }, + "template_name": { + "type": "string" + }, + "on_failure": { + "type": "string", + "enum": [ + "stop", + "continue" + ] + } + } + } + }, + "created_by": { + "type": "string" + }, + "use_count": { + "type": "integer" + }, + "runs": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "completed": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "running": { + "type": "integer" + } + } + }, + "created_at": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + }, + "post": { + "tags": [ + "Pipelines" + ], + "summary": "Create pipeline", + "operationId": "createPipeline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name", + "steps" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "required": [ + "template_id" + ], + "properties": { + "template_id": { + "type": "integer" + }, + "on_failure": { + "type": "string", + "enum": [ + "stop", + "continue" + ], + "default": "stop" + } + } + } + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Pipeline created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pipeline": { + "type": "object" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + } + }, + "put": { + "tags": [ + "Pipelines" + ], + "summary": "Update pipeline", + "operationId": "updatePipeline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Pipeline updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pipeline": { + "type": "object" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + }, + "delete": { + "tags": [ + "Pipelines" + ], + "summary": "Delete pipeline", + "operationId": "deletePipeline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Pipeline deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/pipelines/run": { + "post": { + "tags": [ + "Pipelines" + ], + "summary": "Run a pipeline", + "operationId": "runPipeline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "pipeline_id" + ], + "properties": { + "pipeline_id": { + "type": "integer" + }, + "params": { + "type": "object" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Pipeline run started", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "run_id": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/projects": { + "get": { + "tags": [ + "Projects" + ], + "summary": "List all projects", + "operationId": "listProjects", + "responses": { + "200": { + "description": "Project list" + } + } + }, + "post": { + "tags": [ + "Projects" + ], + "summary": "Create a new project", + "operationId": "createProject", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Project created" + } + } + } + }, + "/api/projects/{id}": { + "get": { + "tags": [ + "Projects" + ], + "summary": "Get project by ID", + "operationId": "getProject", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Project details" + } + } + }, + "patch": { + "tags": [ + "Projects" + ], + "summary": "Update a project", + "operationId": "updateProject", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Updated" + } + } + }, + "delete": { + "tags": [ + "Projects" + ], + "summary": "Delete a project", + "operationId": "deleteProject", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Deleted" + } + } + } + }, + "/api/projects/{id}/tasks": { + "get": { + "tags": [ + "Projects" + ], + "summary": "List tasks in a project", + "operationId": "listProjectTasks", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Tasks in project" + } + } + } + }, + "/api/quality-review": { + "get": { + "tags": [ + "Quality" + ], + "summary": "List quality reviews", + "operationId": "listQualityReviews", + "parameters": [ + { + "name": "task_id", + "in": "query", + "schema": { + "type": "integer" + }, + "description": "Filter by task" + } + ], + "responses": { + "200": { + "description": "Quality review list" + } + } + }, + "post": { + "tags": [ + "Quality" + ], + "summary": "Submit a quality review", + "operationId": "submitQualityReview", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "task_id", + "status" + ], + "properties": { + "task_id": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "approved", + "rejected" + ] + }, + "notes": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Review submitted" + } + } + } + }, + "/api/releases/check": { + "get": { + "tags": [ + "Releases" + ], + "summary": "Check for new releases", + "operationId": "checkReleases", + "security": [], + "responses": { + "200": { + "description": "Release info with version comparison" + } + } + } + }, + "/api/scheduler": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Get scheduler status", + "operationId": "getSchedulerStatus", + "responses": { + "200": { + "description": "Scheduler status and registered tasks", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "running": { + "type": "boolean" + }, + "tasks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "interval": { + "type": "string" + }, + "last_run": { + "type": "integer" + }, + "next_run": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + }, + "post": { + "tags": [ + "Admin" + ], + "summary": "Trigger scheduled task", + "operationId": "triggerScheduledTask", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "task" + ], + "properties": { + "task": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Task triggered", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "result": { + "type": "object" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/search": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Full-text search", + "operationId": "search", + "parameters": [ + { + "name": "q", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "schema": { + "type": "string", + "enum": [ + "tasks", + "agents", + "activities", + "all" + ] + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "integer", + "default": 20 + } + } + ], + "responses": { + "200": { + "description": "Search results", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "snippet": { + "type": "string" + }, + "score": { + "type": "number" + } + } + } + }, + "total": { + "type": "integer" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + }, + "/api/sessions": { + "get": { + "tags": [ + "Sessions" + ], + "summary": "List gateway sessions", + "operationId": "listSessions", "parameters": [ { "name": "agent", @@ -1455,33 +4596,33 @@ ], "responses": { "200": { - "description": "Agent communication log", + "description": "Session list", "content": { "application/json": { "schema": { "type": "object", "properties": { - "messages": { + "sessions": { "type": "array", "items": { "type": "object", "properties": { - "id": { + "key": { + "type": "string" + }, + "agent": { + "type": "string" + }, + "model": { + "type": "string" + }, + "status": { + "type": "string" + }, + "totalTokens": { "type": "integer" }, - "from_agent": { - "type": "string" - }, - "to_agent": { - "type": "string" - }, - "content": { - "type": "string" - }, - "type": { - "type": "string" - }, - "created_at": { + "updatedAt": { "type": "integer" } } @@ -1498,29 +4639,94 @@ } } }, - "/api/agents/sync": { + "/api/sessions/{id}/control": { "post": { "tags": [ - "Agents" + "Sessions" ], - "summary": "Sync agents from gateway config", - "operationId": "syncAgents", + "summary": "Control session (pause/resume/kill)", + "operationId": "controlSession", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "action" + ], + "properties": { + "action": { + "type": "string", + "enum": [ + "pause", + "resume", + "kill" + ] + } + } + } + } + } + }, "responses": { "200": { - "description": "Sync results", + "description": "Action applied", "content": { "application/json": { "schema": { "type": "object", "properties": { - "synced": { - "type": "integer" - }, - "created": { - "type": "integer" - }, - "updated": { - "type": "integer" + "success": { + "type": "boolean" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/settings": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Get application settings", + "operationId": "getSettings", + "responses": { + "200": { + "description": "Current settings", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "settings": { + "type": "object" } } } @@ -1534,6 +4740,596 @@ "$ref": "#/components/responses/Forbidden" } } + }, + "post": { + "tags": [ + "Admin" + ], + "summary": "Update settings", + "operationId": "updateSettings", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Settings updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/spawn": { + "post": { + "tags": [ + "Admin" + ], + "summary": "Spawn agent process", + "operationId": "spawnAgent", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "agent" + ], + "properties": { + "agent": { + "type": "string" + }, + "task": { + "type": "string" + }, + "params": { + "type": "object" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Agent spawned", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "session_id": { + "type": "string" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/standup": { + "get": { + "tags": [ + "Admin" + ], + "summary": "Get standup report", + "operationId": "getStandupReport", + "parameters": [ + { + "name": "date", + "in": "query", + "schema": { + "type": "string", + "format": "date" + } + } + ], + "responses": { + "200": { + "description": "Standup report", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "agents": { + "type": "array", + "items": { + "type": "object" + } + }, + "tasks_completed": { + "type": "integer" + }, + "tasks_in_progress": { + "type": "integer" + }, + "highlights": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + } + } + } + }, + "/api/status": { + "get": { + "tags": [ + "Monitoring" + ], + "summary": "Get system status", + "operationId": "getSystemStatus", + "security": [], + "responses": { + "200": { + "description": "System health status", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "ok", + "degraded", + "down" + ] + }, + "version": { + "type": "string" + }, + "uptime": { + "type": "integer" + }, + "agents": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "online": { + "type": "integer" + } + } + }, + "tasks": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "in_progress": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + }, + "/api/super/provision-jobs": { + "get": { + "tags": [ + "Super Admin" + ], + "summary": "List provision jobs", + "operationId": "listProvisionJobs", + "responses": { + "200": { + "description": "Provision job list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "tenant_id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "running", + "completed", + "failed" + ] + }, + "output": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "completed_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + }, + "post": { + "tags": [ + "Super Admin" + ], + "summary": "Create provision job", + "operationId": "createProvisionJob", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "tenant_id", + "type" + ], + "properties": { + "tenant_id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "params": { + "type": "object" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Job created", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + } + }, + "/api/super/provision-jobs/{id}": { + "get": { + "tags": [ + "Super Admin" + ], + "summary": "Get provision job details", + "operationId": "getProvisionJob", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Job details", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/super/provision-jobs/{id}/run": { + "post": { + "tags": [ + "Super Admin" + ], + "summary": "Run provision job", + "operationId": "runProvisionJob", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Job started", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, + "/api/super/tenants": { + "get": { + "tags": [ + "Super Admin" + ], + "summary": "List tenants", + "operationId": "listTenants", + "responses": { + "200": { + "description": "Tenant list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tenants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "slug": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "linux_user": { + "type": "string" + }, + "created_at": { + "type": "integer" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + } + } + }, + "post": { + "tags": [ + "Super Admin" + ], + "summary": "Create tenant and bootstrap job", + "operationId": "createTenant", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "slug", + "name" + ], + "properties": { + "slug": { + "type": "string" + }, + "name": { + "type": "string" + }, + "linux_user": { + "type": "string" + }, + "config": { + "type": "object" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Tenant created with bootstrap job", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "409": { + "description": "Tenant slug or linux user already exists", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/api/super/tenants/{id}/decommission": { + "post": { + "tags": [ + "Super Admin" + ], + "summary": "Decommission tenant", + "operationId": "decommissionTenant", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Tenant decommissioned", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } } }, "/api/tasks": { @@ -1991,6 +5787,77 @@ } } }, + "/api/tasks/{id}/broadcast": { + "post": { + "tags": [ + "Tasks" + ], + "summary": "Broadcast task to agents", + "operationId": "broadcastTask", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agents": { + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Task broadcast sent", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "delivered_to": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthorized" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "404": { + "$ref": "#/components/responses/NotFound" + } + } + } + }, "/api/tasks/{id}/comments": { "get": { "tags": [ @@ -2120,337 +5987,6 @@ } } }, - "/api/tasks/{id}/broadcast": { - "post": { - "tags": [ - "Tasks" - ], - "summary": "Broadcast task to agents", - "operationId": "broadcastTask", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "agents": { - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Task broadcast sent", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "delivered_to": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/chat/conversations": { - "get": { - "tags": [ - "Chat" - ], - "summary": "List conversations", - "operationId": "listConversations", - "responses": { - "200": { - "description": "Conversation list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "conversations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "participants": { - "type": "array", - "items": { - "type": "string" - } - }, - "last_message": { - "type": "string" - }, - "updated_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/chat/messages": { - "get": { - "tags": [ - "Chat" - ], - "summary": "List messages", - "operationId": "listMessages", - "parameters": [ - { - "name": "conversation_id", - "in": "query", - "schema": { - "type": "integer" - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "Message list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "conversation_id": { - "type": "integer" - }, - "sender": { - "type": "string" - }, - "content": { - "type": "string" - }, - "created_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Chat" - ], - "summary": "Send message", - "operationId": "sendMessage", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "conversation_id": { - "type": "integer" - }, - "content": { - "type": "string" - }, - "recipient": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "201": { - "description": "Message sent", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "object" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/chat/messages/{id}": { - "get": { - "tags": [ - "Chat" - ], - "summary": "Get message by ID", - "operationId": "getMessage", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Message details", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - }, - "delete": { - "tags": [ - "Chat" - ], - "summary": "Delete message", - "operationId": "deleteMessage", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Message deleted", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, "/api/tokens": { "get": { "tags": [ @@ -2677,146 +6213,6 @@ } } }, - "/api/sessions": { - "get": { - "tags": [ - "Sessions" - ], - "summary": "List gateway sessions", - "operationId": "listSessions", - "parameters": [ - { - "name": "agent", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 50 - } - } - ], - "responses": { - "200": { - "description": "Session list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "sessions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "agent": { - "type": "string" - }, - "model": { - "type": "string" - }, - "status": { - "type": "string" - }, - "totalTokens": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/sessions/{id}/control": { - "post": { - "tags": [ - "Sessions" - ], - "summary": "Control session (pause/resume/kill)", - "operationId": "controlSession", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "action" - ], - "properties": { - "action": { - "type": "string", - "enum": [ - "pause", - "resume", - "kill" - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Action applied", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, "/api/webhooks": { "get": { "tags": [ @@ -3157,6 +6553,38 @@ } } }, + "/api/webhooks/retry": { + "post": { + "tags": [ + "Webhooks" + ], + "summary": "Retry a failed webhook delivery", + "operationId": "retryWebhookDelivery", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "delivery_id" + ], + "properties": { + "delivery_id": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Delivery retried" + } + } + } + }, "/api/webhooks/test": { "post": { "tags": [ @@ -3216,331 +6644,16 @@ } } }, - "/api/alerts": { + "/api/webhooks/verify-docs": { "get": { "tags": [ - "Alerts" + "Webhooks" ], - "summary": "List alert rules", - "operationId": "listAlertRules", + "summary": "Get webhook verification documentation", + "operationId": "getWebhookVerifyDocs", "responses": { "200": { - "description": "Alert rule list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AlertRule" - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Alerts" - ], - "summary": "Create alert rule or evaluate rules", - "operationId": "createAlertRule", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "object", - "title": "CreateRule", - "required": [ - "name", - "entity_type", - "condition_field", - "condition_operator", - "condition_value" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "entity_type": { - "type": "string", - "enum": [ - "agent", - "task", - "session", - "activity" - ] - }, - "condition_field": { - "type": "string" - }, - "condition_operator": { - "type": "string", - "enum": [ - "equals", - "not_equals", - "greater_than", - "less_than", - "contains", - "count_above", - "count_below", - "age_minutes_above" - ] - }, - "condition_value": { - "type": "string" - }, - "action_type": { - "type": "string", - "default": "notification" - }, - "action_config": { - "type": "object" - }, - "cooldown_minutes": { - "type": "integer", - "default": 60 - } - } - }, - { - "type": "object", - "title": "EvaluateRules", - "required": [ - "action" - ], - "properties": { - "action": { - "type": "string", - "const": "evaluate" - } - } - } - ] - } - } - } - }, - "responses": { - "201": { - "description": "Rule created", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "rule": { - "$ref": "#/components/schemas/AlertRule" - } - } - } - } - } - }, - "200": { - "description": "Rules evaluated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "evaluated": { - "type": "integer" - }, - "triggered": { - "type": "integer" - }, - "results": { - "type": "array", - "items": { - "type": "object", - "properties": { - "rule_id": { - "type": "integer" - }, - "rule_name": { - "type": "string" - }, - "triggered": { - "type": "boolean" - }, - "reason": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "429": { - "$ref": "#/components/responses/RateLimited" - } - } - }, - "put": { - "tags": [ - "Alerts" - ], - "summary": "Update alert rule", - "operationId": "updateAlertRule", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "entity_type": { - "type": "string" - }, - "condition_field": { - "type": "string" - }, - "condition_operator": { - "type": "string" - }, - "condition_value": { - "type": "string" - }, - "action_type": { - "type": "string" - }, - "action_config": { - "type": "object" - }, - "cooldown_minutes": { - "type": "integer" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Rule updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "rule": { - "$ref": "#/components/schemas/AlertRule" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - }, - "429": { - "$ref": "#/components/responses/RateLimited" - } - } - }, - "delete": { - "tags": [ - "Alerts" - ], - "summary": "Delete alert rule", - "operationId": "deleteAlertRule", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Rule deleted", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "deleted": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "429": { - "$ref": "#/components/responses/RateLimited" + "description": "Verification guide and examples" } } } @@ -3797,2684 +6910,6 @@ } } } - }, - "/api/pipelines": { - "get": { - "tags": [ - "Pipelines" - ], - "summary": "List pipelines", - "operationId": "listPipelines", - "responses": { - "200": { - "description": "Pipeline list with enriched step data and run counts", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "pipelines": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "type": "object", - "properties": { - "template_id": { - "type": "integer" - }, - "template_name": { - "type": "string" - }, - "on_failure": { - "type": "string", - "enum": [ - "stop", - "continue" - ] - } - } - } - }, - "created_by": { - "type": "string" - }, - "use_count": { - "type": "integer" - }, - "runs": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "completed": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "running": { - "type": "integer" - } - } - }, - "created_at": { - "type": "integer" - }, - "updated_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Pipelines" - ], - "summary": "Create pipeline", - "operationId": "createPipeline", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name", - "steps" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "type": "object", - "required": [ - "template_id" - ], - "properties": { - "template_id": { - "type": "integer" - }, - "on_failure": { - "type": "string", - "enum": [ - "stop", - "continue" - ], - "default": "stop" - } - } - } - } - } - } - } - } - }, - "responses": { - "201": { - "description": "Pipeline created", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "pipeline": { - "type": "object" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "429": { - "$ref": "#/components/responses/RateLimited" - } - } - }, - "put": { - "tags": [ - "Pipelines" - ], - "summary": "Update pipeline", - "operationId": "updatePipeline", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "type": "object" - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Pipeline updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "pipeline": { - "type": "object" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - }, - "delete": { - "tags": [ - "Pipelines" - ], - "summary": "Delete pipeline", - "operationId": "deletePipeline", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Pipeline deleted", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/pipelines/run": { - "post": { - "tags": [ - "Pipelines" - ], - "summary": "Run a pipeline", - "operationId": "runPipeline", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "pipeline_id" - ], - "properties": { - "pipeline_id": { - "type": "integer" - }, - "params": { - "type": "object" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Pipeline run started", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "run_id": { - "type": "integer" - }, - "status": { - "type": "string" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/activities": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "List activities", - "operationId": "listActivities", - "parameters": [ - { - "name": "type", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "actor", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "entity_type", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 50 - } - }, - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "Activity list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "activities": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "type": { - "type": "string" - }, - "entity_type": { - "type": "string" - }, - "entity_id": { - "type": "integer" - }, - "actor": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "created_at": { - "type": "integer" - } - } - } - }, - "total": { - "type": "integer" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/audit": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Get audit log", - "operationId": "getAuditLog", - "parameters": [ - { - "name": "action", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "actor", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 100 - } - }, - { - "name": "offset", - "in": "query", - "schema": { - "type": "integer", - "default": 0 - } - } - ], - "responses": { - "200": { - "description": "Audit log entries", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "entries": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "action": { - "type": "string" - }, - "actor": { - "type": "string" - }, - "target_type": { - "type": "string" - }, - "target_id": { - "type": "integer" - }, - "detail": { - "type": "object" - }, - "ip_address": { - "type": "string" - }, - "created_at": { - "type": "integer" - } - } - } - }, - "total": { - "type": "integer" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/logs": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Get system logs", - "operationId": "getSystemLogs", - "parameters": [ - { - "name": "level", - "in": "query", - "schema": { - "type": "string", - "enum": [ - "info", - "warn", - "error", - "debug" - ] - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Log entries", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "timestamp": { - "type": "string" - }, - "level": { - "type": "string" - }, - "message": { - "type": "string" - }, - "source": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/notifications": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "List notifications", - "operationId": "listNotifications", - "parameters": [ - { - "name": "recipient", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "unread", - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 50 - } - } - ], - "responses": { - "200": { - "description": "Notification list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "notifications": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "recipient": { - "type": "string" - }, - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "read": { - "type": "boolean" - }, - "source_type": { - "type": "string" - }, - "source_id": { - "type": "integer" - }, - "created_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Monitoring" - ], - "summary": "Notification actions (mark read, dismiss)", - "operationId": "notificationAction", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "action" - ], - "properties": { - "action": { - "type": "string", - "enum": [ - "mark_read", - "mark_all_read", - "dismiss" - ] - }, - "id": { - "type": "integer" - }, - "recipient": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Action applied", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/notifications/deliver": { - "post": { - "tags": [ - "Monitoring" - ], - "summary": "Deliver notification to agent", - "operationId": "deliverNotification", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "agent", - "title", - "message" - ], - "properties": { - "agent": { - "type": "string" - }, - "title": { - "type": "string" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Notification delivered", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/events": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "SSE stream for real-time events", - "operationId": "getEventStream", - "responses": { - "200": { - "description": "Server-Sent Events stream", - "content": { - "text/event-stream": { - "schema": { - "type": "string" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/status": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Get system status", - "operationId": "getSystemStatus", - "security": [], - "responses": { - "200": { - "description": "System health status", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "ok", - "degraded", - "down" - ] - }, - "version": { - "type": "string" - }, - "uptime": { - "type": "integer" - }, - "agents": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "online": { - "type": "integer" - } - } - }, - "tasks": { - "type": "object", - "properties": { - "total": { - "type": "integer" - }, - "in_progress": { - "type": "integer" - } - } - } - } - } - } - } - } - } - } - }, - "/api/settings": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Get application settings", - "operationId": "getSettings", - "responses": { - "200": { - "description": "Current settings", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "settings": { - "type": "object" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Update settings", - "operationId": "updateSettings", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Settings updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/scheduler": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Get scheduler status", - "operationId": "getSchedulerStatus", - "responses": { - "200": { - "description": "Scheduler status and registered tasks", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "running": { - "type": "boolean" - }, - "tasks": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "interval": { - "type": "string" - }, - "last_run": { - "type": "integer" - }, - "next_run": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Trigger scheduled task", - "operationId": "triggerScheduledTask", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "task" - ], - "properties": { - "task": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Task triggered", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "result": { - "type": "object" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/cron": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Get cron jobs", - "operationId": "getCronJobs", - "parameters": [ - { - "name": "action", - "in": "query", - "schema": { - "type": "string", - "enum": [ - "list", - "logs" - ], - "default": "list" - } - } - ], - "responses": { - "200": { - "description": "Cron job list or logs", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "jobs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "schedule": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "last_run": { - "type": "integer" - }, - "last_status": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Manage cron jobs", - "operationId": "manageCronJobs", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "action" - ], - "properties": { - "action": { - "type": "string", - "enum": [ - "toggle", - "trigger", - "add", - "remove" - ] - }, - "name": { - "type": "string" - }, - "schedule": { - "type": "string" - }, - "command": { - "type": "string" - }, - "enabled": { - "type": "boolean" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Action applied", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/gateways": { - "get": { - "tags": [ - "Admin" - ], - "summary": "List gateways", - "operationId": "listGateways", - "responses": { - "200": { - "description": "Gateway list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "gateways": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "url": { - "type": "string" - }, - "status": { - "type": "string" - }, - "last_health_check": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Add gateway", - "operationId": "addGateway", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name", - "url" - ], - "properties": { - "name": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - } - } - } - } - }, - "responses": { - "201": { - "description": "Gateway added", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "put": { - "tags": [ - "Admin" - ], - "summary": "Update gateway", - "operationId": "updateGateway", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "url": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Gateway updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - }, - "delete": { - "tags": [ - "Admin" - ], - "summary": "Delete gateway", - "operationId": "deleteGateway", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Gateway deleted", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/gateways/health": { - "post": { - "tags": [ - "Admin" - ], - "summary": "Probe gateway health", - "operationId": "probeGatewayHealth", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "gateway_id": { - "type": "integer" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Health check results", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "healthy": { - "type": "boolean" - }, - "latency_ms": { - "type": "number" - }, - "details": { - "type": "object" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/gateway-config": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Read gateway config", - "operationId": "getGatewayConfig", - "responses": { - "200": { - "description": "Gateway configuration", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Update gateway config", - "operationId": "updateGatewayConfig", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Config updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/integrations": { - "get": { - "tags": [ - "Admin" - ], - "summary": "List integrations", - "operationId": "listIntegrations", - "responses": { - "200": { - "description": "Integration list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "integrations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "config": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Integration actions (enable, disable, test, configure)", - "operationId": "integrationAction", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "action", - "id" - ], - "properties": { - "action": { - "type": "string", - "enum": [ - "enable", - "disable", - "test", - "configure" - ] - }, - "id": { - "type": "string" - }, - "config": { - "type": "object" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Action applied", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/spawn": { - "post": { - "tags": [ - "Admin" - ], - "summary": "Spawn agent process", - "operationId": "spawnAgent", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "agent" - ], - "properties": { - "agent": { - "type": "string" - }, - "task": { - "type": "string" - }, - "params": { - "type": "object" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Agent spawned", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "session_id": { - "type": "string" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/standup": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Get standup report", - "operationId": "getStandupReport", - "parameters": [ - { - "name": "date", - "in": "query", - "schema": { - "type": "string", - "format": "date" - } - } - ], - "responses": { - "200": { - "description": "Standup report", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "date": { - "type": "string" - }, - "agents": { - "type": "array", - "items": { - "type": "object" - } - }, - "tasks_completed": { - "type": "integer" - }, - "tasks_in_progress": { - "type": "integer" - }, - "highlights": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/memory": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Get memory files", - "operationId": "getMemoryFiles", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Memory file contents", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "post": { - "tags": [ - "Admin" - ], - "summary": "Update memory file", - "operationId": "updateMemoryFile", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "path", - "content" - ], - "properties": { - "path": { - "type": "string" - }, - "content": { - "type": "string" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Memory updated", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/search": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Full-text search", - "operationId": "search", - "parameters": [ - { - "name": "q", - "in": "query", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "schema": { - "type": "string", - "enum": [ - "tasks", - "agents", - "activities", - "all" - ] - } - }, - { - "name": "limit", - "in": "query", - "schema": { - "type": "integer", - "default": 20 - } - } - ], - "responses": { - "200": { - "description": "Search results", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "title": { - "type": "string" - }, - "snippet": { - "type": "string" - }, - "score": { - "type": "number" - } - } - } - }, - "total": { - "type": "integer" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - } - }, - "/api/backup": { - "post": { - "tags": [ - "Admin" - ], - "summary": "Trigger backup", - "operationId": "triggerBackup", - "responses": { - "200": { - "description": "Backup completed", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size_bytes": { - "type": "integer" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/cleanup": { - "post": { - "tags": [ - "Admin" - ], - "summary": "Trigger cleanup of old data", - "operationId": "triggerCleanup", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "older_than_days": { - "type": "integer", - "default": 30 - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Cleanup results", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "deleted": { - "type": "object" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/export": { - "get": { - "tags": [ - "Admin" - ], - "summary": "Export data", - "operationId": "exportData", - "parameters": [ - { - "name": "type", - "in": "query", - "schema": { - "type": "string", - "enum": [ - "tasks", - "agents", - "activities", - "all" - ] - } - }, - { - "name": "format", - "in": "query", - "schema": { - "type": "string", - "enum": [ - "json", - "csv" - ], - "default": "json" - } - } - ], - "responses": { - "200": { - "description": "Exported data", - "content": { - "application/json": { - "schema": { - "type": "object" - } - }, - "text/csv": { - "schema": { - "type": "string" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/super/tenants": { - "get": { - "tags": [ - "Super Admin" - ], - "summary": "List tenants", - "operationId": "listTenants", - "responses": { - "200": { - "description": "Tenant list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "tenants": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "slug": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "type": "string" - }, - "linux_user": { - "type": "string" - }, - "created_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "post": { - "tags": [ - "Super Admin" - ], - "summary": "Create tenant and bootstrap job", - "operationId": "createTenant", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "slug", - "name" - ], - "properties": { - "slug": { - "type": "string" - }, - "name": { - "type": "string" - }, - "linux_user": { - "type": "string" - }, - "config": { - "type": "object" - } - } - } - } - } - }, - "responses": { - "201": { - "description": "Tenant created with bootstrap job", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "409": { - "description": "Tenant slug or linux user already exists", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } - }, - "/api/super/tenants/{id}/decommission": { - "post": { - "tags": [ - "Super Admin" - ], - "summary": "Decommission tenant", - "operationId": "decommissionTenant", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Tenant decommissioned", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/super/provision-jobs": { - "get": { - "tags": [ - "Super Admin" - ], - "summary": "List provision jobs", - "operationId": "listProvisionJobs", - "responses": { - "200": { - "description": "Provision job list", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "jobs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "tenant_id": { - "type": "integer" - }, - "type": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "running", - "completed", - "failed" - ] - }, - "output": { - "type": "string" - }, - "created_at": { - "type": "integer" - }, - "completed_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - }, - "post": { - "tags": [ - "Super Admin" - ], - "summary": "Create provision job", - "operationId": "createProvisionJob", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "tenant_id", - "type" - ], - "properties": { - "tenant_id": { - "type": "integer" - }, - "type": { - "type": "string" - }, - "params": { - "type": "object" - } - } - } - } - } - }, - "responses": { - "201": { - "description": "Job created", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - } - } - } - }, - "/api/super/provision-jobs/{id}": { - "get": { - "tags": [ - "Super Admin" - ], - "summary": "Get provision job details", - "operationId": "getProvisionJob", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Job details", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/super/provision-jobs/{id}/run": { - "post": { - "tags": [ - "Super Admin" - ], - "summary": "Run provision job", - "operationId": "runProvisionJob", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Job started", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "status": { - "type": "string" - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "403": { - "$ref": "#/components/responses/Forbidden" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } - }, - "/api/connect": { - "post": { - "tags": [ - "Connections" - ], - "summary": "Register a direct CLI connection", - "description": "Registers a CLI tool directly without a gateway. Auto-creates agent if name doesn't exist.", - "operationId": "registerConnection", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "tool_name", - "agent_name" - ], - "properties": { - "tool_name": { - "type": "string" - }, - "tool_version": { - "type": "string" - }, - "agent_name": { - "type": "string" - }, - "agent_role": { - "type": "string" - }, - "metadata": { - "type": "object" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Connection registered", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "connection_id": { - "type": "string", - "format": "uuid" - }, - "agent_id": { - "type": "integer" - }, - "agent_name": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "connected" - ] - }, - "sse_url": { - "type": "string" - }, - "heartbeat_url": { - "type": "string" - }, - "token_report_url": { - "type": "string" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "get": { - "tags": [ - "Connections" - ], - "summary": "List all direct connections", - "operationId": "listConnections", - "responses": { - "200": { - "description": "List of connections", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "connections": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "agent_id": { - "type": "integer" - }, - "agent_name": { - "type": "string" - }, - "tool_name": { - "type": "string" - }, - "tool_version": { - "type": "string" - }, - "connection_id": { - "type": "string", - "format": "uuid" - }, - "status": { - "type": "string", - "enum": [ - "connected", - "disconnected" - ] - }, - "last_heartbeat": { - "type": "integer" - }, - "created_at": { - "type": "integer" - } - } - } - } - } - } - } - } - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - } - } - }, - "delete": { - "tags": [ - "Connections" - ], - "summary": "Disconnect a CLI connection", - "operationId": "disconnectConnection", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "connection_id" - ], - "properties": { - "connection_id": { - "type": "string", - "format": "uuid" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Disconnected", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "disconnected" - ] - }, - "connection_id": { - "type": "string" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - }, - "401": { - "$ref": "#/components/responses/Unauthorized" - }, - "404": { - "$ref": "#/components/responses/NotFound" - } - } - } } }, "components": { @@ -6822,6 +7257,26 @@ "type": "integer" } } + }, + "Project": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "created_at": { + "type": "integer" + }, + "updated_at": { + "type": "integer" + } + } } }, "responses": {