@github/copilot-sdk 1.0.0-beta.5 → 1.0.0-beta.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.
@@ -38,6 +38,16 @@ function createServerRpc(connection) {
38
38
  */
39
39
  getQuota: async (params) => connection.sendRequest("account.getQuota", params)
40
40
  },
41
+ secrets: {
42
+ /**
43
+ * Registers secret values for redaction in session logs and exports. The SDK calls this to inject dynamically generated secret values (e.g., OIDC tokens).
44
+ *
45
+ * @param params Secret values to add to the redaction filter.
46
+ *
47
+ * @returns Confirmation that the secret values were registered.
48
+ */
49
+ addFilterValues: async (params) => connection.sendRequest("secrets.addFilterValues", params)
50
+ },
41
51
  mcp: {
42
52
  config: {
43
53
  /**
@@ -335,6 +345,43 @@ function createSessionRpc(connection, sessionId) {
335
345
  setCredentials: async (params) => connection.sendRequest("session.auth.setCredentials", { sessionId, ...params })
336
346
  },
337
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 */
338
385
  model: {
339
386
  /**
340
387
  * Gets the currently selected model for the session.
@@ -702,6 +749,53 @@ function createSessionRpc(connection, sessionId) {
702
749
  * @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
703
750
  */
704
751
  login: async (params) => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params })
752
+ },
753
+ /** @experimental */
754
+ apps: {
755
+ /**
756
+ * Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability.
757
+ *
758
+ * @param params MCP server and resource URI to fetch.
759
+ *
760
+ * @returns Resource contents returned by the MCP server.
761
+ */
762
+ readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", { sessionId, ...params }),
763
+ /**
764
+ * 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"`.
765
+ *
766
+ * @param params MCP server to list app-callable tools for.
767
+ *
768
+ * @returns App-callable tools from the named MCP server.
769
+ */
770
+ listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", { sessionId, ...params }),
771
+ /**
772
+ * 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`.
773
+ *
774
+ * @param params MCP server, tool name, and arguments to invoke from an MCP App view.
775
+ *
776
+ * @returns Standard MCP CallToolResult
777
+ */
778
+ callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", { sessionId, ...params }),
779
+ /**
780
+ * 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.
781
+ *
782
+ * @param params Host context to advertise to MCP App guests.
783
+ */
784
+ setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", { sessionId, ...params }),
785
+ /**
786
+ * Read the current host context advertised to MCP App guests.
787
+ *
788
+ * @returns Current host context advertised to MCP App guests.
789
+ */
790
+ getHostContext: async () => connection.sendRequest("session.mcp.apps.getHostContext", { sessionId }),
791
+ /**
792
+ * 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.
793
+ *
794
+ * @param params MCP server to diagnose MCP Apps wiring for.
795
+ *
796
+ * @returns Diagnostic snapshot of MCP Apps wiring for the named server.
797
+ */
798
+ diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", { sessionId, ...params })
705
799
  }
706
800
  },
707
801
  /** @experimental */
@@ -1142,9 +1236,11 @@ function createSessionRpc(connection, sessionId) {
1142
1236
  /**
1143
1237
  * Compacts the session history to reduce context usage.
1144
1238
  *
1239
+ * @param params Optional compaction parameters.
1240
+ *
1145
1241
  * @returns Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
1146
1242
  */
1147
- compact: async () => connection.sendRequest("session.history.compact", { sessionId }),
1243
+ compact: async (params) => connection.sendRequest("session.history.compact", { sessionId, ...params }),
1148
1244
  /**
1149
1245
  * Truncates persisted session history to a specific event.
1150
1246
  *