@github/copilot-sdk 1.0.13-preview.4 → 1.0.13

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 | FusionRouteStartedEvent | FusionRouteFailedEvent | FusionResolvedEvent | FusionCompletedEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantFusionPhaseStartedEvent | AssistantFusionPhaseCompletedEvent | AssistantFusionPhaseFailedEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | ModelCallFinishedEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentConfiguredEvent | 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;
12
+ export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | AutoTierSwitchFailedEvent | ModeChangedEvent | ModeNoticeDeliveredEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | ContextClearedEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | CompletionReceiptEvent | FusionRouteStartedEvent | FusionRouteFailedEvent | FusionResolvedEvent | FusionCompletedEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantFusionPhaseStartedEvent | AssistantFusionPhaseActivityEvent | AssistantFusionPhaseCompletedEvent | AssistantFusionPhaseFailedEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | ModelCallFinishedEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentConfiguredEvent | 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 | McpServerRemovedEvent | McpServerNeedsReconnectEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
13
13
  /**
14
14
  * Routing preference used when the session model is `auto`.
15
15
  */
@@ -56,6 +56,20 @@ export type Verbosity =
56
56
  | "medium"
57
57
  /** A more detailed response was requested. */
58
58
  | "high";
59
+ /**
60
+ * What the user must do to recover from a failure, named as an action rather than as one client's affordance. The runtime cannot know which affordance a client offers — a slash command, a settings pane, a link — so the accompanying message stays host-agnostic and each client renders its own copy from this value. Absent when the runtime knows of no action the user can take.
61
+ */
62
+ export type RemediationAction =
63
+ /** Authenticate again with the Copilot backend. The current credential is absent, expired, or rejected. */
64
+ "sign_in"
65
+ /** Authenticate as a different account. The current account exists but lacks access to the requested resource. */
66
+ | "switch_account"
67
+ /** Inspect which account is currently authenticated before deciding what to change. */
68
+ | "show_account"
69
+ /** Review or widen the sandbox policy. The blocked path or host is named by the accompanying message or by the tool result the action arrived with. */
70
+ | "review_sandbox_policy"
71
+ /** Permit outbound network access in the sandbox policy. */
72
+ | "allow_sandbox_outbound";
59
73
  /**
60
74
  * The session mode the agent is operating in
61
75
  */
@@ -122,6 +136,18 @@ export type ModelChangeSource =
122
136
  | "automatic"
123
137
  /** An SDK or RPC caller selected the model. */
124
138
  | "sdk";
139
+ /**
140
+ * Terminal reason an Auto preference activation failed.
141
+ */
142
+ export type AutoTierSwitchFailureReason =
143
+ /** The candidate model was rejected by model policy. */
144
+ "policy_rejected"
145
+ /** The Auto routing request failed or returned an unusable response. */
146
+ | "request_failed"
147
+ /** The runtime could not prepare the Auto routing request. */
148
+ | "setup_failed"
149
+ /** The provider does not support Auto routing. */
150
+ | "unsupported";
125
151
  /**
126
152
  * Permission mode for the session.
127
153
  */
@@ -191,6 +217,30 @@ export type TaskCompletionOutcome =
191
217
  | "continue"
192
218
  /** Completion cannot proceed without intervention; the active objective is paused when one is identified. */
193
219
  | "blocked";
220
+ /**
221
+ * Structured terminal status from a tool completion event.
222
+ */
223
+ export type CompletionReceiptToolStatus =
224
+ /** The tool completed successfully. */
225
+ "success"
226
+ /** The tool failed without a more specific structured status. */
227
+ | "failure"
228
+ /** The tool exceeded its time budget. */
229
+ | "timeout"
230
+ /** The user rejected the tool call. */
231
+ | "rejected"
232
+ /** The permissions service denied the tool call. */
233
+ | "denied";
234
+ /**
235
+ * Runtime reason the completion decision was accepted.
236
+ */
237
+ export type CompletionReceiptStopReason =
238
+ /** The model reached a natural terminal response. */
239
+ "natural"
240
+ /** A terminal tool ended the interaction. */
241
+ | "terminal_tool"
242
+ /** The configured agentStop continuation limit was reached. */
243
+ | "agent_stop_block_limit";
194
244
  /**
195
245
  * Kind of turn for which HydraFusion routing is running.
196
246
  */
@@ -220,6 +270,34 @@ export type FusionPattern =
220
270
  | "cascade"
221
271
  /** Run a primary draft, a read-only critique, and a revision. */
222
272
  | "critique";
