Resource guide
Sessions are durable work, not requests
Starting a session creates an identity that outlives the initiating HTTP response. Store that identity immediately, then follow events to render progress and terminal state. Messages, notes, answers, and interrupts all target the same session timeline.
Session lifecycle routes require the sessions capability. An app that starts or controls sessions
must declare "sessions" in its apiScopes and use its runtime BENTO_APP_API_KEY; registration is
where the app requests that authority, without a separate install-consent grant. The attachment
upload-session mint on this page is the exception: it writes to the drive and therefore requires
files:write.
Every durable input records who sent it, and that author is derived from the credential — never
supplied by the caller. A browser session or human API key authors as that person;
a registered app's BENTO_APP_API_KEY authors as the app; the workspace VM's own key authors as
Bento itself. The one caller-visible attribution field is sourceSessionId on message, note, and
answer requests, which attributes the input to another session in the same workspace after the
server validates it exists there.
Some sessions acquire a runner state machine; the product calls those Jobs, but they are the same
resource on the same route. There is one list, and every session in it carries a bucket saying
what it is doing right now — asking, running, scheduled, or done. That reading prefers the
machine where there is one and the turn where there is not, so a session whose turn reported
complete while its machine keeps working still buckets as running. Page any subset with
?bucket=; omit it to page everything, newest first. A machine-backed session additionally carries
a machine projection, and the canonical Session detail URL exposes the full snapshot. List rows
arrive in { items, nextCursor }; authorization, search, and personal state can make a page short
or empty, so only a null cursor means the walk is complete.
Use ?topLevel=true on that collection to page only roots. To walk lineage, request
GET /sessions/{sessionId}/children; it returns exactly that readable parent's direct
children in the same summary envelope. A grandchild appears only when its own parent is queried.
Children may belong to another agent, have no agent, or carry a machine—the relationship is the
parent ID, not inherited agent scope. Each parent and each bucket/archive choice has an independent
opaque cursor; never reuse a cursor from the root list or another parent.
Parent readability is only the entry check. The server still evaluates every child through the
caller's current discovery lanes, so a specific-audience child can be omitted and a personal
archive can differ between readers. Archiving a parent does not archive its children: use the
child collection's archived=only mode to page archived children independently. As with all session
pages, a short or empty page may still have a continuation; stop only at nextCursor: null.
Start with a bounded prompt
The request schema requires a non-empty prompt. Start, message, note, and answer inputs may carry
a small bounded inline image set or attachment metadata for files already landed in the workspace
drive; attachment bytes do not travel through the session API. Durable input history keeps the
file's path, display name, byte count, and optional media type so clients can render the same file
reference later. Send only context the task needs. An input whose words were transcribed from
speech may set dictated: true, and the agent then reads it knowing a word may have been
misheard. tier, when present on a start or message
request, selects an automatic router (frontier or balanced) or a stable provider
alias (openai-frontier, openai-max, anthropic-frontier, anthropic-max, or
anthropic-balanced, google-recommended, or google-balanced). The Anthropic balanced choice
currently runs Claude Sonnet 5.5, and the Gemini balanced choice runs Gemini 4 Hydrogen. Provider
aliases follow model upgrades on subsequent turns without changing the saved choice. An unavailable
model fails through the ordinary session error path; it does not switch to another model.
Answers deliberately have no tier field because they resume the session's persisted choice.
{
"prompt": "Summarize release notes.",
"cwd": "agents/seo-specialist",
"title": "Release notes",
"tier": "balanced"
}The CLI returns as soon as the session is accepted. Use --cwd agents/<slug> to select its
agent and --title to keep a chosen title. Save the returned sessionId, inputSeq, and url;
open url to continue in Bento. Add --wait to wait for the reply.
bento session create --workspace "$WORKSPACE" --cwd agents/seo-specialist \
--title "Release notes" --tier balanced --prompt "Summarize release notes."curl -sS -X POST \
-H "Authorization: Bearer $BENTO_API_KEY" \
-H "Content-Type: application/json" \
"$BENTO_API_URL/v1/workspaces/$WORKSPACE/sessions/wait?waitMs=0" \
--data '{"prompt":"Summarize release notes.","cwd":"agents/seo-specialist","title":"Release notes","tier":"balanced","clientRequestId":"4b27f182-b3e8-47c4-9fb8-5a488243ab92"}'{
"sessionId": "ses_9",
"inputSeq": 1,
"status": "running",
"url": "https://app.bento.ing/w/acme/agents/seo-specialist/sessions/ses_9"
}Omitting behavior resolves to steer. On a newly created session there is no active turn yet,
so steer and follow-up have the same initial delivery boundary. You can still state the choice
explicitly:
{
"prompt": "Summarize release notes after indexing finishes.",
"cwd": "agents/seo-specialist",
"behavior": "follow_up"
}An explicit tier becomes sticky for later messages in that session. Each queued prompt keeps the effective tier resolved when it was accepted, so retries and later workspace-default changes cannot alter work already waiting to run.
The CLI and the /wait endpoint above return an input handle: sessionId, inputSeq,
and an absolute url, together with either status: "running" (accepted and still running, which is success) or a terminal event.
session create returns on acceptance by default. Open url immediately; use the handle with
bento session result get to observe that input's outcome later. Waiting does not submit another prompt.
The ordinary create endpoint, POST /v1/workspaces/{workspaceSlug}/sessions, returns a different
receipt: the new session identity, canonical snapshot, initial history, and absolute url
after one immediate delivery attempt. Clients using that endpoint can seed their detail and
history caches from the receipt and continue from the event stream. Its delivery field is
accepted when the runner acknowledged the initial prompt and queued when the durable
timeline still owns a later retry.
History uses the universal page envelope { items, nextCursor }, with at most 100 timeline rows per
page. Omit order for newest-first reading, or use order=asc for replay. afterSeq is accepted only
with ascending order and starts strictly after that durable sequence. Continuations are opaque:
pass nextCursor back unchanged, continue through short or empty pages, and stop only when it is
null. A page may be shorter than its requested limit when the next event would cross the bounded
database-read or serialized-response budget; its cursor still resumes at that first unconsumed
event. beforeSeq is a public address for a newest-first page: it returns rows strictly below that
sequence, so a client that keeps only a recent tail can ask for exactly the rows under its oldest
one. It cannot be combined with order=asc, and a continuation cursor stays bound to it. A
chronological UI reverses each newest-first wire page before merging it into its local timeline.
The event stream resumes independently from the last committed sequence, so reconnecting never
requires walking old history again.
Create, message, note, and answer requests may include a stable clientRequestId. The web creates
one UUID per submission; retrying the same request ID returns the already-created session or input
instead of duplicating it.
File attachments use the workspace drive rather than the inline image body: mint a grant and send the bytes to the VM, then name the resulting drive path on the message. See Files.
Wait for foreground work
Use a /wait route when the caller needs the result of the submitted turn. The request stays open
until the durable timeline contains the terminal caused by that input or its observation budget
expires. Set the optional waitMs query to choose a bounded budget; omitting it retains the server
default. Set waitMs=0 for background work with an input handle: it durably submits the work,
performs one result lookup, and returns without opening a live observation channel. Admission and
dispatch still take time. The existing routes without /wait retain their ordinary async receipts.
An initial wait request requires one UUID. Generate it once per logical submission and reuse it if the connection ends ambiguously.
{
"prompt": "Summarize release notes and report the conclusion.",
"cwd": "agents/seo-specialist",
"behavior": "follow_up",
"clientRequestId": "4b27f182-b3e8-47c4-9fb8-5a488243ab92"
}Use the corresponding explicit route for the operation: /sessions/wait for root creation,
/{sessionId}/children/wait for child creation, /{sessionId}/messages/wait for a message,
and /{sessionId}/answer/wait for an answer. Root and agent default aliases add /wait to their
ordinary message path. Notes remain fire-and-forget and have no wait variant.
A terminal returns HTTP 200 with the canonical sessionId, the submitted inputSeq, and the exact
durable terminal marker. complete, ask, interrupted, and sleep all complete the wait; runner
failure or cancellation remains event content rather than becoming an HTTP error. Fetch history
after inputSeq when the caller needs transcript context about how that result was produced—the
wait response deliberately does not copy history.
If no terminal is durable at the server deadline, HTTP 202 means observation timed out while the
turn continued. Keep the returned sessionId and inputSeq with the workspace and API origin.
Read that input's result without sending its prompt again:
bento session result get --workspace "$WORKSPACE" --session-id "$BENTO_SESSION_ID" \
--seq "$input_seq" --wait-ms 30000curl -sS -H "Authorization: Bearer $BENTO_API_KEY" \
"$BENTO_API_URL/v1/workspaces/$WORKSPACE/sessions/$BENTO_SESSION_ID/results/$input_seq?waitMs=30000"Omit waitMs on this GET for a single lookup, or set a positive budget to wait. It returns the same
200 terminal or 202 pending shape. The input handle grants no authority: the current caller must
be able to read the session, but need not be the original submitter. Notes and output events are
not waitable inputs. A deleted or unavailable session returns the existing not_found refusal;
deletion discovered during an admitted wait is not pending work.
If the submission connection ended before returning a handle, retry the original path with the
identical body and clientRequestId. That recovers the original input before mutable parent or
default aliases are resolved. Changing only the wait budget does not create another input.
Disconnecting a wait stops only observation—the already-durable input continues normally. Clients can resume observation later through the result endpoint. Read history separately for transcript context; a result lookup never submits, wakes or cancels work.
Start related work from a session
Use the session-keyed create route when one session starts another. The parent identity comes from
the path; the body stays the ordinary create shape. A child names its owner with agent or its
folder with cwd; with neither, it works in its parent's folder. An omitted tier inherits from the
parent. A session's folder is fixed when it is created. The resulting snapshot carries
createdBySessionId even if that parent is later deleted.
Cross-session messages, notes, and answers may set sourceSessionId so the timeline attributes the
injected input to the sending session instead of the credential's owner. Omit the field for ordinary
input. There is no request field for claiming user, app, or system authorship — those are always
derived from the credential.
{
"prompt": "What is your current result and what remains?",
"behavior": "follow_up",
"sourceSessionId": "js7a92k3fd0q1m8v6x4tz5nwr"
}History exposes each input's typed sender — {"kind":"user","userId":…}, {"kind":"app","appId":…},
{"kind":"session","sessionId":…}, or {"kind":"system"} — as stored identity only; current names,
emails, slugs, and titles are resolved at read time and never snapshotted into events. The row's
createdAt is the input's one timestamp, and its seq is the same value
history?order=asc&afterSeq=<seq> accepts to begin strictly later, so the sequence a model sees in
its message envelope is a ready-made replay boundary.
Search messages
GET /sessions/search?pattern= searches the messages of every session the caller can see with a
regular expression. Each item is one session with its best matching messages; each match carries
its seq, author (user or assistant), the input's sender, and a snippet whose
highlights are UTF-16 offsets into its text. Sessions arrive best match first, and a match's
strength fades with age, so an older match must be much stronger to outrank a recent one: when
looking for something old, page on or set createdBefore. An item shows a session's best three
matches; moreMatches: true says it has others, which a search with that sessionId lists. Narrow
with from, agentId (root for the drive's own sessions), sessionId,
createdAfter/createdBefore (an ISO date, read as midnight UTC, or a date-time with an offset
such as Z), and archived (include by default, exclude, or only).
bento session search --workspace "$WORKSPACE" \
--pattern 'webhook.*retr' --from user --created-after 2026-10-01curl -sS -G \
-H "Authorization: Bearer $BENTO_API_KEY" \
"$BENTO_API_URL/v1/workspaces/$WORKSPACE/sessions/search" \
--data-urlencode 'pattern=webhook.*retr' \
--data-urlencode 'from=user' \
--data-urlencode 'createdAfter=2026-10-01'A match's seq is a history address: history?order=asc&afterSeq=<max(0, seq − 3)>&view=transcript
reads the conversation around it.
The pattern is a JavaScript RegExp with the u flag, not ripgrep's dialect: \w, \d and \b
are ASCII-only, and there is no leading (?i). Case is smart: the search ignores case unless the
pattern spells an uppercase letter, and caseSensitive overrides that. fixedStrings=true matches
the pattern as plain text, which is the safe choice for a pasted error message or path.
An index finds the candidates the regex then checks, and it stores whole words, so some text is out of its reach:
- A word the pattern requires must start a word in the text:
ploydoes not find "deploy". A pattern with no such word, such as\d{3}, is refused withpattern_needs_literalunlesssessionIdnames one session, which is then read whole. - A word longer than 31 UTF-8 bytes is found by its first 31 bytes only. A long identifier is still
found by its start; near that cut, a letter shorter lowercased than as written (the Kelvin sign
K,
İ) can miss. - Ignoring case finds a word by its lowercase spelling, so letters JavaScript treats as one but lowercases apart (σ and ς, s and ſ, µ and μ) are different letters to the index.
- Long messages are indexed in chunks of about 8 KiB, and a match that spans two chunks can be missed.
- Only text a reader sees by default is indexed: messages and the questions an agent asks, not tool calls, tool output, reasoning, or attachments.
Every page carries meta. complete: false means the page may be missing matches: the search read
as much as one page may (reason: "read_budget" or "candidate_cap"). A common word often ends a
page this way, because its newest month alone fills the read budget. meta.hint names the filters
not yet set; add one, or require a longer or rarer word, and search again. reason: "access_filtered" keeps complete: true: a match was in a session this caller may not see.
A pattern that needs more alternatives than one search can run (over 16 words), or that takes more
than a second to check, is refused with pattern_too_expensive; pattern_invalid carries the
parser's message. A request the schema rejects is invalid_request without a reason: a pattern
over 1,000 characters, a date-time without an offset, or a limit over the page maximum. A
sessionId the caller cannot see is 404. The cursor is bound to the pattern,
its flags, and every filter, so change any of them and start again without it.
Use the default alias when identity should be stable
The default path is a server-resolved alias for one ordinary session belonging to an owner — an
agent, or the drive root under the reserved root slug. Reading it before the first message returns
{ "session": null } on a 200, because having no chat yet is the alias's ordinary state rather
than an error; only /history answers no_default_session. Posting the first message creates and
binds the session atomically, while later messages resolve the same real identity.
The binding is a pointer on the owner, not a property of the session, and several operations move it.
Posting a first message sets it. Permanent deletion clears it. PUT sets it to an active,
top-level, workspace-wide chat that owner already has, excluding onboarding chats, or to null —
which demotes the current default to an ordinary session without
touching it: it stops being excluded from excludeDefault listings, keeps running whatever it was
running, and the owner's next message starts a fresh default. Globally archiving the default
also clears the binding, so the next message starts a fresh chat. Personal archive never moves it.
An ineligible chat the caller can read returns 409 with the first matching reason:
wrong owner, archived, onboarding, child, then specific-people audience. Each error in the
update contract names how to choose an eligible chat.
Unknown, unreadable, invisible or deleting chats return 404 not_found. A refusal leaves
the current binding intact; read the alias again to confirm a successful repoint or clear.
The default message body is the ordinary message shape and deliberately has no mode: defaults
always launch in automatic mode. Responses expose the resolved session ID whether the request
created the session or continued it, so clients may switch to canonical ID-addressed routes whenever
they need another session operation.
Message and answer responses return { "ok": true, "delivery": "accepted" | "queued" }.
The request waits for one correlated runner acknowledgement: accepted means the agent runner has taken
the input, while queued means the input is already durable and the normal session drain will retry
it. A queued response is therefore a delivery state, not a rejected message.
Pin an additional chat
Owners and editors can set a workspace-wide pin with bento session update --session-id ID --pinned.
To unpin, send { "pinned": false } with --body-file. Viewers observe the pin and cannot change it;
existing audiences still control who can discover the chat. Render the action from permissions.pin.
The returned session snapshot confirms the committed desired state, and repeated identical
writes return the same version. Pins change neither activity nor unread state.
An additional-chat pin is independent of its agent's pin. Main chats cannot be pinned independently: making a pinned chat the main chat clears its pin. Archive hides a chat while preserving its pin for restore; deletion removes it permanently.
Treat audience and archive as response-driven state
Choosing Specific people changes which humans participate in a session and who receives its noise. It is not an isolation boundary for agents, memory, installed apps, workspace VM processes, or workspace owners. Those resources remain in the workspace trust domain; use the response's audience and permission fields instead of inferring authority from a role, submitting actor, or audience kind.
Discover audience IDs through the existing paginated workspace member directory. That collection
accepts either sessions or files:read, so a sessions-only app or workspace process can select
people without requesting unrelated file access. Use each returned member's id in creation's
memberUserIds or an audience update's add and remove arrays; continue through nextCursor
exactly like every other collection.
Archive is two independent desired states. A person may archive a session only for themselves, while
an authorized editor or owner may archive it for everyone. The response preserves both timestamps;
the workspace-wide cause dominates effective visibility without erasing the personal cause beneath
it. Restoring the dominant cause can therefore reveal the preserved cause rather than making the
session active. Clients should render actions from permissions.personalArchive,
permissions.globalArchive, and permissions.delete, send the desired cause, then commit the
returned summary. They must not manufacture timestamps or recompute the effective reason locally.
Global archive of the default session clears its alias; personal archive never moves it. Archiving never cascades to child sessions. Permanent deletion includes the selected session and every descendant. It may clear a default alias only when that alias still points at a deleted session; the server makes that comparison and the client never chooses a replacement.
Accepted new messages and answers restore a globally archived session in the same transaction
that accepts the input. A person's own input also clears their personal archive; another person's
input or input from a session, app, or system does not. Notes, duplicate inputs, and delivery drains
do not restore. The archive response includes globalArchiveOrigin: manual, automatic, or
null for active sessions and archives created before origin tracking.
A workspace keeps 10,000 active sessions. When it goes over that cap, the oldest asking and
done sessions are archived automatically with globalArchiveOrigin: 'automatic', preserving
their last activity time. Pinned, running, scheduled, and default sessions are never archived
this way, so these exemptions can keep the workspace above the cap. Accepted new input restores
an automatically archived session just like any other global archive.
An empty 204 means the selected root is already sealed from public reads and its recursive deletion
work is durable; descendant sealing, runner disposal, and physical cleanup continue asynchronously.
Successful, missing, hidden, and retried deletion all return that same empty response, so retrying
after a lost response is safe. An unavailable runner delays hidden physical cleanup instead of
restoring visibility or turning the accepted request into 502. Connected-provider cleanup is best
effort and never retains Bento session data once runner disposal succeeds. A caller that can still see
the session but lacks lifecycle authority receives 403 and should refresh detail to learn the
current response-driven permissions.
Continue with steer or follow-up
Messages also default to steer, which lets the running agent incorporate the new user message
immediately.
{
"prompt": "Use the latest deployment logs.",
"tier": "frontier"
}Choose follow_up when the message should wait for the agent to finish its current task. The
message is still accepted and persisted immediately; its delivery behavior is part of the user
message rather than gateway policy.
{
"prompt": "After the current task, compare staging and production.",
"behavior": "follow_up"
}Hold the workspace directory
A client that shows every session at once — a sidebar, a dashboard, an agent watching its workspace — should hold the workspace directory instead of paging the list. The directory is every agent and every non-archived session the caller can see, as lightweight rows, kept current by one stream. Automatically archived sessions leave the directory; use the archived session list to find them again. The same stream carries the events of every session you can see whose turn is running, so one connection keeps both the list and the running transcripts current. Read a settled session's transcript per session from history.
- Snapshot.
GET /directoryreturns the first chunk; pass eachnextCursorback unchanged until a chunk saysdone: true. Every chunk answers at the samehighWaterSeq, and only the first carriesagents. Apply the snapshot only once every chunk has arrived. - Stream. Open
GET /directory/eventswithLast-Event-IDset tohighWaterSeq. Each frame'sidis a directory sequence and itseventis the entry'skind:upsertandremovedfor sessions,agent_upsertandagent_removedfor agents,apps_changedwhen the workspace's apps changed (it carries no row: list apps again),session_readwhen the caller read a session elsewhere, andcursorwhen there is no row to send: changes you cannot see moved the head, or — always, when you connect already at the head — to say you are caught up (it carries no row; just commit itsid). Keep whichever copy of a row has the higherversion, so applying an entry twice is harmless, then commit the frame'sidas your cursor. - Reset. A
resetframe is the stream's last and carries noid, so a client that reconnects on its own cannot resume past it: take a fresh snapshot and stream from itshighWaterSeq. The server sends it when the replay after your cursor would be too long, when the cursor is older than what it retains, and when your role in the workspace changed. - Running sessions. A session whose turn is running joins the stream with one
session_joinedframe,{"sessionId", "afterSeq", "headSeq"}, sent after the directory entry that shows it running when this connection sends one. Itssession_eventframes follow,{"sessionId", "frame"}, whereframeis whatsession.history.list.eventssends: durable events with aseq, in order, and live progress without one. Its frames start afterafterSeq: if you hold that session's events through a lower seq, read the gap from history; if you hold events pastheadSeq, the server does not have them, so drop yours and read again. A session's frames end on their own once its turn finishes. If one session can't be read for a moment, it joins again with a freshsession_joined; the stream goes on. Session frames carry noid, soLast-Event-IDresumes only the directory, and every running session joins again on reconnect. - Reconnect. The stream ends itself cleanly at regular intervals, before any platform limit
can cut it, and sends
: keepalivecomments while it is quiet. Reconnect from your committed cursor. A stream that cannot go on ends with oneevent: stream_errorframe.{"error":"forbidden"}means the caller left the workspace, and the reconnect then answers403or404, which, like401, is terminal;{"error":"unavailable"}is a dropped connection — reconnect.
The CLI reads a paginated directory snapshot; use curl for live directory events.
bento directory get --workspace "$WORKSPACE"curl -sS -H "Authorization: Bearer $BENTO_API_KEY" \
"$BENTO_API_URL/v1/workspaces/$WORKSPACE/directory"
curl -sS -N -H "Authorization: Bearer $BENTO_API_KEY" \
-H "Last-Event-ID: $HIGH_WATER_SEQ" \
"$BENTO_API_URL/v1/workspaces/$WORKSPACE/directory/events"Only a person has a read cursor. A browser session or human API key sees
viewer: {"kind":"human","joinedAtSeq":…}, rows carry readThroughSeq, and a session is unread
when its version is above joinedAtSeq and readThroughSeq is below its lastEventSeq. An app
key or the workspace VM sees viewer: {"kind":"workspace"}, rows without readThroughSeq, and no
session_read entries. Clients without Last-Event-ID can pass ?after= instead; with neither,
the stream answers reset at once.
To hold file metadata alongside sessions, use the workspace drive.
Project events deterministically
Persist canonical events, tolerate ephemeral progress, and treat document patches as updates to
their owned state rather than chat messages. Follow SSE and resume for reconnection.
A machine-backed session's detail response carries a compact machine projection, already
classified into stable ordered-path items. Clients should not infer the current step by matching state labels or
treat the following definition item as a predicted transition.
Sessions
30 operations /v1 /workspaces /{workspaceSlug} /directoryRead one chunk of the workspace directory snapshot
bento directory get- 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 } } }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "highWaterSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "nextCursor": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "done": { "type": "boolean" }, "viewer": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "human" }, "joinedAtSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "kind", "joinedAtSeq" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false } ] }, "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" }, "pinned": { "type": "boolean" }, "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 }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "defaultSessionId": { "type": "string" } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "pinned", "createdAt", "updatedAt", "version" ], "additionalProperties": false } }, "rootAgent": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "pinned": { "type": "boolean" }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "step": { "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 }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "activityVersion": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastVisibleSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "readThroughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "isDefault": { "type": "boolean" }, "preview": { "type": "object", "properties": { "text": { "type": "string", "minLength": 1 }, "author": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "agent" } }, "required": [ "kind" ], "additionalProperties": false }, { "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 } ] } }, "required": [ "text", "author" ], "additionalProperties": false } }, "required": [ "id", "pinned", "title", "titleOrigin", "titleStatus", "turnStatus", "bucket", "createdAt", "updatedAt", "lastEventSeq", "audience", "archive", "permissions", "version", "activityVersion", "lastVisibleSeq", "isDefault" ], "additionalProperties": false } } }, "required": [ "highWaterSeq", "nextCursor", "done", "viewer", "sessions" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "forbidden" } }, "required": [ "error" ], "additionalProperties": false, "description": "The caller is not a member of this workspace (403)" } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /directory /eventsStream the workspace directory changes after a sequence, and the events of its running sessions, as server-sent 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": { "after": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } } }- Headers
Last-Event-ID— Resume after this directory sequence; wins over `after`.
- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "upsert" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "row": { "type": "object", "properties": { "id": { "type": "string" }, "pinned": { "type": "boolean" }, "title": { "type": "string" }, "titleOrigin": { "type": "string", "enum": [ "excerpt", "auto", "manual" ] }, "titleStatus": { "type": "string", "enum": [ "generating", "complete", "failed" ] }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "createdBySessionId": { "type": "string" }, "machine": { "type": "object", "properties": { "step": { "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 }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "activity" ], "additionalProperties": false }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "activityVersion": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "lastVisibleSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "readThroughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "isDefault": { "type": "boolean" }, "preview": { "type": "object", "properties": { "text": { "type": "string", "minLength": 1 }, "author": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "agent" } }, "required": [ "kind" ], "additionalProperties": false }, { "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 } ] } }, "required": [ "text", "author" ], "additionalProperties": false } }, "required": [ "id", "pinned", "title", "titleOrigin", "titleStatus", "turnStatus", "bucket", "createdAt", "updatedAt", "lastEventSeq", "audience", "archive", "permissions", "version", "activityVersion", "lastVisibleSeq", "isDefault" ], "additionalProperties": false } }, "required": [ "kind", "seq", "row" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "removed" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "sessionId": { "type": "string" } }, "required": [ "kind", "seq", "sessionId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "agent_upsert" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "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" }, "pinned": { "type": "boolean" }, "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 }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "defaultSessionId": { "type": "string" } }, "required": [ "id", "workspaceId", "anchorId", "anchorPath", "anchorState", "slug", "pinned", "createdAt", "updatedAt", "version" ], "additionalProperties": false } }, "required": [ "kind", "seq", "agent" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "agent_removed" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "agentId": { "type": "string" } }, "required": [ "kind", "seq", "agentId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "root_agent_upsert" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "rootAgent": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false } }, "required": [ "kind", "seq", "rootAgent" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session_read" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "sessionId": { "type": "string" }, "readThroughSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "kind", "seq", "sessionId", "readThroughSeq" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "apps_changed" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "kind", "seq" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "reset" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "kind", "seq" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "cursor" }, "seq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "kind", "seq" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session_joined" }, "sessionId": { "type": "string" }, "afterSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "headSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "kind", "sessionId", "afterSeq", "headSeq" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "session_event" }, "sessionId": { "type": "string" }, "frame": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "number" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "required": [ "type", "answer", "sender" ], "additionalProperties": false } ] } ] }, { "type": "object", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } ] } }, "required": [ "event" ], "additionalProperties": false } }, "required": [ "kind", "sessionId", "frame" ], "additionalProperties": false }, { "type": "object", "properties": { "error": { "type": "string", "enum": [ "forbidden", "unavailable" ] } }, "required": [ "error" ], "additionalProperties": false } ] }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_last_event_id" } }, "required": [ "error" ], "additionalProperties": false, "description": "`Last-Event-ID` is not a directory sequence (400)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "forbidden" } }, "required": [ "error" ], "additionalProperties": false, "description": "The caller is not a member of this workspace (403)" } ] }- Delivery
- Server-sent event stream
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessionsList and page sessions by bucket. search keeps a session only when every word appears in its title or first prompt, so adding a word only narrows the results.
bento session list- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "archived": { "default": "exclude", "type": "string", "enum": [ "exclude", "only" ] }, "search": { "type": "string", "maxLength": 200 }, "agentId": { "type": "string", "minLength": 1 }, "excludeDefault": { "anyOf": [ { "type": "boolean", "const": true }, { "type": "string", "const": "true" } ] }, "topLevel": { "anyOf": [ { "type": "boolean", "const": true }, { "type": "string", "const": "true" } ] } }, "additionalProperties": false }- 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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "machine": { "type": "object", "properties": { "step": { "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 }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "activity" ], "additionalProperties": false } }, "required": [ "id", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions" ], "additionalProperties": false } }, "nextCursor": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Opaque collection cursor is malformed or bound to another walk (400)
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /searchSearch the messages of every session you can see with a regular expression. Sessions come back best match first, each with its matching messages as snippets; open a match in context with session.history.list from its seq. The pattern is a JavaScript RegExp with the `u` flag, which differs from ripgrep: \w, \d and \b are ASCII-only, and there is no leading (?i). fixedStrings matches the pattern as plain text. Case follows smart case: case-insensitive unless the pattern spells an uppercase letter; caseSensitive overrides it. An index finds candidates by words, from the start of a word only, so the pattern must require a word that starts a word in the text: "ploy" does not find "deploy", and a pattern with no such word (\d{3}) is refused unless sessionId names one session to read whole. A word longer than 31 UTF-8 bytes is found by its first 31 bytes only, and near that cut a letter shorter lowercased than as written (the Kelvin sign, İ) can miss. Case-insensitive search finds a word by its lowercase spelling, so letters JavaScript treats as one (σ/ς, s/ſ, µ/μ) are different to the index. Long messages are indexed in chunks of about 8 KiB, and a match that spans two chunks can be missed. Only text a reader sees by default is searched: messages and the questions an agent asks, not tool calls, tool output, reasoning or attachments. meta.complete is false when a page may be missing matches, usually because a common word filled the read budget (reason read_budget); narrow the search as meta.hint says.
bento session search --pattern 'webhook.*retr' --from user --created-after 2026-10-01- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 }, "pattern": { "type": "string", "minLength": 1, "maxLength": 1000, "description": "A JavaScript regular expression, compiled with the u flag; at most 1,000 characters." }, "fixedStrings": { "description": "Match the pattern as plain text, not a regex.", "type": "boolean" }, "caseSensitive": { "description": "Omitted: smart case, so the search is case-sensitive only when the pattern spells an uppercase letter.", "type": "boolean" }, "agentId": { "description": "Only sessions of this agent; `root` for the drive's own sessions.", "type": "string", "minLength": 1 }, "sessionId": { "description": "Only this session, read whole, so the pattern needs no required word.", "type": "string", "minLength": 1 }, "from": { "description": "Only messages from this side.", "type": "string", "enum": [ "user", "assistant" ] }, "createdAfter": { "description": "Only messages created after this instant: an ISO date (midnight UTC) or date-time.", "type": "string" }, "createdBefore": { "description": "Only messages created before this instant: an ISO date (midnight UTC) or date-time.", "type": "string" }, "archived": { "default": "include", "description": "Whether archived sessions are searched too, left out, or searched alone.", "type": "string", "enum": [ "include", "exclude", "only" ] } }, "required": [ "pattern" ], "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "session": { "type": "object", "properties": { "id": { "type": "string" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "machine": { "type": "object", "properties": { "step": { "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 }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "activity" ], "additionalProperties": false } }, "required": [ "id", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions" ], "additionalProperties": false }, "matches": { "type": "array", "items": { "type": "object", "properties": { "seq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "createdAt": { "type": "number" }, "author": { "type": "string", "enum": [ "user", "assistant" ] }, "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 } ] }, "snippet": { "type": "object", "properties": { "text": { "type": "string" }, "highlights": { "type": "array", "items": { "type": "array", "prefixItems": [ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } ] } } }, "required": [ "text", "highlights" ], "additionalProperties": false } }, "required": [ "seq", "createdAt", "author", "snippet" ], "additionalProperties": false } }, "moreMatches": { "type": "boolean" } }, "required": [ "session", "matches", "moreMatches" ], "additionalProperties": false } }, "nextCursor": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "meta": { "type": "object", "properties": { "complete": { "type": "boolean" }, "reason": { "type": "string", "enum": [ "candidate_cap", "read_budget", "access_filtered" ] }, "hint": { "type": "string" } }, "required": [ "complete" ], "additionalProperties": false } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "anyOf": [ { "anyOf": [ { "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "pattern_invalid" }, "message": { "type": "string" } }, "required": [ "error", "message" ], "additionalProperties": false, "description": "The pattern is not a valid JavaScript regular expression in `u` mode (400)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "pattern_needs_literal" } }, "required": [ "error" ], "additionalProperties": false, "description": "The pattern has no word every match must contain. Add one, or search one session with sessionId (400)." } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "pattern_too_expensive" } }, "required": [ "error" ], "additionalProperties": false, "description": "The pattern needs more alternatives than one search can run (over 16 words), or took over a second to check. Use fewer alternatives, a simpler pattern, narrower filters, or sessionId (400)." } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "not_found" } }, "required": [ "error" ], "additionalProperties": false, "description": "The session is unavailable to this caller (404)" } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /skillsList the skills available to a session working in a workspace folder
bento skill list- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 }, "cwd": { "type": "string" } }, "additionalProperties": false }- 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", "minLength": 1 }, "description": { "type": "string" }, "path": { "type": "string", "minLength": 1 }, "scope": { "type": "string", "enum": [ "user", "project", "temporary", "builtin" ] } }, "required": [ "name", "path" ], "additionalProperties": false } }, "nextCursor": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Opaque collection cursor is malformed or bound to another walk (400)
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessionsCreate a session from its first user message
bento session create --agent seo-specialist --title "heybento.ai" --prompt "..."- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "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)$" }, "agent": { "description": "The agent that owns the session, by slug; `root` is the workspace agent. The session runs in the agent's folder. Not with cwd.", "type": "string" }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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" ] }, "audience": { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "memberUserIds": { "maxItems": 100, "type": "array", "items": { "type": "string" } } }, "required": [ "kind", "memberUserIds" ], "additionalProperties": false } }, "required": [ "prompt" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "onboarding" }, "agentSlug": { "type": "string" } }, "required": [ "kind", "agentSlug" ], "additionalProperties": false } ] }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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": [ "events" ], "additionalProperties": false }, "dispatched": { "type": "boolean", "const": false }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "url", "session", "snapshot", "history", "dispatched", "delivery" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "sessionId" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /waitCreate a session and wait for the submitted turn to finish
bento session create --agent seo-specialist --title "heybento.ai" --prompt "..."- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "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)$" }, "agent": { "description": "The agent that owns the session, by slug; `root` is the workspace agent. The session runs in the agent's folder. Not with cwd.", "type": "string" }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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" ] }, "audience": { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "memberUserIds": { "maxItems": 100, "type": "array", "items": { "type": "string" } } }, "required": [ "kind", "memberUserIds" ], "additionalProperties": false } }, "required": [ "prompt", "clientRequestId" ], "additionalProperties": false }- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "waitMs": { "type": "integer", "minimum": 0, "maximum": 720000 } } }- 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 }, "url": { "type": "string", "format": "uri" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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", "url", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "running" }, "url": { "type": "string", "format": "uri" } }, "required": [ "sessionId", "inputSeq", "status", "url" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /childrenCreate a child session inheriting its parent context
bento session child create --session-id example --prompt "..." --agent seo-specialist- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "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)$" }, "agent": { "description": "The agent that owns the session, by slug; `root` is the workspace agent. The session runs in the agent's folder. Not with cwd.", "type": "string" }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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" ], "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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": [ "events" ], "additionalProperties": false }, "dispatched": { "type": "boolean", "const": false }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "url", "session", "snapshot", "history", "dispatched", "delivery" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /children /waitCreate a child session and wait for the submitted turn to finish
bento session child create --session-id example --prompt "..." --agent seo-specialist- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "title": { "type": "string", "minLength": 1, "maxLength": 120 }, "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)$" }, "agent": { "description": "The agent that owns the session, by slug; `root` is the workspace agent. The session runs in the agent's folder. Not with cwd.", "type": "string" }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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" ], "additionalProperties": false }- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "waitMs": { "type": "integer", "minimum": 0, "maximum": 720000 } } }- 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 }, "url": { "type": "string", "format": "uri" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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", "url", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "running" }, "url": { "type": "string", "format": "uri" } }, "required": [ "sessionId", "inputSeq", "status", "url" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /childrenPage one session’s direct children
bento session child list --session-id example- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 }, "bucket": { "type": "string", "enum": [ "asking", "running", "scheduled", "done" ] }, "archived": { "default": "exclude", "type": "string", "enum": [ "exclude", "only" ] } }, "additionalProperties": false }- 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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } }, "required": [ "id", "name" ], "additionalProperties": false }, "onboarding": { "type": "boolean" }, "createdBySessionId": { "type": "string" }, "createdAt": { "type": "number" }, "updatedAt": { "type": "number" }, "lastEventSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unread": { "type": "boolean" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "machine": { "type": "object", "properties": { "step": { "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 }, "activity": { "type": "string", "enum": [ "running", "sleeping", "waiting", "idle" ] }, "nextWakeAt": { "type": "number" }, "outcome": { "type": "string", "enum": [ "interrupted", "completed", "failed", "cancelled", "error" ] } }, "required": [ "activity" ], "additionalProperties": false } }, "required": [ "id", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions" ], "additionalProperties": false } }, "nextCursor": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Opaque collection cursor is malformed or bound to another walk (400)
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId}Get a session snapshot
bento session get --session-id example- 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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /agents /{agentSlug} /sessions /defaultGet an agent's default session snapshot
bento agent session default get --agent-slug seo-specialist- 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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "session" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /agents /{agentSlug} /sessions /defaultPoint an agent's default session alias at a session, or at nothing
bento agent session default update --agent-slug seo-specialist --body-file request.json- 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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions", "workspaceId", "lastDeliveredInputSeq" ], "additionalProperties": false }, { "type": "null" } ] } }, "required": [ "session" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "anyOf": [ { "anyOf": [ { "anyOf": [ { "anyOf": [ { "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "not_found" } }, "required": [ "error" ], "additionalProperties": false, "description": "The session is unavailable to this caller (404)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "forbidden" } }, "required": [ "error" ], "additionalProperties": false } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "default_session_wrong_owner" } }, "required": [ "error" ], "additionalProperties": false, "description": "This chat belongs to another owner. Pick a chat owned by the selected agent, or update its own agent's default (409)." } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "default_session_archived" } }, "required": [ "error" ], "additionalProperties": false, "description": "An archived chat can't be an agent's default. Restore it or pick an active chat this agent owns (409)." } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "default_session_onboarding" } }, "required": [ "error" ], "additionalProperties": false, "description": "An onboarding chat can't be an agent's default. Pick an ordinary chat this agent owns (409)." } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "default_session_has_parent" } }, "required": [ "error" ], "additionalProperties": false, "description": "A child session can't be an agent's default chat. Pick a top-level chat this agent owns (409)." } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "default_session_not_workspace_wide" } }, "required": [ "error" ], "additionalProperties": false, "description": "A specific-people chat can't be an agent's default. Pick a workspace-wide chat this agent owns (409)." } ] }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /workspaces /{workspaceSlug} /agents /{agentSlug} /sessions /default /historyPage through an agent's default session history
bento agent session default history list --agent-slug seo-specialist- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 }, "order": { "default": "desc", "type": "string", "enum": [ "asc", "desc" ] }, "view": { "default": "all", "type": "string", "enum": [ "all", "transcript" ] }, "afterSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "no_default_session" } }, "required": [ "error" ], "additionalProperties": false, "description": "The selected owner has no default session (404)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "not_found" } }, "required": [ "error" ], "additionalProperties": false, "description": "The session is unavailable to this caller (404)" } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /agents /{agentSlug} /sessions /default /messagesCreate or message an agent's default session
bento agent session default message create --agent-slug seo-specialist --prompt "..."- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 }, "agentFirstMessage": { "type": "string", "maxLength": 2000 } }, "required": [ "prompt" ], "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "url": { "type": "string", "format": "uri" }, "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" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] }, "workspaceId": { "type": "string" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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": [ "events" ], "additionalProperties": false }, "dispatched": { "type": "boolean", "const": false }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] } }, "required": [ "url", "session", "snapshot", "history", "dispatched", "delivery" ], "additionalProperties": false }, { "type": "object", "properties": { "ok": { "type": "boolean", "const": true }, "delivery": { "type": "string", "enum": [ "accepted", "queued" ] }, "url": { "type": "string", "format": "uri" }, "sessionId": { "type": "string", "minLength": 1 } }, "required": [ "ok", "delivery", "url", "sessionId" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /agents /{agentSlug} /sessions /default /messages /waitCreate or message an agent's default session and wait for the turn
bento agent session default message create --agent-slug seo-specialist --prompt "..."- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 }, "agentFirstMessage": { "type": "string", "maxLength": 2000 } }, "required": [ "prompt", "clientRequestId" ], "additionalProperties": false }- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "waitMs": { "type": "integer", "minimum": 0, "maximum": 720000 } } }- 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 }, "url": { "type": "string", "format": "uri" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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", "url", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "running" }, "url": { "type": "string", "format": "uri" } }, "required": [ "sessionId", "inputSeq", "status", "url" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /audiencePage the current members of a specific session audience
bento session audience get --session-id example- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 } }, "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } }, "nextCursor": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "not_found" } }, "required": [ "error" ], "additionalProperties": false, "description": "The session is unavailable to this caller (404)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "audience_kind_immutable" } }, "required": [ "error" ], "additionalProperties": false, "description": "This session does not have a specific-people audience (409)" } ] }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /audienceAtomically update a specific session audience; self-removal returns no body when access is lost
bento session audience update --session-id example --body-file request.json- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "add": { "maxItems": 100, "type": "array", "items": { "type": "string" } }, "remove": { "maxItems": 100, "type": "array", "items": { "type": "string" } } }, "additionalProperties": false }- Response
200200 response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "pinned": { "type": "boolean" }, "pin": { "type": "object", "properties": { "pinned": { "type": "boolean" }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "pinned", "version" ], "additionalProperties": false }, "turnStatus": { "type": "string", "enum": [ "running", "complete", "ask", "interrupted", "sleep" ] }, "turnError": { "type": "string" }, "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" ] }, "cwd": { "type": "string" }, "agent": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "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" }, "pollIntervalMs": { "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" }, "audience": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "workspace" } }, "required": [ "kind" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "specific" }, "count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "preview": { "maxItems": 5, "type": "array", "items": { "type": "object", "properties": { "memberId": { "type": "string" }, "userId": { "type": "string" }, "name": { "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": [ "owner", "editor", "viewer" ] } }, "required": [ "memberId", "userId", "name", "email", "role" ], "additionalProperties": false } } }, "required": [ "kind", "count", "preview" ], "additionalProperties": false } ] }, "archive": { "type": "object", "properties": { "globalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "globalArchiveOrigin": { "anyOf": [ { "type": "string", "enum": [ "manual", "automatic" ] }, { "type": "null" } ] }, "personalArchivedAt": { "anyOf": [ { "type": "number" }, { "type": "null" } ] }, "reason": { "anyOf": [ { "type": "string", "enum": [ "global", "personal" ] }, { "type": "null" } ] } }, "required": [ "globalArchivedAt", "globalArchiveOrigin", "personalArchivedAt", "reason" ], "additionalProperties": false }, "permissions": { "type": "object", "properties": { "send": { "type": "boolean" }, "answer": { "type": "boolean" }, "interrupt": { "type": "boolean" }, "rename": { "type": "boolean" }, "pin": { "type": "boolean" }, "manageAudience": { "type": "boolean" }, "personalArchive": { "type": "boolean" }, "globalArchive": { "type": "boolean" }, "delete": { "type": "boolean" } }, "required": [ "send", "answer", "interrupt", "rename", "pin", "manageAudience", "personalArchive", "globalArchive", "delete" ], "additionalProperties": false }, "view": { "type": "string" }, "viewRevision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "viewBy": { "type": "string", "enum": [ "user", "agent" ] } }, "required": [ "id", "pinned", "turnStatus", "bucket", "title", "titleOrigin", "titleStatus", "createdAt", "updatedAt", "lastEventSeq", "unread", "audience", "archive", "permissions" ], "additionalProperties": false }204No structured response body
- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /results /{seq}Read or wait for the durable outcome of an existing session input
bento session result get --session-id example --seq 1- 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": { "waitMs": { "type": "integer", "minimum": 0, "maximum": 720000 } } }- 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 }, "url": { "type": "string", "format": "uri" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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", "url", "terminal" ], "additionalProperties": false }, { "type": "object", "properties": { "sessionId": { "type": "string", "minLength": 1 }, "inputSeq": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "status": { "type": "string", "const": "running" }, "url": { "type": "string", "format": "uri" } }, "required": [ "sessionId", "inputSeq", "status", "url" ], "additionalProperties": false } ] }- Delivery
- Standard response
- Retry
- Declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /historyPage through durable session events
bento session history list --session-id example- 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": 50, "type": "integer", "minimum": 1, "maximum": 100 }, "order": { "default": "desc", "type": "string", "enum": [ "asc", "desc" ] }, "view": { "default": "all", "type": "string", "enum": [ "all", "transcript" ] }, "afterSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "beforeSeq": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "additionalProperties": false }- Response
Response JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "items": { "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] } }, "required": [ "items", "nextCursor" ], "additionalProperties": false }- Errors
Error body JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "anyOf": [ { "type": "object", "properties": { "error": { "type": "string", "const": "not_found" } }, "required": [ "error" ], "additionalProperties": false, "description": "The session is unavailable to this caller (404)" }, { "type": "object", "properties": { "error": { "type": "string", "const": "invalid_cursor" } }, "required": [ "error" ], "additionalProperties": false, "description": "Opaque collection cursor is malformed or bound to another walk (400)" } ] }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /history /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": {}, "additionalProperties": false }- 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 }, "createdAt": { "type": "number" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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" }, "pollWake": { "type": "boolean" }, "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": "agent_message" }, "message": { "type": "string", "minLength": 1 }, "createdAt": { "type": "string" } }, "required": [ "type", "message", "createdAt" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "view_shown" }, "view": { "type": "string" }, "createdAt": { "type": "string" } }, "required": [ "type", "view", "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 } }, "dictated": { "type": "boolean", "const": true } }, "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 /workspaces /{workspaceSlug} /sessions /{sessionId} /images /{imageId}Read an image referenced by a session event.
bento session image get --session-id example --image-id example- Scope
ws:{workspaceSlug}:sessions- Request
- No JSON request body
- Response
- Raw byte stream
- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /messagesSend a user message to a session
bento session message create --session-id example --prompt "..."- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "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" ] }, "url": { "type": "string", "format": "uri" } }, "required": [ "ok", "delivery", "url" ], "additionalProperties": false }- Delivery
- Standard response
- Retry
- Not declared idempotent
/v1 /workspaces /{workspaceSlug} /sessions /{sessionId} /messages /waitSend a user message and wait for the submitted turn to finish
bento session message create --session-id example --prompt "..."- Scope
ws:{workspaceSlug}:sessions- Request
Request JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "description": "The words of the input. May be empty when it carries images or attachments." }, "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" ] } }, "dictated": { "description": "True when the words were transcribed from speech.", "type": "boolean" }, "tier": { "type": "string", "enum": [ "frontier", "balanced", "economy", "openai-frontier", "openai-max", "anthropic-frontier", "anthropic-max", "anthropic-balanced", "google-recommended", "google-balanced" ] }, "behavior": { "default": "steer", "type": "string", "enum": [ "steer", "follow_up" ] }, "sourceSessionId": { "type": "string", "minLength": 1 } }, "required": [ "prompt", "clientRequestId" ] }- Query
Query parameters JSON schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "waitMs": { "type": "integer", "minimum": 0, "maximum": 720000 } } }- 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 }, "url": { "type": "string", "format": "uri" }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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" }, "providerRecovery": { "type": "object", "properties": { "fromModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "fromRoute": { "type": "string", "enum": [ "configured", "vercel", "unknown" ] }, "toModel": { "type": "string", "minLength": 1, "maxLength": 256 }, "toRoute": { "type": "string", "const": "vercel" }, "reason": { "type": "string", "enum": [ "empty_response", "provider_error" ] }, "status": { "type": "integer", "minimum": 100, "maximum": 599 } }, "required": [ "fromModel", "fromRoute", "toModel", "toRoute", "reason" ], "additionalProperties": false }, "metadata": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "storage_full", "session_cwd_fallback", "bound_agent_root_unavailable", "relay_backlog", "runner_exited", "relay_undeliverable", "interrupt_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": [ "first_turn", "new_task", "idle", "manual_compact", "overflow", "modality_switch", "tier_change" ] }, "rationale": { "type": "string" }, "probabilities": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "number" } }, "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", "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "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 }, "pendingStateTransition": { "type": "object", "properties": { "stateName": { "type": "string" } }, "required": [ "stateName" ], "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 }, "routing": { "type": "object", "properties": { "saved": { "type": "object", "properties": { "tier": { "type": "string" }, "route": { "type": "string" } }, "required": [ "tier", "route" ], "additionalProperties": false }, "compactedSinceLastMessage": { "type": "boolean" }, "currentTask": { "type": "string" } }, "additionalProperties": false } }, "required": [ "status", "mode", "agent" ], "additionalProperties": false }, "wakeAt": { "type": "number" }, "pollWake": { "type": "boolean" }, "quiet": { "type": "boolean", "const": true }, "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": "nu