@github/copilot-sdk 1.0.0-beta.3 → 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,35 +165,45 @@ 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
  */
77
- export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook;
176
+ export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement | PermissionRequestExtensionPermissionAccess;
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
- export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook;
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";
196
+ export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestExtensionPermissionAccess;
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
  */
@@ -106,32 +211,126 @@ export type PermissionResult = PermissionApproved | PermissionApprovedForSession
106
211
  /**
107
212
  * The approval to add as a session-scoped rule
108
213
  */
109
- export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool;
214
+ export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement | UserToolSessionApprovalExtensionPermissionAccess;
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
  /**
@@ -169,16 +371,21 @@ export interface StartData {
169
371
  * Version string of the Copilot application
170
372
  */
171
373
  copilotVersion: string;
374
+ /**
375
+ * When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id.
376
+ */
377
+ detachedFromSpawningParentSessionId?: string;
172
378
  /**
173
379
  * Identifier of the software producing the events (e.g., "copilot-agent")
174
380
  */
175
381
  producer: string;
176
382
  /**
177
- * 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")
178
384
  */
179
385
  reasoningEffort?: string;
386
+ reasoningSummary?: ReasoningSummary;
180
387
  /**
181
- * Whether this session supports remote steering via Mission Control
388
+ * Whether this session supports remote steering via GitHub
182
389
  */
183
390
  remoteSteerable?: boolean;
184
391
  /**
@@ -232,6 +439,9 @@ export interface WorkingDirectoryContext {
232
439
  */
233
440
  repositoryHost?: string;
234
441
  }
442
+ /**
443
+ * Session event "session.resume". Session resume metadata including current context and event count
444
+ */
235
445
  export interface ResumeEvent {
236
446
  /**
237
447
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -254,6 +464,9 @@ export interface ResumeEvent {
254
464
  * ISO 8601 timestamp when the event was created
255
465
  */
256
466
  timestamp: string;
467
+ /**
468
+ * Type discriminator. Always "session.resume".
469
+ */
257
470
  type: "session.resume";
258
471
  }
259
472
  /**
@@ -274,11 +487,12 @@ export interface ResumeData {
274
487
  */
275
488
  eventCount: number;
276
489
  /**
277
- * 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")
278
491
  */
279
492
  reasoningEffort?: string;
493
+ reasoningSummary?: ReasoningSummary;
280
494
  /**
281
- * Whether this session supports remote steering via Mission Control
495
+ * Whether this session supports remote steering via GitHub
282
496
  */
283
497
  remoteSteerable?: boolean;
284
498
  /**
@@ -294,6 +508,9 @@ export interface ResumeData {
294
508
  */
295
509
  sessionWasActive?: boolean;
296
510
  }
511
+ /**
512
+ * Session event "session.remote_steerable_changed". Notifies that the session's remote steering capability has changed
513
+ */
297
514
  export interface RemoteSteerableChangedEvent {
298
515
  /**
299
516
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -316,17 +533,23 @@ export interface RemoteSteerableChangedEvent {
316
533
  * ISO 8601 timestamp when the event was created
317
534
  */
318
535
  timestamp: string;
536
+ /**
537
+ * Type discriminator. Always "session.remote_steerable_changed".
538
+ */
319
539
  type: "session.remote_steerable_changed";
320
540
  }
321
541
  /**
322
- * Notifies Mission Control that the session's remote steering capability has changed
542
+ * Notifies that the session's remote steering capability has changed
323
543
  */
324
544
  export interface RemoteSteerableChangedData {
325
545
  /**
326
- * Whether this session now supports remote steering via Mission Control
546
+ * Whether this session now supports remote steering via GitHub
327
547
  */
328
548
  remoteSteerable: boolean;
329
549
  }
550
+ /**
551
+ * Session event "session.error". Error details for timeline display including message and optional diagnostic information
552
+ */
330
553
  export interface ErrorEvent {
331
554
  /**
332
555
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -349,6 +572,9 @@ export interface ErrorEvent {
349
572
  * ISO 8601 timestamp when the event was created
350
573
  */
351
574
  timestamp: string;
575
+ /**
576
+ * Type discriminator. Always "session.error".
577
+ */
352
578
  type: "session.error";
353
579
  }
354
580
  /**
@@ -360,7 +586,7 @@ export interface ErrorData {
360
586
  */
361
587
  eligibleForAutoSwitch?: boolean;
362
588
  /**
363
- * 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"`).
364
590
  */
365
591
  errorCode?: string;
366
592
  /**
@@ -388,12 +614,18 @@ export interface ErrorData {
388
614
  */
389
615
  url?: string;
390
616
  }
617
+ /**
618
+ * Session event "session.idle". Payload indicating the session is idle with no background agents in flight
619
+ */
391
620
  export interface IdleEvent {
392
621
  /**
393
622
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
394
623
  */
395
624
  agentId?: string;
396
625
  data: IdleData;
626
+ /**
627
+ * Always true for events that are transient and not persisted to the session event log on disk.
628
+ */
397
629
  ephemeral: true;
398
630
  /**
399
631
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -407,6 +639,9 @@ export interface IdleEvent {
407
639
  * ISO 8601 timestamp when the event was created
408
640
  */
409
641
  timestamp: string;
642
+ /**
643
+ * Type discriminator. Always "session.idle".
644
+ */
410
645
  type: "session.idle";
411
646
  }
412
647
  /**
@@ -418,12 +653,18 @@ export interface IdleData {
418
653
  */
419
654
  aborted?: boolean;
420
655
  }
656
+ /**
657
+ * Session event "session.title_changed". Session title change payload containing the new display title
658
+ */
421
659
  export interface TitleChangedEvent {
422
660
  /**
423
661
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
424
662
  */
425
663
  agentId?: string;
426
664
  data: TitleChangedData;
665
+ /**
666
+ * Always true for events that are transient and not persisted to the session event log on disk.
667
+ */
427
668
  ephemeral: true;
428
669
  /**
429
670
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -437,6 +678,9 @@ export interface TitleChangedEvent {
437
678
  * ISO 8601 timestamp when the event was created
438
679
  */
439
680
  timestamp: string;
681
+ /**
682
+ * Type discriminator. Always "session.title_changed".
683
+ */
440
684
  type: "session.title_changed";
441
685
  }
442
686
  /**
@@ -448,6 +692,9 @@ export interface TitleChangedData {
448
692
  */
449
693
  title: string;
450
694
  }
695
+ /**
696
+ * Session event "session.schedule_created". Scheduled prompt registered via /every or /after
697
+ */
451
698
  export interface ScheduleCreatedEvent {
452
699
  /**
453
700
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -470,12 +717,19 @@ export interface ScheduleCreatedEvent {
470
717
  * ISO 8601 timestamp when the event was created
471
718
  */
472
719
  timestamp: string;
720
+ /**
721
+ * Type discriminator. Always "session.schedule_created".
722
+ */
473
723
  type: "session.schedule_created";
474
724
  }
475
725
  /**
476
- * Scheduled prompt registered via /every
726
+ * Scheduled prompt registered via /every or /after
477
727
  */
478
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;
479
733
  /**
480
734
  * Sequential id assigned to the scheduled prompt within the session
481
735
  */
@@ -488,7 +742,14 @@ export interface ScheduleCreatedData {
488
742
  * Prompt text that gets enqueued on every tick
489
743
  */
490
744
  prompt: string;
745
+ /**
746
+ * Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)
747
+ */
748
+ recurring?: boolean;
491
749
  }
750
+ /**
751
+ * Session event "session.schedule_cancelled". Scheduled prompt cancelled from the schedule manager dialog
752
+ */
492
753
  export interface ScheduleCancelledEvent {
493
754
  /**
494
755
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -511,6 +772,9 @@ export interface ScheduleCancelledEvent {
511
772
  * ISO 8601 timestamp when the event was created
512
773
  */
513
774
  timestamp: string;
775
+ /**
776
+ * Type discriminator. Always "session.schedule_cancelled".
777
+ */
514
778
  type: "session.schedule_cancelled";
515
779
  }
516
780
  /**
@@ -522,6 +786,9 @@ export interface ScheduleCancelledData {
522
786
  */
523
787
  id: number;
524
788
  }
789
+ /**
790
+ * Session event "session.info". Informational message for timeline display with categorization
791
+ */
525
792
  export interface InfoEvent {
526
793
  /**
527
794
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -544,6 +811,9 @@ export interface InfoEvent {
544
811
  * ISO 8601 timestamp when the event was created
545
812
  */
546
813
  timestamp: string;
814
+ /**
815
+ * Type discriminator. Always "session.info".
816
+ */
547
817
  type: "session.info";
548
818
  }
549
819
  /**
@@ -567,6 +837,9 @@ export interface InfoData {
567
837
  */
568
838
  url?: string;
569
839
  }
840
+ /**
841
+ * Session event "session.warning". Warning message for timeline display with categorization
842
+ */
570
843
  export interface WarningEvent {
571
844
  /**
572
845
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -589,6 +862,9 @@ export interface WarningEvent {
589
862
  * ISO 8601 timestamp when the event was created
590
863
  */
591
864
  timestamp: string;
865
+ /**
866
+ * Type discriminator. Always "session.warning".
867
+ */
592
868
  type: "session.warning";
593
869
  }
594
870
  /**
@@ -608,6 +884,9 @@ export interface WarningData {
608
884
  */
609
885
  warningType: string;
610
886
  }
887
+ /**
888
+ * Session event "session.model_change". Model change details including previous and new model identifiers
889
+ */
611
890
  export interface ModelChangeEvent {
612
891
  /**
613
892
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -630,6 +909,9 @@ export interface ModelChangeEvent {
630
909
  * ISO 8601 timestamp when the event was created
631
910
  */
632
911
  timestamp: string;
912
+ /**
913
+ * Type discriminator. Always "session.model_change".
914
+ */
633
915
  type: "session.model_change";
634
916
  }
635
917
  /**
@@ -652,11 +934,16 @@ export interface ModelChangeData {
652
934
  * Reasoning effort level before the model change, if applicable
653
935
  */
654
936
  previousReasoningEffort?: string;
937
+ previousReasoningSummary?: ReasoningSummary;
655
938
  /**
656
939
  * Reasoning effort level after the model change, if applicable
657
940
  */
658
- reasoningEffort?: string;
941
+ reasoningEffort?: string | null;
942
+ reasoningSummary?: ReasoningSummary;
659
943
  }
944
+ /**
945
+ * Session event "session.mode_changed". Agent mode change details including previous and new modes
946
+ */
660
947
  export interface ModeChangedEvent {
661
948
  /**
662
949
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -679,21 +966,21 @@ export interface ModeChangedEvent {
679
966
  * ISO 8601 timestamp when the event was created
680
967
  */
681
968
  timestamp: string;
969
+ /**
970
+ * Type discriminator. Always "session.mode_changed".
971
+ */
682
972
  type: "session.mode_changed";
683
973
  }
684
974
  /**
685
975
  * Agent mode change details including previous and new modes
686
976
  */
687
977
  export interface ModeChangedData {
688
- /**
689
- * Agent mode after the change (e.g., "interactive", "plan", "autopilot")
690
- */
691
- newMode: string;
692
- /**
693
- * Agent mode before the change (e.g., "interactive", "plan", "autopilot")
694
- */
695
- previousMode: string;
978
+ newMode: SessionMode;
979
+ previousMode: SessionMode;
696
980
  }
981
+ /**
982
+ * Session event "session.plan_changed". Plan file operation details indicating what changed
983
+ */
697
984
  export interface PlanChangedEvent {
698
985
  /**
699
986
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -716,6 +1003,9 @@ export interface PlanChangedEvent {
716
1003
  * ISO 8601 timestamp when the event was created
717
1004
  */
718
1005
  timestamp: string;
1006
+ /**
1007
+ * Type discriminator. Always "session.plan_changed".
1008
+ */
719
1009
  type: "session.plan_changed";
720
1010
  }
721
1011
  /**
@@ -724,6 +1014,9 @@ export interface PlanChangedEvent {
724
1014
  export interface PlanChangedData {
725
1015
  operation: PlanChangedOperation;
726
1016
  }
1017
+ /**
1018
+ * Session event "session.workspace_file_changed". Workspace file change details including path and operation type
1019
+ */
727
1020
  export interface WorkspaceFileChangedEvent {
728
1021
  /**
729
1022
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -746,6 +1039,9 @@ export interface WorkspaceFileChangedEvent {
746
1039
  * ISO 8601 timestamp when the event was created
747
1040
  */
748
1041
  timestamp: string;
1042
+ /**
1043
+ * Type discriminator. Always "session.workspace_file_changed".
1044
+ */
749
1045
  type: "session.workspace_file_changed";
750
1046
  }
751
1047
  /**
@@ -758,6 +1054,9 @@ export interface WorkspaceFileChangedData {
758
1054
  */
759
1055
  path: string;
760
1056
  }
1057
+ /**
1058
+ * Session event "session.handoff". Session handoff metadata including source, context, and repository information
1059
+ */
761
1060
  export interface HandoffEvent {
762
1061
  /**
763
1062
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -780,6 +1079,9 @@ export interface HandoffEvent {
780
1079
  * ISO 8601 timestamp when the event was created
781
1080
  */
782
1081
  timestamp: string;
1082
+ /**
1083
+ * Type discriminator. Always "session.handoff".
1084
+ */
783
1085
  type: "session.handoff";
784
1086
  }
