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

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
@@ -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
@@ -1052,6 +1374,9 @@ export interface ShutdownModelMetricRequests {
1052
1374
  */
1053
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
  /**
@@ -1358,6 +1713,9 @@ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail {
1358
1713
  */
1359
1714
  tokenType: string;
1360
1715
  }
1716
+ /**
1717
+ * Session event "session.task_complete". Task completion notification with summary from the agent
1718
+ */
1361
1719
  export interface TaskCompleteEvent {
1362
1720
  /**
1363
1721
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1380,6 +1738,9 @@ export interface TaskCompleteEvent {
1380
1738
  * ISO 8601 timestamp when the event was created
1381
1739
  */
1382
1740
  timestamp: string;
1741
+ /**
1742
+ * Type discriminator. Always "session.task_complete".
1743
+ */
1383
1744
  type: "session.task_complete";
1384
1745
  }
1385
1746
  /**
@@ -1395,6 +1756,9 @@ export interface TaskCompleteData {
1395
1756
  */
1396
1757
  summary?: string;
1397
1758
  }
1759
+ /**
1760
+ * Session event "user.message".
1761
+ */
1398
1762
  export interface UserMessageEvent {
1399
1763
  /**
1400
1764
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1417,8 +1781,14 @@ export interface UserMessageEvent {
1417
1781
  * ISO 8601 timestamp when the event was created
1418
1782
  */
1419
1783
  timestamp: string;
1784
+ /**
1785
+ * Type discriminator. Always "user.message".
1786
+ */
1420
1787
  type: "user.message";
1421
1788
  }
1789
+ /**
1790
+ * Schema for the `UserMessageData` type.
1791
+ */
1422
1792
  export interface UserMessageData {
1423
1793
  agentMode?: UserMessageAgentMode;
1424
1794
  /**
@@ -1434,7 +1804,11 @@ export interface UserMessageData {
1434
1804
  */
1435
1805
  interactionId?: string;
1436
1806
  /**
1437
- * Path-backed native document attachments that stayed on the tagged_files path flow because native upload would exceed the request size limit
1807
+ * 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.
1808
+ */
1809
+ isAutopilotContinuation?: boolean;
1810
+ /**
1811
+ * 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
1812
  */
1439
1813
  nativeDocumentPathFallbackPaths?: string[];
1440
1814
  /**
@@ -1604,12 +1978,18 @@ export interface UserMessageAttachmentBlob {
1604
1978
  */
1605
1979
  type: "blob";
1606
1980
  }
1981
+ /**
1982
+ * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
1983
+ */
1607
1984
  export interface PendingMessagesModifiedEvent {
1608
1985
  /**
1609
1986
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1610
1987
  */
1611
1988
  agentId?: string;
1612
1989
  data: PendingMessagesModifiedData;
1990
+ /**
1991
+ * Always true for events that are transient and not persisted to the session event log on disk.
1992
+ */
1613
1993
  ephemeral: true;
1614
1994
  /**
1615
1995
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1623,6 +2003,9 @@ export interface PendingMessagesModifiedEvent {
1623
2003
  * ISO 8601 timestamp when the event was created
1624
2004
  */
1625
2005
  timestamp: string;
2006
+ /**
2007
+ * Type discriminator. Always "pending_messages.modified".
2008
+ */
1626
2009
  type: "pending_messages.modified";
1627
2010
  }
1628
2011
  /**
@@ -1630,6 +2013,9 @@ export interface PendingMessagesModifiedEvent {
1630
2013
  */
1631
2014
  export interface PendingMessagesModifiedData {
1632
2015
  }
2016
+ /**
2017
+ * Session event "assistant.turn_start". Turn initialization metadata including identifier and interaction tracking
2018
+ */
1633
2019
  export interface AssistantTurnStartEvent {
1634
2020
  /**
1635
2021
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1652,6 +2038,9 @@ export interface AssistantTurnStartEvent {
1652
2038
  * ISO 8601 timestamp when the event was created
1653
2039
  */
1654
2040
  timestamp: string;
2041
+ /**
2042
+ * Type discriminator. Always "assistant.turn_start".
2043
+ */
1655
2044
  type: "assistant.turn_start";
1656
2045
  }
1657
2046
  /**
@@ -1667,12 +2056,18 @@ export interface AssistantTurnStartData {
1667
2056
  */
1668
2057
  turnId: string;
1669
2058
  }
2059
+ /**
2060
+ * Session event "assistant.intent". Agent intent description for current activity or plan
2061
+ */
1670
2062
  export interface AssistantIntentEvent {
1671
2063
  /**
1672
2064
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1673
2065
  */
1674
2066
  agentId?: string;
1675
2067
  data: AssistantIntentData;
2068
+ /**
2069
+ * Always true for events that are transient and not persisted to the session event log on disk.
2070
+ */
1676
2071
  ephemeral: true;
1677
2072
  /**
1678
2073
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1686,6 +2081,9 @@ export interface AssistantIntentEvent {
1686
2081
  * ISO 8601 timestamp when the event was created
1687
2082
  */
1688
2083
  timestamp: string;
2084
+ /**
2085
+ * Type discriminator. Always "assistant.intent".
2086
+ */
1689
2087
  type: "assistant.intent";
1690
2088
  }
1691
2089
  /**
@@ -1697,6 +2095,9 @@ export interface AssistantIntentData {
1697
2095
  */
1698
2096
  intent: string;
1699
2097
  }
2098
+ /**
2099
+ * Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text
2100
+ */
1700
2101
  export interface AssistantReasoningEvent {
1701
2102
  /**
1702
2103
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1719,6 +2120,9 @@ export interface AssistantReasoningEvent {
1719
2120
  * ISO 8601 timestamp when the event was created
1720
2121
  */
1721
2122
  timestamp: string;
2123
+ /**
2124
+ * Type discriminator. Always "assistant.reasoning".
2125
+ */
1722
2126
  type: "assistant.reasoning";
1723
2127
  }
1724
2128
  /**
@@ -1734,12 +2138,18 @@ export interface AssistantReasoningData {
1734
2138
  */
1735
2139
  reasoningId: string;
1736
2140
  }
2141
+ /**
2142
+ * Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates
2143
+ */
1737
2144
  export interface AssistantReasoningDeltaEvent {
1738
2145
  /**
1739
2146
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1740
2147
  */
1741
2148
  agentId?: string;
1742
2149
  data: AssistantReasoningDeltaData;
2150
+ /**
2151
+ * Always true for events that are transient and not persisted to the session event log on disk.
2152
+ */
1743
2153
  ephemeral: true;
1744
2154
  /**
1745
2155
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1753,6 +2163,9 @@ export interface AssistantReasoningDeltaEvent {
1753
2163
  * ISO 8601 timestamp when the event was created
1754
2164
  */
1755
2165
  timestamp: string;
2166
+ /**
2167
+ * Type discriminator. Always "assistant.reasoning_delta".
2168
+ */
1756
2169
  type: "assistant.reasoning_delta";
1757
2170
  }
1758
2171
  /**
@@ -1768,12 +2181,18 @@ export interface AssistantReasoningDeltaData {
1768
2181
  */
1769
2182
  reasoningId: string;
1770
2183
  }
2184
+ /**
2185
+ * Session event "assistant.streaming_delta". Streaming response progress with cumulative byte count
2186
+ */
1771
2187
  export interface AssistantStreamingDeltaEvent {
1772
2188
  /**
1773
2189
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1774
2190
  */
1775
2191
  agentId?: string;
1776
2192
  data: AssistantStreamingDeltaData;
2193
+ /**
2194
+ * Always true for events that are transient and not persisted to the session event log on disk.
2195
+ */
1777
2196
  ephemeral: true;
1778
2197
  /**
1779
2198
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1787,6 +2206,9 @@ export interface AssistantStreamingDeltaEvent {
1787
2206
  * ISO 8601 timestamp when the event was created
1788
2207
  */
1789
2208
  timestamp: string;
2209
+ /**
2210
+ * Type discriminator. Always "assistant.streaming_delta".
2211
+ */
1790
2212
  type: "assistant.streaming_delta";
1791
2213
  }
1792
2214
  /**
@@ -1798,6 +2220,9 @@ export interface AssistantStreamingDeltaData {
1798
2220
  */
1799
2221
  totalResponseSizeBytes: number;
1800
2222
  }
2223
+ /**
2224
+ * Session event "assistant.message". Assistant response containing text content, optional tool requests, and interaction metadata
2225
+ */
1801
2226
  export interface AssistantMessageEvent {
1802
2227
  /**
1803
2228
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1820,6 +2245,9 @@ export interface AssistantMessageEvent {
1820
2245
  * ISO 8601 timestamp when the event was created
1821
2246
  */
1822
2247
  timestamp: string;
2248
+ /**
2249
+ * Type discriminator. Always "assistant.message".
2250
+ */
1823
2251
  type: "assistant.message";
1824
2252
  }
1825
2253
  /**
@@ -1896,7 +2324,7 @@ export interface AssistantMessageToolRequest {
1896
2324
  * Arguments to pass to the tool, format depends on the tool
1897
2325
  */
1898
2326
  arguments?: {
1899
- [k: string]: unknown;
2327
+ [k: string]: unknown | undefined;
1900
2328
  };
1901
2329
  /**
1902
2330
  * Resolved intention summary describing what this specific call does
@@ -1924,12 +2352,18 @@ export interface AssistantMessageToolRequest {
1924
2352
  toolTitle?: string;
1925
2353
  type?: AssistantMessageToolRequestType;
1926
2354
  }
2355
+ /**
2356
+ * Session event "assistant.message_start". Streaming assistant message start metadata
2357
+ */
1927
2358
  export interface AssistantMessageStartEvent {
1928
2359
  /**
1929
2360
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1930
2361
  */
1931
2362
  agentId?: string;
1932
2363
  data: AssistantMessageStartData;
2364
+ /**
2365
+ * Always true for events that are transient and not persisted to the session event log on disk.
2366
+ */
1933
2367
  ephemeral: true;
1934
2368
  /**
1935
2369
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1943,6 +2377,9 @@ export interface AssistantMessageStartEvent {
1943
2377
  * ISO 8601 timestamp when the event was created
1944
2378
  */
1945
2379
  timestamp: string;
2380
+ /**
2381
+ * Type discriminator. Always "assistant.message_start".
2382
+ */
1946
2383
  type: "assistant.message_start";
1947
2384
  }
1948
2385
  /**
@@ -1958,12 +2395,18 @@ export interface AssistantMessageStartData {
1958
2395
  */
