From 85e0d7ffbede64da79a1e01d785e7176d3fa14ff Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 3 Oct 2026 15:14:44 -0400 Subject: [PATCH] docs(api): define the protocol 3 contract Define request shapes, responses, authentication, and stream recovery for protocol 3. --- docs/http-api-architecture.md | 88 + docs/http-api-design.md | 1580 +++++ docs/openapi.yaml | 10478 ++++++++++++++++++++++++++++++++ 3 files changed, 12146 insertions(+) create mode 100644 docs/http-api-architecture.md create mode 100644 docs/http-api-design.md create mode 100644 docs/openapi.yaml diff --git a/docs/http-api-architecture.md b/docs/http-api-architecture.md new file mode 100644 index 000000000..e1f528ebc --- /dev/null +++ b/docs/http-api-architecture.md @@ -0,0 +1,88 @@ +# HTTP API architecture + +[OpenAPI](openapi.yaml) defines wire shapes. [HTTP API design](http-api-design.md) +defines ordering, retry, recovery, and resource behavior. This document explains +the owners and persistence boundaries behind those operations. + +## State ownership + +Session actors, the store transaction connection, the family owner, the +settings lock, and the bounded bus own the state below. HTTP handlers call +these owners and project their results. + +| State | Owner and commit boundary | Recovery and removal | +| --- | --- | --- | +| Creation intent and decision | `conversation` and `operations`, on the shared store transaction connection. Persist the submitted descriptor separately from resolved defaults and editable configuration. | Keep provenance while the session exists. Keep rejected decisions and deletion tombstones for the contract's seven-day window. A lost response is recovered by the same session URI and original ID. | +| Child creation and initial task | Family owner serializes membership validation. One store transaction commits session, relationship, creation decision, and identified task. | A failed commit leaves none of them. Deletion admission prevents a racing child from escaping captured membership. | +| Input admission | `operations` commits the immutable decision and pending input together. Check a known ID before mutable validation. | Accepted pending input survives restart. Queue-full rejection stays rejected on retry. Unknown expired IDs cannot execute. | +| Input consumption and turn outcome | Session actor orders execution. Store owner commits transcript rows, images, input delivery, turn membership, and pending removal together. | Failed consumption leaves input pending. An unfinished previous run becomes abandoned after restart. Start seven-day receipt retention only when both delivery and the associated turn are terminal. | +| Configuration and workspace intent | Session actor validates its configuration revision and idleness. Family owner captures descendant membership; store owner commits desired workspace and deferred descendant intentions. | Persist desired revision before kernel work. A late completion cannot restore an older workspace. Report failed application separately from committed desired state. | +| Visits and deletion | Store owner commits visit identity with the counter, and deletion outcomes with pending cancellations and tombstones. Family owner serializes captured subtree changes. | Repeated visits do not increment again. Partial deletion reports the actual captured remainder. Never automatically repeat subtree deletion after transport loss. | +| Session watch | Session actor captures live state, replay position, and durable high-water mark together. Generation belongs only to that actor lifetime. | Reset reads history through the captured high-water mark. Advance the client's cursor pair after delivery succeeds. Actor replacement cannot authorize old numeric replay. | +| Collection watch | Existing bus admits bounded notifications before subscriber mailboxes and coalesces wakes. | Overflow and closure require resubscription followed by authoritative refresh. Disconnect removes subscription state. No duplicate full-event mailbox queue. | +| Settings and credentials | Existing settings owner constructs the candidate under the per-home lock. MCP connection probes run outside the lock; publication rechecks the group validator and private candidate inputs. | Use the crash recovery procedure below. Runtime application is distinct from persistence. Secrets remain write-only. | +| Provider login | OAuth owner owns the bounded live listener/exchange. It owns durable admission and terminal records through the supplied store transaction connection. | Persist admission before opening a listener. Restart marks unfinished records failed. Preserve terminal decisions for 15 minutes; a duplicate ID cannot start another exchange. | +| Prepared context | Existing runtime owner publishes one immutable latest prepared snapshot. | Paging pins its ID; replacement returns `410 context_changed`. Reading context never prepares a request. | +| Extension ledgers | Each extension owns its tables, migrations, validation, permissions, and handlers. | Commit domain changes before best-effort notifications. Notification failure cannot undo committed work. | + +Composition discovery runs outside the runtime actor in bounded preparation +workers. Admission reserves capacity for both observations and preparation, so +slow kernel starts cannot occupy every read slot. + +### Settings crash recovery + +Provider and MCP changes publish public settings and `creds.json` atomically. + +The settings owner uses the per-home lock and a private recovery record for +a pending group replacement: + +1. Recover any prior replacement before reading or changing settings. All + credential writers, refreshes, and readers that can observe these files + participate in this boundary. +2. Read the current group, check `If-Match`, and construct the complete candidate + while retaining unrelated sections. Resolve conflicting secret sources and + validate the candidate before changing authoritative files. +3. Write the complete replacement documents into private temporary files. + Set mode `0600` before writing secrets. Sync the files. +4. Publish a private recovery record containing the complete replacement + documents and their allowed destination names. Sync the record and its + directory. Publication is the durable commit decision. + Before this point, failure leaves the old group authoritative. +5. Replace the affected files and sync their directory. After the commit + decision, recovery completes those replacements; it does not undo them. + Recovery can regenerate a consumed temporary file from the record, so a + crash after the first rename does not lose the remaining replacement data. +6. Remove the recovery record and temporary files only after replacement is + durable. Then expose the new group and validator to readers. + +Crash before the commit decision keeps the old group. Crash after it completes +the new group on restart. An inability to finish recovery fails startup or the +settings operation with an actionable storage error; it cannot expose a mixed +snapshot. Keep old runtime composition usable until candidate application +succeeds. A post-commit application failure reports the persisted desired state +and failed application, without claiming persistence rolled back. + +Scope this mechanism to the existing settings owner. Do not create a generic +file transaction library. Bound each replacement by its existing file limit +and the recovery record by the sum of those limits plus bounded metadata. +Reject a recovery record with foreign paths, invalid contents, missing +replacement data, or unsafe permissions. Never log its secret +contents. Exercise real crash points before and after the commit decision. + +### Durable facts + +Creation provenance, turn-terminal retention, workspace intent, and login +admission are durable. Their owners migrate their records before actors start. +Migration failures stop startup before admitting work. + +For a session created before provenance was stored, expose unavailable +provenance explicitly. Do not infer its original request from its current name, +workspace, or model. Existing history, forks, and attachments remain usable. +Such a session returns `creation: null` in the single target schema and cannot +prove a matching identified creation. + +Login intent comparison includes private form values. Use a keyed fingerprint +with a protected, persistent daemon-owned key rather than a publicly readable +hash of a low-entropy password. Do not persist callback codes or access tokens +in admission records. The OAuth owner removes fingerprint metadata when the +record expires; the credentials owner continues to own resulting accounts. diff --git a/docs/http-api-design.md b/docs/http-api-design.md new file mode 100644 index 000000000..00ba04052 --- /dev/null +++ b/docs/http-api-design.md @@ -0,0 +1,1580 @@ +# HTTP API design + +Status: implemented contract for daemon protocol 3. + +[openapi.yaml](openapi.yaml) owns the exact request, response, parameter, header, +and SSE payload shapes. This document owns behavior: ordering, atomicity, +retry, recovery, and resource ownership. Both documents must agree. +The OpenAPI version is a document-format version; daemon protocol 3 is a +separate compatibility decision. + +[API architecture](http-api-architecture.md) explains state ownership and settings +crash recovery. + +This document defines daemon protocol 3. The daemon and CLI use this contract +together. It defines no compatibility +aliases or legacy response readers. Changes to this contract require an update +here, a client impact review, and behavioral tests before implementation. + +The API serves terminal, web, and desktop clients. All current TUI features +remain available. Installation discovery, local launch, and the interactive +restart offer remain application policy, outside the API connection. + +The [resource map](#resource-map) lists routes. The [HTTP rules](#http-rules) +define authentication, errors, and retries. [Sessions](#sessions-and-durable-input) +and [SSE](#sse-delivery-and-recovery) define chat and recovery. +[Extension contracts](#extension-contracts) define optional domain operations. +The [feature checklist](#existing-feature-coverage) and +[behavioral verification](#verification) describe the supported workflows. + +## Design decisions + +- Resources own their data and operations. A screen does not get its own route. +- A session read includes the state needed to open a chat. A collection read + includes the state needed to browse sessions or draw an agent family. +- Ordinary HTTP requests perform changes. SSE delivers live updates. +- JSON and SSE use the same session resource URL, selected by `Accept`. +- Input IDs identify user intent across retries. Stream cursors identify an + actor lifetime and position. Transcript checkpoints identify durable history. + These identities are separate. +- Core operations have named, typed contracts. Extensions own separate domain + routes. A command menu entry points to its canonical operation. +- The daemon owns execution state, argument parsing, storage inspection, and + progress. Clients own navigation, rendering, local drafts, and confirmations. +- Bounds apply before subscriber mailboxes. Model execution does not wait for + a client to read its socket. + +SSE is the sole core streaming transport. The current UI needs server-to-client +updates, and SSE retains the existing replay and bounded delivery design. +This contract does not add WebSocket authentication or subscriptions. +It makes no claim that changing route organization reduces CPU or memory. + +### Reading and changing the wire contract + +Each OpenAPI operation names its request and accepted response schemas. +Required properties are listed explicitly. Nullable fields accept JSON null; +optional fields may be omitted. Requests reject unlisted fields. Response +schemas describe what the server emits; clients may ignore new fields. +Tool, provider-private, and extension-specific bodies use the explicitly named +`DynamicJSON` schema. Core resource envelopes have typed fields. + +SSE `itemSchema` describes a parsed event whose `data` string contains JSON. +Decode that string and validate its `contentSchema` separately. Ordinary schema +validation does not assert string-encoded content. The wire contract uses +[OpenAPI 3.2 streaming definitions](https://spec.openapis.org/oas/v3.2#special-considerations-for-server-sent-events). +The `x-max-utf8-bytes`, `x-max-encoded-bytes`, and content-byte annotations +record byte limits that also need explicit runtime checks. JSON Schema +`maxLength` counts Unicode code points, not encoded bytes. + +Agree on a shape by editing the operation and its shared schemas, adding a +complete example, and reviewing the affected behavior here. Validate the +document and examples before changing either implementation. Validate real daemon replies and decoded SSE batches in workflow tests; +shape validation does not prove ordering, atomicity, or safe retry. + +## Resource map + +The tables list every platform path template. Extension paths appear in their +own section. An omitted method is unsupported. `GET` defaults to JSON. + +| Path | Methods | Responsibility | +| --- | --- | --- | +| `/server` | GET | Readiness, protocol, capabilities, build, quota, notices | +| `/server/shutdown` | POST | Explicitly stop the identified daemon instance | +| `/settings` | GET, PATCH | Shared defaults, provider profiles, MCP, secrets, UI preferences | +| `/storage` | GET | Online storage accounting | +| `/sessions` | GET | Filtered session summaries, or collection invalidations over SSE | +| `/sessions/{session_id}` | PUT, GET, PATCH, DELETE | Create, attach, configure, delete, or watch a session | +| `/sessions/{session_id}/visits/{visit_id}` | PUT | Count one deliberate opening without counting retries | +| `/sessions/{session_id}/inputs/{input_id}` | PUT, GET | Admit immutable user input and read its durable outcome | +| `/sessions/{session_id}/inputs/{input_id}/cancel` | POST | Cancel that input or request interruption of its exclusive turn | +| `/sessions/{session_id}/interrupt` | POST | Interrupt a captured turn and cancel captured waiting inputs | +| `/sessions/{session_id}/history` | GET | Bounded transcript pages or checkpoint summaries | +| `/sessions/{session_id}/history/{entry_id}` | GET | Read full content of a large transcript entry in bounded pieces | +| `/sessions/{session_id}/context` | GET | Prepared request inspection and provider request records | +| `/sessions/{session_id}/catalog` | GET | Fresh discovery and separately identified loaded composition | +| `/sessions/{session_id}/reload` | POST | Reload session composition, model catalogs, or both | +| `/sessions/{session_id}/kernel/upgrade` | POST | Explicitly replace this session's Python kernel | +| `/sessions/{session_id}/compaction` | POST | Compact the model-facing conversation | +| `/models` | GET | Provider model metadata, effort choices, context limits, cache policy | +| `/workspaces` | GET | Recent workspaces or one directory with optional repository preview | +| `/hosts` | GET | Known hosts or one host's cached probe state | +| `/hosts/{host}/probe` | POST | Explicitly refresh a host probe | +| `/auth` | GET | Provider login methods and redacted account metadata | +| `/auth/logins/{login_id}` | PUT, GET, PATCH, DELETE | Start, inspect, answer, or cancel a provider login | +| `/auth/accounts/{account_id}` | DELETE | Remove a provider account | + +There is no generic request endpoint, command dispatcher, operation lookup +route, separate status route, preview route, agent tree route, or stream suffix. +The underlying durable admission records remain owned by the daemon. Their +public representation is the session or input whose identity they protect. + +### Opening a chat + +1. Use the supplied base URL and bearer token to read `/server`. Check protocol + and required capabilities before opening a screen. +2. Read `/sessions` for the picker or family graph. Each row includes its + metadata and bounded live state. +3. Read the selected session. Install its history, pending inputs, status, + progress, and cursor together. Count a deliberate opening with one identified + visit; background reads do not count. +4. Watch that same session URL as SSE, passing the installed cursor pair. + Apply subsequent events, or replace the daemon-derived view on reset. +5. Send a message with an identified input PUT. Keep its local handle until + the returned decision or matching stream event resolves it. Cancellation + targets that input identity. +6. Fetch older history by durable position. Open context, catalog, or extension + resources when the user needs them. Use the validator already displayed + with a resource when editing it. + +## HTTP rules + +### Addressing and authentication + +A client receives a base URL and daemon bearer token. Native local clients may +read the protected discovery record. Other clients receive both values through +explicit connection setup. No API method reads client installation files, +launches a daemon, or replaces one. + +Every platform request, including SSE, uses +`Authorization: Bearer `. The token grants operator access to this +daemon. This protocol has no user accounts, tenant isolation, or session ACLs. +Provider OAuth accounts are model-provider credentials, not daemon identities. +Browser OPTIONS preflights are the exception to bearer presentation. They +return only allowed request metadata and cannot read or mutate resources. + +The default listener remains loopback. Connections across an untrusted network +require HTTPS or an encrypted tunnel. Tokens never appear in URLs, response +bodies, diagnostic logs, or stream events. + +Browser clients use `fetch` for JSON and SSE so they can send the authorization +header. Native `EventSource` does not expose arbitrary request headers. +[The SSE specification](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface) +defines its constructor and stream format. + +Browser access uses an operator-configured list of exact allowed origins. +The daemon validates `Origin` before routing or reading a body. Allowed +preflights advertise the supported method and headers, including `Authorization`, +`Content-Type`, `If-Match`, and `If-None-Match`. Responses vary by `Origin` and +expose `ETag`, `Location`, and `Retry-After`. There are no authentication cookies +or wildcard origins. Origin approval does not replace the bearer check. +This follows the [Fetch CORS protocol](https://fetch.spec.whatwg.org/#http-cors-protocol). + +The daemon validates the requested host against its listener and configured +public addresses. A supplied origin or host never grants additional permission. +Optional extension intake routes declare their own authentication policy. + +### Encoding, limits, and pagination + +JSON uses UTF-8, `snake_case` field names, and tagged objects for variants. +IDs are opaque strings. Paths and query values use ordinary percent encoding. +Core timestamps are UTC RFC 3339 strings. Unknown historical timestamps are null. +Durations use explicitly named units. +Counters and sequence numbers are integers from zero through `2^53 - 1`. + +Unknown request fields, duplicate JSON keys, invalid enum values, malformed +query values, and unknown query parameters return `400 invalid_request`. +Requests do not silently substitute defaults for invalid values. Unknown +response fields may be ignored. Missing required fields and invalid known +variants fail decoding. + +`PATCH` uses `application/merge-patch+json`. Omission keeps a value, `null` +removes an override or optional value, and `false` remains a real value. +Arrays replace the complete array. Writable fields are listed for each resource. +[JSON Merge Patch](https://www.rfc-editor.org/rfc/rfc7396.html) +defines these rules. + +Ordinary JSON request bodies have a 64 KiB limit. Input admission has a +9,200,000-byte limit, including encoded images. JSON responses and SSE data +frames have a 1 MiB limit. Resource-specific limits below apply as well. +HTTP body framing accepts valid fixed-length and chunked requests, enforcing +the same byte limit while reading. Ambiguous framing, unsupported content +encoding, and incomplete bodies fail without executing the operation. + +Lists return `{ "items": [], "next": null }`. `next` is an opaque continuation +token tied to the query and representation, including `limit`. Follow-up requests +retain the original query and add `next`. Default `limit` is 50; maximum is +200. Each page also respects its encoded byte limit, including JSON escaping. +Catalog entries, glances, input outcomes, and reset snapshots obey that bound +even when their item counts fit. Large content uses its documented paging path; +summary text is shortened explicitly. A single catalog entry is at most 64 KiB. +Session glances include at most 16 entries of 8 KiB each. Tokens never contain credentials +and cannot authorize access. A token for another query returns `400`. +Missing singleton resources return `404`; an empty collection returns `200`. + +Collection traversal uses a stable sort key and ID as its tie breaker. +Sessions use most recent activity first. A traversal is not a frozen global +snapshot: concurrent edits can move rows. Clients key rows by ID and refresh +on invalidation. History traversals use immutable transcript positions and +do not have this limitation. + +### Revisions and errors + +An `ETag` validates the complete selected JSON representation. Configuration +has a separate representation from volatile session state. Session reads expose +the URL and validator for `view=configuration`; settings reads expose the URL +and validator for each `group`. Editing those representations uses `If-Match` +without conflicting with unrelated progress or another settings group. +Extension item reads likewise expose the item's observed URL and validator. + +`PATCH` and conditional `DELETE` require the observed `If-Match`. Missing +preconditions return `428`; stale ones return `412`. Checks and the corresponding +commit occur under the owning resource's serialization or transaction boundary. +Validators are opaque; clients never derive them from an integer revision. +Mutation envelopes carry new resource validators explicitly and are not cached +as canonical read representations. + +Errors use `application/problem+json`, with `type: "about:blank"`, `title`, +`status`, `detail`, and a stable Albedo `code`. An optional `fields` array +contains JSON pointers and safe explanations. Decisions described below can +add a typed `decision` field. Clients branch on status and code, never wording. +Raw request bodies, secrets, and provider responses do not appear in errors. +[Problem Details](https://www.rfc-editor.org/rfc/rfc9457.html) +defines the common envelope. + +| Status | Meaning | +| --- | --- | +| 200 | A read or synchronous operation returned its documented result | +| 201 | A resource was created; `Location` identifies it | +| 202 | Input is durably accepted, or an explicitly identified action is underway | +| 204 | A deletion or cancellation needs no response body | +| 400 | Invalid syntax, fields, query, or identity timestamp | +| 401 | Missing or invalid daemon token; includes `WWW-Authenticate: Bearer` | +| 403 | Disallowed browser origin or caller permission | +| 404 | Unknown current resource or disabled extension route | +| 405 | Known path, unsupported method; includes `Allow` | +| 406 | Unsupported response media type | +| 409 | Busy state, identity conflict, stale catalog, or incompatible operation | +| 410 | Retained deletion, expired identity, or obsolete prepared context | +| 412 | The observed representation or creation precondition no longer holds | +| 413 | Body exceeds its limit | +| 415 | Unsupported request media type | +| 428 | Required precondition is missing | +| 429 | Admission or rate limit; includes `Retry-After` where a later new intent can succeed | +| 503 | Owner, storage, or upstream preparation is unavailable | + +All authenticated data responses use `Cache-Control: no-store`. Clients may +keep in-memory resource state and validators. Errors after SSE headers use the +stream failure contract rather than pretending to change the HTTP status. + +### Retries and cancellation + +Reads can retry transient connection failures with capped backoff and jitter. +They remain subject to the caller's deadline. Authentication and protocol +errors are actionable failures, not evidence that a daemon is absent. + +Session creation, input admission, visits, and login creation retain the +original ID and encoded intent during recovery. Other changes have no automatic +replay after a lost response. A precondition or a resource-specific identity can +make an explicit retry safe, as specified below. + +Canceling a client context stops its requests and subscriptions. It does not +undo an accepted input, interrupt a shared turn, stop a detached daemon, or +authorize replacing one. Those are separate operations. Transport cancellation +after a mutation was sent can leave its outcome uncertain. + +## Server, settings, and storage + +### Server identity and shutdown + +`GET /server` returns `instance_id`, `protocol`, `state`, `capabilities`, +`build`, `digest`, `extensions`, `quota`, and `notices`. `state` is `ready` or `draining`. +`instance_id` changes at each daemon startup. `build` and `digest` are nullable update +information. Attachment requires protocol 3; optional operations check the +advertised capability before invocation. + +Capabilities are a map from stable feature names to integer contract versions. +The required version-1 features are `durable_inputs`, `session_replay`, +`collection_invalidation`, and `tool_progress`. Optional features include +`context`, `catalog`, `workspace_browsing`, `host_probes`, `provider_auth`, and +`storage_report`. Extension entries identify enabled services and their +contract versions. Builds cannot substitute for protocol compatibility. + +`quota` contains the latest recorded observations per account and limit. Each +observation includes durable sequence, provider and account labels, limit ID, +plan, observed percentage, window, reset time, scope, status, source, and safe +failure details. Unknown percentage is null. `include=quota_history` adds the +same records newest first, paged by `limit` and `next`. +Notices have `id`, `kind`, and `message`; dismissal is a shared UI setting and does not consume a read. + +`POST /server/shutdown` accepts `instance_id` and `timeout_ms`, default 5,000 +and maximum 30,000. A different instance returns `409 instance_changed`. +The daemon marks itself draining, refuses new admissions, stops active turns, +flushes durable state, and closes. Accepted waiting inputs remain durable for +the replacement daemon. `202` reports `instance_id` and `state: "draining"`. +The client observes closure with a bounded wait. It cannot use this endpoint +to start the replacement. + +The interactive CLI still offers to keep or restart a discovered daemon. +Keeping it is the default. Its approved instance identifies the shutdown +target. [Daemon attachment and local startup](daemon-lifecycle.md) owns this +user flow and deliberate operator overrides. + +### Shared settings + +`GET /settings` returns these groups and `group_resources`, a map of group +name to canonical URL and `etag`. `GET /settings?group={name}` returns just +that group's canonical representation and its `ETag` header. + +| Group | Fields and meaning | +| --- | --- | +| `providers` | `default_profile` and `profiles` keyed by name. Profiles contain provider extension, endpoint, default model, effort, nullable image edge, nullable OAuth account, and `has_key`. | +| `mcp` | `definitions` keyed by name: configured enablement, transport, URL or command with arguments, nonsecret environment and headers, timeouts, and secret-presence metadata. | +| `extensions` | Global default enablement keyed by extension name. | +| `capabilities` | Global skill, instruction, and MCP preferences keyed by their stable preference key. | +| `models` | Per-model raised context choices and the cache TTL prior table, with source and units. | +| `ui` | `thinking`, `tools`, and `dismissed_notices`. Per-session pin, archive, and visits are session fields. | + +`PATCH /settings?group={name}` changes exactly one group per request. Its body +is a merge patch of that group's fields, with the observed group `If-Match`. +The group owner checks its validator in the same commit boundary. It validates the +entire patch before effects and commits that group's desired state atomically. +Provider profile data and its secrets have one settings owner; MCP definitions +and their secrets have another. Their persistence must recover the complete +old or complete new group after a crash, including when storage uses files. +A multi-group patch returns `400`; there is no partial PATCH success. + +Provider keys and MCP secrets are write-only patch fields. Provider +`api_key`, MCP `bearer_token`, and individual secret header or environment +entries accept a replacement string or `null` for removal. Omission retains +the existing secret. Reads return presence and secret names, never values. +Response-only presence fields are rejected on writes. + +MCP changes validate the candidate connection before saving. A failed probe +keeps the previous definition and secrets. This removes the client-side +save-then-undo sequence. A request can deliberately set `validate_connection` +to `false`; that control is not persisted. The response reports validation +state and safe diagnostics. + +Changing a profile does not implicitly select it. Changing +`providers.default_profile` explicitly sets the default for new sessions. +Changing a per-model raised-cap choice affects that model's next prepared +requests across sessions. `models.raised_caps` maps returned `cap_key` values +to booleans: true uses the advertised maximum, false uses the ordinary limit, +and null removes a choice. Missing choices default to false. Clients do not +construct cap keys. Existing requests keep their captured settings. + +Global capability selection accepts `catalog_session_id`, `catalog_revision`, +and candidate-ID `choices`; the daemon resolves the IDs to preference keys. +The read representation exposes persisted preferences. These write-only +selection fields prevent stale discovery from changing a different file. + +The provider group uses these exact profile fields: `extension`, `endpoint`, +`protocol`, `model`, `effort`, `image_edge`, `account_id`, and response-only +`has_key`. Protocol is `responses` or `chat_completions`. Nullable fields keep +their documented absence; model and extension are required on creation. +Deleting a profile removes its key. Removing the selected default requires +an explicit replacement or `default_profile: null` in the same atomic patch. + +For example, a provider-group patch selects a profile explicitly: + +```json +{ + "default_profile": "personal", + "profiles": { + "personal": { + "extension": "openai", + "endpoint": "https://provider.example/v1", + "protocol": "responses", + "model": "chosen-model", + "effort": null, + "image_edge": null, + "account_id": null, + "api_key": "replacement-secret" + } + } +} +``` + +An MCP definition has `enabled`, `transport: "stdio"|"http"`, `command`, +`arguments`, `cwd`, `url`, `environment`, `headers`, `bearer_token_env_var`, +`enabled_tools`, `disabled_tools`, `startup_timeout_ms`, and `call_timeout_ms`. +Transport selects the applicable command or URL fields. Environment and header +values are tagged `{ "source": "literal"|"env", "value": ... }`. Environment +references resolve on the daemon host. Tool filters preserve the current MCP +allow and deny controls. Definition enablement defaults to true. + +Writes add a `secrets` object containing `bearer_token`, `environment`, and +`headers`. Secret maps accept replacement strings and per-key null removals. +Reads replace that object with `secret_presence`, containing bearer presence +and the two lists of names. Deleting a definition deletes its associated secrets. +Candidate validation rejects duplicate environment or header names across public +and secret maps. Header names compare case-insensitively. It also rejects more +than one bearer source: `bearer_token_env_var`, `secrets.bearer_token`, or an +Authorization header. Switching sources requires removing the old source in +the same patch. The validated connection uses the candidate's resolved values. +`validate_connection` is a write-only group control, outside definitions: + +```json +{ + "validate_connection": true, + "definitions": { + "example": { + "enabled": true, + "transport": "http", + "url": "https://tools.example/mcp", + "secrets": { + "bearer_token": "replacement-secret", + "headers": {"X-Old-Key": null} + } + } + } +} +``` + +MCP capability preferences are separate from configured enablement. Effective +selection uses the session override, then the global preference, then true. +A definition with `enabled: false` remains unavailable regardless of selection. +Global MCP preference changes use the same catalog revision guard as global +skill and instruction choices. Other group writes use `extensions.defaults`, +`models.raised_caps`, or `ui.thinking`, `ui.tools`, and `ui.dismissed_notices`. +Capabilities read as `preferences` keyed by stable preference key; their +write-only selection fields are siblings in the capabilities group. + +Every successful patch returns `{ "group": ..., "resource": ..., "application": ... }`. +`resource` contains the updated value, canonical URL, and validator. +`application` includes desired revision, active service revision, +`needs_reload_count`, up to 200 affected session IDs, `more`, and warnings. +`GET /sessions?needs_reload=true` provides the complete paged set. +Persisted defaults do not claim that every open +session reloaded. Global services use the new desired state on subsequent +requests. Sessions apply composition through their explicit reload operation. + +### Storage accounting + +`GET /storage` returns `database`, `sessions`, `images`, `files`, and +`measured_at`. Session items include ID, title, workspace, creation and activity +timestamps, and estimated content bytes. Images report shared count and bytes. +Database fields include main-file bytes, WAL plus SHM bytes, page size, total +pages, free pages, and estimated used bytes. Files contain daemon-owned state +file categories, sizes, and cleanup-candidate metadata. +The database keys are `main_file_bytes`, `wal_bytes`, `page_size_bytes`, +`page_count`, `free_page_count`, and `used_bytes`. Sessions have +`estimated_content_bytes`; shared images have `count` and `bytes`. + +Session estimates count pinned context, transcript content, cell sources, +payloads, and traces. Shared images count once outside session estimates. +Estimates do not claim allocated disk space per session. Database measurements +share one read boundary; filesystem measurements describe the inspection period. +Session and file lists use separate `next` tokens within this response, with +each token identifying its section. Totals always cover the complete store. + +An online client needs no filesystem or Python access. Returned paths describe +the daemon's files and never authorize local deletion. Offline diagnosis and +approved cleanup remain explicit local operations under the ownership lock. + +## Sessions and durable input + +### Session representations + +`SessionSummary` contains `id`, `name`, `automatic_name`, `workspace`, `parent_id`, +`root_id`, `address`, `depth`, `closed`, `created_at`, `activity_at`, +`provider_profile`, `model`, `effort`, `status`, `preview`, `preferences`, +`current_progress`, `activity`, and `cursor`. Each summary captures its own +status, progress, activity, and cursor together. Family `address` stays stable +when display name changes. + +`status` contains `phase`, nullable `run_id`, `interrupt_requested`, and a +nullable safe `blocking_reason`. Phases are `idle`, `preparing`, `generating`, +`running`, `interrupting`, and `compacting`. `preview` has at most 256 Unicode +scalar values and 1,024 UTF-8 bytes, and includes the durable transcript row count. +One transcript row can produce several history entries. Continuation markers +do not add transcript rows. +`preferences` contains `pinned`, nullable `pin_order`, `archived`, and `opens`. +Pin order preserves the shared ordered pin list. Pinning assigns its order once; +repeating `pinned: true` does not move the row or increment anything. +Unpinning clears the order. Only `pinned` and `archived` are writable; opens +and pin order are read-only. + +`activity` provides the agent graph's live tails without a session subscription +for every node. It contains up to 12 `lines`, each with `kind` and `text`. +Kinds are `assistant`, `thinking`, `tool`, `input`, `note`, and `error`. +The current partial line is included. Each line has at most 256 Unicode scalar +values and 1,024 UTF-8 bytes; the complete encoded activity object is at most +16 KiB, shortening oldest lines first. Tool-argument previews stay in +`current_progress` and are not copied into these lines. + +Activity also includes `output_scalars`, `output_utf8_bytes`, and `observed_at`. +The counters cover generated text and reasoning in this actor generation. +Clients derive display rates from successive samples and decay them while +quiet. Nullable `latest_input: { "input_id": ..., "source": ..., "bytes": ... }` +and `latest_answer: { "message_id": ..., "bytes": ... }` let clients animate +new human input and completed root answers by identity. Input source is `chat`, +`agent`, or `system`; bytes count UTF-8 display text. Initial reads install +these identities without replaying old animations. The actor maintains this +bounded activity once, before subscriber fan-out. Full content stays in history. + +`Session` adds: + +- `creation`, the immutable submitted creation intent and separately resolved defaults. +- `revision` and `family_revision` for conditional edits and family operations. +- `configuration_resource`, containing its canonical URL, value, and `etag`. +- `workspace_change`, nullable desired versus active workspace and deferred state. +- `selection`, containing session overrides and effective selections. +- `composition`, containing desired and loaded revisions, `needs_reload`, + dependencies, quarantine diagnostics, and capability availability. +- `kernel`, containing state, build identity, staleness reasons, and live-job + count. No Python variables or process handles leave the daemon. +- `pending_inputs`, at most 32 bounded input summaries with acceptance order, + and `input_order`, the greatest order ever accepted into this session. +- `usage`, including token and cache counters, elapsed time, model limits, + observed cache TTL, and time-indexed cache fade observations. +- `history`, a bounded recent page, with its older-page token. +- `cursor`, the generation and sequence captured with the live state. +- `glances`, bounded extension-provided summaries and links to their resources. + +`input_order` is zero before the first admission. + +Pending summaries include input ID, kind, display preview, admission time, +acceptance order, delivery state, and blocking reason. They omit image content +and expanded model input. Collection summaries and detail reads do not parse +tool arguments or reconstruct previews. + +### Collection reads + +`GET /sessions` accepts `scope=roots|all` and optional `parent_id`, `family_id`, +`workspace`, `search`, `archived`, and `needs_reload`. The parent and family +filters are mutually exclusive. `family_id` selects the containing root +and all descendants. `search` matches display names and ID prefixes. +`sort=activity|frequent` defaults to activity; frequent sorts by opens, activity, +and ID. Pinned state remains available for client grouping. + +Parent and family queries default to `scope=all`; other queries default to roots. +An explicitly supplied `scope=roots` with a parent or family filter returns `400`. +The result is a page of `SessionSummary` objects. A family query also returns +`family: { "root_id": ..., "revision": ... }`. Agent trees are drawn from +`parent_id`, `address`, and `depth`; there is no second agent identity or graph +endpoint. Clients can traverse all pages. A missing requested family returns +`404`, while an existing parent with no children returns an empty page. + +`Accept: text/event-stream` selects the collection watch described below. + +### Creation, forks, and children + +`PUT /sessions/{session_id}` requires a fresh client-generated UUIDv7 and +`If-None-Match: *`. Its body is one creation variant: + +| `kind` | Fields | Behavior | +| --- | --- | --- | +| `new` | `workspace`; optional `name`, `provider_profile`, `model`, `effort` | Create an independent session. | +| `fork` | `source_session_id`, `checkpoint_id`; optional `name` | Copy the durable prefix and selection overrides into an independent session. | +| `child` | `parent_id`, `address`, `name`, `initial_input_id`, `task`; optional `model`, `effort` | Create a family member inheriting workspace and provider, with an initial durable task. | + +The daemon resolves defaults once at first admission. Child creation, family +membership, creation decision, and initial input admission commit together. +A rejected task leaves no orphan child. The child task is ordinary identified +user input. Forks preserve full durable tool arguments and results, image +references, captured execution traces, continuation boundaries, and selected extension overrides. +They copy no Python namespace, live jobs, progress, or usage totals. The daemon +closes incomplete tool exchanges at the chosen checkpoint using its existing +history rules. + +Success returns `201` with `Session`, its `Location`, and `ETag`. A retained +rejected creation returns its original problem and admission status on retry. +An existing session fails the create precondition with `412`. Recovery reads +the session and compares `creation.submitted` structurally with the original +intent. Optional creation fields absent from the request appear as null in +this descriptor. String contents stay exact. Matching intent proves creation; +a different intent is an ID conflict. Resolved workspace and provider defaults +appear in `creation.resolved` and do not change the submitted descriptor. +Current model, title, or workspace cannot replace that provenance check. +Sessions stored before immutable provenance was recorded return +`creation: null`. They remain readable, editable, and forkable, but cannot +prove a matching creation request. Migration never invents submitted intent +from their current configuration. Every newly admitted creation has provenance. +Conditional creation follows +[HTTP If-None-Match semantics](https://www.rfc-editor.org/rfc/rfc9110.html#section-13.1.2). + +Creation decisions and deletion tombstones remain queryable at the same URI. +Rejected creation reads return their original problem with `decision` metadata; +deleted session reads return `410 session_deleted` with creation provenance. +An unknown young ID returns `404`, which cannot prove an in-flight PUT will +never commit. Recovery retains the same intent and identity. + +`GET /sessions/{session_id}` returns `Session`. `tail`, default 100 and maximum +200, selects the recent history window. The byte bound can shorten the window. +Status, progress, pending ownership, and the cursor share one session-actor +capture. History is read through that capture's durable high-water mark. +The configuration view does not accept `tail` or stream cursor parameters. + +### Changes, visits, and deletion + +`GET /sessions/{session_id}?view=configuration` returns only editable metadata, +preferences, overrides, revision, and family revision, with a strong `ETag`. +The full session read embeds this same value and validator for an edit. +`PATCH /sessions/{session_id}?view=configuration` accepts `name`, `provider_profile`, +`model`, `effort`, `preferences`, and `selection`. An empty or null name restores +the automatic title for a root, or the original family name for a child. +Pin and archive changes are shared preferences. Model and +composition changes require an idle session. Selection maps accept true, +false, or null to clear the override and inherit the global default. +A patch enabling one compaction strategy clears competing earlier true +overrides to inheritance; enabling multiple strategies in the same patch +returns `400 selection_conflict`, and explicit false or null choices keep +their meaning. +When model or profile changes without an explicit effort, keep a supported +current effort, then try the profile default and model default. An explicit +null clears effort; an explicit unsupported level fails validation. +Selection has `extensions`, `skills`, `instructions`, and `mcp` maps keyed by +their catalog IDs. MCP entries enable or disable installed server definitions; +their IDs are stable definition names. Definitions and secrets belong to shared +settings. Skill and instruction choices additionally include the write-only +`catalog_revision` from the discovery read. +A stale catalog returns `409 catalog_changed`. +The session owner prepares a valid candidate before committing the patch. +Editable session data and preferences commit together through the store owner. +The result includes the new configuration resource and captured session state. +PATCHes set explicit values; they never toggle or increment preferences. + +For example, a session selection patch clears one override and disables a skill: + +```json +{ + "selection": { + "extensions": {"browser": null}, + "skills": {"candidate-123": false} + }, + "catalog_revision": "observed-discovery-revision" +} +``` + +Workspace changes use the same PATCH with `workspace` as its only change, +alongside the observed `family_revision` as a write-only precondition. +The daemon validates the destination and captures following descendants under +the family revision. A busy target session returns `409 session_busy` before +any move; the UI retains its deferred move intent. An idle parent can move while +a descendant is busy. Destination metadata and deferred descendant intents +commit in one store transaction before kernel cleanup. Busy descendants finish +their captured turn in the old workspace and apply the new workspace at idle. +Their `workspace_change` reports desired location, active location, and state +`deferred` or `applying`. This intent survives client disconnect and daemon restart. + +The move preserves transcript and family addresses, resets affected kernels +and Python namespaces, and returns applied and deferred counts, bounded ID +lists, `truncated`, and cleanup warnings. When truncated, clients refresh the +family rather than repeating a move to discover its result. +Cleanup failure cannot be reported as rollback of a committed move. +Affected sessions cannot begin a new turn in an old kernel after the commit. +A later explicit move supersedes the earlier desired location by revision; +a delayed completion cannot restore an older choice. New descendants inherit +the parent's desired workspace at their admission. + +Model selection does not implicitly change the default for new sessions. +The TUI's model picker explicitly updates the shared default when appropriate. +A later default or cap failure leaves a confirmed session model change visible. + +`PUT /sessions/{session_id}/visits/{visit_id}` accepts an empty object and counts +one deliberate attachment. Repeating the UUIDv7 returns the same count without +incrementing it again. Background refreshes do not create visits. Reads never +change opens. Deleted sessions cannot be revived by a visit. + +`DELETE /sessions/{session_id}?view=configuration` defaults to `scope=leaf`. +It requires the configuration `If-Match`, an idle session, and no children. +`scope=subtree` also requires +the `family_revision` query parameter from the family read. The daemon captures exactly that +membership, prevents new child admission during this operation, interrupts +members, cancels pending inputs, and deletes deepest first. + +Deletion returns `200` with `state: "complete"|"partial"`, `deleted_count`, +`remaining_count`, `deleted_ids`, and `remaining` objects containing ID and +safe reason. Counts cover the captured operation; lists contain up to 200 +IDs each and can shorten further to meet the byte limit, with `truncated: true`. +Clients refresh the authoritative family or read known deletion tombstones. +They never repeat deletion to page its result. Partial deletion is visible. +Any successful deletion changes the family revision. A retry with the old +revision cannot broaden the operation or delete new descendants. The client +refreshes and confirms the remaining membership before a new deletion attempt. +This operation has no automatic replay after transport loss. + +### Input admission and outcomes + +`PUT /sessions/{session_id}/inputs/{input_id}` uses a client UUIDv7. The body +has optional `client_id` for echo correlation and exactly one variant: + +| `kind` | Fields | +| --- | --- | +| `message` | `text`; optional `image` with `mime_type` and base64 `data` | +| `continue` | No content fields | +| `skill` | `candidate_id`, `catalog_revision`, and `arguments` as text | +| `command` | `command_id` and typed `arguments`; only a catalog entry with `delivery: "input"` | + +A message requires nonblank text or an image. Images accept PNG, JPEG, GIF, +and WebP, subject to decoding, dimension, and selected-provider bounds. The +daemon preserves original upload metadata and the full durable payload. +Provider-specific fitting stays daemon-owned and appears in durable history. + +Command inputs prepare a user turn. They do not invoke arbitrary management +handlers. Their preparation produces content, runs outside the session actor, +and persists the resolved content before transcript consumption. Preparation +must be repeatable without external side effects. An extension that performs +effects exposes its own domain operation instead. + +The first accepted PUT returns `202` with `Input`. An identical PUT returns +the retained admission decision and current delivery state, using the original +admission status. Changed intent under the same ID returns `409 input_conflict`. +Echo-only `client_id` does not change identity. Lookup happens before current +workspace, skill, provider, and queue validation. Defaults and skill content +resolve once. Rejected decisions are durable, including `429 queue_full`. + +`GET /sessions/{session_id}/inputs/{input_id}` returns the known decision even +after session deletion. `Input` contains `id`, `session_id`, `kind`, +`admission`, `accepted_at`, `acceptance_order`, `delivery`, +`blocking_reason`, `transcript_position`, and nullable `turn`. Admission is +`accepted` or `rejected`; rejected admission includes the original safe problem +and HTTP status. Delivery is `pending`, `committed`, or `cancelled`, and is +null for rejection. A continuation has a durable position without a text row. + +`turn` identifies consumed turn membership and any durable terminal outcome: +`running`, `completed`, `interrupted`, `failed`, or `abandoned`. A restarted +daemon marks an unfinished previous run abandoned rather than claiming its +external effects completed. One turn can contain several inputs. Its nullable +`outcome` contains separately recorded detail; null means no detail was recorded. +Acceptance means safe storage. Commitment means transcript consumption. +Neither means that the assistant answered or a tool effect ran exactly once. + +There are at most 32 waiting inputs per session. A duplicate consumes no slot. +Consumption commits transcript rows, images, input delivery state, turn +membership, and pending removal in one store transaction. Failure leaves the +input pending. Preparation failure exposes a safe blocking reason; it cannot +install a successful delivery state. Waiting accepted inputs survive restart. + +Known pending identities and inputs belonging to an unfinished turn never +expire. An input becomes terminal only when delivery and its associated turn +are terminal. Its admission record remains for seven days after that point. +Rejected decisions become terminal at rejection. Live sessions retain creation provenance +for their lifetime. Deleted sessions retain tombstones for seven days. +Known decisions are checked first. Unknown UUIDv7 identities older than seven +days return `410 identity_expired` and cannot execute; identities more than +five minutes ahead return `400 identity_future`. This prevents recreation after +deduplication records expire. These rules also cover visit identities. + +Recovery queries the same input URI and may resend the exact same PUT within +the caller's deadline. `404` means unknown at the time of the read, not safe +to invent another ID. `410` stops automatic recovery and keeps an unresolved +UI row. A matching durable event can still reconcile that row later. + +### Targeted cancellation and interruption + +`POST /sessions/{session_id}/inputs/{input_id}/cancel` accepts an empty object. +It returns the current `Input` and one `result`: + +- `cancelled`: a waiting input was removed and its cancellation committed. +- `interrupt_requested`: its current turn belongs exclusively to this input. +- `shared_running`: other inputs share the active turn; the turn continues. +- `not_pending`: no waiting or interruptible exclusive work remains. + +Every input kind uses the same identity for admission, membership, and cancel. +This operation never interrupts a later unrelated turn. Repeating it reports +the current outcome of the same input, without resubmitting that input. + +`POST /sessions/{session_id}/interrupt` requires `run_id`, nullable, and +`through_input_order`, taken from the session snapshot. It cancels still-waiting +inputs at or below that order and requests interruption of exactly that run. +Newer queued inputs remain accepted. An already ended run is reported as ended; +a later run is never interrupted by retrying this request. Acceptance of an +interrupt request does not mean all external tools stopped. + +The result contains `run_id`, `state: "requested"|"already_ended"`, +`cancelled_input_ids`, and warnings. Interruption prevents new inputs joining +the captured run. Live status reports `interrupting` until the run ends. + +## History, context, catalogs, and runtime + +### Durable history + +`GET /sessions/{session_id}/history` accepts `view=entries|checkpoints`, default +entries, and one of `before`, `after`, or `next`. Positions are durable +transcript positions, unrelated to the actor cursor. Pages retain ascending +display order and include `older`, `newer`, and `high_water`. +Default entry count is 100, maximum 200, with a 256 KiB content budget. + +Each entry has stable `id`, `position`, `kind`, `turn_id`, `input_id`, +`created_at`, `content`, nullable `checkpoint_id`, and `content_complete`. +User entries, assistant answers, and tool calls expose checkpoints for their inclusive durable +transcript row. Calls packed into one row share a checkpoint; a fork cannot +split that row. Checkpoint view lists user turns for the TUI fork picker. +Recorded thinking duration is exposed as `thinking_duration_ms`; live thinking +completion can report `elapsed_ms`. These measure thinking, not the whole turn. + +Kinds are `user`, `assistant`, `thinking`, `tool_call`, `tool_result`, `note`, +`continuation`, `compaction`, and `image_fit`. Content is a tagged set of text, +JSON tool arguments or results, image metadata, and execution trace fields. +Tagged daemon notes retain their native origin as a JSON part with `field: "origin"`. +Tool names, native call IDs, normalized progress-call IDs, activity summaries, +and file diffs remain available. Provider-private fields are explicit opaque +data; clients do not reinterpret them as execution instructions. + +The daemon pages on complete display groups when they fit. A large group uses +content references rather than growing a response past its bound. Preview +truncation is explicit and never changes the stored content. Checkpoint view +contains position, valid checkpoint ID, title, turn type, and bounded preview. +It provides the TUI tree and fork picker without a separate tree route. + +`GET /sessions/{session_id}/history/{entry_id}` returns the full entry content +as pages of `parts`, each with `field`, `offset_bytes`, `text`, and `complete`. +Text and JSON fields use their exact stored UTF-8 encoding; offsets are bytes, +and pieces end on UTF-8 boundaries. Opaque `next` identifies the next piece. +Binary image parts use base64 with decoded-byte offsets. The decoded content +budget is 256 KiB per page. The daemon shortens a page further when JSON escaping +or base64 would reach the common encoded response bound. +Metadata identifies MIME type, dimensions, and original byte count. Clients +can reconstruct full arguments, results, and images without filesystem access. + +### Prepared context and request records + +`GET /sessions/{session_id}/context` defaults to `view=summary`. It describes +the latest actual prepared request, never prepares a new one. The summary has +`state: "pending"|"ready"`, nullable `snapshot_id`, capture time, provider, +model, protocol, context-window tokens, compaction observations, and sections. +Each section contains ID, label, kind, source, item count, UTF-8 byte count, +page count, and bounded preview. Pending state contains a reason. + +`view=section` requires `snapshot_id`, `section_id`, and a zero-based `page`. +A page has `text`, omitted-content explanation, page index, and page count. +Text has a 32 KiB UTF-8 limit and ends on a character boundary. Only the latest +snapshot is retained. If it changes during navigation, the old identity returns +`410 context_changed`; the client refreshes the summary. A page never silently +comes from another prepared request. + +`view=requests` returns paged provider request records. `after` is a durable +record sequence. Records include provider profile and account labels, model, +nullable run identity, timestamps, request kind, outcome, HTTP status, token +observations including reasoning and cache writes by TTL, cache marks, head and +projection hashes, input counts, compaction strategy, bounded safe failure +details, and links to source transcript positions. Unknown historical run +identity is null. Full provider request bodies and credentials are absent. +Estimated and observed token counts have separate fields and sources. + +`GET /models?view=cache-policy` reads the cache-policy table and its layer +diagnostics. Entries retain matching patterns, clock, tiers, prices, survival, +evidence, sources, and notes. `limit` and `next` page entries. Optional +`extension`, `host`, and `model` selectors return the first matching entry in +`matched`, independent of the displayed page. This view does not require a +provider profile and never connects to a provider. Catalogue view remains the +default. + +### Discovery and loaded composition + +`GET /sessions/{session_id}/catalog` returns `discovery` and `loaded` as +separate fields. Optional `kind=extensions|skills|instructions|mcp|commands` +filters entries without changing these identities. Discovery contains +`revision`, workspace, candidates, and diagnostics. It reflects current local files +and preferences. Remote files come from the last observed mirror; preparation +refreshes stale mirrors. Loaded contains its composition revision and prepared command +definitions. Reading discovery does not reload the prompt or start a kernel. +If desired discovery fails, `discovery` is null and `discovery_failure` contains +a safe reason. Retained loaded commands remain readable. Successful discovery +sets `discovery_failure` to null; clients need a discovery revision to edit selection. + +Candidates contain `id`, `kind`, `title`, `description`, lexical `source`, +nullable `resolved_source`, `preference_key`, `valid`, `eligible`, +`effective_enabled`, nullable global preference and session override, +`shadowed_by`, dependencies, quarantine state, and diagnostic. Extension candidates +also include typed context, tool, Python module, and plugin metadata for inspection. +Other candidate kinds return `extension: null`. +Selections use candidate IDs and the observed discovery revision. Paths are +daemon metadata, not client filesystem instructions. Diagnostics survive +missing, invalid, shadowed, and quarantined entries. + +Command definitions contain ID, slash name, description, typed argument +declarations, caller permissions, and `delivery: "read"|"mutation"|"input"`. +They identify either a canonical HTTP operation or a durable input variant. +There is no public endpoint that accepts an arbitrary slash command string. +The CLI parses slash syntax into the named operation; Python bindings call +the same domain owner with trusted model caller context. + +Optional page descriptors contain title, empty-state text, rows, glance, +and actions. Rows include ID, text, badge, tone, detail, and the observed +resource URL and `etag` for an editable item. Actions declare +label, optional keyboard hint, confirmation text, HTTP method, relative path +template, typed path, query, body, and header bindings, and result schema. +Path, query, and header binding keys name declared parameters. Body binding +keys are JSON pointers into the request object; they also support nested fields. +Bindings read a literal, the displayed row, submitted form, or installed session +snapshot. Form fields can declare `default_binding` with a `row` or `session` +source and JSON pointer to prefill an edit. The resolved value replaces the +literal default and must fit the declared field type. Missing optional form values omit their bindings. Result schemas +are JSON Schema 2020-12 fragments, without remote schema retrieval. +An edit binds `If-Match` to the row's observed validator. The adapter never +fetches a newer validator just to overwrite data from a stale screen. +Field types are text, secret, +boolean, choice, integer, or hidden literal. Descriptors cannot change retry +policy or authorization. The adapter rejects foreign origins and undeclared +extension routes. Extension-specific response content stays an explicit +dynamic JSON body, such as `json.RawMessage` in Go. + +### Reload, kernel upgrade, and compaction + +`POST /sessions/{session_id}/reload` accepts +`target: "session"|"models"|"both"`, default both. Session reload requires idle, +builds the candidate composition before swapping it, and retains the previous +composition on failure. Success preserves the Python namespace and pinned +prompt prefix, except where an extension's declared lifecycle requires restart. +The result includes loaded revision, restart requirements, and warnings. +Model reload reports success or failure per provider and keeps old catalog +data where refresh failed. It also reloads cache policy, reported separately as +`cache_policy` with state and failure; session-only reload returns null there. +`both` returns these outcomes explicitly; one +confirmed refresh is not hidden by failure of the other. + +`POST /sessions/{session_id}/kernel/upgrade` accepts an empty object and requires +idle. It stages the new kernel, reports the fate of live jobs, copies supported +namespace state, and swaps only after validation. Failure keeps the previous +kernel usable where the existing upgrade boundary permits it; stopped external +jobs are reported as stopped and cannot be claimed restored. The response +contains old and new identities, upgrade state, stopped jobs, and warnings. + +`POST /sessions/{session_id}/compaction` accepts an optional `strategy`. It +requires idle and compacts the model-facing projection without deleting +transcript history. A supplied strategy first becomes the session override. +The response reports `selection_applied`, the effective strategy, compaction +state, before and after counts, and safe failure details. A failed compaction +can retain a successfully selected strategy; the response preserves that fact. +Neither runtime action automatically retries an uncertain external effect. + +## Models, workspaces, hosts, and provider login + +`GET /models` requires `provider_profile`, or `provider` with optional +`endpoint` for a not-yet-saved profile. It always returns model objects, +never a mode-dependent array of plain IDs. Objects contain ID, label, effort +choices, default and effective context tokens, nullable maximum context and +output tokens, input modalities, image edge, raised state, and cache policy. +Unknown facts are nullable. Optional `model` returns a single metadata row +for a requested ID, including an unlisted manual ID and its `cap_key`. +Manual IDs remain accepted when the provider cannot enumerate them. +Metadata includes source and freshness. + +`GET /workspaces` without `location` lists recent canonical workspaces with +use counts and last activity. With `location`, it returns `directory`, child +directories, canonical parent, home, host state, and pagination. `include=preview` +adds repository facts, language shares, and a bounded two-level file tree. +Git and jj facts retain their distinct typed variants. A missing optional VCS +fact is null with a diagnostic, rather than loss of the entire directory. +The tree has at most 12 top-level entries and four children per directory; +`more` counts omissions. Local and SSH locations share this representation. +Paths are interpreted and canonicalized on the daemon's host. + +`GET /hosts` returns known SSH targets and cached state, optionally filtered by +`target`. State is `unknown`, `probing`, `ready`, `needs_auth`, `unreachable`, +or `unsupported`, with safe detail, observation time, OS, architecture, home, +and nullable authentication instructions. `POST /hosts/{host}/probe` starts +or joins one bounded probe and returns `202` with the host state. Repeated +probe requests coalesce. GET does not start SSH sign-in. + +SSH sign-in remains an explicit operator action. A local CLI can perform the +existing terminal handoff using daemon-supplied target and control-path +metadata after confirmation. A client on another machine displays instructions +for signing in on the daemon host. This API does not promise a browser terminal. +Filesystem failure codes distinguish missing workspace, needs-auth, +unreachable host, unsupported host, and permission denied. + +`GET /auth` returns login providers, their form fields and supported flows, +redacted accounts, and account selection metadata. It does not duplicate +credential values from settings. `PUT /auth/logins/{login_id}` uses UUIDv7, +with provider and declared typed form values. +The server records immutable login intent and returns URL, expiry, +`state`, and manual-input instructions. First creation returns `201`; +an identical PUT returns the existing flow with `200`. Changed intent returns +`409 login_conflict`. Same-ID comparison stays inside the daemon and includes +the private form values. A duplicate never starts a second flow. +Login secrets never appear in the read representation or its fingerprint +provenance fields. Fingerprints are server-created and are not exposed for +low-entropy login secrets. + +GET inspects that flow. `PATCH` supplies `response`, such as a pasted callback +URL or provider code, under `If-Match`. DELETE cancels it idempotently. States +are `waiting`, `exchanging`, `complete`, `failed`, `cancelled`, and `expired`. +Flow reads include bounded safe progress and globally unique opaque account +IDs that also identify their provider. Completed flows +return account metadata. Terminal flow metadata remains for 15 minutes, +uncompleted flows expire after their advertised provider deadline, and at +most eight flows are active. Duplicate creation never opens a second flow. +An expired or evicted ID cannot restart a flow. Unknown IDs older than the +15-minute flow recovery window return `410`. + +Login admission intent and terminal decisions survive daemon restart within +their retention window. A restart marks an unfinished flow `failed` with +`code: "daemon_restarted"`; it does not reuse a lost listener or exchange. +Repeating its PUT returns that retained failure. Starting again requires a +new login ID. The daemon retains only the protected secret material needed +for immutable-intent comparison and removes it when the record expires. + +OAuth callbacks stay on provider-required daemon-owned loopback listeners. +They validate provider state and PKCE where the provider supports it. Manual +callback input preserves remote-client usability. Secrets and callback codes +stay out of logs and SSE. Selecting an account updates a provider profile +through `/settings`; `DELETE /auth/accounts/{account_id}` refuses removal +while a saved profile still references it. It does not interrupt a running +request using captured credentials. + +## SSE delivery and recovery + +### Session watch + +`GET /sessions/{session_id}` with `Accept: text/event-stream` watches one +session. Initial attachment omits `after_generation` and `after_seq`. +Reconnect sends both from the last fully consumed batch. `tail` applies when +a snapshot is needed. JSON reads return the same cursor pair for subsequent +attachment. `Vary: Accept` distinguishes the representations. +A successfully installed JSON session snapshot counts as the initial reset. +Its cursor can seed the SSE watch after the snapshot callback succeeds. +Without an installed snapshot, the client omits the cursor and requires reset. + +A batch uses this envelope. `snapshot` appears only with a leading reset. + +```json +{ + "generation": "J6kYj6IGcXyP3eMIp-WL3A", + "cursor": 42, + "events": [ + {"type": "reset", "data": {"reason": "initial"}} + ], + "snapshot": { + "id": "019a0000-0000-7000-8000-000000000001", + "history": {"items": [], "older": null, "newer": null, "high_water": 0}, + "current_progress": [], + "pending_inputs": [] + } +} +``` + +The example shows the relevant snapshot fields; a real snapshot is the complete +`Session` representation defined above. Generation is a nonempty base64url +128-bit random identity created by the session actor initializer. Sequence is +a nonnegative integer in that generation. Empty keepalive batches carry both +values and an empty events array. Keepalives do not advance the event sequence. +The `data:` JSON is authoritative; this protocol does not use SSE `id` or +automatic `Last-Event-ID` recovery. + +The session checks generation equality before consulting numeric replay +bounds. Missing or different generation, or an unavailable sequence, requires +a durable snapshot reset. Malformed cursor components return `400` before +headers. A well-formed future or evicted cursor resets. The replay buffer +retains at most 256 events or 4 MiB, whichever bound is reached first. +An oversized event is represented by bounded history references. + +Registration and state capture serialize with session publication. A reset +captures state, bounded current progress, pending ownership, and replay cursor +together, then loads history through the captured durable high-water mark. +Capture publishes any pending coalesced progress or activity before choosing +the cursor. Live-state changes advance the actor sequence; one cursor cannot +identify conflicting status, progress, or activity replacements. +Events after that cursor remain eligible for replay. Slow snapshot loading +cannot silently skip an evicted interval: the subscription resets again or +closes with failure. Transcript loading failure emits failure and closes; +it never installs a successful replacement cursor. + +Client delivery follows these rules: + +1. Validate the complete batch, generation, sequence, and known event fields. +2. Require a leading reset on first attachment or a generation change. +3. On reset, replace visible recent history, pending state, and live progress. + Clear partial arguments and transient text from the previous stream. +4. Deliver all events in order. Same-generation replay cannot regress the + sequence without a reset. +5. Save generation and sequence together only after every callback succeeds. + +EOF and transient failures retain the last consumed pair. Explicit recovery +and cancellation clear it. A generation change with reset is ordinary recovery. +A change without reset is a protocol failure. The client can attempt one +cursor-free recovery; a second protocol failure is surfaced to the user. +Reset history is authoritative for its covered window. Previously loaded older +history remains accessible by durable positions and is deduplicated by entry ID. +Reset replaces daemon-derived views. It preserves local drafts and unresolved +creation or input handles, reconciling them only by matching identities. + +### Session events and progress + +Each event has `type` and `data`, its typed body. A published session event +also has `sequence`, its position in the generation. Control events reset and +failure have no sequence. Session identity is implicit in the +subscribed URL. Events within a batch are ordered. There is no ordering claim +between streams belonging to different sessions. A failure control appears +alone, without a snapshot, and terminates the stream even before attachment +has succeeded. Clients never treat it as a successful reset. + +For example, an incremental batch appends text: + +```json +{ + "generation": "J6kYj6IGcXyP3eMIp-WL3A", + "cursor": 43, + "events": [ + { + "type": "text", + "sequence": 43, + "data": {"run_id": "run-1", "message_id": "message-1", "text": "Hello"} + } + ] +} +``` + +Incremental event sequences increase contiguously from the requested cursor. +The batch cursor is the last published event represented by the batch. Clients +apply a batch atomically to local state or deduplicate already delivered events +by generation and sequence. This prevents duplication when an earlier callback +succeeds and a later callback fails before the batch cursor is saved. + +| Type | Body and behavior | +| --- | --- | +| `reset` | Reason `initial`, `generation_changed`, `replay_unavailable`, or `recovery`; requires the complete batch snapshot. | +| `status` | Current phase, run ID, interrupt state, and blocking reason. | +| `input` | `input`, a bounded `Input` outcome update, including membership and delivery changes. | +| `text` | Run ID, message ID, and appended assistant text. | +| `thinking` | Run ID, message ID, and appended reasoning text. | +| `message` | Completed display message with stable history entry identity. | +| `tool_progress` | `progress`, a normalized progress object, or null to clear all live progress. | +| `tool` | Completed call identity, progress identity, bounded arguments, result, trace, and full-content reference if needed. | +| `note` | Entry identity, origin, display text, and related family mail IDs where present. | +| `retry` | Run, provider attempt, safe reason, and retry delay in milliseconds; clears obsolete attempt progress. | +| `usage` | Typed token, timing, model-window, and cache observations. | +| `committed` | Durable high-water position that covers previously displayed events. | +| `turn_completed` | Run ID, terminal outcome, and input membership. | +| `compacted` | Strategy and observation, without replacing durable history. | +| `error` | Safe error code and message for the turn; not transport authentication. | +| `invalidate` | Resource kind and relative URL whose metadata changed. | +| `failure` | Stream error code; terminal, never advances the saved cursor. | + +Assistant text and reasoning are provisional until committed. Clients reconcile +completed entries by stable identity. Model retry can end an attempt without +creating another user input. Family mail events are durable notes with nullable +`mail: { "mail_id": ..., "sender_session_id": ..., "receiver_session_id": ..., +"kind": ..., "bytes": ... }`. Sender is null for external senders. +Kind is `task`, `message`, `result`, `unreviewed`, or `webhook`; bytes count +the UTF-8 message body. `unreviewed` is an answer forwarded after a child ended +without replying. A null sender also includes a bounded `sender_label`, such +as a hook name, at most 100 Unicode scalar values and 400 UTF-8 bytes. +The agent view animates these identities without interpreting note text. + +Progress contains `call_id`, nullable `tool_call_id`, `name`, `phase`, +`intent`, and optional `preview: { "offset_scalars": ..., "text": ... }`. +Phase is `generating` or `running`. Intent is `read`, `search`, `list`, `run`, +or `unknown`; unknown remains valid. Intent comes from declared tool metadata +or emitted execution evidence; generating code can have unknown intent. +The daemon does not parse Python just to guess a label. +The client does not accumulate arguments or infer Python +behavior. Calls interleave by `call_id`, which changes across actor lifetimes, +runs, provider steps, retries, and output indexes. + +Preview updates replace the latest window. The window has at most 512 decoded +Unicode scalar values and 2,048 UTF-8 bytes. `offset_scalars` counts decoded +source scalars before that window, including source newlines. It does not count +JSON escapes, UTF-8 bytes, grapheme clusters, or terminal columns. Names have +a 100-byte UTF-8 bound; native IDs over 200 bytes are omitted. One progress +event has an 8 KiB bound and an attempt tracks at most 32 calls. Excess calls +disable generating previews for that attempt while execution continues. + +First appearance and transition to running publish immediately. Other preview +updates coalesce over 100 ms. Attachment captures updates awaiting publication. +Completion, cancellation, failure, retry, and reset clear obsolete previews. +Argument parsing occurs once per provider fragment, before subscriber delivery. +Full tool arguments and results remain durable. Capability `tool_progress: 1` +is required; there is no legacy client reconstruction. + +### Collection watch and overload + +`GET /sessions` with `Accept: text/event-stream` uses the same scope filters as +the JSON collection, excluding pagination and sort. It sends invalidations, +not transcripts or duplicate full argument payloads. Its first batch contains +`ready` and `reset`, requiring an authoritative collection read. No cursor +or replay promise applies to this stream. + +```json +{ + "events": [ + {"type": "ready", "data": {}}, + {"type": "reset", "data": {"reason": "initial"}} + ] +} +``` + +An incremental batch contains `invalidate` events with resource URLs and +affected session IDs, plus bounded `activity` replacements for visible agents. +An activity event has this typed body: + +```json +{ + "type": "activity", + "data": { + "session_id": "session-1", + "cursor": {"generation": "J6kYj6IGcXyP3eMIp-WL3A", "sequence": 10}, + "status": {"phase": "idle", "run_id": null, "interrupt_requested": false, "blocking_reason": null}, + "current_progress": [], + "activity": { + "lines": [], + "output_scalars": 0, + "output_utf8_bytes": 0, + "observed_at": "2026-10-02T14:00:00Z", + "latest_input": null, + "latest_answer": null + } + } +} +``` + +Status, current progress, activity, and cursor are captured together and replace +the row's live state together. The cursor matches the summary cursor. Separate +updates cannot share a cursor while replacing only one of those fields. +Collection `mail` events carry the same mail metadata as session notes, without +message text. Peer labels come from session summaries; unknown peer IDs trigger +a metadata read. These animation events have no replay guarantee. +Scope filters cover both entry and removal, including a +workspace change moving a row out of the filter. The daemon invalidates the +scope when it cannot resolve membership cheaply or safely. + +A client subscribes, waits for ready, then reads authoritative JSON pages. +Changes during loading leave the view dirty and cause another refresh. +Activity replacements arriving during that read are applied afterward by +their per-session generation and sequence. Equal or older sequences cannot +overwrite a newer row. An actor-generation mismatch requires refreshing that row. +This yields a current view without claiming an atomic snapshot across actors. +Reconnect always repeats the readiness and refresh flow. + +The bus queue holds at most 256 events and 1 MiB per subscriber. Mailboxes carry +at most one outstanding wake, never full payloads. Publication uses bounded +nonblocking admission. Session streams read the existing replay buffer rather +than maintaining additional payload queues. Flushes coalesce over 100 ms. +Progress and display events have independent payload bounds. + +At overflow, the collection stream emits `overflow` and closes if the socket +can still accept the signal. Closure alone also requires refresh; delivery of +the final marker cannot be guaranteed to a stalled reader. The client refreshes +by resubscribing, waiting for ready, and then reading the authoritative tree, +status, progress, and glances. It does not append new state to an obsolete graph. +Disconnect and failed writes release the subscription and its queue. + +Both stream kinds send keepalives at least every five seconds when quiet. +Sockets have bounded write waits. Publication never awaits subscriber socket +writes. A stalled reader cannot retain an unbounded mailbox or force another +subscriber's writes to wait behind its own. Reverse proxies must pass streaming +responses without buffering. Compression is disabled by default. History, images, and +large extension results remain bounded HTTP reads, not unsolicited stream data. + +## Extension contracts + +Extension management stays under `/extensions/{extension_name}`. These routes +are not aliases for core commands. The extension owns validation, persistence, +permissions, and typed domain results. Enabled routes and action descriptors +are discoverable through the server and session catalog. + +HTTP bearer clients are human operators. Internal model callers use the same +domain operations with trusted caller context supplied by the runtime. +A JSON `role`, `caller`, or session ID cannot grant human permission. +Core shutdown and global credential management cannot be delegated through a +page descriptor. Disabling a service returns `404` for its HTTP routes. + +Extension lists use common pagination and may include optional `page` and +`glance` render hints. Each editable row includes `resource`, containing URL, +value, and its observed `etag`. Work, paperclip, and schedule item reads are +canonical item representations. Hook and linked-group reads include runtime +observations and expose a separate `view=configuration` resource for edits, +using the session configuration convention. Its validator covers only the +complete configuration representation, not changing runtime observations. + +Mutation responses contain `resource` and `notification`. Notification has +`state: "not_requested"|"queued"|"failed"`, with nullable safe `code` and +`detail`. Multiple targets use `notifications`, one result per target. +Creates return `201` with `Location`; edits return `200`. Deletes return `200` +when reporting a deleted resource or notification outcome, otherwise `204`. +A committed ledger edit remains successful if notifying an agent fails. +Secret-generating POSTs have no automatic retry after response loss; the caller +reads the resource and explicitly rotates if the secret was lost. + +### Work + +| Path | Methods | +| --- | --- | +| `/extensions/work/items` | GET, POST | +| `/extensions/work/items/{item_id}` | GET, PATCH, DELETE | + +Every Work read and mutation requires a `workspace` query selecting the invoking +workspace. GET collection reads its linked group. POST accepts +`title`, optional `notes`, `parent_id`, `session_id`, and `run_id`. +Fields include those values, `status`, `revision`, and timestamps. Status is +`open`, `active`, `blocked`, `done`, or `cancelled`. A run requires a session. +PATCH changes title, notes, status, session, or run under `If-Match`; parent +and original workspace are immutable. The query supplies the creation workspace; +notes default to empty, status defaults to open, and optional IDs default to null. +Title has a 4,096-byte limit; notes have a 32 KiB limit. DELETE requires +`If-Match` and rejects an item with children. +Writes remain scoped to the invoking workspace's linked group. + +Human mutations can name `notify_session_id` to queue the existing user-change +note. Results distinguish ledger commit from note delivery. Models retain +their workspace-scoped create, read, update, and delete operations through +trusted internal bindings. Work pages preserve linked-workspace labels and +pending-work glances. + +### Paperclips + +| Path | Methods | +| --- | --- | +| `/extensions/paperclips/items` | GET, POST | +| `/extensions/paperclips/items/{item_id}` | GET, PATCH, DELETE | + +This ledger is global. Items contain ID, topic, title, message, suggestion, +reply, status, origin session and workspace, creation time, resolution, and +resolving session. Topic is `harness`, `workflow`, `bug`, `user`, or `other`. +POST accepts topic, message, optional title and suggestion, and the filing +session and workspace. Topic defaults to other; optional text defaults to empty. +Message is nonblank and at most 32 KiB; title is at most 4 KiB; suggestion, +reply, and resolution are at most 16 KiB each. Topic, title, message, suggestion, +and origin are immutable after creation. Status, timestamps, and resolving +session are response-only at creation. + +Humans PATCH status to `acknowledged`, `resolved`, or `dismissed`, or supply +`reply`. A reply acknowledges the item and attempts a note to its filing session. +The reply stays saved when notification fails. DELETE removes the item. +PATCH with reply cannot also set resolved or dismissed. Human resolution can +include a resolution note; it never changes the original message. A model's +resolving session comes from trusted runtime context. DELETE requires `If-Match`. +Models can file, list, and resolve still-open or acknowledged items with a +nonempty resolution. Human terminal decisions cannot be overwritten by a model. +All edits use `If-Match`. Listings preserve open-first order and global glances. + +### Schedule + +| Path | Methods | +| --- | --- | +| `/extensions/schedule/jobs` | GET, POST | +| `/extensions/schedule/jobs/{job_id}` | GET, PATCH, DELETE | + +GET requires `session_id`. POST accepts session ID, kind, prompt, and +`delay_seconds`, with `every_seconds` required for recurring or heartbeat jobs. +Kinds are `once`, `recurring`, and `heartbeat`. Prompt has a 4,096-byte limit; +intervals range from 60 to 31,536,000 seconds. Resources include `next_at`. +PATCH can change `prompt`, `kind`, `delay_seconds`, and `every_seconds` under +`If-Match`, preserving once-to-recurring edits. Once jobs prohibit repetition; +recurring and heartbeat jobs require it. A prompt-only edit preserves `next_at`. +A changed delay resolves from commit time. DELETE requires `If-Match`. +Models retain these operations. + +Once jobs disappear after durable delivery. Recurring prompts queue behind +running work. Heartbeats skip busy sessions. Restart resumes the schedule +without replaying every missed interval. Session deletion removes its jobs. + +### Linked workspaces + +| Path | Methods | +| --- | --- | +| `/extensions/links/groups` | GET, POST, DELETE | + +GET requires `workspace` and returns its complete group with bounded remote +presence facts, paged where necessary. Configuration view contains membership +and revision without remote presence facts. POST uses that observed configuration +URL and its `If-Match`, with `other_workspace` and `other_etag` from the other +group's configuration read. It checks both groups and merges them in one owner +commit. Stale membership on either side returns `412`. +DELETE uses the configuration URL plus `member` and checks that member belongs +to the observed group at commit. The member becomes its own group. Neither operation deletes work +or memory. Writes are human-only. Notifications to affected open sessions +are reported separately from the committed group change. `notification_count` +covers all targets; the response includes up to 200 outcomes and `truncated` +when the list reaches its count or byte bound. + +### Webhooks + +| Path | Methods | Authentication | +| --- | --- | --- | +| `/extensions/webhooks/hooks` | GET, POST | Daemon bearer | +| `/extensions/webhooks/hooks/{hook_id}` | GET, PATCH, DELETE | Daemon bearer | +| `/extensions/webhooks/hooks/{hook_id}/secret` | POST | Daemon bearer | +| `/extensions/webhooks/hooks/{hook_id}/deliveries` | GET | Daemon bearer | +| `/extensions/webhooks/hooks/{hook_id}/deliveries` | POST | Signature over raw body | +| `/extensions/webhooks/deliveries/{delivery_id}` | GET | Daemon bearer | +| `/extensions/webhooks/permissions/{session_id}` | GET, PATCH | Daemon bearer | + +Hooks contain ID, name, target session, enabled state, signature header and +prefix, revision, public delivery URL, pending delivery count, and latest +deferral reason. Names use 1 to 64 ASCII letters, digits, `_`, or `-`. +POST accepts `session_id`, `name`, optional `enabled`, `signature_header`, +`signature_prefix`, and `secret` of 16 to 4,096 bytes. Name is unique within its +target session. Enabled defaults true. Header uses 1 to 64 ASCII letters, digits, +or hyphens; prefix has at most 32 bytes and no CR or LF. Absence generates a secret. +PATCH configuration accepts name, enabled, header, and prefix. Target session +is immutable. ID, revision, URL, pending counts, and diagnostics are read-only. +Secret rotation POST accepts only an optional secret. Creation and rotation return that +secret only in the operation response. Rotation and PATCH require `If-Match`. +Stored secrets never appear in lists, descriptors, ordinary logs, or SSE. + +Permission reads return false when no setting exists. PATCH accepts explicit +`agent_manage`, with omission retaining its value. Only humans grant it. +Agent management remains restricted to that agent's target session. Turning +management off does not disable hooks or prevent reading that session's own +accepted delivery payloads. Hook edits use the caller's observed revision, +not a revision fetched just before overwriting a stale screen. + +Incoming delivery POST has a 65,536-byte raw-body limit. It requires the +configured HMAC-SHA256 signature and never accepts a bearer token instead. +Default header is `X-Albedo-Signature` and prefix is `sha256=`. +Missing or invalid signatures return `403`, without a daemon bearer challenge. +Optional `X-Albedo-Event-Id`, at most 128 bytes without newlines, deduplicates +by hook, ID, and body hash. A changed body under that ID returns `409`. +Acceptance stores the delivery and its durable inbox entry together, then +returns `202` with `delivery_id`. A full target inbox returns `429`; +unknown or disabled hooks return `404`. The pending bound is 1,000 per session. + +Delivery lists accept `state=pending|delivered|all`, default all, and common +pagination. Metadata contains ID, hook ID, target session, receipt and delivery +timestamps, attempts, and latest deferral reason. Direct delivery reads add +`payload: { "encoding": "utf8"|"base64", "data": ... }`. +Both direct and by-hook historical reads remain available after hook deletion. +Payloads are external data and carry no instruction authority. Deleting a +hook retains accepted deliveries. Deleting the target session removes its +hooks and inbox. An operator exposing intake through a reverse proxy allows +only the signed POST method, not management GET on the same path. + +### OpenAI proxy + +| Path | Methods | +| --- | --- | +| `/extensions/proxy/v1/models` | GET | +| `/extensions/proxy/v1/chat/completions` | POST | + +This optional service keeps its OpenAI-compatible request and response format, +including JSON and streaming responses. It is stateless with respect to agent +sessions: the caller supplies history. It retains the 32,000,000-byte request +limit and opaque provider state carried in tool IDs. The supported request +subset contains model, messages, tools, token limits, temperature, top_p, stop, +tool_choice, parallel_tool_calls, reasoning effort, response format, stream, +and stream_options.include_usage. User images must be base64 data URLs; +remote image URLs are not fetched. Unsupported fields return a proxy-format error. +Provider transports apply only options they can express, as described in +[the proxy transport contract](../robot-docs/proxy.md#translation). +Text and reasoning stream as delta.content and delta.reasoning_content. +Complete tool calls publish when the turn ends. Provider failure sends an error +chunk before termination, or a JSON error for a nonstreaming request. +The proxy's OpenAI envelope, field names, and body limit override platform +encoding conventions. It uses daemon bearer +authentication. An operator may explicitly enable anonymous loopback access; +that policy never grants access to core or other extension routes. + +## Existing feature coverage + +This table is the implementation acceptance checklist. UI shortcuts and labels +can stay unchanged while their adapter calls use the target contract. + +| Existing feature | Target operation or data | +| --- | --- | +| Session picker, search, workspace filter, grouping, recent previews | Filtered session summaries with names, activity, workspace, preview, and shared preferences | +| Pinned, archived, and frequent sessions | Session preferences, `sort=frequent`, and identified visits | +| New session, checkpoint fork, child spawn | Session creation variants with retry provenance and atomic child task | +| Rename, stable family address, leaf or subtree deletion | Session PATCH, separate name and address, conditional deletion result | +| Text, images, continue, selected skill, queued steering | Immutable input variants and ordered durable admission | +| Pending rows, uncertain sends, uncertain creation across navigation | Same-resource decision lookup and retained original handles | +| Targeted cancel, shared turn, whole-turn interrupt | Input cancel and captured session interrupt | +| Chat, thinking, code preview, full tool output, file diffs | Session SSE plus durable history content reads | +| Late attachment, reconnect, restart, replay eviction | Actor-generation cursor and durable reset snapshot | +| Older history and transcript tree | Immutable history pages and checkpoint view | +| Footer status, usage, cache fade, context window | Session snapshot, status and usage events, model metadata | +| Model picker, manual ID, effort, default profile, raised cap | Session selection, models, and explicit separate settings changes | +| `/reload`, `/reload session`, `/reload models` | Typed reload targets with independent confirmed outcomes | +| `/compact [strategy]` | Compaction result preserving confirmed strategy choice | +| `/kernel`, `/kernel upgrade` | Session kernel metadata and explicit upgrade | +| Extensions, dependencies, quarantine, global defaults and inheritance | Fresh catalog, loaded composition, session overrides, shared settings | +| Skill and instruction discovery, source diagnostics, selection | Candidate revision checks and explicit resolved-source metadata | +| Context inspector and bounded section pages | Prepared snapshot identity and context section reads | +| Provider request telemetry | Context request-record view | +| MCP forms, credentials, validation and failed-save recovery | Atomic candidate settings patch with write-only secrets | +| Provider login, manual callback, choose or remove account | Auth flows, provider-profile selection, account deletion | +| `/cd`, folder and repository preview, missing workspace repair | Workspace read and family-aware session move | +| SSH host completion, probe, sign-in handoff | Hosts, explicit probe, and actionable local operator instructions | +| Agent graph, live tails and rate, attach, spawn, rename, delete, send, mail animation | Session family summaries, atomic activity replacements, normal input admission, typed mail metadata | +| Work, paperclips, schedule, linked-workspace pages and glances | Extension resources and declarative typed page actions | +| Webhook forms, copy URL, generated secret, rotation, permission toggle | Webhooks domain contract and one-time operation secrets | +| Shared thinking and tool display preferences | Settings UI group | +| Online storage report and offline diagnosis | Storage API and deliberate local diagnostic path | +| Ordinary CLI keep-or-restart offer | Existing launcher policy with instance-targeted shutdown | +| Drafts, editor, clipboard, mouse, animations, navigation, quit | Client-owned behavior; no daemon endpoint | + +Agent-originated mail remains an extension/runtime operation under trusted +family permissions. Human graph messages use ordinary user inputs addressed +to the chosen session. The API does not let clients forge agent senders. + +## Architecture and implementation boundaries + +`server.gleam` owns routing, authentication, HTTP admission, negotiation, and +mapping domain errors to wire responses. It does not own session state or +execute extension commands inside a session actor. + +The session actor owns generation, live status, normalized progress, replay +capture, and configuration application. The store owner commits identified +creation, pending input, consumption, and deletion outcomes on its transaction +connection. Family operations serialize membership validation with mutation. +The existing bus owns bounded collection notification admission and cleanup. + +Settings owners validate and persist their desired state. Runtime composition +prepares candidates before applying them. Extensions keep their ledgers, +permissions, migrations, and handlers. Provider transport and Python RPCs stay +internal; their URLs and execution rules are not public client responsibilities. + +The Go API adapter owns paths, query encoding, request and result types, +capability checks, byte bounds, deadlines, retry policy, and SSE validation. +Application commands and UI packages receive typed results and UI messages. +Local discovery and launching stay outside the connection. Other clients can +implement this contract without local storage or execution knowledge. + +The implementation uses direct domain operations. It adds no forwarding-only +wrappers, generic command bus, generation registry, duplicate progress parser, +or per-client full-argument buffers. New route aliases require a contract +change, not a convenience helper in the UI. + +## Verification + +Behavioral tests exercise these outcomes through the real daemon: + +- Lose creation and input responses, retry original IDs, edit a created session, + and still recover the original intent. Reject changed intent and expired IDs. +- Retry a rejected queue-full input after capacity clears. It stays rejected. + Delete its session and retain accepted, cancelled, and rejected decisions. +- Race child creation with interruption and deletion. No child lacks its task, + and an old interrupt or deletion attempt cannot affect newer work. +- Attach during generation; replay, evict, restart the actor, and restart the + daemon. Committed history survives and old numeric cursors never authorize replay. +- Interleave tool calls with escaped Unicode, retry, cancel, and transition to + running. Progress remains bounded and full arguments remain in history. +- Stall one reader under sustained events from many agents. Measure queue bytes + and mailbox length; another reader stays responsive, overflow refreshes, and + disconnect releases subscriptions. +- Change collection membership while pages load. A removal or moved workspace + reaches the client, stale activity cannot replace newer state, and reconnect + refreshes graph, status, progress, tails, and glances without duplicate rows. + Interleave text, tools, and mail across agents; one collection subscription + preserves live tails and animation identities within the payload bounds. +- Page older history, retrieve a large tool result and image, and fork a valid + checkpoint. Full content is recoverable and history navigation survives reset. +- Change prepared context between summary and page. The old page fails by + identity rather than displaying another request's section. +- Race preference edits and stale catalog choices. Preconditions protect + changes, false differs from omission, and null restores inheritance. +- Fail candidate MCP validation and session reload. Previous secrets and + loaded composition remain usable; committed model changes remain visible + when a later default or cap change fails. Reject conflicting credential + sources before attempting a connection or changing saved settings. +- Exercise local and remote workspace browsing, missing workspaces, busy moves, + descendant moves, and explicit SSH authentication instructions. +- Complete, cancel, and expire provider login flows, including manual callback. + Restart during a flow; the old ID stays failed and cannot start another flow. + Verify secret redaction, origin rejection, bearer failures, and browser CORS. +- Exercise work, paperclip reply, scheduling while busy, linked-group merge, + webhook stale edits, signatures, deduplication, secret loss, and permissions. + Committed domain changes survive a failed notification. +- Read storage from a client without daemon filesystem or Python access and + compare known isolated totals. Attachment never starts or stops a daemon. + +Controlled transport tests cover malformed wire data, callback failure before +cursor commit, partial HTTP responses, and failures a healthy daemon cannot +produce. Cross-cutting parser tests cover fragmented SSE lines and UTF-8 bounds. +There are no compatibility fixtures, UI copy snapshots, route-constant tests, +or tests that only encode and decode the same local type. + +An independent consumer authenticates, creates a session, submits identified +input, watches SSE, resumes after disconnect, and reads history using only this +document. Its success verifies that Go-specific knowledge is not required. + +Run focused E2Es and Go race tests for changed behavior, then `./test.sh` for +the complete gate. Review resource ownership, uncertain outcomes, bounded +queues, cleanup, and test failure modes when changing the API. Performance +experiments and their results belong outside the repository. + +Server and clients use the same contract. Durable history and supported storage +migrations remain supported; old API wire formats do not. diff --git a/docs/openapi.yaml b/docs/openapi.yaml new file mode 100644 index 000000000..985a04eac --- /dev/null +++ b/docs/openapi.yaml @@ -0,0 +1,10478 @@ +# Daemon protocol 3. See http-api-design.md for behavioral semantics. +openapi: 3.2.1 +info: + title: Albedo daemon API + version: 3.0.0 + summary: 'Protocol 3: typed HTTP resources and SSE.' + description: This file owns daemon request and response shapes. + http-api-design.md owns ordering, atomicity, retry and recovery behavior. Server and clients switch + together; there are no legacy route aliases. Unknown request fields and duplicate JSON keys are errors. + Unknown response fields may be ignored by clients. No operation starts or replaces a daemon. JSON + and SSE frames are at most 1 MiB unless an extension explicitly overrides that limit. Ordinary request + bodies are at most 64 KiB, input bodies 9,200,000 bytes and proxy bodies 32,000,000 bytes. UTF-8 and + encoded-byte limits are described with x-max-utf8-bytes/x-max-encoded-bytes; standard schema validation + alone does not assert them. Examples use synthetic secrets only. +jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema +externalDocs: + description: Behavior, ownership, feature coverage and verification. + url: http-api-design.md +security: +- DaemonBearer: [] +tags: +- name: server +- name: settings +- name: storage +- name: sessions +- name: models +- name: workspaces +- name: hosts +- name: auth +- name: work +- name: paperclips +- name: schedule +- name: links +- name: webhooks +- name: proxy +paths: + /server: + get: + operationId: getServer + summary: Read daemon identity and capabilities + tags: + - server + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Server' + examples: + Server: + value: + instance_id: instance-1 + protocol: 3 + state: ready + capabilities: + durable_inputs: 1 + session_replay: 1 + collection_invalidation: 1 + tool_progress: 1 + storage_report: 1 + build: example-build + digest: null + extensions: + - name: work + version: 1 + quota: null + notices: [] + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: No startup or replacement. Authentication and protocol failures remain actionable errors. + Pagination is valid only with include=quota_history. + parameters: + - name: include + in: query + required: false + schema: + type: string + enum: [quota_history] + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + /server/shutdown: + post: + operationId: shutdownServer + summary: Drain the identified daemon + tags: + - server + responses: + '202': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Shutdown' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '409': + $ref: '#/components/responses/Problem409' + description: No automatic recovery or replay. The local launcher alone may offer replacement. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ShutdownRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /settings: + get: + operationId: getSettings + summary: Read shared settings or one canonical group + tags: + - settings + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/SettingsRead' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: Without group, return Settings and observed group validators. With group, return that + group only; the ETag covers that representation. + parameters: + - name: group + in: query + required: false + schema: + type: string + enum: [providers, mcp, extensions, capabilities, models, ui] + patch: + operationId: patchSettings + summary: Atomically edit one settings group + tags: + - settings + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/SettingsChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Query group selects its corresponding schema. Omitted fields keep values. Null removes + only nullable fields or map entries. Candidate validation precedes the complete group commit. + No lost-response retry. + parameters: + - name: group + in: query + required: true + schema: + type: string + enum: [providers, mcp, extensions, capabilities, models, ui] + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SettingsPatch' + examples: + ProviderSettingsPatch: + value: + default_profile: personal + profiles: + personal: + extension: openai + endpoint: https://provider.example/v1 + protocol: responses + model: example-model + effort: null + image_edge: null + account_id: null + api_key: synthetic-example-key + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /storage: + get: + operationId: getStorage + summary: Read storage accounting + tags: + - storage + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/StorageReport' + examples: + StorageReport: + value: + database: + main_file_bytes: 8192 + wal_bytes: 0 + page_size_bytes: 4096 + page_count: 2 + free_page_count: 0 + used_bytes: 8192 + sessions: + items: [] + next: null + total_count: 0 + total_estimated_content_bytes: 0 + images: + count: 0 + bytes: 0 + files: + items: [] + next: null + totals: + kernel_bytes: 0 + backup_bytes: 0 + other_bytes: 0 + recent_backup_bytes: 0 + recent_backup_count: 0 + measured_at: '2026-10-02T14:00:00Z' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: 'Each section has its own continuation. Totals cover complete storage. Paths never + authorize local mutation. Requires capability `storage_report: 1`.' + parameters: + - name: sessions_next + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + - name: files_next + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + - $ref: '#/components/parameters/Limit' + /sessions: + get: + operationId: listSessions + summary: Browse sessions or watch collection changes + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/SessionPage' + examples: + SessionPage: + value: + items: + - id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + automatic_name: New session + workspace: /workspace/project + location: + host: null + user: null + path: /workspace/project + label: null + parent_id: null + root_id: 01a0fcea-2b00-7000-8000-000000000001 + address: null + depth: 0 + closed: false + created_at: '2026-10-02T14:00:00Z' + activity_at: '2026-10-02T14:00:00Z' + provider_profile: personal + model: example-model + effort: null + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + preview: + text: '' + transcript_count: 0 + truncated: false + preferences: + pinned: false + pin_order: null + archived: false + opens: 0 + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + next: null + text/event-stream: + itemSchema: + $ref: '#/components/schemas/CollectionSSE' + headers: + Vary: + $ref: '#/components/headers/Vary' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: JSON defaults to roots, or all with parent/family. Parent and family are exclusive. + Explicit roots with either is invalid. SSE accepts the same scope filters, excluding sort/limit/next; + no cursor or replay. Subscribe, wait for ready, then read pages. Closure or overflow repeats this + flow. + parameters: + - name: scope + in: query + required: false + schema: + type: string + enum: [roots, all] + - name: parent_id + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: family_id + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: workspace + in: query + required: false + schema: + $ref: '#/components/schemas/Workspace' + - name: search + in: query + required: false + schema: + type: string + maxLength: 256 + - name: archived + in: query + required: false + schema: + type: boolean + - name: needs_reload + in: query + required: false + schema: + type: boolean + - name: sort + in: query + required: false + schema: + type: string + enum: [activity, frequent] + default: activity + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + /sessions/{session_id}: + get: + operationId: getSession + summary: Read or watch one session + tags: + - sessions + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + Vary: + $ref: '#/components/headers/Vary' + content: + application/json: + schema: + $ref: '#/components/schemas/SessionRead' + examples: + Session: + value: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + automatic_name: New session + workspace: /workspace/project + location: + host: null + user: null + path: /workspace/project + label: null + parent_id: null + root_id: 01a0fcea-2b00-7000-8000-000000000001 + address: null + depth: 0 + closed: false + created_at: '2026-10-02T14:00:00Z' + activity_at: '2026-10-02T14:00:00Z' + provider_profile: personal + model: example-model + effort: null + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + preview: + text: '' + transcript_count: 0 + truncated: false + preferences: + pinned: false + pin_order: null + archived: false + opens: 0 + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + creation: + submitted: + kind: new + workspace: /workspace/project + name: null + provider_profile: null + model: null + effort: null + resolved: + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + revision: config-1 + family_revision: family-1 + configuration_resource: + url: /sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration + etag: '"session-config-1"' + value: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + preferences: + pinned: false + pin_order: null + archived: false + selection: + extensions: {} + skills: {} + instructions: {} + mcp: {} + revision: config-1 + family_revision: family-1 + workspace_change: null + selection: + overrides: + extensions: {} + skills: {} + instructions: {} + mcp: {} + effective: + extensions: {} + skills: {} + instructions: {} + mcp: {} + composition: + desired_revision: composition-1 + loaded_revision: null + needs_reload: true + dependencies: {} + quarantine: [] + availability: {} + kernel: + instance_id: null + state: none + stage: null + build: null + stale: false + staleness_reasons: [] + live_job_count: 0 + pending_inputs: [] + input_order: 0 + usage: + model: null + observed_at: null + prompt_tokens: null + cached_prompt_tokens: null + cache_write_tokens: null + completion_tokens: null + total_tokens: null + elapsed_ms: null + tokens_per_second: null + context_window_tokens: null + cache_ttl_seconds: null + cache_fade: [] + history: + items: [] + older: null + newer: null + high_water: 0 + glances: [] + text/event-stream: + itemSchema: + $ref: '#/components/schemas/SessionSSE' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: JSON defaults to complete Session. Configuration JSON excludes tail and replay parameters. + SSE accepts tail and after_generation/after_seq, without view. Initial subscription omits both + cursors; reconnect keeps the fully consumed pair. A missing generation requests reset. after_generation + without after_seq is invalid. Neither auth failure nor closure starts a daemon. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: false + schema: + type: string + enum: [configuration] + - name: tail + in: query + required: false + schema: + type: integer + minimum: 0 + maximum: 200 + default: 100 + - name: after_generation + in: query + required: false + schema: + $ref: '#/components/schemas/Generation' + - name: after_seq + in: query + required: false + schema: + $ref: '#/components/schemas/Counter' + put: + operationId: createSession + summary: Create a new, forked or child session + tags: + - sessions + responses: + '201': + description: Successful result. + headers: + Location: + $ref: '#/components/headers/Location' + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/Session' + examples: + Session: + value: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + automatic_name: New session + workspace: /workspace/project + location: + host: null + user: null + path: /workspace/project + label: null + parent_id: null + root_id: 01a0fcea-2b00-7000-8000-000000000001 + address: null + depth: 0 + closed: false + created_at: '2026-10-02T14:00:00Z' + activity_at: '2026-10-02T14:00:00Z' + provider_profile: personal + model: example-model + effort: null + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + preview: + text: '' + transcript_count: 0 + truncated: false + preferences: + pinned: false + pin_order: null + archived: false + opens: 0 + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + creation: + submitted: + kind: new + workspace: /workspace/project + name: null + provider_profile: null + model: null + effort: null + resolved: + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + revision: config-1 + family_revision: family-1 + configuration_resource: + url: /sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration + etag: '"session-config-1"' + value: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + preferences: + pinned: false + pin_order: null + archived: false + selection: + extensions: {} + skills: {} + instructions: {} + mcp: {} + revision: config-1 + family_revision: family-1 + workspace_change: null + selection: + overrides: + extensions: {} + skills: {} + instructions: {} + mcp: {} + effective: + extensions: {} + skills: {} + instructions: {} + mcp: {} + composition: + desired_revision: composition-1 + loaded_revision: null + needs_reload: true + dependencies: {} + quarantine: [] + availability: {} + kernel: + instance_id: null + state: none + stage: null + build: null + stale: false + staleness_reasons: [] + live_job_count: 0 + pending_inputs: [] + input_order: 0 + usage: + model: null + observed_at: null + prompt_tokens: null + cached_prompt_tokens: null + cache_write_tokens: null + completion_tokens: null + total_tokens: null + elapsed_ms: null + tokens_per_second: null + context_window_tokens: null + cache_ttl_seconds: null + cache_fade: [] + history: + items: [] + older: null + newer: null + high_water: 0 + glances: [] + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '409': + $ref: '#/components/responses/Problem409' + '410': + $ref: '#/components/responses/Problem410' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + '429': + $ref: '#/components/responses/Problem429' + description: Session ID must be UUIDv7. If-None-Match:* is required. Retain the identity and submitted + intent after response loss. An existing resource returns 412; GET creation.submitted proves original + intent. Child membership and task admission commit together. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/UUIDv7' + - $ref: '#/components/parameters/IfNoneMatch' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SessionCreationRequest' + examples: + NewSessionRequest: + value: + kind: new + workspace: /workspace/project + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + patch: + operationId: patchSession + summary: Edit configuration or move workspace + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/SessionChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Use the observed configuration URL and validator. Workspace is a standalone change + with family_revision. Busy target fails before commit; busy descendants follow a committed parent + move at idle. Other configuration fields commit together. No automatic lost-response retry. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: true + schema: + const: configuration + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SessionChangeRequest' + examples: + SessionPatch: + value: + selection: + extensions: + browser: null + skills: + candidate-1: false + catalog_revision: discovery-1 + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + delete: + operationId: deleteSession + summary: Delete a leaf or captured subtree + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/SessionDeletion' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Leaf requires idle and no children. Subtree requires family_revision, gates new children, + interrupts captured members and deletes deepest first. Partial outcomes are explicit. Refresh + before confirming a new attempt; never automatically replay after transport loss. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: true + schema: + const: configuration + - $ref: '#/components/parameters/IfMatch' + - name: scope + in: query + required: false + schema: + type: string + enum: [leaf, subtree] + default: leaf + - name: family_revision + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + /sessions/{session_id}/visits/{visit_id}: + put: + operationId: recordVisit + summary: Count one deliberate opening + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Visit' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: Visit ID is UUIDv7. Same identity increments once; reads and refreshes never count. + parameters: + - name: visit_id + in: path + required: true + schema: + $ref: '#/components/schemas/UUIDv7' + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmptyRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /sessions/{session_id}/inputs/{input_id}: + put: + operationId: putInput + summary: Admit immutable identified input + tags: + - sessions + responses: + '202': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Input' + examples: + Input: + value: + id: 01a0fcea-2b00-7000-8000-000000000002 + session_id: 01a0fcea-2b00-7000-8000-000000000001 + kind: message + admission: accepted + http_status: 202 + problem: null + accepted_at: '2026-10-02T14:00:00Z' + acceptance_order: 1 + delivery: pending + blocking_reason: null + transcript_position: null + turn: null + client_id: draft-1 + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '410': + $ref: '#/components/responses/Problem410' + '429': + description: Retained rejection, even if capacity later clears. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + examples: + queue_full: + value: + type: about:blank + title: Queue full + status: 429 + detail: This session already has 32 waiting inputs. + code: queue_full + decision: + kind: input + input: + id: 01a0fcea-2b00-7000-8000-000000000002 + session_id: 01a0fcea-2b00-7000-8000-000000000001 + kind: message + admission: rejected + http_status: 429 + problem: + type: about:blank + title: Queue full + status: 429 + detail: This session already has 32 waiting inputs. + code: queue_full + accepted_at: null + acceptance_order: null + delivery: null + blocking_reason: null + transcript_position: null + turn: null + client_id: draft-1 + headers: + Retry-After: + $ref: '#/components/headers/RetryAfter' + description: Input ID is UUIDv7. Duplicate lookup precedes mutable validation and returns the original + admission status with current delivery. Queue-full rejection remains rejected. No If-None-Match. + Preserve the exact intent and identity while recovering an uncertain response. + parameters: + - name: input_id + in: path + required: true + schema: + $ref: '#/components/schemas/UUIDv7' + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/InputRequest' + examples: + MessageInputRequest: + value: + kind: message + text: Fix the parser. + client_id: draft-1 + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + get: + operationId: getInput + summary: Read a durable input outcome + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Input' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: Available after session deletion. Accepted is not consumed or answered. Retain pending + and unfinished-turn identities; terminal decisions last seven days. Unknown old UUIDv7 returns + 410, never a fresh admission. + parameters: + - name: input_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + /sessions/{session_id}/inputs/{input_id}/cancel: + post: + operationId: cancelInput + summary: Cancel or interrupt only this input + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/InputCancellation' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: Never interrupts a later unrelated turn. shared_running leaves a shared turn running; + retry only inspects or acts on this same input. + parameters: + - name: input_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmptyRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /sessions/{session_id}/interrupt: + post: + operationId: interruptSession + summary: Interrupt a captured run and waiting prefix + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Interruption' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + description: Capture run_id and through_input_order from the installed session. Retry cannot interrupt + a later run or cancel newer inputs. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/InterruptRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /sessions/{session_id}/history: + get: + operationId: getHistory + summary: Page history or fork checkpoints + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/HistoryRead' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: Use only one of before/after/next. Durable positions are independent of actor replay. + Pages are ascending and preserve complete display groups where bounded. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: false + schema: + type: string + enum: [entries, checkpoints] + default: entries + - name: before + in: query + required: false + schema: + $ref: '#/components/schemas/Counter' + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/Counter' + - $ref: '#/components/parameters/Next' + - name: limit + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 200 + default: 100 + /sessions/{session_id}/history/{entry_id}: + get: + operationId: getHistoryContent + summary: Read full content in bounded pieces + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/EntryContentPage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: Follow next until null. UTF-8 pieces end at character boundaries. Base64 image offsets + count decoded bytes. Reconstruct stored content, not shortened previews. + parameters: + - name: entry_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/Next' + /sessions/{session_id}/context: + get: + operationId: getContext + summary: Inspect prepared context or request records + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ContextRead' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: 'Summary never prepares a request. Section requires snapshot_id, section_id, page and + forbids request-pagination fields. Requests accepts after/limit/next. Stale snapshot is 410 context_changed, + never another section. Requires capability `context: 1`.' + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: false + schema: + type: string + enum: [summary, section, requests] + default: summary + - name: snapshot_id + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: section_id + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: page + in: query + required: false + schema: + $ref: '#/components/schemas/Counter' + - name: after + in: query + required: false + schema: + $ref: '#/components/schemas/Counter' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + /sessions/{session_id}/catalog: + get: + operationId: getCatalog + summary: Discover candidates, loaded commands and pages + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Catalog' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: 'Discovery and loaded composition are separate. Reads do not reload. Continuation identifies + its section; candidate revision guards discovery-based selection. Requires capability `catalog: + 1`.' + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: kind + in: query + required: false + schema: + type: string + enum: [extensions, skills, instructions, mcp, commands] + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + /sessions/{session_id}/reload: + post: + operationId: reloadSession + summary: Reload composition, models or both + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ReloadResult' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: Session reload requires idle. Both targets return separate outcomes, preserving confirmed + success when the other fails. Lost-response replay is not automatic. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReloadRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /sessions/{session_id}/kernel/upgrade: + post: + operationId: upgradeKernel + summary: Explicitly upgrade an idle kernel + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/KernelUpgradeResult' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: Stage and validate before swap. Report external jobs stopped during an unsuccessful + upgrade; do not claim them restored. No automatic retry. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmptyRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /sessions/{session_id}/compaction: + post: + operationId: compactSession + summary: Compact model context while retaining history + tags: + - sessions + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/CompactionResult' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: Idle required. Selecting a strategy can succeed even if compaction later fails; report + both. Full durable history stays intact. No automatic retry. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CompactionRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /models: + get: + operationId: listModels + summary: Read provider model metadata + tags: + - models + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ModelRead' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: In catalogue view, exactly one of provider_profile/provider is required. Endpoint is allowed only with + provider. Unknown facts are null. A manual unlisted ID remains usable. Optional model returns + one metadata row, including cap_key, for an unlisted manual ID; unknown facts stay null. + parameters: + - name: view + in: query + required: false + schema: + type: string + enum: [catalogue, cache-policy] + default: catalogue + - name: extension + in: query + required: false + description: Cache-policy matching only; defaults to the empty selector. + schema: + type: string + maxLength: 256 + - name: host + in: query + required: false + description: Cache-policy matching only; defaults to the empty selector. + schema: + type: string + maxLength: 4096 + - name: model + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: provider_profile + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: provider + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - name: endpoint + in: query + required: false + schema: + type: string + format: uri + maxLength: 4096 + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + /workspaces: + get: + operationId: getWorkspaces + summary: Browse recent locations or a directory + tags: + - workspaces + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/WorkspaceRead' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: 'Without location return recent workspaces. include=preview requires location. Paths + resolve on the daemon host; cached host state does not perform SSH sign-in. Requires capability + `workspace_browsing: 1`.' + parameters: + - name: location + in: query + required: false + schema: + $ref: '#/components/schemas/Workspace' + - name: include + in: query + required: false + schema: + type: string + enum: [preview] + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + /hosts: + get: + operationId: listHosts + summary: Read known SSH hosts and cached state + tags: + - hosts + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/HostPage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + parameters: + - name: target + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + description: 'Requires capability `host_probes: 1`.' + /hosts/{host}/probe: + post: + operationId: probeHost + summary: Start or join a host probe + tags: + - hosts + responses: + '202': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Host' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + description: 'Coalesce repeated probes. Authentication remains an explicit operator handoff; no + background SSH sign-in. Requires capability `host_probes: 1`.' + parameters: + - name: host + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmptyRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /auth: + get: + operationId: getAuth + summary: Read login choices and redacted accounts + tags: + - auth + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/Auth' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: 'Requires capability `provider_auth: 1`.' + /auth/logins/{login_id}: + put: + operationId: createLogin + summary: Start or recover an identified provider login + tags: + - auth + responses: + '201': + description: Successful result. + headers: + Location: + $ref: '#/components/headers/Location' + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/Login' + examples: + Login: + value: + id: 01a0fcea-2b00-7000-8000-000000000003 + provider: example-provider + url: https://provider.example/authorize?state=synthetic-state + expires_at: '2026-10-02T14:15:00Z' + state: waiting + instructions: Paste the callback URL if the browser cannot reach the daemon. + progress: Waiting for authorization. + accounts: [] + failure: null + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '409': + $ref: '#/components/responses/Problem409' + '410': + $ref: '#/components/responses/Problem410' + '429': + $ref: '#/components/responses/Problem429' + '200': + description: Existing identified flow. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/Login' + description: 'UUIDv7 identity. Compare immutable private intent inside the daemon. Duplicate returns + existing flow, never another browser/exchange. Restart turns unfinished flows into retained daemon_restarted + failures; a new flow needs a new ID. Requires capability `provider_auth: 1`.' + parameters: + - name: login_id + in: path + required: true + schema: + $ref: '#/components/schemas/UUIDv7' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LoginRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + get: + operationId: getLogin + summary: Inspect a provider login + tags: + - auth + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/Login' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: 'No credential or submitted form echo. Terminal records remain fifteen minutes; unfinished + flows expire at their provider deadline. Requires capability `provider_auth: 1`.' + parameters: + - name: login_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + patch: + operationId: answerLogin + summary: Supply manual callback or code + tags: + - auth + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/Login' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '410': + $ref: '#/components/responses/Problem410' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + parameters: + - name: login_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/LoginPatch' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + description: 'Requires capability `provider_auth: 1`.' + delete: + operationId: cancelLogin + summary: Cancel a login idempotently + tags: + - auth + responses: + '204': + description: Successful result. + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '410': + $ref: '#/components/responses/Problem410' + description: 'Cancellation stops only this flow; completed accounts remain saved. No If-Match is + needed for identity-scoped cancellation. Requires capability `provider_auth: 1`.' + parameters: + - name: login_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + /auth/accounts/{account_id}: + delete: + operationId: deleteAccount + summary: Remove an unreferenced provider account + tags: + - auth + responses: + '204': + description: Successful result. + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: 'Reject if a saved provider profile references it. Does not interrupt captured credentials + in an active request. Account IDs are never reused. Requires capability `provider_auth: 1`.' + parameters: + - name: account_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + /extensions/work/items: + get: + operationId: listWork + summary: List work resources + tags: + - work + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/WorkPage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: Requires enabled extension work. Lists may include bounded page descriptors and glances. + parameters: + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + post: + operationId: createWork + summary: Create a work resource + tags: + - work + responses: + '201': + description: Successful result. + headers: + Location: + $ref: '#/components/headers/Location' + content: + application/json: + schema: + $ref: '#/components/schemas/WorkChange' + examples: + WorkChange: + value: + resource: + url: /extensions/work/items/work-1?workspace=%2Fworkspace%2Fproject + etag: '"work-revision-1"' + value: + id: work-1 + workspace: /workspace/project + title: Fix the parser + notes: '' + parent_id: null + session_id: null + run_id: null + status: open + revision: work-revision-1 + created_at: '2026-10-02T14:00:00Z' + updated_at: '2026-10-02T14:00:00Z' + notification: + state: not_requested + code: null + detail: null + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: No automatic lost-response retry. Notification outcome does not undo a committed domain + edit. + parameters: + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/WorkCreate' + examples: + WorkCreate: + value: + title: Fix the parser + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /extensions/work/items/{item_id}: + get: + operationId: getWork + summary: Read one work resource + tags: + - work + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/WorkItem' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + parameters: + - name: item_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + patch: + operationId: patchWork + summary: Edit a work resource + tags: + - work + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/WorkChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response + retry. + parameters: + - name: item_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/WorkPatch' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + delete: + operationId: deleteWork + summary: Delete a work resource + tags: + - work + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ExtensionDeletion' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Committed deletion remains successful if notification fails. Work items with children + cannot be deleted. + parameters: + - name: item_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - name: notify_session_id + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + description: Queue the deletion note for this session after the durable edit. + - $ref: '#/components/parameters/IfMatch' + /extensions/paperclips/items: + get: + operationId: listPaperclips + summary: List paperclips resources + tags: + - paperclips + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/PaperclipPage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: Requires enabled extension paperclips. Lists may include bounded page descriptors and + glances. + parameters: + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + post: + operationId: createPaperclips + summary: Create a paperclips resource + tags: + - paperclips + responses: + '201': + description: Successful result. + headers: + Location: + $ref: '#/components/headers/Location' + content: + application/json: + schema: + $ref: '#/components/schemas/PaperclipChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: No automatic lost-response retry. Notification outcome does not undo a committed domain + edit. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PaperclipCreate' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /extensions/paperclips/items/{item_id}: + get: + operationId: getPaperclips + summary: Read one paperclips resource + tags: + - paperclips + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/Paperclip' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + parameters: + - name: item_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + patch: + operationId: patchPaperclips + summary: Edit a paperclips resource + tags: + - paperclips + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/PaperclipChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response + retry. + parameters: + - name: item_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PaperclipPatch' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + delete: + operationId: deletePaperclips + summary: Delete a paperclips resource + tags: + - paperclips + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ExtensionDeletion' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Committed deletion remains successful if notification fails. Work items with children + cannot be deleted. + parameters: + - name: item_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + /extensions/schedule/jobs: + get: + operationId: listSchedule + summary: List schedule resources + tags: + - schedule + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/SchedulePage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: Requires enabled extension schedule. Lists may include bounded page descriptors and + glances. + parameters: + - name: session_id + in: query + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + post: + operationId: createSchedule + summary: Create a schedule resource + tags: + - schedule + responses: + '201': + description: Successful result. + headers: + Location: + $ref: '#/components/headers/Location' + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: No automatic lost-response retry. Notification outcome does not undo a committed domain + edit. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleCreate' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /extensions/schedule/jobs/{job_id}: + get: + operationId: getSchedule + summary: Read one schedule resource + tags: + - schedule + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleJob' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + parameters: + - name: job_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + patch: + operationId: patchSchedule + summary: Edit a schedule resource + tags: + - schedule + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Use the displayed item validator. Reject readonly/unknown fields. No automatic lost-response + retry. + parameters: + - name: job_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SchedulePatch' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + delete: + operationId: deleteSchedule + summary: Delete a schedule resource + tags: + - schedule + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ExtensionDeletion' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Committed deletion remains successful if notification fails. Work items with children + cannot be deleted. + parameters: + - name: job_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + /extensions/links/groups: + get: + operationId: getLinkGroup + summary: Read linked membership and presence + tags: + - links + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/LinkGroup' + - $ref: '#/components/schemas/LinkConfiguration' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + description: Only configuration view has the canonical membership ETag. Presence does not change + that validator. + parameters: + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - name: view + in: query + required: false + schema: + type: string + enum: [configuration] + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + post: + operationId: mergeLinkGroups + summary: Merge two observed workspace groups + tags: + - links + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/LinkChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Check both observed validators in one owner commit. Human-only; domain commit and notifications + are separate. No automatic lost-response retry. + parameters: + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - name: view + in: query + required: true + schema: + const: configuration + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LinkMerge' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + delete: + operationId: unlinkWorkspace + summary: Remove a member from the observed group + tags: + - links + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/LinkChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Check membership at commit. Creates a singleton group; deletes no work or memory. Human-only. + parameters: + - name: workspace + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - name: member + in: query + required: true + schema: + $ref: '#/components/schemas/Workspace' + - name: view + in: query + required: true + schema: + const: configuration + - $ref: '#/components/parameters/IfMatch' + /extensions/webhooks/hooks: + get: + operationId: listHooks + summary: List hooks without secrets + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/HookPage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + parameters: + - name: session_id + in: query + required: false + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + post: + operationId: createHook + summary: Create a hook and disclose its secret once + tags: + - webhooks + responses: + '201': + description: Successful result. + headers: + Location: + $ref: '#/components/headers/Location' + content: + application/json: + schema: + $ref: '#/components/schemas/HookChange' + examples: + HookChange: + value: + resource: + url: /extensions/webhooks/hooks/hook-1?view=configuration + etag: '"hook-revision-1"' + value: + id: hook-1 + name: ci + session_id: 01a0fcea-2b00-7000-8000-000000000001 + enabled: true + signature_header: X-Albedo-Signature + signature_prefix: sha256= + revision: hook-revision-1 + notification: + state: not_requested + code: null + detail: null + secret: synthetic-example-hook-secret + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + description: Default enabled=true, signature_header=X-Albedo-Signature and signature_prefix=sha256=. + Missing secret generates one. Lost secret requires explicit rotation; never retry creation automatically. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/HookCreate' + examples: + HookCreate: + value: + session_id: 01a0fcea-2b00-7000-8000-000000000001 + name: ci + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /extensions/webhooks/hooks/{hook_id}: + get: + operationId: getHook + summary: Read hook state or canonical configuration + tags: + - webhooks + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Hook' + - $ref: '#/components/schemas/HookConfiguration' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: ETag is present only on configuration view. Ordinary read exposes the configuration + resource and validator plus runtime observations. + parameters: + - name: hook_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: false + schema: + type: string + enum: [configuration] + patch: + operationId: patchHook + summary: Edit the observed hook configuration + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/HookChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Target session and secret are not writable. Agent callers need that session permission; + HTTP bearer clients are operators. + parameters: + - name: hook_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: true + schema: + const: configuration + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/HookPatch' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + delete: + operationId: deleteHook + summary: Delete a hook while retaining accepted deliveries + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ExtensionDeletion' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + parameters: + - name: hook_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: view + in: query + required: true + schema: + const: configuration + - $ref: '#/components/parameters/IfMatch' + /extensions/webhooks/hooks/{hook_id}/secret: + post: + operationId: rotateHookSecret + summary: Rotate and disclose the hook secret once + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/HookChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: If-Match is the observed hook configuration validator. Missing secret generates one. + No automatic retry after a lost response. + parameters: + - name: hook_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/HookSecretRequest' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /extensions/webhooks/hooks/{hook_id}/deliveries: + get: + operationId: listHookDeliveries + summary: Read accepted hook delivery metadata + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/DeliveryPage' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: Historical reads remain available after hook deletion while retained deliveries exist. + parameters: + - name: hook_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: state + in: query + required: false + schema: + type: string + enum: [pending, delivered, all] + default: all + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Next' + post: + operationId: deliverWebhook + summary: Accept signed external data durably + tags: + - webhooks + responses: + '202': + description: Successful result. + content: + application/json: + schema: + type: object + properties: + delivery_id: + $ref: '#/components/schemas/ID' + required: [delivery_id] + additionalProperties: false + '400': + $ref: '#/components/responses/Problem400' + '403': + description: Missing or invalid hook signature. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '409': + $ref: '#/components/responses/Problem409' + '429': + $ref: '#/components/responses/Problem429' + description: Authenticate configured HMAC-SHA256 over the exact raw body. A daemon bearer is not + a substitute. Signature header name and prefix come from hook configuration. Same event ID and + body returns original admission; changed body conflicts. Pending inbox limit 1000. Raw body maximum + 65536 bytes. + parameters: + - name: hook_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - name: X-Albedo-Event-Id + in: header + required: false + schema: + type: string + pattern: ^[^\r\n]+$ + maxLength: 128 + description: Optional sender identity scoped to hook and exact body hash. + security: + - WebhookSignature: [] + requestBody: + required: true + content: + '*/*': + schema: + type: string + format: binary + maxLength: 65536 + description: Raw bytes, not a parsed JSON requirement. Verify signature before admission. + /extensions/webhooks/deliveries/{delivery_id}: + get: + operationId: getDelivery + summary: Read an accepted delivery payload + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/DeliveryDetail' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + parameters: + - name: delivery_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + /extensions/webhooks/permissions/{session_id}: + get: + operationId: getHookPermission + summary: Read agent hook-management permission + tags: + - webhooks + responses: + '200': + description: Successful result. + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/HookPermission' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '404': + $ref: '#/components/responses/Problem404' + description: Absent stored permission reads false with its initial canonical validator. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + patch: + operationId: patchHookPermission + summary: Set agent hook-management permission + tags: + - webhooks + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/HookPermissionChange' + '400': + $ref: '#/components/responses/Problem400' + '401': + $ref: '#/components/responses/Problem401' + '403': + $ref: '#/components/responses/Problem403' + '405': + $ref: '#/components/responses/Problem405' + '406': + $ref: '#/components/responses/Problem406' + '503': + $ref: '#/components/responses/Problem503' + '413': + $ref: '#/components/responses/Problem413' + '415': + $ref: '#/components/responses/Problem415' + '404': + $ref: '#/components/responses/Problem404' + '412': + $ref: '#/components/responses/Problem412' + '428': + $ref: '#/components/responses/Problem428' + description: Only operator callers can grant permission. Omission retains it; turning off management + keeps existing hooks enabled. + parameters: + - name: session_id + in: path + required: true + schema: + $ref: '#/components/schemas/ID' + - $ref: '#/components/parameters/IfMatch' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/HookPermissionPatch' + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. + /extensions/proxy/v1/models: + get: + operationId: listProxyModels + summary: List saved-profile OpenAI model IDs + tags: + - proxy + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyModels' + '400': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '401': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '403': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '405': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '406': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '503': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + description: External OpenAI envelope. Bearer required unless operator explicitly configured anonymous + loopback access. + /extensions/proxy/v1/chat/completions: + post: + operationId: createProxyCompletion + summary: Run a stateless OpenAI chat completion + tags: + - proxy + responses: + '200': + description: Successful result. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyCompletion' + examples: + ProxyCompletion: + value: + id: completion-1 + object: chat.completion + created: 1790949600 + model: personal/example-model + choices: + - index: 0 + message: + role: assistant + content: Hello + finish_reason: stop + usage: + prompt_tokens: 1 + completion_tokens: 1 + total_tokens: 2 + text/event-stream: + itemSchema: + $ref: '#/components/schemas/ProxySSE' + '400': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '401': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '403': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '405': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '406': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '503': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '413': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + '415': + description: OpenAI proxy error. + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyError' + description: Caller supplies full history. Tool IDs carry opaque provider state and must be echoed + exactly. Bearer required unless anonymous loopback policy explicitly enabled. Providers apply + only representable generation options; proxy transport documentation defines these differences. + No automatic replay after request admission. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProxyCompletionRequest' + examples: + ProxyCompletionRequest: + value: + model: personal/example-model + messages: + - role: user + content: Hello + stream: true + description: UTF-8 JSON; duplicate keys and unknown fields are rejected. +components: + securitySchemes: + DaemonBearer: + type: http + scheme: bearer + description: Daemon operator token, supplied out of band. Browser clients use fetch for authenticated + JSON and SSE. No query tokens or authentication cookies. + WebhookSignature: + type: apiKey + in: header + name: X-Albedo-Signature + description: Default header only. Each hook may configure another header and prefix. HMAC-SHA256 + over exact raw bytes; bearer is not an alternative. + parameters: + IfMatch: + name: If-Match + in: header + required: true + schema: + $ref: '#/components/schemas/ETag' + description: Observed canonical representation validator. Wildcards and weak validators are not + accepted. + IfNoneMatch: + name: If-None-Match + in: header + required: true + schema: + const: '*' + description: Conditional creation only. + Limit: + name: limit + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 200 + default: 50 + Next: + name: next + in: query + required: false + schema: + $ref: '#/components/schemas/PageToken' + headers: + ETag: + description: Opaque strong validator for the complete canonical JSON representation. Mutation envelopes + carry their resource validator inside the body. + schema: + $ref: '#/components/schemas/ETag' + Location: + description: URL of the created resource. + schema: + $ref: '#/components/schemas/ResourceURL' + required: true + Vary: + description: Includes Accept; browser responses also include Origin. + schema: + type: string + RetryAfter: + description: Seconds until a later new admission may succeed. Never retries an already rejected + identified input. + schema: + type: integer + minimum: 0 + maximum: 3600 + WWWAuthenticate: + description: Bearer challenge. + schema: + type: string + pattern: ^Bearer + Allow: + description: Allowed methods for a known path. + schema: + type: string + responses: + Problem400: + description: Invalid request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem401: + description: Missing or invalid daemon token + headers: + WWWAuthenticate: + $ref: '#/components/headers/WWWAuthenticate' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem403: + description: Disallowed origin or caller + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem404: + description: Unknown resource or disabled service + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem405: + description: Method not allowed + headers: + Allow: + $ref: '#/components/headers/Allow' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem406: + description: Unsupported response media type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem409: + description: Conflicting intent, busy state or stale catalog + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem410: + description: Expired identity, deletion tombstone or obsolete context + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem412: + description: Stale representation or failed creation condition + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem413: + description: Body too large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem415: + description: Unsupported request media type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem428: + description: Required precondition missing + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem429: + description: Admission limit + headers: + RetryAfter: + $ref: '#/components/headers/RetryAfter' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + Problem503: + description: Unavailable owner, storage or upstream preparation + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + schemas: + ID: + type: string + minLength: 1 + description: Opaque identity. Never infer a resource type or route from its contents. + maxLength: 512 + UUIDv7: + type: string + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ + format: uuid + description: Client-generated lowercase UUIDv7. Retained decisions are checked before timestamp + expiry. + Generation: + type: string + pattern: ^[A-Za-z0-9_-]{21}[AQgw]$ + description: 128 random bits encoded as unpadded base64url; new for each session actor lifetime. + Counter: + type: integer + minimum: 0 + maximum: 9007199254740991 + Timestamp: + type: string + format: date-time + pattern: Z$ + description: UTC RFC 3339. + PageToken: + type: string + minLength: 1 + description: Opaque continuation, tied to the query and representation; never authority. + maxLength: 4096 + ETag: + type: string + pattern: ^"[^"\r\n]+"$ + description: Strong opaque validator for the complete canonical representation. + maxLength: 512 + ResourceURL: + type: string + pattern: ^/([^/#][^#]*)?$ + description: Daemon-relative URL, including any representation query. No foreign origin or fragment. + maxLength: 16384 + Workspace: + type: string + minLength: 1 + description: Canonical daemon-host location, local or SSH. Clients do not resolve this path locally. + maxLength: 4096 + SafeReason: + type: object + properties: + code: + type: string + minLength: 1 + maxLength: 100 + detail: + type: string + maxLength: 4096 + required: [code, detail] + additionalProperties: false + Warnings: + type: array + items: + $ref: '#/components/schemas/SafeReason' + maxItems: 100 + DynamicJSON: + description: 'Explicit domain payload: tool arguments, tool results, provider-private state, or + extension data. JSON values of any type are allowed; no core resource uses this as its envelope.' + Problem: + type: object + properties: + type: + const: about:blank + title: + type: string + maxLength: 256 + status: + type: integer + minimum: 400 + maximum: 599 + detail: + type: string + maxLength: 4096 + code: + type: string + minLength: 1 + maxLength: 100 + fields: + type: array + items: + type: object + properties: + pointer: + type: string + maxLength: 4096 + detail: + type: string + maxLength: 4096 + required: [pointer, detail] + additionalProperties: false + maxItems: 100 + decision: + oneOf: + - $ref: '#/components/schemas/CreationDecision' + - $ref: '#/components/schemas/InputDecision' + required: [type, title, status, detail, code] + additionalProperties: false + examples: + - type: about:blank + title: Queue full + status: 429 + detail: This session already has 32 waiting inputs. + code: queue_full + decision: + kind: input + input: + id: 01a0fcea-2b00-7000-8000-000000000002 + session_id: 01a0fcea-2b00-7000-8000-000000000001 + kind: message + admission: rejected + http_status: 429 + problem: + type: about:blank + title: Queue full + status: 429 + detail: This session already has 32 waiting inputs. + code: queue_full + accepted_at: null + acceptance_order: null + delivery: null + blocking_reason: null + transcript_position: null + turn: null + client_id: draft-1 + EmptyRequest: + type: object + properties: {} + additionalProperties: false + Cursor: + type: object + properties: + generation: + $ref: '#/components/schemas/Generation' + sequence: + $ref: '#/components/schemas/Counter' + required: [generation, sequence] + additionalProperties: false + ResourceValidator: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + required: [url, etag] + additionalProperties: false + Notification: + type: object + properties: + state: + type: string + enum: [not_requested, queued, failed] + code: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + detail: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + required: [state, code, detail] + additionalProperties: false + TargetNotification: + type: object + properties: + session_id: + $ref: '#/components/schemas/ID' + notification: + $ref: '#/components/schemas/Notification' + required: [session_id, notification] + additionalProperties: false + QuotaObservation: + type: object + properties: + sequence: + $ref: '#/components/schemas/Counter' + provider: + $ref: '#/components/schemas/ID' + account_id: + $ref: '#/components/schemas/ID' + limit_id: + type: string + maxLength: 256 + label: + type: string + maxLength: 4096 + plan: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + used_percent: + anyOf: + - type: number + - type: 'null' + window_label: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + window_seconds: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + resets_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + scope: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + status: + type: string + maxLength: 256 + source: + type: string + maxLength: 256 + error: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + observed_at: + $ref: '#/components/schemas/Timestamp' + required: + - sequence + - provider + - account_id + - limit_id + - label + - plan + - used_percent + - window_label + - window_seconds + - resets_at + - scope + - status + - source + - error + - observed_at + additionalProperties: false + QuotaPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/QuotaObservation' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + Server: + type: object + properties: + instance_id: + $ref: '#/components/schemas/ID' + protocol: + const: 3 + state: + type: string + enum: [ready, draining] + capabilities: + type: object + additionalProperties: + type: integer + minimum: 1 + maximum: 9007199254740991 + build: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + digest: + type: [string, 'null'] + pattern: ^[0-9a-f]{64}$ + description: Content digest of the running code tree; update information, not attachment compatibility. + extensions: + type: array + items: + type: object + properties: + name: + $ref: '#/components/schemas/ID' + version: + type: integer + minimum: 1 + maximum: 9007199254740991 + required: [name, version] + additionalProperties: false + maxItems: 200 + quota: + anyOf: + - type: array + items: + $ref: '#/components/schemas/QuotaObservation' + maxItems: 200 + - type: 'null' + notices: + type: array + items: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [info, warning, migration] + message: + type: string + maxLength: 4096 + required: [id, kind, message] + additionalProperties: false + maxItems: 100 + quota_history: + $ref: '#/components/schemas/QuotaPage' + required: [instance_id, protocol, state, capabilities, build, digest, extensions, quota, notices] + additionalProperties: false + examples: + - instance_id: instance-1 + protocol: 3 + state: ready + capabilities: + durable_inputs: 1 + session_replay: 1 + collection_invalidation: 1 + tool_progress: 1 + storage_report: 1 + build: example-build + digest: null + extensions: + - name: work + version: 1 + quota: null + notices: [] + ShutdownRequest: + type: object + properties: + instance_id: + $ref: '#/components/schemas/ID' + timeout_ms: + type: integer + minimum: 1 + maximum: 30000 + default: 5000 + required: [instance_id] + additionalProperties: false + Shutdown: + type: object + properties: + instance_id: + $ref: '#/components/schemas/ID' + state: + const: draining + required: [instance_id, state] + additionalProperties: false + ProviderProfile: + type: object + properties: + extension: + $ref: '#/components/schemas/ID' + endpoint: + anyOf: + - type: string + format: uri + maxLength: 4096 + - type: 'null' + protocol: + type: string + enum: [responses, chat_completions] + model: + $ref: '#/components/schemas/ID' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + image_edge: + anyOf: + - type: integer + minimum: 1 + maximum: 65536 + - type: 'null' + account_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + has_key: + type: boolean + required: [extension, endpoint, protocol, model, effort, image_edge, account_id, has_key] + additionalProperties: false + ProviderProfilePatch: + type: object + properties: + extension: + $ref: '#/components/schemas/ID' + endpoint: + anyOf: + - type: string + format: uri + maxLength: 4096 + - type: 'null' + protocol: + type: string + enum: [responses, chat_completions] + model: + $ref: '#/components/schemas/ID' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + image_edge: + anyOf: + - type: integer + minimum: 1 + maximum: 65536 + - type: 'null' + account_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + api_key: + anyOf: + - type: string + minLength: 1 + writeOnly: true + maxLength: 16384 + - type: 'null' + description: Partial existing profile; extension and model required when creating a new map entry. + additionalProperties: false + ProviderSettings: + type: object + properties: + default_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + profiles: + type: object + additionalProperties: + $ref: '#/components/schemas/ProviderProfile' + required: [default_profile, profiles] + additionalProperties: false + ProviderSettingsPatch: + type: object + properties: + default_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + profiles: + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ProviderProfilePatch' + - type: 'null' + description: Removing the selected profile requires replacing or clearing default_profile in this + same patch. + additionalProperties: false + examples: + - default_profile: personal + profiles: + personal: + extension: openai + endpoint: https://provider.example/v1 + protocol: responses + model: example-model + effort: null + image_edge: null + account_id: null + api_key: synthetic-example-key + ValueSource: + type: object + properties: + source: + type: string + enum: [literal, env] + value: + type: string + maxLength: 16384 + description: For env, value is a daemon-host environment variable name. + required: [source, value] + additionalProperties: false + SecretPresence: + type: object + properties: + bearer_token: + type: boolean + environment: + type: array + items: + type: string + maxLength: 256 + maxItems: 200 + headers: + type: array + items: + type: string + maxLength: 256 + maxItems: 200 + required: [bearer_token, environment, headers] + additionalProperties: false + MCPDefinition: + type: object + properties: + enabled: + type: boolean + transport: + type: string + enum: [stdio, http] + command: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + arguments: + type: array + items: + type: string + maxLength: 4096 + maxItems: 200 + cwd: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + url: + anyOf: + - type: string + format: uri + maxLength: 4096 + - type: 'null' + environment: + type: object + additionalProperties: + $ref: '#/components/schemas/ValueSource' + headers: + type: object + additionalProperties: + $ref: '#/components/schemas/ValueSource' + bearer_token_env_var: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + enabled_tools: + anyOf: + - type: array + items: + type: string + maxLength: 256 + maxItems: 1000 + - type: 'null' + disabled_tools: + type: array + items: + type: string + maxLength: 256 + maxItems: 1000 + startup_timeout_ms: + type: integer + minimum: 1 + maximum: 300000 + call_timeout_ms: + type: integer + minimum: 1 + maximum: 3600000 + secret_presence: + $ref: '#/components/schemas/SecretPresence' + required: [enabled, transport, command, arguments, cwd, url, environment, headers, bearer_token_env_var, + enabled_tools, disabled_tools, startup_timeout_ms, call_timeout_ms, secret_presence] + additionalProperties: false + MCPSecretsPatch: + type: object + properties: + bearer_token: + anyOf: + - type: string + minLength: 1 + writeOnly: true + maxLength: 16384 + - type: 'null' + environment: + type: object + additionalProperties: + anyOf: + - type: string + writeOnly: true + maxLength: 16384 + - type: 'null' + headers: + type: object + additionalProperties: + anyOf: + - type: string + writeOnly: true + maxLength: 16384 + - type: 'null' + writeOnly: true + additionalProperties: false + MCPDefinitionPatch: + type: object + properties: + enabled: + type: boolean + transport: + type: string + enum: [stdio, http] + command: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + arguments: + type: array + items: + type: string + maxLength: 4096 + maxItems: 200 + cwd: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + url: + anyOf: + - type: string + format: uri + maxLength: 4096 + - type: 'null' + environment: + anyOf: + - type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ValueSource' + - type: 'null' + - type: 'null' + headers: + anyOf: + - type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ValueSource' + - type: 'null' + - type: 'null' + bearer_token_env_var: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + enabled_tools: + anyOf: + - type: array + items: + type: string + maxLength: 256 + maxItems: 1000 + - type: 'null' + disabled_tools: + type: array + items: + type: string + maxLength: 256 + maxItems: 1000 + startup_timeout_ms: + type: integer + minimum: 1 + maximum: 300000 + call_timeout_ms: + type: integer + minimum: 1 + maximum: 3600000 + secrets: + $ref: '#/components/schemas/MCPSecretsPatch' + description: Partial merge patch. Public and secret sources cannot overlap. HTTP and stdio fields + are validated against transport on the complete candidate. Public environment/header entries accept + null removal; a null whole map clears it. Switching credential sources removes the former source + in the same patch. + additionalProperties: false + MCPSettings: + type: object + properties: + definitions: + type: object + additionalProperties: + $ref: '#/components/schemas/MCPDefinition' + required: [definitions] + additionalProperties: false + MCPSettingsPatch: + type: object + properties: + definitions: + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/MCPDefinitionPatch' + - type: 'null' + validate_connection: + type: boolean + default: true + writeOnly: true + description: Validate candidate connections before atomic commit unless explicitly disabled. + additionalProperties: false + examples: + - validate_connection: true + definitions: + example: + enabled: true + transport: http + url: https://tools.example/mcp + secrets: + bearer_token: synthetic-example-token + ExtensionSettings: + type: object + properties: + defaults: + type: object + additionalProperties: + type: boolean + required: [defaults] + additionalProperties: false + ExtensionSettingsPatch: + type: object + properties: + defaults: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + additionalProperties: false + CapabilitySettings: + type: object + properties: + preferences: + type: object + additionalProperties: + type: boolean + required: [preferences] + additionalProperties: false + CapabilitySettingsPatch: + type: object + properties: + catalog_session_id: + $ref: '#/components/schemas/ID' + catalog_revision: + $ref: '#/components/schemas/ID' + choices: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + description: Resolve candidate IDs to stable preference keys under the observed catalog revision. + required: [catalog_session_id, catalog_revision, choices] + additionalProperties: false + CachePrior: + type: object + properties: + provider: + $ref: '#/components/schemas/ID' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + ttl_seconds: + anyOf: + - type: integer + minimum: 0 + maximum: 9007199254740991 + - type: 'null' + source: + type: string + maxLength: 256 + required: [provider, model, ttl_seconds, source] + additionalProperties: false + ModelSettings: + type: object + properties: + raised_caps: + type: object + additionalProperties: + type: boolean + cache_ttl_priors: + type: array + items: + $ref: '#/components/schemas/CachePrior' + maxItems: 200 + required: [raised_caps, cache_ttl_priors] + additionalProperties: false + ModelSettingsPatch: + type: object + properties: + raised_caps: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + description: Keys are cap_key values from model metadata. True raises to the advertised maximum; + false uses the ordinary limit; null clears the choice. A missing choice defaults to false. Only + raised_caps is writable. + additionalProperties: false + UISettings: + type: object + properties: + thinking: + type: boolean + tools: + type: boolean + dismissed_notices: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 1000 + required: [thinking, tools, dismissed_notices] + additionalProperties: false + UISettingsPatch: + type: object + properties: + thinking: + type: boolean + tools: + type: boolean + dismissed_notices: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 1000 + additionalProperties: false + ProviderSettingsResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/ProviderSettings' + required: [url, etag, value] + additionalProperties: false + MCPSettingsResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/MCPSettings' + required: [url, etag, value] + additionalProperties: false + ExtensionSettingsResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/ExtensionSettings' + required: [url, etag, value] + additionalProperties: false + CapabilitySettingsResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/CapabilitySettings' + required: [url, etag, value] + additionalProperties: false + ModelSettingsResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/ModelSettings' + required: [url, etag, value] + additionalProperties: false + UISettingsResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/UISettings' + required: [url, etag, value] + additionalProperties: false + Settings: + type: object + properties: + providers: + $ref: '#/components/schemas/ProviderSettings' + mcp: + $ref: '#/components/schemas/MCPSettings' + extensions: + $ref: '#/components/schemas/ExtensionSettings' + capabilities: + $ref: '#/components/schemas/CapabilitySettings' + models: + $ref: '#/components/schemas/ModelSettings' + ui: + $ref: '#/components/schemas/UISettings' + group_resources: + type: object + properties: + providers: + $ref: '#/components/schemas/ResourceValidator' + mcp: + $ref: '#/components/schemas/ResourceValidator' + extensions: + $ref: '#/components/schemas/ResourceValidator' + capabilities: + $ref: '#/components/schemas/ResourceValidator' + models: + $ref: '#/components/schemas/ResourceValidator' + ui: + $ref: '#/components/schemas/ResourceValidator' + required: [providers, mcp, extensions, capabilities, models, ui] + additionalProperties: false + required: [providers, mcp, extensions, capabilities, models, ui, group_resources] + additionalProperties: false + SettingsRead: + oneOf: + - $ref: '#/components/schemas/Settings' + - $ref: '#/components/schemas/ProviderSettings' + - $ref: '#/components/schemas/MCPSettings' + - $ref: '#/components/schemas/ExtensionSettings' + - $ref: '#/components/schemas/CapabilitySettings' + - $ref: '#/components/schemas/ModelSettings' + - $ref: '#/components/schemas/UISettings' + SettingsPatch: + anyOf: + - $ref: '#/components/schemas/ProviderSettingsPatch' + - $ref: '#/components/schemas/MCPSettingsPatch' + - $ref: '#/components/schemas/ExtensionSettingsPatch' + - $ref: '#/components/schemas/CapabilitySettingsPatch' + - $ref: '#/components/schemas/ModelSettingsPatch' + - $ref: '#/components/schemas/UISettingsPatch' + description: The group query selects the one applicable patch schema. It is an error to send fields + for another group. + SettingsApplication: + type: object + properties: + desired_revision: + $ref: '#/components/schemas/ID' + active_service_revision: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + needs_reload_count: + $ref: '#/components/schemas/Counter' + session_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + more: + type: boolean + validation: + type: string + enum: [passed, skipped, not_applicable] + warnings: + $ref: '#/components/schemas/Warnings' + required: [desired_revision, active_service_revision, needs_reload_count, session_ids, more, validation, + warnings] + additionalProperties: false + ProviderSettingsChange: + type: object + properties: + group: + const: providers + resource: + $ref: '#/components/schemas/ProviderSettingsResource' + application: + $ref: '#/components/schemas/SettingsApplication' + required: [group, resource, application] + additionalProperties: false + MCPSettingsChange: + type: object + properties: + group: + const: mcp + resource: + $ref: '#/components/schemas/MCPSettingsResource' + application: + $ref: '#/components/schemas/SettingsApplication' + required: [group, resource, application] + additionalProperties: false + ExtensionSettingsChange: + type: object + properties: + group: + const: extensions + resource: + $ref: '#/components/schemas/ExtensionSettingsResource' + application: + $ref: '#/components/schemas/SettingsApplication' + required: [group, resource, application] + additionalProperties: false + CapabilitySettingsChange: + type: object + properties: + group: + const: capabilities + resource: + $ref: '#/components/schemas/CapabilitySettingsResource' + application: + $ref: '#/components/schemas/SettingsApplication' + required: [group, resource, application] + additionalProperties: false + ModelSettingsChange: + type: object + properties: + group: + const: models + resource: + $ref: '#/components/schemas/ModelSettingsResource' + application: + $ref: '#/components/schemas/SettingsApplication' + required: [group, resource, application] + additionalProperties: false + UISettingsChange: + type: object + properties: + group: + const: ui + resource: + $ref: '#/components/schemas/UISettingsResource' + application: + $ref: '#/components/schemas/SettingsApplication' + required: [group, resource, application] + additionalProperties: false + SettingsChange: + oneOf: + - $ref: '#/components/schemas/ProviderSettingsChange' + - $ref: '#/components/schemas/MCPSettingsChange' + - $ref: '#/components/schemas/ExtensionSettingsChange' + - $ref: '#/components/schemas/CapabilitySettingsChange' + - $ref: '#/components/schemas/ModelSettingsChange' + - $ref: '#/components/schemas/UISettingsChange' + StorageSession: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + title: + type: string + maxLength: 4096 + workspace: + $ref: '#/components/schemas/Workspace' + created_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + activity_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + estimated_content_bytes: + $ref: '#/components/schemas/Counter' + required: [id, title, workspace, created_at, activity_at, estimated_content_bytes] + additionalProperties: false + StorageFile: + type: object + properties: + path: + type: string + maxLength: 4096 + category: + type: string + enum: [kernel, backup, other] + bytes: + $ref: '#/components/schemas/Counter' + modified_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + cleanup_candidate: + type: boolean + cleanup_reason: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [path, category, bytes, modified_at, cleanup_candidate, cleanup_reason] + additionalProperties: false + StorageSessionPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/StorageSession' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + total_count: + $ref: '#/components/schemas/Counter' + total_estimated_content_bytes: + $ref: '#/components/schemas/Counter' + required: [items, next, total_count, total_estimated_content_bytes] + additionalProperties: false + StorageFilePage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/StorageFile' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + totals: + type: object + properties: + kernel_bytes: + $ref: '#/components/schemas/Counter' + backup_bytes: + $ref: '#/components/schemas/Counter' + other_bytes: + $ref: '#/components/schemas/Counter' + recent_backup_bytes: + $ref: '#/components/schemas/Counter' + recent_backup_count: + $ref: '#/components/schemas/Counter' + required: [kernel_bytes, backup_bytes, other_bytes, recent_backup_bytes, recent_backup_count] + additionalProperties: false + required: [items, next, totals] + additionalProperties: false + StorageReport: + type: object + properties: + database: + type: object + properties: + main_file_bytes: + $ref: '#/components/schemas/Counter' + wal_bytes: + $ref: '#/components/schemas/Counter' + page_size_bytes: + $ref: '#/components/schemas/Counter' + page_count: + $ref: '#/components/schemas/Counter' + free_page_count: + $ref: '#/components/schemas/Counter' + used_bytes: + $ref: '#/components/schemas/Counter' + required: [main_file_bytes, wal_bytes, page_size_bytes, page_count, free_page_count, used_bytes] + additionalProperties: false + sessions: + $ref: '#/components/schemas/StorageSessionPage' + images: + type: object + properties: + count: + $ref: '#/components/schemas/Counter' + bytes: + $ref: '#/components/schemas/Counter' + required: [count, bytes] + additionalProperties: false + files: + $ref: '#/components/schemas/StorageFilePage' + measured_at: + $ref: '#/components/schemas/Timestamp' + required: [database, sessions, images, files, measured_at] + additionalProperties: false + examples: + - database: + main_file_bytes: 8192 + wal_bytes: 0 + page_size_bytes: 4096 + page_count: 2 + free_page_count: 0 + used_bytes: 8192 + sessions: + items: [] + next: null + total_count: 0 + total_estimated_content_bytes: 0 + images: + count: 0 + bytes: 0 + files: + items: [] + next: null + totals: + kernel_bytes: 0 + backup_bytes: 0 + other_bytes: 0 + recent_backup_bytes: 0 + recent_backup_count: 0 + measured_at: '2026-10-02T14:00:00Z' + SessionStatus: + type: object + properties: + phase: + type: string + enum: [idle, preparing, generating, running, interrupting, compacting] + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + interrupt_requested: + type: boolean + blocking_reason: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [phase, run_id, interrupt_requested, blocking_reason] + additionalProperties: false + Preview: + type: object + properties: + text: + type: string + x-max-utf8-bytes: 1024 + maxLength: 256 + transcript_count: + $ref: '#/components/schemas/Counter' + truncated: + type: boolean + required: [text, transcript_count, truncated] + additionalProperties: false + SessionPreferences: + type: object + properties: + pinned: + type: boolean + pin_order: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + archived: + type: boolean + opens: + $ref: '#/components/schemas/Counter' + required: [pinned, pin_order, archived, opens] + additionalProperties: false + PreferencePatch: + type: object + properties: + pinned: + type: boolean + archived: + type: boolean + additionalProperties: false + ProgressPreview: + type: object + properties: + offset_scalars: + $ref: '#/components/schemas/Counter' + text: + type: string + x-max-utf8-bytes: 2048 + maxLength: 512 + required: [offset_scalars, text] + additionalProperties: false + ToolProgress: + type: object + properties: + call_id: + $ref: '#/components/schemas/ID' + tool_call_id: + anyOf: + - type: string + minLength: 1 + x-max-utf8-bytes: 200 + maxLength: 200 + - type: 'null' + name: + type: string + minLength: 1 + x-max-utf8-bytes: 100 + maxLength: 100 + phase: + type: string + enum: [generating, running] + intent: + type: string + enum: [read, search, list, run, unknown] + preview: + $ref: '#/components/schemas/ProgressPreview' + x-max-encoded-bytes: 8192 + required: [call_id, tool_call_id, name, phase, intent] + additionalProperties: false + examples: + - call_id: progress-1 + tool_call_id: null + name: python + phase: generating + intent: unknown + preview: + offset_scalars: 0 + text: print("hello") + Activity: + type: object + properties: + lines: + type: array + items: + type: object + properties: + kind: + type: string + enum: [assistant, thinking, tool, input, note, error] + text: + type: string + x-max-utf8-bytes: 1024 + maxLength: 256 + required: [kind, text] + additionalProperties: false + maxItems: 12 + output_scalars: + $ref: '#/components/schemas/Counter' + output_utf8_bytes: + $ref: '#/components/schemas/Counter' + observed_at: + $ref: '#/components/schemas/Timestamp' + latest_input: + anyOf: + - type: object + properties: + input_id: + $ref: '#/components/schemas/ID' + source: + type: string + enum: [chat, agent, system] + bytes: + $ref: '#/components/schemas/Counter' + required: [input_id, source, bytes] + additionalProperties: false + - type: 'null' + latest_answer: + anyOf: + - type: object + properties: + message_id: + $ref: '#/components/schemas/ID' + bytes: + $ref: '#/components/schemas/Counter' + required: [message_id, bytes] + additionalProperties: false + - type: 'null' + x-max-encoded-bytes: 16384 + required: [lines, output_scalars, output_utf8_bytes, observed_at, latest_input, latest_answer] + additionalProperties: false + SessionLocation: + type: object + description: Parsed workspace and daemon-resolved display label. Reading this metadata does not connect to the remote host. + properties: + host: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + user: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + path: + type: string + maxLength: 16384 + label: + anyOf: + - type: string + maxLength: 8192 + - type: 'null' + required: [host, user, path, label] + additionalProperties: false + SessionSummary: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + name: + type: string + maxLength: 4096 + automatic_name: + type: string + maxLength: 4096 + location: + $ref: '#/components/schemas/SessionLocation' + workspace: + $ref: '#/components/schemas/Workspace' + parent_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + root_id: + $ref: '#/components/schemas/ID' + address: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + depth: + type: integer + minimum: 0 + maximum: 1000 + closed: + type: boolean + created_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + activity_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + provider_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + status: + $ref: '#/components/schemas/SessionStatus' + preview: + $ref: '#/components/schemas/Preview' + preferences: + $ref: '#/components/schemas/SessionPreferences' + current_progress: + type: array + items: + $ref: '#/components/schemas/ToolProgress' + maxItems: 32 + activity: + $ref: '#/components/schemas/Activity' + cursor: + anyOf: + - $ref: '#/components/schemas/Cursor' + - type: 'null' + description: Live fields and cursor are captured together. Extra response fields may be ignored. + required: [id, name, automatic_name, workspace, location, parent_id, root_id, address, depth, closed, created_at, + activity_at, provider_profile, model, effort, status, preview, preferences, current_progress, + activity, cursor] + SessionPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/SessionSummary' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + family: + type: object + properties: + root_id: + $ref: '#/components/schemas/ID' + revision: + $ref: '#/components/schemas/ID' + required: [root_id, revision] + additionalProperties: false + required: [items, next] + additionalProperties: false + examples: + - items: + - id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + automatic_name: New session + workspace: /workspace/project + location: + host: null + user: null + path: /workspace/project + label: null + parent_id: null + root_id: 01a0fcea-2b00-7000-8000-000000000001 + address: null + depth: 0 + closed: false + created_at: '2026-10-02T14:00:00Z' + activity_at: '2026-10-02T14:00:00Z' + provider_profile: personal + model: example-model + effort: null + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + preview: + text: '' + transcript_count: 0 + truncated: false + preferences: + pinned: false + pin_order: null + archived: false + opens: 0 + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + next: null + SelectionOverrides: + type: object + properties: + extensions: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + skills: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + instructions: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + mcp: + type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + required: [extensions, skills, instructions, mcp] + additionalProperties: false + SelectionPatch: + type: object + properties: + extensions: + anyOf: + - type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + - type: 'null' + skills: + anyOf: + - type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + - type: 'null' + instructions: + anyOf: + - type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + - type: 'null' + mcp: + anyOf: + - type: object + additionalProperties: + anyOf: + - type: boolean + - type: 'null' + - type: 'null' + description: Null map entry clears that override. Null entire map clears all overrides of that kind. + additionalProperties: false + SessionSelection: + type: object + properties: + overrides: + $ref: '#/components/schemas/SelectionOverrides' + effective: + type: object + properties: + extensions: + type: object + additionalProperties: + type: boolean + skills: + type: object + additionalProperties: + type: boolean + instructions: + type: object + additionalProperties: + type: boolean + mcp: + type: object + additionalProperties: + type: boolean + required: [extensions, skills, instructions, mcp] + additionalProperties: false + required: [overrides, effective] + additionalProperties: false + SessionConfiguration: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + name: + type: string + maxLength: 4096 + workspace: + $ref: '#/components/schemas/Workspace' + provider_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + preferences: + type: object + properties: + pinned: + type: boolean + pin_order: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + archived: + type: boolean + required: [pinned, pin_order, archived] + additionalProperties: false + selection: + $ref: '#/components/schemas/SelectionOverrides' + revision: + $ref: '#/components/schemas/ID' + family_revision: + $ref: '#/components/schemas/ID' + required: [id, name, workspace, provider_profile, model, effort, preferences, selection, revision, + family_revision] + additionalProperties: false + examples: + - id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + preferences: + pinned: false + pin_order: null + archived: false + selection: + extensions: {} + skills: {} + instructions: {} + mcp: {} + revision: config-1 + family_revision: family-1 + SessionConfigurationResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/SessionConfiguration' + required: [url, etag, value] + additionalProperties: false + SessionPatch: + type: object + properties: + name: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + provider_profile: + $ref: '#/components/schemas/ID' + model: + $ref: '#/components/schemas/ID' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + preferences: + $ref: '#/components/schemas/PreferencePatch' + selection: + $ref: '#/components/schemas/SelectionPatch' + catalog_revision: + $ref: '#/components/schemas/ID' + description: Skill and instruction changes require catalog_revision. All fields validate and commit + together. + additionalProperties: false + examples: + - selection: + extensions: + browser: null + skills: + candidate-1: false + catalog_revision: discovery-1 + WorkspaceMoveRequest: + type: object + properties: + workspace: + $ref: '#/components/schemas/Workspace' + family_revision: + $ref: '#/components/schemas/ID' + required: [workspace, family_revision] + additionalProperties: false + examples: + - workspace: /workspace/other-project + family_revision: family-1 + SessionChangeRequest: + oneOf: + - $ref: '#/components/schemas/SessionPatch' + - $ref: '#/components/schemas/WorkspaceMoveRequest' + NewSessionRequest: + type: object + properties: + kind: + const: new + workspace: + $ref: '#/components/schemas/Workspace' + name: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + provider_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [kind, workspace] + additionalProperties: false + examples: + - kind: new + workspace: /workspace/project + NewSessionIntent: + type: object + properties: + kind: + const: new + workspace: + $ref: '#/components/schemas/Workspace' + name: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + provider_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [kind, workspace, name, provider_profile, model, effort] + additionalProperties: false + ForkSessionRequest: + type: object + properties: + kind: + const: fork + source_session_id: + $ref: '#/components/schemas/ID' + checkpoint_id: + $ref: '#/components/schemas/ID' + name: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + required: [kind, source_session_id, checkpoint_id] + additionalProperties: false + ForkSessionIntent: + type: object + properties: + kind: + const: fork + source_session_id: + $ref: '#/components/schemas/ID' + checkpoint_id: + $ref: '#/components/schemas/ID' + name: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + required: [kind, source_session_id, checkpoint_id, name] + additionalProperties: false + ChildSessionRequest: + type: object + properties: + kind: + const: child + parent_id: + $ref: '#/components/schemas/ID' + address: + type: string + minLength: 1 + maxLength: 512 + name: + type: string + minLength: 1 + maxLength: 4096 + initial_input_id: + $ref: '#/components/schemas/UUIDv7' + task: + type: string + minLength: 1 + maxLength: 32768 + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [kind, parent_id, address, name, initial_input_id, task] + additionalProperties: false + ChildSessionIntent: + type: object + properties: + kind: + const: child + parent_id: + $ref: '#/components/schemas/ID' + address: + type: string + minLength: 1 + maxLength: 512 + name: + type: string + minLength: 1 + maxLength: 4096 + initial_input_id: + $ref: '#/components/schemas/UUIDv7' + task: + type: string + minLength: 1 + maxLength: 32768 + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [kind, parent_id, address, name, initial_input_id, task, model, effort] + additionalProperties: false + SessionCreationRequest: + oneOf: + - $ref: '#/components/schemas/NewSessionRequest' + - $ref: '#/components/schemas/ForkSessionRequest' + - $ref: '#/components/schemas/ChildSessionRequest' + Creation: + type: object + properties: + submitted: + oneOf: + - $ref: '#/components/schemas/NewSessionIntent' + - $ref: '#/components/schemas/ForkSessionIntent' + - $ref: '#/components/schemas/ChildSessionIntent' + resolved: + type: object + properties: + workspace: + $ref: '#/components/schemas/Workspace' + provider_profile: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + effort: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [workspace, provider_profile, model, effort] + additionalProperties: false + required: [submitted, resolved] + additionalProperties: false + CreationDecision: + type: object + properties: + kind: + const: creation + session_id: + $ref: '#/components/schemas/ID' + admission: + type: string + enum: [accepted, rejected] + http_status: + type: integer + minimum: 200 + maximum: 599 + creation: + anyOf: + - $ref: '#/components/schemas/Creation' + - type: 'null' + decided_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + deleted_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + required: [kind, session_id, admission, http_status, creation, decided_at, deleted_at] + additionalProperties: false + WorkspaceChange: + type: object + properties: + desired: + $ref: '#/components/schemas/Workspace' + active: + $ref: '#/components/schemas/Workspace' + state: + type: string + enum: [deferred, applying] + revision: + $ref: '#/components/schemas/ID' + required: [desired, active, state, revision] + additionalProperties: false + QuarantineDiagnostic: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + reason: + $ref: '#/components/schemas/SafeReason' + required: [id, reason] + additionalProperties: false + Composition: + type: object + properties: + desired_revision: + $ref: '#/components/schemas/ID' + loaded_revision: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + needs_reload: + type: boolean + dependencies: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + quarantine: + type: array + items: + $ref: '#/components/schemas/QuarantineDiagnostic' + maxItems: 200 + availability: + type: object + additionalProperties: + type: boolean + required: [desired_revision, loaded_revision, needs_reload, dependencies, quarantine, availability] + additionalProperties: false + Kernel: + type: object + properties: + state: + type: string + enum: [none, booting, attached, reattaching, lost] + stage: + anyOf: + - type: string + enum: [staging, starting] + - type: 'null' + build: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + stale: + type: boolean + staleness_reasons: + type: array + items: + $ref: '#/components/schemas/SafeReason' + maxItems: 100 + live_job_count: + description: Observed owned jobs. Null while booting or when the kernel owner is lost. + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + instance_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + required: [state, stage, build, stale, staleness_reasons, live_job_count, instance_id] + additionalProperties: false + Usage: + type: object + properties: + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + observed_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + prompt_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + cached_prompt_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + cache_write_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + completion_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + total_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + elapsed_ms: + anyOf: + - type: number + minimum: 0 + - type: 'null' + tokens_per_second: + anyOf: + - type: number + minimum: 0 + - type: 'null' + context_window_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + cache_ttl_seconds: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + cache_fade: + type: array + items: + type: object + properties: + at: + $ref: '#/components/schemas/Timestamp' + cached_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + required: [at, cached_tokens] + additionalProperties: false + maxItems: 200 + required: [model, observed_at, prompt_tokens, cached_prompt_tokens, cache_write_tokens, completion_tokens, + total_tokens, elapsed_ms, tokens_per_second, context_window_tokens, cache_ttl_seconds, cache_fade] + additionalProperties: false + PendingInput: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [message, continue, skill, command] + preview: + $ref: '#/components/schemas/Preview' + accepted_at: + $ref: '#/components/schemas/Timestamp' + acceptance_order: + $ref: '#/components/schemas/Counter' + delivery: + const: pending + blocking_reason: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [id, kind, preview, accepted_at, acceptance_order, delivery, blocking_reason] + additionalProperties: false + Glance: + type: object + properties: + extension: + $ref: '#/components/schemas/ID' + title: + type: string + maxLength: 256 + rows: + type: array + items: + $ref: '#/components/schemas/PageRow' + maxItems: 12 + url: + $ref: '#/components/schemas/ResourceURL' + data: + $ref: '#/components/schemas/DynamicJSON' + x-max-encoded-bytes: 8192 + required: [extension, title, rows, url] + additionalProperties: false + Session: + allOf: + - $ref: '#/components/schemas/SessionSummary' + - type: object + properties: + creation: + description: Null only for stored sessions that predate immutable creation provenance. All newly admitted creations have provenance. + anyOf: + - $ref: '#/components/schemas/Creation' + - type: 'null' + revision: + $ref: '#/components/schemas/ID' + family_revision: + $ref: '#/components/schemas/ID' + configuration_resource: + $ref: '#/components/schemas/SessionConfigurationResource' + workspace_change: + anyOf: + - $ref: '#/components/schemas/WorkspaceChange' + - type: 'null' + selection: + $ref: '#/components/schemas/SessionSelection' + composition: + $ref: '#/components/schemas/Composition' + kernel: + $ref: '#/components/schemas/Kernel' + pending_inputs: + type: array + items: + $ref: '#/components/schemas/PendingInput' + maxItems: 32 + input_order: + $ref: '#/components/schemas/Counter' + usage: + $ref: '#/components/schemas/Usage' + history: + $ref: '#/components/schemas/HistoryPage' + glances: + type: array + items: + $ref: '#/components/schemas/Glance' + maxItems: 16 + required: [creation, revision, family_revision, configuration_resource, workspace_change, selection, + composition, kernel, pending_inputs, input_order, usage, history, glances] + unevaluatedProperties: false + x-max-encoded-bytes: 1048576 + examples: + - id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + automatic_name: New session + workspace: /workspace/project + location: + host: null + user: null + path: /workspace/project + label: null + parent_id: null + root_id: 01a0fcea-2b00-7000-8000-000000000001 + address: null + depth: 0 + closed: false + created_at: '2026-10-02T14:00:00Z' + activity_at: '2026-10-02T14:00:00Z' + provider_profile: personal + model: example-model + effort: null + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + preview: + text: '' + transcript_count: 0 + truncated: false + preferences: + pinned: false + pin_order: null + archived: false + opens: 0 + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + creation: + submitted: + kind: new + workspace: /workspace/project + name: null + provider_profile: null + model: null + effort: null + resolved: + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + revision: config-1 + family_revision: family-1 + configuration_resource: + url: /sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration + etag: '"session-config-1"' + value: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + preferences: + pinned: false + pin_order: null + archived: false + selection: + extensions: {} + skills: {} + instructions: {} + mcp: {} + revision: config-1 + family_revision: family-1 + workspace_change: null + selection: + overrides: + extensions: {} + skills: {} + instructions: {} + mcp: {} + effective: + extensions: {} + skills: {} + instructions: {} + mcp: {} + composition: + desired_revision: composition-1 + loaded_revision: null + needs_reload: true + dependencies: {} + quarantine: [] + availability: {} + kernel: + instance_id: null + state: none + stage: null + build: null + stale: false + staleness_reasons: [] + live_job_count: 0 + pending_inputs: [] + input_order: 0 + usage: + model: null + observed_at: null + prompt_tokens: null + cached_prompt_tokens: null + cache_write_tokens: null + completion_tokens: null + total_tokens: null + elapsed_ms: null + tokens_per_second: null + context_window_tokens: null + cache_ttl_seconds: null + cache_fade: [] + history: + items: [] + older: null + newer: null + high_water: 0 + glances: [] + SessionRead: + oneOf: + - $ref: '#/components/schemas/Session' + - $ref: '#/components/schemas/SessionConfiguration' + SessionChange: + type: object + properties: + resource: + $ref: '#/components/schemas/SessionConfigurationResource' + session: + $ref: '#/components/schemas/Session' + move: + anyOf: + - type: object + properties: + applied_count: + $ref: '#/components/schemas/Counter' + deferred_count: + $ref: '#/components/schemas/Counter' + applied_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + deferred_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + truncated: + type: boolean + warnings: + $ref: '#/components/schemas/Warnings' + required: [applied_count, deferred_count, applied_ids, deferred_ids, truncated, warnings] + additionalProperties: false + - type: 'null' + required: [resource, session, move] + additionalProperties: false + Visit: + type: object + properties: + visit_id: + $ref: '#/components/schemas/ID' + session_id: + $ref: '#/components/schemas/ID' + opens: + $ref: '#/components/schemas/Counter' + required: [visit_id, session_id, opens] + additionalProperties: false + SessionDeletion: + type: object + properties: + state: + type: string + enum: [complete, partial] + deleted_count: + $ref: '#/components/schemas/Counter' + remaining_count: + $ref: '#/components/schemas/Counter' + deleted_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + remaining: + type: array + items: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + reason: + $ref: '#/components/schemas/SafeReason' + required: [id, reason] + additionalProperties: false + maxItems: 200 + truncated: + type: boolean + description: Counts cover the complete captured operation. ID lists are bounded summaries, never + false completion. Refresh the authoritative family or known tombstones if truncated; deletion + is never repeated to page a result. + required: [state, deleted_count, remaining_count, deleted_ids, remaining, truncated] + additionalProperties: false + ImageUpload: + type: object + properties: + mime_type: + type: string + enum: [image/png, image/jpeg, image/gif, image/webp] + data: + type: string + contentEncoding: base64 + description: Strict base64; decoded dimensions and provider constraints are validated before admission. + required: [mime_type, data] + additionalProperties: false + MessageInputRequest: + type: object + properties: + kind: + const: message + text: + type: string + maxLength: 1048576 + image: + $ref: '#/components/schemas/ImageUpload' + client_id: + type: string + maxLength: 512 + required: [kind, text] + additionalProperties: false + anyOf: + - properties: + text: + pattern: \S + - required: [image] + examples: + - kind: message + text: Fix the parser. + client_id: draft-1 + ContinueInputRequest: + type: object + properties: + kind: + const: continue + client_id: + type: string + maxLength: 512 + required: [kind] + additionalProperties: false + SkillInputRequest: + type: object + properties: + kind: + const: skill + candidate_id: + $ref: '#/components/schemas/ID' + catalog_revision: + $ref: '#/components/schemas/ID' + arguments: + type: string + maxLength: 1048576 + client_id: + type: string + maxLength: 512 + required: [kind, candidate_id, catalog_revision, arguments] + additionalProperties: false + CommandInputRequest: + type: object + properties: + kind: + const: command + command_id: + $ref: '#/components/schemas/ID' + arguments: + $ref: '#/components/schemas/DynamicJSON' + client_id: + type: string + maxLength: 512 + required: [kind, command_id, arguments] + additionalProperties: false + InputRequest: + oneOf: + - $ref: '#/components/schemas/MessageInputRequest' + - $ref: '#/components/schemas/ContinueInputRequest' + - $ref: '#/components/schemas/SkillInputRequest' + - $ref: '#/components/schemas/CommandInputRequest' + x-max-encoded-bytes: 9200000 + Turn: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + state: + type: string + enum: [running, completed, interrupted, failed, abandoned] + started_at: + $ref: '#/components/schemas/Timestamp' + ended_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + outcome: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [id, state, started_at, ended_at, outcome] + additionalProperties: false + Input: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + session_id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [message, continue, skill, command] + admission: + type: string + enum: [accepted, rejected] + http_status: + type: integer + minimum: 200 + maximum: 599 + problem: + anyOf: + - $ref: '#/components/schemas/AdmissionProblem' + - type: 'null' + accepted_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + acceptance_order: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + delivery: + anyOf: + - type: string + enum: [pending, committed, cancelled] + - type: 'null' + blocking_reason: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + transcript_position: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + turn: + anyOf: + - $ref: '#/components/schemas/Turn' + - type: 'null' + client_id: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + required: [id, session_id, kind, admission, http_status, problem, accepted_at, acceptance_order, + delivery, blocking_reason, transcript_position, turn, client_id] + additionalProperties: false + allOf: + - if: + properties: + admission: + const: rejected + then: + properties: + delivery: + type: 'null' + accepted_at: + type: 'null' + acceptance_order: + type: 'null' + turn: + type: 'null' + http_status: + type: integer + minimum: 400 + maximum: 599 + problem: + $ref: '#/components/schemas/AdmissionProblem' + else: + properties: + delivery: + type: string + enum: [pending, committed, cancelled] + accepted_at: + $ref: '#/components/schemas/Timestamp' + acceptance_order: + type: integer + minimum: 1 + maximum: 9007199254740991 + http_status: + const: 202 + problem: + type: 'null' + examples: + - id: 01a0fcea-2b00-7000-8000-000000000002 + session_id: 01a0fcea-2b00-7000-8000-000000000001 + kind: message + admission: accepted + http_status: 202 + problem: null + accepted_at: '2026-10-02T14:00:00Z' + acceptance_order: 1 + delivery: pending + blocking_reason: null + transcript_position: null + turn: null + client_id: draft-1 + InputDecision: + type: object + properties: + kind: + const: input + input: + $ref: '#/components/schemas/Input' + required: [kind, input] + additionalProperties: false + InputCancellation: + type: object + properties: + input: + $ref: '#/components/schemas/Input' + result: + type: string + enum: [cancelled, interrupt_requested, shared_running, not_pending] + required: [input, result] + additionalProperties: false + InterruptRequest: + type: object + properties: + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + through_input_order: + $ref: '#/components/schemas/Counter' + required: [run_id, through_input_order] + additionalProperties: false + Interruption: + type: object + properties: + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + state: + type: string + enum: [requested, already_ended] + cancelled_input_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 32 + warnings: + $ref: '#/components/schemas/Warnings' + required: [run_id, state, cancelled_input_ids, warnings] + additionalProperties: false + ToolActivity: + type: object + properties: + kind: + type: string + enum: [read, search, list, run] + target: + type: string + maxLength: 1000 + required: [kind, target] + additionalProperties: false + FileDiff: + type: object + properties: + path: + type: string + maxLength: 1000 + kind: + const: diff + diff: + type: string + maxLength: 16000 + added: + $ref: '#/components/schemas/Counter' + removed: + $ref: '#/components/schemas/Counter' + required: [path, kind, diff, added, removed] + additionalProperties: false + FileUnavailable: + type: object + properties: + path: + type: string + maxLength: 1000 + kind: + const: unavailable + reason: + type: string + maxLength: 1000 + required: [path, kind, reason] + additionalProperties: false + ToolTrace: + type: object + properties: + activities: + type: array + items: + $ref: '#/components/schemas/ToolActivity' + maxItems: 64 + changes: + type: array + items: + oneOf: + - $ref: '#/components/schemas/FileDiff' + - $ref: '#/components/schemas/FileUnavailable' + maxItems: 16 + truncated: + type: boolean + required: [activities, changes, truncated] + additionalProperties: false + ContentReference: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + field: + type: string + minLength: 1 + maxLength: 256 + bytes: + $ref: '#/components/schemas/Counter' + required: [url, field, bytes] + additionalProperties: false + ImageMetadata: + type: object + properties: + mime_type: + type: string + maxLength: 100 + width: + type: integer + minimum: 1 + maximum: 9007199254740991 + height: + type: integer + minimum: 1 + maximum: 9007199254740991 + original_bytes: + $ref: '#/components/schemas/Counter' + reference: + $ref: '#/components/schemas/ContentReference' + required: [mime_type, width, height, original_bytes, reference] + additionalProperties: false + TextContent: + type: object + properties: + kind: + const: text + text: + type: string + maxLength: 262144 + required: [kind, text] + additionalProperties: false + JSONContent: + type: object + properties: + kind: + const: json + field: + type: string + maxLength: 256 + value: + $ref: '#/components/schemas/DynamicJSON' + required: [kind, field, value] + additionalProperties: false + ImageContent: + type: object + properties: + kind: + const: image + image: + $ref: '#/components/schemas/ImageMetadata' + required: [kind, image] + additionalProperties: false + TraceContent: + type: object + properties: + kind: + const: trace + trace: + $ref: '#/components/schemas/ToolTrace' + required: [kind, trace] + additionalProperties: false + ReferenceContent: + type: object + properties: + kind: + const: reference + reference: + $ref: '#/components/schemas/ContentReference' + required: [kind, reference] + additionalProperties: false + HistoryEntry: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + position: + $ref: '#/components/schemas/Counter' + kind: + type: string + enum: [user, assistant, thinking, tool_call, tool_result, note, continuation, compaction, image_fit] + turn_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + input_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + created_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + content: + type: array + items: + oneOf: + - $ref: '#/components/schemas/TextContent' + - $ref: '#/components/schemas/JSONContent' + - $ref: '#/components/schemas/ImageContent' + - $ref: '#/components/schemas/TraceContent' + - $ref: '#/components/schemas/ReferenceContent' + maxItems: 200 + checkpoint_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + content_complete: + type: boolean + tool: + anyOf: + - type: object + properties: + name: + type: string + maxLength: 100 + tool_call_id: + $ref: '#/components/schemas/ID' + progress_call_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + required: [name, tool_call_id, progress_call_id] + additionalProperties: false + - type: 'null' + thinking_duration_ms: + description: Observed thinking duration, when recorded. + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + required: [id, position, kind, turn_id, input_id, created_at, content, checkpoint_id, content_complete, + tool] + additionalProperties: false + HistoryPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/HistoryEntry' + maxItems: 200 + older: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + newer: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + high_water: + $ref: '#/components/schemas/Counter' + x-max-content-bytes: 262144 + required: [items, older, newer, high_water] + additionalProperties: false + examples: + - items: [] + older: null + newer: null + high_water: 0 + Checkpoint: + type: object + properties: + position: + $ref: '#/components/schemas/Counter' + checkpoint_id: + $ref: '#/components/schemas/ID' + title: + type: string + maxLength: 4096 + turn_type: + type: string + enum: [user, continue, agent, scheduled, webhook] + preview: + $ref: '#/components/schemas/Preview' + required: [position, checkpoint_id, title, turn_type, preview] + additionalProperties: false + CheckpointPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Checkpoint' + maxItems: 200 + older: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + newer: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + high_water: + $ref: '#/components/schemas/Counter' + required: [items, older, newer, high_water] + additionalProperties: false + HistoryRead: + anyOf: + - $ref: '#/components/schemas/HistoryPage' + - $ref: '#/components/schemas/CheckpointPage' + description: The requested view determines the item type. Empty pages are valid for either view. + ContentPart: + type: object + properties: + field: + type: string + maxLength: 256 + offset_bytes: + $ref: '#/components/schemas/Counter' + encoding: + type: string + enum: [utf8, base64] + text: + type: string + maxLength: 1048576 + complete: + type: boolean + description: UTF-8 offsets count exact stored bytes. Base64 offsets count decoded image bytes. + required: [field, offset_bytes, encoding, text, complete] + additionalProperties: false + EntryContentPage: + type: object + properties: + entry_id: + $ref: '#/components/schemas/ID' + parts: + type: array + items: + $ref: '#/components/schemas/ContentPart' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + image: + anyOf: + - type: object + properties: + mime_type: + type: string + maxLength: 100 + width: + type: integer + minimum: 1 + maximum: 9007199254740991 + height: + type: integer + minimum: 1 + maximum: 9007199254740991 + original_bytes: + $ref: '#/components/schemas/Counter' + required: [mime_type, width, height, original_bytes] + additionalProperties: false + - type: 'null' + x-max-decoded-content-bytes: 262144 + required: [entry_id, parts, next, image] + additionalProperties: false + ContextSection: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + label: + type: string + maxLength: 256 + kind: + type: string + enum: [instructions, extension_context, history, tools, other] + source: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + item_count: + $ref: '#/components/schemas/Counter' + utf8_bytes: + $ref: '#/components/schemas/Counter' + page_count: + $ref: '#/components/schemas/Counter' + preview: + $ref: '#/components/schemas/Preview' + required: [id, label, kind, source, item_count, utf8_bytes, page_count, preview] + additionalProperties: false + ContextSummary: + type: object + properties: + state: + type: string + enum: [pending, ready] + snapshot_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + captured_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + provider: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + model: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + protocol: + anyOf: + - type: string + enum: [responses, chat_completions] + - type: 'null' + context_window_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + compaction: + $ref: '#/components/schemas/ContextCompaction' + sections: + type: array + items: + $ref: '#/components/schemas/ContextSection' + maxItems: 1000 + reason: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [state, snapshot_id, captured_at, provider, model, protocol, context_window_tokens, compaction, + sections, reason] + additionalProperties: false + allOf: + - if: + properties: + state: + const: ready + then: + properties: + snapshot_id: + $ref: '#/components/schemas/ID' + captured_at: + $ref: '#/components/schemas/Timestamp' + reason: + type: 'null' + else: + properties: + snapshot_id: + type: 'null' + reason: + $ref: '#/components/schemas/SafeReason' + ContextSectionPage: + type: object + properties: + snapshot_id: + $ref: '#/components/schemas/ID' + section_id: + $ref: '#/components/schemas/ID' + text: + type: string + x-max-utf8-bytes: 32768 + maxLength: 32768 + omitted: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + page: + $ref: '#/components/schemas/Counter' + page_count: + $ref: '#/components/schemas/Counter' + required: [snapshot_id, section_id, text, omitted, page, page_count] + additionalProperties: false + TokenObservation: + type: object + properties: + estimated: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + observed: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + source: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + required: [estimated, observed, source] + additionalProperties: false + ProviderRequestRecord: + type: object + properties: + sequence: + $ref: '#/components/schemas/Counter' + provider: + $ref: '#/components/schemas/ID' + model: + $ref: '#/components/schemas/ID' + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + started_at: + $ref: '#/components/schemas/Timestamp' + ended_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + prompt_tokens: + $ref: '#/components/schemas/TokenObservation' + completion_tokens: + $ref: '#/components/schemas/TokenObservation' + cached_tokens: + $ref: '#/components/schemas/TokenObservation' + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + kind: + type: string + enum: [turn, summarizer, background] + provider_profile: + $ref: '#/components/schemas/ID' + account_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + outcome: + type: string + enum: [completed, failed] + http_status: + anyOf: + - type: integer + minimum: 100 + maximum: 599 + - type: 'null' + cache_creation_tokens: + $ref: '#/components/schemas/TokenObservation' + cache_write_5m_tokens: + $ref: '#/components/schemas/TokenObservation' + cache_write_1h_tokens: + $ref: '#/components/schemas/TokenObservation' + reasoning_tokens: + $ref: '#/components/schemas/TokenObservation' + head_hash: + type: string + maxLength: 128 + input_count: + $ref: '#/components/schemas/Counter' + replaced_input_count: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + projection_hash: + anyOf: + - type: string + maxLength: 128 + - type: 'null' + strategy: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + cache_marks: + type: array + maxItems: 200 + items: + type: object + properties: + through: + type: string + enum: [tools, system, input] + index: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + ttl_seconds: + $ref: '#/components/schemas/Counter' + required: [through, index, ttl_seconds] + additionalProperties: false + transcript_positions: + type: array + items: + $ref: '#/components/schemas/Counter' + maxItems: 200 + required: [sequence, provider, model, run_id, started_at, ended_at, prompt_tokens, completion_tokens, + cached_tokens, failure, transcript_positions, kind, provider_profile, account_id, outcome, + http_status, cache_creation_tokens, cache_write_5m_tokens, cache_write_1h_tokens, reasoning_tokens, + head_hash, input_count, replaced_input_count, projection_hash, strategy, cache_marks] + additionalProperties: false + RequestRecordPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/ProviderRequestRecord' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + ContextRead: + oneOf: + - $ref: '#/components/schemas/ContextSummary' + - $ref: '#/components/schemas/ContextSectionPage' + - $ref: '#/components/schemas/RequestRecordPage' + FormField: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 256 + label: + type: string + maxLength: 256 + type: + type: string + enum: [text, secret, boolean, choice, integer, hidden] + required: + type: boolean + default: + $ref: '#/components/schemas/DynamicJSON' + default_binding: + description: Prefill from the selected row or installed session, before showing the form. + type: object + properties: + source: + type: string + enum: [row, session] + pointer: + type: string + pattern: ^(|/.*)$ + maxLength: 4096 + required: [source, pointer] + additionalProperties: false + choices: + type: array + items: + type: object + properties: + value: + $ref: '#/components/schemas/DynamicJSON' + label: + type: string + maxLength: 256 + required: [value, label] + additionalProperties: false + maxItems: 200 + minimum: + anyOf: + - type: number + - type: 'null' + maximum: + anyOf: + - type: number + - type: 'null' + description: + type: string + maxLength: 4096 + required: [name, label, type, required, default, choices, minimum, maximum, description] + additionalProperties: false + Binding: + oneOf: + - type: object + properties: + source: + const: literal + value: + $ref: '#/components/schemas/DynamicJSON' + required: [source, value] + additionalProperties: false + - type: object + properties: + source: + type: string + enum: [row, form, session] + pointer: + type: string + pattern: ^(|/.*)$ + maxLength: 4096 + required: [source, pointer] + additionalProperties: false + description: JSON pointer resolves against the selected row, submitted form, or installed session + snapshot. No expression language. + ActionOperation: + type: object + properties: + operation_id: + type: string + minLength: 1 + maxLength: 256 + method: + type: string + enum: [GET, PUT, POST, PATCH, DELETE] + path_template: + $ref: '#/components/schemas/ResourceURL' + path: + type: object + additionalProperties: + $ref: '#/components/schemas/Binding' + query: + type: object + additionalProperties: + $ref: '#/components/schemas/Binding' + headers: + type: object + additionalProperties: + $ref: '#/components/schemas/Binding' + body: + type: object + additionalProperties: + $ref: '#/components/schemas/Binding' + propertyNames: + type: string + format: json-pointer + pattern: ^/ + result_schema: + $ref: '#/components/schemas/DynamicJSON' + description: Operation must be declared in this contract, or the installed extension contract version. + Bind If-Match from the displayed resource, never from a fresh read. Path, query and header map + keys name declared parameters; body map keys are JSON pointers into the request object. Missing + optional form values omit their bindings. result_schema is a JSON Schema 2020-12 fragment, with + no remote schema retrieval. + required: [operation_id, method, path_template, path, query, headers, body, result_schema] + additionalProperties: false + PageAction: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + label: + type: string + maxLength: 256 + keyboard_hint: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + confirmation: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + fields: + type: array + items: + $ref: '#/components/schemas/FormField' + maxItems: 100 + operation: + $ref: '#/components/schemas/ActionOperation' + required: [id, label, keyboard_hint, confirmation, fields, operation] + additionalProperties: false + PageRow: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + text: + type: string + maxLength: 4096 + badge: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + tone: + type: string + enum: [plain, active, muted, success, warning, error] + detail: + anyOf: + - type: string + maxLength: 16384 + - type: 'null' + resource: + anyOf: + - type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/DynamicJSON' + required: [url, etag, value] + additionalProperties: false + - type: 'null' + required: [id, text, badge, tone, detail, resource] + additionalProperties: false + PageDescriptor: + type: object + properties: + title: + type: string + maxLength: 256 + empty_state: + type: string + maxLength: 4096 + rows: + type: array + items: + $ref: '#/components/schemas/PageRow' + maxItems: 200 + glance: + anyOf: + - $ref: '#/components/schemas/Glance' + - type: 'null' + actions: + type: array + items: + $ref: '#/components/schemas/PageAction' + maxItems: 100 + summary: + type: string + maxLength: 4096 + required: [title, empty_state, rows, glance, actions, summary] + additionalProperties: false + CatalogCandidate: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [extension, skill, instruction, mcp] + title: + type: string + maxLength: 256 + description: + type: string + maxLength: 4096 + source: + type: string + maxLength: 4096 + resolved_source: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + preference_key: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + valid: + type: boolean + eligible: + type: boolean + effective_enabled: + type: boolean + global_preference: + anyOf: + - type: boolean + - type: 'null' + session_override: + anyOf: + - type: boolean + - type: 'null' + shadowed_by: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + dependencies: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + quarantined: + type: boolean + diagnostic: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + extension: + description: Installed extension metadata for the inspector. Null for other candidate kinds. + anyOf: + - $ref: '#/components/schemas/ExtensionMetadata' + - type: 'null' + x-max-encoded-bytes: 65536 + required: [id, kind, title, description, source, resolved_source, preference_key, valid, eligible, + effective_enabled, global_preference, session_override, shadowed_by, dependencies, quarantined, + diagnostic, extension] + additionalProperties: false + ExtensionMetadata: + type: object + properties: + context: + type: boolean + tools: + type: array + maxItems: 200 + items: + $ref: '#/components/schemas/ID' + python_modules: + type: array + maxItems: 200 + items: + $ref: '#/components/schemas/ID' + plugins: + type: array + maxItems: 200 + items: + $ref: '#/components/schemas/ID' + required: [context, tools, python_modules, plugins] + additionalProperties: false + HTTPCommand: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + slash_name: + type: string + maxLength: 256 + description: + type: string + maxLength: 4096 + arguments: + type: array + items: + $ref: '#/components/schemas/FormField' + maxItems: 100 + caller_permissions: + type: array + items: + type: string + enum: [human, model] + maxItems: 2 + delivery: + type: string + enum: [read, mutation] + operation: + $ref: '#/components/schemas/ActionOperation' + required: [id, slash_name, description, arguments, caller_permissions, delivery, operation] + additionalProperties: false + InputCommand: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + slash_name: + type: string + maxLength: 256 + description: + type: string + maxLength: 4096 + arguments: + type: array + items: + $ref: '#/components/schemas/FormField' + maxItems: 100 + caller_permissions: + type: array + items: + type: string + enum: [human, model] + maxItems: 2 + delivery: + const: input + command_id: + $ref: '#/components/schemas/ID' + required: [id, slash_name, description, arguments, caller_permissions, delivery, command_id] + additionalProperties: false + Catalog: + type: object + properties: + discovery: + type: [object, 'null'] + properties: + revision: + $ref: '#/components/schemas/ID' + workspace: + $ref: '#/components/schemas/Workspace' + candidates: + type: array + items: + $ref: '#/components/schemas/CatalogCandidate' + maxItems: 200 + diagnostics: + type: array + items: + $ref: '#/components/schemas/SafeReason' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [revision, workspace, candidates, diagnostics, next] + additionalProperties: false + discovery_failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + loaded: + type: object + properties: + revision: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + commands: + type: array + items: + oneOf: + - $ref: '#/components/schemas/HTTPCommand' + - $ref: '#/components/schemas/InputCommand' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [revision, commands, next] + additionalProperties: false + pages: + type: array + items: + $ref: '#/components/schemas/PageDescriptor' + maxItems: 16 + description: Pagination is independent for discovered candidates and loaded commands; next tokens + identify their section. + required: [discovery, discovery_failure, loaded] + additionalProperties: false + SessionReloadOutcome: + type: object + properties: + state: + type: string + enum: [applied, failed, skipped] + loaded_revision: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + restart_required: + type: boolean + warnings: + $ref: '#/components/schemas/Warnings' + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [state, loaded_revision, restart_required, warnings, failure] + additionalProperties: false + ModelReloadOutcome: + type: object + properties: + provider: + $ref: '#/components/schemas/ID' + state: + type: string + enum: [refreshed, failed, skipped] + observed_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [provider, state, observed_at, failure] + additionalProperties: false + CachePolicyReloadOutcome: + type: object + properties: + state: + type: string + enum: [refreshed, failed] + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [state, failure] + additionalProperties: false + ReloadRequest: + type: object + properties: + target: + type: string + enum: [session, models, both] + default: both + additionalProperties: false + ReloadResult: + type: object + properties: + cache_policy: + anyOf: + - $ref: '#/components/schemas/CachePolicyReloadOutcome' + - type: 'null' + session: + anyOf: + - $ref: '#/components/schemas/SessionReloadOutcome' + - type: 'null' + models: + type: array + items: + $ref: '#/components/schemas/ModelReloadOutcome' + maxItems: 200 + required: [session, models, cache_policy] + additionalProperties: false + KernelUpgradeResult: + type: object + properties: + old_build: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + new_build: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + state: + type: string + enum: [upgraded, unchanged, failed] + stopped_jobs: + type: array + items: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + reason: + $ref: '#/components/schemas/SafeReason' + required: [id, reason] + additionalProperties: false + maxItems: 200 + warnings: + $ref: '#/components/schemas/Warnings' + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + old_kernel_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + new_kernel_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + required: [old_build, new_build, state, stopped_jobs, warnings, failure, old_kernel_id, new_kernel_id] + additionalProperties: false + CompactionRequest: + type: object + properties: + strategy: + $ref: '#/components/schemas/ID' + additionalProperties: false + CompactionObservation: + type: object + properties: + strategy: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + before_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + after_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + evicted_entries: + $ref: '#/components/schemas/Counter' + summary: + type: string + maxLength: 32768 + required: [strategy, before_tokens, after_tokens, evicted_entries, summary] + additionalProperties: false + CompactionResult: + type: object + properties: + selection_applied: + type: boolean + effective_strategy: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + state: + type: string + enum: [compacted, unchanged, failed] + observation: + anyOf: + - $ref: '#/components/schemas/CompactionObservation' + - type: 'null' + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [selection_applied, effective_strategy, state, observation, failure] + additionalProperties: false + Model: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + label: + type: string + maxLength: 256 + efforts: + type: array + items: + type: object + properties: + id: + type: string + maxLength: 100 + label: + type: string + maxLength: 256 + required: [id, label] + additionalProperties: false + maxItems: 100 + default_context_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + effective_context_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + max_context_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + max_output_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + input_modalities: + type: array + items: + type: string + minLength: 1 + maxLength: 100 + maxItems: 32 + image_edge: + anyOf: + - type: integer + minimum: 1 + maximum: 65536 + - type: 'null' + raised: + type: boolean + cap_key: + $ref: '#/components/schemas/ID' + cache_policy: + type: object + properties: + ttl_seconds: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + source: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + required: [ttl_seconds, source] + additionalProperties: false + source: + type: string + maxLength: 256 + observed_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + required: [id, label, efforts, default_context_tokens, effective_context_tokens, max_context_tokens, + max_output_tokens, input_modalities, image_edge, raised, cap_key, cache_policy, source, observed_at] + additionalProperties: false + CachePolicyEntry: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + layer: + type: string + enum: + - default + - remote + - local + match: + type: object + properties: + extension: + anyOf: + - type: array + items: + type: string + maxLength: 4096 + maxItems: 100 + - type: 'null' + host: + anyOf: + - type: array + items: + type: string + maxLength: 4096 + maxItems: 100 + - type: 'null' + model: + anyOf: + - type: array + items: + type: string + maxLength: 4096 + maxItems: 100 + - type: 'null' + required: + - extension + - host + - model + additionalProperties: false + policy: + type: string + enum: + - refresh + - fixed + - evict + - unknown + clock: + type: string + enum: + - request + - response + tiers: + anyOf: + - type: array + maxItems: 32 + items: + type: object + properties: + seconds: + $ref: '#/components/schemas/Counter' + write: + anyOf: + - type: number + minimum: 0 + - type: 'null' + required: + - seconds + - write + additionalProperties: false + - type: 'null' + read: + anyOf: + - type: number + minimum: 0 + - type: 'null' + survival: + anyOf: + - type: object + properties: + typical: + $ref: '#/components/schemas/Counter' + max: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + required: + - typical + - max + additionalProperties: false + - type: 'null' + evidence: + type: string + enum: + - documented + - measured + - implemented + - folklore + - unknown + source: + type: string + maxLength: 4096 + checked: + type: string + maxLength: 100 + note: + type: string + maxLength: 16384 + required: + - id + - layer + - match + - policy + - clock + - tiers + - read + - survival + - evidence + - source + - checked + - note + additionalProperties: false + CachePolicyLayer: + type: object + properties: + name: + type: string + enum: + - default + - remote + - local + path: + type: string + maxLength: 16384 + loaded: + type: boolean + error: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: + - name + - path + - loaded + - error + additionalProperties: false + CachePolicyPage: + type: object + properties: + entries: + type: array + items: + $ref: '#/components/schemas/CachePolicyEntry' + maxItems: 200 + layers: + type: array + items: + $ref: '#/components/schemas/CachePolicyLayer' + maxItems: 3 + matched: + anyOf: + - $ref: '#/components/schemas/CachePolicyEntry' + - type: 'null' + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: + - entries + - layers + - matched + - next + additionalProperties: false + ModelRead: + oneOf: + - $ref: '#/components/schemas/ModelPage' + - $ref: '#/components/schemas/CachePolicyPage' + ModelPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Model' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + Host: + type: object + properties: + target: + $ref: '#/components/schemas/ID' + state: + type: string + enum: [unknown, probing, ready, needs_auth, unreachable, unsupported] + detail: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + observed_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + os: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + architecture: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + home: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + authentication: + anyOf: + - type: object + properties: + instructions: + type: string + maxLength: 4096 + ssh_target: + type: string + maxLength: 4096 + control_path: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + required: [instructions, ssh_target, control_path] + additionalProperties: false + - type: 'null' + required: [target, state, detail, observed_at, os, architecture, home, authentication] + additionalProperties: false + HostPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Host' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + RecentWorkspace: + type: object + properties: + location: + $ref: '#/components/schemas/Workspace' + use_count: + $ref: '#/components/schemas/Counter' + activity_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + required: [location, use_count, activity_at] + additionalProperties: false + RecentWorkspacePage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/RecentWorkspace' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + TreeChild: + type: object + properties: + name: + type: string + maxLength: 4096 + kind: + type: string + enum: [file, directory, symlink] + location: + $ref: '#/components/schemas/Workspace' + language: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + changed: + $ref: '#/components/schemas/Counter' + required: [name, kind, location, language, changed] + additionalProperties: false + TreeEntry: + type: object + properties: + name: + type: string + maxLength: 4096 + kind: + type: string + enum: [file, directory, symlink] + location: + $ref: '#/components/schemas/Workspace' + children: + type: array + items: + $ref: '#/components/schemas/TreeChild' + maxItems: 4 + more: + $ref: '#/components/schemas/Counter' + language: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + changed: + $ref: '#/components/schemas/Counter' + required: [name, kind, location, children, more, language, changed] + additionalProperties: false + GitFacts: + type: object + properties: + kind: + const: git + branch: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + revision: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + dirty: + anyOf: + - type: boolean + - type: 'null' + added: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + modified: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + removed: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + root: + $ref: '#/components/schemas/Workspace' + changed: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + touched_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + required: [kind, branch, revision, dirty, added, modified, removed, root, changed, touched_at] + additionalProperties: false + JJFacts: + type: object + properties: + kind: + const: jj + change_id: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + revision: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + description: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + dirty: + anyOf: + - type: boolean + - type: 'null' + conflicts: + anyOf: + - type: boolean + - type: 'null' + root: + $ref: '#/components/schemas/Workspace' + changed: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + touched_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + bookmark: + anyOf: + - type: object + properties: + name: + type: string + maxLength: 4096 + ahead: + $ref: '#/components/schemas/Counter' + required: [name, ahead] + additionalProperties: false + - type: 'null' + required: [kind, change_id, revision, description, dirty, conflicts, root, changed, touched_at, + bookmark] + additionalProperties: false + WorkspacePreview: + type: object + properties: + repository: + anyOf: + - oneOf: + - $ref: '#/components/schemas/GitFacts' + - $ref: '#/components/schemas/JJFacts' + - type: 'null' + repository_diagnostic: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + languages: + type: array + items: + type: object + properties: + name: + type: string + maxLength: 256 + bytes: + $ref: '#/components/schemas/Counter' + share: + type: number + minimum: 0 + maximum: 1 + color: + anyOf: + - type: string + pattern: ^#[0-9a-fA-F]{6}$ + - type: 'null' + required: [name, bytes, share, color] + additionalProperties: false + maxItems: 100 + tree: + type: array + items: + $ref: '#/components/schemas/TreeEntry' + maxItems: 12 + more: + $ref: '#/components/schemas/Counter' + required: [repository, repository_diagnostic, languages, tree, more] + additionalProperties: false + WorkspaceDirectory: + type: object + properties: + directory: + $ref: '#/components/schemas/Workspace' + parent: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + home: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + host: + anyOf: + - $ref: '#/components/schemas/Host' + - type: 'null' + items: + type: array + items: + type: object + properties: + name: + type: string + maxLength: 4096 + location: + $ref: '#/components/schemas/Workspace' + vcs: + anyOf: + - type: string + enum: [git, jj] + - type: 'null' + modified_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + hidden: + type: boolean + required: [name, location, vcs, modified_at, hidden] + additionalProperties: false + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + preview: + $ref: '#/components/schemas/WorkspacePreview' + required: [directory, parent, home, host, items, next] + additionalProperties: false + WorkspaceRead: + oneOf: + - $ref: '#/components/schemas/RecentWorkspacePage' + - $ref: '#/components/schemas/WorkspaceDirectory' + Account: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + provider: + $ref: '#/components/schemas/ID' + label: + type: string + maxLength: 256 + detail: + type: string + maxLength: 4096 + selected_by_profiles: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + required: [id, provider, label, detail, selected_by_profiles] + additionalProperties: false + LoginProvider: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + label: + type: string + maxLength: 256 + detail: + type: string + maxLength: 4096 + flows: + type: array + items: + type: string + enum: [browser, manual, device, form] + maxItems: 4 + fields: + type: array + items: + $ref: '#/components/schemas/FormField' + maxItems: 100 + required: [id, label, detail, flows, fields] + additionalProperties: false + Auth: + type: object + properties: + providers: + type: array + items: + $ref: '#/components/schemas/LoginProvider' + maxItems: 200 + accounts: + type: array + items: + $ref: '#/components/schemas/Account' + maxItems: 200 + required: [providers, accounts] + additionalProperties: false + LoginRequest: + type: object + properties: + provider: + $ref: '#/components/schemas/ID' + flow: + type: string + enum: [browser, manual, device, form] + values: + type: object + additionalProperties: + type: [string, boolean, integer] + description: Flow defaults to the provider preferred flow. Form names, types and required values + are checked against that provider declaration. Values are write-only. + required: [provider, values] + additionalProperties: false + LoginPatch: + type: object + properties: + response: + type: string + minLength: 1 + writeOnly: true + maxLength: 16384 + required: [response] + additionalProperties: false + Login: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + provider: + $ref: '#/components/schemas/ID' + url: + anyOf: + - type: string + format: uri + maxLength: 4096 + - type: 'null' + expires_at: + $ref: '#/components/schemas/Timestamp' + state: + type: string + enum: [waiting, exchanging, complete, failed, cancelled, expired] + instructions: + anyOf: + - type: string + maxLength: 4096 + - type: 'null' + progress: + type: string + maxLength: 4096 + accounts: + type: array + items: + $ref: '#/components/schemas/Account' + maxItems: 200 + failure: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [id, provider, url, expires_at, state, instructions, progress, accounts, failure] + additionalProperties: false + examples: + - id: 01a0fcea-2b00-7000-8000-000000000003 + provider: example-provider + url: https://provider.example/authorize?state=synthetic-state + expires_at: '2026-10-02T14:15:00Z' + state: waiting + instructions: Paste the callback URL if the browser cannot reach the daemon. + progress: Waiting for authorization. + accounts: [] + failure: null + MailMetadata: + type: object + properties: + mail_id: + $ref: '#/components/schemas/ID' + sender_session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + receiver_session_id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [task, message, result, unreviewed, webhook] + bytes: + $ref: '#/components/schemas/Counter' + sender_label: + anyOf: + - type: string + x-max-utf8-bytes: 400 + maxLength: 100 + - type: 'null' + required: [mail_id, sender_session_id, receiver_session_id, kind, bytes, sender_label] + additionalProperties: false + SessionStatusEvent: + type: object + properties: + type: + const: status + sequence: + $ref: '#/components/schemas/Counter' + data: + $ref: '#/components/schemas/SessionStatus' + required: [type, sequence, data] + additionalProperties: false + SessionInputEvent: + type: object + properties: + type: + const: input + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + input: + $ref: '#/components/schemas/Input' + required: [input] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionTextEvent: + type: object + properties: + type: + const: text + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + run_id: + $ref: '#/components/schemas/ID' + message_id: + $ref: '#/components/schemas/ID' + text: + type: string + maxLength: 262144 + required: [run_id, message_id, text] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionThinkingEvent: + type: object + properties: + type: + const: thinking + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + run_id: + $ref: '#/components/schemas/ID' + message_id: + $ref: '#/components/schemas/ID' + text: + type: string + maxLength: 262144 + elapsed_ms: + description: Completed thinking duration, when observed. + $ref: '#/components/schemas/Counter' + required: [run_id, message_id, text] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionMessageEvent: + type: object + properties: + type: + const: message + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + entry: + $ref: '#/components/schemas/HistoryEntry' + required: [entry] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionToolProgressEvent: + type: object + properties: + type: + const: tool_progress + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + progress: + anyOf: + - $ref: '#/components/schemas/ToolProgress' + - type: 'null' + required: [progress] + additionalProperties: false + x-max-encoded-bytes: 8192 + required: [type, sequence, data] + additionalProperties: false + SessionToolEvent: + type: object + properties: + type: + const: tool + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + tool_call_id: + $ref: '#/components/schemas/ID' + progress_call_id: + $ref: '#/components/schemas/ID' + name: + type: string + maxLength: 100 + arguments: + $ref: '#/components/schemas/DynamicJSON' + result: + $ref: '#/components/schemas/DynamicJSON' + trace: + anyOf: + - $ref: '#/components/schemas/ToolTrace' + - type: 'null' + content_complete: + type: boolean + reference: + anyOf: + - $ref: '#/components/schemas/ContentReference' + - type: 'null' + required: [tool_call_id, progress_call_id, name, arguments, result, trace, content_complete, + reference] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionNoteEvent: + type: object + properties: + type: + const: note + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + entry_id: + $ref: '#/components/schemas/ID' + origin: + type: string + maxLength: 256 + text: + type: string + maxLength: 262144 + mail: + anyOf: + - $ref: '#/components/schemas/MailMetadata' + - type: 'null' + required: [entry_id, origin, text, mail] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionRetryEvent: + type: object + properties: + type: + const: retry + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + run_id: + $ref: '#/components/schemas/ID' + attempt: + type: integer + minimum: 1 + maximum: 9007199254740991 + reason: + $ref: '#/components/schemas/SafeReason' + delay_ms: + $ref: '#/components/schemas/Counter' + required: [run_id, attempt, reason, delay_ms] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionUsageEvent: + type: object + properties: + type: + const: usage + sequence: + $ref: '#/components/schemas/Counter' + data: + $ref: '#/components/schemas/Usage' + required: [type, sequence, data] + additionalProperties: false + SessionCommittedEvent: + type: object + properties: + type: + const: committed + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + high_water: + $ref: '#/components/schemas/Counter' + required: [high_water] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionTurnCompletedEvent: + type: object + properties: + type: + const: turn_completed + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + run_id: + $ref: '#/components/schemas/ID' + state: + type: string + enum: [completed, interrupted, failed, abandoned] + input_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + input_count: + $ref: '#/components/schemas/Counter' + truncated: + type: boolean + required: [run_id, state, input_ids, input_count, truncated] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionCompactedEvent: + type: object + properties: + type: + const: compacted + sequence: + $ref: '#/components/schemas/Counter' + data: + $ref: '#/components/schemas/CompactionObservation' + required: [type, sequence, data] + additionalProperties: false + SessionErrorEvent: + type: object + properties: + type: + const: error + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + code: + type: string + maxLength: 100 + message: + type: string + maxLength: 4096 + required: [run_id, code, message] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionInvalidateEvent: + type: object + properties: + type: + const: invalidate + sequence: + $ref: '#/components/schemas/Counter' + data: + type: object + properties: + kind: + type: string + enum: [session, settings, catalog, context, extension] + url: + $ref: '#/components/schemas/ResourceURL' + required: [kind, url] + additionalProperties: false + required: [type, sequence, data] + additionalProperties: false + SessionEvent: + oneOf: + - $ref: '#/components/schemas/SessionStatusEvent' + - $ref: '#/components/schemas/SessionInputEvent' + - $ref: '#/components/schemas/SessionTextEvent' + - $ref: '#/components/schemas/SessionThinkingEvent' + - $ref: '#/components/schemas/SessionMessageEvent' + - $ref: '#/components/schemas/SessionToolProgressEvent' + - $ref: '#/components/schemas/SessionToolEvent' + - $ref: '#/components/schemas/SessionNoteEvent' + - $ref: '#/components/schemas/SessionRetryEvent' + - $ref: '#/components/schemas/SessionUsageEvent' + - $ref: '#/components/schemas/SessionCommittedEvent' + - $ref: '#/components/schemas/SessionTurnCompletedEvent' + - $ref: '#/components/schemas/SessionCompactedEvent' + - $ref: '#/components/schemas/SessionErrorEvent' + - $ref: '#/components/schemas/SessionInvalidateEvent' + ResetEvent: + type: object + properties: + type: + const: reset + data: + type: object + properties: + reason: + type: string + enum: [initial, generation_changed, replay_unavailable, recovery] + required: [reason] + additionalProperties: false + required: [type, data] + additionalProperties: false + FailureEvent: + type: object + properties: + type: + const: failure + data: + $ref: '#/components/schemas/SafeReason' + required: [type, data] + additionalProperties: false + ReplayBatch: + type: object + properties: + generation: + $ref: '#/components/schemas/Generation' + cursor: + $ref: '#/components/schemas/Counter' + events: + type: array + items: + $ref: '#/components/schemas/SessionEvent' + maxItems: 256 + description: Empty keepalive keeps the last sequence. Nonempty event sequences are contiguous from + the requested cursor. + required: [generation, cursor, events] + additionalProperties: false + examples: + - generation: J6kYj6IGcXyP3eMIp-WL3A + cursor: 1 + events: + - type: input + sequence: 1 + data: + input: + id: 01a0fcea-2b00-7000-8000-000000000002 + session_id: 01a0fcea-2b00-7000-8000-000000000001 + kind: message + admission: accepted + http_status: 202 + problem: null + accepted_at: '2026-10-02T14:00:00Z' + acceptance_order: 1 + delivery: pending + blocking_reason: null + transcript_position: null + turn: null + client_id: draft-1 + ResetBatch: + type: object + properties: + generation: + $ref: '#/components/schemas/Generation' + cursor: + $ref: '#/components/schemas/Counter' + events: + type: array + prefixItems: + - $ref: '#/components/schemas/ResetEvent' + items: + $ref: '#/components/schemas/SessionEvent' + minItems: 1 + maxItems: 256 + snapshot: + $ref: '#/components/schemas/Session' + description: Leading reset and complete snapshot. Later events, if any, follow the snapshot cursor. + Envelope cursor advances through every delivered event. + required: [generation, cursor, events, snapshot] + additionalProperties: false + examples: + - generation: J6kYj6IGcXyP3eMIp-WL3A + cursor: 0 + events: + - type: reset + data: + reason: initial + snapshot: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + automatic_name: New session + workspace: /workspace/project + location: + host: null + user: null + path: /workspace/project + label: null + parent_id: null + root_id: 01a0fcea-2b00-7000-8000-000000000001 + address: null + depth: 0 + closed: false + created_at: '2026-10-02T14:00:00Z' + activity_at: '2026-10-02T14:00:00Z' + provider_profile: personal + model: example-model + effort: null + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + preview: + text: '' + transcript_count: 0 + truncated: false + preferences: + pinned: false + pin_order: null + archived: false + opens: 0 + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + creation: + submitted: + kind: new + workspace: /workspace/project + name: null + provider_profile: null + model: null + effort: null + resolved: + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + revision: config-1 + family_revision: family-1 + configuration_resource: + url: /sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration + etag: '"session-config-1"' + value: + id: 01a0fcea-2b00-7000-8000-000000000001 + name: New session + workspace: /workspace/project + provider_profile: personal + model: example-model + effort: null + preferences: + pinned: false + pin_order: null + archived: false + selection: + extensions: {} + skills: {} + instructions: {} + mcp: {} + revision: config-1 + family_revision: family-1 + workspace_change: null + selection: + overrides: + extensions: {} + skills: {} + instructions: {} + mcp: {} + effective: + extensions: {} + skills: {} + instructions: {} + mcp: {} + composition: + desired_revision: composition-1 + loaded_revision: null + needs_reload: true + dependencies: {} + quarantine: [] + availability: {} + kernel: + instance_id: null + state: none + stage: null + build: null + stale: false + staleness_reasons: [] + live_job_count: 0 + pending_inputs: [] + input_order: 0 + usage: + model: null + observed_at: null + prompt_tokens: null + cached_prompt_tokens: null + cache_write_tokens: null + completion_tokens: null + total_tokens: null + elapsed_ms: null + tokens_per_second: null + context_window_tokens: null + cache_ttl_seconds: null + cache_fade: [] + history: + items: [] + older: null + newer: null + high_water: 0 + glances: [] + FailureBatch: + type: object + properties: + generation: + $ref: '#/components/schemas/Generation' + cursor: + $ref: '#/components/schemas/Counter' + events: + type: array + items: + $ref: '#/components/schemas/FailureEvent' + minItems: 1 + maxItems: 1 + description: Terminal failure, alone with no snapshot. It does not commit a replacement cursor. + required: [generation, cursor, events] + additionalProperties: false + examples: + - generation: J6kYj6IGcXyP3eMIp-WL3A + cursor: 0 + events: + - type: failure + data: + code: history_unavailable + detail: Durable history could not be loaded. + SessionBatch: + oneOf: + - $ref: '#/components/schemas/ReplayBatch' + - $ref: '#/components/schemas/ResetBatch' + - $ref: '#/components/schemas/FailureBatch' + x-max-encoded-bytes: 1048576 + ActivityEvent: + type: object + properties: + type: + const: activity + data: + type: object + properties: + session_id: + $ref: '#/components/schemas/ID' + cursor: + $ref: '#/components/schemas/Cursor' + status: + $ref: '#/components/schemas/SessionStatus' + current_progress: + type: array + items: + $ref: '#/components/schemas/ToolProgress' + maxItems: 32 + activity: + $ref: '#/components/schemas/Activity' + required: [session_id, cursor, status, current_progress, activity] + additionalProperties: false + required: [type, data] + additionalProperties: false + CollectionInvalidateEvent: + type: object + properties: + type: + const: invalidate + data: + type: object + properties: + urls: + type: array + items: + $ref: '#/components/schemas/ResourceURL' + maxItems: 200 + session_ids: + type: array + items: + $ref: '#/components/schemas/ID' + maxItems: 200 + scope_dirty: + type: boolean + required: [urls, session_ids, scope_dirty] + additionalProperties: false + required: [type, data] + additionalProperties: false + CollectionMailEvent: + type: object + properties: + type: + const: mail + data: + $ref: '#/components/schemas/MailMetadata' + required: [type, data] + additionalProperties: false + CollectionReadyEvent: + type: object + properties: + type: + const: ready + data: + $ref: '#/components/schemas/EmptyRequest' + required: [type, data] + additionalProperties: false + CollectionResetEvent: + type: object + properties: + type: + const: reset + data: + type: object + properties: + reason: + const: initial + required: [reason] + additionalProperties: false + required: [type, data] + additionalProperties: false + CollectionOverflowEvent: + type: object + properties: + type: + const: overflow + data: + $ref: '#/components/schemas/EmptyRequest' + required: [type, data] + additionalProperties: false + CollectionReadyBatch: + type: object + properties: + events: + type: array + prefixItems: + - $ref: '#/components/schemas/CollectionReadyEvent' + - $ref: '#/components/schemas/CollectionResetEvent' + items: false + minItems: 2 + maxItems: 2 + required: [events] + additionalProperties: false + examples: + - events: + - type: ready + data: {} + - type: reset + data: + reason: initial + CollectionBatch: + oneOf: + - $ref: '#/components/schemas/CollectionReadyBatch' + - type: object + properties: + events: + type: array + items: + oneOf: + - $ref: '#/components/schemas/ActivityEvent' + - $ref: '#/components/schemas/CollectionInvalidateEvent' + - $ref: '#/components/schemas/CollectionMailEvent' + maxItems: 256 + required: [events] + additionalProperties: false + - type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/CollectionOverflowEvent' + minItems: 1 + maxItems: 1 + required: [events] + additionalProperties: false + x-max-encoded-bytes: 1048576 + examples: + - events: + - type: activity + data: + session_id: 01a0fcea-2b00-7000-8000-000000000001 + cursor: + generation: J6kYj6IGcXyP3eMIp-WL3A + sequence: 0 + status: + phase: idle + run_id: null + interrupt_requested: false + blocking_reason: null + current_progress: [] + activity: + lines: [] + output_scalars: 0 + output_utf8_bytes: 0 + observed_at: '2026-10-02T14:00:00Z' + latest_input: null + latest_answer: null + SessionSSE: + type: object + properties: + data: + type: string + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/SessionBatch' + description: One parsed SSE event. Decode data as JSON and validate SessionBatch separately; contentSchema + is not asserted by ordinary JSON Schema validation. No event, id or retry fields are emitted. + required: [data] + additionalProperties: false + examples: + - data: '{"generation":"J6kYj6IGcXyP3eMIp-WL3A","cursor":0,"events":[{"type":"reset","data":{"reason":"initial"}}],"snapshot":{"id":"01a0fcea-2b00-7000-8000-000000000001","name":"New + session","automatic_name":"New session","workspace":"/workspace/project","location":{"host":null,"user":null,"path":"/workspace/project","label":null},"parent_id":null,"root_id":"01a0fcea-2b00-7000-8000-000000000001","address":null,"depth":0,"closed":false,"created_at":"2026-10-02T14:00:00Z","activity_at":"2026-10-02T14:00:00Z","provider_profile":"personal","model":"example-model","effort":null,"status":{"phase":"idle","run_id":null,"interrupt_requested":false,"blocking_reason":null},"preview":{"text":"","transcript_count":0,"truncated":false},"preferences":{"pinned":false,"pin_order":null,"archived":false,"opens":0},"current_progress":[],"activity":{"lines":[],"output_scalars":0,"output_utf8_bytes":0,"observed_at":"2026-10-02T14:00:00Z","latest_input":null,"latest_answer":null},"cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"creation":{"submitted":{"kind":"new","workspace":"/workspace/project","name":null,"provider_profile":null,"model":null,"effort":null},"resolved":{"workspace":"/workspace/project","provider_profile":"personal","model":"example-model","effort":null}},"revision":"config-1","family_revision":"family-1","configuration_resource":{"url":"/sessions/01a0fcea-2b00-7000-8000-000000000001?view=configuration","etag":"\"session-config-1\"","value":{"id":"01a0fcea-2b00-7000-8000-000000000001","name":"New + session","workspace":"/workspace/project","provider_profile":"personal","model":"example-model","effort":null,"preferences":{"pinned":false,"pin_order":null,"archived":false},"selection":{"extensions":{},"skills":{},"instructions":{},"mcp":{}},"revision":"config-1","family_revision":"family-1"}},"workspace_change":null,"selection":{"overrides":{"extensions":{},"skills":{},"instructions":{},"mcp":{}},"effective":{"extensions":{},"skills":{},"instructions":{},"mcp":{}}},"composition":{"desired_revision":"composition-1","loaded_revision":null,"needs_reload":true,"dependencies":{},"quarantine":[],"availability":{}},"kernel":{"instance_id":null,"state":"none","stage":null,"build":null,"stale":false,"staleness_reasons":[],"live_job_count":0},"pending_inputs":[],"input_order":0,"usage":{"model":null,"observed_at":null,"prompt_tokens":null,"cached_prompt_tokens":null,"cache_write_tokens":null,"completion_tokens":null,"total_tokens":null,"elapsed_ms":null,"tokens_per_second":null,"context_window_tokens":null,"cache_ttl_seconds":null,"cache_fade":[]},"history":{"items":[],"older":null,"newer":null,"high_water":0},"glances":[]}}' + - data: '{"generation":"J6kYj6IGcXyP3eMIp-WL3A","cursor":1,"events":[{"type":"input","sequence":1,"data":{"input":{"id":"01a0fcea-2b00-7000-8000-000000000002","session_id":"01a0fcea-2b00-7000-8000-000000000001","kind":"message","admission":"accepted","http_status":202,"problem":null,"accepted_at":"2026-10-02T14:00:00Z","acceptance_order":1,"delivery":"pending","blocking_reason":null,"transcript_position":null,"turn":null,"client_id":"draft-1"}}}]}' + CollectionSSE: + type: object + properties: + data: + type: string + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/CollectionBatch' + description: One parsed SSE event. Decode data as JSON and validate CollectionBatch separately; + contentSchema is not asserted by ordinary JSON Schema validation. No event, id or retry fields + are emitted. + required: [data] + additionalProperties: false + examples: + - data: '{"events":[{"type":"ready","data":{}},{"type":"reset","data":{"reason":"initial"}}]}' + - data: '{"events":[{"type":"activity","data":{"session_id":"01a0fcea-2b00-7000-8000-000000000001","cursor":{"generation":"J6kYj6IGcXyP3eMIp-WL3A","sequence":0},"status":{"phase":"idle","run_id":null,"interrupt_requested":false,"blocking_reason":null},"current_progress":[],"activity":{"lines":[],"output_scalars":0,"output_utf8_bytes":0,"observed_at":"2026-10-02T14:00:00Z","latest_input":null,"latest_answer":null}}}]}' + WorkItem: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + workspace: + $ref: '#/components/schemas/Workspace' + title: + type: string + x-max-utf8-bytes: 4096 + maxLength: 4096 + notes: + type: string + x-max-utf8-bytes: 32768 + maxLength: 32768 + parent_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + status: + type: string + enum: [open, active, blocked, done, cancelled] + revision: + $ref: '#/components/schemas/ID' + created_at: + $ref: '#/components/schemas/Timestamp' + updated_at: + $ref: '#/components/schemas/Timestamp' + required: [id, workspace, title, notes, parent_id, session_id, run_id, status, revision, created_at, + updated_at] + additionalProperties: false + WorkCreate: + type: object + properties: + title: + type: string + x-max-utf8-bytes: 4096 + maxLength: 4096 + notes: + type: string + x-max-utf8-bytes: 32768 + maxLength: 32768 + parent_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + notify_session_id: + $ref: '#/components/schemas/ID' + required: [title] + additionalProperties: false + examples: + - title: Fix the parser + WorkPatch: + type: object + properties: + title: + type: string + x-max-utf8-bytes: 4096 + maxLength: 4096 + notes: + type: string + x-max-utf8-bytes: 32768 + maxLength: 32768 + session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + run_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + status: + type: string + enum: [open, active, blocked, done, cancelled] + notify_session_id: + $ref: '#/components/schemas/ID' + additionalProperties: false + Paperclip: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + topic: + type: string + enum: [harness, workflow, bug, user, other] + title: + type: string + x-max-utf8-bytes: 4096 + maxLength: 4096 + message: + type: string + minLength: 1 + pattern: \S + x-max-utf8-bytes: 32768 + maxLength: 32768 + suggestion: + type: string + x-max-utf8-bytes: 16384 + maxLength: 16384 + reply: + type: string + x-max-utf8-bytes: 16384 + maxLength: 16384 + status: + type: string + enum: [open, acknowledged, resolved, dismissed] + session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + workspace: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + created_at: + $ref: '#/components/schemas/Timestamp' + updated_at: + $ref: '#/components/schemas/Timestamp' + resolution: + type: string + x-max-utf8-bytes: 16384 + maxLength: 16384 + resolving_session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + revision: + $ref: '#/components/schemas/ID' + required: [id, topic, title, message, suggestion, reply, status, session_id, workspace, created_at, + updated_at, resolution, resolving_session_id, revision] + additionalProperties: false + PaperclipCreate: + type: object + properties: + topic: + type: string + enum: [harness, workflow, bug, user, other] + title: + type: string + x-max-utf8-bytes: 4096 + maxLength: 4096 + message: + type: string + minLength: 1 + pattern: \S + x-max-utf8-bytes: 32768 + maxLength: 32768 + suggestion: + type: string + x-max-utf8-bytes: 16384 + maxLength: 16384 + session_id: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + workspace: + anyOf: + - $ref: '#/components/schemas/Workspace' + - type: 'null' + required: [message] + additionalProperties: false + PaperclipPatch: + type: object + properties: + status: + type: string + enum: [acknowledged, resolved, dismissed] + reply: + type: string + x-max-utf8-bytes: 16384 + maxLength: 16384 + resolution: + type: string + x-max-utf8-bytes: 16384 + maxLength: 16384 + description: Reply cannot accompany resolved or dismissed status. It acknowledges the item. + additionalProperties: false + ScheduleJob: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + session_id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [once, recurring, heartbeat] + prompt: + type: string + minLength: 1 + x-max-utf8-bytes: 4096 + maxLength: 4096 + next_at: + $ref: '#/components/schemas/Timestamp' + every_seconds: + anyOf: + - type: integer + minimum: 60 + maximum: 31536000 + - type: 'null' + revision: + $ref: '#/components/schemas/ID' + created_at: + description: Null for historical schedules that did not record creation time. + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + updated_at: + description: Null until a historical schedule records a new update. + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + required: [id, session_id, kind, prompt, next_at, every_seconds, revision, created_at, updated_at] + additionalProperties: false + ScheduleCreate: + type: object + properties: + session_id: + $ref: '#/components/schemas/ID' + kind: + type: string + enum: [once, recurring, heartbeat] + prompt: + type: string + minLength: 1 + x-max-utf8-bytes: 4096 + maxLength: 4096 + delay_seconds: + type: integer + minimum: 0 + maximum: 31536000 + default: 0 + every_seconds: + type: integer + minimum: 60 + maximum: 31536000 + required: [session_id, kind, prompt] + additionalProperties: false + allOf: + - if: + properties: + kind: + const: once + then: + not: + required: [every_seconds] + else: + required: [every_seconds] + SchedulePatch: + type: object + properties: + kind: + type: string + enum: [once, recurring, heartbeat] + prompt: + type: string + minLength: 1 + x-max-utf8-bytes: 4096 + maxLength: 4096 + delay_seconds: + type: integer + minimum: 0 + maximum: 31536000 + every_seconds: + anyOf: + - type: integer + minimum: 60 + maximum: 31536000 + - type: 'null' + description: 'Validate complete candidate: once has null repetition; recurring and heartbeat require + every_seconds.' + additionalProperties: false + LinkConfiguration: + type: object + properties: + workspace: + $ref: '#/components/schemas/Workspace' + group_id: + $ref: '#/components/schemas/ID' + members: + type: array + items: + $ref: '#/components/schemas/Workspace' + maxItems: 200 + revision: + $ref: '#/components/schemas/ID' + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [workspace, group_id, members, revision, next] + additionalProperties: false + LinkConfigurationResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/LinkConfiguration' + required: [url, etag, value] + additionalProperties: false + LinkGroup: + type: object + properties: + page: + $ref: '#/components/schemas/PageDescriptor' + configuration_resource: + $ref: '#/components/schemas/LinkConfigurationResource' + presence: + type: array + items: + type: object + properties: + workspace: + $ref: '#/components/schemas/Workspace' + exists: + description: Observed directory presence. Null for an uninspected or unreachable location. + anyOf: + - type: boolean + - type: 'null' + session_count: + $ref: '#/components/schemas/Counter' + host: + anyOf: + - $ref: '#/components/schemas/Host' + - type: 'null' + required: [workspace, session_count, host, exists] + additionalProperties: false + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [configuration_resource, presence, next] + additionalProperties: false + LinkMerge: + type: object + properties: + other_workspace: + $ref: '#/components/schemas/Workspace' + other_etag: + $ref: '#/components/schemas/ETag' + required: [other_workspace, other_etag] + additionalProperties: false + LinkChange: + type: object + properties: + resource: + $ref: '#/components/schemas/LinkConfigurationResource' + notifications: + type: array + items: + $ref: '#/components/schemas/TargetNotification' + maxItems: 200 + notification_count: + $ref: '#/components/schemas/Counter' + truncated: + type: boolean + required: [resource, notifications, notification_count, truncated] + additionalProperties: false + HookConfiguration: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + name: + type: string + pattern: ^[A-Za-z0-9_-]{1,64}$ + maxLength: 64 + session_id: + $ref: '#/components/schemas/ID' + enabled: + type: boolean + signature_header: + type: string + pattern: ^[A-Za-z0-9-]{1,64}$ + maxLength: 64 + signature_prefix: + type: string + pattern: ^[^\r\n]*$ + x-max-utf8-bytes: 32 + maxLength: 32 + revision: + $ref: '#/components/schemas/ID' + required: [id, name, session_id, enabled, signature_header, signature_prefix, revision] + additionalProperties: false + HookConfigurationResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/HookConfiguration' + required: [url, etag, value] + additionalProperties: false + Hook: + type: object + properties: + configuration_resource: + $ref: '#/components/schemas/HookConfigurationResource' + delivery_url: + type: string + format: uri + maxLength: 4096 + pending_count: + $ref: '#/components/schemas/Counter' + deferral_reason: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [configuration_resource, delivery_url, pending_count, deferral_reason] + additionalProperties: false + HookCreate: + type: object + properties: + name: + type: string + pattern: ^[A-Za-z0-9_-]{1,64}$ + maxLength: 64 + session_id: + $ref: '#/components/schemas/ID' + enabled: + type: boolean + signature_header: + type: string + pattern: ^[A-Za-z0-9-]{1,64}$ + maxLength: 64 + signature_prefix: + type: string + pattern: ^[^\r\n]*$ + x-max-utf8-bytes: 32 + maxLength: 32 + secret: + type: string + minLength: 1 + writeOnly: true + x-min-utf8-bytes: 16 + x-max-utf8-bytes: 4096 + maxLength: 4096 + required: [name, session_id] + additionalProperties: false + examples: + - session_id: 01a0fcea-2b00-7000-8000-000000000001 + name: ci + HookPatch: + type: object + properties: + name: + type: string + pattern: ^[A-Za-z0-9_-]{1,64}$ + maxLength: 64 + enabled: + type: boolean + signature_header: + type: string + pattern: ^[A-Za-z0-9-]{1,64}$ + maxLength: 64 + signature_prefix: + type: string + pattern: ^[^\r\n]*$ + x-max-utf8-bytes: 32 + maxLength: 32 + additionalProperties: false + HookSecretRequest: + type: object + properties: + secret: + type: string + minLength: 1 + writeOnly: true + x-min-utf8-bytes: 16 + x-max-utf8-bytes: 4096 + maxLength: 4096 + additionalProperties: false + HookChange: + type: object + properties: + resource: + $ref: '#/components/schemas/HookConfigurationResource' + notification: + $ref: '#/components/schemas/Notification' + secret: + type: string + minLength: 1 + x-min-utf8-bytes: 16 + x-max-utf8-bytes: 4096 + maxLength: 4096 + description: Secret appears only on creation and explicit rotation, including a generated secret. + Never present on PATCH or reads. + required: [resource, notification] + additionalProperties: false + examples: + - resource: + url: /extensions/webhooks/hooks/hook-1?view=configuration + etag: '"hook-revision-1"' + value: + id: hook-1 + name: ci + session_id: 01a0fcea-2b00-7000-8000-000000000001 + enabled: true + signature_header: X-Albedo-Signature + signature_prefix: sha256= + revision: hook-revision-1 + notification: + state: not_requested + code: null + detail: null + secret: synthetic-example-hook-secret + HookPermission: + type: object + properties: + session_id: + $ref: '#/components/schemas/ID' + agent_manage: + type: boolean + revision: + $ref: '#/components/schemas/ID' + required: [session_id, agent_manage, revision] + additionalProperties: false + HookPermissionPatch: + type: object + properties: + agent_manage: + type: boolean + additionalProperties: false + HookPermissionResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/HookPermission' + required: [url, etag, value] + additionalProperties: false + HookPermissionChange: + type: object + properties: + resource: + $ref: '#/components/schemas/HookPermissionResource' + notification: + $ref: '#/components/schemas/Notification' + required: [resource, notification] + additionalProperties: false + Delivery: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + hook_id: + $ref: '#/components/schemas/ID' + session_id: + $ref: '#/components/schemas/ID' + received_at: + $ref: '#/components/schemas/Timestamp' + delivered_at: + anyOf: + - $ref: '#/components/schemas/Timestamp' + - type: 'null' + attempts: + $ref: '#/components/schemas/Counter' + deferral_reason: + anyOf: + - $ref: '#/components/schemas/SafeReason' + - type: 'null' + required: [id, hook_id, session_id, received_at, delivered_at, attempts, deferral_reason] + DeliveryDetail: + allOf: + - $ref: '#/components/schemas/Delivery' + - type: object + properties: + payload: + type: object + properties: + encoding: + type: string + enum: [utf8, base64] + data: + type: string + maxLength: 90000 + required: [encoding, data] + additionalProperties: false + required: [payload] + WorkResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/WorkItem' + required: [url, etag, value] + additionalProperties: false + WorkChange: + type: object + properties: + resource: + $ref: '#/components/schemas/WorkResource' + notification: + $ref: '#/components/schemas/Notification' + required: [resource, notification] + additionalProperties: false + examples: + - resource: + url: /extensions/work/items/work-1?workspace=%2Fworkspace%2Fproject + etag: '"work-revision-1"' + value: + id: work-1 + workspace: /workspace/project + title: Fix the parser + notes: '' + parent_id: null + session_id: null + run_id: null + status: open + revision: work-revision-1 + created_at: '2026-10-02T14:00:00Z' + updated_at: '2026-10-02T14:00:00Z' + notification: + state: not_requested + code: null + detail: null + WorkPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/WorkResource' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + page: + $ref: '#/components/schemas/PageDescriptor' + glance: + $ref: '#/components/schemas/Glance' + required: [items, next] + additionalProperties: false + PaperclipResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/Paperclip' + required: [url, etag, value] + additionalProperties: false + PaperclipChange: + type: object + properties: + resource: + $ref: '#/components/schemas/PaperclipResource' + notification: + $ref: '#/components/schemas/Notification' + required: [resource, notification] + additionalProperties: false + PaperclipPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/PaperclipResource' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + page: + $ref: '#/components/schemas/PageDescriptor' + glance: + $ref: '#/components/schemas/Glance' + required: [items, next] + additionalProperties: false + ScheduleResource: + type: object + properties: + url: + $ref: '#/components/schemas/ResourceURL' + etag: + $ref: '#/components/schemas/ETag' + value: + $ref: '#/components/schemas/ScheduleJob' + required: [url, etag, value] + additionalProperties: false + ScheduleChange: + type: object + properties: + resource: + $ref: '#/components/schemas/ScheduleResource' + notification: + $ref: '#/components/schemas/Notification' + required: [resource, notification] + additionalProperties: false + SchedulePage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/ScheduleResource' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + page: + $ref: '#/components/schemas/PageDescriptor' + glance: + $ref: '#/components/schemas/Glance' + required: [items, next] + additionalProperties: false + HookPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Hook' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + DeliveryPage: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Delivery' + maxItems: 200 + next: + anyOf: + - $ref: '#/components/schemas/PageToken' + - type: 'null' + required: [items, next] + additionalProperties: false + ExtensionDeletion: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + notification: + $ref: '#/components/schemas/Notification' + required: [id, notification] + additionalProperties: false + ProxyTextPart: + type: object + properties: + type: + const: text + text: + type: string + required: [type, text] + additionalProperties: false + ProxyImagePart: + type: object + properties: + type: + const: image_url + image_url: + type: object + properties: + url: + type: string + pattern: ^data:image/(png|jpeg|gif|webp);base64, + detail: + type: string + enum: [auto, low, high] + required: [url] + additionalProperties: false + required: [type, image_url] + additionalProperties: false + ProxyToolCall: + type: object + properties: + id: + type: string + minLength: 1 + maxLength: 270000 + type: + const: function + function: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 256 + arguments: + type: string + required: [name, arguments] + additionalProperties: false + required: [id, type, function] + additionalProperties: false + ProxyMessage: + type: object + properties: + role: + type: string + enum: [system, developer, user, assistant, tool] + content: + anyOf: + - oneOf: + - type: string + - type: array + items: + oneOf: + - $ref: '#/components/schemas/ProxyTextPart' + - $ref: '#/components/schemas/ProxyImagePart' + - type: 'null' + name: + type: string + maxLength: 256 + tool_call_id: + type: string + minLength: 1 + maxLength: 270000 + tool_calls: + type: array + items: + $ref: '#/components/schemas/ProxyToolCall' + maxItems: 200 + reasoning_content: + anyOf: + - type: string + - type: 'null' + description: Tool messages require tool_call_id. Only assistant messages carry tool_calls. Images + are accepted only as user data URLs. + required: [role] + additionalProperties: false + ProxyToolDefinition: + type: object + properties: + type: + const: function + function: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 256 + description: + type: string + parameters: + $ref: '#/components/schemas/DynamicJSON' + strict: + type: boolean + required: [name] + additionalProperties: false + required: [type, function] + additionalProperties: false + ProxyCompletionRequest: + type: object + properties: + model: + type: string + minLength: 1 + maxLength: 577 + messages: + type: array + items: + $ref: '#/components/schemas/ProxyMessage' + tools: + type: array + items: + $ref: '#/components/schemas/ProxyToolDefinition' + maxItems: 200 + max_tokens: + type: integer + minimum: 1 + maximum: 9007199254740991 + max_completion_tokens: + type: integer + minimum: 1 + maximum: 9007199254740991 + temperature: + type: number + minimum: 0 + maximum: 2 + top_p: + type: number + minimum: 0 + maximum: 1 + stop: + oneOf: + - type: string + - type: array + items: + type: string + maxItems: 4 + tool_choice: + oneOf: + - type: string + enum: [none, auto, required] + - type: object + properties: + type: + const: function + function: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 256 + required: [name] + additionalProperties: false + required: [type, function] + additionalProperties: false + parallel_tool_calls: + type: boolean + reasoning_effort: + type: string + maxLength: 100 + reasoning: + type: object + properties: + effort: + type: string + maxLength: 100 + required: [effort] + additionalProperties: false + response_format: + oneOf: + - type: object + properties: + type: + const: json_object + required: [type] + additionalProperties: false + - type: object + properties: + type: + const: json_schema + json_schema: + type: object + properties: + name: + type: string + maxLength: 256 + description: + type: string + schema: + $ref: '#/components/schemas/DynamicJSON' + strict: + type: boolean + required: [name, schema] + additionalProperties: false + required: [type, json_schema] + additionalProperties: false + stream: + type: boolean + default: false + stream_options: + type: object + properties: + include_usage: + type: boolean + additionalProperties: false + x-max-encoded-bytes: 32000000 + required: [model, messages] + additionalProperties: false + examples: + - model: personal/example-model + messages: + - role: user + content: Hello + stream: true + ProxyUsage: + type: object + properties: + prompt_tokens_details: + type: object + properties: + cached_tokens: + $ref: '#/components/schemas/Counter' + required: [cached_tokens] + additionalProperties: false + completion_tokens_details: + type: object + properties: + reasoning_tokens: + $ref: '#/components/schemas/Counter' + required: [reasoning_tokens] + additionalProperties: false + prompt_tokens: + $ref: '#/components/schemas/Counter' + completion_tokens: + $ref: '#/components/schemas/Counter' + total_tokens: + $ref: '#/components/schemas/Counter' + required: [prompt_tokens, completion_tokens, total_tokens] + additionalProperties: false + ProxyError: + type: object + properties: + error: + type: object + properties: + message: + type: string + maxLength: 4096 + type: + type: string + maxLength: 100 + code: + anyOf: + - type: string + maxLength: 100 + - type: 'null' + param: + anyOf: + - type: string + maxLength: 256 + - type: 'null' + required: [message, type, code, param] + additionalProperties: false + required: [error] + additionalProperties: false + ProxyCompletion: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + object: + const: chat.completion + created: + $ref: '#/components/schemas/Counter' + model: + type: string + maxLength: 577 + choices: + type: array + items: + type: object + properties: + index: + $ref: '#/components/schemas/Counter' + message: + type: object + properties: + role: + const: assistant + content: + anyOf: + - type: string + - type: 'null' + reasoning_content: + anyOf: + - type: string + - type: 'null' + tool_calls: + type: array + items: + $ref: '#/components/schemas/ProxyToolCall' + maxItems: 200 + required: [role, content] + additionalProperties: false + finish_reason: + type: string + enum: [stop, length, tool_calls, content_filter] + required: [index, message, finish_reason] + additionalProperties: false + minItems: 1 + maxItems: 1 + usage: + anyOf: + - $ref: '#/components/schemas/ProxyUsage' + - type: 'null' + required: [id, object, created, model, choices, usage] + additionalProperties: false + examples: + - id: completion-1 + object: chat.completion + created: 1790949600 + model: personal/example-model + choices: + - index: 0 + message: + role: assistant + content: Hello + finish_reason: stop + usage: + prompt_tokens: 1 + completion_tokens: 1 + total_tokens: 2 + ProxyToolDelta: + type: object + properties: + index: + $ref: '#/components/schemas/Counter' + id: + type: string + minLength: 1 + maxLength: 270000 + type: + const: function + function: + type: object + properties: + name: + type: string + maxLength: 256 + arguments: + type: string + required: [name, arguments] + additionalProperties: false + required: [index] + additionalProperties: false + ProxyChunk: + type: object + properties: + id: + $ref: '#/components/schemas/ID' + object: + const: chat.completion.chunk + created: + $ref: '#/components/schemas/Counter' + model: + type: string + maxLength: 577 + choices: + type: array + items: + type: object + properties: + index: + $ref: '#/components/schemas/Counter' + delta: + type: object + properties: + role: + const: assistant + content: + type: string + reasoning_content: + type: string + tool_calls: + type: array + items: + $ref: '#/components/schemas/ProxyToolDelta' + maxItems: 200 + additionalProperties: false + finish_reason: + anyOf: + - type: string + enum: [stop, length, tool_calls, content_filter] + - type: 'null' + required: [index, delta, finish_reason] + additionalProperties: false + maxItems: 1 + usage: + anyOf: + - $ref: '#/components/schemas/ProxyUsage' + - type: 'null' + required: [id, object, created, model, choices] + additionalProperties: false + ProxySSE: + type: object + properties: + data: + anyOf: + - const: '[DONE]' + - type: string + contentMediaType: application/json + contentSchema: + oneOf: + - $ref: '#/components/schemas/ProxyChunk' + - $ref: '#/components/schemas/ProxyError' + description: Data is a JSON chunk or error, followed by literal [DONE]. Validate decoded JSON explicitly. + required: [data] + additionalProperties: false + ProxyModels: + type: object + properties: + object: + const: list + data: + type: array + items: + type: object + properties: + id: + type: string + minLength: 1 + maxLength: 577 + object: + const: model + created: + $ref: '#/components/schemas/Counter' + owned_by: + type: string + maxLength: 256 + required: [id, object, created, owned_by] + additionalProperties: false + errors: + type: array + items: + type: object + properties: + profile: + $ref: '#/components/schemas/ID' + message: + type: string + maxLength: 4096 + required: [profile, message] + additionalProperties: false + maxItems: 200 + required: [object, data] + additionalProperties: false + AdmissionProblem: + type: object + properties: + type: + const: about:blank + title: + type: string + maxLength: 256 + status: + type: integer + minimum: 400 + maximum: 599 + detail: + type: string + maxLength: 4096 + code: + type: string + minLength: 1 + maxLength: 100 + fields: + type: array + items: + type: object + properties: + pointer: + type: string + maxLength: 4096 + detail: + type: string + maxLength: 4096 + required: [pointer, detail] + additionalProperties: false + maxItems: 100 + required: [type, title, status, detail, code] + additionalProperties: false + ContextCompaction: + type: object + properties: + status: + type: string + enum: [not_configured, not_needed, compacted, unknown] + strategy: + anyOf: + - $ref: '#/components/schemas/ID' + - type: 'null' + trigger_free_percent: + anyOf: + - type: number + minimum: 0 + maximum: 100 + - type: 'null' + input_limit_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + estimated_input_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + provider_input_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + provider_cached_input_tokens: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + before_items: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + after_items: + anyOf: + - $ref: '#/components/schemas/Counter' + - type: 'null' + source: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + estimate_method: + anyOf: + - type: string + maxLength: 512 + - type: 'null' + required: [status, strategy, trigger_free_percent, input_limit_tokens, estimated_input_tokens, provider_input_tokens, + provider_cached_input_tokens, before_items, after_items, source, estimate_method] + additionalProperties: false -- knotmirror 0.0.1