785
1087
  /**
@@ -826,6 +1128,9 @@ export interface HandoffRepository {
826
1128
  */
827
1129
  owner: string;
828
1130
  }
1131
+ /**
1132
+ * Session event "session.truncation". Conversation truncation statistics including token counts and removed content metrics
1133
+ */
829
1134
  export interface TruncationEvent {
830
1135
  /**
831
1136
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -848,6 +1153,9 @@ export interface TruncationEvent {
848
1153
  * ISO 8601 timestamp when the event was created
849
1154
  */
850
1155
  timestamp: string;
1156
+ /**
1157
+ * Type discriminator. Always "session.truncation".
1158
+ */
851
1159
  type: "session.truncation";
852
1160
  }
853
1161
  /**
@@ -887,12 +1195,18 @@ export interface TruncationData {
887
1195
  */
888
1196
  tokensRemovedDuringTruncation: number;
889
1197
  }
1198
+ /**
1199
+ * Session event "session.snapshot_rewind". Session rewind details including target event and count of removed events
1200
+ */
890
1201
  export interface SnapshotRewindEvent {
891
1202
  /**
892
1203
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
893
1204
  */
894
1205
  agentId?: string;
895
1206
  data: SnapshotRewindData;
1207
+ /**
1208
+ * Always true for events that are transient and not persisted to the session event log on disk.
1209
+ */
896
1210
  ephemeral: true;
897
1211
  /**
898
1212
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -906,6 +1220,9 @@ export interface SnapshotRewindEvent {
906
1220
  * ISO 8601 timestamp when the event was created
907
1221
  */
908
1222
  timestamp: string;
1223
+ /**
1224
+ * Type discriminator. Always "session.snapshot_rewind".
1225
+ */
909
1226
  type: "session.snapshot_rewind";
910
1227
  }
911
1228
  /**
@@ -921,6 +1238,9 @@ export interface SnapshotRewindData {
921
1238
  */
922
1239
  upToEventId: string;
923
1240
  }
1241
+ /**
1242
+ * Session event "session.shutdown". Session termination metrics including usage statistics, code changes, and shutdown reason
1243
+ */
924
1244
  export interface ShutdownEvent {
925
1245
  /**
926
1246
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -943,6 +1263,9 @@ export interface ShutdownEvent {
943
1263
  * ISO 8601 timestamp when the event was created
944
1264
  */
945
1265
  timestamp: string;
1266
+ /**
1267
+ * Type discriminator. Always "session.shutdown".
1268
+ */
946
1269
  type: "session.shutdown";
947
1270
  }
948
1271
  /**
@@ -970,7 +1293,7 @@ export interface ShutdownData {
970
1293
  * Per-model usage breakdown, keyed by model identifier
971
1294
  */
972
1295
  modelMetrics: {
973
- [k: string]: ShutdownModelMetric;
1296
+ [k: string]: ShutdownModelMetric | undefined;
974
1297
  };
975
1298
  /**
976
1299
  * Unix timestamp (milliseconds) when the session started
@@ -985,7 +1308,7 @@ export interface ShutdownData {
985
1308
  * Session-wide per-token-type accumulated token counts
986
1309
  */
987
1310
  tokenDetails?: {
988
- [k: string]: ShutdownTokenDetail;
1311
+ [k: string]: ShutdownTokenDetail | undefined;
989
1312
  };
990
1313
  /**
991
1314
  * Tool definitions token count at shutdown
@@ -1021,13 +1344,16 @@ export interface ShutdownCodeChanges {
1021
1344
  */
1022
1345
  linesRemoved: number;
1023
1346
  }
1347
+ /**
1348
+ * Schema for the `ShutdownModelMetric` type.
1349
+ */
1024
1350
  export interface ShutdownModelMetric {
1025
1351
  requests: ShutdownModelMetricRequests;
1026
1352
  /**
1027
1353
  * Token count details per type
1028
1354
  */
1029
1355
  tokenDetails?: {
1030
- [k: string]: ShutdownModelMetricTokenDetail;
1356
+ [k: string]: ShutdownModelMetricTokenDetail | undefined;
1031
1357
  };
1032
1358
  /**
1033
1359
  * Accumulated nano-AI units cost for this model
@@ -1048,6 +1374,9 @@ export interface ShutdownModelMetricRequests {
1048
1374
  */
1049
1375
  count: number;
1050
1376
  }
1377
+ /**
1378
+ * Schema for the `ShutdownModelMetricTokenDetail` type.
1379
+ */
1051
1380
  export interface ShutdownModelMetricTokenDetail {
1052
1381
  /**
1053
1382
  * Accumulated token count for this token type
@@ -1079,12 +1408,18 @@ export interface ShutdownModelMetricUsage {
1079
1408
  */
1080
1409
  reasoningTokens?: number;
1081
1410
  }
1411
+ /**
1412
+ * Schema for the `ShutdownTokenDetail` type.
1413
+ */
1082
1414
  export interface ShutdownTokenDetail {
1083
1415
  /**
1084
1416
  * Accumulated token count for this token type
1085
1417
  */
1086
1418
  tokenCount: number;
1087
1419
  }
1420
+ /**
1421
+ * Session event "session.context_changed". Updated working directory and git context after the change
1422
+ */
1088
1423
  export interface ContextChangedEvent {
1089
1424
  /**
1090
1425
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1107,14 +1442,23 @@ export interface ContextChangedEvent {
1107
1442
  * ISO 8601 timestamp when the event was created
1108
1443
  */
1109
1444
  timestamp: string;
1445
+ /**
1446
+ * Type discriminator. Always "session.context_changed".
1447
+ */
1110
1448
  type: "session.context_changed";
1111
1449
  }
1450
+ /**
1451
+ * Session event "session.usage_info". Current context window usage statistics including token and message counts
1452
+ */
1112
1453
  export interface UsageInfoEvent {
1113
1454
  /**
1114
1455
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1115
1456
  */
1116
1457
  agentId?: string;
1117
1458
  data: UsageInfoData;
1459
+ /**
1460
+ * Always true for events that are transient and not persisted to the session event log on disk.
1461
+ */
1118
1462
  ephemeral: true;
1119
1463
  /**
1120
1464
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1128,6 +1472,9 @@ export interface UsageInfoEvent {
1128
1472
  * ISO 8601 timestamp when the event was created
1129
1473
  */
1130
1474
  timestamp: string;
1475
+ /**
1476
+ * Type discriminator. Always "session.usage_info".
1477
+ */
1131
1478
  type: "session.usage_info";
1132
1479
  }
1133
1480
  /**
@@ -1163,6 +1510,9 @@ export interface UsageInfoData {
1163
1510
  */
1164
1511
  toolDefinitionsTokens?: number;
1165
1512
  }
1513
+ /**
1514
+ * Session event "session.compaction_start". Context window breakdown at the start of LLM-powered conversation compaction
1515
+ */
1166
1516
  export interface CompactionStartEvent {
1167
1517
  /**
1168
1518
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1185,6 +1535,9 @@ export interface CompactionStartEvent {
1185
1535
  * ISO 8601 timestamp when the event was created
1186
1536
  */
1187
1537
  timestamp: string;
1538
+ /**
1539
+ * Type discriminator. Always "session.compaction_start".
1540
+ */
1188
1541
  type: "session.compaction_start";
1189
1542
  }
1190
1543
  /**
@@ -1204,6 +1557,9 @@ export interface CompactionStartData {
1204
1557
  */
1205
1558
  toolDefinitionsTokens?: number;
1206
1559
  }
1560
+ /**
1561
+ * Session event "session.compaction_complete". Conversation compaction results including success status, metrics, and optional error details
1562
+ */
1207
1563
  export interface CompactionCompleteEvent {
1208
1564
  /**
1209
1565
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1226,6 +1582,9 @@ export interface CompactionCompleteEvent {
1226
1582
  * ISO 8601 timestamp when the event was created
1227
1583
  */
1228
1584
  timestamp: string;
1585
+ /**
1586
+ * Type discriminator. Always "session.compaction_complete".
1587
+ */
1229
1588
  type: "session.compaction_complete";
1230
1589
  }
1231
1590
  /**
@@ -1354,6 +1713,9 @@ export interface CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail {
1354
1713
  */
1355
1714
  tokenType: string;
1356
1715
  }
1716
+ /**
1717
+ * Session event "session.task_complete". Task completion notification with summary from the agent
1718
+ */
1357
1719
  export interface TaskCompleteEvent {
1358
1720
  /**
1359
1721
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1376,6 +1738,9 @@ export interface TaskCompleteEvent {
1376
1738
  * ISO 8601 timestamp when the event was created
1377
1739
  */
1378
1740
  timestamp: string;
1741
+ /**
1742
+ * Type discriminator. Always "session.task_complete".
1743
+ */
1379
1744
  type: "session.task_complete";
1380
1745
  }
1381
1746
  /**
@@ -1391,6 +1756,9 @@ export interface TaskCompleteData {
1391
1756
  */
1392
1757
  summary?: string;
1393
1758
  }
1759
+ /**
1760
+ * Session event "user.message".
1761
+ */
1394
1762
  export interface UserMessageEvent {
1395
1763
  /**
1396
1764
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1413,8 +1781,14 @@ export interface UserMessageEvent {
1413
1781
  * ISO 8601 timestamp when the event was created
1414
1782
  */
1415
1783
  timestamp: string;
1784
+ /**
1785
+ * Type discriminator. Always "user.message".
1786
+ */
1416
1787
  type: "user.message";
1417
1788
  }
1789
+ /**
1790
+ * Schema for the `UserMessageData` type.
1791
+ */
1418
1792
  export interface UserMessageData {
1419
1793
  agentMode?: UserMessageAgentMode;
1420
1794
  /**
@@ -1430,7 +1804,11 @@ export interface UserMessageData {
1430
1804
  */
1431
1805
  interactionId?: string;
1432
1806
  /**
1433
- * 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
1434
1812
  */
1435
1813
  nativeDocumentPathFallbackPaths?: string[];
1436
1814
  /**
@@ -1600,12 +1978,18 @@ export interface UserMessageAttachmentBlob {
1600
1978
  */
1601
1979
  type: "blob";
1602
1980
  }
1981
+ /**
1982
+ * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
1983
+ */
1603
1984
  export interface PendingMessagesModifiedEvent {
1604
1985
  /**
1605
1986
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1606
1987
  */
1607
1988
  agentId?: string;
1608
1989
  data: PendingMessagesModifiedData;
1990
+ /**
1991
+ * Always true for events that are transient and not persisted to the session event log on disk.
1992
+ */
1609
1993
  ephemeral: true;
1610
1994
  /**
1611
1995
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1619,6 +2003,9 @@ export interface PendingMessagesModifiedEvent {
1619
2003
  * ISO 8601 timestamp when the event was created
1620
2004
  */
1621
2005
  timestamp: string;
2006
+ /**
2007
+ * Type discriminator. Always "pending_messages.modified".
2008
+ */
1622
2009
  type: "pending_messages.modified";
1623
2010
  }
1624
2011
  /**
@@ -1626,6 +2013,9 @@ export interface PendingMessagesModifiedEvent {
1626
2013
  */
1627
2014
  export interface PendingMessagesModifiedData {
1628
2015
  }
2016
+ /**
2017
+ * Session event "assistant.turn_start". Turn initialization metadata including identifier and interaction tracking
2018
+ */
1629
2019
  export interface AssistantTurnStartEvent {
1630
2020
  /**
1631
2021
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1648,6 +2038,9 @@ export interface AssistantTurnStartEvent {
1648
2038
  * ISO 8601 timestamp when the event was created
1649
2039
  */
1650
2040
  timestamp: string;
2041
+ /**
2042
+ * Type discriminator. Always "assistant.turn_start".
2043
+ */
1651
2044
  type: "assistant.turn_start";
1652
2045
  }
1653
2046
  /**
@@ -1663,12 +2056,18 @@ export interface AssistantTurnStartData {
1663
2056
  */
1664
2057
  turnId: string;
1665
2058
  }
2059
+ /**
2060
+ * Session event "assistant.intent". Agent intent description for current activity or plan
2061
+ */
1666
2062
  export interface AssistantIntentEvent {
1667
2063
  /**
1668
2064
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1669
2065
  */
1670
2066
  agentId?: string;
1671
2067
  data: AssistantIntentData;
2068
+ /**
2069
+ * Always true for events that are transient and not persisted to the session event log on disk.
2070
+ */
1672
2071
  ephemeral: true;
1673
2072
  /**
1674
2073
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1682,6 +2081,9 @@ export interface AssistantIntentEvent {
1682
2081
  * ISO 8601 timestamp when the event was created
1683
2082
  */
1684
2083
  timestamp: string;
2084
+ /**
2085
+ * Type discriminator. Always "assistant.intent".
2086
+ */
1685
2087
  type: "assistant.intent";
1686
2088
  }
1687
2089
  /**
@@ -1693,6 +2095,9 @@ export interface AssistantIntentData {
1693
2095
  */
1694
2096
  intent: string;
1695
2097
  }
2098
+ /**
2099
+ * Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text
2100
+ */
1696
2101
  export interface AssistantReasoningEvent {
1697
2102
  /**
1698
2103
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1715,6 +2120,9 @@ export interface AssistantReasoningEvent {
1715
2120
  * ISO 8601 timestamp when the event was created
1716
2121
  */
1717
2122
  timestamp: string;
2123
+ /**
2124
+ * Type discriminator. Always "assistant.reasoning".
2125
+ */
1718
2126
  type: "assistant.reasoning";
1719
2127
  }
