JSON property names are camelCase and enums travel as their names. A ? marks a property the payload may omit;| null one that may be null.
supported | boolean | Whether the app registered AI conversations. |
voiceSupported | boolean | Whether the app registered the voice loop. |
openSessions | number | Sessions the bridge holds open, and raises events for. |
A stored session, without loading it.
id | string | |
title | string | null | |
started | string | |
lastActivity | string | |
messageCount | number | |
profile | string | null | |
tags | string[] | |
usage | AiUsage | |
Everything billed in a session.
inputTokens | number | |
outputTokens | number | |
cachedInputTokens | number | |
reasoningTokens | number | |
totalTokens | number | |
requestCount | number | |
AiStartSessionRequestobject#A new session. Every field is optional.
title? | string | null | |
profile? | string | null | Selects the app's tools, memory and prompts for a kind of conversation. |
tags? | string[] | null | |
metadata? | Record<string, string> | null | |
excludeFromSearch? | boolean | Keep it out of conversation search and long-term memory. |
A session as it is right now.
"Idle""Thinking""Responding""AwaitingUser""Compacting"
Something the AI asked, with the answers to pick from when it gave some.
id | string | |
text | string | |
choices | AiChoice[] | null | |
allowMultiple | boolean | |
How full the model's context window is.
currentTokens | number | |
maxTokens | number | null | |
percentUsed | number | null | |
pressure | AiContextPressure | null | |
isEstimate | boolean | True when counted locally rather than reported by the model. |
"Normal""Warning""Critical"
A message to the AI: text, or an answer to a question with choices. A question without choices is answered with text.
text? | string | null | At most 32,000 characters. |
answer? | AiAnswer | null | |
images? | AiImageRef[] | null | At most 4, each a JPEG, PNG, WebP, HEIC or GIF of at most 10 MB. |
instructions? | string[] | null | Extra direction for this turn only, not shown in the history. |
wait? | boolean | Answer once the turn ends, with its reply, rather than as soon as it starts. |
An answer to one of pendingQuestions by its choices.
questionId | string | |
choiceIds | string[] | |
An image to send, from a file root — one the page wrote, a photo, a camera capture.
A file the page can reach through the files bridge: a named root and a path inside it. Bridges that take or return a file use this, so nothing reaches the page that /_bridge/files would not also serve.
What happens to an image after the turn that sent it.
"DropAfterTurn""KeepInContext""DontStore"
A turn that started, or with wait, one that ended.
How a turn ended.
"Completed""AwaitingUser""Interrupted""Superseded""Failed"
id | string | |
sessionId | string | |
sequence | number | |
timestamp | string | |
role | AiMessageRole | |
source | AiMessageSource | |
status | AiMessageStatus | |
text | string | null | What to show. |
spokenText | string | null | What was actually heard, when it was spoken and interrupted. |
parts | AiMessagePart[] | |
compacted | boolean | Folded into a summary; no longer sent to the model. |
"User""Assistant""Tool""System""Summary"
"Typed""Voice""ChoiceAnswer""Camera""Interceptor""Compaction""MemoryFlush""Model"
"Complete""Streaming""Interrupted""Failed"
One part of a message. Which fields are set depends on kind.
kind | AiPartKind | |
displayed | boolean | Shown in the conversation. |
spoken | boolean | Read aloud by the voice loop. |
text | string | null | The text; a tool call's arguments as JSON; a tool's result; an answer's labels. |
name | string | null | |
callId | string | null | |
isError | boolean | |
attachmentId | string | null | An image's id for getAttachment. |
mediaType | string | null | |
questionId | string | null | |
choiceIds | string[] | null | |
"Text""ToolCall""ToolResult""Answer""Image"
messages | AiMessage[] | Oldest first. |
hasMore | boolean | Older messages remain; ask again with the first one's sequence. |
Whose memory a document is: one session's, one profile's, or every session's.
"Session""Profile""Global"
Something the assistant remembers, as a markdown document at a path.
path | string | |
scope | AiMemoryScope | |
scopeKey | string | null | The session id or profile name; null for Global. |
description | string | null | |
content | string | |
created | string | |
updated | string | |
updatedBy | AiMemoryAuthor | |
version | number | |
"Assistant""User""App"
AiMemorySaveRequestobject#scope | AiMemoryScope | |
path | string | |
content | string | |
scopeKey? | string | null | The session id or profile name; null for Global. |
description? | string | null | |
supported | boolean | Whether the app registered the voice loop. |
state | AiVoiceState | |
sessionId | string | null | The session it is attached to. |
"Off""WaitingForWakeWord""Listening""FollowUp""Thinking""Speaking""Paused"
Where a permission stands. Reported by every bridge that needs one; the names match Shiny's own.
"Unknown""NotSupported""NotSetup""Disabled""Restricted""Denied""Available"
Attaches the voice loop to a session. Every field but the session is optional.
sessionId | string | |
wakeWord? | string | null | Listen for this before each conversation; without one, the loop starts on pushToTalk. |
interruption? | AiInterruptionMode | null | |
quietWords? | string[] | null | What stops a reply under QuietWords; at most 32. |
followUpTimeoutSeconds? | number | null | How long it listens for an answer to a question before needing the wake word again. |
acknowledgement? | AiAcknowledgement | null | |
culture? | string | null | Recognition and speech, such as en-US. |
How the user can talk over a reply.
"Off""QuietWords""Full"
What the voice loop does to acknowledge it heard the user.
"None""AudioBlip""LessWordy""Full"
sessionId | string | |
turnId | string | |
userMessage | AiMessage | |
The next piece of the reply as the model writes it.
sessionId | string | |
turnId | string | |
text | string | |
The model called one of the app's tools, or one finished.
sessionId | string | |
turnId | string | |
callId | string | |
name | string | |
completed | boolean | |
isError | boolean | |
silent | boolean | A tool the app marked as not worth showing. |
sessionId | string | |
turnId | string | |
outcome | AiTurnOutcome | |
replyMessageId | string | null | |
spokenText | string | null | What was heard before an interruption. |
error | string | null | |
sessionId | string | |
message | AiMessage | |
updated | boolean | True when an existing message changed — finished streaming, interrupted, compacted. |
sessionId | string | |
title | string | null | |
sessionId | string | |
compactedCount | number | |
wasHardTrim | boolean | Messages were dropped without a summary, because summarizing failed or there was no room. |
"Created""Updated""Deleted""Renamed"
sessionId | string | |
message | string | |
AiVoiceStateChangedobject#text | string | |
final | boolean | False while the user is still speaking. |
The sentence the voice loop is speaking now.
AiSpeechInterruptedobject#AiInterruptionReasonenum#"QuietWord""Answer""NewSpeech""PushToTalk""Stop"
input | number | The microphone, 0–1. |
output | number | The speech, 0–1. |