@github/copilot-sdk 1.0.0-beta.1 → 1.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,31 +2,106 @@
2
2
  * AUTO-GENERATED FILE - DO NOT EDIT
3
3
  * Generated from: session-events.schema.json
4
4
  */
5
- export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | PlanChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent;
5
+ /**
6
+ * Union of all session event variants emitted by the Copilot CLI runtime.
7
+ */
8
+ export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | PermissionsChangedEvent | PlanChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | McpAppToolCallCompleteEvent;
6
9
  /**
7
10
  * Hosting platform type of the repository (github or ado)
8
11
  */
9
- export type WorkingDirectoryContextHostType = "github" | "ado";
12
+ export type WorkingDirectoryContextHostType =
13
+ /** Repository is hosted on GitHub. */
14
+ "github"
15
+ /** Repository is hosted on Azure DevOps. */
16
+ | "ado";
17
+ /**
18
+ * Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed")
19
+ */
20
+ export type ReasoningSummary =
21
+ /** Do not request reasoning summaries from the model. */
22
+ "none"
23
+ /** Request a concise summary of the model's reasoning. */
24
+ | "concise"
25
+ /** Request a detailed summary of the model's reasoning. */
26
+ | "detailed";
27
+ /**
28
+ * The type of operation performed on the autopilot objective state file
29
+ */
30
+ export type AutopilotObjectiveChangedOperation =
31
+ /** Autopilot objective state file was created for a new objective. */
32
+ "create"
33
+ /** Autopilot objective state file was updated for an existing objective. */
34
+ | "update"
35
+ /** Autopilot objective state file was deleted or cleared. */
36
+ | "delete";
37
+ /**
38
+ * Current autopilot objective status, if one exists
39
+ */
40
+ export type AutopilotObjectiveChangedStatus =
41
+ /** Objective is active and can drive autopilot continuations. */
42
+ "active"
43
+ /** Objective is paused and will not drive autopilot continuations. */
44
+ | "paused"
45
+ /** Legacy objective state indicating the previous continuation cap was reached. */
46
+ | "cap_reached"
47
+ /** Objective was completed by the agent. */
48
+ | "completed";
49
+ /**
50
+ * The session mode the agent is operating in
51
+ */
52
+ export type SessionMode =
53
+ /** The agent is responding interactively to the user. */
54
+ "interactive"
55
+ /** The agent is preparing a plan before making changes. */
56
+ | "plan"
57
+ /** The agent is working autonomously toward task completion. */
58
+ | "autopilot";
10
59
  /**
11
60
  * The type of operation performed on the plan file
12
61
  */
13
- export type PlanChangedOperation = "create" | "update" | "delete";
62
+ export type PlanChangedOperation =
63
+ /** The plan file was created. */
64
+ "create"
65
+ /** The plan file was updated. */
66
+ | "update"
67
+ /** The plan file was deleted. */
68
+ | "delete";
14
69
  /**
15
70
  * Whether the file was newly created or updated
16
71
  */
17
- export type WorkspaceFileChangedOperation = "create" | "update";
72
+ export type WorkspaceFileChangedOperation =
73
+ /** The workspace file was created. */
74
+ "create"
75
+ /** The workspace file was updated. */
76
+ | "update";
18
77
  /**
19
78
  * Origin type of the session being handed off
20
79
  */
21
- export type HandoffSourceType = "remote" | "local";
80
+ export type HandoffSourceType =
81
+ /** The handoff originated from a remote session. */
82
+ "remote"
83
+ /** The handoff originated from a local session. */
84
+ | "local";
22
85
  /**
23
86
  * Whether the session ended normally ("routine") or due to a crash/fatal error ("error")
24
87
  */
25
- export type ShutdownType = "routine" | "error";
88
+ export type ShutdownType =
89
+ /** The session ended normally. */
90
+ "routine"
91
+ /** The session ended because of a crash or fatal error. */
92
+ | "error";
26
93
  /**
27
94
  * The agent mode that was active when this message was sent
28
95
  */
29
- export type UserMessageAgentMode = "interactive" | "plan" | "autopilot" | "shell";
96
+ export type UserMessageAgentMode =
97
+ /** The agent is responding interactively to the user. */
98
+ "interactive"
99
+ /** The agent is preparing a plan before making changes. */
100
+ | "plan"
101
+ /** The agent is working autonomously toward task completion. */
102
+ | "autopilot"
103
+ /** The agent is in shell-focused UI mode. */
104
+ | "shell";
30
105
  /**
31
106
  * A user message attachment — a file, directory, code selection, blob, or GitHub reference
32
107
  */
@@ -34,15 +109,53 @@ export type UserMessageAttachment = UserMessageAttachmentFile | UserMessageAttac
34
109
  /**
35
110
  * Type of GitHub reference
36
111
  */
37
- export type UserMessageAttachmentGithubReferenceType = "issue" | "pr" | "discussion";
112
+ export type UserMessageAttachmentGithubReferenceType =
113
+ /** GitHub issue reference. */
114
+ "issue"
115
+ /** GitHub pull request reference. */
116
+ | "pr"
117
+ /** GitHub discussion reference. */
118
+ | "discussion";
38
119
  /**
39
120
  * Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent.
40
121
  */
41
- export type AssistantMessageToolRequestType = "function" | "custom";
122
+ export type AssistantMessageToolRequestType =
123
+ /** Standard function-style tool call. */
124
+ "function"
125
+ /** Custom grammar-based tool call. */
126
+ | "custom";
127
+ /**
128
+ * API endpoint used for this model call, matching CAPI supported_endpoints vocabulary
129
+ */
130
+ export type AssistantUsageApiEndpoint =
131
+ /** Chat Completions API endpoint. */
132
+ "/chat/completions"
133
+ /** Anthropic Messages API endpoint. */
134
+ | "/v1/messages"
135
+ /** Responses API endpoint. */
136
+ | "/responses"
137
+ /** WebSocket Responses API endpoint. */
138
+ | "ws:/responses";
42
139
  /**
43
140
  * Where the failed model call originated
44
141
  */
45
- export type ModelCallFailureSource = "top_level" | "subagent" | "mcp_sampling";
142
+ export type ModelCallFailureSource =
143
+ /** Model call from the top-level agent. */
144
+ "top_level"
145
+ /** Model call from a sub-agent. */
146
+ | "subagent"
147
+ /** Model call from MCP sampling. */
148
+ | "mcp_sampling";
149
+ /**
150
+ * Finite reason code describing why the current turn was aborted
151
+ */
152
+ export type AbortReason =
153
+ /** The local user requested the abort, for example by pressing Ctrl+C in the CLI. */
154
+ "user_initiated"
155
+ /** A remote command requested the abort. */
156
+ | "remote_command"
157
+ /** An MCP server delivered a user.abort notification. */
158
+ | "user_abort";
46
159
  /**
47
160
  * A content block within a tool result, which may be text, terminal output, image, audio, or a resource
48
161
  */
@@ -50,15 +163,41 @@ export type ToolExecutionCompleteContent = ToolExecutionCompleteContentText | To
50
163
  /**
51
164
  * Theme variant this icon is intended for
52
165
  */
53
- export type ToolExecutionCompleteContentResourceLinkIconTheme = "light" | "dark";
166
+ export type ToolExecutionCompleteContentResourceLinkIconTheme =
167
+ /** Icon intended for light themes. */
168
+ "light"
169
+ /** Icon intended for dark themes. */
170
+ | "dark";
54
171
  /**
55
172
  * The embedded resource contents, either text or base64-encoded binary
56
173
  */
57
174
  export type ToolExecutionCompleteContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents;
175
+ /**
176
+ * Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration.
177
+ */
178
+ export type ToolExecutionCompleteToolDescriptionMetaUIVisibility =
179
+ /** Tool is callable by the model (LLM tool surface) */
180
+ "model"
181
+ /** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */
182
+ | "app";
183
+ /**
184
+ * What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)
185
+ */
186
+ export type SkillInvokedTrigger =
187
+ /** Skill invocation requested explicitly by the user, such as via a slash command or UI affordance. */
188
+ "user-invoked"
189
+ /** Skill invocation requested by the agent. */
190
+ | "agent-invoked"
191
+ /** Skill content loaded as part of another context, such as a configured custom agent or subagent. */
192
+ | "context-load";
58
193
  /**
59
194
  * Message role: "system" for system prompts, "developer" for developer-injected instructions
60
195
  */
61
- export type SystemMessageRole = "system" | "developer";
196
+ export type SystemMessageRole =
197
+ /** System prompt message. */
198
+ "system"
199
+ /** Developer instruction message. */
200
+ | "developer";
62
201
  /**
63
202
  * Structured metadata identifying what triggered this notification
64
203
  */
@@ -66,35 +205,45 @@ export type SystemNotification = SystemNotificationAgentCompleted | SystemNotifi
66
205
  /**
67
206
  * Whether the agent completed successfully or failed
68
207
  */
69
- export type SystemNotificationAgentCompletedStatus = "completed" | "failed";
208
+ export type SystemNotificationAgentCompletedStatus =
209
+ /** The agent completed successfully. */
210
+ "completed"
211
+ /** The agent failed. */
212
+ | "failed";
70
213
  /**
71
214
  * Details of the permission being requested
72
215
  */
73
- export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook;
216
+ export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement | PermissionRequestExtensionPermissionAccess;
74
217
  /**
75
218
  * Whether this is a store or vote memory operation
76
219
  */
77
- export type PermissionRequestMemoryAction = "store" | "vote";
220
+ export type PermissionRequestMemoryAction =
221
+ /** Store a new memory. */
222
+ "store"
223
+ /** Vote on an existing memory. */
224
+ | "vote";
78
225
  /**
79
226
  * Vote direction (vote only)
80
227
  */
81
- export type PermissionRequestMemoryDirection = "upvote" | "downvote";
228
+ export type PermissionRequestMemoryDirection =
229
+ /** Vote that the memory is useful or accurate. */
230
+ "upvote"
231
+ /** Vote that the memory is incorrect or outdated. */
232
+ | "downvote";
82
233
  /**
83
234
  * Derived user-facing permission prompt details for UI consumers
84
235
  */
85
- export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook;
86
- /**
87
- * Whether this is a store or vote memory operation
88
- */
89
- export type PermissionPromptRequestMemoryAction = "store" | "vote";
90
- /**
91
- * Vote direction (vote only)
92
- */
93
- export type PermissionPromptRequestMemoryDirection = "upvote" | "downvote";
236
+ export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestExtensionPermissionAccess;
94
237
  /**
95
238
  * Underlying permission kind that needs path approval
96
239
  */
97
- export type PermissionPromptRequestPathAccessKind = "read" | "shell" | "write";
240
+ export type PermissionPromptRequestPathAccessKind =
241
+ /** Read access to a filesystem path. */
242
+ "read"
243
+ /** Shell command access involving a filesystem path. */
244
+ | "shell"
245
+ /** Write access to a filesystem path. */
246
+ | "write";
98
247
  /**
99
248
  * The result of the permission request
100
249
  */
@@ -102,32 +251,146 @@ export type PermissionResult = PermissionApproved | PermissionApprovedForSession
102
251
  /**
103
252
  * The approval to add as a session-scoped rule
104
253
  */
105
- export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool;
254
+ export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement | UserToolSessionApprovalExtensionPermissionAccess;
106
255
  /**
107
256
  * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent.
108
257
  */
109
- export type ElicitationRequestedMode = "form" | "url";
258
+ export type ElicitationRequestedMode =
259
+ /** Structured form-based elicitation. */
260
+ "form"
261
+ /** Browser URL-based elicitation. */
262
+ | "url";
110
263
  /**
111
264
  * The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed)
112
265
  */
113
- export type ElicitationCompletedAction = "accept" | "decline" | "cancel";
114
- export type ElicitationCompletedContent = string | number | boolean | string[];
266
+ export type ElicitationCompletedAction =
267
+ /** The user submitted the requested form. */
268
+ "accept"
269
+ /** The user explicitly declined the request. */
270
+ | "decline"
271
+ /** The user dismissed the request. */
272
+ | "cancel";
273
+ /**
274
+ * Schema for the `ElicitationCompletedContent` type.
275
+ */
276
+ export type ElicitationCompletedContent = (string | number | boolean | string[]) | undefined;
277
+ /**
278
+ * Source-defined JSON payload for the custom notification
279
+ */
280
+ export type CustomNotificationPayload = string | number | boolean | null | unknown[] | {
281
+ [k: string]: unknown | undefined;
282
+ };
283
+ /**
284
+ * The user's auto-mode-switch choice
285
+ */
286
+ export type AutoModeSwitchResponse =
287
+ /** Switch models for this request. */
288
+ "yes"
289
+ /** Switch models now and keep using the replacement automatically. */
290
+ | "yes_always"
291
+ /** Do not switch models. */
292
+ | "no";
293
+ /**
294
+ * Exit plan mode action
295
+ */
296
+ export type ExitPlanModeAction =
297
+ /** Exit plan mode without starting implementation. */
298
+ "exit_only"
299
+ /** Exit plan mode and continue in interactive mode. */
300
+ | "interactive"
301
+ /** Exit plan mode and continue autonomously. */
302
+ | "autopilot"
303
+ /** Exit plan mode and continue with parallel autonomous workers. */
304
+ | "autopilot_fleet";
305
+ /**
306
+ * Source location type (e.g., project, personal-copilot, plugin, builtin)
307
+ */
308
+ export type SkillSource =
309
+ /** Skill defined in the current project's skill directories. */
310
+ "project"
311
+ /** Skill discovered from a parent directory in the current workspace tree. */
312
+ | "inherited"
313
+ /** Skill defined in the user's Copilot skill directory. */
314
+ | "personal-copilot"
315
+ /** Skill defined in the user's personal agents skill directory. */
316
+ | "personal-agents"
317
+ /** Skill provided by an installed plugin. */
318
+ | "plugin"
319
+ /** Skill loaded from a configured custom skill directory. */
320
+ | "custom"
321
+ /** Skill bundled with the runtime. */
322
+ | "builtin";
323
+ /**
324
+ * Configuration source: user, workspace, plugin, or builtin
325
+ */
326
+ export type McpServerSource =
327
+ /** Server configured in the user's global MCP configuration. */
328
+ "user"
329
+ /** Server configured by the current workspace. */
330
+ | "workspace"
331
+ /** Server contributed by an installed plugin. */
332
+ | "plugin"
333
+ /** Server bundled with the runtime. */
334
+ | "builtin";
115
335
  /**
116
336
  * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
117
337
  */
118
- export type McpServersLoadedServerStatus = "connected" | "failed" | "needs-auth" | "pending" | "disabled" | "not_configured";
119
- /**
120
- * New connection status: connected, failed, needs-auth, pending, disabled, or not_configured
121
- */
122
- export type McpServerStatusChangedStatus = "connected" | "failed" | "needs-auth" | "pending" | "disabled" | "not_configured";
338
+ export type McpServerStatus =
339
+ /** The server is connected and available. */
340
+ "connected"
341
+ /** The server failed to connect or initialize. */
342
+ | "failed"
343
+ /** The server requires authentication before it can connect. */
344
+ | "needs-auth"
345
+ /** The server connection is still being established. */
346
+ | "pending"
347
+ /** The server is configured but disabled. */
348
+ | "disabled"
349
+ /** The server is not configured for this session. */
350
+ | "not_configured";
351
+ /**
352
+ * Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)
353
+ */
354
+ export type McpServerTransport =
355
+ /** Server communicates over stdio with a local child process. */
356
+ "stdio"
357
+ /** Server communicates over streamable HTTP. */
358
+ | "http"
359
+ /** Server communicates over Server-Sent Events (deprecated). */
360
+ | "sse"
361
+ /** Server is backed by an in-memory runtime implementation. */
362
+ | "memory";
123
363
  /**
124
364
  * Discovery source
125
365
  */
126
- export type ExtensionsLoadedExtensionSource = "project" | "user";
366
+ export type ExtensionsLoadedExtensionSource =
367
+ /** Extension discovered from the current project. */
368
+ "project"
369
+ /** Extension discovered from the user's extension directory. */
370
+ | "user";
127
371
  /**
128
372
  * Current status: running, disabled, failed, or starting
129
373
  */
130
- export type ExtensionsLoadedExtensionStatus = "running" | "disabled" | "failed" | "starting";
374
+ export type ExtensionsLoadedExtensionStatus =
375
+ /** The extension process is running. */
376
+ "running"
377
+ /** The extension is installed but disabled. */
378
+ | "disabled"
379
+ /** The extension failed to start or crashed. */
380
+ | "failed"
381
+ /** The extension process is starting. */
382
+ | "starting";
383
+ /**
384
+ * Runtime-controlled routing state for the instance. "ready" when the provider connection is live; "stale" when the provider has gone away and the instance is awaiting rebinding.
385
+ */
386
+ export type CanvasOpenedAvailability =
387
+ /** Provider connection is live; actions can be invoked. */
388
+ "ready"
389
+ /** Provider has gone away; the instance is awaiting rebinding. */
390
+ | "stale";
391
+ /**
392
+ * Session event "session.start". Session initialization metadata including context and configuration
393
+ */
131
394
  export interface StartEvent {
132
395
  /**
133
396
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -150,6 +413,9 @@ export interface StartEvent {
150
413
  * ISO 8601 timestamp when the event was created
151
414
  */
152
415
  timestamp: string;
416
+ /**
417
+ * Type discriminator. Always "session.start".
418
+ */
153
419
  type: "session.start";
154
420
  }
155
421
  /**
@@ -161,20 +427,31 @@ export interface StartData {
161
427
  */
162
428
  alreadyInUse?: boolean;
163
429
  context?: WorkingDirectoryContext;
430
+ /**
431
+ * Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model)
432
+ */
433
+ contextTier?: "default"
434
+ /** Extended context tier with a larger context window. */
435
+ | "long_context" | null;
164
436
  /**
165
437
  * Version string of the Copilot application
166
438
  */
167
439
  copilotVersion: string;
440
+ /**
441
+ * When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id.
442
+ */
443
+ detachedFromSpawningParentSessionId?: string;
168
444
  /**
169
445
  * Identifier of the software producing the events (e.g., "copilot-agent")
170
446
  */
171
447
  producer: string;
172
448
  /**
173
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
449
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
174
450
  */
175
451
  reasoningEffort?: string;
452
+ reasoningSummary?: ReasoningSummary;
176
453
  /**
177
- * Whether this session supports remote steering via Mission Control
454
+ * Whether this session supports remote steering via GitHub
178
455
  */
179
456
  remoteSteerable?: boolean;
180
457
  /**
@@ -228,6 +505,9 @@ export interface WorkingDirectoryContext {
228
505
  */
229
506
  repositoryHost?: string;
230
507
  }
508
+ /**
509
+ * Session event "session.resume". Session resume metadata including current context and event count
510
+ */
231
511
  export interface ResumeEvent {
232
512
  /**
233
513
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -250,6 +530,9 @@ export interface ResumeEvent {
250
530
  * ISO 8601 timestamp when the event was created
251
531
  */
252
532
  timestamp: string;
533
+ /**
534
+ * Type discriminator. Always "session.resume".
535
+ */
253
536
  type: "session.resume";
254
537
  }
255
538
  /**
@@ -261,6 +544,12 @@ export interface ResumeData {
261
544
  */
262
545
  alreadyInUse?: boolean;
263
546
  context?: WorkingDirectoryContext;