1720
2128
  /**
@@ -1730,12 +2138,18 @@ export interface AssistantReasoningData {
1730
2138
  */
1731
2139
  reasoningId: string;
1732
2140
  }
2141
+ /**
2142
+ * Session event "assistant.reasoning_delta". Streaming reasoning delta for incremental extended thinking updates
2143
+ */
1733
2144
  export interface AssistantReasoningDeltaEvent {
1734
2145
  /**
1735
2146
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1736
2147
  */
1737
2148
  agentId?: string;
1738
2149
  data: AssistantReasoningDeltaData;
2150
+ /**
2151
+ * Always true for events that are transient and not persisted to the session event log on disk.
2152
+ */
1739
2153
  ephemeral: true;
1740
2154
  /**
1741
2155
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1749,6 +2163,9 @@ export interface AssistantReasoningDeltaEvent {
1749
2163
  * ISO 8601 timestamp when the event was created
1750
2164
  */
1751
2165
  timestamp: string;
2166
+ /**
2167
+ * Type discriminator. Always "assistant.reasoning_delta".
2168
+ */
1752
2169
  type: "assistant.reasoning_delta";
1753
2170
  }
1754
2171
  /**
@@ -1764,12 +2181,18 @@ export interface AssistantReasoningDeltaData {
1764
2181
  */
1765
2182
  reasoningId: string;
1766
2183
  }
2184
+ /**
2185
+ * Session event "assistant.streaming_delta". Streaming response progress with cumulative byte count
2186
+ */
1767
2187
  export interface AssistantStreamingDeltaEvent {
1768
2188
  /**
1769
2189
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1770
2190
  */
1771
2191
  agentId?: string;
1772
2192
  data: AssistantStreamingDeltaData;
2193
+ /**
2194
+ * Always true for events that are transient and not persisted to the session event log on disk.
2195
+ */
1773
2196
  ephemeral: true;
1774
2197
  /**
1775
2198
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1783,6 +2206,9 @@ export interface AssistantStreamingDeltaEvent {
1783
2206
  * ISO 8601 timestamp when the event was created
1784
2207
  */
1785
2208
  timestamp: string;
2209
+ /**
2210
+ * Type discriminator. Always "assistant.streaming_delta".
2211
+ */
1786
2212
  type: "assistant.streaming_delta";
1787
2213
  }
1788
2214
  /**
@@ -1794,6 +2220,9 @@ export interface AssistantStreamingDeltaData {
1794
2220
  */
1795
2221
  totalResponseSizeBytes: number;
1796
2222
  }
2223
+ /**
2224
+ * Session event "assistant.message". Assistant response containing text content, optional tool requests, and interaction metadata
2225
+ */
1797
2226
  export interface AssistantMessageEvent {
1798
2227
  /**
1799
2228
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1816,12 +2245,23 @@ export interface AssistantMessageEvent {
1816
2245
  * ISO 8601 timestamp when the event was created
1817
2246
  */
1818
2247
  timestamp: string;
2248
+ /**
2249
+ * Type discriminator. Always "assistant.message".
2250
+ */
1819
2251
  type: "assistant.message";
1820
2252
  }
1821
2253
  /**
1822
2254
  * Assistant response containing text content, optional tool requests, and interaction metadata
1823
2255
  */
1824
2256
  export interface AssistantMessageData {
2257
+ /**
2258
+ * Raw Anthropic content array with advisor blocks (server_tool_use, advisor_tool_result) for verbatim round-tripping
2259
+ */
2260
+ anthropicAdvisorBlocks?: unknown[];
2261
+ /**
2262
+ * Anthropic advisor model ID used for this response, for timeline display on replay
2263
+ */
2264
+ anthropicAdvisorModel?: string;
1825
2265
  /**
1826
2266
  * The assistant's text response content
1827
2267
  */
@@ -1838,6 +2278,10 @@ export interface AssistantMessageData {
1838
2278
  * Unique identifier for this assistant message
1839
2279
  */
1840
2280
  messageId: string;
2281
+ /**
2282
+ * Model that produced this assistant message, if known
2283
+ */
2284
+ model?: string;
1841
2285
  /**
1842
2286
  * Actual output token count from the API response (completion_tokens), used for accurate token accounting
1843
2287
  */
@@ -1880,7 +2324,7 @@ export interface AssistantMessageToolRequest {
1880
2324
  * Arguments to pass to the tool, format depends on the tool
1881
2325
  */
1882
2326
  arguments?: {
1883
- [k: string]: unknown;
2327
+ [k: string]: unknown | undefined;
1884
2328
  };
1885
2329
  /**
1886
2330
  * Resolved intention summary describing what this specific call does
@@ -1908,12 +2352,18 @@ export interface AssistantMessageToolRequest {
1908
2352
  toolTitle?: string;
1909
2353
  type?: AssistantMessageToolRequestType;
1910
2354
  }
2355
+ /**
2356
+ * Session event "assistant.message_start". Streaming assistant message start metadata
2357
+ */
1911
2358
  export interface AssistantMessageStartEvent {
1912
2359
  /**
1913
2360
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1914
2361
  */
1915
2362
  agentId?: string;
1916
2363
  data: AssistantMessageStartData;
2364
+ /**
2365
+ * Always true for events that are transient and not persisted to the session event log on disk.
2366
+ */
1917
2367
  ephemeral: true;
1918
2368
  /**
1919
2369
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1927,6 +2377,9 @@ export interface AssistantMessageStartEvent {
1927
2377
  * ISO 8601 timestamp when the event was created
1928
2378
  */
1929
2379
  timestamp: string;
2380
+ /**
2381
+ * Type discriminator. Always "assistant.message_start".
2382
+ */
1930
2383
  type: "assistant.message_start";
1931
2384
  }
1932
2385
  /**
@@ -1942,12 +2395,18 @@ export interface AssistantMessageStartData {
1942
2395
  */
1943
2396
  phase?: string;
1944
2397
  }
2398
+ /**
2399
+ * Session event "assistant.message_delta". Streaming assistant message delta for incremental response updates
2400
+ */
1945
2401
  export interface AssistantMessageDeltaEvent {
1946
2402
  /**
1947
2403
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1948
2404
  */
1949
2405
  agentId?: string;
1950
2406
  data: AssistantMessageDeltaData;
2407
+ /**
2408
+ * Always true for events that are transient and not persisted to the session event log on disk.
2409
+ */
1951
2410
  ephemeral: true;
1952
2411
  /**
1953
2412
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -1961,6 +2420,9 @@ export interface AssistantMessageDeltaEvent {
1961
2420
  * ISO 8601 timestamp when the event was created
1962
2421
  */
1963
2422
  timestamp: string;
2423
+ /**
2424
+ * Type discriminator. Always "assistant.message_delta".
2425
+ */
1964
2426
  type: "assistant.message_delta";
1965
2427
  }
1966
2428
  /**
@@ -1981,6 +2443,9 @@ export interface AssistantMessageDeltaData {
1981
2443
  */
1982
2444
  parentToolCallId?: string;
1983
2445
  }
2446
+ /**
2447
+ * Session event "assistant.turn_end". Turn completion metadata including the turn identifier
2448
+ */
1984
2449
  export interface AssistantTurnEndEvent {
1985
2450
  /**
1986
2451
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2003,6 +2468,9 @@ export interface AssistantTurnEndEvent {
2003
2468
  * ISO 8601 timestamp when the event was created
2004
2469
  */
2005
2470
  timestamp: string;
2471
+ /**
2472
+ * Type discriminator. Always "assistant.turn_end".
2473
+ */
2006
2474
  type: "assistant.turn_end";
2007
2475
  }
2008
2476
  /**
@@ -2014,12 +2482,18 @@ export interface AssistantTurnEndData {
2014
2482
  */
2015
2483
  turnId: string;
2016
2484
  }
2485
+ /**
2486
+ * Session event "assistant.usage". LLM API call usage metrics including tokens, costs, quotas, and billing information
2487
+ */
2017
2488
  export interface AssistantUsageEvent {
2018
2489
  /**
2019
2490
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2020
2491
  */
2021
2492
  agentId?: string;
2022
2493
  data: AssistantUsageData;
2494
+ /**
2495
+ * Always true for events that are transient and not persisted to the session event log on disk.
2496
+ */
2023
2497
  ephemeral: true;
2024
2498
  /**
2025
2499
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2033,6 +2507,9 @@ export interface AssistantUsageEvent {
2033
2507
  * ISO 8601 timestamp when the event was created
2034
2508
  */
2035
2509
  timestamp: string;
2510
+ /**
2511
+ * Type discriminator. Always "assistant.usage".
2512
+ */
2036
2513
  type: "assistant.usage";
2037
2514
  }
2038
2515
  /**
@@ -2043,6 +2520,7 @@ export interface AssistantUsageData {
2043
2520
  * Completion ID from the model provider (e.g., chatcmpl-abc123)
2044
2521
  */
2045
2522
  apiCallId?: string;
2523
+ apiEndpoint?: AssistantUsageApiEndpoint;
2046
2524
  /**
2047
2525
  * Number of tokens read from prompt cache
2048
2526
  */
@@ -2093,10 +2571,10 @@ export interface AssistantUsageData {
2093
2571
  * Per-quota resource usage snapshots, keyed by quota identifier
2094
2572
  */
2095
2573
  quotaSnapshots?: {
2096
- [k: string]: AssistantUsageQuotaSnapshot;
2574
+ [k: string]: AssistantUsageQuotaSnapshot | undefined;
2097
2575
  };
2098
2576
  /**
2099
- * 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")
2100
2578
  */
2101
2579
  reasoningEffort?: string;
2102
2580
  /**
@@ -2106,7 +2584,7 @@ export interface AssistantUsageData {
2106
2584
  /**
2107
2585
  * Time to first token in milliseconds. Only available for streaming requests
2108
2586
  */
2109
- ttftMs?: number;
2587
+ timeToFirstTokenMs?: number;
2110
2588
  }
2111
2589
  /**
2112
2590
  * Per-request cost and usage data from the CAPI copilot_usage response field
@@ -2142,6 +2620,9 @@ export interface AssistantUsageCopilotUsageTokenDetail {
2142
2620
  */
2143
2621
  tokenType: string;
2144
2622
  }
2623
+ /**
2624
+ * Schema for the `AssistantUsageQuotaSnapshot` type.
2625
+ */
2145
2626
  export interface AssistantUsageQuotaSnapshot {
2146
2627
  /**
2147
2628
  * Total requests allowed by the entitlement
@@ -2160,7 +2641,7 @@ export interface AssistantUsageQuotaSnapshot {
2160
2641
  */
2161
2642
  overageAllowedWithExhaustedQuota: boolean;
2162
2643
  /**
2163
- * Percentage of quota remaining (0.0 to 1.0)
2644
+ * Percentage of quota remaining (0 to 100)
2164
2645
  */
2165
2646
  remainingPercentage: number;
2166
2647
  /**
@@ -2176,12 +2657,18 @@ export interface AssistantUsageQuotaSnapshot {
2176
2657
  */
2177
2658
  usedRequests: number;
2178
2659
  }
2660
+ /**
2661
+ * Session event "model.call_failure". Failed LLM API call metadata for telemetry
2662
+ */
2179
2663
  export interface ModelCallFailureEvent {
2180
2664
  /**
2181
2665
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2182
2666
  */
2183
2667
  agentId?: string;
2184
2668
  data: ModelCallFailureData;
2669
+ /**
2670
+ * Always true for events that are transient and not persisted to the session event log on disk.
2671
+ */
2185
2672
  ephemeral: true;
2186
2673
  /**
2187
2674
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2195,6 +2682,9 @@ export interface ModelCallFailureEvent {
2195
2682
  * ISO 8601 timestamp when the event was created
2196
2683
  */
2197
2684
  timestamp: string;
2685
+ /**
2686
+ * Type discriminator. Always "model.call_failure".
2687
+ */
2198
2688
  type: "model.call_failure";
2199
2689
  }
2200
2690
  /**
@@ -2231,6 +2721,9 @@ export interface ModelCallFailureData {
2231
2721
  */
2232
2722
  statusCode?: number;
2233
2723
  }
2724
+ /**
2725
+ * Session event "abort". Turn abort information including the reason for termination
2726
+ */
2234
2727
  export interface AbortEvent {
2235
2728
  /**
2236
2729
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2253,6 +2746,9 @@ export interface AbortEvent {
2253
2746
  * ISO 8601 timestamp when the event was created
2254
2747
  */
2255
2748
  timestamp: string;
2749
+ /**
2750
+ * Type discriminator. Always "abort".
2751
+ */
2256
2752
  type: "abort";
2257
2753
  }
2258
2754
  /**
@@ -2261,6 +2757,9 @@ export interface AbortEvent {
2261
2757
  export interface AbortData {
2262
2758
  reason: AbortReason;
2263
2759
  }
2760
+ /**
2761
+ * Session event "tool.user_requested". User-initiated tool invocation request with tool name and arguments
2762
+ */
2264
2763
  export interface ToolUserRequestedEvent {
2265
2764
  /**
2266
2765
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2283,6 +2782,9 @@ export interface ToolUserRequestedEvent {
2283
2782
  * ISO 8601 timestamp when the event was created
2284
2783
  */
2285
2784
  timestamp: string;
2785
+ /**
2786
+ * Type discriminator. Always "tool.user_requested".
2787
+ */
2286
2788
  type: "tool.user_requested";
2287
2789
  }