1959
2396
  phase?: string;
1960
2397
  }
2398
+ /**
2399
+ * Session event "assistant.message_delta". Streaming assistant message delta for incremental response updates
2400
+ */
1961
2401
  export interface AssistantMessageDeltaEvent {
1962
2402
  /**
1963
2403
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1964
2404
  */
1965
2405
  agentId?: string;
1966
2406
  data: AssistantMessageDeltaData;
2407
+ /**
2408
+ * Always true for events that are transient and not persisted to the session event log on disk.
2409
+ */
1967
2410
  ephemeral: true;
1968
2411
  /**
1969
2412
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1977,6 +2420,9 @@ export interface AssistantMessageDeltaEvent {
1977
2420
  * ISO 8601 timestamp when the event was created
1978
2421
  */
1979
2422
  timestamp: string;
2423
+ /**
2424
+ * Type discriminator. Always "assistant.message_delta".
2425
+ */
1980
2426
  type: "assistant.message_delta";
1981
2427
  }
1982
2428
  /**
@@ -1997,6 +2443,9 @@ export interface AssistantMessageDeltaData {
1997
2443
  */
1998
2444
  parentToolCallId?: string;
1999
2445
  }
2446
+ /**
2447
+ * Session event "assistant.turn_end". Turn completion metadata including the turn identifier
2448
+ */
2000
2449
  export interface AssistantTurnEndEvent {
2001
2450
  /**
2002
2451
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2019,6 +2468,9 @@ export interface AssistantTurnEndEvent {
2019
2468
  * ISO 8601 timestamp when the event was created
2020
2469
  */
2021
2470
  timestamp: string;
2471
+ /**
2472
+ * Type discriminator. Always "assistant.turn_end".
2473
+ */
2022
2474
  type: "assistant.turn_end";
2023
2475
  }
2024
2476
  /**
@@ -2030,12 +2482,18 @@ export interface AssistantTurnEndData {
2030
2482
  */
2031
2483
  turnId: string;
2032
2484
  }
2485
+ /**
2486
+ * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information
2487
+ */
2033
2488
  export interface AssistantUsageEvent {
2034
2489
  /**
2035
2490
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2036
2491
  */
2037
2492
  agentId?: string;
2038
2493
  data: AssistantUsageData;
2494
+ /**
2495
+ * Always true for events that are transient and not persisted to the session event log on disk.
2496
+ */
2039
2497
  ephemeral: true;
2040
2498
  /**
2041
2499
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2049,6 +2507,9 @@ export interface AssistantUsageEvent {
2049
2507
  * ISO 8601 timestamp when the event was created
2050
2508
  */
2051
2509
  timestamp: string;
2510
+ /**
2511
+ * Type discriminator. Always "assistant.usage".
2512
+ */
2052
2513
  type: "assistant.usage";
2053
2514
  }
2054
2515
  /**
@@ -2059,6 +2520,7 @@ export interface AssistantUsageData {
2059
2520
  * Completion ID from the model provider (e.g., chatcmpl-abc123)
2060
2521
  */
2061
2522
  apiCallId?: string;
2523
+ apiEndpoint?: AssistantUsageApiEndpoint;
2062
2524
  /**
2063
2525
  * Number of tokens read from prompt cache
2064
2526
  */
@@ -2109,10 +2571,10 @@ export interface AssistantUsageData {
2109
2571
  * Per-quota resource usage snapshots, keyed by quota identifier
2110
2572
  */
2111
2573
  quotaSnapshots?: {
2112
- [k: string]: AssistantUsageQuotaSnapshot;
2574
+ [k: string]: AssistantUsageQuotaSnapshot | undefined;
2113
2575
  };
2114
2576
  /**
2115
- * Reasoning effort level used for model calls, if applicable (e.g. "low", "medium", "high", "xhigh")
2577
+ * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
2116
2578
  */
2117
2579
  reasoningEffort?: string;
2118
2580
  /**
@@ -2122,7 +2584,7 @@ export interface AssistantUsageData {
2122
2584
  /**
2123
2585
  * Time to first token in milliseconds. Only available for streaming requests
2124
2586
  */
2125
- ttftMs?: number;
2587
+ timeToFirstTokenMs?: number;
2126
2588
  }
2127
2589
  /**
2128
2590
  * Per-request cost and usage data from the CAPI copilot_usage response field
@@ -2158,6 +2620,9 @@ export interface AssistantUsageCopilotUsageTokenDetail {
2158
2620
  */
2159
2621
  tokenType: string;
2160
2622
  }
2623
+ /**
2624
+ * Schema for the `AssistantUsageQuotaSnapshot` type.
2625
+ */
2161
2626
  export interface AssistantUsageQuotaSnapshot {
2162
2627
  /**
2163
2628
  * Total requests allowed by the entitlement
@@ -2176,7 +2641,7 @@ export interface AssistantUsageQuotaSnapshot {
2176
2641
  */
2177
2642
  overageAllowedWithExhaustedQuota: boolean;
2178
2643
  /**
2179
- * Percentage of quota remaining (0.0 to 1.0)
2644
+ * Percentage of quota remaining (0 to 100)
2180
2645
  */
2181
2646
  remainingPercentage: number;
2182
2647
  /**
@@ -2192,12 +2657,18 @@ export interface AssistantUsageQuotaSnapshot {
2192
2657
  */
2193
2658
  usedRequests: number;
2194
2659
  }
2660
+ /**
2661
+ * Session event "model.call_failure". Failed LLM API call metadata for telemetry
2662
+ */
2195
2663
  export interface ModelCallFailureEvent {
2196
2664
  /**
2197
2665
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2198
2666
  */
2199
2667
  agentId?: string;
2200
2668
  data: ModelCallFailureData;
2669
+ /**
2670
+ * Always true for events that are transient and not persisted to the session event log on disk.
2671
+ */
2201
2672
  ephemeral: true;
2202
2673
  /**
2203
2674
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2211,6 +2682,9 @@ export interface ModelCallFailureEvent {
2211
2682
  * ISO 8601 timestamp when the event was created
2212
2683
  */
2213
2684
  timestamp: string;
2685
+ /**
2686
+ * Type discriminator. Always "model.call_failure".
2687
+ */
2214
2688
  type: "model.call_failure";
2215
2689
  }
2216
2690
  /**
@@ -2247,6 +2721,9 @@ export interface ModelCallFailureData {
2247
2721
  */
2248
2722
  statusCode?: number;
2249
2723
  }
2724
+ /**
2725
+ * Session event "abort". Turn abort information including the reason for termination
2726
+ */
2250
2727
  export interface AbortEvent {
2251
2728
  /**
2252
2729
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2269,6 +2746,9 @@ export interface AbortEvent {
2269
2746
  * ISO 8601 timestamp when the event was created
2270
2747
  */
2271
2748
  timestamp: string;
2749
+ /**
2750
+ * Type discriminator. Always "abort".
2751
+ */
2272
2752
  type: "abort";
2273
2753
  }
2274
2754
  /**
@@ -2277,6 +2757,9 @@ export interface AbortEvent {
2277
2757
  export interface AbortData {
2278
2758
  reason: AbortReason;
2279
2759
  }
2760
+ /**
2761
+ * Session event "tool.user_requested". User-initiated tool invocation request with tool name and arguments
2762
+ */
2280
2763
  export interface ToolUserRequestedEvent {
2281
2764
  /**
2282
2765
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2299,6 +2782,9 @@ export interface ToolUserRequestedEvent {
2299
2782
  * ISO 8601 timestamp when the event was created
2300
2783
  */
2301
2784
  timestamp: string;
2785
+ /**
2786
+ * Type discriminator. Always "tool.user_requested".
2787
+ */
2302
2788
  type: "tool.user_requested";
2303
2789
  }
2304
2790
  /**
@@ -2309,7 +2795,7 @@ export interface ToolUserRequestedData {
2309
2795
  * Arguments for the tool invocation
2310
2796
  */
2311
2797
  arguments?: {
2312
- [k: string]: unknown;
2798
+ [k: string]: unknown | undefined;
2313
2799
  };
2314
2800
  /**
2315
2801
  * Unique identifier for this tool call
@@ -2320,6 +2806,9 @@ export interface ToolUserRequestedData {
2320
2806
  */
2321
2807
  toolName: string;
2322
2808
  }
2809
+ /**
2810
+ * Session event "tool.execution_start". Tool execution startup details including MCP server information when applicable
2811
+ */
2323
2812
  export interface ToolExecutionStartEvent {
2324
2813
  /**
2325
2814
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2342,6 +2831,9 @@ export interface ToolExecutionStartEvent {
2342
2831
  * ISO 8601 timestamp when the event was created
2343
2832
  */
2344
2833
  timestamp: string;
2834
+ /**
2835
+ * Type discriminator. Always "tool.execution_start".
2836
+ */
2345
2837
  type: "tool.execution_start";
2346
2838
  }
2347
2839
  /**
@@ -2352,7 +2844,7 @@ export interface ToolExecutionStartData {
2352
2844
  * Arguments passed to the tool
2353
2845
  */
2354
2846
  arguments?: {
2355
- [k: string]: unknown;
2847
+ [k: string]: unknown | undefined;
2356
2848
  };
2357
2849
  /**
2358
2850
  * Name of the MCP server hosting this tool, when the tool is an MCP tool
@@ -2380,12 +2872,18 @@ export interface ToolExecutionStartData {
2380
2872
  */
2381
2873
  turnId?: string;
2382
2874
  }
2875
+ /**
2876
+ * Session event "tool.execution_partial_result". Streaming tool execution output for incremental result display
2877
+ */
2383
2878
  export interface ToolExecutionPartialResultEvent {
2384
2879
  /**
2385
2880
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2386
2881
  */
2387
2882
  agentId?: string;
2388
2883
  data: ToolExecutionPartialData;
2884
+ /**
2885
+ * Always true for events that are transient and not persisted to the session event log on disk.
2886
+ */
2389
2887
  ephemeral: true;
2390
2888
  /**
2391
2889
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2399,6 +2897,9 @@ export interface ToolExecutionPartialResultEvent {
2399
2897
  * ISO 8601 timestamp when the event was created
2400
2898
  */
2401
2899
  timestamp: string;
2900
+ /**
2901
+ * Type discriminator. Always "tool.execution_partial_result".
2902
+ */
2402
2903
  type: "tool.execution_partial_result";
2403
2904
  }
2404
2905
  /**
@@ -2414,12 +2915,18 @@ export interface ToolExecutionPartialData {
2414
2915
  */
