{
  "openapi": "3.1.0",
  "info": {
    "title": "Burrow API",
    "version": "2026.08.25",
    "description": "Initial contract for the stable Burrow REST surface. This is a contract layer over the existing implementation; streaming and provider-specific event protocols remain documented separately. Model discovery can enrich provider/model ID matches from a cached models.dev catalog; Azure training-date suffixes are removed before exact model lookup. Provider metadata and manual overrides take precedence; catalog failure preserves unknown/existing metadata. Enriched model objects may expose capabilityProvenance {source, snapshotAt, matchedProvider, matchedModel}, discoveredContextWindow, optional contextWindowOverride, and effective contextWindow. No provider credentials or private deployment data are sent to models.dev."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:42817",
      "description": "Local development server"
    }
  ],
  "tags": [
    {
      "name": "Workspace"
    },
    {
      "name": "Work items"
    },
    {
      "name": "Scheduled jobs"
    },
    {
      "name": "Group channels"
    },
    {
      "name": "Traces"
    },
    {
      "name": "Task board"
    },
    {
      "name": "Export",
      "description": "User-selected export bundles."
    },
    {
      "name": "Archive",
      "description": "Operator-readable runtime proof packets."
    },
    {
      "name": "Mods",
      "description": "Installed Burrow mods and their validated host contributions."
    },
    {
      "name": "Setup",
      "description": "Persistent installation setup lifecycle."
    },
    {
      "name": "Forge",
      "description": "Explicit operator media generation, without agent brain or profile context."
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Public runtime health",
        "operationId": "getHealth",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/HealthResponse"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Authenticated runtime health",
        "operationId": "getApiHealth",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/HealthResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Runtime status",
        "operationId": "getStatus",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/HealthResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/metrics": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Bounded operational metrics",
        "operationId": "getMetrics",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/inventory": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Safe diagnostics inventory counts",
        "operationId": "getDiagnosticsInventory",
        "description": "Returns only configured MCP and installed/enabled mod counts. It exposes no connection details, mod metadata, settings, paths, or secrets and accepts diagnostics:read API tokens.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/DiagnosticsInventoryResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agents": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "List registered agents",
        "operationId": "listAgents",
        "parameters": [
          {
            "$ref": "#/components/parameters/IncludeDisabled"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/AgentListResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Create a registered agent",
        "operationId": "createAgent",
        "requestBody": {
          "$ref": "#/components/requestBodies/AgentCreate"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/AgentResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agents/{agentId}": {
      "patch": {
        "tags": [
          "Agents"
        ],
        "summary": "Update a registered agent",
        "operationId": "updateAgent",
        "requestBody": {
          "$ref": "#/components/requestBodies/AgentPatch"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/AgentResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      },
      "delete": {
        "tags": [
          "Agents"
        ],
        "summary": "Delete a registered agent",
        "operationId": "deleteAgent",
        "responses": {
          "200": {
            "$ref": "#/components/responses/AgentResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      }
    },
    "/api/chat": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Run one chat turn",
        "operationId": "runChat",
        "description": "May return a normal JSON response or an NDJSON stream depending on request headers and runtime behavior. The streaming event contract is intentionally separate from this REST document.",
        "requestBody": {
          "$ref": "#/components/requestBodies/ChatRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ChatResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/chat/runs/active": {
      "get": {
        "tags": [
          "Chat"
        ],
        "summary": "List active chat runs",
        "operationId": "listActiveChatRuns",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ActiveChatRunsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/chat/{runId}/cancel": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Cancel a chat run",
        "operationId": "cancelChatRun",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathRunId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "List sessions for incremental export discovery",
        "operationId": "listSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/Archived"
          },
          {
            "$ref": "#/components/parameters/SearchQuery"
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SessionListResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Read one session",
        "operationId": "getSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSessionId"
          },
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SessionDetailResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/reset": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Reset a session",
        "operationId": "resetSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSessionId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/traces": {
      "get": {
        "tags": [
          "Traces"
        ],
        "summary": "List traces",
        "operationId": "listTraces",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TraceListResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/traces/{runId}": {
      "get": {
        "tags": [
          "Traces"
        ],
        "summary": "Read a trace",
        "operationId": "getTrace",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathRunId"
          },
          {
            "$ref": "#/components/parameters/Output"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TraceResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/task-board/statuses": {
      "get": {
        "tags": [
          "Task board"
        ],
        "summary": "List task statuses",
        "operationId": "listTaskStatuses",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          }
        }
      }
    },
    "/api/task-board/priorities": {
      "get": {
        "tags": [
          "Task board"
        ],
        "summary": "List task priorities",
        "operationId": "listTaskPriorities",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          }
        }
      }
    },
    "/api/task-board/projects": {
      "get": {
        "tags": [
          "Task board"
        ],
        "summary": "List projects",
        "operationId": "listProjects",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProjectListResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Task board"
        ],
        "summary": "Create a project",
        "operationId": "createProject",
        "requestBody": {
          "$ref": "#/components/requestBodies/ProjectCreate"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ProjectResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/task-board/tasks": {
      "get": {
        "tags": [
          "Task board"
        ],
        "summary": "List tasks",
        "operationId": "listTasks",
        "parameters": [
          {
            "$ref": "#/components/parameters/ProjectId"
          },
          {
            "$ref": "#/components/parameters/TaskStatus"
          },
          {
            "$ref": "#/components/parameters/TaskPriority"
          },
          {
            "$ref": "#/components/parameters/AssignedAgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TaskListResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Task board"
        ],
        "summary": "Create a task",
        "operationId": "createTask",
        "requestBody": {
          "$ref": "#/components/requestBodies/TaskCreate"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/TaskResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/workspace/files": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "summary": "List workspace files",
        "operationId": "listWorkspaceFiles",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/Scope"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkspaceFilesResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/workspace/file": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "summary": "Read a workspace file",
        "operationId": "readWorkspaceFile",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/Scope"
          },
          {
            "$ref": "#/components/parameters/Path"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkspaceFileResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Workspace"
        ],
        "summary": "Write a workspace file",
        "operationId": "writeWorkspaceFile",
        "requestBody": {
          "$ref": "#/components/requestBodies/WorkspaceFileWrite"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkspaceFileResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/session/continuity-scope": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Read continuity scope",
        "operationId": "getContinuityScope",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Sessions"
        ],
        "summary": "Set continuity scope",
        "operationId": "setContinuityScope",
        "requestBody": {
          "$ref": "#/components/requestBodies/ContinuityScopeWrite"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "delete": {
        "tags": [
          "Sessions"
        ],
        "summary": "Clear continuity scope",
        "operationId": "clearContinuityScope",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/session/handoff": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Read session handoff",
        "operationId": "readSessionHandoff",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Write session handoff",
        "operationId": "writeSessionHandoff",
        "requestBody": {
          "$ref": "#/components/requestBodies/SessionHandoffWrite"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/session/handoff-candidate": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Write a handoff candidate",
        "operationId": "writeSessionHandoffCandidate",
        "requestBody": {
          "$ref": "#/components/requestBodies/SessionHandoffWrite"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tasks": {
      "get": {
        "tags": [
          "Work items"
        ],
        "summary": "List work items",
        "operationId": "listWorkItems",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkItemListResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Work items"
        ],
        "summary": "Create a work item",
        "operationId": "createWorkItem",
        "requestBody": {
          "$ref": "#/components/requestBodies/WorkItemCreate"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkItemResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tasks/{id}": {
      "get": {
        "tags": [
          "Work items"
        ],
        "summary": "Read a work item",
        "operationId": "getWorkItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          },
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkItemResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tasks/{id}/step": {
      "post": {
        "tags": [
          "Work items"
        ],
        "summary": "Run one work-item step",
        "operationId": "runWorkItemStep",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tasks/{id}/continue": {
      "post": {
        "tags": [
          "Work items"
        ],
        "summary": "Continue a work item",
        "operationId": "continueWorkItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tasks/{id}/archive": {
      "post": {
        "tags": [
          "Work items"
        ],
        "summary": "Archive a work item",
        "operationId": "archiveWorkItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/workbench": {
      "post": {
        "tags": [
          "Work items"
        ],
        "summary": "Plan a workbench turn",
        "operationId": "planWorkbenchTurn",
        "requestBody": {
          "$ref": "#/components/requestBodies/WorkbenchRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/workbench/run": {
      "post": {
        "tags": [
          "Work items"
        ],
        "summary": "Run a workbench step",
        "operationId": "runWorkbenchStep",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/scheduled-jobs": {
      "get": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "List scheduled jobs",
        "operationId": "listScheduledJobs",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/Enabled"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ScheduledJobListResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "Create a scheduled job",
        "operationId": "createScheduledJob",
        "requestBody": {
          "$ref": "#/components/requestBodies/ScheduledJobCreate"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/CreatedJsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/scheduled-jobs/{jobId}": {
      "get": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "Read a scheduled job",
        "operationId": "getScheduledJob",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathJobId"
          }
        ]
      },
      "patch": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "Update a scheduled job",
        "operationId": "updateScheduledJob",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathJobId"
          }
        ]
      },
      "delete": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "Delete a scheduled job",
        "operationId": "deleteScheduledJob",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathJobId"
          }
        ]
      }
    },
    "/api/scheduled-jobs/{jobId}/runs": {
      "get": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "List scheduled job runs",
        "operationId": "listScheduledJobRuns",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathJobId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/scheduled-jobs/{jobId}/trigger": {
      "post": {
        "tags": [
          "Scheduled jobs"
        ],
        "summary": "Trigger a scheduled job",
        "operationId": "triggerScheduledJob",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathJobId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/AcceptedJsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/group-channels": {
      "get": {
        "tags": [
          "Group channels"
        ],
        "summary": "List group channels",
        "operationId": "listGroupChannels",
        "responses": {
          "200": {
            "$ref": "#/components/responses/GroupChannelListResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Group channels"
        ],
        "summary": "Create a group channel",
        "operationId": "createGroupChannel",
        "requestBody": {
          "$ref": "#/components/requestBodies/GroupChannelCreate"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/CreatedJsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/group-channels/{channelId}": {
      "get": {
        "tags": [
          "Group channels"
        ],
        "summary": "Read a group channel",
        "operationId": "getGroupChannel",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathChannelId"
          }
        ]
      }
    },
    "/api/group-channels/{channelId}/messages": {
      "post": {
        "tags": [
          "Group channels"
        ],
        "summary": "Post a group-channel message",
        "operationId": "postGroupChannelMessage",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathChannelId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/GroupChannelMessage"
        },
        "responses": {
          "202": {
            "$ref": "#/components/responses/AcceptedJsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/group-channels/{channelId}/runs/{runId}/cancel": {
      "post": {
        "tags": [
          "Group channels"
        ],
        "summary": "Cancel a group-channel run",
        "operationId": "cancelGroupChannelRun",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathChannelId"
          },
          {
            "$ref": "#/components/parameters/PathRunId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agent-status": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "Read agent status",
        "operationId": "getAgentStatus",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/AgentStatusResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/sessions": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "List human-facing archived sessions and reset snapshots",
        "operationId": "listArchivedSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/Archived"
          },
          {
            "$ref": "#/components/parameters/Q"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "calendar day in the requested timezone of session archive/list display timestamp (archivedAt, then updatedAt, then createdAt).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from the previous page; keep the same filters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "description": "IANA timezone defining date/month boundaries. Browser sends its local timezone. DST automatic."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveSessionListResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/sessions/{agentId}/{sessionId}": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Read a human-facing archived session or reset snapshot",
        "operationId": "getArchivedSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathAgentId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (1\u2013200, default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Opaque cursor returned as nextCursor by the preceding page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive chat timestamp lower bound (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Inclusive chat timestamp upper bound (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveSessionResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "description": "Archive-only chat conversation reader. Newest page first; before selects older pages. Compacted generations are deduplicated by stable turn ID; reset snapshots remain separate. Missing retained generations and stale cursors return 409 rather than implying beginning of history."
      }
    },
    "/api/sessions/{sessionId}/rename": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Rename a session",
        "operationId": "renameSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/SessionRename"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/archive": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Archive a session",
        "operationId": "archiveSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/SessionArchive"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/unarchive": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Unarchive a session",
        "operationId": "unarchiveSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/fork": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Fork a session",
        "operationId": "forkSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/SessionFork"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/authority": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "List session authority explanations",
        "operationId": "listSessionAuthority",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/authority/latest": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Read latest session authority explanation",
        "operationId": "getLatestSessionAuthority",
        "parameters": [
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/PathSessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/session/context": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Inspect session context",
        "operationId": "getSessionContext",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ContextResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/context": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Inspect session context alias",
        "operationId": "getContext",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ContextResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/session/context-status": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Read context status",
        "operationId": "getContextStatus",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ContextStatusResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/session/search": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Search session entries",
        "operationId": "searchSession",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/Q"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/traces/{runId}/authority": {
      "get": {
        "tags": [
          "Traces"
        ],
        "summary": "Read trace authority",
        "operationId": "getTraceAuthority",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathRunId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TraceAuthorityResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/identities": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read settings",
        "operationId": "getIdentities",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Update settings",
        "operationId": "updateIdentities",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/curator": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read curator settings and runtime status",
        "operationId": "getCuratorSettings",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CuratorSettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Save curator selection",
        "operationId": "updateCuratorSettings",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/CuratorSelectionWrite"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CuratorSettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/ui-auth": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read settings",
        "operationId": "getUiAuthSettings",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Update settings",
        "operationId": "updateUiAuthSettings",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/execution-boundaries": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read settings",
        "operationId": "getExecutionBoundaries",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Update settings",
        "operationId": "updateExecutionBoundaries",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read settings",
        "operationId": "listModelConnections",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Update settings",
        "operationId": "saveModelConnection",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/mcp-connections": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "List MCP connections",
        "operationId": "listMcpConnections",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/McpConnectionListResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Create or update an MCP connection",
        "operationId": "saveMcpConnection",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/McpConnectionWrite"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/McpConnectionResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections/discover": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Discover models",
        "operationId": "discoverModels",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections/claude-cli-credential": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read Claude CLI credential status",
        "operationId": "getClaudeCliCredential",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections/import-claude-cli-credential": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Import Claude CLI credential",
        "operationId": "importClaudeCliCredential",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections/{id}": {
      "delete": {
        "tags": [
          "Settings"
        ],
        "summary": "Delete model connection",
        "operationId": "deleteModelConnection",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/mcp-connections/discover": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Discover MCP tools",
        "operationId": "discoverMcpTools",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/mcp-connections/{id}": {
      "delete": {
        "tags": [
          "Settings"
        ],
        "summary": "Delete MCP connection",
        "operationId": "deleteMcpConnection",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/retention": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Deprecated: read retention policy",
        "operationId": "getRetention",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "deprecated": true
      }
    },
    "/api/retention/cleanup": {
      "post": {
        "tags": [
          "Status"
        ],
        "summary": "Deprecated: run retention cleanup",
        "operationId": "runRetentionCleanup",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "deprecated": true
      }
    },
    "/api/memory/brain-promotion-candidates": {
      "get": {
        "tags": [
          "Memory"
        ],
        "summary": "List Brain promotion candidates",
        "operationId": "listBrainPromotionCandidates",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "patch": {
        "tags": [
          "Memory"
        ],
        "summary": "Update Brain promotion candidate",
        "operationId": "updateBrainPromotionCandidate",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/export/catalog": {
      "get": {
        "operationId": "getExportCatalog",
        "tags": [
          "Export"
        ],
        "responses": {
          "200": {
            "description": "Export catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            }
          }
        },
        "summary": "List export categories"
      }
    },
    "/api/export": {
      "post": {
        "operationId": "createExport",
        "tags": [
          "Export"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Downloadable export bundle",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "summary": "Create a selected export bundle"
      }
    },
    "/api/export/import/preview": {
      "post": {
        "tags": [
          "Export"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import preview/result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "operationId": "previewExportImport",
        "summary": "Preview an export import"
      }
    },
    "/api/export/import": {
      "post": {
        "tags": [
          "Export"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportImportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import preview/result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "operationId": "importExport",
        "summary": "Apply an export import"
      }
    },
    "/api/auth/session": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read auth session",
        "operationId": "getAuthSession",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/codex-lb/accounts": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "List Codex-LB accounts",
        "operationId": "listCodexLbAccounts",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/anthropic/oauth/usage": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read Anthropic OAuth usage",
        "operationId": "getAnthropicOauthUsage",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/openai/oauth/usage": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read OpenAI OAuth usage",
        "operationId": "getOpenaiOauthUsage",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agents/{agentId}/profile-documents": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read agent profile documents",
        "operationId": "getAgentProfileDocuments",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      },
      "put": {
        "tags": [
          "Status"
        ],
        "summary": "Replace agent profile documents",
        "operationId": "updateAgentProfileDocuments",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      }
    },
    "/api/agents/{agentId}/model-selection": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read agent model selection",
        "operationId": "getAgentModelSelection",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      },
      "put": {
        "tags": [
          "Status"
        ],
        "summary": "Update agent model selection",
        "operationId": "updateAgentModelSelection",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      }
    },
    "/api/agents/{agentId}/mcp-tools": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read agent MCP tools",
        "operationId": "getAgentMcpTools",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      },
      "put": {
        "tags": [
          "Status"
        ],
        "summary": "Update agent MCP tools",
        "operationId": "updateAgentMcpTools",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ]
      }
    },
    "/api/task-board/tasks/{id}/execute": {
      "post": {
        "tags": [
          "Status"
        ],
        "summary": "Execute task-board task",
        "operationId": "executeTaskBoardTask",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/openai-oauth/start": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Start OpenAI OAuth login",
        "operationId": "startOpenaiOauthLogin",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections/openai-oauth/{id}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read OpenAI OAuth login status",
        "operationId": "getOpenaiOauthLogin",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/openai-oauth/{id}/submit-code": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Submit OpenAI OAuth callback",
        "operationId": "submitOpenaiOauthCode",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/openai-oauth/{id}/cancel": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Cancel OpenAI OAuth login",
        "operationId": "cancelOpenaiOauthLogin",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/claude-code-login/start": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Start Claude Code OAuth login",
        "operationId": "startClaudeCodeLogin",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ClaudeCodeLoginStartResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/model-connections/claude-code-login/{id}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read Claude Code login status",
        "operationId": "getClaudeCodeLogin",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/claude-code-login/{id}/submit-code": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Submit Claude Code callback",
        "operationId": "submitClaudeCodeLoginCode",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/claude-code-login/{id}/cancel": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Cancel Claude Code login",
        "operationId": "cancelClaudeCodeLogin",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/settings/model-connections/claude-code-login/{id}/import": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Import Claude Code OAuth credential",
        "operationId": "importClaudeCodeLogin",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathId"
          }
        ]
      }
    },
    "/api/scheduled-jobs/{jobId}/runs/{runId}/cancel": {
      "post": {
        "tags": [
          "Status"
        ],
        "summary": "Cancel scheduled job run",
        "operationId": "cancelScheduledJobRun",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/PathJobId"
          },
          {
            "$ref": "#/components/parameters/PathRunId"
          }
        ]
      }
    },
    "/api/task-board/projects/{projectId}": {
      "patch": {
        "tags": [
          "Status"
        ],
        "summary": "Update task-board project",
        "operationId": "updateTaskBoardProject",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "Status"
        ],
        "summary": "Delete task-board project",
        "operationId": "deleteTaskBoardProject",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/task-board/tasks/{taskId}": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read task-board task",
        "operationId": "getTaskBoardTask",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Status"
        ],
        "summary": "Update task-board task",
        "operationId": "updateTaskBoardTask",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "Status"
        ],
        "summary": "Delete task-board task",
        "operationId": "deleteTaskBoardTask",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/settings/tiddle": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read Tiddle rolling-continuity status",
        "operationId": "getTiddleStatus",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "description": "Optional agent ID. When omitted, returns recent receipts across agents."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TiddleStatusResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tiddle/cards": {
      "get": {
        "tags": [
          "Tiddle"
        ],
        "summary": "List current Tiddle warm cards",
        "operationId": "listTiddleCards",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TiddleCardListResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/tiddle/history": {
      "get": {
        "tags": [
          "Tiddle"
        ],
        "summary": "Read append-only Tiddle Signal history",
        "operationId": "getTiddleHistory",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "cardId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TiddleHistoryResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/attachments": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "List attachment artifacts referenced by a session",
        "operationId": "listSessionAttachments",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "default"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/AttachmentListResponse"
          }
        }
      }
    },
    "/api/attachments/{agentId}/{artifactPath}": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "Read an attachment artifact",
        "operationId": "getAttachmentArtifact",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifactPath",
            "in": "path",
            "required": true,
            "description": "URL-encoded relative artifact path returned by the list endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment bytes"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "delete": {
        "tags": [
          "Attachments"
        ],
        "summary": "Delete an attachment artifact before retention expiry",
        "operationId": "deleteAttachmentArtifact",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifactPath",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/AttachmentDeleteResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/dreams": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "List archive-ready Dream cards",
        "operationId": "listArchiveDreams",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "calendar day in the requested timezone of dream creation (createdAt), not dream diary entryDate."
          },
          {
            "name": "phase",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from the previous page; keep the same filters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "description": "IANA timezone defining date/month boundaries. Browser sends its local timezone. DST automatic."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveDreamListResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/dreams/{agentId}/{entryId}": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "Read an archive-ready Dream document",
        "operationId": "getArchiveDream",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveDreamDocumentResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agents/{agentId}/archive-summary-model-selection": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read optional archive-summary model selection",
        "operationId": "getArchiveSummaryModelSelection",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Status"
        ],
        "summary": "Set or clear optional archive-summary model selection",
        "operationId": "updateArchiveSummaryModelSelection",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathAgentId"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/continuity/cards": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "List current warm continuity cards for Archive inspection",
        "operationId": "listArchiveContinuityCards",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from the previous page; keep the same filters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveContinuityCardListResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/continuity/cards/{agentId}/{cardId}": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "Read a current continuity card and its Signal history",
        "operationId": "getArchiveContinuityCard",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cardId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from the previous page; keep the same filters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveContinuityCardDetailResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/retention": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read operator-managed retention policy and cleanup preview",
        "operationId": "getRetentionPolicy",
        "responses": {
          "200": {
            "$ref": "#/components/responses/RetentionPolicyResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Save operator-managed retention policy",
        "operationId": "updateRetentionPolicy",
        "requestBody": {
          "$ref": "#/components/requestBodies/RetentionPolicyUpdate"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/RetentionPolicyResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/retention/preview": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Preview retention cleanup without deleting traces",
        "operationId": "previewRetentionCleanup",
        "requestBody": {
          "$ref": "#/components/requestBodies/RetentionPolicyPreview"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/RetentionCleanupResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/retention/run": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Run cleanup using the enabled retention policy",
        "operationId": "runManagedRetentionCleanup",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/RetentionCleanupResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/runs": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "List archived runtime proof packets",
        "description": "Returns runs across all enabled agents when agentId is omitted. Pages use descending completion/start time with stable identity tie-breakers; use cursor to reach older runs.",
        "operationId": "listArchiveRuns",
        "parameters": [
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "$ref": "#/components/parameters/SessionId"
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from the previous page; keep the same filters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveRunListResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/runs/{runId}": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "Read one archived runtime proof packet",
        "description": "Searches enabled agents when agentId is omitted and preserves the matched run's agent identity. When agentId is supplied, lookup is scoped to that agent.",
        "operationId": "getArchiveRun",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathRunId"
          },
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveRunResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/sessions/{sessionId}/export": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Export canonical raw session records",
        "description": "Read-only, versioned export for external memory or audit systems. Returns complete persisted active and compacted transcript generations in canonical order. Reset snapshots are intentionally excluded because they are separate archive documents.",
        "operationId": "exportSessionTranscript",
        "parameters": [
          {
            "$ref": "#/components/parameters/PathSessionId"
          },
          {
            "$ref": "#/components/parameters/AgentId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SessionExportResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/mods": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "List loaded mods and host contributions",
        "operationId": "listMods",
        "description": "Returns successfully loaded mods. Contribution endpoints remain validated beneath the declaring mod namespace. Settings contributions are declarative: mods rent Settings slots while core owns rendering and layout. Legacy apiTargets contributions remain supported as a generic fallback.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ModCatalogResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/setup/status": {
      "get": {
        "tags": [
          "Setup"
        ],
        "summary": "Read persistent installation setup state",
        "operationId": "getSetupStatus",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/setup/complete": {
      "post": {
        "tags": [
          "Setup"
        ],
        "summary": "Mark installation setup complete",
        "operationId": "completeSetup",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/mcp-connections/diagnose": {
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Diagnose MCP connection",
        "operationId": "diagnoseMcpConnection",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agents/overview": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Read bulk agent UI overview",
        "description": "Return registered agents with identities, current parent/child status, context usage, and model selections in one request. The optional sessions map selects the parent session for each agent.",
        "operationId": "getAgentOverview",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/mod-management": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "List installed and available mods",
        "operationId": "listModManagement",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/mod-management/source-refresh": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "Read persisted mod source refresh settings",
        "operationId": "getModSourceRefreshConfig",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Mods"
        ],
        "summary": "Replace persisted mod source refresh settings",
        "operationId": "updateModSourceRefreshConfig",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModSourceRefreshConfig"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/mod-management/sources": {
      "post": {
        "tags": [
          "Mods"
        ],
        "summary": "Add and inspect a mod source",
        "operationId": "createModSource",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/mod-management/sources/{sourceId}": {
      "delete": {
        "tags": [
          "Mods"
        ],
        "summary": "Remove a mod source",
        "operationId": "deleteModSource",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/ModSourceId"
          }
        ]
      }
    },
    "/api/mod-management/refresh": {
      "post": {
        "tags": [
          "Mods"
        ],
        "summary": "Refresh all mod sources",
        "operationId": "refreshModSources",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/mod-management/{modId}/install": {
      "post": {
        "tags": [
          "Mods"
        ],
        "summary": "Install or update a mod",
        "operationId": "installMod",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/ModId"
          }
        ]
      }
    },
    "/api/mod-management/{modId}/enable": {
      "post": {
        "tags": [
          "Mods"
        ],
        "summary": "Enable an installed mod",
        "operationId": "enableMod",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/ModId"
          }
        ]
      }
    },
    "/api/mod-management/{modId}/disable": {
      "post": {
        "tags": [
          "Mods"
        ],
        "summary": "Disable an installed mod",
        "operationId": "disableMod",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/ModId"
          }
        ]
      }
    },
    "/api/mod-management/{modId}/uninstall": {
      "post": {
        "tags": [
          "Mods"
        ],
        "summary": "Uninstall a mod while preserving settings",
        "operationId": "uninstallMod",
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/ModId"
          }
        ]
      }
    },
    "/api/task-board/conversation-project": {
      "get": {
        "tags": [
          "Task board"
        ],
        "summary": "Get the conversation active project",
        "operationId": "getConversationProject",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "default"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProjectResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Task board"
        ],
        "summary": "Set the conversation active project",
        "operationId": "setConversationProject",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agentId",
                  "projectId"
                ],
                "properties": {
                  "agentId": {
                    "type": "string"
                  },
                  "sessionId": {
                    "type": "string",
                    "default": "default"
                  },
                  "projectId": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProjectResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "delete": {
        "tags": [
          "Task board"
        ],
        "summary": "Clear the conversation active project",
        "operationId": "clearConversationProject",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "default"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ProjectResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/api-tokens": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "List API token metadata",
        "operationId": "listApiTokens",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Create a scoped API token",
        "operationId": "createApiToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "diagnostics:read"
                      ]
                    }
                  },
                  "expiresAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/api-tokens/{tokenId}": {
      "delete": {
        "tags": [
          "Settings"
        ],
        "summary": "Revoke an API token",
        "operationId": "revokeApiToken",
        "parameters": [
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/mods": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "Read sanitized opt-in mod diagnostics",
        "operationId": "listDiagnosticMods",
        "description": "Core diagnostics:read allowlisted endpoint; never proxies mod HTTP routes. Inventory includes mod ID, name and installed version when available. Unsupported and unavailable adapters have explicit statuses. No secrets, prompts or transcripts.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sanitized diagnostic response"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/mods/{modId}/jobs": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "Read sanitized opt-in mod diagnostics",
        "operationId": "listDiagnosticModJobs",
        "description": "Core diagnostics:read allowlisted endpoint; never proxies mod HTTP routes. Unsupported and unavailable adapters have explicit statuses. No secrets, prompts or transcripts.",
        "parameters": [
          {
            "name": "modId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 256
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized diagnostic response"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/mods/{modId}/jobs/{jobId}": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "Read sanitized opt-in mod diagnostics",
        "operationId": "getDiagnosticModJob",
        "description": "Core diagnostics:read allowlisted endpoint; never proxies mod HTTP routes. Unsupported and unavailable adapters have explicit statuses. No secrets, prompts or transcripts.",
        "parameters": [
          {
            "name": "modId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized diagnostic response"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/mods/{modId}/pending": {
      "get": {
        "tags": [
          "Mods"
        ],
        "summary": "Read current mod capability operations",
        "operationId": "getModPendingOperations",
        "description": "All current Core-hosted capability operation types, pending status and elapsed milliseconds only; elapsed does not prove progress. Requires diagnostics:read bearer token.",
        "parameters": [
          {
            "name": "modId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized pending operations"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/skills": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "List centrally managed text skills",
        "operationId": "listSkills",
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Settings"
        ],
        "summary": "Create a centrally managed text skill",
        "operationId": "createSkill",
        "parameters": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/skills/{id}": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read a text skill",
        "operationId": "getSkill",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "patch": {
        "tags": [
          "Settings"
        ],
        "summary": "Update a text skill",
        "operationId": "updateSkill",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "delete": {
        "tags": [
          "Settings"
        ],
        "summary": "Delete a text skill",
        "operationId": "deleteSkill",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/agents/{agentId}/skills": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read an agent skill assignment and effective catalog",
        "operationId": "getAgentSkills",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Replace an agent skill assignment",
        "operationId": "saveAgentSkills",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/JsonBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SettingsResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/generated-artifacts/{agentId}/{storageReference}": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "Download a persisted generated artifact",
        "description": "Reads only a runtime-owned storage reference beneath the selected agent workspace generated-artifact root. This endpoint does not fetch provider URLs.",
        "operationId": "getGeneratedArtifact",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storageReference",
            "in": "path",
            "required": true,
            "description": "URL-encoded storageReference returned by the generated artifact storage contract.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated artifact bytes",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/forge/catalog": {
      "get": {
        "tags": [
          "Forge"
        ],
        "summary": "getForgeCatalog",
        "operationId": "getForgeCatalog",
        "description": "See docs/forge-api.md. Uses the existing operator authentication boundary; diagnostics API tokens cannot access Forge. No provider credentials are returned.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeCatalog"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/forge/jobs": {
      "get": {
        "tags": [
          "Forge"
        ],
        "summary": "listForgeJobs",
        "operationId": "listForgeJobs",
        "description": "See docs/forge-api.md. Uses the existing operator authentication boundary; diagnostics API tokens cannot access Forge. No provider credentials are returned.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "tags": [
          "Forge"
        ],
        "summary": "createForgeJob",
        "operationId": "createForgeJob",
        "description": "See docs/forge-api.md. Uses the existing operator authentication boundary; diagnostics API tokens cannot access Forge. No provider credentials are returned.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Durably accepted; poll job detail. Same-key replay returns 200 without dispatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeCreateResponse"
                }
              }
            }
          },
          "202": {
            "description": "Durably accepted; poll job detail. Same-key replay returns 200 without dispatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeCreateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgeCreate"
              }
            }
          }
        }
      }
    },
    "/api/forge/jobs/{id}": {
      "get": {
        "tags": [
          "Forge"
        ],
        "summary": "getForgeJob",
        "operationId": "getForgeJob",
        "description": "See docs/forge-api.md. Uses the existing operator authentication boundary; diagnostics API tokens cannot access Forge. No provider credentials are returned.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeJobResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/forge/jobs/{id}/attach": {
      "post": {
        "tags": [
          "Forge"
        ],
        "summary": "attachForgeArtifact",
        "operationId": "attachForgeArtifact",
        "description": "See docs/forge-api.md. Uses the existing operator authentication boundary; diagnostics API tokens cannot access Forge. No provider credentials are returned.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeAttachResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgeAttach"
              }
            }
          }
        }
      }
    },
    "/api/forge/jobs/{id}/artifacts/{artifactId}": {
      "get": {
        "tags": [
          "Forge"
        ],
        "summary": "getForgeArtifact",
        "operationId": "getForgeArtifact",
        "description": "See docs/forge-api.md. Uses the existing operator authentication boundary; diagnostics API tokens cannot access Forge. No provider credentials are returned.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "download",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private media bytes; inline preview or attachment download.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "404": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/forge/selections": {
      "get": {
        "tags": [
          "Forge"
        ],
        "summary": "getForgeSelections",
        "operationId": "getForgeSelections",
        "responses": {
          "200": {
            "description": "Saved operator-wide selections",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeSelectionsResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Forge"
        ],
        "summary": "setForgeSelection",
        "operationId": "setForgeSelection",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgeSelection"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved selections",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForgeSelectionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/postgres": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read PostgreSQL availability and pgvector installation",
        "operationId": "getDiagnosticsPostgres",
        "description": "diagnostics:read allowlisted; no prompts, provider errors, artifacts, model settings or database credentials.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sanitized diagnostic response"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/forge/jobs": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "List sanitized Forge job summaries",
        "operationId": "listDiagnosticForgeJobs",
        "description": "diagnostics:read allowlisted; no prompts, provider errors, artifacts, model settings or database credentials.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized diagnostic response"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/diagnostics/forge/jobs/{jobId}": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Read sanitized Forge job summary",
        "operationId": "getDiagnosticForgeJob",
        "description": "diagnostics:read allowlisted; no prompts, provider errors, artifacts, model settings or database credentials.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized diagnostic response"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/archive/calendar": {
      "get": {
        "tags": [
          "Archive"
        ],
        "summary": "List UTC days with retained Archive records in a month",
        "operationId": "listArchiveCalendarDates",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sessions",
                "dreams"
              ]
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$"
            }
          },
          {
            "$ref": "#/components/parameters/AgentId"
          },
          {
            "in": "query",
            "name": "timezone",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "description": "IANA timezone defining date/month boundaries. Browser sends its local timezone. DST automatic."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ArchiveCalendarResponse"
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/settings/timezone": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read operator timezone for agent context and schedule defaults",
        "operationId": "getOperatorTimezone",
        "responses": {
          "200": {
            "description": "Operator timezone",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "timezone"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Validated IANA timezone; UTC until configured."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Save IANA operator timezone without changing browser-local UI or existing schedules",
        "operationId": "saveOperatorTimezone",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "timezone"
                ],
                "properties": {
                  "timezone": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operator timezone",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "timezone"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Validated IANA timezone; UTC until configured."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/api/albdruck/knowledge": {
      "get": {
        "operationId": "getAlbdruckKnowledge",
        "summary": "Get Albdruck knowledge",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "global"
              ],
              "default": "agent"
            }
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ]
      }
    },
    "/api/albdruck/knowledge/{id}": {
      "get": {
        "operationId": "getAlbdruckKnowledgeDetail",
        "summary": "Get Albdruck {id}",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "global"
              ],
              "default": "agent"
            }
          }
        ]
      },
      "put": {
        "operationId": "putAlbdruckKnowledgeDetail",
        "summary": "Put Albdruck {id}",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "global"
              ],
              "default": "agent"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAlbdruckKnowledgeDetail",
        "summary": "Delete Albdruck {id}",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "global"
              ],
              "default": "agent"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/albdruck/recall": {
      "post": {
        "operationId": "postAlbdruckRecall",
        "summary": "Post Albdruck recall",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "global"
              ],
              "default": "agent"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/albdruck/retention": {
      "get": {
        "operationId": "getAlbdruckRetention",
        "summary": "Get Albdruck retention",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "conversationDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "operationalDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "attachmentDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "knowledgeDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "evidenceDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "revisionDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        }
      },
      "put": {
        "operationId": "putAlbdruckRetention",
        "summary": "Put Albdruck retention",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "conversationDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "operationalDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "attachmentDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "knowledgeDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "evidenceDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    },
                    "revisionDays": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "404": {
            "description": "Knowledge not found"
          },
          "409": {
            "description": "Inactive knowledge or identity conflict"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "conversationDays": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "operationalDays": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "attachmentDays": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "knowledgeDays": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "evidenceDays": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "revisionDays": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/albdruck/history": {
      "post": {
        "operationId": "postAlbdruckHistory",
        "summary": "Search original live and archived conversation entries",
        "tags": [
          "Albdruck"
        ],
        "responses": {
          "200": {
            "description": "Original entries and an opaque continuation cursor (null at exhaustion).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "agentId",
                          "sessionId",
                          "entryId",
                          "timestamp",
                          "role",
                          "content",
                          "sourceRef",
                          "provenance"
                        ],
                        "properties": {
                          "agentId": {
                            "type": "string"
                          },
                          "sessionId": {
                            "type": "string"
                          },
                          "entryId": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "sourceRef": {
                            "type": "object",
                            "required": [
                              "kind",
                              "agentId",
                              "sessionId",
                              "entryId"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "conversation_entry"
                                ]
                              },
                              "agentId": {
                                "type": "string"
                              },
                              "sessionId": {
                                "type": "string"
                              },
                              "entryId": {
                                "type": "string"
                              }
                            }
                          },
                          "provenance": {
                            "type": "object",
                            "required": [
                              "store",
                              "reset"
                            ],
                            "properties": {
                              "store": {
                                "type": "string",
                                "enum": [
                                  "live",
                                  "archive"
                                ]
                              },
                              "reset": {
                                "type": "boolean"
                              },
                              "archiveId": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string"
                              },
                              "generation": {
                                "type": "integer"
                              },
                              "archivedAt": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, scope, pageSize, or cursor"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "global"
              ],
              "default": "agent"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque nextCursor from the previous page."
                  },
                  "pageSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "default": 50
                  }
                }
              }
            }
          }
        },
        "description": "Original message evidence only, never summaries or derived knowledge. Agent scope requires agentId; global searches all agents. Keyset order is agentId, sessionId, entryId ascending; cursors are bound to scope and query. Reset or compaction does not change entry identity. Not a frozen snapshot across pages: later inserts ahead of the cursor may appear and deleted originals disappear."
      }
    },
    "/api/albdruck/purge-conversation": {
      "post": {
        "operationId": "purgeAlbdruckConversation",
        "summary": "Irreversibly purge an original conversation and its derived evidence",
        "tags": [
          "Albdruck"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agentId",
                  "sessionId",
                  "reason"
                ],
                "properties": {
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Purge completed (idempotent); independent knowledge evidence retained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "sessionId": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "removed": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid purge request"
          },
          "409": {
            "description": "Active or current-main conversation cannot be purged"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "AgentId": {
        "name": "agentId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "PathAgentId": {
        "name": "agentId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "SessionId": {
        "name": "sessionId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "PathSessionId": {
        "name": "sessionId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "RunId": {
        "name": "runId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "IncludeDisabled": {
        "name": "includeDisabled",
        "in": "query",
        "required": false,
        "schema": {
          "type": "boolean",
          "default": true
        }
      },
      "Archived": {
        "name": "archived",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "SearchQuery": {
        "name": "q",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "ProjectId": {
        "name": "projectId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "TaskStatus": {
        "name": "status",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "TaskPriority": {
        "name": "priority",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "AssignedAgentId": {
        "name": "assignedAgentId",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "PathId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "PathJobId": {
        "name": "jobId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "PathChannelId": {
        "name": "channelId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "Scope": {
        "name": "scope",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "Path": {
        "name": "path",
        "in": "query",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "Enabled": {
        "name": "enabled",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "PathRunId": {
        "name": "runId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        }
      },
      "Q": {
        "name": "q",
        "in": "query",
        "schema": {
          "type": "string"
        }
      },
      "Output": {
        "name": "output",
        "in": "query",
        "schema": {
          "type": "boolean"
        }
      },
      "UpdatedSince": {
        "name": "updatedSince",
        "in": "query",
        "description": "Only return sessions updated strictly after this RFC 3339 timestamp. Use with stable agentId/sessionId to poll incrementally.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ModId": {
        "name": "modId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        }
      },
      "ModSourceId": {
        "name": "sourceId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "requestBodies": {
      "JsonBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JsonObject"
            }
          }
        }
      },
      "McpConnectionWrite": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpConnectionWrite"
            }
          }
        }
      },
      "AgentCreate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentCreate"
            }
          }
        }
      },
      "AgentPatch": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentPatch"
            }
          }
        }
      },
      "ChatRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ChatRequest"
            }
          }
        }
      },
      "ProjectCreate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ProjectCreate"
            }
          }
        }
      },
      "TaskCreate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TaskCreate"
            }
          }
        }
      },
      "WorkspaceFileWrite": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "path",
                "content"
              ],
              "properties": {
                "agentId": {
                  "type": "string"
                },
                "scope": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "content": {
                  "type": "string",
                  "maxLength": 1048576
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "ContinuityScopeWrite": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "agentId",
                "sessionId",
                "continuityScope"
              ],
              "properties": {
                "agentId": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "continuityScope": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "SessionHandoffWrite": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "agentId",
                "sessionId"
              ],
              "properties": {
                "agentId": {
                  "type": "string"
                },
                "sessionId": {
                  "type": "string"
                },
                "runId": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "content": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "WorkItemCreate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "message"
              ],
              "properties": {
                "agentId": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "workspaceRoot": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "WorkbenchRequest": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "message"
              ],
              "properties": {
                "agentId": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "workspaceRoot": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "ScheduledJobCreate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "agentId",
                "name",
                "prompt",
                "cron"
              ],
              "properties": {
                "agentId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "prompt": {
                  "type": "string"
                },
                "cron": {
                  "type": "string"
                },
                "timezone": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Null or omitted inherits the operator timezone dynamically. String is an explicit override."
                },
                "sessionId": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "modelConnectionId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "model": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "GroupChannelCreate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "name",
                "participantAgentIds"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "participantAgentIds": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "GroupChannelMessage": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "message"
              ],
              "properties": {
                "message": {
                  "type": "string"
                },
                "agentIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "SessionRename": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "targetSessionId"
              ],
              "properties": {
                "targetSessionId": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "SessionArchive": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [],
              "properties": {
                "archived": {
                  "type": "boolean"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "SessionFork": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [],
              "properties": {
                "targetSessionId": {
                  "type": "string"
                }
              },
              "additionalProperties": true
            }
          }
        }
      },
      "CuratorSelectionWrite": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CuratorSelection"
            }
          }
        }
      },
      "RetentionPolicyUpdate": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "traceMaxAgeDays": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1,
                  "maximum": 36500
                },
                "traceMaxBytes": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1
                },
                "intervalMinutes": {
                  "type": "integer",
                  "minimum": 15,
                  "maximum": 10080
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "RetentionPolicyPreview": {
        "required": false,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "policy": {
                  "$ref": "#/components/schemas/RetentionPolicy"
                }
              },
              "additionalProperties": false
            }
          }
        }
      }
    },
    "responses": {
      "JsonResponse": {
        "description": "JSON response. Endpoint-specific fields are being tightened incrementally from the existing implementation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JsonObject"
            }
          }
        }
      },
      "ChatResponse": {
        "description": "Normal non-streaming chat response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ChatResponse"
            }
          }
        }
      },
      "AttachmentListResponse": {
        "description": "Session attachment artifacts",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AttachmentListResponse"
            }
          }
        }
      },
      "AttachmentDeleteResponse": {
        "description": "Attachment deletion result",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AttachmentDeleteResponse"
            }
          }
        }
      },
      "ErrorResponse": {
        "description": "Burrow error response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CreatedJsonResponse": {
        "description": "Created JSON resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JsonObject"
            }
          }
        }
      },
      "AcceptedJsonResponse": {
        "description": "Accepted for asynchronous processing.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/JsonObject"
            }
          }
        }
      },
      "HealthResponse": {
        "description": "Runtime health response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/HealthResponse"
            }
          }
        }
      },
      "AgentListResponse": {
        "description": "Agent list response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentListResponse"
            }
          }
        }
      },
      "AgentResponse": {
        "description": "Agent mutation response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentResponse"
            }
          }
        }
      },
      "WorkspaceFilesResponse": {
        "description": "Workspace file listing.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WorkspaceFilesResponse"
            }
          }
        }
      },
      "WorkspaceFileResponse": {
        "description": "Workspace file content.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WorkspaceFileResponse"
            }
          }
        }
      },
      "ProjectListResponse": {
        "description": "Project list response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ProjectListResponse"
            }
          }
        }
      },
      "ProjectResponse": {
        "description": "Project mutation response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ProjectResponse"
            }
          }
        }
      },
      "TaskListResponse": {
        "description": "Task list response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TaskListResponse"
            }
          }
        }
      },
      "TaskResponse": {
        "description": "Task mutation response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TaskResponse"
            }
          }
        }
      },
      "WorkItemListResponse": {
        "description": "Work item list response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WorkItemListResponse"
            }
          }
        }
      },
      "WorkItemResponse": {
        "description": "Work item response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/WorkItemResponse"
            }
          }
        }
      },
      "GroupChannelListResponse": {
        "description": "Group channel list response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GroupChannelListResponse"
            }
          }
        }
      },
      "ScheduledJobListResponse": {
        "description": "Scheduled job list response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ScheduledJobListResponse"
            }
          }
        }
      },
      "AgentStatusResponse": {
        "description": "AgentStatusResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentStatusResponse"
            }
          }
        }
      },
      "ActiveChatRunsResponse": {
        "description": "ActiveChatRunsResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ActiveChatRunsResponse"
            }
          }
        }
      },
      "SessionListResponse": {
        "description": "SessionListResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SessionListResponse"
            }
          }
        }
      },
      "SessionDetailResponse": {
        "description": "SessionDetailResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SessionDetailResponse"
            }
          }
        }
      },
      "TraceListResponse": {
        "description": "TraceListResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TraceListResponse"
            }
          }
        }
      },
      "TraceResponse": {
        "description": "TraceResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TraceResponse"
            }
          }
        }
      },
      "TraceAuthorityResponse": {
        "description": "TraceAuthorityResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TraceAuthorityResponse"
            }
          }
        }
      },
      "SettingsResponse": {
        "description": "SettingsResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SettingsResponse"
            }
          }
        }
      },
      "McpConnectionListResponse": {
        "description": "Sanitized MCP connection list; plaintext API keys are never returned.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpConnectionListResponse"
            }
          }
        }
      },
      "McpConnectionResponse": {
        "description": "Sanitized saved MCP connection; plaintext API keys are never returned.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/McpConnectionResponse"
            }
          }
        }
      },
      "ContextResponse": {
        "description": "ContextResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ContextResponse"
            }
          }
        }
      },
      "ArchiveSessionListResponse": {
        "description": "ArchiveSessionListResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveSessionListResponse"
            }
          }
        }
      },
      "ArchiveSessionResponse": {
        "description": "ArchiveSessionResponse response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveSessionResponse"
            }
          }
        }
      },
      "ContextStatusResponse": {
        "description": "Context status response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ContextStatusResponse"
            }
          }
        }
      },
      "ClaudeCodeLoginStartResponse": {
        "description": "Claude Code OAuth login session with browser verification URL.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ClaudeCodeLoginStartResponse"
            }
          }
        }
      },
      "CuratorSettingsResponse": {
        "description": "Curator selection and runtime availability.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CuratorSettingsResponse"
            }
          }
        }
      },
      "TiddleStatusResponse": {
        "description": "Tiddle rolling-continuity cadence, status, and recent pass receipts.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TiddleStatusResponse"
            }
          }
        }
      },
      "TiddleCardListResponse": {
        "description": "Current warm Tiddle cards. Cards are recall metadata, not instructions or durable truth.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TiddleCardListResponse"
            }
          }
        }
      },
      "TiddleHistoryResponse": {
        "description": "Append-only Tiddle Signal history retained for drift and model-performance inspection.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TiddleHistoryResponse"
            }
          }
        }
      },
      "ArchiveDreamListResponse": {
        "description": "Archive-ready Dream diary cards without source or runtime metadata.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveDreamListResponse"
            }
          }
        }
      },
      "ArchiveDreamDocumentResponse": {
        "description": "Archive-ready Dream diary document. Markdown is the narrative only.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveDreamDocumentResponse"
            }
          }
        }
      },
      "ArchiveContinuityCardListResponse": {
        "description": "Current warm continuity cards for Archive inspection. Cards are mutable continuity metadata, not immutable archived sessions or prompt authority.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveContinuityCardListResponse"
            }
          }
        }
      },
      "ArchiveContinuityCardDetailResponse": {
        "description": "A current warm continuity card with append-only Signal history for inspection.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveContinuityCardDetailResponse"
            }
          }
        }
      },
      "RetentionPolicyResponse": {
        "description": "Persisted retention policy, scheduler state, and dry-run cleanup plan.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RetentionPolicyResponse"
            }
          }
        }
      },
      "RetentionCleanupResponse": {
        "description": "Retention cleanup preview or execution result.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RetentionCleanupResponse"
            }
          }
        }
      },
      "ArchiveRunListResponse": {
        "description": "Archive run proof list",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveRunListResponse"
            }
          }
        }
      },
      "ArchiveRunResponse": {
        "description": "Archive run proof packet",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveRunResponse"
            }
          }
        }
      },
      "SessionExportResponse": {
        "description": "Canonical read-only session export.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "ok",
                "schemaVersion",
                "session",
                "entries"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "schemaVersion": {
                  "type": "string",
                  "const": "1"
                },
                "session": {
                  "type": "object",
                  "required": [
                    "id",
                    "metadata"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "metadata": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": false
                },
                "entries": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SessionExportEntry"
                  }
                }
              },
              "additionalProperties": false
            }
          }
        }
      },
      "ModCatalogResponse": {
        "description": "Loaded mod catalog",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ModCatalogResponse"
            }
          }
        }
      },
      "DiagnosticsInventoryResponse": {
        "description": "Count-only diagnostics inventory.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DiagnosticsInventoryResponse"
            }
          }
        }
      },
      "ArchiveCalendarResponse": {
        "description": "UTC days with retained Archive sessions or Dreams, independent of list pagination.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ArchiveCalendarResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "JsonObject": {
        "type": "object",
        "additionalProperties": true
      },
      "AgentCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,96}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "enabled": {
            "type": "boolean"
          },
          "availableCapabilities": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "minItems": 1
          },
          "contextConfig": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": false
      },
      "AgentPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "enabled": {
            "type": "boolean"
          },
          "availableCapabilities": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            },
            "minItems": 1
          },
          "contextConfig": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": false
      },
      "ChatRequest": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "reasoningEffort": {
            "type": "string"
          },
          "temperature": {
            "type": "number",
            "minimum": 0
          },
          "attachments": {
            "type": "array",
            "description": "Inline attachments. Burrow persists each accepted payload beneath the owning agent workspace at artifacts/attachments and records its artifact path in session metadata. Image attachments are sent as multimodal input only when the selected model supports image input. All other attachment types are decoded and included as bounded text; PDF, office, audio, video, archive, and other binary formats are not natively parsed. Attachment artifacts are cleaned after 30 days.",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ChatAttachment"
            }
          }
        },
        "additionalProperties": true
      },
      "AttachmentArtifact": {
        "type": "object",
        "required": [
          "id",
          "name",
          "type",
          "size",
          "artifactPath"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Relative artifact path; use URL encoding when inserting into the artifact route."
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "storedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "sessionId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "artifactPath": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "AttachmentListResponse": {
        "type": "object",
        "required": [
          "ok",
          "agentId",
          "sessionId",
          "attachments"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "agentId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachmentArtifact"
            }
          }
        },
        "additionalProperties": false
      },
      "AttachmentDeleteResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "artifactPath": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ChatAttachment": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 240,
            "default": "attachment"
          },
          "type": {
            "type": "string",
            "maxLength": 160,
            "default": "application/octet-stream",
            "description": "MIME type. image/* or a data:image URL is treated as an image attachment."
          },
          "mimeType": {
            "type": "string",
            "maxLength": 160,
            "description": "Alias for type."
          },
          "size": {
            "type": "integer",
            "minimum": 0,
            "description": "Optional client-reported byte size."
          },
          "encoding": {
            "type": "string",
            "maxLength": 40,
            "default": "utf8",
            "description": "utf8/plain text or a data URL/base64 representation."
          },
          "content": {
            "type": "string",
            "description": "Inline text or data URL. Non-image content is accepted up to 200000 characters before prompt budgeting. Image content is accepted up to 30000000 characters."
          }
        },
        "additionalProperties": false
      },
      "ProjectCreate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,96}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "maxLength": 20000
          }
        },
        "additionalProperties": false
      },
      "TaskCreate": {
        "type": "object",
        "required": [
          "projectId",
          "title"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,96}$"
          },
          "projectId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,96}$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "description": {
            "type": "string",
            "maxLength": 20000
          },
          "status": {
            "type": "string",
            "enum": [
              "backlog",
              "todo",
              "in_progress",
              "review",
              "done",
              "cancelled"
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "normal",
              "low"
            ]
          },
          "assignedAgentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "actorAgentId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "ChatSummary": {
        "type": "object",
        "required": [
          "decision",
          "blockers",
          "warnings"
        ],
        "properties": {
          "decision": {
            "type": [
              "string",
              "null"
            ]
          },
          "intent": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "routeKind": {
            "type": [
              "string",
              "null"
            ]
          },
          "observedResultKind": {
            "type": [
              "string",
              "null"
            ]
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "trace": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "runId": {
                "type": "string"
              },
              "sessionId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "workItem": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "verification": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ChatResult": {
        "type": "object",
        "required": [
          "decision",
          "runId",
          "sessionId",
          "answerText",
          "blockers",
          "verification",
          "completionEvidence"
        ],
        "properties": {
          "decision": {
            "type": [
              "string",
              "null"
            ]
          },
          "runId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "answerText": {
            "type": [
              "string",
              "null"
            ]
          },
          "blockers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "continuity": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "verification": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "completionEvidence": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ChatResponse": {
        "type": "object",
        "required": [
          "ok",
          "summary",
          "result"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "summary": {
            "$ref": "#/components/schemas/ChatSummary"
          },
          "result": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": true
      },
      "ChatStreamEvent": {
        "type": "object",
        "required": [
          "type",
          "runId",
          "sessionId",
          "ts"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string"
          },
          "stack": {
            "type": "string",
            "description": "Development-only field."
          }
        },
        "additionalProperties": true
      },
      "HealthResponse": {
        "type": "object",
        "required": [
          "ok",
          "version"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "runtime": {
            "type": "string"
          },
          "ui": {
            "type": "object",
            "additionalProperties": true
          },
          "config": {
            "type": "object",
            "additionalProperties": true
          },
          "policy": {
            "type": "object",
            "additionalProperties": true
          },
          "traces": {
            "type": "object",
            "additionalProperties": true
          },
          "version": {
            "type": "string",
            "example": "2026.08.25",
            "description": "Calendar release identifier; same-day revisions append -N."
          }
        },
        "additionalProperties": true
      },
      "AgentResponse": {
        "type": "object",
        "required": [
          "ok",
          "agent"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "agent": {
            "$ref": "#/components/schemas/AgentCreate"
          }
        },
        "additionalProperties": true
      },
      "AgentListResponse": {
        "type": "object",
        "required": [
          "ok",
          "agents"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "agents": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "WorkspaceFilesResponse": {
        "type": "object",
        "required": [
          "ok",
          "workspaceRoot",
          "files"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "workspaceRoot": {
            "type": "string"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "file",
                    "directory"
                  ]
                },
                "size": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": true
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "WorkspaceFileResponse": {
        "type": "object",
        "required": [
          "ok",
          "path",
          "workspaceRoot",
          "content",
          "size"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "path": {
            "type": "string"
          },
          "workspaceRoot": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": true
      },
      "ProjectResponse": {
        "type": "object",
        "required": [
          "ok",
          "project"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "project": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ProjectListResponse": {
        "type": "object",
        "required": [
          "ok",
          "projects"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "TaskResponse": {
        "type": "object",
        "required": [
          "ok",
          "task"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "task": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "TaskListResponse": {
        "type": "object",
        "required": [
          "ok",
          "tasks"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "tasks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "WorkItemListResponse": {
        "type": "object",
        "required": [
          "ok",
          "items"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "WorkItemResponse": {
        "type": "object",
        "required": [
          "ok",
          "item"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "item": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "GroupChannelListResponse": {
        "type": "object",
        "required": [
          "ok",
          "channels"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "ScheduledJobListResponse": {
        "type": "object",
        "required": [
          "ok",
          "jobs",
          "activeRuns"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "jobs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "activeRuns": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "AgentStatusResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "agentId": {
            "type": "string"
          },
          "agent": {
            "type": "object",
            "additionalProperties": true
          },
          "session": {
            "type": "object",
            "additionalProperties": true
          },
          "subagents": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "ActiveChatRunsResponse": {
        "type": "object",
        "required": [
          "ok",
          "runs"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "runs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "SessionListResponse": {
        "type": "object",
        "required": [
          "ok",
          "sessions"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionListItem"
            }
          }
        },
        "additionalProperties": true
      },
      "SessionDetailResponse": {
        "type": "object",
        "required": [
          "ok",
          "session"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "session": {
            "$ref": "#/components/schemas/SessionDetail"
          }
        },
        "additionalProperties": true
      },
      "TraceListResponse": {
        "type": "object",
        "required": [
          "ok",
          "traces"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "traces": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "TraceResponse": {
        "type": "object",
        "required": [
          "ok",
          "trace"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "trace": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "TraceAuthorityResponse": {
        "type": "object",
        "required": [
          "ok",
          "runId",
          "authority"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "runId": {
            "type": "string"
          },
          "authority": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "SettingsResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          },
          "auth": {
            "type": "object",
            "additionalProperties": true
          },
          "identities": {
            "type": "object",
            "additionalProperties": true
          },
          "boundaries": {
            "type": "object",
            "additionalProperties": true
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "McpLifecycle": {
        "type": "string",
        "enum": [
          "ephemeral",
          "keep_alive"
        ],
        "default": "ephemeral",
        "description": "ephemeral starts a fresh MCP server per call. keep_alive retains one server process and its state across calls; use it for stateful servers such as browser automation."
      },
      "McpTool": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "inputSchema": {
            "type": "object",
            "additionalProperties": true
          },
          "availability": {
            "type": "string",
            "enum": [
              "grant-required",
              "mod-authorized"
            ],
            "readOnly": true,
            "description": "Mod-owned tools only. Ordinary MCP tools always require agent grants."
          }
        },
        "additionalProperties": false
      },
      "McpConnectionWrite": {
        "type": "object",
        "required": [
          "name",
          "transport"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,96}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "transport": {
            "type": "string",
            "enum": [
              "http",
              "stdio"
            ]
          },
          "baseUrl": {
            "type": "string",
            "format": "uri",
            "description": "Required for HTTP connections."
          },
          "command": {
            "type": "string",
            "maxLength": 240,
            "description": "Required for stdio connections."
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "lifecycle": {
            "$ref": "#/components/schemas/McpLifecycle"
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "apiKey": {
            "type": "string",
            "writeOnly": true,
            "description": "Optional replacement API key. Stored encrypted and never returned."
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpTool"
            }
          },
          "environmentVariables": {
            "type": "array",
            "description": "Provider-scoped environment variables for a stdio MCP. Values are encrypted; omitted values retain existing entries while editing, and omitted entries are removed.",
            "items": {
              "$ref": "#/components/schemas/McpEnvironmentVariableWrite"
            }
          }
        },
        "additionalProperties": false
      },
      "McpConnection": {
        "type": "object",
        "required": [
          "id",
          "name",
          "transport",
          "args",
          "lifecycle",
          "enabled",
          "apiKeyConfigured",
          "tools",
          "createdAt",
          "updatedAt",
          "environmentVariables"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "transport": {
            "type": "string",
            "enum": [
              "http",
              "stdio",
              "mod"
            ]
          },
          "baseUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "command": {
            "type": [
              "string",
              "null"
            ]
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lifecycle": {
            "$ref": "#/components/schemas/McpLifecycle"
          },
          "enabled": {
            "type": "boolean"
          },
          "apiKeyConfigured": {
            "type": "boolean"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpTool"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "environmentVariables": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpEnvironmentVariable"
            }
          }
        },
        "additionalProperties": false
      },
      "McpConnectionListResponse": {
        "type": "object",
        "required": [
          "ok",
          "connections"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "connections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/McpConnection"
            }
          }
        },
        "additionalProperties": false
      },
      "McpConnectionResponse": {
        "type": "object",
        "required": [
          "ok",
          "connection"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "connection": {
            "$ref": "#/components/schemas/McpConnection"
          }
        },
        "additionalProperties": false
      },
      "ContextResponse": {
        "type": "object",
        "required": [
          "ok",
          "context"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "context": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "contextBuildReceipt": {
                "$ref": "#/components/schemas/ContextBuildReceipt"
              }
            }
          }
        },
        "additionalProperties": true
      },
      "ArchiveSessionListResponse": {
        "description": "Human-facing archive only. Reset snapshots are virtual documents with archiveSnapshot=reset and sourceSessionId; they never enter normal agent session, context, recall, continuity, or search paths.",
        "type": "object",
        "required": [
          "ok",
          "sessions",
          "nextCursor",
          "hasMore"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveSessionListItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to retrieve the next page."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "ArchiveSessionResponse": {
        "description": "Archive-only chat conversation reader. Newest page first; before selects older pages. Compacted generations are deduplicated by stable turn ID; reset snapshots remain separate. Missing retained generations and stale cursors return 409 rather than implying beginning of history.",
        "type": "object",
        "required": [
          "ok",
          "session",
          "hasMore",
          "nextCursor",
          "historyStatus"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "session": {
            "type": "object",
            "additionalProperties": true,
            "description": "Session detail with turns containing only visible chat messages, ordered chronologically within this page; attachment references remain in message content."
          },
          "turns": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "historyStatus": {
            "type": "string",
            "enum": [
              "complete",
              "unavailable"
            ]
          }
        },
        "additionalProperties": true
      },
      "ExportRequest": {
        "type": "object",
        "required": [
          "categories"
        ],
        "properties": {
          "categories": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "agents",
                "settings",
                "model-connections",
                "mcp-connections",
                "ui-auth",
                "task-board"
              ]
            }
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "description": "Required when any selected category contains secrets or sensitive content."
          }
        }
      },
      "ExportImportRequest": {
        "type": "object",
        "required": [
          "payload"
        ],
        "properties": {
          "payload": {
            "type": "string",
            "description": "Base64-encoded export bundle."
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "writeOnly": true
          },
          "confirm": {
            "type": "boolean",
            "default": false
          },
          "conflictPolicy": {
            "type": "string",
            "enum": [
              "error",
              "skip",
              "replace"
            ],
            "default": "error"
          }
        },
        "additionalProperties": false
      },
      "RunEvidenceSelectionDetail": {
        "type": "object",
        "required": [
          "runId",
          "sessionId",
          "reason",
          "crossSession"
        ],
        "properties": {
          "runId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          },
          "crossSession": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "RunEvidenceInspection": {
        "type": "object",
        "description": "Bounded provenance-only inspection metadata. Evidence text, tool output, and provider bodies are excluded.",
        "properties": {
          "candidateCount": {
            "type": "integer",
            "minimum": 0
          },
          "selectedCount": {
            "type": "integer",
            "minimum": 0
          },
          "omittedCount": {
            "type": "integer",
            "minimum": 0
          },
          "chars": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6000
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "selected": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/RunEvidenceSelectionDetail"
            }
          },
          "omitted": {
            "type": "array",
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/RunEvidenceSelectionDetail"
            }
          }
        },
        "additionalProperties": false
      },
      "ContextBuildReceipt": {
        "type": "object",
        "description": "Receipt for the last assembled provider prompt; contains bounded inspection metadata, not prompt text or provider bodies.",
        "properties": {
          "providers": {
            "type": "object",
            "properties": {
              "runEvidence": {
                "$ref": "#/components/schemas/RunEvidenceInspection"
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ContextStatusResponse": {
        "type": "object",
        "required": [
          "ok",
          "status"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "status": {
            "type": "object",
            "properties": {
              "context": {
                "type": "object",
                "additionalProperties": true
              },
              "runEvidence": {
                "$ref": "#/components/schemas/RunEvidenceInspection"
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "ClaudeCodeLogin": {
        "type": "object",
        "required": [
          "id",
          "status",
          "verificationUrl",
          "prompt",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "verificationUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "prompt": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "connection": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": true
      },
      "ClaudeCodeLoginStartResponse": {
        "type": "object",
        "required": [
          "ok",
          "login"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "connection": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "login": {
            "$ref": "#/components/schemas/ClaudeCodeLogin"
          }
        },
        "additionalProperties": true
      },
      "CuratorSelection": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind",
              "connectionId",
              "model"
            ],
            "properties": {
              "kind": {
                "const": "external"
              },
              "connectionId": {
                "type": "string",
                "minLength": 1
              },
              "model": {
                "type": "string",
                "minLength": 1
              },
              "temperature": {
                "type": "number",
                "minimum": 0,
                "maximum": 0.5,
                "default": 0
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind",
              "modelPath"
            ],
            "properties": {
              "kind": {
                "const": "local"
              },
              "modelPath": {
                "type": "string",
                "minLength": 1
              },
              "contextSize": {
                "type": "integer",
                "minimum": 1,
                "default": 4096
              },
              "gpuLayers": {
                "type": "integer",
                "default": 0
              },
              "temperature": {
                "type": "number",
                "minimum": 0,
                "maximum": 0.5,
                "default": 0
              }
            }
          }
        ]
      },
      "CuratorSettingsResponse": {
        "type": "object",
        "required": [
          "ok",
          "configured",
          "available",
          "selection"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "configured": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "selection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CuratorSelection"
              },
              {
                "type": "null"
              }
            ]
          },
          "implementation": {
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": true
      },
      "TiddleStatusResponse": {
        "type": "object",
        "required": [
          "ok",
          "cadenceHours",
          "lookbackHours",
          "cardTtlDays",
          "temperature",
          "receipts"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "agentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cadenceHours": {
            "const": 4
          },
          "lookbackHours": {
            "const": 24
          },
          "cardTtlDays": {
            "const": 30
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 0.5
          },
          "state": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "receipts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "TiddleCardListResponse": {
        "type": "object",
        "required": [
          "ok",
          "agentId",
          "cards"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "agentId": {
            "type": "string"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cards": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "TiddleHistoryResponse": {
        "type": "object",
        "required": [
          "ok",
          "agentId",
          "entries"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "agentId": {
            "type": "string"
          },
          "cardId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "ArchiveDreamListResponse": {
        "type": "object",
        "required": [
          "ok",
          "entries",
          "nextCursor",
          "hasMore"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to retrieve the next page."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ArchiveDreamDocumentResponse": {
        "type": "object",
        "required": [
          "ok",
          "document"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "document": {
            "type": "object",
            "required": [
              "id",
              "kind",
              "agentId",
              "title",
              "markdown"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "const": "dream"
              },
              "agentId": {
                "type": "string"
              },
              "agentName": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "subtitle": {
                "type": "string"
              },
              "phase": {
                "type": "string"
              },
              "markdown": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ArchiveSessionListItem": {
        "type": "object",
        "required": [
          "agentId",
          "sessionId",
          "title",
          "titleSource",
          "summary",
          "summaryStatus",
          "turnCount",
          "archived"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "agentName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Deterministically derived archive title when available."
          },
          "titleSource": {
            "type": "string",
            "enum": [
              "derived",
              "legacy"
            ]
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional one- or two-sentence model summary. Null when no archive-summary model is configured or generation did not succeed."
          },
          "summaryStatus": {
            "type": "string",
            "enum": [
              "ready",
              "not_configured",
              "failed"
            ]
          },
          "summarizedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "turnCount": {
            "type": "integer"
          },
          "chatTurnCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "archiveSnapshot": {
            "type": "string",
            "enum": [
              "reset"
            ]
          },
          "sourceSessionId": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ArchiveContinuityCard": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "agentId",
          "agentName",
          "title",
          "summary",
          "firstSeen",
          "lastSeen",
          "recurrence"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "const": "continuity"
          },
          "agentId": {
            "type": "string"
          },
          "agentName": {
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "firstSeen": {
            "type": "string",
            "format": "date-time"
          },
          "lastSeen": {
            "type": "string",
            "format": "date-time"
          },
          "recurrence": {
            "type": "integer",
            "minimum": 1
          },
          "recentRefs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ArchiveContinuityHistoryEntry": {
        "type": "object",
        "required": [
          "id",
          "at",
          "agentId",
          "disposition",
          "reason"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "runId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "scope": {
            "type": [
              "string",
              "null"
            ]
          },
          "disposition": {
            "type": "string"
          },
          "cardId": {
            "type": [
              "string",
              "null"
            ]
          },
          "recurrenceBefore": {
            "type": "integer"
          },
          "recurrenceAfter": {
            "type": "integer"
          },
          "titleBefore": {
            "type": [
              "string",
              "null"
            ]
          },
          "titleAfter": {
            "type": [
              "string",
              "null"
            ]
          },
          "summaryBefore": {
            "type": [
              "string",
              "null"
            ]
          },
          "summaryAfter": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ArchiveContinuityCardListResponse": {
        "type": "object",
        "required": [
          "ok",
          "scope",
          "cards",
          "nextCursor",
          "hasMore"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "scope": {
            "type": [
              "string",
              "null"
            ]
          },
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveContinuityCard"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to retrieve the next page."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ArchiveContinuityCardDetailResponse": {
        "type": "object",
        "required": [
          "ok",
          "card",
          "history",
          "nextCursor",
          "hasMore"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "card": {
            "$ref": "#/components/schemas/ArchiveContinuityCard"
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveContinuityHistoryEntry"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to retrieve the next page."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "RetentionPolicy": {
        "type": "object",
        "required": [
          "version",
          "enabled",
          "traceMaxAgeDays",
          "traceMaxBytes",
          "intervalMinutes"
        ],
        "properties": {
          "version": {
            "const": 1
          },
          "enabled": {
            "type": "boolean"
          },
          "traceMaxAgeDays": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 36500
          },
          "traceMaxBytes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "intervalMinutes": {
            "type": "integer",
            "minimum": 15,
            "maximum": 10080
          }
        },
        "additionalProperties": false
      },
      "RetentionPolicyState": {
        "type": "object",
        "required": [
          "lastRunAt",
          "lastResult",
          "lastError",
          "nextRunAt"
        ],
        "properties": {
          "lastRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastResult": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "nextRunAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "RetentionPlan": {
        "type": "object",
        "required": [
          "ok",
          "dryRun",
          "retention",
          "counts"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "dryRun": {
            "type": "boolean"
          },
          "retention": {
            "type": "object",
            "additionalProperties": true
          },
          "counts": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "RetentionPolicyResponse": {
        "type": "object",
        "required": [
          "ok",
          "policy",
          "state",
          "plan"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "policy": {
            "$ref": "#/components/schemas/RetentionPolicy"
          },
          "state": {
            "$ref": "#/components/schemas/RetentionPolicyState"
          },
          "plan": {
            "$ref": "#/components/schemas/RetentionPlan"
          }
        },
        "additionalProperties": false
      },
      "RetentionCleanupResponse": {
        "type": "object",
        "required": [
          "ok",
          "policy",
          "state",
          "dryRun",
          "retention",
          "counts"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "policy": {
            "$ref": "#/components/schemas/RetentionPolicy"
          },
          "state": {
            "$ref": "#/components/schemas/RetentionPolicyState"
          },
          "dryRun": {
            "type": "boolean"
          },
          "retention": {
            "type": "object",
            "additionalProperties": true
          },
          "counts": {
            "type": "object",
            "additionalProperties": true
          },
          "attachments": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "SessionTurn": {
        "description": "Bounded chat or activity entry returned by the session detail endpoint. Tool calls and results remain debug/audit records and are represented to the UI through SessionToolActivity, not raw tool payloads.",
        "type": "object",
        "required": [
          "id",
          "ts",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "parentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "enum": [
              "message",
              "activity",
              "receipt"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "user",
              "assistant",
              "agent",
              null
            ]
          },
          "content": {
            "type": "string"
          },
          "contentTruncated": {
            "type": "boolean"
          },
          "runId": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "SessionToolActivityItem": {
        "type": "object",
        "required": [
          "label",
          "status"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ok",
              "error"
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 1
          }
        },
        "additionalProperties": true
      },
      "SessionToolActivity": {
        "description": "Structured, displayable tool activity for a parent or child session. It contains bounded labels and outcomes, not raw tool arguments or result payloads.",
        "type": "object",
        "required": [
          "summary",
          "items"
        ],
        "properties": {
          "runId": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionToolActivityItem"
            }
          }
        },
        "additionalProperties": true
      },
      "SessionDetail": {
        "type": "object",
        "required": [
          "id",
          "turns",
          "activities"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "agentName": {
            "type": "string"
          },
          "turnCount": {
            "type": "integer",
            "minimum": 0
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "turns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionTurn"
            }
          },
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionToolActivity"
            }
          }
        },
        "additionalProperties": true
      },
      "ArchiveRunStatus": {
        "type": "string",
        "enum": [
          "completed",
          "warning",
          "failed",
          "unverified",
          "incomplete"
        ]
      },
      "ArchiveEvidenceItem": {
        "type": "object",
        "required": [
          "text",
          "status",
          "sourceRefs"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "observed",
              "validated",
              "failed",
              "unresolved",
              "unknown"
            ]
          },
          "sourceRefs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "ArchiveRunCounts": {
        "type": "object",
        "required": [
          "observations",
          "changes",
          "verifications",
          "failures",
          "unresolved",
          "toolActivities",
          "subagents"
        ],
        "properties": {
          "observations": {
            "type": "integer",
            "minimum": 0
          },
          "changes": {
            "type": "integer",
            "minimum": 0
          },
          "verifications": {
            "type": "integer",
            "minimum": 0
          },
          "unresolved": {
            "type": "integer",
            "minimum": 0
          },
          "toolActivities": {
            "type": "integer",
            "minimum": 0
          },
          "subagents": {
            "type": "integer",
            "minimum": 0
          },
          "failures": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "ArchiveTimelineEvent": {
        "type": "object",
        "required": [
          "kind",
          "status",
          "summary",
          "evidence"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "tool_call",
              "tool_result",
              "tool_trace",
              "tool_activity",
              "observation",
              "change",
              "verification",
              "failure",
              "unresolved",
              "terminal",
              "context",
              "subagent"
            ]
          },
          "status": {
            "type": "string"
          },
          "ts": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "summary": {
            "type": "string"
          },
          "evidence": {
            "type": "string",
            "enum": [
              "session_execution",
              "trace_receipt",
              "session_activity",
              "run_evidence",
              "runtime_receipt",
              "subagent_record",
              "archive_inference"
            ]
          }
        },
        "additionalProperties": false
      },
      "ArchiveRunDetail": {
        "description": "Bounded operator-readable proof packet assembled from persisted runtime receipts, activities, final chat output, and run evidence. Raw tool artifacts remain trace-owned.",
        "type": "object",
        "required": [
          "id",
          "runId",
          "agentId",
          "sessionId",
          "status",
          "counts",
          "evidence",
          "timeline",
          "references",
          "subagents"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "agentName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sessionId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ArchiveRunStatus"
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "objective": {
            "type": [
              "string",
              "null"
            ]
          },
          "finalAnswer": {
            "type": [
              "string",
              "null"
            ]
          },
          "decision": {
            "type": [
              "string",
              "null"
            ]
          },
          "route": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "counts": {
            "$ref": "#/components/schemas/ArchiveRunCounts"
          },
          "evidence": {
            "type": "object",
            "required": [
              "observations",
              "changes",
              "verifications",
              "failures",
              "unresolved"
            ],
            "properties": {
              "observations": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArchiveEvidenceItem"
                }
              },
              "changes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArchiveEvidenceItem"
                }
              },
              "verifications": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArchiveEvidenceItem"
                }
              },
              "unresolved": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArchiveEvidenceItem"
                }
              },
              "failures": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArchiveEvidenceItem"
                }
              }
            },
            "additionalProperties": false
          },
          "context": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArchiveContextProof"
              },
              {
                "type": "null"
              }
            ]
          },
          "timeline": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveTimelineEvent"
            }
          },
          "references": {
            "type": "object",
            "required": [
              "trace",
              "sourceRefs"
            ],
            "properties": {
              "trace": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              },
              "sourceRefs": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "subagents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveSubagentProof"
            }
          },
          "lastActivityAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "request": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exact canonical user message that initiated this run, when retained."
          }
        },
        "additionalProperties": false
      },
      "ArchiveRunListResponse": {
        "type": "object",
        "required": [
          "ok",
          "runs",
          "nextCursor",
          "hasMore"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveRunDetail"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as cursor to retrieve the next page."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ArchiveRunResponse": {
        "type": "object",
        "required": [
          "ok",
          "run"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "run": {
            "$ref": "#/components/schemas/ArchiveRunDetail"
          }
        },
        "additionalProperties": false
      },
      "ArchiveSubagentProof": {
        "type": "object",
        "required": [
          "id",
          "status",
          "phase",
          "purpose",
          "createdAt",
          "completedAt",
          "model",
          "result",
          "trace"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "phase": {
            "type": [
              "string",
              "null"
            ]
          },
          "purpose": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "model": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "trace": {
            "type": "object",
            "additionalProperties": true
          },
          "verification": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "status",
                  "expected",
                  "check",
                  "observed",
                  "actionRequired"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "passed",
                      "failed",
                      "failed_expected",
                      "not_run"
                    ]
                  },
                  "expected": {
                    "type": "boolean"
                  },
                  "check": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "observed": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "actionRequired": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ArchiveContextProof": {
        "type": "object",
        "required": [
          "budget",
          "compression",
          "attachments"
        ],
        "properties": {
          "budget": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "compression": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "attachments": {
            "type": "integer",
            "minimum": 0
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plain-language explanation of the recorded context and compression state."
          },
          "contextEvents": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Bounded recorded context-build decisions for this run."
          },
          "attachmentManifest": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "All attachment references retained by the context build."
          },
          "currentAttachmentManifest": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Attachments supplied on the current request."
          },
          "retainedAttachmentManifest": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Prior attachment references retained across context rebuilding."
          }
        },
        "additionalProperties": false
      },
      "SessionExportEntry": {
        "description": "One normalized canonical persisted session record. This is an export/audit record, not the bounded UI session-turn projection.",
        "type": "object",
        "required": [
          "id",
          "ts",
          "sessionId",
          "type",
          "content",
          "visibility",
          "entersPrompt",
          "metadata"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "parentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ts": {
            "type": "string",
            "format": "date-time"
          },
          "sessionId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "role": {
            "type": [
              "string",
              "null"
            ]
          },
          "content": {
            "type": "string"
          },
          "contentTruncated": {
            "type": "boolean"
          },
          "runId": {
            "type": [
              "string",
              "null"
            ]
          },
          "traceDir": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string"
          },
          "entersPrompt": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "SessionExport": {
        "description": "Schema-versioned, read-only canonical transcript export. Compacted transcript generations are included; reset snapshots remain separate archive resources.",
        "type": "object",
        "required": [
          "schemaVersion",
          "session",
          "entries"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1"
          },
          "session": {
            "type": "object",
            "required": [
              "id",
              "metadata"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "metadata": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "additionalProperties": false
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionExportEntry"
            }
          }
        },
        "additionalProperties": false
      },
      "SessionListItem": {
        "type": "object",
        "description": "Stable session discovery record for incremental export polling.",
        "required": [
          "sessionId",
          "agentId",
          "updatedAt",
          "turnCount",
          "archived"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Compatibility alias for sessionId."
          },
          "sessionId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "turnCount": {
            "type": "integer",
            "minimum": 0
          },
          "archived": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "summary": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ModContributions": {
        "type": "object",
        "description": "Validated declarative host contribution contracts declared by a loaded mod. Core owns Settings rendering/layout; mods declare data capabilities and metadata.",
        "properties": {
          "apiTargets": {
            "type": "string",
            "pattern": "^/api/mods/[^/]+/.+",
            "description": "Mod-scoped endpoint implementing the API target registry contract. Core resolves and manages these targets through its existing UI and API clients.",
            "examples": [
              "/api/mods/node-goblin/targets"
            ]
          },
          "settings": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/ModSettingsContribution"
            },
            "description": "Core-rendered Settings workspace slots declared by the mod. Legacy apiTargets remains available as a generic fallback."
          }
        },
        "additionalProperties": false
      },
      "ModCatalogItem": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "contributions": {
            "$ref": "#/components/schemas/ModContributions"
          },
          "ui": {
            "type": "object",
            "description": "Optional installed-mod UI assets. settingsUrl identifies a settings module loaded through the host-owned Settings runtime contract; controlUrl remains the legacy control surface.",
            "properties": {
              "controlUrl": {
                "type": "string"
              },
              "settingsUrl": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ModCatalogResponse": {
        "type": "object",
        "required": [
          "ok",
          "mods"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "mods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModCatalogItem"
            }
          }
        },
        "additionalProperties": false
      },
      "McpEnvironmentVariableWrite": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$"
          },
          "value": {
            "type": "string",
            "writeOnly": true,
            "description": "Optional replacement value. Stored encrypted and never returned; omit it while editing to retain an already configured value."
          }
        },
        "additionalProperties": false
      },
      "McpEnvironmentVariable": {
        "type": "object",
        "required": [
          "name",
          "configured"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "configured": {
            "type": "boolean",
            "description": "Whether an encrypted value is stored. The value is never returned."
          }
        },
        "additionalProperties": false
      },
      "ModSettingsEmptyState": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "description": {
            "type": "string",
            "maxLength": 1200
          }
        },
        "additionalProperties": false
      },
      "ModSettingsPane": {
        "type": "object",
        "required": [
          "title",
          "capability"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "description": {
            "type": "string",
            "maxLength": 1200
          },
          "capability": {
            "type": "string",
            "enum": [
              "apiTargets",
              "settingsUi"
            ],
            "description": "Settings capability supplied by the installed mod and rendered through the host-owned Settings contract."
          }
        },
        "additionalProperties": false
      },
      "ModSettingsNavigation": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "description": {
            "type": "string",
            "maxLength": 600
          }
        },
        "additionalProperties": false
      },
      "ModSettingsInventory": {
        "type": "object",
        "required": [
          "title",
          "capability"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240
          },
          "description": {
            "type": "string",
            "maxLength": 1200
          },
          "capability": {
            "type": "string",
            "enum": [
              "apiTargets",
              "settingsUi"
            ]
          },
          "emptyState": {
            "$ref": "#/components/schemas/ModSettingsEmptyState"
          }
        },
        "additionalProperties": false
      },
      "ModSettingsContribution": {
        "type": "object",
        "required": [
          "id",
          "navigation",
          "primary"
        ],
        "description": "Declarative mod Settings slot. Core owns Settings layout and rendering; the mod declares labels, optional inventory metadata, and host-owned data capabilities.",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "navigation": {
            "$ref": "#/components/schemas/ModSettingsNavigation",
            "description": "Column 2 section navigation metadata."
          },
          "primary": {
            "$ref": "#/components/schemas/ModSettingsPane",
            "description": "Column 3 primary configuration pane metadata."
          },
          "inventory": {
            "$ref": "#/components/schemas/ModSettingsInventory",
            "description": "Optional Column 4 inventory/overflow pane metadata."
          }
        },
        "additionalProperties": false
      },
      "DiagnosticsInventoryResponse": {
        "type": "object",
        "required": [
          "ok",
          "inventory"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "inventory": {
            "type": "object",
            "required": [
              "mcp",
              "mods"
            ],
            "properties": {
              "mcp": {
                "type": "object",
                "required": [
                  "configured"
                ],
                "properties": {
                  "configured": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              "mods": {
                "type": "object",
                "required": [
                  "installed",
                  "enabled"
                ],
                "properties": {
                  "installed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "enabled": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ModSourceRefreshConfig": {
        "type": "object",
        "required": [
          "enabled",
          "intervalMs",
          "staleMs"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "intervalMs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Base delay between background source refreshes in milliseconds."
          },
          "staleMs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Age in milliseconds after which listing management state queues a refresh."
          },
          "concurrency": {
            "type": "integer",
            "minimum": 1,
            "description": "Maximum number of independent Git sources checked concurrently; defaults to 4 when not configured.",
            "maximum": 9007199254740991
          },
          "maxBackoffMs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991,
            "description": "Maximum background retry delay after refresh failures; defaults to 24 hours when not configured."
          }
        },
        "additionalProperties": false
      },
      "ForgeArtifact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "previewUrl": {
            "type": "string"
          },
          "downloadUrl": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "mimeType",
          "previewUrl",
          "downloadUrl",
          "sizeBytes"
        ],
        "additionalProperties": false
      },
      "ForgeJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "modelId": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "interrupted"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForgeArtifact"
            }
          }
        },
        "required": [
          "id",
          "connectionId",
          "modelId",
          "kind",
          "prompt",
          "idempotencyKey",
          "createdAt",
          "updatedAt",
          "status",
          "error",
          "artifacts"
        ],
        "additionalProperties": false
      },
      "ForgeCreate": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string",
            "minLength": 1
          },
          "modelId": {
            "type": "string",
            "minLength": 1
          },
          "prompt": {
            "type": "string",
            "minLength": 1
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "connectionId",
          "modelId",
          "prompt",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "ForgeAttach": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "artifactId": {
            "type": "string"
          }
        },
        "required": [
          "agentId",
          "sessionId",
          "artifactId"
        ],
        "additionalProperties": false
      },
      "ForgeModel": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "modelId": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "audio",
              "video"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "unavailableReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "controls": {
            "type": "array",
            "maxItems": 0,
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "connectionId",
          "modelId",
          "label",
          "kind",
          "available",
          "unavailableReason",
          "controls"
        ],
        "additionalProperties": false
      },
      "ForgeCatalog": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForgeModel"
            }
          },
          "sourceAttachments": {
            "type": "object",
            "properties": {
              "available": {
                "const": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "available",
              "reason"
            ],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "available": {
                "const": false,
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "available",
              "reason"
            ],
            "additionalProperties": false
          },
          "music": {
            "type": "object",
            "required": [
              "available",
              "reason"
            ],
            "properties": {
              "available": {
                "type": "boolean",
                "const": false
              },
              "reason": {
                "type": "string",
                "const": "music_model_not_configured"
              }
            }
          }
        },
        "required": [
          "ok",
          "models",
          "sourceAttachments",
          "video"
        ],
        "additionalProperties": false
      },
      "ForgeJobResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "job": {
            "$ref": "#/components/schemas/ForgeJob"
          }
        },
        "required": [
          "ok",
          "job"
        ],
        "additionalProperties": false
      },
      "ForgeCreateResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "job": {
            "$ref": "#/components/schemas/ForgeJob"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "ok",
          "job",
          "replayed"
        ],
        "additionalProperties": false
      },
      "ForgeHistory": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForgeJob"
            }
          }
        },
        "required": [
          "ok",
          "jobs"
        ],
        "additionalProperties": false
      },
      "ForgeAttachResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "attachment": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "storedAt": {
                "type": "string"
              },
              "sessionId": {
                "type": "string"
              },
              "artifactPath": {
                "type": "string"
              },
              "size": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "type",
              "storedAt",
              "sessionId",
              "artifactPath",
              "size"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ok",
          "attachment"
        ],
        "additionalProperties": false
      },
      "ForgeSelection": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "image",
              "music",
              "speech",
              "video"
            ]
          },
          "connectionId": {
            "type": "string",
            "minLength": 1
          },
          "modelId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "mode",
          "connectionId",
          "modelId"
        ],
        "additionalProperties": false
      },
      "ForgeSelectionsResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "selections": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ForgeSelectionPair"
            }
          }
        },
        "required": [
          "ok",
          "selections"
        ],
        "additionalProperties": false
      },
      "ForgeSelectionPair": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "modelId": {
            "type": "string"
          }
        },
        "required": [
          "connectionId",
          "modelId"
        ],
        "additionalProperties": false
      },
      "ArchiveCalendarResponse": {
        "type": "object",
        "required": [
          "ok",
          "kind",
          "month",
          "dates"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "kind": {
            "type": "string",
            "enum": [
              "sessions",
              "dreams"
            ]
          },
          "month": {
            "type": "string"
          },
          "dates": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date"
            }
          }
        },
        "additionalProperties": false
      }
    }
  },
  "x-burrow-contract-status": {
    "phase": "verified",
    "sourceOfTruth": "docs/openapi.json",
    "nextSteps": [
      "add live import preview/round-trip assertions",
      "keep live contract and route-drift checks green"
    ],
    "excludedProtocols": [
      "NDJSON chat streaming",
      "provider-specific upstream streaming",
      "WebSocket protocols"
    ]
  }
}
