@github/copilot-sdk 1.0.0-beta.4 → 1.0.0-beta.6

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,84 @@
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 | ScheduleCreatedEvent | ScheduleCancelledEvent | 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 | 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 | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent;
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 session mode the agent is operating in
29
+ */
30
+ export type SessionMode =
31
+ /** The agent is responding interactively to the user. */
32
+ "interactive"
33
+ /** The agent is preparing a plan before making changes. */
34
+ | "plan"
35
+ /** The agent is working autonomously toward task completion. */
36
+ | "autopilot";
10
37
  /**
11
38
  * The type of operation performed on the plan file
12
39
  */
13
- export type PlanChangedOperation = "create" | "update" | "delete";
40
+ export type PlanChangedOperation =
41
+ /** The plan file was created. */
42
+ "create"
43
+ /** The plan file was updated. */
44
+ | "update"
45
+ /** The plan file was deleted. */
46
+ | "delete";
14
47
  /**
15
48
  * Whether the file was newly created or updated
16
49
  */
17
- export type WorkspaceFileChangedOperation = "create" | "update";
50
+ export type WorkspaceFileChangedOperation =
51
+ /** The workspace file was created. */
52
+ "create"
53
+ /** The workspace file was updated. */
54
+ | "update";
18
55
  /**
19
56
  * Origin type of the session being handed off
20
57
  */
21
- export type HandoffSourceType = "remote" | "local";
58
+ export type HandoffSourceType =
59
+ /** The handoff originated from a remote session. */
60
+ "remote"
61
+ /** The handoff originated from a local session. */
62
+ | "local";
22
63
  /**
23
64
  * Whether the session ended normally ("routine") or due to a crash/fatal error ("error")
24
65
  */
25
- export type ShutdownType = "routine" | "error";
66
+ export type ShutdownType =
67
+ /** The session ended normally. */
68
+ "routine"
69
+ /** The session ended because of a crash or fatal error. */
70
+ | "error";
26
71
  /**
27
72
  * The agent mode that was active when this message was sent
28
73
  */
29
- export type UserMessageAgentMode = "interactive" | "plan" | "autopilot" | "shell";
74
+ export type UserMessageAgentMode =
75
+ /** The agent is responding interactively to the user. */
76
+ "interactive"
77
+ /** The agent is preparing a plan before making changes. */
78
+ | "plan"
79
+ /** The agent is working autonomously toward task completion. */
80
+ | "autopilot"
81
+ /** The agent is in shell-focused UI mode. */
82
+ | "shell";
30
83
  /**
31
84
  * A user message attachment — a file, directory, code selection, blob, or GitHub reference
32
85
  */
@@ -34,19 +87,53 @@ export type UserMessageAttachment = UserMessageAttachmentFile | UserMessageAttac
34
87
  /**
35
88
  * Type of GitHub reference
36
89
  */
37
- export type UserMessageAttachmentGithubReferenceType = "issue" | "pr" | "discussion";
90
+ export type UserMessageAttachmentGithubReferenceType =
91
+ /** GitHub issue reference. */
92
+ "issue"
93
+ /** GitHub pull request reference. */
94
+ | "pr"
95
+ /** GitHub discussion reference. */
96
+ | "discussion";
38
97
  /**
39
98
  * Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent.
40
99
  */
41
- export type AssistantMessageToolRequestType = "function" | "custom";
100
+ export type AssistantMessageToolRequestType =
101
+ /** Standard function-style tool call. */
102
+ "function"
103
+ /** Custom grammar-based tool call. */
104
+ | "custom";
105
+ /**
106
+ * API endpoint used for this model call, matching CAPI supported_endpoints vocabulary
107
+ */
108
+ export type AssistantUsageApiEndpoint =
109
+ /** Chat Completions API endpoint. */
110
+ "/chat/completions"
111
+ /** Anthropic Messages API endpoint. */
112
+ | "/v1/messages"
113
+ /** Responses API endpoint. */
114
+ | "/responses"
115
+ /** WebSocket Responses API endpoint. */
116
+ | "ws:/responses";
42
117
  /**
43
118
  * Where the failed model call originated
44
119
  */
45
- export type ModelCallFailureSource = "top_level" | "subagent" | "mcp_sampling";
120
+ export type ModelCallFailureSource =
121
+ /** Model call from the top-level agent. */
122
+ "top_level"
123
+ /** Model call from a sub-agent. */
124
+ | "subagent"
125
+ /** Model call from MCP sampling. */
126
+ | "mcp_sampling";
46
127
  /**
47
128
  * Finite reason code describing why the current turn was aborted
48
129
  */
49
- export type AbortReason = "user_initiated" | "remote_command" | "user_abort";
130
+ export type AbortReason =
131
+ /** The local user requested the abort, for example by pressing Ctrl+C in the CLI. */
132
+ "user_initiated"
133
+ /** A remote command requested the abort. */
134
+ | "remote_command"
135
+ /** An MCP server delivered a user.abort notification. */
136
+ | "user_abort";
50
137
  /**
51
138
  * A content block within a tool result, which may be text, terminal output, image, audio, or a resource
52
139
  */
@@ -54,7 +141,11 @@ export type ToolExecutionCompleteContent = ToolExecutionCompleteContentText | To
54
141
  /**
55
142
  * Theme variant this icon is intended for
56
143
  */
57
- export type ToolExecutionCompleteContentResourceLinkIconTheme = "light" | "dark";
144
+ export type ToolExecutionCompleteContentResourceLinkIconTheme =
145
+ /** Icon intended for light themes. */
146
+ "light"
147
+ /** Icon intended for dark themes. */
148
+ | "dark";
58
149
  /**
59
150
  * The embedded resource contents, either text or base64-encoded binary
60
151
  */
@@ -62,7 +153,11 @@ export type ToolExecutionCompleteContentResourceDetails = EmbeddedTextResourceCo
62
153
  /**
63
154
  * Message role: "system" for system prompts, "developer" for developer-injected instructions
64
155
  */
65
- export type SystemMessageRole = "system" | "developer";
156
+ export type SystemMessageRole =
157
+ /** System prompt message. */
158
+ "system"
159
+ /** Developer instruction message. */
160
+ | "developer";
66
161
  /**
67
162
  * Structured metadata identifying what triggered this notification
68
163
  */
@@ -70,7 +165,11 @@ export type SystemNotification = SystemNotificationAgentCompleted | SystemNotifi
70
165
  /**
71
166
  * Whether the agent completed successfully or failed
72
167
  */
73
- export type SystemNotificationAgentCompletedStatus = "completed" | "failed";
168
+ export type SystemNotificationAgentCompletedStatus =
169
+ /** The agent completed successfully. */
170
+ "completed"
171
+ /** The agent failed. */
172
+ | "failed";
74
173
  /**
75
174
  * Details of the permission being requested
76
175
  */
@@ -78,27 +177,33 @@ export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite
78
177
  /**
79
178
  * Whether this is a store or vote memory operation
80
179
  */
81
- export type PermissionRequestMemoryAction = "store" | "vote";
180
+ export type PermissionRequestMemoryAction =
181
+ /** Store a new memory. */
182
+ "store"
183
+ /** Vote on an existing memory. */
184
+ | "vote";
82
185
  /**
83
186
  * Vote direction (vote only)
84
187
  */
85
- export type PermissionRequestMemoryDirection = "upvote" | "downvote";
188
+ export type PermissionRequestMemoryDirection =
189
+ /** Vote that the memory is useful or accurate. */
190
+ "upvote"
191
+ /** Vote that the memory is incorrect or outdated. */
192
+ | "downvote";
86
193
  /**
87
194
  * Derived user-facing permission prompt details for UI consumers
88
195
  */
89
196
  export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestExtensionPermissionAccess;
90
- /**
91
- * Whether this is a store or vote memory operation
92
- */
93
- export type PermissionPromptRequestMemoryAction = "store" | "vote";
94
- /**
95
- * Vote direction (vote only)
96
- */
97
- export type PermissionPromptRequestMemoryDirection = "upvote" | "downvote";
98
197
  /**
99
198
  * Underlying permission kind that needs path approval
100
199
  */
101
- export type PermissionPromptRequestPathAccessKind = "read" | "shell" | "write";
200
+ export type PermissionPromptRequestPathAccessKind =
201
+ /** Read access to a filesystem path. */
202
+ "read"
203
+ /** Shell command access involving a filesystem path. */
204
+ | "shell"
205
+ /** Write access to a filesystem path. */
206
+ | "write";
102
207
  /**
103
208
  * The result of the permission request
104
209
  */
@@ -110,28 +215,122 @@ export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserTool
110
215
  /**
111
216
  * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent.
112
217
  */
113
- export type ElicitationRequestedMode = "form" | "url";
218
+ export type ElicitationRequestedMode =
219
+ /** Structured form-based elicitation. */
220
+ "form"
221
+ /** Browser URL-based elicitation. */
222
+ | "url";
114
223
  /**
115
224
  * The user action: "accept" (submitted form), "decline" (explicitly refused), or "cancel" (dismissed)
116
225
  */
117
- export type ElicitationCompletedAction = "accept" | "decline" | "cancel";
118
- export type ElicitationCompletedContent = string | number | boolean | string[];
226
+ export type ElicitationCompletedAction =
227
+ /** The user submitted the requested form. */
228
+ "accept"
229
+ /** The user explicitly declined the request. */
230
+ | "decline"
231
+ /** The user dismissed the request. */
232
+ | "cancel";
233
+ /**
234
+ * Schema for the `ElicitationCompletedContent` type.
235
+ */
236
+ export type ElicitationCompletedContent = (string | number | boolean | string[]) | undefined;
237
+ /**
238
+ * Source-defined JSON payload for the custom notification
239
+ */
240
+ export type CustomNotificationPayload = string | number | boolean | null | unknown[] | {
241
+ [k: string]: unknown | undefined;
242
+ };
243
+ /**
244
+ * The user's auto-mode-switch choice
245
+ */
246
+ export type AutoModeSwitchResponse =
247
+ /** Switch models for this request. */
248
+ "yes"
249
+ /** Switch models now and keep using the replacement automatically. */
250
+ | "yes_always"
251
+ /** Do not switch models. */
252
+ | "no";
253
+ /**
254
+ * Exit plan mode action
255
+ */
256
+ export type ExitPlanModeAction =
257
+ /** Exit plan mode without starting implementation. */
258
+ "exit_only"
259
+ /** Exit plan mode and continue in interactive mode. */
260
+ | "interactive"
261
+ /** Exit plan mode and continue autonomously. */
262
+ | "autopilot"
263
+ /** Exit plan mode and continue with parallel autonomous workers. */
264
+ | "autopilot_fleet";
265
+ /**
266
+ * Source location type (e.g., project, personal-copilot, plugin, builtin)
267
+ */
268
+ export type SkillSource =
269
+ /** Skill defined in the current project's skill directories. */
270
+ "project"
271
+ /** Skill discovered from a parent directory in the current workspace tree. */
272
+ | "inherited"
273
+ /** Skill defined in the user's Copilot skill directory. */
274
+ | "personal-copilot"
275
+ /** Skill defined in the user's personal agents skill directory. */
276
+ | "personal-agents"
277
+ /** Skill provided by an installed plugin. */
278
+ | "plugin"
279
+ /** Skill loaded from a configured custom skill directory. */
280
+ | "custom"
281
+ /** Skill bundled with the runtime. */
282
+ | "builtin";
283
+ /**
284
+ * Configuration source: user, workspace, plugin, or builtin
285
+ */
286
+ export type McpServerSource =
287
+ /** Server configured in the user's global MCP configuration. */
288
+ "user"
289
+ /** Server configured by the current workspace. */
290
+ | "workspace"
291
+ /** Server contributed by an installed plugin. */
292
+ | "plugin"
293
+ /** Server bundled with the runtime. */
294
+ | "builtin";
119
295
  /**
120
296
  * Connection status: connected, failed, needs-auth, pending, disabled, or not_configured
121
297
  */
122
- export type McpServersLoadedServerStatus = "connected" | "failed" | "needs-auth" | "pending" | "disabled" | "not_configured";
123
- /**
124
- * New connection status: connected, failed, needs-auth, pending, disabled, or not_configured
125
- */
126
- export type McpServerStatusChangedStatus = "connected" | "failed" | "needs-auth" | "pending" | "disabled" | "not_configured";
298
+ export type McpServerStatus =
299
+ /** The server is connected and available. */
300
+ "connected"
301
+ /** The server failed to connect or initialize. */
302
+ | "failed"
303
+ /** The server requires authentication before it can connect. */
304
+ | "needs-auth"
305
+ /** The server connection is still being established. */
306
+ | "pending"
307
+ /** The server is configured but disabled. */
308
+ | "disabled"
309
+ /** The server is not configured for this session. */
310
+ | "not_configured";
127
311
  /**
128
312
  * Discovery source
129
313
  */
130
- export type ExtensionsLoadedExtensionSource = "project" | "user";
314
+ export type ExtensionsLoadedExtensionSource =
315
+ /** Extension discovered from the current project. */
316
+ "project"
317
+ /** Extension discovered from the user's extension directory. */
318
+ | "user";
131
319
  /**
132
320
  * Current status: running, disabled, failed, or starting
133
321
  */
134
- export type ExtensionsLoadedExtensionStatus = "running" | "disabled" | "failed" | "starting";
322
+ export type ExtensionsLoadedExtensionStatus =
323
+ /** The extension process is running. */
324
+ "running"
325
+ /** The extension is installed but disabled. */
326
+ | "disabled"
327
+ /** The extension failed to start or crashed. */
328
+ | "failed"
329
+ /** The extension process is starting. */
330
+ | "starting";
331
+ /**
332
+ * Session event "session.start". Session initialization metadata including context and configuration
333
+ */
135
334
  export interface StartEvent {
136
335
  /**
137
336
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -154,6 +353,9 @@ export interface StartEvent {
154
353
  * ISO 8601 timestamp when the event was created
155
354
  */
156
355
  timestamp: string;
356
+ /**
357
+ * Type discriminator. Always "session.start".
358
+ */
157
359
  type: "session.start";
158
360
  }
159
361
  /**
@@ -178,11 +380,12 @@ export interface StartData {
178
380
  */
179
381
  producer: string;
180
382
  /**
181
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
383
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
182
384
  */
183
385
  reasoningEffort?: string;
386
+ reasoningSummary?: ReasoningSummary;
184
387
  /**
185
- * Whether this session supports remote steering via Mission Control
388
+ * Whether this session supports remote steering via GitHub
186
389
  */
187
390
  remoteSteerable?: boolean;
188
391
  /**
@@ -236,6 +439,9 @@ export interface WorkingDirectoryContext {
236
439
  */
237
440
  repositoryHost?: string;
238
441
  }
442
+ /**
443
+ * Session event "session.resume". Session resume metadata including current context and event count
444
+ */
239
445
  export interface ResumeEvent {
240
446
  /**
241
447
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -258,6 +464,9 @@ export interface ResumeEvent {
258
464
  * ISO 8601 timestamp when the event was created
259
465
  */
260
466
  timestamp: string;
467
+ /**
468
+ * Type discriminator. Always "session.resume".
469
+ */
261
470
  type: "session.resume";
262
471
  }