273
+ /**
274
+ * HydraFusion phase kind.
275
+ */
276
+ /** @experimental */
277
+ export type FusionPhaseKind =
278
+ /** Primary solver phase. */
279
+ "primary"
280
+ /** Read-only cascade judge phase. */
281
+ | "judge"
282
+ /** Cascade repair phase. */
283
+ | "repair"
284
+ /** Initial critique-pattern draft phase. */
285
+ | "draft"
286
+ /** Read-only critique phase. */
287
+ | "critic"
288
+ /** Critique-pattern revision phase. */
289
+ | "revision"
290
+ /** Follow-up phase continuing from the resolved model. */
291
+ | "follow_up";
292
+ /**
293
+ * Conversation scope in which a HydraFusion phase executes.
294
+ */
295
+ /** @experimental */
296
+ export type FusionConversationScope =
297
+ /** Canonical root conversation history. */
298
+ "root"
299
+ /** Isolated read-only review history that does not enter the root conversation. */
300
+ | "review";
223
301
  /**
224
302
  * The agent mode that was active when this message was sent
225
303
  */
@@ -265,33 +343,16 @@ export type UserMessageDelivery =
265
343
  /** Enqueued while the agent was busy; processed as its own run afterward. */
266
344
  | "queued";
267
345
  /**
268
- * Conversation scope in which a HydraFusion phase executes.
346
+ * Content-safe activity observed while a HydraFusion phase is running.
269
347
  */
270
348
  /** @experimental */
271
- export type FusionConversationScope =
272
- /** Canonical root conversation history. */
273
- "root"
274
- /** Isolated read-only review history that does not enter the root conversation. */
275
- | "review";
276
- /**
277
- * HydraFusion phase kind.
278
- */
279
- /** @experimental */
280
- export type FusionPhaseKind =
281
- /** Primary solver phase. */
282
- "primary"
283
- /** Read-only cascade judge phase. */
284
- | "judge"
285
- /** Cascade repair phase. */
286
- | "repair"
287
- /** Initial critique-pattern draft phase. */
288
- | "draft"
289
- /** Read-only critique phase. */
290
- | "critic"
291
- /** Critique-pattern revision phase. */
292
- | "revision"
293
- /** Follow-up phase continuing from the resolved model. */
294
- | "follow_up";
349
+ export type FusionPhaseActivityKind =
350
+ /** The provider produced additional private output bytes. */
351
+ "model_output"
352
+ /** A tool began executing inside the phase. */
353
+ | "tool_started"
354
+ /** A tool finished executing inside the phase. */
355
+ | "tool_completed";
295
356
  /**
296
357
  * Durable outcome status of a HydraFusion phase.
297
358
  */
@@ -736,7 +797,9 @@ export type ManagedSettingsResolvedSource =
736
797
  | "device"
737
798
  /** Only session-local SDK-host injection contributed. */
738
799
  | "client"
739
- /** More than one channel contributed. Ordinary keys resolve device over server per key, while permissions compose restrictively across all present layers. */
800
+ /** A policy helper registered by device or server policy contributed. Device registration takes priority when present. */
801
+ | "policyHelper"
802
+ /** More than one channel contributed. Ordinary keys resolve device over server over policy helper per key, while permissions compose restrictively across all present layers. */
740
803
  | "mixed"
741
804
  /** No managed policy is in force (no channel contributed). */
742
805
  | "none";
@@ -787,7 +850,7 @@ export type FactoryRunSettledStatus =
787
850
  /** The run failed, with `failureType` carrying the class when it has one. */
788
851
  | "error";
789
852
  /**
790
- * Source location type (e.g., project, personal-copilot, plugin, builtin)
853
+ * Source location type (e.g., project, personal-copilot, plugin, builtin, sdk)
791
854
  */
792
855
  export type SkillSource =
793
856
  /** Skill defined in the current project's skill directories. */
@@ -803,7 +866,17 @@ export type SkillSource =
803
866
  /** Skill loaded from a configured custom skill directory. */
804
867
  | "custom"
805
868
  /** Skill bundled with the runtime. */
806
- | "builtin";
869
+ | "builtin"
870
+ /** Pathless skill supplied lazily by an SDK skill provider. */
871
+ | "sdk";
872
+ /**
873
+ * Whether configured models are advisory preferences or required constraints
874
+ */
875
+ export type AgentModelPolicy =
876
+ /** Treat the authored models as advisory preferences that callers may override. */
877
+ "preferred"
878
+ /** Require subagent execution to use one of the authored models. */
879
+ | "required";
807
880
  /**
808
881
  * Configuration source: user, workspace, plugin, or builtin
809
882
  */