547
+ /**
548
+ * Context tier currently selected at resume time; null when no tier is active
549
+ */
550
+ contextTier?: "default"
551
+ /** Extended context tier with a larger context window. */
552
+ | "long_context" | null;
264
553
  /**
265
554
  * When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume.
266
555
  */
@@ -270,11 +559,12 @@ export interface ResumeData {
270
559
  */
271
560
  eventCount: number;
272
561
  /**
273
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
562
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
274
563
  */
275
564
  reasoningEffort?: string;
565
+ reasoningSummary?: ReasoningSummary;
276
566
  /**
277
- * Whether this session supports remote steering via Mission Control
567
+ * Whether this session supports remote steering via GitHub
278
568
  */
279
569
  remoteSteerable?: boolean;
280
570
  /**
@@ -290,6 +580,9 @@ export interface ResumeData {
290
580
  */
291
581
  sessionWasActive?: boolean;
292
582
  }
583
+ /**
584
+ * Session event "session.remote_steerable_changed". Notifies that the session's remote steering capability has changed
585
+ */
293
586
  export interface RemoteSteerableChangedEvent {
294
587
  /**
295
588
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -312,17 +605,23 @@ export interface RemoteSteerableChangedEvent {
312
605
  * ISO 8601 timestamp when the event was created
313
606
  */
314
607
  timestamp: string;
608
+ /**
609
+ * Type discriminator. Always "session.remote_steerable_changed".
610
+ */
315
611
  type: "session.remote_steerable_changed";
316
612
  }
317
613
  /**
318
- * Notifies Mission Control that the session's remote steering capability has changed
614
+ * Notifies that the session's remote steering capability has changed
319
615
  */
320
616
  export interface RemoteSteerableChangedData {
321
617
  /**
322
- * Whether this session now supports remote steering via Mission Control
618
+ * Whether this session now supports remote steering via GitHub
323
619
  */
324
620
  remoteSteerable: boolean;
325
621
  }
622
+ /**
623
+ * Session event "session.error". Error details for timeline display including message and optional diagnostic information
624
+ */
326
625
  export interface ErrorEvent {
327
626
  /**
328
627
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -345,6 +644,9 @@ export interface ErrorEvent {
345
644
  * ISO 8601 timestamp when the event was created
346
645
  */
347
646
  timestamp: string;
647
+ /**
648
+ * Type discriminator. Always "session.error".
649
+ */
348
650
  type: "session.error";
349
651
  }
350
652
  /**
@@ -356,7 +658,7 @@ export interface ErrorData {
356
658
  */
357
659
  eligibleForAutoSwitch?: boolean;
358
660
  /**
359
- * Fine-grained error code from the upstream provider, when available. For `errorType: "rate_limit"`, this is one of the `RateLimitErrorCode` values (e.g., `"user_weekly_rate_limited"`, `"user_global_rate_limited"`, `"rate_limited"`, `"user_model_rate_limited"`, `"integration_rate_limited"`).
661
+ * Fine-grained error code from the upstream provider, when available. For `errorType: "rate_limit"`, this is one of the `RateLimitErrorCode` values (e.g., `"user_weekly_rate_limited"`, `"user_global_rate_limited"`, `"rate_limited"`, `"user_model_rate_limited"`, `"integration_rate_limited"`). For `errorType: "quota"`, this is the CAPI quota error code (e.g., `"quota_exceeded"`, `"session_quota_exceeded"`, `"billing_not_configured"`).
360
662
  */
361
663
  errorCode?: string;
362
664
  /**
@@ -371,6 +673,10 @@ export interface ErrorData {
371
673
  * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
372
674
  */
373
675
  providerCallId?: string;
676
+ /**
677
+ * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
678
+ */
679
+ serviceRequestId?: string;
374
680
  /**
375
681
  * Error stack trace, when available
376
682
  */
@@ -384,12 +690,18 @@ export interface ErrorData {
384
690
  */
385
691
  url?: string;
386
692
  }
693
+ /**
694
+ * Session event "session.idle". Payload indicating the session is idle with no background agents in flight
695
+ */
387
696
  export interface IdleEvent {
388
697
  /**
389
698
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
390
699
  */
391
700
  agentId?: string;
392
701
  data: IdleData;
702
+ /**
703
+ * Always true for events that are transient and not persisted to the session event log on disk.
704
+ */
393
705
  ephemeral: true;
394
706
  /**
395
707
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -403,6 +715,9 @@ export interface IdleEvent {
403
715
  * ISO 8601 timestamp when the event was created
404
716
  */
405
717
  timestamp: string;
718
+ /**
719
+ * Type discriminator. Always "session.idle".
720
+ */
406
721
  type: "session.idle";
407
722
  }
408
723
  /**
@@ -414,12 +729,18 @@ export interface IdleData {
414
729
  */
415
730
  aborted?: boolean;
416
731
  }
732
+ /**
733
+ * Session event "session.title_changed". Session title change payload containing the new display title
734
+ */
417
735
  export interface TitleChangedEvent {
418
736
  /**
419
737
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
420
738
  */
421
739
  agentId?: string;
422
740
  data: TitleChangedData;
741
+ /**
742
+ * Always true for events that are transient and not persisted to the session event log on disk.
743
+ */
423
744
  ephemeral: true;
424
745
  /**
425
746
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -433,6 +754,9 @@ export interface TitleChangedEvent {
433
754
  * ISO 8601 timestamp when the event was created
434
755
  */
435
756
  timestamp: string;
757
+ /**
758
+ * Type discriminator. Always "session.title_changed".
759
+ */
436
760
  type: "session.title_changed";
437
761
  }
438
762
  /**
@@ -444,6 +768,144 @@ export interface TitleChangedData {
444
768
  */
445
769
  title: string;
446
770
  }
771
+ /**
772
+ * Session event "session.schedule_created". Scheduled prompt registered via /every or /after
773
+ */
774
+ export interface ScheduleCreatedEvent {
775
+ /**
776
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
777
+ */
778
+ agentId?: string;
779
+ data: ScheduleCreatedData;
780
+ /**
781
+ * When true, the event is transient and not persisted to the session event log on disk
782
+ */
783
+ ephemeral?: boolean;
784
+ /**
785
+ * Unique event identifier (UUID v4), generated when the event is emitted
786
+ */
787
+ id: string;
788
+ /**
789
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
790
+ */
791
+ parentId: string | null;
792
+ /**
793
+ * ISO 8601 timestamp when the event was created
794
+ */
795
+ timestamp: string;
796
+ /**
797
+ * Type discriminator. Always "session.schedule_created".
798
+ */
799
+ type: "session.schedule_created";
800
+ }
801
+ /**
802
+ * Scheduled prompt registered via /every or /after
803
+ */
804
+ export interface ScheduleCreatedData {
805
+ /**
806
+ * Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion)
807
+ */
808
+ displayPrompt?: string;
809
+ /**
810
+ * Sequential id assigned to the scheduled prompt within the session
811
+ */
812
+ id: number;
813
+ /**
814
+ * Interval between ticks in milliseconds
815
+ */
816
+ intervalMs: number;
817
+ /**
818
+ * Prompt text that gets enqueued on every tick
819
+ */
820
+ prompt: string;
821
+ /**
822
+ * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)
823
+ */
824
+ recurring?: boolean;
825
+ }
826
+ /**
827
+ * Session event "session.schedule_cancelled". Scheduled prompt cancelled from the schedule manager dialog
828
+ */
829
+ export interface ScheduleCancelledEvent {
830
+ /**
831
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
832
+ */
833
+ agentId?: string;
834
+ data: ScheduleCancelledData;
835
+ /**
836
+ * When true, the event is transient and not persisted to the session event log on disk
837
+ */
838
+ ephemeral?: boolean;
839
+ /**
840
+ * Unique event identifier (UUID v4), generated when the event is emitted
841
+ */
842
+ id: string;
843
+ /**
844
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
845
+ */
846
+ parentId: string | null;
847
+ /**
848
+ * ISO 8601 timestamp when the event was created
849
+ */
850
+ timestamp: string;
851
+ /**
852
+ * Type discriminator. Always "session.schedule_cancelled".
853
+ */
854
+ type: "session.schedule_cancelled";
855
+ }
856
+ /**
857
+ * Scheduled prompt cancelled from the schedule manager dialog
858
+ */
859
+ export interface ScheduleCancelledData {
860
+ /**
861
+ * Id of the scheduled prompt that was cancelled
862
+ */
863
+ id: number;
864
+ }
865
+ /**
866
+ * Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed
867
+ */
868
+ export interface AutopilotObjectiveChangedEvent {
869
+ /**
870
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
871
+ */
872
+ agentId?: string;
873
+ data: AutopilotObjectiveChangedData;
874
+ /**
875
+ * When true, the event is transient and not persisted to the session event log on disk
876
+ */
877
+ ephemeral?: boolean;
878
+ /**
879
+ * Unique event identifier (UUID v4), generated when the event is emitted
880
+ */
881
+ id: string;
882
+ /**
883
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
884
+ */
885
+ parentId: string | null;
886
+ /**
887
+ * ISO 8601 timestamp when the event was created
888
+ */
889
+ timestamp: string;
890
+ /**
891
+ * Type discriminator. Always "session.autopilot_objective_changed".
892
+ */
893
+ type: "session.autopilot_objective_changed";
894
+ }
895
+ /**
896
+ * Autopilot objective state file operation details indicating what changed
897
+ */
898
+ export interface AutopilotObjectiveChangedData {
899
+ /**
900
+ * Current autopilot objective id, if one exists
901
+ */
902
+ id?: number;
903
+ operation: AutopilotObjectiveChangedOperation;
904
+ status?: AutopilotObjectiveChangedStatus;
905
+ }
906
+ /**
907
+ * Session event "session.info". Informational message for timeline display with categorization
908
+ */
447
909
  export interface InfoEvent {
448
910
  /**
449
911
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -466,6 +928,9 @@ export interface InfoEvent {
466
928
  * ISO 8601 timestamp when the event was created
467
929
  */
468
930
  timestamp: string;
931
+ /**
932
+ * Type discriminator. Always "session.info".
933
+ */
469
934
  type: "session.info";
470
935
  }
471
936
  /**
@@ -489,6 +954,9 @@ export interface InfoData {
489
954
  */
490
955
  url?: string;
491
956
  }
957
+ /**
958
+ * Session event "session.warning". Warning message for timeline display with categorization
959
+ */
492
960
  export interface WarningEvent {
493
961
  /**
494
962
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -511,6 +979,9 @@ export interface WarningEvent {
511
979
  * ISO 8601 timestamp when the event was created
512
980
  */
513
981
  timestamp: string;
982
+ /**
983
+ * Type discriminator. Always "session.warning".
984
+ */
514
985
  type: "session.warning";
515
986
  }
516
987
  /**
@@ -530,6 +1001,9 @@ export interface WarningData {
530
1001
  */
531
1002
  warningType: string;
532
1003
  }
1004
+ /**
1005
+ * Session event "session.model_change". Model change details including previous and new model identifiers
1006
+ */
533
1007
  export interface ModelChangeEvent {
534
1008
  /**
535
1009
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -552,6 +1026,9 @@ export interface ModelChangeEvent {
552
1026
  * ISO 8601 timestamp when the event was created
553
1027
  */
554
1028
  timestamp: string;
1029
+ /**
1030
+ * Type discriminator. Always "session.model_change".
1031
+ */
555
1032
  type: "session.model_change";
556
1033
  }
557
1034
  /**
@@ -562,6 +1039,12 @@ export interface ModelChangeData {
562
1039
  * Reason the change happened, when not user-initiated. Currently `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy.
563
1040
  */
564
1041
  cause?: string;
1042
+ /**
1043
+ * Context tier after the model change; null explicitly clears a previously selected tier
1044
+ */
1045
+ contextTier?: "default"
1046
+ /** Extended context tier with a larger context window. */
1047
+ | "long_context" | null;
565
1048
  /**
566
1049
  * Newly selected model identifier
567
1050
  */
@@ -574,11 +1057,16 @@ export interface ModelChangeData {
574
1057
  * Reasoning effort level before the model change, if applicable
575
1058
  */
576
1059
  previousReasoningEffort?: string;
1060
+ previousReasoningSummary?: ReasoningSummary;
577
1061
  /**
578
1062
  * Reasoning effort level after the model change, if applicable
579
1063
  */
580
- reasoningEffort?: string;
1064
+ reasoningEffort?: string | null;
1065
+ reasoningSummary?: ReasoningSummary;
581
1066
  }
1067
+ /**
1068
+ * Session event "session.mode_changed". Agent mode change details including previous and new modes
1069
+ */
582
1070
  export interface ModeChangedEvent {
583
1071
  /**
584
1072
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -601,21 +1089,64 @@ export interface ModeChangedEvent {
601
1089
  * ISO 8601 timestamp when the event was created
602
1090
  */
603
1091
  timestamp: string;
1092
+ /**
1093
+ * Type discriminator. Always "session.mode_changed".
1094
+ */
604
1095
  type: "session.mode_changed";
605
1096
  }
606
1097
  /**
607
1098
  * Agent mode change details including previous and new modes
608
1099
  */
609
1100
  export interface ModeChangedData {
1101
+ newMode: SessionMode;
1102
+ previousMode: SessionMode;
1103
+ }
1104
+ /**
1105
+ * Session event "session.permissions_changed". Permissions change details carrying the aggregate allow-all boolean transition.
1106
+ */
1107
+ export interface PermissionsChangedEvent {
1108
+ /**
1109
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1110
+ */
1111
+ agentId?: string;
1112
+ data: PermissionsChangedData;
1113
+ /**
1114
+ * When true, the event is transient and not persisted to the session event log on disk
1115
+ */
1116
+ ephemeral?: boolean;
1117
+ /**
1118
+ * Unique event identifier (UUID v4), generated when the event is emitted
1119
+ */
1120
+ id: string;
1121
+ /**
1122
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
1123
+ */
1124
+ parentId: string | null;
610
1125
  /**
611
- * Agent mode after the change (e.g., "interactive", "plan", "autopilot")
1126
+ * ISO 8601 timestamp when the event was created
1127
+ */
1128
+ timestamp: string;
1129
+ /**
1130
+ * Type discriminator. Always "session.permissions_changed".
1131
+ */
1132
+ type: "session.permissions_changed";
1133
+ }
1134
+ /**
1135
+ * Permissions change details carrying the aggregate allow-all boolean transition.
1136
+ */
1137
+ export interface PermissionsChangedData {
1138
+ /**
1139
+ * Aggregate allow-all flag after the change
612
1140
  */
613
- newMode: string;
1141
+ allowAllPermissions: boolean;
614
1142
  /**
615
- * Agent mode before the change (e.g., "interactive", "plan", "autopilot")
1143
+ * Aggregate allow-all flag before the change
616
1144
  */
617
- previousMode: string;
1145
+ previousAllowAllPermissions: boolean;
618
1146
  }
1147
+ /**
1148
+ * Session event "session.plan_changed". Plan file operation details indicating what changed
1149
+ */
619
1150
  export interface PlanChangedEvent {
620
1151
  /**
621
1152
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -638,6 +1169,9 @@ export interface PlanChangedEvent {
638
1169
  * ISO 8601 timestamp when the event was created
639
1170
  */
640
1171
  timestamp: string;
1172
+ /**
1173
+ * Type discriminator. Always "session.plan_changed".
1174
+ */
641
1175
  type: "session.plan_changed";
642
1176
  }
643
1177
  /**
@@ -646,6 +1180,9 @@ export interface PlanChangedEvent {
646
1180
  export interface PlanChangedData {
647
1181
  operation: PlanChangedOperation;
648
1182
  }
1183
+ /**
1184
+ * Session event "session.workspace_file_changed". Workspace file change details including path and operation type
1185
+ */
649
1186
  export interface WorkspaceFileChangedEvent {
650
1187
  /**
651
1188
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -668,6 +1205,9 @@ export interface WorkspaceFileChangedEvent {
668
1205
  * ISO 8601 timestamp when the event was created
669
1206
  */
670
1207
  timestamp: string;
1208
+ /**
1209
+ * Type discriminator. Always "session.workspace_file_changed".
1210
+ */
671
1211
  type: "session.workspace_file_changed";
672
1212
  }
673
1213
  /**
@@ -680,6 +1220,9 @@ export interface WorkspaceFileChangedData {
680
1220
  */
681
1221
  path: string;
682
1222
  }
1223
+ /**
1224
+ * Session event "session.handoff". Session handoff metadata including source, context, and repository information
1225
+ */
683
1226
  export interface HandoffEvent {
684
1227
  /**
685
1228
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -702,6 +1245,9 @@ export interface HandoffEvent {
702
1245
  * ISO 8601 timestamp when the event was created
703
1246
  */
704
1247
  timestamp: string;
1248
+ /**
1249
+ * Type discriminator. Always "session.handoff".
1250
+ */
705
1251
  type: "session.handoff";
706
1252
  }
707
1253
  /**
@@ -748,6 +1294,9 @@ export interface HandoffRepository {
748
1294
  */
749
1295
  owner: string;
750
1296
  }
1297
+ /**
1298
+ * Session event "session.truncation". Conversation truncation statistics including token counts and removed content metrics
1299
+ */
751
1300
  export interface TruncationEvent {
752
1301
  /**
753
1302
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -770,6 +1319,9 @@ export interface TruncationEvent {
770
1319
  * ISO 8601 timestamp when the event was created
771
1320
  */
772
1321
  timestamp: string;
1322
+ /**
1323
+ * Type discriminator. Always "session.truncation".
1324
+ */
773
1325
  type: "session.truncation";
774
1326
  }
775
1327
  /**
@@ -809,12 +1361,18 @@ export interface TruncationData {
809
1361
  */
810
1362
  tokensRemovedDuringTruncation: number;
811
1363
  }
1364
+ /**
1365
+ * Session event "session.snapshot_rewind". Session rewind details including target event and count of removed events
1366
+ */
812
1367
  export interface SnapshotRewindEvent {
813
1368
  /**
814
1369
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
815
1370
  */
816
1371
  agentId?: string;
817
1372
  data: SnapshotRewindData;
1373
+ /**
1374
+ * Always true for events that are transient and not persisted to the session event log on disk.
1375
+ */
818
1376
  ephemeral: true;
819
1377
  /**
820
1378
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -828,6 +1386,9 @@ export interface SnapshotRewindEvent {
828
1386
  * ISO 8601 timestamp when the event was created
829
1387
  */
830
1388
  timestamp: string;
1389
+ /**
1390
+ * Type discriminator. Always "session.snapshot_rewind".
1391
+ */
831
1392
  type: "session.snapshot_rewind";
832
1393
  }
833
1394
  /**
@@ -843,6 +1404,9 @@ export interface SnapshotRewindData {
843
1404
  */
844
1405
  upToEventId: string;
845
1406
  }
1407
+ /**
1408
+ * Session event "session.shutdown". Session termination metrics including usage statistics, code changes, and shutdown reason
1409
+ */
846
1410
  export interface ShutdownEvent {
847
1411
  /**
848
1412
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -865,6 +1429,9 @@ export interface ShutdownEvent {
865
1429
  * ISO 8601 timestamp when the event was created
866
1430
  */
867
1431
  timestamp: string;
1432
+ /**
1433
+ * Type discriminator. Always "session.shutdown".
1434
+ */
868
1435
  type: "session.shutdown";
869
1436
  }