263
472
  /**
@@ -278,11 +487,12 @@ export interface ResumeData {
278
487
  */
279
488
  eventCount: number;
280
489
  /**
281
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
490
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
282
491
  */
283
492
  reasoningEffort?: string;
493
+ reasoningSummary?: ReasoningSummary;
284
494
  /**
285
- * Whether this session supports remote steering via Mission Control
495
+ * Whether this session supports remote steering via GitHub
286
496
  */
287
497
  remoteSteerable?: boolean;
288
498
  /**
@@ -298,6 +508,9 @@ export interface ResumeData {
298
508
  */
299
509
  sessionWasActive?: boolean;
300
510
  }
511
+ /**
512
+ * Session event "session.remote_steerable_changed". Notifies that the session's remote steering capability has changed
513
+ */
301
514
  export interface RemoteSteerableChangedEvent {
302
515
  /**
303
516
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -320,17 +533,23 @@ export interface RemoteSteerableChangedEvent {
320
533
  * ISO 8601 timestamp when the event was created
321
534
  */
322
535
  timestamp: string;
536
+ /**
537
+ * Type discriminator. Always "session.remote_steerable_changed".
538
+ */
323
539
  type: "session.remote_steerable_changed";
324
540
  }
325
541
  /**
326
- * Notifies Mission Control that the session's remote steering capability has changed
542
+ * Notifies that the session's remote steering capability has changed
327
543
  */
328
544
  export interface RemoteSteerableChangedData {
329
545
  /**
330
- * Whether this session now supports remote steering via Mission Control
546
+ * Whether this session now supports remote steering via GitHub
331
547
  */
332
548
  remoteSteerable: boolean;
333
549
  }
550
+ /**
551
+ * Session event "session.error". Error details for timeline display including message and optional diagnostic information
552
+ */
334
553
  export interface ErrorEvent {
335
554
  /**
336
555
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -353,6 +572,9 @@ export interface ErrorEvent {
353
572
  * ISO 8601 timestamp when the event was created
354
573
  */
355
574
  timestamp: string;
575
+ /**
576
+ * Type discriminator. Always "session.error".
577
+ */
356
578
  type: "session.error";
357
579
  }
358
580
  /**
@@ -364,7 +586,7 @@ export interface ErrorData {
364
586
  */
365
587
  eligibleForAutoSwitch?: boolean;
366
588
  /**
367
- * 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"`).
589
+ * 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"`).
368
590
  */
369
591
  errorCode?: string;
370
592
  /**
@@ -392,12 +614,18 @@ export interface ErrorData {
392
614
  */
393
615
  url?: string;
394
616
  }
617
+ /**
618
+ * Session event "session.idle". Payload indicating the session is idle with no background agents in flight
619
+ */
395
620
  export interface IdleEvent {
396
621
  /**
397
622
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
398
623
  */
399
624
  agentId?: string;
400
625
  data: IdleData;
626
+ /**
627
+ * Always true for events that are transient and not persisted to the session event log on disk.
628
+ */
401
629
  ephemeral: true;
402
630
  /**
403
631
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -411,6 +639,9 @@ export interface IdleEvent {
411
639
  * ISO 8601 timestamp when the event was created
412
640
  */
413
641
  timestamp: string;
642
+ /**
643
+ * Type discriminator. Always "session.idle".
644
+ */
414
645
  type: "session.idle";
415
646
  }
416
647
  /**
@@ -422,12 +653,18 @@ export interface IdleData {
422
653
  */
423
654
  aborted?: boolean;
424
655
  }
656
+ /**
657
+ * Session event "session.title_changed". Session title change payload containing the new display title
658
+ */
425
659
  export interface TitleChangedEvent {
426
660
  /**
427
661
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
428
662
  */
429
663
  agentId?: string;
430
664
  data: TitleChangedData;
665
+ /**
666
+ * Always true for events that are transient and not persisted to the session event log on disk.
667
+ */
431
668
  ephemeral: true;
432
669
  /**
433
670
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -441,6 +678,9 @@ export interface TitleChangedEvent {
441
678
  * ISO 8601 timestamp when the event was created
442
679
  */
443
680
  timestamp: string;
681
+ /**
682
+ * Type discriminator. Always "session.title_changed".
683
+ */
444
684
  type: "session.title_changed";
445
685
  }
446
686
  /**
@@ -452,6 +692,9 @@ export interface TitleChangedData {
452
692
  */
453
693
  title: string;
454
694
  }
695
+ /**
696
+ * Session event "session.schedule_created". Scheduled prompt registered via /every or /after
697
+ */
455
698
  export interface ScheduleCreatedEvent {
456
699
  /**
457
700
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -474,12 +717,19 @@ export interface ScheduleCreatedEvent {
474
717
  * ISO 8601 timestamp when the event was created
475
718
  */
476
719
  timestamp: string;
720
+ /**
721
+ * Type discriminator. Always "session.schedule_created".
722
+ */
477
723
  type: "session.schedule_created";
478
724
  }
479
725
  /**
480
- * Scheduled prompt registered via /every
726
+ * Scheduled prompt registered via /every or /after
481
727
  */
482
728
  export interface ScheduleCreatedData {
729
+ /**
730
+ * 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)
731
+ */
732
+ displayPrompt?: string;
483
733
  /**
484
734
  * Sequential id assigned to the scheduled prompt within the session
485
735
  */
@@ -492,7 +742,14 @@ export interface ScheduleCreatedData {
492
742
  * Prompt text that gets enqueued on every tick
493
743
  */
494
744
  prompt: string;
745
+ /**
746
+ * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)
747
+ */
748
+ recurring?: boolean;
495
749
  }
750
+ /**
751
+ * Session event "session.schedule_cancelled". Scheduled prompt cancelled from the schedule manager dialog
752
+ */
496
753
  export interface ScheduleCancelledEvent {
497
754
  /**
498
755
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -515,6 +772,9 @@ export interface ScheduleCancelledEvent {
515
772
  * ISO 8601 timestamp when the event was created
516
773
  */
517
774
  timestamp: string;
775
+ /**
776
+ * Type discriminator. Always "session.schedule_cancelled".
777
+ */
518
778
  type: "session.schedule_cancelled";
519
779
  }
520
780
  /**
@@ -526,6 +786,9 @@ export interface ScheduleCancelledData {
526
786
  */
527
787
  id: number;
528
788
  }
789
+ /**
790
+ * Session event "session.info". Informational message for timeline display with categorization
791
+ */
529
792
  export interface InfoEvent {
530
793
  /**
531
794
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -548,6 +811,9 @@ export interface InfoEvent {
548
811
  * ISO 8601 timestamp when the event was created
549
812
  */
550
813
  timestamp: string;
814
+ /**
815
+ * Type discriminator. Always "session.info".
816
+ */
551
817
  type: "session.info";
552
818
  }
553
819
  /**
@@ -571,6 +837,9 @@ export interface InfoData {
571
837
  */
572
838
  url?: string;
573
839
  }
840
+ /**
841
+ * Session event "session.warning". Warning message for timeline display with categorization
842
+ */
574
843
  export interface WarningEvent {
575
844
  /**
576
845
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -593,6 +862,9 @@ export interface WarningEvent {
593
862
  * ISO 8601 timestamp when the event was created
594
863
  */
595
864
  timestamp: string;
865
+ /**
866
+ * Type discriminator. Always "session.warning".
867
+ */
596
868
  type: "session.warning";
597
869
  }
598
870
  /**
@@ -612,6 +884,9 @@ export interface WarningData {
612
884
  */
613
885
  warningType: string;
614
886
  }
887
+ /**
888
+ * Session event "session.model_change". Model change details including previous and new model identifiers
889
+ */
615
890
  export interface ModelChangeEvent {
616
891
  /**
617
892
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -634,6 +909,9 @@ export interface ModelChangeEvent {
634
909
  * ISO 8601 timestamp when the event was created
635
910
  */
636
911
  timestamp: string;
912
+ /**
913
+ * Type discriminator. Always "session.model_change".
914
+ */
637
915
  type: "session.model_change";
638
916
  }
639
917
  /**
@@ -656,11 +934,16 @@ export interface ModelChangeData {
656
934
  * Reasoning effort level before the model change, if applicable
657
935
  */
658
936
  previousReasoningEffort?: string;
937
+ previousReasoningSummary?: ReasoningSummary;
659
938
  /**
660
939
  * Reasoning effort level after the model change, if applicable
661
940
  */
662
- reasoningEffort?: string;
941
+ reasoningEffort?: string | null;
942
+ reasoningSummary?: ReasoningSummary;
663
943
  }
944
+ /**
945
+ * Session event "session.mode_changed". Agent mode change details including previous and new modes
946
+ */
664
947
  export interface ModeChangedEvent {
665
948
  /**
666
949
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -683,21 +966,21 @@ export interface ModeChangedEvent {
683
966
  * ISO 8601 timestamp when the event was created
684
967
  */
685
968
  timestamp: string;
969
+ /**
970
+ * Type discriminator. Always "session.mode_changed".
971
+ */
686
972
  type: "session.mode_changed";
687
973
  }
688
974
  /**
689
975
  * Agent mode change details including previous and new modes
690
976
  */
691
977
  export interface ModeChangedData {
692
- /**
693
- * Agent mode after the change (e.g., "interactive", "plan", "autopilot")
694
- */
695
- newMode: string;
696
- /**
697
- * Agent mode before the change (e.g., "interactive", "plan", "autopilot")
698
- */
699
- previousMode: string;
978
+ newMode: SessionMode;
979
+ previousMode: SessionMode;
700
980
  }
981
+ /**
982
+ * Session event "session.plan_changed". Plan file operation details indicating what changed
983
+ */
701
984
  export interface PlanChangedEvent {
702
985
  /**
703
986
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -720,6 +1003,9 @@ export interface PlanChangedEvent {
720
1003
  * ISO 8601 timestamp when the event was created
721
1004
  */
722
1005
  timestamp: string;
1006
+ /**
1007
+ * Type discriminator. Always "session.plan_changed".
1008
+ */
723
1009
  type: "session.plan_changed";
724
1010
  }
725
1011
  /**
@@ -728,6 +1014,9 @@ export interface PlanChangedEvent {
728
1014
  export interface PlanChangedData {
729
1015
  operation: PlanChangedOperation;
730
1016
  }
1017
+ /**
1018
+ * Session event "session.workspace_file_changed". Workspace file change details including path and operation type
1019
+ */
731
1020
  export interface WorkspaceFileChangedEvent {
732
1021
  /**
733
1022
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -750,6 +1039,9 @@ export interface WorkspaceFileChangedEvent {
750
1039
  * ISO 8601 timestamp when the event was created
751
1040
  */
752
1041
  timestamp: string;
1042
+ /**
1043
+ * Type discriminator. Always "session.workspace_file_changed".
1044
+ */
753
1045
  type: "session.workspace_file_changed";
754
1046
  }
755
1047
  /**
@@ -762,6 +1054,9 @@ export interface WorkspaceFileChangedData {
762
1054
  */
763
1055
  path: string;
764
1056
  }
1057
+ /**
1058
+ * Session event "session.handoff". Session handoff metadata including source, context, and repository information
1059
+ */
765
1060
  export interface HandoffEvent {
766
1061
  /**
767
1062
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -784,6 +1079,9 @@ export interface HandoffEvent {
784
1079
  * ISO 8601 timestamp when the event was created
785
1080
  */
786
1081
  timestamp: string;
1082
+ /**
1083
+ * Type discriminator. Always "session.handoff".
1084
+ */
787
1085
  type: "session.handoff";
788
1086
  }
789
1087
  /**
@@ -830,6 +1128,9 @@ export interface HandoffRepository {
830
1128
  */
831
1129
  owner: string;
832
1130
  }
1131
+ /**
1132
+ * Session event "session.truncation". Conversation truncation statistics including token counts and removed content metrics
1133
+ */
833
1134
  export interface TruncationEvent {
834
1135
  /**
835
1136
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -852,6 +1153,9 @@ export interface TruncationEvent {
852
1153
  * ISO 8601 timestamp when the event was created
853
1154
  */
854
1155
  timestamp: string;
1156
+ /**
1157
+ * Type discriminator. Always "session.truncation".
1158
+ */
855
1159
  type: "session.truncation";
856
1160
  }
857
1161
  /**
@@ -891,12 +1195,18 @@ export interface TruncationData {
891
1195
  */
892
1196
  tokensRemovedDuringTruncation: number;
893
1197
  }
1198
+ /**
1199
+ * Session event "session.snapshot_rewind". Session rewind details including target event and count of removed events
1200
+ */
894
1201
  export interface SnapshotRewindEvent {
895
1202
  /**
896
1203
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
897
1204
  */
898
1205
  agentId?: string;
899
1206
  data: SnapshotRewindData;
1207
+ /**
1208
+ * Always true for events that are transient and not persisted to the session event log on disk.
1209
+ */
900
1210
  ephemeral: true;
901
1211
  /**
902
1212
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -910,6 +1220,9 @@ export interface SnapshotRewindEvent {
910
1220
  * ISO 8601 timestamp when the event was created
911
1221
  */
912
1222
  timestamp: string;
1223
+ /**
1224
+ * Type discriminator. Always "session.snapshot_rewind".
1225
+ */
913
1226
  type: "session.snapshot_rewind";
914
1227
  }
915
1228
  /**
@@ -925,6 +1238,9 @@ export interface SnapshotRewindData {
925
1238
  */
926
1239
  upToEventId: string;
927
1240
  }
1241
+ /**
1242
+ * Session event "session.shutdown". Session termination metrics including usage statistics, code changes, and shutdown reason
1243
+ */
928
1244
  export interface ShutdownEvent {
929
1245
  /**
930
1246
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -947,6 +1263,9 @@ export interface ShutdownEvent {
947
1263
  * ISO 8601 timestamp when the event was created
948
1264
  */
949
1265
  timestamp: string;
1266
+ /**
1267
+ * Type discriminator. Always "session.shutdown".
1268
+ */
950
1269
  type: "session.shutdown";
951
1270
  }
952
1271
  /**
@@ -974,7 +1293,7 @@ export interface ShutdownData {
974
1293
  * Per-model usage breakdown, keyed by model identifier
975
1294
  */
976
1295
  modelMetrics: {
977
- [k: string]: ShutdownModelMetric;
1296
+ [k: string]: ShutdownModelMetric | undefined;
978
1297
  };
979
1298
  /**
980
1299
  * Unix timestamp (milliseconds) when the session started
@@ -989,7 +1308,7 @@ export interface ShutdownData {
989
1308
  * Session-wide per-token-type accumulated token counts
990
1309
  */
991
1310
  tokenDetails?: {
992
- [k: string]: ShutdownTokenDetail;
1311
+ [k: string]: ShutdownTokenDetail | undefined;
993
1312
  };
