{ "openapi": "3.1.0", "info": { "title": "Aiden Remote API", "version": "1.0.0", "description": "Normative Aiden On The Go REST/SSE contract. Filesystem paths and credentials are never wire identifiers." }, "x-aiden-json-response-emission": { "maximumUtf8Bytes": 1048576, "overflowStatus": 413, "overflowErrorCode": "payload_too_large", "atomic": true }, "x-aiden-context-private-response-fields": { "appliesTo": [ "Chat", "ChatSummary", "Bot", "ChatTaskProgress", "ChatAgentRoster" ], "recursive": true, "normalization": "Remove hyphens, underscores, periods, and whitespace, then lowercase before comparison.", "forbiddenNormalizedNames": [ "credential", "credentials", "secret", "secrets", "apikey", "token", "accesstoken", "refreshtoken", "header", "headers", "endpoint", "path", "prompt", "instructions", "openinggreeting", "argument", "arguments", "args", "toolargument", "toolarguments", "toolargs", "result", "results", "toolresult", "toolresults", "reasoning", "reasoningcontent", "authorization", "credentialdigest", "providerfingerprint", "mcpserverbindings", "folderpath", "repositorypath", "worktreepath", "worktreegitdir", "ownershiptoken", "worktreedevice", "worktreeinode", "createdfromhead", "canonicalpath", "absolutepath", "scriptpath", "managedhomepath", "managedworkspacepath", "workspacepath", "bothomepath", "systemprompt", "skillcontent", "skillcontents", "skillpath", "skillpaths", "providercredential", "mcpcredential", "connectioncredential", "authorizationheader", "providerheaders", "mcpheaders", "connectionheaders", "providerapikey", "mcpapikey", "connectionapikey", "credentialmaterial", "assetfilename", "avatarassetfilename", "temporaryasseturl", "temporaryurl", "environment", "stdout", "stderr" ], "allowedSchemaProperties": [ "BotDetail.instructions" ], "chatSummaryOnlyForbiddenNormalizedNames": [ "messages", "attachments", "htmlartifacts", "outcome", "timeline", "reasoning", "botid", "providerid", "modelid", "preview" ] }, "servers": [ { "url": "https://{host}/api/aiden/v1", "variables": { "host": { "default": "aiden.invalid" } } } ], "security": [ { "deviceBearer": [], "protocolVersion": [] } ], "paths": { "/providers": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "createProvider", "x-aiden-capability": "workspace:manage", "x-aiden-additional-capabilities": [ "server:read" ], "x-aiden-feature": "providers-create-v1", "description": "Contract revision 22 (providers-create-v1). Create a custom provider on the paired host without contacting its endpoint. Credentials are write-only and stored encrypted on the host. Creation is scoped to the authenticated device and Idempotency-Key. Replays never overwrite an existing connection or rotate its key.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderCreation" } } } }, "responses": { "201": { "description": "Created provider or recovered creation receipt", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderCreationReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/health": { "get": { "operationId": "health", "description": "Unauthenticated readiness. Without a query the body is exactly {ok, protocolVersion}. Contract revision 19 adds the opt-in detail=host query, which returns the non-secret host descriptor that desktop controllers use to identify and group hosts. Any other query is invalid_request.", "security": [], "parameters": [ { "name": "detail", "in": "query", "required": false, "schema": { "enum": [ "host" ] } } ], "responses": { "200": { "description": "Minimal readiness, or the host descriptor when detail=host", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Health" }, { "$ref": "#/components/schemas/HostHealth" } ] } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/pairing/manual-bootstrap": { "post": { "operationId": "pairingManualBootstrap", "security": [], "description": "Returns the active pairing trust envelope encrypted under the locally displayed 100-bit setup code. The code is never sent in this request.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "maxProperties": 0, "additionalProperties": false } } } }, "responses": { "200": { "description": "Sealed pairing trust envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualPairingBootstrap" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/pairing/exchange": { "post": { "operationId": "pairingExchange", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingExchangeRequest" } } } }, "responses": { "200": { "description": "Issued device credential", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingExchangeResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/server": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getServer", "x-aiden-capability": "server:read", "responses": { "200": { "description": "Safe server projection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Server" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/device/identity": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "patch": { "operationId": "updateDeviceIdentity", "x-aiden-capability": "server:read", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceIdentityRequest" } } } }, "responses": { "200": { "description": "Updated presentation-only client-device label", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceIdentityResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/device/capabilities": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "updateDeviceCapabilities", "x-aiden-capability": "server:read", "description": "Additive post-pairing negotiation. Any device may request tasks:read and agents:read; only a paired mac or linux device may request simulators:control, which is never advertised to phones or tablets. Bot and legacy grants remain pairing-bound. The response returns the authenticated device's complete updated grant list. Compatibility: an older Aiden cannot load a device record holding simulators:control, so downgrading the serving Mac after a desktop negotiates it requires re-pairing that desktop.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceCapabilitiesUpdateRequest" } } } }, "responses": { "200": { "description": "Complete updated capability grants", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceCapabilitiesUpdateResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listWorkspaces", "x-aiden-capability": "workspace:read", "responses": { "200": { "description": "Workspace list", "content": { "application/json": { "schema": { "type": "object", "required": [ "workspaces" ], "properties": { "workspaces": { "type": "array", "items": { "$ref": "#/components/schemas/Workspace" } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createWorkspace", "x-aiden-capability": "workspace:manage", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceCreate" } } } }, "responses": { "201": { "description": "Workspace created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Workspace" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}": { "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getWorkspace", "x-aiden-capability": "workspace:read", "responses": { "200": { "description": "Workspace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Workspace" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "updateWorkspace", "x-aiden-capability": "workspace:manage", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspacePatch" } } } }, "responses": { "200": { "description": "Updated workspace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Workspace" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "unregisterWorkspace", "x-aiden-capability": "workspace:manage", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "204": { "description": "Registry record removed; folder untouched" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspace-browser/roots": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listWorkspaceBrowserRoots", "x-aiden-capability": "workspace:browse", "responses": { "200": { "description": "Approved roots", "content": { "application/json": { "schema": { "type": "object", "required": [ "roots" ], "properties": { "roots": { "type": "array", "items": { "$ref": "#/components/schemas/BrowserRoot" } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspace-browser/children": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listWorkspaceBrowserChildren", "x-aiden-capability": "workspace:browse", "parameters": [ { "name": "location", "in": "query", "required": true, "schema": { "type": "string", "pattern": "^loc_[A-Za-z0-9_-]{43}$" } }, { "name": "cursor", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^cur_[A-Za-z0-9_-]{43}$" } } ], "responses": { "200": { "description": "Bounded directory page", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrowserPage" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspace-browser/selections": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "createWorkspaceSelection", "x-aiden-capability": "workspace:browse", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "location" ], "properties": { "location": { "type": "string", "pattern": "^loc_[A-Za-z0-9_-]{43}$" } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Single-use selection nonce", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorkspaceSelection" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chat-summaries": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listChatSummaries", "description": "Returns a transcript-free frozen page of regular chat metadata, ordered by updatedAt descending and then chat ID ascending. Cursors are opaque, integrity protected, expire after five minutes, and never restart pagination implicitly.", "x-aiden-capability": "chat:read", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 100 } }, { "name": "cursor", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 512 } } ], "responses": { "200": { "description": "Transcript-free chat summary page", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatSummaryPage" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listChats", "x-aiden-capability": "chat:read", "parameters": [ { "name": "workspaceId", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Chat list", "content": { "application/json": { "schema": { "type": "object", "required": [ "chats" ], "properties": { "chats": { "type": "array", "items": { "$ref": "#/components/schemas/Chat" } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createChat", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "workspaceId" ], "properties": { "workspaceId": { "type": "string" }, "providerId": { "type": "string" }, "modelId": { "type": "string" }, "noWorkspace": { "type": "boolean", "const": true, "description": "Contract revision 51. Sent by a phone starting a chat under Chats (workspaceId names a hidden No workspace record): the host saves the chat in a hidden folder of its own, a fresh one when the named record already holds a chat. Without it the chat stays in the workspace named." } }, "additionalProperties": false } } } }, "responses": { "201": { "description": "Chat created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chat" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChat", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "responses": { "200": { "description": "Chat snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chat" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "updateChat", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "title" ], "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 200 } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Updated chat", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chat" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "deleteChat", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "204": { "description": "Chat removed" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/read": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "markChatRead", "description": "Record that this device displayed the chat through a persisted message, clearing its unread marker on every surface. Markers only move forward, so stale or duplicate reports are harmless no-ops; an unknown throughMessageId never advances the marker. Without throughMessageId the marker covers the newest persisted message. Available only when the server advertises chat-read-state-v1.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/ChatId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "throughMessageId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "additionalProperties": false } } } }, "responses": { "204": { "description": "Read report accepted" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/triage": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "setChatTriage", "description": "Pin, mark done or snooze a chat in the Inbox. Each field present is set and the others are kept (last writer wins per field); snoozeUntil null wakes the chat. The acting device computes snooze presets in its own time zone and sends an absolute time. With ifRevision, the write lands only when the chat's triage revision still matches (0 for a chat with no triage), so an Undo never overwrites a newer change; a mismatch answers 409 revision_conflict with currentRevision. Triage lives outside the chat and never changes its revision. Bot chats are refused. Available only when the server advertises chat-triage-v1.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "minProperties": 1, "properties": { "pinned": { "type": "boolean" }, "done": { "type": "boolean" }, "restoreDoneAt": { "type": "string", "format": "date-time", "maxLength": 40, "description": "Original Done time to restore on Undo. Requires done=true and ifRevision." }, "snoozeUntil": { "oneOf": [ { "type": "string", "format": "date-time", "maxLength": 40 }, { "type": "null" } ] }, "ifRevision": { "type": "integer", "minimum": 0 } }, "dependentSchemas": { "restoreDoneAt": { "required": [ "done", "ifRevision" ], "properties": { "done": { "const": true } } } }, "anyOf": [ { "required": [ "pinned" ] }, { "required": [ "done" ] }, { "required": [ "snoozeUntil" ] } ], "additionalProperties": false } } } }, "responses": { "200": { "description": "The chat's triage after the write", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatTriage" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/move": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "moveChat", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "workspaceId", "confirmedForeground" ], "properties": { "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "confirmedForeground": { "const": true } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Chat moved to the selected workspace", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Chat" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/worktree": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "moveChatToNewWorktree", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "x-aiden-capabilities": [ "chat:write", "git:write", "chat:new-worktree" ], "description": "Contract revision 53. New worktree for a phone's first message: the Mac makes a managed worktree from the chat's workspace (from the repository's default branch, fetched from its remote when there is one) on a branch named from text (aiden/), then moves the still-empty chat into the worktree's workspace and returns it. Send the turn afterwards as usual. One worktree per chat. For 24 hours the same Idempotency-Key and body replay a 200 answer as it was; after a refusal the key is settled and a same-key retry answers 409 internal_error, not the first refusal, so a client mints a new key after any answer. An empty chat already in the worktree this route made for it answers 200 with it whatever the revision or key. 409 revision_conflict for a stale If-Match, checked again at the move; 409 operation_stale when the chat already has messages; 409 git_capability_denied when Git could not make it (the message says why, without a path); 409 workspace_unavailable when the workspace has no folder or no access. It can take a while when the base is fetched.", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 4000 } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "The chat, now in the new worktree's workspace", "content": { "application/json": { "schema": { "type": "object", "required": [ "chat", "branch" ], "properties": { "chat": { "$ref": "#/components/schemas/Chat" }, "branch": { "type": "string", "minLength": 1, "maxLength": 200 } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/fork": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "forkChat", "description": "Contract revision 21 fork (chat-fork-v1). Creates a new chat in the same workspace from one message of a regular chat. position after keeps everything through the chosen settled assistant reply; position before keeps everything before the chosen user prompt and returns that prompt as prefill so the device can edit and resend it in the fork, with its attachments restaged for this device. A summary request (chat-fork-summary-v1) starts the fork with a pending summary of what followed the cut in the source. Bot chats are not forked (not_found). An ineligible message is invalid_request, a busy source is operation_in_progress, and a fork too large to copy is payload_too_large. Contract revision 64 (chat:continue-in-new-chat, which the device must hold): the body { continueIn: { workspaceId } } continues a chat whose workspace folder is gone in a new chat in that workspace, or in No workspace when it names a hidden noWorkspace record. The fork keeps everything through the newest assistant reply (forkedFrom.position after), carries no prefill, and leaves the original chat as it is. A chat whose folder is present, the chat's own workspace, the Assistant, or a chat with no reply yet is invalid_request; an unknown workspace is not_found; a destination whose own folder is missing too is a non-retryable operation_in_progress whose message says so.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatForkRequest" } } } }, "responses": { "201": { "description": "Fork created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatForkResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/fork-summary/{action}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "chatForkSummaryAction", "description": "Contract revision 21 fork summary actions (chat-fork-summary-v1). retry asks for a failed summary again with the same focus, skip continues without the summary (the fork becomes a plain fork), and both return the Chat. cancel stops a running summary, which becomes failed, and returns ChatForkSummaryCancel. A chat without a fork summary is not_found; a summary that moved on (finished, retried or cancelled elsewhere) is revision_conflict.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "action", "in": "path", "required": true, "schema": { "enum": [ "retry", "skip", "cancel" ] } } ], "responses": { "200": { "description": "Summary action applied", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/Chat" }, { "$ref": "#/components/schemas/ChatForkSummaryCancel" } ] } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/tasks": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatTasks", "description": "Authoritative bounded task-progress snapshot for one chat. Requires the negotiated tasks:read grant in addition to chat:read.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-capabilities": [ "chat:read", "tasks:read" ], "parameters": [ { "$ref": "#/components/parameters/ChatId" } ], "responses": { "200": { "description": "Canonical chat task projection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatTaskProgress" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/agents": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatAgents", "description": "Authoritative bounded delegated-agent roster for one chat's active or most recent turn. Requires the negotiated agents:read grant in addition to chat:read.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-capabilities": [ "chat:read", "agents:read" ], "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/PublicTurnId" } ], "responses": { "200": { "description": "Canonical chat agent roster", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAgentRoster" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/agents/{agentId}/interrupt": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "interruptChatAgent", "description": "Stop one running delegated agent in the chat's active turn through the Mac's own subagent stop path, then return the refreshed current-turn roster. Available only when /server.features advertises chat-agent-interrupt-v1. Requires chat:write plus the negotiated agents:read grant; retained Bot chats additionally require bot:write. The agent is addressed only by its public agentId. An already-finished or abandoned agent is an idempotent no-op that returns the roster; an unknown agentId returns not_found; a running agent whose Mac-side control is no longer available (for example a legacy run) returns operation_stale. The request has no body.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "x-aiden-capabilities": [ "chat:write", "agents:read" ], "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/AgentId" } ], "responses": { "200": { "description": "Refreshed current-turn chat agent roster", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatAgentRoster" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/context": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatContextPressure", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-feature": "chat-context-pressure-v1", "description": "Contract revision 41. The next-request context pressure the host's own composer meter shows for one workspace chat, reduced to bounded counts: no breakdown, prompt cache, tool or server names, paths or text. Announced by `chat-context-pressure-v1` to paired desktops only. Without a query the chat's own model prices the request; `providerId` and `modelId` together price a model the host has configured instead (one it has not is invalid_request, and either alone is invalid_request). `pressure` is null when the host cannot project the chat now (no model, or its history is unavailable). The device's unsent draft is not included. Bot chats are not projected (not_found). Bot-chat reads otherwise follow the same bot:read rule as other chat reads.", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "providerId", "in": "query", "required": false, "description": "A configured host provider, sent together with modelId. Request URLs carry no percent-encoding, so only characters a query takes literally are allowed.", "schema": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9._~:@/!$()*,;-]+$" } }, { "name": "modelId", "in": "query", "required": false, "description": "A model of that provider, sent together with providerId.", "schema": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9._~:@/!$()*,;-]+$" } } ], "responses": { "200": { "description": "Next-request context pressure", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatContextPressure" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/skills": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatSkills", "description": "Bounded invocable-skill catalog for one chat, identical to the desktop slash palette projection: opaque invocation leases plus safe display metadata. Bot chats are narrowed to the Bot's currently admitted skills. Requires the negotiated skills:invoke grant in addition to chat:read.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-capabilities": [ "chat:read", "skills:invoke" ], "parameters": [ { "$ref": "#/components/parameters/ChatId" } ], "responses": { "200": { "description": "Canonical chat skill catalog", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatSkillCatalog" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/progress/events": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "chatProgressEvents", "description": "Dedicated chat-scoped live snapshot channel for observing work started by any device. The streamId is the chat ID. Each subscription hydrates complete nonterminal task_update and agents_update snapshots and app_controls_changed read-only revision invalidations filtered to the device's negotiated progress grants; transport heartbeats are SSE comment frames and are not protocol events. Last-Event-ID and after are scoped by optional Aiden-Progress-Epoch. A matching retained projection resumes without duplicate snapshots; epoch mismatch or missing history hydrates current snapshots. This channel has no durable replay journal across host lifetimes. A device needs chat:read and at least one of tasks:read, agents:read or owner-enabled app-controls:read. These progress events are not emitted on ordinary parent turn streams.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "Aiden-Progress-Epoch", "in": "header", "required": false, "description": "Epoch from the last authenticated task/agent snapshot. A mismatch resets the cursor and hydrates fresh snapshots. Missing preserves legacy behavior.", "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,64}$" } }, { "name": "Last-Event-ID", "in": "header", "required": false, "description": "Last received progress sequence. Supply Aiden-Progress-Epoch to resume only within the same host projection lifetime; mismatches hydrate snapshots.", "schema": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, { "name": "after", "in": "query", "required": false, "description": "Progress cursor, scoped by optional Aiden-Progress-Epoch. The channel does not provide durable replay across epochs.", "schema": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } ], "responses": { "200": { "headers": { "Aiden-Progress-Resumed": { "schema": { "type": "string", "enum": [ "true", "false" ] }, "description": "True only if the supplied progress epoch and cursor match retained current projections; otherwise fresh snapshots follow." } }, "description": "Live chat progress snapshot event stream. Aiden-Progress-Resumed reports whether the epoch-scoped cursor resumed; otherwise current snapshots hydrate the client.", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/turns": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "startTurn", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TurnStartRequest" } } } }, "responses": { "202": { "description": "Turn accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TurnStartResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/attachments": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "uploadChatAttachment", "description": "Stages one image or text file for this device's next turn in the chat. Since contract revision 50, a device holding attachments:raw may instead send one picture as its raw image/png or image/jpeg bytes, with an exact Content-Length (at most 8 MiB) and the file name, percent-encoded UTF-8, in Aiden-Attachment-Name. Both return the same single-use reference; without attachments:raw a raw upload is 403 capability_denied.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AttachmentUpload" } }, "image/png": { "schema": { "$ref": "#/components/schemas/RawAttachmentUpload" } }, "image/jpeg": { "schema": { "$ref": "#/components/schemas/RawAttachmentUpload" } } } }, "responses": { "201": { "description": "Short-lived, single-use attachment reference", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AttachmentReference" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/attachments/{attachmentId}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "delete": { "operationId": "removeChatAttachment", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "attachmentId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^att_[A-Za-z0-9_-]{43}$" } } ], "responses": { "204": { "description": "Temporary attachment removed" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/attachments/{attachmentId}/content": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatAttachmentContent", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "attachmentId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,256}$" } } ], "responses": { "200": { "description": "Bounded raster image content owned by this chat", "content": { "image/png": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 8388608 } }, "image/jpeg": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 8388608 } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/spending": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatSpending", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-feature": "spending-limits-v1", "description": "Contract revision 47. What this chat's total limit allows and what it has spent, in US dollars. Only pay-as-you-go keys count; sign-ins and models on the Mac count as $0. spending is null when no limit applies. state is nearing from 80% of the allowed amount and reached at it.", "responses": { "200": { "description": "The spending status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendingStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/spending/allow-more": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "allowMoreChatSpending", "x-aiden-capability": "chat:write", "x-aiden-feature": "spending-limits-v1", "description": "Contract revision 47. Allow more: adds the limit once more while the status is nearing or reached; a status still under its limit is returned unchanged. The body is an empty object. If-Match carries the status revision, so a repeated or crossed tap gets 409 revision_conflict (with currentRevision) instead of a second allowance. 404 when no limit applies.", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } }, "responses": { "200": { "description": "The spending status after Allow more", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendingStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/jobs": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listChatBackgroundJobs", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-capabilities": [ "chat:read", "chat:jobs" ], "description": "Contract revision 49. What the agent left running for this chat on the Mac (a dev server, a watcher, a long test run), running jobs first, then the ones that ended recently in this session of the Mac app. fromCommand marks processes a run_command call left running, which have no exit code. ports are the TCP ports a running job listens on, on the Mac (localhost there, not on the phone). The list is not pushed: read it again after a reply settles or while it is on screen.", "responses": { "200": { "description": "The chat's background jobs", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BackgroundJobs" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/jobs/{jobId}/stop": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "jobId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^job_[0-9a-f]{8}$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "stopChatBackgroundJob", "x-aiden-capability": "chat:write", "x-aiden-capabilities": [ "chat:write", "chat:jobs" ], "description": "Contract revision 49. Stops a job and everything it started: politely first, forced after a few seconds, and only processes that carry the job's own marker. Returns once it has ended, with the chat's list. A job that already ended is returned as it is. The body is an empty object. 404 not_found for a job this chat does not have.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } }, "responses": { "200": { "description": "The chat's background jobs after the stop", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BackgroundJobs" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/visuals/{visualId}/document": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatVisualDocument", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "x-aiden-feature": "chat-visual-viewer-v1", "description": "Contract revision 35. One self-contained HTML document that draws a visual a message in this chat projects, for phones to open full screen in a locked-down web view. Announced by `chat-visual-viewer-v1`; visual entries gain no new key. The document has no subresources and talks to its host only through the native message channel (iOS `aidenVisual` handler, Android `AidenVisualBridge`) with `ready`, `prompt` and `openUrl` messages. Served `no-store` with a strong ETag (a matching `If-None-Match` gets 304) and gzip when accepted.", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "visualId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,256}$" } }, { "name": "scheme", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "light", "dark" ], "default": "light" } }, { "name": "theme", "in": "query", "required": false, "description": "A preset id from aiden-appearance-v1.json. An id this host does not know falls back to aiden.", "schema": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,31}$", "default": "aiden" } } ], "responses": { "200": { "description": "The viewer document", "content": { "text/html": { "schema": { "type": "string", "maxLength": 12582912 } } } }, "304": { "description": "The document matches If-None-Match" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBots", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "parameters": [ { "name": "includeArchived", "in": "query", "required": false, "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Bounded Bot summaries and authoritative favorite order; instructions are omitted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotList" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createBot", "x-aiden-provider-model-must-be-currently-available": true, "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotCreateRequest" } } } }, "responses": { "201": { "description": "Main-owned Bot created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotDetail" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBot", "x-aiden-archived-access": "readable", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "responses": { "200": { "description": "Bot identity, editable guidance, avatar, and safe access view", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotDetail" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "updateBotIdentity", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotIdentityPatch" } } } }, "responses": { "200": { "description": "Updated authoritative Bot detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotDetail" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "deleteBot", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "204": { "description": "Bot permanently erased: chat, memory, instructions, routines, files and photo" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bot-presets": { "get": { "operationId": "listBotPresets", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "responses": { "200": { "description": "Starter Bot presets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPresetList" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/from-preset": { "post": { "operationId": "createBotFromPreset", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "201": { "description": "Existing preset Bot returned, or one created from the preset", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPresetCreateResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPresetCreateRequest" } } } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/session": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotSession", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read" ], "parameters": [], "responses": { "200": { "description": "The Bot's one durable conversation: newest entries, in-flight partial and state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSession" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/session/entries": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotSessionEntries", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read" ], "description": "Revision 67. The entries just older than `before`, oldest first, projected exactly as this device's session is (the same opt-ins decide what shows). `before` must be an entry the device's current session holds; one it does not (another epoch, or an id it was never sent) is 409 operation_stale, and the client reads the session again. Pages fit the session's byte limit, so a page may hold fewer than `limit` entries; `hasOlder` is truthful. A host older than revision 67 answers 404.", "parameters": [ { "name": "before", "in": "query", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } } ], "responses": { "200": { "description": "One page of older entries", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSessionEntriesPage" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/session/events": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "streamBotSessionEvents", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read" ], "parameters": [], "responses": { "200": { "description": "Server-sent events: snapshot first, then partial, entry, state and closed frames", "content": { "text/event-stream": { "schema": { "$ref": "#/components/schemas/BotSessionEvent" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "x-aiden-event-stream": true, "x-aiden-event-epoch-seq": true } }, "/bots/{botId}/messages": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "sendBotMessage", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "chat:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "200": { "description": "Message accepted (or deduped by Idempotency-Key)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMessageReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMessageRequest" } } } } } }, "/bots/{botId}/attachments": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "uploadBotAttachment", "description": "Contract revision 33, only on hosts announcing bot-attachments-v1. Stages one image or text file for this device's next message to the Bot. Since contract revision 50, a device holding attachments:raw may send one picture as its raw bytes instead, as on POST /chats/{chatId}/attachments. The reference is single-use, expires after ten minutes and is spent only by POST /bots/{botId}/messages for the same Bot and device.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "chat:write" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AttachmentUpload" } }, "image/png": { "schema": { "$ref": "#/components/schemas/RawAttachmentUpload" } }, "image/jpeg": { "schema": { "$ref": "#/components/schemas/RawAttachmentUpload" } } } }, "responses": { "201": { "description": "Short-lived, single-use attachment reference", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AttachmentReference" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/attachments/{attachmentId}": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "delete": { "operationId": "removeBotAttachment", "description": "Contract revision 33, only on hosts announcing bot-attachments-v1. Drops a staged upload the person removed before sending; an unknown reference is already gone.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "chat:write" ], "parameters": [ { "name": "attachmentId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^att_[A-Za-z0-9_-]{43}$" } } ], "responses": { "204": { "description": "Temporary attachment removed" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/resume": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "resumeBotSession", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "200": { "description": "Bot session state after resume", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSessionState" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotResumeRequest" } } } } } }, "/bots/{botId}/dismiss": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "dismissBotSession", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "200": { "description": "Bot session state after dismiss", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSessionState" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } } } }, "/bots/{botId}/queued/{submissionId}/withdraw": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "submissionId", "in": "path", "required": true, "description": "A queued message's submissionId, as the session's queued list names it.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "withdrawBotQueuedMessage", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "chat:write", "bot:activity" ], "description": "Revision 67. Take back one of the person's queued messages before its turn starts, as the host's own Remove does. Requires Idempotency-Key; a repeat replays the original receipt. withdrawn: it will not run. started: its turn already began, so it stays in the chat. gone: the host no longer has it, or it is a routine's input or the Bot's self-introduction, which are not the person's to take back. Needs bot:activity, the grant that shows the queue. A host older than revision 67, or one without Bot chat activity, answers 404.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } }, "responses": { "200": { "description": "What became of the queued message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotQueuedWithdrawReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/stop": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "stopBotSession", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "200": { "description": "Bot session state after stop", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSessionState" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } } } }, "/bots/{botId}/questions/{waitId}/answer": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "waitId", "in": "path", "required": true, "description": "The waitId of the question the Bot is waiting on (BotSession.question.waitId).", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "answerBotQuestion", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "description": "Answers the Bot's quick-reply question. The Idempotency-Key is the request UUID: a repeat with the same key returns the same receipt. Another key for a question that is no longer waiting returns 409 question_expired.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuestionRespondRequest" } } } }, "responses": { "200": { "description": "The answer was recorded for this question. A repeat with the same Idempotency-Key returns the same receipt.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotQuestionAnswerReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/handoffs/{waitId}/answer": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "waitId", "in": "path", "required": true, "description": "The waitId of the hand-off the Bot is waiting on (BotSession.handoff.waitId).", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "answerBotHandoff", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:handoffs" ], "description": "Contract revision 37. Done or Skip on the Bot's waiting hand-off. The Idempotency-Key is the request UUID: a repeat with the same key returns the same receipt. A hand-off that is no longer waiting returns 409 handoff_expired; an answer it does not accept returns 400 invalid_request, as does done on a sign_in hand-off, which is finished on the Mac. A host without the hand-off routes answers not_found; a device without bot:handoffs gets capability_denied.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotHandoffAnswerRequest" } } } }, "responses": { "200": { "description": "The answer settled the hand-off. A repeat with the same Idempotency-Key returns the same receipt.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotHandoffAnswerReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/handoffs/{waitId}/open-on-mac": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "waitId", "in": "path", "required": true, "description": "The waitId of the hand-off the Bot is waiting on (BotSession.handoff.waitId).", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "openBotHandoffOnMac", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:handoffs" ], "description": "Contract revision 37. Brings the Bot's waiting hand-off forward on the Mac: its chat, and for a sign-in, or (contract revision 43) a step on the Bot's own browser or computer, that browser or computer. The body is an empty object. Idempotent per Idempotency-Key: a repeat returns the same receipt and never opens it twice. A hand-off that is no longer waiting returns 409 handoff_expired.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } }, "responses": { "200": { "description": "The Mac was asked to show the hand-off.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotHandoffOpenOnMacReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/spending": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotSpending", "x-aiden-capability": "bot:read", "x-aiden-feature": "spending-limits-v1", "description": "Contract revision 47. What the Bot's monthly limit (its own or the default; the month starts on the owner's chosen day) allows and what it has spent, in US dollars. Only pay-as-you-go keys count; sign-ins and models on the Mac count as $0. spending is null when no limit applies. state is nearing from 80% of the allowed amount and reached at it.", "responses": { "200": { "description": "The spending status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendingStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/spending/allow-more": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "allowMoreBotSpending", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "x-aiden-feature": "spending-limits-v1", "description": "Contract revision 47. Allow more: adds the limit once more while the status is nearing or reached; a status still under its limit is returned unchanged. The body is an empty object. If-Match carries the status revision, so a repeated or crossed tap gets 409 revision_conflict (with currentRevision) instead of a second allowance. 404 when no limit applies.", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } }, "responses": { "200": { "description": "The spending status after Allow more", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpendingStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/issues/{issueId}/act": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "issueId", "in": "path", "required": true, "description": "The id of the issue card the device is answering (BotSession.issues[].id).", "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "actOnBotIssue", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:issues" ], "description": "Contract revision 42. Carries out one action a Bot issue card offers. The Idempotency-Key is the request UUID: a repeat with the same key returns the same receipt and runs the host action once. done means the host carried it out and settled the card (open_chat and open_settings answer done without settling). not_open means the issue is gone or already settled. An unknown action kind, or an action the card never offered (409 operation_stale), records nothing for its key.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotIssueActRequest" } } } }, "responses": { "200": { "description": "The action ran, or nothing was open under that issue id.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotIssueActReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/pause": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "pauseBot", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:handoffs" ], "description": "Contract revision 37. Pauses the Bot: it takes no new turns, routines skip, and a running turn is closed and left interrupted. The body is an empty object. Idempotent per Idempotency-Key; pausing a paused Bot keeps the first pause. Writes to a paused Bot then return 409 bot_paused to devices holding bot:handoffs and 409 operation_stale to every other device.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "maxProperties": 0 } } } }, "responses": { "200": { "description": "The Bot's session state after the pause (paused).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSessionState" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "unpauseBot", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:handoffs" ], "description": "Contract revision 37. Clears the pause. No body. An interrupted turn then waits for Resume. Idempotent per Idempotency-Key.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "200": { "description": "The Bot's session state after the pause was cleared.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotSessionState" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/routines": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotRoutines", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "parameters": [], "responses": { "200": { "description": "Routines of this Bot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineList" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createBotRoutine", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "201": { "description": "Routine created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutine" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineCreateRequest" } } } } } }, "/bots/{botId}/routines/{routineId}": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "$ref": "#/components/parameters/RoutineId" } ], "patch": { "operationId": "updateBotRoutine", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "200": { "description": "Routine updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutine" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineUpdateRequest" } } } } }, "delete": { "operationId": "deleteBotRoutine", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "204": { "description": "Routine deleted" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/connection-requests": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "requestBotConnection", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "200": { "description": "Mac notified to finish connecting the app", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectionRequestReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectionRequest" } } } } } }, "/bots/{botId}/memory": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotMemory", "description": "Contract revision 27 (bot-memory-v1). What the Bot remembers: its own notes (memory) and what it knows about the person (user). Reading it is a chat read. readable false means a memory file could not be read; only the clear edit is offered then.", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read" ], "parameters": [], "responses": { "200": { "description": "The Bot's memory", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMemory" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/memory/edits": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "editBotMemory", "description": "Contract revision 27 (bot-memory-v1). Replace or remove one entry by its content-addressed id, or clear both stores. A stale entry id is memory_entry_not_found (404); a replacement over the store's budget is memory_over_budget (422); one that looks like a password or an instruction to the Bot is memory_blocked (422); an empty or too long text is invalid_request (422).", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMemoryEditRequest" } } } }, "responses": { "200": { "description": "The edit applied", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMemoryEditResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/routine-proposals/{proposalId}/respond": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "$ref": "#/components/parameters/ProposalId" } ], "post": { "operationId": "respondBotRoutineProposal", "description": "Contract revision 27 (bot-proactive-v1). Accept creates the routine the Bot suggested (once, whichever device answers); dismiss records Not now. A repeated answer returns the settled status unchanged. An unknown proposal is routine_proposal_not_found (404).", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineProposalRespondRequest" } } } }, "responses": { "200": { "description": "The settled answer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineProposalRespondResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/routine-suggestions": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotRoutineSuggestions", "description": "Contract revision 27 (bot-proactive-v1). Starter routines for a Bot with none: a Daily check-in that opens the routine editor prefilled. Empty once the Bot has any routine. Nothing is created until the person saves the routine.", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "parameters": [], "responses": { "200": { "description": "Routine suggestions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineSuggestionList" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/routine-notifications": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotRoutineNotifications", "description": "Contract revision 27 (bot-proactive-v1). Finished runs of Bot routines that notify: a visible reply or a failure (silent, skipped and duplicate runs are left out), newest first, at most 100. Previews are redacted. Clients poll on foreground and post one local notification per id; there is no push.", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read" ], "parameters": [ { "name": "since", "in": "query", "required": false, "description": "Only notifications that became visible after this host time. Pass the previous response's now, the last completed millisecond included in that poll.", "schema": { "type": "string", "format": "date-time" } } ], "responses": { "200": { "description": "Bot routine notifications", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineNotificationList" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bot-conversations": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotConversations", "x-aiden-archived-access": "readable", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read" ], "parameters": [ { "name": "cursor", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, { "name": "query", "in": "query", "required": false, "schema": { "type": "string", "maxLength": 200 } }, { "name": "botId", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 30 } } ], "responses": { "200": { "description": "Newest-first bounded Bot conversation page", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConversationPage" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/chats": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "createBotChat", "x-aiden-canonical-chat-per-bot": true, "x-aiden-provider-model-must-be-currently-available": true, "x-aiden-provider-model-required-only-when-creating": true, "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "chat:write" ], "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotChatCreateRequest" } } } }, "responses": { "201": { "description": "Existing canonical Bot chat returned, or one authoritative chat created when absent; 201 is retained for v1 client compatibility", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotChatCreateResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bot-capabilities": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotCapabilityCatalog", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "parameters": [ { "$ref": "#/components/parameters/BotIdQuery" } ], "responses": { "200": { "description": "Safe opaque Bot capability catalog; no paths, credentials, headers, or fingerprints", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotCapabilityCatalog" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/capabilities": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "patch": { "operationId": "updateBotAccess", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAccessUpdateRequest" } } } }, "responses": { "200": { "description": "Authoritative Bot access policy after a revision-checked update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAccessView" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bot-conversations/{chatId}/files": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotConversationFiles", "x-aiden-archived-access": "readable", "x-aiden-capability": "files:read", "x-aiden-capabilities": [ "bot:read", "files:read" ], "responses": { "200": { "description": "Bounded file index authorized against the Bot chat and current policy epoch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileIndex" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bot-conversations/{chatId}/files/{fileId}": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^file_[A-Za-z0-9_-]{43}$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "readBotConversationFile", "x-aiden-archived-access": "readable", "x-aiden-capability": "files:read", "x-aiden-capabilities": [ "bot:read", "files:read" ], "responses": { "200": { "description": "Readable text document authorized against the Bot chat and current policy epoch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDocument" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "put": { "operationId": "writeBotConversationFile", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "files:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "files:write" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "content", "expectedVersion" ], "properties": { "content": { "type": "string", "maxLength": 5242880 }, "expectedVersion": { "type": "string", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Authoritative saved Bot-chat document", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDocument" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/avatar": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "put": { "operationId": "putBotAvatar", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAvatarUploadRequest" } } } }, "responses": { "200": { "description": "Canonical normalized Bot avatar metadata", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAvatarAsset" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "deleteBotAvatar", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write" ], "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "200": { "description": "Bot detail after returning to the semantic avatar fallback", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotDetail" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/avatar/{assetRevision}": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/AssetRevision" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotAvatarContent", "x-aiden-archived-access": "readable", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read" ], "responses": { "200": { "description": "Authenticated canonical Bot avatar content", "headers": { "Cache-Control": { "required": true, "schema": { "const": "no-store" } }, "X-Content-Type-Options": { "required": true, "schema": { "const": "nosniff" } } }, "content": { "image/png": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 4194304 } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/streams/{streamId}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getStream", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/StreamId" } ], "responses": { "200": { "description": "Stream status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/streams/{streamId}/events": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "streamEvents", "description": "Resumable SSE stream for one device-owned turn. Last-Event-ID or after is the last delivered decimal sequence; a cursor ahead of the stream head returns 400 invalid_request. Contract revision 65: for after < earliest - 1 (where earliest is the oldest retained journal sequence), the server synthesizes a connection-local nonterminal snapshot at sequence = earliest - 1 with nextSequence = earliest, then replays every retained journal event from earliest onward (including the terminal event on finished streams), leaving the journal and other subscribers untouched. Devices holding stream:snapshot-reasons receive reason: gap | reset on snapshot payloads; other devices receive the three-key snapshot payload.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/StreamId" }, { "name": "Last-Event-ID", "in": "header", "required": false, "schema": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, { "name": "after", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } ], "responses": { "200": { "description": "Resumable event stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/streams/{streamId}/approval": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getStreamApproval", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "description": "Contract revision 39: devices holding schedule:cards and schedule:read receive schedule (ApprovalSchedule) on a scheduled-task approval. It is display-only and never changes canAllow.", "parameters": [ { "$ref": "#/components/parameters/StreamId" } ], "responses": { "200": { "description": "Current bounded approval snapshot for this stream", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamApprovalSnapshot" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/streams/{streamId}/question": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getStreamQuestion", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/StreamId" } ], "responses": { "200": { "description": "Current bounded question prompt for this stream", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamQuestionSnapshot" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/streams/{streamId}/cancel": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "cancelStream", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/StreamId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "202": { "description": "Cancellation accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/streams/{streamId}/inputs": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "submitStreamInput", "description": "Shared foreground admission for mid-flight user input (advertised as the chat-run-input-v1 server feature). The Mac host derives the chat from the stream, revalidates ownership and run state, persists the user message before returning an accepted receipt, and binds the admission to the Idempotency-Key request UUID. Domain rejections return 200 with status=rejected so the client draft stays unconsumed; committed=true means the message is durable transcript history and must not be resent.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "chat:write", "parameters": [ { "$ref": "#/components/parameters/StreamId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamInputRequest" } } } }, "responses": { "200": { "description": "Admission outcome for the requested input", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamInputResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approvals/{approvalId}/respond": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "respondApproval", "description": "Resolve an approval owned by this device. Allowing schedule_task or edit_automation additionally requires schedule:write; clients without that grant may deny only. Contract revision 25: an approvalId that is a durable Bot approval waitId (BotSession.approval) is answered on that Bot by any device holding bot:read and bot:write as well; only scope once is accepted, and allowing one whose canAllow is false is capability_denied (deny still works).", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "approval:respond", "parameters": [ { "name": "approvalId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "decision" ], "properties": { "decision": { "enum": [ "allow", "deny" ] }, "scope": { "$ref": "#/components/schemas/ToolApprovalScope", "description": "Contract revision 17. Optional and valid only with decision allow. once (the default) authorizes this call only; chat and always remember the exact same tool and normalized target for this chat or, until revoked on the desktop, for this workspace. The scope must be one listed in PendingApproval.scopes, otherwise the request is invalid_request." } }, "if": { "required": [ "scope" ] }, "then": { "properties": { "decision": { "const": "allow" } } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Approval resolved", "content": { "application/json": { "schema": { "type": "object", "required": [ "approvalId", "decision", "resolvedAt" ], "properties": { "approvalId": { "type": "string" }, "decision": { "enum": [ "allow", "deny" ] }, "scope": { "$ref": "#/components/schemas/ToolApprovalScope", "description": "Echoed only when the request carried a scope." }, "resolvedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/questions/{promptId}/respond": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "respondQuestion", "description": "Resolve a pending question prompt owned by this device. The host only offers the ask_user_question tool to turns started by devices that negotiated questions:respond.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "questions:respond", "parameters": [ { "name": "promptId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuestionRespondRequest" } } } }, "responses": { "200": { "description": "Question resolved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuestionRespondResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/models": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listModels", "x-aiden-capability": "chat:read", "responses": { "200": { "description": "Configured provider/model projection", "content": { "application/json": { "schema": { "type": "object", "required": [ "providers", "defaults" ], "properties": { "providers": { "type": "array", "items": { "$ref": "#/components/schemas/Provider" } }, "defaults": { "type": "object", "description": "providerId and modelId of the model a new chat starts on. Contract revision 70 adds thinkingLevel, only while agentSlider is present and the default is exactly the host's last provider and model: the host's last level fitted to that model's levels, absent when the fit has none.", "properties": { "thinkingLevel": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ] } }, "additionalProperties": { "type": "string" } }, "agentSlider": { "$ref": "#/components/schemas/AgentSlider" } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/speech": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getSpeechStatus", "x-aiden-capability": "server:read", "responses": { "200": { "description": "Paired-Mac local speech engine and model status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "selectSpeechModel", "x-aiden-capability": "chat:write", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "modelId" ], "properties": { "modelId": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Updated local speech selection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/speech/models/{modelId}/download": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" } } ], "post": { "operationId": "downloadSpeechModel", "x-aiden-capability": "chat:write", "responses": { "202": { "description": "Model download accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "cancelSpeechModelDownload", "x-aiden-capability": "chat:write", "responses": { "200": { "description": "Current model download status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/speech/models/{modelId}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "modelId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" } } ], "delete": { "operationId": "deleteSpeechModel", "x-aiden-capability": "chat:write", "responses": { "200": { "description": "Speech status after deleting the local model", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/speech/transcriptions": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "transcribeSpeech", "x-aiden-capability": "chat:write", "description": "Transcribes one explicit, bounded recording locally on the paired Mac. Audio is not retained and the current Parakeet model returns a final result only. Since contract revision 34, hosts advertising speech-request-gzip-v1 in GET /server.features accept one gzip-compressed JSON request body; clients without that feature send identity JSON. Encoded and expanded bodies are each limited to 2561024 bytes; trailing bytes and concatenated gzip members are rejected.", "parameters": [ { "name": "Content-Encoding", "in": "header", "required": false, "description": "Optional identity or gzip for this route only. Send gzip only when GET /server.features contains speech-request-gzip-v1.", "schema": { "type": "string", "enum": [ "identity", "gzip" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechTranscriptionRequest" } } } }, "responses": { "200": { "description": "Final local transcript", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeechTranscription" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/usage": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getUsageSummary", "x-aiden-capability": "server:read", "parameters": [ { "name": "range", "in": "query", "required": true, "schema": { "enum": [ "7d", "30d", "90d", "1y", "all" ] } } ], "responses": { "200": { "description": "Privacy-safe aggregate usage from this Aiden Agent installation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UsageSummary" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/files": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listWorkspaceFiles", "x-aiden-capability": "files:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "name": "tree", "in": "query", "schema": { "type": "string", "enum": [ "1" ] }, "description": "Opt into nonrecursive directory pages. Required when directory or cursor is supplied." }, { "name": "directory", "in": "query", "schema": { "type": "string", "pattern": "^file_[A-Za-z0-9_-]{43}$" }, "description": "Opaque directory handle from a file page; omitted for workspace root." }, { "name": "cursor", "in": "query", "schema": { "type": "string", "pattern": "^cur_[A-Za-z0-9_-]{43}$" }, "description": "Expiring device/workspace/directory-bound continuation. An evicted snapshot returns handle_expired." } ], "responses": { "200": { "description": "Legacy bounded recursive file index, or at most 200 direct children when tree=1. Page responses include directoryPath; nextCursor indicates more captured children. truncated reports omitted/scan-limited entries, not pagination.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileIndex" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/files/{fileId}": { "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "name": "fileId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^file_[A-Za-z0-9_-]{43}$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "readWorkspaceFile", "x-aiden-capability": "files:read", "responses": { "200": { "description": "Readable text document", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDocument" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "put": { "operationId": "writeWorkspaceFile", "x-aiden-capability": "files:write", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "content", "expectedVersion" ], "properties": { "content": { "type": "string", "maxLength": 5242880 }, "expectedVersion": { "type": "string", "maxLength": 128 } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Authoritative saved document", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FileDocument" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/review": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "reviewGitWorkspace", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "responses": { "200": { "description": "Bounded repository review snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/diff": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "readGitDiff", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitDiffRequest" } } } }, "responses": { "200": { "description": "Bounded diff from an immutable review snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/branches": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listGitBranches", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "responses": { "200": { "description": "Allowlisted branch projection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createGitBranch", "x-aiden-capability": "git:write", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitCreateBranchRequest" } } } }, "responses": { "202": { "description": "Branch creation accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/checkout": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "checkoutGitBranch", "x-aiden-capability": "git:write", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitCheckoutRequest" } } } }, "responses": { "202": { "description": "Checkout accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/commit": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "commitGitWorkspace", "x-aiden-capability": "git:write", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitCommitRequest" } } } }, "responses": { "202": { "description": "Snapshot-bound commit accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/push-capability": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getGitPushCapability", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "responses": { "200": { "description": "Safe push capability and reason", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/push": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "pushGitWorkspace", "x-aiden-capability": "git:write", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitPushRequest" } } } }, "responses": { "202": { "description": "Reviewed push accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/compare": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "compareGitBranch", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitCompareRequest" } } } }, "responses": { "200": { "description": "Immutable comparison snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/comparison-diff": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "readGitComparisonDiff", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitComparisonDiffRequest" } } } }, "responses": { "200": { "description": "Bounded comparison diff", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/worktrees": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listGitWorktrees", "x-aiden-capability": "git:read", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" } ], "responses": { "200": { "description": "Worktrees without filesystem or Git-admin paths", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createGitWorktree", "x-aiden-capability": "git:write", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitCreateWorktreeRequest" } } } }, "responses": { "202": { "description": "Managed worktree creation accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/workspaces/{workspaceId}/git/managed-worktree": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "delete": { "operationId": "removeManagedGitWorktree", "x-aiden-capability": "git:write", "parameters": [ { "$ref": "#/components/parameters/WorkspaceId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForegroundConfirmation" } } } }, "responses": { "202": { "description": "Persisted-ID-bound managed worktree removal accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GitResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listScheduledTasks", "x-aiden-capability": "schedule:read", "responses": { "200": { "description": "Task list", "content": { "application/json": { "schema": { "type": "object", "required": [ "tasks" ], "properties": { "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduledTask" } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createScheduledTask", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskMutation" } } } }, "responses": { "201": { "description": "Created task", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTask" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/{taskId}": { "parameters": [ { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getScheduledTask", "x-aiden-capability": "schedule:read", "responses": { "200": { "description": "Task", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTask" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "updateScheduledTask", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTaskMutation" } } } }, "responses": { "200": { "description": "Updated task", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTask" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "removeScheduledTask", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "responses": { "204": { "description": "Task removed" }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/{taskId}/pause": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "pauseScheduledTask", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/TaskId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "202": { "description": "Pause accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTask" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/{taskId}/resume": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "resumeScheduledTask", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/TaskId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "202": { "description": "Resume accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduledTask" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/{taskId}/run": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "runScheduledTask", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/TaskId" }, { "$ref": "#/components/parameters/IfMatch" }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "responses": { "202": { "description": "Durable run accepted; socket loss does not cancel it", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleRunAccepted" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/{taskId}/runs": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listScheduledTaskRuns", "x-aiden-capability": "schedule:read", "parameters": [ { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Bounded redacted run history", "content": { "application/json": { "schema": { "type": "object", "required": [ "runs" ], "properties": { "runs": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduleRun" } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/notifications": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listScheduledTaskNotifications", "x-aiden-capability": "schedule:read", "parameters": [ { "name": "since", "in": "query", "required": false, "description": "Epoch-milliseconds cursor; runs finished at or after it are returned (inclusive \u2014 clients dedupe by run id).", "schema": { "type": "integer", "minimum": 0 } } ], "responses": { "200": { "description": "Completed scheduled-task runs across all tasks, newest first (max 100; when the window overflows, the oldest runs are kept and the remainder arrives on the next poll)", "content": { "application/json": { "schema": { "type": "object", "required": [ "notifications", "now" ], "properties": { "notifications": { "type": "array", "items": { "$ref": "#/components/schemas/ScheduleRunNotification" } }, "now": { "type": "integer", "description": "Server epoch-milliseconds clock \u2014 clients baseline first-poll cursors to this rather than the device clock." } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/preview": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "previewSchedule", "x-aiden-capability": "schedule:read", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "cron", "timezone" ], "properties": { "cron": { "type": "string" }, "timezone": { "type": "string" }, "count": { "type": "integer", "minimum": 1, "maximum": 20 } }, "additionalProperties": false } } } }, "responses": { "200": { "description": "Next run timestamps", "content": { "application/json": { "schema": { "type": "object", "required": [ "dates" ], "properties": { "dates": { "type": "array", "items": { "type": "string", "format": "date-time" } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/scripts": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listScheduledScripts", "x-aiden-capability": "schedule:read", "parameters": [ { "name": "workspaceId", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Server-inventoried scripts without paths", "content": { "application/json": { "schema": { "type": "object", "required": [ "scripts" ], "properties": { "scripts": { "type": "array", "items": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "additionalProperties": false } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/mcp-servers": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listScheduledMcpServers", "x-aiden-capability": "schedule:read", "responses": { "200": { "description": "Enabled MCP server IDs and display names only", "content": { "application/json": { "schema": { "type": "object", "required": [ "servers" ], "properties": { "servers": { "type": "array", "items": { "type": "object", "required": [ "id", "name" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "additionalProperties": false } } }, "additionalProperties": false } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/memory/settings": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getMemorySettings", "x-aiden-capability": "workspace:read", "responses": { "200": { "description": "Global memory settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemorySettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "updateMemorySettings", "x-aiden-capability": "workspace:manage", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemorySettingsMutation" } } } }, "responses": { "200": { "description": "Updated global memory settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MemorySettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/scheduled-tasks/settings": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getScheduledTaskSettings", "x-aiden-capability": "schedule:read", "responses": { "200": { "description": "Settings projection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "patch": { "operationId": "updateScheduledTaskSettings", "x-aiden-capability": "schedule:write", "parameters": [ { "$ref": "#/components/parameters/IfMatch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleSettingsMutation" } } } }, "responses": { "200": { "description": "Updated settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ScheduleSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/simulators": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listSimulators", "x-aiden-capability": "simulators:control", "x-aiden-any-capability": [ "simulators:control", "simulators:mobile" ], "parameters": [ { "name": "chatId", "in": "query", "required": false, "description": "Contract revision 26. A chat the device can read; adds chatDeviceIds to the listing.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "description": "Requires the negotiated simulators:control grant on a paired mac or linux device, or since contract revision 26 the simulators:mobile grant on an iphone or ipad; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Lists the serving Mac's iOS Simulators and Android Emulators. While the owner has not turned on Share with paired Macs, sharing is false and devices is empty. Phones also need the owner's Share with Aiden On The Go consent. Phones may open iOS Simulators only; Android Emulators are listed for them as Open on your Mac to view. The optional chatId query (the only query accepted) also requires chat:read and a visible chat; the response then carries chatDeviceIds and the Mac never starts its hub for it. Phones also receive toolVersions.", "responses": { "200": { "description": "Simulator listing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorListing" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/simulators/open": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "openSimulator", "x-aiden-capability": "simulators:control", "x-aiden-any-capability": [ "simulators:control", "simulators:mobile" ], "description": "Requires the negotiated simulators:control grant on a paired mac or linux device, or since contract revision 26 the simulators:mobile grant on an iphone or ipad; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Boots a listed simulator and starts its stream on the serving Mac. Sharing must be on. Phones also need the owner's Share with Aiden On The Go consent. Phones may open only iOS Simulators; any other platform is capability_denied.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorDeviceRequest" } } } }, "responses": { "200": { "description": "The opened simulator", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorOpenResponse" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/simulators/shutdown": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "shutdownSimulator", "x-aiden-capability": "simulators:control", "x-aiden-any-capability": [ "simulators:control", "simulators:mobile" ], "description": "Requires the negotiated simulators:control grant on a paired mac or linux device, or since contract revision 26 the simulators:mobile grant on an iphone or ipad; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Shuts down a listed simulator on the serving Mac. Phones also need the owner's Share with Aiden On The Go consent.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorDeviceRequest" } } } }, "responses": { "200": { "description": "Shut down", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorOk" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/simulators/settings": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "getSimulatorSettings", "x-aiden-capability": "simulators:control", "description": "Desktop-only. Requires the negotiated simulators:control grant on a paired mac or linux device; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Reads a listed simulator's settings. Contract revision 26: phones holding simulators:mobile are refused with capability_denied.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorDeviceRequest" } } } }, "responses": { "200": { "description": "Settings snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/simulators/action": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "runSimulatorAction", "x-aiden-capability": "simulators:control", "description": "Desktop-only. Requires the negotiated simulators:control grant on a paired mac or linux device; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Runs one control action on a listed simulator. Contract revision 26: phones holding simulators:mobile are refused with capability_denied.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorActionRequest" } } } }, "responses": { "200": { "description": "Updated settings snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimulatorSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/simulators/hub/{hubPath}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "hubPath", "in": "path", "required": true, "description": "An allowlisted hub path. It spans several segments, for example vendor/serve-sim/helper/{udid}/stream.avcc or vendor/serve-emu/api/fold. serve-emu paths other than its device list and health must name exactly one listed device as ?device=.", "schema": { "type": "string", "minLength": 1, "maxLength": 512 } } ], "get": { "operationId": "relaySimulatorHub", "x-aiden-capability": "simulators:control", "x-aiden-any-capability": [ "simulators:control", "simulators:mobile" ], "description": "Requires the negotiated simulators:control grant on a paired mac or linux device, or since contract revision 26 the simulators:mobile grant on an iphone or ipad; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Relays an allowlisted path of the serving Mac's loopback simulator hub: the stream page assets and frame stream (GET or HEAD), and the per-device helper, serve-emu video and gesture, and device list WebSockets (GET with Upgrade). Location headers are never relayed. A device may hold at most 8 open relays; more are refused with handle_capacity. Device-scoped paths must name a simulator in the current listing. WebSocket upgrades authenticate the same bearer credential and reject any Origin header. The hub's exec route is never relayed. Relayed streams close when the owner turns sharing off or revokes the device. Phones also need the owner's Share with Aiden On The Go consent. Phones reach only vendor/serve-sim/helper/{udid}/stream.mjpeg, .../config, .../health and the helper WebSocket vendor/serve-sim/helper/ws?device={udid}; every other hub path, including every serve-emu route, is capability_denied for them.", "responses": { "101": { "description": "WebSocket upgrade for a listed simulator's helper stream or a listed emulator's stream" }, "200": { "description": "Relayed hub content" }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "captureSimulatorScreenshot", "x-aiden-capability": "simulators:control", "description": "Desktop-only. Requires the negotiated simulators:control grant on a paired mac or linux device; other devices are refused with capability_denied. Returns not_found when the serving Mac has no simulator feature. Only hubPath vendor/serve-sim/api/screenshot, vendor/serve-emu/api/screenshot, and vendor/serve-emu/api/fold accept POST. The iOS screenshot body names one listed simulator; the Android screenshot names its emulator in ?device= and takes no body; the fold body names a posture. The relay rebuilds each body from those fields alone and bounds the request to 1 KiB. serve-emu stream tuning (PUT and PATCH) is never relayed. Contract revision 26: phones holding simulators:mobile are refused with capability_denied.", "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "required": [ "udid" ], "properties": { "udid": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" } }, "additionalProperties": false }, { "type": "object", "required": [ "posture" ], "properties": { "posture": { "enum": [ "closed", "opened" ] } }, "additionalProperties": false } ] } } } }, "responses": { "200": { "description": "PNG screenshot, or the emulator's fold state", "content": { "image/png": { "schema": { "type": "string", "format": "binary" } }, "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/read-aloud": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getReadAloudSettingsStatus", "x-aiden-capability": "chat:read", "description": "Requires tts-v1. Playback only; settings and credentials remain desktop-owned. No automatic synthesis retry.", "responses": { "200": { "description": "ReadAloudStatus", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/read-aloud": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "chatId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "get": { "operationId": "getChatReadAloudStatus", "x-aiden-capability": "chat:read", "description": "Requires tts-v1. Playback only; settings and credentials remain desktop-owned. No automatic synthesis retry.", "responses": { "200": { "description": "ReadAloudStatus", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "startChatReadAloud", "x-aiden-capability": "chat:write", "description": "Requires tts-v1. Playback only; settings and credentials remain desktop-owned. No automatic synthesis retry.", "responses": { "200": { "description": "ReadAloudJob", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudJob" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudStart" } } } } } }, "/chats/{chatId}/read-aloud/stop": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "chatId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "post": { "operationId": "stopChatReadAloud", "x-aiden-capability": "chat:write", "description": "Requires tts-v1. Playback only; settings and credentials remain desktop-owned. No automatic synthesis retry.", "responses": { "200": { "description": "ReadAloudStopped", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudStopped" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudStop" } } } } } }, "/chats/{chatId}/read-aloud/audio/{jobId}/{segment}/{offset}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "chatId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "name": "jobId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "name": "segment", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 0, "maximum": 255 } }, { "name": "offset", "in": "path", "required": true, "schema": { "type": "integer", "minimum": 0, "maximum": 8388608 } } ], "get": { "operationId": "readChatReadAloudAudio", "x-aiden-capability": "chat:read", "description": "Requires tts-v1. Playback only; settings and credentials remain desktop-owned. No automatic synthesis retry.", "responses": { "200": { "description": "ReadAloudAudio", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReadAloudAudio" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/host/events": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "hostEvents", "description": "Contract revision 19 host feed (host-events-v1), granted to paired mac and linux devices only. The first event is a snapshot of every chat summary, workspace (with an optional credential-free repository identity) and, for bot:read devices, Bot. Later events upsert or remove one chat, workspace or Bot, or report a run.state change. Event ids are :; a missing, foreign-epoch or expired cursor (more than 1,000 events or 8 MiB behind) receives a fresh snapshot instead of a replay. A snapshot larger than 256 KiB arrives as consecutive snapshot frames: every frame but the last carries partial: true and no SSE id, and only the final frame carries the id, so an interrupted snapshot is retried whole on resume. A heartbeat comment is sent every 15 seconds. The feed never reads transcripts. Since revision 52, right after a runs:observe device's snapshot the host also sends that device a run.state (with attentionSummary) for each run still waiting; those entries take sequences every other device skips, and each pass uses at most half the journal's event and byte retention.", "x-aiden-archived-access": "readable", "x-aiden-capability": "host:events", "parameters": [ { "name": "Last-Event-ID", "in": "header", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[\\x21-\\x7e]{1,128}$" } }, { "name": "after", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[\\x21-\\x7e]{1,128}$" } } ], "x-aiden-sse-event": { "$ref": "#/components/schemas/HostFeedEvent" }, "responses": { "200": { "description": "Resumable event stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/messages": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "chatMessagesWindow", "description": "Contract revision 19 message window (chat-messages-window-v1). Returns at most limit visible messages ending just before the message named by before (or at the newest message), oldest first, within the 1 MiB JSON budget. Oldest messages are dropped first, then reasoning; a single message that still does not fit is payload_too_large. An unknown before is revision_conflict. GET /chats/{chatId} is unchanged.", "x-aiden-archived-access": "readable", "x-aiden-capability": "chat:read", "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "before", "in": "query", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } } ], "responses": { "200": { "description": "Bounded window of visible messages", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatMessagesWindow" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/runs/current/events": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "chatCurrentRunEvents", "description": "Contract revision 19 (run-streams-v1). Streams the newest retained run in a visible chat, whatever surface started it, from its first retained event. Resume a dropped stream through /runs/{runId}/events; a cursor here is invalid_request. run_gone when the chat has no retained run. The aiden-run-epoch response header names the run journal epoch. Contract revision 24 (phone-run-control-v1): a phone holding the phone-scoped runs:observe grant also needs chat:read for the chat, and Bot chats keep the phone's own bot:read audience. Phones receive the phone approval projection: summary, toolCallId, toolName, canAllow and, only when canAllow, the offered scopes; never details or detailsOmitted. Contract revision 39: a phone holding schedule:cards and schedule:read also receives schedule (ApprovalSchedule) on scheduled-task approvals, here and in gap snapshot approvals; it never changes canAllow.", "x-aiden-archived-access": "readable", "x-aiden-capability": "runs:observe", "parameters": [ { "name": "Aiden-Run-Checkpoint", "in": "header", "description": "Revision 58. Set to 1 to accept a bounded snapshot of an active run at its current sequence. Older hosts ignore this header.", "schema": { "type": "string", "const": "1" } }, { "$ref": "#/components/parameters/ChatId" } ], "x-aiden-sse-event": { "$ref": "#/components/schemas/RunEvent" }, "responses": { "200": { "description": "Resumable event stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/runs/{runId}/events": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "runEvents", "description": "Contract revision 19 (run-streams-v1). Resumable stream of one run in a visible chat. Event types are those of /streams/{streamId}/events plus run.started, approval_resolved, question_resolved and the terminal run.ended. Last-Event-ID or after is the last delivered decimal sequence; a cursor older than retention yields a snapshot with the pending prompts first. Observers without runs:control receive approval_required without host-only details. run_gone when the run is unknown or evicted. Contract revision 24 (phone-run-control-v1): a phone holding the phone-scoped runs:observe grant also needs chat:read for the chat, and Bot chats keep the phone's own bot:read audience. Phones receive the phone approval projection: summary, toolCallId, toolName, canAllow and, only when canAllow, the offered scopes; never details or detailsOmitted. Contract revision 39: a phone holding schedule:cards and schedule:read also receives schedule (ApprovalSchedule) on scheduled-task approvals, here and in gap snapshot approvals; it never changes canAllow.", "x-aiden-archived-access": "readable", "x-aiden-capability": "runs:observe", "parameters": [ { "name": "Aiden-Run-Checkpoint", "in": "header", "description": "Revision 58. Set to 1 to accept a bounded snapshot of an active run at its current sequence. Older hosts ignore this header.", "schema": { "type": "string", "const": "1" } }, { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "name": "Last-Event-ID", "in": "header", "required": false, "schema": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, { "name": "after", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } ], "x-aiden-sse-event": { "$ref": "#/components/schemas/RunEvent" }, "responses": { "200": { "description": "Resumable event stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/runs/{runId}/cancel": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "cancelRun", "description": "Contract revision 19 (run-control-v1). Stops a running run whatever surface started it. Requires chat write access to the run's chat. run_gone for an unknown run; operation_stale once the run has finished. Contract revision 24 (phone-run-control-v1): a phone holding runs:control also needs chat:write, and bot:write for a Bot chat.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "runs:control", "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "description": "Always the empty JSON object {} sent as application/json.", "content": { "application/json": { "schema": { "type": "object", "maxProperties": 0 } } } }, "responses": { "202": { "description": "Cancellation accepted", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunCancelResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/runs/{runId}/approvals/{approvalId}/respond": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "respondRunApproval", "description": "Contract revision 19 (run-control-v1). Resolves an approval in this run whoever owns it. The first responder wins; a later responder receives 409 approval_resolved with the winning decision and resolvedAt, and an Idempotency-Key replay returns the same outcome. An approval that is not part of the run is not_found. Allowing an approval whose details were too large to send is capability_denied; review it on the host. Contract revision 24 (phone-run-control-v1): a phone holding runs:control also needs approval:respond; a phone may allow only an approval its projection marked canAllow, otherwise allow is capability_denied and deny still works.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "runs:control", "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "name": "approvalId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunApprovalRespondRequest" } } } }, "responses": { "200": { "description": "Approval resolved by this request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunApprovalResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/runs/{runId}/questions/{promptId}/respond": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "respondRunQuestion", "description": "Contract revision 19 (run-control-v1). Answers or dismisses a question in this run whoever owns it. The first responder wins; a later responder receives 409 question_already_resolved with the winning outcome and resolvedAt. Contract revision 24 (phone-run-control-v1): a phone holding runs:control also needs questions:respond.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "runs:control", "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "name": "promptId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuestionRespondRequest" } } } }, "responses": { "200": { "description": "Question resolved by this request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunQuestionResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/runs/{runId}/inputs": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "submitRunInput", "description": "Contract revision 19 (run-control-v1). Mid-flight steer or queue input for a running run, with the same admission semantics as /streams/{streamId}/inputs. Contract revision 24 (phone-run-control-v1): a phone holding runs:control also needs chat:write, and bot:write for a Bot chat.", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "runs:control", "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StreamInputRequest" } } } }, "responses": { "200": { "description": "Admission outcome for the requested input", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunInputResult" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/pairing/requests": { "post": { "operationId": "createPairingRequest", "security": [], "description": "Contract revision 20 (pairing-requests-v1). Unauthenticated; no bearer credential or Aiden-Protocol-Version header. Requests carrying an Origin header are refused. A mac or linux desktop asks this host to pair. Accepted only while the host's Accept connection requests setting is on (403 pairing_closed otherwise); iphone and ipad requesters receive 403 capability_denied. At most 5 requests per source and 20 overall per minute, 8 open requests overall and 2 per source (429 rate_limited with details.retryAfterSeconds). The request expires 120 s after creation.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingRequestCreate" } } } }, "responses": { "201": { "description": "Created connection request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingRequestCreated" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/pairing/requests/{requestId}/reveal": { "post": { "operationId": "revealPairingRequest", "security": [], "description": "Contract revision 20 (pairing-requests-v1). Unauthenticated; no bearer credential or Aiden-Protocol-Version header. Requests carrying an Origin header are refused. One-shot commit/reveal step: the requester sends its nonce and receives the host nonce committed to by hostCommitment. The host shows its approval prompt only after this call. A second reveal is 409 pairing_already_used; an unknown request or a wrong or missing secret is 404 not_found.", "parameters": [ { "name": "requestId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" } }, { "$ref": "#/components/parameters/PairingRequestSecret" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingRequestReveal" } } } }, "responses": { "200": { "description": "Host nonce", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingRequestRevealed" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/pairing/requests/{requestId}": { "get": { "operationId": "pollPairingRequest", "security": [], "description": "Contract revision 20 (pairing-requests-v1). Unauthenticated; no bearer credential or Aiden-Protocol-Version header. Requests carrying an Origin header are refused. Long-poll for at most 25 s; answers early on any state change. Only approved carries the sealed grant envelope. Terminal records are kept for 60 s, then 404 not_found. An unknown request or a wrong or missing secret is 404 not_found.", "parameters": [ { "name": "requestId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" } }, { "$ref": "#/components/parameters/PairingRequestSecret" } ], "responses": { "200": { "description": "Current request state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingRequestStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "delete": { "operationId": "cancelPairingRequest", "security": [], "description": "Contract revision 20 (pairing-requests-v1). Unauthenticated; no bearer credential or Aiden-Protocol-Version header. Requests carrying an Origin header are refused. Requester cancel. A denied, expired or cancelled request reports its state unchanged. Cancelling an approved request revokes its device and reports cancelled, even after the envelope was fetched. The cancel is acknowledged only once the revocation is recorded; otherwise it fails with internal_error and can be retried.", "parameters": [ { "name": "requestId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" } }, { "$ref": "#/components/parameters/PairingRequestSecret" } ], "responses": { "200": { "description": "State after cancellation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PairingRequestCancelled" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/controls/{panelId}": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" }, { "$ref": "#/components/parameters/ChatId" }, { "name": "panelId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" } } ], "get": { "operationId": "getAppControls", "description": "Host-owned conversation settings controls. Requires desktop owner consent, live device grants, canonical chat access and the unchanged panel workspace. Display/read makes no mutation. POST additionally requires app-controls:respond; memory mutations require workspace:manage. Every operation uses its original ID and expected value/policy revision; retry returns the durable receipt and never repeats an uncertain effect. No bot, credential, shell or arbitrary settings action is supported.", "x-aiden-capability": "app-controls:read", "x-aiden-capabilities": [ "chat:read", "app-controls:read" ], "x-aiden-archived-access": "readable", "responses": { "200": { "description": "Current host projection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppControlSnapshot" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "applyAppControl", "description": "Host-owned conversation settings controls. Requires desktop owner consent, live device grants, canonical chat access and the unchanged panel workspace. Display/read makes no mutation. POST additionally requires app-controls:respond; memory mutations require workspace:manage. Every operation uses its original ID and expected value/policy revision; retry returns the durable receipt and never repeats an uncertain effect. No bot, credential, shell or arbitrary settings action is supported.", "x-aiden-capability": "app-controls:respond", "x-aiden-capabilities": [ "chat:read", "app-controls:read", "app-controls:respond" ], "x-aiden-archived-access": "denied", "responses": { "200": { "description": "Durable operation receipt", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppControlReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppControlOperation" } } } } } }, "/bots/{botId}/session/images/{entryId}": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "entryId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "description": "The id of a shared_image entry in the Bot's current session." }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getBotSessionImage", "description": "Contract revision 45: the bytes of an image the Bot shared, while it is in the Bot's current conversation. 404 not_found once it is gone.", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:images" ], "responses": { "200": { "description": "Authenticated shared image content", "headers": { "Cache-Control": { "required": true, "schema": { "const": "no-store" } }, "X-Content-Type-Options": { "required": true, "schema": { "const": "nosniff" } } }, "content": { "image/png": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 8388608 } }, "image/jpeg": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 8388608 } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/chats/{chatId}/recordings/{recordingId}": { "parameters": [ { "$ref": "#/components/parameters/ChatId" }, { "name": "recordingId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^recording-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "description": "The id a recording recap on one of this chat's timelines names." }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getChatBrowserRecording", "description": "Contract revision 46: the video a browser_recording_stop step in this chat saved. Announced by `chat-browser-recordings-v1`. Only a recording the chat's own timelines name can be read; 404 not_found when it is no longer on the Mac or on a host without the in-app browser.", "x-aiden-capability": "chat:read", "x-aiden-feature": "chat-browser-recordings-v1", "responses": { "200": { "description": "Authenticated browser recording", "headers": { "Cache-Control": { "required": true, "schema": { "const": "no-store" } }, "X-Content-Type-Options": { "required": true, "schema": { "const": "nosniff" } } }, "content": { "video/mp4": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 134217728 } }, "video/webm": { "schema": { "type": "string", "contentEncoding": "binary", "maxLength": 134217728 } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/open-work": { "get": { "operationId": "botOpenWorkSnapshot", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:open-work" ], "responses": { "200": { "description": "Open work response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotOpenWorkSnapshot" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "x-aiden-capability": "bot:read" }, "post": { "operationId": "botOpenWorkMutate", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:write", "bot:open-work" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotOpenWorkMutation" } } } }, "responses": { "200": { "description": "Open work response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotOpenWorkResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "x-aiden-capability": "bot:write" }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/open-work/{itemId}/evidence/{kind}": { "get": { "operationId": "botOpenWorkEvidence", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "itemId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "kind", "in": "path", "required": true, "schema": { "type": "string", "enum": [ "source", "result" ] } } ], "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:open-work" ], "responses": { "200": { "description": "Open work response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotOpenWorkEvidence" } } } }, "404": { "description": "No retained evidence belongs to this work item" }, "default": { "$ref": "#/components/responses/Error" } }, "x-aiden-capability": "bot:read" }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/watches": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotConnectorWatches", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "bot:watches" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchList" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "createBotConnectorWatch", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "201": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatch" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchCreateRequest" } } } } } }, "/bots/{botId}/watches/sources": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "discoverBotConnectorWatchSources", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchSourceList" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "properties": {}, "required": [] } } } } } }, "/bots/{botId}/watches/test": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "testBotConnectorWatch", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchTestResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchTestRequest" } } } } } }, "/bots/{botId}/watches/{watchId}": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "watchId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 } } ], "patch": { "operationId": "updateBotConnectorWatch", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatch" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchUpdateRequest" } } } } }, "delete": { "operationId": "deleteBotConnectorWatch", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchRemoval" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchIdentityRequest" } } } } } }, "/bots/{botId}/watches/{watchId}/enabled": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "watchId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 } } ], "post": { "operationId": "enableBotConnectorWatch", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatch" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchEnableRequest" } } } } } }, "/bots/{botId}/watches/{watchId}/run": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "watchId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 } } ], "post": { "operationId": "runBotConnectorWatch", "description": "Contract revision54; requires negotiated bot:watches. Source discovery is explicit. Mutations carry a stable UUID mutationId and existing-resource expectedRevision in JSON. No credentials, raw tools or executable configuration are accepted.", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:watches", "bot:write" ], "responses": { "200": { "description": "Connector watch result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchRunResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotConnectorWatchIdentityRequest" } } } } } }, "/bots/{botId}/routine-models/{routineId}": { "get": { "operationId": "botRoutineModelSettings", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "routineId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:routine-models" ], "responses": { "200": { "description": "Routine model response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineModelSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "botRoutineModelSave", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "routineId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:routine-models", "bot:write" ], "responses": { "200": { "description": "Routine model response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineModelResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineModelSave" } } } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/routine-models/{routineId}/catalog": { "get": { "operationId": "botRoutineModelCatalog", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "routineId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:routine-models", "bot:write" ], "responses": { "200": { "description": "Routine model response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineModelCatalog" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/routine-models/{routineId}/runs": { "get": { "operationId": "botRoutineModelRuns", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "routineId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:routine-models" ], "responses": { "200": { "description": "Routine model response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineModelRuns" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/routine-resume-status": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "botExecutionResumeStatus", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:write", "bot:routine-models" ], "responses": { "200": { "description": "Passive status for the person choosing Resume; it never acknowledges a charge or starts work.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotExecutionResumeStatus" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/routine-models": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "botRoutineModelDirectory", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "chat:read", "bot:routine-models" ], "responses": { "200": { "description": "Owned routine identities only; no executable source configuration or private grants.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotRoutineModelDirectory" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/peers": { "get": { "operationId": "botPeerSettings", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers" ], "x-aiden-capability": "bot:read", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "botPeerMutate", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers", "bot:write" ], "x-aiden-capability": "bot:write", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerMutationResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerMutation" } } } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/peers/catalog": { "get": { "operationId": "botPeerCatalog", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers" ], "x-aiden-capability": "bot:read", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerCatalog" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/peer-exchanges": { "get": { "operationId": "botPeerExchanges", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers", "chat:read" ], "x-aiden-capability": "bot:read", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerExchangeList" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/peer-exchanges/{exchangeId}": { "get": { "operationId": "botPeerExchange", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "exchangeId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers", "chat:read" ], "x-aiden-capability": "bot:read", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerExchangeDetail" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/peer-exchanges/{exchangeId}/stop": { "post": { "operationId": "botPeerStop", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "exchangeId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers", "chat:read", "bot:write" ], "x-aiden-capability": "bot:write", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerStopResult" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerStopMutation" } } } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/{botId}/peer-exchanges/{exchangeId}/evidence/{kind}": { "get": { "operationId": "botPeerEvidence", "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "exchangeId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, { "name": "kind", "in": "path", "required": true, "schema": { "enum": [ "source", "result" ] } } ], "x-aiden-capabilities": [ "bot:read", "bot:peers", "chat:read" ], "x-aiden-capability": "bot:read", "responses": { "200": { "description": "Bot messaging owner response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPeerEvidence" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ] }, "/bots/messaging": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "put": { "operationId": "updateBotMessaging", "x-aiden-archived-access": "mutation_blocked", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:write", "bot:messaging" ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMessagingSettings" } } } }, "responses": { "200": { "description": "Authoritative Bot messaging settings", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotMessagingSettings" } } } }, "default": { "$ref": "#/components/responses/Error" } }, "summary": "Set whether Bots can message each other", "description": "Revision 54. Requires bot:write and negotiated bot:messaging. Exact boolean enabled. Changes gate new sends only; accepted deliveries finish. No inference or catalog access." } }, "/bots/{botId}/allowed": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listBotAllowed", "x-aiden-capability": "bot:read", "x-aiden-capabilities": [ "bot:read", "bot:allowed" ], "description": "Revision 57. Combined rules and selected folders, sorted newest date then ID, with opaque device-and-Bot-bound cursors. Pages of 50 share a complete immutable snapshot for 2 minutes. Cache: 64 snapshots globally, 4 per device, aggregate 8 MiB; over-capacity complete views are refused, never truncated. Unknown Bot is 404. Foreign, expired or evicted cursors are refreshable 400 invalid_request; restart without cursor.", "parameters": [ { "name": "cursor", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^cur_[A-Za-z0-9_-]{43}$" } } ], "responses": { "200": { "description": "The first or requested immutable page, at most 50 rows. No private targets or authorization metadata.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAllowedList" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/allowed/{entryId}/remove": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "entryId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[A-Za-z0-9_-]+$" } } ], "post": { "operationId": "removeBotAllowed", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:allowed" ], "description": "Revision 57. Remove only this Bot entry. Exact empty JSON body, no query. Naturally idempotent; no Idempotency-Key required. Success including an already-gone entry invalidates this device/Bot snapshots and returns a fresh first page; load its subsequent pages. Never republishes consent or removes another Bot folder/root.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": {}, "required": [], "additionalProperties": false } } } }, "responses": { "200": { "description": "The first or requested immutable page, at most 50 rows. No private targets or authorization metadata.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAllowedList" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/plans/{planId}/respond": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "planId", "in": "path", "required": true, "description": "The exact plan ID returned by the Bot session.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "respondBotPlan", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:plans" ], "description": "Revision 56. Respond to an exact plan with approve, not_now or stop. Requires Idempotency-Key. Duplicate success replays its original receipt. Unknown decision is 400 invalid_request. A settled, missing or expired plan is 409 plan_expired, a pre-effect refusal that leaves no durable rejected key. Transient errors permit retry with the same key and exact plan identity; first answer wins. Unwired hosts return 404. not_now returns stopped; other statuses come from the exact host plan.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPlanRespondRequest" } } } }, "responses": { "200": { "description": "The host authorized and settled the answer, or replayed its original receipt.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotPlanRespondReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/access-requests/{waitId}/answer": { "parameters": [ { "$ref": "#/components/parameters/BotId" }, { "name": "waitId", "in": "path", "required": true, "description": "The current access request waitId.", "schema": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "answerBotAccessRequest", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:access-requests" ], "description": "Revision 55. Answer an offered access choice. Requires Idempotency-Key; a repeat replays the receipt even after the card settles or a response is lost. An unoffered choice is 400 invalid_request. A settled or expired request is 409 access_request_expired. Unwired hosts return 404.", "parameters": [ { "$ref": "#/components/parameters/IdempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAccessAnswerRequest" } } } }, "responses": { "200": { "description": "The host authorized and settled the answer, or replayed its original receipt.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BotAccessAnswerReceipt" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approvals/mode": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "getApprovalMode", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. The Mac's approval mode ({mode: auto|ask|never, autoAvailable}). Auto without a usable model reads ask. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "responses": { "200": { "description": "The mode.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "put": { "operationId": "setApprovalMode", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. Set the Mac's approval mode, exactly {mode}. auto without a usable model is 400 invalid_request. Returns the mode as it now is. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "auto", "ask", "never" ] } }, "required": [ "mode" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "The mode.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approvals/rules": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listApprovalRules", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. The rules page: {rows, unreadable?}. unreadable means the rules file could not be read; every change is refused until it is fixed on the Mac. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "responses": { "200": { "description": "The rules page.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } }, "post": { "operationId": "addApprovalRule", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. Add a rule ({target, decision, owner?, handOff?, label?}), or change the decision of the rule that already exists for that target. 409 revision_conflict while the rules file is unreadable or when the Mac refuses it. Returns the rules page. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { "200": { "description": "The rules page.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approvals/rules/picker": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "get": { "operationId": "listApprovalRulePicker", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. Add rule's options: {options: [{target, label, group, description?}]}: Aiden's built-in tools, and each connected app. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "responses": { "200": { "description": "The options.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approvals/rules/change": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "changeApprovalRule", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. Change one row: {ref, decision?, handOff?}, at least one of the two. 404 not_found when the row is gone; 409 revision_conflict when unreadable or refused. Returns the rules page. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { "200": { "description": "The rules page.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/approvals/rules/remove": { "parameters": [ { "$ref": "#/components/parameters/ProtocolVersion" } ], "post": { "operationId": "removeApprovalRule", "x-aiden-capability": "approval:respond", "x-aiden-capabilities": [ "approval:respond", "approvals:settings" ], "description": "Revision 61. Remove one row: exactly {ref}. 404 not_found when the row is gone; 409 revision_conflict when unreadable or refused. Returns the rules page. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { "200": { "description": "The rules page.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/settings-changes/{changeId}/respond": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "changeId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "post": { "operationId": "respondBotSettingsChange", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:settings-changes" ], "description": "Revision 61. Apply or Dismiss a held update_bot card, or Undo an applied-change receipt: exactly {decision}. Edit happens on the Mac. 409 revision_conflict with the Mac's message when the Bot's settings moved; an Undo the Mac cannot make answers 200 with status undo_refused. Returns {changeId, status, message?}. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "decision": { "type": "string", "enum": [ "apply", "dismiss", "undo" ] } }, "required": [ "decision" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/skill-proposals/{proposalId}/respond": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "proposalId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "post": { "operationId": "respondBotSkillProposal", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:suggestions" ], "description": "Revision 61. Add or Not now on a skill suggestion: exactly {decision}. 404 not_found when it is no longer waiting. Returns {proposalId, status}. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "decision": { "type": "string", "enum": [ "add", "dismiss" ] } }, "required": [ "decision" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/lessons/{lessonId}/respond": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "lessonId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "post": { "operationId": "respondBotLesson", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:suggestions" ], "description": "Revision 61. Keep or Not now on a lesson card: exactly {decision}. Returns {lessonId, status}. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "decision": { "type": "string", "enum": [ "keep", "dismiss" ] } }, "required": [ "decision" ], "additionalProperties": false } } } }, "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/lessons/{lessonId}/remove": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "lessonId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "post": { "operationId": "removeBotLesson", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:suggestions" ], "description": "Revision 61. Undo on a Learned line: the lesson is retired. Exact empty body. Returns {lessonId, status: retired}. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": {}, "required": [], "additionalProperties": false } } } }, "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } }, "/bots/{botId}/learning/{changeId}/undo": { "parameters": [ { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, { "$ref": "#/components/parameters/ProtocolVersion" }, { "name": "changeId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } } ], "post": { "operationId": "undoBotLearning", "x-aiden-capability": "bot:write", "x-aiden-capabilities": [ "bot:read", "bot:write", "bot:suggestions" ], "description": "Revision 61. Undo on a memory tidy line. Exact empty body. 409 revision_conflict when the memory changed since. Returns {changeId, undone: true}. Shapes, errors and the shared fixture: docs/aiden-remote-api-v1.md, Bot UX on phones (revision 61); protocol/aiden-remote/v1/fixtures/bot-ux-revision-61.json.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": {}, "required": [], "additionalProperties": false } } } }, "responses": { "200": { "description": "The answer.", "content": { "application/json": { "schema": { "type": "object" } } } }, "default": { "$ref": "#/components/responses/Error" } } } } }, "components": { "securitySchemes": { "deviceBearer": { "type": "http", "scheme": "bearer", "bearerFormat": "Aiden device credential" }, "protocolVersion": { "type": "apiKey", "in": "header", "name": "Aiden-Protocol-Version", "description": "Must be exactly 1." } }, "responses": { "Error": { "description": "Stable safe error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } } }, "parameters": { "PairingRequestSecret": { "name": "Aiden-Pairing-Secret", "in": "header", "required": true, "description": "The pollSecret returned at creation. Compared in constant time; a mismatch is indistinguishable from an unknown request.", "schema": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" } }, "IdempotencyKey": { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "type": "string", "minLength": 16, "maxLength": 128 } }, "ProtocolVersion": { "name": "Aiden-Protocol-Version", "in": "header", "required": true, "schema": { "const": "1" } }, "IfMatch": { "name": "If-Match", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, "WorkspaceId": { "name": "workspaceId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, "ChatId": { "name": "chatId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, "PublicTurnId": { "name": "turnId", "in": "query", "required": false, "description": "Opaque public turn identity. Omit to read the active or most recent public turn.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "AgentId": { "name": "agentId", "in": "path", "required": true, "description": "Projection-minted public agent identity from a ChatAgentRoster.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "BotId": { "name": "botId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, "BotIdQuery": { "name": "botId", "in": "query", "required": false, "description": "Existing authenticated Bot whose saved unavailable catalog choices should be retained; omit for the generic Bot-creation catalog.", "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } }, "AssetRevision": { "name": "assetRevision", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "StreamId": { "name": "streamId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, "TaskId": { "name": "taskId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }, "ProposalId": { "name": "proposalId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" } }, "RoutineId": { "name": "routineId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" } } }, "schemas": { "ProviderCreation": { "type": "object", "required": [ "label", "baseUrl", "kind", "deployment", "needsKey", "models", "confirmedForeground" ], "additionalProperties": false, "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "baseUrl": { "type": "string", "minLength": 1, "maxLength": 2048, "format": "uri" }, "kind": { "enum": [ "openai", "anthropic" ] }, "deployment": { "enum": [ "local", "hosted" ] }, "needsKey": { "type": "boolean" }, "apiKey": { "type": "string", "minLength": 1, "maxLength": 4096, "writeOnly": true }, "models": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/components/schemas/ProviderCreationModel" } }, "confirmedForeground": { "const": true } }, "allOf": [ { "if": { "properties": { "needsKey": { "const": true } } }, "then": { "required": [ "apiKey" ] }, "else": { "not": { "required": [ "apiKey" ] } } } ] }, "ProviderCreationModel": { "type": "object", "required": [ "id", "vision", "reasoning", "toolCall" ], "additionalProperties": false, "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "vision": { "type": "boolean" }, "reasoning": { "type": "boolean" }, "toolCall": { "type": "boolean" }, "contextLength": { "type": "integer", "minimum": 1, "maximum": 1000000000 }, "outputLimit": { "type": "integer", "minimum": 1, "maximum": 1000000000 }, "maxImages": { "type": "integer", "minimum": 0, "maximum": 100 } } }, "ProviderCreationReceipt": { "type": "object", "required": [ "id", "label", "models" ], "additionalProperties": false, "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "models": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 128 } } } }, "Health": { "type": "object", "required": [ "ok", "protocolVersion" ], "properties": { "ok": { "const": true }, "protocolVersion": { "const": 1 } }, "additionalProperties": false }, "PairingBootstrap": { "type": "object", "description": "Canonical bootstrap nested inside the locally displayed QR trust envelope.", "required": [ "protocolVersion", "instanceId", "endpoint", "serverSpkiSha256", "secret", "expiresAt" ], "properties": { "protocolVersion": { "const": 1 }, "instanceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "endpoint": { "type": "string", "format": "uri", "pattern": "^https://(?:\\[(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){1}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,4})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){2}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,3})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){3}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,2})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){4}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,1})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){5}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,0})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){6}::|(?:[0-9A-Fa-f]{1,4}:){6}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|::(?:[0-9A-Fa-f]{1,4}:){0,5}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0}::(?:[0-9A-Fa-f]{1,4}:){0,4}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){1}::(?:[0-9A-Fa-f]{1,4}:){0,3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){2}::(?:[0-9A-Fa-f]{1,4}:){0,2}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){3}::(?:[0-9A-Fa-f]{1,4}:){0,1}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){4}::(?:[0-9A-Fa-f]{1,4}:){0,0}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\\]|(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})|(?=[A-Za-z0-9.-]{1,253}(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?/api/aiden/v1$)(?!(?:[A-Za-z0-9-]+\\.)*[0-9]+(?::[0-9]+)?/api/aiden/v1$)(?=[A-Za-z0-9.-]*[A-Za-z-])[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*)(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?/api/aiden/v1$", "maxLength": 2048 }, "serverSpkiSha256": { "type": "string", "pattern": "^sha256/[A-Za-z0-9+/]{43}=$" }, "secret": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, "expiresAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "PairingTrust": { "type": "object", "oneOf": [ { "required": [ "mode", "caCertificateDerBase64" ], "properties": { "mode": { "const": "private-ca" }, "caCertificateDerBase64": { "type": "string", "contentEncoding": "base64", "maxLength": 5464 } }, "additionalProperties": false }, { "required": [ "mode" ], "properties": { "mode": { "const": "system" } }, "additionalProperties": false } ] }, "PairingPayload": { "type": "object", "required": [ "kind", "bootstrap", "trust" ], "properties": { "kind": { "const": "aiden-pairing-v1" }, "bootstrap": { "$ref": "#/components/schemas/PairingBootstrap" }, "trust": { "$ref": "#/components/schemas/PairingTrust" } }, "additionalProperties": false }, "ManualPairingBootstrap": { "type": "object", "required": [ "kind", "protocolVersion", "sessionId", "expiresAt", "salt", "nonce", "ciphertext", "tag" ], "properties": { "kind": { "const": "aiden-manual-pairing-v1" }, "protocolVersion": { "const": 1 }, "sessionId": { "type": "string", "pattern": "^pairing_[A-Za-z0-9_-]{32}$" }, "expiresAt": { "type": "string", "format": "date-time" }, "salt": { "type": "string", "pattern": "^[A-Za-z0-9_-]{22}$" }, "nonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{16}$" }, "ciphertext": { "type": "string", "minLength": 2, "maxLength": 5462, "pattern": "^[A-Za-z0-9_-]+$" }, "tag": { "type": "string", "pattern": "^[A-Za-z0-9_-]{22}$" } }, "additionalProperties": false }, "PairingExchangeRequest": { "type": "object", "required": [ "secret", "deviceName", "deviceType", "clientVersion" ], "properties": { "secret": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, "deviceName": { "type": "string", "minLength": 1, "maxLength": 80 }, "deviceType": { "enum": [ "iphone", "ipad", "android", "mac", "linux" ] }, "clientVersion": { "type": "string", "minLength": 1, "maxLength": 40 }, "acceptsDisplayName": { "type": "boolean", "description": "Opt in to the additive displayName response field; omitted by legacy strict clients." }, "acceptsBotCapabilities": { "type": "boolean", "description": "Explicitly accepts the Bot capability vocabulary and the additive serverCapabilities projection. Bot grants are never issued when this field is absent or false." }, "acceptsProgressCapabilities": { "type": "boolean", "description": "Explicitly accepts the task/agent progress capability vocabulary and the additive serverCapabilities projection. Progress grants are never issued when this field is absent or false. Already-paired devices negotiate the same vocabulary through POST /device/capabilities." } }, "additionalProperties": false }, "PairingExchangeResponse": { "type": "object", "required": [ "protocolVersion", "instanceId", "deviceId", "credential", "capabilities", "endpoint", "serverSpkiSha256" ], "properties": { "protocolVersion": { "const": 1 }, "instanceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "deviceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "credential": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, "capabilities": { "type": "array", "description": "Exact capabilities granted to this authenticated device.", "items": { "enum": [ "server:read", "chat:read", "chat:write", "approval:respond", "workspace:read", "workspace:browse", "workspace:manage", "files:read", "files:write", "git:read", "git:write", "schedule:read", "schedule:write", "bot:read", "bot:write", "tasks:read", "agents:read", "questions:respond", "skills:invoke", "app-controls:read", "app-controls:respond", "host:events", "runs:observe", "runs:control" ] }, "uniqueItems": true }, "displayName": { "type": "string", "minLength": 1, "maxLength": 80 }, "endpoint": { "type": "string", "format": "uri", "pattern": "^https://(?:\\[(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){1}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,4})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){2}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,3})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){3}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,2})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){4}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,1})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){5}::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,0})?|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){6}::|(?:[0-9A-Fa-f]{1,4}:){6}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|::(?:[0-9A-Fa-f]{1,4}:){0,5}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0}::(?:[0-9A-Fa-f]{1,4}:){0,4}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){1}::(?:[0-9A-Fa-f]{1,4}:){0,3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){2}::(?:[0-9A-Fa-f]{1,4}:){0,2}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){3}::(?:[0-9A-Fa-f]{1,4}:){0,1}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){4}::(?:[0-9A-Fa-f]{1,4}:){0,0}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\\]|(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})|(?=[A-Za-z0-9.-]{1,253}(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?/api/aiden/v1$)(?!(?:[A-Za-z0-9-]+\\.)*[0-9]+(?::[0-9]+)?/api/aiden/v1$)(?=[A-Za-z0-9.-]*[A-Za-z-])[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*)(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?/api/aiden/v1$", "maxLength": 2048 }, "serverSpkiSha256": { "type": "string", "pattern": "^sha256/[A-Za-z0-9+/]{43}=$" } }, "allOf": [ { "if": { "properties": { "capabilities": { "contains": { "const": "bot:write" } } } }, "then": { "properties": { "capabilities": { "contains": { "const": "bot:read" } } } } } ], "additionalProperties": false }, "PeerRoute": { "type": "object", "additionalProperties": false, "required": [ "endpoint", "serverSpkiSha256" ], "properties": { "endpoint": { "type": "string", "format": "uri", "maxLength": 2048, "description": "HTTPS canonical .local or .ts.net endpoint. Never an IP literal." }, "serverSpkiSha256": { "type": "string", "pattern": "^sha256/[A-Za-z0-9+/]{43}=$" }, "caCertificateDerBase64": { "type": "string", "maxLength": 8192, "description": "Required private CA DER for LAN; absent for system-trusted Tailscale." }, "addresses": { "type": "array", "maxItems": 8, "uniqueItems": true, "items": { "type": "string", "format": "ipv4" }, "description": "Optional LAN-only RFC1918 lookup hints. TLS still checks the canonical hostname, CA and pin before credentials are transmitted." } } }, "Server": { "type": "object", "required": [ "protocolVersion", "instanceId", "name", "appVersion", "capabilities", "connectionMode", "features", "serverTime" ], "properties": { "peerRoutes": { "type": "array", "maxItems": 2, "description": "Contract revision 31. Emitted only for authenticated mac/linux devices with peer-routes-v1. Route-specific trust learned over the authenticated channel; never present on health, discovery or phone projections.", "items": { "$ref": "#/components/schemas/PeerRoute" } }, "protocolVersion": { "const": 1 }, "instanceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "appVersion": { "type": "string", "minLength": 1, "maxLength": 40 }, "capabilities": { "type": "array", "description": "Exact capabilities granted to the authenticated device.", "items": { "enum": [ "server:read", "chat:read", "chat:write", "approval:respond", "workspace:read", "workspace:browse", "workspace:manage", "files:read", "files:write", "git:read", "git:write", "schedule:read", "schedule:write", "bot:read", "bot:write", "tasks:read", "agents:read", "questions:respond", "skills:invoke", "app-controls:read", "app-controls:respond", "simulators:control", "host:events", "runs:observe", "runs:control", "simulators:mobile", "bot:cards", "bot:activity", "bot:messaging", "bot:handoffs", "bot:handoff-notes", "bot:handoff-on-mac", "bot:access-requests", "bot:plans", "bot:allowed", "bot:images", "bot:issues", "bot:watches", "bot:open-work", "bot:routine-models", "bot:peers", "bot:needs-you", "schedule:cards", "chat:jobs", "attachments:raw", "chat:new-worktree", "bot:settings-changes", "bot:suggestions", "bot:templates", "approval:cards", "approvals:settings", "chat:continue-in-new-chat", "stream:snapshot-reasons", "approval:plain-words", "chat:agent-slider" ] }, "uniqueItems": true }, "serverCapabilities": { "type": "array", "description": "Server-supported inventory. Present only for devices that explicitly negotiated the Bot or progress capability vocabulary; it never grants authority.", "items": { "enum": [ "server:read", "chat:read", "chat:write", "approval:respond", "workspace:read", "workspace:browse", "workspace:manage", "files:read", "files:write", "git:read", "git:write", "schedule:read", "schedule:write", "bot:read", "bot:write", "tasks:read", "agents:read", "questions:respond", "skills:invoke", "app-controls:read", "app-controls:respond", "simulators:control", "host:events", "runs:observe", "runs:control", "simulators:mobile", "bot:cards", "bot:activity", "bot:messaging", "bot:handoffs", "bot:handoff-notes", "bot:handoff-on-mac", "bot:access-requests", "bot:plans", "bot:allowed", "bot:images", "bot:issues", "bot:watches", "bot:open-work", "bot:routine-models", "bot:peers", "bot:needs-you", "schedule:cards", "chat:jobs", "attachments:raw", "chat:new-worktree", "bot:settings-changes", "bot:suggestions", "bot:templates", "approval:cards", "approvals:settings", "chat:continue-in-new-chat", "stream:snapshot-reasons", "approval:plain-words", "chat:agent-slider" ] }, "uniqueItems": true }, "features": { "type": "array", "description": "Bounded additive API feature advertisements independent of device grants or vocabulary opt-in. Clients recognize supported values and ignore other bounded values; feature tokens never grant authority. Contract revision 26: phones alone may see mobile-simulators-v1, which gates negotiating simulators:mobile. Contract revision 27 adds bot-memory-v1 (Bot memory routes) and bot-proactive-v1 (routine proposal answers, routine suggestions and the Bot routine notification feed), each announced only while its routes are wired.", "maxItems": 32, "items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" }, "uniqueItems": true }, "deviceName": { "type": "string", "description": "Presentation-only label currently stored for the authenticated client device.", "minLength": 1, "maxLength": 80 }, "connectionMode": { "enum": [ "lan", "tailscale", "both" ] }, "minimumClientVersion": { "type": "string", "minLength": 1, "maxLength": 40 }, "serverTime": { "type": "string", "format": "date-time" } }, "allOf": [ { "if": { "properties": { "capabilities": { "contains": { "const": "bot:write" } } } }, "then": { "properties": { "capabilities": { "contains": { "const": "bot:read" } } } } }, { "if": { "required": [ "serverCapabilities" ], "properties": { "serverCapabilities": { "contains": { "const": "bot:write" } } } }, "then": { "properties": { "serverCapabilities": { "contains": { "const": "bot:read" } } } } } ], "additionalProperties": false }, "DeviceIdentityRequest": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 } }, "additionalProperties": false }, "DeviceIdentityResponse": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 } }, "additionalProperties": false }, "DeviceCapabilitiesUpdateRequest": { "type": "object", "required": [ "accepts" ], "properties": { "accepts": { "type": "array", "description": "Negotiable capability vocabulary the device accepts: the progress grants tasks:read and agents:read, and the desktop-only simulators:control. Only additive grants are negotiable after pairing; legacy and Bot grants are never modified by this route. simulators:control is refused with capability_denied unless the paired device type is mac or linux, and with not_found when the serving Mac has no simulator feature. Contract revision 19 adds the desktop-only host:events, runs:observe and runs:control grants under the same mac-or-linux rule; a host without the host feed or run registry answers not_found. Contract revision 24 lets iphone and ipad devices negotiate the phone-scoped runs:observe and runs:control subset while the server advertises phone-run-control-v1 (android devices since contract revision 31); host:events stays desktop-only. Contract revision 26 lets iphone and ipad devices negotiate simulators:mobile, the phone simulator viewer grant, while the server advertises mobile-simulators-v1; mac and linux devices are refused it with capability_denied, and a Mac without the simulator feature answers not_found. Contract revision 27 adds bot:cards, which any device type may negotiate while the server advertises bot-durable-session-v1: it grants no authority and only opts the device into the memory_update and routine_proposal Bot session entries. Contract revision 30 adds bot:activity, which any device type may negotiate while the server advertises bot-activity-v1: it grants no authority and only opts the device into the activity and queued Bot session frames and Bot detail chatActivity. Contract revision 37 adds bot:handoffs, which any device type may negotiate while the server lists it in serverCapabilities (a host without the hand-off routes answers not_found): it opts the device into the Bot session handoff field and frame, the paused session state, Bot paused flags and the bot_paused error code, and lets it call the hand-off answer, open-on-mac and pause routes, which still need bot:read and bot:write. Phones request it in their own call, after any other negotiation. Contract revision 39 adds schedule:cards, which any device type may negotiate while the server lists it in serverCapabilities (a host without streams or the run registry answers not_found): it grants no authority and, together with schedule:read, opts the device into the schedule field on scheduled-task approvals. Phones request it in its own call, so an older host that rejects the name leaves every other grant in place. Contract revision 42 adds bot:issues, which any device type may negotiate while the server lists it in serverCapabilities (a host without the issue act route answers not_found): it grants no authority and opts the device into the Bot session issues list and frame, the summary issueCount, issue items in the routine notification feed, and the issue act route, which still needs bot:read and bot:write. Phones request it in its own call. Contract revision 43 adds bot:handoff-on-mac, negotiated like bot:handoff-notes beside bot:handoffs: it grants no authority and opts the device into onMac on hand-off cards whose step is on the Bot's own screen.", "minItems": 1, "maxItems": 23, "items": { "enum": [ "tasks:read", "agents:read", "questions:respond", "skills:invoke", "app-controls:read", "app-controls:respond", "simulators:control", "host:events", "runs:observe", "runs:control", "simulators:mobile", "bot:cards", "bot:activity", "bot:messaging", "bot:handoffs", "bot:handoff-notes", "bot:handoff-on-mac", "bot:access-requests", "bot:plans", "bot:allowed", "bot:images", "bot:issues", "bot:watches", "bot:open-work", "bot:routine-models", "bot:peers", "bot:needs-you", "schedule:cards", "chat:jobs", "attachments:raw", "chat:new-worktree", "bot:settings-changes", "bot:suggestions", "bot:templates", "approval:cards", "approvals:settings", "chat:continue-in-new-chat", "stream:snapshot-reasons", "approval:plain-words", "chat:agent-slider" ] }, "uniqueItems": true } }, "additionalProperties": false }, "DeviceCapabilitiesUpdateResponse": { "type": "object", "required": [ "capabilities" ], "properties": { "capabilities": { "type": "array", "description": "Complete updated capability grants for the authenticated device.", "items": { "enum": [ "server:read", "chat:read", "chat:write", "approval:respond", "workspace:read", "workspace:browse", "workspace:manage", "files:read", "files:write", "git:read", "git:write", "schedule:read", "schedule:write", "bot:read", "bot:write", "tasks:read", "agents:read", "questions:respond", "skills:invoke", "app-controls:read", "app-controls:respond", "simulators:control", "host:events", "runs:observe", "runs:control", "simulators:mobile", "bot:cards", "bot:activity", "bot:messaging", "bot:handoffs", "bot:handoff-notes", "bot:handoff-on-mac", "bot:access-requests", "bot:plans", "bot:allowed", "bot:images", "bot:issues", "bot:watches", "bot:open-work", "bot:routine-models", "bot:peers", "bot:needs-you", "schedule:cards", "chat:jobs", "attachments:raw", "chat:new-worktree", "bot:settings-changes", "bot:suggestions", "bot:templates", "approval:cards", "approvals:settings", "chat:continue-in-new-chat", "stream:snapshot-reasons", "approval:plain-words", "chat:agent-slider" ] }, "uniqueItems": true } }, "additionalProperties": false }, "SimulatorDevice": { "type": "object", "required": [ "id", "name", "platform", "version", "booted", "kind" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "platform": { "enum": [ "ios", "android" ], "description": "An Android emulator's id is its adb serial while it runs and its AVD name while it is off. Phones view only ios devices and show android ones as Open on your Mac to view, because only iOS Simulators serve MJPEG." }, "version": { "type": "string", "maxLength": 64 }, "booted": { "type": "boolean" }, "kind": { "enum": [ "iphone", "ipad", "other" ] } }, "additionalProperties": true }, "SimulatorListing": { "type": "object", "required": [ "sharing", "status", "devices" ], "properties": { "sharing": { "type": "boolean", "description": "Whether the serving Mac's owner shares simulators with this device's audience: Share with paired Macs for desktops, Share with Aiden On The Go for phones (contract revision 26). devices is empty while false." }, "status": { "enum": [ "disabled", "needs-consent", "installing", "starting", "ready", "stopped", "unavailable", "error" ] }, "detail": { "type": "string", "maxLength": 300 }, "devices": { "type": "array", "maxItems": 256, "items": { "$ref": "#/components/schemas/SimulatorDevice" } }, "chatDeviceIds": { "type": "array", "maxItems": 256, "description": "Contract revision 26. Present only when the request named a chatId: the listed simulators the desktop attached to that chat.", "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9-]+$" } }, "toolVersions": { "type": "object", "description": "Contract revision 26, phones only: the pinned helper versions on the serving Mac.", "required": [ "hub", "agent" ], "properties": { "hub": { "type": "string", "minLength": 1, "maxLength": 64 }, "agent": { "type": "string", "minLength": 1, "maxLength": 64 } }, "additionalProperties": false } }, "additionalProperties": false }, "SimulatorDeviceRequest": { "type": "object", "required": [ "deviceId" ], "properties": { "deviceId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" } }, "additionalProperties": false }, "SimulatorActionRequest": { "type": "object", "required": [ "deviceId", "type" ], "properties": { "deviceId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" }, "type": { "type": "string", "minLength": 1, "maxLength": 64 } }, "additionalProperties": true, "description": "One simulator control action. Fields beyond deviceId and type follow the desktop device-action vocabulary and are validated by the serving Mac, which always runs the action on its own simulators." }, "SimulatorOpenResponse": { "type": "object", "required": [ "device" ], "properties": { "device": { "$ref": "#/components/schemas/SimulatorDevice" } }, "additionalProperties": false }, "SimulatorOk": { "type": "object", "required": [ "ok" ], "properties": { "ok": { "const": true } }, "additionalProperties": false }, "SimulatorSettings": { "type": "object", "description": "Simulator settings snapshot (appearance, content size, and similar) as reported by the serving Mac.", "additionalProperties": true }, "SpeechStatus": { "type": "object", "required": [ "engine", "selectedModelId", "models", "input" ], "properties": { "engine": { "type": "object", "required": [ "ready", "error" ], "properties": { "ready": { "type": "boolean" }, "error": { "type": [ "string", "null" ] } }, "additionalProperties": false }, "selectedModelId": { "type": [ "string", "null" ] }, "models": { "type": "array", "maxItems": 16, "items": { "type": "object", "required": [ "id", "name", "description", "sizeLabel", "quant", "languagesLabel", "accuracy", "speed", "recommended", "installed" ], "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" }, "name": { "type": "string", "maxLength": 200 }, "description": { "type": "string", "maxLength": 1000 }, "sizeLabel": { "type": "string", "maxLength": 100 }, "quant": { "type": "string", "maxLength": 50 }, "languagesLabel": { "type": "string", "maxLength": 200 }, "accuracy": { "type": "number", "minimum": 0, "maximum": 1 }, "speed": { "type": "number", "minimum": 0, "maximum": 1 }, "recommended": { "type": "boolean" }, "installed": { "type": "boolean" }, "languages": { "type": "array", "maxItems": 128, "items": { "type": "string", "pattern": "^[a-z]{2,3}$" } }, "capabilities": { "type": "object", "required": [ "autoDetect", "languageHint", "translateToEnglish", "maxWindowSeconds" ], "properties": { "autoDetect": { "type": "boolean" }, "languageHint": { "type": "boolean" }, "translateToEnglish": { "type": "boolean" }, "maxWindowSeconds": { "type": [ "integer", "null" ], "minimum": 1 } }, "additionalProperties": false }, "license": { "type": "object", "required": [ "name", "url" ], "properties": { "name": { "type": "string", "maxLength": 200 }, "url": { "type": "string", "format": "uri", "maxLength": 1000 }, "attribution": { "type": "string", "maxLength": 200 } }, "additionalProperties": false }, "download": { "type": "object", "required": [ "id", "percentage", "phase", "status" ], "properties": { "id": { "type": "string" }, "percentage": { "type": "integer", "minimum": 0, "maximum": 100 }, "phase": { "enum": [ "download", "verify", "extract" ] }, "status": { "enum": [ "downloading", "failed" ] }, "error": { "type": "string", "maxLength": 1000 } }, "additionalProperties": false } }, "additionalProperties": false } }, "input": { "type": "object", "required": [ "encoding", "sampleRate", "channels", "maximumSeconds", "partialResults" ], "properties": { "encoding": { "const": "pcm_s16le" }, "sampleRate": { "const": 16000 }, "channels": { "const": 1 }, "maximumSeconds": { "const": 60 }, "partialResults": { "const": false } }, "additionalProperties": false } }, "additionalProperties": false }, "SpeechTranscriptionRequest": { "type": "object", "required": [ "encoding", "sampleRate", "channels", "pcmBase64", "modelId" ], "properties": { "encoding": { "const": "pcm_s16le" }, "sampleRate": { "const": 16000 }, "channels": { "const": 1 }, "pcmBase64": { "type": "string", "contentEncoding": "base64", "maxLength": 2560000 }, "modelId": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" } }, "additionalProperties": false }, "SpeechTranscription": { "type": "object", "required": [ "text", "modelId" ], "properties": { "text": { "type": "string", "maxLength": 200000 }, "modelId": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" } }, "additionalProperties": false }, "UsageTokens": { "type": "object", "required": [ "input", "output", "cacheRead", "cacheWrite", "reasoning", "total" ], "properties": { "input": { "type": "integer", "minimum": 0 }, "output": { "type": "integer", "minimum": 0 }, "cacheRead": { "type": "integer", "minimum": 0 }, "cacheWrite": { "type": "integer", "minimum": 0 }, "cacheWrite1h": { "type": "integer", "minimum": 0 }, "reasoning": { "type": "integer", "minimum": 0 }, "total": { "type": "integer", "minimum": 0 } }, "additionalProperties": false }, "UsageSummary": { "type": "object", "required": [ "range", "startDate", "endDate", "totals", "days", "models" ], "properties": { "range": { "enum": [ "7d", "30d", "90d", "1y", "all" ] }, "startDate": { "type": "string", "format": "date" }, "endDate": { "type": "string", "format": "date" }, "totals": { "type": "object", "required": [ "requests", "completedRequests", "failedRequests", "cancelledRequests", "reportedTokenRequests", "unmeteredRequests", "localRequests", "costedRequests", "unpricedHostedRequests", "hostedCostUsd", "activeDays", "currentStreak", "longestStreak", "tokens" ], "properties": { "requests": { "type": "integer", "minimum": 0 }, "completedRequests": { "type": "integer", "minimum": 0 }, "failedRequests": { "type": "integer", "minimum": 0 }, "cancelledRequests": { "type": "integer", "minimum": 0 }, "reportedTokenRequests": { "type": "integer", "minimum": 0 }, "unmeteredRequests": { "type": "integer", "minimum": 0 }, "localRequests": { "type": "integer", "minimum": 0 }, "costedRequests": { "type": "integer", "minimum": 0 }, "unpricedHostedRequests": { "type": "integer", "minimum": 0 }, "hostedCostUsd": { "type": "number", "minimum": 0 }, "activeDays": { "type": "integer", "minimum": 0 }, "currentStreak": { "type": "integer", "minimum": 0 }, "longestStreak": { "type": "integer", "minimum": 0 }, "tokens": { "$ref": "#/components/schemas/UsageTokens" } }, "additionalProperties": false }, "days": { "type": "array", "items": { "type": "object" } }, "models": { "type": "array", "items": { "type": "object" } } }, "additionalProperties": false }, "Workspace": { "type": "object", "required": [ "id", "name", "permission", "memoryEnabled", "hasFolder", "isManagedWorktree", "createdAt", "updatedAt", "revision" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "permission": { "enum": [ "full", "ask", "none" ] }, "memoryEnabled": { "type": "boolean" }, "hasFolder": { "type": "boolean" }, "isManagedWorktree": { "type": "boolean" }, "noWorkspace": { "type": "boolean", "const": true, "description": "Contract revision 51. Present only on a hidden folder Aiden made for one chat without a workspace. Clients list those chats under one Chats group instead of a workspace each." }, "branchName": { "type": "string" }, "repositoryName": { "type": "string" }, "git": { "type": "object", "properties": { "isRepo": { "type": "boolean" }, "branch": { "type": "string" }, "uncommitted": { "type": "integer", "minimum": 0 } }, "required": [ "isRepo" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string" } }, "additionalProperties": false }, "WorkspaceCreate": { "oneOf": [ { "type": "object", "required": [ "mode", "name" ], "properties": { "mode": { "const": "folderless" }, "name": { "type": "string", "minLength": 1, "maxLength": 120 } }, "additionalProperties": false }, { "type": "object", "required": [ "mode" ], "properties": { "mode": { "const": "scratch" } }, "additionalProperties": false }, { "type": "object", "required": [ "mode", "selection" ], "properties": { "mode": { "const": "selected-folder" }, "selection": { "type": "string", "pattern": "^sel_[A-Za-z0-9_-]{43}$" }, "name": { "type": "string", "minLength": 1, "maxLength": 120 } }, "additionalProperties": false }, { "type": "object", "required": [ "mode", "selection", "url", "files" ], "properties": { "mode": { "const": "clone" }, "selection": { "type": "string", "pattern": "^sel_[A-Za-z0-9_-]{43}$" }, "url": { "type": "string", "minLength": 1, "maxLength": 2048 }, "files": { "type": "array", "maxItems": 16, "items": { "type": "object", "required": [ "name", "content" ], "properties": { "name": { "type": "string", "maxLength": 80, "pattern": "^\\.(?:env|dev\\.vars)(?:\\.[A-Za-z0-9_-][A-Za-z0-9_.-]*)?$" }, "content": { "type": "string", "maxLength": 131072 } }, "additionalProperties": false } } }, "additionalProperties": false, "description": "Desktop-only, requires workspace:manage and workspace:browse. Clones into a new repository-name child of the selected approved folder. Optional ignored root-level environment text files are at most 128 KiB each and 512 KiB total. Request cancellation stops the clone before publication when possible; a lost reply must be reconciled before a fresh request." } ] }, "ForegroundConfirmation": { "type": "object", "required": [ "confirmedForeground" ], "properties": { "confirmedForeground": { "const": true } }, "additionalProperties": false }, "WorkspacePatch": { "type": "object", "required": [ "confirmedForeground" ], "minProperties": 2, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "permission": { "enum": [ "full", "ask", "none" ] }, "memoryEnabled": { "type": "boolean" }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "BrowserRoot": { "type": "object", "required": [ "id", "label", "location", "policyRevision" ], "properties": { "id": { "type": "string", "maxLength": 128 }, "label": { "type": "string", "maxLength": 120 }, "location": { "type": "string", "pattern": "^loc_[A-Za-z0-9_-]{43}$" }, "policyRevision": { "type": "string", "maxLength": 128 } }, "additionalProperties": false }, "BrowserEntry": { "type": "object", "required": [ "id", "name", "location" ], "properties": { "id": { "type": "string", "maxLength": 128 }, "name": { "type": "string", "maxLength": 255 }, "location": { "type": "string", "pattern": "^loc_[A-Za-z0-9_-]{43}$" } }, "additionalProperties": false }, "BrowserPage": { "type": "object", "required": [ "rootId", "label", "breadcrumbs", "entries" ], "properties": { "rootId": { "type": "string", "maxLength": 128 }, "label": { "type": "string", "maxLength": 120 }, "breadcrumbs": { "type": "array", "maxItems": 20, "items": { "type": "object", "required": [ "label", "location" ], "properties": { "label": { "type": "string", "maxLength": 255 }, "location": { "type": "string", "pattern": "^loc_[A-Za-z0-9_-]{43}$" } }, "additionalProperties": false } }, "entries": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/BrowserEntry" } }, "nextCursor": { "type": "string", "pattern": "^cur_[A-Za-z0-9_-]{43}$" } }, "additionalProperties": false }, "WorkspaceSelection": { "type": "object", "required": [ "selection", "displayName", "expiresAt" ], "properties": { "selection": { "type": "string", "pattern": "^sel_[A-Za-z0-9_-]{43}$" }, "displayName": { "type": "string", "maxLength": 255 }, "expiresAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "MessageAttachment": { "type": "object", "required": [ "id", "name", "mimeType", "kind", "size" ], "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,256}$" }, "name": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^[^/\\\\\\u0000-\\u001F\\u007F]+$" }, "mimeType": { "type": "string", "minLength": 1, "maxLength": 120 }, "kind": { "enum": [ "image", "text" ] }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "toolCallId": { "type": "string", "pattern": "^call-[1-9][0-9]*$", "description": "Contract revision 44: on an assistant image, the timeline tool step that produced it. Clients draw the image at that step; an image without it trails the reply." } }, "additionalProperties": false }, "AttachmentReference": { "type": "object", "required": [ "id", "name", "mimeType", "kind", "size", "expiresAt" ], "properties": { "id": { "type": "string", "pattern": "^att_[A-Za-z0-9_-]{43}$" }, "name": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^[^/\\\\\\u0000-\\u001F\\u007F]+$" }, "mimeType": { "type": "string", "maxLength": 120 }, "kind": { "enum": [ "image", "text" ] }, "size": { "type": "integer", "minimum": 0, "maximum": 8388608 }, "expiresAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "RawAttachmentUpload": { "description": "Contract revision 50 (attachments:raw): one picture's raw bytes, at most 8 MiB, with an exact Content-Length and the file name, percent-encoded UTF-8, in the Aiden-Attachment-Name header. The host checks the bytes, type and dimensions exactly as for the JSON upload.", "type": "string", "format": "binary", "maxLength": 8388608 }, "AttachmentUpload": { "oneOf": [ { "type": "object", "required": [ "name", "mimeType", "kind", "data" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^[^/\\\\\\u0000-\\u001F\\u007F]+$" }, "mimeType": { "enum": [ "image/png", "image/jpeg" ] }, "kind": { "const": "image" }, "data": { "type": "string", "contentEncoding": "base64", "maxLength": 11184812 } }, "additionalProperties": false }, { "type": "object", "required": [ "name", "mimeType", "kind", "text" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^[^/\\\\\\u0000-\\u001F\\u007F]+$" }, "mimeType": { "enum": [ "text/plain", "text/markdown", "text/csv", "application/json", "application/xml", "application/yaml", "application/x-yaml", "application/javascript", "application/typescript" ] }, "kind": { "const": "text" }, "text": { "type": "string", "maxLength": 100000 } }, "additionalProperties": false } ] }, "MessageOutcome": { "type": "object", "required": [ "status" ], "properties": { "status": { "enum": [ "failed", "cancelled" ] }, "category": { "enum": [ "network", "timeout", "service_unavailable", "rate_limit", "authentication", "quota", "invalid_request", "context_window", "output_limit", "interrupted", "context_management", "unknown" ] }, "attempts": { "type": "integer", "minimum": 0, "maximum": 16 }, "retryExhausted": { "type": "boolean" } }, "additionalProperties": false }, "GenerationLineChanges": { "type": "object", "required": [ "additions", "deletions" ], "properties": { "additions": { "type": "integer", "minimum": 0, "maximum": 100000000 }, "deletions": { "type": "integer", "minimum": 0, "maximum": 100000000 } }, "additionalProperties": false }, "GenerationToolStep": { "type": "object", "required": [ "id", "order", "kind", "toolCallId", "toolName", "label", "status", "startedAt", "updatedAt" ], "properties": { "id": { "type": "string", "pattern": "^tool-[1-9][0-9]*$" }, "order": { "type": "integer", "minimum": 0, "maximum": 199 }, "kind": { "const": "tool" }, "toolCallId": { "type": "string", "pattern": "^call-[1-9][0-9]*$" }, "toolName": { "type": "string", "minLength": 1, "maxLength": 80 }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "status": { "enum": [ "pending", "awaiting_approval", "running", "completed", "failed", "blocked", "cancelled" ] }, "startedAt": { "type": "number", "minimum": 0 }, "updatedAt": { "type": "number", "minimum": 0 }, "finishedAt": { "type": "number", "minimum": 0 }, "contentOffset": { "type": "integer", "minimum": 0 }, "target": { "type": "string", "minLength": 1, "maxLength": 240, "pattern": "^(?![/~])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$" }, "detail": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^[^\\u0000-\\u001F\\u007F]+$" }, "lineChanges": { "$ref": "#/components/schemas/GenerationLineChanges" }, "producedFile": { "$ref": "#/components/schemas/ProducedFile" }, "questionnaire": { "$ref": "#/components/schemas/AskUserQuestionRecap" }, "extraction": { "$ref": "#/components/schemas/WebExtractRecap" }, "recording": { "$ref": "#/components/schemas/BrowserRecordingRecap" }, "stoppedByUser": { "const": true, "description": "Contract revision 62. Set only on a cancelled step Aiden cancelled because the person pressed Stop; clients read it as stopped, not as an issue. Absent on every other step." } }, "allOf": [ { "if": { "required": [ "stoppedByUser" ] }, "then": { "properties": { "status": { "const": "cancelled" } } } }, { "if": { "required": [ "producedFile" ] }, "then": { "properties": { "status": { "const": "completed" } }, "oneOf": [ { "properties": { "toolName": { "const": "write_file" }, "producedFile": { "properties": { "operation": { "const": "written" } } } } }, { "properties": { "toolName": { "const": "edit_file" }, "producedFile": { "properties": { "operation": { "const": "edited" } } } } } ] } }, { "if": { "required": [ "questionnaire" ] }, "then": { "required": [ "status", "toolName" ], "properties": { "status": { "const": "completed" }, "toolName": { "const": "ask_user_question" } } } }, { "if": { "required": [ "extraction" ] }, "then": { "required": [ "status", "toolName" ], "properties": { "status": { "const": "completed" }, "toolName": { "const": "web_fetch" } } } }, { "if": { "required": [ "recording" ] }, "then": { "required": [ "status", "toolName" ], "properties": { "status": { "const": "completed" }, "toolName": { "const": "browser_recording_stop" } } } } ], "additionalProperties": false }, "ProducedFile": { "type": "object", "description": "Host-confirmed successful write_file/edit_file provenance. Only on completed tool steps. Never an authorization to open a Mac path.", "required": [ "relativePath", "operation", "bytes" ], "properties": { "relativePath": { "type": "string", "minLength": 1, "maxLength": 240, "pattern": "^(?![/~])(?![A-Za-z]:/)(?![\\s\\S]*(?:^|/)\\.{1,2}(?:/|$))(?![\\s\\S]*//)(?![\\s\\S]*/$)[^\\\\\\u0000-\\u001F\\u007F]+$" }, "operation": { "enum": [ "written", "edited" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 1000000000 } }, "additionalProperties": false }, "WebExtractRecap": { "type": "object", "description": "Contract revision 38. Display-only recap of a web_fetch extract call: the page's host and each value read, with the page line it came from. Only on completed web_fetch tool steps of a version 3 timeline. error means extraction failed and the page text was read instead; fields is then empty, and otherwise holds one to sixteen fields with distinct names. cut means only the first part of the page was read. Strings are single lines: no control characters, no leading, trailing or repeated whitespace, and spaces only as U+0020. Lengths count Unicode code points. Clients render it as text and never act on it; older clients ignore it.", "required": [ "version", "host", "cut", "fields" ], "properties": { "version": { "const": 1 }, "host": { "type": "string", "minLength": 1, "maxLength": 253, "pattern": "^[^\\s\\u0000-\\u001F\\u007F]+(?: [^\\s\\u0000-\\u001F\\u007F]+)*$" }, "cut": { "type": "boolean" }, "error": { "enum": [ "setup", "auth", "quota", "timeout", "unavailable", "invalid-response" ] }, "fields": { "type": "array", "maxItems": 16, "items": { "$ref": "#/components/schemas/WebExtractRecapField" } } }, "if": { "required": [ "error" ] }, "then": { "properties": { "fields": { "maxItems": 0 } } }, "else": { "properties": { "fields": { "minItems": 1 } } }, "additionalProperties": false }, "WebExtractRecapField": { "type": "object", "description": "One value read off the page. extracted is typed, confident and found on the page, so value, confidence and sourceLine are all present. uncertain is a guess, never a value read from the page; notFound marks a guess that appears nowhere on the page. null means the page has no value, and carries only name and status. value is a short display form; scripts get the whole value.", "required": [ "name", "status" ], "properties": { "name": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$" }, "status": { "enum": [ "extracted", "uncertain", "null" ] }, "value": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\s\\u0000-\\u001F\\u007F]+(?: [^\\s\\u0000-\\u001F\\u007F]+)*$" }, "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, "sourceLine": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^[^\\s\\u0000-\\u001F\\u007F]+(?: [^\\s\\u0000-\\u001F\\u007F]+)*$" }, "notFound": { "const": true } }, "allOf": [ { "if": { "required": [ "status" ], "properties": { "status": { "const": "extracted" } } }, "then": { "required": [ "value", "confidence", "sourceLine" ], "not": { "required": [ "notFound" ] } } }, { "if": { "required": [ "status" ], "properties": { "status": { "const": "null" } } }, "then": { "not": { "anyOf": [ { "required": [ "value" ] }, { "required": [ "confidence" ] }, { "required": [ "sourceLine" ] }, { "required": [ "notFound" ] } ] } } } ], "additionalProperties": false }, "AskUserQuestionRecap": { "type": "object", "description": "Contract revision 29. Display-only recap of a settled ask_user_question card: each question and what the owner chose. Only on completed ask_user_question tool steps of a version 3 timeline. dismissed means the owner closed the card and expired means the agent stopped waiting; both leave every item skipped. Lengths count Unicode code points. Clients render it as text and never treat it as an answer to submit; older clients ignore it.", "required": [ "version", "outcome", "items" ], "properties": { "version": { "const": 1 }, "outcome": { "enum": [ "answered", "dismissed", "expired" ] }, "items": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/components/schemas/AskUserQuestionRecapItem" } } }, "allOf": [ { "if": { "required": [ "outcome" ], "properties": { "outcome": { "enum": [ "dismissed", "expired" ] } } }, "then": { "properties": { "items": { "items": { "properties": { "kind": { "const": "skipped" } } } } } } } ], "additionalProperties": false }, "AskUserQuestionRecapItem": { "type": "object", "description": "One question and its outcome. option carries the one chosen label, multi one to five distinct labels, custom the owner's own text (clipped to 1000 code points), and skipped no answers. Strings are non-blank and contain no C0 control characters other than tab and newline, and no DEL.", "required": [ "question", "header", "kind", "answers" ], "properties": { "question": { "type": "string", "minLength": 1, "maxLength": 1000, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0008\\u000B-\\u001F\\u007F]+$" }, "header": { "type": "string", "minLength": 1, "maxLength": 16, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0008\\u000B-\\u001F\\u007F]+$" }, "kind": { "enum": [ "option", "multi", "custom", "skipped" ] }, "answers": { "type": "array", "maxItems": 5, "items": { "type": "string", "minLength": 1, "maxLength": 1000, "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u0008\\u000B-\\u001F\\u007F]+$" } } }, "allOf": [ { "if": { "required": [ "kind" ], "properties": { "kind": { "const": "skipped" } } }, "then": { "properties": { "answers": { "maxItems": 0 } } } }, { "if": { "required": [ "kind" ], "properties": { "kind": { "const": "option" } } }, "then": { "properties": { "answers": { "minItems": 1, "maxItems": 1, "items": { "maxLength": 60 } } } } }, { "if": { "required": [ "kind" ], "properties": { "kind": { "const": "multi" } } }, "then": { "properties": { "answers": { "minItems": 1, "maxItems": 5, "uniqueItems": true, "items": { "maxLength": 60 } } } } }, { "if": { "required": [ "kind" ], "properties": { "kind": { "const": "custom" } } }, "then": { "properties": { "answers": { "minItems": 1, "maxItems": 1 } } } } ], "additionalProperties": false }, "GenerationThinkingStep": { "type": "object", "required": [ "id", "order", "kind", "startedAt", "updatedAt" ], "properties": { "id": { "type": "string", "pattern": "^think-[1-9][0-9]*$" }, "order": { "type": "integer", "minimum": 0, "maximum": 199 }, "kind": { "const": "thinking" }, "startedAt": { "type": "number", "minimum": 0 }, "updatedAt": { "type": "number", "minimum": 0 }, "finishedAt": { "type": "number", "minimum": 0 }, "contentOffset": { "type": "integer", "minimum": 0 }, "durationMs": { "type": "number", "minimum": 0 }, "reasoningStartOffset": { "type": "integer", "minimum": 0 }, "reasoningEndOffset": { "type": "integer", "minimum": 0 } }, "additionalProperties": false }, "GenerationTimeline": { "type": "object", "required": [ "version", "generationId", "status", "startedAt", "steps" ], "properties": { "version": { "enum": [ 1, 2, 3 ] }, "generationId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "status": { "enum": [ "running", "completed", "failed", "cancelled" ] }, "startedAt": { "type": "number", "minimum": 0 }, "finishedAt": { "type": "number", "minimum": 0 }, "steps": { "type": "array", "maxItems": 200, "items": { "oneOf": [ { "$ref": "#/components/schemas/GenerationToolStep" }, { "$ref": "#/components/schemas/GenerationThinkingStep" } ] } }, "cancellationOrigin": { "enum": [ "user_stop", "chat_deletion", "workspace_authority_change", "computer_use_disabled", "scheduled_task_cancel", "application_shutdown" ] }, "claimCheck": { "type": "object", "required": [ "kind", "stepIds" ], "properties": { "kind": { "const": "unverified_success" }, "stepIds": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "type": "string" } } }, "additionalProperties": false } }, "allOf": [ { "if": { "required": [ "version" ], "properties": { "version": { "enum": [ 1, 2 ] } } }, "then": { "properties": { "steps": { "items": { "not": { "anyOf": [ { "required": [ "questionnaire" ] }, { "required": [ "extraction" ] }, { "required": [ "stoppedByUser" ] } ] } } } } } } ], "additionalProperties": false }, "Message": { "type": "object", "required": [ "id", "role", "text", "createdAt" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "role": { "enum": [ "user", "assistant" ] }, "text": { "type": "string", "maxLength": 200000 }, "reasoning": { "type": "string", "maxLength": 100000 }, "attachments": { "type": "array", "maxItems": 20, "items": { "$ref": "#/components/schemas/MessageAttachment" } }, "appPanels": { "type": "array", "maxItems": 4, "items": { "$ref": "#/components/schemas/AppControlPanel" } }, "outcome": { "$ref": "#/components/schemas/MessageOutcome" }, "timeline": { "$ref": "#/components/schemas/GenerationTimeline" }, "htmlArtifacts": { "type": "array", "maxItems": 40, "items": { "type": "object", "required": [ "id", "title" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 256 }, "title": { "type": "string", "minLength": 1, "maxLength": 120 } }, "additionalProperties": false } }, "visuals": { "description": "Additive in contract revision 28 (feature chat-visuals-v1): inline visuals in reply order. Clients show the snapshot image (an attachment on this message) after the matching timeline tool step, else fallbackText, and drop entries they cannot parse.", "type": "array", "maxItems": 40, "items": { "type": "object", "required": [ "id", "kind", "title" ], "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,256}$" }, "kind": { "type": "string", "enum": [ "ui", "html" ] }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "toolCallId": { "type": "string", "pattern": "^call-[1-9][0-9]*$" }, "fallbackText": { "type": "string", "minLength": 1, "maxLength": 4000 }, "snapshotAttachmentId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,256}$" }, "layout": { "type": "string", "enum": [ "wide" ] } }, "additionalProperties": false } }, "inputSource": { "type": "string", "enum": [ "voice" ], "description": "Additive in contract revision 60, user messages only: Aiden Live sent this message for the person on the Mac. Clients show a small \"By voice\" label; they ignore the key on assistant messages and any value they do not know." }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "BotSemanticAvatar": { "type": "object", "required": [ "version", "shape", "color" ], "properties": { "version": { "const": 1 }, "shape": { "enum": [ "wisp", "orb", "drop", "hex", "cloud", "peak", "squircle", "capsule" ] }, "color": { "enum": [ "lilac", "sky", "mint", "sun", "periwinkle", "coral", "peach", "aqua", "rose", "lime", "plum", "graphite" ] }, "eyes": { "enum": [ "dots", "wide", "happy", "sleepy", "focus", "wink" ], "description": "Retired in revision 25: accepted and ignored on input, never emitted." }, "detail": { "enum": [ "none", "halo", "orbit", "sparkles", "antenna", "bolts" ], "description": "Retired in revision 25: accepted and ignored on input, never emitted." } }, "additionalProperties": false }, "BotAvatarAsset": { "type": "object", "required": [ "assetRevision", "mimeType", "width", "height", "byteSize" ], "properties": { "assetRevision": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "mimeType": { "const": "image/png" }, "width": { "const": 512 }, "height": { "const": 512 }, "byteSize": { "type": "integer", "minimum": 1, "maximum": 4194304 } }, "additionalProperties": false }, "BotAvatarView": { "type": "object", "required": [ "semantic" ], "properties": { "semantic": { "$ref": "#/components/schemas/BotSemanticAvatar" }, "asset": { "$ref": "#/components/schemas/BotAvatarAsset" } }, "additionalProperties": false }, "BotHealth": { "enum": [ "ready", "degraded", "unavailable" ] }, "BotSummary": { "type": "object", "x-aiden-updated-at-not-before-created-at": true, "required": [ "id", "name", "purpose", "avatar", "health", "createdAt", "updatedAt", "revision" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "purpose": { "type": "string", "maxLength": 280 }, "avatar": { "$ref": "#/components/schemas/BotAvatarView" }, "health": { "$ref": "#/components/schemas/BotHealth" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 }, "sessionState": { "description": "Contract revision 37: paused reaches only devices holding bot:handoffs; every other device sees a paused Bot as unavailable.", "enum": [ "idle", "running", "interrupted", "needs_model", "unavailable", "paused" ] }, "paused": { "description": "Contract revision 37, only for devices holding bot:handoffs and only while the person paused the Bot (sessionState is then paused).", "const": true }, "issueCount": { "description": "Contract revision 42, only for devices holding bot:issues and only while it is above zero: how many open Bot issues the Bot holds.", "type": "integer", "minimum": 1, "maximum": 8 }, "needsYou": { "const": true, "description": "Contract revision 68, only on GET /bots for devices holding bot:needs-you: an approval, a question, a hand-off or an open issue waits on the person. Sent only as true." } }, "additionalProperties": false }, "BotList": { "type": "object", "required": [ "bots", "maxBots" ], "properties": { "bots": { "type": "array", "maxItems": 256, "items": { "$ref": "#/components/schemas/BotSummary" } }, "maxBots": { "const": 256 }, "messaging": { "$ref": "#/components/schemas/BotMessagingSettings" } }, "additionalProperties": false }, "BotCapabilityOption": { "type": "object", "required": [ "id", "label", "available" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "available": { "type": "boolean" }, "description": { "type": "string", "maxLength": 280 } }, "additionalProperties": false }, "BotFileScopeOption": { "type": "object", "required": [ "id", "label", "available", "kind" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "available": { "type": "boolean" }, "kind": { "enum": [ "full_mac", "bot_home", "approved_location" ] }, "description": { "type": "string", "maxLength": 280 } }, "additionalProperties": false }, "BotProviderModelOption": { "type": "object", "required": [ "id", "label", "available", "supportsImages" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 512 }, "label": { "type": "string", "minLength": 1, "maxLength": 160 }, "available": { "type": "boolean" }, "supportsImages": { "type": "boolean" } }, "additionalProperties": false }, "BotProviderOption": { "type": "object", "required": [ "id", "label", "available", "models" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 256 }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "available": { "type": "boolean" }, "models": { "type": "array", "maxItems": 256, "items": { "$ref": "#/components/schemas/BotProviderModelOption" } } }, "additionalProperties": false }, "BotCapabilityCatalog": { "type": "object", "required": [ "revision", "providers", "fileScopes", "shellAvailable", "connections", "skills", "otherCapabilities" ], "properties": { "revision": { "type": "string", "minLength": 1, "maxLength": 128 }, "providers": { "type": "array", "maxItems": 64, "x-aiden-max-total-models": 512, "items": { "$ref": "#/components/schemas/BotProviderOption" } }, "fileScopes": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/BotFileScopeOption" } }, "shellAvailable": { "type": "boolean" }, "connections": { "type": "array", "maxItems": 128, "items": { "$ref": "#/components/schemas/BotCapabilityOption" } }, "skillsEnabled": { "type": "boolean", "default": true, "description": "Optional global Skills gate; omission means enabled. When false, skill choices are unavailable and only authenticated retained selections may be preserved or reduced. This flag never grants runtime skill authority." }, "skills": { "type": "array", "maxItems": 256, "items": { "$ref": "#/components/schemas/BotCapabilityOption" } }, "otherCapabilities": { "type": "array", "maxItems": 128, "items": { "$ref": "#/components/schemas/BotCapabilityOption" } } }, "additionalProperties": false }, "BotCustomSelection": { "type": "object", "required": [ "providerId", "modelId", "fileScopeIds", "shellEnabled", "connectionIds", "skillIds", "otherCapabilityIds" ], "properties": { "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 }, "fileScopeIds": { "type": "array", "maxItems": 64, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "shellEnabled": { "type": "boolean" }, "connectionIds": { "type": "array", "maxItems": 128, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "skillIds": { "type": "array", "maxItems": 256, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } }, "otherCapabilityIds": { "type": "array", "maxItems": 128, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" } } }, "additionalProperties": false }, "BotAccessView": { "oneOf": [ { "type": "object", "required": [ "botId", "accessMode", "revision", "policyEpoch", "summary" ], "properties": { "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "accessMode": { "const": "full" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 }, "policyEpoch": { "type": "string", "minLength": 1, "maxLength": 128 }, "summary": { "type": "string", "minLength": 1, "maxLength": 280 } }, "additionalProperties": false }, { "type": "object", "required": [ "botId", "accessMode", "revision", "policyEpoch", "summary", "custom" ], "properties": { "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "accessMode": { "const": "custom" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 }, "policyEpoch": { "type": "string", "minLength": 1, "maxLength": 128 }, "summary": { "type": "string", "minLength": 1, "maxLength": 280 }, "custom": { "$ref": "#/components/schemas/BotCustomSelection" } }, "additionalProperties": false } ] }, "BotAccessUpdateRequest": { "oneOf": [ { "type": "object", "required": [ "accessMode", "catalogRevision", "confirmedForeground" ], "properties": { "accessMode": { "const": "full" }, "catalogRevision": { "type": "string", "minLength": 1, "maxLength": 128 }, "confirmedForeground": { "const": true }, "providerId": { "type": "string", "minLength": 1, "maxLength": 128 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 }, "visionModel": { "oneOf": [ { "$ref": "#/components/schemas/BotModelSelection" }, { "type": "null" } ] } }, "dependentRequired": { "providerId": [ "modelId" ], "modelId": [ "providerId" ] }, "additionalProperties": false }, { "type": "object", "required": [ "accessMode", "catalogRevision", "custom" ], "properties": { "accessMode": { "const": "custom" }, "catalogRevision": { "type": "string", "minLength": 1, "maxLength": 128 }, "custom": { "$ref": "#/components/schemas/BotCustomSelection" }, "visionModel": { "oneOf": [ { "$ref": "#/components/schemas/BotModelSelection" }, { "type": "null" } ] } }, "additionalProperties": false } ] }, "BotDetail": { "type": "object", "x-aiden-updated-at-not-before-created-at": true, "required": [ "id", "name", "purpose", "instructions", "avatar", "health", "access", "createdAt", "updatedAt", "revision" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "purpose": { "type": "string", "maxLength": 280 }, "instructions": { "type": "string", "minLength": 1, "maxLength": 32000 }, "avatar": { "$ref": "#/components/schemas/BotAvatarView" }, "health": { "$ref": "#/components/schemas/BotHealth" }, "access": { "$ref": "#/components/schemas/BotAccessView" }, "modelSelection": { "type": "object", "required": [ "providerId", "modelId" ], "properties": { "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 } }, "additionalProperties": false }, "visionModelSelection": { "$ref": "#/components/schemas/BotModelSelection" }, "chatActivity": { "description": "Contract revision 30, only for devices holding bot:activity.", "$ref": "#/components/schemas/BotChatActivity" }, "sessionState": { "description": "Present when the host advertises bot-durable-session-v1. Contract revision 37: paused reaches only devices holding bot:handoffs; every other device sees a paused Bot as unavailable.", "enum": [ "idle", "running", "interrupted", "needs_model", "unavailable", "paused" ] }, "paused": { "description": "Contract revision 37, always present for devices holding bot:handoffs and never for others: whether the person paused the Bot.", "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 }, "botMessaging": { "$ref": "#/components/schemas/BotMessaging", "description": "Revision 54, only for devices holding bot:messaging. Absent switches default on." } }, "additionalProperties": false }, "BotModelSelection": { "type": "object", "required": [ "providerId", "modelId" ], "properties": { "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 } }, "additionalProperties": false }, "BotCreateRequest": { "type": "object", "x-aiden-provider-model-must-be-currently-available": true, "required": [ "name", "avatar" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "purpose": { "type": "string", "maxLength": 280, "description": "Optional from contract revision 61 for a device holding bot:templates; absent means empty. Other devices must send it." }, "openingGreeting": { "type": "string", "maxLength": 2000, "deprecated": true, "description": "Retired in contract revision 27. Accepted and ignored so older clients keep working; never emitted." }, "instructions": { "type": "string", "minLength": 1, "maxLength": 32000, "description": "Optional from contract revision 61 for a device holding bot:templates; absent means the starter instructions. Other devices must send it, and an empty string is still refused." }, "avatar": { "$ref": "#/components/schemas/BotSemanticAvatar" }, "access": { "$ref": "#/components/schemas/BotAccessUpdateRequest", "description": "Optional." } }, "additionalProperties": false }, "BotIdentityPatch": { "type": "object", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "purpose": { "type": "string", "maxLength": 280 }, "openingGreeting": { "type": "string", "maxLength": 2000, "deprecated": true, "description": "Retired in contract revision 27. Accepted and ignored so older clients keep working; never emitted." }, "instructions": { "type": "string", "minLength": 1, "maxLength": 32000 }, "avatar": { "$ref": "#/components/schemas/BotSemanticAvatar" }, "chatActivity": { "description": "Contract revision 30, only on hosts announcing bot-activity-v1. Absent keeps the saved choice.", "$ref": "#/components/schemas/BotChatActivity" }, "botMessaging": { "$ref": "#/components/schemas/BotMessagingPatch" } }, "additionalProperties": false }, "BotConversationItem": { "type": "object", "x-aiden-updated-at-not-before-created-at": true, "required": [ "chatId", "botId", "title", "activityState", "canRespondToApproval", "createdAt", "updatedAt", "revision" ], "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 128 }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "title": { "type": "string", "maxLength": 1024 }, "preview": { "type": "string", "maxLength": 500 }, "activityState": { "enum": [ "idle", "queued", "running", "waiting_for_approval", "reconciling" ] }, "canRespondToApproval": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 } }, "allOf": [ { "if": { "required": [ "canRespondToApproval" ], "properties": { "canRespondToApproval": { "const": true } } }, "then": { "properties": { "activityState": { "const": "waiting_for_approval" } } } } ], "additionalProperties": false }, "BotConversationPage": { "type": "object", "required": [ "conversations" ], "properties": { "conversations": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/BotConversationItem" } }, "nextCursor": { "type": "string", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false }, "BotChatCreateRequest": { "x-aiden-provider-model-must-be-currently-available": true, "oneOf": [ { "type": "object", "maxProperties": 0, "additionalProperties": false }, { "type": "object", "required": [ "providerId", "modelId" ], "properties": { "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 } }, "additionalProperties": false } ] }, "BotChatCreateResponse": { "allOf": [ { "$ref": "#/components/schemas/Chat" }, { "type": "object", "required": [ "botId" ] } ] }, "BotAvatarUploadRequest": { "type": "object", "required": [ "mimeType", "data" ], "properties": { "mimeType": { "enum": [ "image/png", "image/jpeg" ] }, "data": { "type": "string", "contentEncoding": "base64", "minLength": 4, "maxLength": 5592408, "pattern": "^[A-Za-z0-9+/]+={0,2}$" } }, "additionalProperties": false }, "Chat": { "type": "object", "x-aiden-max-json-response-bytes": 1048576, "x-aiden-updated-at-not-before-created-at": true, "not": { "required": [ "botId", "thinkingLevel" ] }, "dependentRequired": { "providerId": [ "modelId" ], "thinkingLevel": [ "modelId" ], "modelId": [ "providerId" ] }, "required": [ "id", "workspaceId", "title", "messages", "createdAt", "updatedAt", "revision" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "title": { "type": "string", "maxLength": 1024 }, "titlePending": { "type": "boolean", "enum": [ true ] }, "forkedFrom": { "description": "Additive in contract revision 21: present on a chat created by Fork.", "allOf": [ { "$ref": "#/components/schemas/ChatForkLineage" } ] }, "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 }, "thinkingLevel": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ], "description": "Contract revision 70: the chat's own thinking level (an Agent Slider stop), present only with providerId and modelId and never on a Bot chat. Absent: the model's saved level applies." }, "messages": { "type": "array", "maxItems": 10000, "items": { "$ref": "#/components/schemas/Message" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false }, "ChatTriage": { "type": "object", "description": "A chat's Inbox triage on its host (chat-triage-v1). revision starts at 1 and rises with every write; pass it back as ifRevision.", "required": [ "chatId", "revision", "updatedAt" ], "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 160 }, "revision": { "type": "integer", "minimum": 1 }, "updatedAt": { "type": "string", "format": "date-time" }, "pinnedAt": { "type": "string", "format": "date-time" }, "doneAt": { "type": "string", "format": "date-time" }, "snoozedUntil": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "ChatSummary": { "type": "object", "description": "Transcript-free regular-chat projection. Harmless additive fields are tolerated, while clients still apply the recursive private-field denial policy.", "x-aiden-updated-at-not-before-created-at": true, "required": [ "id", "workspaceId", "title", "titlePending", "createdAt", "updatedAt", "revision", "activity" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "title": { "type": "string", "maxLength": 1024 }, "titlePending": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 47, "maxLength": 47, "pattern": "^rev_[A-Za-z0-9_-]{43}$" }, "activity": { "enum": [ "idle", "active" ] }, "rowState": { "description": "Additive in contract revision 18. List-row state in display priority: needs_approval (a tool approval is waiting), needs_input (an ask-user question is waiting), working (a turn is running), or idle. Older servers omit it; clients then fall back to activity.", "enum": [ "needs_approval", "needs_input", "working", "idle" ] }, "unread": { "description": "Additive in contract revision 18. True only when assistant output was persisted after the chat was last viewed on any surface (desktop or a paired device). Output older than the host's read-tracking baseline is never unread. Always false on hosts that do not advertise chat-read-state-v1.", "type": "boolean" }, "lastRunFailed": { "description": "Additive in contract revision 36. Present, and true, only when the chat's newest assistant output is a failed turn (a provider failure or a failed generation timeline; a Stop is not a failure). Clients show Failed in place of the unread dot while unread is true. Older servers omit it.", "type": "boolean", "enum": [ true ] }, "forkedFrom": { "description": "Additive in contract revision 21: lineage for the sidebar fork glyph. Rows never carry the summary.", "allOf": [ { "$ref": "#/components/schemas/ChatForkLineageRow" } ] }, "attentionSince": { "description": "Additive in contract revision 52 (inbox-signals-v1). While a live run waits on an approval or question, when the oldest pending approval was raised, or else the oldest question. Absent otherwise.", "type": "string", "format": "date-time" }, "runStartedAt": { "description": "Additive in contract revision 52. While a run is live, when it started. Absent otherwise.", "type": "string", "format": "date-time" }, "lastAssistantMessageId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$", "description": "Message boundary for read actions on this Inbox row." }, "lastAssistantAt": { "description": "Additive in contract revision 52. When the chat's newest assistant output (or failed turn) was persisted. Absent before the first reply.", "type": "string", "format": "date-time" }, "pinnedAt": { "description": "Additive in contract revision 52. When the chat was pinned in the Inbox. Present only with triageRevision.", "type": "string", "format": "date-time" }, "doneAt": { "description": "Additive in contract revision 52. When the chat was marked done. Newer output brings it back. Present only with triageRevision.", "type": "string", "format": "date-time" }, "snoozedUntil": { "description": "Additive in contract revision 52. When the chat's snooze ends. Present only with triageRevision.", "type": "string", "format": "date-time" }, "triageRevision": { "description": "Additive in contract revision 52. The revision of the chat's triage entry (chat-triage-v1); absent when the chat has never been triaged. Clients send it as ifRevision and drop their own pending write once the host reports it.", "type": "integer", "minimum": 1 }, "inboxBucket": { "description": "Additive in contract revision 52 (inbox-signals-v1). The Inbox bucket the host's own placement rules give the row, computed from the state the host holds: needs_you (a pending approval or question, or unread output from a failed run), working, done (marked done with no newer output), snoozed, pinned, updates (unread), or earlier (read and idle, however old). The host can't know which chat a device has open, so the row counts as not open, and it applies no recent window. Clients recheck the time-based parts against their own clock: a snoozed row past its snoozedUntil is awake, and an earlier row older than the client's recent window ages out. Needs you rows order by tier from rowState (approval, question, then failed). Later hosts may send values outside this list; a client places those rows itself, as it does a bucket without an inboxSortAt. Present only with inboxSortAt.", "enum": [ "needs_you", "pinned", "updates", "earlier", "working", "snoozed", "done" ] }, "inboxSortAt": { "description": "Additive in contract revision 52. The time the row orders by within its inboxBucket: needs_you by attentionSince (else updatedAt), oldest first; pinned by pinnedAt and updates by lastAssistantAt (else updatedAt), newest first; earlier by updatedAt, newest first; working by runStartedAt (else updatedAt), oldest first. A done or snoozed row carries the time it orders by in the bucket it returns to. Present only with inboxBucket.", "type": "string", "format": "date-time" } }, "additionalProperties": true }, "ChatForkSummary": { "type": "object", "description": "Contract revision 21. What happened after the fork point in the source chat, summarized for the fork's model context. Messages sent while it is pending wait for it; a failed summary blocks sending until it is retried or skipped.", "required": [ "state", "afterMessageId" ], "properties": { "state": { "enum": [ "pending", "ready", "failed" ] }, "afterMessageId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9_-]+$", "description": "The fork's last copied message; the summary follows it." }, "focus": { "type": "string", "minLength": 1, "maxLength": 1000, "description": "The focus the summary was asked for." }, "text": { "type": "string", "minLength": 1, "maxLength": 32000 }, "error": { "type": "string", "minLength": 1, "maxLength": 1000, "description": "Why the summary failed, in Aiden's own words. Provider errors stay on the Mac." } }, "additionalProperties": false }, "ChatForkLineage": { "type": "object", "description": "Contract revision 21. The chat and message this chat was forked from. The source may since have been deleted.", "required": [ "chatId", "messageId", "position", "at" ], "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "messageId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "position": { "enum": [ "after", "before" ] }, "at": { "type": "string", "format": "date-time" }, "summary": { "$ref": "#/components/schemas/ChatForkSummary" } }, "additionalProperties": false }, "ChatForkLineageRow": { "type": "object", "description": "Contract revision 21. Fork lineage on a chat row, without the summary.", "required": [ "chatId", "messageId", "position", "at" ], "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "messageId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "position": { "enum": [ "after", "before" ] }, "at": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "ChatForkRequest": { "description": "A fork at one message, or (contract revision 64, chat:continue-in-new-chat) a continue of a chat whose workspace folder is gone into another workspace.", "oneOf": [ { "type": "object", "required": [ "messageId", "position" ], "properties": { "messageId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "position": { "enum": [ "after", "before" ] }, "summary": { "type": "object", "description": "Fork with summary (chat-fork-summary-v1).", "properties": { "focus": { "type": "string", "minLength": 1, "maxLength": 1000, "description": "Optional focus for the summary; surrounding whitespace is trimmed." } }, "additionalProperties": false } }, "additionalProperties": false }, { "$ref": "#/components/schemas/ChatContinueInNewChatRequest" } ] }, "ChatContinueInNewChatRequest": { "type": "object", "description": "Contract revision 64 (chat:continue-in-new-chat). Fork the whole conversation, through its newest reply, into the workspace named here. Send the id of a workspace from /workspaces, or of a hidden noWorkspace record for No workspace.", "required": [ "continueIn" ], "properties": { "continueIn": { "type": "object", "required": [ "workspaceId" ], "properties": { "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]{1,128}$" } }, "additionalProperties": false } }, "additionalProperties": false }, "ChatForkResult": { "type": "object", "required": [ "chat" ], "properties": { "chat": { "$ref": "#/components/schemas/Chat", "description": "The new fork; it always carries forkedFrom." }, "prefill": { "type": "object", "description": "Only for position before: the chosen prompt to edit and resend in the fork. Attachments that cannot be restaged are omitted.", "required": [ "text" ], "properties": { "text": { "type": "string", "maxLength": 200000 }, "attachments": { "type": "array", "maxItems": 10, "items": { "$ref": "#/components/schemas/AttachmentReference" } } }, "additionalProperties": false } }, "additionalProperties": false }, "ChatForkSummaryCancel": { "type": "object", "required": [ "cancelled" ], "properties": { "cancelled": { "type": "boolean", "description": "False when no summary was running." } }, "additionalProperties": false }, "ChatSummaryPage": { "type": "object", "x-aiden-max-json-response-bytes": 1048576, "required": [ "summaries" ], "properties": { "summaries": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/ChatSummary" } }, "nextCursor": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^cur_[A-Za-z0-9_-]{1,384}\\.[A-Za-z0-9_-]{43}$" } }, "additionalProperties": true }, "ChatTask": { "type": "object", "required": [ "id", "subject", "status" ], "properties": { "id": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "subject": { "type": "string", "minLength": 1, "maxLength": 512 }, "status": { "enum": [ "pending", "in_progress", "completed", "deleted" ] }, "activeForm": { "type": "string", "minLength": 1, "maxLength": 512 }, "blockedBy": { "type": "array", "maxItems": 256, "items": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "uniqueItems": true } }, "additionalProperties": false }, "ChatTaskProgress": { "type": "object", "description": "Bounded renderer-safe projection of the Mac-owned durable todo view for one chat. Never a transcript, private journal, or child-history channel. Task ids must be unique, at most one task may be in_progress, and blockedBy entries must reference distinct listed task ids whose dependency graph is acyclic.", "required": [ "version", "chatId", "availability", "epoch", "revision", "updatedAt", "tasks" ], "properties": { "version": { "const": 1 }, "chatId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "availability": { "enum": [ "ready", "unavailable" ] }, "unavailableReason": { "enum": [ "storage_not_enabled", "invalid_snapshot", "unsupported" ] }, "epoch": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9._:-]+$", "description": "Opaque projection-authority epoch. Clients reset revision comparisons whenever it changes." }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "updatedAt": { "type": "string", "format": "date-time" }, "tasks": { "type": "array", "maxItems": 256, "items": { "$ref": "#/components/schemas/ChatTask" } } }, "allOf": [ { "if": { "properties": { "availability": { "const": "ready" } }, "required": [ "availability" ] }, "then": { "not": { "required": [ "unavailableReason" ] } } }, { "if": { "properties": { "availability": { "const": "unavailable" } }, "required": [ "availability" ] }, "then": { "required": [ "unavailableReason" ], "properties": { "tasks": { "maxItems": 0 } } } } ], "additionalProperties": false }, "ChatAgent": { "type": "object", "description": "One delegated-agent record in the public roster. agentId is a projection-minted public identifier; private run/session/group/generation/child/workspace identifiers never cross this boundary. parentAgentId is required exactly when depth is at least 2, and finishedAt exactly for terminal states.", "required": [ "agentId", "depth", "revision", "role", "label", "taskPreview", "state", "startedAt", "updatedAt", "modelId", "turns", "tools", "tokens" ], "properties": { "agentId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "parentAgentId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "depth": { "type": "integer", "minimum": 1, "maximum": 8 }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "role": { "enum": [ "scout", "planner", "reviewer", "implementer" ] }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "taskPreview": { "type": "string", "minLength": 1, "maxLength": 240 }, "state": { "enum": [ "queued", "starting", "running", "needs_attention", "completed", "failed", "timed_out", "interrupted", "stopped", "unknown" ] }, "activity": { "type": "string", "minLength": 1, "maxLength": 160 }, "startedAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "finishedAt": { "type": "string", "format": "date-time" }, "modelId": { "type": "string", "minLength": 1, "maxLength": 160 }, "turns": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "tools": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "milestones": { "type": "array", "maxItems": 12, "items": { "enum": [ "reading", "listing", "matching", "searching", "inspecting", "composing" ] }, "uniqueItems": true }, "notices": { "type": "array", "maxItems": 3, "items": { "enum": [ "task_truncated", "report_truncated", "display_filtered" ] }, "uniqueItems": true }, "error": { "type": "string", "minLength": 1, "maxLength": 240 }, "warnings": { "type": "array", "maxItems": 5, "items": { "type": "string", "minLength": 1, "maxLength": 240 } } }, "allOf": [ { "if": { "properties": { "state": { "enum": [ "completed", "failed", "timed_out", "interrupted", "stopped", "unknown" ] } }, "required": [ "state" ] }, "then": { "required": [ "finishedAt" ] } }, { "if": { "properties": { "state": { "enum": [ "queued", "starting", "running", "needs_attention" ] } }, "required": [ "state" ] }, "then": { "not": { "anyOf": [ { "required": [ "finishedAt" ] }, { "required": [ "error" ] } ] }, "properties": { "warnings": { "type": "array", "maxItems": 0 }, "notices": { "type": "array", "not": { "contains": { "const": "report_truncated" } } } } } }, { "if": { "properties": { "depth": { "const": 1 } }, "required": [ "depth" ] }, "then": { "not": { "required": [ "parentAgentId" ] } } }, { "if": { "properties": { "depth": { "minimum": 2 } }, "required": [ "depth" ] }, "then": { "required": [ "parentAgentId" ] } } ], "additionalProperties": false }, "ChatAgentRoster": { "type": "object", "description": "Bounded projection of renderer-safe delegated-agent state for one chat's active or most recent turn. Agent ids must be unique, parentAgentId must reference an agent in the same roster, a non-empty roster requires turnId, and previousTurns is a newest-first bounded list of selectable historical public turns excluding turnId.", "required": [ "version", "chatId", "availability", "epoch", "revision", "updatedAt", "agents" ], "properties": { "version": { "const": 1 }, "chatId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "turnId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$", "description": "Public identity of the turn the roster is bound to. Required while agents are listed." }, "previousTurns": { "type": "array", "maxItems": 16, "description": "Optional newest-first list of historical public turns whose rosters can be requested with GET /chats/{chatId}/agents?turnId=...; entries are unique and exclude the current turnId.", "items": { "$ref": "#/components/schemas/ChatPreviousTurn" } }, "availability": { "enum": [ "ready", "unavailable" ] }, "unavailableReason": { "enum": [ "unsupported", "invalid_snapshot" ] }, "epoch": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9._:-]+$" }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "updatedAt": { "type": "string", "format": "date-time" }, "agents": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/ChatAgent" } } }, "allOf": [ { "if": { "properties": { "availability": { "const": "ready" } }, "required": [ "availability" ] }, "then": { "not": { "required": [ "unavailableReason" ] } } }, { "if": { "properties": { "availability": { "const": "unavailable" } }, "required": [ "availability" ] }, "then": { "required": [ "unavailableReason" ], "properties": { "agents": { "maxItems": 0 } } } }, { "if": { "properties": { "agents": { "minItems": 1 } }, "required": [ "agents" ] }, "then": { "required": [ "turnId" ] } } ], "additionalProperties": false }, "ChatPreviousTurn": { "type": "object", "description": "Opaque public turn selector for a historical roster. It contains no transcript or private generation identity.", "required": [ "turnId", "startedAt" ], "properties": { "turnId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "startedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "TurnStartRequest": { "type": "object", "required": [ "text" ], "anyOf": [ { "properties": { "text": { "minLength": 1 } } }, { "required": [ "attachmentIds" ], "properties": { "attachmentIds": { "minItems": 1 } } } ], "properties": { "text": { "type": "string", "maxLength": 200000 }, "providerId": { "type": "string" }, "modelId": { "type": "string" }, "thinkingLevel": { "type": "string" }, "saveSelection": { "type": "boolean", "description": "Contract revision 70, for a device holding chat:agent-slider: true asks the host to keep this turn's selection as the chat's own, in the same write as the message. The level is saved only when the device holds chat:agent-slider, saveSelection is true, the turn names both providerId and modelId, the chat is not a Bot chat, and the host has a readable Agent Slider; otherwise the level applies to this turn only and the chat's saved level is untouched. For a chat:agent-slider device the host fits thinkingLevel to the model's levels instead of refusing it, runs that level and saves it; a model without levels runs with none and saves none, as does a saved turn that names no level. Other devices keep the strict check (a level the model does not offer is a 400) and never save." }, "attachmentIds": { "type": "array", "minItems": 1, "maxItems": 10, "uniqueItems": true, "items": { "type": "string", "pattern": "^att_[A-Za-z0-9_-]{43}$" } }, "skill": { "$ref": "#/components/schemas/SkillInvocation", "description": "Optional explicit skill invocation lease from GET /chats/{chatId}/skills. The Mac resolves, expands, and binds it to the appended user message exactly like a desktop slash selection; requires the negotiated skills:invoke grant." } }, "additionalProperties": false }, "SkillInvocation": { "type": "object", "required": [ "version", "invocationId", "displayName", "source" ], "properties": { "version": { "const": 1 }, "invocationId": { "type": "string", "maxLength": 64 }, "displayName": { "type": "string", "maxLength": 80 }, "source": { "enum": [ "builtin", "configured", "workspace", "global" ] } }, "additionalProperties": false }, "ChatSkillCatalogEntry": { "type": "object", "required": [ "invocationId", "name", "description", "source", "available" ], "properties": { "invocationId": { "type": "string", "maxLength": 64 }, "name": { "type": "string", "maxLength": 80 }, "description": { "type": "string", "maxLength": 240 }, "source": { "enum": [ "builtin", "configured", "workspace", "global" ] }, "available": { "type": "boolean" }, "unavailableReason": { "type": "string", "maxLength": 160 } }, "additionalProperties": false }, "ChatContextPressure": { "type": "object", "required": [ "chatId", "pressure" ], "properties": { "chatId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,128}$" }, "pressure": { "oneOf": [ { "$ref": "#/components/schemas/ContextPressure" }, { "type": "null" } ] } }, "additionalProperties": false }, "ContextPressure": { "type": "object", "description": "Contract revision 41. Every field the host's projection sends; the host's breakdown and prompt cache never cross the wire.", "required": [ "contextTokens", "contextWindow", "inputBudgetTokens", "reservedTokens", "percentOfWindow", "percentOfUsableInput", "shouldCompact", "messageTokens", "staticTokens", "source", "computedAt" ], "properties": { "contextTokens": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "Projected total tokens for the next request." }, "contextWindow": { "type": "number", "minimum": 1, "maximum": 9007199254740991, "description": "The pricing model's context window." }, "inputBudgetTokens": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "Usable input budget after response and safety reserves." }, "reservedTokens": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "Tokens reserved for output and safety margin." }, "percentOfWindow": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "contextTokens / contextWindow, in percent." }, "percentOfUsableInput": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "contextTokens / inputBudgetTokens, in percent." }, "shouldCompact": { "type": "boolean", "description": "The host compacts before the next request." }, "messageTokens": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "Estimated tokens for the conversation." }, "staticTokens": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "Estimated tokens for the system prompt and tool schemas." }, "source": { "type": "string", "enum": [ "provider-anchored", "estimated" ] }, "computedAt": { "type": "number", "minimum": 0, "maximum": 9007199254740991, "description": "Epoch milliseconds when the host computed this projection." } }, "additionalProperties": false }, "ChatSkillCatalog": { "type": "object", "required": [ "skills" ], "properties": { "skills": { "type": "array", "maxItems": 500, "items": { "$ref": "#/components/schemas/ChatSkillCatalogEntry" } } }, "additionalProperties": false }, "TurnStartResponse": { "type": "object", "required": [ "turnId", "streamId", "status", "message" ], "properties": { "turnId": { "type": "string" }, "streamId": { "type": "string" }, "status": { "const": "accepted" }, "message": { "$ref": "#/components/schemas/Message" } }, "additionalProperties": false }, "ToolApprovalScope": { "type": "string", "enum": [ "once", "chat", "always" ] }, "ApprovalSchedule": { "type": "object", "description": "Contract revision 39. Display-only facts for a scheduled-task approval card, sent only to devices holding both schedule:cards and schedule:read. The host builds it from the validated scheduled-task details; it never changes canAllow and is never part of details. Text is trimmed and carries no control or bidirectional-override characters; prompt and script may contain line breaks. A client that cannot validate it drops it and shows the summary card.", "required": [ "action", "name", "cadence", "timezone", "mode", "permission", "connectors", "notify", "enabled", "schedulerEnabled" ], "properties": { "action": { "enum": [ "create", "update", "pause", "resume", "remove", "run_now" ] }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "cadence": { "type": "string", "minLength": 1, "maxLength": 200, "description": "Human cadence such as Weekdays at 9:00 AM, with the zone when it differs from the host's. Never cron syntax." }, "timezone": { "type": "string", "minLength": 1, "maxLength": 128, "description": "IANA time zone the cadence is evaluated in." }, "nextRunAt": { "type": "string", "format": "date-time", "maxLength": 40, "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$", "description": "UTC next run. Present only while the task will run on its own: enabled, scheduling on, and not being removed." }, "mode": { "enum": [ "llm", "script" ] }, "permission": { "enum": [ "read-only", "full" ] }, "workspaceName": { "type": "string", "minLength": 1, "maxLength": 120, "description": "Project the task runs in, when it has one." }, "connectors": { "type": "array", "maxItems": 16, "description": "Connector (MCP server) display names the task may use.", "items": { "type": "string", "minLength": 1, "maxLength": 120 } }, "providerName": { "type": "string", "minLength": 1, "maxLength": 120, "description": "llm mode only." }, "modelName": { "type": "string", "minLength": 1, "maxLength": 256, "description": "llm mode only." }, "notify": { "type": "boolean" }, "enabled": { "type": "boolean", "description": "False when the task is saved paused." }, "schedulerEnabled": { "type": "boolean", "description": "False when scheduling is off on the host, so the task will not run automatically." }, "prompt": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "llm mode instructions, at most 2,000 characters." }, "script": { "type": "string", "minLength": 1, "maxLength": 2000, "description": "script mode command, at most 2,000 characters." }, "truncated": { "const": true, "description": "The prompt or script was shortened to fit. Present only with prompt or script." } }, "allOf": [ { "if": { "properties": { "mode": { "const": "llm" } }, "required": [ "mode" ] }, "then": { "not": { "required": [ "script" ] } } }, { "if": { "properties": { "mode": { "const": "script" } }, "required": [ "mode" ] }, "then": { "allOf": [ { "not": { "required": [ "prompt" ] } }, { "not": { "required": [ "providerName" ] } }, { "not": { "required": [ "modelName" ] } } ] } }, { "if": { "required": [ "truncated" ] }, "then": { "anyOf": [ { "required": [ "prompt" ] }, { "required": [ "script" ] } ] } } ], "additionalProperties": false }, "PendingApproval": { "type": "object", "required": [ "approvalId", "streamId", "chatId", "summary", "toolCallId", "toolName", "expiresAt", "canAllow" ], "properties": { "approvalId": { "type": "string" }, "streamId": { "type": "string" }, "chatId": { "type": "string" }, "summary": { "type": "string" }, "toolCallId": { "type": "string" }, "toolName": { "type": "string" }, "expiresAt": { "type": "string", "format": "date-time" }, "canAllow": { "type": "boolean", "description": "False when exact privileged details are intentionally host-only or the device lacks a capability required to allow this mutation; mobile clients must offer Deny only." }, "scopes": { "type": "array", "description": "Contract revision 17. Allow scopes this approval offers, always starting with once. Omitted when only a one-time allow is possible or canAllow is false; older clients that ignore it keep allowing once.", "minItems": 2, "items": { "$ref": "#/components/schemas/ToolApprovalScope" } }, "schedule": { "$ref": "#/components/schemas/ApprovalSchedule" } }, "additionalProperties": false }, "StreamApprovalSnapshot": { "type": "object", "required": [ "approval" ], "properties": { "approval": { "oneOf": [ { "$ref": "#/components/schemas/PendingApproval" }, { "type": "null" } ] } }, "additionalProperties": false }, "StreamStatus": { "type": "object", "required": [ "streamId", "chatId", "turnId", "state", "lastSequence", "updatedAt" ], "properties": { "streamId": { "type": "string" }, "chatId": { "type": "string" }, "turnId": { "type": "string" }, "state": { "enum": [ "queued", "running", "waiting_for_approval", "reconciling", "done", "error", "cancelled", "interrupted" ] }, "lastSequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "StreamInputRequest": { "type": "object", "required": [ "mode", "text" ], "properties": { "mode": { "enum": [ "steer", "queue" ], "description": "steer injects guidance into the active turn; queue follows up after the current turn." }, "text": { "type": "string", "minLength": 1, "maxLength": 200000 } }, "additionalProperties": false }, "StreamInputResult": { "type": "object", "required": [ "streamId", "chatId", "turnId", "mode", "status", "committed" ], "properties": { "streamId": { "type": "string" }, "chatId": { "type": "string" }, "turnId": { "type": "string" }, "mode": { "enum": [ "steer", "queue" ] }, "status": { "enum": [ "admitted", "rejected" ] }, "queue": { "enum": [ "steer", "follow-up" ], "description": "Runtime queue that accepted the input; present only when status=admitted." }, "reason": { "enum": [ "run_not_active", "cancelled", "capacity", "invalid" ], "description": "Rejection reason; present only when status=rejected." }, "committed": { "type": "boolean", "description": "True once the user message is durable in the chat transcript; a rejected-but-committed input must not be resent." }, "messageId": { "type": "string", "description": "Transcript identity of the committed user message." } }, "additionalProperties": false }, "StreamEvent": { "type": "object", "description": "An ordinary parent-turn event or, for task_update, agents_update and app_controls_changed, an event on the dedicated chat-scoped progress channel. Progress event streamId values are chat IDs; they never appear on ordinary parent turn streams.", "required": [ "protocolVersion", "streamId", "sequence", "timestamp", "type", "terminal", "payload" ], "properties": { "protocolVersion": { "const": 1 }, "streamId": { "type": "string", "minLength": 1, "maxLength": 128 }, "sequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "timestamp": { "type": "string", "format": "date-time" }, "type": { "type": "string", "minLength": 1, "maxLength": 80 }, "terminal": { "type": "boolean" }, "payload": { "type": "object", "maxProperties": 32 } }, "allOf": [ { "if": { "properties": { "type": { "const": "snapshot" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "chatId", "turnId", "nextSequence" ], "properties": { "chatId": { "type": "string", "maxLength": 128 }, "turnId": { "type": "string", "maxLength": 128 }, "reason": { "type": "string", "enum": [ "gap", "reset" ], "description": "Contract revision 65, sent only to devices holding stream:snapshot-reasons: gap for a reader-local retention gap or aggregate-budget replacement, reset for a provider projection reset." }, "nextSequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "status" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "state" ], "properties": { "state": { "enum": [ "queued", "running", "waiting_for_approval", "reconciling" ] } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "enum": [ "text_delta", "reasoning_delta" ] } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "maxLength": 200000 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "tool_started" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "toolId", "name" ], "properties": { "toolId": { "type": "string", "maxLength": 128 }, "name": { "type": "string", "maxLength": 120 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "tool_finished" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "toolId", "status" ], "properties": { "toolId": { "type": "string", "maxLength": 128 }, "status": { "enum": [ "succeeded", "failed", "cancelled" ] } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "timeline" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "timeline" ], "properties": { "timeline": { "$ref": "#/components/schemas/GenerationTimeline" } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "approval_required" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "approvalId", "summary", "expiresAt" ], "properties": { "approvalId": { "type": "string", "maxLength": 128 }, "summary": { "type": "string", "maxLength": 2000 }, "expiresAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "question_required" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "promptId", "questions", "expiresAt" ], "properties": { "promptId": { "type": "string", "maxLength": 128 }, "questions": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/components/schemas/PendingQuestionItem" } }, "expiresAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "done" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": true }, "payload": { "type": "object", "required": [ "messageId" ], "properties": { "messageId": { "type": "string", "maxLength": 128 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "error" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": true }, "payload": { "type": "object", "required": [ "code", "message" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "type": "string", "maxLength": 2000 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "cancelled" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": true }, "payload": { "type": "object", "required": [ "source" ], "properties": { "source": { "enum": [ "device", "server" ] } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "heartbeat" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "maxProperties": 0, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "task_update" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "$ref": "#/components/schemas/ChatTaskProgress" } } } }, { "if": { "properties": { "type": { "const": "agents_update" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "$ref": "#/components/schemas/ChatAgentRoster" } } } }, { "if": { "properties": { "type": { "const": "app_controls_changed" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "revision" ], "properties": { "revision": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "not": { "enum": [ "snapshot", "status", "text_delta", "reasoning_delta", "tool_started", "tool_finished", "timeline", "approval_required", "task_update", "agents_update", "app_controls_changed", "done", "error", "cancelled", "heartbeat" ] } } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false } } } } ], "additionalProperties": true }, "ProviderArtwork": { "type": "object", "required": [ "mimeType", "dataBase64" ], "properties": { "mimeType": { "const": "image/png" }, "dataBase64": { "type": "string", "maxLength": 43696, "pattern": "^iVBORw0KGgo[A-Za-z0-9+/]*={0,2}$" } }, "additionalProperties": false }, "Provider": { "type": "object", "required": [ "id", "label", "models" ], "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "artwork": { "$ref": "#/components/schemas/ProviderArtwork" }, "models": { "type": "array", "items": { "type": "object", "required": [ "id", "label", "supportsImages" ], "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "supportsImages": { "type": "boolean", "description": "Whether this configured model accepts image input." }, "thinkingLevels": { "type": "array", "maxItems": 8, "items": { "enum": [ "off", "minimal", "low", "medium", "high", "xhigh", "max" ] } }, "defaultThinkingLevel": { "enum": [ "off", "minimal", "low", "medium", "high", "xhigh", "max" ] }, "thinkingCanDisable": { "type": "boolean" }, "hidden": { "type": "boolean" } }, "additionalProperties": false } } }, "additionalProperties": false }, "FileEntry": { "type": "object", "required": [ "id", "displayPath", "name", "kind" ], "properties": { "id": { "type": "string", "pattern": "^file_[A-Za-z0-9_-]{43}$" }, "displayPath": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$", "maxLength": 4096 }, "name": { "type": "string", "maxLength": 255 }, "kind": { "enum": [ "file", "directory", "symlink" ] }, "size": { "type": "integer", "minimum": 0, "maximum": 5242880 }, "language": { "type": "string", "maxLength": 80 } }, "additionalProperties": false }, "FileIndex": { "type": "object", "required": [ "snapshotId", "entries", "truncated", "maxEntries", "maxDepth" ], "properties": { "directoryPath": { "type": "string", "maxLength": 4096, "description": "Workspace-relative directory, empty for root. Present only for tree pages." }, "nextCursor": { "type": "string", "pattern": "^cur_[A-Za-z0-9_-]{43}$" }, "snapshotId": { "type": "string" }, "entries": { "type": "array", "maxItems": 4000, "items": { "$ref": "#/components/schemas/FileEntry" } }, "truncated": { "type": "boolean" }, "maxEntries": { "const": 4000 }, "maxDepth": { "const": 20 } }, "additionalProperties": false }, "FileDocument": { "type": "object", "required": [ "id", "displayPath", "content", "version", "truncated" ], "properties": { "id": { "type": "string", "pattern": "^file_[A-Za-z0-9_-]{43}$" }, "displayPath": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$", "maxLength": 4096 }, "content": { "type": "string", "maxLength": 5242880 }, "version": { "type": "string", "maxLength": 128 }, "truncated": { "type": "boolean" }, "warning": { "type": "string", "maxLength": 500 } }, "additionalProperties": false }, "GitDiffRequest": { "type": "object", "required": [ "snapshotId", "fileId" ], "properties": { "snapshotId": { "type": "string" }, "fileId": { "type": "string" } }, "additionalProperties": false }, "GitCreateBranchRequest": { "type": "object", "required": [ "name", "startPoint", "confirmedForeground" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "startPoint": { "type": "string", "minLength": 1, "maxLength": 500 }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "GitCheckoutRequest": { "type": "object", "required": [ "branch", "snapshotId", "confirmedForeground" ], "properties": { "branch": { "type": "string", "minLength": 1, "maxLength": 500 }, "snapshotId": { "type": "string" }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "GitCommitRequest": { "type": "object", "required": [ "snapshotId", "message", "scope", "confirmedForeground" ], "properties": { "snapshotId": { "type": "string" }, "message": { "type": "string", "minLength": 1, "maxLength": 20000 }, "scope": { "enum": [ "all-reviewed", "staged-reviewed" ] }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "GitPushRequest": { "type": "object", "required": [ "snapshotId", "remote", "branch", "confirmedForeground" ], "properties": { "snapshotId": { "type": "string", "maxLength": 128 }, "remote": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,200}$" }, "branch": { "type": "string", "minLength": 1, "maxLength": 500 }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "GitCompareRequest": { "type": "object", "required": [ "baseRef" ], "properties": { "baseRef": { "type": "string", "minLength": 1, "maxLength": 500 } }, "additionalProperties": false }, "GitComparisonDiffRequest": { "type": "object", "required": [ "comparisonId", "fileId" ], "properties": { "comparisonId": { "type": "string" }, "fileId": { "type": "string" } }, "additionalProperties": false }, "GitCreateWorktreeRequest": { "type": "object", "required": [ "branch", "name", "confirmedForeground" ], "properties": { "branch": { "type": "string", "minLength": 1, "maxLength": 500 }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "GitFileProjection": { "type": "object", "required": [ "id", "displayPath", "status" ], "properties": { "id": { "type": "string", "pattern": "^file_[A-Za-z0-9_-]{43}$" }, "displayPath": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$", "maxLength": 4096 }, "status": { "enum": [ "added", "modified", "deleted", "renamed", "untracked", "conflicted" ] }, "staged": { "type": "boolean" }, "additions": { "type": "integer", "minimum": 0 }, "deletions": { "type": "integer", "minimum": 0 } }, "additionalProperties": false }, "GitProjection": { "oneOf": [ { "type": "object", "required": [ "kind", "branch", "uncommitted", "files" ], "properties": { "kind": { "const": "review" }, "branch": { "type": "string" }, "uncommitted": { "type": "integer", "minimum": 0 }, "files": { "type": "array", "maxItems": 4000, "items": { "$ref": "#/components/schemas/GitFileProjection" } } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "displayPath", "diff", "truncated" ], "properties": { "kind": { "const": "diff" }, "displayPath": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$", "maxLength": 4096 }, "diff": { "type": "string", "maxLength": 2000000 }, "truncated": { "type": "boolean" } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "current", "branches" ], "properties": { "kind": { "const": "branches" }, "current": { "type": "string" }, "branches": { "type": "array", "items": { "type": "string" } }, "unborn": { "const": true, "description": "Present when the repository has no commits yet; the current branch is listed although it has none." } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "comparisonId", "base", "head", "files" ], "properties": { "kind": { "const": "comparison" }, "comparisonId": { "type": "string" }, "base": { "type": "string" }, "head": { "type": "string" }, "files": { "type": "array", "maxItems": 4000, "items": { "$ref": "#/components/schemas/GitFileProjection" } } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "allowed" ], "properties": { "kind": { "const": "push-capability" }, "allowed": { "type": "boolean" }, "reason": { "type": "string", "maxLength": 500 }, "remote": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,200}$" }, "branch": { "type": "string", "maxLength": 500 } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "worktrees" ], "properties": { "kind": { "const": "worktrees" }, "worktrees": { "type": "array", "items": { "type": "object", "required": [ "id", "name", "branch", "managed" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "branch": { "type": "string" }, "managed": { "type": "boolean" } }, "additionalProperties": false } } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "message" ], "properties": { "kind": { "const": "mutation" }, "message": { "type": "string" }, "branch": { "type": "string" }, "commitId": { "type": "string" }, "workspaceId": { "type": "string" }, "warning": { "type": "string" } }, "additionalProperties": false } ] }, "GitResult": { "type": "object", "required": [ "operationId", "status" ], "properties": { "operationId": { "type": "string" }, "status": { "enum": [ "snapshot", "accepted", "running", "succeeded", "failed", "conflict" ] }, "snapshotId": { "type": "string" }, "capability": { "type": "object", "properties": { "allowed": { "type": "boolean" }, "reason": { "type": "string" } }, "required": [ "allowed" ], "additionalProperties": false }, "result": { "$ref": "#/components/schemas/GitProjection" } }, "additionalProperties": false }, "ScheduledTask": { "type": "object", "required": [ "id", "revision", "name", "enabled", "schedule", "timezone", "mode", "permission", "notify", "running", "createdAt", "updatedAt" ], "properties": { "id": { "type": "string" }, "revision": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean" }, "schedule": { "type": "string" }, "timezone": { "type": "string" }, "mode": { "enum": [ "llm", "script" ] }, "permission": { "enum": [ "full", "read-only" ] }, "workspaceId": { "type": "string" }, "providerId": { "type": "string" }, "modelId": { "type": "string" }, "mcpServerIds": { "type": "array", "items": { "type": "string" } }, "scriptId": { "type": "string" }, "prompt": { "type": "string", "maxLength": 32768 }, "notify": { "type": "boolean" }, "running": { "type": "boolean" }, "nextRunAt": { "type": "string", "format": "date-time" }, "lastRunAt": { "type": "string", "format": "date-time" }, "lastResult": { "enum": [ "success", "error", "silent", "blocked" ] }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "ScheduledTaskMutation": { "type": "object", "required": [ "name", "schedule", "timezone", "mode", "permission", "confirmedForeground" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "schedule": { "type": "string" }, "timezone": { "type": "string" }, "mode": { "enum": [ "llm", "script" ] }, "permission": { "enum": [ "full", "read-only" ] }, "workspaceId": { "type": "string" }, "providerId": { "type": "string" }, "modelId": { "type": "string" }, "mcpServerIds": { "type": "array", "items": { "type": "string" } }, "scriptId": { "type": "string" }, "prompt": { "type": "string" }, "notify": { "type": "boolean" }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "ScheduleRunAccepted": { "type": "object", "required": [ "taskId", "runId", "status", "acceptedAt" ], "properties": { "taskId": { "type": "string" }, "runId": { "type": "string" }, "status": { "enum": [ "accepted", "running" ] }, "acceptedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "ScheduleRun": { "type": "object", "required": [ "id", "taskId", "status", "startedAt" ], "properties": { "id": { "type": "string" }, "taskId": { "type": "string" }, "status": { "enum": [ "accepted", "running", "succeeded", "failed", "cancelled" ] }, "startedAt": { "type": "string", "format": "date-time" }, "finishedAt": { "type": "string", "format": "date-time" }, "summary": { "type": "string", "maxLength": 20000 }, "errorCode": { "type": "string" } }, "additionalProperties": false }, "ScheduleRunNotification": { "type": "object", "required": [ "id", "taskId", "taskName", "status", "startedAt", "finishedAt", "notify" ], "properties": { "id": { "type": "string" }, "taskId": { "type": "string" }, "taskName": { "type": "string", "maxLength": 120 }, "status": { "enum": [ "succeeded", "failed" ] }, "startedAt": { "type": "string", "format": "date-time" }, "finishedAt": { "type": "string", "format": "date-time" }, "summary": { "type": "string", "maxLength": 20000 }, "errorCode": { "type": "string" }, "notify": { "type": "boolean" } }, "additionalProperties": false }, "ScheduleSettings": { "type": "object", "required": [ "revision", "enabled", "defaultMode", "defaultPermission", "defaultMcpEnabled", "defaultNotify", "defaultTimezone" ], "properties": { "revision": { "type": "string" }, "enabled": { "type": "boolean" }, "defaultMode": { "enum": [ "llm", "script" ] }, "defaultPermission": { "enum": [ "full", "read-only" ] }, "defaultMcpEnabled": { "type": "boolean" }, "defaultNotify": { "type": "boolean" }, "defaultTimezone": { "type": "string" } }, "additionalProperties": false }, "SpendingStatus": { "type": "object", "additionalProperties": false, "required": [ "spending" ], "description": "Contract revision 47 (spending-limits-v1).", "properties": { "spending": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/Spending" } ] } } }, "Spending": { "type": "object", "additionalProperties": false, "required": [ "period", "state", "limitUsd", "allowedUsd", "spentUsd", "allowMoreUsd", "revision" ], "properties": { "period": { "type": "string", "enum": [ "chat", "month" ], "description": "chat: the whole chat, its helpers included. month: the Bot's current month, its routines included." }, "state": { "type": "string", "enum": [ "under", "nearing", "reached" ] }, "limitUsd": { "type": "number", "exclusiveMinimum": 0, "maximum": 100000 }, "allowedUsd": { "type": "number", "exclusiveMinimum": 0, "description": "The limit plus what Allow more added." }, "spentUsd": { "type": "number", "minimum": 0 }, "allowMoreUsd": { "type": "number", "exclusiveMinimum": 0, "description": "What one Allow more adds: the limit again." }, "periodStart": { "type": "string", "format": "date-time" }, "periodEnd": { "type": "string", "format": "date-time", "description": "When the Bot's month starts over." }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 } } }, "BackgroundJobs": { "type": "object", "additionalProperties": false, "required": [ "jobs" ], "description": "Contract revision 49 (chat:jobs).", "properties": { "jobs": { "type": "array", "maxItems": 40, "items": { "$ref": "#/components/schemas/BackgroundJob" } } } }, "BackgroundJob": { "type": "object", "additionalProperties": false, "required": [ "id", "label", "state", "startedAt", "ports" ], "properties": { "id": { "type": "string", "pattern": "^job_[0-9a-f]{8}$" }, "label": { "type": "string", "minLength": 1, "maxLength": 200, "description": "The agent's short label, else the command." }, "state": { "type": "string", "enum": [ "running", "exited", "failed", "stopped" ] }, "startedAt": { "type": "string", "format": "date-time" }, "endedAt": { "type": "string", "format": "date-time", "description": "Present exactly when the job is not running." }, "exitCode": { "type": "integer", "description": "Only for exited or failed jobs whose exit code is known." }, "endReason": { "type": "string", "enum": [ "agent", "person", "output-limit", "chat-deleted", "access-changed", "app-quit", "chat-settled" ], "description": "Present exactly when the job is stopped. `chat-settled` (revision 63): the agent asked for the job to stop once the chat went quiet, and it did. Clients show an unknown reason as plain Stopped." }, "fromCommand": { "type": "boolean", "const": true, "description": "A run_command call left these processes running; they have no exit code." }, "ports": { "type": "array", "maxItems": 5, "items": { "type": "integer", "minimum": 1, "maximum": 65535 }, "description": "TCP ports it listens on, on the Mac; empty unless it runs." } } }, "MemorySettings": { "type": "object", "required": [ "enabled", "revision" ], "properties": { "enabled": { "type": "boolean" }, "revision": { "type": "string" } }, "additionalProperties": false }, "MemorySettingsMutation": { "type": "object", "required": [ "enabled", "confirmedForeground" ], "properties": { "enabled": { "type": "boolean" }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "ScheduleSettingsMutation": { "type": "object", "required": [ "confirmedForeground" ], "minProperties": 2, "properties": { "enabled": { "type": "boolean" }, "defaultMode": { "enum": [ "llm", "script" ] }, "defaultPermission": { "enum": [ "full", "read-only" ] }, "defaultMcpEnabled": { "type": "boolean" }, "defaultNotify": { "type": "boolean" }, "defaultTimezone": { "type": "string", "maxLength": 120 }, "confirmedForeground": { "const": true } }, "additionalProperties": false }, "ErrorCode": { "enum": [ "invalid_request", "payload_too_large", "rate_limited", "authentication_required", "credential_revoked", "capability_denied", "pairing_closed", "pairing_expired", "pairing_already_used", "server_identity_changed", "not_found", "already_exists", "revision_conflict", "idempotency_conflict", "idempotency_capacity", "idempotency_in_flight", "bot_archived", "workspace_unavailable", "workspace_changing", "permission_confirmation_required", "handle_invalid", "handle_expired", "handle_wrong_device", "root_policy_changed", "filesystem_identity_changed", "path_outside_root", "handle_capacity", "turn_already_active", "stream_gone", "run_gone", "approval_already_resolved", "approval_resolved", "approval_expired", "question_already_resolved", "question_expired", "skill_unavailable", "operation_in_progress", "operation_stale", "git_capability_denied", "schedule_disabled", "schedule_run_in_progress", "server_interrupted", "internal_error", "memory_entry_not_found", "memory_over_budget", "memory_blocked", "routine_proposal_not_found", "bot_paused", "handoff_expired", "access_request_expired", "plan_expired" ] }, "ErrorDetails": { "type": "object", "properties": { "currentRevision": { "type": "string", "maxLength": 128 }, "retryAfterSeconds": { "type": "integer", "minimum": 0, "maximum": 86400 }, "chatId": { "type": "string", "maxLength": 128 }, "minimumClientVersion": { "type": "string", "maxLength": 40 }, "limit": { "type": "integer", "minimum": 0, "maximum": 1000000 }, "field": { "type": "string", "maxLength": 120 }, "decision": { "enum": [ "allow", "deny", "expired", "cancelled" ], "description": "Contract revision 19. The winning decision on approval_resolved from run control." }, "outcome": { "enum": [ "answered", "expired", "cancelled" ], "description": "Contract revision 19. The winning outcome on a run-control question_already_resolved." }, "resolvedAt": { "type": "string", "format": "date-time", "description": "Contract revision 19. When the winning resolution committed." }, "reason": { "enum": [ "folder_missing", "worktree_missing" ], "description": "Contract revision 64, only to a device holding chat:continue-in-new-chat. On a turn's 409 workspace_unavailable: the chat's workspace folder (folder_missing) or its managed worktree's folder (worktree_missing) is gone. Never a path." }, "canContinueInNewChat": { "type": "boolean", "description": "Contract revision 64, with reason. Whether POST /chats/{chatId}/fork with continueIn can continue this chat (it has an assistant reply to fork after)." } }, "additionalProperties": false }, "ErrorEnvelope": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object", "required": [ "code", "message", "requestId", "retryable" ], "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "type": "string", "maxLength": 2000 }, "requestId": { "type": "string", "maxLength": 128 }, "retryable": { "type": "boolean" }, "details": { "$ref": "#/components/schemas/ErrorDetails" } }, "additionalProperties": false } }, "additionalProperties": false }, "PendingQuestionOption": { "type": "object", "required": [ "label", "description" ], "properties": { "label": { "type": "string", "maxLength": 60 }, "description": { "type": "string", "maxLength": 2000 } }, "additionalProperties": false }, "PendingQuestionItem": { "type": "object", "required": [ "question", "header", "multiSelect", "options" ], "properties": { "question": { "type": "string", "maxLength": 1000 }, "header": { "type": "string", "maxLength": 16 }, "multiSelect": { "type": "boolean" }, "options": { "type": "array", "minItems": 2, "maxItems": 4, "items": { "$ref": "#/components/schemas/PendingQuestionOption" } } }, "additionalProperties": false }, "PendingQuestion": { "type": "object", "required": [ "promptId", "streamId", "chatId", "toolCallId", "questions", "expiresAt" ], "properties": { "promptId": { "type": "string" }, "streamId": { "type": "string" }, "chatId": { "type": "string" }, "toolCallId": { "type": "string" }, "questions": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/components/schemas/PendingQuestionItem" } }, "expiresAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "StreamQuestionSnapshot": { "type": "object", "required": [ "question" ], "properties": { "question": { "oneOf": [ { "$ref": "#/components/schemas/PendingQuestion" }, { "type": "null" } ] } }, "additionalProperties": false }, "QuestionAnswer": { "type": "object", "required": [ "questionIndex", "kind" ], "properties": { "questionIndex": { "type": "integer", "minimum": 0, "maximum": 3 }, "kind": { "enum": [ "option", "custom", "multi" ] }, "answer": { "type": "string", "maxLength": 4000, "description": "Required for option and custom kinds; option answers must equal one offered option label." }, "selected": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "type": "string", "maxLength": 60 }, "description": "Required for the multi kind; every entry must equal an offered option label." } }, "additionalProperties": false }, "QuestionRespondRequest": { "type": "object", "required": [ "cancelled", "answers" ], "properties": { "cancelled": { "type": "boolean", "description": "True when the user dismissed the prompt without answering." }, "answers": { "type": "array", "maxItems": 4, "items": { "$ref": "#/components/schemas/QuestionAnswer" } } }, "additionalProperties": false }, "QuestionRespondResponse": { "type": "object", "required": [ "promptId", "resolvedAt" ], "properties": { "promptId": { "type": "string" }, "resolvedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "ReadAloudSource": { "type": "object", "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "messageId": { "type": "string", "minLength": 1, "maxLength": 200 }, "sourceRevision": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "chatId", "messageId", "sourceRevision" ], "additionalProperties": false }, "ReadAloudStart": { "type": "object", "properties": { "requestId": { "type": "string", "minLength": 1, "maxLength": 128 }, "source": { "$ref": "#/components/schemas/ReadAloudSource" }, "settingsRevision": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "requestId", "source", "settingsRevision" ], "additionalProperties": false }, "ReadAloudJob": { "type": "object", "properties": { "jobId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "chatId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, { "type": "null" } ] }, "kind": { "type": "string", "enum": [ "read-aloud", "preview" ] }, "phase": { "type": "string", "enum": [ "preparing", "generating", "buffering", "paused", "completed", "cancelled", "failed" ] }, "totalSegments": { "type": "integer", "minimum": 1, "maximum": 256 }, "readySegments": { "type": "integer", "minimum": 0, "maximum": 256 }, "omissions": { "type": "array", "items": { "type": "string" } }, "error": { "anyOf": [ { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "retryable": { "type": "boolean" }, "generationMayHaveBeenBilled": { "type": "boolean" } }, "required": [ "code", "message", "retryable", "generationMayHaveBeenBilled" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "jobId", "chatId", "kind", "phase", "totalSegments", "readySegments", "omissions", "error" ], "additionalProperties": false }, "ReadAloudStatus": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "ready": { "type": "boolean" }, "settingsRevision": { "type": "string" }, "source": { "anyOf": [ { "$ref": "#/components/schemas/ReadAloudSource" }, { "type": "null" } ] }, "job": { "anyOf": [ { "$ref": "#/components/schemas/ReadAloudJob" }, { "type": "null" } ] } }, "required": [ "enabled", "ready", "settingsRevision", "source", "job" ], "additionalProperties": false }, "ReadAloudStop": { "type": "object", "properties": { "requestId": { "type": "string", "minLength": 1, "maxLength": 128 } }, "required": [ "requestId" ], "additionalProperties": false }, "ReadAloudStopped": { "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }, "ReadAloudAudio": { "type": "object", "properties": { "bytesBase64": { "type": "string", "maxLength": 87384, "contentEncoding": "base64" }, "mimeType": { "type": "string", "const": "audio/wav" }, "sampleRate": { "type": "integer", "const": 24000 }, "channels": { "type": "integer", "const": 1 }, "segmentBytes": { "type": "integer", "minimum": 1, "maximum": 8388608 }, "nextOffset": { "type": "integer", "minimum": 0, "maximum": 8388608 }, "complete": { "type": "boolean" } }, "required": [ "bytesBase64", "mimeType", "sampleRate", "channels", "segmentBytes", "nextOffset", "complete" ], "additionalProperties": false }, "PairingRequestCreate": { "type": "object", "description": "Contract revision 20 (pairing-requests-v1). deviceName is the requester's unauthenticated claim and is shown to the host user as such.", "required": [ "deviceName", "deviceType", "publicKey" ], "properties": { "deviceName": { "type": "string", "minLength": 1, "maxLength": 80, "description": "Trimmed; control and bidirectional-override characters are rejected." }, "deviceType": { "enum": [ "mac", "linux" ] }, "publicKey": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "description": "Requester's X25519 public key, 32 raw bytes as unpadded base64url." }, "clientVersion": { "type": "string", "minLength": 1, "maxLength": 40 } }, "additionalProperties": false }, "PairingRequestCreated": { "type": "object", "required": [ "requestId", "pollSecret", "expiresAt", "hostCommitment" ], "properties": { "requestId": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" }, "pollSecret": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "description": "Sent back only in the Aiden-Pairing-Secret header, never in a URL." }, "expiresAt": { "type": "string", "format": "date-time" }, "hostCommitment": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "description": "SHA-256(\"aiden-pairing-commit-v1\" || 0x00 || requestId || hostNonce)." } }, "additionalProperties": false }, "PairingRequestReveal": { "type": "object", "required": [ "requesterNonce" ], "properties": { "requesterNonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "description": "32 random bytes chosen by the requester." } }, "additionalProperties": false }, "PairingRequestRevealed": { "type": "object", "required": [ "hostNonce" ], "properties": { "hostNonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$", "description": "Must match hostCommitment; the requester aborts otherwise." } }, "additionalProperties": false }, "PairingRequestStatus": { "type": "object", "required": [ "requestId", "state", "expiresAt" ], "properties": { "requestId": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" }, "state": { "enum": [ "pending", "approved", "denied", "expired", "cancelled" ] }, "expiresAt": { "type": "string", "format": "date-time" }, "envelope": { "$ref": "#/components/schemas/PairingRequestEnvelope" } }, "additionalProperties": false, "if": { "properties": { "state": { "const": "approved" } } }, "then": { "required": [ "envelope" ] }, "else": { "not": { "required": [ "envelope" ] } } }, "PairingRequestCancelled": { "type": "object", "required": [ "requestId", "state" ], "properties": { "requestId": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" }, "state": { "enum": [ "pending", "approved", "denied", "expired", "cancelled" ] } }, "additionalProperties": false }, "PairingRequestEnvelope": { "type": "object", "description": "The approved grant sealed to the requester's X25519 key with a fresh host ephemeral key. key = HKDF-SHA256(X25519(hostEphemeral, requesterPublicKey), salt, \"aiden-pairing-request-v1\\n\" + requestId + \"\\n\" + requesterPublicKey + \"\\n\" + hostPublicKey, 32); AES-256-GCM with AAD \"aiden-pairing-request-v1\\n\" + requestId + \"\\n\" + expiresAt. The plaintext is {kind: \"aiden-pairing-grant-v1\", requestId, trust, exchange} where trust is a PairingTrust and exchange is a PairingExchangeResponse.", "required": [ "kind", "protocolVersion", "requestId", "expiresAt", "hostPublicKey", "salt", "nonce", "ciphertext", "tag" ], "properties": { "kind": { "const": "aiden-pairing-request-v1" }, "protocolVersion": { "const": 1 }, "requestId": { "type": "string", "pattern": "^pairreq_[A-Za-z0-9_-]{32}$" }, "expiresAt": { "type": "string", "format": "date-time" }, "hostPublicKey": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, "salt": { "type": "string", "pattern": "^[A-Za-z0-9_-]{22}$" }, "nonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{16}$" }, "ciphertext": { "type": "string", "minLength": 2, "maxLength": 10923, "pattern": "^[A-Za-z0-9_-]+$" }, "tag": { "type": "string", "pattern": "^[A-Za-z0-9_-]{22}$" } }, "additionalProperties": false }, "HostHealth": { "type": "object", "description": "Contract revision 19 opt-in host descriptor from GET /health?detail=host. Every field is non-secret and grants nothing.", "required": [ "ok", "protocolVersion", "instanceId", "displayName", "contractRevision", "pairingRequests" ], "properties": { "ok": { "const": true }, "protocolVersion": { "const": 1 }, "instanceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "displayName": { "type": "string", "minLength": 1, "maxLength": 80 }, "platform": { "enum": [ "mac", "linux", "windows" ] }, "contractRevision": { "type": "integer", "minimum": 19 }, "pairingRequests": { "type": "boolean", "description": "Whether this host accepts desktop pairing requests right now. Only a host at contract revision 20 or newer serves /pairing/requests, so requesters also check contractRevision." } }, "additionalProperties": false }, "RepositoryIdentity": { "type": "object", "description": "Credential-free repository identity derived from cached Git data, never by crawling. canonicalKey is host/owner/name with no scheme, port, userinfo, query or .git, so the same checkout on two hosts shares a key.", "required": [ "canonicalKey", "relativePath" ], "properties": { "canonicalKey": { "type": "string", "minLength": 3, "maxLength": 512, "pattern": "^[a-z0-9.-]+(?:/[A-Za-z0-9._~+-]+)+$" }, "relativePath": { "type": "string", "maxLength": 4096, "description": "POSIX path of the workspace folder inside the repository; empty at the root." } }, "additionalProperties": false }, "HostFeedWorkspace": { "type": "object", "description": "A Workspace as the host feed projects it: identical to Workspace plus an optional repository identity.", "required": [ "id", "name", "permission", "memoryEnabled", "hasFolder", "isManagedWorktree", "createdAt", "updatedAt", "revision" ], "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "permission": { "enum": [ "full", "ask", "none" ] }, "memoryEnabled": { "type": "boolean" }, "hasFolder": { "type": "boolean" }, "isManagedWorktree": { "type": "boolean" }, "noWorkspace": { "type": "boolean", "const": true, "description": "Contract revision 51. Present only on a hidden folder Aiden made for one chat without a workspace. Clients list those chats under one Chats group instead of a workspace each." }, "branchName": { "type": "string" }, "repositoryName": { "type": "string" }, "git": { "type": "object", "properties": { "isRepo": { "type": "boolean" }, "branch": { "type": "string" }, "uncommitted": { "type": "integer", "minimum": 0 } }, "required": [ "isRepo" ], "additionalProperties": false }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string" }, "repository": { "$ref": "#/components/schemas/RepositoryIdentity" } }, "additionalProperties": false }, "HostFeedBot": { "type": "object", "description": "A host feed Bot row: a BotSummary (without issueCount, which only phones read) plus the Inbox signals of contract revision 52 and the preview of revision 66. Each optional field is present only when it holds.", "x-aiden-updated-at-not-before-created-at": true, "required": [ "id", "name", "purpose", "avatar", "health", "createdAt", "updatedAt", "revision" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "purpose": { "type": "string", "maxLength": 280 }, "avatar": { "$ref": "#/components/schemas/BotAvatarView" }, "health": { "$ref": "#/components/schemas/BotHealth" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 }, "sessionState": { "description": "Contract revision 37: paused reaches only devices holding bot:handoffs; every other device sees a paused Bot as unavailable.", "enum": [ "idle", "running", "interrupted", "needs_model", "unavailable", "paused" ] }, "paused": { "description": "Contract revision 37, only for devices holding bot:handoffs and only while the person paused the Bot (sessionState is then paused).", "const": true }, "needsYou": { "description": "Contract revision 52: an approval, a question, a hand-off or an open issue waits on the person.", "const": true }, "failed": { "description": "Contract revision 52: the Bot's last turn was cut short, or its model cannot be used.", "const": true }, "lastReplyAt": { "description": "Contract revision 52: when the Bot's newest reply with visible text arrived. Since revision 66 a host sends it for every Bot, not only Bots whose chat is open there.", "type": "string", "format": "date-time" }, "preview": { "description": "Contract revision 66: the one plain line the host's own Bots list shows under the Bot's name (its newest reply, else the person's newest message). No line breaks or control characters.", "type": "string", "minLength": 1, "maxLength": 140 }, "summarized": { "description": "Contract revision 66: the row's preview and lastReplyAt come from the Bot's summary, so a row with this and neither of them is a Bot with no message yet. Absent when the host could not read the summary, and on hosts before revision 66.", "const": true } }, "additionalProperties": false }, "HostFeedSnapshot": { "type": "object", "required": [ "epoch", "sequence", "summaries", "workspaces", "bots" ], "properties": { "epoch": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$" }, "sequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "summaries": { "type": "array", "items": { "$ref": "#/components/schemas/ChatSummary" } }, "workspaces": { "type": "array", "items": { "$ref": "#/components/schemas/HostFeedWorkspace" } }, "bots": { "type": "array", "description": "Empty for devices without bot:read.", "items": { "$ref": "#/components/schemas/HostFeedBot" } }, "partial": { "const": true, "description": "Present only on a non-final chunk of a snapshot larger than 256 KiB. Such frames carry no SSE id. Clients append each chunk's arrays and replace their host state only when the final chunk (without partial, with the id) arrives." } }, "additionalProperties": false }, "RunStateChange": { "type": "object", "required": [ "chatId", "runId", "state", "unread" ], "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 128 }, "runId": { "type": "string", "minLength": 1, "maxLength": 128 }, "state": { "$ref": "#/components/schemas/RunState" }, "unread": { "type": "boolean" } }, "additionalProperties": false }, "RunState": { "enum": [ "working", "needs_approval", "needs_input", "done", "failed", "cancelled" ] }, "HostFeedEvent": { "type": "object", "description": "One GET /host/events event. The SSE id is :, omitted only on a partial snapshot chunk; terminal is always false.", "required": [ "protocolVersion", "streamId", "sequence", "timestamp", "type", "terminal", "payload" ], "properties": { "protocolVersion": { "const": 1 }, "streamId": { "const": "host" }, "sequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "timestamp": { "type": "string", "format": "date-time" }, "type": { "enum": [ "snapshot", "chat.upsert", "chat.remove", "workspace.upsert", "workspace.remove", "bot.upsert", "bot.remove", "run.state" ] }, "terminal": { "const": false }, "payload": { "type": "object" } }, "allOf": [ { "if": { "properties": { "type": { "const": "snapshot" } }, "required": [ "type" ] }, "then": { "properties": { "payload": { "$ref": "#/components/schemas/HostFeedSnapshot" } } } }, { "if": { "properties": { "type": { "const": "chat.upsert" } }, "required": [ "type" ] }, "then": { "properties": { "payload": { "$ref": "#/components/schemas/ChatSummary" } } } }, { "if": { "properties": { "type": { "const": "workspace.upsert" } }, "required": [ "type" ] }, "then": { "properties": { "payload": { "$ref": "#/components/schemas/HostFeedWorkspace" } } } }, { "if": { "properties": { "type": { "const": "bot.upsert" } }, "required": [ "type" ] }, "then": { "properties": { "payload": { "$ref": "#/components/schemas/HostFeedBot" } } } }, { "if": { "properties": { "type": { "const": "run.state" } }, "required": [ "type" ] }, "then": { "properties": { "payload": { "$ref": "#/components/schemas/RunStateChange" } } } }, { "if": { "properties": { "type": { "enum": [ "chat.remove", "workspace.remove", "bot.remove" ] } }, "required": [ "type" ] }, "then": { "properties": { "payload": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160 } }, "additionalProperties": false } } } } ], "additionalProperties": false }, "RunEvent": { "type": "object", "description": "One run-stream event. streamId is the run ID and the SSE id is the decimal sequence. Content events carry the /streams/{streamId}/events payloads.", "required": [ "protocolVersion", "streamId", "sequence", "timestamp", "type", "terminal", "payload" ], "properties": { "protocolVersion": { "const": 1 }, "streamId": { "type": "string", "minLength": 1, "maxLength": 128 }, "sequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "timestamp": { "type": "string", "format": "date-time" }, "type": { "enum": [ "snapshot", "run.started", "status", "text_delta", "reasoning_delta", "tool_started", "tool_finished", "timeline", "approval_required", "approval_resolved", "question_required", "question_resolved", "done", "error", "cancelled", "run.ended" ] }, "terminal": { "type": "boolean" }, "payload": { "type": "object" } }, "allOf": [ { "if": { "properties": { "type": { "const": "snapshot" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "runId", "chatId", "reason", "nextSequence" ], "properties": { "runId": { "type": "string", "maxLength": 128 }, "chatId": { "type": "string", "maxLength": 128 }, "reason": { "enum": [ "gap", "reset" ] }, "epoch": { "type": "string", "maxLength": 128 }, "state": { "$ref": "#/components/schemas/RunState" }, "pendingApprovalIds": { "type": "array", "items": { "type": "string", "maxLength": 128 } }, "pendingQuestionIds": { "type": "array", "items": { "type": "string", "maxLength": 128 } }, "approvals": { "type": "array", "items": { "type": "object" } }, "questions": { "type": "array", "items": { "type": "object" } }, "replyText": { "description": "Complete public text through this cursor, only on an opted-in live gap snapshot. Absent when unavailable.", "type": "string", "maxLength": 32768 }, "replyReasoning": { "description": "Complete displayable parent reasoning through this cursor, only on an opted-in live gap snapshot.", "type": "string", "maxLength": 32768 }, "timeline": { "$ref": "#/components/schemas/GenerationTimeline" }, "nextSequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "run.started" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": false }, "payload": { "type": "object", "required": [ "runId", "chatId", "origin" ], "properties": { "runId": { "type": "string", "maxLength": 128 }, "chatId": { "type": "string", "maxLength": 128 }, "origin": { "enum": [ "renderer", "remote", "headless" ] } }, "additionalProperties": false } } } }, { "if": { "properties": { "type": { "const": "run.ended" } }, "required": [ "type" ] }, "then": { "properties": { "terminal": { "const": true }, "payload": { "type": "object", "required": [ "runId", "chatId", "state" ], "properties": { "runId": { "type": "string", "maxLength": 128 }, "chatId": { "type": "string", "maxLength": 128 }, "state": { "enum": [ "done", "failed", "cancelled" ] } }, "additionalProperties": false } } } } ], "additionalProperties": false }, "RunApprovalRespondRequest": { "type": "object", "required": [ "decision" ], "properties": { "decision": { "enum": [ "allow", "deny" ] }, "scope": { "$ref": "#/components/schemas/ToolApprovalScope", "description": "Optional and valid only with decision allow; must be offered by the approval." } }, "if": { "required": [ "scope" ] }, "then": { "properties": { "decision": { "const": "allow" } } }, "additionalProperties": false }, "RunCancelResult": { "type": "object", "required": [ "runId", "chatId", "state", "cancelRequested" ], "properties": { "runId": { "type": "string" }, "chatId": { "type": "string" }, "state": { "$ref": "#/components/schemas/RunState" }, "cancelRequested": { "type": "boolean", "description": "False when the run stopped before this request reached it." } }, "additionalProperties": false }, "RunApprovalResult": { "type": "object", "required": [ "runId", "approvalId", "decision", "resolvedAt" ], "properties": { "runId": { "type": "string" }, "approvalId": { "type": "string" }, "decision": { "enum": [ "allow", "deny" ] }, "scope": { "$ref": "#/components/schemas/ToolApprovalScope" }, "resolvedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "RunQuestionResult": { "type": "object", "required": [ "runId", "promptId", "outcome", "resolvedAt" ], "properties": { "runId": { "type": "string" }, "promptId": { "type": "string" }, "outcome": { "enum": [ "answered", "expired" ] }, "resolvedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "RunInputResult": { "type": "object", "required": [ "runId", "chatId", "mode", "status", "committed" ], "properties": { "runId": { "type": "string" }, "chatId": { "type": "string" }, "mode": { "enum": [ "steer", "queue" ] }, "status": { "enum": [ "admitted", "rejected" ] }, "queue": { "enum": [ "steer", "follow-up" ] }, "reason": { "enum": [ "run_not_active", "cancelled", "capacity", "invalid" ] }, "committed": { "type": "boolean" }, "messageId": { "type": "string" } }, "additionalProperties": false }, "AgentSlider": { "type": "object", "description": "Contract revision 70: the host's Agent Slider, absent when the host has none or cannot read it. Stops run left to right; homeStopId names the stop Reset to home returns to. A stop is never substituted: availability is ready, the first reason it cannot run, or computer-only for a stop that runs on the computer but whose provider or model this device's catalog leaves out. Clients decode tolerantly: a stop with an unknown availability or an unknown thinkingLevel keeps its id and label but cannot be chosen, and the rest of the slider stays.", "required": [ "stops", "homeStopId" ], "properties": { "stops": { "type": "array", "minItems": 3, "maxItems": 7, "items": { "$ref": "#/components/schemas/AgentSliderStop" } }, "homeStopId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$" } }, "additionalProperties": false }, "AgentSliderStop": { "type": "object", "dependentRequired": { "providerId": [ "modelId" ], "modelId": [ "providerId" ], "thinkingLevel": [ "modelId" ] }, "if": { "properties": { "availability": { "const": "ready" } } }, "then": { "required": [ "providerId", "modelId" ] }, "else": { "not": { "anyOf": [ { "required": [ "providerId" ] }, { "required": [ "modelId" ] }, { "required": [ "thinkingLevel" ] } ] } }, "required": [ "id", "label", "availability" ], "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$" }, "label": { "type": "string", "minLength": 1, "maxLength": 24 }, "providerLabel": { "type": "string", "minLength": 1, "maxLength": 256, "description": "The configured provider's label, on every stop whose provider is configured except computer-only. Never an id." }, "modelLabel": { "type": "string", "minLength": 1, "maxLength": 256, "description": "The model's human name: its catalog label on a ready stop, its name on a not-signed-in or hidden stop. Absent when only the id is known, and on unassigned, provider-missing, model-missing and computer-only stops." }, "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 }, "thinkingLevel": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ], "description": "The level a turn on this stop runs with on this host: the stop's own level fitted to its model's levels. Absent when the stop has none or the model has no levels." }, "availability": { "type": "string", "enum": [ "ready", "unassigned", "provider-missing", "not-signed-in", "model-missing", "hidden", "computer-only" ], "description": "computer-only: the stop runs on the computer, but its provider or model is one the phone catalog deliberately leaves out (an agent harness, an id past the length limit, an embedding model, or one past the size budget). Such a stop carries no ids, labels or level. providerId, modelId and thinkingLevel are sent only on ready stops." } }, "additionalProperties": false }, "ChatMessagesWindow": { "type": "object", "description": "Contract revision 23 (chat-messages-window-metadata-v1) adds the chat metadata a whole-chat read returns: workspaceId, botId, title, titlePending, providerId/modelId, createdAt and updatedAt. A host advertising chat-messages-window-metadata-v1 always includes workspaceId, title, createdAt and updatedAt; a client that refreshes from a window falls back to GET /chats/{chatId} when they are absent.", "not": { "required": [ "botId", "thinkingLevel" ] }, "x-aiden-max-json-response-bytes": 1048576, "dependentRequired": { "providerId": [ "modelId" ], "thinkingLevel": [ "modelId" ], "modelId": [ "providerId" ] }, "required": [ "chatId", "revision", "messages", "hasOlder" ], "properties": { "chatId": { "type": "string", "minLength": 1, "maxLength": 128 }, "revision": { "type": "string", "maxLength": 128 }, "messages": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Message" }, "description": "Oldest first." }, "hasOlder": { "type": "boolean", "description": "True when older visible messages exist before the first returned message." }, "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128 }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "title": { "type": "string", "maxLength": 1024 }, "titlePending": { "type": "boolean", "enum": [ true ] }, "providerId": { "type": "string", "minLength": 1, "maxLength": 256 }, "modelId": { "type": "string", "minLength": 1, "maxLength": 512 }, "thinkingLevel": { "type": "string", "enum": [ "off", "low", "medium", "high", "xhigh", "max" ], "description": "Contract revision 70: the chat's own thinking level (an Agent Slider stop), present only with providerId and modelId and never on a Bot chat. Absent: the model's saved level applies." }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "forkedFrom": { "description": "Additive in contract revision 21: present on a fork, with its summary.", "allOf": [ { "$ref": "#/components/schemas/ChatForkLineage" } ] } }, "additionalProperties": false }, "BotSessionState": { "description": "A Bot session's state on its own, as Resume, Dismiss and Stop return it.", "allOf": [ { "$ref": "#/components/schemas/BotSessionStateFields" } ], "unevaluatedProperties": false }, "BotSessionStateFields": { "type": "object", "required": [ "state", "interrupted" ], "properties": { "state": { "description": "interrupted is a turn that stopped part-way and waits for Resume or Dismiss. Contract revision 37: paused (the person paused the Bot) reaches only devices holding bot:handoffs; every other device sees unavailable.", "enum": [ "idle", "running", "interrupted", "needs_model", "unavailable", "paused" ] }, "interrupted": { "type": "boolean" }, "blocked": { "enum": [ "access_changed", "bot_missing" ] } } }, "BotSessionEntry": { "oneOf": [ { "type": "object", "required": [ "type", "id", "role", "text" ], "properties": { "type": { "const": "message" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "role": { "enum": [ "user", "assistant" ] }, "text": { "type": "string", "maxLength": 100000 }, "createdAt": { "type": "string", "format": "date-time" }, "label": { "type": "string", "maxLength": 80 }, "interrupted": { "const": true }, "submissionId": { "description": "Contract revision 30, only for devices holding bot:activity, and only on the person's own message (role user): the submission it was sent as, the same id as the send receipt and the queued list, so a phone settles its optimistic bubble exactly. Never on a routine's input (never together with label) or a question answer, and omitted when the Mac no longer knows it; a device without bot:activity never receives the key.", "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,64}$" } }, "additionalProperties": false }, { "type": "object", "required": [ "type", "id", "pluginId", "name", "iconId", "reason", "status" ], "properties": { "type": { "const": "connect_card" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "pluginId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "maxLength": 80 }, "iconId": { "type": "string", "maxLength": 64 }, "reason": { "type": "string", "maxLength": 280 }, "status": { "enum": [ "pending", "connected", "dismissed" ] } }, "additionalProperties": false }, { "type": "object", "required": [ "type", "id", "notice" ], "properties": { "type": { "const": "notice" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "notice": { "const": "session_reset" } }, "additionalProperties": false }, { "type": "object", "description": "A reply that failed. Clients show \"I couldn't finish that reply.\"; on the newest entry, Retry posts retryText to POST /bots/{botId}/messages with a new Idempotency-Key. retryText is omitted when there is nothing to resend.", "required": [ "type", "id" ], "properties": { "type": { "const": "failed_turn" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "createdAt": { "type": "string", "format": "date-time" }, "retryText": { "type": "string", "minLength": 1, "maxLength": 100000 } }, "additionalProperties": false }, { "type": "object", "description": "Contract revision 27, only for devices holding bot:cards: the Bot saved something to its memory. Clients show a quiet Memory updated line.", "required": [ "type", "id" ], "properties": { "type": { "const": "memory_update" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, { "type": "object", "description": "Contract revision 27, only for devices holding bot:cards: a routine the Bot suggested. Pending cards are answered through POST /bots/{botId}/routine-proposals/{proposalId}/respond.", "required": [ "type", "id", "proposalId", "name", "prompt", "label", "status" ], "properties": { "type": { "const": "routine_proposal" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "proposalId": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "prompt": { "type": "string", "minLength": 1, "maxLength": 100000 }, "label": { "type": "string", "minLength": 1, "maxLength": 120, "description": "When the routine runs, ready to show: a schedule with its timezone (\"Every day at 9:00 AM \u00b7 Pacific Time\"), or what starts an event routine (\"When this routine's link is called\"). A card the Bot replaced with a revised one is omitted; the revised card follows as a new entry." }, "status": { "enum": [ "pending", "accepted", "dismissed" ] }, "routineId": { "type": "string", "minLength": 1, "maxLength": 160, "description": "Only when accepted." }, "createdAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, { "type": "object", "description": "Contract revision 45, only for devices holding bot:images: an image the Bot shared. The bytes are read from GET /bots/{botId}/session/images/{id}; devices without bot:images get an assistant message with the same id that names the image and points to the Mac.", "required": [ "type", "id", "name", "mimeType", "size" ], "properties": { "type": { "const": "shared_image" }, "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "mimeType": { "enum": [ "image/png", "image/jpeg" ] }, "size": { "type": "integer", "minimum": 1, "maximum": 8388608 } }, "additionalProperties": false }, { "$ref": "#/components/schemas/BotPeerSessionEntry" } ] }, "BotSession": { "allOf": [ { "$ref": "#/components/schemas/BotSessionStateFields" } ], "type": "object", "required": [ "botId", "epoch", "seq", "state", "interrupted", "entries", "hasOlder", "question", "approval" ], "properties": { "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "epoch": { "type": "string", "minLength": 1, "maxLength": 128 }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "partial": { "type": "string", "maxLength": 100000 }, "entries": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/BotSessionEntry" } }, "hasOlder": { "type": "boolean" }, "question": { "oneOf": [ { "$ref": "#/components/schemas/BotQuestion" }, { "type": "null" } ] }, "approval": { "oneOf": [ { "$ref": "#/components/schemas/BotApproval" }, { "type": "null" } ] }, "activity": { "description": "Contract revision 30, only for devices holding bot:activity: what the Bot is doing in its running turn, or null.", "oneOf": [ { "$ref": "#/components/schemas/BotSessionActivity" }, { "type": "null" } ] }, "queued": { "description": "Contract revision 30, only for devices holding bot:activity: the person's messages waiting for the running turn.", "type": "array", "maxItems": 20, "items": { "$ref": "#/components/schemas/BotQueuedMessage" } }, "handoff": { "description": "Contract revision 37, always present for devices holding bot:handoffs and never for others: the hand-off the Bot is waiting on, or null. Other devices get an assistant message with id handoff-notice: as the newest entry instead.", "oneOf": [ { "$ref": "#/components/schemas/BotHandoff" }, { "type": "null" } ] }, "issues": { "description": "Contract revision 42, present only for devices holding bot:issues: the Bot's issue cards, oldest first. A card that only the Mac can answer carries no actions.", "type": "array", "maxItems": 58, "items": { "$ref": "#/components/schemas/BotIssue" } }, "accessRequest": { "oneOf": [ { "$ref": "#/components/schemas/BotAccessRequest" }, { "type": "null" } ], "description": "Revision 55. Present only for bot:access-requests holders." }, "plan": { "description": "Revision 56. Present only for bot:plans holders. null clears the current plan; absence means the capability is not negotiated.", "oneOf": [ { "$ref": "#/components/schemas/BotPlan" }, { "type": "null" } ] } }, "unevaluatedProperties": false }, "BotIssue": { "type": "object", "description": "Contract revision 42 (bot:issues): one host-owned \"Needs you\" card. open_settings is desktop-only and never sent as an action.", "required": [ "id", "kind", "title", "body", "actions", "createdAt", "resolved" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "kind": { "enum": [ "preflight_failed", "routine_failed", "routine_paused", "run_stalled", "access_needed" ] }, "title": { "type": "string", "minLength": 1, "maxLength": 80 }, "body": { "type": "string", "maxLength": 280 }, "routineId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "actions": { "type": "array", "maxItems": 2, "items": { "$ref": "#/components/schemas/BotIssueAction" } }, "createdAt": { "type": "string", "format": "date-time" }, "resolved": { "type": "boolean", "description": "A settled card offers no action." } }, "allOf": [ { "if": { "required": [ "resolved" ], "properties": { "resolved": { "const": true } } }, "then": { "properties": { "actions": { "maxItems": 0 } } } } ], "additionalProperties": false }, "BotIssueAction": { "type": "object", "required": [ "kind" ], "properties": { "kind": { "enum": [ "open_chat", "resume_routine", "stop_run", "keep_waiting", "allow_folder", "dismiss_access" ] }, "routineId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$", "description": "Present exactly on resume_routine." } }, "additionalProperties": false, "description": "allow_folder and dismiss_access require bot:access-requests beside bot:issues. dismiss_access is offered only on access_needed issues." }, "BotIssueActRequest": { "type": "object", "required": [ "action" ], "properties": { "action": { "$ref": "#/components/schemas/BotIssueAction" } }, "additionalProperties": false }, "BotIssueActReceipt": { "type": "object", "required": [ "result" ], "properties": { "result": { "enum": [ "done", "not_open" ] } }, "additionalProperties": false }, "BotSessionActivity": { "description": "Contract revision 30 (bot-activity-v1). Exactly these keys: never a step, detail, path, command, query or thinking. Clients render an unknown phase as working.", "type": "object", "required": [ "phase", "startedAt" ], "properties": { "phase": { "type": "string", "pattern": "^[a-z][a-z_]{0,31}$" }, "app": { "type": "string", "minLength": 1, "maxLength": 40 }, "startedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "additionalProperties": false }, "BotQueuedMessage": { "type": "object", "required": [ "submissionId", "mode", "text" ], "properties": { "submissionId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,64}$" }, "mode": { "enum": [ "steer", "queue" ] }, "text": { "type": "string", "minLength": 1, "maxLength": 32000 } }, "additionalProperties": false }, "BotChatActivity": { "type": "object", "required": [ "level", "wording" ], "properties": { "level": { "enum": [ "quiet", "summary", "detailed" ] }, "wording": { "enum": [ "follows", "thinking" ] } }, "additionalProperties": false }, "BotSessionEvent": { "type": "object", "required": [ "protocolVersion", "botId", "epoch", "seq", "type", "payload" ], "properties": { "protocolVersion": { "const": 1 }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "epoch": { "type": "string", "minLength": 1, "maxLength": 128 }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "type": { "enum": [ "snapshot", "partial", "entry", "state", "question", "approval", "activity", "queued", "handoff", "issues", "closed", "access_request", "plan" ] }, "payload": { "description": "handoff (contract revision 37, only for devices holding bot:handoffs) carries { handoff: BotHandoff | null }. issues (contract revision 42, only for devices holding bot:issues) carries { issues: BotIssue[] }. At the same seq, other devices get a state frame, so their sequence still advances. Revision 55 access_request carries {accessRequest: BotAccessRequest | null} only for bot:access-requests holders. Legacy phones and paired desktops receive an assistant access-notice entry, removed by an authoritative snapshot on settlement or replacement. Revision 56 plan carries {plan: BotPlan | null} only for bot:plans holders. Other devices receive a state frame at the same sequence.", "type": "object" } }, "additionalProperties": false, "allOf": [ { "if": { "properties": { "type": { "const": "plan" } } }, "then": { "properties": { "payload": { "type": "object", "required": [ "plan" ], "properties": { "plan": { "oneOf": [ { "$ref": "#/components/schemas/BotPlan" }, { "type": "null" } ] } }, "additionalProperties": false } } } } ] }, "BotMessageRequest": { "type": "object", "required": [ "text" ], "properties": { "text": { "type": "string", "maxLength": 32000 }, "whenBusy": { "description": "Contract revision 30, only on hosts announcing bot-activity-v1: steer joins the running turn; queue (or no value) runs after it.", "enum": [ "steer", "queue" ] }, "attachmentIds": { "description": "Contract revision 33, only on hosts announcing bot-attachments-v1: references from POST /bots/{botId}/attachments, spent by this message. With them the text may be empty.", "type": "array", "minItems": 1, "maxItems": 10, "uniqueItems": true, "items": { "type": "string", "pattern": "^att_[A-Za-z0-9_-]{43}$" } } }, "additionalProperties": false, "anyOf": [ { "properties": { "text": { "minLength": 1 } } }, { "required": [ "attachmentIds" ] } ] }, "BotMessageReceipt": { "allOf": [ { "$ref": "#/components/schemas/BotSessionStateFields" } ], "type": "object", "required": [ "submissionId", "deduped", "state", "interrupted" ], "properties": { "submissionId": { "type": "string", "minLength": 1, "maxLength": 128 }, "deduped": { "type": "boolean" } }, "unevaluatedProperties": false }, "BotMemoryEntry": { "type": "object", "required": [ "id", "text" ], "properties": { "id": { "type": "string", "pattern": "^[0-9a-f]{16}$", "description": "First 16 hex of sha256(target + NUL + text): a stale id never overwrites newer text." }, "text": { "type": "string", "minLength": 1, "maxLength": 500 } }, "additionalProperties": false }, "BotMemoryStore": { "type": "object", "required": [ "entries", "usedChars", "limitChars", "overBudget" ], "properties": { "entries": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/BotMemoryEntry" } }, "usedChars": { "type": "integer", "minimum": 0 }, "limitChars": { "type": "integer", "minimum": 1 }, "overBudget": { "type": "boolean" } }, "additionalProperties": false }, "BotMemory": { "type": "object", "required": [ "botId", "revision", "readable", "memory", "user", "updatedAt" ], "properties": { "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "revision": { "type": "string", "pattern": "^[0-9a-f]{16}$" }, "readable": { "type": "boolean" }, "memory": { "$ref": "#/components/schemas/BotMemoryStore" }, "user": { "$ref": "#/components/schemas/BotMemoryStore" }, "updatedAt": { "type": [ "string", "null" ], "format": "date-time" } }, "additionalProperties": false }, "BotMemoryEditRequest": { "type": "object", "required": [ "edit" ], "properties": { "edit": { "oneOf": [ { "type": "object", "required": [ "kind", "target", "entryId", "text" ], "properties": { "kind": { "const": "replace" }, "target": { "enum": [ "memory", "user" ] }, "entryId": { "type": "string", "pattern": "^[0-9a-f]{16}$" }, "text": { "type": "string", "minLength": 1, "maxLength": 500 } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "target", "entryId" ], "properties": { "kind": { "const": "remove" }, "target": { "enum": [ "memory", "user" ] }, "entryId": { "type": "string", "pattern": "^[0-9a-f]{16}$" } }, "additionalProperties": false }, { "type": "object", "required": [ "kind" ], "properties": { "kind": { "const": "clear" } }, "additionalProperties": false } ] } }, "additionalProperties": false }, "BotMemoryEditResponse": { "type": "object", "required": [ "ok", "view" ], "properties": { "ok": { "const": true }, "view": { "$ref": "#/components/schemas/BotMemory" } }, "additionalProperties": false }, "BotRoutineProposalRespondRequest": { "type": "object", "required": [ "decision" ], "properties": { "decision": { "enum": [ "accept", "dismiss" ] } }, "additionalProperties": false }, "BotRoutineProposalRespondResult": { "type": "object", "required": [ "status" ], "properties": { "status": { "enum": [ "accepted", "dismissed" ] }, "routineId": { "type": "string", "minLength": 1, "maxLength": 160, "description": "Present exactly when accepted." } }, "additionalProperties": false }, "BotRoutineSuggestionList": { "type": "object", "required": [ "suggestions" ], "properties": { "suggestions": { "type": "array", "maxItems": 8, "items": { "type": "object", "required": [ "id", "name", "prompt", "schedule", "label" ], "properties": { "id": { "enum": [ "daily-check-in" ] }, "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32000 }, "schedule": { "$ref": "#/components/schemas/BotRoutineSchedule" }, "label": { "type": "string", "minLength": 1, "maxLength": 120 } }, "additionalProperties": false } } }, "additionalProperties": false }, "BotRoutineNotificationList": { "type": "object", "required": [ "notifications", "now" ], "properties": { "notifications": { "type": "array", "maxItems": 100, "items": { "type": "object", "required": [ "id", "botId", "botName", "routineName", "finishedAt", "preview" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160 }, "kind": { "description": "Absent means routine. Issue, peer and message items carry neither routineId nor status; routine items require them.", "enum": [ "routine", "issue", "peer", "message" ] }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "botName": { "type": "string", "minLength": 1, "maxLength": 80 }, "routineId": { "type": "string", "minLength": 1, "maxLength": 160 }, "routineName": { "type": "string", "minLength": 1, "maxLength": 120 }, "status": { "enum": [ "succeeded", "failed" ] }, "finishedAt": { "type": "string", "format": "date-time" }, "preview": { "type": "string", "minLength": 1, "maxLength": 160 } }, "additionalProperties": false, "allOf": [ { "if": { "properties": { "kind": { "enum": [ "issue", "peer", "message" ] } }, "required": [ "kind" ] }, "then": { "not": { "anyOf": [ { "required": [ "routineId" ] }, { "required": [ "status" ] } ] } }, "else": { "required": [ "routineId", "status" ] } } ] } }, "now": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "BotRoutineSchedule": { "oneOf": [ { "type": "object", "required": [ "kind", "date", "time" ], "properties": { "kind": { "const": "once" }, "date": { "type": "string" }, "time": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "time" ], "properties": { "kind": { "const": "daily" }, "time": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "time" ], "properties": { "kind": { "const": "weekdays" }, "time": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "days", "time" ], "properties": { "kind": { "const": "weekly" }, "days": { "type": "array", "minItems": 1, "maxItems": 7, "uniqueItems": true, "items": { "type": "integer", "minimum": 0, "maximum": 6 } }, "time": { "type": "string" } }, "additionalProperties": false }, { "type": "object", "required": [ "kind", "day", "time" ], "properties": { "kind": { "const": "monthly" }, "day": { "type": "integer", "minimum": 1, "maximum": 28 }, "time": { "type": "string" } }, "additionalProperties": false } ] }, "BotRoutine": { "type": "object", "required": [ "id", "botId", "name", "message", "schedule", "timezone", "label", "enabled", "updatedAt", "revision" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "message": { "type": "string", "minLength": 1, "maxLength": 32000 }, "schedule": { "anyOf": [ { "$ref": "#/components/schemas/BotRoutineSchedule" }, { "type": "null" } ] }, "timezone": { "type": "string", "maxLength": 80 }, "label": { "type": "string", "maxLength": 120 }, "enabled": { "type": "boolean" }, "nextRunAt": { "type": "string", "format": "date-time" }, "lastRunAt": { "type": "string", "format": "date-time" }, "lastResult": { "enum": [ "success", "error", "silent", "blocked", "skipped" ] }, "lastError": { "type": "string", "maxLength": 500 }, "updatedAt": { "type": "string", "format": "date-time" }, "revision": { "type": "string", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false }, "BotRoutineList": { "type": "object", "required": [ "routines" ], "properties": { "routines": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/BotRoutine" } } }, "additionalProperties": false }, "BotRoutineCreateRequest": { "type": "object", "required": [ "name", "schedule", "message" ], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "schedule": { "$ref": "#/components/schemas/BotRoutineSchedule" }, "message": { "type": "string", "minLength": 1, "maxLength": 32000 }, "timezone": { "type": "string", "maxLength": 80 } }, "additionalProperties": false }, "BotRoutineUpdateRequest": { "type": "object", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "schedule": { "$ref": "#/components/schemas/BotRoutineSchedule" }, "message": { "type": "string", "minLength": 1, "maxLength": 32000 }, "timezone": { "type": "string", "maxLength": 80 }, "enabled": { "type": "boolean" } }, "additionalProperties": false }, "BotConnectionRequest": { "type": "object", "required": [ "pluginId" ], "properties": { "pluginId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "additionalProperties": false }, "BotConnectionRequestReceipt": { "type": "object", "required": [ "pluginId", "name", "status" ], "properties": { "pluginId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "maxLength": 80 }, "status": { "const": "sent" } }, "additionalProperties": false }, "BotConnectionChip": { "type": "object", "required": [ "pluginId", "name", "iconId" ], "properties": { "pluginId": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "maxLength": 80 }, "iconId": { "type": "string", "maxLength": 64 } }, "additionalProperties": false }, "BotPreset": { "type": "object", "required": [ "id", "name", "subtitle", "avatar", "suggestedConnections" ], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 64 }, "name": { "type": "string", "maxLength": 80 }, "subtitle": { "type": "string", "maxLength": 120 }, "avatar": { "type": "object", "required": [ "version", "shape", "color" ], "properties": { "version": { "const": 1 }, "shape": { "enum": [ "wisp", "orb", "drop", "hex", "cloud", "peak", "squircle", "capsule" ] }, "color": { "enum": [ "lilac", "sky", "mint", "sun", "periwinkle", "coral", "peach", "aqua", "rose", "lime", "plum", "graphite" ] } }, "additionalProperties": false }, "suggestedConnections": { "type": "array", "maxItems": 8, "items": { "$ref": "#/components/schemas/BotConnectionChip" } }, "suggestedRoutine": { "type": "object", "required": [ "name", "label" ], "properties": { "name": { "type": "string", "maxLength": 80 }, "label": { "type": "string", "maxLength": 120 } }, "additionalProperties": false } }, "additionalProperties": false }, "BotPresetList": { "type": "object", "required": [ "presets" ], "properties": { "presets": { "type": "array", "maxItems": 8, "items": { "$ref": "#/components/schemas/BotPreset" } } }, "additionalProperties": false }, "BotPresetCreateRequest": { "type": "object", "required": [ "presetId" ], "properties": { "presetId": { "type": "string", "minLength": 1, "maxLength": 64 } }, "additionalProperties": false }, "BotPresetCreateResult": { "type": "object", "required": [ "created", "bot" ], "properties": { "created": { "type": "boolean" }, "bot": { "$ref": "#/components/schemas/BotSummary" } }, "additionalProperties": false }, "BotQuestion": { "description": "A question the Bot is waiting on. Answered by waitId, once.", "type": "object", "required": [ "waitId", "toolCallId", "questions" ], "properties": { "waitId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" }, "toolCallId": { "type": "string", "minLength": 1, "maxLength": 128 }, "questions": { "type": "array", "minItems": 1, "maxItems": 4, "items": { "$ref": "#/components/schemas/PendingQuestionItem" } } }, "additionalProperties": false }, "BotApproval": { "description": "A tool call the Bot is waiting to have approved. Answered once, by waitId, through POST /approvals/{approvalId}/respond, which needs approval:respond, bot:read and bot:write. canAllow false: a phone may only deny it. An offered Always answer also requires bot:allowed and scope always; other Bot cards remain once-only. The receipt acknowledges the choice, not durable grant publication.", "type": "object", "required": [ "waitId", "toolCallId", "toolName", "summary", "canAllow" ], "properties": { "waitId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" }, "toolCallId": { "type": "string", "minLength": 1, "maxLength": 128 }, "toolName": { "type": "string", "minLength": 1, "maxLength": 120 }, "summary": { "type": "string", "minLength": 1, "maxLength": 2000 }, "canAllow": { "type": "boolean" }, "alwaysCount": { "type": "integer", "minimum": 3, "maximum": 20, "description": "Revision 57, only bot:allowed holders on an offered card. No private class key." } }, "additionalProperties": false, "allOf": [ { "if": { "required": [ "alwaysCount" ] }, "then": { "properties": { "canAllow": { "const": true } } } } ] }, "BotQuestionAnswerReceipt": { "type": "object", "required": [ "waitId" ], "properties": { "waitId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, "additionalProperties": false }, "BotHandoff": { "description": "Contract revision 37, only for devices holding bot:handoffs: a step the Bot hands back to the person (Your turn: ), answered once by waitId with done or skipped. A sign_in hand-off is finished on the Mac; a phone may only skip it or open it on the Mac.", "type": "object", "required": [ "waitId", "kind", "action" ], "properties": { "waitId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" }, "kind": { "enum": [ "action", "sign_in" ] }, "action": { "type": "string", "minLength": 1, "maxLength": 160 }, "why": { "type": "string", "minLength": 1, "maxLength": 400 }, "open": { "type": "object", "required": [ "url" ], "properties": { "url": { "description": "An absolute https URL with a host and no user name or password.", "type": "string", "minLength": 9, "maxLength": 2048, "pattern": "^https://" } }, "additionalProperties": false }, "takesNote": { "description": "Contract revision 40, only for devices that also hold bot:handoff-notes: present, and false, only on a card whose answer may carry no note (one the Bot's password-or-code rule opened). Clients hide the note box for it; a note with its answer is 400 invalid_request whether or not the device was told.", "const": false }, "onMac": { "description": "Contract revision 43, only for devices that also hold bot:handoff-on-mac: present, and true, only on an action card whose step is on the Bot's own browser or computer. Such a card never carries open for any device; clients offer Finish on your Mac (POST /bots/{botId}/handoffs/{waitId}/open-on-mac), which brings the Bot's chat and its browser or computer forward on the Mac, beside Skip and Done.", "const": true } }, "additionalProperties": false }, "BotHandoffAnswerRequest": { "type": "object", "required": [ "outcome" ], "properties": { "outcome": { "enum": [ "done", "skipped" ] }, "note": { "description": "What the person adds with their answer. Not blank.", "type": "string", "minLength": 1, "maxLength": 4000 } }, "additionalProperties": false }, "BotHandoffAnswerReceipt": { "type": "object", "required": [ "waitId" ], "properties": { "waitId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }, "additionalProperties": false }, "BotHandoffOpenOnMacReceipt": { "type": "object", "required": [ "waitId", "opened" ], "properties": { "waitId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" }, "opened": { "description": "Whether the Mac brought the hand-off forward: the Bot's chat, and for a sign-in the Bot's own browser when it has one.", "type": "boolean" } }, "additionalProperties": false }, "AppControlPanel": { "type": "object", "additionalProperties": false, "required": [ "version", "id", "topic", "fallback" ], "properties": { "version": { "const": 1 }, "id": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" }, "topic": { "enum": [ "appearance", "memory", "web-search", "skills" ] }, "fallback": { "type": "string", "maxLength": 500 }, "workspaceId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" } } }, "AppControlOption": { "type": "object", "additionalProperties": false, "required": [ "value", "label" ], "properties": { "value": { "type": "string", "minLength": 1, "maxLength": 80 }, "label": { "type": "string", "maxLength": 120 } } }, "AppControlRow": { "type": "object", "additionalProperties": false, "required": [ "id", "label", "description", "scope", "value", "revision" ], "properties": { "id": { "enum": [ "appearance.mode", "appearance.chatWidth", "appearance.reduceMotion", "memory.enabled", "memory.workspace", "webSearch.enabled", "skills.enabled" ] }, "label": { "type": "string", "minLength": 1, "maxLength": 120 }, "description": { "type": "string", "maxLength": 500 }, "scope": { "type": "string", "maxLength": 256 }, "value": { "oneOf": [ { "type": "boolean" }, { "type": "string", "maxLength": 80 } ] }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" }, "options": { "type": "array", "maxItems": 50, "items": { "$ref": "#/components/schemas/AppControlOption" } }, "disabledReason": { "type": "string", "maxLength": 500 } } }, "AppControlSnapshot": { "type": "object", "additionalProperties": false, "required": [ "version", "title", "target", "policy", "rows" ], "properties": { "version": { "const": 1 }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "target": { "type": "string", "minLength": 1, "maxLength": 256 }, "policy": { "enum": [ "disabled", "ask", "safe" ] }, "rows": { "type": "array", "maxItems": 8, "items": { "$ref": "#/components/schemas/AppControlRow" } } } }, "AppControlOperation": { "type": "object", "additionalProperties": false, "required": [ "control", "value", "expectedRevision", "operationId" ], "properties": { "control": { "enum": [ "appearance.mode", "appearance.chatWidth", "appearance.reduceMotion", "memory.enabled", "memory.workspace", "webSearch.enabled", "skills.enabled" ] }, "value": { "oneOf": [ { "type": "boolean" }, { "type": "string", "maxLength": 80 } ] }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" }, "operationId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" } } }, "AppControlReceipt": { "type": "object", "additionalProperties": false, "required": [ "status", "operationId", "control", "value", "scope", "effective" ], "properties": { "status": { "enum": [ "applied", "already_set", "outcome_unknown" ] }, "operationId": { "type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$" }, "control": { "enum": [ "appearance.mode", "appearance.chatWidth", "appearance.reduceMotion", "memory.enabled", "memory.workspace", "webSearch.enabled", "skills.enabled" ] }, "value": { "oneOf": [ { "type": "boolean" }, { "type": "string", "maxLength": 80 } ] }, "scope": { "type": "string", "maxLength": 256 }, "effective": { "enum": [ "now", "next_turn", "next_session", "after_preview" ] }, "warning": { "type": "string", "maxLength": 500 } } }, "BrowserRecordingRecap": { "type": "object", "description": "Contract revision 46: the video a completed browser_recording_stop step saved. Display-only; the bytes are read from GET /chats/{chatId}/recordings/{recordingId}.", "required": [ "id", "mimeType", "durationMs", "sizeBytes" ], "properties": { "id": { "type": "string", "pattern": "^recording-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "mimeType": { "enum": [ "video/mp4", "video/webm" ] }, "durationMs": { "type": "integer", "minimum": 0, "maximum": 360000 }, "sizeBytes": { "type": "integer", "minimum": 1, "maximum": 134217728 } }, "additionalProperties": false }, "BotConnectorWatchCondition": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "email" }, "sender": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 }, "subject": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 }, "unreadOnly": { "type": "boolean" } }, "required": [ "kind", "unreadOnly" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "calendar" }, "lookAheadMinutes": { "type": "integer", "minimum": 15, "maximum": 1440 }, "timezone": { "type": "string", "minLength": 1, "maxLength": 100, "x-aiden-utf16-max": 100 } }, "required": [ "kind", "lookAheadMinutes", "timezone" ] } ] }, "BotConnectorWatchSource": { "type": "object", "additionalProperties": false, "properties": { "providerLabel": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "accountLabel": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "resourceLabel": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 } }, "required": [ "providerLabel", "accountLabel", "resourceLabel" ] }, "BotOpenWorkSource": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "person" } }, "required": [ "kind" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "person" }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 } }, "required": [ "kind", "submissionId", "entryId" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "routine" }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "routineId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "runId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "kind", "submissionId", "entryId", "routineId", "runId" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "peer" }, "exchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "role": { "enum": [ "incoming", "outgoing" ] }, "peerBotId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "kind", "exchangeId", "role", "peerBotId" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "peer" }, "exchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "role": { "enum": [ "incoming", "outgoing" ] }, "peerBotId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 } }, "required": [ "kind", "exchangeId", "role", "peerBotId", "submissionId", "entryId" ] } ] }, "BotOpenWorkLink": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "kind": { "type": "string", "enum": [ "source", "result" ] }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 } }, "required": [ "kind", "submissionId", "entryId" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "routine" }, "routineId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "runId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "kind", "routineId", "runId" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "issue" }, "issueId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "kind", "issueId" ] }, { "type": "object", "additionalProperties": false, "properties": { "kind": { "const": "peer" }, "exchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "peerBotId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "kind", "exchangeId", "peerBotId" ] } ] }, "BotOpenWorkExecution": { "type": "object", "additionalProperties": false, "properties": { "state": { "type": "string", "enum": [ "idle", "queued", "running", "interrupted", "stopping" ] }, "canStop": { "type": "boolean" }, "blockedReason": { "type": "string", "enum": [ "mixed_inputs", "not_linked", "host_unavailable" ] } }, "required": [ "state", "canStop" ] }, "BotOpenWorkStopReceipt": { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "state": { "type": "string", "enum": [ "requested", "stopped", "already_finished", "not_running", "uncertain", "blocked" ] }, "requestedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "finishedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "reason": { "type": "string", "enum": [ "mixed_inputs", "host_unavailable", "deadline", "source_missing" ] } }, "required": [ "mutationId", "state", "requestedAt" ] }, "BotOpenWorkUndoOption": { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "itemId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "mutationId", "itemId", "expectedRevision", "expiresAt" ] }, "BotOpenWorkItem": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "title": { "type": "string", "minLength": 1, "maxLength": 160, "description": "At most160 Unicode scalars and640 UTF-8 bytes; well-formed Unicode." }, "note": { "type": "string", "maxLength": 1000, "description": "At most1000 Unicode scalars and2048 UTF-8 bytes; may be empty." }, "state": { "type": "string", "enum": [ "open", "waiting", "done", "dismissed" ] }, "waitingReason": { "type": "string", "minLength": 1, "maxLength": 160, "description": "At most160 Unicode scalars and640 UTF-8 bytes; well-formed Unicode." }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "source": { "$ref": "#/components/schemas/BotOpenWorkSource" }, "links": { "type": "array", "maxItems": 4, "items": { "$ref": "#/components/schemas/BotOpenWorkLink" } }, "completion": { "type": "object", "additionalProperties": false, "properties": { "by": { "type": "string", "enum": [ "person", "bot" ] }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "result": { "type": "object", "additionalProperties": false, "properties": { "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 } }, "required": [ "submissionId", "entryId" ] } }, "required": [ "by", "at" ] }, "execution": { "$ref": "#/components/schemas/BotOpenWorkExecution" }, "lastStop": { "$ref": "#/components/schemas/BotOpenWorkStopReceipt" } }, "required": [ "id", "revision", "title", "note", "state", "createdAt", "updatedAt", "source", "links", "execution" ], "allOf": [ { "if": { "properties": { "state": { "const": "waiting" } } }, "then": { "required": [ "waitingReason" ] }, "else": { "not": { "required": [ "waitingReason" ] } } } ] }, "BotOpenWorkSnapshot": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "items": { "type": "array", "maxItems": 192, "items": { "$ref": "#/components/schemas/BotOpenWorkItem" } }, "undo": { "type": "array", "maxItems": 192, "items": { "$ref": "#/components/schemas/BotOpenWorkUndoOption" } } }, "required": [ "botId", "revision", "items", "undo" ], "description": "Complete serialized response is at most900 KiB. At most64 active and128 terminal items; revisions are opaque strings and live execution may change at equal revision." }, "BotOpenWorkMutation": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "const": "add" }, "title": { "type": "string", "minLength": 1, "maxLength": 160, "description": "At most160 Unicode scalars and640 UTF-8 bytes; well-formed Unicode." }, "note": { "type": "string", "maxLength": 1000, "description": "At most1000 Unicode scalars and2048 UTF-8 bytes; may be empty." } }, "required": [ "mutationId", "expectedRevision", "action", "title" ] }, { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "const": "edit" }, "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "patch": { "type": "object", "additionalProperties": false, "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 160, "description": "At most160 Unicode scalars and640 UTF-8 bytes; well-formed Unicode." }, "note": { "type": "string", "maxLength": 1000, "description": "At most1000 Unicode scalars and2048 UTF-8 bytes; may be empty." }, "state": { "type": "string", "enum": [ "open", "waiting", "done", "dismissed" ] }, "waitingReason": { "type": "string", "minLength": 1, "maxLength": 160, "description": "At most160 Unicode scalars and640 UTF-8 bytes; well-formed Unicode." } }, "required": [], "minProperties": 1, "allOf": [ { "if": { "required": [ "state" ], "properties": { "state": { "const": "waiting" } } }, "then": { "required": [ "waitingReason" ] } }, { "if": { "required": [ "state" ], "properties": { "state": { "enum": [ "open", "done", "dismissed" ] } } }, "then": { "not": { "required": [ "waitingReason" ] } } } ] } }, "required": [ "mutationId", "expectedRevision", "action", "id", "patch" ] }, { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "type": "string", "enum": [ "dismiss", "stop", "stop_and_dismiss" ] }, "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "mutationId", "expectedRevision", "action", "id" ] }, { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "const": "undo" }, "undoOf": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 } }, "required": [ "mutationId", "expectedRevision", "action", "undoOf" ] } ] }, "BotOpenWorkResult": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": true }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "replayed": { "type": "boolean" }, "itemId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "snapshot": { "$ref": "#/components/schemas/BotOpenWorkSnapshot" }, "undo": { "$ref": "#/components/schemas/BotOpenWorkUndoOption" }, "stop": { "$ref": "#/components/schemas/BotOpenWorkStopReceipt" } }, "required": [ "ok", "mutationId", "replayed", "snapshot" ] }, { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": false }, "code": { "type": "string", "enum": [ "invalid", "not_found", "stale", "active_full", "history_full", "receipts_full", "mutation_conflict", "undo_conflict", "undo_expired", "mixed_inputs", "unavailable", "deleted" ] }, "error": { "type": "string", "minLength": 1, "maxLength": 280 }, "snapshot": { "$ref": "#/components/schemas/BotOpenWorkSnapshot" } }, "required": [ "ok", "code", "error" ] } ] }, "BotOpenWorkEvidence": { "type": "object", "additionalProperties": false, "properties": { "itemId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "kind": { "type": "string", "enum": [ "source", "result" ] }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "title": { "type": "string", "minLength": 1, "maxLength": 160, "description": "At most160 Unicode scalars and640 UTF-8 bytes; well-formed Unicode." }, "text": { "type": "string", "maxLength": 32768, "description": "At most32768 UTF-8 bytes; truncated explicitly identifies an excerpt." }, "truncated": { "type": "boolean" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "itemId", "kind", "submissionId", "entryId", "title", "text", "truncated" ] }, "BotConnectorWatch": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "botId": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-utf16-max": 160 }, "revision": { "type": "string", "pattern": "^[0-9]{1,32}$" }, "name": { "type": "string", "minLength": 1, "maxLength": 120, "x-aiden-utf16-max": 120 }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "x-aiden-utf16-max": 32768 }, "templateId": { "enum": [ "mail_messages", "calendar_upcoming" ] }, "condition": { "$ref": "#/components/schemas/BotConnectorWatchCondition" }, "everyMinutes": { "enum": [ 15, 30, 60 ] }, "source": { "$ref": "#/components/schemas/BotConnectorWatchSource" }, "enabled": { "type": "boolean" }, "state": { "enum": [ "waiting", "empty", "unchanged", "changed", "error", "paused" ] }, "lastCheckAt": { "type": "integer", "minimum": 0 }, "nextCheckAt": { "type": "integer", "minimum": 0 }, "lastRunAt": { "type": "integer", "minimum": 0 }, "lastError": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 } }, "required": [ "id", "botId", "revision", "name", "prompt", "templateId", "condition", "everyMinutes", "source", "enabled", "state" ] }, "BotConnectorWatchList": { "type": "object", "additionalProperties": false, "properties": { "supported": { "type": "boolean" }, "unavailableReason": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 }, "templates": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "id": { "enum": [ "mail_messages", "calendar_upcoming" ] }, "kind": { "enum": [ "email", "calendar" ] }, "title": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "description": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "available": { "type": "boolean" }, "unavailableReason": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 }, "intervals": { "type": "array", "items": { "enum": [ 15, 30, 60 ] }, "maxItems": 3 } }, "required": [ "id", "kind", "title", "description", "available", "intervals" ] }, "maxItems": 2 }, "watches": { "type": "array", "items": { "$ref": "#/components/schemas/BotConnectorWatch" }, "maxItems": 16 } }, "required": [ "supported", "templates", "watches" ] }, "BotConnectorWatchSourceList": { "type": "object", "additionalProperties": false, "properties": { "choices": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "templateId": { "enum": [ "mail_messages", "calendar_upcoming" ] }, "providerLabel": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "accountLabel": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "resourceLabel": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "available": { "type": "boolean" }, "unavailableReason": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 } }, "required": [ "id", "templateId", "providerLabel", "accountLabel", "resourceLabel", "available" ] }, "maxItems": 500 }, "unavailableReasons": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200, "x-aiden-utf16-max": 200 }, "maxItems": 16 } }, "required": [ "choices", "unavailableReasons" ] }, "BotConnectorWatchTestResult": { "type": "object", "additionalProperties": false, "properties": { "checkedAt": { "type": "integer", "minimum": 0 }, "result": { "enum": [ "baseline", "empty", "unchanged", "changed" ] }, "itemCount": { "type": "integer", "minimum": 0, "maximum": 250 }, "changeCount": { "type": "integer", "minimum": 0, "maximum": 250 }, "preview": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 500, "x-aiden-utf16-max": 500 }, "maxItems": 8 } }, "required": [ "checkedAt", "result", "itemCount", "changeCount", "preview" ] }, "BotConnectorWatchRemoval": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "revision": { "type": "string", "pattern": "^deleted:[0-9]{1,32}$" }, "removed": { "type": "boolean" } }, "required": [ "id", "revision", "removed" ] }, "BotConnectorWatchRunResult": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "revision": { "type": "string", "pattern": "^[0-9]{1,32}$" }, "admitted": { "type": "boolean" } }, "required": [ "id", "revision", "admitted" ] }, "BotConnectorWatchCreateRequest": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120, "x-aiden-utf16-max": 120 }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "x-aiden-utf16-max": 32768 }, "condition": { "$ref": "#/components/schemas/BotConnectorWatchCondition" }, "everyMinutes": { "enum": [ 15, 30, 60 ] }, "sourceChoiceId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "mutationId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 } }, "required": [ "name", "prompt", "condition", "everyMinutes", "sourceChoiceId", "mutationId" ] }, "BotConnectorWatchUpdateRequest": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120, "x-aiden-utf16-max": 120 }, "prompt": { "type": "string", "minLength": 1, "maxLength": 32768, "x-aiden-utf16-max": 32768 }, "condition": { "$ref": "#/components/schemas/BotConnectorWatchCondition" }, "everyMinutes": { "enum": [ 15, 30, 60 ] }, "sourceChoiceId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "mutationId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[0-9]{1,32}$" } }, "required": [ "name", "prompt", "condition", "everyMinutes", "mutationId", "expectedRevision" ] }, "BotConnectorWatchIdentityRequest": { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[0-9]{1,32}$" } }, "required": [ "mutationId", "expectedRevision" ] }, "BotConnectorWatchEnableRequest": { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[0-9]{1,32}$" }, "enabled": { "type": "boolean" } }, "required": [ "mutationId", "expectedRevision", "enabled" ] }, "BotConnectorWatchTestRequest": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[0-9]{1,32}$" } }, "required": [ "id", "expectedRevision" ] }, { "type": "object", "additionalProperties": false, "properties": { "sourceChoiceId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-fA-F-]{36}$", "maxLength": 36 }, "condition": { "$ref": "#/components/schemas/BotConnectorWatchCondition" } }, "required": [ "sourceChoiceId", "condition" ] } ] }, "BotRoutineModelChoice": { "type": "object", "additionalProperties": false, "properties": { "providerId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "modelId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "thinkingLevel": { "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh", "max" ] } }, "required": [ "providerId", "modelId", "thinkingLevel" ] }, "BotRoutineModelSelection": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "mode": { "const": "inherit" } }, "required": [ "mode" ] }, { "type": "object", "additionalProperties": false, "properties": { "mode": { "const": "selected" }, "primary": { "$ref": "#/components/schemas/BotRoutineModelChoice" }, "fallback": { "$ref": "#/components/schemas/BotRoutineModelChoice" } }, "required": [ "mode", "primary" ] } ] }, "BotRoutineModelSettings": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "routineId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "selection": { "$ref": "#/components/schemas/BotRoutineModelSelection" }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastMutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 } }, "required": [ "botId", "routineId", "revision", "selection", "updatedAt" ] }, "BotRoutineModelSave": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "routineId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "catalogRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "selection": { "$ref": "#/components/schemas/BotRoutineModelSelection" } }, "required": [ "botId", "routineId", "mutationId", "expectedRevision", "catalogRevision", "selection" ] }, "BotRoutineModelOption": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "label": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "available": { "type": "boolean" }, "supportsImages": { "type": "boolean" }, "thinkingLevels": { "type": "array", "maxItems": 7, "uniqueItems": true, "items": { "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh", "max" ] } } }, "required": [ "id", "label", "available", "supportsImages", "thinkingLevels" ] }, "BotRoutineModelProvider": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "label": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "available": { "type": "boolean" }, "models": { "type": "array", "maxItems": 512, "items": { "$ref": "#/components/schemas/BotRoutineModelOption" } } }, "required": [ "id", "label", "available", "models" ] }, "BotRoutineModelCatalog": { "type": "object", "additionalProperties": false, "properties": { "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "providers": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/BotRoutineModelProvider" } } }, "required": [ "revision", "providers" ] }, "BotRoutineRunModel": { "type": "object", "additionalProperties": false, "properties": { "chosen": { "$ref": "#/components/schemas/BotRoutineModelChoice" }, "actual": { "$ref": "#/components/schemas/BotRoutineModelChoice" }, "providerLabel": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "modelLabel": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "chosenProviderLabel": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "chosenModelLabel": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "fallbackReason": { "enum": [ "model_unavailable", "credentials_unavailable" ] } }, "required": [ "chosen", "actual", "providerLabel", "modelLabel", "chosenProviderLabel", "chosenModelLabel" ] }, "BotRoutineModelRun": { "type": "object", "additionalProperties": false, "properties": { "runId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "admittedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "startedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "scheduledFor": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "timezone": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "triggerKind": { "enum": [ "scheduled", "manual", "event", "retry", "catch_up" ] }, "model": { "$ref": "#/components/schemas/BotRoutineRunModel" } }, "required": [ "runId", "admittedAt", "triggerKind", "model" ], "allOf": [ { "if": { "required": [ "scheduledFor" ] }, "then": { "required": [ "timezone" ] } } ] }, "BotRoutineModelRuns": { "type": "array", "maxItems": 64, "items": { "$ref": "#/components/schemas/BotRoutineModelRun" } }, "BotRoutineModelResult": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": true }, "settings": { "$ref": "#/components/schemas/BotRoutineModelSettings" }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$", "minLength": 36, "maxLength": 36 }, "replayed": { "type": "boolean" } }, "required": [ "ok", "settings", "mutationId", "replayed" ] }, { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": false }, "code": { "enum": [ "conflict", "invalid", "unavailable", "not_found", "history_full" ] }, "error": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "settings": { "$ref": "#/components/schemas/BotRoutineModelSettings" } }, "required": [ "ok", "code", "error" ] } ] }, "BotExecutionResumeStatus": { "type": "object", "additionalProperties": false, "required": [ "requiresUnknownCostAcknowledgement" ], "properties": { "requiresUnknownCostAcknowledgement": { "type": "boolean" }, "interruptedSubmissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "minLength": 1, "maxLength": 32 }, "costReceiptId": { "type": "string", "pattern": "^cost_[a-f0-9]{64}$", "minLength": 69, "maxLength": 69 } }, "allOf": [ { "if": { "properties": { "requiresUnknownCostAcknowledgement": { "const": true } }, "required": [ "requiresUnknownCostAcknowledgement" ] }, "then": { "required": [ "interruptedSubmissionId", "costReceiptId" ] }, "else": { "not": { "required": [ "costReceiptId" ] } } } ] }, "BotResumeRequest": { "oneOf": [ { "type": "object", "additionalProperties": false, "maxProperties": 0 }, { "type": "object", "additionalProperties": false, "required": [ "acknowledgeUnknownCost", "expectedSubmissionId", "expectedCostReceiptId" ], "properties": { "acknowledgeUnknownCost": { "const": true }, "expectedSubmissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "minLength": 1, "maxLength": 32 }, "expectedCostReceiptId": { "type": "string", "pattern": "^cost_[a-f0-9]{64}$", "minLength": 69, "maxLength": 69 } } } ], "description": "Confirmed unknown-cost Resume requires bot:routine-models, the exact interrupted input and opaque cost receipt returned by status. Ordinary Resume keeps an empty body. A stale token cannot acknowledge a later receipt, including on the same input." }, "BotRoutineModelDirectory": { "type": "object", "additionalProperties": false, "required": [ "botId", "routines" ], "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "routines": { "type": "array", "maxItems": 1024, "items": { "type": "object", "additionalProperties": false, "required": [ "id", "name", "kind" ], "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "name": { "type": "string", "minLength": 1, "maxLength": 160, "x-aiden-max-utf8-bytes": 640 }, "kind": { "enum": [ "scheduled", "event", "watch" ] } } } } } }, "BotPeerIdentity": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "name": { "type": "string", "minLength": 1, "maxLength": 160 } }, "required": [ "botId", "name" ] }, "BotPeerPair": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "peer": { "$ref": "#/components/schemas/BotPeerIdentity" }, "approvedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "revision", "peer", "approvedAt" ] }, "BotPeerSettings": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "routingDescription": { "type": "string", "minLength": 0, "maxLength": 1000 }, "pairs": { "type": "array", "maxItems": 128, "items": { "$ref": "#/components/schemas/BotPeerPair" } }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastMutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" } }, "required": [ "botId", "revision", "routingDescription", "pairs", "updatedAt" ] }, "BotPeerCatalog": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "bots": { "type": "array", "maxItems": 128, "items": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "name": { "type": "string", "minLength": 1, "maxLength": 160 }, "available": { "type": "boolean" } }, "required": [ "botId", "name", "available" ] } } }, "required": [ "botId", "revision", "bots" ] }, "BotPeerMutation": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "const": "describe" }, "routingDescription": { "type": "string", "minLength": 0, "maxLength": 1000 } }, "required": [ "botId", "mutationId", "expectedRevision", "action", "routingDescription" ] }, { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "const": "approve" }, "catalogRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "peerBotId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "botId", "mutationId", "expectedRevision", "action", "catalogRevision", "peerBotId" ] }, { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "action": { "const": "revoke" }, "pairId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "pairRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "botId", "mutationId", "expectedRevision", "action", "pairId", "pairRevision" ] } ] }, "BotPeerMutationResult": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": true }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "replayed": { "type": "boolean" }, "snapshot": { "$ref": "#/components/schemas/BotPeerSettings" } }, "required": [ "ok", "mutationId", "replayed", "snapshot" ] }, { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": false }, "code": { "enum": [ "invalid", "conflict", "unavailable", "history_full", "access_changed", "not_found" ] }, "error": { "type": "string", "minLength": 1, "maxLength": 1000 }, "snapshot": { "$ref": "#/components/schemas/BotPeerSettings" } }, "required": [ "ok", "code", "error" ] } ] }, "BotPeerStopReceipt": { "type": "object", "additionalProperties": false, "properties": { "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "state": { "enum": [ "requested", "uncertain", "stopped", "not_running", "blocked" ] }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "reason": { "enum": [ "mixed_inputs", "host_unavailable", "stale_source" ] } }, "required": [ "mutationId", "state", "at" ] }, "BotPeerExchangeSummary": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "pairId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "sender": { "$ref": "#/components/schemas/BotPeerIdentity" }, "recipient": { "$ref": "#/components/schemas/BotPeerIdentity" }, "direction": { "enum": [ "sent", "received" ] }, "kind": { "enum": [ "request", "question", "status", "fyi" ] }, "title": { "type": "string", "minLength": 1, "maxLength": 160 }, "state": { "enum": [ "waiting", "queued", "running", "interrupted", "stopping", "completed", "failed", "cancelled", "expired", "uncertain" ] }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "canStop": { "type": "boolean" }, "returnState": { "enum": [ "reserved", "waiting", "queued", "delivered", "not_applicable" ] }, "parentExchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "rootExchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "blockedReason": { "type": "string", "minLength": 1, "maxLength": 1000 }, "lastStop": { "$ref": "#/components/schemas/BotPeerStopReceipt" } }, "required": [ "id", "revision", "pairId", "sender", "recipient", "direction", "kind", "title", "state", "createdAt", "updatedAt", "expiresAt", "canStop", "returnState" ] }, "BotPeerExchangeDetail": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "pairId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "sender": { "$ref": "#/components/schemas/BotPeerIdentity" }, "recipient": { "$ref": "#/components/schemas/BotPeerIdentity" }, "direction": { "enum": [ "sent", "received" ] }, "kind": { "enum": [ "request", "question", "status", "fyi" ] }, "title": { "type": "string", "minLength": 1, "maxLength": 160 }, "state": { "enum": [ "waiting", "queued", "running", "interrupted", "stopping", "completed", "failed", "cancelled", "expired", "uncertain" ] }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "expiresAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "canStop": { "type": "boolean" }, "returnState": { "enum": [ "reserved", "waiting", "queued", "delivered", "not_applicable" ] }, "parentExchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "rootExchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "blockedReason": { "type": "string", "minLength": 1, "maxLength": 1000 }, "lastStop": { "$ref": "#/components/schemas/BotPeerStopReceipt" }, "request": { "type": "object", "additionalProperties": false, "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 8192 } }, "required": [ "text" ] }, "result": { "type": "object", "additionalProperties": false, "properties": { "outcome": { "enum": [ "completed", "failed", "cancelled", "expired" ] }, "text": { "type": "string", "minLength": 0, "maxLength": 16384 }, "truncated": { "type": "boolean" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "outcome", "text", "truncated", "createdAt" ] } }, "required": [ "id", "revision", "pairId", "sender", "recipient", "direction", "kind", "title", "state", "createdAt", "updatedAt", "expiresAt", "canStop", "returnState", "request" ] }, "BotPeerExchangeList": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "revision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "exchanges": { "type": "array", "maxItems": 128, "items": { "$ref": "#/components/schemas/BotPeerExchangeSummary" } } }, "required": [ "botId", "revision", "exchanges" ] }, "BotPeerStopMutation": { "type": "object", "additionalProperties": false, "properties": { "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "expectedRevision": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "exchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 } }, "required": [ "botId", "mutationId", "expectedRevision", "exchangeId" ] }, "BotPeerStopResult": { "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": true }, "mutationId": { "type": "string", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-8][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" }, "replayed": { "type": "boolean" }, "exchange": { "$ref": "#/components/schemas/BotPeerExchangeDetail" } }, "required": [ "ok", "mutationId", "replayed", "exchange" ] }, { "type": "object", "additionalProperties": false, "properties": { "ok": { "const": false }, "code": { "enum": [ "invalid", "conflict", "unavailable", "history_full", "access_changed", "not_found" ] }, "error": { "type": "string", "minLength": 1, "maxLength": 1000 }, "exchange": { "$ref": "#/components/schemas/BotPeerExchangeDetail" } }, "required": [ "ok", "code", "error" ] } ] }, "BotPeerEvidence": { "type": "object", "additionalProperties": false, "properties": { "exchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "kind": { "enum": [ "source", "result" ] }, "botId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "submissionId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "entryId": { "type": "string", "pattern": "^[1-9][0-9]{0,31}$", "maxLength": 32 }, "title": { "type": "string", "minLength": 1, "maxLength": 160 }, "text": { "type": "string", "minLength": 0, "maxLength": 32768 }, "truncated": { "type": "boolean" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "exchangeId", "kind", "botId", "submissionId", "entryId", "title", "text", "truncated" ] }, "BotPeerSessionEntry": { "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128 }, "type": { "const": "peer" }, "exchangeId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "direction": { "enum": [ "sent", "received" ] }, "peerBotId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,160}$", "minLength": 1, "maxLength": 160 }, "peerName": { "type": "string", "minLength": 1, "maxLength": 160 }, "messageKind": { "enum": [ "request", "question", "status", "fyi", "result" ] }, "createdAt": { "type": "string", "format": "date-time" }, "final": { "const": true } }, "required": [ "id", "type", "exchangeId", "direction", "peerBotId", "peerName", "messageKind" ], "allOf": [ { "if": { "required": [ "final" ] }, "then": { "properties": { "messageKind": { "const": "result" } } } } ] }, "BotAllowedEntry": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[A-Za-z0-9_-]+$" }, "kind": { "const": "rule" }, "what": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" }, "addedAt": { "type": "string", "format": "date-time" }, "uses": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastUsedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "kind", "what", "addedAt", "uses" ], "additionalProperties": false, "allOf": [ { "if": { "properties": { "uses": { "const": 0 } } }, "then": { "not": { "required": [ "lastUsedAt" ] } } } ] }, { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^[A-Za-z0-9_-]+$" }, "kind": { "const": "folder" }, "what": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" }, "addedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "kind", "what", "addedAt" ], "additionalProperties": false } ] }, "BotAllowedList": { "type": "object", "properties": { "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "entries": { "type": "array", "maxItems": 50, "uniqueItems": true, "items": { "$ref": "#/components/schemas/BotAllowedEntry" } }, "nextCursor": { "type": "string", "pattern": "^cur_[A-Za-z0-9_-]{43}$" } }, "required": [ "botId", "entries" ], "additionalProperties": false }, "BotMessagingSettings": { "type": "object", "required": [ "enabled" ], "properties": { "enabled": { "type": "boolean" } }, "additionalProperties": false }, "BotMessaging": { "type": "object", "required": [ "receive", "send" ], "properties": { "receive": { "type": "boolean" }, "send": { "type": "boolean" } }, "additionalProperties": false }, "BotMessagingPatch": { "type": "object", "minProperties": 1, "properties": { "receive": { "type": "boolean" }, "send": { "type": "boolean" } }, "additionalProperties": false }, "BotPlan": { "type": "object", "required": [ "planId", "status", "title", "why", "steps", "items" ], "properties": { "planId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" }, "status": { "enum": [ "pending", "active", "finished", "stopped", "expired" ] }, "title": { "type": "string", "minLength": 1, "maxLength": 80, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" }, "why": { "type": "string", "minLength": 1, "maxLength": 300, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" }, "steps": { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "object", "required": [ "text", "status" ], "properties": { "text": { "type": "string", "minLength": 1, "maxLength": 200, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" }, "status": { "enum": [ "pending", "done", "skipped" ] } }, "additionalProperties": false } }, "items": { "type": "array", "minItems": 1, "maxItems": 8, "items": { "type": "object", "required": [ "line", "details" ], "properties": { "line": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" }, "details": { "type": "array", "maxItems": 6, "items": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" } }, "used": { "type": "integer", "minimum": 0, "maximum": 25 }, "max": { "type": "integer", "minimum": 1, "maximum": 25 } }, "additionalProperties": false, "dependentRequired": { "used": [ "max" ], "max": [ "used" ] }, "allOf": [ { "if": { "properties": { "max": { "const": 1 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 1 } } } }, { "if": { "properties": { "max": { "const": 2 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 2 } } } }, { "if": { "properties": { "max": { "const": 3 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 3 } } } }, { "if": { "properties": { "max": { "const": 4 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 4 } } } }, { "if": { "properties": { "max": { "const": 5 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 5 } } } }, { "if": { "properties": { "max": { "const": 6 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 6 } } } }, { "if": { "properties": { "max": { "const": 7 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 7 } } } }, { "if": { "properties": { "max": { "const": 8 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 8 } } } }, { "if": { "properties": { "max": { "const": 9 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 9 } } } }, { "if": { "properties": { "max": { "const": 10 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 10 } } } }, { "if": { "properties": { "max": { "const": 11 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 11 } } } }, { "if": { "properties": { "max": { "const": 12 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 12 } } } }, { "if": { "properties": { "max": { "const": 13 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 13 } } } }, { "if": { "properties": { "max": { "const": 14 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 14 } } } }, { "if": { "properties": { "max": { "const": 15 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 15 } } } }, { "if": { "properties": { "max": { "const": 16 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 16 } } } }, { "if": { "properties": { "max": { "const": 17 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 17 } } } }, { "if": { "properties": { "max": { "const": 18 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 18 } } } }, { "if": { "properties": { "max": { "const": 19 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 19 } } } }, { "if": { "properties": { "max": { "const": 20 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 20 } } } }, { "if": { "properties": { "max": { "const": 21 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 21 } } } }, { "if": { "properties": { "max": { "const": 22 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 22 } } } }, { "if": { "properties": { "max": { "const": 23 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 23 } } } }, { "if": { "properties": { "max": { "const": 24 } }, "required": [ "max" ] }, "then": { "properties": { "used": { "maximum": 24 } } } } ] } }, "expiresAt": { "type": "string", "format": "date-time" }, "from": { "type": "string", "minLength": 1, "maxLength": 120, "pattern": "^(?!\\s*$)[^\\u0000-\\u0008\\u000e-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u180e\\u200b\\u200e\\u200f\\u2028\\u2029\\u202a-\\u202e\\u2060-\\u2064\\u2066-\\u206f\\ufeff\\ufff9-\\ufffb]+$" } }, "additionalProperties": false, "description": "Revision 56, bot:plans holders only. Display-only plan with bounded text. Bot-written text is redacted; host-formatted file items disclose the enforced folder location, access mode and temporary-grant lifetime. No Bot/item IDs, authorization, runtime request identities, raw proposal, binding, model tool names or revision. Counted items carry both used and max, with used <= max." }, "BotPlanRespondRequest": { "type": "object", "required": [ "decision" ], "properties": { "decision": { "enum": [ "approve", "not_now", "stop" ] } }, "additionalProperties": false }, "BotPlanRespondReceipt": { "type": "object", "required": [ "planId", "status" ], "properties": { "planId": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" }, "status": { "enum": [ "active", "finished", "stopped", "expired" ] } }, "additionalProperties": false }, "BotAccessRequest": { "type": "object", "additionalProperties": false, "required": [ "waitId", "target", "label", "why", "choices" ], "properties": { "waitId": { "type": "string", "pattern": "^[A-Za-z0-9-]{1,64}$" }, "target": { "type": "string", "enum": [ "folder", "whole_mac" ] }, "label": { "type": "string", "minLength": 1, "maxLength": 120, "allOf": [ { "pattern": "\\S" }, { "not": { "pattern": "[\\u0000-\\u001f\\u007f-\\u009f]" } } ] }, "place": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(~/|/)" }, "why": { "type": "string", "minLength": 1, "maxLength": 400, "allOf": [ { "pattern": "\\S" }, { "not": { "pattern": "[\\u0000-\\u001f\\u007f-\\u009f]" } } ] }, "choices": { "type": "array", "minItems": 2, "maxItems": 3, "uniqueItems": true, "items": { "type": "string", "enum": [ "not_now", "always", "once" ] }, "enum": [ [ "not_now", "once" ], [ "not_now", "always", "once" ] ] }, "approvalCount": { "type": "integer", "minimum": 3, "maximum": 20, "description": "Revision 57. Only bot:allowed plus bot:access-requests holders, for a folder offering Always." } }, "description": "Revision 55, bot:access-requests holders only. Public display card; no authorization, root identity, tool call or logical request id. Exact choices in order are [not_now, once] or, for a persistable folder, [not_now, always, once]. Whole Mac has label 'your whole Mac' and no place or always. Nonblank text, no control characters. place is a bounded display path, never an API identifier.", "allOf": [ { "if": { "properties": { "target": { "const": "whole_mac" } } }, "then": { "properties": { "label": { "const": "your whole Mac" }, "choices": { "const": [ "not_now", "once" ] } }, "not": { "required": [ "place" ] } } }, { "if": { "required": [ "approvalCount" ] }, "then": { "properties": { "target": { "const": "folder" }, "choices": { "const": [ "not_now", "always", "once" ] } } } } ] }, "BotAccessAnswerRequest": { "type": "object", "additionalProperties": false, "required": [ "choice" ], "properties": { "choice": { "type": "string", "enum": [ "once", "always", "not_now" ] } } }, "BotAccessAnswerReceipt": { "type": "object", "additionalProperties": false, "required": [ "answered" ], "properties": { "answered": { "type": "boolean", "const": true }, "savedForFuture": { "type": "boolean", "const": true, "description": "Records the exact earlier durable folder approval, including a replay after removal. It does not confirm current saved access or issue temporary run access." } } }, "BotSessionEntriesPage": { "type": "object", "description": "Revision 67: one page of a Bot session's older entries.", "required": [ "botId", "epoch", "entries", "hasOlder" ], "properties": { "botId": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9._:-]+$" }, "epoch": { "type": "string", "minLength": 1, "maxLength": 128, "description": "The session the page belongs to. A page from another epoch does not join the transcript the device holds." }, "entries": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/BotSessionEntry" } }, "hasOlder": { "type": "boolean" } }, "additionalProperties": false }, "BotQueuedWithdrawReceipt": { "type": "object", "description": "Revision 67: what became of a queued message.", "required": [ "submissionId", "outcome" ], "properties": { "submissionId": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,64}$" }, "outcome": { "enum": [ "withdrawn", "started", "gone" ] } }, "additionalProperties": false } } } }