2288
2790
  /**
@@ -2293,7 +2795,7 @@ export interface ToolUserRequestedData {
2293
2795
  * Arguments for the tool invocation
2294
2796
  */
2295
2797
  arguments?: {
2296
- [k: string]: unknown;
2798
+ [k: string]: unknown | undefined;
2297
2799
  };
2298
2800
  /**
2299
2801
  * Unique identifier for this tool call
@@ -2304,6 +2806,9 @@ export interface ToolUserRequestedData {
2304
2806
  */
2305
2807
  toolName: string;
2306
2808
  }
2809
+ /**
2810
+ * Session event "tool.execution_start". Tool execution startup details including MCP server information when applicable
2811
+ */
2307
2812
  export interface ToolExecutionStartEvent {
2308
2813
  /**
2309
2814
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2326,6 +2831,9 @@ export interface ToolExecutionStartEvent {
2326
2831
  * ISO 8601 timestamp when the event was created
2327
2832
  */
2328
2833
  timestamp: string;
2834
+ /**
2835
+ * Type discriminator. Always "tool.execution_start".
2836
+ */
2329
2837
  type: "tool.execution_start";
2330
2838
  }
2331
2839
  /**
@@ -2336,7 +2844,7 @@ export interface ToolExecutionStartData {
2336
2844
  * Arguments passed to the tool
2337
2845
  */
2338
2846
  arguments?: {
2339
- [k: string]: unknown;
2847
+ [k: string]: unknown | undefined;
2340
2848
  };
2341
2849
  /**
2342
2850
  * Name of the MCP server hosting this tool, when the tool is an MCP tool
@@ -2364,12 +2872,18 @@ export interface ToolExecutionStartData {
2364
2872
  */
2365
2873
  turnId?: string;
2366
2874
  }
2875
+ /**
2876
+ * Session event "tool.execution_partial_result". Streaming tool execution output for incremental result display
2877
+ */
2367
2878
  export interface ToolExecutionPartialResultEvent {
2368
2879
  /**
2369
2880
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2370
2881
  */
2371
2882
  agentId?: string;
2372
2883
  data: ToolExecutionPartialData;
2884
+ /**
2885
+ * Always true for events that are transient and not persisted to the session event log on disk.
2886
+ */
2373
2887
  ephemeral: true;
2374
2888
  /**
2375
2889
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2383,6 +2897,9 @@ export interface ToolExecutionPartialResultEvent {
2383
2897
  * ISO 8601 timestamp when the event was created
2384
2898
  */
2385
2899
  timestamp: string;
2900
+ /**
2901
+ * Type discriminator. Always "tool.execution_partial_result".
2902
+ */
2386
2903
  type: "tool.execution_partial_result";
2387
2904
  }
2388
2905
  /**
@@ -2398,12 +2915,18 @@ export interface ToolExecutionPartialData {
2398
2915
  */
2399
2916
  toolCallId: string;
2400
2917
  }
2918
+ /**
2919
+ * Session event "tool.execution_progress". Tool execution progress notification with status message
2920
+ */
2401
2921
  export interface ToolExecutionProgressEvent {
2402
2922
  /**
2403
2923
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2404
2924
  */
2405
2925
  agentId?: string;
2406
2926
  data: ToolExecutionProgressData;
2927
+ /**
2928
+ * Always true for events that are transient and not persisted to the session event log on disk.
2929
+ */
2407
2930
  ephemeral: true;
2408
2931
  /**
2409
2932
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -2417,6 +2940,9 @@ export interface ToolExecutionProgressEvent {
2417
2940
  * ISO 8601 timestamp when the event was created
2418
2941
  */
2419
2942
  timestamp: string;
2943
+ /**
2944
+ * Type discriminator. Always "tool.execution_progress".
2945
+ */
2420
2946
  type: "tool.execution_progress";
2421
2947
  }
2422
2948
  /**
@@ -2432,6 +2958,9 @@ export interface ToolExecutionProgressData {
2432
2958
  */
2433
2959
  toolCallId: string;
2434
2960
  }
2961
+ /**
2962
+ * Session event "tool.execution_complete". Tool execution completion results including success status, detailed output, and error information
2963
+ */
2435
2964
  export interface ToolExecutionCompleteEvent {
2436
2965
  /**
2437
2966
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2454,6 +2983,9 @@ export interface ToolExecutionCompleteEvent {
2454
2983
  * ISO 8601 timestamp when the event was created
2455
2984
  */
2456
2985
  timestamp: string;
2986
+ /**
2987
+ * Type discriminator. Always "tool.execution_complete".
2988
+ */
2457
2989
  type: "tool.execution_complete";
2458
2990
  }
2459
2991
  /**
@@ -2491,7 +3023,7 @@ export interface ToolExecutionCompleteData {
2491
3023
  * Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)
2492
3024
  */
2493
3025
  toolTelemetry?: {
2494
- [k: string]: unknown;
3026
+ [k: string]: unknown | undefined;
2495
3027
  };
2496
3028
  /**
2497
3029
  * Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event
@@ -2661,6 +3193,9 @@ export interface ToolExecutionCompleteContentResource {
2661
3193
  */
2662
3194
  type: "resource";
2663
3195
  }
3196
+ /**
3197
+ * Schema for the `EmbeddedTextResourceContents` type.
3198
+ */
2664
3199
  export interface EmbeddedTextResourceContents {
2665
3200
  /**
2666
3201
  * MIME type of the text content
@@ -2675,6 +3210,9 @@ export interface EmbeddedTextResourceContents {
2675
3210
  */
2676
3211
  uri: string;
2677
3212
  }
3213
+ /**
3214
+ * Schema for the `EmbeddedBlobResourceContents` type.
3215
+ */
2678
3216
  export interface EmbeddedBlobResourceContents {
2679
3217
  /**
2680
3218
  * Base64-encoded binary content of the resource
@@ -2689,6 +3227,9 @@ export interface EmbeddedBlobResourceContents {
2689
3227
  */
2690
3228
  uri: string;
2691
3229
  }
3230
+ /**
3231
+ * Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata
3232
+ */
2692
3233
  export interface SkillInvokedEvent {
2693
3234
  /**
2694
3235
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2711,6 +3252,9 @@ export interface SkillInvokedEvent {
2711
3252
  * ISO 8601 timestamp when the event was created
2712
3253
  */
2713
3254
  timestamp: string;
3255
+ /**
3256
+ * Type discriminator. Always "skill.invoked".
3257
+ */
2714
3258
  type: "skill.invoked";
2715
3259
  }
2716
3260
  /**
@@ -2746,6 +3290,9 @@ export interface SkillInvokedData {
2746
3290
  */
2747
3291
  pluginVersion?: string;
2748
3292
  }
3293
+ /**
3294
+ * Session event "subagent.started". Sub-agent startup details including parent tool call and agent information
3295
+ */
2749
3296
  export interface SubagentStartedEvent {
2750
3297
  /**
2751
3298
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2768,6 +3315,9 @@ export interface SubagentStartedEvent {
2768
3315
  * ISO 8601 timestamp when the event was created
2769
3316
  */
2770
3317
  timestamp: string;
3318
+ /**
3319
+ * Type discriminator. Always "subagent.started".
3320
+ */
2771
3321
  type: "subagent.started";
2772
3322
  }
2773
3323
  /**
@@ -2795,6 +3345,9 @@ export interface SubagentStartedData {
2795
3345
  */
2796
3346
  toolCallId: string;
2797
3347
  }
3348
+ /**
3349
+ * Session event "subagent.completed". Sub-agent completion details for successful execution
3350
+ */
2798
3351
  export interface SubagentCompletedEvent {
2799
3352
  /**
2800
3353
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2817,6 +3370,9 @@ export interface SubagentCompletedEvent {
2817
3370
  * ISO 8601 timestamp when the event was created
2818
3371
  */
2819
3372
  timestamp: string;
3373
+ /**
3374
+ * Type discriminator. Always "subagent.completed".
3375
+ */
2820
3376
  type: "subagent.completed";
2821
3377
  }
2822
3378
  /**
@@ -2852,6 +3408,9 @@ export interface SubagentCompletedData {
2852
3408
  */
2853
3409
  totalToolCalls?: number;
2854
3410
  }
3411
+ /**
3412
+ * Session event "subagent.failed". Sub-agent failure details including error message and agent information
3413
+ */
2855
3414
  export interface SubagentFailedEvent {
2856
3415
  /**
2857
3416
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2874,6 +3433,9 @@ export interface SubagentFailedEvent {
2874
3433
  * ISO 8601 timestamp when the event was created
2875
3434
  */
2876
3435
  timestamp: string;
3436
+ /**
3437
+ * Type discriminator. Always "subagent.failed".
3438
+ */
2877
3439
  type: "subagent.failed";
2878
3440
  }
2879
3441
  /**
@@ -2913,6 +3475,9 @@ export interface SubagentFailedData {
2913
3475
  */
2914
3476
  totalToolCalls?: number;
2915
3477
  }
3478
+ /**
3479
+ * Session event "subagent.selected". Custom agent selection details including name and available tools
3480
+ */
2916
3481
  export interface SubagentSelectedEvent {
2917
3482
  /**
2918
3483
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2935,6 +3500,9 @@ export interface SubagentSelectedEvent {
2935
3500
  * ISO 8601 timestamp when the event was created
2936
3501
  */
2937
3502
  timestamp: string;
3503
+ /**
3504
+ * Type discriminator. Always "subagent.selected".
3505
+ */
2938
3506
  type: "subagent.selected";
2939
3507
  }
2940
3508
  /**
@@ -2954,6 +3522,9 @@ export interface SubagentSelectedData {
2954
3522
  */
2955
3523
  tools: string[] | null;
2956
3524
  }
3525
+ /**
3526
+ * Session event "subagent.deselected". Empty payload; the event signals that the custom agent was deselected, returning to the default agent
3527
+ */
2957
3528
  export interface SubagentDeselectedEvent {
2958
3529
  /**
2959
3530
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -2976,6 +3547,9 @@ export interface SubagentDeselectedEvent {
2976
3547
  * ISO 8601 timestamp when the event was created
2977
3548
  */
2978
3549
  timestamp: string;
3550
+ /**
3551
+ * Type discriminator. Always "subagent.deselected".
3552
+ */
2979
3553
  type: "subagent.deselected";
2980
3554
  }
2981
3555
  /**
@@ -2983,6 +3557,9 @@ export interface SubagentDeselectedEvent {
2983
3557
  */
2984
3558
  export interface SubagentDeselectedData {
2985
3559
  }
3560
+ /**
3561
+ * Session event "hook.start". Hook invocation start details including type and input data
3562
+ */
2986
3563
  export interface HookStartEvent {
2987
3564
  /**
2988
3565
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3005,6 +3582,9 @@ export interface HookStartEvent {
3005
3582
  * ISO 8601 timestamp when the event was created
3006
3583
  */
3007
3584
  timestamp: string;
3585
+ /**
3586
+ * Type discriminator. Always "hook.start".
3587
+ */
3008
3588
  type: "hook.start";
3009
3589
  }
3010
3590
  /**
@@ -3023,9 +3603,12 @@ export interface HookStartData {
3023
3603
  * Input data passed to the hook
3024
3604
  */
3025
3605
  input?: {
3026
- [k: string]: unknown;
3606
+ [k: string]: unknown | undefined;
3027
3607
  };
3028
3608
  }
3609
+ /**
3610
+ * Session event "hook.end". Hook invocation completion details including output, success status, and error information
3611
+ */
3029
3612
  export interface HookEndEvent {
3030
3613
  /**
3031
3614
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3048,6 +3631,9 @@ export interface HookEndEvent {
3048
3631
  * ISO 8601 timestamp when the event was created
3049
3632
  */
3050
3633
  timestamp: string;
3634
+ /**
3635
+ * Type discriminator. Always "hook.end".
3636
+ */
3051
3637
  type: "hook.end";
3052
3638
  }
3053
3639
  /**
@@ -3067,7 +3653,7 @@ export interface HookEndData {
3067
3653
  * Output data produced by the hook
3068
3654
  */
3069
3655
  output?: {
3070
- [k: string]: unknown;
3656
+ [k: string]: unknown | undefined;
3071
3657
  };
3072
3658
  /**
3073
3659
  * Whether the hook completed successfully
@@ -3087,6 +3673,9 @@ export interface HookEndError {
3087
3673
  */
3088
3674
  stack?: string;
3089
3675
  }
3676
+ /**
3677
+ * Session event "system.message". System/developer instruction content with role and optional template metadata
3678
+ */
3090
3679
  export interface SystemMessageEvent {
3091
3680
  /**
3092
3681
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3109,6 +3698,9 @@ export interface SystemMessageEvent {
3109
3698
  * ISO 8601 timestamp when the event was created
3110
3699
  */
3111
3700
  timestamp: string;
3701
+ /**
3702
+ * Type discriminator. Always "system.message".
3703
+ */
3112
3704
  type: "system.message";
3113
3705
  }
3114
3706
  /**
@@ -3138,9 +3730,12 @@ export interface SystemMessageMetadata {
3138
3730
  * Template variables used when constructing the prompt
3139
3731
  */
