@github/copilot-sdk 1.0.11 → 1.0.12-unstable.0

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.
@@ -9,7 +9,7 @@ export type JsonValue = null | boolean | number | string | JsonValue[] | {
9
9
  /**
10
10
  * Union of all session event variants emitted by the Copilot CLI runtime.
11
11
  */
12
- export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | ContextClearedEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | ManagedSettingsResolvedEvent | ManagedSettingsEnforcedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | FactoryRunUpdatedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
12
+ export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | ContextClearedEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | ModelCallFinishedEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | UIEphemeralQueryEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | ManagedSettingsResolvedEvent | ManagedSettingsEnforcedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | FactoryRunUpdatedEvent | FactoryRunStartedEvent | FactoryRunSettledEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
13
13
  /**
14
14
  * Hosting platform type of the repository (github or ado)
15
15
  */
@@ -76,6 +76,32 @@ export type AutopilotObjectiveChangedStatus =
76
76
  | "cap_reached"
77
77
  /** Objective was completed by the agent. */
78
78
  | "completed";
79
+ /**
80
+ * Origin of an effective session model change.
81
+ */
82
+ export type ModelChangeSource =
83
+ /** The user selected a model directly with `/model <id>`. */
84
+ "model_command"
85
+ /** The user selected the model with `/settings`. */
86
+ | "settings_command"
87
+ /** The user selected the model with the `/config` alias. */
88
+ | "config_command"
89
+ /** The user selected the model in the model picker, including the picker opened by bare `/model`. */
90
+ | "model_picker"
91
+ /** Organization-managed settings selected the model. */
92
+ | "managed_settings"
93
+ /** Repository settings selected the model. */
94
+ | "repo_settings"
95
+ /** Startup model resolution selected the model. */
96
+ | "startup"
97
+ /** Selecting an agent selected its configured model. */
98
+ | "agent"
99
+ /** Entering, leaving, or reconfiguring plan mode selected the model. */
100
+ | "plan_mode"
101
+ /** The runtime selected the model automatically, such as rate-limit recovery or refusal fallback. */
102
+ | "automatic"
103
+ /** An SDK or RPC caller selected the model. */
104
+ | "sdk";
79
105
  /**
80
106
  * The session mode the agent is operating in
81
107
  */
@@ -87,16 +113,16 @@ export type SessionMode =
87
113
  /** The agent is working autonomously toward task completion. */
88
114
  | "autopilot";
89
115
  /**
90
- * Allow-all mode for the session.
116
+ * Permission mode for the session.
91
117
  */
92
118
  /** @experimental */
93
- export type PermissionAllowAllMode =
119
+ export type PermissionMode =
94
120
  /** Permission requests follow the normal approval flow. */
95
- "off"
121
+ "manual"
122
+ /** Permission requests include an LLM safety recommendation; clients may automatically approve requests judged acceptable. */
123
+ | "assisted"
96
124
  /** Tool, path, and URL permission requests are automatically approved. */
97
- | "on"
98
- /** Permission requests follow the normal approval flow with an LLM advisory recommendation attached; clients may choose to auto-approve requests the judge evaluated as acceptable. */
99
- | "auto";
125
+ | "allow-all";
100
126
  /**
101
127
  * The type of operation performed on the plan file
102
128
  */
@@ -235,6 +261,14 @@ export type AssistantUsageApiEndpoint =
235
261
  | "/responses"
236
262
  /** WebSocket Responses API endpoint. */
237
263
  | "ws:/responses";
264
+ /**
265
+ * Transport used for a successful model call
266
+ */
267
+ export type AssistantUsageTransport =
268
+ /** HTTP transport, including SSE streams. */
269
+ "http"
270
+ /** WebSocket transport. */
271
+ | "websocket";
238
272
  /**
239
273
  * For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature). Absent for non-400 failures.
240
274
  */
@@ -269,6 +303,18 @@ export type ModelCallFailureTransport =
269
303
  "http"
270
304
  /** WebSocket transport. */
271
305
  | "websocket";
306
+ /**
307
+ * Final outcome of one logical model dispatch after response acceptance processing
308
+ */
309
+ export type ModelCallFinishedOutcome =
310
+ /** The provider response was accepted for continued agent processing. */
311
+ "success"
312
+ /** The dispatch ended with a provider or transport error. */
313
+ | "error"
314
+ /** The dispatch was cancelled before an accepted response was produced. */
315
+ | "cancelled"
316
+ /** The provider response was rejected during post-response acceptance processing. */
317
+ | "rejected";
272
318
  /**
273
319
  * Finite reason code describing why the current turn was aborted
274
320
  */
@@ -395,7 +441,14 @@ export type SystemNotificationFactoryCompletedStatus =
395
441
  /**
396
442
  * Details of the permission being requested
397
443
  */
398
- export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement | PermissionRequestFactory | PermissionRequestExtensionPermissionAccess;
444
+ export type PermissionRequest = PermissionRequestShell | PermissionRequestWrite | PermissionRequestRead | PermissionRequestMcp | PermissionRequestUrl | PermissionRequestMemory | PermissionRequestCustomTool | PermissionRequestHook | PermissionRequestExtensionManagement | PermissionRequestFactory | PermissionRequestExtensionPermissionAccess | PermissionRequestExtensionEnvAccess;
445
+ /**
446
+ * Advisory recommendation the runtime attaches to a permission request whose origin it can vouch for by construction. Unlike the auto-approval judge this does not depend on auto mode and does not evaluate what the tool call does; its absence simply means the runtime has no opinion and the request follows the host's normal approval flow.
447
+ */
448
+ /** @experimental */
449
+ export type PermissionRecommendation =
450
+ /** The runtime vouches for the request's origin and recommends approving it without prompting. The host still owns the decision and may deny it; deny rules, managed policy, and the auto-approval safety judge all outrank this recommendation. */
451
+ "approve";
399
452
  /**
400
453
  * Whether this is a store or vote memory operation
401
454
  */
@@ -405,30 +458,10 @@ export type PermissionRequestMemoryAction =
405
458
  /** Vote on an existing memory. */
406
459
  | "vote";
407
460
  /**
408
- * Vote direction (vote only)
409
- */
410
- export type PermissionRequestMemoryDirection =
411
- /** Vote that the memory is useful or accurate. */
412
- "upvote"
413
- /** Vote that the memory is incorrect or outdated. */
414
- | "downvote";
415
- /**
416
- * Operation gated by a factory permission request.
417
- */
418
- export type FactoryPermissionOperation =
419
- /** Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. */
420
- "run"
421
- /** Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. */
422
- | "author";
423
- /**
424
- * Derived user-facing permission prompt details for UI consumers
425
- */
426
- export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestFactory | PermissionPromptRequestExtensionPermissionAccess;
427
- /**
428
- * Why the auto-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs.
461
+ * Why the assisted-approval judge produced no usable recommendation. Present only alongside an `error` recommendation, where the human-readable reason is a fixed string and therefore cannot distinguish these cases. Intended to make a judge failure reportable by a consumer that has no access to the host's logs.
429
462
  */
430
463
  /** @experimental */
431
- export type AutoApprovalJudgeFailureReason =
464
+ export type AssistedApprovalJudgeFailureReason =
432
465
  /** The judge model call exceeded its deadline. */
433
466
  "timeout"
434
467
  /** The judge model call was cancelled before it returned. */
@@ -440,18 +473,46 @@ export type AutoApprovalJudgeFailureReason =
440
473
  /** The judge model replied, but the reply carried no ALLOW/DENY verdict. */
441
474
  | "parse_error";
442
475
  /**
443
- * Outcome of the auto-approval safety judge for a permission request. Present only when auto mode is enabled; its absence means the judge did not evaluate the request (auto mode was off).
476
+ * Outcome of the assisted-approval safety judge for a permission request. Present only in assisted mode; its absence means the judge did not evaluate the request.
444
477
  */
445
478
  /** @experimental */
446
- export type AutoApprovalRecommendation =
479
+ export type AssistedApprovalRecommendation =
447
480
  /** The judge evaluated the request and recommends automatically approving it. */
448
481
  "approve"
449
- /** The judge evaluated the request and does not recommend auto-approving it; explicit approval is required. Whether that means prompting, denying, or something else is the consumer's decision. */
482
+ /** The judge evaluated the request and does not recommend automatically approving it; explicit approval is required. Whether that means prompting, denying, or something else is the consumer's decision. */
450
483
  | "requireApproval"
451
- /** Auto mode is enabled, but this request category is never auto-approvable (for example, sandbox-bypass requests), so the judge was not consulted. */
484
+ /** Assisted mode is enabled, but this request category is never automatically approvable (for example, sandbox-bypass requests), so the judge was not consulted. */
452
485
  | "excluded"
453
486
  /** The judge was consulted but did not return a usable recommendation, so the request requires explicit approval. */
454
487
  | "error";
488
+ /**
489
+ * Vote direction (vote only)
490
+ */
491
+ export type PermissionRequestMemoryDirection =
492
+ /** Vote that the memory is useful or accurate. */
493
+ "upvote"
494
+ /** Vote that the memory is incorrect or outdated. */
495
+ | "downvote";
496
+ /**
497
+ * Scope of a stored memory.
498
+ */
499
+ export type PermissionRequestMemoryScope =
500
+ /** Store the memory for the current repository. */
501
+ "repository"
502
+ /** Store the memory for the current user. */
503
+ | "user";
504
+ /**
505
+ * Operation gated by a factory permission request.
506
+ */
507
+ export type FactoryPermissionOperation =
508
+ /** Running a registered factory, which spends subagents, active time, and AI credits under the approved limits. */
509
+ "run"
510
+ /** Authoring a factory, which writes JavaScript into a session-scoped extension and loads it. */
511
+ | "author";
512
+ /**
513
+ * Derived user-facing permission prompt details for UI consumers
514
+ */
515
+ export type PermissionPromptRequest = PermissionPromptRequestCommands | PermissionPromptRequestWrite | PermissionPromptRequestRead | PermissionPromptRequestMcp | PermissionPromptRequestUrl | PermissionPromptRequestMemory | PermissionPromptRequestCustomTool | PermissionPromptRequestPath | PermissionPromptRequestHook | PermissionPromptRequestExtensionManagement | PermissionPromptRequestFactory | PermissionPromptRequestExtensionPermissionAccess | PermissionPromptRequestExtensionEnvAccess;
455
516
  /**
456
517
  * Underlying permission kind that needs path approval
457
518
  */
@@ -469,7 +530,7 @@ export type PermissionResult = PermissionApproved | PermissionApprovedForSession
469
530
  /**
470
531
  * The approval to add as a session-scoped rule
471
532
  */
472
- export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement | UserToolSessionApprovalFactory | UserToolSessionApprovalExtensionPermissionAccess;
533
+ export type UserToolSessionApproval = UserToolSessionApprovalCommands | UserToolSessionApprovalRead | UserToolSessionApprovalWrite | UserToolSessionApprovalMcp | UserToolSessionApprovalMemory | UserToolSessionApprovalCustomTool | UserToolSessionApprovalExtensionManagement | UserToolSessionApprovalFactory | UserToolSessionApprovalExtensionPermissionAccess | UserToolSessionApprovalExtensionEnvAccess;
473
534
  /**
474
535
  * Elicitation mode; "form" for structured input, "url" for browser-based. Defaults to "form" when absent.
475
536
  */
@@ -536,6 +597,21 @@ export type McpHeadersRefreshCompletedOutcome =
536
597
  * Source-defined JSON payload for the custom notification
537
598
  */
538
599
  export type CustomNotificationPayload = JsonValue;
600
+ /**
601
+ * Lifecycle phase for a Rust-owned ephemeral query stream.
602
+ */
603
+ /** @experimental */
604
+ export type UIEphemeralQueryPhase =
605
+ /** The ephemeral query stream has begun. */
606
+ "started"
607
+ /** A partial result chunk was produced by the stream. */
608
+ | "chunk"
609
+ /** The ephemeral query stream finished successfully. */
610
+ | "completed"
611
+ /** The ephemeral query stream ended with an error. */
612
+ | "failed"
613
+ /** The ephemeral query stream was cancelled before completing. */
614
+ | "aborted";
539
615
  /**
540
616
  * The user's auto-mode-switch choice
541
617
  */
@@ -592,16 +668,18 @@ export type ManagedSettingsEnforcedAction =
592
668
  * For a `bypass_permissions_blocked` action, which permission-escalation primitive was refused
593
669
  */
594
670
  export type ManagedSettingsEnforcedEscalation =
595
- /** Full allow-all ("/allow-all on") permissions — auto-approving tools, paths, and URLs. */
671
+ /** Full allow-all permissions — automatically approving tools, paths, and URLs. */
596
672
  "allow_all"
597
- /** Auto-approval of all tool permission requests. */
673
+ /** Automatic approval of all tool permission requests. */
598
674
  | "approve_all"
599
- /** Advisory auto-approval ("/allow-all auto") mode — keeps normal prompt paths and adds LLM-advised approval, distinct from full allow-all. */
600
- | "auto_approval"
675
+ /** Assisted mode — keeps normal prompt paths and adds an LLM recommendation, distinct from allow-all. */
676
+ | "assisted_approval"
601
677
  /** Unrestricted filesystem access outside the session's allowed directories. */
602
678
  | "unrestricted_paths"
603
679
  /** Unrestricted URL fetch access. */
604
- | "unrestricted_urls";
680
+ | "unrestricted_urls"
681
+ /** A server-wide MCP "Always Allow" (or `--allow-tool <server>`) blanket that would auto-approve every tool from an MCP server. Capped to per-tool approval; each tool still prompts. */
682
+ | "server_wide_mcp_approval";
605
683
  /**
606
684
  * Exit plan mode action
607
685
  */
@@ -614,6 +692,18 @@ export type ExitPlanModeAction =
614
692
  | "autopilot"
615
693
  /** Exit plan mode and continue with parallel autonomous workers. */
616
694
  | "autopilot_fleet";
695
+ /**
696
+ * Terminal status a factory run committed. A settled run is never `pending` or `running`, so those two members of the run-status domain are deliberately absent.
697
+ */
698
+ export type FactoryRunSettledStatus =
699
+ /** The factory body resolved and its result was committed. */
700
+ "completed"
701
+ /** The run was stopped by a limit, an approval refusal or another policy decision. */
702
+ | "halted"
703
+ /** The run was cancelled by its caller or by session disposal. */
704
+ | "cancelled"
705
+ /** The run failed, with `failureType` carrying the class when it has one. */
706
+ | "error";
617
707
  /**
618
708
  * Source location type (e.g., project, personal-copilot, plugin, builtin)
619
709
  */
@@ -1474,6 +1564,7 @@ export interface ModelChangeData {
1474
1564
  */
1475
1565
  reasoningEffort?: string | null;
1476
1566
  reasoningSummary?: ReasoningSummary;
1567
+ source?: ModelChangeSource;
1477
1568
  verbosity?: Verbosity;
1478
1569
  }
1479
1570
  /**
@@ -1553,8 +1644,9 @@ export interface SessionLimitsChangedData {
1553
1644
  sessionLimits: SessionLimitsConfig | null;
1554
1645
  }
1555
1646
  /**
1556
- * Session event "session.permissions_changed". Permissions change details carrying the aggregate allow-all transition.
1647
+ * Session event "session.permissions_changed". Permission-mode transition details.
1557
1648
  */
1649
+ /** @experimental */
1558
1650
  export interface PermissionsChangedEvent {
1559
1651
  /**
1560
1652
  * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
@@ -1583,29 +1675,28 @@ export interface PermissionsChangedEvent {
1583
1675
  type: "session.permissions_changed";
1584
1676
  }
1585
1677
  /**
1586
- * Permissions change details carrying the aggregate allow-all transition.
1678
+ * Permission-mode transition details.
1587
1679
  */
1680
+ /** @experimental */
1588
1681
  export interface PermissionsChangedData {
1589
1682
  /**
1590
- * Allow-all mode after the change
1683
+ * Explicit LLM judge model override used by assisted mode; omitted when the provider default applies
1591
1684
  *
1592
1685
  * @experimental
1593
1686
  */
1594
- allowAllPermissionMode?: PermissionAllowAllMode;
1687
+ assistedApprovalModel?: string;
1595
1688
  /**
1596
- * Aggregate allow-all flag after the change
1597
- */
1598
- allowAllPermissions: boolean;
1599
- /**
1600
- * Allow-all mode before the change
1689
+ * Permission mode after the change
1601
1690
  *
1602
1691
  * @experimental
1603
1692
  */
1604
- previousAllowAllPermissionMode?: PermissionAllowAllMode;
1693
+ mode: PermissionMode;
1605
1694
  /**
1606
- * Aggregate allow-all flag before the change
1695
+ * Permission mode before the change
1696
+ *
1697
+ * @experimental
1607
1698
  */
1608
- previousAllowAllPermissions: boolean;
1699
+ previousMode: PermissionMode;
1609
1700
  }
1610
1701
  /**
1611
1702
  * Session event "session.plan_changed". Plan file operation details indicating what changed
@@ -1936,6 +2027,12 @@ export interface ShutdownEvent {
1936
2027
  * Session termination metrics including usage statistics, code changes, and shutdown reason
1937
2028
  */
1938
2029
  export interface ShutdownData {
2030
+ /**
2031
+ * Per-agent usage breakdown, keyed by agent instance identifier. The main conversation uses the stable key `main`.
2032
+ */
2033
+ agentMetrics?: {
2034
+ [k: string]: ShutdownAgentMetric | undefined;
2035
+ };
1939
2036
  codeChanges: ShutdownCodeChanges;
1940
2037
  /**
1941
2038
  * Non-system message token count at shutdown
@@ -1994,21 +2091,31 @@ export interface ShutdownData {
1994
2091
  totalNanoAiu?: number;
1995
2092
  }
1996
2093
  /**
1997
- * Aggregate code change metrics for the session
2094
+ * Usage attributed to one agent instance at session shutdown.
1998
2095
  */
1999
- export interface ShutdownCodeChanges {
2096
+ export interface ShutdownAgentMetric {
2000
2097
  /**
2001
- * List of file paths that were modified during the session
2098
+ * Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels.
2002
2099
  */
2003
- filesModified: string[];
2100
+ agentDisplayName?: string;
2004
2101
  /**
2005
- * Total number of lines added during the session
2102
+ * Configured agent name, when this is a subagent
2006
2103
  */
2007
- linesAdded: number;
2104
+ agentName?: string;
2008
2105
  /**
2009
- * Total number of lines removed during the session
2106
+ * Per-model usage for this agent, keyed by model identifier
2010
2107
  */
2011
- linesRemoved: number;
2108
+ modelMetrics: {
2109
+ [k: string]: ShutdownModelMetric | undefined;
2110
+ };
2111
+ /**
2112
+ * Time spent in model API calls by this agent, in milliseconds
2113
+ */
2114
+ totalApiDurationMs: number;
2115
+ /**
2116
+ * Accumulated nano-AI units cost for this agent
2117
+ */
2118
+ totalNanoAiu: number;
2012
2119
  }
2013
2120
  /**
2014
2121
  * Per-model shutdown metrics with request counts, token usage, nano-AI units, and token details.
@@ -2080,6 +2187,23 @@ export interface ShutdownModelMetricUsage {
2080
2187
  */
2081
2188
  reasoningTokens?: number;
2082
2189
  }
2190
+ /**
2191
+ * Aggregate code change metrics for the session
2192
+ */
2193
+ export interface ShutdownCodeChanges {
2194
+ /**
2195
+ * List of file paths that were modified during the session
2196
+ */
2197
+ filesModified: string[];
2198
+ /**
2199
+ * Total number of lines added during the session
2200
+ */
2201
+ linesAdded: number;
2202
+ /**
2203
+ * Total number of lines removed during the session
2204
+ */
2205
+ linesRemoved: number;
2206
+ }
2083
2207
  /**
2084
2208
  * A session-wide shutdown token-type entry storing the accumulated token count.
2085
2209
  */
@@ -2607,6 +2731,10 @@ export interface UserMessageData {
2607
2731
  * Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching
2608
2732
  */
2609
2733
  transformedContent?: string;
2734
+ /**
2735
+ * The agent-loop turn ID that consumed this message; absent when no agent-loop turn consumed it
2736
+ */
2737
+ turnId?: string;
2610
2738
  }
2611
2739
  /**
2612
2740
  * File attachment
@@ -3256,6 +3384,9 @@ export interface AssistantReasoningData {
3256
3384
  * Unique identifier for this reasoning block
3257
3385
  */
3258
3386
  reasoningId: string;
3387
+ /**
3388
+ * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
3389
+ */
3259
3390
  rte?: boolean;
3260
3391
  }
3261
3392
  /**
@@ -3493,6 +3624,9 @@ export interface AssistantMessageData {
3493
3624
  * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
3494
3625
  */
3495
3626
  requestId?: string;
3627
+ /**
3628
+ * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
3629
+ */
3496
3630
  rte?: boolean;
3497
3631
  serverTools?: AssistantMessageServerTools;
3498
3632
  /**
@@ -3641,12 +3775,27 @@ export interface CitationLocationBlock {
3641
3775
  */
3642
3776
  /** @experimental */
3643
3777
  export interface AssistantMessageServerTools {
3778
+ /**
3779
+ * Advisor model identifier associated with the server-tool payload.
3780
+ */
3644
3781
  advisorModel?: string;
3782
+ /**
3783
+ * Provider function-call namespaces keyed by function-call identifier.
3784
+ */
3645
3785
  functionCallNamespaces?: {
3646
3786
  [k: string]: string | undefined;
3647
3787
  };
3788
+ /**
3789
+ * Provider-native server-tool call and output items preserved verbatim for replay.
3790
+ */
3648
3791
  items?: JsonValue[];
3792
+ /**
3793
+ * Model provider that produced this server-tool payload.
3794
+ */
3649
3795
  provider: string;
3796
+ /**
3797
+ * Raw provider content blocks retained for verbatim round-tripping.
3798
+ */
3650
3799
  rawContentBlocks?: JsonValue[];
3651
3800
  }
3652
3801
  /**
@@ -3890,6 +4039,10 @@ export interface AssistantUsageEvent {
3890
4039
  * LLM API call usage metrics including tokens, costs, quotas, and billing information
3891
4040
  */
3892
4041
  export interface AssistantUsageData {
4042
+ /**
4043
+ * Number of accepted speculative prediction tokens
4044
+ */
4045
+ acceptedPredictionTokens?: number;
3893
4046
  /**
3894
4047
  * Completion ID from the model provider (e.g., chatcmpl-abc123)
3895
4048
  */
@@ -3942,6 +4095,22 @@ export interface AssistantUsageData {
3942
4095
  * Average inter-token latency in milliseconds. Only available for streaming requests
3943
4096
  */
3944
4097
  interTokenLatencyMs?: number;
4098
+ /**
4099
+ * Whether Auto mode was selected for this model call
4100
+ */
4101
+ isAuto?: boolean;
4102
+ /**
4103
+ * Whether this model call used a bring-your-own-key provider
4104
+ */
4105
+ isByok?: boolean;
4106
+ /**
4107
+ * Requested maximum output tokens used for this model call
4108
+ */
4109
+ maxOutputTokens?: number;
4110
+ /**
4111
+ * Effective maximum prompt-token limit used for this model call
4112
+ */
4113
+ maxPromptTokens?: number;
3945
4114
  /**
3946
4115
  * Model identifier used for this API call
3947
4116
  */
@@ -3950,6 +4119,10 @@ export interface AssistantUsageData {
3950
4119
  * Number of output tokens produced
3951
4120
  */
3952
4121
  outputTokens?: number;
4122
+ /**
4123
+ * Time to first observable model output in milliseconds. Includes text, reasoning, and tool-call output; only available for streaming requests that produce observable output.
4124
+ */
4125
+ outputTtftMs?: number;
3953
4126
  /**
3954
4127
  * @deprecated
3955
4128
  * Parent tool call ID when this usage originates from a sub-agent
@@ -3963,10 +4136,18 @@ export interface AssistantUsageData {
3963
4136
  * Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
3964
4137
  */
3965
4138
  reasoningEffort?: string;
4139
+ reasoningSummary?: ReasoningSummary;
3966
4140
  /**
3967
4141
  * Number of output tokens used for reasoning (e.g., chain-of-thought)
3968
4142
  */
3969
4143
  reasoningTokens?: number;
4144
+ /**
4145
+ * Number of rejected speculative prediction tokens
4146
+ */
4147
+ rejectedPredictionTokens?: number;
4148
+ /**
4149
+ * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
4150
+ */
3970
4151
  rte?: boolean;
3971
4152
  /**
3972
4153
  * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
@@ -3976,6 +4157,7 @@ export interface AssistantUsageData {
3976
4157
  * Time to first token in milliseconds. Only available for streaming requests
3977
4158
  */
3978
4159
  timeToFirstTokenMs?: number;
4160
+ transport?: AssistantUsageTransport;
3979
4161
  }
3980
4162
  /**
3981
4163
  * Per-request cost and usage data from the CAPI copilot_usage response field
@@ -4068,6 +4250,10 @@ export interface ModelCallFailureData {
4068
4250
  * What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls
4069
4251
  */
4070
4252
  initiator?: string;
4253
+ /**
4254
+ * Authoritative interaction classification for the failed call, matching `assistant.usage.interactionType` (for example `conversation-agent`, `conversation-subagent`, or `conversation-sampling`). Absent when the producer cannot classify the interaction.
4255
+ */
4256
+ interactionType?: string;
4071
4257
  /**
4072
4258
  * Whether the session selected Auto mode for the failed call
4073
4259
  */
@@ -4097,6 +4283,9 @@ export interface ModelCallFailureData {
4097
4283
  */
4098
4284
  reasoningEffort?: string;
4099
4285
  requestFingerprint?: ModelCallFailureRequestFingerprint;
4286
+ /**
4287
+ * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
4288
+ */
4100
4289
  rte?: boolean;
4101
4290
  /**
4102
4291
  * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
@@ -4142,6 +4331,62 @@ export interface ModelCallFailureRequestFingerprint {
4142
4331
  */
4143
4332
  toolResultMessageCount: number;
4144
4333
  }
4334
+ /**
4335
+ * Session event "model.call_finished". Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count.
4336
+ */
4337
+ export interface ModelCallFinishedEvent {
4338
+ /**
4339
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4340
+ */
4341
+ agentId?: string;
4342
+ data: ModelCallFinishedData;
4343
+ /**
4344
+ * Always true for events that are transient and not persisted to the session event log on disk.
4345
+ */
4346
+ ephemeral: true;
4347
+ /**
4348
+ * Unique event identifier (UUID v4), generated when the event is emitted
4349
+ */
4350
+ id: string;
4351
+ /**
4352
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
4353
+ */
4354
+ parentId: string | null;
4355
+ /**
4356
+ * ISO 8601 timestamp when the event was created
4357
+ */
4358
+ timestamp: string;
4359
+ /**
4360
+ * Type discriminator. Always "model.call_finished".
4361
+ */
4362
+ type: "model.call_finished";
4363
+ }
4364
+ /**
4365
+ * Final lifecycle outcome for one logical model dispatch. A logical dispatch may include internal reconnect or fallback work, so event count is not provider HTTP-request count.
4366
+ */
4367
+ export interface ModelCallFinishedData {
4368
+ /**
4369
+ * Whether an accepted successful response requested the exact name and command semantics of a built-in file edit tool, including an external tool explicitly replacing that built-in name. Absent when the logical dispatch did not produce an accepted response.
4370
+ */
4371
+ containsBuiltInFileEditRequest?: boolean;
4372
+ /**
4373
+ * Monotonic elapsed time spent in the logical model dispatch, including any internal transport reconnect or fallback and excluding orchestrator retry backoff, tool execution, confirmations, and post-response processing
4374
+ */
4375
+ dispatchDurationMs: number;
4376
+ /**
4377
+ * Version of the built-in file-edit semantic classifier used for this event
4378
+ */
4379
+ editClassifierVersion: number;
4380
+ /**
4381
+ * Identifier of the user interaction that owns the model dispatch, matching assistant.turn_start.interactionId when available
4382
+ */
4383
+ interactionId?: string;
4384
+ outcome: ModelCallFinishedOutcome;
4385
+ /**
4386
+ * Agent-loop iteration within the interaction that initiated the model dispatch
4387
+ */
4388
+ turnId: string;
4389
+ }
4145
4390
  /**
4146
4391
  * Session event "abort". Turn abort information including the reason for termination
4147
4392
  */
@@ -4284,6 +4529,9 @@ export interface ToolExecutionStartData {
4284
4529
  * Tool call ID of the parent tool invocation when this event originates from a sub-agent
4285
4530
  */
4286
4531
  parentToolCallId?: string;
4532
+ /**
4533
+ * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
4534
+ */
4287
4535
  rte?: boolean;
4288
4536
  shellToolInfo?: ToolExecutionStartShellToolInfo;
4289
4537
  /**
@@ -4497,6 +4745,9 @@ export interface ToolExecutionCompleteData {
4497
4745
  */
4498
4746
  parentToolCallId?: string;
4499
4747
  result?: ToolExecutionCompleteResult;
4748
+ /**
4749
+ * Per-request treatment/eligibility signal returned by the Copilot API in the `X-GitHub-Copilot-Request-TE` response header for the associated model call; `false` when the header was absent or unparseable.
4750
+ */
4500
4751
  rte?: boolean;
4501
4752
  /**
4502
4753
  * Whether this tool execution ran inside a sandbox container
@@ -4910,17 +5161,35 @@ export interface ToolExecutionCompleteUIResourceMeta {
4910
5161
  */
4911
5162
  export interface ToolExecutionCompleteUIResourceMetaUI {
4912
5163
  csp?: ToolExecutionCompleteUIResourceMetaUICsp;
5164
+ /**
5165
+ * Optional dedicated origin for the rendered MCP Apps UI resource.
5166
+ */
4913
5167
  domain?: string;
4914
5168
  permissions?: ToolExecutionCompleteUIResourceMetaUIPermissions;
5169
+ /**
5170
+ * Whether the host should render a border around the MCP Apps UI resource.
5171
+ */
4915
5172
  prefersBorder?: boolean;
4916
5173
  }
4917
5174
  /**
4918
5175
  * CSP domain allowlists for an MCP Apps UI resource, including connect, resource, frame, and base URI domains.
4919
5176
  */
4920
5177
  export interface ToolExecutionCompleteUIResourceMetaUICsp {
5178
+ /**
5179
+ * Domains the UI resource may use as document base URIs.
5180
+ */
4921
5181
  baseUriDomains?: string[];
5182
+ /**
5183
+ * Domains the UI resource may connect to.
5184
+ */
4922
5185
  connectDomains?: string[];
5186
+ /**
5187
+ * Domains the UI resource may embed as nested frames.
5188
+ */
4923
5189
  frameDomains?: string[];
5190
+ /**
5191
+ * Domains from which the UI resource may load scripts, styles, images, and other resources.
5192
+ */
4924
5193
  resourceDomains?: string[];
4925
5194
  }
4926
5195
  /**
@@ -5146,6 +5415,10 @@ export interface SubagentStartedData {
5146
5415
  * Internal name of the sub-agent
5147
5416
  */
5148
5417
  agentName: string;
5418
+ /**
5419
+ * Root id of the factory run that spawned this sub-agent, when it was spawned by one.
5420
+ */
5421
+ factoryRunId?: string;
5149
5422
  /**
5150
5423
  * Model the sub-agent will run with, when known at start.
5151
5424
  */
@@ -5702,7 +5975,7 @@ export interface SystemNotificationData {
5702
5975
  */
5703
5976
  export interface SystemNotificationAgentCompleted {
5704
5977
  /**
5705
- * Unique identifier of the background agent
5978
+ * Unique task identifier
5706
5979
  */
5707
5980
  agentId: string;
5708
5981
  /**
@@ -5713,6 +5986,10 @@ export interface SystemNotificationAgentCompleted {
5713
5986
  * Human-readable description of the agent task
5714
5987
  */
5715
5988
  description?: string;
5989
+ /**
5990
+ * Friendly, non-unique name intended for display
5991
+ */
5992
+ displayName?: string;
5716
5993
  /**
5717
5994
  * The full prompt given to the background agent
5718
5995
  */
@@ -5728,7 +6005,7 @@ export interface SystemNotificationAgentCompleted {
5728
6005
  */
5729
6006
  export interface SystemNotificationAgentIdle {
5730
6007
  /**
5731
- * Unique identifier of the background agent
6008
+ * Unique task identifier
5732
6009
  */
5733
6010
  agentId: string;
5734
6011
  /**
@@ -5739,6 +6016,10 @@ export interface SystemNotificationAgentIdle {
5739
6016
  * Human-readable description of the agent task
5740
6017
  */
5741
6018
  description?: string;
6019
+ /**
6020
+ * Friendly, non-unique name intended for display
6021
+ */
6022
+ displayName?: string;
5742
6023
  /**
5743
6024
  * Type discriminator. Always "agent_idle".
5744
6025
  */
@@ -6126,6 +6407,12 @@ export interface PermissionRequestMcp {
6126
6407
  * Permission kind discriminator
6127
6408
  */
6128
6409
  kind: "mcp";
6410
+ /**
6411
+ * Advisory runtime permission recommendation. The SDK host remains responsible for deciding the request and may reject it.
6412
+ *
6413
+ * @experimental
6414
+ */
6415
+ permissionRecommendation?: PermissionRecommendation;
6129
6416
  /**
6130
6417
  * Whether this MCP tool is read-only (no side effects)
6131
6418
  */
@@ -6189,6 +6476,12 @@ export interface PermissionRequestUrl {
6189
6476
  */
6190
6477
  export interface PermissionRequestMemory {
6191
6478
  action?: PermissionRequestMemoryAction;
6479
+ /**
6480
+ * Assisted-approval judge information for this request; present only in assisted mode.
6481
+ *
6482
+ * @experimental
6483
+ */
6484
+ assistedApproval?: PermissionAssistedApproval;
6192
6485
  /**
6193
6486
  * Source references for the stored fact (store only)
6194
6487
  */
@@ -6206,6 +6499,11 @@ export interface PermissionRequestMemory {
6206
6499
  * Reason for the vote (vote only)
6207
6500
  */
6208
6501
  reason?: string;
6502
+ /**
6503
+ * Repository name with owner associated with the stored memory (store only)
6504
+ */
6505
+ repoNwo?: string;
6506
+ scope?: PermissionRequestMemoryScope;
6209
6507
  /**
6210
6508
  * Topic or subject of the memory (store only)
6211
6509
  */
@@ -6215,6 +6513,22 @@ export interface PermissionRequestMemory {
6215
6513
  */
6216
6514
  toolCallId?: string;
6217
6515
  }
6516
+ /**
6517
+ * Assisted-approval judge information attached to a permission request. Present only in assisted mode; its absence means the judge did not evaluate the request. The `recommendation` conveys the judge's disposition for this request.
6518
+ */
6519
+ /** @experimental */
6520
+ export interface PermissionAssistedApproval {
6521
+ failureReason?: AssistedApprovalJudgeFailureReason;
6522
+ /**
6523
+ * Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected.
6524
+ */
6525
+ model?: string;
6526
+ /**
6527
+ * Human-readable reason for the judge's recommendation, when available.
6528
+ */
6529
+ reason?: string;
6530
+ recommendation: AssistedApprovalRecommendation;
6531
+ }
6218
6532
  /**
6219
6533
  * Custom tool invocation permission request
6220
6534
  */
@@ -6227,6 +6541,10 @@ export interface PermissionRequestCustomTool {
6227
6541
  * Permission kind discriminator
6228
6542
  */
6229
6543
  kind: "custom-tool";
6544
+ /**
6545
+ * Whether the tool declared that permission may be skipped unless a deny rule matches
6546
+ */
6547
+ skipPermission?: boolean;
6230
6548
  /**
6231
6549
  * Tool call ID that triggered this permission request
6232
6550
  */
@@ -6298,9 +6616,21 @@ export interface PermissionRequestFactory {
6298
6616
  * Whether this factory is eligible for persistent approval
6299
6617
  */
6300
6618
  canPersistApproval: boolean;
6619
+ /**
6620
+ * Factory-declared AI-credit limit before any run/resume caller override is applied.
6621
+ */
6301
6622
  declaredMaxAiCredits?: number;
6623
+ /**
6624
+ * Factory-declared concurrent-subagent limit before any run/resume caller override is applied.
6625
+ */
6302
6626
  declaredMaxConcurrentSubagents?: number;
6627
+ /**
6628
+ * Factory-declared total-subagent limit before any run/resume caller override is applied.
6629
+ */
6303
6630
  declaredMaxTotalSubagents?: number;
6631
+ /**
6632
+ * Factory-declared active-time limit in seconds before any run/resume caller override is applied.
6633
+ */
6304
6634
  declaredTimeoutSeconds?: number;
6305
6635
  /**
6306
6636
  * Factory description
@@ -6374,16 +6704,39 @@ export interface PermissionRequestExtensionPermissionAccess {
6374
6704
  */
6375
6705
  toolCallId?: string;
6376
6706
  }
6707
+ /**
6708
+ * Extension sensitive environment variable access request
6709
+ */
6710
+ export interface PermissionRequestExtensionEnvAccess {
6711
+ /**
6712
+ * Names of the sensitive environment variables the extension is requesting. Values never appear here.
6713
+ *
6714
+ * @minItems 1
6715
+ */
6716
+ environmentVariables: [string, ...string[]];
6717
+ /**
6718
+ * Name of the extension requesting environment variable access
6719
+ */
6720
+ extensionName: string;
6721
+ /**
6722
+ * Permission kind discriminator
6723
+ */
6724
+ kind: "extension-env-access";
6725
+ /**
6726
+ * Tool call ID that triggered this permission request
6727
+ */
6728
+ toolCallId?: string;
6729
+ }
6377
6730
  /**
6378
6731
  * Shell command permission prompt
6379
6732
  */
6380
6733
  export interface PermissionPromptRequestCommands {
6381
6734
  /**
6382
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6735
+ * Assisted-approval judge information for this request; present only in assisted mode.
6383
6736
  *
6384
6737
  * @experimental
6385
6738
  */
6386
- autoApproval?: PermissionAutoApproval;
6739
+ assistedApproval?: PermissionAssistedApproval;
6387
6740
  /**
6388
6741
  * Whether the UI can offer session-wide approval for this command pattern
6389
6742
  */
@@ -6417,32 +6770,16 @@ export interface PermissionPromptRequestCommands {
6417
6770
  */
6418
6771
  warning?: string;
6419
6772
  }
6420
- /**
6421
- * Auto-approval judge information attached to a permission request. Present (non-null) only when the session's allow-all mode is "auto"; its absence means auto mode was off and the judge did not evaluate the request. The `recommendation` conveys the judge's disposition for this request.
6422
- */
6423
- /** @experimental */
6424
- export interface PermissionAutoApproval {
6425
- failureReason?: AutoApprovalJudgeFailureReason;
6426
- /**
6427
- * Model id that produced the recommendation, when the judge was consulted and reported one. Absent for `excluded` (the judge was not consulted) and for failures that occurred before a model was selected.
6428
- */
6429
- model?: string;
6430
- /**
6431
- * Human-readable reason for the judge's recommendation, when available.
6432
- */
6433
- reason?: string;
6434
- recommendation: AutoApprovalRecommendation;
6435
- }
6436
6773
  /**
6437
6774
  * File write permission prompt
6438
6775
  */
6439
6776
  export interface PermissionPromptRequestWrite {
6440
6777
  /**
6441
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6778
+ * Assisted-approval judge information for this request; present only in assisted mode.
6442
6779
  *
6443
6780
  * @experimental
6444
6781
  */
6445
- autoApproval?: PermissionAutoApproval;
6782
+ assistedApproval?: PermissionAssistedApproval;
6446
6783
  /**
6447
6784
  * Whether the UI can offer session-wide approval for file write operations
6448
6785
  */
@@ -6481,11 +6818,11 @@ export interface PermissionPromptRequestWrite {
6481
6818
  */
6482
6819
  export interface PermissionPromptRequestRead {
6483
6820
  /**
6484
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6821
+ * Assisted-approval judge information for this request; present only in assisted mode.
6485
6822
  *
6486
6823
  * @experimental
6487
6824
  */
6488
- autoApproval?: PermissionAutoApproval;
6825
+ assistedApproval?: PermissionAssistedApproval;
6489
6826
  /**
6490
6827
  * Human-readable description of why the file is being read
6491
6828
  */
@@ -6516,15 +6853,25 @@ export interface PermissionPromptRequestMcp {
6516
6853
  */
6517
6854
  args?: JsonValue;
6518
6855
  /**
6519
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6856
+ * Assisted-approval judge information for this request; present only in assisted mode.
6520
6857
  *
6521
6858
  * @experimental
6522
6859
  */
6523
- autoApproval?: PermissionAutoApproval;
6860
+ assistedApproval?: PermissionAssistedApproval;
6861
+ /**
6862
+ * Whether the host may offer a server-wide "approve all tools from this server" blanket. Absent is treated as true; the runtime sends false when managed policy disables bypass-permissions mode, which forbids the server-wide escalation while still allowing per-tool approval.
6863
+ */
6864
+ canOfferServerWideApproval?: boolean;
6524
6865
  /**
6525
6866
  * Prompt kind discriminator
6526
6867
  */
6527
6868
  kind: "mcp";
6869
+ /**
6870
+ * Advisory runtime permission recommendation. The host remains responsible for deciding the request and may reject it.
6871
+ *
6872
+ * @experimental
6873
+ */
6874
+ permissionRecommendation?: PermissionRecommendation;
6528
6875
  /**
6529
6876
  * Name of the MCP server providing the tool
6530
6877
  */
@@ -6547,11 +6894,11 @@ export interface PermissionPromptRequestMcp {
6547
6894
  */
6548
6895
  export interface PermissionPromptRequestUrl {
6549
6896
  /**
6550
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6897
+ * Assisted-approval judge information for this request; present only in assisted mode.
6551
6898
  *
6552
6899
  * @experimental
6553
6900
  */
6554
- autoApproval?: PermissionAutoApproval;
6901
+ assistedApproval?: PermissionAssistedApproval;
6555
6902
  /**
6556
6903
  * Human-readable description of why the URL is being accessed
6557
6904
  */
@@ -6591,11 +6938,11 @@ export interface PermissionPromptRequestUrl {
6591
6938
  export interface PermissionPromptRequestMemory {
6592
6939
  action?: PermissionRequestMemoryAction;
6593
6940
  /**
6594
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6941
+ * Assisted-approval judge information for this request; present only in assisted mode.
6595
6942
  *
6596
6943
  * @experimental
6597
6944
  */
6598
- autoApproval?: PermissionAutoApproval;
6945
+ assistedApproval?: PermissionAssistedApproval;
6599
6946
  /**
6600
6947
  * Source references for the stored fact (store only)
6601
6948
  */
@@ -6631,11 +6978,11 @@ export interface PermissionPromptRequestCustomTool {
6631
6978
  */
6632
6979
  args?: JsonValue;
6633
6980
  /**
6634
- * Auto-approval judge information for this request; present only when auto mode is enabled.
6981
+ * Assisted-approval judge information for this request; present only in assisted mode.
6635
6982
  *
6636
6983
  * @experimental
6637
6984
  */
6638
- autoApproval?: PermissionAutoApproval;
6985
+ assistedApproval?: PermissionAssistedApproval;
6639
6986
  /**
6640
6987
  * Prompt kind discriminator
6641
6988
  */
@@ -6659,11 +7006,11 @@ export interface PermissionPromptRequestCustomTool {
6659
7006
  export interface PermissionPromptRequestPath {
6660
7007
  accessKind: PermissionPromptRequestPathAccessKind;
6661
7008
  /**
6662
- * Auto-approval judge information for this request; present only when auto mode is enabled.
7009
+ * Assisted-approval judge information for this request; present only in assisted mode.
6663
7010
  *
6664
7011
  * @experimental
6665
7012
  */
6666
- autoApproval?: PermissionAutoApproval;
7013
+ assistedApproval?: PermissionAssistedApproval;
6667
7014
  /**
6668
7015
  * Prompt kind discriminator
6669
7016
  */
@@ -6682,11 +7029,11 @@ export interface PermissionPromptRequestPath {
6682
7029
  */
6683
7030
  export interface PermissionPromptRequestHook {
6684
7031
  /**
6685
- * Auto-approval judge information for this request; present only when auto mode is enabled.
7032
+ * Assisted-approval judge information for this request; present only in assisted mode.
6686
7033
  *
6687
7034
  * @experimental
6688
7035
  */
6689
- autoApproval?: PermissionAutoApproval;
7036
+ assistedApproval?: PermissionAssistedApproval;
6690
7037
  /**
6691
7038
  * Optional message from the hook explaining why confirmation is needed
6692
7039
  */
@@ -6713,11 +7060,11 @@ export interface PermissionPromptRequestHook {
6713
7060
  */
6714
7061
  export interface PermissionPromptRequestExtensionManagement {
6715
7062
  /**
6716
- * Auto-approval judge information for this request; present only when auto mode is enabled.
7063
+ * Assisted-approval judge information for this request; present only in assisted mode.
6717
7064
  *
6718
7065
  * @experimental
6719
7066
  */
6720
- autoApproval?: PermissionAutoApproval;
7067
+ assistedApproval?: PermissionAssistedApproval;
6721
7068
  /**
6722
7069
  * Name of the extension being managed
6723
7070
  */
@@ -6744,18 +7091,30 @@ export interface PermissionPromptRequestFactory {
6744
7091
  */
6745
7092
  approvalKey: string;
6746
7093
  /**
6747
- * Auto-approval judge information for this request; present only when auto mode is enabled.
7094
+ * Assisted-approval judge information for this request; present only in assisted mode.
6748
7095
  *
6749
7096
  * @experimental
6750
7097
  */
6751
- autoApproval?: PermissionAutoApproval;
7098
+ assistedApproval?: PermissionAssistedApproval;
6752
7099
  /**
6753
7100
  * Whether this factory is eligible for persistent approval
6754
7101
  */
6755
7102
  canPersistApproval: boolean;
7103
+ /**
7104
+ * Factory-declared AI-credit limit before any run/resume caller override is applied.
7105
+ */
6756
7106
  declaredMaxAiCredits?: number;
7107
+ /**
7108
+ * Factory-declared concurrent-subagent limit before any run/resume caller override is applied.
7109
+ */
6757
7110
  declaredMaxConcurrentSubagents?: number;
7111
+ /**
7112
+ * Factory-declared total-subagent limit before any run/resume caller override is applied.
7113
+ */
6758
7114
  declaredMaxTotalSubagents?: number;
7115
+ /**
7116
+ * Factory-declared active-time limit in seconds before any run/resume caller override is applied.
7117
+ */
6759
7118
  declaredTimeoutSeconds?: number;
6760
7119
  /**
6761
7120
  * Factory description
@@ -6804,11 +7163,11 @@ export interface PermissionPromptRequestFactory {
6804
7163
  */
6805
7164
  export interface PermissionPromptRequestExtensionPermissionAccess {
6806
7165
  /**
6807
- * Auto-approval judge information for this request; present only when auto mode is enabled.
7166
+ * Assisted-approval judge information for this request; present only in assisted mode.
6808
7167
  *
6809
7168
  * @experimental
6810
7169
  */
6811
- autoApproval?: PermissionAutoApproval;
7170
+ assistedApproval?: PermissionAssistedApproval;
6812
7171
  /**
6813
7172
  * Capabilities the extension is requesting
6814
7173
  */
@@ -6826,6 +7185,35 @@ export interface PermissionPromptRequestExtensionPermissionAccess {
6826
7185
  */
6827
7186
  toolCallId?: string;
6828
7187
  }
7188
+ /**
7189
+ * Extension sensitive environment variable access prompt
7190
+ */
7191
+ export interface PermissionPromptRequestExtensionEnvAccess {
7192
+ /**
7193
+ * Assisted-approval judge information for this request; present only in assisted mode.
7194
+ *
7195
+ * @experimental
7196
+ */
7197
+ assistedApproval?: PermissionAssistedApproval;
7198
+ /**
7199
+ * Names of the sensitive environment variables the extension is requesting. Values never appear here.
7200
+ *
7201
+ * @minItems 1
7202
+ */
7203
+ environmentVariables: [string, ...string[]];
7204
+ /**
7205
+ * Name of the extension requesting environment variable access
7206
+ */
7207
+ extensionName: string;
7208
+ /**
7209
+ * Prompt kind discriminator
7210
+ */
7211
+ kind: "extension-env-access";
7212
+ /**
7213
+ * Tool call ID that triggered this permission request
7214
+ */
7215
+ toolCallId?: string;
7216
+ }
6829
7217
  /**
6830
7218
  * Session event "permission.completed". Permission request completion notification signaling UI dismissal
6831
7219
  */
@@ -6878,6 +7266,10 @@ export interface PermissionApproved {
6878
7266
  * The permission request was approved
6879
7267
  */
6880
7268
  kind: "approved";
7269
+ /**
7270
+ * Whether a managed approval policy already handled this request
7271
+ */
7272
+ managedApprovalHandled?: boolean;
6881
7273
  }
6882
7274
  /**
6883
7275
  * Permission response variant that approves a request and remembers the provided approval for the rest of the session.
@@ -6888,6 +7280,10 @@ export interface PermissionApprovedForSession {
6888
7280
  * Approved and remembered for the rest of the session
6889
7281
  */
6890
7282
  kind: "approved-for-session";
7283
+ /**
7284
+ * Whether a managed approval policy already handled this request
7285
+ */
7286
+ managedApprovalHandled?: boolean;
6891
7287
  }
6892
7288
  /**
6893
7289
  * Session-scoped tool-approval rule for specific shell command identifiers.
@@ -6998,6 +7394,25 @@ export interface UserToolSessionApprovalExtensionPermissionAccess {
6998
7394
  */
6999
7395
  kind: "extension-permission-access";
7000
7396
  }
7397
+ /**
7398
+ * Session-scoped tool-approval rule for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names.
7399
+ */
7400
+ export interface UserToolSessionApprovalExtensionEnvAccess {
7401
+ /**
7402
+ * Names of the sensitive environment variables this approval covers. Values are never persisted.
7403
+ *
7404
+ * @minItems 1
7405
+ */
7406
+ environmentVariables: [string, ...string[]];
7407
+ /**
7408
+ * Extension name
7409
+ */
7410
+ extensionName: string;
7411
+ /**
7412
+ * Extension environment access approval kind
7413
+ */
7414
+ kind: "extension-env-access";
7415
+ }
7001
7416
  /**
7002
7417
  * Permission response variant that approves a request and persists the provided approval to a project location key.
7003
7418
  */
@@ -7011,6 +7426,10 @@ export interface PermissionApprovedForLocation {
7011
7426
  * The location key (git root or cwd) to persist the approval to
7012
7427
  */
7013
7428
  locationKey: string;
7429
+ /**
7430
+ * Whether a managed approval policy already handled this request
7431
+ */
7432
+ managedApprovalHandled?: boolean;
7014
7433
  }
7015
7434
  /**
7016
7435
  * Permission response variant indicating the request was cancelled before use, with an optional reason.
@@ -7727,6 +8146,60 @@ export interface CustomNotificationData {
7727
8146
  export interface CustomNotificationSubject {
7728
8147
  [k: string]: string | undefined;
7729
8148
  }
8149
+ /**
8150
+ * Session event "ui.ephemeral_query". Ordered output and terminal state for a transient query that does not modify conversation history.
8151
+ */
8152
+ /** @experimental */
8153
+ export interface UIEphemeralQueryEvent {
8154
+ /**
8155
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
8156
+ */
8157
+ agentId?: string;
8158
+ data: UIEphemeralQueryData;
8159
+ /**
8160
+ * Always true for events that are transient and not persisted to the session event log on disk.
8161
+ */
8162
+ ephemeral: true;
8163
+ /**
8164
+ * Unique event identifier (UUID v4), generated when the event is emitted
8165
+ */
8166
+ id: string;
8167
+ /**
8168
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
8169
+ */
8170
+ parentId: string | null;
8171
+ /**
8172
+ * ISO 8601 timestamp when the event was created
8173
+ */
8174
+ timestamp: string;
8175
+ /**
8176
+ * Type discriminator. Always "ui.ephemeral_query".
8177
+ */
8178
+ type: "ui.ephemeral_query";
8179
+ }
8180
+ /**
8181
+ * Ordered output and terminal state for a transient query that does not modify conversation history.
8182
+ */
8183
+ /** @experimental */
8184
+ export interface UIEphemeralQueryData {
8185
+ /**
8186
+ * Full response text, present for the `completed` phase.
8187
+ */
8188
+ answer?: string;
8189
+ /**
8190
+ * Ordered text delta, present for the `chunk` phase.
8191
+ */
8192
+ chunk?: string;
8193
+ /**
8194
+ * Model or transport failure message, present for the `failed` phase.
8195
+ */
8196
+ error?: string;
8197
+ phase: UIEphemeralQueryPhase;
8198
+ /**
8199
+ * Runtime-minted query identifier.
8200
+ */
8201
+ requestId: string;
8202
+ }
7730
8203
  /**
7731
8204
  * Session event "external_tool.requested". External tool invocation request for client-side tool execution
7732
8205
  */
@@ -7765,6 +8238,10 @@ export interface ExternalToolRequestedData {
7765
8238
  * Arguments to pass to the external tool
7766
8239
  */
7767
8240
  arguments?: JsonValue;
8241
+ /**
8242
+ * Stable provider identity captured with an extension-owned tool definition; hosts use it to route the request to the same provider that was offered to the model
8243
+ */
8244
+ providerId?: string | null;
7768
8245
  /**
7769
8246
  * Unique identifier for this request; used to respond via session.respondToExternalTool()
7770
8247
  */
@@ -8514,6 +8991,10 @@ export interface ExitPlanModeRequestedData {
8514
8991
  * Available actions the user can take
8515
8992
  */
8516
8993
  actions: ExitPlanModeAction[];
8994
+ /**
8995
+ * Model the session had selected when the plan was authored, when one is known
8996
+ */
8997
+ model?: string;
8517
8998
  /**
8518
8999
  * Full content of the plan file
8519
9000
  */
@@ -8694,7 +9175,117 @@ export interface FactoryRunUpdatedData {
8694
9175
  * Monotonic revision now available for the run.
8695
9176
  */
8696
9177
  revision: number;
9178
+ /**
9179
+ * Factory run identifier.
9180
+ */
9181
+ runId: string;
9182
+ }
9183
+ /**
9184
+ * Session event "factory.run_started". Ephemeral signal that a factory run attempt began executing.
9185
+ */
9186
+ /** @experimental */
9187
+ export interface FactoryRunStartedEvent {
9188
+ /**
9189
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
9190
+ */
9191
+ agentId?: string;
9192
+ data: FactoryRunStartedData;
9193
+ /**
9194
+ * Always true for events that are transient and not persisted to the session event log on disk.
9195
+ */
9196
+ ephemeral: true;
9197
+ /**
9198
+ * Unique event identifier (UUID v4), generated when the event is emitted
9199
+ */
9200
+ id: string;
9201
+ /**
9202
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
9203
+ */
9204
+ parentId: string | null;
9205
+ /**
9206
+ * ISO 8601 timestamp when the event was created
9207
+ */
9208
+ timestamp: string;
9209
+ /**
9210
+ * Type discriminator. Always "factory.run_started".
9211
+ */
9212
+ type: "factory.run_started";
9213
+ }
9214
+ /**
9215
+ * Ephemeral signal that a factory run attempt began executing.
9216
+ */
9217
+ /** @experimental */
9218
+ export interface FactoryRunStartedData {
9219
+ /**
9220
+ * Attempt number this start committed; a resumed run increments it.
9221
+ */
9222
+ attempt: number;
9223
+ /**
9224
+ * Name of the factory this run executes. Low cardinality by construction.
9225
+ */
9226
+ factoryName: string;
9227
+ /**
9228
+ * Identifier of the factory run that started.
9229
+ */
9230
+ runId: string;
9231
+ }
9232
+ /**
9233
+ * Session event "factory.run_settled". Ephemeral signal that a factory run reached a terminal status.
9234
+ */
9235
+ /** @experimental */
9236
+ export interface FactoryRunSettledEvent {
9237
+ /**
9238
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
9239
+ */
9240
+ agentId?: string;
9241
+ data: FactoryRunSettledData;
9242
+ /**
9243
+ * Always true for events that are transient and not persisted to the session event log on disk.
9244
+ */
9245
+ ephemeral: true;
9246
+ /**
9247
+ * Unique event identifier (UUID v4), generated when the event is emitted
9248
+ */
9249
+ id: string;
9250
+ /**
9251
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
9252
+ */
9253
+ parentId: string | null;
9254
+ /**
9255
+ * ISO 8601 timestamp when the event was created
9256
+ */
9257
+ timestamp: string;
9258
+ /**
9259
+ * Type discriminator. Always "factory.run_settled".
9260
+ */
9261
+ type: "factory.run_settled";
9262
+ }
9263
+ /**
9264
+ * Ephemeral signal that a factory run reached a terminal status.
9265
+ */
9266
+ /** @experimental */
9267
+ export interface FactoryRunSettledData {
9268
+ /**
9269
+ * AI credits this run consumed, in nano-AIU.
9270
+ */
9271
+ consumedNanoAiu: number;
9272
+ /**
9273
+ * Subagents this run consumed against its limits.
9274
+ */
9275
+ consumedSubagents: number;
9276
+ /**
9277
+ * Active milliseconds accumulated across every attempt of this run.
9278
+ */
9279
+ elapsedMs: number;
9280
+ /**
9281
+ * Typed failure class recorded on the run, when it failed with one (e.g. `factory_limit_reached`).
9282
+ */
9283
+ failureType?: string;
9284
+ /**
9285
+ * Identifier of the factory run that settled.
9286
+ */
8697
9287
  runId: string;
9288
+ status: FactoryRunSettledStatus;
8698
9289
  }
8699
9290
  /**
8700
9291
  * Session event "session.skills_loaded". Payload of `session.skills_loaded` listing resolved skill metadata.