@github/copilot-sdk 1.0.17-preview.1 → 1.0.17-preview.10
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.
- package/README.md +108 -0
- package/dist/canvas.d.ts +6 -1
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +69 -4
- package/dist/cjs/extension.js +2 -0
- package/dist/cjs/generated/rpc.js +326 -25
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/runtimeArtifacts.js +1 -0
- package/dist/cjs/session.js +151 -2
- package/dist/cjs/sessionFsProvider.js +57 -0
- package/dist/cjs/types.js +5 -2
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +69 -4
- package/dist/extension.d.ts +1 -1
- package/dist/extension.js +2 -0
- package/dist/generated/rpc.d.ts +1948 -673
- package/dist/generated/rpc.js +326 -25
- package/dist/generated/session-events.d.ts +282 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -0
- package/dist/runtimeArtifacts.js +1 -0
- package/dist/session.d.ts +52 -1
- package/dist/session.js +151 -2
- package/dist/sessionFsProvider.d.ts +9 -1
- package/dist/sessionFsProvider.js +56 -0
- package/dist/types.d.ts +159 -2
- package/dist/types.js +4 -2
- package/docs/agent-author.md +29 -2
- package/package.json +13 -12
|
@@ -9,9 +9,9 @@ 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 | IndexedSearchEvent | WarningEvent | ModelChangeEvent | ModelDeselectedEvent | AutoTierRecommendationEvent | AutoTierSwitchFailedEvent | ModeChangedEvent | ModeNoticeDeliveredEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | ContextClearedEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | CompletionReceiptEvent | FusionRouteStartedEvent | FusionRouteFailedEvent | FusionResolvedEvent | FusionCompletedEvent | PermissionRecoveryEvent | 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 | PermissionCarriedForwardEvent | PermissionMessageAuthorizationEvent | PermissionMessageAuthorizationReadEvent | PermissionMessageAuthorizationDegradedEvent | PermissionAssentDetectedEvent | PermissionContextualAuthorizationEvent | 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 | WorkflowRunUpdatedEvent | WorkflowRunStartedEvent | WorkflowRunSettledEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpServerRemovedEvent | McpServerNeedsReconnectEvent | 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 | IndexedSearchEvent | WarningEvent | ModelChangeEvent | ModelDeselectedEvent | AutoTierRecommendationEvent | AutoTierSwitchFailedEvent | ModeChangedEvent | ModeNoticeDeliveredEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | ContextClearedEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | CompletionReceiptEvent | FusionRouteStartedEvent | FusionRouteFailedEvent | FusionResolvedEvent | FusionCompletedEvent | PermissionRecoveryEvent | 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 | ToolShellOutputEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentConfiguredEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | PermissionCarriedForwardEvent | PermissionMessageAuthorizationEvent | PermissionMessageAuthorizationReadEvent | PermissionMessageAuthorizationDegradedEvent | PermissionAssentDetectedEvent | PermissionContextualAuthorizationEvent | 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 | HumanResponseRecordedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | WorkflowRunUpdatedEvent | WorkflowRunStartedEvent | WorkflowRunSettledEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpServerRemovedEvent | McpServerNeedsReconnectEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Extensible routing preference for the virtual `auto` model. New identifiers must be advertised and enabled by the provider. `fast` is an integrator-only latency preset.
|
|
15
15
|
*/
|
|
16
16
|
export type AutoTier =
|
|
17
17
|
/** Optimize for efficiency. */
|
|
@@ -21,7 +21,7 @@ export type AutoTier =
|
|
|
21
21
|
/** Optimize for intelligence. */
|
|
22
22
|
| "intelligence"
|
|
23
23
|
/** Integrator-only preset that optimizes for latency. */
|
|
24
|
-
| "fast";
|
|
24
|
+
| "fast" | (string & {});
|
|
25
25
|
/**
|
|
26
26
|
* Hosting platform type of the repository (github or ado)
|
|
27
27
|
*/
|
|
@@ -308,7 +308,7 @@ export type ModelDeselectedReason =
|
|
|
308
308
|
/** A host-managed provider snapshot no longer publishes the selected model. */
|
|
309
309
|
"provider_withdrawn";
|
|
310
310
|
/**
|
|
311
|
-
* Auto preferences that Copilot API can recommend.
|
|
311
|
+
* Enabled Auto preferences that Copilot API can recommend.
|
|
312
312
|
*/
|
|
313
313
|
export type RecommendedAutoTier =
|
|
314
314
|
/** Optimize for efficiency. */
|
|
@@ -316,7 +316,7 @@ export type RecommendedAutoTier =
|
|
|
316
316
|
/** Balance efficiency and intelligence. */
|
|
317
317
|
| "balance"
|
|
318
318
|
/** Optimize for intelligence. */
|
|
319
|
-
| "intelligence";
|
|
319
|
+
| "intelligence" | (string & {});
|
|
320
320
|
/**
|
|
321
321
|
* Terminal reason an Auto preference activation failed.
|
|
322
322
|
*/
|
|
@@ -740,7 +740,7 @@ export type AbortReason =
|
|
|
740
740
|
/** Autopilot stopped the run because the active objective reached its user-set --max-ai-credits limit. */
|
|
741
741
|
| "autopilot_credit_limit";
|
|
742
742
|
/**
|
|
743
|
-
* Configuration source: user, workspace, plugin, builtin, or
|
|
743
|
+
* Configuration source: user, workspace, plugin, builtin, managed, or account
|
|
744
744
|
*/
|
|
745
745
|
export type McpServerSource =
|
|
746
746
|
/** Server configured in the user's global MCP configuration. */
|
|
@@ -752,7 +752,9 @@ export type McpServerSource =
|
|
|
752
752
|
/** Server bundled with the runtime. */
|
|
753
753
|
| "builtin"
|
|
754
754
|
/** Server supplied by a trusted host-managed catalog. */
|
|
755
|
-
| "managed"
|
|
755
|
+
| "managed"
|
|
756
|
+
/** Server contributed by a signed-in account; enablement and organization policy still apply. */
|
|
757
|
+
| "account";
|
|
756
758
|
/**
|
|
757
759
|
* Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)
|
|
758
760
|
*/
|
|
@@ -773,6 +775,27 @@ export type ToolExecutionStartToolDescriptionMetaUIVisibility =
|
|
|
773
775
|
"model"
|
|
774
776
|
/** Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool */
|
|
775
777
|
| "app";
|
|
778
|
+
/**
|
|
779
|
+
* Shell output source. Terminal output has no separate stdout/stderr attribution.
|
|
780
|
+
*/
|
|
781
|
+
export type ToolShellOutputStream =
|
|
782
|
+
/** Output from the shell command's standard output stream. This is the default when stream is omitted. */
|
|
783
|
+
"stdout"
|
|
784
|
+
/** Output from the shell command's standard error stream. */
|
|
785
|
+
| "stderr"
|
|
786
|
+
/** Inherently merged output that cannot be attributed separately to stdout or stderr. */
|
|
787
|
+
| "terminal";
|
|
788
|
+
/**
|
|
789
|
+
* Kind of file mutation committed by a built-in editing tool.
|
|
790
|
+
*/
|
|
791
|
+
/** @experimental */
|
|
792
|
+
export type ToolExecutionCompleteFileEditKind =
|
|
793
|
+
/** A file was created. */
|
|
794
|
+
"create"
|
|
795
|
+
/** A file was written by an edit operation. */
|
|
796
|
+
| "edit"
|
|
797
|
+
/** A file was deleted. */
|
|
798
|
+
| "delete" | (string & {});
|
|
776
799
|
/**
|
|
777
800
|
* A model-facing binary result as persisted: full inline data, a size-omitted marker, or a deduplicated asset reference
|
|
778
801
|
*/
|
|
@@ -1215,6 +1238,92 @@ export type ExitPlanModeAction =
|
|
|
1215
1238
|
| "autopilot"
|
|
1216
1239
|
/** Exit plan mode and continue with parallel autonomous workers. */
|
|
1217
1240
|
| "autopilot_fleet";
|
|
1241
|
+
/**
|
|
1242
|
+
* Controlled provenance for a typed runtime response. Only `human_response`, minted by a trusted direct-interaction ingress, is human authorization evidence.
|
|
1243
|
+
*/
|
|
1244
|
+
export type HumanResponseActor =
|
|
1245
|
+
/** A built-in trusted client submitted the response after direct human interaction. */
|
|
1246
|
+
"human_response"
|
|
1247
|
+
/** A host or SDK automation submitted the response without direct human interaction. */
|
|
1248
|
+
| "host_automation"
|
|
1249
|
+
/** The response came through a legacy or otherwise unattributed ingress. */
|
|
1250
|
+
| "unknown";
|
|
1251
|
+
/**
|
|
1252
|
+
* Exact runtime-owned question or reviewed plan paired with the typed response that settled it.
|
|
1253
|
+
*/
|
|
1254
|
+
export type HumanResponseRecordedResponse = {
|
|
1255
|
+
/**
|
|
1256
|
+
* Exact answer content accepted from the user.
|
|
1257
|
+
*/
|
|
1258
|
+
content: {
|
|
1259
|
+
[k: string]: ElicitationCompletedContent | undefined;
|
|
1260
|
+
};
|
|
1261
|
+
/**
|
|
1262
|
+
* Exact question displayed to the user.
|
|
1263
|
+
*/
|
|
1264
|
+
message: string;
|
|
1265
|
+
requestedSchema: ElicitationRequestedSchema;
|
|
1266
|
+
/**
|
|
1267
|
+
* Runtime-owned response kind discriminator.
|
|
1268
|
+
*/
|
|
1269
|
+
responseKind: "ask_user";
|
|
1270
|
+
} | {
|
|
1271
|
+
/**
|
|
1272
|
+
* Whether the displayed request allowed a free-form answer.
|
|
1273
|
+
*/
|
|
1274
|
+
allowFreeform?: boolean;
|
|
1275
|
+
/**
|
|
1276
|
+
* Exact selected or free-form answer submitted by the user.
|
|
1277
|
+
*/
|
|
1278
|
+
answer: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* Exact choices displayed to the user, when the request offered choices.
|
|
1281
|
+
*/
|
|
1282
|
+
choices?: string[];
|
|
1283
|
+
/**
|
|
1284
|
+
* Exact question displayed to the user.
|
|
1285
|
+
*/
|
|
1286
|
+
question: string;
|
|
1287
|
+
/**
|
|
1288
|
+
* Runtime-owned response kind discriminator.
|
|
1289
|
+
*/
|
|
1290
|
+
responseKind: "user_input";
|
|
1291
|
+
/**
|
|
1292
|
+
* Whether the answer was typed as free-form text rather than selected from the displayed choices.
|
|
1293
|
+
*/
|
|
1294
|
+
wasFreeform: boolean;
|
|
1295
|
+
} | {
|
|
1296
|
+
/**
|
|
1297
|
+
* Actions offered by the plan review UI.
|
|
1298
|
+
*/
|
|
1299
|
+
actions: ExitPlanModeAction[];
|
|
1300
|
+
/**
|
|
1301
|
+
* Whether the user approved the reviewed plan.
|
|
1302
|
+
*/
|
|
1303
|
+
approved: boolean;
|
|
1304
|
+
/**
|
|
1305
|
+
* Whether the selected response requested edit auto-approval.
|
|
1306
|
+
*/
|
|
1307
|
+
autoApproveEdits?: boolean;
|
|
1308
|
+
/**
|
|
1309
|
+
* Exact feedback submitted with the plan decision, when present.
|
|
1310
|
+
*/
|
|
1311
|
+
feedback?: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* Exact full plan content available from the review UI.
|
|
1314
|
+
*/
|
|
1315
|
+
planContent: string;
|
|
1316
|
+
recommendedAction: ExitPlanModeAction;
|
|
1317
|
+
/**
|
|
1318
|
+
* Runtime-owned response kind discriminator.
|
|
1319
|
+
*/
|
|
1320
|
+
responseKind: "exit_plan_mode";
|
|
1321
|
+
selectedAction?: ExitPlanModeAction;
|
|
1322
|
+
/**
|
|
1323
|
+
* Exact plan summary displayed to the user.
|
|
1324
|
+
*/
|
|
1325
|
+
summary: string;
|
|
1326
|
+
};
|
|
1218
1327
|
/**
|
|
1219
1328
|
* Terminal status a workflow run committed. A settled run is never `pending` or `running`, so those two members of the run-status domain are deliberately absent.
|
|
1220
1329
|
*/
|
|
@@ -1271,7 +1380,7 @@ export type McpServerStatus =
|
|
|
1271
1380
|
| "pending"
|
|
1272
1381
|
/** The server is configured but disabled. */
|
|
1273
1382
|
| "disabled"
|
|
1274
|
-
/** The server
|
|
1383
|
+
/** The server is not running: it may not have started yet, may have been explicitly stopped, or may be quarantined by restrictive managed policy. It can be restarted on demand when policy permits. */
|
|
1275
1384
|
| "stopped"
|
|
1276
1385
|
/** The server is not configured for this session. */
|
|
1277
1386
|
| "not_configured";
|
|
@@ -1360,6 +1469,10 @@ export interface StartData {
|
|
|
1360
1469
|
* Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
|
|
1361
1470
|
*/
|
|
1362
1471
|
reasoningEffort?: string;
|
|
1472
|
+
/**
|
|
1473
|
+
* Model that owns effort embedded in an authored model selection. Omitted for independent reasoning-effort overrides and legacy events.
|
|
1474
|
+
*/
|
|
1475
|
+
reasoningEffortModel?: string;
|
|
1363
1476
|
reasoningSummary?: ReasoningSummary;
|
|
1364
1477
|
/**
|
|
1365
1478
|
* Whether this session supports remote steering via GitHub
|
|
@@ -1512,6 +1625,10 @@ export interface ResumeData {
|
|
|
1512
1625
|
* Reasoning effort level used for model calls, if applicable (e.g. "none", "low", "medium", "high", "xhigh", "max")
|
|
1513
1626
|
*/
|
|
1514
1627
|
reasoningEffort?: string;
|
|
1628
|
+
/**
|
|
1629
|
+
* Model that owns effort embedded in an authored model selection. Omitted for independent reasoning-effort overrides and legacy events.
|
|
1630
|
+
*/
|
|
1631
|
+
reasoningEffortModel?: string;
|
|
1515
1632
|
reasoningSummary?: ReasoningSummary;
|
|
1516
1633
|
/**
|
|
1517
1634
|
* Whether this session supports remote steering via GitHub
|
|
@@ -2114,6 +2231,10 @@ export interface ModelChangeData {
|
|
|
2114
2231
|
* Reasoning effort level after the model change, if applicable
|
|
2115
2232
|
*/
|
|
2116
2233
|
reasoningEffort?: string | null;
|
|
2234
|
+
/**
|
|
2235
|
+
* Model that owns effort embedded in an authored model selection. Omitted for independent reasoning-effort overrides and legacy events.
|
|
2236
|
+
*/
|
|
2237
|
+
reasoningEffortModel?: string;
|
|
2117
2238
|
reasoningSummary?: ReasoningSummary;
|
|
2118
2239
|
source?: ModelChangeSource;
|
|
2119
2240
|
verbosity?: Verbosity;
|
|
@@ -5506,6 +5627,10 @@ export interface AssistantMessageReasoningBlocks {
|
|
|
5506
5627
|
* 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.
|
|
5507
5628
|
*/
|
|
5508
5629
|
blocks?: JsonValue[];
|
|
5630
|
+
/**
|
|
5631
|
+
* Anthropic Messages assistant block ordering preserved when the legacy reasoning-only representation cannot reproduce it exactly. Thinking and text blocks remain verbatim; tool-use entries retain identity and a payload fingerprint when later signed reasoning depends on them, and are hydrated from the message's tool requests during replay.
|
|
5632
|
+
*/
|
|
5633
|
+
orderedBlocks?: JsonValue[];
|
|
5509
5634
|
/**
|
|
5510
5635
|
* Model provider that produced these reasoning blocks.
|
|
5511
5636
|
*/
|
|
@@ -5804,6 +5929,10 @@ export interface AssistantUsageData {
|
|
|
5804
5929
|
*/
|
|
5805
5930
|
apiCallId?: string;
|
|
5806
5931
|
apiEndpoint?: AssistantUsageApiEndpoint;
|
|
5932
|
+
/**
|
|
5933
|
+
* Where the bring-your-own-key model runs and who manages it: "local_managed" (on the device, managed by Copilot), "local_user" (on the device, managed by the user), or "remote_user" (off the device, managed by the user). Absent for Copilot-served models.
|
|
5934
|
+
*/
|
|
5935
|
+
byokKind?: string;
|
|
5807
5936
|
/**
|
|
5808
5937
|
* Updated prompt-cache expiration for this model call. Present only when the call establishes or refreshes known cache state.
|
|
5809
5938
|
*/
|
|
@@ -5877,6 +6006,10 @@ export interface AssistantUsageData {
|
|
|
5877
6006
|
* Model identifier used for this API call
|
|
5878
6007
|
*/
|
|
5879
6008
|
model: string;
|
|
6009
|
+
/**
|
|
6010
|
+
* Fixed-set provider family serving the bring-your-own-key model (for example "openai", "anthropic", "azure_openai", "ollama", "llama_cpp", or "other"). Never the caller-supplied provider name. Absent for Copilot-served models.
|
|
6011
|
+
*/
|
|
6012
|
+
modelProvider?: string;
|
|
5880
6013
|
/**
|
|
5881
6014
|
* Number of output tokens produced
|
|
5882
6015
|
*/
|
|
@@ -5999,6 +6132,10 @@ export interface ModelCallFailureData {
|
|
|
5999
6132
|
apiCallId?: string;
|
|
6000
6133
|
apiEndpoint?: AssistantUsageApiEndpoint;
|
|
6001
6134
|
badRequestKind?: ModelCallFailureBadRequestKind;
|
|
6135
|
+
/**
|
|
6136
|
+
* Where the bring-your-own-key model for the failed call runs and who manages it: "local_managed" (on the device, managed by Copilot), "local_user" (on the device, managed by the user), or "remote_user" (off the device, managed by the user). Absent for Copilot-served models.
|
|
6137
|
+
*/
|
|
6138
|
+
byokKind?: string;
|
|
6002
6139
|
/**
|
|
6003
6140
|
* Duration of the failed API call in milliseconds
|
|
6004
6141
|
*/
|
|
@@ -6050,6 +6187,10 @@ export interface ModelCallFailureData {
|
|
|
6050
6187
|
* Model identifier used for the failed API call
|
|
6051
6188
|
*/
|
|
6052
6189
|
model?: string;
|
|
6190
|
+
/**
|
|
6191
|
+
* Fixed-set provider family serving the bring-your-own-key model for the failed call (for example "openai", "anthropic", "azure_openai", "ollama", "llama_cpp", or "other"). Never the caller-supplied provider name. Absent for Copilot-served models.
|
|
6192
|
+
*/
|
|
6193
|
+
modelProvider?: string;
|
|
6053
6194
|
/**
|
|
6054
6195
|
* Parent task tool call ID when this failed model call belongs to a sub-agent
|
|
6055
6196
|
*/
|
|
@@ -6062,6 +6203,10 @@ export interface ModelCallFailureData {
|
|
|
6062
6203
|
* Reasoning effort level used for the failed model call, if applicable
|
|
6063
6204
|
*/
|
|
6064
6205
|
reasoningEffort?: string;
|
|
6206
|
+
/**
|
|
6207
|
+
* Serialized (uncompressed) byte length of the failed request body. A content-free size signal.
|
|
6208
|
+
*/
|
|
6209
|
+
requestBodyBytes?: number;
|
|
6065
6210
|
requestFingerprint?: ModelCallFailureRequestFingerprint;
|
|
6066
6211
|
/**
|
|
6067
6212
|
* 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.
|
|
@@ -6397,7 +6542,8 @@ export interface ToolExecutionStartToolDescriptionMetaUI {
|
|
|
6397
6542
|
visibility?: ToolExecutionStartToolDescriptionMetaUIVisibility[];
|
|
6398
6543
|
}
|
|
6399
6544
|
/**
|
|
6400
|
-
*
|
|
6545
|
+
* @deprecated
|
|
6546
|
+
* Session event "tool.execution_partial_result". Deprecated merged replacement snapshot of shell output. Use tool.shell_output for append-only, stream-tagged output instead.
|
|
6401
6547
|
*/
|
|
6402
6548
|
export interface ToolExecutionPartialResultEvent {
|
|
6403
6549
|
/**
|
|
@@ -6427,11 +6573,12 @@ export interface ToolExecutionPartialResultEvent {
|
|
|
6427
6573
|
type: "tool.execution_partial_result";
|
|
6428
6574
|
}
|
|
6429
6575
|
/**
|
|
6430
|
-
*
|
|
6576
|
+
* @deprecated
|
|
6577
|
+
* Deprecated merged replacement snapshot of shell output. Use tool.shell_output for append-only, stream-tagged output instead.
|
|
6431
6578
|
*/
|
|
6432
6579
|
export interface ToolExecutionPartialData {
|
|
6433
6580
|
/**
|
|
6434
|
-
*
|
|
6581
|
+
* Merged replacement snapshot from the running shell, not an append-only chunk
|
|
6435
6582
|
*/
|
|
6436
6583
|
partialOutput: string;
|
|
6437
6584
|
/**
|
|
@@ -6439,6 +6586,54 @@ export interface ToolExecutionPartialData {
|
|
|
6439
6586
|
*/
|
|
6440
6587
|
toolCallId: string;
|
|
6441
6588
|
}
|
|
6589
|
+
/**
|
|
6590
|
+
* Session event "tool.shell_output". Live, append-only shell output. Not persisted or replayed to late subscribers. Text is decoded and redacted per chunk; chunks need not contain complete lines.
|
|
6591
|
+
*/
|
|
6592
|
+
export interface ToolShellOutputEvent {
|
|
6593
|
+
/**
|
|
6594
|
+
* Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
|
|
6595
|
+
*/
|
|
6596
|
+
agentId?: string;
|
|
6597
|
+
data: ToolShellOutputData;
|
|
6598
|
+
/**
|
|
6599
|
+
* Always true for events that are transient and not persisted to the session event log on disk.
|
|
6600
|
+
*/
|
|
6601
|
+
ephemeral: true;
|
|
6602
|
+
/**
|
|
6603
|
+
* Unique event identifier (UUID v4), generated when the event is emitted
|
|
6604
|
+
*/
|
|
6605
|
+
id: string;
|
|
6606
|
+
/**
|
|
6607
|
+
* ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
|
|
6608
|
+
*/
|
|
6609
|
+
parentId: string | null;
|
|
6610
|
+
/**
|
|
6611
|
+
* ISO 8601 timestamp when the event was created
|
|
6612
|
+
*/
|
|
6613
|
+
timestamp: string;
|
|
6614
|
+
/**
|
|
6615
|
+
* Type discriminator. Always "tool.shell_output".
|
|
6616
|
+
*/
|
|
6617
|
+
type: "tool.shell_output";
|
|
6618
|
+
}
|
|
6619
|
+
/**
|
|
6620
|
+
* Live, append-only shell output. Not persisted or replayed to late subscribers. Text is decoded and redacted per chunk; chunks need not contain complete lines.
|
|
6621
|
+
*/
|
|
6622
|
+
export interface ToolShellOutputData {
|
|
6623
|
+
/**
|
|
6624
|
+
* Zero-based publication sequence across all output streams for this tool call. Not a byte offset or an OS write-order guarantee.
|
|
6625
|
+
*/
|
|
6626
|
+
sequence: number;
|
|
6627
|
+
stream?: ToolShellOutputStream;
|
|
6628
|
+
/**
|
|
6629
|
+
* New output to append, without synthetic shell-result markers or stream-switch separators
|
|
6630
|
+
*/
|
|
6631
|
+
text: string;
|
|
6632
|
+
/**
|
|
6633
|
+
* Tool call ID that owns this shell output
|
|
6634
|
+
*/
|
|
6635
|
+
toolCallId: string;
|
|
6636
|
+
}
|
|
6442
6637
|
/**
|
|
6443
6638
|
* Session event "tool.execution_progress". Tool execution progress notification with status message
|
|
6444
6639
|
*/
|
|
@@ -6523,6 +6718,12 @@ export interface ToolExecutionCompleteEvent {
|
|
|
6523
6718
|
*/
|
|
6524
6719
|
export interface ToolExecutionCompleteData {
|
|
6525
6720
|
error?: ToolExecutionCompleteError;
|
|
6721
|
+
/**
|
|
6722
|
+
* Experimental. File mutations actually committed by a built-in file editing tool, in execution order. Present on successful edits and on partial failures when earlier mutations were committed. Paths are absolute in the session filesystem namespace.
|
|
6723
|
+
*
|
|
6724
|
+
* @experimental
|
|
6725
|
+
*/
|
|
6726
|
+
fileEdits?: ToolExecutionCompleteFileEdit[];
|
|
6526
6727
|
/**
|
|
6527
6728
|
* Experimental HydraFusion attribution for this tool completion.
|
|
6528
6729
|
*
|
|
@@ -6601,6 +6802,17 @@ export interface ToolExecutionCompleteError {
|
|
|
6601
6802
|
message: string;
|
|
6602
6803
|
remediation?: RemediationAction;
|
|
6603
6804
|
}
|
|
6805
|
+
/**
|
|
6806
|
+
* A file mutation that was actually committed by a built-in file editing tool.
|
|
6807
|
+
*/
|
|
6808
|
+
/** @experimental */
|
|
6809
|
+
export interface ToolExecutionCompleteFileEdit {
|
|
6810
|
+
kind: ToolExecutionCompleteFileEditKind;
|
|
6811
|
+
/**
|
|
6812
|
+
* Absolute path in the session filesystem namespace.
|
|
6813
|
+
*/
|
|
6814
|
+
path: string;
|
|
6815
|
+
}
|
|
6604
6816
|
/**
|
|
6605
6817
|
* Tool execution result on success
|
|
6606
6818
|
*/
|
|
@@ -8646,6 +8858,8 @@ export interface PermissionApprovalEvaluation {
|
|
|
8646
8858
|
| "action-too-long"
|
|
8647
8859
|
/** The script path was not authorized for inspection. */
|
|
8648
8860
|
| "path-not-authorized"
|
|
8861
|
+
/** A code source was excluded from review by content exclusion policy. */
|
|
8862
|
+
| "content-excluded"
|
|
8649
8863
|
/** The script working directory was invalid. */
|
|
8650
8864
|
| "invalid-working-directory"
|
|
8651
8865
|
/** The script snapshot could not be read. */
|
|
@@ -8670,6 +8884,18 @@ export interface PermissionApprovalEvaluation {
|
|
|
8670
8884
|
| "unreviewable-script-invocation"
|
|
8671
8885
|
/** The script argument binding could not be reviewed. */
|
|
8672
8886
|
| "argument-binding-unreviewable"
|
|
8887
|
+
/** The shell command could not be analyzed for execution evidence. */
|
|
8888
|
+
| "unsupported-command-shape"
|
|
8889
|
+
/** The shell command used a code source that cannot be bound for review. */
|
|
8890
|
+
| "unsupported-source"
|
|
8891
|
+
/** The shell command used a code source computed at run time. */
|
|
8892
|
+
| "dynamic-source"
|
|
8893
|
+
/** The shell command referenced more code sources than can be reviewed. */
|
|
8894
|
+
| "too-many-sources"
|
|
8895
|
+
/** A code-bearing executable could not be inspected. */
|
|
8896
|
+
| "executable-unavailable"
|
|
8897
|
+
/** A code-bearing executable exceeded the binding size limit. */
|
|
8898
|
+
| "executable-too-large"
|
|
8673
8899
|
/** The script review metadata was malformed. */
|
|
8674
8900
|
| "malformed-script-action-review"
|
|
8675
8901
|
/** The script snapshot manifest was malformed. */
|
|
@@ -11663,6 +11889,51 @@ export interface ExitPlanModeCompletedData {
|
|
|
11663
11889
|
requestId: string;
|
|
11664
11890
|
selectedAction?: ExitPlanModeAction;
|
|
11665
11891
|
}
|
|
11892
|
+
/**
|
|
11893
|
+
* Session event "human_response.recorded". Durable request-correlated evidence for a typed response to a runtime-owned question or plan review.
|
|
11894
|
+
*/
|
|
11895
|
+
export interface HumanResponseRecordedEvent {
|
|
11896
|
+
/**
|
|
11897
|
+
* Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
|
|
11898
|
+
*/
|
|
11899
|
+
agentId?: string;
|
|
11900
|
+
data: HumanResponseRecordedData;
|
|
11901
|
+
/**
|
|
11902
|
+
* When true, the event is transient and not persisted to the session event log on disk
|
|
11903
|
+
*/
|
|
11904
|
+
ephemeral?: boolean;
|
|
11905
|
+
/**
|
|
11906
|
+
* Unique event identifier (UUID v4), generated when the event is emitted
|
|
11907
|
+
*/
|
|
11908
|
+
id: string;
|
|
11909
|
+
/**
|
|
11910
|
+
* ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
|
|
11911
|
+
*/
|
|
11912
|
+
parentId: string | null;
|
|
11913
|
+
/**
|
|
11914
|
+
* ISO 8601 timestamp when the event was created
|
|
11915
|
+
*/
|
|
11916
|
+
timestamp: string;
|
|
11917
|
+
/**
|
|
11918
|
+
* Type discriminator. Always "human_response.recorded".
|
|
11919
|
+
*/
|
|
11920
|
+
type: "human_response.recorded";
|
|
11921
|
+
}
|
|
11922
|
+
/**
|
|
11923
|
+
* Durable request-correlated evidence for a typed response to a runtime-owned question or plan review.
|
|
11924
|
+
*/
|
|
11925
|
+
export interface HumanResponseRecordedData {
|
|
11926
|
+
actor: HumanResponseActor;
|
|
11927
|
+
/**
|
|
11928
|
+
* Request ID of the runtime-owned question or plan review.
|
|
11929
|
+
*/
|
|
11930
|
+
requestId: string;
|
|
11931
|
+
response: HumanResponseRecordedResponse;
|
|
11932
|
+
/**
|
|
11933
|
+
* Tool call ID that opened the request, when present.
|
|
11934
|
+
*/
|
|
11935
|
+
toolCallId?: string;
|
|
11936
|
+
}
|
|
11666
11937
|
/**
|
|
11667
11938
|
* Session event "session.tools_updated". Payload of `session.tools_updated` identifying the model whose resolved tools were updated.
|
|
11668
11939
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { BuiltInTools, ToolSet } from "./toolSet.js";
|
|
|
11
11
|
export { CopilotSession, type AssistantMessageEvent } from "./session.js";
|
|
12
12
|
export { defineWorkflow, WorkflowResumeError, isWorkflowRunTerminal } from "./workflow.js";
|
|
13
13
|
export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
|
|
14
|
-
export { defineTool, approveAll, createAttributedPermissionResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
|
|
14
|
+
export { defineTool, approveAll, createAttributedPermissionResult, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SessionFsSqliteTransactionFailure, SessionFsWriteFailure, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
|
|
15
15
|
export type * from "./generated/session-events.js";
|
|
16
|
-
export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AuthIdentityMetadata, AuthInfoType, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorSessionAccount, ConnectorSessionAccountResult, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
|
16
|
+
export type { AskUserVariant, CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AuthIdentityMetadata, AuthInfoType, ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorSessionAccount, ConnectorSessionAccountResult, ConnectorStatus, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, AgentStopHandler, AgentStopHookInput, AgentStopHookOutput, SubagentStartHandler, SubagentStartHookInput, SubagentStartHookOutput, SubagentStopHandler, SubagentStopHookInput, SubagentStopHookOutput, UserPromptTransformedHandler, UserPromptTransformedHookInput, UserPromptTransformedHookOutput, CopilotClientInfo, CopilotClientMode, CopilotClientOptions, InstallationConfirmationHandler, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionLaunchProfile, ExtensionLaunchProvider, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubMcpToolConfig, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTokenProvider, GitHubTokenProviderArgs, GitHubTokenProviderResult, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, ExtensionContextAttachment, MessageOptions, ResponseSchema, MessageSource, ManagedSettings, ManagedSettingsPermissions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, AutoTier, CapiSessionOptions, CurrentModel, ModelSwitchAutoTierResult, ModelSwitchAutoTierStatus, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestedData, PermissionRequestedEvent, PermissionRequestResult, AttributedPermissionResult, PermissionDecisionContext, PermissionDecisionOutcome, PermissionDecisionSource, PermissionDecisionSurface, PermissionResponseCapability, ProviderConfig, ProviderConfigModelProvider, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, SandboxConfigSource, ResumeSessionConfig, TranscriptRecovery, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionHooks, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SessionFsSqliteStatement, SessionFsSqliteTransactionErrorClass, SkillProvider, SkillProviderCallOptions, SkillProviderDescriptor, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
|
17
17
|
export type { JsonValue, WorkflowRunOptions, WorkflowResumeOptions, WorkflowLimitOverrides, WorkflowResumeErrorCode, SessionWorkflowApi, WorkflowAgentOptions, WorkflowContext, WorkflowDefinition, WorkflowHandle, WorkflowJsonSchema, WorkflowLimits, WorkflowMeta, WorkflowPipelineStage, WorkflowStepOptions, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary, WorkflowListRunsOptions, WorkflowRunsPage, WorkflowRunDetail, WorkflowProgressPage, WorkflowProgressLine, WorkflowPhaseObservation, WorkflowPhaseStatus, WorkflowAgentSummary, } from "./workflow.js";
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
CopilotWebSocketCloseStatus,
|
|
23
23
|
CopilotWebSocketForwarder,
|
|
24
24
|
SessionFsSqliteTransactionFailure,
|
|
25
|
+
SessionFsWriteFailure,
|
|
25
26
|
SYSTEM_MESSAGE_SECTIONS
|
|
26
27
|
} from "./types.js";
|
|
27
28
|
export {
|
|
@@ -39,6 +40,7 @@ export {
|
|
|
39
40
|
RuntimeConnection,
|
|
40
41
|
SYSTEM_MESSAGE_SECTIONS,
|
|
41
42
|
SessionFsSqliteTransactionFailure,
|
|
43
|
+
SessionFsWriteFailure,
|
|
42
44
|
ToolSet,
|
|
43
45
|
WorkflowResumeError,
|
|
44
46
|
approveAll,
|
package/dist/runtimeArtifacts.js
CHANGED
package/dist/session.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSessionRpc } from "./generated/rpc.js";
|
|
2
2
|
import type { ModelSwitchAutoTierResult } from "./generated/rpc.js";
|
|
3
3
|
import type { OpenCanvasInstance } from "./generated/rpc.js";
|
|
4
|
-
import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, TranscriptRecovery, TypedSessionEventHandler } from "./types.js";
|
|
4
|
+
import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, Tool, TranscriptRecovery, TypedSessionEventHandler } from "./types.js";
|
|
5
5
|
import { type SessionWorkflowApi } from "./workflow.js";
|
|
6
6
|
/** Assistant message event - the final response from the assistant. */
|
|
7
7
|
export type AssistantMessageEvent = Extract<SessionEvent, {
|
|
@@ -45,6 +45,8 @@ export declare class CopilotSession {
|
|
|
45
45
|
private eventHandlers;
|
|
46
46
|
private typedEventHandlers;
|
|
47
47
|
private toolHandlers;
|
|
48
|
+
/** Settles once every earlier `setTools` call has finished. */
|
|
49
|
+
private setToolsQueue;
|
|
48
50
|
private pendingExternalTools;
|
|
49
51
|
private canvases;
|
|
50
52
|
private bearerTokenProviders;
|
|
@@ -57,6 +59,7 @@ export declare class CopilotSession {
|
|
|
57
59
|
private elicitationHandler?;
|
|
58
60
|
private exitPlanModeHandler?;
|
|
59
61
|
private autoModeSwitchHandler?;
|
|
62
|
+
private skillProvider?;
|
|
60
63
|
private hooks?;
|
|
61
64
|
private transformCallbacks?;
|
|
62
65
|
private _rpc;
|
|
@@ -233,6 +236,12 @@ export declare class CopilotSession {
|
|
|
233
236
|
private _confirm;
|
|
234
237
|
private _select;
|
|
235
238
|
private _input;
|
|
239
|
+
private requireSkillProvider;
|
|
240
|
+
/**
|
|
241
|
+
* Runs a provider call with an abort signal tied to the runtime's request
|
|
242
|
+
* cancellation. Failures are logged locally and reported generically.
|
|
243
|
+
*/
|
|
244
|
+
private callSkillProvider;
|
|
236
245
|
/**
|
|
237
246
|
* Retrieves all events and messages from this session's history.
|
|
238
247
|
*
|
|
@@ -364,6 +373,48 @@ export declare class CopilotSession {
|
|
|
364
373
|
* ```
|
|
365
374
|
*/
|
|
366
375
|
setAutoTier(autoTier: AutoTier | null): Promise<ModelSwitchAutoTierResult>;
|
|
376
|
+
/**
|
|
377
|
+
* Replace the tools this client supplies to the session.
|
|
378
|
+
*
|
|
379
|
+
* `tools` becomes the complete set of tools this client implements,
|
|
380
|
+
* replacing the ones it supplied when the session was created or resumed,
|
|
381
|
+
* or in an earlier call. Built-in, MCP, and plugin tools, and tools other
|
|
382
|
+
* connected clients supply, are unaffected. Pass an empty array to remove
|
|
383
|
+
* all of this client's tools.
|
|
384
|
+
*
|
|
385
|
+
* Tools are defined the same way as for `createSession`: calls to tools
|
|
386
|
+
* with a `handler` are dispatched to it, and tools without one are
|
|
387
|
+
* declaration-only. Once the runtime accepts the replacement, every tool
|
|
388
|
+
* call this session dispatches uses the new handlers; calls already
|
|
389
|
+
* running finish on their original handlers. If the runtime rejects the
|
|
390
|
+
* replacement, this rejects and the previous tools and handlers stay in
|
|
391
|
+
* place. Concurrent calls on the same session are applied one at a time,
|
|
392
|
+
* in the order they are made.
|
|
393
|
+
*
|
|
394
|
+
* The agent sees the new tools from its next model request, which can fall
|
|
395
|
+
* within a turn in progress. A model request already in flight was made
|
|
396
|
+
* with the previous tools, so the agent can still call a tool you removed.
|
|
397
|
+
* This session doesn't answer that call, and it can stay pending until the
|
|
398
|
+
* turn is aborted. If a running turn might still call a tool you remove,
|
|
399
|
+
* replace tools while the session is idle.
|
|
400
|
+
*
|
|
401
|
+
* @param tools - The complete set of tools this client supplies
|
|
402
|
+
*
|
|
403
|
+
* @experimental Wraps the experimental `session.tools.set` RPC and may change
|
|
404
|
+
* or be removed in a future release.
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```typescript
|
|
408
|
+
* await session.setTools([
|
|
409
|
+
* defineTool("search_issues", {
|
|
410
|
+
* description: "Search the issues shown on the current page",
|
|
411
|
+
* parameters: z.object({ query: z.string() }),
|
|
412
|
+
* handler: async ({ query }) => searchIssues(query),
|
|
413
|
+
* }),
|
|
414
|
+
* ]);
|
|
415
|
+
* ```
|
|
416
|
+
*/
|
|
417
|
+
setTools(tools: Tool[]): Promise<void>;
|
|
367
418
|
/**
|
|
368
419
|
* Log a message to the session timeline.
|
|
369
420
|
* The message appears in the session event stream and is visible to SDK consumers
|