994
1313
  /**
995
1314
  * Tool definitions token count at shutdown
@@ -1006,7 +1325,7 @@ export interface ShutdownData {
1006
1325
  /**
1007
1326
  * Total number of premium API requests used during the session
1008
1327
  */
1009
- totalPremiumRequests: number;
1328
+ totalPremiumRequests?: number;
1010
1329
  }
1011
1330
  /**
1012
1331
  * Aggregate code change metrics for the session
@@ -1025,13 +1344,16 @@ export interface ShutdownCodeChanges {
1025
1344
  */
1026
1345
  linesRemoved: number;
1027
1346
  }
1347
+ /**
1348
+ * Schema for the `ShutdownModelMetric` type.
1349
+ */
1028
1350
  export interface ShutdownModelMetric {
1029
1351
  requests: ShutdownModelMetricRequests;
1030
1352
  /**
1031
1353
  * Token count details per type
1032
1354
  */
1033
1355
  tokenDetails?: {
1034
- [k: string]: ShutdownModelMetricTokenDetail;
1356
+ [k: string]: ShutdownModelMetricTokenDetail | undefined;
1035
1357
  };
1036
1358
  /**
1037
1359
  * Accumulated nano-AI units cost for this model
@@ -1046,12 +1368,15 @@ export interface ShutdownModelMetricRequests {
1046
1368
  /**
1047
1369
  * Cumulative cost multiplier for requests to this model
1048
1370
  */
1049
- cost: number;
1371
+ cost?: number;
1050
1372
  /**
1051
1373
  * Total number of API requests made to this model
1052
1374
  */
1053
- count: number;
1375
+ count?: number;
1054
1376
  }
1377
+ /**
1378
+ * Schema for the `ShutdownModelMetricTokenDetail` type.
1379
+ */
1055
1380
  export interface ShutdownModelMetricTokenDetail {
1056
1381
  /**
1057
1382
  * Accumulated token count for this token type
@@ -1083,12 +1408,18 @@ export interface ShutdownModelMetricUsage {
1083
1408
  */
1084
1409
  reasoningTokens?: number;
1085
1410
  }
1411
+ /**
1412
+ * Schema for the `ShutdownTokenDetail` type.
1413
+ */
1086
1414
  export interface ShutdownTokenDetail {
1087
1415
  /**
1088
1416
  * Accumulated token count for this token type
1089
1417
  */
1090
1418
  tokenCount: number;
1091
1419
  }
1420
+ /**
1421
+ * Session event "session.context_changed". Updated working directory and git context after the change
1422
+ */
1092
1423
  export interface ContextChangedEvent {
1093
1424
  /**
1094
1425
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1111,14 +1442,23 @@ export interface ContextChangedEvent {
1111
1442
  * ISO 8601 timestamp when the event was created
1112
1443
  */
1113
1444
  timestamp: string;
1445
+ /**
1446
+ * Type discriminator. Always "session.context_changed".
1447
+ */
1114
1448
  type: "session.context_changed";
1115
1449
  }
1450
+ /**
1451
+ * Session event "session.usage_info". Current context window usage statistics including token and message counts
1452
+ */
1116
1453
  export interface UsageInfoEvent {
1117
1454
  /**
1118
1455
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1119
1456
  */
1120
1457
  agentId?: string;
1121
1458
  data: UsageInfoData;
1459
+ /**
1460
+ * Always true for events that are transient and not persisted to the session event log on disk.
1461
+ */
1122
1462
  ephemeral: true;
1123
1463
  /**
1124
1464
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1132,6 +1472,9 @@ export interface UsageInfoEvent {
1132
1472
  * ISO 8601 timestamp when the event was created
1133
1473
  */
1134
1474
  timestamp: string;
1475
+ /**
1476
+ * Type discriminator. Always "session.usage_info".
1477
+ */
1135
1478
  type: "session.usage_info";
1136
1479
  }
1137
1480
  /**
@@ -1167,6 +1510,9 @@ export interface UsageInfoData {
1167
1510
  */
1168
1511
  toolDefinitionsTokens?: number;
1169
1512
  }
1513
+ /**
1514
+ * Session event "session.compaction_start". Context window breakdown at the start of LLM-powered conversation compaction
1515
+ */
1170
1516
  export interface CompactionStartEvent {
1171
1517
  /**
1172
1518
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1189,6 +1535,9 @@ export interface CompactionStartEvent {
1189
1535
  * ISO 8601 timestamp when the event was created
1190
1536
  */
1191
1537
  timestamp: string;
1538
+ /**
1539
+ * Type discriminator. Always "session.compaction_start".
1540
+ */
1192
1541
  type: "session.compaction_start";
1193
1542
  }
1194
1543
  /**
@@ -1208,6 +1557,9 @@ export interface CompactionStartData {
1208
1557
  */
1209
1558
  toolDefinitionsTokens?: number;
1210
1559
  }
1560
+ /**
1561
+ * Session event "session.compaction_complete". Conversation compaction results including success status, metrics, and optional error details
1562
+ */
1211
1563
  export interface CompactionCompleteEvent {
1212
1564
  /**
1213
1565
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1230,6 +1582,9 @@ export interface CompactionCompleteEvent {
1230
1582
  * ISO 8601 timestamp when the event was created
1231
1583
  */
1232
1584
  timestamp: string;
1585
+ /**
1586
+ * Type discriminator. Always "session.compaction_complete".
1587
+ */
1233
1588
  type: "session.compaction_complete";
1234
1589
  }
1235
1590
  /**
@@ -1249,6 +1604,10 @@ export interface CompactionCompleteData {
1249
1604
  * Token count from non-system messages (user, assistant, tool) after compaction
1250
1605
  */
1251
1606
  conversationTokens?: number;
1607
+ /**
1608
+ * User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text.
1609
+ */
1610
+ customInstructions?: string;
1252
1611
  /**
1253
1612
  * Error message if compaction failed
1254
1613
  */
@@ -1358,6 +1717,9 @@ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail {
1358
1717
  */
1359
1718
  tokenType: string;
1360
1719
  }
1720
+ /**
1721
+ * Session event "session.task_complete". Task completion notification with summary from the agent
1722
+ */
1361
1723
  export interface TaskCompleteEvent {
1362
1724
  /**
1363
1725
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1380,6 +1742,9 @@ export interface TaskCompleteEvent {
1380
1742
  * ISO 8601 timestamp when the event was created
1381
1743
  */
1382
1744
  timestamp: string;
1745
+ /**
1746
+ * Type discriminator. Always "session.task_complete".
1747
+ */
1383
1748
  type: "session.task_complete";
1384
1749
  }
1385
1750
  /**
@@ -1395,6 +1760,9 @@ export interface TaskCompleteData {
1395
1760
  */
1396
1761
  summary?: string;
1397
1762
  }
1763
+ /**
1764
+ * Session event "user.message".
1765
+ */
1398
1766
  export interface UserMessageEvent {
1399
1767
  /**
1400
1768
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1417,8 +1785,14 @@ export interface UserMessageEvent {
1417
1785
  * ISO 8601 timestamp when the event was created
1418
1786
  */
1419
1787
  timestamp: string;
1788
+ /**
1789
+ * Type discriminator. Always "user.message".
1790
+ */
1420
1791
  type: "user.message";
1421
1792
  }
1793
+ /**
1794
+ * Schema for the `UserMessageData` type.
1795
+ */
1422
1796
  export interface UserMessageData {
1423
1797
  agentMode?: UserMessageAgentMode;
1424
1798
  /**
@@ -1434,7 +1808,11 @@ export interface UserMessageData {
1434
1808
  */
1435
1809
  interactionId?: string;
1436
1810
  /**
1437
- * Path-backed native document attachments that stayed on the tagged_files path flow because native upload would exceed the request size limit
1811
+ * 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.
1812
+ */
1813
+ isAutopilotContinuation?: boolean;
1814
+ /**
1815
+ * 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
1438
1816
  */
1439
1817
  nativeDocumentPathFallbackPaths?: string[];
1440
1818
  /**
@@ -1604,12 +1982,18 @@ export interface UserMessageAttachmentBlob {
1604
1982
  */
1605
1983
  type: "blob";
1606
1984
  }
1985
+ /**
1986
+ * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
1987
+ */
1607
1988
  export interface PendingMessagesModifiedEvent {
1608
1989
  /**
1609
1990
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1610
1991
  */
1611
1992
  agentId?: string;
1612
1993
  data: PendingMessagesModifiedData;
1994
+ /**
1995
+ * Always true for events that are transient and not persisted to the session event log on disk.
1996
+ */
1613
1997
  ephemeral: true;
1614
1998
  /**
1615
1999
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1623,6 +2007,9 @@ export interface PendingMessagesModifiedEvent {
1623
2007
  * ISO 8601 timestamp when the event was created
1624
2008
  */
1625
2009
  timestamp: string;
2010
+ /**
2011
+ * Type discriminator. Always "pending_messages.modified".
2012
+ */
1626
2013
  type: "pending_messages.modified";
1627
2014
  }
1628
2015
  /**
@@ -1630,6 +2017,9 @@ export interface PendingMessagesModifiedEvent {
1630
2017
  */
1631
2018
  export interface PendingMessagesModifiedData {
1632
2019
  }
2020
+ /**
2021
+ * Session event "assistant.turn_start". Turn initialization metadata including identifier and interaction tracking
2022
+ */
1633
2023
  export interface AssistantTurnStartEvent {
1634
2024
  /**
1635
2025
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1652,6 +2042,9 @@ export interface AssistantTurnStartEvent {
1652
2042
  * ISO 8601 timestamp when the event was created
1653
2043
  */
1654
2044
  timestamp: string;
2045
+ /**
2046
+ * Type discriminator. Always "assistant.turn_start".
2047
+ */
1655
2048
  type: "assistant.turn_start";
1656
2049
  }
1657
2050
  /**
@@ -1667,12 +2060,18 @@ export interface AssistantTurnStartData {
1667
2060
  */
1668
2061
  turnId: string;
1669
2062
  }
2063
+ /**
2064
+ * Session event "assistant.intent". Agent intent description for current activity or plan
2065
+ */
1670
2066
  export interface AssistantIntentEvent {
1671
2067
  /**
1672
2068
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1673
2069
  */
1674
2070
  agentId?: string;
1675
2071
  data: AssistantIntentData;
2072
+ /**
2073
+ * Always true for events that are transient and not persisted to the session event log on disk.
2074
+ */
1676
2075
  ephemeral: true;
1677
2076
  /**
1678
2077
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1686,6 +2085,9 @@ export interface AssistantIntentEvent {
1686
2085
  * ISO 8601 timestamp when the event was created
1687
2086
  */
1688
2087
  timestamp: string;
2088
+ /**
2089
+ * Type discriminator. Always "assistant.intent".
2090
+ */
1689
2091
  type: "assistant.intent";
1690
2092
  }
1691
2093
  /**
@@ -1697,6 +2099,9 @@ export interface AssistantIntentData {
1697
2099
  */
1698
2100
  intent: string;
1699
2101
  }
2102
+ /**
2103
+ * Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text
2104
+ */
1700
2105
  export interface AssistantReasoningEvent {
1701
2106
  /**
1702
2107
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1719,6 +2124,9 @@ export interface AssistantReasoningEvent {
1719
2124
  * ISO 8601 timestamp when the event was created
1720
2125
  */
1721
2126
  timestamp: string;
2127
+ /**
2128
+ * Type discriminator. Always "assistant.reasoning".
2129
+ */
1722
2130
  type: "assistant.reasoning";
1723
2131
  }
1724
2132
  /**
@@ -1734,12 +2142,18 @@ export interface AssistantReasoningData {
1734
2142
  */
1735
2143
  reasoningId: string;
1736
2144
  }
2145
+ /**
2146
+ * Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates
2147
+ */
1737
2148
  export interface AssistantReasoningDeltaEvent {
1738
2149
  /**
1739
2150
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1740
2151
  */
1741
2152
  agentId?: string;
1742
2153
  data: AssistantReasoningDeltaData;
2154
+ /**
2155
+ * Always true for events that are transient and not persisted to the session event log on disk.
2156
+ */
1743
2157
  ephemeral: true;
1744
2158
  /**
1745
2159
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1753,6 +2167,9 @@ export interface AssistantReasoningDeltaEvent {
1753
2167
  * ISO 8601 timestamp when the event was created
1754
2168
  */
1755
2169
  timestamp: string;
2170
+ /**
2171
+ * Type discriminator. Always "assistant.reasoning_delta".
2172
+ */
1756
2173
  type: "assistant.reasoning_delta";
1757
2174
  }
1758
2175
  /**
@@ -1768,12 +2185,18 @@ export interface AssistantReasoningDeltaData {
1768
2185
  */
1769
2186
  reasoningId: string;
1770
2187
  }
2188
+ /**
2189
+ * Session event "assistant.streaming_delta". Streaming response progress with cumulative byte count
2190
+ */
1771
2191
  export interface AssistantStreamingDeltaEvent {
1772
2192
  /**
1773
2193
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1774
2194
  */
1775
2195
  agentId?: string;
1776
2196
  data: AssistantStreamingDeltaData;
2197
+ /**
2198
+ * Always true for events that are transient and not persisted to the session event log on disk.
2199
+ */
1777
2200
  ephemeral: true;
1778
2201
  /**
1779
2202
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1787,6 +2210,9 @@ export interface AssistantStreamingDeltaEvent {
1787
2210
  * ISO 8601 timestamp when the event was created
1788
2211
  */
1789
2212
  timestamp: string;
2213
+ /**
2214
+ * Type discriminator. Always "assistant.streaming_delta".
2215
+ */
1790
2216
  type: "assistant.streaming_delta";
1791
2217
  }
1792
2218
  /**
@@ -1798,6 +2224,9 @@ export interface AssistantStreamingDeltaData {
1798
2224
  */
1799
2225
  totalResponseSizeBytes: number;
1800
2226
  }
2227
+ /**
2228
+ * Session event "assistant.message". Assistant response containing text content, optional tool requests, and interaction metadata
2229
+ */
1801
2230
  export interface AssistantMessageEvent {
1802
2231
  /**
1803
2232
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1820,6 +2249,9 @@ export interface AssistantMessageEvent {
1820
2249
  * ISO 8601 timestamp when the event was created
1821
2250
  */
1822
2251
  timestamp: string;
2252
+ /**
2253
+ * Type discriminator. Always "assistant.message".
2254
+ */
1823
2255
  type: "assistant.message";
1824
2256
  }
1825
2257
  /**
@@ -1829,7 +2261,9 @@ export interface AssistantMessageData {
1829
2261
  /**
1830
2262
  * Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping
1831
2263
  */
1832
- anthropicAdvisorBlocks?: unknown[];
2264
+ anthropicAdvisorBlocks?: {
2265
+ [k: string]: unknown | undefined;
2266
+ }[];
1833
2267
  /**
1834
2268
  * Anthropic advisor model ID used for this response, for timeline display on replay
1835
2269
  */