@@ -1199,6 +1272,7 @@ export interface ErrorData {
1199
1272
  * GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs
1200
1273
  */
1201
1274
  providerCallId?: string;
1275
+ remediation?: RemediationAction;
1202
1276
  /**
1203
1277
  * Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
1204
1278
  */
@@ -1579,6 +1653,7 @@ export interface WarningData {
1579
1653
  * Human-readable warning message for display in the timeline
1580
1654
  */
1581
1655
  message: string;
1656
+ remediation?: RemediationAction;
1582
1657
  /**
1583
1658
  * Optional URL associated with this warning that the user can open in a browser
1584
1659
  */
@@ -1622,6 +1697,10 @@ export interface ModelChangeEvent {
1622
1697
  * Model change details including previous and new model identifiers
1623
1698
  */
1624
1699
  export interface ModelChangeData {
1700
+ /**
1701
+ * Committed Auto preference after the model configuration change, when applicable.
1702
+ */
1703
+ autoTier?: AutoTier | null;
1625
1704
  /**
1626
1705
  * Reason the change happened, when not user-initiated. `"rate_limit_auto_switch"` for changes triggered by the auto-mode-switch rate-limit recovery path, or `"refusal_fallback"` when the active model declined a request (content refusal) and the runtime switched to the configured refusal-fallback model. UI clients can use this to render contextual copy.
1627
1706
  */
@@ -1634,6 +1713,7 @@ export interface ModelChangeData {
1634
1713
  * Newly selected model identifier
1635
1714
  */
1636
1715
  newModel: string;
1716
+ previousAutoTier?: AutoTier;
1637
1717
  /**
1638
1718
  * Model that was previously selected, if any
1639
1719
  */
@@ -1652,6 +1732,47 @@ export interface ModelChangeData {
1652
1732
  source?: ModelChangeSource;
1653
1733
  verbosity?: Verbosity;
1654
1734
  }
1735
+ /**
1736
+ * Session event "session.auto_tier_switch_failed". A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume.
1737
+ */
1738
+ export interface AutoTierSwitchFailedEvent {
1739
+ /**
1740
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1741
+ */
1742
+ agentId?: string;
1743
+ data: AutoTierSwitchFailedData;
1744
+ /**
1745
+ * Always true for events that are transient and not persisted to the session event log on disk.
1746
+ */
1747
+ ephemeral: true;
1748
+ /**
1749
+ * Unique event identifier (UUID v4), generated when the event is emitted
1750
+ */
1751
+ id: string;
1752
+ /**
1753
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
1754
+ */
1755
+ parentId: string | null;
1756
+ /**
1757
+ * ISO 8601 timestamp when the event was created
1758
+ */
1759
+ timestamp: string;
1760
+ /**
1761
+ * Type discriminator. Always "session.auto_tier_switch_failed".
1762
+ */
1763
+ type: "session.auto_tier_switch_failed";
1764
+ }
1765
+ /**
1766
+ * A transient Auto preference failure emitted when the runtime cannot mint or accept a usable model and token pair. The previously effective preference remains active, so SDK clients can surface a non-blocking failure without changing their committed-tier state. This event is ephemeral and is not persisted or replayed on resume.
1767
+ */
1768
+ export interface AutoTierSwitchFailedData {
1769
+ effectiveAutoTier?: AutoTier;
1770
+ reason: AutoTierSwitchFailureReason;
1771
+ /**
1772
+ * Auto preference that failed to activate, or null when returning to provider-default routing failed.
1773
+ */
1774
+ requestedAutoTier: AutoTier | null;
1775
+ }
1655
1776
  /**
1656
1777
  * Session event "session.mode_changed". Agent mode change details including previous and new modes
1657
1778
  */
@@ -1689,6 +1810,46 @@ export interface ModeChangedData {
1689
1810
  newMode: SessionMode;
1690
1811
  previousMode: SessionMode;
1691
1812
  }
1813
+ /**
1814
+ * Session event "session.mode_notice_delivered". Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume.
1815
+ */
1816
+ export interface ModeNoticeDeliveredEvent {
1817
+ /**
1818
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1819
+ */
1820
+ agentId?: string;
1821
+ data: ModeNoticeDeliveredData;
1822
+ /**
1823
+ * When true, the event is transient and not persisted to the session event log on disk
1824
+ */
1825
+ ephemeral?: boolean;
1826
+ /**
1827
+ * Unique event identifier (UUID v4), generated when the event is emitted
1828
+ */
1829
+ id: string;
1830
+ /**
1831
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
1832
+ */
1833
+ parentId: string | null;
1834
+ /**
1835
+ * ISO 8601 timestamp when the event was created
1836
+ */
1837
+ timestamp: string;
1838
+ /**
1839
+ * Type discriminator. Always "session.mode_notice_delivered".
1840
+ */
1841
+ type: "session.mode_notice_delivered";
1842
+ }
1843
+ /**
1844
+ * Records that a mode transition notice reached the model so cache-stable mode tools can remain offered across resume.
1845
+ */
1846
+ export interface ModeNoticeDeliveredData {
1847
+ /**
1848
+ * Model-visible transition notice persisted for a mid-turn delivery
1849
+ */
1850
+ content?: string;
1851
+ mode: SessionMode;
1852
+ }
1692
1853
  /**
1693
1854
  * Session event "session.session_limits_changed". Session limits update details. Null clears the limits.
1694
1855
  */
@@ -2748,6 +2909,97 @@ export interface TaskCompleteData {
2748
2909
  */
2749
2910
  summary?: string;
2750
2911
  }
2912
+ /**
2913
+ * Session event "session.completion_receipt". Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted.
2914
+ */
2915
+ /** @experimental */
2916
+ export interface CompletionReceiptEvent {
2917
+ /**
2918
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
2919
+ */
2920
+ agentId?: string;
2921
+ data: CompletionReceiptData;
2922
+ /**
2923
+ * When true, the event is transient and not persisted to the session event log on disk
2924
+ */
2925
+ ephemeral?: boolean;
2926
+ /**
2927
+ * Unique event identifier (UUID v4), generated when the event is emitted
2928
+ */
2929
+ id: string;
2930
+ /**
2931
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
2932
+ */
2933
+ parentId: string | null;
2934
+ /**
2935
+ * ISO 8601 timestamp when the event was created
2936
+ */
2937
+ timestamp: string;
2938
+ /**
2939
+ * Type discriminator. Always "session.completion_receipt".
2940
+ */
2941
+ type: "session.completion_receipt";
2942
+ }
2943
+ /**
2944
+ * Behavior-neutral record of structured runtime facts present when an agent completion decision is accepted.
2945
+ */
2946
+ /** @experimental */
2947
+ export interface CompletionReceiptData {
2948
+ /**
2949
+ * One-based accepted completion receipt ordinal in the durable session history.
2950
+ */
2951
+ attempt: number;
2952
+ eventRange: CompletionReceiptEventRange;
2953
+ /**
2954
+ * Number of failed structured tool completions in the covered range.
2955
+ */
2956
+ failedToolCount: number;
2957
+ finalTool?: CompletionReceiptFinalTool;
2958
+ /**
2959
+ * Version of the completion receipt payload.
2960
+ */
2961
+ schemaVersion: number;
2962
+ /**
2963
+ * Identifier of the assistant turn-end event that supplied the accepted completion boundary. This is the receipt's idempotency key, and always equals eventRange.endEventId.
2964
+ */
2965
+ sourceEventId: string;
2966
+ stopReason: CompletionReceiptStopReason;
2967
+ /**
2968
+ * Number of successful structured tool completions in the covered range.
2969
+ */
2970
+ successfulToolCount: number;
2971
+ }
2972
+ /**
2973
+ * Inclusive durable event range summarized by a completion receipt.
2974
+ */
2975
+ export interface CompletionReceiptEventRange {
2976
+ /**
2977
+ * Identifier of the assistant turn-end event that ends the covered exchange. Always equals the receipt's sourceEventId, so either field is a valid join key.
2978
+ */
2979
+ endEventId: string;
2980
+ /**
2981
+ * Identifier of the user message that starts the covered exchange.
2982
+ */
2983
+ startEventId: string;
2984
+ }
2985
+ /**
2986
+ * Final structured tool completion in the covered event range.
2987
+ */
2988
+ export interface CompletionReceiptFinalTool {
2989
+ /**
2990
+ * Process exit code from a structured shell result, when available.
2991
+ */
2992
+ exitCode?: number;
2993
+ status: CompletionReceiptToolStatus;
2994
+ /**
2995
+ * Unique identifier of the completed tool call.
2996
+ */
2997
+ toolCallId: string;
2998
+ /**
2999
+ * Tool name from the matching tool execution start event, when available.
3000
+ */
3001
+ toolName?: string;
3002
+ }
2751
3003
  /**
2752
3004
  * Session event "session.fusion_route_started". Experimental transient signal that HydraFusion routing has started for an eligible turn.
2753
3005
  */
@@ -2921,6 +3173,12 @@ export interface FusionResolvedData {
2921
3173
  */
2922
3174
  modelUniverseVersion?: string;
2923
3175
  pattern: FusionPattern;
3176
+ /**
3177
+ * Presentation-neutral phase plan for clients that render workflow progress.
3178
+ *
3179
+ * @experimental
3180
+ */
3181
+ phasePlan?: FusionPhasePlanStep[];
2924
3182
  /**
2925
3183
  * Version of the validated execution-plan format.
2926
3184
  */
@@ -2979,6 +3237,22 @@ export interface FusionFollowUpRecommendation {
2979
3237
  compactionTurn: FusionFollowUpAction;
2980
3238
  userTurn: FusionFollowUpAction;
2981
3239
  }
3240
+ /**
3241
+ * Presentation-neutral phase planned for a HydraFusion turn.
3242
+ */
3243
+ /** @experimental */
3244
+ export interface FusionPhasePlanStep {
3245
+ /**
3246
+ * Whether the phase executes only when an earlier phase requests it.
3247
+ */
3248
+ conditional: boolean;
3249
+ kind: FusionPhaseKind;
3250
+ /**
3251
+ * Semantic role assigned to the phase.
3252
+ */
3253
+ role: string;
3254
+ scope: FusionConversationScope;
3255
+ }
2982
3256
  /**
2983
3257
  * Validated HydraFusion routing capability scores.
2984
3258
  */
@@ -3159,6 +3433,10 @@ export interface UserMessageData {
3159
3433
  * 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.
3160
3434
  */
3161
3435
  isAutopilotContinuation?: boolean;
3436
+ /**
3437
+ * Stable identity of the logical user message, matching the ID returned by send and retained by pending queue snapshots
3438
+ */
3439
+ messageId?: string;
3162
3440
  /**
3163
3441
  * 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
3164
3442
  */
@@ -3799,6 +4077,67 @@ export interface FusionPhaseStartedData {
3799
4077
  */
3800
4078
  role: string;
3801
4079
  }
4080
+ /**
4081
+ * Session event "assistant.fusion_phase_activity". Experimental content-safe activity signal for a running HydraFusion phase.
4082
+ */
4083
+ /** @experimental */
4084
+ export interface AssistantFusionPhaseActivityEvent {
4085
+ /**
4086
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
4087
+ */
4088
+ agentId?: string;
4089
+ data: FusionPhaseActivityData;
4090
+ /**
4091
+ * Always true for events that are transient and not persisted to the session event log on disk.
4092
+ */
4093
+ ephemeral: true;
4094
+ /**
4095
+ * Unique event identifier (UUID v4), generated when the event is emitted
4096
+ */
4097
+ id: string;
4098
+ /**
4099
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
4100
+ */
4101
+ parentId: string | null;
4102
+ /**
4103
+ * ISO 8601 timestamp when the event was created
4104
+ */
4105
+ timestamp: string;
4106
+ /**
4107
+ * Type discriminator. Always "assistant.fusion_phase_activity".
4108
+ */
4109
+ type: "assistant.fusion_phase_activity";
4110
+ }
4111
+ /**
4112
+ * Experimental content-safe activity signal for a running HydraFusion phase.
4113
+ */
4114
+ /** @experimental */
4115
+ export interface FusionPhaseActivityData {
4116
+ activity: FusionPhaseActivityKind;
4117
+ conversationScope: FusionConversationScope;
4118
+ /**
4119
+ * Identifier of the HydraFusion turn containing the phase.
4120
+ */
4121
+ fusionId: string;
4122
+ pattern: FusionPattern;
4123
+ /**
4124
+ * Stable identifier for the concrete phase.
4125
+ */
4126
+ phaseId: string;
4127
+ phaseKind: FusionPhaseKind;
4128
+ /**
4129
+ * Semantic role assigned to the phase.
4130
+ */
4131
+ role: string;
4132
+ /**
4133
+ * Opaque hashed correlation token for matching tool-started and tool-completed activity within this Fusion activity stream. It is not the tool call identifier exposed by tool lifecycle events.
4134
+ */
4135
+ toolCallId?: string;
4136
+ /**
4137
+ * Cumulative private response bytes observed for this model call. The event never includes response text.
4138
+ */
4139
+ totalResponseSizeBytes?: number;
4140
+ }
3802
4141
  /**
3803
4142
  * Session event "assistant.fusion_phase_completed". Experimental durable HydraFusion phase output and lossless replay checkpoint.
3804
4143
  */
@@ -4509,7 +4848,7 @@ export interface FusionAttribution {
4509
4848
  /** @experimental */
4510
4849
  export interface AssistantMessageReasoningBlocks {
4511
4850
  /**
4512
- * Provider-native reasoning content blocks (e.g. Anthropic `thinking` / `redacted_thinking`) preserved verbatim, in order. A single response can carry several, each signed over the content preceding it, so dropping or reordering any of them invalidates the rest.
4851
+ * Provider-native reasoning items or content blocks preserved verbatim, in order. A single response can carry several, and provider signatures or identifiers may depend on their exact content and ordering.
4513
4852
  */
4514
4853
  blocks?: JsonValue[];
4515
4854
  /**
@@ -5567,6 +5906,7 @@ export interface ToolExecutionCompleteError {
5567
5906
  * Human-readable error message
5568
5907
  */
5569
5908
  message: string;
5909
+ remediation?: RemediationAction;
5570
5910
  }
5571
5911
  /**
5572
5912
  * Tool execution result on success
@@ -6129,6 +6469,10 @@ export interface SkillInvokedData {
6129
6469
  * Description of the skill from its SKILL.md frontmatter
6130
6470
  */
6131
6471
  description?: string;
6472
+ /**
6473
+ * Whether model invocation is disabled for this skill
6474
+ */
6475
+ disableModelInvocation?: boolean;
6132
6476
  /**
6133
6477
  * Model identifier active when the skill was invoked, when known
6134
6478
  */
@@ -6138,7 +6482,7 @@ export interface SkillInvokedData {
6138
6482
  */
6139
6483
  name: string;
6140
6484
  /**
6141
- * File path to the SKILL.md definition
6485
+ * File path to the SKILL.md definition, or an empty string for an SDK-provided skill without a filesystem identity
6142
6486
  */
6143
6487
  path: string;
6144
6488
  /**
@@ -6150,7 +6494,7 @@ export interface SkillInvokedData {
6150
6494
  */
6151
6495
  pluginVersion?: string;
6152
6496
  /**
6153
- * Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill)
6497
+ * Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), remote (org/enterprise skill), and sdk (SDK-provided skill)
6154
6498
  */
6155
6499
  source?: string;
6156
6500
  trigger?: SkillInvokedTrigger;
@@ -6355,6 +6699,10 @@ export interface SubagentCompletedData {
6355
6699
  * Model used by the sub-agent
6356
6700
  */
6357
6701
  model?: string;
6702
+ /**
6703
+ * Why an explicit task-call model did not become the effective model
6704
+ */
6705
+ modelOverrideReason?: string;
6358
6706
  /**
6359
6707
  * Tool call ID of the parent tool invocation that spawned this sub-agent
6360
6708
  */
@@ -6442,6 +6790,10 @@ export interface SubagentFailedData {
6442
6790
  * Model selected for the sub-agent, when known
6443
6791
  */
6444
6792
  model?: string;
6793
+ /**
6794
+ * Why an explicit task-call model did not become the effective model
6795
+ */
6796
+ modelOverrideReason?: string;
6445
6797
  /**
6446
6798
  * Tool call ID of the parent tool invocation that spawned this sub-agent
6447
6799
  */
@@ -7107,6 +7459,7 @@ export interface PermissionRequestedEvent {
7107
7459
  * Permission request notification requiring client approval with request details
7108
7460
  */
7109
7461
  export interface PermissionRequestedData {
7462
+ agentMode?: SessionMode;
7110
7463
  permissionRequest: PermissionRequest;
7111
7464
  promptRequest?: PermissionPromptRequest;
7112
7465
  /**
@@ -7167,11 +7520,11 @@ export interface PermissionRequestShell {
7167
7520
  */
7168
7521
  possibleUrls: PermissionRequestShellPossibleUrl[];
7169
7522
  /**
7170
- * True when the model has requested to run this command outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7523
+ * True when the tool is asking to run this command outside the sandbox, either because the command detaches and cannot be sandboxed at all, or because a sandboxed run looked blocked (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. This is a request, not a grant: the command runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7171
7524
  */
7172
7525
  requestSandboxBypass?: boolean;
7173
7526
  /**
7174
- * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
7527
+ * What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true.
7175
7528
  */
7176
7529
  requestSandboxBypassReason?: string;
7177
7530
  /**
@@ -7284,11 +7637,11 @@ export interface PermissionRequestRead {
7284
7637
  */
7285
7638
  path: string;
7286
7639
  /**
7287
- * True when the model has requested to run this search outside the sandbox (it set requestSandboxBypass: true and the host opted in via sandbox.allowBypass). This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7640
+ * True when the tool is asking to re-run this search outside the sandbox, after a sandboxed run looked blocked (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. This is a request, not a grant: the search runs unsandboxed only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7288
7641
  */
7289
7642
  requestSandboxBypass?: boolean;
7290
7643
  /**
7291
- * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
7644
+ * What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true.
7292
7645
  */
7293
7646
  requestSandboxBypassReason?: string;
7294
7647
  /**
@@ -7356,11 +7709,11 @@ export interface PermissionRequestUrl {
7356
7709
  */
7357
7710
  redirectedFrom?: string;
7358
7711
  /**
7359
- * True when this URL fetch is requesting to bypass the sandbox network policy: either the model set requestSandboxBypass: true, or the tool re-issued the request as an interactive bypass after the network policy denied the approved URL (host opted in via sandbox.allowBypass). This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7712
+ * True when the tool is asking to run this URL fetch outside the sandbox, after the network policy denied the approved URL or the sandbox proxy could not reach it (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7360
7713
  */
7361
7714
  requestSandboxBypass?: boolean;
7362
7715
  /**
7363
- * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
7716
+ * What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true.
7364
7717
  */
7365
7718
  requestSandboxBypassReason?: string;
7366
7719
  /**
@@ -7817,11 +8170,11 @@ export interface PermissionPromptRequestUrl {
7817
8170
  */
7818
8171
  redirectedFrom?: string;
7819
8172
  /**
7820
- * True when this URL fetch is requesting to bypass the sandbox network policy: either the model set requestSandboxBypass: true, or the tool re-issued the request as an interactive bypass after the network policy denied the approved URL (host opted in via sandbox.allowBypass). This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
8173
+ * True when the tool is asking to run this URL fetch outside the sandbox, after the network policy denied the approved URL or the sandbox proxy could not reach it (host opted in via sandbox.allowBypass). The model cannot ask for this; only the tool raises it. This is a request, not a grant: the fetch runs only if the user approves this permission request. Hosts should highlight the elevated risk in the approval UI.
7821
8174
  */
7822
8175
  requestSandboxBypass?: boolean;
7823
8176
  /**
7824
- * Model-provided justification for the sandbox-bypass request. Only meaningful when requestSandboxBypass is true.
8177
+ * What the tool tells the user about the bypass on offer: which policy rule blocked the call, or why it cannot be sandboxed. Only meaningful when requestSandboxBypass is true.
7825
8178
  */
7826
8179
  requestSandboxBypassReason?: string;
7827
8180
  /**
@@ -9629,7 +9982,7 @@ export interface AutoModeResolvedData {
9629
9982
  stickyOverride?: boolean;
9630
9983
  }
9631
9984
  /**
9632
- * Session event "session.managed_settings_resolved". Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values per ordinary key, while permissions compose restrictively across device, server, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
9985
+ * Session event "session.managed_settings_resolved". Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
9633
9986
  */
9634
9987
  /** @experimental */
9635
9988
  export interface ManagedSettingsResolvedEvent {
@@ -9660,7 +10013,7 @@ export interface ManagedSettingsResolvedEvent {
9660
10013
  type: "session.managed_settings_resolved";
9661
10014
  }
9662
10015
  /**
9663
- * Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values per ordinary key, while permissions compose restrictively across device, server, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
10016
+ * Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
9664
10017
  */
9665
10018
  /** @experimental */
9666
10019
  export interface ManagedSettingsResolvedData {
@@ -9688,6 +10041,10 @@ export interface ManagedSettingsResolvedData {
9688
10041
  * Whether at least two managed sources supplied permission allowlists, so enforcement intersects them and the flattened settings payload omits `permissions.allow`.
9689
10042
  */
9690
10043
  permissionsAllowIntersected?: boolean;
10044
+ /**
10045
+ * Whether the policy-helper managed-settings layer was present. The policy helper is the weakest channel: it fills keys no enterprise source set and can never replace one.
10046
+ */
10047
+ policyHelperManaged?: boolean;
9691
10048
  /**
9692
10049
  * Whether the effective sandbox policy forces the sandbox on *only* because managed policy could not be determined, rather than because the policy requires it. Lets clients tell a user whose `--no-sandbox` was overridden that the sandbox stayed on as a fail-closed fallback, instead of attributing it to an administrator who set no such policy.
9693
10050
  */
@@ -10313,7 +10670,7 @@ export interface CustomAgentsUpdatedData {
10313
10670
  warnings: string[];
10314
10671
  }
10315
10672
  /**
10316
- * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and model override.
10673
+ * A single loaded custom agent in `session.custom_agents_updated`, with identity, source, tools, invocability, and authored model configuration.
10317
10674
  */
10318
10675
  export interface CustomAgentsUpdatedAgent {
10319
10676
  /**
@@ -10332,6 +10689,11 @@ export interface CustomAgentsUpdatedAgent {
10332
10689
  * Model override for this agent, if set
10333
10690
  */
10334
10691
  model?: string;
10692
+ modelPolicy?: AgentModelPolicy;
10693
+ /**
10694
+ * Authored model ids in priority order, if configured
10695
+ */
10696
+ models?: string[];
10335
10697
  /**
10336
10698
  * Internal name of the agent
10337
10699
  */
@@ -10408,10 +10770,20 @@ export interface McpServersLoadedServer {
10408
10770
  * Version of the plugin that supplied the effective MCP server config, only when source is plugin
10409
10771
  */
10410
10772
  pluginVersion?: string;
10773
+ serverMetadata?: McpServerMetadata;
10411
10774
  source?: McpServerSource;
10412
10775
  status: McpServerStatus;
10413
10776
  transport?: McpServerTransport;
10414
10777
  }
10778
+ /**
10779
+ * Server-advertised metadata learned through modern discovery or legacy initialization.
10780
+ */
10781
+ export interface McpServerMetadata {
10782
+ /**
10783
+ * Non-empty natural-language guidance for using the server, or null when the server omitted instructions or advertised an empty string.
10784
+ */
10785
+ instructions: string | null;
10786
+ }
10415
10787
  /**
10416
10788
  * Session event "session.mcp_server_status_changed". Payload of `session.mcp_server_status_changed` for one MCP server's status and optional failure error.
10417
10789
  */
@@ -10456,6 +10828,84 @@ export interface McpServerStatusChangedData {
10456
10828
  serverName: string;
10457
10829
  status: McpServerStatus;
10458
10830
  }
10831
+ /**
10832
+ * Session event "session.mcp_server_removed". Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs.
10833
+ */
10834
+ export interface McpServerRemovedEvent {
10835
+ /**
10836
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
10837
+ */
10838
+ agentId?: string;
10839
+ data: McpServerRemovedData;
10840
+ /**
10841
+ * Always true for events that are transient and not persisted to the session event log on disk.
10842
+ */
10843
+ ephemeral: true;
10844
+ /**
10845
+ * Unique event identifier (UUID v4), generated when the event is emitted
10846
+ */
10847
+ id: string;
10848
+ /**
10849
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
10850
+ */
10851
+ parentId: string | null;
10852
+ /**
10853
+ * ISO 8601 timestamp when the event was created
10854
+ */
10855
+ timestamp: string;
10856
+ /**
10857
+ * Type discriminator. Always "session.mcp_server_removed".
10858
+ */
10859
+ type: "session.mcp_server_removed";
10860
+ }
10861
+ /**
10862
+ * Payload of `session.mcp_server_removed` identifying an MCP server the graph no longer runs.
10863
+ */
10864
+ export interface McpServerRemovedData {
10865
+ /**
10866
+ * Name of the MCP server that was removed from the graph
10867
+ */
10868
+ serverName: string;
10869
+ }
10870
+ /**
10871
+ * Session event "session.mcp_server_needs_reconnect". Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established.
10872
+ */
10873
+ export interface McpServerNeedsReconnectEvent {
10874
+ /**
10875
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
10876
+ */
10877
+ agentId?: string;
10878
+ data: McpServerNeedsReconnectData;
10879
+ /**
10880
+ * Always true for events that are transient and not persisted to the session event log on disk.
10881
+ */
10882
+ ephemeral: true;
10883
+ /**
10884
+ * Unique event identifier (UUID v4), generated when the event is emitted
10885
+ */
10886
+ id: string;
10887
+ /**
10888
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
10889
+ */
10890
+ parentId: string | null;
10891
+ /**
10892
+ * ISO 8601 timestamp when the event was created
10893
+ */
10894
+ timestamp: string;
10895
+ /**
10896
+ * Type discriminator. Always "session.mcp_server_needs_reconnect".
10897
+ */
10898
+ type: "session.mcp_server_needs_reconnect";
10899
+ }
10900
+ /**
10901
+ * Payload of `session.mcp_server_needs_reconnect` identifying an MCP server whose connection must be re-established.
10902
+ */
10903
+ export interface McpServerNeedsReconnectData {
10904
+ /**
10905
+ * Name of the MCP server that needs to reconnect
10906
+ */
10907
+ serverName: string;
10908
+ }
10459
10909
  /**
10460
10910
  * Session event "mcp.tools.list_changed". Payload identifying the MCP server associated with a list change.
10461
10911
  */