openapi: 3.1.0 info: title: aimee-server API version: "1" description: > Native HTTP surface for aimee-server. Exposes liveness/discovery endpoints, an OpenAI-compatible shaping layer (models / chat.completions / completions / embeddings), and persona management. The same operations are also available over the NDJSON socket; this `/v1` surface is the contract-first HTTP transport. servers: - url: http://127.0.0.1:{port}/v1 variables: port: default: "8910" components: securitySchemes: bearerAuth: type: http scheme: bearer description: > Required for `/v1/*` over TCP. Unix-domain-socket access is authorised by filesystem permissions and needs no token. schemas: ProposalDraftRequest: type: object description: > Internal clients supply message as canonical IR. Legacy external text imports once at this public endpoint. Supplying both forms is refused. The host assigns context authority and the proposal drafting policy. oneOf: - required: [message] not: { required: [prompt] } - required: [prompt] not: { required: [message] } properties: message: type: object required: [role, blocks] properties: role: { type: string, enum: [user] } blocks: type: array minItems: 1 maxItems: 1 items: type: object required: [type, text] properties: type: { type: string, enum: [text] } text: { type: string, minLength: 1, description: At least 8 UTF-8 bytes } model: { type: string, description: Optional configured HTTP delegate name } prompt: { type: string, minLength: 1, deprecated: true, description: Legacy external text import only; at least 8 UTF-8 bytes } HealthResponse: type: object properties: status: { type: string, example: ok } service: { type: string, example: aimee-server } ReadyResponse: type: object properties: ready: { type: boolean, example: true } status: type: string description: "ok when every dependency sampled ok; degraded when one failed; unknown when not sampled yet or the sample is stale" enum: [ok, degraded, unknown] service: { type: string, example: aimee-server } sampled_at: type: integer nullable: true description: "Epoch seconds when the snapshot was taken; null before the first sample" age_seconds: type: integer nullable: true description: "Age of the snapshot in seconds; null before the first sample" dependencies: type: object description: "Per-dependency state; each value is ok, fail, or unknown" properties: db1: { type: string, example: ok } kb: { type: string, example: ok } retrieval: { type: string, example: ok } modules: type: string description: "State of the required same-container module processes on the local event bus" example: ok diagnostics: type: object properties: failed_boundary: { type: string } breaker_state: { type: string } retry_after_ms: { type: integer, format: int64 } last_success_query_ms: { type: integer, format: int64 } last_ingest_at: { type: string } missing_module: type: string description: "First required process module not attached to the local event bus; empty when all are present" VersionResponse: type: object properties: version: { type: string } service: { type: string, example: aimee-server } CapabilitiesResponse: type: object properties: capabilities: type: array items: { type: string } version: { type: string } service: { type: string, example: aimee-server } ModelsList: type: object properties: object: { type: string, example: list } data: type: array items: type: object properties: id: { type: string } object: { type: string, example: model } owned_by: { type: string } ChatMessage: type: object required: [role, content] properties: role: { type: string, enum: [system, user, assistant] } content: { type: string } ChatCompletionRequest: type: object required: [messages] properties: model: { type: string, default: aimee } messages: type: array items: { $ref: '#/components/schemas/ChatMessage' } temperature: { type: number } max_tokens: { type: integer } stream: { type: boolean, default: false } ChatCompletionResponse: type: object properties: id: { type: string } object: { type: string, example: chat.completion } model: { type: string } choices: type: array items: type: object properties: index: { type: integer } message: { $ref: '#/components/schemas/ChatMessage' } finish_reason: { type: string } usage: { $ref: '#/components/schemas/Usage' } CompletionRequest: type: object required: [prompt] properties: model: { type: string, default: aimee } prompt: { type: string } temperature: { type: number } max_tokens: { type: integer } stream: { type: boolean, default: false } CompletionResponse: type: object properties: id: { type: string } object: { type: string, example: text_completion } model: { type: string } choices: type: array items: type: object properties: index: { type: integer } text: { type: string } finish_reason: { type: string } usage: { $ref: '#/components/schemas/Usage' } EmbeddingsRequest: type: object required: [input] properties: model: { type: string, default: aimee } input: oneOf: - type: string - type: array items: { type: string } EmbeddingsResponse: type: object properties: object: { type: string, example: list } data: type: array items: type: object properties: object: { type: string, example: embedding } index: { type: integer } embedding: type: array items: { type: number } model: { type: string } usage: { $ref: '#/components/schemas/Usage' } Usage: type: object properties: prompt_tokens: { type: integer } completion_tokens: { type: integer } total_tokens: { type: integer } ResponsesRequest: type: object required: [input] properties: model: { type: string, default: aimee } input: oneOf: - type: string - type: array items: oneOf: - type: string - type: object properties: role: { type: string } content: {} previous_response_id: { type: string } temperature: { type: number } max_tokens: { type: integer } stream: { type: boolean, default: false } ResponseObject: type: object properties: id: { type: string } object: { type: string, example: response } created_at: { type: integer } model: { type: string } status: { type: string, example: completed } output: type: array items: type: object properties: id: { type: string } type: { type: string, example: message } status: { type: string } role: { type: string, example: assistant } content: type: array items: type: object properties: type: { type: string, example: output_text } text: { type: string } annotations: type: array items: {} usage: type: object properties: input_tokens: { type: integer } output_tokens: { type: integer } total_tokens: { type: integer } Persona: type: object properties: name: { type: string } description: { type: string } PersonaList: type: object properties: personas: type: array items: { $ref: '#/components/schemas/Persona' } PersonaWrite: type: object required: [name] properties: name: { type: string, description: "Filename-safe name (letters, digits, '.', '_', '-')" } description: { type: string } persona: { type: string, description: "Identity prose; may contain one %s for the cwd" } principles: { type: string } brief: { type: string } delegates: { type: string, enum: [full, readonly, none] } check_role: { type: string } check_marker: { type: string } roles: type: array items: { type: string } RoleTemplate: type: object properties: role: { type: string } content: { type: string, description: "Raw template body with {{TASK}}/{{CONTEXT}}" } SessionPersonaRequest: type: object required: [persona] properties: persona: { type: string } ErrorResponse: type: object properties: error: type: object properties: message: { type: string } type: { type: string } Presence: type: object description: A live presence (a session shared across one or more attached surfaces). properties: session_id: { type: string } owner: { type: string } attachments: { type: integer } turn_in_flight: { type: boolean } turn_id: { type: string } AttachRequest: type: object required: [surface] properties: surface: { type: string, description: "Surface label, e.g. cli / webchat / telegram / acp" } owner: { type: string, description: "Owner principal the presence is scoped to (first attach fixes it)" } target: { type: string, description: "Optional delivery-target spec for outbound routing, e.g. telegram:-100:42" } subscribe_mask: { type: integer, description: "OR of presence event classes to route to this surface" } persistent: { type: boolean, description: "Keep delivering routed async events after the live stream detaches" } AttachResponse: type: object properties: session_id: { type: string } attach_id: { type: string } events_url: { type: string } CliManifest: type: object required: [manifest_version, routes] properties: manifest_version: type: integer description: > Bumped only when the SHAPE of this document changes. A client that does not recognise the version must say so rather than guess at the rows. server_version: { type: string } routes: type: array items: type: object required: [op, verb, path] properties: op: type: string description: Method name the client asks for, e.g. "config.show". verb: { type: string, enum: [GET, POST, PUT, DELETE] } path: { type: string } async: type: boolean description: > Present and true when POSTing returns a run handle to poll at GET /v1/runs/{id} instead of a final response. paths: /native/primitive: post: summary: Select model-neutral personal memory for local native preparation description: > Requires the enrolled client's memory-read capability. Aimee returns current source records and revisions; the inference host retains its model weights and prepares model-specific native state locally. The active view contains at most 32 unique records. Overlapping recall sections do not repeat a record; conflicting source revisions or content fail closed, including conflicts outside the selected 32-record window. security: [{bearerAuth: []}] requestBody: required: true content: application/json: schema: type: object required: [task_hint] properties: task_hint: {type: string, minLength: 1} limit_tokens: {type: integer, minimum: 64, maximum: 8192} store: {type: string, enum: [user]} responses: '200': {description: Current selected source rows and record revisions; no model tensors} '400': {description: Invalid selection request} '403': {description: Memory read denied} '502': {description: Personal memory unavailable} /health: get: summary: Liveness probe security: [] responses: "200": description: Service is up content: application/json: schema: { $ref: '#/components/schemas/HealthResponse' } /cli/manifest: get: summary: The thin client's method to route map description: > The map of dispatchable method (`op`) to `/v1` route, read off this server's live route registry. The thin client fetches this instead of carrying a compiled-in copy, so a capability added to the server is reachable from an existing client with no client rebuild. `async: true` marks rows whose POST returns a run handle to poll at `GET /v1/runs/{id}` rather than a final response; the client must know this to drive the request and cannot infer it from the path. Rows with an inline `{id}` segment are not listed; those carry a different marshalling contract. Unauthenticated for the same reason as the OpenAPI document: it describes the surface and grants nothing, and a client that cannot read it cannot address the server at all, so gating it would make an authentication failure look like a missing command. security: [] responses: "200": description: The route map content: application/json: schema: { $ref: '#/components/schemas/CliManifest' } /ready: get: summary: Readiness probe description: > Reports whether the server can serve work right now, with per-dependency state. Distinct from /health, which is liveness only and always returns 200 while the process is up. An orchestrator should restart on a /health failure but only drain on a /ready failure. The answer comes from a snapshot sampled on a background interval, so this route performs no dependency I/O. It fails closed: before the first sample, past the staleness bound, when any data dependency failed, or while a required same-container module process is absent from the local event bus, the answer is 503. security: [] responses: "200": description: Every dependency sampled ok content: application/json: schema: { $ref: '#/components/schemas/ReadyResponse' } "503": description: "Not ready: a dependency failed, or state is unknown because no sample has completed or the snapshot is stale" content: application/json: schema: { $ref: '#/components/schemas/ReadyResponse' } /management/action: post: summary: Execute an authenticated management control-plane action description: > Verifies the caller's management JWT, peer identity, capability, and request digest before dispatching the management action. requestBody: required: false content: application/json: schema: { type: object, additionalProperties: true } responses: "200": description: Management action accepted content: application/json: schema: { type: object } "403": description: Management action denied content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Management control plane is not configured content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /management/action/challenge: post: summary: Issue a nonce for a management control-plane action description: > Requires the dedicated kb management-client mTLS certificate profile. The nonce is short-lived, single-use, and bound to this TLS connection, peer certificate, target server, and management.action.v1 purpose. The subsequent action request must use the same live TLS connection. responses: "200": description: Management action challenge issued content: application/json: schema: type: object required: [nonce, expires_at] properties: nonce: { type: string, description: Canonical base64url without padding } expires_at: { type: string, pattern: '^[0-9]+$' } "401": { description: Dedicated management-client certificate required } "429": { description: Outstanding challenge capacity reached } "503": { description: Management action verification is not configured } /management/read/challenge: post: summary: Issue a nonce for a bounded management read description: > Requires the dedicated kb management-client mTLS profile. The nonce is short-lived, single-use, same-connection bound, and purpose-separated as management.read.v1. responses: "200": description: Management-read challenge issued content: application/json: schema: type: object required: [nonce, purpose, expires_at] additionalProperties: false properties: nonce: { type: string, pattern: '^[A-Za-z0-9_-]{43}$' } purpose: { type: string, enum: [management.read.v1] } expires_at: { type: integer } "403": { description: Dedicated management-client certificate required } "503": { description: Management-read verification is unavailable } /management/read/agents: get: summary: Return the bounded management agent projection description: > Requires a nonce-bound status proof and a remote_reads JWT on the same pinned mTLS connection. The response contains only the frozen safe fields. responses: "200": description: Bounded agent projection content: application/json: schema: type: object required: [server_id, team, agents] additionalProperties: false properties: server_id: { type: string, minLength: 1, maxLength: 127, pattern: '^[A-Za-z0-9][A-Za-z0-9._-]{0,126}$' } team: { type: integer, format: int64, minimum: 1 } agents: type: array maxItems: 16 items: type: object required: [name, provider, model, enabled, delegate_available, primary_only, max_parallel] additionalProperties: false properties: name: { type: string, pattern: '^[A-Za-z0-9._-]{1,63}$' } provider: { type: string, pattern: '^[A-Za-z0-9._-]{1,15}$' } model: { type: string, maxLength: 127 } enabled: { type: boolean } delegate_available: { type: boolean } primary_only: { type: boolean } max_parallel: { type: integer, minimum: 0, maximum: 1024 } "403": { description: Management read forbidden } "409": { description: Nonce or JTI already consumed } "502": { description: Integrity verification failed } "503": { description: Management read unavailable } /management/read/config/challenge: post: summary: Issue a purpose-separated nonce for a bounded configuration read responses: "200": description: Configuration-read challenge issued content: application/json: schema: type: object required: [nonce, purpose, expires_at] additionalProperties: false properties: nonce: { type: string, pattern: '^[A-Za-z0-9_-]{43}$' } purpose: { type: string, enum: [management.read.config.v1] } expires_at: { type: integer } "403": { description: Dedicated management-client certificate required } "503": { description: Management-read verification is unavailable } /management/read/config: get: summary: Return the bounded five-field safe configuration projection responses: "200": description: Safe configuration projection content: application/json: schema: type: object additionalProperties: false required: [server_id, team, config] properties: server_id: { type: string, minLength: 1, maxLength: 127, pattern: '^[A-Za-z0-9][A-Za-z0-9._-]{0,126}$' } team: { type: integer, format: int64, minimum: 1 } config: type: object additionalProperties: false required: [mtls, remote_writes, client_transport, cli_session_forwarding, require_aimee_git] properties: mtls: { type: string, enum: [off, optional, required] } remote_writes: { type: string, enum: [off, data, full] } client_transport: { type: string, enum: [socket, http, auto] } cli_session_forwarding: { type: boolean } require_aimee_git: { type: boolean } "403": { description: Management read forbidden } "409": { description: Nonce or JTI already consumed } "502": { description: Integrity verification failed } "503": { description: Management read unavailable } /management/challenge: post: summary: Issue a nonce for a read-only management health check description: > Requires the dedicated kb management-client mTLS certificate profile. The nonce is short-lived, single-use, and bound to this TLS connection, peer certificate, target server, and health-check purpose. responses: "200": description: Management challenge issued content: application/json: schema: type: object required: [nonce, expires_at] properties: nonce: { type: string, description: Canonical base64url without padding } expires_at: { type: string, pattern: '^[0-9]+$' } "401": { description: Dedicated management-client certificate required } "429": { description: Outstanding challenge capacity reached } "503": { description: Management status verification is not configured } /management/health: get: summary: Verify a nonce-bound online revocation staple description: > Read-only health probe for the reverse management channel. Requires the same live mTLS connection used to obtain the challenge and consumes the nonce on every identifiable verification attempt. parameters: - in: header name: X-Aimee-Management-Status required: true schema: { type: string, maxLength: 4096 } description: Strict signed management-status JSON staple responses: "200": description: Peer and target status verified content: application/json: schema: type: object required: [status, server_id] properties: status: { type: string, enum: [ok] } server_id: { type: string } "401": { description: Missing or invalid peer certificate or staple } "403": { description: Authenticated peer, target, or purpose mismatch } "409": { description: Replayed, expired, conflicting, or rolled-back challenge } "503": { description: Management status verification is unavailable } /version: get: summary: Build version security: [] responses: "200": description: Version info content: application/json: schema: { $ref: '#/components/schemas/VersionResponse' } /capabilities: get: summary: Resources this HTTP surface serves security: [] responses: "200": description: Capability list content: application/json: schema: { $ref: '#/components/schemas/CapabilitiesResponse' } /openapi.json: get: summary: This OpenAPI document (JSON content type) security: [] responses: "200": description: The OpenAPI spec /openapi.yaml: get: summary: This OpenAPI document (YAML content type) security: [] responses: "200": description: The OpenAPI spec /models: get: summary: List available models responses: "200": description: OpenAI-shaped model list content: application/json: schema: { $ref: '#/components/schemas/ModelsList' } /embedders: get: summary: List the embedders this deployment can offer description: > Read from the embedder registry (scripts/embedders.json), not from a running service: the setup wizard needs this list before anything is deployed. `local` says whether the current KB image can run the model internally. One is bundled in that image. An entry it cannot run is selectable only as a remote role. Every other field changes the vectors, so the picker shows them: a different `dim` rebuilds the pgvector columns as well as re-embedding the corpus, and `prefixed` marks a model whose card defines query/document prefixes. responses: "200": description: The registry as a choosable list content: application/json: schema: type: object properties: status: { type: string } embedders: type: array items: type: object properties: id: { type: string } dim: { type: integer } context: { type: integer } pooling: { type: string } local: { type: boolean } prefixed: { type: boolean } /hosts: get: summary: Enumerate hosts and their live GPU inventory description: > The local host plus every registered network host, each probed for its GPUs (local via a device query, remote over ssh). Backs the setup wizard's host + GPU pickers. responses: "200": description: Hosts with per-host live GPU inventory content: application/json: schema: type: object properties: status: { type: string } hosts: type: array items: type: object properties: name: { type: string } kind: { type: string, enum: [local, remote] } ip: { type: string } error: { type: string } gpus: type: array items: type: object properties: index: { type: integer } name: { type: string } vendor: { type: string } vram_mb: { type: integer } /rules: get: summary: List active collaboration rules responses: "200": description: Active collaboration rules ({epoch, rules[]}) content: application/json: schema: type: object properties: epoch: { type: integer } rules: { type: array, items: { type: object } } "502": description: Rules backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Rules not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/blocks: get: summary: Composable workflow block catalog (built-ins + custom registry) responses: "200": description: "{blocks:[{name,produces,accepts[],custom,requires_input,executor?}]}" content: application/json: schema: { type: object } /workflow/blocks/{name}: put: summary: Create or edit a delegate custom block (blocks.yaml; command executors refused) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Updated block catalog, content: { application/json: { schema: { type: object } } } } } delete: summary: Delete a custom delegate block (command blocks are operator-only) responses: { "200": { description: Updated block catalog, content: { application/json: { schema: { type: object } } } } } /workflow/defs: get: summary: List saved workflow definitions responses: "200": description: "{defs:[{name,valid,version}]}" content: application/json: schema: { type: object } /workflow/triggers: get: summary: Configured trigger rules (aimee.yaml trigger_rules) that auto-start runs responses: "200": description: "{max_concurrent,triggers:[{source,event,schedule,mode,template,workspace,max_spend_usd?}]}" content: application/json: schema: { type: object } /workflow/defs/{name}: get: summary: One workflow definition (canonical form, version, node graph) parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: "{valid,name,version,canonical,def,error?}" content: application/json: schema: { type: object } "400": description: Invalid workflow name content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Workflow not found content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/validate: post: summary: Validate posted workflow YAML without saving requestBody: required: true content: application/json: schema: type: object required: [yaml] properties: yaml: { type: string } responses: "200": description: "{valid,name,version,canonical,def,error?}" content: application/json: schema: { type: object } "400": description: Malformed request content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/save: post: summary: Canonical-normalize + save a workflow (optimistic lock on prev_version) requestBody: required: true content: application/json: schema: type: object required: [name, yaml] properties: name: { type: string } yaml: { type: string } prev_version: { type: string } responses: "200": description: "{name,version}" content: application/json: schema: { type: object } "400": description: Invalid definition or name content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "409": description: Version conflict / already exists content: application/json: schema: { type: object } /workflow/items: get: summary: List the caller's own workflow work items (submitter-scoped run-state rows) responses: "200": description: "{items:[{id,workflow,version,stage,state,mode,pause_reason,repo,proposal_name,pr_ref,submitter,cum_cost_usd,work_item_max_cost_usd,override_count}]}" content: application/json: schema: { type: object } /workflow/items/all: get: summary: List ALL work items regardless of submitter (operator view, CAP_WORKFLOW_ADMIN) responses: "200": description: All work-item run-state rows content: application/json: schema: { type: object } /workflow/repo/tree: get: summary: List directories + .md files under the server's local project checkout (composer proposal browser), path-confined parameters: - name: path in: query required: false schema: { type: string } description: Relative path under the project root ("" = root); rejects .. / symlink escape responses: "200": description: "{path, entries:[{name,type:dir|file}]}" content: application/json: schema: { type: object } "400": description: Path escapes the project root content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Not a directory / not found content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/repo/file: get: summary: Read one .md file under the confined project root (composer proposal browser) parameters: - name: path in: query required: true schema: { type: string } description: Relative .md path under the project root; rejects .. / symlink escape responses: "200": description: "{path, content, truncated}" content: application/json: schema: { type: object } "400": description: Path escapes the project root or is not a .md file content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: File not found / not a regular file content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}/events: get: summary: The item's lifecycle timeline (proposal history), owner-only, paginated by event id parameters: - name: id in: path required: true schema: { type: string } - name: after in: query required: false schema: { type: integer } description: Return events with id greater than this cursor (default 0) - name: limit in: query required: false schema: { type: integer } description: Max events to return, clamped to [1,200] (default 200) responses: "200": description: "{events:[{id,stage,kind,actor,detail,cost_usd,created_at}], next_after}" content: application/json: schema: { type: object } "403": description: Not the caller's work item content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}/proposal: get: summary: The source proposal markdown the run is executing (owner-only) parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: "{proposal_md, truncated}" content: application/json: schema: { type: object } "403": description: Not the caller's work item content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Proposal file not found content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}: get: summary: One work item's run-state parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: Work-item run-state content: application/json: schema: { type: object } "404": description: Work item not found content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Delete a run after auto-abandoning it, then remove its rows and proposal file (owner or operator) parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: "{id, deleted:true}" content: application/json: schema: { type: object } "403": description: Not the caller's work item content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Work item not found content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}/pause: post: summary: Pause an active run (operator_paused) so the scheduler stops advancing it (owner or operator) parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: Updated work-item run-state content: application/json: schema: { type: object } "409": description: Run already finished or already paused content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}/resume: post: summary: Resume a paused run and wake the scheduler; refuses a run parked at a human gate (owner or operator) parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: Updated work-item run-state content: application/json: schema: { type: object } "409": description: Run not paused, already finished, or parked at a human gate (use Approve/Reject) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}/stop: post: summary: Stop a run (abandon it); the scheduler reclaims its worktree (owner or operator) parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: Updated work-item run-state content: application/json: schema: { type: object } "409": description: Run already finished content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workflow/items/{id}/gate: post: summary: Approve or reject the human gate a run is parked at (operator-only) parameters: - name: id in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object required: [decision] properties: decision: { type: string, enum: [approve, reject] } gate: { type: string, description: Gate name (defaults to the parked stage) } responses: "200": description: "{work_item_id, gate, decision}" content: application/json: schema: { type: object } "400": description: Bad decision "404": description: Work item not found /kb/search: post: summary: Search the knowledge base (proxied to aimee-kb) requestBody: required: true content: application/json: schema: type: object required: [query] properties: query: { type: string } project: { type: string } max_results: { type: integer } format: { type: string, enum: [json, text] } responses: "200": description: Knowledge search result envelope content: application/json: schema: { type: object } "400": description: Missing query content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Knowledge backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Knowledge search not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /curiosity: get: summary: List open curiosity items (proxied to aimee-kb) responses: "200": description: Curiosity items content: application/json: schema: { type: object } "502": description: Curiosity backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Curiosity not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /roadmap: get: summary: List roadmaps (proxied to aimee-kb) responses: "200": description: Roadmap list content: application/json: schema: { type: object } "502": description: Roadmap backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Roadmap not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /dev/submit: post: summary: Submit a proposal for autonomous development (runs server-side via the workflow engine) requestBody: required: true content: application/json: schema: type: object required: [proposal_md] properties: proposal_md: { type: string, description: The proposal to execute autonomously } workflow: { type: string, description: Workflow name (default "build") } repo: { type: string, description: Optional repo identifier } responses: "200": description: "{work_item_id, workflow, state}" content: application/json: schema: { type: object } "400": description: Missing proposal_md "500": description: Could not create the work item /dev/ci-event: post: summary: Record a PR's CI result and resume its autonomous scheduler (HMAC-signed; no capability, fail-closed if the secret is unset) requestBody: required: true content: application/json: schema: type: object required: [pr_ref, head_sha, status, signature] properties: pr_ref: { type: string, description: The PR ref the run opened } head_sha: { type: string, description: The commit CI ran on } status: { type: string, enum: [passed, failed, error, pending] } log_url: { type: string, description: Optional CI log URL } signature: { type: string, description: HMAC-SHA256 hex over "pr_ref|head_sha|status" keyed by AIMEE_CI_WEBHOOK_SECRET } responses: "200": description: "{ok, work_item, duplicate}" content: application/json: schema: { type: object } "400": description: Missing/invalid fields or unknown status "401": description: Invalid signature "404": description: No work item for pr_ref "413": description: Body too large "503": description: Webhook disabled (AIMEE_CI_WEBHOOK_SECRET unset) /dev/sweep: post: summary: Propose and rank cross-call-site duplication seams (analysis-only; files nothing) requestBody: required: false content: application/json: schema: type: object properties: project: { type: string, description: Indexed project name to scope the walk (default first indexed) } responses: "200": description: "{candidates[], areas_total, areas_run, files, strong, worth_exploring, rejected, excluded, analysis_only}" content: application/json: schema: { type: object } "400": description: No indexed project / no source files /runs: post: summary: Queue an owned inference run using canonical input description: >- Pins the selected model registration and executes the server tool catalog. Input accepts Responses-style ordered messages and content blocks, including images and tool history; bare array strings are separate user messages. Instructions, temperature and output limits are preserved. Unsupported execution controls or client tool catalogs are rejected. Terminal snapshots expose canonical_session_id for durable history; the live store is bounded. A token-limited response has status incomplete. Runs are private to their authenticated owner. Native Codex/Claude SDK runs require an absolute cwd; workspace ownership and session isolation follow the browser tool path. requestBody: required: true content: application/json: schema: type: object required: [input] properties: model: { type: string } cwd: type: string description: Absolute host workspace path required for native Codex/Claude SDK execution. input: {} instructions: { type: string } temperature: { type: number, minimum: 0, maximum: 2 } max_tokens: { type: integer, minimum: 1 } max_output_tokens: { type: integer, minimum: 1 } responses: "200": description: Queued run object content: application/json: schema: { type: object } "400": description: Invalid run request content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Inference failed content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Runs not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /runs/{id}: get: summary: Retrieve a previously created run parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: The run object content: application/json: schema: { type: object } "404": description: No such run content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "410": description: Run interrupted by server replacement or evicted from the live store content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /runs/{id}/events: get: summary: Stream a run's output as SSE (replay for completed runs) parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: text/event-stream of response.output_text.delta events + a terminal done event "404": description: No such run content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "410": description: Run interrupted by server replacement or evicted from the live store content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /runs/{id}/stop: post: summary: Request cancellation of an owned run parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: The run object with cancellation requested, or its existing terminal status content: application/json: schema: { type: object } "404": description: No such run content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "410": description: Run interrupted by server replacement or evicted from the live store content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /cli/session: post: summary: Create/ensure a server-hosted Claude PTY session (terminal forwarding) description: > Starts (or reuses) a detached tmux session running `claude` plus a forkpty child, so a thin client can drive the raw interactive terminal over /v1. Gated by `aimee.api.cli_session_forwarding` (404 when off). requestBody: required: true content: application/json: schema: type: object required: [session_id] properties: session_id: { type: string } rows: { type: integer } cols: { type: integer } responses: "200": description: Session ready content: application/json: schema: { type: object } "400": description: Invalid session id or body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: CLI session forwarding disabled content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Kill a server-hosted Claude PTY session parameters: - name: session_id in: query required: false schema: { type: string } responses: "200": description: Session killed (no-op for unknown id) content: application/json: schema: { type: object } /cli/session/{id}/input: post: summary: Queue raw input (base64) to a PTY session parameters: - name: id in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object required: [data] properties: data: { type: string, description: base64-encoded raw input bytes } responses: "200": description: Input queued content: application/json: schema: { type: object } "404": description: Unknown session or invalid input content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /cli/session/{id}/resize: post: summary: Set the PTY window size parameters: - name: id in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object properties: rows: { type: integer } cols: { type: integer } responses: "200": description: Resize accepted content: application/json: schema: { type: object } "404": description: Unknown session or bad dimensions content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /cli/session/{id}/stream: get: summary: Stream raw PTY output as base64 SSE frames description: > Server-sent events; each `data:` frame is base64-encoded raw terminal output. The pump also drains queued input and applies pending resizes. parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: SSE stream of PTY output content: text/event-stream: schema: { type: string } "404": description: CLI session forwarding disabled content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /cli/session/{id}: delete: summary: Kill a server-hosted Claude PTY session by id parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: Session killed (no-op for unknown id) content: application/json: schema: { type: object } /agents: get: summary: List configured models and the default agent responses: "200": description: Configured agents ({default, agents[]}) content: application/json: schema: type: object properties: default: { type: string } agents: type: array items: type: object properties: name: { type: string } provider: { type: string } model: { type: string } enabled: { type: boolean } roles: { type: array, items: { type: string } } "502": description: Agent configuration unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Agents not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /kb/status: get: summary: Knowledge-base / vector status (proxied to aimee-kb) responses: "200": description: KB / vector status content: application/json: schema: { type: object } "502": description: Knowledge backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: KB status not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /kb/ingest/status: get: summary: Knowledge-base ingest queue and worker status (proxied to aimee-kb) responses: "200": description: Ingest queue, recent jobs, and worker slots content: application/json: schema: { type: object } "502": description: Knowledge backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /kb/curator: get: summary: Curator LLM provider + queue status (proxied to aimee-kb) responses: "200": description: Curator observability block (synthesis provider + queue depth) content: application/json: schema: { type: object } "502": description: Knowledge backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Curator status not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/recall: post: summary: Recall relevant memories (proxied to aimee-kb) requestBody: required: true content: application/json: schema: type: object required: [task_hint] properties: task_hint: { type: string } query: { type: string } limit_tokens: { type: integer } session_start: { type: boolean } responses: "200": description: Memory recall envelope ({recall:...}) content: application/json: schema: { type: object } "400": description: Missing task_hint content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Memory backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Memory recall not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /code/audit: post: summary: Graph-derived code-health audit (proxied to aimee-kb) description: >- Dead exports, import cycles, exact body-hash clone groups, near-clone pairs, and clone threshold metadata derived from the indexed code graph (entity_edges) and code_embeddings. Requires aimee-kb with code graph rows for the requested project. requestBody: required: false content: application/json: schema: type: object properties: project: { type: string } limit: { type: integer } responses: "200": description: Audit bundle ({dead_exports, cycles, clones, near_clones}) content: application/json: schema: { type: object } "502": description: Knowledge service (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /audit/trace: post: summary: Per-turn retrieval-evidence trace (proxied to aimee-kb) description: >- Reconstruct what a turn retrieved: given the caller-visible turn_id (the X-Aimee-Retrieval-Event response-header value), return the per-turn retrieval_event and its surfaced ids. trace_status is one of the exhaustive states ok / not_instrumented / not_evaluated / evidence_unavailable (P1 produces ok and evidence_unavailable). Requires aimee-kb. Gated by kb_evidence_emit_enabled at emit time. requestBody: required: true content: application/json: schema: type: object required: [turn_id] properties: turn_id: { type: string } responses: "200": description: Trace bundle ({status, trace_status, turn_id, retrieval_event_id?, event?}) content: application/json: schema: { type: object } "502": description: Knowledge service (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /audit/provenance: post: summary: Per-turn source provenance (proxied to aimee-kb) description: >- Which sources grounded a turn's answer, at which version: given the caller-visible turn_id, resolve each source id recorded on the turn's retrieval_event to {id, kind, source, version, present, turn_version, drifted}. version is the source row's updated_at read live (current); turn_version is the point-in-time version captured at emit; drifted is true when a still-present source's current version differs from turn_version (version-change drift). present is false when the source no longer exists (deleted/superseded since the turn). outcomes is the P5 work-outcome history for the retrieval event, including authenticated evaluator, task, workflow, correction and fault attribution; it is `not-computed` only if that projection could not be read. The same payload is exported by `aimee audit provenance `. provenance_status is one of the exhaustive states ok / not_instrumented / not_evaluated / evidence_unavailable (P2 produces ok and evidence_unavailable). Requires aimee-kb. Gated by kb_evidence_emit_enabled at emit time. requestBody: required: true content: application/json: schema: type: object required: [turn_id] properties: turn_id: { type: string } responses: "200": description: Provenance bundle ({status, provenance_status, turn_id, retrieval_event_id?, sources?}) content: application/json: schema: { type: object } "502": description: Knowledge service (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /audit/fidelity: post: summary: Per-turn answer-fidelity report (proxied to aimee-kb) description: >- How faithful a turn's answer was to its own injected evidence: given the caller-visible turn_id, return the answer-level fidelity_report (supported / unsupported / abstained claim buckets) plus the per-chunk attribution_count. fidelity_status is one of the exhaustive states ok / not_instrumented / not_evaluated / evidence_unavailable. This read produces ok, not_evaluated (the honest default when the default-off fidelity judge has not run for the turn), and evidence_unavailable (lookup error); not_instrumented is reserved for paths that emit no evidence and is set at emit time. Requires aimee-kb. Gated by fidelity_check_enabled at emit time. requestBody: required: true content: application/json: schema: type: object required: [turn_id] properties: turn_id: { type: string } responses: "200": description: Fidelity bundle ({status, fidelity_status, turn_id, report?, attribution_count?}) content: application/json: schema: { type: object } "502": description: Knowledge service (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /css/signals: post: summary: CSS migration assistant signals (proxied to aimee-kb) description: >- Query the CSS migration assistant's style graph and pipeline for a project. op is one of dead-rules, conflicts, duplicate-declarations, duplicate-selectors, unresolved, migrate-enumerate, migrate-list, rules-doc. Read ops return {results, count}; migrate-enumerate returns {units}; rules-doc returns {rules_doc}. Requires css_style_graph_enabled and a re-index to populate the graph; proxied to aimee-kb (KB_STORE-side). requestBody: required: true content: application/json: schema: type: object required: [op, project] properties: op: { type: string } project: { type: string } responses: "200": description: CSS signal results ({status, op, project, results?, count?, units?, rules_doc?}) content: application/json: schema: { type: object } "502": description: Knowledge service (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /notes: get: summary: List notes (proxied to aimee-kb) responses: "200": description: Notes list content: application/json: schema: { type: object } "502": description: Notes backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Notes not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/find: post: summary: Find indexed code symbols by identifier requestBody: required: true content: application/json: schema: type: object required: [identifier] properties: identifier: { type: string } responses: "200": description: Index hits envelope content: application/json: schema: { type: object } "400": description: Missing identifier or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Index backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/list: post: summary: List indexed projects responses: "200": description: Indexed projects envelope content: application/json: schema: { type: object } "502": description: Index backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/hybrid: post: summary: Fused lexical and semantic search over the code index description: > The command-line twin of the index_hybrid MCP tool, for finding a PHRASE rather than a symbol. Accepts `queries` so several phrases cost one round trip. scope=all widens beyond the active project. Note the MCP twin also performs cite-capture against an MCP session id; this route does not, because it has no such session. The retrieval is identical. requestBody: required: true content: application/json: schema: type: object properties: project: { type: string } query: { type: string } queries: type: array items: { type: string } symbol: { type: string } scope: { type: string, enum: [current, all] } max_results: { type: integer } cwd: { type: string } responses: "200": description: One result entry per query, in order content: application/json: schema: { type: object } "400": description: Missing query/queries, bad scope, or no active project content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Knowledge service unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/investigate: post: summary: Ask the code index a plain-words question description: > The command-line twin of the index_investigate MCP tool. Returns ranked evidence with the code attached rather than a list of paths to go read. Accepts `queries` so several questions cost one round trip; `query` is the single-question form. requestBody: required: true content: application/json: schema: type: object properties: project: { type: string } query: { type: string } queries: type: array items: { type: string } symbol: { type: string } cwd: { type: string } responses: "200": description: One result entry per question, in order content: application/json: schema: { type: object } "400": description: Missing query/queries, or no active project to scope it to content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Knowledge service unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/span: post: summary: Read an exact line range from an indexed file description: > The command-line twin of the code_span_get MCP tool. It exists so a range read can be chained with && into one shell call instead of costing a tool turn per read. line_end defaults to line_start, so an omitted range returns a single line rather than a whole file. requestBody: required: true content: application/json: schema: type: object required: [file_path] properties: project: { type: string } file_path: { type: string } line_start: { type: integer } line_end: { type: integer } cwd: { type: string } responses: "200": description: Span envelope with the file content for the range content: application/json: schema: { type: object } "400": description: Missing file_path, or no active project to scope it to content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Knowledge service unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/structure: post: summary: List the definitions in an indexed file requestBody: required: true content: application/json: schema: type: object required: [project, file_path] properties: project: { type: string } file_path: { type: string } responses: "200": description: File structure envelope content: application/json: schema: { type: object } "400": description: Missing project/file_path or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Index backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/find_callers: post: summary: Find callers of an indexed symbol requestBody: required: true content: application/json: schema: type: object required: [symbol] properties: symbol: { type: string } project: { type: string } responses: "200": description: Caller hits envelope content: application/json: schema: { type: object } "400": description: Missing symbol or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Index backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/deps: post: summary: Cross-repo dependency edges for a registered repo description: >- Proxies the kb cross-repo dependency query. Returns confidence-tiered edges with evidence + a version stamp, or the AMBIGUOUS review queue when status=ambiguous. direction: out = deps OF the project (default), in = repos that depend ON the project (--reverse), both = union. requestBody: required: true content: application/json: schema: type: object required: [project] properties: project: { type: string } direction: { type: string, enum: [out, in, both], default: out } min_tier: { type: string, enum: [high, medium, tentative] } status: { type: string, enum: [ambiguous] } dry_run: type: boolean description: >- Offline candidate inspection. Emit every band down to LOW plus inline AMBIGUOUS candidates, writing nothing (acceptance #4). responses: "200": description: Cross-repo dependency edges or ambiguous review queue content: application/json: schema: { type: object } "400": description: Missing project or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Index backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /index/blast_radius: post: summary: Dependency blast radius for an indexed file requestBody: required: true content: application/json: schema: type: object required: [project, file_path] properties: project: { type: string } file_path: { type: string } responses: "200": description: Blast radius envelope content: application/json: schema: { type: object } "400": description: Missing project/file_path or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Index backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /skills: get: summary: List available skills responses: "200": description: Skills envelope content: application/json: schema: { type: object } /skills/show: post: summary: Show a skill's definition requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } file_path: { type: string } responses: "200": description: Skill definition envelope content: application/json: schema: { type: object } "400": description: Missing name or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /hud: get: summary: Session HUD status snapshot responses: "200": description: HUD status envelope content: application/json: schema: { type: object } /trajectory/export: post: summary: Export owner-checked canonical session history description: >- Returns aimee.trajectory.v2 with canonical messages and explicit export fidelity. Redaction and tool-result omissions never rewrite native tool identities or signatures. No inferred outcome/reward or cross-session audit overlay is included. requestBody: required: true content: application/json: schema: type: object required: [session_id] properties: session_id: { type: string } compress: { type: boolean } max_result_bytes: { type: integer } responses: "200": description: Trajectory export envelope content: application/json: schema: { type: object } "400": description: Missing session_id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /toolsets: get: summary: List effective toolsets responses: "200": description: Toolsets envelope content: application/json: schema: { type: object } /toolsets/show: post: summary: Show a toolset's resolved tools requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } responses: "200": description: Toolset envelope content: application/json: schema: { type: object } "400": description: Missing name or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /collab_rules: get: summary: List collaboration rules responses: "200": description: Collaboration rules envelope content: application/json: schema: { type: object } /collab_rules/active: get: summary: List active collaboration rules responses: "200": description: Active collaboration rules envelope content: application/json: schema: { type: object } /wm/list: post: summary: List working-memory entries for a session requestBody: required: true content: application/json: schema: type: object required: [session_id] properties: session_id: { type: string } responses: "200": description: Working-memory envelope content: application/json: schema: { type: object } "400": description: Missing session_id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /attempts/list: post: summary: List attempt-log entries for a session requestBody: required: true content: application/json: schema: type: object required: [session_id] properties: session_id: { type: string } responses: "200": description: Attempt-log envelope content: application/json: schema: { type: object } "400": description: Missing session_id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /aux/config: get: summary: Show auxiliary-model configuration responses: "200": description: Auxiliary model config envelope content: application/json: schema: { type: object } /config: get: summary: Show all configuration values responses: "200": description: Configuration envelope with a config object of key/value pairs content: application/json: schema: { type: object } /config/deploy-env: get: summary: Emit the compose environment for this backend record description: > The KEY=VALUE lines a managed `docker compose up -d` needs, derived from the saved configuration. Intended for the operator wrapper `eval "$(aimee config deploy-env)" && docker compose up -d`: recreating a managed container without these silently reinterpolates AIMEE_KB_VARIANT to empty, which resolves the knowledge-base image to the embedderless variant. Carries no credential: embedder and synthesis API keys are deliberately omitted and live only in Vault. responses: "200": description: Envelope whose `env` string holds the KEY=VALUE lines content: application/json: schema: { type: object } /config/get: post: summary: Get one configuration value requestBody: content: application/json: schema: { type: object } responses: "200": description: Single config key/value content: application/json: schema: { type: object } /config/set: post: summary: Set one configuration value description: > Roundtable policy keys are operator-controlled and require the server-token-attested `webuser:admin` appliance administrator; generic capabilities and local Unix-socket access are insufficient. requestBody: content: application/json: schema: { type: object } responses: "200": description: Updated config key/value content: application/json: schema: { type: object } "403": description: Roundtable policy mutation was not authorized content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /cron: get: summary: List cron jobs responses: "200": description: Cron job list content: application/json: schema: { type: object } /cron/add: post: summary: Add a cron job requestBody: content: application/json: schema: { type: object } responses: "200": description: Cron job created content: application/json: schema: { type: object } /cron/show: post: summary: Show a cron job requestBody: required: true content: application/json: schema: type: object required: [job_id] properties: job_id: { type: string } responses: "200": description: Cron job content: application/json: schema: { type: object } /cron/history: post: summary: Show cron job run history requestBody: required: true content: application/json: schema: type: object required: [job_id] properties: job_id: { type: string } limit: { type: integer } responses: "200": description: Cron run history content: application/json: schema: { type: object } /cron/run: post: summary: Run a cron job now requestBody: required: true content: application/json: schema: type: object required: [job_id] properties: job_id: { type: string } responses: "200": description: Cron run result content: application/json: schema: { type: object } /cron/enable: post: summary: Enable a cron job requestBody: required: true content: application/json: schema: type: object required: [job_id] properties: job_id: { type: string } responses: "200": description: Cron job enabled content: application/json: schema: { type: object } /cron/disable: post: summary: Disable a cron job requestBody: required: true content: application/json: schema: type: object required: [job_id] properties: job_id: { type: string } responses: "200": description: Cron job disabled content: application/json: schema: { type: object } /cron/remove: post: summary: Remove a cron job requestBody: required: true content: application/json: schema: type: object required: [job_id] properties: job_id: { type: string } responses: "200": description: Cron job removed content: application/json: schema: { type: object } /delegate/run: post: summary: Run a delegate task (forced background when invoked remotely; returns job_id to poll) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Delegate run accepted, content: { application/json: { schema: { type: object } } } } } /delegate/log: get: summary: Tail the delegate log responses: { "200": { description: Delegate log, content: { application/json: { schema: { type: object } } } } } /delegate/backend_list: get: summary: List delegate backends responses: { "200": { description: Backend list, content: { application/json: { schema: { type: object } } } } } /delegate/status: post: summary: Status of a delegate job requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Delegate status, content: { application/json: { schema: { type: object } } } } } /delegate/reservation/forget: post: summary: Release a delegate replay reservation (job_id makes it a compare-delete, so a newer job under the same key is not erased) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: "Release outcome; released is false when the reservation was already gone or now names a different job", content: { application/json: { schema: { type: object } } } } } /delegate/cancel_unassigned: post: summary: Cancel a delegate job that was never assigned to a worker, if it has been unassigned for at least min_unassigned_secs requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: "Cancellation outcome; cancelled is false when the job was assigned, already terminal, or not yet old enough", content: { application/json: { schema: { type: object } } } } } /delegate/sandbox/images: get: summary: List build-from-spec sandbox images (aimee-sbx:*) with created time, size, and in-use flag responses: { "200": { description: Sandbox image list, content: { application/json: { schema: { type: object } } } } } /delegate/sandbox/gc: post: summary: Prune sandbox images not referenced by any container and older than max_age_days (keeps the most recent) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: GC report, content: { application/json: { schema: { type: object } } } } } /vault/unlock: post: summary: "Unlock the credential vault over a kernel-attested local or webchat UDS connection" requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Unlocked, content: { application/json: { schema: { type: object } } } } } /vault/rekey: post: summary: Re-key a webuser vault on a login-password change (re-wraps DEKs, no re-encryption) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Re-keyed, content: { application/json: { schema: { type: object } } } } } /vault/set: post: summary: Store an encrypted credential in the unlocked vault requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Stored, content: { application/json: { schema: { type: object } } } } } /vault/set_server: post: summary: Store a credential under the server-owned principal (attested + vault:write:server) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Stored, content: { application/json: { schema: { type: object } } } } } /vault/capability: post: summary: Manage the vault:write:server capability allow-list (UDS-only) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Updated, content: { application/json: { schema: { type: object } } } } } /vault/list: post: summary: List vault credential names (no secrets) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Credential names, content: { application/json: { schema: { type: object } } } } } /vault/delete: post: summary: Remove a credential from the vault requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Deleted, content: { application/json: { schema: { type: object } } } } } /vault/lock: post: summary: Lock the vault (evict the cached key) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Locked, content: { application/json: { schema: { type: object } } } } } /cert/issue: post: summary: Issue an mTLS client cert for a CN (operator-gated; returns cert + one-time key) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Issued, content: { application/json: { schema: { type: object } } } } } /cert/sign: post: summary: Sign a locally generated mTLS client CSR (operator-gated; private key never leaves the client) requestBody: required: true content: application/json: schema: type: object required: [cn, csr] properties: cn: { type: string, minLength: 1 } csr: { type: string, minLength: 1, description: PEM-encoded PKCS#10 CSR } days: { type: integer, minimum: 1, maximum: 3650, default: 90 } responses: "200": description: Signed client certificate content: application/json: schema: type: object required: [status, cn, serial, cert] properties: status: { type: string, enum: [ok] } cn: { type: string } serial: { type: string } cert: { type: string, description: PEM-encoded X.509 certificate } "400": { description: Invalid CSR or request } "403": { description: Operator authorization required } /cert/list: post: summary: List issued mTLS client certs (serial, cn, expiry, revoked) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Certs, content: { application/json: { schema: { type: object } } } } } /cert/revoke: post: summary: Revoke an mTLS client cert by serial (operator-gated) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Revoked, content: { application/json: { schema: { type: object } } } } } /management/action: post: summary: Authorize a management action with mTLS identity and a management JWT description: > Validates the configured issuer, audience, capability, peer identity, request-body digest, and replay-protected JWT ID before dispatch. requestBody: required: true content: application/json: schema: { type: object } responses: "200": description: Management action authorized and dispatched content: application/json: schema: type: object required: [ok, actor, jti] properties: ok: { type: boolean, enum: [true] } actor: { type: string } jti: { type: string } "403": { description: Management action denied } "503": { description: Management control plane is not configured } /delegate/reply: post: deprecated: true summary: Refuse the retired delegate reply protocol description: > Compatibility endpoint only; no reply is delivered or acknowledged. Canonical pending questions are answered by an authenticated browser operator through /chat/control-reply using the exact session_id and turn-qualified request_id. Delegation IDs do not authorize answers. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "502": { description: Retired reply protocol is unavailable, content: { application/json: { schema: { $ref: '#/components/schemas/ErrorResponse' } } } } } /delegate/launch: post: summary: Launch a delegate job (async, returns job_id) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Launched, content: { application/json: { schema: { type: object } } } } } /delegate/backend_exec: post: summary: Execute via a delegate backend requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Exec result, content: { application/json: { schema: { type: object } } } } } /job/list: get: summary: List jobs responses: { "200": { description: Job list, content: { application/json: { schema: { type: object } } } } } /job/start: post: summary: Start a job (async, returns job_id) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Started, content: { application/json: { schema: { type: object } } } } } /job/status: post: summary: Job status requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Job status, content: { application/json: { schema: { type: object } } } } } /job/cancel: post: summary: Cancel a job requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Cancelled, content: { application/json: { schema: { type: object } } } } } /jobs/list: get: summary: List durable background jobs responses: { "200": { description: Job list, content: { application/json: { schema: { type: object } } } } } /jobs/status: post: summary: Durable job status requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Job status, content: { application/json: { schema: { type: object } } } } } /jobs/logs: post: summary: Durable job logs requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Job logs, content: { application/json: { schema: { type: object } } } } } /jobs/cancel: post: summary: Cancel a durable job requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Cancelled, content: { application/json: { schema: { type: object } } } } } /model/list: get: summary: List configured models responses: { "200": { description: Model list, content: { application/json: { schema: { type: object } } } } } /audit/verify: get: summary: Verify the WORM audit chain + checkpoint MACs (green/amber/red) responses: { "200": { description: Verify result, content: { application/json: { schema: { type: object } } } } } /audit/checkpoint: post: summary: Append a checkpoint committing the current WORM chain head responses: { "200": { description: Checkpoint result, content: { application/json: { schema: { type: object } } } } } /audit/seal: post: summary: Export an immutable, verifiable snapshot of the WORM store responses: { "200": { description: Seal result, content: { application/json: { schema: { type: object } } } } } /audit/snapshot: post: summary: Append a hash-chained metric.snapshot row responses: { "200": { description: Snapshot result, content: { application/json: { schema: { type: object } } } } } /audit/captures: get: summary: List the audit-on-bus capture files (recorded governed-action event streams) available for replay responses: { "200": { description: Capture file list, content: { application/json: { schema: { type: object } } } } } /audit/replay: post: summary: Replay one audit-on-bus capture file's governed-action rows as JSON (paged; observational) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Replay page, content: { application/json: { schema: { type: object } } } } } /model/local: get: summary: List local agents responses: { "200": { description: Local agent list, content: { application/json: { schema: { type: object } } } } } /model/add: post: summary: Add an agent requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Agent added, content: { application/json: { schema: { type: object } } } } } /model/remove: post: summary: Remove an agent requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Agent removed, content: { application/json: { schema: { type: object } } } } } /model/enable: post: summary: Enable an agent requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Agent enabled, content: { application/json: { schema: { type: object } } } } } /model/disable: post: summary: Disable an agent requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Agent disabled, content: { application/json: { schema: { type: object } } } } } /model/roles: post: summary: Set an agent's roles requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Agent roles updated, content: { application/json: { schema: { type: object } } } } } /model/personas: post: summary: Set the personas an agent may be dispatched as ("all" = every persona) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Agent personas updated, content: { application/json: { schema: { type: object } } } } } /model/set: post: summary: Surgically patch only the provided fields of an existing agent (model, endpoint, provider, cost_tier, max_turns, max_parallel, context_window, tools, inject-respond-tool, roles, personas, enabled, key) description: CLI-style args accept --inject-respond-tool on|off to explicitly set respond-tool injection independently of tools. This explicit value overrides coupling from a simultaneous --tools toggle. Without it, unchanged tools preserves the existing injection policy; an actual tools toggle retains legacy coupling. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Updated agent record, content: { application/json: { schema: { type: object } } } } } /model/probe: post: summary: Probe an agent/provider requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Probe result, content: { application/json: { schema: { type: object } } } } } /model/stats: get: summary: Per-delegate run statistics responses: { "200": { description: Per-delegate run stats, content: { application/json: { schema: { type: object } } } } } /economizer/stats: get: summary: Economizer telemetry (gateway mutation counters, tool-condense savings, avoided-$) responses: { "200": { description: Economizer stats, content: { application/json: { schema: { type: object } } } } } /model/draft: post: summary: One-shot tool-free text generation (proposal drafting) via a non-CLI delegate requestBody: { required: true, content: { application/json: { schema: { $ref: '#/components/schemas/ProposalDraftRequest' } } } } responses: { "200": { description: "{text, agent}", content: { application/json: { schema: { type: object } } } } } /model/generate: post: summary: One-shot tool-free canonical text completion for evaluation description: > Accepts {ir} with an aimee.request.v1 request containing one caller system text block and one user text block, explicit max_tokens and temperature, no tools, and tool_choice none. Caller instructions and retrieved evidence must retain unverified provenance. Other controls are refused. Selects the configured default HTTP delegate without hints, tool execution or feedback. requestBody: { required: true, content: { application/json: { schema: { type: object, additionalProperties: false, required: [ir], properties: { ir: { type: object } } } } } } responses: { "200": { description: "{status, ir}; ir is a complete aimee.response.v1 text answer", content: { application/json: { schema: { type: object } } } } } /model/setup: post: summary: Set up an agent (async) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Setup started, content: { application/json: { schema: { type: object } } } } } /model/setup_poll: post: summary: Poll agent setup progress requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Setup status, content: { application/json: { schema: { type: object } } } } } /model/cli_oauth_start: post: summary: Install a vendor CLI on the server and start its OAuth login (claude/codex) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Verification URL + code, content: { application/json: { schema: { type: object } } } } } /model/cli_oauth_code: post: summary: Submit the operator-pasted code into a server-side CLI OAuth login (claude) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Submitted, content: { application/json: { schema: { type: object } } } } } /model/cli_oauth_poll: post: summary: Poll a server-side CLI OAuth login; register the agent on success requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Login state, content: { application/json: { schema: { type: object } } } } } /model/episodes: post: summary: List an agent's episodes requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Episode list, content: { application/json: { schema: { type: object } } } } } /agent/list: get: summary: Roster list (deprecated alias of /model/list) responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/local: get: summary: Roster local (deprecated alias of /model/local) responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/add: post: summary: Roster add (deprecated alias of /model/add) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/remove: post: summary: Roster remove (deprecated alias of /model/remove) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/enable: post: summary: Roster enable (deprecated alias of /model/enable) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/roles: post: summary: Roster roles (deprecated alias of /model/roles) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/personas: post: summary: Roster personas (deprecated alias of /model/personas) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/set: post: summary: Roster set (deprecated alias of /model/set) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/disable: post: summary: Roster disable (deprecated alias of /model/disable) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/probe: post: summary: Roster probe (deprecated alias of /model/probe) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/stats: get: summary: Roster stats (deprecated alias of /model/stats) responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/draft: post: summary: Roster draft (deprecated alias of /model/draft) requestBody: { required: true, content: { application/json: { schema: { $ref: '#/components/schemas/ProposalDraftRequest' } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/setup: post: summary: Roster setup (deprecated alias of /model/setup) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/setup_poll: post: summary: Roster setup_poll (deprecated alias of /model/setup_poll) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/cli_oauth_start: post: summary: Roster cli_oauth_start (deprecated alias of /model/cli_oauth_start) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/cli_oauth_code: post: summary: Roster cli_oauth_code (deprecated alias of /model/cli_oauth_code) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/cli_oauth_poll: post: summary: Roster cli_oauth_poll (deprecated alias of /model/cli_oauth_poll) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /agent/episodes: post: summary: Roster episodes (deprecated alias of /model/episodes) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: OK, content: { application/json: { schema: { type: object } } } } } /episode/list: get: summary: List episodes responses: { "200": { description: Episode list, content: { application/json: { schema: { type: object } } } } } /provider/list: get: summary: List providers responses: { "200": { description: Provider list, content: { application/json: { schema: { type: object } } } } } /provider/connections: get: summary: List saved provider connections responses: { "200": { description: Connections with model counts, content: { application/json: { schema: { type: object } } } } } /provider/connection_models: get: summary: Discover models on a saved provider connection parameters: - { name: name, in: query, required: true, schema: { type: string } } responses: { "200": { description: Discovered model IDs, content: { application/json: { schema: { type: object } } } } } /provider/save_connection: post: summary: Create or edit a saved provider connection description: Connection names are unique. Editing preserves the credential when api_key is empty and updates inherited connection settings on its models. A connection also owns its execution transport. Choose backend provider-cli with cli_kind codex to use the Codex agent, or backend http for the direct model API. Switching to http clears native execution settings. requestBody: { required: true, content: { application/json: { schema: { type: object, required: [name, provider], properties: { name: { type: string }, provider: { type: string }, endpoint: { type: string }, api_key: { type: string, writeOnly: true }, auth_type: { type: string }, backend: { type: string, enum: [http, provider-cli] }, cli_kind: { type: string }, cli_cmd: { type: string }, session_reuse: { type: boolean }, create: { type: boolean, default: false } } } } } } responses: { "200": { description: Saved connection or typed error, content: { application/json: { schema: { type: object } } } } } /provider/remove_connection: post: summary: Delete a saved provider connection and its models description: Removes the connection's saved credentials and repairs model role selections. requestBody: { required: true, content: { application/json: { schema: { type: object, required: [name], properties: { name: { type: string } } } } } } responses: { "200": { description: Deletion result or typed error, content: { application/json: { schema: { type: object } } } } } /provider/models: get: summary: List provider models responses: { "200": { description: Provider models, content: { application/json: { schema: { type: object } } } } } /provider/get: post: summary: Get a provider requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Provider, content: { application/json: { schema: { type: object } } } } } /provider/show: post: summary: Show a provider requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Provider, content: { application/json: { schema: { type: object } } } } } /provider/set: post: summary: Set provider configuration requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Updated, content: { application/json: { schema: { type: object } } } } } /provider/quota: post: summary: Provider quota requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Quota, content: { application/json: { schema: { type: object } } } } } /provider/test: post: summary: Test a provider requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Test result, content: { application/json: { schema: { type: object } } } } } /catalog/list: get: summary: List catalogued models responses: { "200": { description: Model list, content: { application/json: { schema: { type: object } } } } } /catalog/show: get: summary: Show a catalogued model responses: { "200": { description: Model, content: { application/json: { schema: { type: object } } } } } /catalog/refresh: post: summary: Refresh the model catalog requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Refreshed, content: { application/json: { schema: { type: object } } } } } /api/status: get: summary: HTTP API status responses: { "200": { description: API status, content: { application/json: { schema: { type: object } } } } } /api/enable: post: summary: Enable the HTTP API requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Enabled, content: { application/json: { schema: { type: object } } } } } /api/rotate_bearer: post: summary: Mint and hot-swap a fresh /v1 bearer (trust-on-first-use enrollment; retires the bootstrap token) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Rotated, content: { application/json: { schema: { type: object } } } } } /api/enroll_bearer: post: summary: Mint an ADDITIONAL /v1 bearer for one more client, leaving existing bearers valid description: > Pairs a new client without revoking anyone else. Prefer this over /api/rotate_bearer, which replaces the single primary bearer and so invalidates every already-paired client at once. Fails closed when the enrolled-bearer limit is reached rather than evicting an in-use credential. Returns the new token once. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Enrolled, content: { application/json: { schema: { type: object } } } } } /api/disable: post: summary: Disable the HTTP API requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Disabled, content: { application/json: { schema: { type: object } } } } } /dashboard/all: get: summary: Full dashboard snapshot responses: { "200": { description: Dashboard, content: { application/json: { schema: { type: object } } } } } /dashboard/audit: get: summary: Tool-action audit ledger (guardrail verdicts) for the Logs page responses: { "200": { description: Audit, content: { application/json: { schema: { type: object } } } } } /dashboard/delegations: get: summary: Delegation dashboard responses: { "200": { description: Delegations, content: { application/json: { schema: { type: object } } } } } /dashboard/logs: get: summary: Dashboard logs responses: { "200": { description: Logs, content: { application/json: { schema: { type: object } } } } } /dashboard/memory_stats: get: summary: Memory statistics dashboard responses: { "200": { description: Memory stats, content: { application/json: { schema: { type: object } } } } } /dashboard/metrics: get: summary: Metrics dashboard responses: { "200": { description: Metrics, content: { application/json: { schema: { type: object } } } } } /dashboard/onboard: get: summary: Onboarding dashboard responses: { "200": { description: Onboarding, content: { application/json: { schema: { type: object } } } } } /dashboard/plans: get: summary: Plans dashboard responses: { "200": { description: Plans, content: { application/json: { schema: { type: object } } } } } /dashboard/traces: get: summary: Traces dashboard responses: { "200": { description: Traces, content: { application/json: { schema: { type: object } } } } } /insights/overview: get: summary: Insights overview description: >- Usage and cost summary over the requested window. Cost is reported with explicit spend semantics: the top-level estimated_cost_usd is the legacy all-rows figure (kept for backwards compatibility), while the spend object breaks cost down by usage_kind so realized provider-reported spend is separated from estimated, avoided (dedup-skipped), and partial (aborted) rows. spend.total is the billable figure and includes REALIZED rows only. Estimated, avoided, and partial are reported individually but excluded from the total. responses: "200": description: Insights content: application/json: schema: type: object properties: status: { type: string } days: { type: integer } total_calls: { type: integer } prompt_tokens: { type: integer } completion_tokens: { type: integer } cache_write_tokens: { type: integer } cache_read_tokens: { type: integer } estimated_cost_usd: type: number description: Legacy all-rows estimated cost; prefer spend.total for billable spend. spend: type: object description: Cost broken down by usage_kind (§ ingress cost-accounting). properties: realized: { type: number, description: Provider-reported usage (the billable spend). } estimated: { type: number, description: No provider usage; aimee-estimated. Not in total. } avoided: { type: number, description: Dedup-skipped; not counted as spend. } partial: { type: number, description: Aborted mid-stream; not counted as spend. } total: { type: number, description: Billable realized total. Excludes estimated, avoided, and partial rows. } models: type: array items: type: object properties: model: { type: string } calls: { type: integer } prompt_tokens: { type: integer } completion_tokens: { type: integer } estimated_cost_usd: { type: number } sources: type: array description: Per turn-origin (internal agent vs ingress surfaces). items: type: object properties: source: { type: string } calls: { type: integer } prompt_tokens: { type: integer } completion_tokens: { type: integer } estimated_cost_usd: { type: number } /optimize/export: get: summary: Bandit optimization export (decision-point registry, arm baselines, decision log) description: Includes live and static optimization points such as kb_fusion_mode, delegate_routing, briefing_style, and guardrail_strictness. Static points are promotion/replay driven until an automatic reward loop is validated. responses: { "200": { description: Optimization export, content: { application/json: { schema: { type: object } } } } } /optimize/promote: post: summary: Persist the production-default arm for a decision point requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Promotion result, content: { application/json: { schema: { type: object } } } } } /optimize/replay-record: post: summary: Record off-policy bandit replay attribution as a benchmark_trace artifact requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Replay record result, content: { application/json: { schema: { type: object } } } } } /calibration/readiness: get: summary: Calibration readiness report responses: { "200": { description: Calibration readiness, content: { application/json: { schema: { type: object } } } } } /demotion/check: get: summary: Demotion dry-run report responses: { "200": { description: Demotion check, content: { application/json: { schema: { type: object } } } } } /intelligence/ranker/export-view: get: summary: Export the learning-to-rank training view + wiring-gap diagnostic responses: { "200": { description: Ranker training view, content: { application/json: { schema: { type: object } } } } } /intelligence/ranker/fit: post: summary: Fit + benchmark-gate the KB-hybrid ranker model requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Ranker fit report, content: { application/json: { schema: { type: object } } } } } /identity/show: get: summary: Show current identity responses: { "200": { description: Identity, content: { application/json: { schema: { type: object } } } } } /identity/diff: post: summary: Diff identity snapshots requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Identity diff, content: { application/json: { schema: { type: object } } } } } /identity/snapshot: post: summary: Snapshot current identity requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Snapshot, content: { application/json: { schema: { type: object } } } } } /dogfood/report: get: summary: Dogfood report responses: { "200": { description: Report, content: { application/json: { schema: { type: object } } } } } /dogfood/review: post: summary: Dogfood review requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Review, content: { application/json: { schema: { type: object } } } } } /dogfood/tag: post: summary: Tag a dogfood item requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Tagged, content: { application/json: { schema: { type: object } } } } } /lsp/diagnostics_summary: post: summary: LSP diagnostics summary requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Diagnostics, content: { application/json: { schema: { type: object } } } } } /curator/contradictions: post: summary: Curator contradictions for an entity requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Contradictions, content: { application/json: { schema: { type: object } } } } } /curator/implements: post: summary: Curator implements relations requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Implements, content: { application/json: { schema: { type: object } } } } } /curator/invalidated: post: summary: Curator invalidated claims requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Invalidated, content: { application/json: { schema: { type: object } } } } } /curator/stages: post: summary: Curator pipeline stage registry (name/label/lane/order/config_key) for the GUI requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Stage registry, content: { application/json: { schema: { type: object } } } } } /graph/explain: post: summary: Explain a graph relationship requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Explanation, content: { application/json: { schema: { type: object } } } } } /trajectory/batch: post: summary: Export canonical histories from batch executions description: >- Executes under an owned parent session and exports each actual private execution's canonical history. The transport-attested principal owns the parent and child sessions; request data cannot select another owner. requestBody: required: true content: application/json: schema: type: object required: [session_id, tasks_path] properties: session_id: { type: string, description: Existing session owned by the authenticated caller } tasks_path: { type: string } toolset_dist: { type: string } out_dir: { type: string } compress: { type: boolean } max_result_bytes: { type: integer, minimum: 1 } responses: { "200": { description: Batch result with canonical execution session references, content: { application/json: { schema: { type: object } } } } } /wm/context: post: summary: Working-memory context requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Context, content: { application/json: { schema: { type: object } } } } } /wm/get: post: summary: Get a working-memory entry requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Entry, content: { application/json: { schema: { type: object } } } } } /skills/autostub: post: summary: Autostub a skill requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Stubbed, content: { application/json: { schema: { type: object } } } } } /skills/eval: post: summary: Evaluate a skill requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Eval result, content: { application/json: { schema: { type: object } } } } } /skills/eval-exec: post: summary: Run bounded executable held-out trials for a skill requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Executable eval result, content: { application/json: { schema: { type: object } } } } } /skills/lifecycle: post: summary: Skill lifecycle action requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Lifecycle result, content: { application/json: { schema: { type: object } } } } } /skills/lint: post: summary: Lint a skill requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Lint result, content: { application/json: { schema: { type: object } } } } } /skills/patch: post: summary: Patch a skill requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Patched, content: { application/json: { schema: { type: object } } } } } /skills/unpin: post: summary: Unpin a skill requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Unpinned, content: { application/json: { schema: { type: object } } } } } /sessions/create: post: summary: Create a session requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Session, content: { application/json: { schema: { type: object } } } } } /sessions/record_transcript: post: summary: Persist a session's conversation transcript to DB1 under its host id requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Recorded, content: { application/json: { schema: { type: object } } } } } /sessions/close: post: summary: Close a session requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Closed, content: { application/json: { schema: { type: object } } } } } /sessions/get: post: summary: Get a session requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Session, content: { application/json: { schema: { type: object } } } } } /sessions/list: post: summary: List durable sessions requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Sessions, content: { application/json: { schema: { type: object } } } } } /sessions/brief: post: summary: Session startup brief requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Brief, content: { application/json: { schema: { type: object } } } } } /sessions/presence: get: summary: Presence overview across sessions responses: { "200": { description: Presence, content: { application/json: { schema: { type: object } } } } } /toolsets/resolve: post: summary: Resolve a toolset requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Resolved toolset, content: { application/json: { schema: { type: object } } } } } /blast_radius/preview: post: summary: Preview the blast radius of a change requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Blast radius, content: { application/json: { schema: { type: object } } } } } /mcp/tools_list: get: summary: List MCP tools responses: { "200": { description: MCP tools, content: { application/json: { schema: { type: object } } } } } /mcp/tools_wait: post: summary: Wait for the MCP tool list to change description: > Answers once the tool-list generation differs from the caller's `generation`, or after `timeout_ms` (at most 290000), so an MCP bridge holds one request open instead of listing tools on a timer. A server already holding its maximum of waiters answers at once with `busy`. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Current generation, content: { application/json: { schema: { type: object } } } } } /mcp/audit: post: summary: Audit MCP servers requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Audit, content: { application/json: { schema: { type: object } } } } } /mcp/recheck: post: summary: Recheck MCP servers requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Rechecked, content: { application/json: { schema: { type: object } } } } } /mcp/call: post: summary: Call an MCP tool requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Call result, content: { application/json: { schema: { type: object } } } } } /help: post: summary: Read the built-in help index or a named help topic description: Read-only narrow endpoint; it always dispatches get_help regardless of any tool field in the request. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Help content, content: { application/json: { schema: { type: object } } } } } /workspaces/context: post: summary: Workspace context requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Context, content: { application/json: { schema: { type: object } } } } } /worktree/gc: post: summary: Garbage-collect delegate worktrees requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Collected, content: { application/json: { schema: { type: object } } } } } /aux/test: post: summary: Test the auxiliary model requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Test result, content: { application/json: { schema: { type: object } } } } } /eval/results: get: summary: Evaluation results responses: { "200": { description: Eval results, content: { application/json: { schema: { type: object } } } } } /learning/approaches: post: summary: Approaches that already failed against a similar goal requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Recalled dead ends, content: { application/json: { schema: { type: object } } } } } /learning/attribution: get: summary: Measured per-capability contribution from the ablation grid responses: { "200": { description: Attribution per ablation arm, content: { application/json: { schema: { type: object } } } } } /learning/fate: post: summary: Record what became of a committed learning proposal requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Recorded fate, content: { application/json: { schema: { type: object } } } } } /learning/resolve: post: summary: Resolve curiosity-backlog gaps that the corpus now answers requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Resolution counts, content: { application/json: { schema: { type: object } } } } } /eval/candidates: get: summary: Synthesised regression candidates and the admission gate responses: { "200": { description: Candidate list, content: { application/json: { schema: { type: object } } } } } post: summary: Scan, admit, reject, or retire regression candidates requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Update result, content: { application/json: { schema: { type: object } } } } } /pipeline/list: get: summary: List roundtable authoring pipelines responses: { "200": { description: Pipeline list, content: { application/json: { schema: { type: object } } } } } /pipeline/status: post: summary: Roundtable authoring pipeline status requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Pipeline status, content: { application/json: { schema: { type: object } } } } } /pipeline/start: post: summary: Start a roundtable authoring pipeline requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Started pipeline, content: { application/json: { schema: { type: object } } } } } /pipeline/cancel: post: summary: Cancel a roundtable authoring pipeline requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Cancel result, content: { application/json: { schema: { type: object } } } } } /pipeline/resume: post: summary: Resume a roundtable authoring pipeline requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Resume result, content: { application/json: { schema: { type: object } } } } } /pipeline/advance: post: summary: Advance a roundtable authoring pipeline to its next phase description: >- Returns the next action for the caller (advance, revise, escalate) after recording the current pass. Capability: delegate. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Advance result, content: { application/json: { schema: { type: object } } } } } /pipeline/gate: post: summary: Record a human gate verdict on a roundtable authoring pipeline description: >- Verdict is pass or fail. Gate authority is checked against the active local operator. Capability: delegate. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Gate result, content: { application/json: { schema: { type: object } } } } } /trigger/list: get: summary: List triggers responses: { "200": { description: Trigger list, content: { application/json: { schema: { type: object } } } } } /trigger/status: post: summary: Trigger status requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Status, content: { application/json: { schema: { type: object } } } } } /trigger/fire: post: summary: Fire a trigger requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Fired, content: { application/json: { schema: { type: object } } } } } /trigger/cancel: post: summary: Cancel a trigger requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Cancelled, content: { application/json: { schema: { type: object } } } } } /init/run: post: summary: Run project initialization requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Init result, content: { application/json: { schema: { type: object } } } } } /launch/run: post: summary: Run a launch configuration requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Launch result, content: { application/json: { schema: { type: object } } } } } /server/info: get: summary: Server info responses: { "200": { description: Server info, content: { application/json: { schema: { type: object } } } } } /server/health: get: summary: Server health (RPC twin) responses: { "200": { description: Health, content: { application/json: { schema: { type: object } } } } } /workers: get: summary: Server worker-pool status description: >- Occupancy of the server's thread pools: the request and compute pools, per-session pools, on-demand delegate threads, any ephemeral secondary pools, and aimee-kb connection workers. Read-only. Capability: dashboard:read. responses: { "200": { description: Worker-pool status, content: { application/json: { schema: { type: object } } } } } /server/forensics: get: summary: Recent server shutdown forensics description: >- Privileged, read-only access to recent clean-signal and inferred unclean-exit records from the server host. Capability: tool:execute. responses: "200": description: Recent shutdown records, newest first content: application/json: schema: type: object properties: recent_shutdowns: type: array items: { type: object } "403": description: Insufficient capability content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /kb/build: post: summary: Build the knowledge base (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /kb/ingest: post: summary: Ingest a corpus into the knowledge base (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /kb/update: post: summary: Update the knowledge base (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /kb/reembed: post: summary: Reset and re-embed the vector store after a dimension change (async; poll GET /runs/{id}) description: >- Drops and recreates every derived vector table at the configured embedding dimension, then requeues the corpus. Gated by kb.reembed_on_dim_change in aimee-kb's own config; without confirm it returns a dry-run plan naming each table and row count. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /memory/embed: post: summary: (Re)generate memory embeddings (async; poll GET /runs/{id}) description: >- Embeds a single memory (memory_id) or the whole corpus (all=true, which requires a rollover version). Needed after a dimension change, which drops memory vectors without requeueing them. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /kb/docs/push: post: summary: Push document contents into the knowledge base (async; poll GET /runs/{id}) description: >- Upload document bytes from the caller's workspace into the knowledge base. The workspace-owning tier reads the files and streams their content to aimee-kb, so a stateless/remote aimee-kb that cannot see the caller's filesystem still ingests them (unlike the path-forwarding kb.build). requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /graph/sync_code: post: summary: Sync the code graph (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /index/verify: post: summary: Compare a workspace with its published canonical index without mutating either description: >- Performs a read-only manifest comparison. Set deep=true to hash file contents; otherwise verification uses the stored manifest metadata. The response distinguishes current index state from matched, modified, missing, and unavailable workspace state. requestBody: required: true content: application/json: schema: type: object required: [project, root] properties: project: { type: string } root: { type: string } deep: { type: boolean, default: false } responses: "200": { description: Verification result, content: { application/json: { schema: { type: object } } } } "400": { description: Missing or invalid project/root } "503": { description: Canonical index unavailable } /index/scan: post: summary: Scan/re-index the codebase (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /index/ingest: post: summary: Index client-pushed workspace files (async; poll GET /runs/{id}) description: >- Index a project from file contents supplied by the caller, used by the thin client to ingest a workspace whose root lives on the client and is not visible to the server (a `detached` workspace). The server relays the supplied {rel_path, content} entries to aimee-kb without reading any local filesystem. Complete snapshots use begin, one or more stage requests, and seal; staged files remain private until seal atomically publishes the manifest. The legacy files-only request remains supported as an incremental update. requestBody: required: true content: application/json: schema: type: object required: [name, root] anyOf: - required: [files] - required: [phase, scan_id] properties: name: { type: string } root: { type: string } force: { type: boolean } phase: type: string enum: [begin, stage, seal, abort] scan_id: type: string description: Client-generated identifier shared by every phase of one scan. expected_files: type: integer minimum: 0 description: Required for seal; must equal the distinct files staged. files: type: array description: Required for legacy and stage requests. items: type: object required: [rel_path, content] properties: rel_path: { type: string } content: { type: string } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /memory/benchmark: post: summary: Run a memory retrieval benchmark description: >- Runs synchronous retrieval suites through the server-side memory.benchmark handler. Supported sync suites are code-graph-fusion, memory, corpus, memory-retrieval, and live. Dataset or judge-style suites such as locomo, longmemeval, locomo-qa, and longmemeval-qa return an async-only envelope with the CLI/delegate route to run them. requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Benchmark result or async-only envelope, content: { application/json: { schema: { type: object } } } } } /curator/synthesize: post: summary: Run curator synthesis/extraction (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /rules/generate: post: summary: Generate collaboration rules via LLM (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /eval/run: post: summary: Run an evaluation (async; poll GET /runs/{id}) requestBody: { content: { application/json: { schema: { type: object } } } } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /delegate/aggregate: post: summary: Mixture-of-Agents ensemble aggregate over ensemble.reference_models (async; poll GET /runs/{id}) requestBody: required: true content: application/json: schema: type: object required: [prompt] properties: prompt: { type: string } responses: { "200": { description: Queued op run, content: { application/json: { schema: { type: object } } } } } /roundtable/review: post: summary: Review a complete artifact through the resolved roundtable requestBody: required: true content: application/json: schema: type: object required: [artifact] properties: artifact: { type: string } original_request: { type: string } artifact_stage: { type: string, enum: [intent, plan, frozen_diff] } roundtable: { type: string } workdir: { type: string } run_id: { type: string } responses: "200": description: Completed roundtable review with structured findings and participant accounting. content: application/json: schema: { type: object } /memory/receipt/forget: post: summary: Remove the authenticated principal's encrypted replay payloads for a request description: Requires memory write authority. Preserves the durable receipt and its chain inclusion. requestBody: required: true content: application/json: schema: type: object required: [request_id] properties: request_id: { type: string, minLength: 1, maxLength: 256 } responses: "200": description: Removal status for each attempt, including explicit pending failures content: application/json: schema: { type: object } /memory/health: post: summary: Aggregate the authenticated principal's receipt-backed retrieval health description: >- The 1.1 memory module keeps no retrieval health journal and answers with a typed `disabled` error; AIMEE_MEMORY_HEALTH_ENABLED is no longer read. The collection described below is the retired 1.0 behaviour. It scanned at most 256 principal-owned requests through a verified local ledger head, reconciles attempts into bounded private PostgreSQL state, and reports one exact project/workspace/purpose/query-class population. Windows use prepared-at timestamps with stages reconciled through the verified ledger snapshot. Windows up to 12 hours also scan an adjacent baseline; longer comparisons exceed the 24-hour retention bound. Alerts require complete unsampled windows and at least 30 labels per window, and describe observed adverse rate changes rather than statistical significance. Concentration alone never triggers an alert. No cross-principal aggregation is offered. Raw queries, memory text, record IDs, family IDs and task IDs are not returned. Older receipts with missing metadata report unknown metrics. Truncation, import failures, unknown dispatch and incomplete windows are explicit. Required receipts and serving decisions are unchanged when collection is disabled. requestBody: content: application/json: schema: type: object properties: window: { type: string, default: 24h, description: Positive Go duration at most 24 hours. } traces: { type: boolean, default: false, description: Include at most 16 receipt references owned by this principal in the exact report population. } project: { type: string, default: '' } workspace: { type: string, default: '' } purpose: { type: string, default: provider_input } query_class: { type: string, default: unclassified } stage: { type: string, enum: [dispatched, assembled_unsent, unknown_dispatch, network_uncertain], default: dispatched } responses: "200": description: Aggregate, collection coverage and readable text, or explicit disabled/unavailable state content: application/json: schema: { type: object } /learning/application: post: summary: Attribute explicit user feedback to a delivered procedure version description: >- The server reads the authenticated principal's existing provider receipt. It accepts no caller-supplied exposure or chain-integrity claim. Learning validates application and verifier evidence, records immutable events, and returns versioned experience. Model self-reports cannot establish application or success. No fitted policy or canonical procedure is changed. requestBody: required: true content: application/json: schema: type: object required: [request_id] properties: request_id: { type: string, minLength: 1, maxLength: 256 } event: { type: object, description: Version 1 learning ProcedureEvent with authority user_feedback. } event_json: { type: string, maxLength: 65536, description: CLI encoding of event; use event for structured clients. } responses: "200": description: Governed event reference and experience, or explicit refusal content: application/json: schema: { type: object } /learning/task_cost: post: summary: Report declared complete-task costs through economizer description: >- Returns actual and estimated nanodollars separately, every unpriced call, stage coverage and attempt identities. Integer amounts are decimal strings. Caller-declared completeness is not independently verified completeness. This observe-only report never admits a cost intervention or claims savings. requestBody: required: true content: application/json: schema: type: object properties: cost: { type: object, description: Economizer version 1 TaskCostRequest. } cost_json: { type: string, maxLength: 2097152, description: CLI encoding of cost. } responses: "200": description: Cost report or explicit refusal content: application/json: schema: { type: object } /memory/receipt: post: summary: Inspect the authenticated principal's durable provider attempt receipts description: >- Returns bounded complete attempt stages from the local WORM ledger. Distinguishes resolved preparation without dispatch, active ownership, admitted uncertainty and acknowledged transport. Commitment-only receipts cannot reconstruct payloads. Ledger inclusion, local checkpoint status, source availability and external effect confirmation are independent. requestBody: required: true content: application/json: schema: type: object required: [request_id] properties: request_id: { type: string, minLength: 1, maxLength: 256 } replay: { type: boolean, default: false, description: Return available matching retained payload bytes as base64. } responses: "200": description: Receipt stages or an explicit unavailable response content: application/json: schema: { type: object } /memory/validity: post: summary: Inspect the serving eligibility decision for one memory description: >- Requires an authenticated user diagnostic purpose. Reports the serving predicate, checked revision and exclusion reasons without memory text. Missing and unauthorized records have the same response. Evidence and authority remain unknown unless established separately. This observation does not authorize a later provider dispatch. Historical mode requires an absolute valid_at and is currently supported by the KB placement; unsupported temporal reconstruction returns unsupported_mode. requestBody: required: true content: application/json: schema: type: object additionalProperties: false required: [id] properties: id: { type: string, pattern: '^[1-9][0-9]*$' } store: { type: string, enum: [user, kb], default: user } mode: { type: string, enum: [current, historical], default: current } valid_at: { type: string } believed_at: { type: string, description: Unsupported reconstruction is refused explicitly. } project: { type: string } workspace: { type: string } scope: type: object required: [type] properties: type: { type: string, enum: [global, project, workspace] } value: { type: string } responses: "200": description: Versioned eligibility decision; no record payload content: application/json: schema: { type: object } "400": description: Invalid arguments or unsupported temporal mode content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "401": description: Diagnostic purpose not authorized content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Memory owner unavailable; no fallback decision content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/hygiene: post: summary: Inspect bounded hygiene findings and queue review proposals description: >- Dry runs create no proposals. Normal runs queue immutable, version-bound learning proposals; neither mode changes canonical memory. Row and content limits bound the compared window; partial coverage and unvisited content are explicit. Findings carry expected source versions and remain candidates requiring review. No auto-apply mode is available. requestBody: required: true content: application/json: schema: type: object additionalProperties: false required: [scope] properties: dry_run: { type: boolean, default: false } cursor: { type: string, maxLength: 4096, description: "Owner/scope/generation-bound continuation; changed evidence requires restarting the scan." } scope: type: object required: [type, value] properties: type: { type: string, enum: [project, workspace, global] } value: { type: string, minLength: 1, maxLength: 1024, description: "Explicit scope value; global requires _global." } max_rows: { type: integer, minimum: 1, maximum: 128, default: 64 } max_content_bytes: { type: integer, minimum: 1, maximum: 32768, default: 16384 } responses: "200": description: Bounded findings with scope, revisions, budgets, coverage and proposal receipts content: application/json: schema: { type: object } "400": description: Invalid scope, budgets, mutation option or unsupported argument content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Owner unavailable; no coverage result is asserted content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/search: post: summary: Keyword-search memories requestBody: required: true content: application/json: schema: type: object required: [keywords] properties: keywords: { type: array, minItems: 1, maxItems: 16, items: { type: string, minLength: 1 } } limit: { type: integer, minimum: 1, maximum: 32 } cwd: { type: string } project: { type: string } workspace: { type: string } scope: { type: string, enum: [all] } responses: "200": description: Memory search envelope content: application/json: schema: { type: object } "400": description: Missing keywords or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Knowledge service unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/list: post: summary: List memories by tier/kind requestBody: content: application/json: schema: type: object properties: tier: { type: string } kind: { type: string } limit: { type: integer } cwd: { type: string } project: { type: string } workspace: { type: string } responses: "200": description: Memory list envelope content: application/json: schema: { type: object } /memory/review: post: summary: List human-reviewable memories, including retained inactive rows description: Scope is explicit or derived from cwd; ordinary recall remains active-only. requestBody: content: application/json: schema: type: object properties: cwd: { type: string } project: { type: string } workspace: { type: string } scope: { type: string, enum: [all] } state: { type: string, enum: [active, pending, rejected, archived, fulfilled, superseded] } limit: { type: integer, minimum: 1, maximum: 256 } responses: "200": description: Review rows with lifecycle, scope, content, reason, and timestamps content: application/json: schema: { type: object } /memory/correction_proposals: post: summary: Inspect correction drafts outside recall description: Select store=user for private drafts or store=kb for scoped shared drafts. The default is kb. requestBody: content: application/json: schema: type: object properties: store: { type: string, enum: [user, kb], default: kb } proposal_id: { type: string, format: uuid } limit: { type: integer, minimum: 1, maximum: 100, default: 50 } project: { type: string } workspace: { type: string } scope: { type: string, enum: [all] } responses: "200": description: Draft references; an exact proposal_id also includes its screened payload content: application/json: schema: { type: object } /memory/review_correction: post: summary: Approve or reject an exact correction draft description: Requires authenticated user authority, an exact target version and payload digest. Approval preserves model authorship and confidence; retries reuse the durable decision. requestBody: required: true content: application/json: schema: type: object required: [proposal_id, payload_digest, expected_version, action] properties: store: { type: string, enum: [user, kb], default: kb } proposal_id: { type: string, format: uuid } payload_digest: { type: string, pattern: '^[0-9a-f]{64}$' } expected_version: { type: object } action: { type: string, enum: [approve, reject] } project: { type: string } workspace: { type: string } scope: { type: string, enum: [all] } responses: "200": description: Durable review decision and resulting version when approved content: application/json: schema: { type: object } "409": description: Draft, target version or prior decision no longer matches /memory/reject: post: summary: Reject a memory and create a durable exact-value tombstone description: Requires memory-write. Re-extraction and exact-key merge cannot restore the value. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer, minimum: 1, maximum: 9007199254740991 } reason: { type: string } cwd: { type: string } project: { type: string } workspace: { type: string } responses: "200": { description: Rejection result, content: { application/json: { schema: { type: object } } } } "400": { description: Missing or non-positive id } "404": { description: No visible memory or rejection refused } /memory/restore: post: summary: Explicitly restore a rejected memory and retire its tombstone description: Requires memory-admin so automatic extraction cannot invoke this exception path. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer, minimum: 1, maximum: 9007199254740991 } cwd: { type: string } project: { type: string } workspace: { type: string } responses: "200": { description: Restore result, content: { application/json: { schema: { type: object } } } } "400": { description: Missing or non-positive id } "404": { description: No visible rejected memory or restore refused } /memory/stats: get: summary: Memory store statistics responses: "200": description: Memory stats envelope content: application/json: schema: { type: object } /memory/delete: post: summary: Retire a private memory or delete a shared memory by id description: > Defaults to store=user: retirement removes a private memory from current recall while retaining governed history and reports destroyed=false. A model cannot retire user-authored or unknown-origin private content. The expected_version precondition binds the owner, record ID and current revision. With idempotency_key, an authenticated identical retry returns its original mutation_receipt without another transition. Reactivated, changed or erased results are not retired again; changed retry payloads conflict. The receipt contains no retained content. Private retirement is not permanent erasure. Select store=kb explicitly for the shared deletion contract. Its existing authority and retention rules determine whether the record is retired or destroyed. Shared conditional deletion supports the same precondition and retry key. Its schema-version-2 receipt names the target_version and outcome (retired or destroyed). Retirement includes the resulting version; destruction has no current version. A changed, restored or hidden result cannot be deleted again through an old receipt. Requires memory-admin. requestBody: required: true content: application/json: schema: type: object required: [id] properties: store: { type: string, enum: [user, kb], default: user } id: oneOf: - { type: integer, minimum: 1, maximum: 9007199254740991 } - { type: string, pattern: '^[1-9][0-9]*$' } expected_version: type: object additionalProperties: false required: [schema_version, owner_id, record_id, record_revision] properties: schema_version: { type: integer, const: 1 } owner_id: { type: string, format: uuid } record_id: { type: string, pattern: '^[1-9][0-9]*$' } record_revision: { type: string, pattern: '^[1-9][0-9]*$' } idempotency_key: type: string minLength: 16 maxLength: 128 pattern: '^[!-~]+$' description: Requires expected_version, an authenticated principal and an identical retry payload. responses: "200": description: Deletion result ({ id, deleted, destroyed }) content: application/json: schema: { type: object } "400": description: Missing or non-positive id content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "409": description: Stale version, changed retry payload, unavailable committed result or authority conflict content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: No such memory, or the knowledge service refused content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/supersede: post: summary: Replace a memory with a corrected one, linking the two description: > Correct memory in the selected store. Private memory retains the stable ID and prior revision; shared KB memory links the old and replacement records. expected_version binds the owner, ID and revision. With idempotency_key, identical authenticated retries return the original mutation_receipt after checking current result eligibility and version. Changed payloads conflict; hidden or changed results are not repeated. A model correction requiring review returns a durable proposal reference. Requires memory-write capability. requestBody: required: true content: application/json: schema: type: object required: [old_id, new_content] properties: store: { type: string, enum: [user, kb], default: user } old_id: oneOf: - { type: integer, minimum: 1, maximum: 9007199254740991 } - { type: string, pattern: '^[1-9][0-9]*$' } expected_version: type: object additionalProperties: false required: [schema_version, owner_id, record_id, record_revision] properties: schema_version: { type: integer, const: 1 } owner_id: { type: string, format: uuid } record_id: { type: string, pattern: '^[1-9][0-9]*$' } record_revision: { type: string, pattern: '^[1-9][0-9]*$' } idempotency_key: type: string minLength: 16 maxLength: 128 pattern: '^[!-~]+$' description: Requires expected_version. Reuse only for the identical correction. new_content: { type: string } confidence: { type: number, minimum: 0, maximum: 1 } session_id: { type: string } responses: "200": description: The superseding memory envelope content: application/json: schema: { type: object } "400": description: Missing old_id or empty new_content content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "409": description: Version, retry payload, unavailable committed result or review-required conflict content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: No such memory, or the knowledge service refused content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /facts/retract: post: summary: Retract a typed fact description: > Withdraws a typed fact the store got wrong. Nothing is deleted: the relation's correction_behavior decides whether the edge is superseded (archived, still auditable) or tombstoned, and either way the row is retained. Omit `target` to retract every current value of (source, relation); supply it to retract one specific value. `authority` defaults to "model". A model authority may not retract a user-stated Class A fact; those edges are skipped rather than refused, so a partial retraction reports how many edges it actually affected. `retracted: 0` is a success meaning nothing current matched. `authority: "user"` REQUESTS user authority; it does not confer it. The request is granted only when the connection itself attested a person: a local UDS peer whose uid the kernel vouched for, or a webuser asserted over the trusted socket. A bearer token or client certificate identifies a service, not a user, so requests carrying one are served at model authority however they label themselves, and the user's own facts stand. An immutable relation is refused with 400 unless the authority is "user". Requires the memory-write capability. requestBody: required: true content: application/json: schema: type: object required: [source, relation] properties: source: { type: string, minLength: 1 } relation: { type: string, minLength: 1 } target: type: string description: Optional; omit to retract all current values of (source, relation) authority: type: string enum: [user, model] default: model responses: "200": description: Retraction result ({ retracted }) content: application/json: schema: { type: object } "400": description: Missing source/relation, bad authority, or an immutable relation content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: The knowledge service refused the retraction content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /entities/merge: post: summary: Merge two entity records into one description: > Collapses `from_id` into `into_id` when both name the same real entity. Entity resolution then follows the merge pointer, so facts recorded against either name resolve to one node. The response carries `merge_id`, the audit handle /entities/unmerge needs. A caller that discards it cannot reverse the merge. Requires the memory-write capability. requestBody: required: true content: application/json: schema: type: object required: [from_id, into_id] properties: from_id: { type: integer, minimum: 1, maximum: 9007199254740991 } into_id: { type: integer, minimum: 1, maximum: 9007199254740991 } responses: "200": description: Merge result ({ merge_id }) content: application/json: schema: { type: object } "400": description: Missing or non-positive ids, or from_id equal to into_id content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Merge refused; both ids must be distinct active entities content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /entities/unmerge: post: summary: Reverse a recorded entity merge description: > Restores the merged entity to active and marks the audit row undone, using the `merge_id` returned by /entities/merge. Requires the memory-write capability. requestBody: required: true content: application/json: schema: type: object required: [merge_id] properties: merge_id: { type: integer, minimum: 1, maximum: 9007199254740991 } responses: "200": description: Unmerge result ({ merge_id, undone }) content: application/json: schema: { type: object } "400": description: Missing or non-positive merge_id content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: No such merge, or it was already undone content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/get: post: summary: Get a memory by id requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer, minimum: 1, maximum: 9007199254740991 } responses: "200": description: Memory envelope content: application/json: schema: { type: object } "400": description: Missing id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Memory not found content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Knowledge service unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /action/receipt: post: summary: Inspect or reconcile an owned durable action receipt description: >- Requires tool-execution capability and ownership of the session lineage. Reconciliation verifies the original destination and payload through the tool owner. Supplied outcome assertions never count as verification. Currently exact postcondition verification supports local write_file. requestBody: required: true content: application/json: schema: type: object required: [operation, session_id, action_id] properties: operation: {type: string, enum: [inspect, reconcile, cancel]} session_id: {type: string} action_id: {type: string} directory: {type: string, description: Original absolute host directory} arguments_json: {type: string, description: Original effective tool arguments for owner verification} responses: '200': description: Owned receipt or an explicit unavailable or unverified result content: application/json: schema: {type: object} /task/projection: post: summary: Operate on disposable state for the owned session's active task description: >- Host-only state ownership with compare-and-swap revisions. Rebuilds and releases use fresh memory-owner evidence. Promotion previews bind an exact claim and existing private target; promote submits a review draft, never an authoritative insert. Shared-store promotion is unavailable. requestBody: required: true content: application/json: schema: type: object required: [operation, session_id, task_id] properties: operation: type: string enum: [describe, rebuild, get, discard, cleanup_expired, promotion_preview, promote] session_id: {type: string} task_id: {type: string, pattern: '^[1-9][0-9]*$'} expected_revision: {type: string, pattern: '^(0|[1-9][0-9]*)$'} binding: type: object required: [store, project, task, view] properties: store: {type: string, enum: [user, kb]} project: {type: string} task: {type: string} view: {type: string, enum: [briefing]} ttl_seconds: {type: integer, minimum: 1, maximum: 86400} max_context_bytes: {type: integer, minimum: 0, maximum: 65536} items: type: array maxItems: 32 items: type: object required: [kind, text] properties: kind: {type: string, enum: [hypothesis, planned_action, working_decision, open_question]} text: {type: string, maxLength: 4096} events: type: array maxItems: 32 items: {type: string, pattern: '^[1-9][0-9]*$'} target_id: {type: string, pattern: '^[1-9][0-9]*$'} claim_index: {type: integer, minimum: 0, maximum: 31} preview_digest: {type: string} responses: "200": description: Non-authoritative projection, review draft, or explicit conflict/unavailable state content: application/json: schema: {type: object} "503": description: Owner unavailable or request refused content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/serve: post: summary: Serve a named authorized memory view description: >- Web adapter over the same typed memory-query bus client used by model adapters. Returns that service's data without independent HTTP query policy. Native temporal coordinates select historical observations; historical answers retain explicit view/belief/axis labels and require current disclosure authorization. Provider dispatch remains separately guarded. Missing owners never trigger an internal memory HTTP fallback. requestBody: required: true content: application/json: schema: type: object required: [view, task] properties: view: type: string enum: [briefing, active_constraints, current_state, recent_decisions, relevant_context, known_failures, reviewed_procedures, open_contradictions, historical_context] task: { type: string, minLength: 1, maxLength: 8192 } store: { type: string, enum: [user, kb], default: user } project: { type: string } workspace: { type: string } cwd: { type: string } scope: oneOf: - { type: string, enum: [current, all] } - type: object required: [type] additionalProperties: false properties: type: { type: string, enum: [global, workspace, project] } value: { type: string, maxLength: 1024 } description: Current uses authorized active context plus Global/shared; all spans authorized G/W/P. User remains exact authenticated User. native_belief: type: string pattern: '^(0|[1-9][0-9]{0,19})$' description: Canonical unsigned 64-bit native belief coordinate, not a wall-clock timestamp. native_region_json: type: string maxLength: 65536 description: Opaque native Region JSON with full signed 64-bit interval endpoints. Historical context only, mutually exclusive with native_region; no current-clock override. Validated by the native owner. native_region: type: object maxProperties: 256 propertyNames: { format: uuid } additionalProperties: type: object required: [start, end] additionalProperties: false properties: start: { type: [integer, 'null'], minimum: -9007199254740991, maximum: 9007199254740991 } end: { type: [integer, 'null'], minimum: -9007199254740991, maximum: 9007199254740991 } description: Sparse half-open intervals over native UUID time axes; null endpoints are unbounded. limit: { type: integer, minimum: 0, maximum: 64 } context_limits: type: object required: [schema_version] additionalProperties: false properties: schema_version: { type: integer, const: 1 } max_context_bytes: { type: integer, minimum: 2, maximum: 1048576 } max_context_tokens: { type: integer, minimum: 1, maximum: 262144 } allOf: - if: required: [view] properties: view: { const: historical_context } then: anyOf: - required: [native_belief] - required: [native_region] - required: [native_region_json] - not: required: [native_region, native_region_json] - if: required: [native_region_json] then: properties: view: { const: historical_context } responses: "200": description: Authorized projection or explicit empty/degraded result content: application/json: schema: { type: object } "400": description: Invalid view or unsupported budget/temporal request content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Memory owner unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/claim-card: post: summary: Inspect a canonical memory claim card description: Web serialization of the same typed claim_card bus result used by model adapters; only current authorized records are selected. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: string, pattern: '^[1-9][0-9]*$' } expand_evidence: { type: boolean, default: false } store: { type: string, enum: [user, kb], default: user } project: { type: string } workspace: { type: string } cwd: { type: string } scope: oneOf: - { type: string, enum: [current, all] } - type: object required: [type] additionalProperties: false properties: type: { type: string, enum: [global, workspace, project] } value: { type: string, maxLength: 1024 } responses: "200": description: Version-bound card and governed canonical correction descriptor content: application/json: schema: { type: object } "404": description: Claim unavailable in the current authorized scope content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Memory owner unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/evidence: post: summary: Inspect authorized memory evidence lineage description: >- Uses a stable scoped snapshot. Inaccessible or unresolved ancestry withholds counts and references. Distinct creation events do not prove independent corroboration; unknown independent counts remain null. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: oneOf: - { type: integer, minimum: 1, maximum: 9007199254740991 } - { type: string, pattern: '^[1-9][0-9]*$' } store: { type: string, enum: [user, kb], default: user } project: { type: string } workspace: { type: string } responses: "200": description: Scoped lineage diagnostics and authorized evidence references content: application/json: schema: { type: object } "400": description: Invalid identity or scope content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: Memory unavailable in the selected scope content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Evidence owner unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /memory/read: get: summary: Assemble the memory context responses: "200": description: Memory context envelope content: application/json: schema: { type: object } /hooks/pre: post: summary: Pre-tool-call harness hook (privileged) description: >- Runs the pre-tool-call guard. CAP_TOOL_EXECUTE: reachable on the local Unix-domain socket (the co-located AI-tool integration) or, over TCP, only with aimee.api.remote_writes=full. requestBody: required: false content: application/json: schema: { type: object } responses: "200": description: Hook decision envelope content: application/json: schema: { type: object } /hooks/post: post: summary: Post-tool-call harness hook (privileged) description: >- Runs the post-tool-call learning/guard pass. CAP_TOOL_EXECUTE; local UDS or remote_writes=full over TCP. requestBody: required: false content: application/json: schema: { type: object } responses: "200": description: Hook decision envelope content: application/json: schema: { type: object } /hooks/session_start: post: summary: Session-start harness hook (privileged) description: >- Emits the session-start brief. CAP_TOOL_EXECUTE; local UDS or remote_writes=full over TCP. requestBody: required: false content: application/json: schema: { type: object } responses: "200": description: Session-start brief envelope content: application/json: schema: { type: object } /hooks/session_end: post: summary: Revoke a session-scoped authenticated harness-hook token description: >- Ends the authenticated hook identity established by session_start. The session id, harness client, and hook token must match the attested transport principal that originally minted the token. requestBody: required: true content: application/json: schema: type: object required: [session_id, harness_client, hook_token] properties: session_id: { type: string } harness_client: { type: string } hook_token: { type: string } responses: "200": { description: Hook identity revoked } "400": { description: Invalid session or token binding } /session/brief_assemble: post: summary: Workspace-independent session brief for the remote thin client description: >- Assembles and returns the workspace-independent SessionStart brief (persona principles + learned Rules + key facts) via build_session_context, with none of the hooks/session_start workspace side-effects (no worktree checkout, state persistence, or reindex) and no client filesystem access. Returns a minimal versioned envelope so the thin client has a stable contract. CAP_SESSION_READ. requestBody: required: false content: application/json: schema: { type: object } responses: "200": description: Versioned brief envelope { schema_version, output } content: application/json: schema: type: object properties: schema_version: { type: integer } output: { type: string } /memory/user_capture: post: summary: Capture a per-user memory into db1 description: >- Upsert a per-user memory (identity fact or preference) into db1 (per-user by construction). The write path behind `aimee memory identity/prefer`. CAP_MEMORY_WRITE. requestBody: required: true content: application/json: schema: type: object required: [kind, key, content] properties: kind: { type: string } key: { type: string } content: { type: string } cwd: { type: string } project: { type: string } workspace: { type: string } tier: { type: string } responses: "200": description: Capture result envelope { kind, key, scope } content: application/json: schema: { type: object } "400": description: Missing kind, key, or content content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Per-user memory store unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /tools/execute: post: summary: Execute a tool via the workspace plane (privileged) description: >- Internal tool-execution bridge. CAP_TOOL_EXECUTE; local UDS or remote_writes=full over TCP. requestBody: required: true content: application/json: schema: { type: object } responses: "200": description: Tool result envelope content: application/json: schema: { type: object } /memory/protected-intake: post: summary: Submit a protected value through an optional private intake client description: > Human-only input transport. The selected private client takes custody before ordinary memory request serialization and returns only opaque references. This route is not a model/MCP command. It requires an attested per-principal human context and memory-write permission; absent private support returns unavailable without falling back to ordinary storage. Retrying requires the same operation UUID and value. The full encrypted envelope must fit the selected custody provider's limit, which may be smaller than this input cap. requestBody: required: true content: application/json: schema: type: object additionalProperties: false required: [operation_uuid, value] properties: operation_uuid: type: string format: uuid pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' value: type: string minLength: 1 maxLength: 65536 writeOnly: true description: Nonempty UTF-8 input; at most 64 KiB encoded bytes before envelope overhead. responses: "200": description: Safe reference/publication result; no submitted value content: application/json: schema: { type: object } "400": description: Invalid bounded input "403": description: Not an authorized human intake context "409": description: Conflicting retry or retired operation "503": description: Private intake unavailable or outcome requires reconciliation /memory/store: post: summary: Store a memory (local-only) description: > Mutating route; reachable only on the local Unix-domain socket. Shared writes require an active project/workspace or explicit scope=all. Optional authenticated idempotency_key binds the admitted request and authority to one durable outcome; identical retries return that result without repeating extraction or invalidation. Existing same-key replacement and review rules still apply. Changed requests conflict; hidden, expired, superseded or erased results are unavailable. Creation does not accept expected_version. requestBody: required: true content: application/json: schema: type: object required: [key, content] properties: key: { type: string } content: { type: string } store: { type: string, enum: [user, kb], default: user } tier: { type: string } kind: { type: string } confidence: { type: number, minimum: 0, maximum: 1 } project: { type: string } workspace: { type: string } scope: { type: string, enum: [all] } native_applicability_json: type: string maxLength: 16384 description: Opaque native Region JSON for world applicability, with at most 128 UUID axes and full signed 64-bit interval endpoints. The owner validates it; omitted preserves existing UTC/lifecycle behavior. Null or non-string values are refused. idempotency_key: type: string minLength: 16 maxLength: 128 pattern: '^[!-~]+$' responses: "200": description: Stored memory envelope; keyed outcomes include schema-2 mutation_receipt with stored/unchanged outcome, commit_id, exact version and replayed flag, or a linked review proposal content: application/json: schema: { type: object } "400": description: Missing key/content or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /wm/set: post: summary: Set a working-memory entry (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [session_id, key, value] properties: session_id: { type: string } key: { type: string } value: { type: string } responses: "200": description: Working-memory entry envelope content: application/json: schema: { type: object } "400": description: Missing fields or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /attempts/record: post: summary: Record an attempt-log entry (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [session_id, approach, outcome] properties: session_id: { type: string } approach: { type: string } outcome: { type: string } responses: "200": description: Attempt-log entry envelope content: application/json: schema: { type: object } "400": description: Missing fields or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /rules/delete: post: summary: Delete a rule by id (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer } responses: "200": description: Deletion envelope content: application/json: schema: { type: object } "400": description: Missing id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /collab_rules/approve: post: summary: Approve a collaboration rule by id (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer } responses: "200": description: Collaboration rule action envelope content: application/json: schema: { type: object } "400": description: Missing id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /collab_rules/reject: post: summary: Reject a collaboration rule by id (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer } responses: "200": description: Collaboration rule action envelope content: application/json: schema: { type: object } "400": description: Missing id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /collab_rules/retire: post: summary: Retire a collaboration rule by id (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: integer } responses: "200": description: Collaboration rule action envelope content: application/json: schema: { type: object } "400": description: Missing id or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /skills/create: post: summary: Create a skill (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [name, content] properties: name: { type: string } content: { type: string } responses: "200": description: Skill mutation envelope content: application/json: schema: { type: object } "400": description: Missing fields, lint failure, or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /skills/edit: post: summary: Edit a skill (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [name, content] properties: name: { type: string } content: { type: string } responses: "200": description: Skill mutation envelope content: application/json: schema: { type: object } "400": description: Missing fields, lint failure, or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /skills/archive: post: summary: Archive a skill (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } absorbed_into: { type: string } responses: "200": description: Skill mutation envelope content: application/json: schema: { type: object } "400": description: Missing name or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /skills/pin: post: summary: Pin or unpin a skill (local-only) description: Mutating route; reachable only on the local Unix-domain socket. requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } pinned: { type: boolean } responses: "200": description: Skill mutation envelope content: application/json: schema: { type: object } "400": description: Missing name or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /notes/search: post: summary: Search notes (proxied to aimee-kb) requestBody: required: true content: application/json: schema: type: object required: [query] properties: query: { type: string } limit: { type: integer } responses: "200": description: Notes search envelope content: application/json: schema: { type: object } "400": description: Missing query content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Notes backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Notes search not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /dashboard/reminders: get: summary: Active reminders (proxied to aimee-kb) responses: "200": description: Reminders list content: application/json: schema: { type: object } "502": description: Dashboard backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Dashboard not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /dashboard/memory: get: summary: Memory subsystem stats (proxied to aimee-kb) responses: "200": description: Memory dashboard stats content: application/json: schema: { type: object } "502": description: Dashboard backend (aimee-kb) unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Dashboard not available on this server content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /shadow/enable: post: summary: Arm shadow-traffic publishing (runtime-only; resets to off on restart) description: >- Operator-only (CAP_SHADOW_ADMIN, full-trust). Arms the shadow-traffic mirror so subscribers receive a copy of each completion request. In-memory only: never persisted, so a restart always boots disarmed. responses: "200": description: Armed /shadow/disable: post: summary: Disarm shadow-traffic publishing and forget all subscribers description: Operator-only (CAP_SHADOW_ADMIN, full-trust). Hard stop. responses: "200": description: Disarmed /shadow/subscribe: post: summary: Register a subscriber to receive mirrored completion traffic description: >- Operator-only (CAP_SHADOW_ADMIN, full-trust). The caller's real /v1 ingress (`url`) receives a fire-and-forget copy of each completion request, tagged X-Aimee-Shadow, authenticated with the supplied `bearer`. Refused while publishing is disarmed. Idempotent by url. requestBody: required: true content: application/json: schema: type: object required: [url] properties: url: { type: string, description: Subscriber's /v1 base URL } bearer: { type: string, description: Bearer presented to the subscriber } responses: "200": description: Subscribed "403": description: Shadow publishing is disarmed /shadow/unsubscribe: post: summary: Remove a shadow-traffic subscriber description: Operator-only (CAP_SHADOW_ADMIN, full-trust). requestBody: required: true content: application/json: schema: type: object required: [url] properties: url: { type: string } responses: "200": description: Unsubscribed (or absent) /chat/completions: post: summary: Create a chat completion requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/ChatCompletionRequest' } responses: "200": description: Chat completion content: application/json: schema: { $ref: '#/components/schemas/ChatCompletionResponse' } "400": description: Invalid request (e.g. stream not yet supported) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /console/memory: post: summary: Forward an optional module console command description: > Requires CAP_MEMORY_ADMIN and verified host identity. The host forwards one JSON object of at most 1 MiB with its authenticated context. The installed module owns command schemas, authorization and response meaning. An absent module returns 503; the host supplies no memory implementation. requestBody: required: true content: application/json: schema: { type: object } responses: "200": { description: Module-owned JSON response } "400": { description: Invalid or oversized JSON object } "403": { description: Required capability or verified identity absent } "503": { description: Optional module or valid response unavailable } default: { description: Module-owned status and JSON object } /modules/user-source: post: summary: Submit an authenticated user operation to an optional source owner description: > Requires CAP_CHAT. The installed owner validates the operation and may return a bounded JSON terminal response or prepare an opaque source-only input for canonical chat delivery. Host identity comes from authenticated transport, never request-body claims. Module absence or failed preparation returns 503. This endpoint grants no model or operator authority. requestBody: required: true content: application/json: schema: { type: object } responses: "200": description: Owner response or canonical source-only delivery content: application/json: schema: { type: object } application/x-ndjson: schema: { type: string } "400": { description: Invalid JSON body } "403": { description: Required chat capability absent } "503": { description: Optional source owner or prepared input unavailable } /chat/stream: post: summary: Stream a native chat turn description: > With ir_version=1, emits canonical session envelopes as NDJSON, committed to the session log before delivery. Each envelope contains version (1), session_id, decimal-string sequence, event_id, turn_id, actor, and event. The event is a typed message, IR delta, harness control request/response, or host execution lifecycle. Delta payload types are TURN_START, BLOCK_START, BLOCK_DELTA, BLOCK_STOP, TURN_STOP, and ERROR. Whole messages retain role and typed text/thinking/tool_use/tool_result/image/document blocks. Tool results pair by opaque tool_id. The authenticated owner is required; provider resume IDs are resolved server-side. Browser disconnect does not cancel execution. Legacy callers without ir_version retain the prior aimee event format. Requires CAP_CHAT. requestBody: required: true content: application/json: schema: type: object required: [message] properties: ir_version: { type: integer, enum: [1], description: Select the canonical durable session stream } control_replies: type: boolean default: true description: > Set false for a caller without an interactive reply subscriber. Questions and permission requests then refuse instead of waiting. This only restricts existing capabilities; it grants no authority. attach_id: { type: string, description: Server-minted presence attachment } queue: { type: boolean, description: Wait for the session turn lock } queue_wait_ms: { type: integer, minimum: 0, maximum: 120000 } message: description: > Canonical user message retained through queue, capture and execution. Legacy external strings convert once at ingress. The host assigns context authority. User blocks are text, image or document. oneOf: - type: string - type: object required: [role, blocks] properties: role: { type: string, enum: [user] } blocks: type: array minItems: 1 maxItems: 4096 items: { type: object } aimee_session_id: { type: string, description: Required stable session identity for ir_version=1 } claude_session_id: { type: string } cwd: { type: string } clean_retry: type: object additionalProperties: false description: > Opt in to operator-enabled durable native retry tracking. An empty object starts an attempt. To retry a failed attempt, provide the retry_attempt event ID and complete current constraints in message. History speculation is omitted; workspace effects are not restored. Unsupported providers, unavailable baselines and unknown writes refuse. properties: previous_attempt: { type: string } replace_constraints: { type: boolean } responses: "200": description: NDJSON canonical session envelopes with ir_version=1; otherwise legacy chat events content: application/x-ndjson: schema: { type: string } "403": description: Caller lacks CAP_CHAT (e.g. a scoped bearer) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /chat/graceful_cancel: post: summary: Stop an exact browser-owned chat turn description: > With session_id and turn_id, requires the root-UDS-attested browser operator and matching durable session actor. A matching local turn is asked to stop; stopping does not assert that effects are quiescent. If no local turn exists, the canonical owner may cancel the exact abandoned non-native execution. A different live turn, native custody, stale source or ownership mismatch refuses. No message is queued. The browser waits for the canonical terminal before submitting any new text. Bodies without turn_id retain the legacy graceful-cancel RPC contract. requestBody: required: true content: application/json: schema: type: object properties: session_id: { type: string } turn_id: { type: string } aimee_session_id: { type: string, description: Legacy session selector without turn_id } responses: "200": description: Exact stop requested or canonical cancellation committed content: application/json: schema: type: object properties: status: { type: string, enum: [ok] } session_id: { type: string } turn_id: { type: string } disposition: { type: string, enum: [stopping, cancelled] } terminal_sequence: { type: string, description: Present for committed canonical cancellation } "400": description: Invalid exact cancellation frame "403": description: Not an authenticated browser operator or durable owner "409": description: Stale turn or active native custody; no canonical cancellation committed "503": description: Durable ownership or cancellation unavailable /chat/interrupt: post: summary: Steer an in-flight chat turn description: > Stop the in-flight turn for a session and queue a follow-up `message` the server auto-continues as the next, server-initiated turn (streamed to the session's /events presence stream). Owner-authorized like chat.graceful_cancel. When no turn is in flight, nothing is queued and `interrupted` is false. Internal clients send canonical IR. Legacy external text imports once at this public endpoint. The host assigns context authority. Requires CAP_CHAT. requestBody: required: true content: application/json: schema: type: object required: [aimee_session_id, message] properties: aimee_session_id: { type: string } message: oneOf: - type: string minLength: 1 description: Legacy external text import only - type: object required: [role, blocks] properties: role: { type: string, enum: [user] } blocks: type: array minItems: 1 maxItems: 4096 items: { type: object, description: Canonical text, image or document block } responses: "200": description: Interrupt accepted content: application/json: schema: type: object properties: status: { type: string } session_id: { type: string } interrupted: { type: boolean } "403": description: Caller lacks CAP_CHAT or is not the session owner content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /chat/control-reply: post: summary: Reply to a pending harness permission or question description: > Queues a decision for the exact server-owned session and execution request. Requires the root-UDS-attested browser user and matching session principal. Model ingress and MCP credentials cannot approve requests. The owning execution persists the correlated canonical response before writing to its native control channel. Stale or already answered requests return 409. requestBody: required: true content: application/json: schema: type: object required: [session_id, request_id, reply] properties: session_id: { type: string } request_id: { type: string } reply: type: object required: [decision] properties: decision: { type: string, enum: [allow, deny, cancel] } answers: type: object additionalProperties: type: array items: { type: string } responses: "200": description: Decision queued for the owning execution content: application/json: schema: type: object properties: status: { type: string } queued: { type: boolean } "400": { description: Invalid request } "403": { description: Browser identity or ownership refused } "409": { description: Pending request is stale or already answered } /chat/live: post: summary: Poll the live (in-flight) turn for a session description: > The browser's fixed-timer polling source of truth for an in-flight turn. The server mirrors the tmux pane scrape into a per-session db1 row (webchat_live) as the answer streams; clients tail it on a ~500ms timer instead of reconciling the per-token SSE stream. Returns the row only when its monotonic `rev` advanced past `since_rev` (`changed:false` otherwise, so an unchanged turn costs nothing). Requires CAP_SESSION_READ. requestBody: required: true content: application/json: schema: type: object required: [session_id] properties: session_id: { type: string } since_rev: { type: integer } responses: "200": description: Live turn state (when changed) or changed=false content: application/json: schema: type: object properties: changed: { type: boolean } rev: { type: integer } turn_id: { type: string } text: { type: string } status: { type: string } "403": description: Caller lacks CAP_SESSION_READ content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /completions: post: summary: Create a text completion requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/CompletionRequest' } responses: "200": description: Text completion content: application/json: schema: { $ref: '#/components/schemas/CompletionResponse' } "400": description: Invalid request content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /embeddings: post: summary: Create embeddings for one or more inputs requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/EmbeddingsRequest' } responses: "200": description: Embeddings list content: application/json: schema: { $ref: '#/components/schemas/EmbeddingsResponse' } "400": description: Invalid request content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Embedder unavailable content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /responses: post: summary: Create a model response (OpenAI Responses API; non-streaming) requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/ResponsesRequest' } responses: "200": description: A response object content: application/json: schema: { $ref: '#/components/schemas/ResponseObject' } "400": description: Invalid request (e.g. stream not yet supported) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /messages: post: summary: Create a message (Anthropic Messages API ingress) description: > Anthropic Messages API surface so Claude Code (and any Anthropic Messages API client pointed here via ANTHROPIC_BASE_URL) can drive aimee's configured primary model. A stateless wire-format proxy: the request's system/messages/tools are translated to the primary provider's format and the reply is translated back to Anthropic shape without involving aimee's agent loop, memory, or toolset. With `stream: true` the response is the Anthropic typed-event SSE sequence (message_start … message_stop). Requires CAP_CHAT. requestBody: required: true content: application/json: schema: type: object required: [messages] properties: model: { type: string, description: Ignored; aimee routes to its primary agent. } max_tokens: { type: integer } system: {} messages: { type: array, items: { type: object } } tools: { type: array, items: { type: object } } temperature: { type: number } stream: { type: boolean } responses: "200": description: > An Anthropic message object (stream:false), or the typed-event SSE sequence (stream:true). content: application/json: schema: { type: object } text/event-stream: schema: { type: string } "400": description: Invalid request content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: Primary provider call failed content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /messages/count_tokens: post: summary: Count input tokens for an Anthropic Messages request requestBody: required: true content: application/json: schema: type: object properties: system: {} messages: { type: array, items: { type: object } } responses: "200": description: Estimated input token count content: application/json: schema: type: object properties: input_tokens: { type: integer } /persona: get: summary: Current active persona responses: "200": description: The active persona content: application/json: schema: { $ref: '#/components/schemas/Persona' } /personas: get: summary: List configured personas responses: "200": description: Persona list content: application/json: schema: { $ref: '#/components/schemas/PersonaList' } post: summary: Create a persona (name in body) requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/PersonaWrite' } responses: "200": description: The created persona (reloaded from config) content: application/json: schema: { $ref: '#/components/schemas/Persona' } "400": description: Missing or invalid persona name content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /commands/{method}: post: summary: Invoke a command declared in the command registry description: >- Invokes a capability registered in THE command table (src/headers/command_registry.h), addressed by its RPC spelling ".". This is how a module-declared command - including one contributed by a plugin module hosting an MCP server or a pluggy plugin - is actually called; the same declaration also drives the CLI manifest and the MCP tool surface, so a listed capability is a reachable one. The request body is the command's own argument object and reaches its handler unchanged. parameters: - name: method in: path required: true description: The command's RPC spelling, ".". schema: { type: string } requestBody: required: false content: application/json: schema: type: object additionalProperties: true responses: "200": description: The command's result content: application/json: schema: type: object properties: status: { type: string, enum: [ok] } result: { type: object, additionalProperties: true } "400": description: Missing command method, or an invalid JSON body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: No such command, or it is not on the RPC surface content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "502": description: The command handler failed content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /personas/{name}: get: summary: Show a persona by name parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: The named persona content: application/json: schema: { $ref: '#/components/schemas/Persona' } "404": description: No such persona content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } put: summary: Create or edit the named persona parameters: - name: name in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/PersonaWrite' } responses: "200": description: The persona after the write (reloaded from config) content: application/json: schema: { $ref: '#/components/schemas/Persona' } "400": description: Invalid persona name or body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Remove the user-level persona file (reset a built-in, delete a custom) parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: Deletion result content: application/json: schema: type: object properties: name: { type: string } deleted: { type: boolean } "404": description: No user-level persona file to remove content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /role_templates: get: summary: List delegate role templates responses: "200": description: Role template names content: application/json: schema: type: object properties: role_templates: type: array items: { type: string } /role_templates/{name}: get: summary: Show a role template's raw body parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: The role template content: application/json: schema: { $ref: '#/components/schemas/RoleTemplate' } "404": description: No such role template content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } put: summary: Create or edit a role template parameters: - name: name in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object required: [content] properties: content: { type: string } responses: "200": description: The role template after the write content: application/json: schema: { $ref: '#/components/schemas/RoleTemplate' } "400": description: Invalid role name or missing content content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Remove the user-level role template (reset a built-in, delete a custom) parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: Deletion result content: application/json: schema: type: object properties: role: { type: string } deleted: { type: boolean } "404": description: No user-level role template to remove content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /roundtables: get: summary: List named roundtable presets (with the active one flagged) responses: "200": description: Preset summaries and the active preset name content: application/json: schema: type: object properties: active: { type: string } roundtables: type: array items: type: object properties: name: { type: string } description: { type: string } active: { type: boolean } synthesized: { type: boolean } post: summary: Create a roundtable preset (name in body) description: Requires the server-token-attested `webuser:admin` appliance administrator. requestBody: required: true content: application/json: schema: { type: object } responses: "200": description: The created preset (reloaded from disk) content: application/json: schema: { type: object } "400": description: Missing or invalid preset name content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Authenticated appliance administrator required content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /roundtables/active: post: summary: Make a preset the active roundtable (mirror its values into live config) description: Requires the server-token-attested `webuser:admin` appliance administrator. requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string } responses: "200": description: Activation result content: application/json: schema: type: object properties: name: { type: string } active: { type: boolean } "404": description: No such preset content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Authenticated appliance administrator required content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /roundtables/{name}: get: summary: Show a roundtable preset by name parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: The named preset (or a synthesized default when the store is empty) content: application/json: schema: { type: object } "404": description: No such preset content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } put: summary: Create or edit the named roundtable preset description: Requires the server-token-attested `webuser:admin` appliance administrator. parameters: - name: name in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: { type: object } responses: "200": description: The preset after the write content: application/json: schema: { type: object } "400": description: Invalid preset name or body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Authenticated appliance administrator required content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Remove a roundtable preset description: Requires the server-token-attested `webuser:admin` appliance administrator. parameters: - name: name in: path required: true schema: { type: string } responses: "200": description: Deletion result content: application/json: schema: type: object properties: name: { type: string } deleted: { type: boolean } "404": description: No preset to remove content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Authenticated appliance administrator required content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /sessions: get: summary: List the owner's live presences (sessions) responses: "200": description: Live presences content: application/json: schema: type: array items: { $ref: '#/components/schemas/Presence' } /sessions/{id}/attach: post: summary: Attach a surface to a session (creates the presence on first attach) parameters: - name: id in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/AttachRequest' } responses: "200": description: Surface attached content: application/json: schema: { $ref: '#/components/schemas/AttachResponse' } "409": description: Attach refused (owner mismatch or registry full) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /sessions/{id}/detach: post: summary: Detach a surface from a session parameters: - name: id in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: type: object required: [attach_id] properties: attach_id: { type: string } responses: "200": description: Surface detached content: application/json: schema: type: object properties: detached: { type: boolean } "404": description: No such attachment content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /sessions/{id}/events: get: summary: Replay and tail canonical session events, or legacy presence description: > text/event-stream of presence events (turn_started / turn_delta / turn_done / busy and routed async events such as delegate/cron/reflection completions) by default. With format=ir, replays the durable canonical session log after cursor, then tails newly committed events. Each SSE frame has event=ir, id=decimal sequence, and data equal to the canonical envelope emitted by /chat/stream. Both roles and tool results are retained. Last-Event-ID takes precedence over cursor on reconnect; a fresh browser starts at zero. Access requires the attested session owner. Keep-alive comments contain no conversation content. parameters: - name: id in: path required: true schema: { type: string } - name: format in: query schema: { type: string, enum: [ir] } description: Select canonical durable replay instead of legacy presence - name: cursor in: query schema: { type: string, pattern: '^(0|[1-9][0-9]*)$' } description: Exclusive decimal event sequence; default zero - name: Last-Event-ID in: header schema: { type: string, pattern: '^(0|[1-9][0-9]*)$' } description: Reconnect cursor; takes precedence over the query cursor responses: "200": description: SSE canonical envelopes with format=ir; otherwise presence events "403": description: Missing session actor or session ownership mismatch "404": description: No such session content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /sessions/{id}/persona: get: summary: Get the persona bound to a session parameters: - name: id in: path required: true schema: { type: string } responses: "200": description: The session persona content: application/json: schema: { $ref: '#/components/schemas/Persona' } post: summary: Set the persona for a session parameters: - name: id in: path required: true schema: { type: string } requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/SessionPersonaRequest' } responses: "200": description: Persona updated content: application/json: schema: { $ref: '#/components/schemas/Persona' } /workspace/mirror-sync: post: summary: Upload the client working-tree patch for a mirror workspace description: > The client of a remote server ships its full working-tree patch (tracked modifications, deletions and untracked files, as a --binary diff against HEAD) so the server's mirror reconstructs the tree the client actually has. Absent, the reconstruct is a clean checkout at head and every uncommitted change is silently missing from the tree agents work in. The target must already be registered as a `mirror` workspace. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [args, diff] properties: args: type: array items: { type: string } description: Single element - the workspace root as the client knows it diff: type: string description: The patch; empty string for a clean tree responses: "200": description: Patch stored for the next reconstruct content: application/json: schema: type: object properties: status: { type: string } "400": description: Not a registered mirror workspace, or missing root content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspaces: get: summary: List registered workspaces (instance-scoped) description: > The workspaces registered on this instance, each with its provider (shared|detached|mirror) and the projects discovered under it. A mirror workspace also reports the client vcs coordinates its server-side tree is reconstructed from. Capability: index:read. responses: "200": description: Workspace registry content: application/json: schema: type: object properties: workspaces: type: array items: type: object properties: path: { type: string } provider: { type: string, enum: [shared, detached, mirror] } remote: { type: string, description: "mirror only: client remote URL" } head: { type: string, description: "mirror only: client HEAD commit" } projects: { type: array, items: { type: string } } post: summary: Register a workspace (instance-scoped) description: > Register a working tree as an instance-scoped workspace. The optional provider selects co-located (shared), marshalled to the client (detached), or a server-side tree reconstructed from the client's git remote (mirror). A mirror registration requires both `remote` and `head`, since the server seeds its bare mirror by fetching that head from that remote, and is rejected without them. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [root_hint] properties: root_hint: type: string description: Absolute path to the workspace root provider: { type: string, enum: [shared, detached, mirror] } remote: type: string description: "Required for provider=mirror: the client's git remote URL" head: type: string description: "Required for provider=mirror: the client's HEAD commit" responses: "200": description: Workspace registered (with discovered projects) content: application/json: schema: type: object properties: path: { type: string } project_count: { type: integer } projects: { type: array, items: { type: object } } "400": description: Missing or invalid root_hint / provider content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspaces/{id}: get: summary: Workspace handle manifest description: > The manifest for one workspace handle: provider, root, existence, and VCS state. `id` is the percent-encoded absolute workspace path. Capability: index:read. parameters: - name: id in: path required: true schema: { type: string } description: Percent-encoded absolute workspace path responses: "200": description: Workspace manifest content: application/json: schema: type: object properties: manifest: type: object properties: root: { type: string } provider: { type: string, enum: [shared, detached] } exists: { type: boolean } is_dir: { type: boolean } vcs: type: object properties: remote: { type: string } head: { type: string } branch: { type: string } delete: summary: Remove a workspace registration description: > Deregister a workspace. `id` is the percent-encoded absolute workspace path. Capability: tool:execute. parameters: - name: id in: path required: true schema: { type: string } description: Percent-encoded absolute workspace path responses: "200": description: Workspace removed content: application/json: schema: type: object properties: removed: { type: string } "404": description: No such workspace content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspaces/{id}/forge-token: post: summary: Install a short-lived brokered forge token for a workspace description: > A filesystem-rich client hands the hub a short-lived, scoped forge token (GitHub/GitLab App installation token, fine-grained PAT, or `gh auth token`) for this workspace. The hub holds it in memory only and never writes it to disk or logs it. The hub injects it into the git/gh exec environment (GH_TOKEN + a GIT_ASKPASS shim), and revokes it when the workspace closes. `id` is the percent-encoded absolute workspace path. Capability: tool:execute. parameters: - name: id in: path required: true schema: { type: string } description: Percent-encoded absolute workspace path requestBody: required: true content: application/json: schema: type: object required: [token] properties: token: { type: string, description: Short-lived forge token } scope: { type: string, enum: [global, workspace, project, user] } ttl_seconds: { type: integer, description: Lifetime in seconds (default 3600) } responses: "200": description: Token installed content: application/json: schema: type: object properties: ok: { type: boolean } "400": description: Missing/invalid token, scope, or ttl content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/clone: post: summary: Clone a git repo as a project under the calling webchat user's workspace description: > Clone `url` as a project under the authenticated `webuser:` principal's isolated workspace (`webusers//`). The caller identity comes from the root-UDS-attested `X-Aimee-Webuser` assertion, NOT the body, so a user can only clone into their own tree. The git credential is resolved per host (single-user server, many providers): an optional inline `token` (then persisted server-side, keyed by host) > the host's stored token > the server identity (AIMEE_FORGE_TOKEN). It crosses only via a GIT_ASKPASS shim, never on disk in plaintext or on the command line. The project is then indexed. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [url] properties: url: { type: string, description: Git remote URL (https or ssh) } name: { type: string, description: Repo name (default - the repo basename) } org: type: string description: > Optional org override. Default - the URL's single-segment owner path (sanitized); a multi-segment owner (GitLab subgroups) clones flat unless this is given. The project ref becomes "/". token: type: string description: > Optional access token for a private repo (GitHub/Gitea/GitLab/...). Authenticates the clone and is persisted in the server vault keyed by the URL's host for future operations. Never echoed back. responses: "200": description: Cloned and indexed content: application/json: schema: type: object properties: ok: { type: boolean } name: type: string description: The project ref ("/" or flat ""). org_note: type: string description: > Present when a multi-segment owner path bailed to a flat clone; explains how to place it with an explicit org. kb_indexed: type: boolean description: > Whether the clone was also pushed to the knowledge service (/v1/code/scan) for code-unit synthesis + embeddings. kb_reason: type: string description: Why the kb scan was skipped (present when kb_indexed is false). "400": description: Invalid URL/name/org (validation failure) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "409": description: >- Identity conflict: the project already exists, the org name clashes with a flat project (or vice versa), or the ref is already bound to a different canonical remote (the other remote is never echoed). content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/projects: get: summary: List the calling webchat user's projects description: > The git projects (cloned repos) under the authenticated `webuser:` principal's scoped workspace. A user only ever sees their own. Capability: index:read. responses: "200": description: Project names content: application/json: schema: type: object properties: projects: type: array items: { type: string } description: Project refs ("/" or flat ""). details: type: array description: Per-project detail rows. items: type: object properties: ref: { type: string } org: { type: string, description: Empty for a flat/legacy project. } name: { type: string } remote: type: string description: > Credential-free canonical remote (absent for legacy clones without a sidecar). root: { type: string } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/org-repos: get: summary: List the repositories under an owner/org on a git host description: > Enumerate the repos under `owner` on git `host` (provider-agnostic: GitHub, GitLab, Gitea/Forgejo, Bitbucket), so the wizard can bulk-clone a workspace. Auth is the attested `webuser:` principal; enumeration uses the per-host token from the sealed vault (or unauthenticated for a public org). Nothing is cloned. Capability: index:read. parameters: - in: query name: host required: true schema: { type: string } description: Git host (e.g. github.com, gitlab.com, gitea.example.com) - in: query name: owner required: true schema: { type: string } description: Owner / org / group slug responses: "200": description: The owner's repositories content: application/json: schema: type: object properties: provider: { type: string } repos: type: array items: type: object properties: name: { type: string } clone_url: { type: string } ssh_url: { type: string } private: { type: boolean } "400": description: Missing or invalid host/owner content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "401": description: Not authorized upstream (add a token for this host) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/clone-org: post: summary: Bulk-clone a selection of a workspace's repos description: > Clone each of `repos` (by `clone_url`) into the authenticated `webuser:` principal's scoped workspace, reusing the per-host credential resolution of /workspace/clone. Individual failures do not abort the batch; a per-repo result list is returned (max 100 repos per request). Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [host, owner, repos] properties: host: { type: string } owner: { type: string } repos: type: array items: type: object required: [name, clone_url] properties: name: { type: string } clone_url: { type: string } responses: "200": description: Per-repo clone results content: application/json: schema: type: object properties: results: type: array items: type: object properties: name: { type: string } ok: { type: boolean } project: { type: string, nullable: true } error: { type: string, nullable: true } kb_indexed: type: boolean description: > Whether the clone was also pushed to the knowledge service (/v1/code/scan) for synthesis + embeddings. kb_reason: type: string description: Why the kb scan was skipped (present when kb_indexed is false). "400": description: Missing host/owner/repos, or too many repos (max 100) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/projects/delete: post: summary: Delete a cloned project under the calling webchat user's workspace description: > Delete the project at `ref` ("/" or flat "") from the authenticated `webuser:` principal's workspace (webchat project lifecycle, slice 2). Identity comes EXCLUSIVELY from the attested `X-Aimee-Webuser` layer; a ref outside the caller's tree is a plain 404. Under the project lifecycle lock the last holder of the ref runs the fenced knowledge purge before the filesystem removal; other holders keep the shared knowledge (`kb_status` "retained"). When the knowledge service is unreachable or a store fails, the delete aborts with 503 and nothing is destroyed unless `force` is true, in which case the filesystem proceeds and the response carries the full per-store detail (`kb_status` "forced"). Every attempt, including an abort, writes structured webuser_project_delete_audit_v1 lines sharing the echoed `purge_id`. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [ref] properties: ref: type: string description: The project ref ("/" or flat ""). force: type: boolean description: > Proceed with the filesystem removal even when the knowledge purge fails or the service is unreachable. The response and audit carry the per-store outcome so the purge can be re-run to convergence later. responses: "200": description: Project deleted content: application/json: schema: type: object properties: ok: { type: boolean } ref: { type: string } kb_status: type: string enum: [purged, retained, forced] description: > `purged` means the last holder was removed and all knowledge stores were cleared. `retained` means other holders keep the shared knowledge. `forced` means the filesystem was removed despite a KB failure. purge_id: type: string description: > The operation id shared by every audit line and the knowledge fence for this delete. kb: type: object additionalProperties: true description: > Per-store purge detail (row counts, or {"error": ...}) when a purge ran; absent when retained. "400": description: Missing/invalid ref content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "404": description: The ref does not resolve under the caller's workspace content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: > Knowledge service unavailable or a store failed (without force): nothing was removed; the body's `kb` member carries the detail. A failed purge-cancel is reported here too ("purge committed but unfinished"). Re-running the delete converges. content: application/json: schema: type: object properties: error: { type: string } kb: type: object additionalProperties: true /internal/forge/execute: post: summary: Mechanically execute an authenticated forge operation for Go WFE description: > Internal Unix-socket-only resource-plane seam. The Go WFE supplies an already-decided typed operation; C confines it to a managed WFE worktree and repository, retains the credential, and performs only the authenticated transport. This endpoint owns no workflow state or lifecycle decision and is unavailable over TCP/TLS. requestBody: required: true content: application/json: schema: type: object additionalProperties: false required: [op, workdir] properties: op: { type: string, enum: [push, open, info, ci, merge] } workdir: { type: string } head: oneOf: - { type: string, maxLength: 91, pattern: '^aimee/feat/wi_[A-Za-z0-9_]+$' } - { type: string, maxLength: 89, pattern: '^aimee/wi/wi_[A-Za-z0-9_]+\.s[0-9a-f]{10}\.g[0-9]+\.[0-9]+$' } base: { type: string } title: { type: string, minLength: 1, maxLength: 256 } body: { type: string, minLength: 1, maxLength: 60000 } draft: type: boolean description: Must be true for final feature-to-trunk handoffs and false for slice PRs. number: { type: integer, minimum: 1 } oneOf: - required: [head] properties: { op: { enum: [push] } } not: anyOf: [{ required: [base] }, { required: [title] }, { required: [body] }, { required: [draft] }, { required: [number] }] - required: [head, base, title, body, draft] properties: { op: { enum: [open] } } not: { required: [number] } - required: [number] properties: { op: { enum: [info, ci] } } not: anyOf: [{ required: [head] }, { required: [base] }, { required: [title] }, { required: [body] }, { required: [draft] }] - required: [base, number] properties: { op: { enum: [merge] } } not: anyOf: [{ required: [head] }, { required: [title] }, { required: [body] }, { required: [draft] }] responses: "200": description: Mechanical forge operation completed content: application/json: schema: type: object additionalProperties: true required: [ok] properties: ok: { type: boolean, enum: [true] } "400": description: Invalid request or forge operation failure content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Non-UDS caller or unmanaged repository/worktree content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/git: post: summary: Run a git operation on the calling webchat user's project description: > Run `op` on the authenticated `webuser:` principal's `project`. Read ops: status, log, diff, branch. Write/remote ops: fetch, pull, commit, push, checkout. The project + op are scoped + allowlisted; arguments are validated (no shell); remote ops inject the user's vaulted git creds. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [project, op] properties: project: { type: string } op: type: string enum: [status, log, diff, branch, fetch, pull, commit, push, checkout] message: { type: string, description: Commit message (op=commit) } branch: { type: string, description: Target branch (op=checkout) } n: { type: integer, description: Log entry count (op=log) } session_id: type: string description: > Optional. Run the op in this session's isolated worktree (the same tree its agent edits) rather than the shared project checkout. responses: "200": description: Operation ran content: application/json: schema: type: object properties: ok: { type: boolean } output: { type: string } "400": description: Unknown project/op, invalid argument, or git failure content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/session-dir: post: summary: Resolve a session's working directory for a project description: > Return the absolute directory the given session acts in for `project`: that session's isolated sibling worktree (off the default branch, created on demand) when `session_id` is non-empty, else the project checkout. Lets the editor open the same tree the session's agent edits. Identity is the authenticated `webuser:` principal. Capability: index:read. requestBody: required: true content: application/json: schema: type: object required: [project] properties: project: { type: string } session_id: { type: string } responses: "200": description: Resolved directory content: application/json: schema: type: object properties: dir: { type: string } "400": description: Unknown project or invalid body content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /workspace/editor: post: summary: Ensure the calling webchat user's code-server is running description: > Spawn (or reuse) a code-server for the authenticated `webuser:` principal, rooted at their scoped workspace and launched with their vault-backed git environment, and return its loopback port. The port reaches only webchat (the trusted reverse-proxy), never the browser. On by default (set AIMEE_WEBCHAT_EDITOR=0 to disable); unavailable on images built without a code-server binary. Capability: tool:execute. responses: "200": description: Editor ready content: application/json: schema: type: object properties: ok: { type: boolean } port: { type: integer } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Editor feature disabled or code-server absent content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/credentials: get: summary: List the git hosts that have a stored credential description: > The git hosts (github.com, gitea.*, ...) for which aimee-server holds an access token. Single-user server: credentials are keyed by host, not by user, and stored in the server vault. Tokens are never returned. The response contains only host names. Identity is the attested `webuser:` principal. Capability: tool:execute. responses: "200": description: Configured hosts content: application/json: schema: type: object properties: hosts: { type: array, items: { type: string } } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } post: summary: Store (or replace) the git access token for a host description: > Persist `token` for `host` (a hostname or a full repo URL, reduced to its host) in the server vault. Used by clones/ops on that host. Provider- agnostic. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [host, token] properties: host: { type: string, description: Hostname (or a repo URL) } token: { type: string, description: Access token (write-only) } responses: "200": description: Stored content: application/json: schema: type: object properties: { ok: { type: boolean } } "400": description: Missing host/token content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Remove the stored git access token for a host description: > Delete the token aimee-server holds for `host`. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [host] properties: host: { type: string } responses: "200": description: Removed (or absent) content: application/json: schema: type: object properties: { ok: { type: boolean } } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/sshkey: post: summary: Store (or replace) the caller's SSH private key for git over SSH description: > Persist an unencrypted OpenSSH/PEM private key in the CALLER's own encrypted vault under (`webuser:`, `git`, `ssh_key`), dual-wrapped so the server can load it into the user's in-memory ssh-agent autonomously (it never touches disk and is never returned to the browser). Storing requires the caller's vault to be unlocked; a locked vault returns 423. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [ssh_key] properties: ssh_key: type: string description: Unencrypted OpenSSH/PEM private key (write-only) responses: "200": description: Stored content: application/json: schema: type: object properties: { ok: { type: boolean } } "400": description: Missing or passphrase-encrypted key content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "413": description: Key too large (> 64 KiB) content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "423": description: Vault is locked. Unlock it, then retry. content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } delete: summary: Remove the caller's stored SSH private key description: > Delete the SSH key from the caller's vault and drop any live ssh-agent handle holding it. Idempotent. Capability: tool:execute. responses: "200": description: Removed (or absent) content: application/json: schema: type: object properties: { ok: { type: boolean } } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/github/start: post: summary: Begin GitHub device-flow sign-in description: > Start the GitHub OAuth device flow to populate the github.com credential without a hand-made PAT. Returns a user code + verification URI to show the user; the opaque device_code is held server-side for the poll endpoint. Requires AIMEE_GITHUB_OAUTH_CLIENT_ID. Capability: tool:execute. responses: "200": description: Device code issued content: application/json: schema: type: object properties: ok: { type: boolean } user_code: { type: string } verification_uri: { type: string } interval: { type: integer } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: GitHub sign-in not configured content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/github/poll: post: summary: Poll GitHub device-flow completion description: > Poll for the user completing the device flow. On completion the access token is stored as the github.com credential. Capability: tool:execute. responses: "200": description: Poll result content: application/json: schema: type: object properties: status: { type: string, enum: [pending, done, error] } error: { type: string } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/github/config: get: summary: Read the configured GitHub OAuth App client ID description: > Whether a GitHub OAuth App client ID is configured (set from the UI or the AIMEE_GITHUB_OAUTH_CLIENT_ID env), and the value (public). Capability: tool:execute. responses: "200": description: Config content: application/json: schema: type: object properties: configured: { type: boolean } client_id: { type: string } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } post: summary: Set the GitHub OAuth App client ID description: > Persist the client ID server-side so the "Sign in with GitHub" button works without an env var. The client ID is public (device flow needs no secret). Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [client_id] properties: client_id: { type: string } responses: "200": description: Stored content: application/json: schema: type: object properties: { ok: { type: boolean } } "400": description: Missing client_id content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/github/web/start: post: summary: Begin the GitHub web (authorization-code) sign-in description: > Redirect sign-in: stash a CSRF state and return the GitHub authorize URL for the browser to navigate to. Needs a client ID + secret (the secret enables this flow; without it, use the device flow). The caller supplies redirect_uri (its public callback origin). Capability: tool:execute. requestBody: content: application/json: schema: type: object properties: { redirect_uri: { type: string } } responses: "200": description: Authorize URL issued content: application/json: schema: type: object properties: ok: { type: boolean } authorize_url: { type: string } "400": description: Not configured / missing redirect_uri content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/github/web/callback: post: summary: Complete the GitHub web sign-in description: > Validate the state, exchange the authorization code (+ the client secret and the stashed redirect_uri) for an access token, and store it as the github.com credential. Capability: tool:execute. requestBody: content: application/json: schema: type: object properties: code: { type: string } state: { type: string } responses: "200": description: Result content: application/json: schema: type: object properties: status: { type: string, enum: [done, error] } error: { type: string } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/device/start: post: summary: Begin a GitLab/Gitea device-flow sign-in description: > Start the OAuth 2.0 device flow for a non-GitHub provider (GitLab or Gitea/Forgejo) to populate the host's credential. Returns a user code + verification URI; the opaque device_code is held server-side for the poll endpoint. Requires a client ID registered for (provider, host). Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [provider] properties: provider: { type: string, enum: [gitlab, gitea] } host: { type: string, description: Host (defaults to gitlab.com for GitLab; required for Gitea) } responses: "200": description: Device code issued content: application/json: schema: type: object properties: ok: { type: boolean } user_code: { type: string } verification_uri: { type: string } interval: { type: integer } "400": description: Unknown provider or missing host content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/device/poll: post: summary: Poll GitLab/Gitea device-flow completion description: > Poll for the user completing the device flow. On completion the access token is stored as the host's credential. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [provider] properties: provider: { type: string, enum: [gitlab, gitea] } host: { type: string } responses: "200": description: Poll result content: application/json: schema: type: object properties: status: { type: string, enum: [pending, done, error] } error: { type: string } "400": description: Unknown provider content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /git/oauth/device/config: get: summary: Read a GitLab/Gitea OAuth App client ID description: > Whether an OAuth App client ID is configured for (provider, host), and the value (public). provider + host come from the query string. Capability: tool:execute. parameters: - in: query name: provider required: true schema: { type: string, enum: [gitlab, gitea] } - in: query name: host required: false schema: { type: string } responses: "200": description: Config content: application/json: schema: type: object properties: configured: { type: boolean } client_id: { type: string } "400": description: Unknown provider content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } post: summary: Set a GitLab/Gitea OAuth App client ID description: > Persist the OAuth App client ID for (provider, host) server-side so device sign-in works. The client ID is public. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [provider, client_id] properties: provider: { type: string, enum: [gitlab, gitea] } host: { type: string } client_id: { type: string } responses: "200": description: Stored content: application/json: schema: type: object properties: { ok: { type: boolean } } "400": description: Unknown provider or missing client_id content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /clients: get: summary: List the server owner's paired devices and pending invitations description: > Requires the authenticated browser owner over the trusted local socket. Returns no pairing tokens. Capability: tool:execute. responses: "200": description: Device roster, including pending, paired, expired and revoked entries content: application/json: schema: type: object properties: clients: type: array items: type: object properties: id: { type: string } name: { type: string } serial: { type: string } state: { type: string, enum: [pending, paired, expired, revoked] } created_at: { type: integer } bound_at: { type: integer } expires_at: { type: integer } "403": description: Caller is not the server owner "503": description: Grant store unavailable post: summary: Create an invitation for another client description: > Requires the authenticated browser owner. Each invitation enrolls one certificate with the owner's full grant. Unbound invitations expire after 15 minutes; paired grants remain until revoked. Existing clients are preserved. Works independently of deployment. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [name] properties: name: { type: string, minLength: 1, maxLength: 64, description: Device label, at most 64 UTF-8 bytes } responses: "200": description: Invitation; cleartext token is returned only at creation content: application/json: schema: type: object properties: id: { type: string } name: { type: string } bearer_token: { type: string } tls_port: { type: integer } expires_at: { type: integer } "400": description: Invalid device name "403": description: Caller is not the server owner "409": description: Limit of 64 active clients and pending invitations reached "503": description: Grant store unavailable /clients/revoke: post: summary: Revoke one device or cancel a pending invitation description: > Requires the authenticated browser owner. Revokes the selected grant and its certificate, preserving other devices. Safe to retry. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [id] properties: id: { type: string, pattern: '^[0-9a-f]{64}$' } responses: "200": description: Device revoked "400": description: Invalid device identifier "403": description: Caller is not the server owner "404": description: Unknown device "503": description: Revocation could not be completed; retry the request /deploy/apply: post: summary: Bring up the managed sibling services description: > Server-orchestrated deploy: run `docker compose up -d` for the managed one-KB profile the current wizard config selects, on a background thread. Atomically claims the authenticated wizard user as the first remote owner and returns that user's enrollment-only bearer; CSR signing later binds its explicit full grant to mTLS. Requires AIMEE_DEPLOY_ENABLED + a mounted Docker socket. Capability: tool:execute. responses: "200": description: Deploy started (or already running) content: application/json: schema: type: object properties: ok: { type: boolean } status: { type: string, enum: [started, running] } enrollment: type: object required: [state, principal, tier, mtls, tls_port] properties: state: { type: string, enum: [ready, paired] } principal: { type: string, example: "webuser:aimee" } tier: { type: string, enum: [full] } mtls: { type: boolean } tls_port: { type: integer } bearer_token: type: string description: Present only while the first user's mTLS enrollment is pending. "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Server-orchestrated deploy is disabled content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /deploy/status: get: summary: Deploy progress + docker compose ps description: > The background deploy's state (running / last exit / output tail) plus `docker compose ps` for the managed services. Capability: tool:execute. responses: "200": description: Deploy status content: application/json: schema: type: object properties: enabled: { type: boolean } running: { type: boolean } last_exit: { type: integer, nullable: true } output: { type: string } ps: { type: string } "403": description: Not a webchat user content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } "503": description: Server-orchestrated deploy is disabled content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /runner/poll: post: summary: Poll for the next detached-workspace op to execute (reverse channel) description: > The filesystem-authority client serving a `detached` workspace polls for the next op the server needs run against its working tree. Returns immediately with have_op:false when nothing is pending (bounded wait); the client re-polls. Capability: tool:execute. workspace_id is a workspace root, or a CLI's private runner channel ("runner:" and 32 lowercase hex digits) that the CLI also sends as X-Aimee-Runner on its own requests, so their ops are run by that CLI only. A channel opens on its first poll; close:true closes it. requestBody: required: true content: application/json: schema: type: object required: [workspace_id] properties: workspace_id: { type: string } close: { type: boolean, description: "Close this runner channel instead of polling it." } responses: "200": description: An op to execute, or have_op:false content: application/json: schema: type: object properties: ok: { type: boolean } have_op: { type: boolean } op: { type: object } "400": description: Missing workspace_id content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } /runner/respond: post: summary: Post the result of a detached-workspace op (reverse channel) description: > The serving client posts the result of the op it just executed back to the server-side transport blocked on this workspace's queue. Capability: tool:execute. requestBody: required: true content: application/json: schema: type: object required: [workspace_id, response] properties: workspace_id: { type: string } response: { type: object } responses: "200": description: Result delivered content: application/json: schema: type: object properties: ok: { type: boolean } "404": description: No runner registered for the workspace content: application/json: schema: { $ref: '#/components/schemas/ErrorResponse' } security: - bearerAuth: []