@@ -1896,7 +2330,7 @@ export interface AssistantMessageToolRequest {
1896
2330
  * Arguments to pass to the tool, format depends on the tool
1897
2331
  */
1898
2332
  arguments?: {
1899
- [k: string]: unknown;
2333
+ [k: string]: unknown | undefined;
1900
2334
  };
1901
2335
  /**
1902
2336
  * Resolved intention summary describing what this specific call does
@@ -1924,12 +2358,18 @@ export interface AssistantMessageToolRequest {
1924
2358
  toolTitle?: string;
1925
2359
  type?: AssistantMessageToolRequestType;
1926
2360
  }
2361
+ /**
2362
+ * Session event "assistant.message_start". Streaming assistant message start metadata
2363
+ */
1927
2364
  export interface AssistantMessageStartEvent {
1928
2365
  /**
1929
2366
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1930
2367
  */
1931
2368
  agentId?: string;
1932
2369
  data: AssistantMessageStartData;
2370
+ /**
2371
+ * Always true for events that are transient and not persisted to the session event log on disk.
2372
+ */
1933
2373
  ephemeral: true;
1934
2374
  /**
1935
2375
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1943,6 +2383,9 @@ export interface AssistantMessageStartEvent {
1943
2383
  * ISO 8601 timestamp when the event was created
1944
2384
  */
1945
2385
  timestamp: string;
2386
+ /**
2387
+ * Type discriminator. Always "assistant.message_start".
2388
+ */
1946
2389
  type: "assistant.message_start";
1947
2390
  }
1948
2391
  /**
@@ -1958,12 +2401,18 @@ export interface AssistantMessageStartData {
1958
2401
  */
1959
2402
  phase?: string;
1960
2403
  }
2404
+ /**
2405
+ * Session event "assistant.message_delta". Streaming assistant message delta for incremental response updates
2406
+ */
1961
2407
  export interface AssistantMessageDeltaEvent {
1962
2408
  /**
1963
2409
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1964
2410
  */
1965
2411
  agentId?: string;
1966
2412
  data: AssistantMessageDeltaData;
2413
+ /**
2414
+ * Always true for events that are transient and not persisted to the session event log on disk.
2415
+ */
1967
2416
  ephemeral: true;
1968
2417
  /**
1969
2418
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1977,6 +2426,9 @@ export interface AssistantMessageDeltaEvent {
1977
2426
  * ISO 8601 timestamp when the event was created
1978
2427
  */
1979
2428
  timestamp: string;
2429
+ /**
2430
+ * Type discriminator. Always "assistant.message_delta".
2431
+ */
1980
2432
  type: "assistant.message_delta";
1981
2433
  }
1982
2434
  /**
@@ -1997,6 +2449,9 @@ export interface AssistantMessageDeltaData {
1997
2449
  */
1998
2450
  parentToolCallId?: string;
1999
2451
  }
2452
+ /**
2453
+ * Session event "assistant.turn_end". Turn completion metadata including the turn identifier
2454
+ */
2000
2455
  export interface AssistantTurnEndEvent {
2001
2456
  /**
2002
2457
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2019,6 +2474,9 @@ export interface AssistantTurnEndEvent {
2019
2474
  * ISO 8601 timestamp when the event was created
2020
2475
  */
2021
2476
  timestamp: string;
2477
+ /**
2478
+ * Type discriminator. Always "assistant.turn_end".
2479
+ */
2022
2480
  type: "assistant.turn_end";
2023
2481
  }
2024
2482
  /**
@@ -2030,12 +2488,18 @@ export interface AssistantTurnEndData {
2030
2488
  */
2031
2489
  turnId: string;
2032
2490
  }
2491
+ /**
2492
+ * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information
2493
+ */
2033
2494
  export interface AssistantUsageEvent {
2034
2495
  /**
2035
2496
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2036
2497
  */
2037
2498
  agentId?: string;
2038
2499
  data: AssistantUsageData;
2500
+ /**
2501
+ * Always true for events that are transient and not persisted to the session event log on disk.
2502
+ */
2039
2503
  ephemeral: true;
2040
2504
  /**
2041
2505
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2049,6 +2513,9 @@ export interface AssistantUsageEvent {
2049
2513
  * ISO 8601 timestamp when the event was created
2050
2514
  */
2051
2515
  timestamp: string;
2516
+ /**
2517
+ * Type discriminator. Always "assistant.usage".
2518
+ */
2052
2519
  type: "assistant.usage";
2053
2520
  }
2054
2521
  /**
@@ -2059,6 +2526,7 @@ export interface AssistantUsageData {
2059
2526
  * Completion ID from the model provider (e.g., chatcmpl-abc123)
2060
2527
  */
2061
2528
  apiCallId?: string;
2529
+ apiEndpoint?: AssistantUsageApiEndpoint;
2062
2530
  /**
2063
2531
  * Number of tokens read from prompt cache
2064
2532
  */
@@ -2109,10 +2577,10 @@ export interface AssistantUsageData {
2109
2577
  * Per-quota resource usage snapshots, keyed by quota identifier
2110
2578
  */
2111
2579
  quotaSnapshots?: {
2112
- [k: string]: AssistantUsageQuotaSnapshot;
2580
+ [k: string]: AssistantUsageQuotaSnapshot | undefined;
2113
2581
  };
2114
2582
  /**
2115
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
2583
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
2116
2584
  */
2117
2585
  reasoningEffort?: string;
2118
2586
  /**
@@ -2122,7 +2590,7 @@ export interface AssistantUsageData {
2122
2590
  /**
2123
2591
  * Time to first token in milliseconds. Only available for streaming requests
2124
2592
  */
2125
- ttftMs?: number;
2593
+ timeToFirstTokenMs?: number;
2126
2594
  }
2127
2595
  /**
2128
2596
  * Per-request cost and usage data from the CAPI copilot_usage response field
@@ -2158,6 +2626,9 @@ export interface AssistantUsageCopilotUsageTokenDetail {
2158
2626
  */
2159
2627
  tokenType: string;
2160
2628
  }
2629
+ /**
2630
+ * Schema for the `AssistantUsageQuotaSnapshot` type.
2631
+ */
2161
2632
  export interface AssistantUsageQuotaSnapshot {
2162
2633
  /**
2163
2634
  * Total requests allowed by the entitlement
@@ -2168,15 +2639,15 @@ export interface AssistantUsageQuotaSnapshot {
2168
2639
  */
2169
2640
  isUnlimitedEntitlement: boolean;
2170
2641
  /**
2171
- * Number of requests over the entitlement limit
2642
+ * Number of additional usage requests made this period
2172
2643
  */
2173
2644
  overage: number;
2174
2645
  /**
2175
- * Whether overage is allowed when quota is exhausted
2646
+ * Whether additional usage is allowed when quota is exhausted
2176
2647
  */
2177
2648
  overageAllowedWithExhaustedQuota: boolean;
2178
2649
  /**
2179
- * Percentage of quota remaining (0.0 to 1.0)
2650
+ * Percentage of quota remaining (0 to 100)
2180
2651
  */
2181
2652
  remainingPercentage: number;
2182
2653
  /**
@@ -2192,12 +2663,18 @@ export interface AssistantUsageQuotaSnapshot {
2192
2663
  */
2193
2664
  usedRequests: number;
2194
2665
  }
2666
+ /**
2667
+ * Session event "model.call_failure". Failed LLM API call metadata for telemetry
2668
+ */
2195
2669
  export interface ModelCallFailureEvent {
2196
2670
  /**
2197
2671
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2198
2672
  */
2199
2673
  agentId?: string;
2200
2674
  data: ModelCallFailureData;
2675
+ /**
2676
+ * Always true for events that are transient and not persisted to the session event log on disk.
2677
+ */
2201
2678
  ephemeral: true;
2202
2679
  /**
2203
2680
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2211,6 +2688,9 @@ export interface ModelCallFailureEvent {
2211
2688
  * ISO 8601 timestamp when the event was created
2212
2689
  */
2213
2690
  timestamp: string;
2691
+ /**
2692
+ * Type discriminator. Always "model.call_failure".
2693
+ */
2214
2694
  type: "model.call_failure";
2215
2695
  }
2216
2696
  /**
@@ -2247,6 +2727,9 @@ export interface ModelCallFailureData {
2247
2727
  */
2248
2728
  statusCode?: number;
2249
2729
  }
2730
+ /**
2731
+ * Session event "abort". Turn abort information including the reason for termination
2732
+ */
2250
2733
  export interface AbortEvent {
2251
2734
  /**
2252
2735
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2269,6 +2752,9 @@ export interface AbortEvent {
2269
2752
  * ISO 8601 timestamp when the event was created
2270
2753
  */
2271
2754
  timestamp: string;
2755
+ /**
2756
+ * Type discriminator. Always "abort".
2757
+ */
2272
2758
  type: "abort";
2273
2759
  }
2274
2760
  /**
@@ -2277,6 +2763,9 @@ export interface AbortEvent {
2277
2763
  export interface AbortData {
2278
2764
  reason: AbortReason;
2279
2765
  }
2766
+ /**
2767
+ * Session event "tool.user_requested". User-initiated tool invocation request with tool name and arguments
2768
+ */
2280
2769
  export interface ToolUserRequestedEvent {
2281
2770
  /**
2282
2771
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2299,6 +2788,9 @@ export interface ToolUserRequestedEvent {
2299
2788
  * ISO 8601 timestamp when the event was created
2300
2789
  */
2301
2790
  timestamp: string;
2791
+ /**
2792
+ * Type discriminator. Always "tool.user_requested".
2793
+ */
2302
2794
  type: "tool.user_requested";
2303
2795
  }
2304
2796
  /**
@@ -2309,7 +2801,7 @@ export interface ToolUserRequestedData {
2309
2801
  * Arguments for the tool invocation
2310
2802
  */
2311
2803
  arguments?: {
2312
- [k: string]: unknown;
2804
+ [k: string]: unknown | undefined;
2313
2805
  };
2314
2806
  /**
2315
2807
  * Unique identifier for this tool call
@@ -2320,6 +2812,9 @@ export interface ToolUserRequestedData {
2320
2812
  */
2321
2813
  toolName: string;
2322
2814
  }
2815
+ /**
2816
+ * Session event "tool.execution_start". Tool execution startup details including MCP server information when applicable
2817
+ */
2323
2818
  export interface ToolExecutionStartEvent {
2324
2819
  /**
2325
2820
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2342,6 +2837,9 @@ export interface ToolExecutionStartEvent {
2342
2837
  * ISO 8601 timestamp when the event was created
2343
2838
  */
2344
2839
  timestamp: string;
2840
+ /**
2841
+ * Type discriminator. Always "tool.execution_start".
2842
+ */
2345
2843
  type: "tool.execution_start";
2346
2844
  }
2347
2845
  /**
@@ -2352,7 +2850,7 @@ export interface ToolExecutionStartData {
2352
2850
  * Arguments passed to the tool
2353
2851
  */
2354
2852
  arguments?: {
2355
- [k: string]: unknown;
2853
+ [k: string]: unknown | undefined;
2356
2854
  };
2357
2855
  /**
2358
2856
  * Name of the MCP server hosting this tool, when the tool is an MCP tool
@@ -2380,12 +2878,18 @@ export interface ToolExecutionStartData {
2380
2878
  */
2381
2879
  turnId?: string;
2382
2880
  }
2881
+ /**
2882
+ * Session event "tool.execution_partial_result". Streaming tool execution output for incremental result display
2883
+ */
2383
2884
  export interface ToolExecutionPartialResultEvent {
2384
2885
  /**
2385
2886
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2386
2887
  */
2387
2888
  agentId?: string;
2388
2889
  data: ToolExecutionPartialData;
2890
+ /**
2891
+ * Always true for events that are transient and not persisted to the session event log on disk.
2892
+ */
2389
2893
  ephemeral: true;
2390
2894
  /**
2391
2895
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2399,6 +2903,9 @@ export interface ToolExecutionPartialResultEvent {
2399
2903
  * ISO 8601 timestamp when the event was created
2400
2904
  */
2401
2905
  timestamp: string;
2906
+ /**
2907
+ * Type discriminator. Always "tool.execution_partial_result".
2908
+ */
2402
2909
  type: "tool.execution_partial_result";
2403
2910
  }
2404
2911
  /**
@@ -2414,12 +2921,18 @@ export interface ToolExecutionPartialData {
2414
2921
  */
2415
2922
  toolCallId: string;
2416
2923
  }
2924
+ /**
2925
+ * Session event "tool.execution_progress". Tool execution progress notification with status message
2926
+ */
2417
2927
  export interface ToolExecutionProgressEvent {
2418
2928
  /**
2419
2929
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2420
2930
  */
2421
2931
  agentId?: string;
2422
2932
  data: ToolExecutionProgressData;
2933
+ /**
2934
+ * Always true for events that are transient and not persisted to the session event log on disk.
2935
+ */
2423
2936
  ephemeral: true;
2424
2937
  /**
2425
2938
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2433,6 +2946,9 @@ export interface ToolExecutionProgressEvent {
2433
2946
  * ISO 8601 timestamp when the event was created
2434
2947
  */
2435
2948
  timestamp: string;
2949
+ /**
2950
+ * Type discriminator. Always "tool.execution_progress".
2951
+ */
2436
2952
  type: "tool.execution_progress";
2437
2953
  }
2438
2954
  /**
@@ -2448,6 +2964,9 @@ export interface ToolExecutionProgressData {
2448
2964
  */
2449
2965
  toolCallId: string;
2450
2966
  }
2967
+ /**
2968
+ * Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information
2969
+ */
2451
2970
  export interface ToolExecutionCompleteEvent {
2452
2971
  /**
2453
2972
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2470,6 +2989,9 @@ export interface ToolExecutionCompleteEvent {
2470
2989
  * ISO 8601 timestamp when the event was created
2471
2990
  */
2472
2991
  timestamp: string;
2992
+ /**
2993
+ * Type discriminator. Always "tool.execution_complete".
2994
+ */
2473
2995
  type: "tool.execution_complete";
2474
2996
  }
2475
2997
  /**
@@ -2495,6 +3017,10 @@ export interface ToolExecutionCompleteData {
2495
3017
  */
2496
3018
  parentToolCallId?: string;
2497
3019
  result?: ToolExecutionCompleteResult;
3020
+ /**
3021
+ * Whether this tool execution ran inside a sandbox container
3022
+ */
3023
+ sandboxed?: boolean;
2498
3024
  /**
2499
3025
  * Whether the tool execution completed successfully
2500
3026
  */
@@ -2507,7 +3033,9 @@ export interface ToolExecutionCompleteData {
2507
3033
  * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)
2508
3034
  */
2509
3035
  toolTelemetry?: {
2510
- [k: string]: unknown;
3036
+ [k: string]: {
3037
+ [k: string]: unknown | undefined;
3038
+ } | undefined;
2511
3039
  };
2512
3040
  /**
2513
3041
  * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
@@ -2677,6 +3205,9 @@ export interface ToolExecutionCompleteContentResource {
2677
3205
  */
2678
3206
  type: "resource";
2679
3207
  }