870
1437
  /**
@@ -892,7 +1459,7 @@ export interface ShutdownData {
892
1459
  * Per-model usage breakdown, keyed by model identifier
893
1460
  */
894
1461
  modelMetrics: {
895
- [k: string]: ShutdownModelMetric;
1462
+ [k: string]: ShutdownModelMetric | undefined;
896
1463
  };
897
1464
  /**
898
1465
  * Unix timestamp (milliseconds) when the session started
@@ -907,7 +1474,7 @@ export interface ShutdownData {
907
1474
  * Session-wide per-token-type accumulated token counts
908
1475
  */
909
1476
  tokenDetails?: {
910
- [k: string]: ShutdownTokenDetail;
1477
+ [k: string]: ShutdownTokenDetail | undefined;
911
1478
  };
912
1479
  /**
913
1480
  * Tool definitions token count at shutdown
@@ -919,12 +1486,10 @@ export interface ShutdownData {
919
1486
  totalApiDurationMs: number;
920
1487
  /**
921
1488
  * Session-wide accumulated nano-AI units cost
1489
+ *
1490
+ * @experimental
922
1491
  */
923
1492
  totalNanoAiu?: number;
924
- /**
925
- * Total number of premium API requests used during the session
926
- */
927
- totalPremiumRequests: number;
928
1493
  }
929
1494
  /**
930
1495
  * Aggregate code change metrics for the session
@@ -943,16 +1508,21 @@ export interface ShutdownCodeChanges {
943
1508
  */
944
1509
  linesRemoved: number;
945
1510
  }
1511
+ /**
1512
+ * Schema for the `ShutdownModelMetric` type.
1513
+ */
946
1514
  export interface ShutdownModelMetric {
947
1515
  requests: ShutdownModelMetricRequests;
948
1516
  /**
949
1517
  * Token count details per type
950
1518
  */
951
1519
  tokenDetails?: {
952
- [k: string]: ShutdownModelMetricTokenDetail;
1520
+ [k: string]: ShutdownModelMetricTokenDetail | undefined;
953
1521
  };
954
1522
  /**
955
1523
  * Accumulated nano-AI units cost for this model
1524
+ *
1525
+ * @experimental
956
1526
  */
957
1527
  totalNanoAiu?: number;
958
1528
  usage: ShutdownModelMetricUsage;
@@ -963,13 +1533,20 @@ export interface ShutdownModelMetric {
963
1533
  export interface ShutdownModelMetricRequests {
964
1534
  /**
965
1535
  * Cumulative cost multiplier for requests to this model
1536
+ *
1537
+ * @experimental
966
1538
  */
967
- cost: number;
1539
+ cost?: number;
968
1540
  /**
969
1541
  * Total number of API requests made to this model
1542
+ *
1543
+ * @experimental
970
1544
  */
971
- count: number;
1545
+ count?: number;
972
1546
  }
1547
+ /**
1548
+ * Schema for the `ShutdownModelMetricTokenDetail` type.
1549
+ */
973
1550
  export interface ShutdownModelMetricTokenDetail {
974
1551
  /**
975
1552
  * Accumulated token count for this token type
@@ -1001,12 +1578,18 @@ export interface ShutdownModelMetricUsage {
1001
1578
  */
1002
1579
  reasoningTokens?: number;
1003
1580
  }
1581
+ /**
1582
+ * Schema for the `ShutdownTokenDetail` type.
1583
+ */
1004
1584
  export interface ShutdownTokenDetail {
1005
1585
  /**
1006
1586
  * Accumulated token count for this token type
1007
1587
  */
1008
1588
  tokenCount: number;
1009
1589
  }
1590
+ /**
1591
+ * Session event "session.context_changed". Updated working directory and git context after the change
1592
+ */
1010
1593
  export interface ContextChangedEvent {
1011
1594
  /**
1012
1595
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1029,14 +1612,23 @@ export interface ContextChangedEvent {
1029
1612
  * ISO 8601 timestamp when the event was created
1030
1613
  */
1031
1614
  timestamp: string;
1615
+ /**
1616
+ * Type discriminator. Always "session.context_changed".
1617
+ */
1032
1618
  type: "session.context_changed";
1033
1619
  }
1620
+ /**
1621
+ * Session event "session.usage_info". Current context window usage statistics including token and message counts
1622
+ */
1034
1623
  export interface UsageInfoEvent {
1035
1624
  /**
1036
1625
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1037
1626
  */
1038
1627
  agentId?: string;
1039
1628
  data: UsageInfoData;
1629
+ /**
1630
+ * Always true for events that are transient and not persisted to the session event log on disk.
1631
+ */
1040
1632
  ephemeral: true;
1041
1633
  /**
1042
1634
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1050,6 +1642,9 @@ export interface UsageInfoEvent {
1050
1642
  * ISO 8601 timestamp when the event was created
1051
1643
  */
1052
1644
  timestamp: string;
1645
+ /**
1646
+ * Type discriminator. Always "session.usage_info".
1647
+ */
1053
1648
  type: "session.usage_info";
1054
1649
  }
1055
1650
  /**
@@ -1085,6 +1680,9 @@ export interface UsageInfoData {
1085
1680
  */
1086
1681
  toolDefinitionsTokens?: number;
1087
1682
  }
1683
+ /**
1684
+ * Session event "session.compaction_start". Context window breakdown at the start of LLM-powered conversation compaction
1685
+ */
1088
1686
  export interface CompactionStartEvent {
1089
1687
  /**
1090
1688
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1107,6 +1705,9 @@ export interface CompactionStartEvent {
1107
1705
  * ISO 8601 timestamp when the event was created
1108
1706
  */
1109
1707
  timestamp: string;
1708
+ /**
1709
+ * Type discriminator. Always "session.compaction_start".
1710
+ */
1110
1711
  type: "session.compaction_start";
1111
1712
  }
1112
1713
  /**
@@ -1126,6 +1727,9 @@ export interface CompactionStartData {
1126
1727
  */
1127
1728
  toolDefinitionsTokens?: number;
1128
1729
  }
1730
+ /**
1731
+ * Session event "session.compaction_complete". Conversation compaction results including success status, metrics, and optional error details
1732
+ */
1129
1733
  export interface CompactionCompleteEvent {
1130
1734
  /**
1131
1735
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1148,6 +1752,9 @@ export interface CompactionCompleteEvent {
1148
1752
  * ISO 8601 timestamp when the event was created
1149
1753
  */
1150
1754
  timestamp: string;
1755
+ /**
1756
+ * Type discriminator. Always "session.compaction_complete".
1757
+ */
1151
1758
  type: "session.compaction_complete";
1152
1759
  }
1153
1760
  /**
@@ -1167,6 +1774,10 @@ export interface CompactionCompleteData {
1167
1774
  * Token count from non-system messages (user, assistant, tool) after compaction
1168
1775
  */
1169
1776
  conversationTokens?: number;
1777
+ /**
1778
+ * User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text.
1779
+ */
1780
+ customInstructions?: string;
1170
1781
  /**
1171
1782
  * Error message if compaction failed
1172
1783
  */
@@ -1191,6 +1802,10 @@ export interface CompactionCompleteData {
1191
1802
  * GitHub request tracing ID (x-github-request-id header) for the compaction LLM call
1192
1803
  */
1193
1804
  requestId?: string;
1805
+ /**
1806
+ * Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call
1807
+ */
1808
+ serviceRequestId?: string;
1194
1809
  /**
1195
1810
  * Whether compaction completed successfully
1196
1811
  */
@@ -1224,7 +1839,6 @@ export interface CompactionCompleteCompactionTokensUsed {
1224
1839
  * Tokens written to prompt cache in the compaction LLM call
1225
1840
  */
1226
1841
  cacheWriteTokens?: number;
1227
- copilotUsage?: CompactionCompleteCompactionTokensUsedCopilotUsage;
1228
1842
  /**
1229
1843
  * Duration of the compaction LLM call in milliseconds
1230
1844
  */
@@ -1242,19 +1856,6 @@ export interface CompactionCompleteCompactionTokensUsed {
1242
1856
  */
1243
1857
  outputTokens?: number;
1244
1858
  }
1245
- /**
1246
- * Per-request cost and usage data from the CAPI copilot_usage response field
1247
- */
1248
- export interface CompactionCompleteCompactionTokensUsedCopilotUsage {
1249
- /**
1250
- * Itemized token usage breakdown
1251
- */
1252
- tokenDetails: CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail[];
1253
- /**
1254
- * Total cost in nano-AI units for this request
1255
- */
1256
- totalNanoAiu: number;
1257
- }
1258
1859
  /**
1259
1860
  * Token usage detail for a single billing category
1260
1861
  */
@@ -1276,6 +1877,9 @@ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail {
1276
1877
  */
1277
1878
  tokenType: string;
1278
1879
  }
1880
+ /**
1881
+ * Session event "session.task_complete". Task completion notification with summary from the agent
1882
+ */
1279
1883
  export interface TaskCompleteEvent {
1280
1884
  /**
1281
1885
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1298,6 +1902,9 @@ export interface TaskCompleteEvent {
1298
1902
  * ISO 8601 timestamp when the event was created
1299
1903
  */
1300
1904
  timestamp: string;
1905
+ /**
1906
+ * Type discriminator. Always "session.task_complete".
1907
+ */
1301
1908
  type: "session.task_complete";
1302
1909
  }
1303
1910
  /**
@@ -1313,6 +1920,9 @@ export interface TaskCompleteData {
1313
1920
  */
1314
1921
  summary?: string;
1315
1922
  }
1923
+ /**
1924
+ * Session event "user.message".
1925
+ */
1316
1926
  export interface UserMessageEvent {
1317
1927
  /**
1318
1928
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1335,8 +1945,14 @@ export interface UserMessageEvent {
1335
1945
  * ISO 8601 timestamp when the event was created
1336
1946
  */
1337
1947
  timestamp: string;
1948
+ /**
1949
+ * Type discriminator. Always "user.message".
1950
+ */
1338
1951
  type: "user.message";
1339
1952
  }
1953
+ /**
1954
+ * Schema for the `UserMessageData` type.
1955
+ */
1340
1956
  export interface UserMessageData {
1341
1957
  agentMode?: UserMessageAgentMode;
1342
1958
  /**
@@ -1352,7 +1968,11 @@ export interface UserMessageData {
1352
1968
  */
1353
1969
  interactionId?: string;
1354
1970
  /**
1355
- * Path-backed native document attachments that stayed on the tagged_files path flow because native upload would exceed the request size limit
1971
+ * True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry.
1972
+ */
1973
+ isAutopilotContinuation?: boolean;
1974
+ /**
1975
+ * Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit
1356
1976
  */
1357
1977
  nativeDocumentPathFallbackPaths?: string[];
1358
1978
  /**
@@ -1522,12 +2142,18 @@ export interface UserMessageAttachmentBlob {
1522
2142
  */
1523
2143
  type: "blob";
1524
2144
  }
2145
+ /**
2146
+ * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
2147
+ */
1525
2148
  export interface PendingMessagesModifiedEvent {
1526
2149
  /**
1527
2150
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1528
2151
  */
1529
2152
  agentId?: string;
1530
2153
  data: PendingMessagesModifiedData;
2154
+ /**
2155
+ * Always true for events that are transient and not persisted to the session event log on disk.
2156
+ */
1531
2157
  ephemeral: true;
1532
2158
  /**
1533
2159
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1541,6 +2167,9 @@ export interface PendingMessagesModifiedEvent {
1541
2167
  * ISO 8601 timestamp when the event was created
1542
2168
  */
1543
2169
  timestamp: string;
2170
+ /**
2171
+ * Type discriminator. Always "pending_messages.modified".
2172
+ */
1544
2173
  type: "pending_messages.modified";
1545
2174
  }
1546
2175
  /**
@@ -1548,6 +2177,9 @@ export interface PendingMessagesModifiedEvent {
1548
2177
  */
1549
2178
  export interface PendingMessagesModifiedData {
1550
2179
  }
2180
+ /**
2181
+ * Session event "assistant.turn_start". Turn initialization metadata including identifier and interaction tracking
2182
+ */
1551
2183
  export interface AssistantTurnStartEvent {
1552
2184
  /**
1553
2185
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1570,6 +2202,9 @@ export interface AssistantTurnStartEvent {
1570
2202
  * ISO 8601 timestamp when the event was created
1571
2203
  */
1572
2204
  timestamp: string;
2205
+ /**
2206
+ * Type discriminator. Always "assistant.turn_start".
2207
+ */
1573
2208
  type: "assistant.turn_start";
1574
2209
  }
1575
2210
  /**
@@ -1585,12 +2220,18 @@ export interface AssistantTurnStartData {
1585
2220
  */
1586
2221
  turnId: string;
1587
2222
  }
2223
+ /**
2224
+ * Session event "assistant.intent". Agent intent description for current activity or plan
2225
+ */
1588
2226
  export interface AssistantIntentEvent {
1589
2227
  /**
1590
2228
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1591
2229
  */
1592
2230
  agentId?: string;
1593
2231
  data: AssistantIntentData;
2232
+ /**
2233
+ * Always true for events that are transient and not persisted to the session event log on disk.
2234
+ */
1594
2235
  ephemeral: true;
1595
2236
  /**
1596
2237
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1604,6 +2245,9 @@ export interface AssistantIntentEvent {
1604
2245
  * ISO 8601 timestamp when the event was created
1605
2246
  */
1606
2247
  timestamp: string;
2248
+ /**
2249
+ * Type discriminator. Always "assistant.intent".
2250
+ */
1607
2251
  type: "assistant.intent";
1608
2252
  }
1609
2253
  /**
@@ -1615,6 +2259,9 @@ export interface AssistantIntentData {
1615
2259
  */
1616
2260
  intent: string;
1617
2261
  }
2262
+ /**
2263
+ * Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text
2264
+ */
1618
2265
  export interface AssistantReasoningEvent {
1619
2266
  /**
1620
2267
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1637,6 +2284,9 @@ export interface AssistantReasoningEvent {
1637
2284
  * ISO 8601 timestamp when the event was created
1638
2285
  */
1639
2286
  timestamp: string;
2287
+ /**
2288
+ * Type discriminator. Always "assistant.reasoning".
2289
+ */
1640
2290
  type: "assistant.reasoning";
1641
2291
  }
1642
2292
  /**
@@ -1652,12 +2302,18 @@ export interface AssistantReasoningData {
1652
2302
  */
1653
2303
  reasoningId: string;
1654
2304
  }
2305
+ /**
2306
+ * Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates
2307
+ */
1655
2308
  export interface AssistantReasoningDeltaEvent {
1656
2309
  /**
1657
2310
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1658
2311
  */
1659
2312
  agentId?: string;
1660
2313
  data: AssistantReasoningDeltaData;
2314
+ /**
2315
+ * Always true for events that are transient and not persisted to the session event log on disk.
2316
+ */
1661
2317
  ephemeral: true;
1662
2318
  /**
1663
2319
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1671,6 +2327,9 @@ export interface AssistantReasoningDeltaEvent {
1671
2327
  * ISO 8601 timestamp when the event was created
1672
2328
  */
1673
2329
  timestamp: string;
2330
+ /**
2331
+ * Type discriminator. Always "assistant.reasoning_delta".
2332
+ */
1674
2333
  type: "assistant.reasoning_delta";
1675
2334
  }
1676
2335
  /**
@@ -1686,12 +2345,18 @@ export interface AssistantReasoningDeltaData {
1686
2345
  */
1687
2346
  reasoningId: string;
1688
2347
  }
2348
+ /**
2349
+ * Session event "assistant.streaming_delta". Streaming response progress with cumulative byte count
2350
+ */
1689
2351
  export interface AssistantStreamingDeltaEvent {
1690
2352
  /**
1691
2353
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1692
2354
  */
1693
2355
  agentId?: string;
1694
2356
  data: AssistantStreamingDeltaData;
2357
+ /**
2358
+ * Always true for events that are transient and not persisted to the session event log on disk.
2359
+ */
1695
2360
  ephemeral: true;
1696
2361
  /**
1697
2362
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1705,6 +2370,9 @@ export interface AssistantStreamingDeltaEvent {
1705
2370
  * ISO 8601 timestamp when the event was created
1706
2371
  */
1707
2372
  timestamp: string;
2373
+ /**
2374
+ * Type discriminator. Always "assistant.streaming_delta".
2375
+ */
1708
2376
  type: "assistant.streaming_delta";
1709
2377
  }
1710
2378
  /**
@@ -1716,6 +2384,9 @@ export interface AssistantStreamingDeltaData {
1716
2384
  */
1717
2385
  totalResponseSizeBytes: number;
1718
2386
  }
2387
+ /**
2388
+ * Session event "assistant.message". Assistant response containing text content, optional tool requests, and interaction metadata
2389
+ */
1719
2390
  export interface AssistantMessageEvent {
1720
2391
  /**
1721
2392
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1738,12 +2409,27 @@ export interface AssistantMessageEvent {
1738
2409
  * ISO 8601 timestamp when the event was created
1739
2410
  */
1740
2411
  timestamp: string;
2412
+ /**
2413
+ * Type discriminator. Always "assistant.message".
2414
+ */
1741
2415
  type: "assistant.message";
1742
2416
  }
1743
2417
  /**
1744
2418
  * Assistant response containing text content, optional tool requests, and interaction metadata
1745
2419
  */
