@github/copilot-sdk 1.0.2 → 1.0.3
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 +27 -7
- package/dist/cjs/generated/rpc.js +34 -1
- package/dist/client.js +27 -7
- package/dist/generated/rpc.d.ts +328 -17
- package/dist/generated/rpc.js +34 -1
- package/dist/generated/session-events.d.ts +284 -29
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +134 -1
- package/package.json +2 -2
package/dist/generated/rpc.js
CHANGED
|
@@ -281,6 +281,31 @@ function createServerRpc(connection) {
|
|
|
281
281
|
setProvider: async (params) => connection.sendRequest("sessionFs.setProvider", params)
|
|
282
282
|
},
|
|
283
283
|
/** @experimental */
|
|
284
|
+
llmInference: {
|
|
285
|
+
/**
|
|
286
|
+
* Registers an SDK client as the LLM inference callback provider.
|
|
287
|
+
*
|
|
288
|
+
* @returns Indicates whether the calling client was registered as the LLM inference provider.
|
|
289
|
+
*/
|
|
290
|
+
setProvider: async () => connection.sendRequest("llmInference.setProvider", {}),
|
|
291
|
+
/**
|
|
292
|
+
* Delivers the response head (status + headers) for an in-flight request, correlated by the requestId the runtime supplied in httpRequestStart. Must be called exactly once per request before any httpResponseChunk frames.
|
|
293
|
+
*
|
|
294
|
+
* @param params Response head.
|
|
295
|
+
*
|
|
296
|
+
* @returns Whether the start frame was accepted.
|
|
297
|
+
*/
|
|
298
|
+
httpResponseStart: async (params) => connection.sendRequest("llmInference.httpResponseStart", params),
|
|
299
|
+
/**
|
|
300
|
+
* Delivers a body byte range (or a terminal transport error) for an in-flight response, correlated by requestId. Set `end` true on the last chunk. When `error` is set the response terminates with a transport-level failure and the runtime raises an APIConnectionError.
|
|
301
|
+
*
|
|
302
|
+
* @param params A response body chunk or terminal error.
|
|
303
|
+
*
|
|
304
|
+
* @returns Whether the chunk was accepted.
|
|
305
|
+
*/
|
|
306
|
+
httpResponseChunk: async (params) => connection.sendRequest("llmInference.httpResponseChunk", params)
|
|
307
|
+
},
|
|
308
|
+
/** @experimental */
|
|
284
309
|
sessions: {
|
|
285
310
|
/**
|
|
286
311
|
* Creates or resumes a local session and returns the opened session ID.
|
|
@@ -1040,6 +1065,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1040
1065
|
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", { sessionId, ...params }),
|
|
1041
1066
|
/** @experimental */
|
|
1042
1067
|
oauth: {
|
|
1068
|
+
/**
|
|
1069
|
+
* Resolves a pending MCP OAuth request with a host-provided token or cancellation. The pending request is emitted as mcp.oauth_required with the data necessary to authorize the request.
|
|
1070
|
+
*
|
|
1071
|
+
* @param params Pending MCP OAuth request ID and host-provided token or cancellation response.
|
|
1072
|
+
*
|
|
1073
|
+
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1074
|
+
*/
|
|
1075
|
+
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", { sessionId, ...params }),
|
|
1043
1076
|
/**
|
|
1044
1077
|
* Starts OAuth authentication for a remote MCP server.
|
|
1045
1078
|
*
|
|
@@ -1804,7 +1837,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
1804
1837
|
/** @experimental */
|
|
1805
1838
|
oauth: {
|
|
1806
1839
|
/**
|
|
1807
|
-
* Responds to a pending MCP OAuth provider
|
|
1840
|
+
* Responds to a pending MCP OAuth request with an in-process provider. This internal CLI-only API accepts a live OAuthClientProvider instance and cannot be used over the SDK JSON-RPC boundary. Use session.mcp.oauth.handlePendingRequest instead for the public SDK-safe response path.
|
|
1808
1841
|
*
|
|
1809
1842
|
* @param params MCP OAuth request id and optional provider response.
|
|
1810
1843
|
*
|
|
@@ -114,6 +114,14 @@ export type UserMessageAgentMode =
|
|
|
114
114
|
* A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload
|
|
115
115
|
*/
|
|
116
116
|
export type Attachment = AttachmentFile | AttachmentDirectory | AttachmentSelection | AttachmentGitHubReference | AttachmentBlob | AttachmentExtensionContext;
|
|
117
|
+
/**
|
|
118
|
+
* Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable
|
|
119
|
+
*/
|
|
120
|
+
export type OmittedBinaryOmittedReason =
|
|
121
|
+
/** Bytes exceeded the session's inline size limit. */
|
|
122
|
+
"too_large"
|
|
123
|
+
/** The referenced binary asset could not be found (e.g. a truncated log). */
|
|
124
|
+
| "asset_unavailable";
|
|
117
125
|
/**
|
|
118
126
|
* Type of GitHub reference
|
|
119
127
|
*/
|
|
@@ -124,6 +132,22 @@ export type AttachmentGitHubReferenceType =
|
|
|
124
132
|
| "pr"
|
|
125
133
|
/** GitHub discussion reference. */
|
|
126
134
|
| "discussion";
|
|
135
|
+
/**
|
|
136
|
+
* The system that produced a citation.
|
|
137
|
+
*/
|
|
138
|
+
/** @experimental */
|
|
139
|
+
export type CitationProvider =
|
|
140
|
+
/** Citation produced by an Anthropic (Claude) model response. */
|
|
141
|
+
"anthropic"
|
|
142
|
+
/** Citation produced by an OpenAI model response. */
|
|
143
|
+
| "openai"
|
|
144
|
+
/** Citation synthesized client-side by the runtime from tool output. */
|
|
145
|
+
| "client";
|
|
146
|
+
/**
|
|
147
|
+
* Location within a cited source (character, page, or content-block range) that supports a span.
|
|
148
|
+
*/
|
|
149
|
+
/** @experimental */
|
|
150
|
+
export type CitationLocation = CitationLocationChar | CitationLocationPage | CitationLocationBlock;
|
|
127
151
|
/**
|
|
128
152
|
* Tool call type: "function" for standard tool calls, "custom" for grammar-based tool calls. Defaults to "function" when absent.
|
|
129
153
|
*/
|
|
@@ -144,6 +168,14 @@ export type AssistantUsageApiEndpoint =
|
|
|
144
168
|
| "/responses"
|
|
145
169
|
/** WebSocket Responses API endpoint. */
|
|
146
170
|
| "ws:/responses";
|
|
171
|
+
/**
|
|
172
|
+
* For HTTP 400 failures only: whether the response carried a structured CAPI error envelope (structured_error, a deterministic validation failure) or no error body (bodyless, the transient gateway/proxy signature). Absent for non-400 failures.
|
|
173
|
+
*/
|
|
174
|
+
export type ModelCallFailureBadRequestKind =
|
|
175
|
+
/** The 400 response carried no error body (transient gateway/proxy signature). */
|
|
176
|
+
"bodyless"
|
|
177
|
+
/** The 400 response carried a structured CAPI error envelope (deterministic validation failure). */
|
|
178
|
+
| "structured_error";
|
|
147
179
|
/**
|
|
148
180
|
* Where the failed model call originated
|
|
149
181
|
*/
|
|
@@ -185,14 +217,6 @@ export type PersistedBinaryImageType =
|
|
|
185
217
|
"image"
|
|
186
218
|
/** Other binary resource data. */
|
|
187
219
|
| "resource";
|
|
188
|
-
/**
|
|
189
|
-
* Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable
|
|
190
|
-
*/
|
|
191
|
-
export type OmittedBinaryOmittedReason =
|
|
192
|
-
/** Bytes exceeded the session's inline size limit. */
|
|
193
|
-
"too_large"
|
|
194
|
-
/** The referenced binary asset could not be found (e.g. a truncated log). */
|
|
195
|
-
| "asset_unavailable";
|
|
196
220
|
/**
|
|
197
221
|
* Binary result type discriminator. Use "image" for images and "resource" for other binary data.
|
|
198
222
|
*/
|
|
@@ -332,15 +356,13 @@ export type ElicitationCompletedAction =
|
|
|
332
356
|
/** The user dismissed the request. */
|
|
333
357
|
| "cancel";
|
|
334
358
|
/**
|
|
335
|
-
*
|
|
336
|
-
*/
|
|
337
|
-
export type ElicitationCompletedContent = (string | number | boolean | string[]) | undefined;
|
|
338
|
-
/**
|
|
339
|
-
* Source-defined JSON payload for the custom notification
|
|
359
|
+
* How the pending MCP OAuth request was completed
|
|
340
360
|
*/
|
|
341
|
-
export type
|
|
342
|
-
|
|
343
|
-
|
|
361
|
+
export type McpOauthCompletionOutcome =
|
|
362
|
+
/** The request completed with a token-backed OAuth provider. */
|
|
363
|
+
"token"
|
|
364
|
+
/** The request completed without an OAuth provider. */
|
|
365
|
+
| "cancelled";
|
|
344
366
|
/**
|
|
345
367
|
* The user's auto-mode-switch choice
|
|
346
368
|
*/
|
|
@@ -2110,11 +2132,24 @@ export interface UserMessageData {
|
|
|
2110
2132
|
* File attachment
|
|
2111
2133
|
*/
|
|
2112
2134
|
export interface AttachmentFile {
|
|
2135
|
+
/**
|
|
2136
|
+
* Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally.
|
|
2137
|
+
*/
|
|
2138
|
+
assetId?: string;
|
|
2139
|
+
/**
|
|
2140
|
+
* Internal: decoded byte length of the attachment's model-facing bytes. Absent externally.
|
|
2141
|
+
*/
|
|
2142
|
+
byteLength?: number;
|
|
2113
2143
|
/**
|
|
2114
2144
|
* User-facing display name for the attachment
|
|
2115
2145
|
*/
|
|
2116
2146
|
displayName: string;
|
|
2117
2147
|
lineRange?: AttachmentFileLineRange;
|
|
2148
|
+
/**
|
|
2149
|
+
* Internal: MIME type of the file's model-facing bytes (post-resize for images). Set when the file's bytes are interned to an asset. Absent externally.
|
|
2150
|
+
*/
|
|
2151
|
+
mimeType?: string;
|
|
2152
|
+
omittedReason?: OmittedBinaryOmittedReason;
|
|
2118
2153
|
/**
|
|
2119
2154
|
* Absolute file path
|
|
2120
2155
|
*/
|
|
@@ -2240,9 +2275,17 @@ export interface AttachmentGitHubReference {
|
|
|
2240
2275
|
*/
|
|
2241
2276
|
export interface AttachmentBlob {
|
|
2242
2277
|
/**
|
|
2243
|
-
*
|
|
2278
|
+
* Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. "sha256:..."). Absent externally.
|
|
2244
2279
|
*/
|
|
2245
|
-
|
|
2280
|
+
assetId?: string;
|
|
2281
|
+
/**
|
|
2282
|
+
* Internal: decoded byte length of the attachment's model-facing bytes. Absent externally.
|
|
2283
|
+
*/
|
|
2284
|
+
byteLength?: number;
|
|
2285
|
+
/**
|
|
2286
|
+
* Base64-encoded content. Present on input and for external consumers; replaced by an internal `assetId` reference in persisted events when interned to a content-addressed asset.
|
|
2287
|
+
*/
|
|
2288
|
+
data?: string;
|
|
2246
2289
|
/**
|
|
2247
2290
|
* User-facing display name for the attachment
|
|
2248
2291
|
*/
|
|
@@ -2251,6 +2294,7 @@ export interface AttachmentBlob {
|
|
|
2251
2294
|
* MIME type of the inline data
|
|
2252
2295
|
*/
|
|
2253
2296
|
mimeType: string;
|
|
2297
|
+
omittedReason?: OmittedBinaryOmittedReason;
|
|
2254
2298
|
/**
|
|
2255
2299
|
* Attachment type discriminator
|
|
2256
2300
|
*/
|
|
@@ -2571,6 +2615,12 @@ export interface AssistantMessageData {
|
|
|
2571
2615
|
* Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances.
|
|
2572
2616
|
*/
|
|
2573
2617
|
apiCallId?: string;
|
|
2618
|
+
/**
|
|
2619
|
+
* Provider-agnostic citations linking spans of this message's content to the sources that support them. Experimental; only populated when citation emission is enabled.
|
|
2620
|
+
*
|
|
2621
|
+
* @experimental
|
|
2622
|
+
*/
|
|
2623
|
+
citations?: Citations;
|
|
2574
2624
|
/**
|
|
2575
2625
|
* The assistant's text response content
|
|
2576
2626
|
*/
|
|
@@ -2630,6 +2680,136 @@ export interface AssistantMessageData {
|
|
|
2630
2680
|
*/
|
|
2631
2681
|
turnId?: string;
|
|
2632
2682
|
}
|
|
2683
|
+
/**
|
|
2684
|
+
* Provider-agnostic citations linking spans of the assistant's response to their supporting sources.
|
|
2685
|
+
*/
|
|
2686
|
+
/** @experimental */
|
|
2687
|
+
export interface Citations {
|
|
2688
|
+
/**
|
|
2689
|
+
* Deduplicated set of sources referenced by the citation spans.
|
|
2690
|
+
*/
|
|
2691
|
+
sources: CitationSource[];
|
|
2692
|
+
/**
|
|
2693
|
+
* Spans of generated text annotated with the sources that support them.
|
|
2694
|
+
*/
|
|
2695
|
+
spans: CitationSpan[];
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* A source that backs one or more cited spans in the assistant's response.
|
|
2699
|
+
*/
|
|
2700
|
+
/** @experimental */
|
|
2701
|
+
export interface CitationSource {
|
|
2702
|
+
/**
|
|
2703
|
+
* Stable, turn-scoped identifier for this source, referenced by CitationReference.sourceId.
|
|
2704
|
+
*/
|
|
2705
|
+
id: string;
|
|
2706
|
+
/**
|
|
2707
|
+
* File path relative to the agent's workspace root, when the source is a file.
|
|
2708
|
+
*/
|
|
2709
|
+
path?: string;
|
|
2710
|
+
provider: CitationProvider;
|
|
2711
|
+
/**
|
|
2712
|
+
* Human-readable title of the source.
|
|
2713
|
+
*/
|
|
2714
|
+
title?: string;
|
|
2715
|
+
/**
|
|
2716
|
+
* URL of the source, when it is a web resource.
|
|
2717
|
+
*/
|
|
2718
|
+
url?: string;
|
|
2719
|
+
}
|
|
2720
|
+
/**
|
|
2721
|
+
* A contiguous span of generated assistant text and the source references that support it.
|
|
2722
|
+
*/
|
|
2723
|
+
/** @experimental */
|
|
2724
|
+
export interface CitationSpan {
|
|
2725
|
+
/**
|
|
2726
|
+
* End offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, exclusive).
|
|
2727
|
+
*/
|
|
2728
|
+
endIndex: number;
|
|
2729
|
+
/**
|
|
2730
|
+
* The sources that support this span of generated text.
|
|
2731
|
+
*/
|
|
2732
|
+
references: CitationReference[];
|
|
2733
|
+
/**
|
|
2734
|
+
* Start offset of the cited span within the final assistant message content (UTF-16 code units, zero-based, inclusive).
|
|
2735
|
+
*/
|
|
2736
|
+
startIndex: number;
|
|
2737
|
+
}
|
|
2738
|
+
/**
|
|
2739
|
+
* A single citation occurrence linking a span of generated text to a supporting source.
|
|
2740
|
+
*/
|
|
2741
|
+
/** @experimental */
|
|
2742
|
+
export interface CitationReference {
|
|
2743
|
+
/**
|
|
2744
|
+
* The exact text from the source that supports the cited span, when provided by the model.
|
|
2745
|
+
*/
|
|
2746
|
+
citedText?: string;
|
|
2747
|
+
location?: CitationLocation;
|
|
2748
|
+
/**
|
|
2749
|
+
* Provider-native citation correlation data (e.g. Anthropic search_result_index / document_index), passed through opaquely for debugging and forward compatibility.
|
|
2750
|
+
*/
|
|
2751
|
+
providerMetadata?: {
|
|
2752
|
+
[k: string]: unknown | undefined;
|
|
2753
|
+
};
|
|
2754
|
+
/**
|
|
2755
|
+
* Identifier of the CitationSource this reference points to (CitationSource.id).
|
|
2756
|
+
*/
|
|
2757
|
+
sourceId: string;
|
|
2758
|
+
}
|
|
2759
|
+
/**
|
|
2760
|
+
* A character range within the source's text content.
|
|
2761
|
+
*/
|
|
2762
|
+
/** @experimental */
|
|
2763
|
+
export interface CitationLocationChar {
|
|
2764
|
+
/**
|
|
2765
|
+
* End character offset within the source text (zero-based, exclusive).
|
|
2766
|
+
*/
|
|
2767
|
+
endIndex: number;
|
|
2768
|
+
/**
|
|
2769
|
+
* Start character offset within the source text (zero-based, inclusive).
|
|
2770
|
+
*/
|
|
2771
|
+
startIndex: number;
|
|
2772
|
+
/**
|
|
2773
|
+
* Citation location type discriminator
|
|
2774
|
+
*/
|
|
2775
|
+
type: "char";
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* A page range within a paginated source document.
|
|
2779
|
+
*/
|
|
2780
|
+
/** @experimental */
|
|
2781
|
+
export interface CitationLocationPage {
|
|
2782
|
+
/**
|
|
2783
|
+
* Last page number of the cited range (inclusive).
|
|
2784
|
+
*/
|
|
2785
|
+
endPage: number;
|
|
2786
|
+
/**
|
|
2787
|
+
* First page number of the cited range.
|
|
2788
|
+
*/
|
|
2789
|
+
startPage: number;
|
|
2790
|
+
/**
|
|
2791
|
+
* Citation location type discriminator
|
|
2792
|
+
*/
|
|
2793
|
+
type: "page";
|
|
2794
|
+
}
|
|
2795
|
+
/**
|
|
2796
|
+
* A content-block range within a structured source document.
|
|
2797
|
+
*/
|
|
2798
|
+
/** @experimental */
|
|
2799
|
+
export interface CitationLocationBlock {
|
|
2800
|
+
/**
|
|
2801
|
+
* Index of the last content block of the cited range (zero-based, exclusive).
|
|
2802
|
+
*/
|
|
2803
|
+
endBlock: number;
|
|
2804
|
+
/**
|
|
2805
|
+
* Index of the first content block of the cited range (zero-based, inclusive).
|
|
2806
|
+
*/
|
|
2807
|
+
startBlock: number;
|
|
2808
|
+
/**
|
|
2809
|
+
* Citation location type discriminator
|
|
2810
|
+
*/
|
|
2811
|
+
type: "block";
|
|
2812
|
+
}
|
|
2633
2813
|
/**
|
|
2634
2814
|
* Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping
|
|
2635
2815
|
*/
|
|
@@ -2989,14 +3169,23 @@ export interface ModelCallFailureData {
|
|
|
2989
3169
|
* Completion ID from the model provider (e.g., chatcmpl-abc123)
|
|
2990
3170
|
*/
|
|
2991
3171
|
apiCallId?: string;
|
|
3172
|
+
badRequestKind?: ModelCallFailureBadRequestKind;
|
|
2992
3173
|
/**
|
|
2993
3174
|
* Duration of the failed API call in milliseconds
|
|
2994
3175
|
*/
|
|
2995
3176
|
durationMs?: number;
|
|
3177
|
+
/**
|
|
3178
|
+
* For HTTP 400 failures only: the `code` from the CAPI error envelope (e.g. 'model_max_prompt_tokens_exceeded') identifying which deterministic validation failure occurred. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures.
|
|
3179
|
+
*/
|
|
3180
|
+
errorCode?: string;
|
|
2996
3181
|
/**
|
|
2997
3182
|
* Raw provider/runtime error message for restricted telemetry
|
|
2998
3183
|
*/
|
|
2999
3184
|
errorMessage?: string;
|
|
3185
|
+
/**
|
|
3186
|
+
* For HTTP 400 failures only: the `type` from the CAPI error envelope (e.g. 'websocket_error'), a coarser companion to errorCode for envelopes that carry no code. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures.
|
|
3187
|
+
*/
|
|
3188
|
+
errorType?: string;
|
|
3000
3189
|
/**
|
|
3001
3190
|
* What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls
|
|
3002
3191
|
*/
|
|
@@ -3398,6 +3587,12 @@ export interface ToolExecutionCompleteResult {
|
|
|
3398
3587
|
* @experimental
|
|
3399
3588
|
*/
|
|
3400
3589
|
binaryResultsForLlm?: PersistedBinaryResult[];
|
|
3590
|
+
/**
|
|
3591
|
+
* Provider-neutral source material this tool makes available to the model as citable content. Persisted so it survives session resume. Experimental.
|
|
3592
|
+
*
|
|
3593
|
+
* @experimental
|
|
3594
|
+
*/
|
|
3595
|
+
citableSources?: CitableSource[];
|
|
3401
3596
|
/**
|
|
3402
3597
|
* Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency
|
|
3403
3598
|
*/
|
|
@@ -3497,6 +3692,32 @@ export interface BinaryAssetReference {
|
|
|
3497
3692
|
mimeType: string;
|
|
3498
3693
|
type: BinaryAssetReferenceType;
|
|
3499
3694
|
}
|
|
3695
|
+
/**
|
|
3696
|
+
* A source supplied by a tool that should be made available to the model as citable content.
|
|
3697
|
+
*/
|
|
3698
|
+
/** @experimental */
|
|
3699
|
+
export interface CitableSource {
|
|
3700
|
+
/**
|
|
3701
|
+
* The source text made available to the model as citable content.
|
|
3702
|
+
*/
|
|
3703
|
+
content: string;
|
|
3704
|
+
/**
|
|
3705
|
+
* Stable identifier for this source within the tool result. Used for deduplication and may be used by future provider integrations to correlate response citations back to the originating source.
|
|
3706
|
+
*/
|
|
3707
|
+
id: string;
|
|
3708
|
+
/**
|
|
3709
|
+
* File path relative to the agent's workspace root, when the source is a file.
|
|
3710
|
+
*/
|
|
3711
|
+
path?: string;
|
|
3712
|
+
/**
|
|
3713
|
+
* Human-readable title of the source.
|
|
3714
|
+
*/
|
|
3715
|
+
title?: string;
|
|
3716
|
+
/**
|
|
3717
|
+
* URL of the source, when it is a web resource.
|
|
3718
|
+
*/
|
|
3719
|
+
url?: string;
|
|
3720
|
+
}
|
|
3500
3721
|
/**
|
|
3501
3722
|
* Plain text content block
|
|
3502
3723
|
*/
|
|
@@ -3723,25 +3944,21 @@ export interface ToolExecutionCompleteUIResourceMetaUIPermissions {
|
|
|
3723
3944
|
* Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type.
|
|
3724
3945
|
*/
|
|
3725
3946
|
export interface ToolExecutionCompleteUIResourceMetaUIPermissionsCamera {
|
|
3726
|
-
[k: string]: unknown | undefined;
|
|
3727
3947
|
}
|
|
3728
3948
|
/**
|
|
3729
3949
|
* Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type.
|
|
3730
3950
|
*/
|
|
3731
3951
|
export interface ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite {
|
|
3732
|
-
[k: string]: unknown | undefined;
|
|
3733
3952
|
}
|
|
3734
3953
|
/**
|
|
3735
3954
|
* Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type.
|
|
3736
3955
|
*/
|
|
3737
3956
|
export interface ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation {
|
|
3738
|
-
[k: string]: unknown | undefined;
|
|
3739
3957
|
}
|
|
3740
3958
|
/**
|
|
3741
3959
|
* Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type.
|
|
3742
3960
|
*/
|
|
3743
3961
|
export interface ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone {
|
|
3744
|
-
[k: string]: unknown | undefined;
|
|
3745
3962
|
}
|
|
3746
3963
|
/**
|
|
3747
3964
|
* Tool definition metadata, present for MCP tools with MCP Apps support
|
|
@@ -5012,7 +5229,12 @@ export interface PermissionPromptRequestRead {
|
|
|
5012
5229
|
* MCP tool invocation permission prompt
|
|
5013
5230
|
*/
|
|
5014
5231
|
export interface PermissionPromptRequestMcp {
|
|
5015
|
-
|
|
5232
|
+
/**
|
|
5233
|
+
* Arguments to pass to the MCP tool
|
|
5234
|
+
*/
|
|
5235
|
+
args?: {
|
|
5236
|
+
[k: string]: unknown | undefined;
|
|
5237
|
+
};
|
|
5016
5238
|
/**
|
|
5017
5239
|
* Prompt kind discriminator
|
|
5018
5240
|
*/
|
|
@@ -5630,7 +5852,6 @@ export interface ElicitationRequestedData {
|
|
|
5630
5852
|
* URL to open in the user's browser (url mode only)
|
|
5631
5853
|
*/
|
|
5632
5854
|
url?: string;
|
|
5633
|
-
[k: string]: unknown | undefined;
|
|
5634
5855
|
}
|
|
5635
5856
|
/**
|
|
5636
5857
|
* JSON Schema describing the form fields to present to the user (form mode only)
|
|
@@ -5697,6 +5918,12 @@ export interface ElicitationCompletedData {
|
|
|
5697
5918
|
*/
|
|
5698
5919
|
requestId: string;
|
|
5699
5920
|
}
|
|
5921
|
+
/**
|
|
5922
|
+
* Schema for the `ElicitationCompletedContent` type.
|
|
5923
|
+
*/
|
|
5924
|
+
export interface ElicitationCompletedContent {
|
|
5925
|
+
[k: string]: unknown | undefined;
|
|
5926
|
+
}
|
|
5700
5927
|
/**
|
|
5701
5928
|
* Session event "sampling.requested". Sampling request from an MCP server; contains the server name and a requestId for correlation
|
|
5702
5929
|
*/
|
|
@@ -5734,7 +5961,9 @@ export interface SamplingRequestedData {
|
|
|
5734
5961
|
/**
|
|
5735
5962
|
* The JSON-RPC request ID from the MCP protocol
|
|
5736
5963
|
*/
|
|
5737
|
-
mcpRequestId:
|
|
5964
|
+
mcpRequestId: {
|
|
5965
|
+
[k: string]: unknown | undefined;
|
|
5966
|
+
};
|
|
5738
5967
|
/**
|
|
5739
5968
|
* Unique identifier for this sampling request; used to respond via session.respondToSampling()
|
|
5740
5969
|
*/
|
|
@@ -5743,7 +5972,6 @@ export interface SamplingRequestedData {
|
|
|
5743
5972
|
* Name of the MCP server that initiated the sampling request
|
|
5744
5973
|
*/
|
|
5745
5974
|
serverName: string;
|
|
5746
|
-
[k: string]: unknown | undefined;
|
|
5747
5975
|
}
|
|
5748
5976
|
/**
|
|
5749
5977
|
* Session event "sampling.completed". Sampling request completion notification signaling UI dismissal
|
|
@@ -5819,9 +6047,13 @@ export interface McpOauthRequiredEvent {
|
|
|
5819
6047
|
*/
|
|
5820
6048
|
export interface McpOauthRequiredData {
|
|
5821
6049
|
/**
|
|
5822
|
-
* Unique identifier for this OAuth request; used to respond via session.
|
|
6050
|
+
* Unique identifier for this OAuth request; used to respond via session.mcp.oauth.handlePendingRequest
|
|
5823
6051
|
*/
|
|
5824
6052
|
requestId: string;
|
|
6053
|
+
/**
|
|
6054
|
+
* Raw OAuth protected-resource metadata document fetched for the MCP server, if available
|
|
6055
|
+
*/
|
|
6056
|
+
resourceMetadata?: string;
|
|
5825
6057
|
/**
|
|
5826
6058
|
* Display name of the MCP server that requires OAuth
|
|
5827
6059
|
*/
|
|
@@ -5831,6 +6063,7 @@ export interface McpOauthRequiredData {
|
|
|
5831
6063
|
*/
|
|
5832
6064
|
serverUrl: string;
|
|
5833
6065
|
staticClientConfig?: McpOauthRequiredStaticClientConfig;
|
|
6066
|
+
wwwAuthenticateParams?: McpOauthWWWAuthenticateParams;
|
|
5834
6067
|
}
|
|
5835
6068
|
/**
|
|
5836
6069
|
* Static OAuth client configuration, if the server specifies one
|
|
@@ -5849,6 +6082,23 @@ export interface McpOauthRequiredStaticClientConfig {
|
|
|
5849
6082
|
*/
|
|
5850
6083
|
publicClient?: boolean;
|
|
5851
6084
|
}
|
|
6085
|
+
/**
|
|
6086
|
+
* OAuth WWW-Authenticate parameters parsed from an MCP auth challenge
|
|
6087
|
+
*/
|
|
6088
|
+
export interface McpOauthWWWAuthenticateParams {
|
|
6089
|
+
/**
|
|
6090
|
+
* OAuth error from the WWW-Authenticate error parameter, if present
|
|
6091
|
+
*/
|
|
6092
|
+
error?: string;
|
|
6093
|
+
/**
|
|
6094
|
+
* Protected resource metadata URL from the WWW-Authenticate resource_metadata parameter
|
|
6095
|
+
*/
|
|
6096
|
+
resourceMetadataUrl: string;
|
|
6097
|
+
/**
|
|
6098
|
+
* Requested OAuth scopes from the WWW-Authenticate scope parameter, if present
|
|
6099
|
+
*/
|
|
6100
|
+
scope?: string;
|
|
6101
|
+
}
|
|
5852
6102
|
/**
|
|
5853
6103
|
* Session event "mcp.oauth_completed". MCP OAuth request completion notification
|
|
5854
6104
|
*/
|
|
@@ -5883,6 +6133,7 @@ export interface McpOauthCompletedEvent {
|
|
|
5883
6133
|
* MCP OAuth request completion notification
|
|
5884
6134
|
*/
|
|
5885
6135
|
export interface McpOauthCompletedData {
|
|
6136
|
+
outcome: McpOauthCompletionOutcome;
|
|
5886
6137
|
/**
|
|
5887
6138
|
* Request ID of the resolved OAuth request
|
|
5888
6139
|
*/
|
|
@@ -5937,6 +6188,12 @@ export interface CustomNotificationData {
|
|
|
5937
6188
|
*/
|
|
5938
6189
|
version?: number;
|
|
5939
6190
|
}
|
|
6191
|
+
/**
|
|
6192
|
+
* Source-defined JSON payload for the custom notification
|
|
6193
|
+
*/
|
|
6194
|
+
export interface CustomNotificationPayload {
|
|
6195
|
+
[k: string]: unknown | undefined;
|
|
6196
|
+
}
|
|
5940
6197
|
/**
|
|
5941
6198
|
* Optional source-defined string identifiers describing the payload subject
|
|
5942
6199
|
*/
|
|
@@ -7196,7 +7453,6 @@ export interface McpAppToolCallCompleteError {
|
|
|
7196
7453
|
*/
|
|
7197
7454
|
export interface McpAppToolCallCompleteToolMeta {
|
|
7198
7455
|
ui?: McpAppToolCallCompleteToolMetaUI;
|
|
7199
|
-
[k: string]: unknown | undefined;
|
|
7200
7456
|
}
|
|
7201
7457
|
/**
|
|
7202
7458
|
* Schema for the `McpAppToolCallCompleteToolMetaUI` type.
|
|
@@ -7210,5 +7466,4 @@ export interface McpAppToolCallCompleteToolMetaUI {
|
|
|
7210
7466
|
* Tool visibility per SEP-1865 (typically a subset of `["model","app"]`)
|
|
7211
7467
|
*/
|
|
7212
7468
|
visibility?: string[];
|
|
7213
|
-
[k: string]: unknown | undefined;
|
|
7214
7469
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export { CopilotSession, type AssistantMessageEvent } from "./session.js";
|
|
|
10
10
|
export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
|
|
11
11
|
export { defineTool, approveAll, convertMcpCallToolResult, createSessionFsAdapter, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
|
|
12
12
|
export type * from "./generated/session-events.js";
|
|
13
|
-
export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, StdioRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolTelemetry, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
|
13
|
+
export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, StdioRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, ProviderModelConfig, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolTelemetry, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|