{ "openapi": "3.1.0", "info": { "title": "Agent Swarm API", "version": "2.7.6", "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)." }, "servers": [ { "url": "http://localhost:3013", "description": "Local development" } ], "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "API key via Authorization: Bearer " }, "agentId": { "type": "apiKey", "in": "header", "name": "X-Agent-ID", "description": "Agent UUID for agent-scoped operations" } }, "schemas": { "ActiveSession": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "agentId": { "type": "string" }, "taskId": { "type": [ "string", "null" ] }, "triggerType": { "type": "string" }, "inboxMessageId": { "type": [ "string", "null" ] }, "taskDescription": { "type": [ "string", "null" ] }, "runnerSessionId": { "type": [ "string", "null" ] }, "providerSessionId": { "type": [ "string", "null" ] }, "runtimeInstanceId": { "type": [ "string", "null" ] }, "startedAt": { "type": "string", "format": "date-time" }, "lastHeartbeatAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "agentId", "taskId", "triggerType", "inboxMessageId", "taskDescription", "runnerSessionId", "providerSessionId", "startedAt", "lastHeartbeatAt" ] }, "ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" } }, "required": [ "error" ], "additionalProperties": {}, "description": "Standard error envelope" }, "AgentTask": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "key": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Non-unique asset directory namespace (for example shared/ or personal//drafts/). Runtime write boundaries normalize and validate the canonical form." }, "agentId": { "type": [ "string", "null" ] }, "creatorAgentId": { "type": "string" }, "task": { "type": "string", "minLength": 1 }, "title": { "type": "string" }, "status": { "type": "string", "enum": [ "draft", "backlog", "unassigned", "offered", "reviewing", "pending", "in_progress", "paused", "completed", "failed", "cancelled", "superseded" ] }, "source": { "type": "string", "enum": [ "mcp", "slack", "api", "ui", "github", "gitlab", "azure-devops", "bitbucket", "agentmail", "system", "schedule", "workflow", "linear", "jira", "comb", "chat" ], "default": "mcp" }, "routingReason": { "type": "string", "enum": [ "skill", "continuity", "overflow", "human_pinned", "reroute_fault" ] }, "routingSource": { "type": "string", "enum": [ "declared", "engine_default" ], "description": "Origin of the routing reason: declared by the caller or chosen by the engine. Absent for unknown historical provenance or no reason." }, "routingNote": { "type": "string", "maxLength": 200 }, "poolWakeAt": { "type": "string" }, "taskType": { "type": "string", "maxLength": 50 }, "tags": { "type": "array", "items": { "type": "string" }, "default": [] }, "priority": { "type": "integer", "minimum": 0, "maximum": 100, "default": 50 }, "dependsOn": { "type": "array", "items": { "type": "string" }, "default": [] }, "offeredTo": { "type": "string" }, "offeredAt": { "type": "string", "format": "date-time" }, "acceptedAt": { "type": "string", "format": "date-time" }, "rejectionReason": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "lastUpdatedAt": { "type": "string", "format": "date-time" }, "finishedAt": { "type": "string", "format": "date-time" }, "notifiedAt": { "type": "string", "format": "date-time" }, "failureReason": { "type": "string" }, "output": { "type": "string" }, "progress": { "type": "string" }, "slackChannelId": { "type": "string" }, "slackThreadTs": { "type": "string" }, "slackTriggerMessageTs": { "type": "string" }, "slackUserId": { "type": "string" }, "slackReplySent": { "type": "boolean", "default": false }, "slackProgressMessageTs": { "type": "string" }, "slackTreeRootMessageTs": { "type": "string" }, "vcsProvider": { "type": "string", "enum": [ "github", "gitlab", "azure-devops", "bitbucket" ] }, "vcsRepo": { "type": "string" }, "vcsEventType": { "type": "string" }, "vcsNumber": { "type": "integer" }, "vcsCommentId": { "type": "integer" }, "vcsAuthor": { "type": "string" }, "vcsUrl": { "type": "string" }, "vcsInstallationId": { "type": "integer" }, "vcsNodeId": { "type": "string" }, "agentmailInboxId": { "type": "string" }, "agentmailMessageId": { "type": "string" }, "agentmailThreadId": { "type": "string" }, "mentionMessageId": { "type": "string" }, "mentionChannelId": { "type": "string" }, "dir": { "type": "string", "minLength": 1 }, "parentTaskId": { "type": "string" }, "claudeSessionId": { "type": "string" }, "model": { "type": "string" }, "modelTier": { "type": "string", "enum": [ "smol", "regular", "smart", "ultra" ] }, "effort": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ] }, "resolvedModel": { "type": "string" }, "modelSource": { "type": "string" }, "modelAlias": { "type": "string" }, "resolvedEffort": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ] }, "profile": { "type": "string" }, "resolvedProfile": { "type": "string" }, "scheduleId": { "type": "string" }, "workflowRunId": { "type": [ "string", "null" ], "format": "uuid" }, "workflowRunStepId": { "type": [ "string", "null" ], "format": "uuid" }, "contextKey": { "type": "string" }, "outputSchema": { "type": "object", "additionalProperties": {} }, "followUpConfig": { "$ref": "#/components/schemas/FollowUpConfig" }, "wasPaused": { "type": "boolean", "default": false }, "deferredAt": { "type": "string", "format": "date-time" }, "compactionCount": { "type": "integer", "minimum": 0 }, "peakContextPercent": { "type": "number", "minimum": 0, "maximum": 100 }, "peakContextTokens": { "type": "integer", "minimum": 0 }, "contextWindowSize": { "type": "integer", "minimum": 0 }, "credentialKeySuffix": { "type": "string" }, "credentialKeyType": { "type": "string" }, "requestedByUserId": { "type": "string" }, "swarmVersion": { "type": "string" }, "provider": { "type": "string", "enum": [ "claude", "codex", "pi", "devin", "claude-managed", "opencode", "acp", "dsh", "amp", "cursor", "grok", "fx" ] }, "providerMeta": { "type": "object", "additionalProperties": {} }, "harnessVariant": { "type": "string" }, "harnessVariantMeta": { "type": "object", "additionalProperties": {} }, "totalCostUsd": { "type": "number", "minimum": 0 }, "routingAffinity": { "$ref": "#/components/schemas/RoutingAffinity" }, "routingAffinityInvalid": { "type": "boolean" } }, "required": [ "id", "key", "agentId", "task", "status", "createdAt", "lastUpdatedAt" ] }, "FollowUpConfig": { "type": "object", "properties": { "disabled": { "type": "boolean" }, "onCompleted": { "type": "string", "maxLength": 4000 }, "onFailed": { "type": "string", "maxLength": 4000 } } }, "RoutingAffinity": { "type": "object", "properties": { "sourceAgentId": { "type": "string" }, "role": { "type": "string", "maxLength": 100 }, "harnessProvider": { "type": "string", "enum": [ "claude", "codex", "pi", "devin", "claude-managed", "opencode", "acp", "dsh", "amp", "cursor", "grok", "fx" ] }, "capabilities": { "type": "array", "items": { "type": "string" }, "default": [] }, "leadOnly": { "type": "boolean" } } }, "AgentCredStatus": { "type": "object", "properties": { "ready": { "type": "boolean" }, "missing": { "type": "array", "items": { "type": "string" }, "default": [] }, "satisfiedBy": { "type": [ "string", "null" ], "enum": [ "env", "file", "side-effect-pending", "sdk-delegated", null ], "default": null }, "hint": { "type": [ "string", "null" ], "default": null }, "liveTest": { "$ref": "#/components/schemas/AgentCredStatusLiveTest" }, "latestModel": { "$ref": "#/components/schemas/AgentLatestModel" }, "reportedAt": { "type": "number" }, "reportKind": { "type": "string", "enum": [ "boot", "post_task" ], "default": "boot" }, "bedrock": { "$ref": "#/components/schemas/AgentBedrockStatus" }, "opencodeGo": { "$ref": "#/components/schemas/AgentOpencodeGoStatus" }, "acp": { "$ref": "#/components/schemas/AgentAcpStatus" } }, "required": [ "ready", "reportedAt" ] }, "AgentCredStatusLiveTest": { "type": [ "object", "null" ], "properties": { "ok": { "type": "boolean" }, "error": { "type": [ "string", "null" ], "default": null }, "latency_ms": { "type": "number" }, "testedAt": { "type": "number" }, "warning": { "type": "string" }, "keys": { "type": "array", "items": { "$ref": "#/components/schemas/AgentCredStatusKeyResult" } } }, "default": null, "required": [ "ok", "latency_ms", "testedAt" ] }, "AgentCredStatusKeyResult": { "type": "object", "properties": { "keyType": { "type": "string" }, "index": { "type": "number" }, "suffix": { "type": "string" }, "ok": { "type": "boolean" }, "error": { "type": "string" }, "httpStatus": { "type": "number" }, "latency_ms": { "type": "number" } }, "required": [ "keyType", "index", "suffix", "ok", "latency_ms" ] }, "AgentLatestModel": { "type": [ "object", "null" ], "properties": { "model": { "type": "string", "minLength": 1 }, "source": { "type": "string", "enum": [ "task", "agent_config", "adapter_default", "custom" ] }, "taskId": { "type": [ "string", "null" ], "default": null }, "harnessProvider": { "type": [ "string", "null" ], "enum": [ "claude", "codex", "pi", "devin", "claude-managed", "opencode", "acp", "dsh", "amp", "cursor", "grok", "fx", null ], "default": null }, "reportedAt": { "type": "number" }, "reasoningEffort": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ] } }, "default": null, "required": [ "model", "source", "reportedAt" ] }, "AgentBedrockStatus": { "type": [ "object", "null" ], "properties": { "region": { "type": "string" }, "probedAt": { "type": "number" }, "ready": { "type": "boolean" }, "models": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ] }, "default": [] }, "error": { "type": "string" } }, "default": null, "required": [ "region", "probedAt", "ready" ] }, "AgentOpencodeGoStatus": { "type": [ "object", "null" ], "properties": { "probedAt": { "type": "number" }, "models": { "type": "array", "items": { "type": "string" }, "default": [] } }, "default": null, "required": [ "probedAt" ] }, "AgentAcpStatus": { "type": [ "object", "null" ], "properties": { "target": { "type": "string", "enum": [ "opencode", "gemini", "copilot", "qwen", "kiro", "goose", "custom" ] }, "configOptions": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "select" ] }, "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "category": { "type": [ "string", "null" ] }, "currentValue": { "type": "string" }, "options": { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "value": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] } }, "required": [ "value", "name" ] }, { "type": "object", "properties": { "group": { "type": "string" }, "name": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] } }, "required": [ "value", "name" ] } } }, "required": [ "group", "name", "options" ] } ] } } }, "required": [ "type", "id", "name", "currentValue", "options" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "boolean" ] }, "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "category": { "type": [ "string", "null" ] }, "currentValue": { "type": "boolean" } }, "required": [ "type", "id", "name", "currentValue" ] } ] } }, "reportedAt": { "type": "number" } }, "default": null, "required": [ "target", "configOptions", "reportedAt" ] }, "AgentSlackIcon": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "emoji" ] }, "emoji": { "type": "string", "maxLength": 102, "pattern": "^:[a-z0-9_+'-]+:$" } }, "required": [ "type", "emoji" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "url" ] }, "url": { "type": "string", "maxLength": 2048, "format": "uri" } }, "required": [ "type", "url" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "app" ] } }, "required": [ "type" ] } ] }, "Agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "minLength": 1 }, "isLead": { "type": "boolean", "default": false }, "status": { "type": "string", "enum": [ "idle", "busy", "offline", "waiting_for_credentials" ] }, "runtimePoolId": { "type": [ "string", "null" ] }, "runtimeProvisionAttempts": { "type": "integer", "minimum": 0 }, "runtimeProvisionRetryAt": { "type": [ "string", "null" ] }, "description": { "type": "string" }, "role": { "type": "string", "maxLength": 100 }, "capabilities": { "type": "array", "items": { "type": "string" }, "default": [] }, "claudeMd": { "type": "string", "maxLength": 262144 }, "soulMd": { "type": "string", "maxLength": 262144 }, "identityMd": { "type": "string", "maxLength": 262144 }, "setupScript": { "type": "string", "maxLength": 262144 }, "toolsMd": { "type": "string", "maxLength": 262144 }, "heartbeatMd": { "type": "string", "maxLength": 262144 }, "maxTasks": { "type": "integer", "minimum": 1, "maximum": 100 }, "emptyPollCount": { "type": "integer", "minimum": 0 }, "lastActivityAt": { "type": "string", "format": "date-time" }, "provider": { "type": "string", "enum": [ "claude", "codex", "pi", "devin", "claude-managed", "opencode", "acp", "dsh", "amp", "cursor", "grok", "fx" ] }, "harnessProvider": { "type": [ "string", "null" ], "enum": [ "claude", "codex", "pi", "devin", "claude-managed", "opencode", "acp", "dsh", "amp", "cursor", "grok", "fx", null ] }, "credentialMissing": { "type": [ "array", "null" ], "items": { "type": "string" } }, "credStatus": { "oneOf": [ { "$ref": "#/components/schemas/AgentCredStatus" }, { "type": "null" } ] }, "avatar": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "lucide" ] }, "icon": { "type": "string", "maxLength": 64, "pattern": "^[a-z0-9-]+$" }, "color": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" } }, "required": [ "type", "icon" ] } ] }, "slackIcon": { "oneOf": [ { "$ref": "#/components/schemas/AgentSlackIcon" }, { "type": "null" } ] }, "createdAt": { "type": "string", "format": "date-time" }, "lastUpdatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "status", "createdAt", "lastUpdatedAt" ] }, "SwarmConfig": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "scope": { "type": "string", "enum": [ "global", "agent", "repo" ] }, "scopeId": { "type": [ "string", "null" ] }, "key": { "type": "string", "minLength": 1, "maxLength": 255 }, "value": { "type": "string" }, "isSecret": { "type": "boolean" }, "envPath": { "type": [ "string", "null" ] }, "description": { "type": [ "string", "null" ] }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" }, "encrypted": { "type": "boolean" }, "exportToEnv": { "type": "boolean" } }, "required": [ "id", "scope", "scopeId", "key", "value", "isSecret", "envPath", "description", "createdAt", "lastUpdatedAt", "encrypted", "exportToEnv" ] }, "AssetSummary": { "type": "object", "properties": { "entityType": { "type": "string", "enum": [ "task", "workflow", "schedule", "page", "app", "script", "file" ] }, "id": { "type": "string" }, "key": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Non-unique asset directory namespace (for example shared/ or personal//drafts/). Runtime write boundaries normalize and validate the canonical form." }, "label": { "type": "string" }, "updatedAt": { "type": "string" }, "providerRef": { "$ref": "#/components/schemas/AssetProviderRef" } }, "required": [ "entityType", "id", "key", "label", "updatedAt" ] }, "AssetProviderRef": { "type": "object", "properties": { "providerId": { "type": "string" }, "orgId": { "type": "string" }, "driveId": { "type": "string" }, "providerKey": { "type": "string" } }, "required": [ "providerId", "providerKey" ] }, "AssetKeyMapping": { "type": "object", "properties": { "id": { "type": "string" }, "providerId": { "type": "string" }, "providerOrgId": { "type": "string" }, "providerDriveId": { "type": "string" }, "providerKey": { "type": "string" }, "key": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Non-unique asset directory namespace (for example shared/ or personal//drafts/). Runtime write boundaries normalize and validate the canonical form." }, "sourceEntityType": { "type": "string", "enum": [ "task-attachment", "external" ] }, "sourceEntityId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string" }, "updatedBy": { "type": "string" } }, "required": [ "id", "providerId", "providerKey", "key", "createdAt", "updatedAt" ] }, "Budget": { "type": "object", "properties": { "scope": { "type": "string", "enum": [ "global", "agent", "user" ] }, "scopeId": { "type": "string" }, "dailyBudgetUsd": { "type": "number", "minimum": 0 }, "createdAt": { "type": "number" }, "lastUpdatedAt": { "type": "number" } }, "required": [ "scope", "scopeId", "dailyBudgetUsd", "createdAt", "lastUpdatedAt" ] }, "BudgetRefusalNotification": { "type": "object", "properties": { "taskId": { "type": "string" }, "date": { "type": "string" }, "agentId": { "type": "string" }, "cause": { "type": "string", "enum": [ "agent", "global", "user" ] }, "agentSpendUsd": { "type": [ "number", "null" ] }, "agentBudgetUsd": { "type": [ "number", "null" ] }, "globalSpendUsd": { "type": [ "number", "null" ] }, "globalBudgetUsd": { "type": [ "number", "null" ] }, "userSpendUsd": { "type": [ "number", "null" ] }, "userBudgetUsd": { "type": [ "number", "null" ] }, "followUpTaskId": { "type": [ "string", "null" ] }, "createdAt": { "type": "number" } }, "required": [ "taskId", "date", "agentId", "cause", "createdAt" ] }, "ContextSnapshot": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "taskId": { "type": "string", "format": "uuid" }, "agentId": { "type": "string" }, "sessionId": { "type": "string" }, "contextUsedTokens": { "type": "integer", "minimum": 0 }, "contextTotalTokens": { "type": "integer", "minimum": 0 }, "contextPercent": { "type": "number", "minimum": 0, "maximum": 100 }, "eventType": { "type": "string", "enum": [ "progress", "compaction", "completion" ] }, "compactTrigger": { "type": "string", "enum": [ "auto", "manual", "auto-inferred" ] }, "preCompactTokens": { "type": "integer", "minimum": 0 }, "cumulativeInputTokens": { "type": "integer", "minimum": 0, "default": 0 }, "cumulativeOutputTokens": { "type": "integer", "minimum": 0, "default": 0 }, "contextFormula": { "type": "string", "enum": [ "input-cache-output", "input-cache-no-output", "input-output-no-cache", "peak-proxy", "pi-delegated", "harness-reported", "unknown" ] }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "taskId", "agentId", "sessionId", "eventType", "createdAt" ] }, "SwarmEvent": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "category": { "type": "string", "enum": [ "tool", "skill", "session", "api", "task", "workflow", "system" ] }, "event": { "type": "string", "enum": [ "tool.start", "tool.end", "skill.invoke", "skill.complete", "session.start", "session.end", "session.resume", "session.cost", "api.request", "api.error", "task.poll", "task.assign", "task.timeout", "workflow.step.start", "workflow.step.end", "workflow.run.start", "workflow.run.end", "system.boot", "system.migration", "system.error", "system.profile_sync_rejected", "system.profile_sync_reconciled", "system.profile_sync_conflict", "script.global_upsert", "schedule.deleted" ] }, "status": { "type": "string", "enum": [ "ok", "error", "timeout", "skipped" ] }, "source": { "type": "string", "enum": [ "worker", "api", "hook", "scheduler", "cli" ] }, "agentId": { "type": "string" }, "taskId": { "type": "string" }, "sessionId": { "type": "string" }, "parentEventId": { "type": "string" }, "numericValue": { "type": "number" }, "durationMs": { "type": "integer" }, "data": { "type": "object", "additionalProperties": {} }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "category", "event", "status", "source", "createdAt" ] }, "Extension": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "minLength": 1, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "description": { "type": "string" }, "runtime": { "type": "string", "enum": [ "api", "worker" ] }, "manifestJson": { "type": "string" }, "contentHash": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "activeVersion": { "type": "integer", "minimum": 1 }, "enabled": { "type": "boolean" }, "priority": { "type": "integer" }, "configJson": { "type": "string" }, "status": { "type": "string", "enum": [ "disabled", "enabled", "error", "auto-disabled" ] }, "consecutiveFailures": { "type": "integer", "minimum": 0 }, "lastError": { "type": [ "string", "null" ] }, "agentId": { "type": [ "string", "null" ] }, "createdByAgentId": { "type": [ "string", "null" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "description", "runtime", "manifestJson", "contentHash", "version", "activeVersion", "enabled", "priority", "configJson", "status", "consecutiveFailures", "lastError", "agentId", "createdByAgentId", "createdAt", "updatedAt" ] }, "ExtensionManifest": { "type": "object", "properties": { "$schema": { "type": "string" }, "name": { "type": "string", "minLength": 1, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "description": { "type": "string" }, "version": { "type": "string", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$" }, "runtime": { "type": "string", "enum": [ "api", "worker" ] }, "assets": { "type": "object", "properties": { "hooks": { "type": "string", "minLength": 1 }, "scripts": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Global script name. Must start with `-`." }, "file": { "type": "string", "minLength": 1, "description": "Bundle path of the script source." }, "description": { "type": "string", "minLength": 1 }, "intent": { "type": "string", "minLength": 1, "description": "Defaults to `description`." } }, "required": [ "name", "file", "description" ], "additionalProperties": false } }, "schedules": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Schedule name. Must start with `-`." }, "description": { "type": "string", "minLength": 1 }, "script": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Name of a script declared in `assets.scripts`." }, "cronExpression": { "type": "string", "minLength": 1 }, "intervalMs": { "type": "integer", "exclusiveMinimum": 0 }, "timezone": { "type": "string", "minLength": 1 }, "args": { "type": "object", "additionalProperties": {} } }, "required": [ "name", "script" ], "additionalProperties": false } }, "workflows": { "type": "array", "items": { "type": "object", "properties": { "file": { "type": "string", "minLength": 1, "description": "Bundle path of a YAML or JSON workflow file. Its `name` must start with `-`." } }, "required": [ "file" ], "additionalProperties": false } }, "skills": { "type": "array", "items": { "type": "object", "properties": { "dir": { "type": "string", "minLength": 1, "description": "Bundle directory holding SKILL.md and optional files/**. The SKILL.md frontmatter `name` must start with `-`." } }, "required": [ "dir" ], "additionalProperties": false } } }, "required": [ "hooks" ], "additionalProperties": false }, "homepage": { "type": "string", "format": "uri" }, "author": { "type": "string", "minLength": 1 } }, "required": [ "name", "description", "version", "runtime", "assets" ], "additionalProperties": false }, "ExtensionInstallBody": { "type": "object", "properties": { "template": { "type": "string", "minLength": 1, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$", "description": "Name of a predefined extension in the catalog (`GET /api/extensions/catalog`). Mutually exclusive with `manifest` and `files`." }, "manifest": { "allOf": [ { "$ref": "#/components/schemas/ExtensionManifest" }, { "description": "Inline bundle manifest. Requires `files`. Accepted only when `EXTENSION_ALLOW_INLINE_INSTALL` is on and the caller is a lead, operator, or dashboard user." } ] }, "files": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Inline bundle files keyed by relative path. Requires `manifest`." }, "priority": { "type": "integer", "description": "Handler priority. Lower values run first." }, "config": { "type": "object", "additionalProperties": {}, "description": "Extension configuration." } }, "additionalProperties": false }, "ExtensionCatalogItem": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "version": { "type": "string" }, "manifestFile": { "type": "string" }, "assets": { "type": "object", "additionalProperties": { "type": "integer" } }, "readme": { "type": [ "string", "null" ] }, "installed": { "type": [ "object", "null" ], "properties": { "id": { "type": "string" }, "version": { "type": "integer" }, "enabled": { "type": "boolean" } }, "required": [ "id", "version", "enabled" ] } }, "required": [ "name", "description", "version", "manifestFile", "assets", "readme", "installed" ] }, "ExtensionVersion": { "type": "object", "properties": { "id": { "type": "string" }, "extensionId": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "manifestJson": { "type": "string" }, "filesJson": { "type": "string" }, "contentHash": { "type": "string" }, "changedByAgentId": { "type": [ "string", "null" ] }, "changedAt": { "type": "string" }, "changeReason": { "type": [ "string", "null" ] } }, "required": [ "id", "extensionId", "version", "manifestJson", "filesJson", "contentHash", "changedByAgentId", "changedAt", "changeReason" ] }, "ExtensionRun": { "type": "object", "properties": { "id": { "type": "string" }, "extensionId": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "event": { "type": "string" }, "action": { "type": "string", "enum": [ "continue", "modify", "block", "error", "timeout", "load-error" ] }, "durationMs": { "type": [ "integer", "null" ] }, "message": { "type": [ "string", "null" ] }, "agentId": { "type": [ "string", "null" ] }, "subject": { "type": [ "string", "null" ] }, "createdAt": { "type": "string" } }, "required": [ "id", "extensionId", "version", "event", "action", "durationMs", "message", "agentId", "subject", "createdAt" ] }, "UserFavorite": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "itemType": { "type": "string", "enum": [ "page", "workflow", "schedule", "agent-fs-path" ] }, "itemId": { "type": "string" }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" }, "createdBy": { "type": "string" }, "updatedBy": { "type": "string" } }, "required": [ "id", "itemType", "itemId", "createdAt", "lastUpdatedAt" ] }, "TaskAttachment": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "taskId": { "type": "string", "format": "uuid" }, "agentId": { "type": [ "string", "null" ] }, "name": { "type": "string" }, "kind": { "type": "string", "enum": [ "agent-fs", "url", "shared-fs", "page" ] }, "url": { "type": "string" }, "path": { "type": "string" }, "pageId": { "type": "string" }, "providerId": { "type": "string" }, "providerKey": { "type": "string" }, "capabilities": { "type": "object", "additionalProperties": {} }, "orgId": { "type": "string" }, "driveId": { "type": "string" }, "mimeType": { "type": "string" }, "sizeBytes": { "type": "integer", "minimum": 0 }, "sha256": { "type": "string" }, "intent": { "type": "string" }, "description": { "type": "string" }, "isPrimary": { "type": "boolean", "default": false }, "createdAt": { "type": "string", "format": "date-time" }, "createdBy": { "type": "string" }, "updatedBy": { "type": "string" } }, "required": [ "id", "taskId", "agentId", "name", "kind", "createdAt" ] }, "InboxItemState": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "itemType": { "type": "string", "enum": [ "approval", "credential_missing", "broken_task", "to_read", "to_start_template", "notification" ] }, "itemId": { "type": "string" }, "status": { "type": "string", "enum": [ "open", "snoozed", "dismissed", "done" ] }, "snoozeUntil": { "type": "string" }, "dismissedAt": { "type": "string" }, "doneAt": { "type": "string" }, "readAt": { "type": "string" }, "lastReadAt": { "type": "string" }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" } }, "required": [ "id", "userId", "itemType", "itemId", "status", "createdAt", "lastUpdatedAt" ] }, "KvEntry": { "type": "object", "properties": { "namespace": { "type": "string" }, "key": { "type": "string" }, "value": {}, "valueType": { "type": "string", "enum": [ "json", "string", "integer" ] }, "expiresAt": { "type": [ "integer", "null" ] }, "createdAt": { "type": "integer" }, "updatedAt": { "type": "integer" } }, "required": [ "namespace", "key", "valueType", "expiresAt", "createdAt", "updatedAt" ] }, "AgentMemory": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "agentId": { "type": [ "string", "null" ] }, "scope": { "type": "string", "enum": [ "agent", "swarm" ] }, "key": { "type": [ "string", "null" ] }, "name": { "type": "string", "minLength": 1, "maxLength": 500 }, "content": { "type": "string" }, "summary": { "type": [ "string", "null" ] }, "source": { "type": "string", "enum": [ "manual", "file_index", "session_summary", "task_completion" ] }, "sourceTaskId": { "type": [ "string", "null" ], "format": "uuid" }, "sourcePath": { "type": [ "string", "null" ] }, "chunkIndex": { "type": "integer", "minimum": 0, "default": 0 }, "totalChunks": { "type": "integer", "minimum": 1, "default": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string" }, "updatedAt": { "type": [ "string", "null" ] }, "accessedAt": { "type": "string" }, "expiresAt": { "type": [ "string", "null" ] }, "accessCount": { "type": "integer", "minimum": 0, "default": 0 }, "embeddingModel": { "type": [ "string", "null" ] }, "contentHash": { "type": [ "string", "null" ] }, "version": { "type": "integer", "minimum": 1, "default": 1 } }, "required": [ "id", "agentId", "scope", "name", "content", "summary", "source", "sourceTaskId", "sourcePath", "tags", "createdAt", "accessedAt" ] }, "MetricDefinition": { "type": "object", "properties": { "version": { "type": "number", "enum": [ 1 ] }, "widgets": { "type": "array", "items": { "$ref": "#/components/schemas/MetricWidget" }, "minItems": 1, "maxItems": 24 }, "variables": { "type": "array", "items": { "$ref": "#/components/schemas/MetricVariable" }, "maxItems": 12 }, "layout": { "type": "object", "properties": { "columns": { "type": "integer", "minimum": 1, "maximum": 4 } } }, "refreshSeconds": { "type": "integer", "minimum": 5, "maximum": 3600 } }, "required": [ "version", "widgets" ] }, "MetricWidget": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "title": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "query": { "type": "object", "properties": { "sql": { "type": "string", "minLength": 1, "maxLength": 10000 }, "params": { "type": "array", "items": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" } ] } }, "maxRows": { "type": "integer", "minimum": 1, "maximum": 500 } }, "required": [ "sql" ] }, "viz": { "$ref": "#/components/schemas/MetricVizConfig" }, "colSpan": { "type": "integer", "minimum": 1, "maximum": 4 }, "rowSpan": { "type": "integer", "minimum": 1, "maximum": 4 } }, "required": [ "id", "title", "query", "viz" ] }, "MetricVizConfig": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "stat", "table", "bar", "line", "multi-bar", "multi-line" ] }, "x": { "type": "string" }, "y": { "type": "string" }, "series": { "type": "array", "items": { "type": "string" } }, "label": { "type": "string" }, "value": { "type": "string" }, "columns": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "format": { "type": "string", "enum": [ "number", "integer", "currency", "percent", "duration" ] } }, "required": [ "key" ] } }, "format": { "type": "string", "enum": [ "number", "integer", "currency", "percent", "duration" ] } }, "required": [ "type" ] }, "MetricVariable": { "type": "object", "properties": { "key": { "type": "string", "minLength": 1, "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" }, "label": { "type": "string", "minLength": 1 }, "type": { "type": "string", "enum": [ "text", "number", "select" ], "default": "text" }, "defaultValue": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" } ] }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string", "minLength": 1 }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "null" } ] } }, "required": [ "label", "value" ] } }, "optionsQuery": { "type": "object", "properties": { "sql": { "type": "string", "minLength": 1, "maxLength": 10000 }, "valueKey": { "type": "string", "minLength": 1 }, "labelKey": { "type": "string", "minLength": 1 } }, "required": [ "sql", "valueKey" ] } }, "required": [ "key" ] }, "Metric": { "type": "object", "properties": { "id": { "type": "string" }, "agentId": { "type": "string" }, "slug": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "definition": { "$ref": "#/components/schemas/MetricDefinition" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "agentId", "slug", "title", "definition", "createdAt", "updatedAt" ] }, "MetricVersion": { "type": "object", "properties": { "id": { "type": "string" }, "metricId": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "snapshot": { "$ref": "#/components/schemas/MetricSnapshot" }, "changedByAgentId": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "id", "metricId", "version", "snapshot", "createdAt" ] }, "MetricSnapshot": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "definition": { "$ref": "#/components/schemas/MetricDefinition" } }, "required": [ "title", "definition" ] }, "SteerResult": { "type": "object", "properties": { "outcome": { "type": "string", "enum": [ "steered", "queued", "promoted" ] }, "steeringMessageId": { "type": "string", "format": "uuid" }, "promotedTaskId": { "type": "string", "format": "uuid" }, "effectiveMode": { "type": "string", "enum": [ "steer", "queue" ] }, "degradedFrom": { "type": "string", "enum": [ "steer", "queue" ] } }, "required": [ "outcome", "effectiveMode" ] }, "SteeringMessage": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "taskId": { "type": "string", "format": "uuid" }, "body": { "type": "string", "minLength": 1 }, "mode": { "type": "string", "enum": [ "steer", "queue" ] }, "status": { "type": "string", "enum": [ "pending", "delivered", "handled", "promoted", "cancelled" ] }, "deliveredMode": { "type": "string", "enum": [ "steer", "queue" ] }, "source": { "type": "string", "enum": [ "ui", "mcp", "script", "slack", "api", "chat" ] }, "senderLabel": { "type": "string" }, "createdByKind": { "type": "string", "enum": [ "user", "agent", "system" ] }, "createdByUserId": { "type": "string" }, "createdByAgentId": { "type": "string" }, "promotedTaskId": { "type": "string", "format": "uuid" }, "createdAt": { "type": "string", "format": "date-time" }, "deliveredAt": { "type": "string", "format": "date-time" }, "handledAt": { "type": "string", "format": "date-time" }, "handledNote": { "type": "string" } }, "required": [ "id", "taskId", "body", "mode", "status", "source", "createdByKind", "createdAt" ] }, "AgentLog": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "eventType": { "type": "string", "enum": [ "agent_joined", "agent_status_change", "agent_left", "task_created", "task_status_change", "task_progress", "task_steering", "task_offered", "task_accepted", "task_rejected", "task_claimed", "task_claim_rejected_affinity", "task_dispatch_rejected_affinity", "task_authorization_rejected", "task_recovery_authorization", "task_dependency_repointed", "task_released", "task_deferred_wait_woke", "task_follow_up_suppressed", "task_follow_up_gate_shadow", "task_citation_check_refused", "channel_message", "service_registered", "service_unregistered", "service_status_change", "budget.upserted", "budget.deleted", "pricing.inserted", "pricing.deleted", "pricing.refresh", "pricing.refresh.failed", "task_superseded", "slack_delivery" ] }, "agentId": { "type": "string" }, "taskId": { "type": "string" }, "oldValue": { "type": "string" }, "newValue": { "type": "string" }, "metadata": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "eventType", "createdAt" ] }, "UserCommsPrefs": { "type": "object", "properties": { "tone": { "type": "string" }, "language": { "type": "string" }, "verbosity": { "type": "string" } } }, "PageThemeTokens": { "type": [ "object", "null" ], "properties": { "light": { "type": "object", "additionalProperties": { "type": "string" } }, "dark": { "type": "object", "additionalProperties": { "type": "string" } } }, "required": [ "light", "dark" ] }, "Page": { "type": "object", "properties": { "id": { "type": "string" }, "key": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Non-unique asset directory namespace (for example shared/ or personal//drafts/). Runtime write boundaries normalize and validate the canonical form." }, "agentId": { "type": "string" }, "slug": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "contentType": { "type": "string", "enum": [ "text/html", "application/json", "image/svg+xml" ] }, "authMode": { "type": "string", "enum": [ "public", "authed", "password" ] }, "passwordHash": { "type": "string" }, "body": { "type": "string" }, "needsCredentials": { "type": "array", "items": { "type": "string" } }, "theme": { "type": [ "string", "null" ] }, "themeTokens": { "$ref": "#/components/schemas/PageThemeTokens" }, "designVersion": { "type": "integer", "minimum": 1 }, "viewCount": { "type": "integer", "minimum": 0, "default": 0 }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" }, "favorite": { "type": "boolean" } }, "required": [ "id", "key", "agentId", "slug", "title", "contentType", "authMode", "body", "theme", "themeTokens", "designVersion", "createdAt", "updatedAt" ] }, "PageVersion": { "type": "object", "properties": { "id": { "type": "string" }, "pageId": { "type": "string" }, "version": { "type": "integer", "minimum": 1 }, "snapshot": { "$ref": "#/components/schemas/PageSnapshot" }, "changedByAgentId": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "id", "pageId", "version", "snapshot", "createdAt" ] }, "PageSnapshot": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "contentType": { "type": "string", "enum": [ "text/html", "application/json", "image/svg+xml" ] }, "authMode": { "type": "string", "enum": [ "public", "authed", "password" ] }, "passwordHash": { "type": "string" }, "body": { "type": "string" }, "needsCredentials": { "type": "array", "items": { "type": "string" } }, "theme": { "type": [ "string", "null" ] }, "themeTokens": { "$ref": "#/components/schemas/PageThemeTokens" }, "designVersion": { "type": "integer", "minimum": 1 } }, "required": [ "title", "contentType", "authMode", "body" ] }, "PromptTemplateResponse": { "allOf": [ { "$ref": "#/components/schemas/PromptTemplate" }, { "type": "object", "properties": { "defaultDrifted": { "type": "boolean" } }, "required": [ "defaultDrifted" ] } ] }, "PromptTemplate": { "type": "object", "properties": { "id": { "type": "string" }, "eventType": { "type": "string" }, "scope": { "type": "string", "enum": [ "global", "agent", "repo" ] }, "scopeId": { "type": [ "string", "null" ] }, "state": { "type": "string", "enum": [ "enabled", "default_prompt_fallback", "skip_event" ] }, "body": { "type": "string" }, "isDefault": { "type": "boolean" }, "version": { "type": "number" }, "createdBy": { "type": [ "string", "null" ] }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "eventType", "scope", "scopeId", "state", "body", "isDefault", "version", "createdBy", "createdAt", "updatedAt" ] }, "PromptTemplateHistory": { "type": "object", "properties": { "id": { "type": "string" }, "templateId": { "type": "string" }, "version": { "type": "number" }, "body": { "type": "string" }, "state": { "type": "string" }, "changedBy": { "type": [ "string", "null" ] }, "changedAt": { "type": "string" }, "changeReason": { "type": [ "string", "null" ] } }, "required": [ "id", "templateId", "version", "body", "state", "changedBy", "changedAt", "changeReason" ] }, "BudgetRefusedTrigger": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "budget_refused" ] }, "cause": { "type": "string", "enum": [ "agent", "global", "user" ] }, "agentSpend": { "type": "number" }, "agentBudget": { "type": "number" }, "globalSpend": { "type": "number" }, "globalBudget": { "type": "number" }, "userSpend": { "type": "number" }, "userBudget": { "type": "number" }, "resetAt": { "type": "string" } }, "required": [ "type", "cause", "resetAt" ] }, "PricingRow": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ "claude", "claude-managed", "codex", "pi", "opencode", "devin", "gemini", "acp", "dsh", "amp", "cursor", "grok", "fx" ] }, "model": { "type": "string" }, "tokenClass": { "type": "string", "enum": [ "input", "cached_input", "output", "cache_write", "cache_write_1h", "web_search", "runtime_hour", "acu" ] }, "effectiveFrom": { "type": "number", "minimum": 0 }, "pricePerMillionUsd": { "type": "number", "minimum": 0 }, "createdAt": { "type": "number" }, "lastUpdatedAt": { "type": "number" } }, "required": [ "provider", "model", "tokenClass", "effectiveFrom", "pricePerMillionUsd", "createdAt", "lastUpdatedAt" ] }, "SwarmRepo": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "url": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 100 }, "clonePath": { "type": "string", "minLength": 1 }, "defaultBranch": { "type": "string", "default": "main" }, "autoClone": { "type": "boolean", "default": true }, "hooks": { "$ref": "#/components/schemas/RepoHooks" }, "guidelines": { "$ref": "#/components/schemas/RepoGuidelines" }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" } }, "required": [ "id", "url", "name", "clonePath", "createdAt", "lastUpdatedAt" ] }, "RepoHooks": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": false } }, "default": { "enabled": false } }, "RepoGuidelines": { "type": [ "object", "null" ], "properties": { "prChecks": { "type": "array", "items": { "type": "string" } }, "mergeChecks": { "type": "array", "items": { "type": "string" } }, "allowMerge": { "type": "boolean", "default": false }, "review": { "type": "array", "items": { "type": "string" } } }, "required": [ "prChecks", "mergeChecks", "review" ] }, "RepoGuidelinesInput": { "type": [ "object", "null" ], "properties": { "prChecks": { "type": "array", "items": { "type": "string" }, "maxItems": 50 }, "mergeChecks": { "type": "array", "items": { "type": "string" }, "maxItems": 50 }, "allowMerge": { "type": "boolean", "default": false }, "review": { "type": "array", "items": { "type": "string" }, "maxItems": 50 } }, "required": [ "prChecks", "mergeChecks", "review" ] }, "ScriptRun": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "agentId": { "type": "string" }, "scriptName": { "type": "string" }, "source": { "type": "string" }, "args": {}, "kind": { "type": "string", "enum": [ "workflow", "inline" ] }, "status": { "type": "string", "enum": [ "running", "paused", "completed", "failed", "cancelled", "aborted_limit" ] }, "pid": { "type": "integer" }, "startedAt": { "type": "string" }, "finishedAt": { "type": "string" }, "output": {}, "error": { "type": "string" }, "lastHeartbeatAt": { "type": "string" }, "idempotencyKey": { "type": "string" }, "requestedByUserId": { "type": "string" }, "sourceTaskId": { "type": "string" } }, "required": [ "id", "agentId", "source", "kind", "status", "startedAt" ] }, "ScriptRunJournalEntry": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "runId": { "type": "string", "format": "uuid" }, "stepKey": { "type": "string" }, "stepType": { "type": "string" }, "config": { "type": "object", "additionalProperties": {} }, "status": { "type": "string", "enum": [ "completed", "failed" ] }, "result": {}, "error": { "type": "string" }, "startedAt": { "type": "string" }, "completedAt": { "type": "string" }, "durationMs": { "type": "number" } }, "required": [ "id", "runId", "stepKey", "stepType", "config", "status", "startedAt" ] }, "SessionLog": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "taskId": { "type": "string", "format": "uuid" }, "sessionId": { "type": "string" }, "iteration": { "type": "integer", "minimum": 1 }, "cli": { "type": "string", "default": "claude" }, "content": { "type": "string" }, "lineNumber": { "type": "integer", "minimum": 0 }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "sessionId", "iteration", "content", "lineNumber", "createdAt" ] }, "SessionCost": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "sessionId": { "type": "string" }, "taskId": { "type": "string", "format": "uuid" }, "agentId": { "type": "string" }, "totalCostUsd": { "type": "number", "minimum": 0 }, "inputTokens": { "type": "integer", "minimum": 0, "default": 0 }, "outputTokens": { "type": "integer", "minimum": 0, "default": 0 }, "cacheReadTokens": { "type": "integer", "minimum": 0, "default": 0 }, "cacheWriteTokens": { "type": "integer", "minimum": 0, "default": 0 }, "reasoningOutputTokens": { "type": "integer", "minimum": 0, "default": 0 }, "thinkingTokens": { "type": "integer", "minimum": 0, "default": 0 }, "durationMs": { "type": "integer", "minimum": 0 }, "numTurns": { "type": [ "integer", "null" ], "minimum": 1 }, "model": { "type": "string" }, "isError": { "type": "boolean", "default": false }, "costSource": { "type": "string", "enum": [ "harness", "pricing-table", "unpriced", "estimated" ], "default": "harness" }, "harnessCostUsd": { "type": [ "number", "null" ] }, "cacheWrite5mTokens": { "type": [ "integer", "null" ] }, "cacheWrite1hTokens": { "type": [ "integer", "null" ] }, "modelBreakdown": { "type": [ "array", "null" ], "items": { "$ref": "#/components/schemas/SessionCostModelBreakdown" } }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "sessionId", "agentId", "totalCostUsd", "durationMs", "numTurns", "model", "createdAt" ] }, "SessionCostModelBreakdown": { "type": "object", "properties": { "model": { "type": "string" }, "inputTokens": { "type": "integer", "minimum": 0 }, "outputTokens": { "type": "integer", "minimum": 0 }, "cacheReadTokens": { "type": "integer", "minimum": 0 }, "cacheWriteTokens": { "type": "integer", "minimum": 0 }, "webSearchRequests": { "type": [ "integer", "null" ], "minimum": 0 }, "costUsd": { "type": [ "number", "null" ] }, "harnessCostUsd": { "type": [ "number", "null" ] } }, "required": [ "model", "inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens" ] }, "SessionOwner": { "type": [ "object", "null" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ] }, "SessionShares": { "type": "object", "properties": { "everyone": { "type": "string", "enum": [ "none", "read", "write" ] }, "users": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "access": { "type": "string", "enum": [ "read", "write" ] }, "createdAt": { "type": "string" } }, "required": [ "userId", "access", "createdAt" ] } } }, "required": [ "everyone", "users" ] }, "Skill": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "content": { "type": "string" }, "type": { "type": "string", "enum": [ "remote", "personal" ] }, "scope": { "type": "string", "enum": [ "global", "swarm", "agent" ] }, "ownerAgentId": { "type": [ "string", "null" ] }, "sourceUrl": { "type": [ "string", "null" ] }, "sourceRepo": { "type": [ "string", "null" ] }, "sourcePath": { "type": [ "string", "null" ] }, "sourceBranch": { "type": "string" }, "sourceHash": { "type": [ "string", "null" ] }, "isComplex": { "type": "boolean" }, "allowedTools": { "type": [ "string", "null" ] }, "model": { "type": [ "string", "null" ] }, "effort": { "type": [ "string", "null" ] }, "context": { "type": [ "string", "null" ] }, "agent": { "type": [ "string", "null" ] }, "disableModelInvocation": { "type": "boolean" }, "userInvocable": { "type": "boolean" }, "version": { "type": "number" }, "isEnabled": { "type": "boolean" }, "systemDefault": { "type": "boolean" }, "invocationCount": { "type": "integer", "description": "Confirmed invocations across all harnesses, at most one per runner session" }, "lastInvokedAt": { "type": [ "string", "null" ] }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" }, "lastFetchedAt": { "type": [ "string", "null" ] } }, "required": [ "id", "name", "description", "content", "type", "scope", "ownerAgentId", "sourceUrl", "sourceRepo", "sourcePath", "sourceBranch", "sourceHash", "isComplex", "allowedTools", "model", "effort", "context", "agent", "disableModelInvocation", "userInvocable", "version", "isEnabled", "systemDefault", "invocationCount", "lastInvokedAt", "createdAt", "lastUpdatedAt", "lastFetchedAt" ] }, "SkillFile": { "type": "object", "properties": { "id": { "type": "string" }, "skillId": { "type": "string" }, "path": { "type": "string" }, "content": { "type": "string" }, "mimeType": { "type": "string" }, "isBinary": { "type": "boolean" }, "size": { "type": [ "number", "null" ] }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" } }, "required": [ "id", "skillId", "path", "content", "mimeType", "isBinary", "size", "createdAt", "lastUpdatedAt" ] }, "AgentSkill": { "type": "object", "properties": { "id": { "type": "string" }, "agentId": { "type": "string" }, "skillId": { "type": "string" }, "isActive": { "type": "boolean" }, "installedAt": { "type": "string" } }, "required": [ "id", "agentId", "skillId", "isActive", "installedAt" ] }, "ScriptVersionRecord": { "type": "object", "properties": { "id": { "type": "string" }, "scriptId": { "type": "string" }, "version": { "type": "number" }, "source": { "type": "string" }, "description": { "type": "string" }, "intent": { "type": "string" }, "signatureJson": { "type": "string" }, "contentHash": { "type": "string" }, "changedByAgentId": { "type": [ "string", "null" ] }, "changedAt": { "type": "string" }, "changeReason": { "type": [ "string", "null" ] } }, "required": [ "id", "scriptId", "version", "source", "description", "intent", "signatureJson", "contentHash", "changedByAgentId", "changedAt", "changeReason" ] }, "ScriptApiRecord": { "type": "object", "properties": { "id": { "type": "string" }, "scriptId": { "type": "string" }, "agentId": { "type": "string" }, "authMode": { "type": "string", "enum": [ "none", "bearer" ] }, "enabled": { "type": "boolean" }, "label": { "type": [ "string", "null" ] }, "callCount": { "type": "number" }, "lastUsedAt": { "type": [ "string", "null" ] }, "createdAt": { "type": "string" } }, "required": [ "id", "scriptId", "agentId", "authMode", "enabled", "label", "callCount", "lastUsedAt", "createdAt" ] }, "McpServer": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "scope": { "type": "string", "enum": [ "global", "swarm", "agent" ] }, "ownerAgentId": { "type": [ "string", "null" ] }, "transport": { "type": "string", "enum": [ "stdio", "http", "sse" ] }, "command": { "type": [ "string", "null" ] }, "args": { "type": [ "string", "null" ] }, "url": { "type": [ "string", "null" ] }, "headers": { "type": [ "string", "null" ] }, "envConfigKeys": { "type": [ "string", "null" ] }, "headerConfigKeys": { "type": [ "string", "null" ] }, "extraAuthorizeParams": { "type": [ "string", "null" ] }, "authMethod": { "type": "string", "enum": [ "static", "oauth", "auto" ], "default": "static" }, "isEnabled": { "type": "boolean" }, "version": { "type": "number" }, "createdAt": { "type": "string" }, "lastUpdatedAt": { "type": "string" } }, "required": [ "id", "name", "description", "scope", "ownerAgentId", "transport", "command", "args", "url", "headers", "envConfigKeys", "headerConfigKeys", "extraAuthorizeParams", "isEnabled", "version", "createdAt", "lastUpdatedAt" ] }, "AgentMcpServer": { "type": "object", "properties": { "id": { "type": "string" }, "agentId": { "type": "string" }, "mcpServerId": { "type": "string" }, "isActive": { "type": "boolean" }, "installedAt": { "type": "string" } }, "required": [ "id", "agentId", "mcpServerId", "isActive", "installedAt" ] }, "TaskTemplate": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "prompt": { "type": "string" }, "kind": { "type": "string", "enum": [ "task", "workflow", "schedule" ], "default": "task" }, "payload": { "type": "object", "additionalProperties": {}, "default": {} }, "category": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" }, "default": [] }, "createdAt": { "type": "string" } }, "required": [ "id", "title", "description", "prompt", "createdAt" ] }, "RbacRole": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "isBuiltin": { "type": "boolean" }, "grantsAll": { "type": "boolean" }, "primary": { "type": "boolean" }, "verbs": { "type": "array", "items": { "type": "string" } } }, "required": [ "id", "name", "description", "isBuiltin", "grantsAll", "primary", "verbs" ] }, "UserRbacRoles": { "type": "object", "properties": { "userId": { "type": "string" }, "roles": { "type": "array", "items": { "$ref": "#/components/schemas/RbacRole" } } }, "required": [ "userId", "roles" ] }, "User": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "minLength": 1 }, "email": { "type": "string" }, "role": { "type": "string" }, "notes": { "type": "string" }, "emailAliases": { "type": "array", "items": { "type": "string" }, "default": [] }, "preferredChannel": { "type": "string", "default": "slack" }, "timezone": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": {} }, "dailyBudgetUsd": { "type": [ "number", "null" ] }, "status": { "type": "string", "enum": [ "invited", "active", "suspended" ], "default": "active" }, "createdAt": { "type": "string", "format": "date-time" }, "lastUpdatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "createdAt", "lastUpdatedAt" ] }, "WorkflowDefinition": { "type": "object", "properties": { "nodes": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowNode" }, "minItems": 1 }, "onNodeFailure": { "type": "string", "enum": [ "fail", "continue" ], "default": "fail", "description": "Behavior when a node's task fails or is cancelled. 'fail' (default): mark the entire run as failed. 'continue': treat the failed node as completed with error output and proceed — downstream convergence nodes receive '[FAILED: reason]' and can handle partial results." } }, "required": [ "nodes" ] }, "WorkflowNode": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique node identifier, used in 'next' and 'inputs' mappings" }, "type": { "type": "string", "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'system-one-decision', 'system-one-extraction', 'validate', 'property-match'" }, "label": { "type": "string", "description": "Human-readable label for UI display" }, "config": { "type": "object", "additionalProperties": {}, "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, routingReason?, routingNote?, tags?, priority?, dir?, vcsRepo?, model? }; configured agentId defaults routingReason to human_pinned. For script: { runtime, script, args?, env?, timeout? }; env is a string-to-string map of environment variables with interpolated values and can be used alongside args. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode?, timeoutMs? (1000-300000) }. For system-one-decision (typed decisions, Jev by default): { provider? ('typesafe' default | 'openrouter' | 'laya'; a literal, never a {{token}}), state, questions: { : { type: 'noul'|'choice'|'score', instructions, criteria? } }, returns: { : { type } }, model? (provider-specific; unset = the provider's default, and laya has none so it sends no model and picks its own checkpoint), timeoutMs?, maxRetries? (0-3), humanReview? { band: { min, max } (0-1, inclusive), approvers: { users?, roles?, policy }, title?, timeout?, notifications? } }; each provider needs its own global secret (TYPESAFE_API_KEY, OPENROUTER_API_KEY, or LAYA_API_KEY; laya also needs the global config LAYA_URL), and a save warns and a run fails before any node executes when one is missing; system-one-decision nodes must not set retry or validation.retry. With humanReview, an answer whose confidence is inside the band waits for a person (human-in-the-loop approval), and next must map ports { approved, rejected?, timeout? }. For system-one-extraction (typed extraction, Cloudflare Clairic by default): { provider? ('cloudflare'; a literal), state (text to read; may be empty when images are sent), fields: { : { type: 'text'|'number'|'date'|'time'|'datetime'|'duration'|'list'|'estimate'|'forecast', instructions?, ...type options (number: unit?, integer?, decimals?; duration: unit? (seconds..years), integer?, decimals?; list: items ('text'|'number'|'date'); estimate: min, max, step?, scale?, unit?; forecast: min, max, horizon?, interval?, scale?, unit?; text/number/date/time/datetime/duration: null_threshold?) } }, images? (max 4 base64 data: URLs or { content_type, base64 }), referenceDate? (YYYY-MM-DD), model?, timeoutMs?, maxRetries? (0-3) }; output answers. carries value (null when the input does not say), guess, p_null, confidence, span/spans, and for estimate/forecast median/p10/p90. Needs the global secret CLOUDFLARE_API_TOKEN (or CLOUDFLARE_API_KEY) and the global config CLOUDFLARE_ACCOUNT_ID; must not set retry or validation.retry. Agent-task templates and ordinary config values support {{interpolation}} from the node's inputs context, including trigger and declared upstream aliases. SECURITY: executable source for script/swarm-script nodes does not interpolate trigger.* or upstream node outputs; only input/workflow/swarm/run values are allowed in inline script source, and named swarm-script source is not workflow-interpolated. Pass dynamic values through config.args instead (inline script receives them as argv, with runtime: \"bash\" running bash -c