2415
2916
  toolCallId: string;
2416
2917
  }
2918
+ /**
2919
+ * Session event "tool.execution_progress". Tool execution progress notification with status message
2920
+ */
2417
2921
  export interface ToolExecutionProgressEvent {
2418
2922
  /**
2419
2923
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2420
2924
  */
2421
2925
  agentId?: string;
2422
2926
  data: ToolExecutionProgressData;
2927
+ /**
2928
+ * Always true for events that are transient and not persisted to the session event log on disk.
2929
+ */
2423
2930
  ephemeral: true;
2424
2931
  /**
2425
2932
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2433,6 +2940,9 @@ export interface ToolExecutionProgressEvent {
2433
2940
  * ISO 8601 timestamp when the event was created
2434
2941
  */
2435
2942
  timestamp: string;
2943
+ /**
2944
+ * Type discriminator. Always "tool.execution_progress".
2945
+ */
2436
2946
  type: "tool.execution_progress";
2437
2947
  }
2438
2948
  /**
@@ -2448,6 +2958,9 @@ export interface ToolExecutionProgressData {
2448
2958
  */
2449
2959
  toolCallId: string;
2450
2960
  }
2961
+ /**
2962
+ * Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information
2963
+ */
2451
2964
  export interface ToolExecutionCompleteEvent {
2452
2965
  /**
2453
2966
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2470,6 +2983,9 @@ export interface ToolExecutionCompleteEvent {
2470
2983
  * ISO 8601 timestamp when the event was created
2471
2984
  */
2472
2985
  timestamp: string;
2986
+ /**
2987
+ * Type discriminator. Always "tool.execution_complete".
2988
+ */
2473
2989
  type: "tool.execution_complete";
2474
2990
  }
2475
2991
  /**
@@ -2507,7 +3023,7 @@ export interface ToolExecutionCompleteData {
2507
3023
  * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)
2508
3024
  */
2509
3025
  toolTelemetry?: {
2510
- [k: string]: unknown;
3026
+ [k: string]: unknown | undefined;
2511
3027
  };
2512
3028
  /**
2513
3029
  * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
@@ -2677,6 +3193,9 @@ export interface ToolExecutionCompleteContentResource {
2677
3193
  */
2678
3194
  type: "resource";
2679
3195
  }
3196
+ /**
3197
+ * Schema for the `EmbeddedTextResourceContents` type.
3198
+ */
2680
3199
  export interface EmbeddedTextResourceContents {
2681
3200
  /**
2682
3201
  * MIME type of the text content
@@ -2691,6 +3210,9 @@ export interface EmbeddedTextResourceContents {
2691
3210
  */
2692
3211
  uri: string;
2693
3212
  }
3213
+ /**
3214
+ * Schema for the `EmbeddedBlobResourceContents` type.
3215
+ */
2694
3216
  export interface EmbeddedBlobResourceContents {
2695
3217
  /**
2696
3218
  * Base64-encoded binary content of the resource
@@ -2705,6 +3227,9 @@ export interface EmbeddedBlobResourceContents {
2705
3227
  */
2706
3228
  uri: string;
2707
3229
  }
3230
+ /**
3231
+ * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata
3232
+ */
2708
3233
  export interface SkillInvokedEvent {
2709
3234
  /**
2710
3235
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2727,6 +3252,9 @@ export interface SkillInvokedEvent {
2727
3252
  * ISO 8601 timestamp when the event was created
2728
3253
  */
2729
3254
  timestamp: string;
3255
+ /**
3256
+ * Type discriminator. Always "skill.invoked".
3257
+ */
2730
3258
  type: "skill.invoked";
2731
3259
  }
2732
3260
  /**
@@ -2762,6 +3290,9 @@ export interface SkillInvokedData {
2762
3290
  */
2763
3291
  pluginVersion?: string;
2764
3292
  }
3293
+ /**
3294
+ * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information
3295
+ */
2765
3296
  export interface SubagentStartedEvent {
2766
3297
  /**
2767
3298
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2784,6 +3315,9 @@ export interface SubagentStartedEvent {
2784
3315
  * ISO 8601 timestamp when the event was created
2785
3316
  */
2786
3317
  timestamp: string;
3318
+ /**
3319
+ * Type discriminator. Always "subagent.started".
3320
+ */
2787
3321
  type: "subagent.started";
2788
3322
  }
2789
3323
  /**
@@ -2811,6 +3345,9 @@ export interface SubagentStartedData {
2811
3345
  */
2812
3346
  toolCallId: string;
2813
3347
  }
3348
+ /**
3349
+ * Session event "subagent.completed". Sub-agent completion details for successful execution
3350
+ */
2814
3351
  export interface SubagentCompletedEvent {
2815
3352
  /**
2816
3353
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2833,6 +3370,9 @@ export interface SubagentCompletedEvent {
2833
3370
  * ISO 8601 timestamp when the event was created
2834
3371
  */
2835
3372
  timestamp: string;
3373
+ /**
3374
+ * Type discriminator. Always "subagent.completed".
3375
+ */
2836
3376
  type: "subagent.completed";
2837
3377
  }
2838
3378
  /**
@@ -2868,6 +3408,9 @@ export interface SubagentCompletedData {
2868
3408
  */
2869
3409
  totalToolCalls?: number;
2870
3410
  }
3411
+ /**
3412
+ * Session event "subagent.failed". Sub-agent failure details including error message and agent information
3413
+ */
2871
3414
  export interface SubagentFailedEvent {
2872
3415
  /**
2873
3416
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2890,6 +3433,9 @@ export interface SubagentFailedEvent {
2890
3433
  * ISO 8601 timestamp when the event was created
2891
3434
  */
2892
3435
  timestamp: string;
3436
+ /**
3437
+ * Type discriminator. Always "subagent.failed".
3438
+ */
2893
3439
  type: "subagent.failed";
2894
3440
  }
2895
3441
  /**
@@ -2929,6 +3475,9 @@ export interface SubagentFailedData {
2929
3475
  */
2930
3476
  totalToolCalls?: number;
2931
3477
  }
3478
+ /**
3479
+ * Session event "subagent.selected". Custom agent selection details including name and available tools
3480
+ */
2932
3481
  export interface SubagentSelectedEvent {
2933
3482
  /**
2934
3483
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2951,7 +3500,10 @@ export interface SubagentSelectedEvent {
2951
3500
  * ISO 8601 timestamp when the event was created
2952
3501
  */
2953
3502
  timestamp: string;
2954
- type: "subagent.selected";
3503
+ /**
3504
+ * Type discriminator. Always "subagent.selected".
3505
+ */
3506
+ type: "subagent.selected";
2955
3507
  }
2956
3508
  /**
2957
3509
  * Custom agent selection details including name and available tools
@@ -2970,6 +3522,9 @@ export interface SubagentSelectedData {
2970
3522
  */
2971
3523
  tools: string[] | null;
2972
3524
  }
3525
+ /**
3526
+ * Session event "subagent.deselected". Empty payload; the event signals that the custom agent was deselected, returning to the default agent
3527
+ */
2973
3528
  export interface SubagentDeselectedEvent {
2974
3529
  /**
2975
3530
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2992,6 +3547,9 @@ export interface SubagentDeselectedEvent {
2992
3547
  * ISO 8601 timestamp when the event was created
2993
3548
  */
2994
3549
  timestamp: string;
3550
+ /**
3551
+ * Type discriminator. Always "subagent.deselected".
3552
+ */
2995
3553
  type: "subagent.deselected";
2996
3554
  }
2997
3555
  /**
@@ -2999,6 +3557,9 @@ export interface SubagentDeselectedEvent {
2999
3557
  */
3000
3558
  export interface SubagentDeselectedData {
3001
3559
  }
3560
+ /**
3561
+ * Session event "hook.start". Hook invocation start details including type and input data
3562
+ */
3002
3563
  export interface HookStartEvent {
3003
3564
  /**
3004
3565
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3021,6 +3582,9 @@ export interface HookStartEvent {
3021
3582
  * ISO 8601 timestamp when the event was created
3022
3583
  */
3023
3584
  timestamp: string;
3585
+ /**
3586
+ * Type discriminator. Always "hook.start".
3587
+ */
3024
3588
  type: "hook.start";
3025
3589
  }
3026
3590
  /**
@@ -3039,9 +3603,12 @@ export interface HookStartData {
3039
3603
  * Input data passed to the hook
3040
3604
  */
3041
3605
  input?: {
3042
- [k: string]: unknown;
3606
+ [k: string]: unknown | undefined;
3043
3607
  };
3044
3608
  }
3609
+ /**
3610
+ * Session event "hook.end". Hook invocation completion details including output, success status, and error information
3611
+ */
3045
3612
  export interface HookEndEvent {
3046
3613
  /**
3047
3614
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3064,6 +3631,9 @@ export interface HookEndEvent {
3064
3631
  * ISO 8601 timestamp when the event was created
3065
3632
  */
3066
3633
  timestamp: string;
3634
+ /**
3635
+ * Type discriminator. Always "hook.end".
3636
+ */
3067
3637
  type: "hook.end";
3068
3638
  }
3069
3639
  /**
@@ -3083,7 +3653,7 @@ export interface HookEndData {
3083
3653
  * Output data produced by the hook
3084
3654
  */
3085
3655
  output?: {
3086
- [k: string]: unknown;
3656
+ [k: string]: unknown | undefined;
3087
3657
  };
3088
3658
  /**
3089
3659
  * Whether the hook completed successfully
@@ -3103,6 +3673,9 @@ export interface HookEndError {
3103
3673
  */
3104
3674
  stack?: string;
3105
3675
  }
3676
+ /**
3677
+ * Session event "system.message". System/developer instruction content with role and optional template metadata
3678
+ */
3106
3679
  export interface SystemMessageEvent {
3107
3680
  /**
3108
3681
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3125,6 +3698,9 @@ export interface SystemMessageEvent {
3125
3698
  * ISO 8601 timestamp when the event was created
3126
3699
  */
3127
3700
  timestamp: string;
3701
+ /**
3702
+ * Type discriminator. Always "system.message".
3703
+ */
3128
3704
  type: "system.message";
3129
3705
  }
3130
3706
  /**
@@ -3154,9 +3730,12 @@ export interface SystemMessageMetadata {
3154
3730
  * Template variables used when constructing the prompt
3155
3731
  */
3156
3732
  variables?: {
3157
- [k: string]: unknown;
3733
+ [k: string]: unknown | undefined;
3158
3734
  };
