Reference
Public endpoint reference
This page is generated from the public registry in packages/contract. An endpoint appears only
after its route, authorization requirement, and request and response schemas are ready to support as
a developer contract.
api_key means any valid ordinary key. workspace_member additionally requires membership in the
workspace named by the path. Operations that exist only for the signed-in dashboard are omitted;
third-party integrations authenticate with ordinary API keys.
Identity
17 operations /v1 /whoamiInspect the authenticated user, workspace memberships, and granted scopes.
- Scope
api_key- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "user": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "name": { "type": "string" } }, "required": [ "id", "email" ], "additionalProperties": false }, "workspaces": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "slug": { "type": "string" }, "name": { "type": "string" }, "status": { "type": "string", "enum": [ "provisioning", "active", "unhealthy", "archived", "retired", "deleted" ] }, "servicingStatus": { "type": "string", "enum": [ "active", "paused", "banned" ] }, "servicingStatusChangedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] }, "billingUserId": { "type": "string" }, "funding": { "type": "object", "properties": { "plan": { "anyOf": [ { "type": "string", "enum": [ "starter", "pro", "max" ] }, { "type": "null" } ] }, "active": { "type": "boolean" }, "trialEndsAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "plan", "active" ], "additionalProperties": false }, "defaultTier": { "type": "object", "properties": { "configured": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effective": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "access": { "type": "string", "enum": [ "all_tiers", "economy_only" ] } }, "required": [ "effective", "access" ], "additionalProperties": false }, "duetName": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "purpose": { "type": "string", "minLength": 1, "maxLength": 1000 }, "onboardedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "onboarding": { "type": "object", "properties": { "starterAgents": { "type": "array", "items": { "type": "string" } } }, "required": [ "starterAgents" ], "additionalProperties": false }, "adminMessage": { "type": "string" } }, "required": [ "id", "slug", "name", "status", "servicingStatus", "role", "billingUserId", "funding", "defaultTier" ], "additionalProperties": false } }, "scopes": { "type": "array", "items": { "type": "string" } }, "versions": { "type": "object", "properties": { "api": { "type": "number", "const": 1 } }, "required": [ "api" ], "additionalProperties": false }, "internalAdmin": { "type": "boolean" }, "credential": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "user", "system_vm", "app", "impersonation", "browser_session", "sync_device", "oauth" ] }, "audience": { "type": "string", "format": "uri" } }, "required": [ "kind" ], "additionalProperties": false } }, "required": [ "user", "workspaces", "scopes", "versions", "internalAdmin" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspacesCreate a workspace and begin asynchronous provisioning.
- Scope
api_key- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1 } }, "required": [ "slug", "name" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "workspaceId": { "type": "string" }, "slug": { "type": "string" }, "status": { "type": "string", "const": "provisioning" } }, "required": [ "workspaceId", "slug", "status" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /reprovisionReplace an owner-managed workspace runtime after an explicit recovery request.
- Scope
ws:{workspaceSlug}:admin- Request
- No request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "provisioning" }, "workspaceId": { "type": "string" }, "scheduled": { "type": "boolean" }, "oldVmName": { "type": "string" }, "imageRef": { "type": "string" }, "archiveStorageId": { "type": "string" } }, "required": [ "status", "workspaceId", "scheduled" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "deferred" }, "reason": { "type": "string", "const": "active_workspace_work" }, "activeAgentSessions": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "activeTrainJobs": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "status", "reason", "activeAgentSessions", "activeTrainJobs" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug}Rename a workspace after acknowledging that its public addresses will break.
- Scope
ws:{workspaceSlug}:admin- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" }, "publicUrlBreakAcknowledged": { "type": "boolean", "const": true } }, "required": [ "slug", "publicUrlBreakAcknowledged" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "breaksPublicUrls": { "type": "boolean", "const": true } }, "required": [ "ok", "breaksPublicUrls" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /admin /suspensionSuspend or resume an owner-managed workspace.
- Scope
ws:{workspaceSlug}:admin- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "suspended": { "type": "boolean" }, "reason": { "type": "string" } }, "required": [ "suspended" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "suspended": { "type": "boolean", "const": true }, "suspendedAt": { "type": "number" }, "suspensionReason": { "type": "string" } }, "required": [ "suspended", "suspendedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "suspended": { "type": "boolean", "const": false } }, "required": [ "suspended" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /admin /suspensionRead whether the workspace is suspended, since when, and why.
- Scope
ws:{workspaceSlug}:admin- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "suspended": { "type": "boolean", "const": true }, "suspendedAt": { "type": "number" }, "suspensionReason": { "type": "string" } }, "required": [ "suspended", "suspendedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "suspended": { "type": "boolean", "const": false } }, "required": [ "suspended" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /anchorsList path anchors and their current health.
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "anchors": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "path": { "type": "string" }, "kind": { "type": "string", "enum": [ "app", "agent", "publish", "share-root", "share-mount" ] }, "settings": {}, "state": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "id", "workspaceId", "path", "kind", "settings", "state", "createdAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "anchors" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /anchors /{anchorId} /reanchorRepair a broken anchor after its workspace path moves.
- Scope
ws:{workspaceSlug}:appsorws:{workspaceSlug}:publishorws:{workspaceSlug}:share- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string" } }, "required": [ "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "anchor": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "path": { "type": "string" }, "kind": { "type": "string", "enum": [ "app", "agent", "publish", "share-root", "share-mount" ] }, "settings": {}, "state": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "id", "workspaceId", "path", "kind", "settings", "state", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "anchor" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /membersList current workspace members and the designated payer.
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "members": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "name": { "type": "string" }, "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] }, "isBillingUser": { "type": "boolean" } }, "required": [ "id", "email", "role", "isBillingUser" ], "additionalProperties": false } } }, "required": [ "members" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /members /{userId}Change a member role while preserving payer and final-owner invariants.
- Scope
ws:{workspaceSlug}:admin- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] } }, "required": [ "role" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "member": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "name": { "type": "string" }, "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] }, "isBillingUser": { "type": "boolean" } }, "required": [ "id", "email", "role", "isBillingUser" ], "additionalProperties": false } }, "required": [ "member" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /members /{userId}Remove a member after payer and final-owner checks pass.
- Scope
ws:{workspaceSlug}:admin- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "removed": { "type": "boolean" } }, "required": [ "removed" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /default-modelSet the workspace model role used when a session has no sticky choice.
- Scope
ws:{workspaceSlug}:admin- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "tier" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "tier" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /auditPage through newest-first workspace audit events.
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cursor": { "type": "string" }, "limit": { "default": 25, "type": "integer", "minimum": 1, "maximum": 100 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "event": { "type": "string" }, "actorId": { "type": "string" }, "at": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "provenance": { "type": "object", "properties": { "action": { "type": "string" }, "activeAgentSessions": { "type": "number" }, "activeTrainJobs": { "type": "number" }, "actor": { "type": "string" }, "acknowledged": { "type": "boolean" }, "agentVersion": { "type": "string" }, "anchorId": { "type": "string" }, "appId": { "type": "string" }, "appSlug": { "type": "string" }, "agentId": { "type": "string" }, "archiveStorageId": { "type": "string" }, "breaksPublicUrls": { "type": "boolean" }, "canonicalEmail": { "type": "string" }, "candidates": { "type": "array", "items": { "type": "object", "properties": { "fromPath": { "type": "string" }, "toPath": { "type": "string" }, "confidence": { "type": "number" }, "inodeMatch": { "type": "boolean" }, "markerMatch": { "type": "boolean" } }, "required": [ "fromPath", "toPath", "confidence", "inodeMatch", "markerMatch" ], "additionalProperties": false } }, "conflictingAnchorId": { "type": "string" }, "conflictingPath": { "type": "string" }, "confidence": { "type": "number" }, "consecutiveMissingPolls": { "type": "number" }, "deleted": { "type": "array", "items": { "type": "string" } }, "deviceCode": { "type": "string" }, "deviceId": { "type": "string" }, "deviceName": { "type": "string" }, "defaultModelId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "expiresAt": { "type": "number" }, "fromPath": { "type": "string" }, "fromWorkspaceId": { "type": "string" }, "gatewayVersion": { "type": "string" }, "generation": { "type": "string" }, "imageRef": { "type": "string" }, "imageVersion": { "type": "string" }, "inodeMatch": { "type": "boolean" }, "installMode": { "type": "string", "enum": [ "subscribe", "clone_once" ] }, "kind": { "type": "string", "enum": [ "app", "agent", "publish", "share-root", "share-mount", "file", "folder" ] }, "lastHeartbeatAt": { "type": "number" }, "listingId": { "type": "string" }, "listingSlug": { "type": "string" }, "markerMatch": { "type": "boolean" }, "memberUserId": { "type": "string" }, "name": { "type": "string" }, "newBillingUserId": { "type": "string" }, "mode": { "type": "string", "enum": [ "read", "write" ] }, "mountPath": { "type": "string" }, "newSlug": { "type": "string" }, "oldPrefixes": { "type": "array", "items": { "type": "string" } }, "oldBillingUserId": { "type": "string" }, "oldSlug": { "type": "string" }, "parentShareId": { "type": "string" }, "path": { "type": "string" }, "prefix": { "type": "string" }, "prefixes": { "type": "array", "items": { "type": "string" } }, "previousVmName": { "type": "string" }, "publishId": { "type": "string" }, "reason": { "type": "string" }, "revokedShareIds": { "type": "array", "items": { "type": "string" } }, "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] }, "oldRole": { "type": "string", "enum": [ "owner", "editor", "viewer" ] }, "scopes": { "type": "array", "items": { "type": "string" } }, "sessionId": { "type": "string" }, "shareId": { "type": "string" }, "slug": { "type": "string" }, "source": { "type": "string" }, "subscriptionId": { "type": "string" }, "targetEmail": { "type": "string" }, "toPath": { "type": "string" }, "toWorkspaceId": { "type": "string" }, "userCode": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "vmName": { "type": "string" } }, "additionalProperties": false } }, "required": [ "id", "event", "actorId", "at" ], "additionalProperties": false } }, "cursor": { "type": "string" }, "done": { "type": "boolean" } }, "required": [ "events", "done" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /telemetryRead the workspace VM CPU, memory, and disk telemetry history.
- Scope
workspace_member- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "sinceAt": { "type": "number", "minimum": 0 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "samples": { "type": "array", "items": { "type": "object", "properties": { "at": { "type": "number", "minimum": 0 }, "cpuPct": { "type": "number", "minimum": 0, "maximum": 100 }, "memUsedMb": { "type": "number", "minimum": 0 }, "memTotalMb": { "type": "number", "minimum": 0 }, "diskUsedMb": { "type": "number", "minimum": 0 }, "diskTotalMb": { "type": "number", "minimum": 0 } }, "required": [ "at" ], "additionalProperties": false } } }, "required": [ "samples" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /invitesInvite an editor or viewer by canonical email address.
- Scope
ws:{workspaceSlug}:members- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "role": { "description": "Defaults to editor.", "type": "string", "enum": [ "editor", "viewer" ] } }, "required": [ "email" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "role": { "type": "string", "enum": [ "editor", "viewer" ] }, "expiresAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "revokedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "consumedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "email", "role", "expiresAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /invitesList recent invitations for a workspace.
- Scope
ws:{workspaceSlug}:members- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "invites": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "role": { "type": "string", "enum": [ "editor", "viewer" ] }, "expiresAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "revokedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "consumedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "email", "role", "expiresAt" ], "additionalProperties": false } } }, "required": [ "invites" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /invites /{inviteId}Revoke an invitation before it is consumed.
- Scope
ws:{workspaceSlug}:members- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "revokedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "revokedAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Sessions
27 operations /v1 /ws /{workspaceSlug} /agent /sessionsList, search, and page sessions by bucket
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cursor": { "type": "string", "minLength": 1 }, "limit": { "default": 20, "type": "integer", "minimum": 1, "maximum": 100 }, "search": { "type": "string", "maxLength": 200 }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "archived": { "default": "exclude", "type": "string", "enum": [ "exclude", "only" ] }, "agentId": { "type": "string", "minLength": 1 }, "excludeDefault": { "anyOf": [ { "type": "boolean", "const": true }, { "type": "string", "const": "true" } ] } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread" ], "additionalProperties": false } }, "nextCursor": { "type": "string" } }, "required": [ "sessions" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessionsCreate a session from its first user message
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "mode": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ] } }, "required": [ "prompt" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "session": { "type": "object", "properties": { "sessionId": { "type": "string" }, "status": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "sessionId", "status", "lastEventSeq", "lastDeliveredInputSeq" ], "additionalProperties": false }, "snapshot": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "deliveryAttempt": { "type": "object", "properties": { "attemptId": { "type": "string", "minLength": 1 }, "throughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "kind": { "type": "string", "enum": [ "initial_prompt", "message", "answer" ] }, "createdAt": { "type": "number" } }, "required": [ "attemptId", "throughSeq", "kind", "createdAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "requestedMachine": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "machineState": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, "history": { "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "nextCursor": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": false }, "dispatched": { "type": "boolean", "const": false }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "session", "snapshot", "history", "dispatched", "delivery" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /attachments /sessionMint short-lived credentials for direct file uploads to an agent folder
- Scope
ws:{workspaceSlug}:files:write- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "vmBaseUrl": { "type": "string", "format": "uri" }, "uploadPath": { "type": "string", "minLength": 1 }, "uploadToken": { "type": "string", "minLength": 1 }, "expiresAt": { "type": "number" }, "prefix": { "type": "string", "minLength": 1 } }, "required": [ "vmBaseUrl", "uploadPath", "uploadToken", "expiresAt", "prefix" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /waitCreate a session and wait for the submitted turn to finish
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "mode": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ] } }, "required": [ "prompt", "clientRequestId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "terminal": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "required": [ "sessionId", "inputSeq", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": [ "sessionId", "inputSeq", "status" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /sessionsCreate a child session inheriting its parent context
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "mode": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ] } }, "required": [ "prompt" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "session": { "type": "object", "properties": { "sessionId": { "type": "string" }, "status": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "sessionId", "status", "lastEventSeq", "lastDeliveredInputSeq" ], "additionalProperties": false }, "snapshot": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "deliveryAttempt": { "type": "object", "properties": { "attemptId": { "type": "string", "minLength": 1 }, "throughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "kind": { "type": "string", "enum": [ "initial_prompt", "message", "answer" ] }, "createdAt": { "type": "number" } }, "required": [ "attemptId", "throughSeq", "kind", "createdAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "requestedMachine": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "machineState": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, "history": { "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "nextCursor": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": false }, "dispatched": { "type": "boolean", "const": false }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "session", "snapshot", "history", "dispatched", "delivery" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /sessions /waitCreate a child session and wait for the submitted turn to finish
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "mode": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ] } }, "required": [ "prompt", "clientRequestId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "terminal": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "required": [ "sessionId", "inputSeq", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": [ "sessionId", "inputSeq", "status" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId}Get a session snapshot
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "deliveryAttempt": { "type": "object", "properties": { "attemptId": { "type": "string", "minLength": 1 }, "throughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "kind": { "type": "string", "enum": [ "initial_prompt", "message", "answer" ] }, "createdAt": { "type": "number" } }, "required": [ "attemptId", "throughSeq", "kind", "createdAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "requestedMachine": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "machineState": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /sessions /defaultGet an agent's default session snapshot
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "session": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "deliveryAttempt": { "type": "object", "properties": { "attemptId": { "type": "string", "minLength": 1 }, "throughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "kind": { "type": "string", "enum": [ "initial_prompt", "message", "answer" ] }, "createdAt": { "type": "number" } }, "required": [ "attemptId", "throughSeq", "kind", "createdAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "requestedMachine": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "machineState": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "session" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /sessions /defaultPoint an agent's default session alias at a session, or at nothing
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "sessionId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "sessionId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "session": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "deliveryAttempt": { "type": "object", "properties": { "attemptId": { "type": "string", "minLength": 1 }, "throughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "kind": { "type": "string", "enum": [ "initial_prompt", "message", "answer" ] }, "createdAt": { "type": "number" } }, "required": [ "attemptId", "throughSeq", "kind", "createdAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "requestedMachine": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "machineState": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "session" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /sessions /default /historyPage through an agent's default session history
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cursor": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "before": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "limit": { "default": 100, "type": "integer", "minimum": 1, "maximum": 500 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "nextCursor": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "const": "no_default_session" } }, "required": [ "error" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /sessions /default /messagesCreate or message an agent's default session
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 }, "agentFirstMessage": { "type": "string", "maxLength": 2000 } }, "required": [ "prompt" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "session": { "type": "object", "properties": { "sessionId": { "type": "string" }, "status": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "sessionId", "status", "lastEventSeq", "lastDeliveredInputSeq" ], "additionalProperties": false }, "snapshot": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "lastDeliveredInputSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "deliveryAttempt": { "type": "object", "properties": { "attemptId": { "type": "string", "minLength": 1 }, "throughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "kind": { "type": "string", "enum": [ "initial_prompt", "message", "answer" ] }, "createdAt": { "type": "number" } }, "required": [ "attemptId", "throughSeq", "kind", "createdAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "requestedMachine": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "machineState": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, "history": { "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "nextCursor": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": false }, "dispatched": { "type": "boolean", "const": false }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "session", "snapshot", "history", "dispatched", "delivery" ], "additionalProperties": false }, { "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "ok", "delivery", "sessionId" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /sessions /default /messages /waitCreate or message an agent's default session and wait for the turn
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "prompt", "clientRequestId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "terminal": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "required": [ "sessionId", "inputSeq", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": [ "sessionId", "inputSeq", "status" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /historyPage through durable session events
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cursor": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "before": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "limit": { "default": 100, "type": "integer", "minimum": 1, "maximum": 500 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "nextCursor": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "events" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /eventsResume a session event stream
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "since": { "default": 0, "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } }- Headers
Last-Event-ID— Resume after the last committed numeric sequence.
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] } }, "required": [ "event" ], "additionalProperties": false }- Delivery
- Server-sent event stream
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /images /{storageId}Read an image referenced by a session event.
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Response
- Raw byte stream
- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /messagesSend a user message to a session
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "prompt" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "ok", "delivery" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /messages /waitSend a user message and wait for the submitted turn to finish
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "prompt", "clientRequestId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "terminal": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "required": [ "sessionId", "inputSeq", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": [ "sessionId", "inputSeq", "status" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /cwdMove a session to another working directory
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" } }, "required": [ "cwd" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "session": { "type": "object", "properties": { "id": { "type": "string" }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" } }, "required": [ "id", "cwd" ], "additionalProperties": false } }, "required": [ "session" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cwd" }, "reason": { "type": "string", "enum": [ "missing", "not_a_directory", "outside_drive", "outside_agent_anchor" ] } }, "required": [ "error", "reason" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /noteAdd context to a session without starting a turn
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "note": { "type": "string", "minLength": 1, "maxLength": 16384 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "note" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "seq" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /answerAnswer a session waiting for user input
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "answer": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "answer" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "ok", "delivery" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /answer /waitAnswer a session and wait for the submitted turn to finish
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "answer": { "type": "string", "minLength": 1 }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] } }, "required": [ "data", "mimeType" ] } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ] } }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "answer", "clientRequestId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "cwd": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^[^\\u0000-\\u001f\\u007f]+$" }, "terminal": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "anyOf": [ { "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "step" }, "step": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning_delta" }, "delta": { "type": "string" } }, "required": [ "type", "delta" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "reasoning" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call_start" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "type", "toolName", "toolCallId" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tool_call" }, "toolName": { "type": "string" }, "toolCallId": { "type": "string" }, "input": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "isError": { "type": "boolean" }, "output": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image" }, "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "type", "data", "mimeType" ], "additionalProperties": false } ] } }, "details": {} }, "required": [ "type", "toolName", "toolCallId", "isError" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "message": { "type": "string" } }, "required": [ "type", "message" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "step" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_started" }, "task": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "task" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_output" }, "taskId": { "type": "string", "pattern": "^t\\d+$" }, "chunk": { "type": "string" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "taskId", "chunk" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "task_settled" }, "settlement": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "completed" }, "settledAt": { "type": "number" }, "result": {} }, "required": [ "id", "status", "settledAt", "result" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "failed" }, "settledAt": { "type": "number" }, "error": {} }, "required": [ "id", "status", "settledAt", "error" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "stopped" }, "settledAt": { "type": "number" }, "reason": { "type": "string" } }, "required": [ "id", "status", "settledAt", "reason" ], "additionalProperties": false }, { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "status": { "type": "string", "const": "lost" }, "settledAt": { "type": "number" } }, "required": [ "id", "status", "settledAt" ], "additionalProperties": false } ] }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "settlement" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "heartbeat" }, "timestamp": { "type": "number" }, "activeTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } } }, "required": [ "type", "timestamp", "activeTaskIds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "todos" }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } } }, "required": [ "type", "todos" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "follow_up_queue" }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } } }, "required": [ "type", "followUpQueue" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "state_machine" }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "type", "stateMachine" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "memory" }, "phase": { "type": "string", "enum": [ "observation", "reflection" ] }, "status": { "type": "string", "enum": [ "running", "completed" ] }, "message": { "type": "string" }, "observations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "usageBumpedObservations": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "type", "phase", "status", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "usage" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "turnUsage", "usageByModel", "lastMessageUsage", "effectiveContextWindow", "contextWindowUsage" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "system" }, "level": { "type": "string", "enum": [ "debug", "info", "warn", "error" ] }, "message": { "type": "string" }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable" ] } }, "required": [ "code" ], "additionalProperties": false } }, "required": [ "type", "level", "message" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "router_switch" }, "tier": { "type": "string" }, "route": { "type": "string" }, "fromModel": { "type": "string" }, "toModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] }, "trigger": { "type": "string", "enum": [ "turn_start", "cadence", "advisor", "step_trigger", "compaction" ] }, "rationale": { "type": "string" }, "visionFallback": { "type": "boolean" }, "origin": { "type": "object", "properties": { "taskId": { "type": "string", "pattern": "^t\\d+$" } }, "required": [ "taskId" ], "additionalProperties": false } }, "required": [ "type", "tier", "route", "fromModel", "toModel", "thinkingLevel", "trigger", "rationale", "visionFallback" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "status" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "state": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting_for_human", "sleeping", "interrupted", "completed", "failed", "cancelled" ] }, "mode": { "anyOf": [ { "type": "string", "const": "agent" }, { "type": "string", "const": "auto" }, { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false } ] }, "options": { "type": "object", "properties": { "model": { "type": "string" }, "memoryModel": { "type": "string" }, "thinkingLevel": { "type": "string", "enum": [ "minimal", "low", "medium", "high", "xhigh" ] } }, "additionalProperties": false }, "agent": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "running", "waiting", "completed", "failed", "cancelled" ] }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" } }, "required": [ "role" ], "additionalProperties": {} } } }, "required": [ "status", "messages" ], "additionalProperties": false }, "stateMachine": { "type": "object", "properties": { "definition": { "type": "object", "properties": { "name": { "type": "string" }, "prompt": { "type": "string" }, "states": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "name", "prompt", "states" ], "additionalProperties": false }, "prompt": { "type": "string" }, "currentState": { "type": "string" }, "currentInput": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "progress": { "type": "object", "properties": { "states": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } } }, "required": [ "states" ], "additionalProperties": {} }, "history": { "type": "array", "items": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "terminal": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "terminalAcknowledged": { "type": "boolean" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "definition", "prompt", "history", "createdAt", "updatedAt" ], "additionalProperties": false }, "todos": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "content": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "in_progress", "completed", "failed" ] } }, "required": [ "id", "content", "status" ], "additionalProperties": false } }, "followUpQueue": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "message" ], "additionalProperties": false } }, "queuedCommands": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt" }, "message": { "type": "string" }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "message", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "answers": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "message": { "type": "string" }, "images": { "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "mimeType": { "type": "string" } }, "required": [ "data", "mimeType" ], "additionalProperties": false } } }, "required": [ "type", "questions", "answers", "behavior" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "wake" } }, "required": [ "type" ], "additionalProperties": false } ] } }, "tasks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "pattern": "^t\\d+$" }, "kind": { "type": "string", "enum": [ "tool", "subagent", "scheduled" ] }, "name": { "type": "string" }, "label": { "type": "string" }, "ownerScopeId": { "anyOf": [ { "type": "string", "pattern": "^turn-\\d+$" }, { "type": "string", "pattern": "^task:t\\d+$" } ] }, "status": { "type": "string", "enum": [ "running", "scheduled", "completed", "failed", "stopped", "lost" ] }, "startedAt": { "type": "number" }, "wakeAt": { "type": "number" } }, "required": [ "id", "kind", "name", "label", "ownerScopeId", "status", "startedAt" ], "additionalProperties": false } }, "taskOutputTails": { "type": "object", "propertyNames": { "type": "string", "pattern": "^t\\d+$" }, "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "pendingLostTaskReminderTaskIds": { "type": "array", "items": { "type": "string", "pattern": "^t\\d+$" } }, "nextTaskId": { "type": "number" }, "wireGuardHorizon": { "type": "object", "properties": { "evictionHorizon": { "type": "number" } }, "required": [ "evictionHorizon" ], "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "state", "wakeAt" ], "additionalProperties": false } ] }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "turn_started" } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "complete" }, "status": { "type": "string", "enum": [ "completed", "failed", "cancelled" ] }, "result": { "type": "string" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "ask" }, "status": { "type": "string", "const": "ask" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "header": { "type": "string" }, "options": { "type": "array", "items": { "type": "object", "properties": { "label": { "type": "string" }, "description": { "type": "string" } }, "required": [ "label" ], "additionalProperties": false } }, "multiSelect": { "type": "boolean" } }, "required": [ "question", "options" ], "additionalProperties": false } }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "questions" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupted" }, "status": { "type": "string", "const": "interrupted" }, "error": { "type": "string" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "sleep" }, "status": { "type": "string", "const": "sleep" }, "wakeAt": { "type": "number" }, "turnUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "usageByModel": { "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "transport": { "type": "object", "properties": { "provider": { "anyOf": [ { "type": "string", "enum": [ "duet-gateway", "vercel-ai-gateway", "openrouter" ] }, { "type": "string", "enum": [ "openai-codex", "github-copilot" ] } ] }, "billing": { "type": "string", "enum": [ "plan-covered", "metered" ] } }, "required": [ "provider", "billing" ], "additionalProperties": false }, "usage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false } }, "required": [ "model", "transport", "usage" ], "additionalProperties": false } }, "lastMessageUsage": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "cacheWrite1h": { "type": "number" }, "totalTokens": { "type": "number" }, "cost": { "type": "object", "properties": { "input": { "type": "number" }, "output": { "type": "number" }, "cacheRead": { "type": "number" }, "cacheWrite": { "type": "number" }, "total": { "type": "number" } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "total" ], "additionalProperties": false } }, "required": [ "input", "output", "cacheRead", "cacheWrite", "totalTokens", "cost" ], "additionalProperties": false }, "effectiveContextWindow": { "type": "number" }, "contextWindowUsage": { "type": "object", "properties": { "systemPrompt": { "type": "number" }, "messages": { "type": "number" }, "localMemory": { "type": "number" }, "globalMemory": { "type": "number" } }, "required": [ "systemPrompt", "messages", "localMemory", "globalMemory" ], "additionalProperties": false } }, "required": [ "type", "wakeAt" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "type": { "type": "string", "const": "session_created" }, "prompt": { "type": "string" }, "createdAt": { "type": "string" }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" } }, "required": [ "type", "prompt", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "interrupt_requested" }, "requestedAt": { "type": "string" } }, "required": [ "type", "requestedAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "tier_clamped" }, "requestedTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "effectiveTier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] } }, "required": [ "type", "requestedTier", "effectiveTier" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "prompt_submitted" }, "prompt": { "type": "string" }, "inputKind": { "type": "string", "enum": [ "initial", "message" ] }, "behavior": { "type": "string", "enum": [ "steer", "follow_up" ] }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "prompt", "inputKind", "behavior", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "note_submitted" }, "note": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "note", "sender" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "answer_submitted" }, "answer": { "type": "string" }, "sender": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "user" }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "userId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "app" }, "appId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "appId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "system" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "clientRequestId": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "images": { "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "storageId": { "type": "string", "minLength": 1 }, "mimeType": { "type": "string", "enum": [ "image/png", "image/jpeg", "image/webp", "image/gif" ] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 5242880 } }, "required": [ "storageId", "mimeType", "bytes" ], "additionalProperties": false } }, "attachments": { "maxItems": 10, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mimeType": { "type": "string", "minLength": 1 } }, "required": [ "path", "name", "bytes" ], "additionalProperties": false } } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] }, "createdAt": { "type": "number" } }, "required": [ "seq", "event", "createdAt" ], "additionalProperties": false } }, "required": [ "sessionId", "inputSeq", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "pending" } }, "required": [ "sessionId", "inputSeq", "status" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /interruptInterrupt a running session
- Scope
ws:{workspaceSlug}:sessions- Request
- No request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId}Permanently replace the generated session title
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 120 } }, "required": [ "title" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /archiveArchive or restore a session
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "archived": { "type": "boolean" } }, "required": [ "archived" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /activityEvery agent’s prioritized recent sessions in one request
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "limitPerAgent": { "default": 24, "type": "integer", "minimum": 1, "maximum": 100 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "owners": { "type": "array", "items": { "type": "object", "properties": { "agentId": { "type": "string" }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread" ], "additionalProperties": false } }, "truncated": { "type": "boolean" }, "chat": { "type": "object", "properties": { "id": { "type": "string" }, "userId": { "type": "string" }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "archivedAt": { "type": "number" }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "definitionName": { "type": "string" }, "currentState": { "type": "string" }, "followingDefinitionState": { "type": "string" }, "progress": { "type": "object", "properties": { "completed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "completed", "total" ], "additionalProperties": false }, "orderedPath": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "name": { "type": "string" }, "kind": { "type": "string" }, "phase": { "type": "string", "enum": [ "past", "current", "future", "outcome" ] }, "terminalStatus": { "type": "string", "enum": [ "completed", "failed", "cancelled", "error" ] } }, "required": [ "key", "index", "name", "phase" ], "additionalProperties": false } }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "orderedPath", "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" } }, "required": [ "id", "userId", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread" ], "additionalProperties": false } }, "required": [ "agentId", "sessions", "truncated" ], "additionalProperties": false } } }, "required": [ "owners" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /readMark a session read up to an event sequence number
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "seq" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "lastReadSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "lastReadSeq" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId}Stop and permanently delete a session
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "deleted": { "type": "boolean", "const": true } }, "required": [ "deleted" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Desktop
3 operations /v1 /ws /{workspaceSlug} /desktop /sessionMint a short-lived, origin-bound viewer URL for the shared workspace desktop.
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "embedOrigin": { "type": "string" } }, "required": [ "embedOrigin" ], "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "entryUrl": { "type": "string", "format": "uri" }, "expiresAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "phase": { "type": "string", "enum": [ "stopped", "starting", "ready" ] }, "screen": { "type": "object", "properties": { "width": { "type": "number", "const": 1440 }, "height": { "type": "number", "const": 900 } }, "required": [ "width", "height" ], "additionalProperties": false } }, "required": [ "entryUrl", "expiresAt", "phase", "screen" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "anyOf": [ { "type": "object", "properties": { "error": { "anyOf": [ { "type": "string", "enum": [ "unauthorized", "not_found", "desktop_gateway_failed" ] }, { "type": "string", "enum": [ "workspace_paused", "workspace_provisioning", "workspace_unhealthy", "workspace_archived" ] } ] } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "insufficient_scope" }, "scope": { "type": "string", "minLength": 1 } }, "required": [ "error", "scope" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_request" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "desktop_unavailable" } }, "required": [ "error" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /desktop /statusRead the shared desktop lifecycle, viewer count, and browser-owner activity.
- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "phase": { "type": "string", "enum": [ "stopped", "starting", "ready" ] }, "viewers": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "owners": { "type": "array", "items": { "type": "object", "properties": { "owner": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "root" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "agent" }, "agentId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "agentId" ], "additionalProperties": false } ] }, "agentSlug": { "type": "string", "minLength": 1 }, "agentName": { "type": "string", "minLength": 1 }, "phase": { "type": "string", "enum": [ "active", "cooling", "idle" ] }, "focused": { "type": "boolean" }, "liveBatchCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "batchTabCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "discardedBatchTabCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastActiveAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "owner", "phase", "focused", "liveBatchCount", "batchTabCount", "discardedBatchTabCount", "lastActiveAt" ], "additionalProperties": false } } }, "required": [ "phase", "viewers", "owners" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "error": { "anyOf": [ { "type": "string", "enum": [ "unauthorized", "not_found", "desktop_gateway_failed" ] }, { "type": "string", "enum": [ "workspace_paused", "workspace_provisioning", "workspace_unhealthy", "workspace_archived" ] } ] } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "insufficient_scope" }, "scope": { "type": "string", "minLength": 1 } }, "required": [ "error", "scope" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /desktop /focusFocus an existing root or named-agent browser window without creating one.
- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "requestId": { "type": "string", "minLength": 1, "maxLength": 128 } }, "required": [ "requestId" ], "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "focused": { "type": "boolean" } }, "required": [ "focused" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "anyOf": [ { "type": "object", "properties": { "error": { "anyOf": [ { "type": "string", "enum": [ "unauthorized", "not_found", "desktop_gateway_failed" ] }, { "type": "string", "enum": [ "workspace_paused", "workspace_provisioning", "workspace_unhealthy", "workspace_archived" ] } ] } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "insufficient_scope" }, "scope": { "type": "string", "minLength": 1 } }, "required": [ "error", "scope" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_request" } }, "required": [ "error" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Declared idempotent
Apps
9 operations /v1 /ws /{workspaceSlug} /appsList workspace apps, optionally filtered by drive path
- Scope
ws:{workspaceSlug}:apps- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string" }, "scope": { "type": "string", "enum": [ "subtree", "children", "self" ] } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "apps": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "capabilities": { "type": "object", "properties": { "register": { "type": "boolean" } }, "required": [ "register" ], "additionalProperties": false } }, "required": [ "apps", "capabilities" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /apps /{slug} /launchOpen a private app: mints a short-lived access grant and redirects to it
- Scope
ws:{workspaceSlug}:apps- Request
- No JSON request body
- Response
- No structured response body
- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /appsRegister a workspace folder as an app runtime with optional display metadata
- Scope
ws:{workspaceSlug}:apps- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" } }, "required": [ "path", "command", "apiScopes", "slug" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "app": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "required": [ "app" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /apps /{appSlug}Get one registered app by slug
- Scope
ws:{workspaceSlug}:apps- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "app": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "required": [ "app" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /apps /{appSlug}Update app display metadata or reconcile changed runtime settings
- Scope
ws:{workspaceSlug}:apps- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "app": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "required": [ "app" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /apps /{appSlug} /reanchorRepair a broken app anchor by slug after the automatic move rail cannot recover its folder
- Scope
ws:{workspaceSlug}:apps- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string" } }, "required": [ "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "app": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "required": [ "app" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /apps /{appSlug} /visibilityMake an app workspace-only or public
- Scope
ws:{workspaceSlug}:apps- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "visibility": { "type": "string", "enum": [ "folder", "public" ] } }, "required": [ "visibility" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "app": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "required": [ "app" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /apps /{appSlug} /disabledDisable or re-enable a shared app replica
- Scope
ws:{workspaceSlug}:apps- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "disabled": { "type": "boolean" } }, "required": [ "disabled" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "app": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" }, "visibility": { "type": "string", "enum": [ "folder", "public" ] }, "canonicalUrl": { "type": "string", "format": "uri" }, "runtimeStatus": { "type": "string", "enum": [ "reconciling", "reconciled", "reconcile_failed" ] }, "reconciliationError": { "type": "string", "minLength": 1 }, "sourceShareId": { "type": "string" }, "sourceShareMode": { "type": "string", "enum": [ "read", "write" ] }, "sourceAppId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "disabledByUserId": { "type": "string" }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "controls": { "type": "object", "properties": { "updateRuntime": { "type": "boolean" }, "makePublic": { "type": "boolean" }, "makePrivate": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "updateRuntime", "makePublic", "makePrivate", "delete" ], "additionalProperties": false } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "command", "apiScopes", "port", "slug", "visibility", "canonicalUrl", "runtimeStatus", "createdByUserId", "createdAt", "updatedAt", "controls" ], "additionalProperties": false } }, "required": [ "app" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /apps /{appSlug}Stop serving and unregister an app
- Scope
ws:{workspaceSlug}:apps- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Agents
19 operations /v1 /ws /{workspaceSlug} /agentsList workspace agents
- Scope
ws:{workspaceSlug}:agents- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agents": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "agents" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agentsRegister a workspace folder as an agent, together with the apps it declares
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "apps": { "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string" }, "slug": { "type": "string" }, "command": { "type": "string", "minLength": 1 }, "apiScopes": { "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "installCommand": { "type": "string", "minLength": 1 }, "port": { "type": "integer", "minimum": 1, "maximum": 65535 }, "name": { "type": "string", "minLength": 1, "maxLength": 64 }, "icon": { "type": "string" } }, "required": [ "path", "slug", "command", "apiScopes" ] } } }, "required": [ "path", "slug" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agent": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false }, "apps": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string" }, "path": { "type": "string", "minLength": 1 }, "status": { "type": "string", "enum": [ "created", "updated", "unchanged" ] } }, "required": [ "slug", "path", "status" ], "additionalProperties": false } } }, "required": [ "agent", "apps" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /rootRename the default agent (the drive root's own agent)
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" } }, "required": [ "name" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" } }, "required": [ "name" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug}Update agent display metadata
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agent": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "agent" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /disabledDisable or re-enable an agent for future session launches
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "disabled": { "type": "boolean" } }, "required": [ "disabled" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agent": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "agent" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /onboardedMark this workspace's copy of an agent onboarded, or clear it to re-onboard
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "onboarded": { "type": "boolean" } }, "required": [ "onboarded" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agent": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "agent" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agent /sessions /{sessionId} /onboardedMark the session's agent onboarded from inside its onboarding conversation
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "onboarded": { "type": "boolean" } }, "required": [ "onboarded" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agent": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "agent" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /app /onboardedMark the calling app's own agent onboarded, addressed by the app's credential
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "onboarded": { "type": "boolean" } }, "required": [ "onboarded" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agent": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string", "minLength": 1 }, "anchorState": { "type": "string", "enum": [ "active", "broken", "orphaned" ] }, "slug": { "type": "string" }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "icon": { "type": "string" }, "sourceShareId": { "type": "string" }, "sourceAgentId": { "type": "string" }, "listingSubscriptionId": { "type": "string" }, "disabledAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "onboardedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "agent" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /onboarding-sessionOpen this workspace's onboarding conversation for an agent, creating it if needed
- Scope
ws:{workspaceSlug}:sessions- Request
- No request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "sessionId" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug}Unregister an agent while preserving its local state
- Scope
ws:{workspaceSlug}:agents- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /marketplace /subscriptionsList marketplace agent subscriptions for a workspace.
- Scope
ws:{workspaceSlug}:agents- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "subscriptions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "agentId": { "type": "string", "minLength": 1 }, "anchorId": { "type": "string", "minLength": 1 }, "listingId": { "type": "string", "minLength": 1 }, "agentName": { "type": "string" }, "path": { "type": "string" }, "mode": { "type": "string", "enum": [ "subscribe", "clone_once" ] }, "state": { "type": "string", "enum": [ "installing", "active", "error", "detached" ] }, "appliedEtag": { "type": "string", "minLength": 1 }, "acknowledgedEtag": { "type": "string", "minLength": 1 }, "lastAppliedAt": { "type": "number", "minimum": 0 }, "lastErrorCode": { "type": "string", "minLength": 1 } }, "required": [ "id", "listingId", "agentName", "path", "mode", "state" ], "additionalProperties": false } } }, "required": [ "subscriptions" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /listingsOffer one of this workspace's agents on the marketplace.
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "agentSlug": { "type": "string" }, "title": { "type": "string", "minLength": 1, "maxLength": 200 }, "summary": { "type": "string", "minLength": 1, "maxLength": 2000 } }, "required": [ "agentSlug" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "listing": { "type": "object", "properties": { "_id": { "type": "string", "minLength": 1 } }, "required": [ "_id" ], "additionalProperties": {} } }, "required": [ "listing" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "enum": [ "publishing_disabled", "listing_anchor_subscribed", "listing_already_exists", "reserved_title", "listing_not_found" ] } }, "required": [ "error" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /listings /{listingId}Remove a listing from the catalog; existing subscribers keep pulling.
- Scope
ws:{workspaceSlug}:agents- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "enum": [ "publishing_disabled", "listing_anchor_subscribed", "listing_already_exists", "reserved_title", "listing_not_found" ] } }, "required": [ "error" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /marketplace /subscriptionsInstall a marketplace listing and synchronously pull it.
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "listingId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "path": { "type": "string" } }, "required": [ "listingId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "subscription": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "agentId": { "type": "string", "minLength": 1 }, "anchorId": { "type": "string", "minLength": 1 }, "listingId": { "type": "string", "minLength": 1 }, "agentName": { "type": "string" }, "path": { "type": "string" }, "mode": { "type": "string", "enum": [ "subscribe", "clone_once" ] }, "state": { "type": "string", "enum": [ "installing", "active", "error", "detached" ] }, "appliedEtag": { "type": "string", "minLength": 1 }, "acknowledgedEtag": { "type": "string", "minLength": 1 }, "lastAppliedAt": { "type": "number", "minimum": 0 }, "lastErrorCode": { "type": "string", "minLength": 1 } }, "required": [ "id", "listingId", "agentName", "path", "mode", "state" ], "additionalProperties": false } }, "required": [ "subscription" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "path_exists" }, "path": { "type": "string" }, "renameRequired": { "type": "boolean", "const": true } }, "required": [ "error", "path", "renameRequired" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "agent_limit_exceeded" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "pull_failed" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "install_failed" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "listing_unavailable" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "listing_removed" } }, "required": [ "error" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /onboardingComplete one-time workspace onboarding and install optional starter agents.
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "duetName": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "purpose": { "type": "string", "minLength": 1, "maxLength": 1000 }, "goal": { "type": "string", "minLength": 1, "maxLength": 100 }, "selectedNames": { "maxItems": 50, "type": "array", "items": { "type": "string" } } }, "required": [ "duetName", "selectedNames" ] }, { "type": "object", "properties": { "duetName": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "purpose": { "type": "string", "minLength": 1, "maxLength": 1000 }, "goal": { "type": "string", "minLength": 1, "maxLength": 100 }, "skip": { "type": "boolean", "const": true } }, "required": [ "duetName", "skip" ] } ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "duetName": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[^[\\]<>`\\p{Cc}]*$" }, "onboardedAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "results": { "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "name": { "type": "string" }, "ok": { "type": "boolean", "const": true }, "subscription": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "agentId": { "type": "string", "minLength": 1 }, "anchorId": { "type": "string", "minLength": 1 }, "listingId": { "type": "string", "minLength": 1 }, "agentName": { "type": "string" }, "path": { "type": "string" }, "mode": { "type": "string", "enum": [ "subscribe", "clone_once" ] }, "state": { "type": "string", "enum": [ "installing", "active", "error", "detached" ] }, "appliedEtag": { "type": "string", "minLength": 1 }, "acknowledgedEtag": { "type": "string", "minLength": 1 }, "lastAppliedAt": { "type": "number", "minimum": 0 }, "lastErrorCode": { "type": "string", "minLength": 1 } }, "required": [ "id", "listingId", "agentName", "path", "mode", "state" ], "additionalProperties": false } }, "required": [ "name", "ok", "subscription" ], "additionalProperties": false }, { "type": "object", "properties": { "name": { "type": "string" }, "ok": { "type": "boolean", "const": false }, "campaign": { "type": "boolean", "const": true }, "failure": { "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "path_exists" }, "path": { "type": "string" }, "renameRequired": { "type": "boolean", "const": true } }, "required": [ "error", "path", "renameRequired" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "agent_limit_exceeded" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "pull_failed" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "install_failed" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "listing_unavailable" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "listing_removed" } }, "required": [ "error" ], "additionalProperties": false } ] } }, "required": [ "name", "ok", "failure" ], "additionalProperties": false } ] } }, "pullError": { "type": "string", "const": "pull_failed" } }, "required": [ "duetName", "onboardedAt", "results" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /onboarding /recommendationsRecommend four official agents for the stated workspace purpose; empty when no confident pick exists.
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "purpose": { "type": "string", "minLength": 1, "maxLength": 1000 }, "tagHints": { "maxItems": 3, "type": "array", "items": { "type": "string", "enum": [ "sales", "marketing", "engineering", "customer-support", "operations", "people", "product", "personal" ] } } }, "required": [ "purpose" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "recommendations": { "anyOf": [ { "minItems": 4, "maxItems": 4, "type": "array", "items": { "type": "object", "properties": { "agentName": { "type": "string" }, "reason": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "agentName", "reason" ], "additionalProperties": false } }, { "minItems": 0, "maxItems": 0, "type": "array", "items": { "type": "object", "properties": { "agentName": { "type": "string" }, "reason": { "type": "string", "minLength": 1, "maxLength": 200 } }, "required": [ "agentName", "reason" ], "additionalProperties": false } } ] } }, "required": [ "recommendations" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /marketplace /subscriptions /cloneClone a marketplace listing once into a caller-chosen path.
- Scope
ws:{workspaceSlug}:agents- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "listingId": { "type": "string", "minLength": 1 }, "path": { "type": "string" } }, "required": [ "listingId", "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "subscription": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "agentId": { "type": "string", "minLength": 1 }, "anchorId": { "type": "string", "minLength": 1 }, "listingId": { "type": "string", "minLength": 1 }, "agentName": { "type": "string" }, "path": { "type": "string" }, "mode": { "type": "string", "enum": [ "subscribe", "clone_once" ] }, "state": { "type": "string", "enum": [ "installing", "active", "error", "detached" ] }, "appliedEtag": { "type": "string", "minLength": 1 }, "acknowledgedEtag": { "type": "string", "minLength": 1 }, "lastAppliedAt": { "type": "number", "minimum": 0 }, "lastErrorCode": { "type": "string", "minLength": 1 } }, "required": [ "id", "listingId", "agentName", "path", "mode", "state" ], "additionalProperties": false } }, "required": [ "subscription" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "path_exists" }, "path": { "type": "string" }, "renameRequired": { "type": "boolean", "const": true } }, "required": [ "error", "path", "renameRequired" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "agent_limit_exceeded" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "pull_failed" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "install_failed" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "listing_unavailable" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "listing_removed" } }, "required": [ "error" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /marketplace /subscriptions /{subscriptionId} /acknowledgeAcknowledge the currently applied version of a subscription.
- Scope
ws:{workspaceSlug}:agents- Request
- No request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "subscription": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "agentId": { "type": "string", "minLength": 1 }, "anchorId": { "type": "string", "minLength": 1 }, "listingId": { "type": "string", "minLength": 1 }, "agentName": { "type": "string" }, "path": { "type": "string" }, "mode": { "type": "string", "enum": [ "subscribe", "clone_once" ] }, "state": { "type": "string", "enum": [ "installing", "active", "error", "detached" ] }, "appliedEtag": { "type": "string", "minLength": 1 }, "acknowledgedEtag": { "type": "string", "minLength": 1 }, "lastAppliedAt": { "type": "number", "minimum": 0 }, "lastErrorCode": { "type": "string", "minLength": 1 } }, "required": [ "id", "listingId", "agentName", "path", "mode", "state" ], "additionalProperties": false } }, "required": [ "subscription" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /marketplace /subscriptions /{subscriptionId}Detach a marketplace subscription while preserving local files.
- Scope
ws:{workspaceSlug}:agents- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Files
6 operations /v1 /ws /{workspaceSlug} /files /{path}?list=1List one workspace directory with file stats
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "entries": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "path": { "type": "string" }, "type": { "type": "string", "enum": [ "file", "directory", "symlink" ] }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mtime": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "target": { "type": "string" } }, "required": [ "name", "path", "type", "size", "mtime" ], "additionalProperties": false } } }, "required": [ "entries" ], "additionalProperties": false }- Errors
Symlink conflict (409)
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "symlink_unresolvable" }, "target": { "type": "string" } }, "required": [ "error", "target" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "path_is_symlink" } }, "required": [ "error" ], "additionalProperties": false } ], "description": "Symlink conflict (409)" }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /files /{path}?stat=1Read file or directory metadata without transferring file bytes
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "entry": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "path": { "type": "string" }, "type": { "type": "string", "enum": [ "file", "directory", "symlink" ] }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "mtime": { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$" }, "target": { "type": "string" } }, "required": [ "name", "path", "type", "size", "mtime" ], "additionalProperties": false }, "etag": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "entry", "etag" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /files /{path}Stream one file with ETag and single-range support
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Headers
Range— Request one byte range.If-None-Match— Return 304 when the current ETag matches.If-Modified-Since— Return 304 when the file is unchanged.
- Response
- Raw byte stream
- Errors
Symlink conflict (409)
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "symlink_unresolvable" }, "target": { "type": "string" } }, "required": [ "error", "target" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "path_is_symlink" } }, "required": [ "error" ], "additionalProperties": false } ], "description": "Symlink conflict (409)" }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /files /{path}Atomically write one file, optionally guarded by If-Match
- Scope
ws:{workspaceSlug}:files:write- Request
- Raw byte stream
- Headers
If-Match— Write only when the current ETag matches.If-Unmodified-Since— Write only when the file is unchanged.Content-Type— Preserve the uploaded media type.
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "etag": { "type": "string" }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "ok", "etag", "size" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "symlink_unresolvable" }, "target": { "type": "string" } }, "required": [ "error", "target" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "path_is_symlink" } }, "required": [ "error" ], "additionalProperties": false } ], "description": "Symlink conflict (409)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "storage_full" } }, "required": [ "error" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /files /{path}Delete one file or empty directory
- Scope
ws:{workspaceSlug}:files:write- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /files /actionsCreate a directory or symlink, move, copy, or bounded-recursively delete
- Scope
ws:{workspaceSlug}:files:write- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "operation": { "type": "string", "const": "mkdir" }, "path": { "type": "string" }, "recursive": { "default": false, "type": "boolean" } }, "required": [ "operation", "path" ] }, { "type": "object", "properties": { "operation": { "type": "string", "const": "move" }, "source": { "type": "string" }, "destination": { "type": "string" }, "overwrite": { "default": false, "type": "boolean" } }, "required": [ "operation", "source", "destination" ] }, { "type": "object", "properties": { "operation": { "type": "string", "const": "copy" }, "source": { "type": "string" }, "destination": { "type": "string" }, "recursive": { "default": false, "type": "boolean" }, "overwrite": { "default": false, "type": "boolean" } }, "required": [ "operation", "source", "destination" ] }, { "type": "object", "properties": { "operation": { "type": "string", "const": "delete" }, "path": { "type": "string" }, "recursive": { "default": false, "type": "boolean" } }, "required": [ "operation", "path" ] }, { "type": "object", "properties": { "operation": { "type": "string", "const": "symlink" }, "path": { "type": "string" }, "target": { "type": "string", "minLength": 1, "maxLength": 4096 } }, "required": [ "operation", "path", "target" ] } ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "affectedEntries": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "ok" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "symlink_unresolvable" }, "target": { "type": "string" } }, "required": [ "error", "target" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "path_is_symlink" } }, "required": [ "error" ], "additionalProperties": false } ], "description": "Symlink conflict (409)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "storage_full" } }, "required": [ "error" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
File activity
5 operations /v1 /ws /{workspaceSlug} /file-activityPage one file’s attributed event history in sequence order
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string" }, "cursor": { "type": "string" }, "limit": { "default": 100, "type": "integer", "minimum": 1, "maximum": 500 }, "reads": { "type": "string", "enum": [ "0", "1" ] } }, "required": [ "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "events": { "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "write" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "create" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "delete" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "rename" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "fromPath": { "type": "string" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "fromPath", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "read" }, "path": { "type": "string" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "changed-summary" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "count", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "viewed-summary" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "count", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "restore" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "actor", "at" ], "additionalProperties": false } ] } }, "required": [ "seq", "event" ], "additionalProperties": false } }, "nextCursor": { "type": "string" } }, "required": [ "events" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /file-activity /seen-byList every actor that touched one file, most recently active first
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string" } }, "required": [ "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "seenBy": { "type": "array", "items": { "type": "object", "properties": { "actor": { "type": "string" }, "userId": { "type": "string", "minLength": 1 }, "firstAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastWriteAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "readCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "writeCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "actor", "firstAt", "lastAt", "readCount", "writeCount" ], "additionalProperties": false } } }, "required": [ "seenBy" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /file-activity /latest-writersBatch-resolve the most recent writer for each named entry of one directory
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "dir": { "anyOf": [ { "type": "string", "const": "" }, { "type": "string" } ] }, "path": { "maxItems": 500, "type": "array", "items": { "type": "string" } } }, "required": [ "dir", "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "writers": { "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string" }, "actor": { "type": "string" }, "userId": { "type": "string" }, "lastWriteAt": { "type": "number" } }, "required": [ "path", "actor", "lastWriteAt" ], "additionalProperties": false } } }, "required": [ "writers" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /file-activity /feedPage file events by workspace, exact path, or folder subtree in sequence order
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cursor": { "type": "string" }, "limit": { "default": 100, "type": "integer", "minimum": 1, "maximum": 500 }, "reads": { "type": "string", "enum": [ "0", "1" ] }, "order": { "default": "asc", "type": "string", "enum": [ "asc", "desc" ] }, "path": { "type": "string" }, "scope": { "type": "string", "enum": [ "exact", "subtree" ] } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "events": { "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "write" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "create" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "delete" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "rename" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "fromPath": { "type": "string" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "fromPath", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "read" }, "path": { "type": "string" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "changed-summary" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "count", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "viewed-summary" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "count", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "restore" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "actor", "at" ], "additionalProperties": false } ] } }, "required": [ "seq", "event" ], "additionalProperties": false } }, "nextCursor": { "type": "string" } }, "required": [ "events" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /file-activity /eventsStream the workspace file event feed as resumable server-sent events
- Scope
ws:{workspaceSlug}:files:read- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "cursor": { "type": "string" }, "reads": { "type": "string", "enum": [ "0", "1" ] } } }- Headers
Last-Event-ID— Resume after the last committed `fa:` file-event cursor.
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "event": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "write" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "create" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "delete" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "rename" }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "path": { "type": "string" }, "fromPath": { "type": "string" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "entryKind", "path", "fromPath", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "read" }, "path": { "type": "string" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "changed-summary" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "count", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "viewed-summary" }, "path": { "type": "string" }, "count": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "entryKind": { "type": "string", "enum": [ "file", "folder" ] }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "path", "count", "actor", "at" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "restore" }, "actor": { "type": "string" }, "at": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "userId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "actor", "at" ], "additionalProperties": false } ] } }, "required": [ "seq", "event" ], "additionalProperties": false }- Delivery
- Server-sent event stream
- Retry
- Not declared idempotent
Train
29 operations /v1 /ws /{workspaceSlug} /train /uploads /sessionMint short-lived credentials for direct uploads to the workspace VM
- Scope
workspace_member- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": {} }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "vmBaseUrl": { "type": "string", "format": "uri" }, "uploadPath": { "type": "string", "minLength": 1 }, "uploadToken": { "type": "string", "minLength": 1 }, "expiresAt": { "type": "number" } }, "required": [ "vmBaseUrl", "uploadPath", "uploadToken", "expiresAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /uploadsList files waiting in the workspace training inbox
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "files": { "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string", "minLength": 1 }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "uploadedAt": { "type": "number" }, "url": { "type": "string" } }, "required": [ "filename", "size", "uploadedAt" ], "additionalProperties": false } }, "totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "capBytes": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "running": { "type": "boolean" } }, "required": [ "files", "totalBytes", "capBytes", "running" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /uploads /urlScrape a public URL into the workspace training inbox
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "url": { "type": "string" } }, "required": [ "url" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "filename": { "type": "string", "minLength": 1 }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "uploadedAt": { "type": "number" }, "url": { "type": "string" } }, "required": [ "filename", "size", "uploadedAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /uploads /{filename}Remove one file from the workspace training inbox
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /trainSnapshot staged sources and start an asynchronous training job
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "urls": { "maxItems": 25, "type": "array", "items": { "type": "string", "minLength": 1 } }, "files": { "maxItems": 200, "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string", "minLength": 1 }, "content": { "type": "string" }, "encoding": { "default": "utf8", "type": "string", "enum": [ "utf8", "base64" ] } }, "required": [ "filename", "content" ] } }, "driveFiles": { "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1 } }, "targetSlug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "jobId": { "type": "string" }, "job": { "type": "object", "properties": { "jobId": { "type": "string" }, "workspaceId": { "type": "string" }, "userId": { "type": "string" }, "agentId": { "type": "string" }, "state": { "type": "string", "enum": [ "queued", "running", "done", "failed" ] }, "phase": { "type": "string", "enum": [ "preparing", "snapshotting", "training", "finalizing", "cleanup", "done", "failed" ] }, "error": { "type": "string" }, "sourceFailures": { "maxItems": 25, "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "maxLength": 2048 }, "code": { "type": "string", "const": "source_fetch_failed" }, "message": { "type": "string", "maxLength": 2048 } }, "required": [ "source", "code", "message" ], "additionalProperties": false } }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "startedAt": { "type": "number" }, "completedAt": { "type": "number" } }, "required": [ "jobId", "workspaceId", "userId", "state", "phase", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "jobId", "job" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /records /{slug} /sources /{relPath}Read one file the training archive kept a copy of
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
- Raw byte stream
- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /records /{slug} /restageReload a memory's archived sources into the staging inbox, re-scraping its URLs
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": {} }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "staged": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "rescraped": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "fellBack": { "type": "array", "items": { "type": "string" } } }, "required": [ "staged", "rescraped", "fellBack" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /memoriesAdd one durable memory without starting a training job.
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "content": { "type": "string" }, "source": { "type": "string", "enum": [ "user", "agent", "system", "api", "import" ] }, "sessionId": { "type": "string" } }, "required": [ "content", "source" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "content": { "type": "string" }, "kind": { "type": "string", "enum": [ "observation", "reflection", "manual", "note" ] }, "source": { "type": "string", "enum": [ "user", "agent", "system", "api", "import" ] }, "priority": { "type": "string", "enum": [ "high", "medium", "low" ] }, "createdAt": { "type": "string" }, "lastUsedAt": { "type": "string" }, "observedDate": { "type": "string" }, "referencedDate": { "type": "string" }, "relativeDate": { "type": "string" }, "timeOfDay": { "type": "string" }, "sessionId": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "packScore": { "type": "number" }, "relevanceScore": { "type": "number" } }, "required": [ "id", "content", "kind", "source", "priority", "createdAt", "lastUsedAt", "observedDate", "tags" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /memories /searchSearch durable memory records by relevance.
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "q": { "type": "string", "minLength": 1 }, "limit": { "default": 10, "type": "integer", "minimum": 1, "maximum": 100 } }, "required": [ "q" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "query": { "type": "string" }, "limit": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "results": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "content": { "type": "string" }, "kind": { "type": "string", "enum": [ "observation", "reflection", "manual", "note" ] }, "source": { "type": "string", "enum": [ "user", "agent", "system", "api", "import" ] }, "priority": { "type": "string", "enum": [ "high", "medium", "low" ] }, "createdAt": { "type": "string" }, "lastUsedAt": { "type": "string" }, "observedDate": { "type": "string" }, "referencedDate": { "type": "string" }, "relativeDate": { "type": "string" }, "timeOfDay": { "type": "string" }, "sessionId": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "packScore": { "type": "number" }, "relevanceScore": { "type": "number" } }, "required": [ "id", "content", "kind", "source", "priority", "createdAt", "lastUsedAt", "observedDate", "tags" ], "additionalProperties": false } } }, "required": [ "query", "limit", "results" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /jobsList recent training jobs newest first
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "limit": { "default": 25, "type": "integer", "minimum": 1, "maximum": 100 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "jobs": { "type": "array", "items": { "type": "object", "properties": { "jobId": { "type": "string" }, "workspaceId": { "type": "string" }, "userId": { "type": "string" }, "agentId": { "type": "string" }, "state": { "type": "string", "enum": [ "queued", "running", "done", "failed" ] }, "phase": { "type": "string", "enum": [ "preparing", "snapshotting", "training", "finalizing", "cleanup", "done", "failed" ] }, "error": { "type": "string" }, "sourceFailures": { "maxItems": 25, "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "maxLength": 2048 }, "code": { "type": "string", "const": "source_fetch_failed" }, "message": { "type": "string", "maxLength": 2048 } }, "required": [ "source", "code", "message" ], "additionalProperties": false } }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "startedAt": { "type": "number" }, "completedAt": { "type": "number" } }, "required": [ "jobId", "workspaceId", "userId", "state", "phase", "createdAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "jobs" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /{jobId}Get the progress and result state of one training job
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "job": { "type": "object", "properties": { "jobId": { "type": "string" }, "workspaceId": { "type": "string" }, "userId": { "type": "string" }, "agentId": { "type": "string" }, "state": { "type": "string", "enum": [ "queued", "running", "done", "failed" ] }, "phase": { "type": "string", "enum": [ "preparing", "snapshotting", "training", "finalizing", "cleanup", "done", "failed" ] }, "error": { "type": "string" }, "sourceFailures": { "maxItems": 25, "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "maxLength": 2048 }, "code": { "type": "string", "const": "source_fetch_failed" }, "message": { "type": "string", "maxLength": 2048 } }, "required": [ "source", "code", "message" ], "additionalProperties": false } }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "startedAt": { "type": "number" }, "completedAt": { "type": "number" } }, "required": [ "jobId", "workspaceId", "userId", "state", "phase", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "job" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /recordsList trained memory records newest first
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "records": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "memoryId": { "type": "string", "minLength": 1 }, "archiveId": { "type": "string" }, "store": { "type": "string" }, "inherited": { "type": "boolean" }, "ownerAgentSlug": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "observedDate": { "type": "string" }, "headline": { "type": "string" }, "model": { "type": "string" }, "sourceFolder": { "type": "string" }, "fileCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "hasArchive": { "type": "boolean" } }, "required": [ "slug", "memoryId", "createdAt", "observedDate", "hasArchive" ], "additionalProperties": false } } }, "required": [ "records" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /agent-memory-countsList trainable workspace agents and their owned memory counts.
- Scope
ws:{workspaceSlug}:memoryandws:{workspaceSlug}:agents- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "counts": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] } }, "trainableAgents": { "type": "array", "items": { "type": "string" } } }, "required": [ "counts" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /records /{slug}Read one trained memory record and its synthesized content
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "record": { "type": "object", "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "memoryId": { "type": "string", "minLength": 1 }, "archiveId": { "type": "string" }, "store": { "type": "string" }, "inherited": { "type": "boolean" }, "ownerAgentSlug": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "observedDate": { "type": "string" }, "headline": { "type": "string" }, "model": { "type": "string" }, "sourceFolder": { "type": "string" }, "fileCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "hasArchive": { "type": "boolean" }, "content": { "type": "string" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "relPath": { "type": "string", "minLength": 1 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "url": { "type": "string" }, "title": { "type": "string" }, "scrapedAt": { "type": "string" } }, "required": [ "relPath", "bytes" ], "additionalProperties": false } } }, "required": [ "slug", "memoryId", "createdAt", "observedDate", "hasArchive", "content" ], "additionalProperties": false } }, "required": [ "record" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /records /{slug}Replace the synthesized content of one trained memory record
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "content": { "type": "string" } }, "required": [ "content" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "record": { "type": "object", "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "memoryId": { "type": "string", "minLength": 1 }, "archiveId": { "type": "string" }, "store": { "type": "string" }, "inherited": { "type": "boolean" }, "ownerAgentSlug": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "observedDate": { "type": "string" }, "headline": { "type": "string" }, "model": { "type": "string" }, "sourceFolder": { "type": "string" }, "fileCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "hasArchive": { "type": "boolean" }, "content": { "type": "string" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "relPath": { "type": "string", "minLength": 1 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "url": { "type": "string" }, "title": { "type": "string" }, "scrapedAt": { "type": "string" } }, "required": [ "relPath", "bytes" ], "additionalProperties": false } } }, "required": [ "slug", "memoryId", "createdAt", "observedDate", "hasArchive", "content" ], "additionalProperties": false } }, "required": [ "record" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /train /records /{slug}Delete a trained memory record and its archived corpus
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "deleted": { "type": "boolean", "const": true }, "slug": { "type": "string" }, "memoryId": { "type": "string" } }, "required": [ "deleted", "slug", "memoryId" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /uploads /sessionMint short-lived credentials for direct uploads to an agent training inbox
- Scope
workspace_member- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": {} }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "vmBaseUrl": { "type": "string", "format": "uri" }, "uploadPath": { "type": "string", "minLength": 1 }, "uploadToken": { "type": "string", "minLength": 1 }, "expiresAt": { "type": "number" } }, "required": [ "vmBaseUrl", "uploadPath", "uploadToken", "expiresAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /uploadsList files waiting in an agent training inbox
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "files": { "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string", "minLength": 1 }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "uploadedAt": { "type": "number" }, "url": { "type": "string" } }, "required": [ "filename", "size", "uploadedAt" ], "additionalProperties": false } }, "totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "capBytes": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "running": { "type": "boolean" } }, "required": [ "files", "totalBytes", "capBytes", "running" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /uploads /urlScrape a public URL into an agent training inbox
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "url": { "type": "string" } }, "required": [ "url" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "filename": { "type": "string", "minLength": 1 }, "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "uploadedAt": { "type": "number" }, "url": { "type": "string" } }, "required": [ "filename", "size", "uploadedAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /uploads /{filename}Remove one file from an agent training inbox
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /trainSnapshot staged sources and start an asynchronous agent training job
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "urls": { "maxItems": 25, "type": "array", "items": { "type": "string", "minLength": 1 } }, "files": { "maxItems": 200, "type": "array", "items": { "type": "object", "properties": { "filename": { "type": "string", "minLength": 1 }, "content": { "type": "string" }, "encoding": { "default": "utf8", "type": "string", "enum": [ "utf8", "base64" ] } }, "required": [ "filename", "content" ] } }, "driveFiles": { "maxItems": 200, "type": "array", "items": { "type": "string", "minLength": 1 } }, "targetSlug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "jobId": { "type": "string" }, "job": { "type": "object", "properties": { "jobId": { "type": "string" }, "workspaceId": { "type": "string" }, "userId": { "type": "string" }, "agentId": { "type": "string" }, "state": { "type": "string", "enum": [ "queued", "running", "done", "failed" ] }, "phase": { "type": "string", "enum": [ "preparing", "snapshotting", "training", "finalizing", "cleanup", "done", "failed" ] }, "error": { "type": "string" }, "sourceFailures": { "maxItems": 25, "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "maxLength": 2048 }, "code": { "type": "string", "const": "source_fetch_failed" }, "message": { "type": "string", "maxLength": 2048 } }, "required": [ "source", "code", "message" ], "additionalProperties": false } }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "startedAt": { "type": "number" }, "completedAt": { "type": "number" } }, "required": [ "jobId", "workspaceId", "userId", "state", "phase", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "jobId", "job" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /jobsList recent agent training jobs newest first
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "limit": { "default": 25, "type": "integer", "minimum": 1, "maximum": 100 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "jobs": { "type": "array", "items": { "type": "object", "properties": { "jobId": { "type": "string" }, "workspaceId": { "type": "string" }, "userId": { "type": "string" }, "agentId": { "type": "string" }, "state": { "type": "string", "enum": [ "queued", "running", "done", "failed" ] }, "phase": { "type": "string", "enum": [ "preparing", "snapshotting", "training", "finalizing", "cleanup", "done", "failed" ] }, "error": { "type": "string" }, "sourceFailures": { "maxItems": 25, "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "maxLength": 2048 }, "code": { "type": "string", "const": "source_fetch_failed" }, "message": { "type": "string", "maxLength": 2048 } }, "required": [ "source", "code", "message" ], "additionalProperties": false } }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "startedAt": { "type": "number" }, "completedAt": { "type": "number" } }, "required": [ "jobId", "workspaceId", "userId", "state", "phase", "createdAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "jobs" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /{jobId}Get the progress and result state of one agent training job
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "job": { "type": "object", "properties": { "jobId": { "type": "string" }, "workspaceId": { "type": "string" }, "userId": { "type": "string" }, "agentId": { "type": "string" }, "state": { "type": "string", "enum": [ "queued", "running", "done", "failed" ] }, "phase": { "type": "string", "enum": [ "preparing", "snapshotting", "training", "finalizing", "cleanup", "done", "failed" ] }, "error": { "type": "string" }, "sourceFailures": { "maxItems": 25, "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "maxLength": 2048 }, "code": { "type": "string", "const": "source_fetch_failed" }, "message": { "type": "string", "maxLength": 2048 } }, "required": [ "source", "code", "message" ], "additionalProperties": false } }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "startedAt": { "type": "number" }, "completedAt": { "type": "number" } }, "required": [ "jobId", "workspaceId", "userId", "state", "phase", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "job" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /recordsList trained agent memory records newest first
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "records": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "memoryId": { "type": "string", "minLength": 1 }, "archiveId": { "type": "string" }, "store": { "type": "string" }, "inherited": { "type": "boolean" }, "ownerAgentSlug": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "observedDate": { "type": "string" }, "headline": { "type": "string" }, "model": { "type": "string" }, "sourceFolder": { "type": "string" }, "fileCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "hasArchive": { "type": "boolean" } }, "required": [ "slug", "memoryId", "createdAt", "observedDate", "hasArchive" ], "additionalProperties": false } } }, "required": [ "records" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /records /{slug}Read one trained agent memory record and its synthesized content
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "record": { "type": "object", "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "memoryId": { "type": "string", "minLength": 1 }, "archiveId": { "type": "string" }, "store": { "type": "string" }, "inherited": { "type": "boolean" }, "ownerAgentSlug": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "observedDate": { "type": "string" }, "headline": { "type": "string" }, "model": { "type": "string" }, "sourceFolder": { "type": "string" }, "fileCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "hasArchive": { "type": "boolean" }, "content": { "type": "string" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "relPath": { "type": "string", "minLength": 1 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "url": { "type": "string" }, "title": { "type": "string" }, "scrapedAt": { "type": "string" } }, "required": [ "relPath", "bytes" ], "additionalProperties": false } } }, "required": [ "slug", "memoryId", "createdAt", "observedDate", "hasArchive", "content" ], "additionalProperties": false } }, "required": [ "record" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /records /{slug}Replace the synthesized content of one trained agent memory record
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "content": { "type": "string" } }, "required": [ "content" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "record": { "type": "object", "properties": { "slug": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }, "memoryId": { "type": "string", "minLength": 1 }, "archiveId": { "type": "string" }, "store": { "type": "string" }, "inherited": { "type": "boolean" }, "ownerAgentSlug": { "type": "string" }, "createdAt": { "anyOf": [ { "type": "string" }, { "type": "number" } ] }, "observedDate": { "type": "string" }, "headline": { "type": "string" }, "model": { "type": "string" }, "sourceFolder": { "type": "string" }, "fileCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "hasArchive": { "type": "boolean" }, "content": { "type": "string" }, "sources": { "type": "array", "items": { "type": "object", "properties": { "relPath": { "type": "string", "minLength": 1 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "url": { "type": "string" }, "title": { "type": "string" }, "scrapedAt": { "type": "string" } }, "required": [ "relPath", "bytes" ], "additionalProperties": false } } }, "required": [ "slug", "memoryId", "createdAt", "observedDate", "hasArchive", "content" ], "additionalProperties": false } }, "required": [ "record" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /records /{slug}Delete a trained agent memory record and its archived corpus
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "deleted": { "type": "boolean", "const": true }, "slug": { "type": "string" }, "memoryId": { "type": "string" } }, "required": [ "deleted", "slug", "memoryId" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /records /{slug} /sources /{relPath}Read one file an agent memory's training archive kept a copy of
- Scope
ws:{workspaceSlug}:memory- Request
- No JSON request body
- Response
- Raw byte stream
- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /agents /{agentSlug} /train /records /{slug} /restageReload an agent memory's archived sources into its staging inbox, re-scraping its URLs
- Scope
ws:{workspaceSlug}:memory- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": {} }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "staged": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "rescraped": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "fellBack": { "type": "array", "items": { "type": "string" } } }, "required": [ "staged", "rescraped", "fellBack" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
Integrations
11 operations /v1 /ws /{workspaceSlug} /integrations /catalogSearch and page through the provider-neutral integration catalog
- Scope
ws:{workspaceSlug}:integrations- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "q": { "type": "string", "maxLength": 200 }, "cursor": { "type": "string", "minLength": 1 }, "limit": { "default": 50, "type": "integer", "minimum": 1, "maximum": 100 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "integration": { "type": "string", "minLength": 1, "maxLength": 128 }, "name": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "logoUrl": { "type": "string", "format": "uri" }, "connected": { "type": "boolean" } }, "required": [ "integration", "name", "connected" ], "additionalProperties": false } }, "nextCursor": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /integrations /connectBegin an OAuth connection using server-derived tenant identity
- Scope
ws:{workspaceSlug}:integrations- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "integration": { "type": "string", "minLength": 1, "maxLength": 128 }, "redirectTo": { "type": "string", "minLength": 1, "maxLength": 2048 } }, "required": [ "integration", "redirectTo" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "integration": { "type": "string", "minLength": 1, "maxLength": 128 }, "authorizeUrl": { "type": "string", "format": "uri" } }, "required": [ "integration", "authorizeUrl" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /integrations /connectionsList workspace integration connections directly from the provider
- Scope
ws:{workspaceSlug}:integrations- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "integration": { "type": "string", "minLength": 1, "maxLength": 128 }, "name": { "type": "string", "minLength": 1 }, "logoUrl": { "type": "string", "format": "uri" }, "status": { "type": "string", "enum": [ "active", "pending", "error", "disconnected" ] }, "connectedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "required": [ "id", "integration", "status", "connectedAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "items" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /integrations /connections /{connectionId}Idempotently disconnect one tenant-owned integration account
- Scope
ws:{workspaceSlug}:integrations- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string", "minLength": 1 }, "disconnected": { "type": "boolean" } }, "required": [ "id", "disconnected" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /integrations /{toolkitSlug} /agent-policySet or clear the agents that receive one integration toolkit
- Scope
ws:{workspaceSlug}:integrations- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "integration": { "type": "string", "minLength": 1, "maxLength": 128 }, "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "required": [ "integration" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /integrations /composio /execute /{toolSlug}Execute a Composio tool for the API key’s workspace; Duet injects the upstream Composio credentials server-side and returns the raw provider response.
- Scope
api_key- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "arguments": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "workspace": { "type": "string" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema" }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /mcp-servers /probeDry-run a remote MCP server for its tool count, per-turn cost, and auth requirement
- Scope
ws:{workspaceSlug}:integrations- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,48}$" }, "url": { "type": "string", "minLength": 1, "maxLength": 2048 }, "auth": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "none" } }, "required": [ "kind" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "oauth" } }, "required": [ "kind" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "static" }, "token": { "type": "string", "minLength": 1, "maxLength": 8192 } }, "required": [ "kind", "token" ] } ] } }, "required": [ "name", "url" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "auth": { "type": "string", "enum": [ "none", "oauth" ] }, "toolCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "estimatedPromptBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "droppedToolNames": { "type": "array", "items": { "type": "string" } }, "registrationSupported": { "type": "boolean" } }, "required": [ "auth", "toolCount", "estimatedPromptBytes" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /mcp-serversAttach a remote MCP server to the workspace after a successful probe
- Scope
ws:{workspaceSlug}:integrations- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,48}$" }, "url": { "type": "string", "minLength": 1, "maxLength": 2048 }, "auth": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "none" } }, "required": [ "kind" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "oauth" } }, "required": [ "kind" ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "static" }, "token": { "type": "string", "minLength": 1, "maxLength": 8192 } }, "required": [ "kind", "token" ] } ] }, "label": { "type": "string", "minLength": 1, "maxLength": 128 } }, "required": [ "name", "url" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,48}$" }, "label": { "type": "string", "minLength": 1, "maxLength": 128 }, "url": { "type": "string", "minLength": 1, "maxLength": 2048 }, "authKind": { "type": "string", "enum": [ "none", "oauth", "static" ] }, "state": { "type": "string", "enum": [ "needs_auth", "ready", "reauth_required", "disconnecting" ] }, "toolCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "estimatedPromptBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "droppedToolNames": { "type": "array", "items": { "type": "string" } }, "lastSuccessAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastErrorAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastErrorCode": { "type": "string", "enum": [ "unauthorized", "reauth_required", "unreachable", "upstream_error", "result_too_large", "timeout" ] }, "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "name", "label", "url", "authKind", "state", "createdAt", "updatedAt" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /mcp-serversList the workspace’s custom MCP servers with their health and per-agent scoping
- Scope
ws:{workspaceSlug}:integrations- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,48}$" }, "label": { "type": "string", "minLength": 1, "maxLength": 128 }, "url": { "type": "string", "minLength": 1, "maxLength": 2048 }, "authKind": { "type": "string", "enum": [ "none", "oauth", "static" ] }, "state": { "type": "string", "enum": [ "needs_auth", "ready", "reauth_required", "disconnecting" ] }, "toolCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "estimatedPromptBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "droppedToolNames": { "type": "array", "items": { "type": "string" } }, "lastSuccessAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastErrorAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastErrorCode": { "type": "string", "enum": [ "unauthorized", "reauth_required", "unreachable", "upstream_error", "result_too_large", "timeout" ] }, "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } }, "createdAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updatedAt": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "name", "label", "url", "authKind", "state", "createdAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "items" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /mcp-servers /{name}Idempotently detach one custom MCP server and its stored credential
- Scope
ws:{workspaceSlug}:integrations- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,48}$" }, "removed": { "type": "boolean" }, "revoked": { "type": "string", "enum": [ "revoked", "not_supported", "failed" ] }, "registration": { "type": "string", "enum": [ "deleted", "retained", "not_supported" ] } }, "required": [ "name", "removed", "revoked", "registration" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /mcp-servers /{name} /agent-policySet or clear the agents that receive one custom MCP server
- Scope
ws:{workspaceSlug}:integrations- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,48}$" }, "allowedAgentIds": { "maxItems": 51, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "required": [ "name" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Shares
6 operationsPublishes
5 operations /v1 /ws /{workspaceSlug} /publishesList public file and folder addresses for a workspace
- Scope
ws:{workspaceSlug}:publish- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "publishes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string" }, "slug": { "type": "string" }, "kind": { "type": "string", "enum": [ "file", "folder" ] }, "pausedAt": { "type": "number" }, "pauseGeneration": { "type": "string", "minLength": 1 }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "slug", "kind", "createdByUserId", "createdAt", "updatedAt" ], "additionalProperties": false } } }, "required": [ "publishes" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /publishesPublish a workspace file or folder at a public slug
- Scope
ws:{workspaceSlug}:publish- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "path": { "type": "string", "minLength": 1 }, "slug": { "type": "string" } }, "required": [ "path" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "publish": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string" }, "slug": { "type": "string" }, "kind": { "type": "string", "enum": [ "file", "folder" ] }, "pausedAt": { "type": "number" }, "pauseGeneration": { "type": "string", "minLength": 1 }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "slug", "kind", "createdByUserId", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "publish" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /publishes /{slug}Replace the public slug for a published path
- Scope
ws:{workspaceSlug}:publish- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "slug": { "type": "string" } }, "required": [ "slug" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "publish": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string" }, "slug": { "type": "string" }, "kind": { "type": "string", "enum": [ "file", "folder" ] }, "pausedAt": { "type": "number" }, "pauseGeneration": { "type": "string", "minLength": 1 }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "slug", "kind", "createdByUserId", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "publish" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /publishes /{slug}Remove a public address without deleting its workspace content
- Scope
ws:{workspaceSlug}:publish- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /publishes /{slug} /pauseFreeze or resume a public publish
- Scope
ws:{workspaceSlug}:publish- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "paused": { "type": "boolean" } }, "required": [ "paused" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "publish": { "type": "object", "properties": { "id": { "type": "string" }, "workspaceId": { "type": "string" }, "anchorId": { "type": "string" }, "anchorPath": { "type": "string" }, "slug": { "type": "string" }, "kind": { "type": "string", "enum": [ "file", "folder" ] }, "pausedAt": { "type": "number" }, "pauseGeneration": { "type": "string", "minLength": 1 }, "createdByUserId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "slug", "kind", "createdByUserId", "createdAt", "updatedAt" ], "additionalProperties": false } }, "required": [ "publish" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
Sync
3 operations /v1 /ws /{workspaceSlug} /mirror-devicesRegister the calling sync device as a whole-drive mirror of a workspace
- Scope
sync_device- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "syncthingDeviceId": { "type": "string", "pattern": "^[A-Z2-7]{7}(-[A-Z2-7]{7})*$" } }, "required": [ "syncthingDeviceId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "folderId": { "type": "string" }, "vmSyncthingDeviceId": { "type": "string" }, "tunnel": { "type": "object", "properties": { "url": { "type": "string" }, "tunnelToken": { "type": "string" }, "expiresAt": { "type": "number" } }, "required": [ "url", "tunnelToken", "expiresAt" ], "additionalProperties": false } }, "required": [ "folderId", "vmSyncthingDeviceId", "tunnel" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /ws /{workspaceSlug} /mirror-devicesList the devices mirroring a workspace
- Scope
sync_device- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "devices": { "type": "array", "items": { "type": "object", "properties": { "deviceId": { "type": "string" }, "deviceName": { "type": "string" }, "syncthingDeviceId": { "type": "string" }, "registeredAt": { "type": "number" } }, "required": [ "deviceId", "syncthingDeviceId", "registeredAt" ], "additionalProperties": false } } }, "required": [ "devices" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /mirror-devices /{deviceId}Detach one device you own from a workspace mirror
- Scope
sync_device- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "deviceId": { "type": "string" } }, "required": [ "ok", "deviceId" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Billing
7 operations /v1 /ws /{workspaceSlug} /billing-userDesignate a current live owner as the workspace payer.
- Scope
ws:{workspaceSlug}:admin- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "userId": { "type": "string", "minLength": 1 } }, "required": [ "userId" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "billingUserId": { "type": "string" }, "member": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "name": { "type": "string" }, "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] }, "isBillingUser": { "type": "boolean" } }, "required": [ "id", "email", "role", "isBillingUser" ], "additionalProperties": false } }, "required": [ "billingUserId", "member" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /billing-capSet or clear the workspace monthly spend cap.
- Scope
ws:{workspaceSlug}:admin- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "monthlyCapMicroUsd": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] } }, "required": [ "monthlyCapMicroUsd" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "monthlyCapMicroUsd": { "anyOf": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "null" } ] } }, "required": [ "monthlyCapMicroUsd" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /billing /usageRead workspace usage grouped over a reporting period.
- Scope
workspace_member- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "period": { "default": "monthly", "type": "string", "enum": [ "daily", "weekly", "monthly" ] }, "group": { "default": "workspace", "type": "string", "enum": [ "workspace", "user", "app" ] }, "start": { "type": "string" }, "end": { "type": "string" } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "period": { "type": "string", "enum": [ "daily", "weekly", "monthly" ] }, "group": { "type": "string", "enum": [ "workspace", "user", "app" ] }, "rows": { "type": "array", "items": { "type": "object", "properties": { "workspaceId": { "type": "string" }, "period": { "type": "string" }, "spendMicroUsd": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "userId": { "type": "string" }, "appId": { "type": "string" }, "appSlug": { "type": "string" }, "inputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "outputTokens": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "required": [ "workspaceId", "period", "spendMicroUsd" ], "additionalProperties": false } } }, "required": [ "period", "group", "rows" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /ws /{workspaceSlug} /billing /ledgerList the workspace credit ledger newest-first with actor attribution.
- Scope
workspace_member- Request
- No JSON request body
- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "limit": { "default": 100, "type": "integer", "minimum": 1, "maximum": 500 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "entries": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "amountMicroUsd": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "type": { "type": "string", "enum": [ "grant", "topup", "usage", "adjustment", "reservation", "subscription_grant", "subscription_expiry" ] }, "actorUserId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy" ] }, "createdAt": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "id", "amountMicroUsd", "type", "createdAt" ], "additionalProperties": false } } }, "required": [ "entries" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /user /billingRead the payer account and every workspace it funds. Answers a user API key as well as the dashboard.
- Scope
api_key- Request
- No JSON request body
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "autoTopupEnabled": { "type": "boolean" }, "autoTopupThresholdMicroUsd": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "autoTopupAmountMicroUsd": { "type": "integer", "minimum": 5000000, "maximum": 9007199254740991 }, "maxMonthlySpendMicroUsd": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "monthlySpendMicroUsd": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "monthlySpendPeriodKey": { "type": "string" }, "balanceMicroUsd": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "lastTopupError": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "at": { "type": "number" } }, "required": [ "code", "message", "at" ], "additionalProperties": false }, "consecutiveTopupFailures": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "firstPaidAt": { "type": "number" }, "paidCreditBalanceMicroUsd": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "monthlyCreditBalanceMicroUsd": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "subscription": { "anyOf": [ { "type": "object", "properties": { "plan": { "type": "string", "enum": [ "starter", "pro", "max" ] }, "status": { "type": "string", "enum": [ "incomplete", "incomplete_expired", "trialing", "active", "past_due", "canceled", "unpaid", "paused" ] }, "isActive": { "type": "boolean" }, "currentPeriodStart": { "type": "number" }, "currentPeriodEnd": { "type": "number" }, "creditsExpireAt": { "type": "number" }, "cancelAtPeriodEnd": { "type": "boolean" }, "pendingPlan": { "type": "string", "enum": [ "starter", "pro", "max" ] } }, "required": [ "plan", "status", "isActive", "currentPeriodStart", "currentPeriodEnd", "creditsExpireAt", "cancelAtPeriodEnd" ], "additionalProperties": false }, { "type": "null" } ] }, "trial": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "available", "exhausted", "ended" ] } }, "required": [ "status" ], "additionalProperties": false }, "lowCreditWarning": { "anyOf": [ { "type": "object", "properties": { "periodStart": { "type": "number" } }, "required": [ "periodStart" ], "additionalProperties": false }, { "type": "null" } ] }, "hasPaymentMethod": { "type": "boolean" }, "workspaces": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "slug": { "type": "string" }, "name": { "type": "string" }, "storage": { "type": "object", "properties": { "usableGb": { "type": "number" }, "usedBytes": { "type": "number" }, "sampledAt": { "type": "number" }, "plan": { "type": "string", "enum": [ "starter", "pro", "max" ] }, "nextPlan": { "type": "string", "enum": [ "starter", "pro", "max" ] }, "nextUsableGb": { "type": "number" } }, "required": [ "usableGb", "plan" ], "additionalProperties": false } }, "required": [ "id", "slug", "name", "storage" ], "additionalProperties": false } } }, "required": [ "monthlySpendMicroUsd", "balanceMicroUsd", "consecutiveTopupFailures", "paidCreditBalanceMicroUsd", "monthlyCreditBalanceMicroUsd", "subscription", "trial", "lowCreditWarning", "hasPaymentMethod", "workspaces" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /user /billing /subscription /checkoutCreate a Stripe-hosted Checkout session for a server-resolved subscription plan. Answers a user API key.
- Scope
api_key- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "workspaceSlug": { "type": "string" }, "plan": { "type": "string", "enum": [ "starter", "pro", "max" ] } }, "required": [ "workspaceSlug", "plan" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "sessionId": { "type": "string" } }, "required": [ "url" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /user /billing /subscription /planUpgrade, schedule a downgrade, or cancel the payer subscription. Answers a user API key.
- Scope
api_key- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "workspaceSlug": { "type": "string" }, "plan": { "type": "string", "enum": [ "starter", "pro", "max" ] } }, "required": [ "workspaceSlug", "plan" ] }, { "type": "object", "properties": { "workspaceSlug": { "type": "string" }, "cancel": { "type": "boolean", "const": true } }, "required": [ "workspaceSlug", "cancel" ] }, { "type": "object", "properties": { "workspaceSlug": { "type": "string" }, "resume": { "type": "boolean", "const": true } }, "required": [ "workspaceSlug", "resume" ] } ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "ok": { "type": "boolean", "const": true } }, "required": [ "ok" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Declared idempotent
Device
5 operations /v1 /feedbackSubmit anonymous product feedback; accepted asynchronously and rate limited.
- Scope
public- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "content": { "type": "string", "minLength": 1 }, "source": { "type": "string", "maxLength": 128 } }, "required": [ "content" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": {}, "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /auth /email /startEmail a sign-in code to a human so an agent holding no credential can finish sign-in on their behalf.
- Scope
public- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, "client_name": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "email" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "request_id": { "type": "string", "pattern": "^req_[a-f0-9]{32}$" }, "expires_in": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "request_id", "expires_in" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /auth /email /verifyExchange the emailed code for a workspace-scoped API key, registering the human if they are new.
- Scope
public- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "request_id": { "type": "string", "pattern": "^req_[a-f0-9]{32}$" }, "code": { "type": "string", "pattern": "^[A-Z2-9]{4}-[A-Z2-9]{4}$" }, "name": { "type": "string", "minLength": 1, "maxLength": 200 }, "workspace_name": { "type": "string", "minLength": 1, "maxLength": 100 }, "workspace_slug": { "type": "string" } }, "required": [ "request_id", "code" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "access_token": { "type": "string", "pattern": "^duet_sk_.*" }, "token_type": { "type": "string", "const": "bearer" }, "prefix": { "type": "string", "pattern": "^duet_sk_.*" }, "scopes": { "minItems": 1, "type": "array", "items": { "type": "string" } }, "workspace": { "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" } }, "required": [ "slug", "name" ], "additionalProperties": false }, "created": { "type": "boolean" } }, "required": [ "access_token", "token_type", "prefix", "scopes", "workspace", "created" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_code" }, "attempts_remaining": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "error", "attempts_remaining" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "workspace_ambiguous" }, "workspaces": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" }, "role": { "type": "string", "enum": [ "owner", "editor", "viewer" ] } }, "required": [ "slug", "name", "role" ], "additionalProperties": false } } }, "required": [ "error", "workspaces" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "expired" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "forbidden" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_request" } }, "required": [ "error" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "const": "rate_limited" }, "retryAfterSeconds": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "error", "retryAfterSeconds" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /device /codeBegin a device authorization grant with workspace scopes, sync-device scopes, or workspace-independent capabilities.
- Scope
public- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "scopes": { "minItems": 1, "type": "array", "items": { "type": "string" } }, "capabilities": { "minItems": 1, "type": "array", "items": { "type": "string", "enum": [ "files:read", "files:write", "memory", "sessions", "agents", "services", "integrations", "apps", "share", "publish", "members" ] } }, "device_name": { "type": "string", "minLength": 1, "maxLength": 64 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "device_code": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "user_code": { "type": "string", "pattern": "^[A-Z2-9]{4}-[A-Z2-9]{4}$" }, "verification_uri": { "type": "string", "format": "uri" }, "expires_in": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "interval": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "device_code", "user_code", "verification_uri", "expires_in", "interval" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /device /tokenPoll a device grant and receive its API key once approved.
- Scope
public- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "device_code": { "type": "string", "pattern": "^[a-f0-9]{64}$" } }, "required": [ "device_code" ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "pending" }, "interval": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "status", "interval" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "slow_down" }, "interval": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } }, "required": [ "status", "interval" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "denied" } }, "required": [ "status" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "expired" } }, "required": [ "status" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "consumed" } }, "required": [ "status" ], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "approved" }, "access_token": { "type": "string", "pattern": "^duet_sk_.*" }, "token_type": { "type": "string", "const": "bearer" }, "prefix": { "type": "string", "pattern": "^duet_sk_.*" }, "scopes": { "type": "array", "items": { "type": "string" } }, "workspace": { "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" } }, "required": [ "slug", "name" ], "additionalProperties": false } }, "required": [ "status", "access_token", "token_type", "prefix", "scopes" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
Why the list can be shorter than the server
The API contains internal callbacks, administrative routes, and work still being migrated. Server reachability is not publication. The registry is intentionally allowlisted so an implementation detail cannot become a public promise through documentation drift.