3140
3732
  variables?: {
3141
- [k: string]: unknown;
3733
+ [k: string]: unknown | undefined;
3142
3734
  };
3143
3735
  }
3736
+ /**
3737
+ * Session event "system.notification". System-generated notification for runtime events like background task completion
3738
+ */
3144
3739
  export interface SystemNotificationEvent {
3145
3740
  /**
3146
3741
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3163,6 +3758,9 @@ export interface SystemNotificationEvent {
3163
3758
  * ISO 8601 timestamp when the event was created
3164
3759
  */
3165
3760
  timestamp: string;
3761
+ /**
3762
+ * Type discriminator. Always "system.notification".
3763
+ */
3166
3764
  type: "system.notification";
3167
3765
  }
3168
3766
  /**
@@ -3175,6 +3773,9 @@ export interface SystemNotificationData {
3175
3773
  content: string;
3176
3774
  kind: SystemNotification;
3177
3775
  }
3776
+ /**
3777
+ * Schema for the `SystemNotificationAgentCompleted` type.
3778
+ */
3178
3779
  export interface SystemNotificationAgentCompleted {
3179
3780
  /**
3180
3781
  * Unique identifier of the background agent
@@ -3193,8 +3794,14 @@ export interface SystemNotificationAgentCompleted {
3193
3794
  */
3194
3795
  prompt?: string;
3195
3796
  status: SystemNotificationAgentCompletedStatus;
3797
+ /**
3798
+ * Type discriminator. Always "agent_completed".
3799
+ */
3196
3800
  type: "agent_completed";
3197
3801
  }
3802
+ /**
3803
+ * Schema for the `SystemNotificationAgentIdle` type.
3804
+ */
3198
3805
  export interface SystemNotificationAgentIdle {
3199
3806
  /**
3200
3807
  * Unique identifier of the background agent
@@ -3208,8 +3815,14 @@ export interface SystemNotificationAgentIdle {
3208
3815
  * Human-readable description of the agent task
3209
3816
  */
3210
3817
  description?: string;
3818
+ /**
3819
+ * Type discriminator. Always "agent_idle".
3820
+ */
3211
3821
  type: "agent_idle";
3212
3822
  }
3823
+ /**
3824
+ * Schema for the `SystemNotificationNewInboxMessage` type.
3825
+ */
3213
3826
  export interface SystemNotificationNewInboxMessage {
3214
3827
  /**
3215
3828
  * Unique identifier of the inbox entry
@@ -3227,8 +3840,14 @@ export interface SystemNotificationNewInboxMessage {
3227
3840
  * Short summary shown before the agent decides whether to read the inbox
3228
3841
  */
3229
3842
  summary: string;
3843
+ /**
3844
+ * Type discriminator. Always "new_inbox_message".
3845
+ */
3230
3846
  type: "new_inbox_message";
3231
3847
  }
3848
+ /**
3849
+ * Schema for the `SystemNotificationShellCompleted` type.
3850
+ */
3232
3851
  export interface SystemNotificationShellCompleted {
3233
3852
  /**
3234
3853
  * Human-readable description of the command
@@ -3242,8 +3861,14 @@ export interface SystemNotificationShellCompleted {
3242
3861
  * Unique identifier of the shell session
3243
3862
  */
3244
3863
  shellId: string;
3864
+ /**
3865
+ * Type discriminator. Always "shell_completed".
3866
+ */
3245
3867
  type: "shell_completed";
3246
3868
  }
3869
+ /**
3870
+ * Schema for the `SystemNotificationShellDetachedCompleted` type.
3871
+ */
3247
3872
  export interface SystemNotificationShellDetachedCompleted {
3248
3873
  /**
3249
3874
  * Human-readable description of the command
@@ -3253,8 +3878,14 @@ export interface SystemNotificationShellDetachedCompleted {
3253
3878
  * Unique identifier of the detached shell session
3254
3879
  */
3255
3880
  shellId: string;
3881
+ /**
3882
+ * Type discriminator. Always "shell_detached_completed".
3883
+ */
3256
3884
  type: "shell_detached_completed";
3257
3885
  }
3886
+ /**
3887
+ * Schema for the `SystemNotificationInstructionDiscovered` type.
3888
+ */
3258
3889
  export interface SystemNotificationInstructionDiscovered {
3259
3890
  /**
3260
3891
  * Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/')
@@ -3272,8 +3903,14 @@ export interface SystemNotificationInstructionDiscovered {
3272
3903
  * Tool command that triggered discovery (currently always 'view')
3273
3904
  */
3274
3905
  triggerTool: string;
3906
+ /**
3907
+ * Type discriminator. Always "instruction_discovered".
3908
+ */
3275
3909
  type: "instruction_discovered";
3276
3910
  }
3911
+ /**
3912
+ * Session event "permission.requested". Permission request notification requiring client approval with request details
3913
+ */
3277
3914
  export interface PermissionRequestedEvent {
3278
3915
  /**
3279
3916
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3296,6 +3933,9 @@ export interface PermissionRequestedEvent {
3296
3933
  * ISO 8601 timestamp when the event was created
3297
3934
  */
3298
3935
  timestamp: string;
3936
+ /**
3937
+ * Type discriminator. Always "permission.requested".
3938
+ */
3299
3939
  type: "permission.requested";
3300
3940
  }
3301
3941
  /**
@@ -3358,6 +3998,9 @@ export interface PermissionRequestShell {
3358
3998
  */
3359
3999
  warning?: string;
3360
4000
  }
4001
+ /**
4002
+ * Schema for the `PermissionRequestShellCommand` type.
4003
+ */
3361
4004
  export interface PermissionRequestShellCommand {
3362
4005
  /**
3363
4006
  * Command identifier (e.g., executable name)
@@ -3368,6 +4011,9 @@ export interface PermissionRequestShellCommand {
3368
4011
  */
3369
4012
  readOnly: boolean;
3370
4013
  }
4014
+ /**
4015
+ * Schema for the `PermissionRequestShellPossibleUrl` type.
4016
+ */
3371
4017
  export interface PermissionRequestShellPossibleUrl {
3372
4018
  /**
3373
4019
  * URL that may be accessed by the command
@@ -3436,7 +4082,7 @@ export interface PermissionRequestMcp {
3436
4082
  * Arguments to pass to the MCP tool
3437
4083
  */
3438
4084
  args?: {
3439
- [k: string]: unknown;
4085
+ [k: string]: unknown | undefined;
3440
4086
  };
3441
4087
  /**
3442
4088
  * Permission kind discriminator
@@ -3523,7 +4169,7 @@ export interface PermissionRequestCustomTool {
3523
4169
  * Arguments to pass to the custom tool
3524
4170
  */
3525
4171
  args?: {
3526
- [k: string]: unknown;
4172
+ [k: string]: unknown | undefined;
3527
4173
  };
3528
4174
  /**
3529
4175
  * Permission kind discriminator
@@ -3558,7 +4204,7 @@ export interface PermissionRequestHook {
3558
4204
  * Arguments of the tool call being gated
3559
4205
  */
3560
4206
  toolArgs?: {
3561
- [k: string]: unknown;
4207
+ [k: string]: unknown | undefined;
3562
4208
  };
3563
4209
  /**
3564
4210
  * Tool call ID that triggered this permission request
@@ -3569,6 +4215,48 @@ export interface PermissionRequestHook {
3569
4215
  */
3570
4216
  toolName: string;
3571
4217
  }
4218
+ /**
4219
+ * Extension management permission request
4220
+ */
4221
+ export interface PermissionRequestExtensionManagement {
4222
+ /**
4223
+ * Name of the extension being managed
4224
+ */
4225
+ extensionName?: string;
4226
+ /**
4227
+ * Permission kind discriminator
4228
+ */
4229
+ kind: "extension-management";
4230
+ /**
4231
+ * The extension management operation (scaffold, reload)
4232
+ */
4233
+ operation: string;
4234
+ /**
4235
+ * Tool call ID that triggered this permission request
4236
+ */
4237
+ toolCallId?: string;
4238
+ }
4239
+ /**
4240
+ * Extension permission access request
4241
+ */
4242
+ export interface PermissionRequestExtensionPermissionAccess {
4243
+ /**
4244
+ * Capabilities the extension is requesting
4245
+ */
4246
+ capabilities: string[];
4247
+ /**
4248
+ * Name of the extension requesting permission access
4249
+ */
4250
+ extensionName: string;
4251
+ /**
4252
+ * Permission kind discriminator
4253
+ */
4254
+ kind: "extension-permission-access";
4255
+ /**
4256
+ * Tool call ID that triggered this permission request
4257
+ */
4258
+ toolCallId?: string;
4259
+ }
3572
4260
  /**
3573
4261
  * Shell command permission prompt
3574
4262
  */