1746
2420
  export interface AssistantMessageData {
2421
+ /**
2422
+ * Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping
2423
+ *
2424
+ * @experimental
2425
+ */
2426
+ anthropicAdvisorBlocks?: unknown[];
2427
+ /**
2428
+ * Anthropic advisor model ID used for this response, for timeline display on replay
2429
+ *
2430
+ * @experimental
2431
+ */
2432
+ anthropicAdvisorModel?: string;
1747
2433
  /**
1748
2434
  * The assistant's text response content
1749
2435
  */
@@ -1760,6 +2446,10 @@ export interface AssistantMessageData {
1760
2446
  * Unique identifier for this assistant message
1761
2447
  */
1762
2448
  messageId: string;
2449
+ /**
2450
+ * Model that produced this assistant message, if known
2451
+ */
2452
+ model?: string;
1763
2453
  /**
1764
2454
  * Actual output token count from the API response (completion_tokens), used for accurate token accounting
1765
2455
  */
@@ -1785,6 +2475,10 @@ export interface AssistantMessageData {
1785
2475
  * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
1786
2476
  */
1787
2477
  requestId?: string;
2478
+ /**
2479
+ * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
2480
+ */
2481
+ serviceRequestId?: string;
1788
2482
  /**
1789
2483
  * Tool invocations requested by the assistant in this message
1790
2484
  */
@@ -1802,7 +2496,7 @@ export interface AssistantMessageToolRequest {
1802
2496
  * Arguments to pass to the tool, format depends on the tool
1803
2497
  */
1804
2498
  arguments?: {
1805
- [k: string]: unknown;
2499
+ [k: string]: unknown | undefined;
1806
2500
  };
1807
2501
  /**
1808
2502
  * Resolved intention summary describing what this specific call does
@@ -1812,6 +2506,10 @@ export interface AssistantMessageToolRequest {
1812
2506
  * Name of the MCP server hosting this tool, when the tool is an MCP tool
1813
2507
  */
1814
2508
  mcpServerName?: string;
2509
+ /**
2510
+ * Original tool name on the MCP server, when the tool is an MCP tool
2511
+ */
2512
+ mcpToolName?: string;
1815
2513
  /**
1816
2514
  * Name of the tool being invoked
1817
2515
  */
@@ -1826,12 +2524,18 @@ export interface AssistantMessageToolRequest {
1826
2524
  toolTitle?: string;
1827
2525
  type?: AssistantMessageToolRequestType;
1828
2526
  }
2527
+ /**
2528
+ * Session event "assistant.message_start". Streaming assistant message start metadata
2529
+ */
1829
2530
  export interface AssistantMessageStartEvent {
1830
2531
  /**
1831
2532
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1832
2533
  */
1833
2534
  agentId?: string;
1834
2535
  data: AssistantMessageStartData;
2536
+ /**
2537
+ * Always true for events that are transient and not persisted to the session event log on disk.
2538
+ */
1835
2539
  ephemeral: true;
1836
2540
  /**
1837
2541
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1845,6 +2549,9 @@ export interface AssistantMessageStartEvent {
1845
2549
  * ISO 8601 timestamp when the event was created
1846
2550
  */
1847
2551
  timestamp: string;
2552
+ /**
2553
+ * Type discriminator. Always "assistant.message_start".
2554
+ */
1848
2555
  type: "assistant.message_start";
1849
2556
  }
1850
2557
  /**
@@ -1860,12 +2567,18 @@ export interface AssistantMessageStartData {
1860
2567
  */
1861
2568
  phase?: string;
1862
2569
  }
2570
+ /**
2571
+ * Session event "assistant.message_delta". Streaming assistant message delta for incremental response updates
2572
+ */
1863
2573
  export interface AssistantMessageDeltaEvent {
1864
2574
  /**
1865
2575
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1866
2576
  */
1867
2577
  agentId?: string;
1868
2578
  data: AssistantMessageDeltaData;
2579
+ /**
2580
+ * Always true for events that are transient and not persisted to the session event log on disk.
2581
+ */
1869
2582
  ephemeral: true;
1870
2583
  /**
1871
2584
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1879,6 +2592,9 @@ export interface AssistantMessageDeltaEvent {
1879
2592
  * ISO 8601 timestamp when the event was created
1880
2593
  */
1881
2594
  timestamp: string;
2595
+ /**
2596
+ * Type discriminator. Always "assistant.message_delta".
2597
+ */
1882
2598
  type: "assistant.message_delta";
1883
2599
  }
1884
2600
  /**
@@ -1899,6 +2615,9 @@ export interface AssistantMessageDeltaData {
1899
2615
  */
1900
2616
  parentToolCallId?: string;
1901
2617
  }
2618
+ /**
2619
+ * Session event "assistant.turn_end". Turn completion metadata including the turn identifier
2620
+ */
1902
2621
  export interface AssistantTurnEndEvent {
1903
2622
  /**
1904
2623
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1921,6 +2640,9 @@ export interface AssistantTurnEndEvent {
1921
2640
  * ISO 8601 timestamp when the event was created
1922
2641
  */
1923
2642
  timestamp: string;
2643
+ /**
2644
+ * Type discriminator. Always "assistant.turn_end".
2645
+ */
1924
2646
  type: "assistant.turn_end";
1925
2647
  }
1926
2648
  /**
@@ -1932,12 +2654,18 @@ export interface AssistantTurnEndData {
1932
2654
  */
1933
2655
  turnId: string;
1934
2656
  }
2657
+ /**
2658
+ * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information
2659
+ */
1935
2660
  export interface AssistantUsageEvent {
1936
2661
  /**
1937
2662
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1938
2663
  */
1939
2664
  agentId?: string;
1940
2665
  data: AssistantUsageData;
2666
+ /**
2667
+ * Always true for events that are transient and not persisted to the session event log on disk.
2668
+ */
1941
2669
  ephemeral: true;
1942
2670
  /**
1943
2671
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1951,6 +2679,9 @@ export interface AssistantUsageEvent {
1951
2679
  * ISO 8601 timestamp when the event was created
1952
2680
  */
1953
2681
  timestamp: string;
2682
+ /**
2683
+ * Type discriminator. Always "assistant.usage".
2684
+ */
1954
2685
  type: "assistant.usage";
1955
2686
  }
1956
2687
  /**
@@ -1961,6 +2692,7 @@ export interface AssistantUsageData {
1961
2692
  * Completion ID from the model provider (e.g., chatcmpl-abc123)
1962
2693
  */
1963
2694
  apiCallId?: string;
2695
+ apiEndpoint?: AssistantUsageApiEndpoint;
1964
2696
  /**
1965
2697
  * Number of tokens read from prompt cache
1966
2698
  */
@@ -1969,9 +2701,10 @@ export interface AssistantUsageData {
1969
2701
  * Number of tokens written to prompt cache
1970
2702
  */
1971
2703
  cacheWriteTokens?: number;
1972
- copilotUsage?: AssistantUsageCopilotUsage;
1973
2704
  /**
1974
2705
  * Model multiplier cost for billing purposes
2706
+ *
2707
+ * @experimental
1975
2708
  */
1976
2709
  cost?: number;
1977
2710
  /**
@@ -2008,13 +2741,7 @@ export interface AssistantUsageData {
2008
2741
  */
2009
2742
  providerCallId?: string;
2010
2743
  /**
2011
- * Per-quota resource usage snapshots, keyed by quota identifier
2012
- */
2013
- quotaSnapshots?: {
2014
- [k: string]: AssistantUsageQuotaSnapshot;
2015
- };
2016
- /**
2017
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
2744
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
2018
2745
  */
2019
2746
  reasoningEffort?: string;
2020
2747
  /**
@@ -2022,22 +2749,13 @@ export interface AssistantUsageData {
2022
2749
  */
2023
2750
  reasoningTokens?: number;
2024
2751
  /**
2025
- * Time to first token in milliseconds. Only available for streaming requests
2026
- */
2027
- ttftMs?: number;
2028
- }
2029
- /**
2030
- * Per-request cost and usage data from the CAPI copilot_usage response field
2031
- */
2032
- export interface AssistantUsageCopilotUsage {
2033
- /**
2034
- * Itemized token usage breakdown
2752
+ * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
2035
2753
  */
2036
- tokenDetails: AssistantUsageCopilotUsageTokenDetail[];
2754
+ serviceRequestId?: string;
2037
2755
  /**
2038
- * Total cost in nano-AI units for this request
2756
+ * Time to first token in milliseconds. Only available for streaming requests
2039
2757
  */
2040
- totalNanoAiu: number;
2758
+ timeToFirstTokenMs?: number;
2041
2759
  }
2042
2760
  /**
2043
2761
  * Token usage detail for a single billing category
@@ -2060,46 +2778,18 @@ export interface AssistantUsageCopilotUsageTokenDetail {
2060
2778
  */
2061
2779
  tokenType: string;
2062
2780
  }
2063
- export interface AssistantUsageQuotaSnapshot {
2064
- /**
2065
- * Total requests allowed by the entitlement
2066
- */
2067
- entitlementRequests: number;
2068
- /**
2069
- * Whether the user has an unlimited usage entitlement
2070
- */
2071
- isUnlimitedEntitlement: boolean;
2072
- /**
2073
- * Number of requests over the entitlement limit
2074
- */
2075
- overage: number;
2076
- /**
2077
- * Whether overage is allowed when quota is exhausted
2078
- */
2079
- overageAllowedWithExhaustedQuota: boolean;
2080
- /**
2081
- * Percentage of quota remaining (0.0 to 1.0)
2082
- */
2083
- remainingPercentage: number;
2084
- /**
2085
- * Date when the quota resets
2086
- */
2087
- resetDate?: string;
2088
- /**
2089
- * Whether usage is still permitted after quota exhaustion
2090
- */
2091
- usageAllowedWithExhaustedQuota: boolean;
2092
- /**
2093
- * Number of requests already consumed
2094
- */
2095
- usedRequests: number;
2096
- }
2781
+ /**
2782
+ * Session event "model.call_failure". Failed LLM API call metadata for telemetry
2783
+ */
2097
2784
  export interface ModelCallFailureEvent {
2098
2785
  /**
2099
2786
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2100
2787
  */
2101
2788
  agentId?: string;
2102
2789
  data: ModelCallFailureData;
2790
+ /**
2791
+ * Always true for events that are transient and not persisted to the session event log on disk.
2792
+ */
2103
2793
  ephemeral: true;
2104
2794
  /**
2105
2795
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2113,6 +2803,9 @@ export interface ModelCallFailureEvent {
2113
2803
  * ISO 8601 timestamp when the event was created
2114
2804
  */
2115
2805
  timestamp: string;
2806
+ /**
2807
+ * Type discriminator. Always "model.call_failure".
2808
+ */
2116
2809
  type: "model.call_failure";
2117
2810
  }
2118
2811
  /**
@@ -2143,12 +2836,19 @@ export interface ModelCallFailureData {
2143
2836
  * GitHub request tracing ID (x-github-request-id header) for server-side log correlation
2144
2837
  */
2145
2838
  providerCallId?: string;
2839
+ /**
2840
+ * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
2841
+ */
2842
+ serviceRequestId?: string;
2146
2843
  source: ModelCallFailureSource;
2147
2844
  /**
2148
2845
  * HTTP status code from the failed request
2149
2846
  */
2150
2847
  statusCode?: number;
2151
2848
  }
2849
+ /**
2850
+ * Session event "abort". Turn abort information including the reason for termination
2851
+ */
2152
2852
  export interface AbortEvent {
2153
2853
  /**
2154
2854
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2171,17 +2871,20 @@ export interface AbortEvent {
2171
2871
  * ISO 8601 timestamp when the event was created
2172
2872
  */
2173
2873
  timestamp: string;
2874
+ /**
2875
+ * Type discriminator. Always "abort".
2876
+ */
2174
2877
  type: "abort";
2175
2878
  }
2176
2879
  /**
2177
2880
  * Turn abort information including the reason for termination
2178
2881
  */
2179
2882
  export interface AbortData {
2180
- /**
2181
- * Reason the current turn was aborted (e.g., "user initiated")
2182
- */
2183
- reason: string;
2883
+ reason: AbortReason;
2184
2884
  }
2885
+ /**
2886
+ * Session event "tool.user_requested". User-initiated tool invocation request with tool name and arguments
2887
+ */
2185
2888
  export interface ToolUserRequestedEvent {
2186
2889
  /**
2187
2890
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2204,6 +2907,9 @@ export interface ToolUserRequestedEvent {
2204
2907
  * ISO 8601 timestamp when the event was created
2205
2908
  */
2206
2909
  timestamp: string;
2910
+ /**
2911
+ * Type discriminator. Always "tool.user_requested".
2912
+ */
2207
2913
  type: "tool.user_requested";
2208
2914
  }
2209
2915
  /**
@@ -2214,7 +2920,7 @@ export interface ToolUserRequestedData {
2214
2920
  * Arguments for the tool invocation
2215
2921
  */
2216
2922
  arguments?: {
2217
- [k: string]: unknown;
2923
+ [k: string]: unknown | undefined;
2218
2924
  };
2219
2925
  /**
2220
2926
  * Unique identifier for this tool call
@@ -2225,6 +2931,9 @@ export interface ToolUserRequestedData {
2225
2931
  */
2226
2932
  toolName: string;
2227
2933
  }
2934
+ /**
2935
+ * Session event "tool.execution_start". Tool execution startup details including MCP server information when applicable
2936
+ */
2228
2937
  export interface ToolExecutionStartEvent {
2229
2938
  /**
2230
2939
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2247,6 +2956,9 @@ export interface ToolExecutionStartEvent {
2247
2956
  * ISO 8601 timestamp when the event was created
2248
2957
  */
2249
2958
  timestamp: string;
2959
+ /**
2960
+ * Type discriminator. Always "tool.execution_start".
2961
+ */
2250
2962
  type: "tool.execution_start";
2251
2963
  }
2252
2964
  /**
@@ -2257,8 +2969,12 @@ export interface ToolExecutionStartData {
2257
2969
  * Arguments passed to the tool
2258
2970
  */
2259
2971
  arguments?: {
2260
- [k: string]: unknown;
2972
+ [k: string]: unknown | undefined;
2261
2973
  };
2974
+ /**
2975
+ * When true, the tool output should be displayed expanded (verbatim) in the CLI timeline
2976
+ */
2977
+ displayVerbatim?: boolean;
2262
2978
  /**
2263
2979
  * Name of the MCP server hosting this tool, when the tool is an MCP tool
2264
2980
  */
@@ -2285,12 +3001,18 @@ export interface ToolExecutionStartData {
2285
3001
  */
2286
3002
  turnId?: string;
2287
3003
  }
3004
+ /**
3005
+ * Session event "tool.execution_partial_result". Streaming tool execution output for incremental result display
3006
+ */
2288
3007
  export interface ToolExecutionPartialResultEvent {
2289
3008
  /**
2290
3009
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2291
3010
  */
2292
3011
  agentId?: string;
2293
3012
  data: ToolExecutionPartialData;
3013
+ /**
3014
+ * Always true for events that are transient and not persisted to the session event log on disk.
3015
+ */
2294
3016
  ephemeral: true;
2295
3017
  /**
2296
3018
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2304,6 +3026,9 @@ export interface ToolExecutionPartialResultEvent {
2304
3026
  * ISO 8601 timestamp when the event was created
2305
3027
  */
2306
3028
  timestamp: string;
3029
+ /**
3030
+ * Type discriminator. Always "tool.execution_partial_result".
3031
+ */
2307
3032
  type: "tool.execution_partial_result";
2308
3033
  }
2309
3034
  /**
@@ -2319,12 +3044,18 @@ export interface ToolExecutionPartialData {
2319
3044
  */
2320
3045
  toolCallId: string;
2321
3046
  }
3047
+ /**
3048
+ * Session event "tool.execution_progress". Tool execution progress notification with status message
3049
+ */
2322
3050
  export interface ToolExecutionProgressEvent {
2323
3051
  /**
2324
3052
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2325
3053
  */
2326
3054
  agentId?: string;
2327
3055
  data: ToolExecutionProgressData;
3056
+ /**
3057
+ * Always true for events that are transient and not persisted to the session event log on disk.
3058
+ */
2328
3059
  ephemeral: true;
2329
3060
  /**
2330
3061
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2338,6 +3069,9 @@ export interface ToolExecutionProgressEvent {
2338
3069
  * ISO 8601 timestamp when the event was created
2339
3070
  */
2340
3071
  timestamp: string;
3072
+ /**
3073
+ * Type discriminator. Always "tool.execution_progress".
3074
+ */
2341
3075
  type: "tool.execution_progress";
2342
3076
  }
2343
3077
  /**
@@ -2353,6 +3087,9 @@ export interface ToolExecutionProgressData {
2353
3087
  */
2354
3088
  toolCallId: string;
2355
3089
  }
3090
+ /**
3091
+ * Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information
3092
+ */
2356
3093
  export interface ToolExecutionCompleteEvent {
2357
3094
  /**
2358
3095
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2375,6 +3112,9 @@ export interface ToolExecutionCompleteEvent {
2375
3112
  * ISO 8601 timestamp when the event was created
2376
3113
  */
2377
3114
  timestamp: string;
3115
+ /**
3116
+ * Type discriminator. Always "tool.execution_complete".
3117
+ */
2378
3118
  type: "tool.execution_complete";
2379
3119
  }
2380
3120
  /**
@@ -2400,6 +3140,10 @@ export interface ToolExecutionCompleteData {
2400
3140
  */
2401
3141
  parentToolCallId?: string;
2402
3142
  result?: ToolExecutionCompleteResult;
3143
+ /**
3144
+ * Whether this tool execution ran inside a sandbox container
3145
+ */
3146
+ sandboxed?: boolean;
2403
3147
  /**
2404
3148
  * Whether the tool execution completed successfully
2405
3149
  */
@@ -2408,11 +3152,12 @@ export interface ToolExecutionCompleteData {
2408
3152
  * Unique identifier for the completed tool call
2409
3153
  */
2410
3154
  toolCallId: string;
3155
+ toolDescription?: ToolExecutionCompleteToolDescription;
2411
3156
  /**
2412
3157
  * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)
2413
3158
  */
2414
3159
  toolTelemetry?: {
2415
- [k: string]: unknown;
3160
+ [k: string]: unknown | undefined;
2416
3161
  };
2417
3162
  /**
2418
3163
  * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
@@ -2448,6 +3193,7 @@ export interface ToolExecutionCompleteResult {
2448
3193
  * Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent.
2449
3194
  */
2450
3195
  detailedContent?: string;
3196
+ uiResource?: ToolExecutionCompleteUIResource;
2451
3197
  }
2452
3198
  /**
2453
3199
  * Plain text content block
@@ -2582,6 +3328,9 @@ export interface ToolExecutionCompleteContentResource {
2582
3328
  */
2583
3329
  type: "resource";
2584
3330
  }
3331
+ /**
3332
+ * Schema for the `EmbeddedTextResourceContents` type.
3333
+ */
2585
3334
  export interface EmbeddedTextResourceContents {
2586
3335
  /**
2587
3336
  * MIME type of the text content
@@ -2596,6 +3345,9 @@ export interface EmbeddedTextResourceContents {
2596
3345
  */
2597
3346
  uri: string;
2598
3347
  }
3348
+ /**
3349
+ * Schema for the `EmbeddedBlobResourceContents` type.
3350
+ */
2599
3351
  export interface EmbeddedBlobResourceContents {
2600
3352
  /**
2601
3353
  * Base64-encoded binary content of the resource
@@ -2610,6 +3362,121 @@ export interface EmbeddedBlobResourceContents {
2610
3362
  */
2611
3363
  uri: string;
2612
3364
  }
