@microsoft/copilot-sdk 0.0.0-stage → 2.0.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2531 -2
- package/dist/canvas.d.ts +135 -0
- package/dist/canvas.js +51 -0
- package/dist/cjs/canvas.js +77 -0
- package/dist/cjs/cliVersion.js +31 -0
- package/dist/cjs/client.js +3941 -0
- package/dist/cjs/copilotRequestHandler.js +815 -0
- package/dist/cjs/decisions.js +139 -0
- package/dist/cjs/entra.js +83 -0
- package/dist/cjs/extension.js +79 -0
- package/dist/cjs/ffiRuntimeHost.js +400 -0
- package/dist/cjs/generated/lifecycle-diagnostics.js +16 -0
- package/dist/cjs/generated/rpc.js +5883 -0
- package/dist/cjs/generated/session-events.js +16 -0
- package/dist/cjs/host.js +83 -0
- package/dist/cjs/index.js +100 -0
- package/dist/cjs/installationConfirmation.js +98 -0
- package/dist/cjs/jsonrpcTypes.js +41 -0
- package/dist/cjs/localModelJson.js +103 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/providerConfiguration.js +39 -0
- package/dist/cjs/rpcCancellation.js +49 -0
- package/dist/cjs/runtimeArtifacts.js +255 -0
- package/dist/cjs/schema.js +40 -0
- package/dist/cjs/sdkProtocolVersion.js +33 -0
- package/dist/cjs/session.js +2764 -0
- package/dist/cjs/sessionFsProvider.js +283 -0
- package/dist/cjs/taskAnalyticsJson.js +47 -0
- package/dist/cjs/telemetry.js +35 -0
- package/dist/cjs/toolSet.js +107 -0
- package/dist/cjs/types.js +204 -0
- package/dist/cjs/workflow.js +278 -0
- package/dist/cliVersion.d.ts +2 -0
- package/dist/cliVersion.js +6 -0
- package/dist/client.d.ts +576 -0
- package/dist/client.js +3924 -0
- package/dist/copilotRequestHandler.d.ts +91 -0
- package/dist/copilotRequestHandler.js +787 -0
- package/dist/decisions.d.ts +65 -0
- package/dist/decisions.js +113 -0
- package/dist/entra.d.ts +3 -0
- package/dist/entra.js +59 -0
- package/dist/extension.d.ts +69 -0
- package/dist/extension.js +59 -0
- package/dist/ffiRuntimeHost.d.ts +44 -0
- package/dist/ffiRuntimeHost.js +366 -0
- package/dist/generated/lifecycle-diagnostics.d.ts +232 -0
- package/dist/generated/lifecycle-diagnostics.js +0 -0
- package/dist/generated/rpc.d.ts +47706 -0
- package/dist/generated/rpc.js +5854 -0
- package/dist/generated/session-events.d.ts +17349 -0
- package/dist/generated/session-events.js +0 -0
- package/dist/host.d.ts +143 -0
- package/dist/host.js +59 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +74 -0
- package/dist/installationConfirmation.d.ts +19 -0
- package/dist/installationConfirmation.js +74 -0
- package/dist/jsonrpcTypes.d.ts +16 -0
- package/dist/jsonrpcTypes.js +17 -0
- package/dist/localModelJson.d.ts +1 -0
- package/dist/localModelJson.js +69 -0
- package/dist/providerConfiguration.d.ts +3 -0
- package/dist/providerConfiguration.js +15 -0
- package/dist/rpcCancellation.d.ts +3 -0
- package/dist/rpcCancellation.js +25 -0
- package/dist/runtimeArtifacts.d.ts +18 -0
- package/dist/runtimeArtifacts.js +233 -0
- package/dist/schema.d.ts +4 -0
- package/dist/schema.js +14 -0
- package/dist/sdkProtocolVersion.d.ts +10 -0
- package/dist/sdkProtocolVersion.js +8 -0
- package/dist/session.d.ts +524 -0
- package/dist/session.js +2751 -0
- package/dist/sessionFsProvider.d.ts +130 -0
- package/dist/sessionFsProvider.js +257 -0
- package/dist/taskAnalyticsJson.d.ts +8 -0
- package/dist/taskAnalyticsJson.js +12 -0
- package/dist/telemetry.d.ts +14 -0
- package/dist/telemetry.js +11 -0
- package/dist/toolSet.d.ts +75 -0
- package/dist/toolSet.js +82 -0
- package/dist/types.d.ts +3864 -0
- package/dist/types.js +169 -0
- package/dist/workflow.d.ts +413 -0
- package/dist/workflow.js +248 -0
- package/docs/agent-author.md +372 -0
- package/docs/examples.md +747 -0
- package/docs/extensions.md +121 -0
- package/docs/workflows.md +303 -0
- package/package.json +135 -5
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { LlmInferenceHeaders } from "./generated/rpc.js";
|
|
2
|
+
declare const kSuppressCloseOnDispose: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* Per-request context handed to every {@link CopilotRequestHandler} hook.
|
|
5
|
+
*
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
export interface CopilotRequestContext {
|
|
9
|
+
readonly requestId: string;
|
|
10
|
+
readonly sessionId?: string;
|
|
11
|
+
readonly agentId?: string;
|
|
12
|
+
/** Runtime-provided logical invocation identity, unchanged across physical retries. */
|
|
13
|
+
readonly agentInvocationId?: string;
|
|
14
|
+
readonly parentAgentId?: string;
|
|
15
|
+
readonly interactionType?: string;
|
|
16
|
+
readonly transport: "http" | "websocket";
|
|
17
|
+
url: string;
|
|
18
|
+
headers: LlmInferenceHeaders;
|
|
19
|
+
readonly signal: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Terminal status for a callback-owned WebSocket connection.
|
|
23
|
+
*
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
26
|
+
export declare class CopilotWebSocketCloseStatus {
|
|
27
|
+
readonly description?: string | undefined;
|
|
28
|
+
readonly errorCode?: string | undefined;
|
|
29
|
+
readonly error?: Error | undefined;
|
|
30
|
+
static readonly normalClosure: CopilotWebSocketCloseStatus;
|
|
31
|
+
constructor(description?: string | undefined, errorCode?: string | undefined, error?: Error | undefined);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Lower-level WebSocket handler with no upstream connection.
|
|
35
|
+
*
|
|
36
|
+
* This is the abstract base shared by all WebSocket handlers. It does not open
|
|
37
|
+
* or forward to any upstream server on its own — subclass it directly only when
|
|
38
|
+
* you want to service a fully synthetic connection yourself (e.g. answer the
|
|
39
|
+
* runtime without any real backend). For the common case of mutating and
|
|
40
|
+
* forwarding traffic to the real upstream, subclass {@link CopilotWebSocketForwarder}
|
|
41
|
+
* instead, which connects upstream and forwards by default.
|
|
42
|
+
*
|
|
43
|
+
* @experimental
|
|
44
|
+
*/
|
|
45
|
+
export declare abstract class CopilotWebSocketHandler implements AsyncDisposable {
|
|
46
|
+
#private;
|
|
47
|
+
[kSuppressCloseOnDispose]: boolean;
|
|
48
|
+
protected readonly context: CopilotRequestContext;
|
|
49
|
+
protected constructor(context: CopilotRequestContext);
|
|
50
|
+
sendResponseMessage(data: string | Uint8Array): Promise<void>;
|
|
51
|
+
close(status?: CopilotWebSocketCloseStatus): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Forward a runtime message. When supplied by the adapter, ctx carries this
|
|
54
|
+
* message's invocation identity, not the identity that opened the connection.
|
|
55
|
+
*/
|
|
56
|
+
abstract sendRequestMessage(data: string | Uint8Array, ctx?: CopilotRequestContext): Promise<void> | void;
|
|
57
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* WebSocket handler that connects to the real upstream and forwards traffic by
|
|
61
|
+
* default. This is the type returned by the default
|
|
62
|
+
* {@link CopilotRequestHandler.openWebSocket}.
|
|
63
|
+
*
|
|
64
|
+
* Override nothing to get full pass-through. To mutate traffic, subclass this
|
|
65
|
+
* type and override a message hook, then call `super` to keep forwarding to the
|
|
66
|
+
* upstream. (Subclassing {@link CopilotWebSocketHandler} instead would drop
|
|
67
|
+
* forwarding entirely.)
|
|
68
|
+
*
|
|
69
|
+
* @experimental
|
|
70
|
+
*/
|
|
71
|
+
export declare class CopilotWebSocketForwarder extends CopilotWebSocketHandler {
|
|
72
|
+
#private;
|
|
73
|
+
constructor(context: CopilotRequestContext);
|
|
74
|
+
sendRequestMessage(data: string | Uint8Array, _ctx?: CopilotRequestContext): void;
|
|
75
|
+
close(status?: CopilotWebSocketCloseStatus): Promise<void>;
|
|
76
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Base class for SDK consumers who want to observe or mutate the outbound
|
|
80
|
+
* model-layer requests the runtime issues (for both CAPI and BYOK providers).
|
|
81
|
+
* Subclass and override {@link sendRequest} or {@link openWebSocket}; an
|
|
82
|
+
* instance that overrides nothing is a transparent pass-through.
|
|
83
|
+
*
|
|
84
|
+
* @experimental
|
|
85
|
+
*/
|
|
86
|
+
export declare class CopilotRequestHandler {
|
|
87
|
+
#private;
|
|
88
|
+
protected sendRequest(request: Request, ctx: CopilotRequestContext): Promise<Response>;
|
|
89
|
+
protected openWebSocket(ctx: CopilotRequestContext): Promise<CopilotWebSocketHandler>;
|
|
90
|
+
}
|
|
91
|
+
export {};
|