@github/copilot-sdk 1.0.0-beta.8 → 1.0.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.
@@ -85,7 +85,11 @@ function createServerRpc(connection) {
85
85
  *
86
86
  * @param params MCP server names to disable for new sessions.
87
87
  */
88
- disable: async (params) => connection.sendRequest("mcp.config.disable", params)
88
+ disable: async (params) => connection.sendRequest("mcp.config.disable", params),
89
+ /**
90
+ * Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk.
91
+ */
92
+ reload: async () => connection.sendRequest("mcp.config.reload", {})
89
93
  },
90
94
  /**
91
95
  * Discovers MCP servers from user, workspace, plugin, and builtin sources.
@@ -114,6 +118,20 @@ function createServerRpc(connection) {
114
118
  */
115
119
  discover: async (params) => connection.sendRequest("skills.discover", params)
116
120
  },
121
+ user: {
122
+ settings: {
123
+ /**
124
+ * Drops this runtime process's in-memory user settings cache so the next settings read observes disk.
125
+ */
126
+ reload: async () => connection.sendRequest("user.settings.reload", {})
127
+ }
128
+ },
129
+ runtime: {
130
+ /**
131
+ * Gracefully shuts down an SDK-owned runtime. The response is sent only after cleanup completes; callers may then terminate the owned runtime process.
132
+ */
133
+ shutdown: async () => connection.sendRequest("runtime.shutdown", {})
134
+ },
117
135
  sessionFs: {
118
136
  /**
119
137
  * Registers an SDK client as the session filesystem provider.
@@ -145,7 +163,7 @@ function createServerRpc(connection) {
145
163
  /**
146
164
  * Lists persisted sessions, optionally filtered by working-directory context.
147
165
  *
148
- * @param params Optional metadata-load limit and context filter applied to the returned sessions.
166
+ * @param params Optional metadata-load limit and filters applied to the returned sessions.
149
167
  *
150
168
  * @returns Persisted sessions matching the filter, ordered most-recently-modified first.
151
169
  */
@@ -276,6 +294,17 @@ function createServerRpc(connection) {
276
294
  * @returns Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload.
277
295
  */
278
296
  setAdditionalPlugins: async (params) => connection.sendRequest("sessions.setAdditionalPlugins", params)
297
+ },
298
+ /** @experimental */
299
+ agentRegistry: {
300
+ /**
301
+ * Spawns a managed-server child with the supplied configuration and returns a discriminated-union result. The caller (typically the CLI controller) is responsible for attaching to the spawned child and sending any follow-up prompt. When the controller-local spawn gate is closed the server returns JSON-RPC MethodNotFound.
302
+ *
303
+ * @param params Inputs to spawn a managed-server child via the controller's spawn delegate.
304
+ *
305
+ * @returns Outcome of an agentRegistry.spawn call.
306
+ */
307
+ spawn: async (params) => connection.sendRequest("agentRegistry.spawn", params)
279
308
  }
280
309
  };
281
310
  }
@@ -372,27 +401,30 @@ function createSessionRpc(connection, sessionId) {
372
401
  * @param params Canvas close parameters.
373
402
  */
374
403
  close: async (params) => connection.sendRequest("session.canvas.close", { sessionId, ...params }),
375
- /**
376
- * Invokes an action on an open canvas instance.
377
- *
378
- * @param params Canvas action invocation parameters.
379
- *
380
- * @returns Canvas action invocation result.
381
- */
382
- invokeAction: async (params) => connection.sendRequest("session.canvas.invokeAction", { sessionId, ...params })
404
+ /** @experimental */
405
+ action: {
406
+ /**
407
+ * Invokes an action on an open canvas instance.
408
+ *
409
+ * @param params Canvas action invocation parameters.
410
+ *
411
+ * @returns Canvas action invocation result.
412
+ */
413
+ invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", { sessionId, ...params })
414
+ }
383
415
  },
384
416
  /** @experimental */