3365
+ /**
3366
+ * MCP Apps UI resource content for rendering in a sandboxed iframe
3367
+ */
3368
+ export interface ToolExecutionCompleteUIResource {
3369
+ _meta?: ToolExecutionCompleteUIResourceMeta;
3370
+ /**
3371
+ * Base64-encoded HTML content
3372
+ */
3373
+ blob?: string;
3374
+ /**
3375
+ * MIME type of the content
3376
+ */
3377
+ mimeType: string;
3378
+ /**
3379
+ * HTML content as a string
3380
+ */
3381
+ text?: string;
3382
+ /**
3383
+ * The ui:// URI of the resource
3384
+ */
3385
+ uri: string;
3386
+ }
3387
+ /**
3388
+ * Resource-level UI metadata (CSP, permissions, visual preferences)
3389
+ */
3390
+ export interface ToolExecutionCompleteUIResourceMeta {
3391
+ ui?: ToolExecutionCompleteUIResourceMetaUI;
3392
+ }
3393
+ /**
3394
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUI` type.
3395
+ */
3396
+ export interface ToolExecutionCompleteUIResourceMetaUI {
3397
+ csp?: ToolExecutionCompleteUIResourceMetaUICsp;
3398
+ domain?: string;
3399
+ permissions?: ToolExecutionCompleteUIResourceMetaUIPermissions;
3400
+ prefersBorder?: boolean;
3401
+ }
3402
+ /**
3403
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type.
3404
+ */
3405
+ export interface ToolExecutionCompleteUIResourceMetaUICsp {
3406
+ baseUriDomains?: string[];
3407
+ connectDomains?: string[];
3408
+ frameDomains?: string[];
3409
+ resourceDomains?: string[];
3410
+ }
3411
+ /**
3412
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type.
3413
+ */
3414
+ export interface ToolExecutionCompleteUIResourceMetaUIPermissions {
3415
+ camera?: ToolExecutionCompleteUIResourceMetaUIPermissionsCamera;
3416
+ clipboardWrite?: ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite;
3417
+ geolocation?: ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation;
3418
+ microphone?: ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone;
3419
+ }
3420
+ /**
3421
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.
3422
+ */
3423
+ export interface ToolExecutionCompleteUIResourceMetaUIPermissionsCamera {
3424
+ [k: string]: unknown | undefined;
3425
+ }
3426
+ /**
3427
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.
3428
+ */
3429
+ export interface ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite {
3430
+ [k: string]: unknown | undefined;
3431
+ }
3432
+ /**
3433
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.
3434
+ */
3435
+ export interface ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation {
3436
+ [k: string]: unknown | undefined;
3437
+ }
3438
+ /**
3439
+ * Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.
3440
+ */
3441
+ export interface ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone {
3442
+ [k: string]: unknown | undefined;
3443
+ }
3444
+ /**
3445
+ * Tool definition metadata, present for MCP tools with MCP Apps support
3446
+ */
3447
+ export interface ToolExecutionCompleteToolDescription {
3448
+ _meta?: ToolExecutionCompleteToolDescriptionMeta;
3449
+ /**
3450
+ * Tool description
3451
+ */
3452
+ description?: string;
3453
+ /**
3454
+ * Tool name
3455
+ */
3456
+ name: string;
3457
+ }
3458
+ /**
3459
+ * MCP Apps metadata for UI resource association
3460
+ */
3461
+ export interface ToolExecutionCompleteToolDescriptionMeta {
3462
+ ui?: ToolExecutionCompleteToolDescriptionMetaUI;
3463
+ }
3464
+ /**
3465
+ * Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type.
3466
+ */
3467
+ export interface ToolExecutionCompleteToolDescriptionMetaUI {
3468
+ /**
3469
+ * URI of the UI resource
3470
+ */
3471
+ resourceUri?: string;
3472
+ /**
3473
+ * Who can access this tool
3474
+ */
3475
+ visibility?: ToolExecutionCompleteToolDescriptionMetaUIVisibility[];
3476
+ }
3477
+ /**
3478
+ * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata
3479
+ */
2613
3480
  export interface SkillInvokedEvent {
2614
3481
  /**
2615
3482
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2632,6 +3499,9 @@ export interface SkillInvokedEvent {
2632
3499
  * ISO 8601 timestamp when the event was created
2633
3500
  */
2634
3501
  timestamp: string;
3502
+ /**
3503
+ * Type discriminator. Always "skill.invoked".
3504
+ */
2635
3505
  type: "skill.invoked";
2636
3506
  }
2637
3507
  /**
@@ -2666,7 +3536,15 @@ export interface SkillInvokedData {
2666
3536
  * Version of the plugin this skill originated from, when applicable
2667
3537
  */
2668
3538
  pluginVersion?: string;
3539
+ /**
3540
+ * Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), personal-claude (~/.claude/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill)
3541
+ */
3542
+ source?: string;
3543
+ trigger?: SkillInvokedTrigger;
2669
3544
  }
3545
+ /**
3546
+ * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information
3547
+ */
2670
3548
  export interface SubagentStartedEvent {
2671
3549
  /**
2672
3550
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2689,6 +3567,9 @@ export interface SubagentStartedEvent {
2689
3567
  * ISO 8601 timestamp when the event was created
2690
3568
  */
2691
3569
  timestamp: string;
3570
+ /**
3571
+ * Type discriminator. Always "subagent.started".
3572
+ */
2692
3573
  type: "subagent.started";
2693
3574
  }
2694
3575
  /**
@@ -2707,11 +3588,18 @@ export interface SubagentStartedData {
2707
3588
  * Internal name of the sub-agent
2708
3589
  */
2709
3590
  agentName: string;
3591
+ /**
3592
+ * Model the sub-agent will run with, when known at start. Surfaced in the timeline for auto-selected sub-agents (e.g. rubber-duck).
3593
+ */
3594
+ model?: string;
2710
3595
  /**
2711
3596
  * Tool call ID of the parent tool invocation that spawned this sub-agent
2712
3597
  */
2713
3598
  toolCallId: string;
2714
3599
  }
3600
+ /**
3601
+ * Session event "subagent.completed". Sub-agent completion details for successful execution
3602
+ */
2715
3603
  export interface SubagentCompletedEvent {
2716
3604
  /**
2717
3605
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2734,6 +3622,9 @@ export interface SubagentCompletedEvent {
2734
3622
  * ISO 8601 timestamp when the event was created
2735
3623
  */
2736
3624
  timestamp: string;
3625
+ /**
3626
+ * Type discriminator. Always "subagent.completed".
3627
+ */
2737
3628
  type: "subagent.completed";
2738
3629
  }
2739
3630
  /**
@@ -2769,6 +3660,9 @@ export interface SubagentCompletedData {
2769
3660
  */
2770
3661
  totalToolCalls?: number;
2771
3662
  }
3663
+ /**
3664
+ * Session event "subagent.failed". Sub-agent failure details including error message and agent information
3665
+ */
2772
3666
  export interface SubagentFailedEvent {
2773
3667
  /**
2774
3668
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2791,6 +3685,9 @@ export interface SubagentFailedEvent {
2791
3685
  * ISO 8601 timestamp when the event was created
2792
3686
  */
2793
3687
  timestamp: string;
3688
+ /**
3689
+ * Type discriminator. Always "subagent.failed".
3690
+ */
2794
3691
  type: "subagent.failed";
2795
3692
  }
2796
3693
  /**
@@ -2830,6 +3727,9 @@ export interface SubagentFailedData {
2830
3727
  */
2831
3728
  totalToolCalls?: number;
2832
3729
  }
3730
+ /**
3731
+ * Session event "subagent.selected". Custom agent selection details including name and available tools
3732
+ */
2833
3733
  export interface SubagentSelectedEvent {
2834
3734
  /**
2835
3735
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2852,6 +3752,9 @@ export interface SubagentSelectedEvent {
2852
3752
  * ISO 8601 timestamp when the event was created
2853
3753
  */
2854
3754
  timestamp: string;
3755
+ /**
3756
+ * Type discriminator. Always "subagent.selected".
3757
+ */
2855
3758
  type: "subagent.selected";
2856
3759
  }
2857
3760
  /**
@@ -2871,6 +3774,9 @@ export interface SubagentSelectedData {
2871
3774
  */
2872
3775
  tools: string[] | null;
2873
3776
  }
3777
+ /**
3778
+ * Session event "subagent.deselected". Empty payload; the event signals that the custom agent was deselected, returning to the default agent
3779
+ */
2874
3780
  export interface SubagentDeselectedEvent {
2875
3781
  /**
2876
3782
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2893,6 +3799,9 @@ export interface SubagentDeselectedEvent {
2893
3799
  * ISO 8601 timestamp when the event was created
2894
3800
  */
2895
3801
  timestamp: string;
3802
+ /**
3803
+ * Type discriminator. Always "subagent.deselected".
3804
+ */
2896
3805
  type: "subagent.deselected";
2897
3806
  }
2898
3807
  /**
@@ -2900,6 +3809,9 @@ export interface SubagentDeselectedEvent {
2900
3809
  */
2901
3810
  export interface SubagentDeselectedData {
2902
3811
  }
3812
+ /**
3813
+ * Session event "hook.start". Hook invocation start details including type and input data
3814
+ */
2903
3815
  export interface HookStartEvent {
2904
3816
  /**
2905
3817
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2922,6 +3834,9 @@ export interface HookStartEvent {
2922
3834
  * ISO 8601 timestamp when the event was created
2923
3835
  */
2924
3836
  timestamp: string;
3837
+ /**
3838
+ * Type discriminator. Always "hook.start".
3839
+ */
2925
3840
  type: "hook.start";
2926
3841
  }
2927
3842
  /**
@@ -2940,10 +3855,13 @@ export interface HookStartData {
2940
3855
  * Input data passed to the hook
2941
3856
  */
2942
3857
  input?: {
2943
- [k: string]: unknown;
3858
+ [k: string]: unknown | undefined;
2944
3859
  };
2945
3860
  }
2946
- export interface HookEndEvent {
3861
+ /**
3862
+ * Session event "hook.end". Hook invocation completion details including output, success status, and error information
3863
+ */
3864
+ export interface HookEndEvent {
2947
3865
  /**
2948
3866
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2949
3867
  */
@@ -2965,6 +3883,9 @@ export interface HookEndEvent {
2965
3883
  * ISO 8601 timestamp when the event was created
2966
3884
  */
2967
3885
  timestamp: string;
3886
+ /**
3887
+ * Type discriminator. Always "hook.end".
3888
+ */
2968
3889
  type: "hook.end";
2969
3890
  }
2970
3891
  /**
@@ -2984,7 +3905,7 @@ export interface HookEndData {
2984
3905
  * Output data produced by the hook
2985
3906
  */
2986
3907
  output?: {
2987
- [k: string]: unknown;
3908
+ [k: string]: unknown | undefined;
2988
3909
  };
2989
3910
  /**
2990
3911
  * Whether the hook completed successfully
@@ -3004,6 +3925,48 @@ export interface HookEndError {
3004
3925
  */
3005
3926
  stack?: string;
3006
3927
  }
3928
+ /**
3929
+ * Session event "hook.progress". Ephemeral progress update from a running hook process
3930
+ */
3931
+ export interface HookProgressEvent {
3932
+ /**
3933
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
3934
+ */
3935
+ agentId?: string;
3936
+ data: HookProgressData;
3937
+ /**
3938
+ * Always true for events that are transient and not persisted to the session event log on disk.
3939
+ */
3940
+ ephemeral: true;
3941
+ /**
3942
+ * Unique event identifier (UUID v4), generated when the event is emitted
3943
+ */
3944
+ id: string;
3945
+ /**
3946
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3947
+ */
3948
+ parentId: string | null;
3949
+ /**
3950
+ * ISO 8601 timestamp when the event was created
3951
+ */
3952
+ timestamp: string;
3953
+ /**
3954
+ * Type discriminator. Always "hook.progress".
3955
+ */
3956
+ type: "hook.progress";
3957
+ }
3958
+ /**
3959
+ * Ephemeral progress update from a running hook process
3960
+ */
3961
+ export interface HookProgressData {
3962
+ /**
3963
+ * Human-readable progress message from the hook process
3964
+ */
3965
+ message: string;
3966
+ }
3967
+ /**
3968
+ * Session event "system.message". System/developer instruction content with role and optional template metadata
3969
+ */
3007
3970
  export interface SystemMessageEvent {
3008
3971
  /**
3009
3972
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3026,6 +3989,9 @@ export interface SystemMessageEvent {
3026
3989
  * ISO 8601 timestamp when the event was created
3027
3990
  */
3028
3991
  timestamp: string;
3992
+ /**
3993
+ * Type discriminator. Always "system.message".
3994
+ */
3029
3995
  type: "system.message";
3030
3996
  }
3031
3997
  /**
@@ -3055,9 +4021,12 @@ export interface SystemMessageMetadata {
3055
4021
  * Template variables used when constructing the prompt
3056
4022
  */
3057
4023
  variables?: {
3058
- [k: string]: unknown;
4024
+ [k: string]: unknown | undefined;
3059
4025
  };
3060
4026
  }
4027
+ /**
4028
+ * Session event "system.notification". System-generated notification for runtime events like background task completion
4029
+ */
3061
4030
  export interface SystemNotificationEvent {
3062
4031
  /**
3063
4032
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3080,6 +4049,9 @@ export interface SystemNotificationEvent {
3080
4049
  * ISO 8601 timestamp when the event was created
3081
4050
  */
3082
4051
  timestamp: string;
4052
+ /**
4053
+ * Type discriminator. Always "system.notification".
4054
+ */
3083
4055
  type: "system.notification";
3084
4056
  }
3085
4057
  /**
@@ -3092,6 +4064,9 @@ export interface SystemNotificationData {
3092
4064
  content: string;
3093
4065
  kind: SystemNotification;
3094
4066
  }
4067
+ /**
4068
+ * Schema for the `SystemNotificationAgentCompleted` type.
4069
+ */
3095
4070
  export interface SystemNotificationAgentCompleted {
3096
4071
  /**
3097
4072
  * Unique identifier of the background agent
@@ -3110,8 +4085,14 @@ export interface SystemNotificationAgentCompleted {
3110
4085
  */
3111
4086
  prompt?: string;
3112
4087
  status: SystemNotificationAgentCompletedStatus;
4088
+ /**
4089
+ * Type discriminator. Always "agent_completed".
4090
+ */
3113
4091
  type: "agent_completed";
3114
4092
  }
4093
+ /**
4094
+ * Schema for the `SystemNotificationAgentIdle` type.
4095
+ */
3115
4096
  export interface SystemNotificationAgentIdle {
3116
4097
  /**
3117
4098
  * Unique identifier of the background agent
@@ -3125,8 +4106,14 @@ export interface SystemNotificationAgentIdle {
3125
4106
  * Human-readable description of the agent task
3126
4107
  */
3127
4108
  description?: string;
4109
+ /**
4110
+ * Type discriminator. Always "agent_idle".
4111
+ */
3128
4112
  type: "agent_idle";
3129
4113
  }
4114
+ /**
4115
+ * Schema for the `SystemNotificationNewInboxMessage` type.
4116
+ */
3130
4117
  export interface SystemNotificationNewInboxMessage {
3131
4118
  /**
3132
4119
  * Unique identifier of the inbox entry
@@ -3144,8 +4131,14 @@ export interface SystemNotificationNewInboxMessage {
3144
4131
  * Short summary shown before the agent decides whether to read the inbox
3145
4132
  */
3146
4133
  summary: string;
4134
+ /**
4135
+ * Type discriminator. Always "new_inbox_message".
4136
+ */
3147
4137
  type: "new_inbox_message";
3148
4138
  }
4139
+ /**
4140
+ * Schema for the `SystemNotificationShellCompleted` type.
4141
+ */
3149
4142
  export interface SystemNotificationShellCompleted {
3150
4143
  /**
3151
4144
  * Human-readable description of the command
@@ -3159,8 +4152,14 @@ export interface SystemNotificationShellCompleted {
3159
4152
  * Unique identifier of the shell session
3160
4153
  */
3161
4154
  shellId: string;
4155
+ /**
4156
+ * Type discriminator. Always "shell_completed".
4157
+ */
3162
4158
  type: "shell_completed";
3163
4159
  }
4160
+ /**
4161
+ * Schema for the `SystemNotificationShellDetachedCompleted` type.
4162
+ */
3164
4163
  export interface SystemNotificationShellDetachedCompleted {
3165
4164
  /**
3166
4165
  * Human-readable description of the command
@@ -3170,8 +4169,14 @@ export interface SystemNotificationShellDetachedCompleted {
3170
4169
  * Unique identifier of the detached shell session
3171
4170
  */
3172
4171
  shellId: string;
4172
+ /**
4173
+ * Type discriminator. Always "shell_detached_completed".
4174
+ */
3173
4175
  type: "shell_detached_completed";
3174
4176
  }
4177
+ /**
4178
+ * Schema for the `SystemNotificationInstructionDiscovered` type.
4179
+ */
3175
4180
  export interface SystemNotificationInstructionDiscovered {
3176
4181
  /**
3177
4182
  * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/')
@@ -3189,8 +4194,14 @@ export interface SystemNotificationInstructionDiscovered {
3189
4194
  * Tool command that triggered discovery (currently always 'view')
3190
4195
  */
3191
4196
  triggerTool: string;
4197
+ /**
4198
+ * Type discriminator. Always "instruction_discovered".
4199
+ */
3192
4200
  type: "instruction_discovered";
3193
4201
  }
4202
+ /**
4203
+ * Session event "permission.requested". Permission request notification requiring client approval with request details
4204
+ */
3194
4205
  export interface PermissionRequestedEvent {
3195
4206
  /**
3196
4207
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3213,6 +4224,9 @@ export interface PermissionRequestedEvent {
3213
4224
  * ISO 8601 timestamp when the event was created
3214
4225
  */
3215
4226
  timestamp: string;
4227
+ /**
4228
+ * Type discriminator. Always "permission.requested".
4229
+ */
3216
4230
  type: "permission.requested";
3217
4231
  }
3218
4232
  /**
@@ -3275,6 +4289,9 @@ export interface PermissionRequestShell {
3275
4289
  */
3276
4290
  warning?: string;
3277
4291
  }
4292
+ /**
4293
+ * Schema for the `PermissionRequestShellCommand` type.
4294
+ */
3278
4295
  export interface PermissionRequestShellCommand {
3279
4296
  /**
3280
4297
  * Command identifier (e.g., executable name)
@@ -3285,6 +4302,9 @@ export interface PermissionRequestShellCommand {
3285
4302
  */
3286
4303
  readOnly: boolean;
3287
4304
  }
4305
+ /**
4306
+ * Schema for the `PermissionRequestShellPossibleUrl` type.
4307
+ */
3288
4308
  export interface PermissionRequestShellPossibleUrl {
3289
4309
  /**
3290
4310
  * URL that may be accessed by the command
@@ -3353,7 +4373,7 @@ export interface PermissionRequestMcp {
3353
4373
  * Arguments to pass to the MCP tool
3354
4374
  */
3355
4375
  args?: {
3356
- [k: string]: unknown;
4376
+ [k: string]: unknown | undefined;
3357
4377
  };
3358
4378
  /**
3359
4379
  * Permission kind discriminator
@@ -3440,7 +4460,7 @@ export interface PermissionRequestCustomTool {
3440
4460
  * Arguments to pass to the custom tool
3441
4461
  */
3442
4462
  args?: {
3443
- [k: string]: unknown;
4463
+ [k: string]: unknown | undefined;
3444
4464
  };
3445
4465
  /**
3446
4466
  * Permission kind discriminator
@@ -3475,7 +4495,7 @@ export interface PermissionRequestHook {
3475
4495
  * Arguments of the tool call being gated
3476
4496
  */
3477
4497
  toolArgs?: {
3478
- [k: string]: unknown;
4498
+ [k: string]: unknown | undefined;
3479
4499
  };
3480
4500
  /**
3481
4501
  * Tool call ID that triggered this permission request
@@ -3486,6 +4506,48 @@ export interface PermissionRequestHook {
3486
4506
  */
3487
4507
  toolName: string;
3488
4508
  }
4509
+ /**
4510
+ * Extension management permission request
4511
+ */
4512
+ export interface PermissionRequestExtensionManagement {
4513
+ /**
4514
+ * Name of the extension being managed
4515
+ */
4516
+ extensionName?: string;
4517
+ /**
4518
+ * Permission kind discriminator
4519
+ */
4520
+ kind: "extension-management";
4521
+ /**
4522
+ * The extension management operation (scaffold, reload)
4523
+ */
4524
+ operation: string;
4525
+ /**
4526
+ * Tool call ID that triggered this permission request
4527
+ */
4528
+ toolCallId?: string;
4529
+ }
4530
+ /**
4531
+ * Extension permission access request
4532
+ */
4533
+ export interface PermissionRequestExtensionPermissionAccess {
4534
+ /**
4535
+ * Capabilities the extension is requesting
4536
+ */
4537
+ capabilities: string[];
4538
+ /**
4539
+ * Name of the extension requesting permission access
4540
+ */
4541
+ extensionName: string;
4542
+ /**
4543
+ * Permission kind discriminator
4544
+ */
4545
+ kind: "extension-permission-access";
4546
+ /**
4547
+ * Tool call ID that triggered this permission request
4548
+ */
4549
+ toolCallId?: string;
4550
+ }
3489
4551
  /**
3490
4552
  * Shell command permission prompt
3491
4553
  */
