@github/copilot-sdk 1.0.7-preview.3 → 1.0.7
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/dist/cjs/client.js +7 -6
- package/dist/cjs/generated/rpc.js +6 -1
- package/dist/client.js +7 -6
- package/dist/generated/rpc.d.ts +64 -2
- package/dist/generated/rpc.js +6 -1
- package/dist/generated/session-events.d.ts +157 -5
- package/dist/types.d.ts +9 -0
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -520,6 +520,9 @@ class CopilotClient {
|
|
|
520
520
|
}
|
|
521
521
|
setupClientGlobalHandlers() {
|
|
522
522
|
const handlers = {};
|
|
523
|
+
handlers.hooks = {
|
|
524
|
+
invoke: async (params) => await this.handleHooksInvoke(params)
|
|
525
|
+
};
|
|
523
526
|
if (this.requestHandler) {
|
|
524
527
|
handlers.llmInference = (0, import_copilotRequestHandler.createCopilotRequestAdapter)(this.requestHandler, () => {
|
|
525
528
|
if (!this.connection) {
|
|
@@ -1074,7 +1077,8 @@ class CopilotClient {
|
|
|
1074
1077
|
parameters: toJsonSchema(tool.parameters),
|
|
1075
1078
|
overridesBuiltInTool: tool.overridesBuiltInTool,
|
|
1076
1079
|
skipPermission: tool.skipPermission,
|
|
1077
|
-
defer: tool.defer
|
|
1080
|
+
defer: tool.defer,
|
|
1081
|
+
metadata: tool.metadata
|
|
1078
1082
|
})),
|
|
1079
1083
|
toolSearch: config.toolSearch,
|
|
1080
1084
|
canvases: config.canvases?.map((canvas) => canvas.declaration),
|
|
@@ -1273,7 +1277,8 @@ class CopilotClient {
|
|
|
1273
1277
|
parameters: toJsonSchema(tool.parameters),
|
|
1274
1278
|
overridesBuiltInTool: tool.overridesBuiltInTool,
|
|
1275
1279
|
skipPermission: tool.skipPermission,
|
|
1276
|
-
defer: tool.defer
|
|
1280
|
+
defer: tool.defer,
|
|
1281
|
+
metadata: tool.metadata
|
|
1277
1282
|
})),
|
|
1278
1283
|
toolSearch: config.toolSearch,
|
|
1279
1284
|
canvases: config.canvases?.map((canvas) => canvas.declaration),
|
|
@@ -2063,10 +2068,6 @@ stderr: ${stderrOutput}`
|
|
|
2063
2068
|
"autoModeSwitch.request",
|
|
2064
2069
|
async (params) => await this.handleAutoModeSwitchRequest(params)
|
|
2065
2070
|
);
|
|
2066
|
-
this.connection.onRequest(
|
|
2067
|
-
"hooks.invoke",
|
|
2068
|
-
async (params) => await this.handleHooksInvoke(params)
|
|
2069
|
-
);
|
|
2070
2071
|
this.connection.onRequest(
|
|
2071
2072
|
"systemMessage.transform",
|
|
2072
2073
|
async (params) => await this.handleSystemMessageTransform(params)
|
|
@@ -1119,7 +1119,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1119
1119
|
*/
|
|
1120
1120
|
list: async () => connection.sendRequest("session.mcp.list", { sessionId }),
|
|
1121
1121
|
/**
|
|
1122
|
-
* Lists the tools exposed by a connected MCP server on this session's host.
|
|
1122
|
+
* Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.
|
|
1123
1123
|
*
|
|
1124
1124
|
* @param params Server name whose tool list should be returned.
|
|
1125
1125
|
*
|
|
@@ -2145,6 +2145,11 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2145
2145
|
});
|
|
2146
2146
|
}
|
|
2147
2147
|
function registerClientGlobalApiHandlers(connection, handlers) {
|
|
2148
|
+
connection.onRequest("hooks.invoke", async (params) => {
|
|
2149
|
+
const handler = handlers.hooks;
|
|
2150
|
+
if (!handler) throw new Error("No hooks client-global handler registered");
|
|
2151
|
+
return handler.invoke(params);
|
|
2152
|
+
});
|
|
2148
2153
|
connection.onRequest("llmInference.httpRequestStart", async (params) => {
|
|
2149
2154
|
const handler = handlers.llmInference;
|
|
2150
2155
|
if (!handler) throw new Error("No llmInference client-global handler registered");
|
package/dist/client.js
CHANGED
|
@@ -497,6 +497,9 @@ class CopilotClient {
|
|
|
497
497
|
}
|
|
498
498
|
setupClientGlobalHandlers() {
|
|
499
499
|
const handlers = {};
|
|
500
|
+
handlers.hooks = {
|
|
501
|
+
invoke: async (params) => await this.handleHooksInvoke(params)
|
|
502
|
+
};
|
|
500
503
|
if (this.requestHandler) {
|
|
501
504
|
handlers.llmInference = createCopilotRequestAdapter(this.requestHandler, () => {
|
|
502
505
|
if (!this.connection) {
|
|
@@ -1051,7 +1054,8 @@ class CopilotClient {
|
|
|
1051
1054
|
parameters: toJsonSchema(tool.parameters),
|
|
1052
1055
|
overridesBuiltInTool: tool.overridesBuiltInTool,
|
|
1053
1056
|
skipPermission: tool.skipPermission,
|
|
1054
|
-
defer: tool.defer
|
|
1057
|
+
defer: tool.defer,
|
|
1058
|
+
metadata: tool.metadata
|
|
1055
1059
|
})),
|
|
1056
1060
|
toolSearch: config.toolSearch,
|
|
1057
1061
|
canvases: config.canvases?.map((canvas) => canvas.declaration),
|
|
@@ -1250,7 +1254,8 @@ class CopilotClient {
|
|
|
1250
1254
|
parameters: toJsonSchema(tool.parameters),
|
|
1251
1255
|
overridesBuiltInTool: tool.overridesBuiltInTool,
|
|
1252
1256
|
skipPermission: tool.skipPermission,
|
|
1253
|
-
defer: tool.defer
|
|
1257
|
+
defer: tool.defer,
|
|
1258
|
+
metadata: tool.metadata
|
|
1254
1259
|
})),
|
|
1255
1260
|
toolSearch: config.toolSearch,
|
|
1256
1261
|
canvases: config.canvases?.map((canvas) => canvas.declaration),
|
|
@@ -2040,10 +2045,6 @@ stderr: ${stderrOutput}`
|
|
|
2040
2045
|
"autoModeSwitch.request",
|
|
2041
2046
|
async (params) => await this.handleAutoModeSwitchRequest(params)
|
|
2042
2047
|
);
|
|
2043
|
-
this.connection.onRequest(
|
|
2044
|
-
"hooks.invoke",
|
|
2045
|
-
async (params) => await this.handleHooksInvoke(params)
|
|
2046
|
-
);
|
|
2047
2048
|
this.connection.onRequest(
|
|
2048
2049
|
"systemMessage.transform",
|
|
2049
2050
|
async (params) => await this.handleSystemMessageTransform(params)
|
package/dist/generated/rpc.d.ts
CHANGED
|
@@ -784,6 +784,18 @@ export type McpHeadersHandlePendingHeadersRefreshRequest = {
|
|
|
784
784
|
} | {
|
|
785
785
|
kind: "none";
|
|
786
786
|
};
|
|
787
|
+
/**
|
|
788
|
+
* Consumer allowed to call an MCP tool.
|
|
789
|
+
*
|
|
790
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
791
|
+
* via the `definition` "McpToolUiVisibility".
|
|
792
|
+
*/
|
|
793
|
+
/** @experimental */
|
|
794
|
+
export type McpToolUiVisibility =
|
|
795
|
+
/** The model may call the tool. */
|
|
796
|
+
"model"
|
|
797
|
+
/** An MCP App view may call the tool. */
|
|
798
|
+
| "app";
|
|
787
799
|
/**
|
|
788
800
|
* Host response to the pending OAuth request.
|
|
789
801
|
*
|
|
@@ -6392,7 +6404,7 @@ export interface McpListToolsResult {
|
|
|
6392
6404
|
tools: McpTools[];
|
|
6393
6405
|
}
|
|
6394
6406
|
/**
|
|
6395
|
-
* MCP tool metadata with tool name and
|
|
6407
|
+
* MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata.
|
|
6396
6408
|
*
|
|
6397
6409
|
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
6398
6410
|
* via the `definition` "McpTools".
|
|
@@ -6407,6 +6419,24 @@ export interface McpTools {
|
|
|
6407
6419
|
* Tool description, when provided.
|
|
6408
6420
|
*/
|
|
6409
6421
|
description?: string;
|
|
6422
|
+
ui?: McpToolUi;
|
|
6423
|
+
}
|
|
6424
|
+
/**
|
|
6425
|
+
* Normalized MCP Apps discovery metadata from a tool's `_meta.ui` block.
|
|
6426
|
+
*
|
|
6427
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
6428
|
+
* via the `definition` "McpToolUi".
|
|
6429
|
+
*/
|
|
6430
|
+
/** @experimental */
|
|
6431
|
+
export interface McpToolUi {
|
|
6432
|
+
/**
|
|
6433
|
+
* URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata.
|
|
6434
|
+
*/
|
|
6435
|
+
resourceUri?: string;
|
|
6436
|
+
/**
|
|
6437
|
+
* Tool visibility advertised by the server. When absent, MCP Apps defaults apply.
|
|
6438
|
+
*/
|
|
6439
|
+
visibility?: McpToolUiVisibility[];
|
|
6410
6440
|
}
|
|
6411
6441
|
/**
|
|
6412
6442
|
* Pending MCP OAuth request ID and host-provided token or cancellation response.
|
|
@@ -11749,6 +11779,10 @@ export interface SessionModelList {
|
|
|
11749
11779
|
* Available models, ordered with the most preferred default first. Includes both Copilot (CAPI) models and any registry BYOK models; a BYOK model appears under its provider-qualified selection id (`provider/id`).
|
|
11750
11780
|
*/
|
|
11751
11781
|
list: unknown[];
|
|
11782
|
+
/**
|
|
11783
|
+
* Cost categories for the full CAPI catalog, including picker-disabled models that Auto may select. Metadata only; entries absent from `list` are not manually selectable.
|
|
11784
|
+
*/
|
|
11785
|
+
modelPriceCategories?: SessionModelPriceCategory[];
|
|
11752
11786
|
/**
|
|
11753
11787
|
* Per-quota snapshots returned alongside the model list, keyed by quota type.
|
|
11754
11788
|
*/
|
|
@@ -11756,6 +11790,17 @@ export interface SessionModelList {
|
|
|
11756
11790
|
[k: string]: unknown | undefined;
|
|
11757
11791
|
};
|
|
11758
11792
|
}
|
|
11793
|
+
/**
|
|
11794
|
+
* Cost-category metadata for a CAPI model.
|
|
11795
|
+
*
|
|
11796
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
11797
|
+
* via the `definition` "SessionModelPriceCategory".
|
|
11798
|
+
*/
|
|
11799
|
+
/** @experimental */
|
|
11800
|
+
export interface SessionModelPriceCategory {
|
|
11801
|
+
id: string;
|
|
11802
|
+
priceCategory: ModelPickerPriceCategory;
|
|
11803
|
+
}
|
|
11759
11804
|
/**
|
|
11760
11805
|
* Session construction options.
|
|
11761
11806
|
*
|
|
@@ -13097,6 +13142,10 @@ export interface SessionUpdateOptionsResult {
|
|
|
13097
13142
|
* Whether the operation succeeded
|
|
13098
13143
|
*/
|
|
13099
13144
|
success: boolean;
|
|
13145
|
+
/**
|
|
13146
|
+
* Number of hooks loaded from installed plugins, returned when installedPlugins is updated
|
|
13147
|
+
*/
|
|
13148
|
+
pluginHookCount?: number;
|
|
13100
13149
|
}
|
|
13101
13150
|
/**
|
|
13102
13151
|
* User-requested shell execution cancellation handle.
|
|
@@ -16321,7 +16370,7 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
|
|
|
16321
16370
|
*/
|
|
16322
16371
|
list: () => Promise<McpServerList>;
|
|
16323
16372
|
/**
|
|
16324
|
-
* Lists the tools exposed by a connected MCP server on this session's host.
|
|
16373
|
+
* Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.
|
|
16325
16374
|
*
|
|
16326
16375
|
* @param params Server name whose tool list should be returned.
|
|
16327
16376
|
*
|
|
@@ -17362,6 +17411,18 @@ export interface ClientSessionApiHandlers {
|
|
|
17362
17411
|
* function uses `getHandlers` to resolve the session's handlers.
|
|
17363
17412
|
*/
|
|
17364
17413
|
export declare function registerClientSessionApiHandlers(connection: MessageConnection, getHandlers: (sessionId: string) => ClientSessionApiHandlers): void;
|
|
17414
|
+
/** Handler for `hooks` client global API methods. */
|
|
17415
|
+
/** @experimental */
|
|
17416
|
+
export interface HooksHandler {
|
|
17417
|
+
/**
|
|
17418
|
+
* Dispatches one SDK callback hook from the runtime to the connection that registered it. Internal transport plumbing: clients opt in through session initialization and the Rust hook processor owns ordering, policy, timeout, and callback routing.
|
|
17419
|
+
*
|
|
17420
|
+
* @param params Runtime-owned wire payload for a server-to-client hook callback invocation.
|
|
17421
|
+
*
|
|
17422
|
+
* @returns Optional output returned by an SDK callback hook.
|
|
17423
|
+
*/
|
|
17424
|
+
invoke(params: HookInvokeRequest): Promise<HookInvokeResponse>;
|
|
17425
|
+
}
|
|
17365
17426
|
/** Handler for `llmInference` client global API methods. */
|
|
17366
17427
|
/** @experimental */
|
|
17367
17428
|
export interface LlmInferenceHandler {
|
|
@@ -17394,6 +17455,7 @@ export interface GitHubTelemetryHandler {
|
|
|
17394
17455
|
}
|
|
17395
17456
|
/** All client global API handler groups. */
|
|
17396
17457
|
export interface ClientGlobalApiHandlers {
|
|
17458
|
+
hooks?: HooksHandler;
|
|
17397
17459
|
llmInference?: LlmInferenceHandler;
|
|
17398
17460
|
gitHubTelemetry?: GitHubTelemetryHandler;
|
|
17399
17461
|
}
|
package/dist/generated/rpc.js
CHANGED
|
@@ -1091,7 +1091,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1091
1091
|
*/
|
|
1092
1092
|
list: async () => connection.sendRequest("session.mcp.list", { sessionId }),
|
|
1093
1093
|
/**
|
|
1094
|
-
* Lists the tools exposed by a connected MCP server on this session's host.
|
|
1094
|
+
* Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.
|
|
1095
1095
|
*
|
|
1096
1096
|
* @param params Server name whose tool list should be returned.
|
|
1097
1097
|
*
|
|
@@ -2117,6 +2117,11 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2117
2117
|
});
|
|
2118
2118
|
}
|
|
2119
2119
|
function registerClientGlobalApiHandlers(connection, handlers) {
|
|
2120
|
+
connection.onRequest("hooks.invoke", async (params) => {
|
|
2121
|
+
const handler = handlers.hooks;
|
|
2122
|
+
if (!handler) throw new Error("No hooks client-global handler registered");
|
|
2123
|
+
return handler.invoke(params);
|
|
2124
|
+
});
|
|
2120
2125
|
connection.onRequest("llmInference.httpRequestStart", async (params) => {
|
|
2121
2126
|
const handler = handlers.llmInference;
|
|
2122
2127
|
if (!handler) throw new Error("No llmInference client-global handler registered");
|
|
@@ -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 | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
|
|
8
|
+
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 | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | ManagedSettingsResolvedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
|
|
9
9
|
/**
|
|
10
10
|
* Hosting platform type of the repository (github or ado)
|
|
11
11
|
*/
|
|
@@ -471,6 +471,16 @@ export type AutoModeResolvedReasoningBucket =
|
|
|
471
471
|
| "medium"
|
|
472
472
|
/** The request looks high-reasoning; a stronger model is appropriate. */
|
|
473
473
|
| "high";
|
|
474
|
+
/**
|
|
475
|
+
* Which channel supplied the effective enterprise managed settings (highest-authority present layer wins wholesale)
|
|
476
|
+
*/
|
|
477
|
+
export type ManagedSettingsResolvedSource =
|
|
478
|
+
/** Account/org policy self-fetched from the GitHub managed-settings endpoint (higher authority). */
|
|
479
|
+
"server"
|
|
480
|
+
/** Device-level MDM policy discovered from plist/registry/file (lower authority). */
|
|
481
|
+
| "device"
|
|
482
|
+
/** No managed policy is in force (no layer contributed). */
|
|
483
|
+
| "none";
|
|
474
484
|
/**
|
|
475
485
|
* Exit plan mode action
|
|
476
486
|
*/
|
|
@@ -2943,6 +2953,53 @@ export interface AssistantIntentData {
|
|
|
2943
2953
|
*/
|
|
2944
2954
|
intent: string;
|
|
2945
2955
|
}
|
|
2956
|
+
/**
|
|
2957
|
+
* Session event "assistant.server_tool_progress". Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message
|
|
2958
|
+
*/
|
|
2959
|
+
export interface AssistantServerToolProgressEvent {
|
|
2960
|
+
/**
|
|
2961
|
+
* Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
|
|
2962
|
+
*/
|
|
2963
|
+
agentId?: string;
|
|
2964
|
+
data: AssistantServerToolProgressData;
|
|
2965
|
+
/**
|
|
2966
|
+
* Always true for events that are transient and not persisted to the session event log on disk.
|
|
2967
|
+
*/
|
|
2968
|
+
ephemeral: true;
|
|
2969
|
+
/**
|
|
2970
|
+
* Unique event identifier (UUID v4), generated when the event is emitted
|
|
2971
|
+
*/
|
|
2972
|
+
id: string;
|
|
2973
|
+
/**
|
|
2974
|
+
* ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
|
|
2975
|
+
*/
|
|
2976
|
+
parentId: string | null;
|
|
2977
|
+
/**
|
|
2978
|
+
* ISO 8601 timestamp when the event was created
|
|
2979
|
+
*/
|
|
2980
|
+
timestamp: string;
|
|
2981
|
+
/**
|
|
2982
|
+
* Type discriminator. Always "assistant.server_tool_progress".
|
|
2983
|
+
*/
|
|
2984
|
+
type: "assistant.server_tool_progress";
|
|
2985
|
+
}
|
|
2986
|
+
/**
|
|
2987
|
+
* Live progress signal for a provider-hosted server tool (e.g. hosted web search) while it runs, before the finalized serverTools envelope lands on the terminal assistant.message
|
|
2988
|
+
*/
|
|
2989
|
+
export interface AssistantServerToolProgressData {
|
|
2990
|
+
/**
|
|
2991
|
+
* Kind of hosted server tool that is running. Only `web_search` is emitted today.
|
|
2992
|
+
*/
|
|
2993
|
+
kind: string;
|
|
2994
|
+
/**
|
|
2995
|
+
* Position of the hosted tool call in the response output. Stable across the call's lifecycle events (unlike the provider's per-event item id, which CAPI rotates), so the host keys the live in-progress row on it.
|
|
2996
|
+
*/
|
|
2997
|
+
outputIndex: number;
|
|
2998
|
+
/**
|
|
2999
|
+
* Lifecycle status of the hosted call: `in_progress`, `searching`, or `completed`.
|
|
3000
|
+
*/
|
|
3001
|
+
status: string;
|
|
3002
|
+
}
|
|
2946
3003
|
/**
|
|
2947
3004
|
* Session event "assistant.reasoning". Assistant reasoning content for timeline display with complete thinking text
|
|
2948
3005
|
*/
|
|
@@ -6851,6 +6908,7 @@ export interface McpOauthRequiredEvent {
|
|
|
6851
6908
|
* OAuth authentication request for an MCP server
|
|
6852
6909
|
*/
|
|
6853
6910
|
export interface McpOauthRequiredData {
|
|
6911
|
+
httpResponse?: McpOauthHttpResponse;
|
|
6854
6912
|
reason: McpOauthRequestReason;
|
|
6855
6913
|
/**
|
|
6856
6914
|
* Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest
|
|
@@ -6871,6 +6929,36 @@ export interface McpOauthRequiredData {
|
|
|
6871
6929
|
staticClientConfig?: McpOauthRequiredStaticClientConfig;
|
|
6872
6930
|
wwwAuthenticateParams?: McpOauthWWWAuthenticateParams;
|
|
6873
6931
|
}
|
|
6932
|
+
/**
|
|
6933
|
+
* Raw HTTP response details from the OAuth auth challenge, as observed by the runtime.
|
|
6934
|
+
*/
|
|
6935
|
+
export interface McpOauthHttpResponse {
|
|
6936
|
+
/**
|
|
6937
|
+
* Complete UTF-8 response body for host-specific challenge handling, including an empty string for an empty body. Omitted when the complete body is not valid UTF-8; body read failures fail the HTTP operation rather than exposing a partial response.
|
|
6938
|
+
*/
|
|
6939
|
+
body?: string;
|
|
6940
|
+
/**
|
|
6941
|
+
* HTTP response headers as observed by the runtime. Order and casing are transport-dependent, and duplicate header names may appear multiple times.
|
|
6942
|
+
*/
|
|
6943
|
+
headers: HeaderEntry[];
|
|
6944
|
+
/**
|
|
6945
|
+
* HTTP status code returned with the auth challenge.
|
|
6946
|
+
*/
|
|
6947
|
+
statusCode: number;
|
|
6948
|
+
}
|
|
6949
|
+
/**
|
|
6950
|
+
* Single HTTP header entry as a name/value pair.
|
|
6951
|
+
*/
|
|
6952
|
+
export interface HeaderEntry {
|
|
6953
|
+
/**
|
|
6954
|
+
* HTTP response header name as observed by the runtime.
|
|
6955
|
+
*/
|
|
6956
|
+
name: string;
|
|
6957
|
+
/**
|
|
6958
|
+
* HTTP response header value as observed by the runtime.
|
|
6959
|
+
*/
|
|
6960
|
+
value: string;
|
|
6961
|
+
}
|
|
6874
6962
|
/**
|
|
6875
6963
|
* Static OAuth client configuration, if the server specifies one
|
|
6876
6964
|
*/
|
|
@@ -7587,6 +7675,70 @@ export interface AutoModeResolvedData {
|
|
|
7587
7675
|
predictedLabel?: string;
|
|
7588
7676
|
reasoningBucket?: AutoModeResolvedReasoningBucket;
|
|
7589
7677
|
}
|
|
7678
|
+
/**
|
|
7679
|
+
* Session event "session.managed_settings_resolved". Enterprise managed-settings resolution: the effective managed settings the session applied and where they came from, so SDK clients can show users what is enterprise-managed and by which authority. 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; for a session-independent pull, use the SDK `getManagedSettings()` API, which returns the identical payload. Managed settings have a single authoritative source, so the highest-authority present layer (server > device) wins wholesale; `bypassPermissionsDisabled` is deny-wins across layers. Marked experimental while the managed-settings surface stabilizes.
|
|
7680
|
+
*/
|
|
7681
|
+
/** @experimental */
|
|
7682
|
+
export interface ManagedSettingsResolvedEvent {
|
|
7683
|
+
/**
|
|
7684
|
+
* Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
|
|
7685
|
+
*/
|
|
7686
|
+
agentId?: string;
|
|
7687
|
+
data: ManagedSettingsResolvedData;
|
|
7688
|
+
/**
|
|
7689
|
+
* Always true for events that are transient and not persisted to the session event log on disk.
|
|
7690
|
+
*/
|
|
7691
|
+
ephemeral: true;
|
|
7692
|
+
/**
|
|
7693
|
+
* Unique event identifier (UUID v4), generated when the event is emitted
|
|
7694
|
+
*/
|
|
7695
|
+
id: string;
|
|
7696
|
+
/**
|
|
7697
|
+
* ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
|
|
7698
|
+
*/
|
|
7699
|
+
parentId: string | null;
|
|
7700
|
+
/**
|
|
7701
|
+
* ISO 8601 timestamp when the event was created
|
|
7702
|
+
*/
|
|
7703
|
+
timestamp: string;
|
|
7704
|
+
/**
|
|
7705
|
+
* Type discriminator. Always "session.managed_settings_resolved".
|
|
7706
|
+
*/
|
|
7707
|
+
type: "session.managed_settings_resolved";
|
|
7708
|
+
}
|
|
7709
|
+
/**
|
|
7710
|
+
* Enterprise managed-settings resolution: the effective managed settings the session applied and where they came from, so SDK clients can show users what is enterprise-managed and by which authority. 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; for a session-independent pull, use the SDK `getManagedSettings()` API, which returns the identical payload. Managed settings have a single authoritative source, so the highest-authority present layer (server > device) wins wholesale; `bypassPermissionsDisabled` is deny-wins across layers. Marked experimental while the managed-settings surface stabilizes.
|
|
7711
|
+
*/
|
|
7712
|
+
/** @experimental */
|
|
7713
|
+
export interface ManagedSettingsResolvedData {
|
|
7714
|
+
/**
|
|
7715
|
+
* Whether enterprise policy disables bypass-permissions ("yolo") mode for this session. Deny-wins across layers, and forced on when `failClosed` is true.
|
|
7716
|
+
*/
|
|
7717
|
+
bypassPermissionsDisabled: boolean;
|
|
7718
|
+
/**
|
|
7719
|
+
* Whether the device (MDM/plist/registry/file) managed-settings layer was present
|
|
7720
|
+
*/
|
|
7721
|
+
deviceManaged: boolean;
|
|
7722
|
+
/**
|
|
7723
|
+
* Whether managed policy could not be determined (e.g. a failed server fetch) and the session fell back to the fail-closed restriction. When true, restrictions such as disabling bypass-permissions are enforced even though `settings` may be absent.
|
|
7724
|
+
*/
|
|
7725
|
+
failClosed: boolean;
|
|
7726
|
+
/**
|
|
7727
|
+
* The setting keys under enterprise management in the effective managed settings (e.g. `model`, `enabledPlugins`, `permissions`). Empty when no managed settings are in force.
|
|
7728
|
+
*/
|
|
7729
|
+
managedKeys: string[];
|
|
7730
|
+
/**
|
|
7731
|
+
* Whether the server (account/org) managed-settings layer was present
|
|
7732
|
+
*/
|
|
7733
|
+
serverManaged: boolean;
|
|
7734
|
+
/**
|
|
7735
|
+
* The effective (resolved) managed settings values, so clients can render exactly what is enforced. Absent when no managed policy is in force.
|
|
7736
|
+
*/
|
|
7737
|
+
settings?: {
|
|
7738
|
+
[k: string]: unknown | undefined;
|
|
7739
|
+
};
|
|
7740
|
+
source: ManagedSettingsResolvedSource;
|
|
7741
|
+
}
|
|
7590
7742
|
/**
|
|
7591
7743
|
* Session event "commands.changed". SDK command registration change notification
|
|
7592
7744
|
*/
|
|
@@ -8131,7 +8283,7 @@ export interface McpServerStatusChangedData {
|
|
|
8131
8283
|
status: McpServerStatus;
|
|
8132
8284
|
}
|
|
8133
8285
|
/**
|
|
8134
|
-
* Session event "mcp.tools.list_changed". Payload
|
|
8286
|
+
* Session event "mcp.tools.list_changed". Payload identifying the MCP server associated with a list change.
|
|
8135
8287
|
*/
|
|
8136
8288
|
export interface McpToolsListChangedEvent {
|
|
8137
8289
|
/**
|
|
@@ -8161,7 +8313,7 @@ export interface McpToolsListChangedEvent {
|
|
|
8161
8313
|
type: "mcp.tools.list_changed";
|
|
8162
8314
|
}
|
|
8163
8315
|
/**
|
|
8164
|
-
* Payload
|
|
8316
|
+
* Payload identifying the MCP server associated with a list change.
|
|
8165
8317
|
*/
|
|
8166
8318
|
export interface McpListChangedData {
|
|
8167
8319
|
/**
|
|
@@ -8170,7 +8322,7 @@ export interface McpListChangedData {
|
|
|
8170
8322
|
serverName: string;
|
|
8171
8323
|
}
|
|
8172
8324
|
/**
|
|
8173
|
-
* Session event "mcp.resources.list_changed". Payload
|
|
8325
|
+
* Session event "mcp.resources.list_changed". Payload identifying the MCP server associated with a list change.
|
|
8174
8326
|
*/
|
|
8175
8327
|
export interface McpResourcesListChangedEvent {
|
|
8176
8328
|
/**
|
|
@@ -8200,7 +8352,7 @@ export interface McpResourcesListChangedEvent {
|
|
|
8200
8352
|
type: "mcp.resources.list_changed";
|
|
8201
8353
|
}
|
|
8202
8354
|
/**
|
|
8203
|
-
* Session event "mcp.prompts.list_changed". Payload
|
|
8355
|
+
* Session event "mcp.prompts.list_changed". Payload identifying the MCP server associated with a list change.
|
|
8204
8356
|
*/
|
|
8205
8357
|
export interface McpPromptsListChangedEvent {
|
|
8206
8358
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -471,6 +471,14 @@ export interface Tool<TArgs = unknown> {
|
|
|
471
471
|
* Optional; defaults to `"auto"`.
|
|
472
472
|
*/
|
|
473
473
|
defer?: "auto" | "never";
|
|
474
|
+
/**
|
|
475
|
+
* Opaque, host-defined metadata associated with the tool definition.
|
|
476
|
+
*
|
|
477
|
+
* Keys are namespaced and are not part of the stable public API. Values are
|
|
478
|
+
* not interpreted and may be recognized to inform host-specific behavior.
|
|
479
|
+
* Unknown keys are preserved and round-tripped untouched.
|
|
480
|
+
*/
|
|
481
|
+
metadata?: Record<string, unknown>;
|
|
474
482
|
}
|
|
475
483
|
/**
|
|
476
484
|
* Helper to define a tool with Zod schema and get type inference for the handler.
|
|
@@ -483,6 +491,7 @@ export declare function defineTool<T = unknown>(name: string, config: {
|
|
|
483
491
|
overridesBuiltInTool?: boolean;
|
|
484
492
|
skipPermission?: boolean;
|
|
485
493
|
defer?: "auto" | "never";
|
|
494
|
+
metadata?: Record<string, unknown>;
|
|
486
495
|
}): Tool<T>;
|
|
487
496
|
/**
|
|
488
497
|
* SDK-supplied override for the runtime's built-in tool-search behavior.
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/github/copilot-sdk.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.0.7
|
|
7
|
+
"version": "1.0.7",
|
|
8
8
|
"description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
|
|
9
9
|
"main": "./dist/cjs/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"author": "GitHub",
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@github/copilot": "^1.0.71
|
|
59
|
+
"@github/copilot": "^1.0.71",
|
|
60
60
|
"koffi": "^3.1.0",
|
|
61
61
|
"vscode-jsonrpc": "^8.2.1",
|
|
62
62
|
"zod": "^4.3.6"
|