3208
+ /**
3209
+ * Schema for the `EmbeddedTextResourceContents` type.
3210
+ */
2680
3211
  export interface EmbeddedTextResourceContents {
2681
3212
  /**
2682
3213
  * MIME type of the text content
@@ -2691,6 +3222,9 @@ export interface EmbeddedTextResourceContents {
2691
3222
  */
2692
3223
  uri: string;
2693
3224
  }
3225
+ /**
3226
+ * Schema for the `EmbeddedBlobResourceContents` type.
3227
+ */
2694
3228
  export interface EmbeddedBlobResourceContents {
2695
3229
  /**
2696
3230
  * Base64-encoded binary content of the resource
@@ -2705,6 +3239,9 @@ export interface EmbeddedBlobResourceContents {
2705
3239
  */
2706
3240
  uri: string;
2707
3241
  }
3242
+ /**
3243
+ * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata
3244
+ */
2708
3245
  export interface SkillInvokedEvent {
2709
3246
  /**
2710
3247
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2727,6 +3264,9 @@ export interface SkillInvokedEvent {
2727
3264
  * ISO 8601 timestamp when the event was created
2728
3265
  */
2729
3266
  timestamp: string;
3267
+ /**
3268
+ * Type discriminator. Always "skill.invoked".
3269
+ */
2730
3270
  type: "skill.invoked";
2731
3271
  }
2732
3272
  /**
@@ -2762,6 +3302,9 @@ export interface SkillInvokedData {
2762
3302
  */
2763
3303
  pluginVersion?: string;
2764
3304
  }
3305
+ /**
3306
+ * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information
3307
+ */
2765
3308
  export interface SubagentStartedEvent {
2766
3309
  /**
2767
3310
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2784,6 +3327,9 @@ export interface SubagentStartedEvent {
2784
3327
  * ISO 8601 timestamp when the event was created
2785
3328
  */
2786
3329
  timestamp: string;
3330
+ /**
3331
+ * Type discriminator. Always "subagent.started".
3332
+ */
2787
3333
  type: "subagent.started";
2788
3334
  }
2789
3335
  /**
@@ -2811,6 +3357,9 @@ export interface SubagentStartedData {
2811
3357
  */
2812
3358
  toolCallId: string;
2813
3359
  }
3360
+ /**
3361
+ * Session event "subagent.completed". Sub-agent completion details for successful execution
3362
+ */
2814
3363
  export interface SubagentCompletedEvent {
2815
3364
  /**
2816
3365
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2833,6 +3382,9 @@ export interface SubagentCompletedEvent {
2833
3382
  * ISO 8601 timestamp when the event was created
2834
3383
  */
2835
3384
  timestamp: string;
3385
+ /**
3386
+ * Type discriminator. Always "subagent.completed".
3387
+ */
2836
3388
  type: "subagent.completed";
2837
3389
  }
2838
3390
  /**
@@ -2868,6 +3420,9 @@ export interface SubagentCompletedData {
2868
3420
  */
2869
3421
  totalToolCalls?: number;
2870
3422
  }
3423
+ /**
3424
+ * Session event "subagent.failed". Sub-agent failure details including error message and agent information
3425
+ */
2871
3426
  export interface SubagentFailedEvent {
2872
3427
  /**
2873
3428
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2890,6 +3445,9 @@ export interface SubagentFailedEvent {
2890
3445
  * ISO 8601 timestamp when the event was created
2891
3446
  */
2892
3447
  timestamp: string;
3448
+ /**
3449
+ * Type discriminator. Always "subagent.failed".
3450
+ */
2893
3451
  type: "subagent.failed";
2894
3452
  }
2895
3453
  /**
@@ -2929,6 +3487,9 @@ export interface SubagentFailedData {
2929
3487
  */
2930
3488
  totalToolCalls?: number;
2931
3489
  }
3490
+ /**
3491
+ * Session event "subagent.selected". Custom agent selection details including name and available tools
3492
+ */
2932
3493
  export interface SubagentSelectedEvent {
2933
3494
  /**
2934
3495
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2951,6 +3512,9 @@ export interface SubagentSelectedEvent {
2951
3512
  * ISO 8601 timestamp when the event was created
2952
3513
  */
2953
3514
  timestamp: string;
3515
+ /**
3516
+ * Type discriminator. Always "subagent.selected".
3517
+ */
2954
3518
  type: "subagent.selected";
2955
3519
  }
2956
3520
  /**
@@ -2970,6 +3534,9 @@ export interface SubagentSelectedData {
2970
3534
  */
2971
3535
  tools: string[] | null;
2972
3536
  }
3537
+ /**
3538
+ * Session event "subagent.deselected". Empty payload; the event signals that the custom agent was deselected, returning to the default agent
3539
+ */
2973
3540
  export interface SubagentDeselectedEvent {
2974
3541
  /**
2975
3542
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2992,6 +3559,9 @@ export interface SubagentDeselectedEvent {
2992
3559
  * ISO 8601 timestamp when the event was created
2993
3560
  */
2994
3561
  timestamp: string;
3562
+ /**
3563
+ * Type discriminator. Always "subagent.deselected".
3564
+ */
2995
3565
  type: "subagent.deselected";
2996
3566
  }
2997
3567
  /**
@@ -2999,6 +3569,9 @@ export interface SubagentDeselectedEvent {
2999
3569
  */
3000
3570
  export interface SubagentDeselectedData {
3001
3571
  }
3572
+ /**
3573
+ * Session event "hook.start". Hook invocation start details including type and input data
3574
+ */
3002
3575
  export interface HookStartEvent {
3003
3576
  /**
3004
3577
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3021,6 +3594,9 @@ export interface HookStartEvent {
3021
3594
  * ISO 8601 timestamp when the event was created
3022
3595
  */
3023
3596
  timestamp: string;
3597
+ /**
3598
+ * Type discriminator. Always "hook.start".
3599
+ */
3024
3600
  type: "hook.start";
3025
3601
  }
3026
3602
  /**
@@ -3039,9 +3615,12 @@ export interface HookStartData {
3039
3615
  * Input data passed to the hook
3040
3616
  */
3041
3617
  input?: {
3042
- [k: string]: unknown;
3618
+ [k: string]: unknown | undefined;
3043
3619
  };
3044
3620
  }
3621
+ /**
3622
+ * Session event "hook.end". Hook invocation completion details including output, success status, and error information
3623
+ */
3045
3624
  export interface HookEndEvent {
3046
3625
  /**
3047
3626
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3064,6 +3643,9 @@ export interface HookEndEvent {
3064
3643
  * ISO 8601 timestamp when the event was created
3065
3644
  */
3066
3645
  timestamp: string;
3646
+ /**
3647
+ * Type discriminator. Always "hook.end".
3648
+ */
3067
3649
  type: "hook.end";
3068
3650
  }
3069
3651
  /**
@@ -3083,7 +3665,7 @@ export interface HookEndData {
3083
3665
  * Output data produced by the hook
3084
3666
  */
3085
3667
  output?: {
3086
- [k: string]: unknown;
3668
+ [k: string]: unknown | undefined;
3087
3669
  };
3088
3670
  /**
3089
3671
  * Whether the hook completed successfully
@@ -3103,6 +3685,9 @@ export interface HookEndError {
3103
3685
  */
3104
3686
  stack?: string;
3105
3687
  }
3688
+ /**
3689
+ * Session event "system.message". System/developer instruction content with role and optional template metadata
3690
+ */
3106
3691
  export interface SystemMessageEvent {
3107
3692
  /**
3108
3693
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3125,6 +3710,9 @@ export interface SystemMessageEvent {
3125
3710
  * ISO 8601 timestamp when the event was created
3126
3711
  */
3127
3712
  timestamp: string;
3713
+ /**
3714
+ * Type discriminator. Always "system.message".
3715
+ */
3128
3716
  type: "system.message";
3129
3717
  }
3130
3718
  /**
@@ -3154,9 +3742,14 @@ export interface SystemMessageMetadata {
3154
3742
  * Template variables used when constructing the prompt
3155
3743
  */
3156
3744
  variables?: {
3157
- [k: string]: unknown;
3745
+ [k: string]: {
3746
+ [k: string]: unknown | undefined;
3747
+ } | undefined;
3158
3748
  };
3159
3749
  }
3750
+ /**
3751
+ * Session event "system.notification". System-generated notification for runtime events like background task completion
3752
+ */
3160
3753
  export interface SystemNotificationEvent {
3161
3754
  /**
3162
3755
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3179,6 +3772,9 @@ export interface SystemNotificationEvent {
3179
3772
  * ISO 8601 timestamp when the event was created
3180
3773
  */
3181
3774
  timestamp: string;
3775
+ /**
3776
+ * Type discriminator. Always "system.notification".
3777
+ */
3182
3778
  type: "system.notification";
3183
3779
  }
3184
3780
  /**
@@ -3191,6 +3787,9 @@ export interface SystemNotificationData {
3191
3787
  content: string;
3192
3788
  kind: SystemNotification;
3193
3789
  }
3790
+ /**
3791
+ * Schema for the `SystemNotificationAgentCompleted` type.
3792
+ */
3194
3793
  export interface SystemNotificationAgentCompleted {
3195
3794
  /**
3196
3795
  * Unique identifier of the background agent
@@ -3209,8 +3808,14 @@ export interface SystemNotificationAgentCompleted {
3209
3808
  */
3210
3809
  prompt?: string;
3211
3810
  status: SystemNotificationAgentCompletedStatus;
3811
+ /**
3812
+ * Type discriminator. Always "agent_completed".
3813
+ */
3212
3814
  type: "agent_completed";
3213
3815
  }
3816
+ /**
3817
+ * Schema for the `SystemNotificationAgentIdle` type.
3818
+ */
3214
3819
  export interface SystemNotificationAgentIdle {
3215
3820
  /**
3216
3821
  * Unique identifier of the background agent
@@ -3224,8 +3829,14 @@ export interface SystemNotificationAgentIdle {
3224
3829
  * Human-readable description of the agent task
3225
3830
  */
3226
3831
  description?: string;
3832
+ /**
3833
+ * Type discriminator. Always "agent_idle".
3834
+ */
3227
3835
  type: "agent_idle";
3228
3836
  }
3837
+ /**
3838
+ * Schema for the `SystemNotificationNewInboxMessage` type.
3839
+ */
3229
3840
  export interface SystemNotificationNewInboxMessage {
3230
3841
  /**
3231
3842
  * Unique identifier of the inbox entry
@@ -3243,8 +3854,14 @@ export interface SystemNotificationNewInboxMessage {
3243
3854
  * Short summary shown before the agent decides whether to read the inbox
3244
3855
  */
3245
3856
  summary: string;
3857
+ /**
3858
+ * Type discriminator. Always "new_inbox_message".
3859
+ */
3246
3860
  type: "new_inbox_message";
3247
3861
  }
3862
+ /**
3863
+ * Schema for the `SystemNotificationShellCompleted` type.
3864
+ */
3248
3865
  export interface SystemNotificationShellCompleted {
3249
3866
  /**
3250
3867
  * Human-readable description of the command
@@ -3258,8 +3875,14 @@ export interface SystemNotificationShellCompleted {
3258
3875
  * Unique identifier of the shell session
3259
3876
  */
3260
3877
  shellId: string;
3878
+ /**
3879
+ * Type discriminator. Always "shell_completed".
3880
+ */
3261
3881
  type: "shell_completed";
3262
3882
  }
3883
+ /**
3884
+ * Schema for the `SystemNotificationShellDetachedCompleted` type.
3885
+ */
3263
3886
  export interface SystemNotificationShellDetachedCompleted {
3264
3887
  /**
3265
3888
  * Human-readable description of the command
@@ -3269,8 +3892,14 @@ export interface SystemNotificationShellDetachedCompleted {
3269
3892
  * Unique identifier of the detached shell session
3270
3893
  */
3271
3894
  shellId: string;
3895
+ /**
3896
+ * Type discriminator. Always "shell_detached_completed".
3897
+ */
3272
3898
  type: "shell_detached_completed";
3273
3899
  }
3900
+ /**
3901
+ * Schema for the `SystemNotificationInstructionDiscovered` type.
3902
+ */
3274
3903
  export interface SystemNotificationInstructionDiscovered {
3275
3904
  /**
3276
3905
  * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/')
@@ -3288,8 +3917,14 @@ export interface SystemNotificationInstructionDiscovered {
3288
3917
  * Tool command that triggered discovery (currently always 'view')
3289
3918
  */
3290
3919
  triggerTool: string;
3920
+ /**
3921
+ * Type discriminator. Always "instruction_discovered".
3922
+ */
3291
3923
  type: "instruction_discovered";
3292
3924
  }
3925
+ /**
3926
+ * Session event "permission.requested". Permission request notification requiring client approval with request details
3927
+ */
3293
3928
  export interface PermissionRequestedEvent {
3294
3929
  /**
3295
3930
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3312,6 +3947,9 @@ export interface PermissionRequestedEvent {
3312
3947
  * ISO 8601 timestamp when the event was created
3313
3948
  */
3314
3949
  timestamp: string;
3950
+ /**
3951
+ * Type discriminator. Always "permission.requested".
3952
+ */
3315
3953
  type: "permission.requested";
3316
3954
  }
3317
3955
  /**
@@ -3374,6 +4012,9 @@ export interface PermissionRequestShell {
3374
4012
  */
3375
4013
  warning?: string;
3376
4014
  }
4015
+ /**
4016
+ * Schema for the `PermissionRequestShellCommand` type.
4017
+ */
3377
4018
  export interface PermissionRequestShellCommand {
3378
4019
  /**
3379
4020
  * Command identifier (e.g., executable name)
@@ -3384,6 +4025,9 @@ export interface PermissionRequestShellCommand {
3384
4025
  */
3385
4026
  readOnly: boolean;
3386
4027
  }
