@github/copilot-sdk-win32-x64 1.0.15-preview.2 → 1.0.15-preview.4
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/copilot-sdk/client.d.ts +1 -0
- package/copilot-sdk/docs/extensions.md +0 -1
- package/copilot-sdk/docs/workflows.md +2 -4
- package/copilot-sdk/extension.d.ts +10 -24
- package/copilot-sdk/extension.js +454 -853
- package/copilot-sdk/generated/rpc.d.ts +4455 -2788
- package/copilot-sdk/generated/session-events.d.ts +211 -120
- package/copilot-sdk/index.d.ts +2 -4
- package/copilot-sdk/index.js +454 -849
- package/copilot-sdk/installationConfirmation.d.ts +19 -0
- package/copilot-sdk/session.d.ts +3 -25
- package/copilot-sdk/types.d.ts +31 -66
- package/copilot-sdk/workflow.d.ts +5 -2
- package/package.json +1 -1
- package/prebuilds/win32-x64/OneAuthInterop.dll +0 -0
- package/prebuilds/win32-x64/copilot-runtime.exe +0 -0
- package/prebuilds/win32-x64/runtime.node +2 -2
- package/ripgrep/bin/win32-x64/rg.exe +0 -0
- package/schemas/api.schema.json +11116 -8682
- package/schemas/session-events.schema.json +998 -818
- package/tgrep/bin/win32-x64/tgrep.exe +0 -0
- package/copilot-sdk/docs/factories.md +0 -296
- package/copilot-sdk/docs/factory-patterns.md +0 -194
- package/copilot-sdk/factory.d.ts +0 -327
- package/prebuilds/win32-x64/msal-node-runtime.node +0 -0
- package/prebuilds/win32-x64/msalruntime.dll +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CancellationToken, type MessageConnection } from "vscode-jsonrpc/node.js";
|
|
2
|
+
import type { InstallationConfirmationRequest, InstallationDecision, InstallationsConfirmResult } from "./generated/rpc.js";
|
|
3
|
+
/** The `installations.confirm` receiver, invoked with the transport's request cancellation. */
|
|
4
|
+
export interface InstallationConfirmationReceiver {
|
|
5
|
+
confirm(request: InstallationConfirmationRequest, token: CancellationToken): Promise<InstallationsConfirmResult>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Collects an explicit human decision for the complete runtime review.
|
|
9
|
+
* Match operationId and policySessionId to the exact action registered by the host
|
|
10
|
+
* before displaying it. Refuse unknown actions or incomplete reviews; never infer
|
|
11
|
+
* authority from the current session or a global pending slot.
|
|
12
|
+
*
|
|
13
|
+
* The SDK echoes the original challenge and fingerprint. Separately spawned UI
|
|
14
|
+
* work must observe the token to retire itself when the request or connection ends.
|
|
15
|
+
* Registering this callback does not enable installation capabilities.
|
|
16
|
+
* @experimental
|
|
17
|
+
*/
|
|
18
|
+
export type InstallationConfirmationHandler = (request: InstallationConfirmationRequest, token: CancellationToken) => InstallationDecision | Promise<InstallationDecision>;
|
|
19
|
+
export declare function createInstallationConfirmationAdapter(connection: MessageConnection, handler: InstallationConfirmationHandler): InstallationConfirmationReceiver;
|
package/copilot-sdk/session.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ 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
4
|
import type { MessageOptions, ResponseSchema, ContextTier, ReasoningEffort, ReasoningSummary, AutoTier, ModelCapabilitiesOverride, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, TypedSessionEventHandler } from "./types.js";
|
|
5
|
-
import { type SessionFactoryApi } from "./factory.js";
|
|
6
5
|
import { type SessionWorkflowApi } from "./workflow.js";
|
|
7
6
|
/** Assistant message event - the final response from the assistant. */
|
|
8
7
|
export type AssistantMessageEvent = Extract<SessionEvent, {
|
|
@@ -49,8 +48,6 @@ export declare class CopilotSession {
|
|
|
49
48
|
private canvases;
|
|
50
49
|
private bearerTokenProviders;
|
|
51
50
|
private commandHandlers;
|
|
52
|
-
private factories;
|
|
53
|
-
private factoryAbortControllers;
|
|
54
51
|
private workflows;
|
|
55
52
|
private workflowAbortControllers;
|
|
56
53
|
private permissionHandler?;
|
|
@@ -72,32 +69,12 @@ export declare class CopilotSession {
|
|
|
72
69
|
private disconnecting;
|
|
73
70
|
private onDisconnected?;
|
|
74
71
|
/**
|
|
75
|
-
* Friendly
|
|
72
|
+
* Friendly workflow API for running registered workflows by name or handle.
|
|
76
73
|
*
|
|
77
|
-
* @experimental Part of the experimental
|
|
74
|
+
* @experimental Part of the experimental Dynamic Workflows surface and may
|
|
78
75
|
* change or be removed in future SDK or CLI releases.
|
|
79
76
|
*/
|
|
80
|
-
readonly factory: SessionFactoryApi;
|
|
81
77
|
readonly workflow: SessionWorkflowApi;
|
|
82
|
-
/**
|
|
83
|
-
* Resolve a start/resume envelope into the terminal envelope callers expect.
|
|
84
|
-
*
|
|
85
|
-
* The CLI may answer `session.factory.run` and `session.factory.resume`
|
|
86
|
-
* before the run settles, so a non-terminal envelope is followed by a wait
|
|
87
|
-
* on the run's terminal state.
|
|
88
|
-
*/
|
|
89
|
-
private settleFactoryRun;
|
|
90
|
-
/**
|
|
91
|
-
* Resolve when a factory run reaches a terminal status.
|
|
92
|
-
*
|
|
93
|
-
* The subscription is installed *before* the first read so a transition
|
|
94
|
-
* landing between the two cannot be missed, and re-reads are serialized so
|
|
95
|
-
* overlapping invalidation events cannot interleave — the run's revision
|
|
96
|
-
* advances once per operation, so a burst of events is common and must
|
|
97
|
-
* collapse into a single in-flight read. A bounded periodic re-read keeps a
|
|
98
|
-
* dropped invalidation from leaving the wait pending forever.
|
|
99
|
-
*/
|
|
100
|
-
private waitForFactoryRun;
|
|
101
78
|
private settleWorkflowRun;
|
|
102
79
|
/**
|
|
103
80
|
* Resolve when a workflow run reaches a terminal status.
|
|
@@ -167,6 +144,7 @@ export declare class CopilotSession {
|
|
|
167
144
|
* assistant has finished processing the message.
|
|
168
145
|
*
|
|
169
146
|
* Events are still delivered to handlers registered via {@link on} while waiting.
|
|
147
|
+
* Sub-agent events with a non-empty `agentId` do not complete the wait or supply its reply.
|
|
170
148
|
* With a schema as the second argument, returns its parsed, validated result.
|
|
171
149
|
* Structured waits select only root-agent output originating from this send;
|
|
172
150
|
* other queued work may delay session.idle but cannot replace the result.
|
package/copilot-sdk/types.d.ts
CHANGED
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
import type { Canvas } from "./canvas.js";
|
|
5
5
|
import type { SessionFsProvider } from "./sessionFsProvider.js";
|
|
6
6
|
import type { CopilotRequestHandler } from "./copilotRequestHandler.js";
|
|
7
|
+
import type { InstallationConfirmationHandler } from "./installationConfirmation.js";
|
|
8
|
+
export type { InstallationConfirmationHandler } from "./installationConfirmation.js";
|
|
7
9
|
import type { AttachmentExtensionContext as GeneratedExtensionContextAttachment, AutoTier, PermissionRequest as GeneratedPermissionRequest, PermissionRequestedData as GeneratedPermissionRequestedData, PermissionRequestedEvent as GeneratedPermissionRequestedEvent, ReasoningSummary, SessionLimitsConfig, SessionEvent as GeneratedSessionEvent } from "./generated/session-events.js";
|
|
8
10
|
import type { CopilotSession } from "./session.js";
|
|
9
|
-
import type {
|
|
10
|
-
import type { ExtensionLaunchProviderHandler as GeneratedExtensionLaunchProvider, GitHubTokenAcquireRequest, GitHubTokenAcquireResult, GitHubTelemetryNotification, ModelBillingTokenPrices, OpenCanvasInstance, RemoteSessionMode, CurrentToolMetadata } from "./generated/rpc.js";
|
|
11
|
+
import type { JsonValue } from "./workflow.js";
|
|
12
|
+
import type { ExtensionLaunchProviderHandler as GeneratedExtensionLaunchProvider, GitHubTokenAcquireRequest, GitHubTokenAcquireResult, GitHubTelemetryNotification, ModelBillingTokenPrices, DiagnosticsConfiguration, OpenCanvasInstance, RemoteSessionMode, CurrentToolMetadata } from "./generated/rpc.js";
|
|
11
13
|
import type { ToolSet } from "./toolSet.js";
|
|
12
14
|
export type { RemoteSessionMode } from "./generated/rpc.js";
|
|
13
15
|
export type { CurrentToolMetadata } from "./generated/rpc.js";
|
|
14
|
-
export type { ExtensionLaunchProfile, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, } from "./generated/rpc.js";
|
|
16
|
+
export type { ConnectorAccountRequest, ConnectorAvailability, ConnectorCapabilities, ConnectorCatalogEntry, ConnectorCatalogResult, ConnectorCatalogStatus, ConnectorConnectRequest, ConnectorConnectResult, ConnectorContinueRequest, ConnectorDisconnectResult, ConnectorMcpStatus, ConnectorReconcileRequest, ConnectorRuntimeStatus, ConnectorStatus, ExtensionLaunchProfile, ExtensionLaunchProviderResolveRequest, ExtensionLaunchProviderResolveResult, GitHubTokenAcquireReason, GitHubTokenAcquireResult, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, InstallationConfirmationRequest, InstallationConfirmationResponse, InstallationDecision, InstallationReview, McpInstallationReview, } from "./generated/rpc.js";
|
|
15
17
|
/**
|
|
16
18
|
* Arguments passed to a session's {@link GitHubTokenProvider}.
|
|
17
19
|
*
|
|
@@ -290,6 +292,12 @@ export interface CopilotClientOptions {
|
|
|
290
292
|
* @experimental
|
|
291
293
|
*/
|
|
292
294
|
extensionLaunchProvider?: ExtensionLaunchProvider;
|
|
295
|
+
/**
|
|
296
|
+
* Connection-global human review for experimental installation operations.
|
|
297
|
+
* Does not register or enable installation capabilities on the runtime.
|
|
298
|
+
* @experimental
|
|
299
|
+
*/
|
|
300
|
+
installationConfirmationHandler?: InstallationConfirmationHandler;
|
|
293
301
|
/**
|
|
294
302
|
* Log level for the Copilot runtime. When omitted, the runtime uses its
|
|
295
303
|
* own default (currently `"info"`).
|
|
@@ -1622,6 +1630,8 @@ export interface McpAuthStaticClientConfig {
|
|
|
1622
1630
|
grantType?: "client_credentials";
|
|
1623
1631
|
/** Whether this is a public OAuth client. */
|
|
1624
1632
|
publicClient?: boolean;
|
|
1633
|
+
/** Configured OAuth scope string used when the server challenge omits scope. */
|
|
1634
|
+
scope?: string;
|
|
1625
1635
|
}
|
|
1626
1636
|
/** MCP OAuth request that the SDK host can satisfy with a host-acquired token. */
|
|
1627
1637
|
export interface McpAuthRequest {
|
|
@@ -1690,69 +1700,6 @@ export interface CanvasProviderIdentity {
|
|
|
1690
1700
|
/** Optional display name surfaced as the canvas extension name. */
|
|
1691
1701
|
name?: string;
|
|
1692
1702
|
}
|
|
1693
|
-
/**
|
|
1694
|
-
* Static resource ceilings declared by a factory before it runs.
|
|
1695
|
-
*
|
|
1696
|
-
* @experimental Part of the experimental Agent Factories surface and may
|
|
1697
|
-
* change or be removed in future SDK or CLI releases.
|
|
1698
|
-
*/
|
|
1699
|
-
export interface FactoryLimits {
|
|
1700
|
-
/** Maximum number of factory subagents that may run concurrently. Must be positive when present. */
|
|
1701
|
-
maxConcurrentSubagents?: number;
|
|
1702
|
-
/** Maximum total number of factory subagents that may be spawned. Must be positive when present. */
|
|
1703
|
-
maxTotalSubagents?: number;
|
|
1704
|
-
/** Maximum AI credits consumed by factory subagents and descendants. This post-paid ceiling is soft. */
|
|
1705
|
-
maxAiCredits?: number;
|
|
1706
|
-
/**
|
|
1707
|
-
* Maximum accumulated active-execution time, in seconds. Active execution includes the entire extension body,
|
|
1708
|
-
* subprocess waits, queued-agent waits, and sleeps. The limit is armed from the remaining headroom when a run
|
|
1709
|
-
* resumes; time between attempts is not counted. Must be finite and positive when present.
|
|
1710
|
-
*/
|
|
1711
|
-
timeoutSeconds?: number;
|
|
1712
|
-
}
|
|
1713
|
-
/**
|
|
1714
|
-
* Registration metadata for an extension-authored factory.
|
|
1715
|
-
*
|
|
1716
|
-
* @experimental Part of the experimental Agent Factories surface and may
|
|
1717
|
-
* change or be removed in future SDK or CLI releases.
|
|
1718
|
-
*/
|
|
1719
|
-
export interface FactoryMeta {
|
|
1720
|
-
/** Stable factory name used for invocation. */
|
|
1721
|
-
name: string;
|
|
1722
|
-
/** Human-readable factory description. */
|
|
1723
|
-
description: string;
|
|
1724
|
-
/** Display metadata for the progress phases the factory may report. */
|
|
1725
|
-
phases: Array<{
|
|
1726
|
-
title: string;
|
|
1727
|
-
detail?: string;
|
|
1728
|
-
}>;
|
|
1729
|
-
/**
|
|
1730
|
-
* Optional declared shape of the arguments this factory expects as `ctx.args`.
|
|
1731
|
-
*
|
|
1732
|
-
* Declaring one is strongly recommended for any factory that reads `ctx.args`.
|
|
1733
|
-
* When the model invokes the factory through the `run_factory` tool, the CLI
|
|
1734
|
-
* validates `args` against this declaration **before** the run starts, so a
|
|
1735
|
-
* malformed call is rejected with a correction hint and retried without ever
|
|
1736
|
-
* creating a run row, prompting the user for permission, or spending credits. A
|
|
1737
|
-
* factory that declares nothing is never validated: a malformed call starts,
|
|
1738
|
-
* takes an approval, spends credits, and then fails inside the factory body.
|
|
1739
|
-
* `factories_manage` with `operation: "inspect"` reports the declared shape so an
|
|
1740
|
-
* agent can read it before invoking.
|
|
1741
|
-
*
|
|
1742
|
-
* This covers the model's `run_factory` path only. `session.factory.run(...)` is
|
|
1743
|
-
* not validated against the declaration, so a factory should still check
|
|
1744
|
-
* `ctx.args` rather than assume the declared shape held.
|
|
1745
|
-
*
|
|
1746
|
-
* Enforcement covers structure — types, required properties, and enum/const
|
|
1747
|
-
* values. Finer constraints such as `minLength`, `pattern`, and
|
|
1748
|
-
* `additionalProperties` are recorded in the declaration but not enforced. See
|
|
1749
|
-
* {@link FactoryJsonSchema} for the accepted subset. A declaration outside that
|
|
1750
|
-
* subset is rejected at registration.
|
|
1751
|
-
*/
|
|
1752
|
-
argsSchema?: FactoryJsonSchema;
|
|
1753
|
-
/** Optional resource ceilings presented to the user before execution. */
|
|
1754
|
-
limits?: FactoryLimits;
|
|
1755
|
-
}
|
|
1756
1703
|
/**
|
|
1757
1704
|
* Provider-scoped options for the Copilot API (CAPI).
|
|
1758
1705
|
*
|
|
@@ -1922,6 +1869,16 @@ export interface SessionConfigBase {
|
|
|
1922
1869
|
* the session to the long-context tier; omit or use "default" otherwise.
|
|
1923
1870
|
*/
|
|
1924
1871
|
contextTier?: ContextTier;
|
|
1872
|
+
/**
|
|
1873
|
+
* Enables session-scoped MCP diagnostic capture at the requested level.
|
|
1874
|
+
*
|
|
1875
|
+
* Diagnostics are off by default. At `"debug"` and `"trace"` levels, entries
|
|
1876
|
+
* can contain MCP payloads, tool arguments, paths, and server stderr. Do not
|
|
1877
|
+
* upload entries as telemetry or export them without deliberate host action.
|
|
1878
|
+
* Omit this option when resuming a resident session to preserve its current
|
|
1879
|
+
* diagnostic level.
|
|
1880
|
+
*/
|
|
1881
|
+
diagnostics?: DiagnosticsConfiguration;
|
|
1925
1882
|
/** Per-property overrides for model capabilities, deep-merged over runtime defaults. */
|
|
1926
1883
|
modelCapabilities?: ModelCapabilitiesOverride;
|
|
1927
1884
|
/**
|
|
@@ -2465,6 +2422,14 @@ export interface SessionConfig extends SessionConfigBase {
|
|
|
2465
2422
|
* Optional custom session ID. If not provided, the server generates one.
|
|
2466
2423
|
*/
|
|
2467
2424
|
sessionId?: string;
|
|
2425
|
+
/**
|
|
2426
|
+
* Invalidates the process-wide custom-instruction discovery cache before
|
|
2427
|
+
* creating this session. Use when instruction files changed in the same runtime.
|
|
2428
|
+
* Other sessions in this runtime may observe updated instructions on later turns
|
|
2429
|
+
* or discovery. This does not watch files or enable disabled instruction loading.
|
|
2430
|
+
* @default false
|
|
2431
|
+
*/
|
|
2432
|
+
refreshCustomInstructions?: boolean;
|
|
2468
2433
|
/**
|
|
2469
2434
|
* Creates a remote session in the cloud instead of a local session.
|
|
2470
2435
|
* The optional repository is associated with the cloud session.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { WorkflowGetRunProgressRequest, WorkflowListRunsRequest, WorkflowListRunsResult, WorkflowProgressPage, WorkflowRunDetail, WorkflowRunResult, WorkflowRunStatus, WorkflowRunSummary } from "./generated/rpc.js";
|
|
2
2
|
import type { ContextTier } from "./generated/session-events.js";
|
|
3
3
|
import type { CopilotSession } from "./session.js";
|
|
4
|
-
import type { JsonValue } from "./factory.js";
|
|
5
4
|
export type { WorkflowRunResult };
|
|
5
|
+
/** A value that can be represented losslessly on the SDK JSON wire. */
|
|
6
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
7
|
+
[key: string]: JsonValue;
|
|
8
|
+
};
|
|
6
9
|
export type { WorkflowAgentSummary, WorkflowPhaseStatus, WorkflowPhaseObservation, WorkflowProgressLine, WorkflowProgressPage, WorkflowRunDetail, WorkflowRunStatus, WorkflowRunSummary, } from "./generated/rpc.js";
|
|
7
10
|
/**
|
|
8
11
|
* Options for paging durable workflow runs.
|
|
@@ -311,7 +314,7 @@ export interface SessionWorkflowApi {
|
|
|
311
314
|
* snapshot: resuming the same durable run can later change the envelope
|
|
312
315
|
* returned by {@link SessionWorkflowApi.getRun}.
|
|
313
316
|
*
|
|
314
|
-
* This watches the runtime's `
|
|
317
|
+
* This watches the runtime's `workflow.run_updated` event and
|
|
315
318
|
* periodically re-reads the durable envelope so a missed event cannot
|
|
316
319
|
* leave the wait hanging. Pass a `signal` to stop waiting; aborting rejects
|
|
317
320
|
* and has no effect on the run itself, which keeps executing. Use
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/prebuilds/win32-x64/runtime.node
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 95447328 bytes
|
|
4
|
+
sha256: 75207d2db5bd75087ed6648c446f5fcb987e4a0212de3a2ed8e12801f77453c1
|
|
Binary file
|