3159
3735
  }
3736
+ /**
3737
+ * Session event "system.notification". System-generated notification for runtime events like background task completion
3738
+ */
3160
3739
  export interface SystemNotificationEvent {
3161
3740
  /**
3162
3741
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3179,6 +3758,9 @@ export interface SystemNotificationEvent {
3179
3758
  * ISO 8601 timestamp when the event was created
3180
3759
  */
3181
3760
  timestamp: string;
3761
+ /**
3762
+ * Type discriminator. Always "system.notification".
3763
+ */
3182
3764
  type: "system.notification";
3183
3765
  }
3184
3766
  /**
@@ -3191,6 +3773,9 @@ export interface SystemNotificationData {
3191
3773
  content: string;
3192
3774
  kind: SystemNotification;
3193
3775
  }
3776
+ /**
3777
+ * Schema for the `SystemNotificationAgentCompleted` type.
3778
+ */
3194
3779
  export interface SystemNotificationAgentCompleted {
3195
3780
  /**
3196
3781
  * Unique identifier of the background agent
@@ -3209,8 +3794,14 @@ export interface SystemNotificationAgentCompleted {
3209
3794
  */
3210
3795
  prompt?: string;
3211
3796
  status: SystemNotificationAgentCompletedStatus;
3797
+ /**
3798
+ * Type discriminator. Always "agent_completed".
3799
+ */
3212
3800
  type: "agent_completed";
3213
3801
  }
3802
+ /**
3803
+ * Schema for the `SystemNotificationAgentIdle` type.
3804
+ */
3214
3805
  export interface SystemNotificationAgentIdle {
3215
3806
  /**
3216
3807
  * Unique identifier of the background agent
@@ -3224,8 +3815,14 @@ export interface SystemNotificationAgentIdle {
3224
3815
  * Human-readable description of the agent task
3225
3816
  */
3226
3817
  description?: string;
3818
+ /**
3819
+ * Type discriminator. Always "agent_idle".
3820
+ */
3227
3821
  type: "agent_idle";
3228
3822
  }
3823
+ /**
3824
+ * Schema for the `SystemNotificationNewInboxMessage` type.
3825
+ */
3229
3826
  export interface SystemNotificationNewInboxMessage {
3230
3827
  /**
3231
3828
  * Unique identifier of the inbox entry
@@ -3243,8 +3840,14 @@ export interface SystemNotificationNewInboxMessage {
3243
3840
  * Short summary shown before the agent decides whether to read the inbox
3244
3841
  */
3245
3842
  summary: string;
3843
+ /**
3844
+ * Type discriminator. Always "new_inbox_message".
3845
+ */
3246
3846
  type: "new_inbox_message";
3247
3847
  }
3848
+ /**
3849
+ * Schema for the `SystemNotificationShellCompleted` type.
3850
+ */
3248
3851
  export interface SystemNotificationShellCompleted {
3249
3852
  /**
3250
3853
  * Human-readable description of the command
@@ -3258,8 +3861,14 @@ export interface SystemNotificationShellCompleted {
3258
3861
  * Unique identifier of the shell session
3259
3862
  */
3260
3863
  shellId: string;
3864
+ /**
3865
+ * Type discriminator. Always "shell_completed".
3866
+ */
3261
3867
  type: "shell_completed";
3262
3868
  }
3869
+ /**
3870
+ * Schema for the `SystemNotificationShellDetachedCompleted` type.
3871
+ */
3263
3872
  export interface SystemNotificationShellDetachedCompleted {
3264
3873
  /**
3265
3874
  * Human-readable description of the command
@@ -3269,8 +3878,14 @@ export interface SystemNotificationShellDetachedCompleted {
3269
3878
  * Unique identifier of the detached shell session
3270
3879
  */
3271
3880
  shellId: string;
3881
+ /**
3882
+ * Type discriminator. Always "shell_detached_completed".
3883
+ */
3272
3884
  type: "shell_detached_completed";
3273
3885
  }
3886
+ /**
3887
+ * Schema for the `SystemNotificationInstructionDiscovered` type.
3888
+ */
3274
3889
  export interface SystemNotificationInstructionDiscovered {
3275
3890
  /**
3276
3891
  * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/')
@@ -3288,8 +3903,14 @@ export interface SystemNotificationInstructionDiscovered {
3288
3903
  * Tool command that triggered discovery (currently always 'view')
3289
3904
  */
3290
3905
  triggerTool: string;
3906
+ /**
3907
+ * Type discriminator. Always "instruction_discovered".
3908
+ */
3291
3909
  type: "instruction_discovered";
3292
3910
  }
3911
+ /**
3912
+ * Session event "permission.requested". Permission request notification requiring client approval with request details
3913
+ */
3293
3914
  export interface PermissionRequestedEvent {
3294
3915
  /**
3295
3916
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3312,6 +3933,9 @@ export interface PermissionRequestedEvent {
3312
3933
  * ISO 8601 timestamp when the event was created
3313
3934
  */
3314
3935
  timestamp: string;
3936
+ /**
3937
+ * Type discriminator. Always "permission.requested".
3938
+ */
3315
3939
  type: "permission.requested";
3316
3940
  }
3317
3941
  /**
@@ -3374,6 +3998,9 @@ export interface PermissionRequestShell {
3374
3998
  */
3375
3999
  warning?: string;
3376
4000
  }
4001
+ /**
4002
+ * Schema for the `PermissionRequestShellCommand` type.
4003
+ */
3377
4004
  export interface PermissionRequestShellCommand {
3378
4005
  /**
3379
4006
  * Command identifier (e.g., executable name)
@@ -3384,6 +4011,9 @@ export interface PermissionRequestShellCommand {
3384
4011
  */
3385
4012
  readOnly: boolean;
3386
4013
  }