@@ -3707,12 +4395,12 @@ export interface PermissionPromptRequestUrl {
3707
4395
  * Memory operation permission prompt
3708
4396
  */
3709
4397
  export interface PermissionPromptRequestMemory {
3710
- action?: PermissionPromptRequestMemoryAction;
4398
+ action?: PermissionRequestMemoryAction;
3711
4399
  /**
3712
4400
  * Source references for the stored fact (store only)
3713
4401
  */
3714
4402
  citations?: string;
3715
- direction?: PermissionPromptRequestMemoryDirection;
4403
+ direction?: PermissionRequestMemoryDirection;
3716
4404
  /**
3717
4405
  * The fact being stored or voted on
3718
4406
  */
@@ -3742,7 +4430,7 @@ export interface PermissionPromptRequestCustomTool {
3742
4430
  * Arguments to pass to the custom tool
3743
4431
  */
3744
4432
  args?: {
3745
- [k: string]: unknown;
4433
+ [k: string]: unknown | undefined;
3746
4434
  };
3747
4435
  /**
3748
4436
  * Prompt kind discriminator
@@ -3795,7 +4483,7 @@ export interface PermissionPromptRequestHook {
3795
4483
  * Arguments of the tool call being gated
3796
4484
  */
3797
4485
  toolArgs?: {
3798
- [k: string]: unknown;
4486
+ [k: string]: unknown | undefined;
3799
4487
  };
3800
4488
  /**
3801
4489
  * Tool call ID that triggered this permission request
@@ -3806,6 +4494,51 @@ export interface PermissionPromptRequestHook {
3806
4494
  */
3807
4495
  toolName: string;
3808
4496
  }
4497
+ /**
4498
+ * Extension management permission prompt
4499
+ */
4500
+ export interface PermissionPromptRequestExtensionManagement {
4501
+ /**
4502
+ * Name of the extension being managed
4503
+ */
4504
+ extensionName?: string;
4505
+ /**
4506
+ * Prompt kind discriminator
4507
+ */
4508
+ kind: "extension-management";
4509
+ /**
4510
+ * The extension management operation (scaffold, reload)
4511
+ */
4512
+ operation: string;
4513
+ /**
4514
+ * Tool call ID that triggered this permission request
4515
+ */
4516
+ toolCallId?: string;
4517
+ }
4518
+ /**
4519
+ * Extension permission access prompt
4520
+ */
4521
+ export interface PermissionPromptRequestExtensionPermissionAccess {
4522
+ /**
4523
+ * Capabilities the extension is requesting
4524
+ */
4525
+ capabilities: string[];
4526
+ /**
4527
+ * Name of the extension requesting permission access
4528
+ */
4529
+ extensionName: string;
4530
+ /**
4531
+ * Prompt kind discriminator
4532
+ */
4533
+ kind: "extension-permission-access";
4534
+ /**
4535
+ * Tool call ID that triggered this permission request
4536
+ */
4537
+ toolCallId?: string;
4538
+ }
4539
+ /**
4540
+ * Session event "permission.completed". Permission request completion notification signaling UI dismissal
4541
+ */
3809
4542
  export interface PermissionCompletedEvent {
3810
4543
  /**
3811
4544
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -3828,6 +4561,9 @@ export interface PermissionCompletedEvent {
3828
4561
  * ISO 8601 timestamp when the event was created
3829
4562
  */
3830
4563
  timestamp: string;
4564
+ /**
4565
+ * Type discriminator. Always "permission.completed".
4566
+ */
3831
4567
  type: "permission.completed";
3832
4568
  }
3833
4569
  /**
@@ -3844,12 +4580,18 @@ export interface PermissionCompletedData {
3844
4580
  */
3845
4581
  toolCallId?: string;
3846
4582
  }
4583
+ /**
4584
+ * Schema for the `PermissionApproved` type.
4585
+ */
3847
4586
  export interface PermissionApproved {
3848
4587
  /**
3849
4588
  * The permission request was approved
3850
4589
  */
3851
4590
  kind: "approved";
3852
4591
  }
4592
+ /**
4593
+ * Schema for the `PermissionApprovedForSession` type.
4594
+ */
3853
4595
  export interface PermissionApprovedForSession {
3854
4596
  approval: UserToolSessionApproval;
3855
4597
  /**
@@ -3857,6 +4599,9 @@ export interface PermissionApprovedForSession {
3857
4599
  */
3858
4600
  kind: "approved-for-session";
3859
4601
  }
4602
+ /**
4603
+ * Schema for the `UserToolSessionApprovalCommands` type.
4604
+ */
3860
4605
  export interface UserToolSessionApprovalCommands {
3861
4606
  /**
3862
4607
  * Command identifiers approved by the user
@@ -3867,18 +4612,27 @@ export interface UserToolSessionApprovalCommands {
3867
4612
  */
3868
4613
  kind: "commands";
3869
4614
  }
4615
+ /**
4616
+ * Schema for the `UserToolSessionApprovalRead` type.
4617
+ */
3870
4618
  export interface UserToolSessionApprovalRead {
3871
4619
  /**
3872
4620
  * Read approval kind
3873
4621
  */
3874
4622
  kind: "read";
3875
4623
  }
4624
+ /**
4625
+ * Schema for the `UserToolSessionApprovalWrite` type.
4626
+ */
3876
4627
  export interface UserToolSessionApprovalWrite {
3877
4628
  /**
3878
4629
  * Write approval kind
3879
4630
  */
3880
4631
  kind: "write";
3881
4632
  }
4633
+ /**
4634
+ * Schema for the `UserToolSessionApprovalMcp` type.
4635
+ */
3882
4636
  export interface UserToolSessionApprovalMcp {
3883
4637
  /**
3884
4638
  * MCP tool approval kind
@@ -3893,12 +4647,18 @@ export interface UserToolSessionApprovalMcp {
3893
4647
  */
3894
4648
  toolName: string | null;
3895
4649
  }
4650
+ /**
4651
+ * Schema for the `UserToolSessionApprovalMemory` type.
4652
+ */
3896
4653
  export interface UserToolSessionApprovalMemory {
3897
4654
  /**
3898
4655
  * Memory approval kind
3899
4656
  */
3900
4657
  kind: "memory";
3901
4658
  }
4659
+ /**
4660
+ * Schema for the `UserToolSessionApprovalCustomTool` type.
4661
+ */
3902
4662
  export interface UserToolSessionApprovalCustomTool {
3903
4663
  /**
3904
4664
  * Custom tool approval kind
@@ -3909,6 +4669,35 @@ export interface UserToolSessionApprovalCustomTool {
3909
4669
  */
3910
4670
  toolName: string;
3911
4671
  }
4672
+ /**
4673
+ * Schema for the `UserToolSessionApprovalExtensionManagement` type.
4674
+ */
4675
+ export interface UserToolSessionApprovalExtensionManagement {
4676
+ /**
4677
+ * Extension management approval kind
4678
+ */
4679
+ kind: "extension-management";
4680
+ /**
4681
+ * Optional operation identifier
4682
+ */
4683
+ operation?: string;
4684
+ }
4685
+ /**
4686
+ * Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type.
4687
+ */
4688
+ export interface UserToolSessionApprovalExtensionPermissionAccess {
4689
+ /**
4690
+ * Extension name
4691
+ */
4692
+ extensionName: string;
4693
+ /**
4694
+ * Extension permission access approval kind
4695
+ */
4696
+ kind: "extension-permission-access";
4697
+ }
4698
+ /**
4699
+ * Schema for the `PermissionApprovedForLocation` type.
4700
+ */
3912
4701
  export interface PermissionApprovedForLocation {
3913
4702
  approval: UserToolSessionApproval;
3914
4703
  /**
@@ -3920,6 +4709,9 @@ export interface PermissionApprovedForLocation {
3920
4709
  */
3921
4710
  locationKey: string;
3922
4711
  }
4712
+ /**
4713
+ * Schema for the `PermissionCancelled` type.
4714
+ */
3923
4715
  export interface PermissionCancelled {
3924
4716
  /**
3925
4717
  * The permission request was cancelled before a response was used
@@ -3930,6 +4722,9 @@ export interface PermissionCancelled {
3930
4722
  */
3931
4723
  reason?: string;
3932
4724
  }
4725
+ /**
4726
+ * Schema for the `PermissionDeniedByRules` type.
4727
+ */
3933
4728
  export interface PermissionDeniedByRules {
3934
4729
  /**
3935
4730
  * Denied because approval rules explicitly blocked it
@@ -3940,9 +4735,12 @@ export interface PermissionDeniedByRules {
3940
4735
  */
3941
4736
  rules: PermissionRule[];
3942
4737
  }
4738
+ /**
4739
+ * Schema for the `PermissionRule` type.
4740
+ */
3943
4741
  export interface PermissionRule {
3944
4742
  /**
3945
- * 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').
3946
4744
  */
3947
4745
  argument: string | null;
3948
4746
  /**
@@ -3950,12 +4748,18 @@ export interface PermissionRule {
3950
4748
  */
3951
4749
  kind: string;
3952
4750
  }
4751
+ /**
4752
+ * Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type.
4753
+ */
3953
4754
  export interface PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser {
3954
4755
  /**
3955
4756
  * Denied because no approval rule matched and user confirmation was unavailable
3956
4757
  */
3957
4758
  kind: "denied-no-approval-rule-and-could-not-request-from-user";
3958
4759
  }
4760
+ /**
4761
+ * Schema for the `PermissionDeniedInteractivelyByUser` type.
4762
+ */
3959
4763
  export interface PermissionDeniedInteractivelyByUser {
3960
4764
  /**
3961
4765
  * Optional feedback from the user explaining the denial
@@ -3970,6 +4774,9 @@ export interface PermissionDeniedInteractivelyByUser {
3970
4774
  */
3971
4775
  kind: "denied-interactively-by-user";
3972
4776
  }
4777
+ /**
4778
+ * Schema for the `PermissionDeniedByContentExclusionPolicy` type.
4779
+ */
3973
4780
  export interface PermissionDeniedByContentExclusionPolicy {
3974
4781
  /**
3975
4782
  * Denied by the organization's content exclusion policy
@@ -3984,6 +4791,9 @@ export interface PermissionDeniedByContentExclusionPolicy {
3984
4791
  */
3985
4792
  path: string;
3986
4793
  }
4794
+ /**
4795
+ * Schema for the `PermissionDeniedByPermissionRequestHook` type.
4796
+ */
3987
4797
  export interface PermissionDeniedByPermissionRequestHook {
3988
4798
  /**
3989
4799
  * Whether to interrupt the current agent turn
@@ -3998,12 +4808,18 @@ export interface PermissionDeniedByPermissionRequestHook {
3998
4808
  */
3999
4809
  message?: string;
4000
4810
  }
4811
+ /**
4812
+ * Session event "user_input.requested". User input request notification with question and optional predefined choices
4813
+ */
4001
4814
  export interface UserInputRequestedEvent {
4002
4815
  /**
4003
4816
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4004
4817
  */
4005
4818
  agentId?: string;
4006
4819
  data: UserInputRequestedData;
4820
+ /**
4821
+ * Always true for events that are transient and not persisted to the session event log on disk.
4822
+ */
4007
4823
  ephemeral: true;
4008
4824
  /**
4009
4825
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4017,6 +4833,9 @@ export interface UserInputRequestedEvent {
4017
4833
  * ISO 8601 timestamp when the event was created
4018
4834
  */
4019
4835
  timestamp: string;
4836
+ /**
4837
+ * Type discriminator. Always "user_input.requested".
4838
+ */
4020
4839
  type: "user_input.requested";
4021
4840
  }
4022
4841
  /**
@@ -4044,12 +4863,18 @@ export interface UserInputRequestedData {
4044
4863
  */
4045
4864
  toolCallId?: string;
4046
4865
  }
4866
+ /**
4867
+ * Session event "user_input.completed". User input request completion with the user's response
4868
+ */
4047
4869
  export interface UserInputCompletedEvent {
4048
4870
  /**
4049
4871
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4050
4872
  */
4051
4873
  agentId?: string;
4052
4874
  data: UserInputCompletedData;
4875
+ /**
4876
+ * Always true for events that are transient and not persisted to the session event log on disk.
4877
+ */
4053
4878
  ephemeral: true;
4054
4879
  /**
4055
4880
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4063,6 +4888,9 @@ export interface UserInputCompletedEvent {
4063
4888
  * ISO 8601 timestamp when the event was created
4064
4889
  */
4065
4890
  timestamp: string;
4891
+ /**
4892
+ * Type discriminator. Always "user_input.completed".
4893
+ */
4066
4894
  type: "user_input.completed";
4067
4895
  }
4068
4896
  /**
@@ -4082,12 +4910,18 @@ export interface UserInputCompletedData {
4082
4910
  */
4083
4911
  wasFreeform?: boolean;
4084
4912
  }
4913
+ /**
4914
+ * Session event "elicitation.requested". Elicitation request; may be form-based (structured input) or URL-based (browser redirect)
4915
+ */
4085
4916
  export interface ElicitationRequestedEvent {
4086
4917
  /**
4087
4918
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4088
4919
  */
4089
4920
  agentId?: string;
4090
4921
  data: ElicitationRequestedData;
4922
+ /**
4923
+ * Always true for events that are transient and not persisted to the session event log on disk.
4924
+ */
4091
4925
  ephemeral: true;
4092
4926
  /**
4093
4927
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4101,6 +4935,9 @@ export interface ElicitationRequestedEvent {
4101
4935
  * ISO 8601 timestamp when the event was created
4102
4936
  */
4103
4937
  timestamp: string;
4938
+ /**
4939
+ * Type discriminator. Always "elicitation.requested".
4940
+ */
4104
4941
  type: "elicitation.requested";
4105
4942
  }
4106
4943
  /**
@@ -4129,7 +4966,7 @@ export interface ElicitationRequestedData {
4129
4966
  * URL to open in the user's browser (url mode only)
4130
4967
  */
4131
4968
  url?: string;
4132
- [k: string]: unknown;
4969
+ [k: string]: unknown | undefined;
4133
4970
  }
4134
4971
  /**
4135
4972
  * JSON Schema describing the form fields to present to the user (form mode only)
@@ -4139,7 +4976,7 @@ export interface ElicitationRequestedSchema {
4139
4976
  * Form field definitions, keyed by field name
4140
4977
  */
4141
4978
  properties: {
4142
- [k: string]: unknown;
4979
+ [k: string]: unknown | undefined;
4143
4980
  };
4144
4981
  /**
4145
4982
  * List of required field names
@@ -4150,12 +4987,18 @@ export interface ElicitationRequestedSchema {
4150
4987
  */
4151
4988
  type: "object";
4152
4989
  }
4990
+ /**
4991
+ * Session event "elicitation.completed". Elicitation request completion with the user's response
4992
+ */
4153
4993
  export interface ElicitationCompletedEvent {
4154
4994
  /**
4155
4995
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4156
4996
  */
4157
4997
  agentId?: string;
4158
4998
  data: ElicitationCompletedData;
4999
+ /**
5000
+ * Always true for events that are transient and not persisted to the session event log on disk.
5001
+ */
4159
5002
  ephemeral: true;
4160
5003
  /**
4161
5004
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4169,6 +5012,9 @@ export interface ElicitationCompletedEvent {
4169
5012
  * ISO 8601 timestamp when the event was created
4170
5013
  */
4171
5014
  timestamp: string;
5015
+ /**
5016
+ * Type discriminator. Always "elicitation.completed".
5017
+ */
4172
5018
  type: "elicitation.completed";
4173
5019
  }
4174
5020
  /**
@@ -4180,19 +5026,25 @@ export interface ElicitationCompletedData {
4180
5026
  * The submitted form data when action is 'accept'; keys match the requested schema fields
4181
5027
  */
4182
5028
  content?: {
4183
- [k: string]: ElicitationCompletedContent;
5029
+ [k: string]: ElicitationCompletedContent | undefined;
4184
5030
  };
4185
5031
  /**
4186
5032
  * Request ID of the resolved elicitation request; clients should dismiss any UI for this request
4187
5033
  */
4188
5034
  requestId: string;
4189
5035
  }
5036
+ /**
5037
+ * Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation
5038
+ */
4190
5039
  export interface SamplingRequestedEvent {
4191
5040
  /**
4192
5041
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4193
5042
  */
4194
5043
  agentId?: string;
4195
5044
  data: SamplingRequestedData;
5045
+ /**
5046
+ * Always true for events that are transient and not persisted to the session event log on disk.
5047
+ */
4196
5048
  ephemeral: true;
4197
5049
  /**
4198
5050
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4206,6 +5058,9 @@ export interface SamplingRequestedEvent {
4206
5058
  * ISO 8601 timestamp when the event was created
4207
5059
  */
4208
5060
  timestamp: string;
5061
+ /**
5062
+ * Type discriminator. Always "sampling.requested".
5063
+ */
4209
5064
  type: "sampling.requested";
4210
5065
  }
4211
5066
  /**
@@ -4224,14 +5079,20 @@ export interface SamplingRequestedData {
4224
5079
  * Name of the MCP server that initiated the sampling request
4225
5080
  */
4226
5081
  serverName: string;
4227
- [k: string]: unknown;
5082
+ [k: string]: unknown | undefined;
4228
5083
  }
5084
+ /**
5085
+ * Session event "sampling.completed". Sampling request completion notification signaling UI dismissal
5086
+ */
4229
5087
  export interface SamplingCompletedEvent {
4230
5088
  /**
4231
5089
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4232
5090
  */
4233
5091
  agentId?: string;
4234
5092
  data: SamplingCompletedData;
5093
+ /**
5094
+ * Always true for events that are transient and not persisted to the session event log on disk.
5095
+ */
4235
5096
  ephemeral: true;
4236
5097
  /**
4237
5098
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4245,6 +5106,9 @@ export interface SamplingCompletedEvent {
4245
5106
  * ISO 8601 timestamp when the event was created
4246
5107
  */
4247
5108
  timestamp: string;
5109
+ /**
5110
+ * Type discriminator. Always "sampling.completed".
5111
+ */
4248
5112
  type: "sampling.completed";
4249
5113
  }