@@ -3624,12 +4686,12 @@ export interface PermissionPromptRequestUrl {
3624
4686
  * Memory operation permission prompt
3625
4687
  */
3626
4688
  export interface PermissionPromptRequestMemory {
3627
- action?: PermissionPromptRequestMemoryAction;
4689
+ action?: PermissionRequestMemoryAction;
3628
4690
  /**
3629
4691
  * Source references for the stored fact (store only)
3630
4692
  */
3631
4693
  citations?: string;
3632
- direction?: PermissionPromptRequestMemoryDirection;
4694
+ direction?: PermissionRequestMemoryDirection;
3633
4695
  /**
3634
4696
  * The fact being stored or voted on
3635
4697
  */
@@ -3659,7 +4721,7 @@ export interface PermissionPromptRequestCustomTool {
3659
4721
  * Arguments to pass to the custom tool
3660
4722
  */
3661
4723
  args?: {
3662
- [k: string]: unknown;
4724
+ [k: string]: unknown | undefined;
3663
4725
  };
3664
4726
  /**
3665
4727
  * Prompt kind discriminator
@@ -3712,7 +4774,7 @@ export interface PermissionPromptRequestHook {
3712
4774
  * Arguments of the tool call being gated
3713
4775
  */
3714
4776
  toolArgs?: {
3715
- [k: string]: unknown;
4777
+ [k: string]: unknown | undefined;
3716
4778
  };
3717
4779
  /**
3718
4780
  * Tool call ID that triggered this permission request
@@ -3723,6 +4785,51 @@ export interface PermissionPromptRequestHook {
3723
4785
  */
3724
4786
  toolName: string;
3725
4787
  }
4788
+ /**
4789
+ * Extension management permission prompt
4790
+ */
4791
+ export interface PermissionPromptRequestExtensionManagement {
4792
+ /**
4793
+ * Name of the extension being managed
4794
+ */
4795
+ extensionName?: string;
4796
+ /**
4797
+ * Prompt kind discriminator
4798
+ */
4799
+ kind: "extension-management";
4800
+ /**
4801
+ * The extension management operation (scaffold, reload)
4802
+ */
4803
+ operation: string;
4804
+ /**
4805
+ * Tool call ID that triggered this permission request
4806
+ */
4807
+ toolCallId?: string;
4808
+ }
4809
+ /**
4810
+ * Extension permission access prompt
4811
+ */
4812
+ export interface PermissionPromptRequestExtensionPermissionAccess {
4813
+ /**
4814
+ * Capabilities the extension is requesting
4815
+ */
4816
+ capabilities: string[];
4817
+ /**
4818
+ * Name of the extension requesting permission access
4819
+ */
4820
+ extensionName: string;
4821
+ /**
4822
+ * Prompt kind discriminator
4823
+ */
4824
+ kind: "extension-permission-access";
4825
+ /**
4826
+ * Tool call ID that triggered this permission request
4827
+ */
4828
+ toolCallId?: string;
4829
+ }
4830
+ /**
4831
+ * Session event "permission.completed". Permission request completion notification signaling UI dismissal
4832
+ */
3726
4833
  export interface PermissionCompletedEvent {
3727
4834
  /**
3728
4835
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3745,6 +4852,9 @@ export interface PermissionCompletedEvent {
3745
4852
  * ISO 8601 timestamp when the event was created
3746
4853
  */
3747
4854
  timestamp: string;
4855
+ /**
4856
+ * Type discriminator. Always "permission.completed".
4857
+ */
3748
4858
  type: "permission.completed";
3749
4859
  }
3750
4860
  /**
@@ -3761,12 +4871,18 @@ export interface PermissionCompletedData {
3761
4871
  */
3762
4872
  toolCallId?: string;
3763
4873
  }
4874
+ /**
4875
+ * Schema for the `PermissionApproved` type.
4876
+ */
3764
4877
  export interface PermissionApproved {
3765
4878
  /**
3766
4879
  * The permission request was approved
3767
4880
  */
3768
4881
  kind: "approved";
3769
4882
  }
4883
+ /**
4884
+ * Schema for the `PermissionApprovedForSession` type.
4885
+ */
3770
4886
  export interface PermissionApprovedForSession {
3771
4887
  approval: UserToolSessionApproval;
3772
4888
  /**
@@ -3774,6 +4890,9 @@ export interface PermissionApprovedForSession {
3774
4890
  */
3775
4891
  kind: "approved-for-session";
3776
4892
  }
4893
+ /**
4894
+ * Schema for the `UserToolSessionApprovalCommands` type.
4895
+ */
3777
4896
  export interface UserToolSessionApprovalCommands {
3778
4897
  /**
3779
4898
  * Command identifiers approved by the user
@@ -3784,18 +4903,27 @@ export interface UserToolSessionApprovalCommands {
3784
4903
  */
3785
4904
  kind: "commands";
3786
4905
  }
4906
+ /**
4907
+ * Schema for the `UserToolSessionApprovalRead` type.
4908
+ */
3787
4909
  export interface UserToolSessionApprovalRead {
3788
4910
  /**
3789
4911
  * Read approval kind
3790
4912
  */
3791
4913
  kind: "read";
3792
4914
  }
4915
+ /**
4916
+ * Schema for the `UserToolSessionApprovalWrite` type.
4917
+ */
3793
4918
  export interface UserToolSessionApprovalWrite {
3794
4919
  /**
3795
4920
  * Write approval kind
3796
4921
  */
3797
4922
  kind: "write";
3798
4923
  }
4924
+ /**
4925
+ * Schema for the `UserToolSessionApprovalMcp` type.
4926
+ */
3799
4927
  export interface UserToolSessionApprovalMcp {
3800
4928
  /**
3801
4929
  * MCP tool approval kind
@@ -3810,12 +4938,18 @@ export interface UserToolSessionApprovalMcp {
3810
4938
  */
3811
4939
  toolName: string | null;
3812
4940
  }
4941
+ /**
4942
+ * Schema for the `UserToolSessionApprovalMemory` type.
4943
+ */
3813
4944
  export interface UserToolSessionApprovalMemory {
3814
4945
  /**
3815
4946
  * Memory approval kind
3816
4947
  */
3817
4948
  kind: "memory";
3818
4949
  }
4950
+ /**
4951
+ * Schema for the `UserToolSessionApprovalCustomTool` type.
4952
+ */
3819
4953
  export interface UserToolSessionApprovalCustomTool {
3820
4954
  /**
3821
4955
  * Custom tool approval kind
@@ -3826,6 +4960,35 @@ export interface UserToolSessionApprovalCustomTool {
3826
4960
  */
3827
4961
  toolName: string;
3828
4962
  }
4963
+ /**
4964
+ * Schema for the `UserToolSessionApprovalExtensionManagement` type.
4965
+ */
4966
+ export interface UserToolSessionApprovalExtensionManagement {
4967
+ /**
4968
+ * Extension management approval kind
4969
+ */
4970
+ kind: "extension-management";
4971
+ /**
4972
+ * Optional operation identifier
4973
+ */
4974
+ operation?: string;
4975
+ }
4976
+ /**
4977
+ * Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type.
4978
+ */
4979
+ export interface UserToolSessionApprovalExtensionPermissionAccess {
4980
+ /**
4981
+ * Extension name
4982
+ */
4983
+ extensionName: string;
4984
+ /**
4985
+ * Extension permission access approval kind
4986
+ */
4987
+ kind: "extension-permission-access";
4988
+ }
4989
+ /**
4990
+ * Schema for the `PermissionApprovedForLocation` type.
4991
+ */
3829
4992
  export interface PermissionApprovedForLocation {
3830
4993
  approval: UserToolSessionApproval;
3831
4994
  /**
@@ -3837,6 +5000,9 @@ export interface PermissionApprovedForLocation {
3837
5000
  */
3838
5001
  locationKey: string;
3839
5002
  }
5003
+ /**
5004
+ * Schema for the `PermissionCancelled` type.
5005
+ */
3840
5006
  export interface PermissionCancelled {
3841
5007
  /**
3842
5008
  * The permission request was cancelled before a response was used
@@ -3847,6 +5013,9 @@ export interface PermissionCancelled {
3847
5013
  */
3848
5014
  reason?: string;
3849
5015
  }
5016
+ /**
5017
+ * Schema for the `PermissionDeniedByRules` type.
5018
+ */
3850
5019
  export interface PermissionDeniedByRules {
3851
5020
  /**
3852
5021
  * Denied because approval rules explicitly blocked it
@@ -3857,9 +5026,12 @@ export interface PermissionDeniedByRules {
3857
5026
  */
3858
5027
  rules: PermissionRule[];
3859
5028
  }
5029
+ /**
5030
+ * Schema for the `PermissionRule` type.
5031
+ */
3860
5032
  export interface PermissionRule {
3861
5033
  /**
3862
- * Optional rule argument matched against the request
5034
+ * Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory').
3863
5035
  */
3864
5036
  argument: string | null;
3865
5037
  /**
@@ -3867,12 +5039,18 @@ export interface PermissionRule {
3867
5039
  */
3868
5040
  kind: string;
3869
5041
  }
5042
+ /**
5043
+ * Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.
5044
+ */
3870
5045
  export interface PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser {
3871
5046
  /**
3872
5047
  * Denied because no approval rule matched and user confirmation was unavailable
3873
5048
  */
3874
5049
  kind: "denied-no-approval-rule-and-could-not-request-from-user";
3875
5050
  }
5051
+ /**
5052
+ * Schema for the `PermissionDeniedInteractivelyByUser` type.
5053
+ */
3876
5054
  export interface PermissionDeniedInteractivelyByUser {
3877
5055
  /**
3878
5056
  * Optional feedback from the user explaining the denial
@@ -3887,6 +5065,9 @@ export interface PermissionDeniedInteractivelyByUser {
3887
5065
  */
3888
5066
  kind: "denied-interactively-by-user";
3889
5067
  }
5068
+ /**
5069
+ * Schema for the `PermissionDeniedByContentExclusionPolicy` type.
5070
+ */
3890
5071
  export interface PermissionDeniedByContentExclusionPolicy {
3891
5072
  /**
3892
5073
  * Denied by the organization's content exclusion policy
@@ -3901,6 +5082,9 @@ export interface PermissionDeniedByContentExclusionPolicy {
3901
5082
  */
3902
5083
  path: string;
3903
5084
  }
5085
+ /**
5086
+ * Schema for the `PermissionDeniedByPermissionRequestHook` type.
5087
+ */
3904
5088
  export interface PermissionDeniedByPermissionRequestHook {
3905
5089
  /**
3906
5090
  * Whether to interrupt the current agent turn
@@ -3915,12 +5099,18 @@ export interface PermissionDeniedByPermissionRequestHook {
3915
5099
  */
3916
5100
  message?: string;
3917
5101
  }
5102
+ /**
5103
+ * Session event "user_input.requested". User input request notification with question and optional predefined choices
5104
+ */
3918
5105
  export interface UserInputRequestedEvent {
3919
5106
  /**
3920
5107
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
3921
5108
  */
3922
5109
  agentId?: string;
3923
5110
  data: UserInputRequestedData;
5111
+ /**
5112
+ * Always true for events that are transient and not persisted to the session event log on disk.
5113
+ */
3924
5114
  ephemeral: true;
3925
5115
  /**
3926
5116
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -3934,6 +5124,9 @@ export interface UserInputRequestedEvent {
3934
5124
  * ISO 8601 timestamp when the event was created
3935
5125
  */
3936
5126
  timestamp: string;
5127
+ /**
5128
+ * Type discriminator. Always "user_input.requested".
5129
+ */
3937
5130
  type: "user_input.requested";
3938
5131
  }
3939
5132
  /**
@@ -3961,12 +5154,18 @@ export interface UserInputRequestedData {
3961
5154
  */
3962
5155
  toolCallId?: string;
3963
5156
  }
5157
+ /**
5158
+ * Session event "user_input.completed". User input request completion with the user's response
5159
+ */
3964
5160
  export interface UserInputCompletedEvent {
3965
5161
  /**
3966
5162
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
3967
5163
  */
3968
5164
  agentId?: string;
3969
5165
  data: UserInputCompletedData;
5166
+ /**
5167
+ * Always true for events that are transient and not persisted to the session event log on disk.
5168
+ */
3970
5169
  ephemeral: true;
3971
5170
  /**
3972
5171
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -3980,6 +5179,9 @@ export interface UserInputCompletedEvent {
3980
5179
  * ISO 8601 timestamp when the event was created
3981
5180
  */
3982
5181
  timestamp: string;
5182
+ /**
5183
+ * Type discriminator. Always "user_input.completed".
5184
+ */
3983
5185
  type: "user_input.completed";
3984
5186
  }
3985
5187
  /**
@@ -3999,12 +5201,18 @@ export interface UserInputCompletedData {
3999
5201
  */
4000
5202
  wasFreeform?: boolean;
4001
5203
  }
5204
+ /**
5205
+ * Session event "elicitation.requested". Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
5206
+ */
4002
5207
  export interface ElicitationRequestedEvent {
4003
5208
  /**
4004
5209
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4005
5210
  */
4006
5211
  agentId?: string;
4007
5212
  data: ElicitationRequestedData;
5213
+ /**
5214
+ * Always true for events that are transient and not persisted to the session event log on disk.
5215
+ */
4008
5216
  ephemeral: true;
4009
5217
  /**
4010
5218
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4018,6 +5226,9 @@ export interface ElicitationRequestedEvent {
4018
5226
  * ISO 8601 timestamp when the event was created
4019
5227
  */
4020
5228
  timestamp: string;
5229
+ /**
5230
+ * Type discriminator. Always "elicitation.requested".
5231
+ */
4021
5232
  type: "elicitation.requested";
4022
5233
  }
4023
5234
  /**
@@ -4046,7 +5257,7 @@ export interface ElicitationRequestedData {
4046
5257
  * URL to open in the user's browser (url mode only)
4047
5258
  */
4048
5259
  url?: string;
4049
- [k: string]: unknown;
5260
+ [k: string]: unknown | undefined;
4050
5261
  }
4051
5262
  /**
4052
5263
  * JSON Schema describing the form fields to present to the user (form mode only)
@@ -4056,7 +5267,7 @@ export interface ElicitationRequestedSchema {
4056
5267
  * Form field definitions, keyed by field name
4057
5268
  */
4058
5269
  properties: {
4059
- [k: string]: unknown;
5270
+ [k: string]: unknown | undefined;
4060
5271
  };
4061
5272
  /**
4062
5273
  * List of required field names
@@ -4067,12 +5278,18 @@ export interface ElicitationRequestedSchema {
4067
5278
  */
4068
5279
  type: "object";
4069
5280
  }
5281
+ /**
5282
+ * Session event "elicitation.completed". Elicitation request completion with the user's response
5283
+ */
4070
5284
  export interface ElicitationCompletedEvent {
4071
5285
  /**
4072
5286
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4073
5287
  */
4074
5288
  agentId?: string;
4075
5289
  data: ElicitationCompletedData;
5290
+ /**
5291
+ * Always true for events that are transient and not persisted to the session event log on disk.
5292
+ */
4076
5293
  ephemeral: true;
4077
5294
  /**
4078
5295
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4086,6 +5303,9 @@ export interface ElicitationCompletedEvent {
4086
5303
  * ISO 8601 timestamp when the event was created
4087
5304
  */
4088
5305
  timestamp: string;
5306
+ /**
5307
+ * Type discriminator. Always "elicitation.completed".
5308
+ */
4089
5309
  type: "elicitation.completed";
4090
5310
  }
4091
5311
  /**
@@ -4097,19 +5317,25 @@ export interface ElicitationCompletedData {
4097
5317
  * The submitted form data when action is 'accept'; keys match the requested schema fields
4098
5318
  */
4099
5319
  content?: {
4100
- [k: string]: ElicitationCompletedContent;
5320
+ [k: string]: ElicitationCompletedContent | undefined;
4101
5321
  };
4102
5322
  /**
4103
5323
  * Request ID of the resolved elicitation request; clients should dismiss any UI for this request
4104
5324
  */
4105
5325
  requestId: string;
4106
5326
  }
5327
+ /**
5328
+ * Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation
5329
+ */
4107
5330
  export interface SamplingRequestedEvent {
4108
5331
  /**
4109
5332
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4110
5333
  */
4111
5334
  agentId?: string;
4112
5335
  data: SamplingRequestedData;
5336
+ /**
5337
+ * Always true for events that are transient and not persisted to the session event log on disk.
5338
+ */
4113
5339
  ephemeral: true;
4114
5340
  /**
4115
5341
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4123,6 +5349,9 @@ export interface SamplingRequestedEvent {
4123
5349
  * ISO 8601 timestamp when the event was created
4124
5350
  */
4125
5351
  timestamp: string;
5352
+ /**
5353
+ * Type discriminator. Always "sampling.requested".
5354
+ */
4126
5355
  type: "sampling.requested";
4127
5356
  }
4128
5357
  /**
@@ -4141,14 +5370,20 @@ export interface SamplingRequestedData {
4141
5370
  * Name of the MCP server that initiated the sampling request
4142
5371
  */
4143
5372
  serverName: string;
4144
- [k: string]: unknown;
5373
+ [k: string]: unknown | undefined;
4145
5374
  }
5375
+ /**
5376
+ * Session event "sampling.completed". Sampling request completion notification signaling UI dismissal
5377
+ */
4146
5378
  export interface SamplingCompletedEvent {
4147
5379
  /**
4148
5380
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4149
5381
  */
4150
5382
  agentId?: string;
4151
5383
  data: SamplingCompletedData;
5384
+ /**
5385
+ * Always true for events that are transient and not persisted to the session event log on disk.
5386
+ */
4152
5387
  ephemeral: true;
4153
5388
  /**
4154
5389
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4162,6 +5397,9 @@ export interface SamplingCompletedEvent {
4162
5397
  * ISO 8601 timestamp when the event was created
4163
5398
  */
4164
5399
  timestamp: string;
5400
+ /**
5401
+ * Type discriminator. Always "sampling.completed".
5402
+ */
4165
5403
  type: "sampling.completed";
4166
5404
  }
4167
5405
  /**
@@ -4173,12 +5411,18 @@ export interface SamplingCompletedData {
4173
5411
  */
4174
5412
  requestId: string;
4175
5413
  }
5414
+ /**
5415
+ * Session event "mcp.oauth_required". OAuth authentication request for an MCP server
5416
+ */
4176
5417
  export interface McpOauthRequiredEvent {
4177
5418
  /**
4178
5419
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4179
5420
  */
4180
5421
  agentId?: string;
4181
5422
  data: McpOauthRequiredData;
5423
+ /**
5424
+ * Always true for events that are transient and not persisted to the session event log on disk.
5425
+ */
4182
5426
  ephemeral: true;
4183
5427
  /**
4184
5428
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4192,6 +5436,9 @@ export interface McpOauthRequiredEvent {
4192
5436
  * ISO 8601 timestamp when the event was created
4193
5437
  */
4194
5438
  timestamp: string;
5439
+ /**
5440
+ * Type discriminator. Always "mcp.oauth_required".
5441
+ */
4195
5442
  type: "mcp.oauth_required";
4196
5443
  }
