Skip to content

Requests and events ​

AGENT_REQUEST_SCHEMAS maps every request name to { payload, result }, and AGENT_EVENT_SCHEMAS maps every event name to its payload schema. AgentRequestType and AgentEventType are the unions of their names. This page lists both tables with the schema of each side and the type inferred from it. Protocol covers the frames they travel in.

Not every host implements every request. A host that only runs chats refuses the fork requests with chat-unsupported (see Host). A request without a payload or a result uses EmptySchema, {}.

Open and read ​

RequestPayloadResult
chat.createChatCreatePayloadSchema (ChatCreatePayload)ChatInfoSchema (ChatInfo)
chat.listEmptySchemaChatListResultSchema (ChatListResult)
chat.attachChatAttachPayloadSchemaChatAttachResultSchema (ChatAttachResult)
chat.detachChatTargetPayloadSchema (ChatTargetPayload)EmptySchema
chat.historyChatHistoryPayloadSchemaChatHistoryResultSchema (ChatHistoryResult)
chat.toolOutputChatToolOutputPayloadSchema (ChatToolOutputPayload)ChatToolOutputResultSchema (ChatToolOutputResult)

chat.create takes a chatId the client picks, and optionally a provider, account, folder, model selection and runtime mode. ChatIdSchema (ChatId) is any nonempty string. ChatTargetPayload is { chatId }, the payload of every request that only names a chat.

chat.attach takes an optional historyLimit and the since of a reconnect. chat.history takes a cursor and an optional limit, and returns items with a history page (ChatHistoryPageSchema, { start, cursor }). See Attaching and replay.

Send and control ​

RequestPayloadResult
chat.sendChatSendPayloadSchema (ChatSendPayload)ChatSendResultSchema (ChatSendResult)
chat.unqueueChatQueuePayloadSchema (ChatQueuePayload)ChatUnqueueResultSchema (ChatUnqueueResult)
chat.sendNowChatQueuePayloadSchemaEmptySchema
chat.cancelChatCancelPayloadSchema (ChatCancelPayload)EmptySchema
chat.compactChatTargetPayloadSchemaEmptySchema
chat.clearChatClearPayloadSchema (ChatClearPayload)EmptySchema
chat.restartChatTargetPayloadSchemaEmptySchema
chat.killChatTargetPayloadSchemaEmptySchema

chat.send answers { queued, turnId? } once the host took the message. A queued message is a ChatQueuedMessage (ChatQueuedMessageSchema) in ChatInfo.queue. chat.unqueue and chat.sendNow name it by messageId, and chat.unqueue returns it so the client can put it back in the draft. chat.cancel with subagents: true also stops every agent the chat opened. chat.clear refuses a chat in the middle of a turn unless it carries force: true.

Answer ​

RequestPayloadResult
chat.approveChatApprovePayloadSchema (ChatApprovePayload)EmptySchema
chat.answerChatAnswerPayloadSchema (ChatAnswerPayload)EmptySchema
chat.dismissChatDismissPayloadSchema (ChatDismissPayload)EmptySchema

See Approvals and questions.

Configure ​

RequestPayloadResult
chat.configureChatConfigurePayloadSchema (ChatConfigurePayload)ChatInfoSchema
chat.setPreferencesChatPreferencesPayloadSchema (ChatPreferencesPayload)EmptySchema
skills.listSkillsListPayloadSchema (SkillsListPayload)SkillsListResultSchema (SkillsListResult)
provider.listEmptySchemaProviderListResultSchema (ProviderListResult)

chat.configure changes a chat's account, model selection, runtime mode or resumeAtReset. The account must be able to continue the conversation. chat.setPreferences stores what new chats start with: a runtime mode, a model selection and an account per provider. skills.list returns the skills a chat can use, each a ChatSkill (ChatSkillSchema) with a ChatSkillSource (ChatSkillSourceSchema).

Turns and forks ​

RequestPayloadResult
chat.turnDiffChatTurnDiffPayloadSchema (ChatTurnDiffPayload)ChatTurnDiffResultSchema (ChatTurnDiffResult)
chat.forkChatForkPayloadSchema (ChatForkPayload)ChatForkResultSchema (ChatForkResult)
chat.forkInfoChatForkInfoPayloadSchema (ChatForkInfoPayload)ChatForkInfoResultSchema (ChatForkInfoResult)
chat.summarizeChatSummarizePayloadSchema (ChatSummarizePayload)ChatSummarizeResultSchema (ChatSummarizeResult)
chat.continueOnChatContinueOnPayloadSchema (ChatContinueOnPayload)ChatContinueOnResultSchema (ChatContinueOnResult)

chat.summarize returns the turn in which the chat writes its summary. chat.continueOn returns the chat that goes on, and the fork when it went on in one. See Checkpoints and forks.