4014
+ /**
4015
+ * Schema for the `PermissionRequestShellPossibleUrl` type.
4016
+ */
3387
4017
  export interface PermissionRequestShellPossibleUrl {
3388
4018
  /**
3389
4019
  * URL that may be accessed by the command
@@ -3452,7 +4082,7 @@ export interface PermissionRequestMcp {
3452
4082
  * Arguments to pass to the MCP tool
3453
4083
  */
3454
4084
  args?: {
3455
- [k: string]: unknown;
4085
+ [k: string]: unknown | undefined;
3456
4086
  };
3457
4087
  /**
3458
4088
  * Permission kind discriminator
@@ -3539,7 +4169,7 @@ export interface PermissionRequestCustomTool {
3539
4169
  * Arguments to pass to the custom tool
3540
4170
  */
3541
4171
  args?: {
3542
- [k: string]: unknown;
4172
+ [k: string]: unknown | undefined;
3543
4173
  };
3544
4174
  /**
3545
4175
  * Permission kind discriminator
@@ -3574,7 +4204,7 @@ export interface PermissionRequestHook {
3574
4204
  * Arguments of the tool call being gated
3575
4205
  */
3576
4206
  toolArgs?: {
3577
- [k: string]: unknown;
4207
+ [k: string]: unknown | undefined;
3578
4208
  };
3579
4209
  /**
3580
4210
  * Tool call ID that triggered this permission request
@@ -3765,12 +4395,12 @@ export interface PermissionPromptRequestUrl {
3765
4395
  * Memory operation permission prompt
3766
4396
  */
3767
4397
  export interface PermissionPromptRequestMemory {
3768
- action?: PermissionPromptRequestMemoryAction;
4398
+ action?: PermissionRequestMemoryAction;
3769
4399
  /**
3770
4400
  * Source references for the stored fact (store only)
3771
4401
  */
3772
4402
  citations?: string;
3773
- direction?: PermissionPromptRequestMemoryDirection;
4403
+ direction?: PermissionRequestMemoryDirection;
3774
4404
  /**
3775
4405
  * The fact being stored or voted on
3776
4406
  */
@@ -3800,7 +4430,7 @@ export interface PermissionPromptRequestCustomTool {
3800
4430
  * Arguments to pass to the custom tool
3801
4431
  */
3802
4432
  args?: {
3803
- [k: string]: unknown;
4433
+ [k: string]: unknown | undefined;
3804
4434
  };
3805
4435
  /**
3806
4436
  * Prompt kind discriminator
@@ -3853,7 +4483,7 @@ export interface PermissionPromptRequestHook {
3853
4483
  * Arguments of the tool call being gated
3854
4484
  */
3855
4485
  toolArgs?: {
3856
- [k: string]: unknown;
4486
+ [k: string]: unknown | undefined;
3857
4487
  };
3858
4488
  /**
3859
4489
  * Tool call ID that triggered this permission request
@@ -3906,6 +4536,9 @@ export interface PermissionPromptRequestExtensionPermissionAccess {
3906
4536
  */
3907
4537
  toolCallId?: string;
3908
4538
  }
4539
+ /**
4540
+ * Session event "permission.completed". Permission request completion notification signaling UI dismissal
4541
+ */
3909
4542
  export interface PermissionCompletedEvent {
3910
4543
  /**
3911
4544
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3928,6 +4561,9 @@ export interface PermissionCompletedEvent {
3928
4561
  * ISO 8601 timestamp when the event was created
3929
4562
  */
3930
4563
  timestamp: string;
4564
+ /**
4565
+ * Type discriminator. Always "permission.completed".
4566
+ */
3931
4567
  type: "permission.completed";
3932
4568
  }
3933
4569
  /**
@@ -3944,12 +4580,18 @@ export interface PermissionCompletedData {
3944
4580
  */
3945
4581
  toolCallId?: string;
3946
4582
  }
4583
+ /**
4584
+ * Schema for the `PermissionApproved` type.
4585
+ */
3947
4586
  export interface PermissionApproved {
3948
4587
  /**
3949
4588
  * The permission request was approved
3950
4589
  */
3951
4590
  kind: "approved";
3952
4591
  }
4592
+ /**
4593
+ * Schema for the `PermissionApprovedForSession` type.
4594
+ */
3953
4595
  export interface PermissionApprovedForSession {
3954
4596
  approval: UserToolSessionApproval;
3955
4597
  /**
@@ -3957,6 +4599,9 @@ export interface PermissionApprovedForSession {
3957
4599
  */
3958
4600
  kind: "approved-for-session";
3959
4601
  }
4602
+ /**
4603
+ * Schema for the `UserToolSessionApprovalCommands` type.
4604
+ */
3960
4605
  export interface UserToolSessionApprovalCommands {
3961
4606
  /**
3962
4607
  * Command identifiers approved by the user
@@ -3967,18 +4612,27 @@ export interface UserToolSessionApprovalCommands {
3967
4612
  */
3968
4613
  kind: "commands";
3969
4614
  }
4615
+ /**
4616
+ * Schema for the `UserToolSessionApprovalRead` type.
4617
+ */
3970
4618
  export interface UserToolSessionApprovalRead {
3971
4619
  /**
3972
4620
  * Read approval kind
3973
4621
  */
3974
4622
  kind: "read";
3975
4623
  }
4624
+ /**
4625
+ * Schema for the `UserToolSessionApprovalWrite` type.
4626
+ */
3976
4627
  export interface UserToolSessionApprovalWrite {
3977
4628
  /**
3978
4629
  * Write approval kind
3979
4630
  */
3980
4631
  kind: "write";
3981
4632
  }
4633
+ /**
4634
+ * Schema for the `UserToolSessionApprovalMcp` type.
4635
+ */
3982
4636
  export interface UserToolSessionApprovalMcp {
3983
4637
  /**
3984
4638
  * MCP tool approval kind
@@ -3993,12 +4647,18 @@ export interface UserToolSessionApprovalMcp {
3993
4647
  */
3994
4648
  toolName: string | null;
3995
4649
  }
4650
+ /**
4651
+ * Schema for the `UserToolSessionApprovalMemory` type.
4652
+ */
3996
4653
  export interface UserToolSessionApprovalMemory {
3997
4654
  /**
3998
4655
  * Memory approval kind
3999
4656
  */
4000
4657
  kind: "memory";
4001
4658
  }
4659
+ /**
4660
+ * Schema for the `UserToolSessionApprovalCustomTool` type.
4661
+ */
4002
4662
  export interface UserToolSessionApprovalCustomTool {
4003
4663
  /**
4004
4664
  * Custom tool approval kind
@@ -4009,6 +4669,9 @@ export interface UserToolSessionApprovalCustomTool {
4009
4669
  */
4010
4670
  toolName: string;
4011
4671
  }
4672
+ /**
4673
+ * Schema for the `UserToolSessionApprovalExtensionManagement` type.
4674
+ */
4012
4675
  export interface UserToolSessionApprovalExtensionManagement {
4013
4676
  /**
4014
4677
  * Extension management approval kind
@@ -4019,6 +4682,9 @@ export interface UserToolSessionApprovalExtensionManagement {
4019
4682
  */
4020
4683
  operation?: string;
4021
4684
  }
4685
+ /**
4686
+ * Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type.
4687
+ */
4022
4688
  export interface UserToolSessionApprovalExtensionPermissionAccess {
4023
4689
  /**
4024
4690
  * Extension name
@@ -4029,6 +4695,9 @@ export interface UserToolSessionApprovalExtensionPermissionAccess {
4029
4695
  */
4030
4696
  kind: "extension-permission-access";
4031
4697
  }
4698
+ /**
4699
+ * Schema for the `PermissionApprovedForLocation` type.
4700
+ */
4032
4701
  export interface PermissionApprovedForLocation {
4033
4702
  approval: UserToolSessionApproval;
4034
4703
  /**
@@ -4040,6 +4709,9 @@ export interface PermissionApprovedForLocation {
4040
4709
  */
4041
4710
  locationKey: string;
4042
4711
  }
4712
+ /**
4713
+ * Schema for the `PermissionCancelled` type.
4714
+ */
4043
4715
  export interface PermissionCancelled {
4044
4716
  /**
4045
4717
  * The permission request was cancelled before a response was used
@@ -4050,6 +4722,9 @@ export interface PermissionCancelled {
4050
4722
  */
4051
4723
  reason?: string;
4052
4724
  }
4725
+ /**
4726
+ * Schema for the `PermissionDeniedByRules` type.
4727
+ */
4053
4728
  export interface PermissionDeniedByRules {
4054
4729
  /**
4055
4730
  * Denied because approval rules explicitly blocked it
@@ -4060,9 +4735,12 @@ export interface PermissionDeniedByRules {
4060
4735
  */
4061
4736
  rules: PermissionRule[];
4062
4737
  }
4738
+ /**
4739
+ * Schema for the `PermissionRule` type.
4740
+ */
4063
4741
  export interface PermissionRule {
4064
4742
  /**
4065
- * Optional rule argument matched against the request
4743
+ * Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory').
4066
4744
  */
4067
4745
  argument: string | null;
4068
4746
  /**
@@ -4070,12 +4748,18 @@ export interface PermissionRule {
4070
4748
  */
4071
4749
  kind: string;
4072
4750
  }
4751
+ /**
4752
+ * Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.
4753
+ */
4073
4754
  export interface PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser {
4074
4755
  /**
4075
4756
  * Denied because no approval rule matched and user confirmation was unavailable
4076
4757
  */
4077
4758
  kind: "denied-no-approval-rule-and-could-not-request-from-user";
4078
4759
  }
4760
+ /**
4761
+ * Schema for the `PermissionDeniedInteractivelyByUser` type.
4762
+ */
4079
4763
  export interface PermissionDeniedInteractivelyByUser {
4080
4764
  /**
4081
4765
  * Optional feedback from the user explaining the denial
@@ -4090,6 +4774,9 @@ export interface PermissionDeniedInteractivelyByUser {
4090
4774
  */
4091
4775
  kind: "denied-interactively-by-user";
4092
4776
  }
4777
+ /**
4778
+ * Schema for the `PermissionDeniedByContentExclusionPolicy` type.
4779
+ */
4093
4780
  export interface PermissionDeniedByContentExclusionPolicy {
4094
4781
  /**
4095
4782
  * Denied by the organization's content exclusion policy
@@ -4104,6 +4791,9 @@ export interface PermissionDeniedByContentExclusionPolicy {
4104
4791
  */
4105
4792
  path: string;
4106
4793
  }
4794
+ /**
4795
+ * Schema for the `PermissionDeniedByPermissionRequestHook` type.
4796
+ */
4107
4797
  export interface PermissionDeniedByPermissionRequestHook {
4108
4798
  /**
4109
4799
  * Whether to interrupt the current agent turn
@@ -4118,12 +4808,18 @@ export interface PermissionDeniedByPermissionRequestHook {
4118
4808
  */
4119
4809
  message?: string;
4120
4810
  }
4811
+ /**
4812
+ * Session event "user_input.requested". User input request notification with question and optional predefined choices
4813
+ */
4121
4814
  export interface UserInputRequestedEvent {
4122
4815
  /**
4123
4816
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4124
4817
  */
4125
4818
  agentId?: string;
4126
4819
  data: UserInputRequestedData;
4820
+ /**
4821
+ * Always true for events that are transient and not persisted to the session event log on disk.
4822
+ */
4127
4823
  ephemeral: true;
4128
4824
  /**
4129
4825
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4137,6 +4833,9 @@ export interface UserInputRequestedEvent {
4137
4833
  * ISO 8601 timestamp when the event was created
4138
4834
  */
4139
4835
  timestamp: string;
4836
+ /**
4837
+ * Type discriminator. Always "user_input.requested".
4838
+ */
4140
4839
  type: "user_input.requested";
4141
4840
  }
4142
4841
  /**
@@ -4164,12 +4863,18 @@ export interface UserInputRequestedData {
4164
4863
  */
4165
4864
  toolCallId?: string;
4166
4865
  }
4866
+ /**
4867
+ * Session event "user_input.completed". User input request completion with the user's response
4868
+ */
4167
4869
  export interface UserInputCompletedEvent {
4168
4870
  /**
4169
4871
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4170
4872
  */
4171
4873
  agentId?: string;
4172
4874
  data: UserInputCompletedData;
4875
+ /**
4876
+ * Always true for events that are transient and not persisted to the session event log on disk.
4877
+ */
4173
4878
  ephemeral: true;
4174
4879
  /**
4175
4880
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4183,6 +4888,9 @@ export interface UserInputCompletedEvent {
4183
4888
  * ISO 8601 timestamp when the event was created
4184
4889
  */
4185
4890
  timestamp: string;
4891
+ /**
4892
+ * Type discriminator. Always "user_input.completed".
4893
+ */
4186
4894
  type: "user_input.completed";
4187
4895
  }
4188
4896
  /**
@@ -4202,12 +4910,18 @@ export interface UserInputCompletedData {
4202
4910
  */
4203
4911
  wasFreeform?: boolean;
4204
4912
  }
4913
+ /**
4914
+ * Session event "elicitation.requested". Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
4915
+ */
4205
4916
  export interface ElicitationRequestedEvent {
4206
4917
  /**
4207
4918
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4208
4919
  */
4209
4920
  agentId?: string;
4210
4921
  data: ElicitationRequestedData;
4922
+ /**
4923
+ * Always true for events that are transient and not persisted to the session event log on disk.
4924
+ */
4211
4925
  ephemeral: true;
4212
4926
  /**
4213
4927
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4221,6 +4935,9 @@ export interface ElicitationRequestedEvent {
4221
4935
  * ISO 8601 timestamp when the event was created
4222
4936
  */
4223
4937
  timestamp: string;
4938
+ /**
4939
+ * Type discriminator. Always "elicitation.requested".
4940
+ */
4224
4941
  type: "elicitation.requested";
4225
4942
  }
4226
4943
  /**
@@ -4249,7 +4966,7 @@ export interface ElicitationRequestedData {
4249
4966
  * URL to open in the user's browser (url mode only)
4250
4967
  */
4251
4968
  url?: string;
4252
- [k: string]: unknown;
4969
+ [k: string]: unknown | undefined;
4253
4970
  }
4254
4971
  /**
4255
4972
  * JSON Schema describing the form fields to present to the user (form mode only)
@@ -4259,7 +4976,7 @@ export interface ElicitationRequestedSchema {
4259
4976
  * Form field definitions, keyed by field name
4260
4977
  */
4261
4978
  properties: {
4262
- [k: string]: unknown;
4979
+ [k: string]: unknown | undefined;
4263
4980
  };
4264
4981
  /**
4265
4982
  * List of required field names
@@ -4270,12 +4987,18 @@ export interface ElicitationRequestedSchema {
4270
4987
  */
4271
4988
  type: "object";
4272
4989
  }