4197
5444
  /**
@@ -4229,12 +5476,18 @@ export interface McpOauthRequiredStaticClientConfig {
4229
5476
  */
4230
5477
  publicClient?: boolean;
4231
5478
  }
5479
+ /**
5480
+ * Session event "mcp.oauth_completed". MCP OAuth request completion notification
5481
+ */
4232
5482
  export interface McpOauthCompletedEvent {
4233
5483
  /**
4234
5484
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4235
5485
  */
4236
5486
  agentId?: string;
4237
5487
  data: McpOauthCompletedData;
5488
+ /**
5489
+ * Always true for events that are transient and not persisted to the session event log on disk.
5490
+ */
4238
5491
  ephemeral: true;
4239
5492
  /**
4240
5493
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4248,6 +5501,9 @@ export interface McpOauthCompletedEvent {
4248
5501
  * ISO 8601 timestamp when the event was created
4249
5502
  */
4250
5503
  timestamp: string;
5504
+ /**
5505
+ * Type discriminator. Always "mcp.oauth_completed".
5506
+ */
4251
5507
  type: "mcp.oauth_completed";
4252
5508
  }
4253
5509
  /**
@@ -4259,16 +5515,19 @@ export interface McpOauthCompletedData {
4259
5515
  */
4260
5516
  requestId: string;
4261
5517
  }
4262
- export interface ExternalToolRequestedEvent {
5518
+ /**
5519
+ * Session event "session.custom_notification". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
5520
+ */
5521
+ export interface CustomNotificationEvent {
4263
5522
  /**
4264
5523
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4265
5524
  */
4266
5525
  agentId?: string;
4267
- data: ExternalToolRequestedData;
5526
+ data: CustomNotificationData;
4268
5527
  /**
4269
- * When true, the event is transient and not persisted to the session event log on disk
5528
+ * Always true for events that are transient and not persisted to the session event log on disk.
4270
5529
  */
4271
- ephemeral?: boolean;
5530
+ ephemeral: true;
4272
5531
  /**
4273
5532
  * Unique event identifier (UUID v4), generated when the event is emitted
4274
5533
  */
@@ -4281,30 +5540,88 @@ export interface ExternalToolRequestedEvent {
4281
5540
  * ISO 8601 timestamp when the event was created
4282
5541
  */
4283
5542
  timestamp: string;
4284
- type: "external_tool.requested";
5543
+ /**
5544
+ * Type discriminator. Always "session.custom_notification".
5545
+ */
5546
+ type: "session.custom_notification";
4285
5547
  }
4286
5548
  /**
4287
- * External tool invocation request for client-side tool execution
5549
+ * Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
4288
5550
  */
4289
- export interface ExternalToolRequestedData {
4290
- /**
4291
- * Arguments to pass to the external tool
4292
- */
4293
- arguments?: {
4294
- [k: string]: unknown;
4295
- };
5551
+ export interface CustomNotificationData {
4296
5552
  /**
4297
- * Unique identifier for this request; used to respond via session.respondToExternalTool()
5553
+ * Source-defined custom notification name
4298
5554
  */
4299
- requestId: string;
5555
+ name: string;
5556
+ payload: CustomNotificationPayload;
4300
5557
  /**
4301
- * Session ID that this external tool request belongs to
5558
+ * Namespace for the custom notification producer
4302
5559
  */
4303
- sessionId: string;
5560
+ source: string;
5561
+ subject?: CustomNotificationSubject;
4304
5562
  /**
4305
- * Tool call ID assigned to this external tool invocation
5563
+ * Optional source-defined payload schema version
4306
5564
  */
4307
- toolCallId: string;
5565
+ version?: number;
5566
+ }
5567
+ /**
5568
+ * Optional source-defined string identifiers describing the payload subject
5569
+ */
5570
+ export interface CustomNotificationSubject {
5571
+ [k: string]: string | undefined;
5572
+ }
5573
+ /**
5574
+ * Session event "external_tool.requested". External tool invocation request for client-side tool execution
5575
+ */
5576
+ export interface ExternalToolRequestedEvent {
5577
+ /**
5578
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5579
+ */
5580
+ agentId?: string;
5581
+ data: ExternalToolRequestedData;
5582
+ /**
5583
+ * When true, the event is transient and not persisted to the session event log on disk
5584
+ */
5585
+ ephemeral?: boolean;
5586
+ /**
5587
+ * Unique event identifier (UUID v4), generated when the event is emitted
5588
+ */
5589
+ id: string;
5590
+ /**
5591
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
5592
+ */
5593
+ parentId: string | null;
5594
+ /**
5595
+ * ISO 8601 timestamp when the event was created
5596
+ */
5597
+ timestamp: string;
5598
+ /**
5599
+ * Type discriminator. Always "external_tool.requested".
5600
+ */
5601
+ type: "external_tool.requested";
5602
+ }
5603
+ /**
5604
+ * External tool invocation request for client-side tool execution
5605
+ */
5606
+ export interface ExternalToolRequestedData {
5607
+ /**
5608
+ * Arguments to pass to the external tool
5609
+ */
5610
+ arguments?: {
5611
+ [k: string]: unknown | undefined;
5612
+ };
5613
+ /**
5614
+ * Unique identifier for this request; used to respond via session.respondToExternalTool()
5615
+ */
5616
+ requestId: string;
5617
+ /**
5618
+ * Session ID that this external tool request belongs to
5619
+ */
5620
+ sessionId: string;
5621
+ /**
5622
+ * Tool call ID assigned to this external tool invocation
5623
+ */
5624
+ toolCallId: string;
4308
5625
  /**
4309
5626
  * Name of the external tool to invoke
4310
5627
  */
@@ -4317,13 +5634,23 @@ export interface ExternalToolRequestedData {
4317
5634
  * W3C Trace Context tracestate header for the execute_tool span
4318
5635
  */
4319
5636
  tracestate?: string;
5637
+ /**
5638
+ * Active session working directory, when known.
5639
+ */
5640
+ workingDirectory?: string;
4320
5641
  }
5642
+ /**
5643
+ * Session event "external_tool.completed". External tool completion notification signaling UI dismissal
5644
+ */
4321
5645
  export interface ExternalToolCompletedEvent {
4322
5646
  /**
4323
5647
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4324
5648
  */
4325
5649
  agentId?: string;
4326
5650
  data: ExternalToolCompletedData;
5651
+ /**
5652
+ * Always true for events that are transient and not persisted to the session event log on disk.
5653
+ */
4327
5654
  ephemeral?: true;
4328
5655
  /**
4329
5656
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4337,6 +5664,9 @@ export interface ExternalToolCompletedEvent {
4337
5664
  * ISO 8601 timestamp when the event was created
4338
5665
  */
4339
5666
  timestamp: string;
5667
+ /**
5668
+ * Type discriminator. Always "external_tool.completed".
5669
+ */
4340
5670
  type: "external_tool.completed";
4341
5671
  }
4342
5672
  /**
@@ -4348,12 +5678,18 @@ export interface ExternalToolCompletedData {
4348
5678
  */
4349
5679
  requestId: string;
4350
5680
  }
5681
+ /**
5682
+ * Session event "command.queued". Queued slash command dispatch request for client execution
5683
+ */
4351
5684
  export interface CommandQueuedEvent {
4352
5685
  /**
4353
5686
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4354
5687
  */
4355
5688
  agentId?: string;
4356
5689
  data: CommandQueuedData;
5690
+ /**
5691
+ * Always true for events that are transient and not persisted to the session event log on disk.
5692
+ */
4357
5693
  ephemeral: true;
4358
5694
  /**
4359
5695
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4367,6 +5703,9 @@ export interface CommandQueuedEvent {
4367
5703
  * ISO 8601 timestamp when the event was created
4368
5704
  */
4369
5705
  timestamp: string;
5706
+ /**
5707
+ * Type discriminator. Always "command.queued".
5708
+ */
4370
5709
  type: "command.queued";
4371
5710
  }
4372
5711
  /**
@@ -4382,12 +5721,18 @@ export interface CommandQueuedData {
4382
5721
  */
4383
5722
  requestId: string;
4384
5723
  }
5724
+ /**
5725
+ * Session event "command.execute". Registered command dispatch request routed to the owning client
5726
+ */
4385
5727
  export interface CommandExecuteEvent {
4386
5728
  /**
4387
5729
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4388
5730
  */
4389
5731
  agentId?: string;
4390
5732
  data: CommandExecuteData;
5733
+ /**
5734
+ * Always true for events that are transient and not persisted to the session event log on disk.
5735
+ */
4391
5736
  ephemeral: true;
4392
5737
  /**
4393
5738
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4401,6 +5746,9 @@ export interface CommandExecuteEvent {
4401
5746
  * ISO 8601 timestamp when the event was created
4402
5747
  */
4403
5748
  timestamp: string;
5749
+ /**
5750
+ * Type discriminator. Always "command.execute".
5751
+ */
4404
5752
  type: "command.execute";
4405
5753
  }
4406
5754
  /**
@@ -4424,12 +5772,18 @@ export interface CommandExecuteData {
4424
5772
  */
4425
5773
  requestId: string;
4426
5774
  }
5775
+ /**
5776
+ * Session event "command.completed". Queued command completion notification signaling UI dismissal
5777
+ */
4427
5778
  export interface CommandCompletedEvent {
4428
5779
  /**
4429
5780
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4430
5781
  */
4431
5782
  agentId?: string;
4432
5783
  data: CommandCompletedData;
5784
+ /**
5785
+ * Always true for events that are transient and not persisted to the session event log on disk.
5786
+ */
4433
5787
  ephemeral: true;
4434
5788
  /**
4435
5789
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4443,6 +5797,9 @@ export interface CommandCompletedEvent {
4443
5797
  * ISO 8601 timestamp when the event was created
4444
5798
  */
4445
5799
  timestamp: string;
5800
+ /**
5801
+ * Type discriminator. Always "command.completed".
5802
+ */
4446
5803
  type: "command.completed";
4447
5804
  }
4448
5805
  /**
@@ -4454,12 +5811,18 @@ export interface CommandCompletedData {
4454
5811
  */
4455
5812
  requestId: string;
4456
5813
  }
5814
+ /**
5815
+ * Session event "auto_mode_switch.requested". Auto mode switch request notification requiring user approval
5816
+ */
4457
5817
  export interface AutoModeSwitchRequestedEvent {
4458
5818
  /**
4459
5819
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4460
5820
  */
4461
5821
  agentId?: string;
4462
5822
  data: AutoModeSwitchRequestedData;
5823
+ /**
5824
+ * Always true for events that are transient and not persisted to the session event log on disk.
5825
+ */
4463
5826
  ephemeral: true;
4464
5827
  /**
4465
5828
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4473,6 +5836,9 @@ export interface AutoModeSwitchRequestedEvent {
4473
5836
  * ISO 8601 timestamp when the event was created
4474
5837
  */
4475
5838
  timestamp: string;
5839
+ /**
5840
+ * Type discriminator. Always "auto_mode_switch.requested".
5841
+ */
4476
5842
  type: "auto_mode_switch.requested";
4477
5843
  }
4478
5844
  /**
@@ -4492,12 +5858,18 @@ export interface AutoModeSwitchRequestedData {
4492
5858
  */
4493
5859
  retryAfterSeconds?: number;
4494
5860
  }
5861
+ /**
5862
+ * Session event "auto_mode_switch.completed". Auto mode switch completion notification
5863
+ */
4495
5864
  export interface AutoModeSwitchCompletedEvent {
4496
5865
  /**
4497
5866
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4498
5867
  */
4499
5868
  agentId?: string;
4500
5869
  data: AutoModeSwitchCompletedData;
5870
+ /**
5871
+ * Always true for events that are transient and not persisted to the session event log on disk.
5872
+ */
4501
5873
  ephemeral: true;
4502
5874
  /**
4503
5875
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4511,6 +5883,9 @@ export interface AutoModeSwitchCompletedEvent {
4511
5883
  * ISO 8601 timestamp when the event was created
4512
5884
  */
4513
5885
  timestamp: string;
5886
+ /**
5887
+ * Type discriminator. Always "auto_mode_switch.completed".
5888
+ */
4514
5889
  type: "auto_mode_switch.completed";
4515
5890
  }
4516
5891
  /**
@@ -4521,17 +5896,20 @@ export interface AutoModeSwitchCompletedData {
4521
5896
  * Request ID of the resolved request; clients should dismiss any UI for this request
4522
5897
  */
4523
5898
  requestId: string;
4524
- /**
4525
- * The user's choice: 'yes', 'yes_always', or 'no'
4526
- */
4527
- response: string;
5899
+ response: AutoModeSwitchResponse;
4528
5900
  }
5901
+ /**
5902
+ * Session event "commands.changed". SDK command registration change notification
5903
+ */
4529
5904
  export interface CommandsChangedEvent {
4530
5905
  /**
4531
5906
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4532
5907
  */
4533
5908
  agentId?: string;
4534
5909
  data: CommandsChangedData;
5910
+ /**
5911
+ * Always true for events that are transient and not persisted to the session event log on disk.
5912
+ */
4535
5913
  ephemeral: true;
4536
5914
  /**
4537
5915
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4545,6 +5923,9 @@ export interface CommandsChangedEvent {
4545
5923
  * ISO 8601 timestamp when the event was created
4546
5924
  */
4547
5925
  timestamp: string;
5926
+ /**
5927
+ * Type discriminator. Always "commands.changed".
5928
+ */
4548
5929
  type: "commands.changed";
4549
5930
  }
4550
5931
  /**
@@ -4556,16 +5937,31 @@ export interface CommandsChangedData {
4556
5937
  */
4557
5938
  commands: CommandsChangedCommand[];
4558
5939
  }
5940
+ /**
5941
+ * Schema for the `CommandsChangedCommand` type.
5942
+ */
4559
5943
  export interface CommandsChangedCommand {
5944
+ /**
5945
+ * Optional human-readable command description.
5946
+ */
4560
5947
  description?: string;
5948
+ /**
5949
+ * Slash command name without the leading slash.
5950
+ */
4561
5951
  name: string;
4562
5952
  }
5953
+ /**
5954
+ * Session event "capabilities.changed". Session capability change notification
5955
+ */
4563
5956
  export interface CapabilitiesChangedEvent {
4564
5957
  /**
4565
5958
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4566
5959
  */
4567
5960
  agentId?: string;
4568
5961
  data: CapabilitiesChangedData;
5962
+ /**
5963
+ * Always true for events that are transient and not persisted to the session event log on disk.
5964
+ */
4569
5965
  ephemeral: true;
4570
5966
  /**
4571
5967
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4579,6 +5975,9 @@ export interface CapabilitiesChangedEvent {
4579
5975
  * ISO 8601 timestamp when the event was created
4580
5976
  */
4581
5977
  timestamp: string;
5978
+ /**
5979
+ * Type discriminator. Always "capabilities.changed".
5980
+ */
4582
5981
  type: "capabilities.changed";
4583
5982
  }
4584
5983
  /**
@@ -4591,17 +5990,31 @@ export interface CapabilitiesChangedData {
4591
5990
  * UI capability changes
4592
5991
  */
4593
5992
  export interface CapabilitiesChangedUI {
5993
+ /**
5994
+ * Whether canvas rendering is now supported
5995
+ */
5996
+ canvases?: boolean;
4594
5997
  /**
4595
5998
  * Whether elicitation is now supported
4596
5999
  */
4597
6000
  elicitation?: boolean;
6001
+ /**
6002
+ * Whether MCP Apps (SEP-1865) UI passthrough is now supported
6003
+ */
6004
+ mcpApps?: boolean;
4598
6005
  }
6006
+ /**
6007
+ * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions
6008
+ */
4599
6009
  export interface ExitPlanModeRequestedEvent {
4600
6010
  /**
4601
6011
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4602
6012
  */
4603
6013
  agentId?: string;
4604
6014
  data: ExitPlanModeRequestedData;
6015
+ /**
6016
+ * Always true for events that are transient and not persisted to the session event log on disk.
6017
+ */
4605
6018
  ephemeral: true;
4606
6019
  /**
4607
6020
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4615,6 +6028,9 @@ export interface ExitPlanModeRequestedEvent {
4615
6028
  * ISO 8601 timestamp when the event was created
4616
6029
  */
4617
6030
  timestamp: string;
6031
+ /**
6032
+ * Type discriminator. Always "exit_plan_mode.requested".
6033
+ */
4618
6034
  type: "exit_plan_mode.requested";
4619
6035
  }
4620
6036
  /**
@@ -4622,17 +6038,14 @@ export interface ExitPlanModeRequestedEvent {
4622
6038
  */
4623
6039
  export interface ExitPlanModeRequestedData {
4624
6040
  /**
4625
- * Available actions the user can take (e.g., approve, edit, reject)
6041
+ * Available actions the user can take
4626
6042
  */
4627
- actions: string[];
6043
+ actions: ExitPlanModeAction[];
4628
6044
  /**
4629
6045
  * Full content of the plan file
4630
6046
  */
4631
6047
  planContent: string;
4632
- /**
4633
- * The recommended action for the user to take
4634
- */
4635
- recommendedAction: string;
6048
+ recommendedAction: ExitPlanModeAction;
4636
6049
  /**
4637
6050
  * Unique identifier for this request; used to respond via session.respondToExitPlanMode()
4638
6051
  */
@@ -4642,12 +6055,18 @@ export interface ExitPlanModeRequestedData {
4642
6055
  */
4643
6056
  summary: string;
4644
6057
  }
6058
+ /**
6059
+ * Session event "exit_plan_mode.completed". Plan mode exit completion with the user's approval decision and optional feedback
6060
+ */
4645
6061
  export interface ExitPlanModeCompletedEvent {
4646
6062
  /**
4647
6063
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4648
6064
  */
4649
6065
  agentId?: string;
4650
6066
  data: ExitPlanModeCompletedData;
6067
+ /**
6068
+ * Always true for events that are transient and not persisted to the session event log on disk.
6069
+ */
4651
6070
  ephemeral: true;
4652
6071
  /**
4653
6072
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4661,6 +6080,9 @@ export interface ExitPlanModeCompletedEvent {
4661
6080
  * ISO 8601 timestamp when the event was created
4662
6081
  */
4663
6082
  timestamp: string;
6083
+ /**
6084
+ * Type discriminator. Always "exit_plan_mode.completed".
6085
+ */
4664
6086
  type: "exit_plan_mode.completed";
4665
6087
  }
4666
6088
  /**
@@ -4683,17 +6105,20 @@ export interface ExitPlanModeCompletedData {
4683
6105
  * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request
4684
6106
  */
4685
6107
  requestId: string;
4686
- /**
4687
- * Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only')
4688
- */
4689
- selectedAction?: string;
6108
+ selectedAction?: ExitPlanModeAction;
4690
6109
  }
6110
+ /**
6111
+ * Session event "session.tools_updated".
6112
+ */
4691
6113
  export interface ToolsUpdatedEvent {
4692
6114
  /**
4693
6115
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4694
6116
  */
4695
6117
  agentId?: string;
4696
6118
  data: ToolsUpdatedData;
6119
+ /**
6120
+ * Always true for events that are transient and not persisted to the session event log on disk.
6121
+ */
4697
6122
  ephemeral: true;
4698
6123
  /**
4699
6124
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4707,17 +6132,32 @@ export interface ToolsUpdatedEvent {
4707
6132
  * ISO 8601 timestamp when the event was created
4708
6133
  */
4709
6134
  timestamp: string;
6135
+ /**
6136
+ * Type discriminator. Always "session.tools_updated".
6137
+ */
4710
6138
  type: "session.tools_updated";
4711
6139
  }