4028
+ /**
4029
+ * Schema for the `PermissionRequestShellPossibleUrl` type.
4030
+ */
3387
4031
  export interface PermissionRequestShellPossibleUrl {
3388
4032
  /**
3389
4033
  * URL that may be accessed by the command
@@ -3452,7 +4096,7 @@ export interface PermissionRequestMcp {
3452
4096
  * Arguments to pass to the MCP tool
3453
4097
  */
3454
4098
  args?: {
3455
- [k: string]: unknown;
4099
+ [k: string]: unknown | undefined;
3456
4100
  };
3457
4101
  /**
3458
4102
  * Permission kind discriminator
@@ -3539,7 +4183,7 @@ export interface PermissionRequestCustomTool {
3539
4183
  * Arguments to pass to the custom tool
3540
4184
  */
3541
4185
  args?: {
3542
- [k: string]: unknown;
4186
+ [k: string]: unknown | undefined;
3543
4187
  };
3544
4188
  /**
3545
4189
  * Permission kind discriminator
@@ -3574,7 +4218,7 @@ export interface PermissionRequestHook {
3574
4218
  * Arguments of the tool call being gated
3575
4219
  */
3576
4220
  toolArgs?: {
3577
- [k: string]: unknown;
4221
+ [k: string]: unknown | undefined;
3578
4222
  };
3579
4223
  /**
3580
4224
  * Tool call ID that triggered this permission request
@@ -3765,12 +4409,12 @@ export interface PermissionPromptRequestUrl {
3765
4409
  * Memory operation permission prompt
3766
4410
  */
3767
4411
  export interface PermissionPromptRequestMemory {
3768
- action?: PermissionPromptRequestMemoryAction;
4412
+ action?: PermissionRequestMemoryAction;
3769
4413
  /**
3770
4414
  * Source references for the stored fact (store only)
3771
4415
  */
3772
4416
  citations?: string;
3773
- direction?: PermissionPromptRequestMemoryDirection;
4417
+ direction?: PermissionRequestMemoryDirection;
3774
4418
  /**
3775
4419
  * The fact being stored or voted on
3776
4420
  */
@@ -3800,7 +4444,7 @@ export interface PermissionPromptRequestCustomTool {
3800
4444
  * Arguments to pass to the custom tool
3801
4445
  */
3802
4446
  args?: {
3803
- [k: string]: unknown;
4447
+ [k: string]: unknown | undefined;
3804
4448
  };
3805
4449
  /**
3806
4450
  * Prompt kind discriminator
@@ -3853,7 +4497,7 @@ export interface PermissionPromptRequestHook {
3853
4497
  * Arguments of the tool call being gated
3854
4498
  */
3855
4499
  toolArgs?: {
3856
- [k: string]: unknown;
4500
+ [k: string]: unknown | undefined;
3857
4501
  };
3858
4502
  /**
3859
4503
  * Tool call ID that triggered this permission request
@@ -3906,6 +4550,9 @@ export interface PermissionPromptRequestExtensionPermissionAccess {
3906
4550
  */
3907
4551
  toolCallId?: string;
3908
4552
  }
4553
+ /**
4554
+ * Session event "permission.completed". Permission request completion notification signaling UI dismissal
4555
+ */
3909
4556
  export interface PermissionCompletedEvent {
3910
4557
  /**
3911
4558
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3928,6 +4575,9 @@ export interface PermissionCompletedEvent {
3928
4575
  * ISO 8601 timestamp when the event was created
3929
4576
  */
3930
4577
  timestamp: string;
4578
+ /**
4579
+ * Type discriminator. Always "permission.completed".
4580
+ */
3931
4581
  type: "permission.completed";
3932
4582
  }
3933
4583
  /**
@@ -3944,12 +4594,18 @@ export interface PermissionCompletedData {
3944
4594
  */
3945
4595
  toolCallId?: string;
3946
4596
  }
4597
+ /**
4598
+ * Schema for the `PermissionApproved` type.
4599
+ */
3947
4600
  export interface PermissionApproved {
3948
4601
  /**
3949
4602
  * The permission request was approved
3950
4603
  */
3951
4604
  kind: "approved";
3952
4605
  }
4606
+ /**
4607
+ * Schema for the `PermissionApprovedForSession` type.
4608
+ */
3953
4609
  export interface PermissionApprovedForSession {
3954
4610
  approval: UserToolSessionApproval;
3955
4611
  /**
@@ -3957,6 +4613,9 @@ export interface PermissionApprovedForSession {
3957
4613
  */
3958
4614
  kind: "approved-for-session";
3959
4615
  }
4616
+ /**
4617
+ * Schema for the `UserToolSessionApprovalCommands` type.
4618
+ */
3960
4619
  export interface UserToolSessionApprovalCommands {
3961
4620
  /**
3962
4621
  * Command identifiers approved by the user
@@ -3967,18 +4626,27 @@ export interface UserToolSessionApprovalCommands {
3967
4626
  */
3968
4627
  kind: "commands";
3969
4628
  }
4629
+ /**
4630
+ * Schema for the `UserToolSessionApprovalRead` type.
4631
+ */
3970
4632
  export interface UserToolSessionApprovalRead {
3971
4633
  /**
3972
4634
  * Read approval kind
3973
4635
  */
3974
4636
  kind: "read";
3975
4637
  }
4638
+ /**
4639
+ * Schema for the `UserToolSessionApprovalWrite` type.
4640
+ */
3976
4641
  export interface UserToolSessionApprovalWrite {
3977
4642
  /**
3978
4643
  * Write approval kind
3979
4644
  */
3980
4645
  kind: "write";
3981
4646
  }
4647
+ /**
4648
+ * Schema for the `UserToolSessionApprovalMcp` type.
4649
+ */
3982
4650
  export interface UserToolSessionApprovalMcp {
3983
4651
  /**
3984
4652
  * MCP tool approval kind
@@ -3993,12 +4661,18 @@ export interface UserToolSessionApprovalMcp {
3993
4661
  */
3994
4662
  toolName: string | null;
3995
4663
  }
4664
+ /**
4665
+ * Schema for the `UserToolSessionApprovalMemory` type.
4666
+ */
3996
4667
  export interface UserToolSessionApprovalMemory {
3997
4668
  /**
3998
4669
  * Memory approval kind
3999
4670
  */
4000
4671
  kind: "memory";
4001
4672
  }
4673
+ /**
4674
+ * Schema for the `UserToolSessionApprovalCustomTool` type.
4675
+ */
4002
4676
  export interface UserToolSessionApprovalCustomTool {
4003
4677
  /**
4004
4678
  * Custom tool approval kind
@@ -4009,6 +4683,9 @@ export interface UserToolSessionApprovalCustomTool {
4009
4683
  */
4010
4684
  toolName: string;
4011
4685
  }
4686
+ /**
4687
+ * Schema for the `UserToolSessionApprovalExtensionManagement` type.
4688
+ */
4012
4689
  export interface UserToolSessionApprovalExtensionManagement {
4013
4690
  /**
4014
4691
  * Extension management approval kind
@@ -4019,6 +4696,9 @@ export interface UserToolSessionApprovalExtensionManagement {
4019
4696
  */
4020
4697
  operation?: string;
4021
4698
  }
4699
+ /**
4700
+ * Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type.
4701
+ */
4022
4702
  export interface UserToolSessionApprovalExtensionPermissionAccess {
4023
4703
  /**
4024
4704
  * Extension name
@@ -4029,6 +4709,9 @@ export interface UserToolSessionApprovalExtensionPermissionAccess {
4029
4709
  */
4030
4710
  kind: "extension-permission-access";
4031
4711
  }
4712
+ /**
4713
+ * Schema for the `PermissionApprovedForLocation` type.
4714
+ */
4032
4715
  export interface PermissionApprovedForLocation {
4033
4716
  approval: UserToolSessionApproval;
4034
4717
  /**
@@ -4040,6 +4723,9 @@ export interface PermissionApprovedForLocation {
4040
4723
  */
4041
4724
  locationKey: string;
4042
4725
  }
4726
+ /**
4727
+ * Schema for the `PermissionCancelled` type.
4728
+ */
4043
4729
  export interface PermissionCancelled {
4044
4730
  /**
4045
4731
  * The permission request was cancelled before a response was used
@@ -4050,6 +4736,9 @@ export interface PermissionCancelled {
4050
4736
  */
4051
4737
  reason?: string;
4052
4738
  }
4739
+ /**
4740
+ * Schema for the `PermissionDeniedByRules` type.
4741
+ */
4053
4742
  export interface PermissionDeniedByRules {
4054
4743
  /**
4055
4744
  * Denied because approval rules explicitly blocked it
@@ -4060,9 +4749,12 @@ export interface PermissionDeniedByRules {
4060
4749
  */
4061
4750
  rules: PermissionRule[];
4062
4751
  }
4752
+ /**
4753
+ * Schema for the `PermissionRule` type.
4754
+ */
4063
4755
  export interface PermissionRule {
4064
4756
  /**
4065
- * Optional rule argument matched against the request
4757
+ * Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory').
4066
4758
  */
4067
4759
  argument: string | null;
4068
4760
  /**
@@ -4070,12 +4762,18 @@ export interface PermissionRule {
4070
4762
  */
4071
4763
  kind: string;
4072
4764
  }
4765
+ /**
4766
+ * Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.
4767
+ */
4073
4768
  export interface PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser {
4074
4769
  /**
4075
4770
  * Denied because no approval rule matched and user confirmation was unavailable
4076
4771
  */
4077
4772
  kind: "denied-no-approval-rule-and-could-not-request-from-user";
4078
4773
  }
4774
+ /**
4775
+ * Schema for the `PermissionDeniedInteractivelyByUser` type.
4776
+ */
4079
4777
  export interface PermissionDeniedInteractivelyByUser {
4080
4778
  /**
4081
4779
  * Optional feedback from the user explaining the denial
@@ -4090,6 +4788,9 @@ export interface PermissionDeniedInteractivelyByUser {
4090
4788
  */
4091
4789
  kind: "denied-interactively-by-user";
4092
4790
  }
4791
+ /**
4792
+ * Schema for the `PermissionDeniedByContentExclusionPolicy` type.
4793
+ */
4093
4794
  export interface PermissionDeniedByContentExclusionPolicy {
4094
4795
  /**
4095
4796
  * Denied by the organization's content exclusion policy
@@ -4104,6 +4805,9 @@ export interface PermissionDeniedByContentExclusionPolicy {
4104
4805
  */
4105
4806
  path: string;
4106
4807
  }
4808
+ /**
4809
+ * Schema for the `PermissionDeniedByPermissionRequestHook` type.
4810
+ */
4107
4811
  export interface PermissionDeniedByPermissionRequestHook {
4108
4812
  /**
4109
4813
  * Whether to interrupt the current agent turn
@@ -4118,12 +4822,18 @@ export interface PermissionDeniedByPermissionRequestHook {
4118
4822
  */
4119
4823
  message?: string;
4120
4824
  }
4825
+ /**
4826
+ * Session event "user_input.requested". User input request notification with question and optional predefined choices
4827
+ */
4121
4828
  export interface UserInputRequestedEvent {
4122
4829
  /**
4123
4830
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4124
4831
  */
4125
4832
  agentId?: string;
4126
4833
  data: UserInputRequestedData;
4834
+ /**
4835
+ * Always true for events that are transient and not persisted to the session event log on disk.
4836
+ */
4127
4837
  ephemeral: true;
4128
4838
  /**
4129
4839
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4137,6 +4847,9 @@ export interface UserInputRequestedEvent {
4137
4847
  * ISO 8601 timestamp when the event was created
4138
4848
  */
4139
4849
  timestamp: string;
4850
+ /**
4851
+ * Type discriminator. Always "user_input.requested".
4852
+ */
4140
4853
  type: "user_input.requested";
4141
4854
  }
4142
4855
  /**
@@ -4164,12 +4877,18 @@ export interface UserInputRequestedData {
4164
4877
  */
4165
4878
  toolCallId?: string;
4166
4879
  }
4880
+ /**
4881
+ * Session event "user_input.completed". User input request completion with the user's response
4882
+ */
4167
4883
  export interface UserInputCompletedEvent {
4168
4884
  /**
4169
4885
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4170
4886
  */
4171
4887
  agentId?: string;
4172
4888
  data: UserInputCompletedData;
4889
+ /**
4890
+ * Always true for events that are transient and not persisted to the session event log on disk.
4891
+ */
4173
4892
  ephemeral: true;
4174
4893
  /**
4175
4894
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4183,6 +4902,9 @@ export interface UserInputCompletedEvent {
4183
4902
  * ISO 8601 timestamp when the event was created
4184
4903
  */
4185
4904
  timestamp: string;
4905
+ /**
4906
+ * Type discriminator. Always "user_input.completed".
4907
+ */
4186
4908
  type: "user_input.completed";
4187
4909
  }
4188
4910
  /**
@@ -4202,12 +4924,18 @@ export interface UserInputCompletedData {
4202
4924
  */
4203
4925
  wasFreeform?: boolean;
4204
4926
  }
4927
+ /**
4928
+ * Session event "elicitation.requested". Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
4929
+ */
4205
4930
  export interface ElicitationRequestedEvent {
4206
4931
  /**
4207
4932
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4208
4933
  */
4209
4934
  agentId?: string;
4210
4935
  data: ElicitationRequestedData;
4936
+ /**
4937
+ * Always true for events that are transient and not persisted to the session event log on disk.
4938
+ */
4211
4939
  ephemeral: true;
4212
4940
  /**
4213
4941
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4221,6 +4949,9 @@ export interface ElicitationRequestedEvent {
4221
4949
  * ISO 8601 timestamp when the event was created
4222
4950
  */
4223
4951
  timestamp: string;
4952
+ /**
4953
+ * Type discriminator. Always "elicitation.requested".
4954
+ */
4224
4955
  type: "elicitation.requested";
4225
4956
  }
4226
4957
  /**
@@ -4249,7 +4980,7 @@ export interface ElicitationRequestedData {
4249
4980
  * URL to open in the user's browser (url mode only)
4250
4981
  */
4251
4982
  url?: string;
4252
- [k: string]: unknown;
4983
+ [k: string]: unknown | undefined;
4253
4984
  }
4254
4985
  /**
4255
4986
  * JSON Schema describing the form fields to present to the user (form mode only)
@@ -4259,7 +4990,9 @@ export interface ElicitationRequestedSchema {
4259
4990
  * Form field definitions, keyed by field name
4260
4991
  */
4261
4992
  properties: {
4262
- [k: string]: unknown;
4993
+ [k: string]: {
4994
+ [k: string]: unknown | undefined;
4995
+ } | undefined;
4263
4996
  };
4264
4997
  /**
4265
4998
  * List of required field names
@@ -4270,12 +5003,18 @@ export interface ElicitationRequestedSchema {
4270
5003
  */
4271
5004
  type: "object";
4272
5005
  }
5006
+ /**
5007
+ * Session event "elicitation.completed". Elicitation request completion with the user's response
5008
+ */
4273
5009
  export interface ElicitationCompletedEvent {
4274
5010
  /**
4275
5011
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4276
5012
  */
4277
5013
  agentId?: string;
4278
5014
  data: ElicitationCompletedData;
5015
+ /**
5016
+ * Always true for events that are transient and not persisted to the session event log on disk.
5017
+ */
4279
5018
  ephemeral: true;
4280
5019
  /**
4281
5020
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4289,6 +5028,9 @@ export interface ElicitationCompletedEvent {
4289
5028
  * ISO 8601 timestamp when the event was created
4290
5029
  */
4291
5030
  timestamp: string;
5031
+ /**
5032
+ * Type discriminator. Always "elicitation.completed".
5033
+ */
4292
5034
  type: "elicitation.completed";
4293
5035
  }
4294
5036
  /**
@@ -4300,19 +5042,25 @@ export interface ElicitationCompletedData {
4300
5042
  * The submitted form data when action is 'accept'; keys match the requested schema fields
4301
5043
  */
4302
5044
  content?: {
4303
- [k: string]: ElicitationCompletedContent;
5045
+ [k: string]: ElicitationCompletedContent | undefined;
4304
5046
  };
4305
5047
  /**
4306
5048
  * Request ID of the resolved elicitation request; clients should dismiss any UI for this request
4307
5049
  */
4308
5050
  requestId: string;
4309
5051
  }