4250
5114
  /**
@@ -4256,12 +5120,18 @@ export interface SamplingCompletedData {
4256
5120
  */
4257
5121
  requestId: string;
4258
5122
  }
5123
+ /**
5124
+ * Session event "mcp.oauth_required". OAuth authentication request for an MCP server
5125
+ */
4259
5126
  export interface McpOauthRequiredEvent {
4260
5127
  /**
4261
5128
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4262
5129
  */
4263
5130
  agentId?: string;
4264
5131
  data: McpOauthRequiredData;
5132
+ /**
5133
+ * Always true for events that are transient and not persisted to the session event log on disk.
5134
+ */
4265
5135
  ephemeral: true;
4266
5136
  /**
4267
5137
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4275,6 +5145,9 @@ export interface McpOauthRequiredEvent {
4275
5145
  * ISO 8601 timestamp when the event was created
4276
5146
  */
4277
5147
  timestamp: string;
5148
+ /**
5149
+ * Type discriminator. Always "mcp.oauth_required".
5150
+ */
4278
5151
  type: "mcp.oauth_required";
4279
5152
  }
4280
5153
  /**
@@ -4312,12 +5185,18 @@ export interface McpOauthRequiredStaticClientConfig {
4312
5185
  */
4313
5186
  publicClient?: boolean;
4314
5187
  }
5188
+ /**
5189
+ * Session event "mcp.oauth_completed". MCP OAuth request completion notification
5190
+ */
4315
5191
  export interface McpOauthCompletedEvent {
4316
5192
  /**
4317
5193
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4318
5194
  */
4319
5195
  agentId?: string;
4320
5196
  data: McpOauthCompletedData;
5197
+ /**
5198
+ * Always true for events that are transient and not persisted to the session event log on disk.
5199
+ */
4321
5200
  ephemeral: true;
4322
5201
  /**
4323
5202
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4331,6 +5210,9 @@ export interface McpOauthCompletedEvent {
4331
5210
  * ISO 8601 timestamp when the event was created
4332
5211
  */
4333
5212
  timestamp: string;
5213
+ /**
5214
+ * Type discriminator. Always "mcp.oauth_completed".
5215
+ */
4334
5216
  type: "mcp.oauth_completed";
4335
5217
  }
4336
5218
  /**
@@ -4342,6 +5224,64 @@ export interface McpOauthCompletedData {
4342
5224
  */
4343
5225
  requestId: string;
4344
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
+ */
4345
5285
  export interface ExternalToolRequestedEvent {
4346
5286
  /**
4347
5287
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -4364,6 +5304,9 @@ export interface ExternalToolRequestedEvent {
4364
5304
  * ISO 8601 timestamp when the event was created
4365
5305
  */
4366
5306
  timestamp: string;
5307
+ /**
5308
+ * Type discriminator. Always "external_tool.requested".
5309
+ */
4367
5310
  type: "external_tool.requested";
4368
5311
  }
4369
5312
  /**
@@ -4374,7 +5317,7 @@ export interface ExternalToolRequestedData {
4374
5317
  * Arguments to pass to the external tool
4375
5318
  */
4376
5319
  arguments?: {
4377
- [k: string]: unknown;
5320
+ [k: string]: unknown | undefined;
4378
5321
  };
4379
5322
  /**
4380
5323
  * Unique identifier for this request; used to respond via session.respondToExternalTool()
@@ -4401,12 +5344,18 @@ export interface ExternalToolRequestedData {
4401
5344
  */
4402
5345
  tracestate?: string;
4403
5346
  }
5347
+ /**
5348
+ * Session event "external_tool.completed". External tool completion notification signaling UI dismissal
5349
+ */
4404
5350
  export interface ExternalToolCompletedEvent {
4405
5351
  /**
4406
5352
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4407
5353
  */
4408
5354
  agentId?: string;
4409
5355
  data: ExternalToolCompletedData;
5356
+ /**
5357
+ * Always true for events that are transient and not persisted to the session event log on disk.
5358
+ */
4410
5359
  ephemeral?: true;
4411
5360
  /**
4412
5361
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4420,6 +5369,9 @@ export interface ExternalToolCompletedEvent {
4420
5369
  * ISO 8601 timestamp when the event was created
4421
5370
  */
4422
5371
  timestamp: string;
5372
+ /**
5373
+ * Type discriminator. Always "external_tool.completed".
5374
+ */
4423
5375
  type: "external_tool.completed";
4424
5376
  }
4425
5377
  /**
@@ -4431,12 +5383,18 @@ export interface ExternalToolCompletedData {
4431
5383
  */
4432
5384
  requestId: string;
4433
5385
  }
5386
+ /**
5387
+ * Session event "command.queued". Queued slash command dispatch request for client execution
5388
+ */
4434
5389
  export interface CommandQueuedEvent {
4435
5390
  /**
4436
5391
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4437
5392
  */
4438
5393
  agentId?: string;
4439
5394
  data: CommandQueuedData;
5395
+ /**
5396
+ * Always true for events that are transient and not persisted to the session event log on disk.
5397
+ */
4440
5398
  ephemeral: true;
4441
5399
  /**
4442
5400
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4450,6 +5408,9 @@ export interface CommandQueuedEvent {
4450
5408
  * ISO 8601 timestamp when the event was created
4451
5409
  */
4452
5410
  timestamp: string;
5411
+ /**
5412
+ * Type discriminator. Always "command.queued".
5413
+ */
4453
5414
  type: "command.queued";
4454
5415
  }
4455
5416
  /**
@@ -4465,12 +5426,18 @@ export interface CommandQueuedData {
4465
5426
  */
4466
5427
  requestId: string;
4467
5428
  }
5429
+ /**
5430
+ * Session event "command.execute". Registered command dispatch request routed to the owning client
5431
+ */
4468
5432
  export interface CommandExecuteEvent {
4469
5433
  /**
4470
5434
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4471
5435
  */
4472
5436
  agentId?: string;
4473
5437
  data: CommandExecuteData;
5438
+ /**
5439
+ * Always true for events that are transient and not persisted to the session event log on disk.
5440
+ */
4474
5441
  ephemeral: true;
4475
5442
  /**
4476
5443
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4484,6 +5451,9 @@ export interface CommandExecuteEvent {
4484
5451
  * ISO 8601 timestamp when the event was created
4485
5452
  */
4486
5453
  timestamp: string;
5454
+ /**
5455
+ * Type discriminator. Always "command.execute".
5456
+ */
4487
5457
  type: "command.execute";
4488
5458
  }
4489
5459
  /**
@@ -4507,12 +5477,18 @@ export interface CommandExecuteData {
4507
5477
  */
4508
5478
  requestId: string;
4509
5479
  }
5480
+ /**
5481
+ * Session event "command.completed". Queued command completion notification signaling UI dismissal
5482
+ */
4510
5483
  export interface CommandCompletedEvent {
4511
5484
  /**
4512
5485
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4513
5486
  */
4514
5487
  agentId?: string;
4515
5488
  data: CommandCompletedData;
5489
+ /**
5490
+ * Always true for events that are transient and not persisted to the session event log on disk.
5491
+ */
4516
5492
  ephemeral: true;
4517
5493
  /**
4518
5494
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4526,6 +5502,9 @@ export interface CommandCompletedEvent {
4526
5502
  * ISO 8601 timestamp when the event was created
4527
5503
  */
4528
5504
  timestamp: string;
5505
+ /**
5506
+ * Type discriminator. Always "command.completed".
5507
+ */
4529
5508
  type: "command.completed";
4530
5509
  }
4531
5510
  /**
@@ -4537,12 +5516,18 @@ export interface CommandCompletedData {
4537
5516
  */
4538
5517
  requestId: string;
4539
5518
  }
5519
+ /**
5520
+ * Session event "auto_mode_switch.requested". Auto mode switch request notification requiring user approval
5521
+ */
4540
5522
  export interface AutoModeSwitchRequestedEvent {
4541
5523
  /**
4542
5524
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4543
5525
  */
4544
5526
  agentId?: string;
4545
5527
  data: AutoModeSwitchRequestedData;
5528
+ /**
5529
+ * Always true for events that are transient and not persisted to the session event log on disk.
5530
+ */
4546
5531
  ephemeral: true;
4547
5532
  /**
4548
5533
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4556,6 +5541,9 @@ export interface AutoModeSwitchRequestedEvent {
4556
5541
  * ISO 8601 timestamp when the event was created
4557
5542
  */
4558
5543
  timestamp: string;
5544
+ /**
5545
+ * Type discriminator. Always "auto_mode_switch.requested".
5546
+ */
4559
5547
  type: "auto_mode_switch.requested";
4560
5548
  }
4561
5549
  /**
@@ -4575,12 +5563,18 @@ export interface AutoModeSwitchRequestedData {
4575
5563
  */
4576
5564
  retryAfterSeconds?: number;
4577
5565
  }
5566
+ /**
5567
+ * Session event "auto_mode_switch.completed". Auto mode switch completion notification
5568
+ */
4578
5569
  export interface AutoModeSwitchCompletedEvent {
4579
5570
  /**
4580
5571
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4581
5572
  */
4582
5573
  agentId?: string;
4583
5574
  data: AutoModeSwitchCompletedData;
5575
+ /**
5576
+ * Always true for events that are transient and not persisted to the session event log on disk.
5577
+ */
4584
5578
  ephemeral: true;
4585
5579
  /**
4586
5580
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4594,6 +5588,9 @@ export interface AutoModeSwitchCompletedEvent {
4594
5588
  * ISO 8601 timestamp when the event was created
4595
5589
  */
4596
5590
  timestamp: string;
5591
+ /**
5592
+ * Type discriminator. Always "auto_mode_switch.completed".
5593
+ */
4597
5594
  type: "auto_mode_switch.completed";
4598
5595
  }
4599
5596
  /**
@@ -4604,17 +5601,20 @@ export interface AutoModeSwitchCompletedData {
4604
5601
  * Request ID of the resolved request; clients should dismiss any UI for this request
4605
5602
  */
4606
5603
  requestId: string;
4607
- /**
4608
- * The user's choice: 'yes', 'yes_always', or 'no'
4609
- */
4610
- response: string;
5604
+ response: AutoModeSwitchResponse;
4611
5605
  }
5606
+ /**
5607
+ * Session event "commands.changed". SDK command registration change notification
5608
+ */
4612
5609
  export interface CommandsChangedEvent {
4613
5610
  /**
4614
5611
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4615
5612
  */
4616
5613
  agentId?: string;
4617
5614
  data: CommandsChangedData;
5615
+ /**
5616
+ * Always true for events that are transient and not persisted to the session event log on disk.
5617
+ */
4618
5618
  ephemeral: true;
4619
5619
  /**
4620
5620
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4628,6 +5628,9 @@ export interface CommandsChangedEvent {
4628
5628
  * ISO 8601 timestamp when the event was created
4629
5629
  */
4630
5630
  timestamp: string;
5631
+ /**
5632
+ * Type discriminator. Always "commands.changed".
5633
+ */
4631
5634
  type: "commands.changed";
4632
5635
  }
4633
5636
  /**
@@ -4639,16 +5642,31 @@ export interface CommandsChangedData {
4639
5642
  */
4640
5643
  commands: CommandsChangedCommand[];
4641
5644
  }
5645
+ /**
5646
+ * Schema for the `CommandsChangedCommand` type.
5647
+ */
4642
5648
  export interface CommandsChangedCommand {
5649
+ /**
5650
+ * Optional human-readable command description.
5651
+ */
4643
5652
  description?: string;
5653
+ /**
5654
+ * Slash command name without the leading slash.
5655
+ */
4644
5656
  name: string;
4645
5657
  }
5658
+ /**
5659
+ * Session event "capabilities.changed". Session capability change notification
5660
+ */
4646
5661
  export interface CapabilitiesChangedEvent {
4647
5662
  /**
4648
5663
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4649
5664
  */
4650
5665
  agentId?: string;
4651
5666
  data: CapabilitiesChangedData;
5667
+ /**
5668
+ * Always true for events that are transient and not persisted to the session event log on disk.
5669
+ */
4652
5670
  ephemeral: true;
4653
5671
  /**
4654
5672
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4662,6 +5680,9 @@ export interface CapabilitiesChangedEvent {
4662
5680
  * ISO 8601 timestamp when the event was created
4663
5681
  */
4664
5682
  timestamp: string;
5683
+ /**
5684
+ * Type discriminator. Always "capabilities.changed".
5685
+ */
4665
5686
  type: "capabilities.changed";
4666
5687
  }
4667
5688
  /**
@@ -4679,12 +5700,18 @@ export interface CapabilitiesChangedUI {
4679
5700
  */
4680
5701
  elicitation?: boolean;
4681
5702
  }
5703
+ /**
5704
+ * Session event "exit_plan_mode.requested". Plan approval request with plan content and available user actions
5705
+ */
4682
5706
  export interface ExitPlanModeRequestedEvent {
4683
5707
  /**
4684
5708
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4685
5709
  */
4686
5710
  agentId?: string;
4687
5711
  data: ExitPlanModeRequestedData;
5712
+ /**
5713
+ * Always true for events that are transient and not persisted to the session event log on disk.
5714
+ */
4688
5715
  ephemeral: true;
4689
5716
  /**
4690
5717
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4698,6 +5725,9 @@ export interface ExitPlanModeRequestedEvent {
4698
5725
  * ISO 8601 timestamp when the event was created
4699
5726
  */
4700
5727
  timestamp: string;
5728
+ /**
5729
+ * Type discriminator. Always "exit_plan_mode.requested".
5730
+ */
4701
5731
  type: "exit_plan_mode.requested";
4702
5732
  }