4990
+ /**
4991
+ * Session event "elicitation.completed". Elicitation request completion with the user's response
4992
+ */
4273
4993
  export interface ElicitationCompletedEvent {
4274
4994
  /**
4275
4995
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4276
4996
  */
4277
4997
  agentId?: string;
4278
4998
  data: ElicitationCompletedData;
4999
+ /**
5000
+ * Always true for events that are transient and not persisted to the session event log on disk.
5001
+ */
4279
5002
  ephemeral: true;
4280
5003
  /**
4281
5004
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4289,6 +5012,9 @@ export interface ElicitationCompletedEvent {
4289
5012
  * ISO 8601 timestamp when the event was created
4290
5013
  */
4291
5014
  timestamp: string;
5015
+ /**
5016
+ * Type discriminator. Always "elicitation.completed".
5017
+ */
4292
5018
  type: "elicitation.completed";
4293
5019
  }
4294
5020
  /**
@@ -4300,19 +5026,25 @@ export interface ElicitationCompletedData {
4300
5026
  * The submitted form data when action is 'accept'; keys match the requested schema fields
4301
5027
  */
4302
5028
  content?: {
4303
- [k: string]: ElicitationCompletedContent;
5029
+ [k: string]: ElicitationCompletedContent | undefined;
4304
5030
  };
4305
5031
  /**
4306
5032
  * Request ID of the resolved elicitation request; clients should dismiss any UI for this request
4307
5033
  */
4308
5034
  requestId: string;
4309
5035
  }
5036
+ /**
5037
+ * Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation
5038
+ */
4310
5039
  export interface SamplingRequestedEvent {
4311
5040
  /**
4312
5041
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4313
5042
  */
4314
5043
  agentId?: string;
4315
5044
  data: SamplingRequestedData;
5045
+ /**
5046
+ * Always true for events that are transient and not persisted to the session event log on disk.
5047
+ */
4316
5048
  ephemeral: true;
4317
5049
  /**
4318
5050
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4326,6 +5058,9 @@ export interface SamplingRequestedEvent {
4326
5058
  * ISO 8601 timestamp when the event was created
4327
5059
  */
4328
5060
  timestamp: string;
5061
+ /**
5062
+ * Type discriminator. Always "sampling.requested".
5063
+ */
4329
5064
  type: "sampling.requested";
4330
5065
  }
4331
5066
  /**
@@ -4344,14 +5079,20 @@ export interface SamplingRequestedData {
4344
5079
  * Name of the MCP server that initiated the sampling request
4345
5080
  */
4346
5081
  serverName: string;
4347
- [k: string]: unknown;
5082
+ [k: string]: unknown | undefined;
4348
5083
  }
5084
+ /**
5085
+ * Session event "sampling.completed". Sampling request completion notification signaling UI dismissal
5086
+ */
4349
5087
  export interface SamplingCompletedEvent {
4350
5088
  /**
4351
5089
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4352
5090
  */
4353
5091
  agentId?: string;
4354
5092
  data: SamplingCompletedData;
5093
+ /**
5094
+ * Always true for events that are transient and not persisted to the session event log on disk.
5095
+ */
4355
5096
  ephemeral: true;
4356
5097
  /**
4357
5098
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4365,6 +5106,9 @@ export interface SamplingCompletedEvent {
4365
5106
  * ISO 8601 timestamp when the event was created
4366
5107
  */
4367
5108
  timestamp: string;
5109
+ /**
5110
+ * Type discriminator. Always "sampling.completed".
5111
+ */
4368
5112
  type: "sampling.completed";
4369
5113
  }
4370
5114
  /**
@@ -4376,12 +5120,18 @@ export interface SamplingCompletedData {
4376
5120
  */
4377
5121
  requestId: string;
4378
5122
  }
5123
+ /**
5124
+ * Session event "mcp.oauth_required". OAuth authentication request for an MCP server
5125
+ */
4379
5126
  export interface McpOauthRequiredEvent {
4380
5127
  /**
4381
5128
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4382
5129
  */
4383
5130
  agentId?: string;
4384
5131
  data: McpOauthRequiredData;
5132
+ /**
5133
+ * Always true for events that are transient and not persisted to the session event log on disk.
5134
+ */
4385
5135
  ephemeral: true;
4386
5136
  /**
4387
5137
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4395,6 +5145,9 @@ export interface McpOauthRequiredEvent {
4395
5145
  * ISO 8601 timestamp when the event was created
4396
5146
  */
4397
5147
  timestamp: string;
5148
+ /**
5149
+ * Type discriminator. Always "mcp.oauth_required".
5150
+ */
4398
5151
  type: "mcp.oauth_required";
4399
5152
  }
4400
5153
  /**
@@ -4432,12 +5185,18 @@ export interface McpOauthRequiredStaticClientConfig {
4432
5185
  */
4433
5186
  publicClient?: boolean;
4434
5187
  }
5188
+ /**
5189
+ * Session event "mcp.oauth_completed". MCP OAuth request completion notification
5190
+ */
4435
5191
  export interface McpOauthCompletedEvent {
4436
5192
  /**
4437
5193
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4438
5194
  */
4439
5195
  agentId?: string;
4440
5196
  data: McpOauthCompletedData;
5197
+ /**
5198
+ * Always true for events that are transient and not persisted to the session event log on disk.
5199
+ */
4441
5200
  ephemeral: true;
4442
5201
  /**
4443
5202
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4451,6 +5210,9 @@ export interface McpOauthCompletedEvent {
4451
5210
  * ISO 8601 timestamp when the event was created
4452
5211
  */
4453
5212
  timestamp: string;
5213
+ /**
5214
+ * Type discriminator. Always "mcp.oauth_completed".
5215
+ */
4454
5216
  type: "mcp.oauth_completed";
4455
5217
  }
4456
5218
  /**
@@ -4462,6 +5224,64 @@ export interface McpOauthCompletedData {
4462
5224
  */
4463
5225
  requestId: string;
4464
5226
  }
5227
+ /**
5228
+ * Session event "session.custom_notification". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
5229
+ */
5230
+ export interface CustomNotificationEvent {
5231
+ /**
5232
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5233
+ */
5234
+ agentId?: string;
5235
+ data: CustomNotificationData;
5236
+ /**
5237
+ * Always true for events that are transient and not persisted to the session event log on disk.
5238
+ */
5239
+ ephemeral: true;
5240
+ /**
5241
+ * Unique event identifier (UUID v4), generated when the event is emitted
5242
+ */
5243
+ id: string;
5244
+ /**
5245
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
5246
+ */
5247
+ parentId: string | null;
5248
+ /**
5249
+ * ISO 8601 timestamp when the event was created
5250
+ */
5251
+ timestamp: string;
5252
+ /**
5253
+ * Type discriminator. Always "session.custom_notification".
5254
+ */
5255
+ type: "session.custom_notification";
5256
+ }
5257
+ /**
5258
+ * Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.
5259
+ */
5260
+ export interface CustomNotificationData {
5261
+ /**
5262
+ * Source-defined custom notification name
5263
+ */
5264
+ name: string;
5265
+ payload: CustomNotificationPayload;
5266
+ /**
5267
+ * Namespace for the custom notification producer
5268
+ */
5269
+ source: string;
5270
+ subject?: CustomNotificationSubject;
5271
+ /**
5272
+ * Optional source-defined payload schema version
5273
+ */
5274
+ version?: number;
5275
+ }
5276
+ /**
5277
+ * Optional source-defined string identifiers describing the payload subject
5278
+ */
5279
+ export interface CustomNotificationSubject {
5280
+ [k: string]: string | undefined;
5281
+ }
5282
+ /**
5283
+ * Session event "external_tool.requested". External tool invocation request for client-side tool execution
5284
+ */
4465
5285
  export interface ExternalToolRequestedEvent {
4466
5286
  /**
4467
5287
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -4484,6 +5304,9 @@ export interface ExternalToolRequestedEvent {
4484
5304
  * ISO 8601 timestamp when the event was created
4485
5305
  */
4486
5306
  timestamp: string;
5307
+ /**
5308
+ * Type discriminator. Always "external_tool.requested".
5309
+ */
4487
5310
  type: "external_tool.requested";
4488
5311
  }
4489
5312
  /**
@@ -4494,7 +5317,7 @@ export interface ExternalToolRequestedData {
4494
5317
  * Arguments to pass to the external tool
4495
5318
  */
4496
5319
  arguments?: {
4497
- [k: string]: unknown;
5320
+ [k: string]: unknown | undefined;
4498
5321
  };
4499
5322
  /**
4500
5323
  * Unique identifier for this request; used to respond via session.respondToExternalTool()
@@ -4521,12 +5344,18 @@ export interface ExternalToolRequestedData {
4521
5344
  */
4522
5345
  tracestate?: string;
4523
5346
  }
5347
+ /**
5348
+ * Session event "external_tool.completed". External tool completion notification signaling UI dismissal
5349
+ */
4524
5350
  export interface ExternalToolCompletedEvent {
4525
5351
  /**
4526
5352
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4527
5353
  */
4528
5354
  agentId?: string;
4529
5355
  data: ExternalToolCompletedData;
5356
+ /**
5357
+ * Always true for events that are transient and not persisted to the session event log on disk.
5358
+ */
4530
5359
  ephemeral?: true;
4531
5360
  /**
4532
5361
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4540,6 +5369,9 @@ export interface ExternalToolCompletedEvent {
4540
5369
  * ISO 8601 timestamp when the event was created
4541
5370
  */
4542
5371
  timestamp: string;
5372
+ /**
5373
+ * Type discriminator. Always "external_tool.completed".
5374
+ */
4543
5375
  type: "external_tool.completed";
4544
5376
  }
4545
5377
  /**
@@ -4551,12 +5383,18 @@ export interface ExternalToolCompletedData {
4551
5383
  */
4552
5384
  requestId: string;
4553
5385
  }
5386
+ /**
5387
+ * Session event "command.queued". Queued slash command dispatch request for client execution
5388
+ */
4554
5389
  export interface CommandQueuedEvent {
4555
5390
  /**
4556
5391
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4557
5392
  */
4558
5393
  agentId?: string;
4559
5394
  data: CommandQueuedData;
5395
+ /**
5396
+ * Always true for events that are transient and not persisted to the session event log on disk.
5397
+ */
4560
5398
  ephemeral: true;
4561
5399
  /**
4562
5400
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4570,6 +5408,9 @@ export interface CommandQueuedEvent {
4570
5408
  * ISO 8601 timestamp when the event was created
4571
5409
  */
4572
5410
  timestamp: string;
5411
+ /**
5412
+ * Type discriminator. Always "command.queued".
5413
+ */
4573
5414
  type: "command.queued";
4574
5415
  }
4575
5416
  /**
@@ -4585,12 +5426,18 @@ export interface CommandQueuedData {
4585
5426
  */
4586
5427
  requestId: string;