5052
+ /**
5053
+ * Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation
5054
+ */
4310
5055
  export interface SamplingRequestedEvent {
4311
5056
  /**
4312
5057
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4313
5058
  */
4314
5059
  agentId?: string;
4315
5060
  data: SamplingRequestedData;
5061
+ /**
5062
+ * Always true for events that are transient and not persisted to the session event log on disk.
5063
+ */
4316
5064
  ephemeral: true;
4317
5065
  /**
4318
5066
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4326,6 +5074,9 @@ export interface SamplingRequestedEvent {
4326
5074
  * ISO 8601 timestamp when the event was created
4327
5075
  */
4328
5076
  timestamp: string;
5077
+ /**
5078
+ * Type discriminator. Always "sampling.requested".
5079
+ */
4329
5080
  type: "sampling.requested";
4330
5081
  }
4331
5082
  /**
@@ -4344,14 +5095,20 @@ export interface SamplingRequestedData {
4344
5095
  * Name of the MCP server that initiated the sampling request
4345
5096
  */
4346
5097
  serverName: string;
4347
- [k: string]: unknown;
5098
+ [k: string]: unknown | undefined;
4348
5099
  }
5100
+ /**
5101
+ * Session event "sampling.completed". Sampling request completion notification signaling UI dismissal
5102
+ */
4349
5103
  export interface SamplingCompletedEvent {
4350
5104
  /**
4351
5105
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4352
5106
  */
4353
5107
  agentId?: string;
4354
5108
  data: SamplingCompletedData;
5109
+ /**
5110
+ * Always true for events that are transient and not persisted to the session event log on disk.
5111
+ */
4355
5112
  ephemeral: true;
4356
5113
  /**
4357
5114
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4365,6 +5122,9 @@ export interface SamplingCompletedEvent {
4365
5122
  * ISO 8601 timestamp when the event was created
4366
5123
  */
4367
5124
  timestamp: string;
5125
+ /**
5126
+ * Type discriminator. Always "sampling.completed".
5127
+ */
4368
5128
  type: "sampling.completed";
4369
5129
  }
4370
5130
  /**
@@ -4376,12 +5136,18 @@ export interface SamplingCompletedData {
4376
5136
  */
4377
5137
  requestId: string;
4378
5138
  }
5139
+ /**
5140
+ * Session event "mcp.oauth_required". OAuth authentication request for an MCP server
5141
+ */
4379
5142
  export interface McpOauthRequiredEvent {
4380
5143
  /**
4381
5144
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4382
5145
  */
4383
5146
  agentId?: string;
4384
5147
  data: McpOauthRequiredData;
5148
+ /**
5149
+ * Always true for events that are transient and not persisted to the session event log on disk.
5150
+ */
4385
5151
  ephemeral: true;
4386
5152
  /**
4387
5153
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4395,6 +5161,9 @@ export interface McpOauthRequiredEvent {
4395
5161
  * ISO 8601 timestamp when the event was created
4396
5162
  */
4397
5163
  timestamp: string;
5164
+ /**
5165
+ * Type discriminator. Always "mcp.oauth_required".
5166
+ */
4398
5167
  type: "mcp.oauth_required";
4399
5168
  }
4400
5169
  /**
@@ -4432,12 +5201,18 @@ export interface McpOauthRequiredStaticClientConfig {
4432
5201
  */
4433
5202
  publicClient?: boolean;
4434
5203
  }
5204
+ /**
5205
+ * Session event "mcp.oauth_completed". MCP OAuth request completion notification
5206
+ */
4435
5207
  export interface McpOauthCompletedEvent {
4436
5208
  /**
4437
5209
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4438
5210
  */
4439
5211
  agentId?: string;
4440
5212
  data: McpOauthCompletedData;
5213
+ /**
5214
+ * Always true for events that are transient and not persisted to the session event log on disk.
5215
+ */
4441
5216
  ephemeral: true;
4442
5217
  /**
4443
5218
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4451,6 +5226,9 @@ export interface McpOauthCompletedEvent {
4451
5226
  * ISO 8601 timestamp when the event was created
4452
5227
  */
4453
5228
  timestamp: string;
5229
+ /**
5230
+ * Type discriminator. Always "mcp.oauth_completed".
5231
+ */
4454
5232
  type: "mcp.oauth_completed";
4455
5233
  }
4456
5234
  /**
@@ -4462,6 +5240,64 @@ export interface McpOauthCompletedData {
4462
5240
  */
4463
5241
  requestId: string;
4464
5242
  }
5243
+ /**
5244
+ * Session event "session.custom_notification". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
5245
+ */
5246
+ export interface CustomNotificationEvent {
5247
+ /**
5248
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5249
+ */
5250
+ agentId?: string;
5251
+ data: CustomNotificationData;
5252
+ /**
5253
+ * Always true for events that are transient and not persisted to the session event log on disk.
5254
+ */
5255
+ ephemeral: true;
5256
+ /**
5257
+ * Unique event identifier (UUID v4), generated when the event is emitted
5258
+ */
5259
+ id: string;
5260
+ /**
5261
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
5262
+ */
5263
+ parentId: string | null;
5264
+ /**
5265
+ * ISO 8601 timestamp when the event was created
5266
+ */
5267
+ timestamp: string;
5268
+ /**
5269
+ * Type discriminator. Always "session.custom_notification".
5270
+ */
5271
+ type: "session.custom_notification";
5272
+ }
5273
+ /**
5274
+ * Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
5275
+ */
5276
+ export interface CustomNotificationData {
5277
+ /**
5278
+ * Source-defined custom notification name
5279
+ */
5280
+ name: string;
5281
+ payload: CustomNotificationPayload;
5282
+ /**
5283
+ * Namespace for the custom notification producer
5284
+ */
5285
+ source: string;
5286
+ subject?: CustomNotificationSubject;
5287
+ /**
5288
+ * Optional source-defined payload schema version
5289
+ */
5290
+ version?: number;
5291
+ }
5292
+ /**
5293
+ * Optional source-defined string identifiers describing the payload subject
5294
+ */
5295
+ export interface CustomNotificationSubject {
5296
+ [k: string]: string | undefined;
5297
+ }
5298
+ /**
5299
+ * Session event "external_tool.requested". External tool invocation request for client-side tool execution
5300
+ */
4465
5301
  export interface ExternalToolRequestedEvent {
4466
5302
  /**
4467
5303
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -4484,6 +5320,9 @@ export interface ExternalToolRequestedEvent {
4484
5320
  * ISO 8601 timestamp when the event was created
4485
5321
  */
4486
5322
  timestamp: string;
5323
+ /**
5324
+ * Type discriminator. Always "external_tool.requested".
5325
+ */
4487
5326
  type: "external_tool.requested";
4488
5327
  }
4489
5328
  /**
@@ -4494,7 +5333,7 @@ export interface ExternalToolRequestedData {
4494
5333
  * Arguments to pass to the external tool
4495
5334
  */
4496
5335
  arguments?: {
4497
- [k: string]: unknown;
5336
+ [k: string]: unknown | undefined;
4498
5337
  };
4499
5338
  /**
4500
5339
  * Unique identifier for this request; used to respond via session.respondToExternalTool()
@@ -4521,12 +5360,18 @@ export interface ExternalToolRequestedData {
4521
5360
  */
4522
5361
  tracestate?: string;
4523
5362
  }
5363
+ /**
5364
+ * Session event "external_tool.completed". External tool completion notification signaling UI dismissal
5365
+ */
4524
5366
  export interface ExternalToolCompletedEvent {
4525
5367
  /**
4526
5368
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4527
5369
  */
4528
5370
  agentId?: string;
4529
5371
  data: ExternalToolCompletedData;
5372
+ /**
5373
+ * Always true for events that are transient and not persisted to the session event log on disk.
5374
+ */
4530
5375
  ephemeral?: true;
4531
5376
  /**
4532
5377
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4540,6 +5385,9 @@ export interface ExternalToolCompletedEvent {
4540
5385
  * ISO 8601 timestamp when the event was created
4541
5386
  */
4542
5387
  timestamp: string;
5388
+ /**
5389
+ * Type discriminator. Always "external_tool.completed".
5390
+ */
4543
5391
  type: "external_tool.completed";
4544
5392
  }
4545
5393
  /**
@@ -4551,12 +5399,18 @@ export interface ExternalToolCompletedData {
4551
5399
  */
4552
5400
  requestId: string;
4553
5401
  }
5402
+ /**
5403
+ * Session event "command.queued". Queued slash command dispatch request for client execution
5404
+ */
4554
5405
  export interface CommandQueuedEvent {
4555
5406
  /**
4556
5407
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4557
5408
  */
4558
5409
  agentId?: string;
4559
5410
  data: CommandQueuedData;
5411
+ /**
5412
+ * Always true for events that are transient and not persisted to the session event log on disk.
5413
+ */
4560
5414
  ephemeral: true;
4561
5415
  /**
4562
5416
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4570,6 +5424,9 @@ export interface CommandQueuedEvent {
4570
5424
  * ISO 8601 timestamp when the event was created
4571
5425
  */
4572
5426
  timestamp: string;
5427
+ /**
5428
+ * Type discriminator. Always "command.queued".
5429
+ */
4573
5430
  type: "command.queued";
4574
5431
  }
4575
5432
  /**
@@ -4585,12 +5442,18 @@ export interface CommandQueuedData {
4585
5442
  */
4586
5443
  requestId: string;
4587
5444
  }
5445
+ /**
5446
+ * Session event "command.execute". Registered command dispatch request routed to the owning client
5447
+ */
4588
5448
  export interface CommandExecuteEvent {
4589
5449
  /**
4590
5450
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4591
5451
  */
4592
5452
  agentId?: string;
4593
5453
  data: CommandExecuteData;
5454
+ /**
5455
+ * Always true for events that are transient and not persisted to the session event log on disk.
5456
+ */
4594
5457
  ephemeral: true;
4595
5458
  /**
4596
5459
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4604,6 +5467,9 @@ export interface CommandExecuteEvent {
4604
5467
  * ISO 8601 timestamp when the event was created
4605
5468
  */
4606
5469
  timestamp: string;
5470
+ /**
5471
+ * Type discriminator. Always "command.execute".
5472
+ */
4607
5473
  type: "command.execute";
4608
5474
  }
4609
5475
  /**
@@ -4627,12 +5493,18 @@ export interface CommandExecuteData {
4627
5493
  */
4628
5494
  requestId: string;
4629
5495
  }
5496
+ /**
5497
+ * Session event "command.completed". Queued command completion notification signaling UI dismissal
5498
+ */
4630
5499
  export interface CommandCompletedEvent {
4631
5500
  /**
4632
5501
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4633
5502
  */
4634
5503
  agentId?: string;
4635
5504
  data: CommandCompletedData;
5505
+ /**
5506
+ * Always true for events that are transient and not persisted to the session event log on disk.
5507
+ */
4636
5508
  ephemeral: true;
4637
5509
  /**
4638
5510
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4646,6 +5518,9 @@ export interface CommandCompletedEvent {
4646
5518
  * ISO 8601 timestamp when the event was created
4647
5519
  */
4648
5520
  timestamp: string;
5521
+ /**
5522
+ * Type discriminator. Always "command.completed".
5523
+ */
4649
5524
  type: "command.completed";
4650
5525
  }
4651
5526
  /**
@@ -4657,12 +5532,18 @@ export interface CommandCompletedData {
4657
5532
  */
4658
5533
  requestId: string;
4659
5534
  }
5535
+ /**
5536
+ * Session event "auto_mode_switch.requested". Auto mode switch request notification requiring user approval
5537
+ */
4660
5538
  export interface AutoModeSwitchRequestedEvent {
4661
5539
  /**
4662
5540
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4663
5541
  */
4664
5542
  agentId?: string;
4665
5543
  data: AutoModeSwitchRequestedData;
5544
+ /**
5545
+ * Always true for events that are transient and not persisted to the session event log on disk.
5546
+ */
4666
5547
  ephemeral: true;
4667
5548
  /**
4668
5549
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4676,6 +5557,9 @@ export interface AutoModeSwitchRequestedEvent {
4676
5557
  * ISO 8601 timestamp when the event was created
4677
5558
  */
4678
5559
  timestamp: string;
5560
+ /**
5561
+ * Type discriminator. Always "auto_mode_switch.requested".
5562
+ */
4679
5563
  type: "auto_mode_switch.requested";
4680
5564
  }
4681
5565
  /**
@@ -4695,12 +5579,18 @@ export interface AutoModeSwitchRequestedData {
4695
5579
  */
4696
5580
  retryAfterSeconds?: number;
4697
5581
  }
5582
+ /**
5583
+ * Session event "auto_mode_switch.completed". Auto mode switch completion notification
5584
+ */
4698
5585
  export interface AutoModeSwitchCompletedEvent {
4699
5586
  /**
4700
5587
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4701
5588
  */
4702
5589
  agentId?: string;
4703
5590
  data: AutoModeSwitchCompletedData;
5591
+ /**
5592
+ * Always true for events that are transient and not persisted to the session event log on disk.
5593
+ */
4704
5594
  ephemeral: true;
4705
5595
  /**
4706
5596
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4714,6 +5604,9 @@ export interface AutoModeSwitchCompletedEvent {
4714
5604
  * ISO 8601 timestamp when the event was created
4715
5605
  */
4716
5606
  timestamp: string;
5607
+ /**
5608
+ * Type discriminator. Always "auto_mode_switch.completed".
5609
+ */
4717
5610
  type: "auto_mode_switch.completed";
4718
5611
  }
4719
5612
  /**
@@ -4724,17 +5617,20 @@ export interface AutoModeSwitchCompletedData {
4724
5617
  * Request ID of the resolved request; clients should dismiss any UI for this request
4725
5618
  */
4726
5619
  requestId: string;
4727
- /**
4728
- * The user's choice: 'yes', 'yes_always', or 'no'
4729
- */
4730
- response: string;
5620
+ response: AutoModeSwitchResponse;
4731
5621
  }
5622
+ /**
5623
+ * Session event "commands.changed". SDK command registration change notification
5624
+ */
4732
5625
  export interface CommandsChangedEvent {
4733
5626
  /**
4734
5627
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4735
5628
  */
4736
5629
  agentId?: string;
4737
5630
  data: CommandsChangedData;
5631
+ /**
5632
+ * Always true for events that are transient and not persisted to the session event log on disk.
5633
+ */
4738
5634
  ephemeral: true;
4739
5635
  /**
4740
5636
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4748,6 +5644,9 @@ export interface CommandsChangedEvent {
4748
5644
  * ISO 8601 timestamp when the event was created
4749
5645
  */
4750
5646
  timestamp: string;
5647
+ /**
5648
+ * Type discriminator. Always "commands.changed".
5649
+ */
4751
5650
  type: "commands.changed";
4752
5651
  }
4753
5652
  /**
@@ -4759,16 +5658,31 @@ export interface CommandsChangedData {
4759
5658
  */
4760
5659
  commands: CommandsChangedCommand[];
4761
5660
  }