385
417
  model: {
386
418
  /**
387
419
  * Gets the currently selected model for the session.
388
420
  *
389
- * @returns The currently selected model and reasoning effort for the session.
421
+ * @returns The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume.
390
422
  */
391
423
  getCurrent: async () => connection.sendRequest("session.model.getCurrent", { sessionId }),
392
424
  /**
393
425
  * Switches the session to a model and optional reasoning configuration.
394
426
  *
395
- * @param params Target model identifier and optional reasoning effort, summary, and capability overrides.
427
+ * @param params Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.
396
428
  *
397
429
  * @returns The model identifier active on the session after the switch.
398
430
  */
@@ -404,7 +436,15 @@ function createSessionRpc(connection, sessionId) {
404
436
  *
405
437
  * @returns Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
406
438
  */
407
- setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { sessionId, ...params })
439
+ setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { sessionId, ...params }),
440
+ /**
441
+ * Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
442
+ *
443
+ * @param params Optional listing options.
444
+ *
445
+ * @returns The list of models available to this session.
446
+ */
447
+ list: async (params) => connection.sendRequest("session.model.list", { sessionId, ...params })
408
448
  },
409
449
  /** @experimental */
410
450
  mode: {
@@ -858,7 +898,13 @@ function createSessionRpc(connection, sessionId) {
858
898
  /**
859
899
  * Reloads extension definitions and processes for the session.
860
900
  */
861
- reload: async () => connection.sendRequest("session.extensions.reload", { sessionId })
901
+ reload: async () => connection.sendRequest("session.extensions.reload", { sessionId }),
902
+ /**
903
+ * Push attachments into the next user-message turn from an extension. The host should surface them as composer pills and forward them via the next session.send call. Callable only by extension-owned connections.
904
+ *
905
+ * @param params Parameters for session.extensions.sendAttachmentsToMessage.
906
+ */
907
+ sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", { sessionId, ...params })
862
908
  },
863
909
  /** @experimental */
864
910
  tools: {
@@ -875,7 +921,13 @@ function createSessionRpc(connection, sessionId) {
875
921
  *
876
922
  * @returns Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation.
877
923
  */
878
- initializeAndValidate: async () => connection.sendRequest("session.tools.initializeAndValidate", { sessionId })
924
+ initializeAndValidate: async () => connection.sendRequest("session.tools.initializeAndValidate", { sessionId }),
925
+ /**
926
+ * Returns lightweight metadata for the session's currently initialized tools.
927
+ *
928
+ * @returns Current lightweight tool metadata snapshot for the session.
929
+ */
930
+ getCurrentMetadata: async () => connection.sendRequest("session.tools.getCurrentMetadata", { sessionId })
879
931
  },
880
932
  /** @experimental */
881
933
  commands: {
@@ -1034,6 +1086,20 @@ function createSessionRpc(connection, sessionId) {
1034
1086
  * @returns Indicates whether the operation succeeded.
1035
1087
  */
1036
1088
  setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
1089
+ /**
1090
+ * Enables or disables full allow-all permissions (tools, paths, and URLs) for the session. Used by attach-mode clients (e.g. LocalRpcSession's `/allow-all` forwarder) to flip the target session's permission state. Unlike `setApproveAll`, this swaps in the unrestricted path and URL managers and emits `session.permissions_changed` on transition. The result returns the authoritative post-mutation state so callers can update their local mirrors without racing the `session.permissions_changed` notification on the same wire.
1091
+ *
1092
+ * @param params Whether to enable full allow-all permissions for the session.
1093
+ *
1094
+ * @returns Indicates whether the operation succeeded and reports the post-mutation state.
1095
+ */
1096
+ setAllowAll: async (params) => connection.sendRequest("session.permissions.setAllowAll", { sessionId, ...params }),
1097
+ /**
1098
+ * Returns whether full allow-all permissions are currently active for the session.
1099
+ *
1100
+ * @returns Current full allow-all permission state.
1101
+ */
1102
+ getAllowAll: async () => connection.sendRequest("session.permissions.getAllowAll", { sessionId }),
1037
1103
  /**
1038
1104
  * Adds or removes session-scoped or location-scoped permission rules.
1039
1105
  *
@@ -1450,10 +1516,10 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
1450
1516
  if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`);
1451
1517
  return handler.close(params);
1452
1518
  });
1453
- connection.onRequest("canvas.invokeAction", async (params) => {
1519
+ connection.onRequest("canvas.action.invoke", async (params) => {
1454
1520
  const handler = getHandlers(params.sessionId).canvas;
1455
1521
  if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`);
1456
- return handler.invokeAction(params);
1522
+ return handler.invoke(params);
1457
1523
  });
1458
1524
  }
1459
1525
  export {
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Union of all session event variants emitted by the Copilot CLI runtime.
7
7
  */
8
- export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | PlanChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | McpAppToolCallCompleteEvent;
8
+ export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | PermissionsChangedEvent | PlanChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
9
9
  /**
10
10
  * Hosting platform type of the repository (github or ado)
11
11
  */
@@ -14,6 +14,14 @@ export type WorkingDirectoryContextHostType =
14
14
  "github"
15
15
  /** Repository is hosted on Azure DevOps. */
16
16
  | "ado";
17
+ /**
18
+ * Allowed values for the `ContextTier` enumeration.
19
+ */
20
+ export type ContextTier =
21
+ /** Default context tier with standard context window size. */
22
+ "default"
23
+ /** Extended context tier with a larger context window. */
24
+ | "long_context";
17
25
  /**
18
26
  * Reasoning summary mode used for model calls, if applicable (e.g. "none", "concise", "detailed")
19
27
  */
@@ -24,6 +32,28 @@ export type ReasoningSummary =
24
32
  | "concise"
25
33
  /** Request a detailed summary of the model's reasoning. */
26
34
  | "detailed";
35
+ /**
36
+ * The type of operation performed on the autopilot objective state file
37
+ */
38
+ export type AutopilotObjectiveChangedOperation =
39
+ /** Autopilot objective state file was created for a new objective. */
40
+ "create"
41
+ /** Autopilot objective state file was updated for an existing objective. */
42
+ | "update"
43
+ /** Autopilot objective state file was deleted or cleared. */
44
+ | "delete";
45
+ /**
46
+ * Current autopilot objective status, if one exists
47
+ */
48
+ export type AutopilotObjectiveChangedStatus =
49
+ /** Objective is active and can drive autopilot continuations. */
50
+ "active"
51
+ /** Objective is paused and will not drive autopilot continuations. */
52
+ | "paused"
53
+ /** Legacy objective state indicating the previous continuation cap was reached. */
54
+ | "cap_reached"
55
+ /** Objective was completed by the agent. */
56
+ | "completed";
27
57
  /**
28
58
  * The session mode the agent is operating in
29
59
  */
@@ -81,13 +111,13 @@ export type UserMessageAgentMode =
81
111
  /** The agent is in shell-focused UI mode. */
82
112
  | "shell";
83
113
  /**
84
- * A user message attachment — a file, directory, code selection, blob, or GitHub reference
114
+ * A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload
85
115
  */
86
- export type UserMessageAttachment = UserMessageAttachmentFile | UserMessageAttachmentDirectory | UserMessageAttachmentSelection | UserMessageAttachmentGithubReference | UserMessageAttachmentBlob;
116
+ export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentBlob | AttachmentExtensionContext;
87
117
  /**
88
118
  * Type of GitHub reference
89
119
  */
90
- export type UserMessageAttachmentGithubReferenceType =
120
+ export type AttachmentGitHubReferenceType =
91
121
  /** GitHub issue reference. */
92
122
  "issue"
93
123
  /** GitHub pull request reference. */
@@ -405,6 +435,10 @@ export interface StartData {
405
435
  */
406
436
  alreadyInUse?: boolean;
407
437
  context?: WorkingDirectoryContext;
438
+ /**
439
+ * Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model)
440
+ */
441
+ contextTier?: ContextTier | null;
408
442
  /**
409
443
  * Version string of the Copilot application
410
444
  */
@@ -516,6 +550,10 @@ export interface ResumeData {
516
550
  */
517
551
  alreadyInUse?: boolean;
518
552
  context?: WorkingDirectoryContext;
553
+ /**
554
+ * Context tier currently selected at resume time; null when no tier is active
555
+ */
556
+ contextTier?: ContextTier | null;
519
557
  /**
520
558
  * When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume.
521
559
  */
@@ -828,6 +866,47 @@ export interface ScheduleCancelledData {
828
866
  */
829
867
  id: number;
830
868
  }
869
+ /**
870
+ * Session event "session.autopilot_objective_changed". Autopilot objective state file operation details indicating what changed
871
+ */
872
+ export interface AutopilotObjectiveChangedEvent {
873
+ /**
874
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
875
+ */
876
+ agentId?: string;
877
+ data: AutopilotObjectiveChangedData;
878
+ /**
879
+ * When true, the event is transient and not persisted to the session event log on disk
880
+ */
881
+ ephemeral?: boolean;
882
+ /**
883
+ * Unique event identifier (UUID v4), generated when the event is emitted
884
+ */
885
+ id: string;
886
+ /**
887
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
888
+ */
889
+ parentId: string | null;
890
+ /**
891
+ * ISO 8601 timestamp when the event was created
892
+ */
893
+ timestamp: string;
894
+ /**
895
+ * Type discriminator. Always "session.autopilot_objective_changed".
896
+ */
897
+ type: "session.autopilot_objective_changed";
898
+ }
899
+ /**
900
+ * Autopilot objective state file operation details indicating what changed
901
+ */
902
+ export interface AutopilotObjectiveChangedData {
903
+ /**
904
+ * Current autopilot objective id, if one exists
905
+ */
906
+ id?: number;
907
+ operation: AutopilotObjectiveChangedOperation;
908
+ status?: AutopilotObjectiveChangedStatus;
909
+ }
831
910
  /**
832
911
  * Session event "session.info". Informational message for timeline display with categorization
833
912
  */
@@ -967,9 +1046,7 @@ export interface ModelChangeData {
967
1046
  /**
968
1047
  * Context tier after the model change; null explicitly clears a previously selected tier
969
1048
  */
970
- contextTier?: "default"
971
- /** Extended context tier with a larger context window. */
972
- | "long_context" | null;
1049
+ contextTier?: ContextTier | null;
973
1050
  /**
974
1051
  * Newly selected model identifier
975
1052
  */
@@ -1026,6 +1103,49 @@ export interface ModeChangedData {
1026
1103
  newMode: SessionMode;
1027
1104
  previousMode: SessionMode;
1028
1105
  }
1106
+ /**
1107
+ * Session event "session.permissions_changed". Permissions change details carrying the aggregate allow-all boolean transition.
1108
+ */
1109
+ export interface PermissionsChangedEvent {
1110
+ /**
1111
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
1112
+ */
1113
+ agentId?: string;
1114
+ data: PermissionsChangedData;
1115
+ /**
1116
+ * When true, the event is transient and not persisted to the session event log on disk
1117
+ */
1118
+ ephemeral?: boolean;
1119
+ /**
1120
+ * Unique event identifier (UUID v4), generated when the event is emitted
1121
+ */
1122
+ id: string;
1123
+ /**
1124
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
1125
+ */
1126
+ parentId: string | null;
1127
+ /**
1128
+ * ISO 8601 timestamp when the event was created
1129
+ */
1130
+ timestamp: string;
1131
+ /**
1132
+ * Type discriminator. Always "session.permissions_changed".
1133
+ */
1134
+ type: "session.permissions_changed";
1135
+ }
1136
+ /**
1137
+ * Permissions change details carrying the aggregate allow-all boolean transition.
1138
+ */
1139
+ export interface PermissionsChangedData {
1140
+ /**
1141
+ * Aggregate allow-all flag after the change
1142
+ */
1143
+ allowAllPermissions: boolean;
1144
+ /**
1145
+ * Aggregate allow-all flag before the change
1146
+ */
1147
+ previousAllowAllPermissions: boolean;
1148
+ }
1029
1149
  /**
1030
1150
  * Session event "session.plan_changed". Plan file operation details indicating what changed
1031
1151
  */
@@ -1840,7 +1960,7 @@ export interface UserMessageData {
1840
1960
  /**
1841
1961
  * Files, selections, or GitHub references attached to the message
1842
1962
  */
1843
- attachments?: UserMessageAttachment[];
1963
+ attachments?: Attachment[];
1844
1964
  /**
1845
1965
  * The user's message text as displayed in the timeline
1846
1966
  */
@@ -1877,12 +1997,12 @@ export interface UserMessageData {
1877
1997
  /**
1878
1998
  * File attachment
1879
1999
  */
1880
- export interface UserMessageAttachmentFile {
2000
+ export interface AttachmentFile {
1881
2001
  /**
1882
2002
  * User-facing display name for the attachment
1883
2003
  */
1884
2004
  displayName: string;
1885
- lineRange?: UserMessageAttachmentFileLineRange;
2005
+ lineRange?: AttachmentFileLineRange;
1886
2006
  /**
1887
2007
  * Absolute file path
1888
2008
  */
@@ -1895,7 +2015,7 @@ export interface UserMessageAttachmentFile {
1895
2015
  /**
1896
2016
  * Optional line range to scope the attachment to a specific section of the file
1897
2017
  */
1898
- export interface UserMessageAttachmentFileLineRange {
2018
+ export interface AttachmentFileLineRange {
1899
2019
  /**
1900
2020
  * End line number (1-based, inclusive)
1901
2021
  */
@@ -1908,7 +2028,7 @@ export interface UserMessageAttachmentFileLineRange {
1908
2028
  /**
1909
2029
  * Directory attachment
1910
2030
  */
1911
- export interface UserMessageAttachmentDirectory {
2031
+ export interface AttachmentDirectory {
1912
2032
  /**
1913
2033
  * User-facing display name for the attachment
1914
2034
  */
@@ -1925,7 +2045,7 @@ export interface UserMessageAttachmentDirectory {
1925
2045
  /**
1926
2046
  * Code selection attachment from an editor
1927
2047
  */
1928
- export interface UserMessageAttachmentSelection {
2048
+ export interface AttachmentSelection {
1929
2049
  /**
1930
2050
  * User-facing display name for the selection
1931
2051
  */
@@ -1934,7 +2054,7 @@ export interface UserMessageAttachmentSelection {
1934
2054
  * Absolute path to the file containing the selection
1935
2055
  */
1936
2056
  filePath: string;
1937
- selection: UserMessageAttachmentSelectionDetails;
2057
+ selection: AttachmentSelectionDetails;
1938
2058
  /**
1939
2059
  * The selected text content
1940
2060
  */
@@ -1947,14 +2067,14 @@ export interface UserMessageAttachmentSelection {
1947
2067
  /**
1948
2068
  * Position range of the selection within the file
1949
2069
  */
1950
- export interface UserMessageAttachmentSelectionDetails {
1951
- end: UserMessageAttachmentSelectionDetailsEnd;
1952
- start: UserMessageAttachmentSelectionDetailsStart;
2070
+ export interface AttachmentSelectionDetails {
2071
+ end: AttachmentSelectionDetailsEnd;
2072
+ start: AttachmentSelectionDetailsStart;
1953
2073
  }
1954
2074
  /**
1955
2075
  * End position of the selection
1956
2076
  */
1957
- export interface UserMessageAttachmentSelectionDetailsEnd {
2077
+ export interface AttachmentSelectionDetailsEnd {
1958
2078
  /**
1959
2079
  * End character offset within the line (0-based)
1960
2080
  */
@@ -1967,7 +2087,7 @@ export interface UserMessageAttachmentSelectionDetailsEnd {
1967
2087
  /**
1968
2088
  * Start position of the selection
1969
2089
  */
1970
- export interface UserMessageAttachmentSelectionDetailsStart {
2090
+ export interface AttachmentSelectionDetailsStart {
1971
2091
  /**
1972
2092
  * Start character offset within the line (0-based)
1973
2093
  */
@@ -1980,12 +2100,12 @@ export interface UserMessageAttachmentSelectionDetailsStart {
1980
2100
  /**
1981
2101
  * GitHub issue, pull request, or discussion reference
1982
2102
  */
1983
- export interface UserMessageAttachmentGithubReference {
2103
+ export interface AttachmentGitHubReference {
1984
2104
  /**
1985
2105
  * Issue, pull request, or discussion number
1986
2106
  */
1987
2107
  number: number;
1988
- referenceType: UserMessageAttachmentGithubReferenceType;
2108
+ referenceType: AttachmentGitHubReferenceType;
1989
2109
  /**
1990
2110
  * Current state of the referenced item (e.g., open, closed, merged)
1991
2111
  */
@@ -2006,7 +2126,7 @@ export interface UserMessageAttachmentGithubReference {
2006
2126
  /**
2007
2127
  * Blob attachment with inline base64-encoded data
2008
2128
  */
2009
- export interface UserMessageAttachmentBlob {
2129
+ export interface AttachmentBlob {
2010
2130
  /**
2011
2131
  * Base64-encoded content
2012
2132
  */
@@ -2024,6 +2144,41 @@ export interface UserMessageAttachmentBlob {
2024
2144
  */
2025
2145
  type: "blob";
2026
2146
  }
2147
+ /**
2148
+ * Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block.
2149
+ */
2150
+ export interface AttachmentExtensionContext {
2151
+ /**
2152
+ * Provider-local canvas identifier when the push was bound to a canvas instance
2153
+ */
2154
+ canvasId?: string;
2155
+ /**
2156
+ * ISO 8601 timestamp captured by the runtime when the push was accepted
2157
+ */
2158
+ capturedAt: string;
2159
+ /**
2160
+ * Owning extension identifier. Runtime-derived from the caller's connection when produced via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent transports.
2161
+ */
2162
+ extensionId: string;
2163
+ /**
2164
+ * Open canvas instance identifier when the push was bound to a canvas instance
2165
+ */
2166
+ instanceId?: string;
2167
+ /**
2168
+ * Caller-supplied JSON payload
2169
+ */
2170
+ payload?: {
2171
+ [k: string]: unknown | undefined;
2172
+ };
2173
+ /**
2174
+ * Human-readable composer pill label
2175
+ */
2176
+ title: string;
2177
+ /**
2178
+ * Attachment type discriminator
2179
+ */
2180
+ type: "extension_context";
2181
+ }
2027
2182
  /**
2028
2183
  * Session event "pending_messages.modified". Empty payload; the event signals that the pending message queue has changed
2029
2184
  */
@@ -2853,6 +3008,10 @@ export interface ToolExecutionStartData {
2853
3008
  arguments?: {
2854
3009
  [k: string]: unknown | undefined;
2855
3010
  };
3011
+ /**
3012
+ * When true, the tool output should be displayed expanded (verbatim) in the CLI timeline
3013
+ */
3014
+ displayVerbatim?: boolean;
2856
3015
  /**
2857
3016
  * Name of the MCP server hosting this tool, when the tool is an MCP tool
2858
3017
  */
@@ -2861,6 +3020,10 @@ export interface ToolExecutionStartData {
2861
3020
  * Original tool name on the MCP server, when the tool is an MCP tool
2862
3021
  */
2863
3022
  mcpToolName?: string;
3023
+ /**
3024
+ * Model identifier that generated this tool call
3025
+ */
3026
+ model?: string;
2864
3027
  /**
2865
3028
  * @deprecated
2866
3029
  * Tool call ID of the parent tool invocation when this event originates from a sub-agent
@@ -3803,6 +3966,45 @@ export interface HookEndError {
3803
3966
  */
3804
3967
  stack?: string;
3805
3968
  }
3969
+ /**
3970
+ * Session event "hook.progress". Ephemeral progress update from a running hook process
3971
+ */
3972
+ export interface HookProgressEvent {
3973
+ /**
3974
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
3975
+ */
3976
+ agentId?: string;
3977
+ data: HookProgressData;
3978
+ /**
3979
+ * Always true for events that are transient and not persisted to the session event log on disk.
3980
+ */
3981
+ ephemeral: true;
3982
+ /**
3983
+ * Unique event identifier (UUID v4), generated when the event is emitted
3984
+ */
3985
+ id: string;
3986
+ /**
3987
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
3988
+ */
3989
+ parentId: string | null;
3990
+ /**
3991
+ * ISO 8601 timestamp when the event was created
3992
+ */
3993
+ timestamp: string;
3994
+ /**
3995
+ * Type discriminator. Always "hook.progress".
3996
+ */
3997
+ type: "hook.progress";
3998
+ }
3999
+ /**
4000
+ * Ephemeral progress update from a running hook process
4001
+ */
4002
+ export interface HookProgressData {
4003
+ /**
4004
+ * Human-readable progress message from the hook process
4005
+ */
4006
+ message: string;
4007
+ }
3806
4008
  /**
3807
4009
  * Session event "system.message". System/developer instruction content with role and optional template metadata
3808
4010
  */
@@ -5473,6 +5675,10 @@ export interface ExternalToolRequestedData {
5473
5675
  * W3C Trace Context tracestate header for the execute_tool span
5474
5676
  */
5475
5677
  tracestate?: string;
5678
+ /**
5679
+ * Active session working directory, when known.
5680
+ */
5681
+ workingDirectory?: string;
5476
5682
  }
5477
5683
  /**
5478
5684
  * Session event "external_tool.completed". External tool completion notification signaling UI dismissal
@@ -6493,6 +6699,45 @@ export interface CanvasRegistryChangedCanvasAction {
6493
6699
  */
6494
6700
  name: string;
6495
6701
  }
6702
+ /**
6703
+ * Session event "session.extensions.attachments_pushed".
6704
+ */
6705
+ export interface ExtensionsAttachmentsPushedEvent {
6706
+ /**
6707
+ * Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
6708
+ */
6709
+ agentId?: string;
6710
+ data: ExtensionsAttachmentsPushedData;
6711
+ /**
6712
+ * Always true for events that are transient and not persisted to the session event log on disk.
6713
+ */
6714
+ ephemeral: true;
6715
+ /**
6716
+ * Unique event identifier (UUID v4), generated when the event is emitted
6717
+ */
6718
+ id: string;
6719
+ /**
6720
+ * ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
6721
+ */
6722
+ parentId: string | null;
6723
+ /**
6724
+ * ISO 8601 timestamp when the event was created
6725
+ */
6726
+ timestamp: string;
6727
+ /**
6728
+ * Type discriminator. Always "session.extensions.attachments_pushed".
6729
+ */
6730
+ type: "session.extensions.attachments_pushed";
6731
+ }
6732
+ /**
6733
+ * Schema for the `ExtensionsAttachmentsPushedData` type.
6734
+ */
6735
+ export interface ExtensionsAttachmentsPushedData {
6736
+ /**
6737
+ * Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call.
6738
+ */
6739
+ attachments: Attachment[];
6740
+ }
6496
6741
  /**
6497
6742
  * Session event "mcp_app.tool_call_complete". MCP App view called a tool on a connected MCP server (SEP-1865)
6498
6743
  */
package/dist/index.d.ts CHANGED
@@ -5,8 +5,9 @@
5
5
  */
6
6
  export { CopilotClient } from "./client.js";
7
7
  export { RuntimeConnection } from "./types.js";
8
+ export { BuiltInTools, ToolSet } from "./toolSet.js";
8
9
  export { CopilotSession, type AssistantMessageEvent } from "./session.js";
9
- export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
10
+ export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
10
11
  export { defineTool, approveAll, convertMcpCallToolResult, createSessionFsAdapter, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
11
12
  export type * from "./generated/session-events.js";
12
- export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientOptions, StdioRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolTelemetry, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
13
+ export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, StdioRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, LargeToolOutputConfig, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolTelemetry, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";