Delegated work ​

RequestPayloadResult
chat.subagentChatSubagentPayloadSchema (ChatSubagentPayload)ChatSubagentResultSchema (ChatSubagentResult)
chat.stopSubagentChatStopSubagentPayloadSchema (ChatStopSubagentPayload)EmptySchema
chat.stopTaskChatStopTaskPayloadSchema (ChatStopTaskPayload)EmptySchema
chat.goalChatGoalPayloadSchema (ChatGoalPayload)EmptySchema

chat.subagent reads one subagent's conversation by the toolUseId of the call that started it, a page at a time. With watch: true the host sends chat.subagentChanged while it grows. The result holds items, a page (ChatSubagentPageSchema), the pending requests, whether it is still live, and its source, a ChatSubagentSource (ChatSubagentSourceSchema) that says which CLI's record it was read from. chat.stopTask stops one background task by taskId.

Bookmarks and visuals ​

RequestPayloadResult
chat.addBookmarkChatAddBookmarkPayloadSchema (ChatAddBookmarkPayload)ChatBookmarksResultSchema (ChatBookmarksResult)
chat.renameBookmarkChatRenameBookmarkPayloadSchema (ChatRenameBookmarkPayload)ChatBookmarksResultSchema
chat.removeBookmarkChatRemoveBookmarkPayloadSchema (ChatRemoveBookmarkPayload)ChatBookmarksResultSchema
chat.removeVisualChatRemoveVisualPayloadSchema (ChatRemoveVisualPayload)ChatVisualsResultSchema (ChatVisualsResult)

See Bookmarks and Visuals.

UI blocks ​

RequestPayloadResult
chat.uiChoiceChatUiChoicePayloadSchema (ChatUiChoicePayload)ChatSendResultSchema
ui.queryChatUiQueryPayloadSchema (ChatUiQueryPayload)ChatUiQueryReadingSchema (ChatUiQueryReading)
ui.linkChatUiLinkPayloadSchema (ChatUiLinkPayload)ChatUiLinkReadingSchema (ChatUiLinkReading)

See UI blocks in replies.

Accounts ​

RequestPayloadResult
accounts.listEmptySchemaProviderAccountsSchema (ProviderAccounts)
accounts.saveProviderAccountsSavePayloadSchema (ProviderAccountsSavePayload)ProviderAccountsSchema
accounts.reorderProviderAccountsReorderPayloadSchema (ProviderAccountsReorderPayload)ProviderAccountsSchema
accounts.createProviderAccountCreatePayloadSchema (ProviderAccountCreatePayload)ProviderAccountCreateResultSchema (ProviderAccountCreateResult)
accounts.refreshEmptySchemaProviderAccountsSchema
accounts.watchLoginProviderAccountWatchLoginPayloadSchema (ProviderAccountWatchLoginPayload)EmptySchema

accounts.watchLogin answers at once, and later results arrive as accounts.changed. See Accounts.

Usage ​

RequestPayloadResult
usage.summaryUsageSummaryPayloadSchema (UsageSummaryPayload)UsageSummaryResultSchema (UsageSummaryResult)
usage.subscribeEmptySchemaEmptySchema
usage.unsubscribeEmptySchemaEmptySchema
usage.limitsEmptySchemaUsageLimitsSnapshotSchema (UsageLimitsSnapshot)
usage.refreshLimitsEmptySchemaUsageLimitsSnapshotSchema

See Usage.

Events ​

EventPayloadWhat a client does with it
chat.eventChatEventEnvelopeSchema (ChatEventEnvelope){ chatId, event, seq? }: apply the ChatEvent to a thread the client attached.
chat.statusChatStatusEventSchema (ChatStatusEvent){ chatId, info }: the chat's whole ChatInfo, to every client, attached or not.
chat.subagentChangedChatSubagentChangedEventSchema (ChatSubagentChangedEvent){ chatId, toolUseId }: ask for the watched subagent page again. It carries no conversation.
chat.bookmarksChatBookmarksEventSchema (ChatBookmarksEvent){ chatId, bookmarks }: the attached chat's whole bookmark list.
chat.visualsChatVisualsEventSchema (ChatVisualsEvent){ chatId, visuals }: the attached chat's whole list of visuals.
accounts.changedProviderAccountsSchemaThe whole account snapshot.
usage.changedUsageChangedEventSchema (UsageChangedEvent){ scannedAt }: ask for the period on screen again.
usage.limitsChangedUsageLimitsSnapshotSchemaThe whole plan limit snapshot.

chat.status goes to every client, so a chat waiting on a person shows it everywhere. info.requests carries a card-sized summary of the waiting approvals and questions. ChatEventSchema (ChatEvent) is the event inside a chat.event; Attaching and replay lists its kinds.

Licenses and third-party notices are listed in each package.