4587
5428
  }
5429
+ /**
5430
+ * Session event "command.execute". Registered command dispatch request routed to the owning client
5431
+ */
4588
5432
  export interface CommandExecuteEvent {
4589
5433
  /**
4590
5434
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4591
5435
  */
4592
5436
  agentId?: string;
4593
5437
  data: CommandExecuteData;
5438
+ /**
5439
+ * Always true for events that are transient and not persisted to the session event log on disk.
5440
+ */
4594
5441
  ephemeral: true;
4595
5442
  /**
4596
5443
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4604,6 +5451,9 @@ export interface CommandExecuteEvent {
4604
5451
  * ISO 8601 timestamp when the event was created
4605
5452
  */
4606
5453
  timestamp: string;
5454
+ /**
5455
+ * Type discriminator. Always "command.execute".
5456
+ */
4607
5457
  type: "command.execute";
4608
5458
  }
4609
5459
  /**
@@ -4627,12 +5477,18 @@ export interface CommandExecuteData {
4627
5477
  */
4628
5478
  requestId: string;
4629
5479
  }
5480
+ /**
5481
+ * Session event "command.completed". Queued command completion notification signaling UI dismissal
5482
+ */
4630
5483
  export interface CommandCompletedEvent {
4631
5484
  /**
4632
5485
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4633
5486
  */
4634
5487
  agentId?: string;
4635
5488
  data: CommandCompletedData;
5489
+ /**
5490
+ * Always true for events that are transient and not persisted to the session event log on disk.
5491
+ */
4636
5492
  ephemeral: true;
4637
5493
  /**
4638
5494
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4646,6 +5502,9 @@ export interface CommandCompletedEvent {
4646
5502
  * ISO 8601 timestamp when the event was created
4647
5503
  */
4648
5504
  timestamp: string;
5505
+ /**
5506
+ * Type discriminator. Always "command.completed".
5507
+ */
4649
5508
  type: "command.completed";
4650
5509
  }
4651
5510
  /**
@@ -4657,12 +5516,18 @@ export interface CommandCompletedData {
4657
5516
  */
4658
5517
  requestId: string;
4659
5518
  }
5519
+ /**
5520
+ * Session event "auto_mode_switch.requested". Auto mode switch request notification requiring user approval
5521
+ */
4660
5522
  export interface AutoModeSwitchRequestedEvent {
4661
5523
  /**
4662
5524
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4663
5525
  */
4664
5526
  agentId?: string;
4665
5527
  data: AutoModeSwitchRequestedData;
5528
+ /**
5529
+ * Always true for events that are transient and not persisted to the session event log on disk.
5530
+ */
4666
5531
  ephemeral: true;
4667
5532
  /**
4668
5533
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4676,6 +5541,9 @@ export interface AutoModeSwitchRequestedEvent {
4676
5541
  * ISO 8601 timestamp when the event was created
4677
5542
  */
4678
5543
  timestamp: string;
5544
+ /**
5545
+ * Type discriminator. Always "auto_mode_switch.requested".
5546
+ */
4679
5547
  type: "auto_mode_switch.requested";
4680
5548
  }
4681
5549
  /**
@@ -4695,12 +5563,18 @@ export interface AutoModeSwitchRequestedData {
4695
5563
  */
4696
5564
  retryAfterSeconds?: number;
4697
5565
  }
5566
+ /**
5567
+ * Session event "auto_mode_switch.completed". Auto mode switch completion notification
5568
+ */
4698
5569
  export interface AutoModeSwitchCompletedEvent {
4699
5570
  /**
4700
5571
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4701
5572
  */
4702
5573
  agentId?: string;
4703
5574
  data: AutoModeSwitchCompletedData;
5575
+ /**
5576
+ * Always true for events that are transient and not persisted to the session event log on disk.
5577
+ */
4704
5578
  ephemeral: true;
4705
5579
  /**
4706
5580
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4714,6 +5588,9 @@ export interface AutoModeSwitchCompletedEvent {
4714
5588
  * ISO 8601 timestamp when the event was created
4715
5589
  */
4716
5590
  timestamp: string;
5591
+ /**
5592
+ * Type discriminator. Always "auto_mode_switch.completed".
5593
+ */
4717
5594
  type: "auto_mode_switch.completed";
4718
5595
  }
4719
5596
  /**
@@ -4724,17 +5601,20 @@ export interface AutoModeSwitchCompletedData {
4724
5601
  * Request ID of the resolved request; clients should dismiss any UI for this request
4725
5602
  */
4726
5603
  requestId: string;
4727
- /**
4728
- * The user's choice: 'yes', 'yes_always', or 'no'
4729
- */
4730
- response: string;
5604
+ response: AutoModeSwitchResponse;
4731
5605
  }
5606
+ /**
5607
+ * Session event "commands.changed". SDK command registration change notification
5608
+ */
4732
5609
  export interface CommandsChangedEvent {
4733
5610
  /**
4734
5611
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4735
5612
  */
4736
5613
  agentId?: string;
4737
5614
  data: CommandsChangedData;
5615
+ /**
5616
+ * Always true for events that are transient and not persisted to the session event log on disk.
5617
+ */
4738
5618
  ephemeral: true;
4739
5619
  /**
4740
5620
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4748,6 +5628,9 @@ export interface CommandsChangedEvent {
4748
5628
  * ISO 8601 timestamp when the event was created
4749
5629
  */
4750
5630
  timestamp: string;
5631
+ /**
5632
+ * Type discriminator. Always "commands.changed".
5633
+ */
4751
5634
  type: "commands.changed";
4752
5635
  }
4753
5636
  /**
@@ -4759,16 +5642,31 @@ export interface CommandsChangedData {
4759
5642
  */
4760
5643
  commands: CommandsChangedCommand[];
4761
5644
  }
5645
+ /**
5646
+ * Schema for the `CommandsChangedCommand` type.
5647
+ */
4762
5648
  export interface CommandsChangedCommand {
5649
+ /**
5650
+ * Optional human-readable command description.
5651
+ */
4763
5652
  description?: string;
5653
+ /**
5654
+ * Slash command name without the leading slash.
5655
+ */
4764
5656
  name: string;
4765
5657
  }
5658
+ /**
5659
+ * Session event "capabilities.changed". Session capability change notification
5660
+ */
4766
5661
  export interface CapabilitiesChangedEvent {
4767
5662
  /**
4768
5663
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4769
5664
  */
4770
5665
  agentId?: string;
4771
5666
  data: CapabilitiesChangedData;
5667
+ /**
5668
+ * Always true for events that are transient and not persisted to the session event log on disk.
5669
+ */
4772
5670
  ephemeral: true;
4773
5671
  /**
4774
5672
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4782,6 +5680,9 @@ export interface CapabilitiesChangedEvent {
4782
5680
  * ISO 8601 timestamp when the event was created
4783
5681
  */
4784
5682
  timestamp: string;
5683
+ /**
5684
+ * Type discriminator. Always "capabilities.changed".
5685
+ */
4785
5686
  type: "capabilities.changed";
4786
5687
  }
4787
5688
  /**
@@ -4799,12 +5700,18 @@ export interface CapabilitiesChangedUI {
4799
5700
  */
4800
5701
  elicitation?: boolean;
4801
5702
  }
5703
+ /**
5704
+ * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions
5705
+ */
4802
5706
  export interface ExitPlanModeRequestedEvent {
4803
5707
  /**
4804
5708
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4805
5709
  */
4806
5710
  agentId?: string;
4807
5711
  data: ExitPlanModeRequestedData;
5712
+ /**
5713
+ * Always true for events that are transient and not persisted to the session event log on disk.
5714
+ */
4808
5715
  ephemeral: true;
4809
5716
  /**
4810
5717
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4818,6 +5725,9 @@ export interface ExitPlanModeRequestedEvent {
4818
5725
  * ISO 8601 timestamp when the event was created
4819
5726
  */
4820
5727
  timestamp: string;
5728
+ /**
5729
+ * Type discriminator. Always "exit_plan_mode.requested".
5730
+ */
4821
5731
  type: "exit_plan_mode.requested";
4822
5732
  }
4823
5733
  /**
@@ -4825,17 +5735,14 @@ export interface ExitPlanModeRequestedEvent {
4825
5735
  */
4826
5736
  export interface ExitPlanModeRequestedData {
4827
5737
  /**
4828
- * Available actions the user can take (e.g., approve, edit, reject)
5738
+ * Available actions the user can take
4829
5739
  */
4830
- actions: string[];
5740
+ actions: ExitPlanModeAction[];
4831
5741
  /**
4832
5742
  * Full content of the plan file
4833
5743
  */
4834
5744
  planContent: string;
4835
- /**
4836
- * The recommended action for the user to take
4837
- */
4838
- recommendedAction: string;
5745
+ recommendedAction: ExitPlanModeAction;
4839
5746
  /**
4840
5747
  * Unique identifier for this request; used to respond via session.respondToExitPlanMode()
4841
5748
  */
@@ -4845,12 +5752,18 @@ export interface ExitPlanModeRequestedData {
4845
5752
  */
4846
5753
  summary: string;
4847
5754
  }
5755
+ /**
5756
+ * Session event "exit_plan_mode.completed". Plan mode exit completion with the user's approval decision and optional feedback
5757
+ */
4848
5758
  export interface ExitPlanModeCompletedEvent {
4849
5759
  /**
4850
5760
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4851
5761
  */
4852
5762
  agentId?: string;
4853
5763
  data: ExitPlanModeCompletedData;
5764
+ /**
5765
+ * Always true for events that are transient and not persisted to the session event log on disk.
5766
+ */
4854
5767
  ephemeral: true;
4855
5768
  /**
4856
5769
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4864,6 +5777,9 @@ export interface ExitPlanModeCompletedEvent {
4864
5777
  * ISO 8601 timestamp when the event was created
4865
5778
  */
4866
5779
  timestamp: string;
5780
+ /**
5781
+ * Type discriminator. Always "exit_plan_mode.completed".
5782
+ */
4867
5783
  type: "exit_plan_mode.completed";
4868
5784
  }
4869
5785
  /**
@@ -4886,17 +5802,20 @@ export interface ExitPlanModeCompletedData {
4886
5802
  * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request
4887
5803
  */
4888
5804
  requestId: string;
4889
- /**
4890
- * Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only')
4891
- */
4892
- selectedAction?: string;
5805
+ selectedAction?: ExitPlanModeAction;
4893
5806
  }
