@github/copilot-sdk 1.0.0-beta.6 → 1.0.0-beta.8
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 +3 -7
- package/dist/canvas.d.ts +103 -0
- package/dist/canvas.js +49 -0
- package/dist/cjs/canvas.js +75 -0
- package/dist/cjs/client.js +16 -126
- package/dist/cjs/extension.js +7 -0
- package/dist/cjs/generated/rpc.js +109 -2
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/session.js +84 -32
- package/dist/cjs/types.js +6 -3
- package/dist/client.d.ts +1 -26
- package/dist/client.js +17 -127
- package/dist/extension.d.ts +3 -1
- package/dist/extension.js +8 -0
- package/dist/generated/rpc.d.ts +1282 -248
- package/dist/generated/rpc.js +109 -2
- package/dist/generated/session-events.d.ts +485 -88
- package/dist/index.d.ts +3 -2
- package/dist/index.js +10 -2
- package/dist/session.d.ts +10 -0
- package/dist/session.js +84 -31
- package/dist/types.d.ts +52 -9
- package/dist/types.js +5 -2
- package/package.json +2 -2
package/dist/generated/rpc.js
CHANGED
|
@@ -249,7 +249,7 @@ function createServerRpc(connection) {
|
|
|
249
249
|
*
|
|
250
250
|
* @param params Session metadata records to enrich with summary and context information.
|
|
251
251
|
*
|
|
252
|
-
* @returns The
|
|
252
|
+
* @returns The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted.
|
|
253
253
|
*/
|
|
254
254
|
enrichMetadata: async (params) => connection.sendRequest("sessions.enrichMetadata", params),
|
|
255
255
|
/**
|
|
@@ -345,6 +345,43 @@ function createSessionRpc(connection, sessionId) {
|
|
|
345
345
|
setCredentials: async (params) => connection.sendRequest("session.auth.setCredentials", { sessionId, ...params })
|
|
346
346
|
},
|
|
347
347
|
/** @experimental */
|
|
348
|
+
canvas: {
|
|
349
|
+
/**
|
|
350
|
+
* Lists canvases declared for the session.
|
|
351
|
+
*
|
|
352
|
+
* @returns Declared canvases available in this session.
|
|
353
|
+
*/
|
|
354
|
+
list: async () => connection.sendRequest("session.canvas.list", { sessionId }),
|
|
355
|
+
/**
|
|
356
|
+
* Lists currently open canvas instances for the live session.
|
|
357
|
+
*
|
|
358
|
+
* @returns Live open-canvas snapshot.
|
|
359
|
+
*/
|
|
360
|
+
listOpen: async () => connection.sendRequest("session.canvas.listOpen", { sessionId }),
|
|
361
|
+
/**
|
|
362
|
+
* Opens or focuses a canvas instance.
|
|
363
|
+
*
|
|
364
|
+
* @param params Canvas open parameters.
|
|
365
|
+
*
|
|
366
|
+
* @returns Open canvas instance snapshot.
|
|
367
|
+
*/
|
|
368
|
+
open: async (params) => connection.sendRequest("session.canvas.open", { sessionId, ...params }),
|
|
369
|
+
/**
|
|
370
|
+
* Closes an open canvas instance.
|
|
371
|
+
*
|
|
372
|
+
* @param params Canvas close parameters.
|
|
373
|
+
*/
|
|
374
|
+
close: async (params) => connection.sendRequest("session.canvas.close", { sessionId, ...params }),
|
|
375
|
+
/**
|
|
376
|
+
* Invokes an action on an open canvas instance.
|
|
377
|
+
*
|
|
378
|
+
* @param params Canvas action invocation parameters.
|
|
379
|
+
*
|
|
380
|
+
* @returns Canvas action invocation result.
|
|
381
|
+
*/
|
|
382
|
+
invokeAction: async (params) => connection.sendRequest("session.canvas.invokeAction", { sessionId, ...params })
|
|
383
|
+
},
|
|
384
|
+
/** @experimental */
|
|
348
385
|
model: {
|
|
349
386
|
/**
|
|
350
387
|
* Gets the currently selected model for the session.
|
|
@@ -475,7 +512,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
475
512
|
*
|
|
476
513
|
* @returns Descriptor for the saved paste file, or null when the workspace is unavailable.
|
|
477
514
|
*/
|
|
478
|
-
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", { sessionId, ...params })
|
|
515
|
+
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", { sessionId, ...params }),
|
|
516
|
+
/**
|
|
517
|
+
* Computes a diff for the session workspace.
|
|
518
|
+
*
|
|
519
|
+
* @param params Parameters for computing a workspace diff.
|
|
520
|
+
*
|
|
521
|
+
* @returns Workspace diff result for the requested mode.
|
|
522
|
+
*/
|
|
523
|
+
diff: async (params) => connection.sendRequest("session.workspaces.diff", { sessionId, ...params })
|
|
479
524
|
},
|
|
480
525
|
/** @experimental */
|
|
481
526
|
instructions: {
|
|
@@ -712,6 +757,53 @@ function createSessionRpc(connection, sessionId) {
|
|
|
712
757
|
* @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
|
|
713
758
|
*/
|
|
714
759
|
login: async (params) => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params })
|
|
760
|
+
},
|
|
761
|
+
/** @experimental */
|
|
762
|
+
apps: {
|
|
763
|
+
/**
|
|
764
|
+
* Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability.
|
|
765
|
+
*
|
|
766
|
+
* @param params MCP server and resource URI to fetch.
|
|
767
|
+
*
|
|
768
|
+
* @returns Resource contents returned by the MCP server.
|
|
769
|
+
*/
|
|
770
|
+
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", { sessionId, ...params }),
|
|
771
|
+
/**
|
|
772
|
+
* List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`.
|
|
773
|
+
*
|
|
774
|
+
* @param params MCP server to list app-callable tools for.
|
|
775
|
+
*
|
|
776
|
+
* @returns App-callable tools from the named MCP server.
|
|
777
|
+
*/
|
|
778
|
+
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", { sessionId, ...params }),
|
|
779
|
+
/**
|
|
780
|
+
* Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`.
|
|
781
|
+
*
|
|
782
|
+
* @param params MCP server, tool name, and arguments to invoke from an MCP App view.
|
|
783
|
+
*
|
|
784
|
+
* @returns Standard MCP CallToolResult
|
|
785
|
+
*/
|
|
786
|
+
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", { sessionId, ...params }),
|
|
787
|
+
/**
|
|
788
|
+
* Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI.
|
|
789
|
+
*
|
|
790
|
+
* @param params Host context to advertise to MCP App guests.
|
|
791
|
+
*/
|
|
792
|
+
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", { sessionId, ...params }),
|
|
793
|
+
/**
|
|
794
|
+
* Read the current host context advertised to MCP App guests.
|
|
795
|
+
*
|
|
796
|
+
* @returns Current host context advertised to MCP App guests.
|
|
797
|
+
*/
|
|
798
|
+
getHostContext: async () => connection.sendRequest("session.mcp.apps.getHostContext", { sessionId }),
|
|
799
|
+
/**
|
|
800
|
+
* Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated.
|
|
801
|
+
*
|
|
802
|
+
* @param params MCP server to diagnose MCP Apps wiring for.
|
|
803
|
+
*
|
|
804
|
+
* @returns Diagnostic snapshot of MCP Apps wiring for the named server.
|
|
805
|
+
*/
|
|
806
|
+
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", { sessionId, ...params })
|
|
715
807
|
}
|
|
716
808
|
},
|
|
717
809
|
/** @experimental */
|
|
@@ -1348,6 +1440,21 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
1348
1440
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
1349
1441
|
return handler.sqliteExists(params);
|
|
1350
1442
|
});
|
|
1443
|
+
connection.onRequest("canvas.open", async (params) => {
|
|
1444
|
+
const handler = getHandlers(params.sessionId).canvas;
|
|
1445
|
+
if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`);
|
|
1446
|
+
return handler.open(params);
|
|
1447
|
+
});
|
|
1448
|
+
connection.onRequest("canvas.close", async (params) => {
|
|
1449
|
+
const handler = getHandlers(params.sessionId).canvas;
|
|
1450
|
+
if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`);
|
|
1451
|
+
return handler.close(params);
|
|
1452
|
+
});
|
|
1453
|
+
connection.onRequest("canvas.invokeAction", async (params) => {
|
|
1454
|
+
const handler = getHandlers(params.sessionId).canvas;
|
|
1455
|
+
if (!handler) throw new Error(`No canvas handler registered for session: ${params.sessionId}`);
|
|
1456
|
+
return handler.invokeAction(params);
|
|
1457
|
+
});
|
|
1351
1458
|
}
|
|
1352
1459
|
export {
|
|
1353
1460
|
createInternalServerRpc,
|