5661
+ /**
5662
+ * Schema for the `CommandsChangedCommand` type.
5663
+ */
4762
5664
  export interface CommandsChangedCommand {
5665
+ /**
5666
+ * Optional human-readable command description.
5667
+ */
4763
5668
  description?: string;
5669
+ /**
5670
+ * Slash command name without the leading slash.
5671
+ */
4764
5672
  name: string;
4765
5673
  }
5674
+ /**
5675
+ * Session event "capabilities.changed". Session capability change notification
5676
+ */
4766
5677
  export interface CapabilitiesChangedEvent {
4767
5678
  /**
4768
5679
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4769
5680
  */
4770
5681
  agentId?: string;
4771
5682
  data: CapabilitiesChangedData;
5683
+ /**
5684
+ * Always true for events that are transient and not persisted to the session event log on disk.
5685
+ */
4772
5686
  ephemeral: true;
4773
5687
  /**
4774
5688
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4782,6 +5696,9 @@ export interface CapabilitiesChangedEvent {
4782
5696
  * ISO 8601 timestamp when the event was created
4783
5697
  */
4784
5698
  timestamp: string;
5699
+ /**
5700
+ * Type discriminator. Always "capabilities.changed".
5701
+ */
4785
5702
  type: "capabilities.changed";
4786
5703
  }
4787
5704
  /**
@@ -4799,12 +5716,18 @@ export interface CapabilitiesChangedUI {
4799
5716
  */
4800
5717
  elicitation?: boolean;
4801
5718
  }
5719
+ /**
5720
+ * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions
5721
+ */
4802
5722
  export interface ExitPlanModeRequestedEvent {
4803
5723
  /**
4804
5724
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4805
5725
  */
4806
5726
  agentId?: string;
4807
5727
  data: ExitPlanModeRequestedData;
5728
+ /**
5729
+ * Always true for events that are transient and not persisted to the session event log on disk.
5730
+ */
4808
5731
  ephemeral: true;
4809
5732
  /**
4810
5733
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4818,6 +5741,9 @@ export interface ExitPlanModeRequestedEvent {
4818
5741
  * ISO 8601 timestamp when the event was created
4819
5742
  */
4820
5743
  timestamp: string;
5744
+ /**
5745
+ * Type discriminator. Always "exit_plan_mode.requested".
5746
+ */
4821
5747
  type: "exit_plan_mode.requested";
4822
5748
  }
4823
5749
  /**
@@ -4825,17 +5751,14 @@ export interface ExitPlanModeRequestedEvent {
4825
5751
  */
4826
5752
  export interface ExitPlanModeRequestedData {
4827
5753
  /**
4828
- * Available actions the user can take (e.g., approve, edit, reject)
5754
+ * Available actions the user can take
4829
5755
  */
4830
- actions: string[];
5756
+ actions: ExitPlanModeAction[];
4831
5757
  /**
4832
5758
  * Full content of the plan file
4833
5759
  */
4834
5760
  planContent: string;
4835
- /**
4836
- * The recommended action for the user to take
4837
- */
4838
- recommendedAction: string;
5761
+ recommendedAction: ExitPlanModeAction;
4839
5762
  /**
4840
5763
  * Unique identifier for this request; used to respond via session.respondToExitPlanMode()
4841
5764
  */
@@ -4845,12 +5768,18 @@ export interface ExitPlanModeRequestedData {
4845
5768
  */
4846
5769
  summary: string;
4847
5770
  }
5771
+ /**
5772
+ * Session event "exit_plan_mode.completed". Plan mode exit completion with the user's approval decision and optional feedback
5773
+ */
4848
5774
  export interface ExitPlanModeCompletedEvent {
4849
5775
  /**
4850
5776
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4851
5777
  */
4852
5778
  agentId?: string;
4853
5779
  data: ExitPlanModeCompletedData;
5780
+ /**
5781
+ * Always true for events that are transient and not persisted to the session event log on disk.
5782
+ */
4854
5783
  ephemeral: true;
4855
5784
  /**
4856
5785
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4864,6 +5793,9 @@ export interface ExitPlanModeCompletedEvent {
4864
5793
  * ISO 8601 timestamp when the event was created
4865
5794
  */
4866
5795
  timestamp: string;
5796
+ /**
5797
+ * Type discriminator. Always "exit_plan_mode.completed".
5798
+ */
4867
5799
  type: "exit_plan_mode.completed";
4868
5800
  }
4869
5801
  /**
@@ -4886,17 +5818,20 @@ export interface ExitPlanModeCompletedData {
4886
5818
  * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request
4887
5819
  */
4888
5820
  requestId: string;
4889
- /**
4890
- * Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only')
4891
- */
4892
- selectedAction?: string;
5821
+ selectedAction?: ExitPlanModeAction;
4893
5822
  }
5823
+ /**
5824
+ * Session event "session.tools_updated".
5825
+ */
4894
5826
  export interface ToolsUpdatedEvent {
4895
5827
  /**
4896
5828
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4897
5829
  */
4898
5830
  agentId?: string;
4899
5831
  data: ToolsUpdatedData;
5832
+ /**
5833
+ * Always true for events that are transient and not persisted to the session event log on disk.
5834
+ */
4900
5835
  ephemeral: true;
4901
5836
  /**
4902
5837
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4910,17 +5845,32 @@ export interface ToolsUpdatedEvent {
4910
5845
  * ISO 8601 timestamp when the event was created
4911
5846
  */
4912
5847
  timestamp: string;
5848
+ /**
5849
+ * Type discriminator. Always "session.tools_updated".
5850
+ */
4913
5851
  type: "session.tools_updated";
4914
5852
  }
5853
+ /**
5854
+ * Schema for the `ToolsUpdatedData` type.
5855
+ */
4915
5856
  export interface ToolsUpdatedData {
5857
+ /**
5858
+ * Identifier of the model the resolved tools apply to.
5859
+ */
4916
5860
  model: string;
4917
5861
  }
5862
+ /**
5863
+ * Session event "session.background_tasks_changed".
5864
+ */
4918
5865
  export interface BackgroundTasksChangedEvent {
4919
5866
  /**
4920
5867
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4921
5868
  */
4922
5869
  agentId?: string;
4923
5870
  data: BackgroundTasksChangedData;
5871
+ /**
5872
+ * Always true for events that are transient and not persisted to the session event log on disk.
5873
+ */
4924
5874
  ephemeral: true;
4925
5875
  /**
4926
5876
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4934,16 +5884,28 @@ export interface BackgroundTasksChangedEvent {
4934
5884
  * ISO 8601 timestamp when the event was created
4935
5885
  */
4936
5886
  timestamp: string;
5887
+ /**
5888
+ * Type discriminator. Always "session.background_tasks_changed".
5889
+ */
4937
5890
  type: "session.background_tasks_changed";
4938
5891
  }
5892
+ /**
5893
+ * Schema for the `BackgroundTasksChangedData` type.
5894
+ */
4939
5895
  export interface BackgroundTasksChangedData {
4940
5896
  }
5897
+ /**
5898
+ * Session event "session.skills_loaded".
5899
+ */
4941
5900
  export interface SkillsLoadedEvent {
4942
5901
  /**
4943
5902
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4944
5903
  */
4945
5904
  agentId?: string;
4946
5905
  data: SkillsLoadedData;
5906
+ /**
5907
+ * Always true for events that are transient and not persisted to the session event log on disk.
5908
+ */
4947
5909
  ephemeral: true;
4948
5910
  /**
4949
5911
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4957,14 +5919,23 @@ export interface SkillsLoadedEvent {
4957
5919
  * ISO 8601 timestamp when the event was created
4958
5920
  */
4959
5921
  timestamp: string;
5922
+ /**
5923
+ * Type discriminator. Always "session.skills_loaded".
5924
+ */
4960
5925
  type: "session.skills_loaded";
4961
5926
  }
5927
+ /**
5928
+ * Schema for the `SkillsLoadedData` type.
5929
+ */
4962
5930
  export interface SkillsLoadedData {
4963
5931
  /**
4964
5932
  * Array of resolved skill metadata
4965
5933
  */
4966
5934
  skills: SkillsLoadedSkill[];
4967
5935
  }
5936
+ /**
5937
+ * Schema for the `SkillsLoadedSkill` type.
5938
+ */
4968
5939
  export interface SkillsLoadedSkill {
4969
5940
  /**
4970
5941
  * Description of what the skill does
@@ -4982,21 +5953,24 @@ export interface SkillsLoadedSkill {
4982
5953
  * Absolute path to the skill file, if available
4983
5954
  */
4984
5955
  path?: string;
4985
- /**
4986
- * Source location type of the skill (e.g., project, personal, plugin)
4987
- */
4988
- source: string;
5956
+ source: SkillSource;
4989
5957
  /**
4990
5958
  * Whether the skill can be invoked by the user as a slash command
4991
5959
  */
4992
5960
  userInvocable: boolean;
4993
5961
  }
5962
+ /**
5963
+ * Session event "session.custom_agents_updated".
5964
+ */
4994
5965
  export interface CustomAgentsUpdatedEvent {
4995
5966
  /**
4996
5967
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4997
5968
  */
4998
5969
  agentId?: string;
4999
5970
  data: CustomAgentsUpdatedData;
5971
+ /**
5972
+ * Always true for events that are transient and not persisted to the session event log on disk.
5973
+ */
5000
5974
  ephemeral: true;
5001
5975
  /**
5002
5976
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5010,8 +5984,14 @@ export interface CustomAgentsUpdatedEvent {
5010
5984
  * ISO 8601 timestamp when the event was created
5011
5985
  */
5012
5986
  timestamp: string;
5987
+ /**
5988
+ * Type discriminator. Always "session.custom_agents_updated".
5989
+ */
5013
5990
  type: "session.custom_agents_updated";
5014
5991
  }
5992
+ /**
5993
+ * Schema for the `CustomAgentsUpdatedData` type.
5994
+ */
5015
5995
  export interface CustomAgentsUpdatedData {
5016
5996
  /**
5017
5997
  * Array of loaded custom agent metadata
@@ -5026,6 +6006,9 @@ export interface CustomAgentsUpdatedData {
5026
6006
  */
5027
6007
  warnings: string[];
5028
6008
  }
6009
+ /**
6010
+ * Schema for the `CustomAgentsUpdatedAgent` type.
6011
+ */
5029
6012
  export interface CustomAgentsUpdatedAgent {
5030
6013
  /**
5031
6014
  * Description of what the agent does
@@ -5060,12 +6043,18 @@ export interface CustomAgentsUpdatedAgent {
5060
6043
  */
5061
6044
  userInvocable: boolean;
5062
6045
  }
6046
+ /**
6047
+ * Session event "session.mcp_servers_loaded".
6048
+ */
5063
6049
  export interface McpServersLoadedEvent {
5064
6050
  /**
5065
6051
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5066
6052
  */
5067
6053
  agentId?: string;
5068
6054
  data: McpServersLoadedData;
6055
+ /**
6056
+ * Always true for events that are transient and not persisted to the session event log on disk.
6057
+ */
5069
6058
  ephemeral: true;
5070
6059
  /**
5071
6060
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5079,14 +6068,23 @@ export interface McpServersLoadedEvent {
5079
6068
  * ISO 8601 timestamp when the event was created
5080
6069
  */
5081
6070
  timestamp: string;
6071
+ /**
6072
+ * Type discriminator. Always "session.mcp_servers_loaded".
6073
+ */
5082
6074
  type: "session.mcp_servers_loaded";
5083
6075
  }
6076
+ /**
6077
+ * Schema for the `McpServersLoadedData` type.
6078
+ */
5084
6079
  export interface McpServersLoadedData {
5085
6080
  /**
5086
6081
  * Array of MCP server status summaries
5087
6082
  */
5088
6083
  servers: McpServersLoadedServer[];
5089
6084
  }
6085
+ /**
6086
+ * Schema for the `McpServersLoadedServer` type.
6087
+ */
5090
6088
  export interface McpServersLoadedServer {
5091
6089
  /**
5092
6090
  * Error message if the server failed to connect
@@ -5096,18 +6094,21 @@ export interface McpServersLoadedServer {
5096
6094
  * Server name (config key)
5097
6095
  */
5098
6096
  name: string;
5099
- /**
5100
- * Configuration source: user, workspace, plugin, or builtin
5101
- */
5102
- source?: string;
5103
- status: McpServersLoadedServerStatus;
6097
+ source?: McpServerSource;
6098
+ status: McpServerStatus;
5104
6099
  }
6100
+ /**
6101
+ * Session event "session.mcp_server_status_changed".
6102
+ */
5105
6103
  export interface McpServerStatusChangedEvent {
5106
6104
  /**
5107
6105
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5108
6106
  */
5109
6107
  agentId?: string;
5110
6108
  data: McpServerStatusChangedData;
6109
+ /**
6110
+ * Always true for events that are transient and not persisted to the session event log on disk.
6111
+ */
5111
6112
  ephemeral: true;
5112
6113
  /**
5113
6114
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5121,21 +6122,33 @@ export interface McpServerStatusChangedEvent {
5121
6122
  * ISO 8601 timestamp when the event was created
5122
6123
  */
5123
6124
  timestamp: string;
6125
+ /**
6126
+ * Type discriminator. Always "session.mcp_server_status_changed".
6127
+ */
5124
6128
  type: "session.mcp_server_status_changed";
5125
6129
  }
6130
+ /**
6131
+ * Schema for the `McpServerStatusChangedData` type.
6132
+ */
5126
6133
  export interface McpServerStatusChangedData {
5127
6134
  /**
5128
6135
  * Name of the MCP server whose status changed
5129
6136
  */
5130
6137
  serverName: string;
5131
- status: McpServerStatusChangedStatus;
6138
+ status: McpServerStatus;
5132
6139
  }
6140
+ /**
6141
+ * Session event "session.extensions_loaded".
6142
+ */
5133
6143
  export interface ExtensionsLoadedEvent {
5134
6144
  /**
5135
6145
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5136
6146
  */
5137
6147
  agentId?: string;
5138
6148
  data: ExtensionsLoadedData;
6149
+ /**
6150
+ * Always true for events that are transient and not persisted to the session event log on disk.
6151
+ */
5139
6152
  ephemeral: true;
5140
6153
  /**
5141
6154
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5149,14 +6162,23 @@ export interface ExtensionsLoadedEvent {
5149
6162
  * ISO 8601 timestamp when the event was created
5150
6163
  */
5151
6164
  timestamp: string;
6165
+ /**
6166
+ * Type discriminator. Always "session.extensions_loaded".
6167
+ */
5152
6168
  type: "session.extensions_loaded";
5153
6169
  }
6170
+ /**
6171
+ * Schema for the `ExtensionsLoadedData` type.
6172
+ */
5154
6173
  export interface ExtensionsLoadedData {
5155
6174
  /**
5156
6175
  * Array of discovered extensions and their status
5157
6176
  */
5158
6177
  extensions: ExtensionsLoadedExtension[];
5159
6178
  }
6179
+ /**
6180
+ * Schema for the `ExtensionsLoadedExtension` type.
6181
+ */
5160
6182
  export interface ExtensionsLoadedExtension {
5161
6183
  /**
5162
6184
  * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')