5807
+ /**
5808
+ * Session event "session.tools_updated".
5809
+ */
4894
5810
  export interface ToolsUpdatedEvent {
4895
5811
  /**
4896
5812
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4897
5813
  */
4898
5814
  agentId?: string;
4899
5815
  data: ToolsUpdatedData;
5816
+ /**
5817
+ * Always true for events that are transient and not persisted to the session event log on disk.
5818
+ */
4900
5819
  ephemeral: true;
4901
5820
  /**
4902
5821
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4910,17 +5829,32 @@ export interface ToolsUpdatedEvent {
4910
5829
  * ISO 8601 timestamp when the event was created
4911
5830
  */
4912
5831
  timestamp: string;
5832
+ /**
5833
+ * Type discriminator. Always "session.tools_updated".
5834
+ */
4913
5835
  type: "session.tools_updated";
4914
5836
  }
5837
+ /**
5838
+ * Schema for the `ToolsUpdatedData` type.
5839
+ */
4915
5840
  export interface ToolsUpdatedData {
5841
+ /**
5842
+ * Identifier of the model the resolved tools apply to.
5843
+ */
4916
5844
  model: string;
4917
5845
  }
5846
+ /**
5847
+ * Session event "session.background_tasks_changed".
5848
+ */
4918
5849
  export interface BackgroundTasksChangedEvent {
4919
5850
  /**
4920
5851
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4921
5852
  */
4922
5853
  agentId?: string;
4923
5854
  data: BackgroundTasksChangedData;
5855
+ /**
5856
+ * Always true for events that are transient and not persisted to the session event log on disk.
5857
+ */
4924
5858
  ephemeral: true;
4925
5859
  /**
4926
5860
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4934,16 +5868,28 @@ export interface BackgroundTasksChangedEvent {
4934
5868
  * ISO 8601 timestamp when the event was created
4935
5869
  */
4936
5870
  timestamp: string;
5871
+ /**
5872
+ * Type discriminator. Always "session.background_tasks_changed".
5873
+ */
4937
5874
  type: "session.background_tasks_changed";
4938
5875
  }
5876
+ /**
5877
+ * Schema for the `BackgroundTasksChangedData` type.
5878
+ */
4939
5879
  export interface BackgroundTasksChangedData {
4940
5880
  }
5881
+ /**
5882
+ * Session event "session.skills_loaded".
5883
+ */
4941
5884
  export interface SkillsLoadedEvent {
4942
5885
  /**
4943
5886
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4944
5887
  */
4945
5888
  agentId?: string;
4946
5889
  data: SkillsLoadedData;
5890
+ /**
5891
+ * Always true for events that are transient and not persisted to the session event log on disk.
5892
+ */
4947
5893
  ephemeral: true;
4948
5894
  /**
4949
5895
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4957,14 +5903,23 @@ export interface SkillsLoadedEvent {
4957
5903
  * ISO 8601 timestamp when the event was created
4958
5904
  */
4959
5905
  timestamp: string;
5906
+ /**
5907
+ * Type discriminator. Always "session.skills_loaded".
5908
+ */
4960
5909
  type: "session.skills_loaded";
4961
5910
  }
5911
+ /**
5912
+ * Schema for the `SkillsLoadedData` type.
5913
+ */
4962
5914
  export interface SkillsLoadedData {
4963
5915
  /**
4964
5916
  * Array of resolved skill metadata
4965
5917
  */
4966
5918
  skills: SkillsLoadedSkill[];
4967
5919
  }
5920
+ /**
5921
+ * Schema for the `SkillsLoadedSkill` type.
5922
+ */
4968
5923
  export interface SkillsLoadedSkill {
4969
5924
  /**
4970
5925
  * Description of what the skill does
@@ -4982,21 +5937,24 @@ export interface SkillsLoadedSkill {
4982
5937
  * Absolute path to the skill file, if available
4983
5938
  */
4984
5939
  path?: string;
4985
- /**
4986
- * Source location type of the skill (e.g., project, personal, plugin)
4987
- */
4988
- source: string;
5940
+ source: SkillSource;
4989
5941
  /**
4990
5942
  * Whether the skill can be invoked by the user as a slash command
4991
5943
  */
4992
5944
  userInvocable: boolean;
4993
5945
  }
5946
+ /**
5947
+ * Session event "session.custom_agents_updated".
5948
+ */
4994
5949
  export interface CustomAgentsUpdatedEvent {
4995
5950
  /**
4996
5951
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4997
5952
  */
4998
5953
  agentId?: string;
4999
5954
  data: CustomAgentsUpdatedData;
5955
+ /**
5956
+ * Always true for events that are transient and not persisted to the session event log on disk.
5957
+ */
5000
5958
  ephemeral: true;
5001
5959
  /**
5002
5960
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5010,8 +5968,14 @@ export interface CustomAgentsUpdatedEvent {
5010
5968
  * ISO 8601 timestamp when the event was created
5011
5969
  */
5012
5970
  timestamp: string;
5971
+ /**
5972
+ * Type discriminator. Always "session.custom_agents_updated".
5973
+ */
5013
5974
  type: "session.custom_agents_updated";
5014
5975
  }
5976
+ /**
5977
+ * Schema for the `CustomAgentsUpdatedData` type.
5978
+ */
5015
5979
  export interface CustomAgentsUpdatedData {
5016
5980
  /**
5017
5981
  * Array of loaded custom agent metadata
@@ -5026,6 +5990,9 @@ export interface CustomAgentsUpdatedData {
5026
5990
  */
5027
5991
  warnings: string[];
5028
5992
  }
5993
+ /**
5994
+ * Schema for the `CustomAgentsUpdatedAgent` type.
5995
+ */
5029
5996
  export interface CustomAgentsUpdatedAgent {
5030
5997
  /**
5031
5998
  * Description of what the agent does
@@ -5060,12 +6027,18 @@ export interface CustomAgentsUpdatedAgent {
5060
6027
  */
5061
6028
  userInvocable: boolean;
5062
6029
  }
6030
+ /**
6031
+ * Session event "session.mcp_servers_loaded".
6032
+ */
5063
6033
  export interface McpServersLoadedEvent {
5064
6034
  /**
5065
6035
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5066
6036
  */
5067
6037
  agentId?: string;
5068
6038
  data: McpServersLoadedData;
6039
+ /**
6040
+ * Always true for events that are transient and not persisted to the session event log on disk.
6041
+ */
5069
6042
  ephemeral: true;
5070
6043
  /**
5071
6044
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5079,14 +6052,23 @@ export interface McpServersLoadedEvent {
5079
6052
  * ISO 8601 timestamp when the event was created
5080
6053
  */
5081
6054
  timestamp: string;
6055
+ /**
6056
+ * Type discriminator. Always "session.mcp_servers_loaded".
6057
+ */
5082
6058
  type: "session.mcp_servers_loaded";
5083
6059
  }
6060
+ /**
6061
+ * Schema for the `McpServersLoadedData` type.
6062
+ */
5084
6063
  export interface McpServersLoadedData {
5085
6064
  /**
5086
6065
  * Array of MCP server status summaries
5087
6066
  */
5088
6067
  servers: McpServersLoadedServer[];
5089
6068
  }
6069
+ /**
6070
+ * Schema for the `McpServersLoadedServer` type.
6071
+ */
5090
6072
  export interface McpServersLoadedServer {
5091
6073
  /**
5092
6074
  * Error message if the server failed to connect
@@ -5096,18 +6078,21 @@ export interface McpServersLoadedServer {
5096
6078
  * Server name (config key)
5097
6079
  */
5098
6080
  name: string;
5099
- /**
5100
- * Configuration source: user, workspace, plugin, or builtin
5101
- */
5102
- source?: string;
5103
- status: McpServersLoadedServerStatus;
6081
+ source?: McpServerSource;
6082
+ status: McpServerStatus;
5104
6083
  }
6084
+ /**
6085
+ * Session event "session.mcp_server_status_changed".
6086
+ */
5105
6087
  export interface McpServerStatusChangedEvent {
5106
6088
  /**
5107
6089
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5108
6090
  */
5109
6091
  agentId?: string;
5110
6092
  data: McpServerStatusChangedData;
6093
+ /**
6094
+ * Always true for events that are transient and not persisted to the session event log on disk.
6095
+ */
5111
6096
  ephemeral: true;
5112
6097
  /**
5113
6098
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5121,21 +6106,33 @@ export interface McpServerStatusChangedEvent {
5121
6106
  * ISO 8601 timestamp when the event was created
5122
6107
  */
5123
6108
  timestamp: string;
6109
+ /**
6110
+ * Type discriminator. Always "session.mcp_server_status_changed".
6111
+ */
5124
6112
  type: "session.mcp_server_status_changed";
5125
6113
  }
6114
+ /**
6115
+ * Schema for the `McpServerStatusChangedData` type.
6116
+ */
5126
6117
  export interface McpServerStatusChangedData {
5127
6118
  /**
5128
6119
  * Name of the MCP server whose status changed
5129
6120
  */
5130
6121
  serverName: string;
5131
- status: McpServerStatusChangedStatus;
6122
+ status: McpServerStatus;
5132
6123
  }
6124
+ /**
6125
+ * Session event "session.extensions_loaded".
6126
+ */
5133
6127
  export interface ExtensionsLoadedEvent {
5134
6128
  /**
5135
6129
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5136
6130
  */
5137
6131
  agentId?: string;
5138
6132
  data: ExtensionsLoadedData;
6133
+ /**
6134
+ * Always true for events that are transient and not persisted to the session event log on disk.
6135
+ */
5139
6136
  ephemeral: true;
5140
6137
  /**
5141
6138
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5149,14 +6146,23 @@ export interface ExtensionsLoadedEvent {
5149
6146
  * ISO 8601 timestamp when the event was created
5150
6147
  */
5151
6148
  timestamp: string;
6149
+ /**
6150
+ * Type discriminator. Always "session.extensions_loaded".
6151
+ */
5152
6152
  type: "session.extensions_loaded";
5153
6153
  }
6154
+ /**
6155
+ * Schema for the `ExtensionsLoadedData` type.
6156
+ */
5154
6157
  export interface ExtensionsLoadedData {
5155
6158
  /**
5156
6159
  * Array of discovered extensions and their status
5157
6160
  */
5158
6161
  extensions: ExtensionsLoadedExtension[];
5159
6162
  }
6163
+ /**
6164
+ * Schema for the `ExtensionsLoadedExtension` type.
6165
+ */
5160
6166
  export interface ExtensionsLoadedExtension {
5161
6167
  /**
5162
6168
  * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')