6140
+ /**
6141
+ * Schema for the `ToolsUpdatedData` type.
6142
+ */
4712
6143
  export interface ToolsUpdatedData {
6144
+ /**
6145
+ * Identifier of the model the resolved tools apply to.
6146
+ */
4713
6147
  model: string;
4714
6148
  }
6149
+ /**
6150
+ * Session event "session.background_tasks_changed".
6151
+ */
4715
6152
  export interface BackgroundTasksChangedEvent {
4716
6153
  /**
4717
6154
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4718
6155
  */
4719
6156
  agentId?: string;
4720
6157
  data: BackgroundTasksChangedData;
6158
+ /**
6159
+ * Always true for events that are transient and not persisted to the session event log on disk.
6160
+ */
4721
6161
  ephemeral: true;
4722
6162
  /**
4723
6163
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4731,16 +6171,28 @@ export interface BackgroundTasksChangedEvent {
4731
6171
  * ISO 8601 timestamp when the event was created
4732
6172
  */
4733
6173
  timestamp: string;
6174
+ /**
6175
+ * Type discriminator. Always "session.background_tasks_changed".
6176
+ */
4734
6177
  type: "session.background_tasks_changed";
4735
6178
  }
6179
+ /**
6180
+ * Schema for the `BackgroundTasksChangedData` type.
6181
+ */
4736
6182
  export interface BackgroundTasksChangedData {
4737
6183
  }
6184
+ /**
6185
+ * Session event "session.skills_loaded".
6186
+ */
4738
6187
  export interface SkillsLoadedEvent {
4739
6188
  /**
4740
6189
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4741
6190
  */
4742
6191
  agentId?: string;
4743
6192
  data: SkillsLoadedData;
6193
+ /**
6194
+ * Always true for events that are transient and not persisted to the session event log on disk.
6195
+ */
4744
6196
  ephemeral: true;
4745
6197
  /**
4746
6198
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4754,14 +6206,23 @@ export interface SkillsLoadedEvent {
4754
6206
  * ISO 8601 timestamp when the event was created
4755
6207
  */
4756
6208
  timestamp: string;
6209
+ /**
6210
+ * Type discriminator. Always "session.skills_loaded".
6211
+ */
4757
6212
  type: "session.skills_loaded";
4758
6213
  }
6214
+ /**
6215
+ * Schema for the `SkillsLoadedData` type.
6216
+ */
4759
6217
  export interface SkillsLoadedData {
4760
6218
  /**
4761
6219
  * Array of resolved skill metadata
4762
6220
  */
4763
6221
  skills: SkillsLoadedSkill[];
4764
6222
  }
6223
+ /**
6224
+ * Schema for the `SkillsLoadedSkill` type.
6225
+ */
4765
6226
  export interface SkillsLoadedSkill {
4766
6227
  /**
4767
6228
  * Description of what the skill does
@@ -4779,21 +6240,24 @@ export interface SkillsLoadedSkill {
4779
6240
  * Absolute path to the skill file, if available
4780
6241
  */
4781
6242
  path?: string;
4782
- /**
4783
- * Source location type of the skill (e.g., project, personal, plugin)
4784
- */
4785
- source: string;
6243
+ source: SkillSource;
4786
6244
  /**
4787
6245
  * Whether the skill can be invoked by the user as a slash command
4788
6246
  */
4789
6247
  userInvocable: boolean;
4790
6248
  }
6249
+ /**
6250
+ * Session event "session.custom_agents_updated".
6251
+ */
4791
6252
  export interface CustomAgentsUpdatedEvent {
4792
6253
  /**
4793
6254
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4794
6255
  */
4795
6256
  agentId?: string;
4796
6257
  data: CustomAgentsUpdatedData;
6258
+ /**
6259
+ * Always true for events that are transient and not persisted to the session event log on disk.
6260
+ */
4797
6261
  ephemeral: true;
4798
6262
  /**
4799
6263
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4807,8 +6271,14 @@ export interface CustomAgentsUpdatedEvent {
4807
6271
  * ISO 8601 timestamp when the event was created
4808
6272
  */
4809
6273
  timestamp: string;
6274
+ /**
6275
+ * Type discriminator. Always "session.custom_agents_updated".
6276
+ */
4810
6277
  type: "session.custom_agents_updated";
4811
6278
  }
6279
+ /**
6280
+ * Schema for the `CustomAgentsUpdatedData` type.
6281
+ */
4812
6282
  export interface CustomAgentsUpdatedData {
4813
6283
  /**
4814
6284
  * Array of loaded custom agent metadata
@@ -4823,6 +6293,9 @@ export interface CustomAgentsUpdatedData {
4823
6293
  */
4824
6294
  warnings: string[];
4825
6295
  }
6296
+ /**
6297
+ * Schema for the `CustomAgentsUpdatedAgent` type.
6298
+ */
4826
6299
  export interface CustomAgentsUpdatedAgent {
4827
6300
  /**
4828
6301
  * Description of what the agent does
@@ -4849,20 +6322,26 @@ export interface CustomAgentsUpdatedAgent {
4849
6322
  */
4850
6323
  source: string;
4851
6324
  /**
4852
- * List of tool names available to this agent
6325
+ * List of tool names available to this agent, or null when all tools are available
4853
6326
  */
4854
- tools: string[];
6327
+ tools: string[] | null;
4855
6328
  /**
4856
6329
  * Whether the agent can be selected by the user
4857
6330
  */
4858
6331
  userInvocable: boolean;
4859
6332
  }
6333
+ /**
6334
+ * Session event "session.mcp_servers_loaded".
6335
+ */
4860
6336
  export interface McpServersLoadedEvent {
4861
6337
  /**
4862
6338
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4863
6339
  */
4864
6340
  agentId?: string;
4865
6341
  data: McpServersLoadedData;
6342
+ /**
6343
+ * Always true for events that are transient and not persisted to the session event log on disk.
6344
+ */
4866
6345
  ephemeral: true;
4867
6346
  /**
4868
6347
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4876,14 +6355,23 @@ export interface McpServersLoadedEvent {
4876
6355
  * ISO 8601 timestamp when the event was created
4877
6356
  */
4878
6357
  timestamp: string;
6358
+ /**
6359
+ * Type discriminator. Always "session.mcp_servers_loaded".
6360
+ */
4879
6361
  type: "session.mcp_servers_loaded";
4880
6362
  }
6363
+ /**
6364
+ * Schema for the `McpServersLoadedData` type.
6365
+ */
4881
6366
  export interface McpServersLoadedData {
4882
6367
  /**
4883
6368
  * Array of MCP server status summaries
4884
6369
  */
4885
6370
  servers: McpServersLoadedServer[];
4886
6371
  }
6372
+ /**
6373
+ * Schema for the `McpServersLoadedServer` type.
6374
+ */
4887
6375
  export interface McpServersLoadedServer {
4888
6376
  /**
4889
6377
  * Error message if the server failed to connect
@@ -4894,17 +6382,29 @@ export interface McpServersLoadedServer {
4894
6382
  */
4895
6383
  name: string;
4896
6384
  /**
4897
- * Configuration source: user, workspace, plugin, or builtin
6385
+ * Name of the plugin that supplied the effective MCP server config, only when source is plugin
4898
6386
  */
4899
- source?: string;
4900
- status: McpServersLoadedServerStatus;
6387
+ pluginName?: string;
6388
+ /**
6389
+ * Version of the plugin that supplied the effective MCP server config, only when source is plugin
6390
+ */
6391
+ pluginVersion?: string;
6392
+ source?: McpServerSource;
6393
+ status: McpServerStatus;
6394
+ transport?: McpServerTransport;
4901
6395
  }
6396
+ /**
6397
+ * Session event "session.mcp_server_status_changed".
6398
+ */
4902
6399
  export interface McpServerStatusChangedEvent {
4903
6400
  /**
4904
6401
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4905
6402
  */
4906
6403
  agentId?: string;
4907
6404
  data: McpServerStatusChangedData;
6405
+ /**
6406
+ * Always true for events that are transient and not persisted to the session event log on disk.
6407
+ */
4908
6408
  ephemeral: true;
4909
6409
  /**
4910
6410
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4918,21 +6418,37 @@ export interface McpServerStatusChangedEvent {
4918
6418
  * ISO 8601 timestamp when the event was created
4919
6419
  */
4920
6420
  timestamp: string;
6421
+ /**
6422
+ * Type discriminator. Always "session.mcp_server_status_changed".
6423
+ */
4921
6424
  type: "session.mcp_server_status_changed";
4922
6425
  }
6426
+ /**
6427
+ * Schema for the `McpServerStatusChangedData` type.
6428
+ */
4923
6429
  export interface McpServerStatusChangedData {
6430
+ /**
6431
+ * Error message if the server entered a failed state
6432
+ */
6433
+ error?: string;
4924
6434
  /**
4925
6435
  * Name of the MCP server whose status changed
4926
6436
  */
4927
6437
  serverName: string;
4928
- status: McpServerStatusChangedStatus;
6438
+ status: McpServerStatus;
4929
6439
  }
6440
+ /**
6441
+ * Session event "session.extensions_loaded".
6442
+ */
4930
6443
  export interface ExtensionsLoadedEvent {
4931
6444
  /**
4932
6445
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4933
6446
  */
4934
6447
  agentId?: string;
4935
6448
  data: ExtensionsLoadedData;
6449
+ /**
6450
+ * Always true for events that are transient and not persisted to the session event log on disk.
6451
+ */
4936
6452
  ephemeral: true;
4937
6453
  /**
4938
6454
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4946,14 +6462,23 @@ export interface ExtensionsLoadedEvent {
4946
6462
  * ISO 8601 timestamp when the event was created
4947
6463
  */
4948
6464
  timestamp: string;
6465
+ /**
6466
+ * Type discriminator. Always "session.extensions_loaded".
6467
+ */
4949
6468
  type: "session.extensions_loaded";
4950
6469
  }
6470
+ /**
6471
+ * Schema for the `ExtensionsLoadedData` type.
6472
+ */
4951
6473
  export interface ExtensionsLoadedData {
4952
6474
  /**
4953
6475
  * Array of discovered extensions and their status
4954
6476
  */
4955
6477
  extensions: ExtensionsLoadedExtension[];
4956
6478
  }
6479
+ /**
6480
+ * Schema for the `ExtensionsLoadedExtension` type.
6481
+ */
4957
6482
  export interface ExtensionsLoadedExtension {
4958
6483
  /**
4959
6484
  * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')
@@ -4966,3 +6491,265 @@ export interface ExtensionsLoadedExtension {
4966
6491
  source: ExtensionsLoadedExtensionSource;
4967
6492
  status: ExtensionsLoadedExtensionStatus;
4968
6493
  }
6494
+ /**
6495
+ * Session event "session.canvas.opened".
6496
+ */
6497
+ export interface CanvasOpenedEvent {
6498
+ /**
6499
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
6500
+ */
6501
+ agentId?: string;
6502
+ data: CanvasOpenedData;
6503
+ /**
6504
+ * Always true for events that are transient and not persisted to the session event log on disk.
6505
+ */
6506
+ ephemeral: true;
6507
+ /**
6508
+ * Unique event identifier (UUID v4), generated when the event is emitted
6509
+ */
6510
+ id: string;
6511
+ /**
6512
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
6513
+ */
6514
+ parentId: string | null;
6515
+ /**
6516
+ * ISO 8601 timestamp when the event was created
6517
+ */
6518
+ timestamp: string;
6519
+ /**
6520
+ * Type discriminator. Always "session.canvas.opened".
6521
+ */
6522
+ type: "session.canvas.opened";
6523
+ }
6524
+ /**
6525
+ * Schema for the `CanvasOpenedData` type.
6526
+ */
6527
+ export interface CanvasOpenedData {
6528
+ availability: CanvasOpenedAvailability;
6529
+ /**
6530
+ * Provider-local canvas identifier
6531
+ */
6532
+ canvasId: string;
6533
+ /**
6534
+ * Owning provider identifier
6535
+ */
6536
+ extensionId: string;
6537
+ /**
6538
+ * Owning extension display name, when available
6539
+ */
6540
+ extensionName?: string;
6541
+ /**
6542
+ * Input supplied when the instance was opened
6543
+ */
6544
+ input?: {
6545
+ [k: string]: unknown | undefined;
6546
+ };
6547
+ /**
6548
+ * Stable caller-supplied canvas instance identifier
6549
+ */
6550
+ instanceId: string;
6551
+ /**
6552
+ * Whether this notification represents an idempotent reopen
6553
+ */
6554
+ reopen: boolean;
6555
+ /**
6556
+ * Provider-supplied status text
6557
+ */
6558
+ status?: string;
6559
+ /**
6560
+ * Rendered title
6561
+ */
6562
+ title?: string;
6563
+ /**
6564
+ * URL for web-rendered canvases
6565
+ */
6566
+ url?: string;
6567
+ }
6568
+ /**
6569
+ * Session event "session.canvas.registry_changed".
6570
+ */
6571
+ export interface CanvasRegistryChangedEvent {
6572
+ /**
6573
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
6574
+ */
6575
+ agentId?: string;
6576
+ data: CanvasRegistryChangedData;
6577
+ /**
6578
+ * Always true for events that are transient and not persisted to the session event log on disk.
6579
+ */
6580
+ ephemeral: true;
6581
+ /**
6582
+ * Unique event identifier (UUID v4), generated when the event is emitted
6583
+ */
6584
+ id: string;
6585
+ /**
6586
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
6587
+ */
6588
+ parentId: string | null;
6589
+ /**
6590
+ * ISO 8601 timestamp when the event was created
6591
+ */
6592
+ timestamp: string;
6593
+ /**
6594
+ * Type discriminator. Always "session.canvas.registry_changed".
6595
+ */
6596
+ type: "session.canvas.registry_changed";
6597
+ }
6598
+ /**
6599
+ * Schema for the `CanvasRegistryChangedData` type.
6600
+ */
6601
+ export interface CanvasRegistryChangedData {
6602
+ /**
6603
+ * Canvas declarations currently available
6604
+ */
6605
+ canvases: CanvasRegistryChangedCanvas[];
6606
+ }
6607
+ /**
6608
+ * Schema for the `CanvasRegistryChangedCanvas` type.
6609
+ */
6610
+ export interface CanvasRegistryChangedCanvas {
6611
+ /**
6612
+ * Actions the agent or host may invoke
6613
+ */
6614
+ actions?: CanvasRegistryChangedCanvasAction[];
6615
+ /**
6616
+ * Provider-local canvas identifier
6617
+ */
6618
+ canvasId: string;
6619
+ /**
6620
+ * Short, single-sentence description shown to the agent in canvas catalogs.
6621
+ */
6622
+ description: string;
6623
+ /**
6624
+ * Human-readable canvas name
6625
+ */
6626
+ displayName: string;
6627
+ /**
6628
+ * Owning provider identifier
6629
+ */
6630
+ extensionId: string;
6631
+ /**
6632
+ * Owning extension display name, when available
6633
+ */
6634
+ extensionName?: string;
6635
+ /**
6636
+ * JSON Schema for canvas open input
6637
+ */
6638
+ inputSchema?: {
6639
+ [k: string]: unknown | undefined;
6640
+ };
6641
+ }
6642
+ /**
6643
+ * Schema for the `CanvasRegistryChangedCanvasAction` type.
6644
+ */
6645
+ export interface CanvasRegistryChangedCanvasAction {
6646
+ /**
6647
+ * Action description
6648
+ */
6649
+ description?: string;
6650
+ /**
6651
+ * JSON Schema for action input
6652
+ */
6653
+ inputSchema?: {
6654
+ [k: string]: unknown | undefined;
6655
+ };
6656
+ /**
6657
+ * Action name
6658
+ */
6659
+ name: string;
6660
+ }
6661
+ /**
6662
+ * Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865)
6663
+ */
6664
+ export interface McpAppToolCallCompleteEvent {
6665
+ /**
6666
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
6667
+ */
6668
+ agentId?: string;
6669
+ data: McpAppToolCallCompleteData;
6670
+ /**
6671
+ * Always true for events that are transient and not persisted to the session event log on disk.
6672
+ */
6673
+ ephemeral: true;
6674
+ /**
6675
+ * Unique event identifier (UUID v4), generated when the event is emitted
6676
+ */
6677
+ id: string;
6678
+ /**
6679
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
6680
+ */
6681
+ parentId: string | null;
6682
+ /**
6683
+ * ISO 8601 timestamp when the event was created
6684
+ */
6685
+ timestamp: string;
6686
+ /**
6687
+ * Type discriminator. Always "mcp_app.tool_call_complete".
6688
+ */
6689
+ type: "mcp_app.tool_call_complete";
6690
+ }
6691
+ /**
6692
+ * MCP App view called a tool on a connected MCP server (SEP-1865)
6693
+ */
6694
+ export interface McpAppToolCallCompleteData {
6695
+ /**
6696
+ * Arguments passed to the tool by the app view, if any
6697
+ */
6698
+ arguments?: {
6699
+ [k: string]: unknown | undefined;
6700
+ };
6701
+ /**
6702
+ * Wall-clock duration of the underlying tools/call in milliseconds
6703
+ */
6704
+ durationMs: number;
6705
+ error?: McpAppToolCallCompleteError;
6706
+ /**
6707
+ * Standard MCP CallToolResult returned by the server. Present whether or not the call set isError.
6708
+ */
6709
+ result?: {
6710
+ [k: string]: unknown | undefined;
6711
+ };
6712
+ /**
6713
+ * Name of the MCP server hosting the tool
6714
+ */
6715
+ serverName: string;
6716
+ /**
6717
+ * True when the call completed without throwing AND the MCP CallToolResult did not set isError
6718
+ */
6719
+ success: boolean;
6720
+ toolMeta?: McpAppToolCallCompleteToolMeta;
6721
+ /**
6722
+ * MCP tool name that was invoked
6723
+ */
6724
+ toolName: string;
6725
+ }
6726
+ /**
6727
+ * Set when the underlying tools/call threw an error before returning a CallToolResult
6728
+ */
6729
+ export interface McpAppToolCallCompleteError {
6730
+ /**
6731
+ * Human-readable error message
6732
+ */
6733
+ message: string;
6734
+ }
6735
+ /**
6736
+ * The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.
6737
+ */
6738
+ export interface McpAppToolCallCompleteToolMeta {
6739
+ ui?: McpAppToolCallCompleteToolMetaUI;
6740
+ [k: string]: unknown | undefined;
6741
+ }
6742
+ /**
6743
+ * Schema for the `McpAppToolCallCompleteToolMetaUI` type.
6744
+ */
6745
+ export interface McpAppToolCallCompleteToolMetaUI {
6746
+ /**
6747
+ * `ui://` URI declared by the tool's `_meta.ui.resourceUri`
6748
+ */
6749
+ resourceUri?: string;
6750
+ /**
6751
+ * Tool visibility per SEP-1865 (typically a subset of `["model","app"]`)
6752
+ */
6753
+ visibility?: string[];
6754
+ [k: string]: unknown | undefined;
6755
+ }