@github/copilot-sdk 1.0.0-beta.6 → 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.
@@ -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.
@@ -712,6 +749,53 @@ function createSessionRpc(connection, sessionId) {
712
749
  * @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
713
750
  */
714
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 })
715
799
  }
716
800
  },
717
801
  /** @experimental */