4703
5733
  /**
@@ -4705,17 +5735,14 @@ export interface ExitPlanModeRequestedEvent {
4705
5735
  */
4706
5736
  export interface ExitPlanModeRequestedData {
4707
5737
  /**
4708
- * Available actions the user can take (e.g., approve, edit, reject)
5738
+ * Available actions the user can take
4709
5739
  */
4710
- actions: string[];
5740
+ actions: ExitPlanModeAction[];
4711
5741
  /**
4712
5742
  * Full content of the plan file
4713
5743
  */
4714
5744
  planContent: string;
4715
- /**
4716
- * The recommended action for the user to take
4717
- */
4718
- recommendedAction: string;
5745
+ recommendedAction: ExitPlanModeAction;
4719
5746
  /**
4720
5747
  * Unique identifier for this request; used to respond via session.respondToExitPlanMode()
4721
5748
  */
@@ -4725,12 +5752,18 @@ export interface ExitPlanModeRequestedData {
4725
5752
  */
4726
5753
  summary: string;
4727
5754
  }
5755
+ /**
5756
+ * Session event "exit_plan_mode.completed". Plan mode exit completion with the user's approval decision and optional feedback
5757
+ */
4728
5758
  export interface ExitPlanModeCompletedEvent {
4729
5759
  /**
4730
5760
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4731
5761
  */
4732
5762
  agentId?: string;
4733
5763
  data: ExitPlanModeCompletedData;
5764
+ /**
5765
+ * Always true for events that are transient and not persisted to the session event log on disk.
5766
+ */
4734
5767
  ephemeral: true;
4735
5768
  /**
4736
5769
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4744,6 +5777,9 @@ export interface ExitPlanModeCompletedEvent {
4744
5777
  * ISO 8601 timestamp when the event was created
4745
5778
  */
4746
5779
  timestamp: string;
5780
+ /**
5781
+ * Type discriminator. Always "exit_plan_mode.completed".
5782
+ */
4747
5783
  type: "exit_plan_mode.completed";
4748
5784
  }
4749
5785
  /**
@@ -4766,17 +5802,20 @@ export interface ExitPlanModeCompletedData {
4766
5802
  * Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request
4767
5803
  */
4768
5804
  requestId: string;
4769
- /**
4770
- * Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only')
4771
- */
4772
- selectedAction?: string;
5805
+ selectedAction?: ExitPlanModeAction;
4773
5806
  }
5807
+ /**
5808
+ * Session event "session.tools_updated".
5809
+ */
4774
5810
  export interface ToolsUpdatedEvent {
4775
5811
  /**
4776
5812
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4777
5813
  */
4778
5814
  agentId?: string;
4779
5815
  data: ToolsUpdatedData;
5816
+ /**
5817
+ * Always true for events that are transient and not persisted to the session event log on disk.
5818
+ */
4780
5819
  ephemeral: true;
4781
5820
  /**
4782
5821
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4790,17 +5829,32 @@ export interface ToolsUpdatedEvent {
4790
5829
  * ISO 8601 timestamp when the event was created
4791
5830
  */
4792
5831
  timestamp: string;
5832
+ /**
5833
+ * Type discriminator. Always "session.tools_updated".
5834
+ */
4793
5835
  type: "session.tools_updated";
4794
5836
  }
5837
+ /**
5838
+ * Schema for the `ToolsUpdatedData` type.
5839
+ */
4795
5840
  export interface ToolsUpdatedData {
5841
+ /**
5842
+ * Identifier of the model the resolved tools apply to.
5843
+ */
4796
5844
  model: string;
4797
5845
  }
5846
+ /**
5847
+ * Session event "session.background_tasks_changed".
5848
+ */
4798
5849
  export interface BackgroundTasksChangedEvent {
4799
5850
  /**
4800
5851
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4801
5852
  */
4802
5853
  agentId?: string;
4803
5854
  data: BackgroundTasksChangedData;
5855
+ /**
5856
+ * Always true for events that are transient and not persisted to the session event log on disk.
5857
+ */
4804
5858
  ephemeral: true;
4805
5859
  /**
4806
5860
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4814,16 +5868,28 @@ export interface BackgroundTasksChangedEvent {
4814
5868
  * ISO 8601 timestamp when the event was created
4815
5869
  */
4816
5870
  timestamp: string;
5871
+ /**
5872
+ * Type discriminator. Always "session.background_tasks_changed".
5873
+ */
4817
5874
  type: "session.background_tasks_changed";
4818
5875
  }
5876
+ /**
5877
+ * Schema for the `BackgroundTasksChangedData` type.
5878
+ */
4819
5879
  export interface BackgroundTasksChangedData {
4820
5880
  }
5881
+ /**
5882
+ * Session event "session.skills_loaded".
5883
+ */
4821
5884
  export interface SkillsLoadedEvent {
4822
5885
  /**
4823
5886
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4824
5887
  */
4825
5888
  agentId?: string;
4826
5889
  data: SkillsLoadedData;
5890
+ /**
5891
+ * Always true for events that are transient and not persisted to the session event log on disk.
5892
+ */
4827
5893
  ephemeral: true;
4828
5894
  /**
4829
5895
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4837,14 +5903,23 @@ export interface SkillsLoadedEvent {
4837
5903
  * ISO 8601 timestamp when the event was created
4838
5904
  */
4839
5905
  timestamp: string;
5906
+ /**
5907
+ * Type discriminator. Always "session.skills_loaded".
5908
+ */
4840
5909
  type: "session.skills_loaded";
4841
5910
  }
5911
+ /**
5912
+ * Schema for the `SkillsLoadedData` type.
5913
+ */
4842
5914
  export interface SkillsLoadedData {
4843
5915
  /**
4844
5916
  * Array of resolved skill metadata
4845
5917
  */
4846
5918
  skills: SkillsLoadedSkill[];
4847
5919
  }
5920
+ /**
5921
+ * Schema for the `SkillsLoadedSkill` type.
5922
+ */
4848
5923
  export interface SkillsLoadedSkill {
4849
5924
  /**
4850
5925
  * Description of what the skill does
@@ -4862,21 +5937,24 @@ export interface SkillsLoadedSkill {
4862
5937
  * Absolute path to the skill file, if available
4863
5938
  */
4864
5939
  path?: string;
4865
- /**
4866
- * Source location type of the skill (e.g., project, personal, plugin)
4867
- */
4868
- source: string;
5940
+ source: SkillSource;
4869
5941
  /**
4870
5942
  * Whether the skill can be invoked by the user as a slash command
4871
5943
  */
4872
5944
  userInvocable: boolean;
4873
5945
  }
5946
+ /**
5947
+ * Session event "session.custom_agents_updated".
5948
+ */
4874
5949
  export interface CustomAgentsUpdatedEvent {
4875
5950
  /**
4876
5951
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4877
5952
  */
4878
5953
  agentId?: string;
4879
5954
  data: CustomAgentsUpdatedData;
5955
+ /**
5956
+ * Always true for events that are transient and not persisted to the session event log on disk.
5957
+ */
4880
5958
  ephemeral: true;
4881
5959
  /**
4882
5960
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4890,8 +5968,14 @@ export interface CustomAgentsUpdatedEvent {
4890
5968
  * ISO 8601 timestamp when the event was created
4891
5969
  */
4892
5970
  timestamp: string;
5971
+ /**
5972
+ * Type discriminator. Always "session.custom_agents_updated".
5973
+ */
4893
5974
  type: "session.custom_agents_updated";
4894
5975
  }
5976
+ /**
5977
+ * Schema for the `CustomAgentsUpdatedData` type.
5978
+ */
4895
5979
  export interface CustomAgentsUpdatedData {
4896
5980
  /**
4897
5981
  * Array of loaded custom agent metadata
@@ -4906,6 +5990,9 @@ export interface CustomAgentsUpdatedData {
4906
5990
  */
4907
5991
  warnings: string[];
4908
5992
  }
5993
+ /**
5994
+ * Schema for the `CustomAgentsUpdatedAgent` type.
5995
+ */
4909
5996
  export interface CustomAgentsUpdatedAgent {
4910
5997
  /**
4911
5998
  * Description of what the agent does
@@ -4940,12 +6027,18 @@ export interface CustomAgentsUpdatedAgent {
4940
6027
  */
4941
6028
  userInvocable: boolean;
4942
6029
  }
6030
+ /**
6031
+ * Session event "session.mcp_servers_loaded".
6032
+ */
4943
6033
  export interface McpServersLoadedEvent {
4944
6034
  /**
4945
6035
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4946
6036
  */
4947
6037
  agentId?: string;
4948
6038
  data: McpServersLoadedData;
6039
+ /**
6040
+ * Always true for events that are transient and not persisted to the session event log on disk.
6041
+ */
4949
6042
  ephemeral: true;
4950
6043
  /**
4951
6044
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -4959,14 +6052,23 @@ export interface McpServersLoadedEvent {
4959
6052
  * ISO 8601 timestamp when the event was created
4960
6053
  */
4961
6054
  timestamp: string;
6055
+ /**
6056
+ * Type discriminator. Always "session.mcp_servers_loaded".
6057
+ */
4962
6058
  type: "session.mcp_servers_loaded";
4963
6059
  }
6060
+ /**
6061
+ * Schema for the `McpServersLoadedData` type.
6062
+ */
4964
6063
  export interface McpServersLoadedData {
4965
6064
  /**
4966
6065
  * Array of MCP server status summaries
4967
6066
  */
4968
6067
  servers: McpServersLoadedServer[];
4969
6068
  }
6069
+ /**
6070
+ * Schema for the `McpServersLoadedServer` type.
6071
+ */
4970
6072
  export interface McpServersLoadedServer {
4971
6073
  /**
4972
6074
  * Error message if the server failed to connect
@@ -4976,18 +6078,21 @@ export interface McpServersLoadedServer {
4976
6078
  * Server name (config key)
4977
6079
  */
4978
6080
  name: string;
4979
- /**
4980
- * Configuration source: user, workspace, plugin, or builtin
4981
- */
4982
- source?: string;
4983
- status: McpServersLoadedServerStatus;
6081
+ source?: McpServerSource;
6082
+ status: McpServerStatus;
4984
6083
  }
6084
+ /**
6085
+ * Session event "session.mcp_server_status_changed".
6086
+ */
4985
6087
  export interface McpServerStatusChangedEvent {
4986
6088
  /**
4987
6089
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4988
6090
  */
4989
6091
  agentId?: string;
4990
6092
  data: McpServerStatusChangedData;
6093
+ /**
6094
+ * Always true for events that are transient and not persisted to the session event log on disk.
6095
+ */
4991
6096
  ephemeral: true;
4992
6097
  /**
4993
6098
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5001,21 +6106,33 @@ export interface McpServerStatusChangedEvent {
5001
6106
  * ISO 8601 timestamp when the event was created
5002
6107
  */
5003
6108
  timestamp: string;
6109
+ /**
6110
+ * Type discriminator. Always "session.mcp_server_status_changed".
6111
+ */
5004
6112
  type: "session.mcp_server_status_changed";
5005
6113
  }
6114
+ /**
6115
+ * Schema for the `McpServerStatusChangedData` type.
6116
+ */
5006
6117
  export interface McpServerStatusChangedData {
5007
6118
  /**
5008
6119
  * Name of the MCP server whose status changed
5009
6120
  */
5010
6121
  serverName: string;
5011
- status: McpServerStatusChangedStatus;
6122
+ status: McpServerStatus;
5012
6123
  }
6124
+ /**
6125
+ * Session event "session.extensions_loaded".
6126
+ */
5013
6127
  export interface ExtensionsLoadedEvent {
5014
6128
  /**
5015
6129
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
5016
6130
  */
5017
6131
  agentId?: string;
5018
6132
  data: ExtensionsLoadedData;
6133
+ /**
6134
+ * Always true for events that are transient and not persisted to the session event log on disk.
6135
+ */
5019
6136
  ephemeral: true;
5020
6137
  /**
5021
6138
  * Unique event identifier (UUID v4), generated when the event is emitted
@@ -5029,14 +6146,23 @@ export interface ExtensionsLoadedEvent {
5029
6146
  * ISO 8601 timestamp when the event was created
5030
6147
  */
5031
6148
  timestamp: string;
6149
+ /**
6150
+ * Type discriminator. Always "session.extensions_loaded".
6151
+ */
5032
6152
  type: "session.extensions_loaded";
5033
6153
  }
6154
+ /**
6155
+ * Schema for the `ExtensionsLoadedData` type.
6156
+ */
5034
6157
  export interface ExtensionsLoadedData {
5035
6158
  /**
5036
6159
  * Array of discovered extensions and their status
5037
6160
  */
5038
6161
  extensions: ExtensionsLoadedExtension[];
5039
6162
  }
6163
+ /**
6164
+ * Schema for the `ExtensionsLoadedExtension` type.
6165
+ */
5040
6166
  export interface ExtensionsLoadedExtension {
5041
6167
  /**
5042
6168
  * Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')