@github/copilot-sdk 1.0.11 → 1.0.12-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.
@@ -15,7 +15,7 @@ function createServerRpc(connection) {
15
15
  /**
16
16
  * Lists Copilot models available to the authenticated user.
17
17
  *
18
- * @param params Optional GitHub token used to list models for a specific user instead of the global auth context.
18
+ * @param params Optional opaque account selection or compatibility GitHub token used to list models.
19
19
  *
20
20
  * @returns List of Copilot models available to the resolved user, including capabilities and billing metadata.
21
21
  */
@@ -41,9 +41,9 @@ function createServerRpc(connection) {
41
41
  /** @experimental */
42
42
  account: {
43
43
  /**
44
- * Gets Copilot quota usage for the authenticated user or supplied GitHub token.
44
+ * Gets Copilot quota usage for the current or opaquely selected authenticated user.
45
45
  *
46
- * @param params Optional GitHub token used to look up quota for a specific user instead of the global auth context.
46
+ * @param params Optional opaque account selection or compatibility GitHub token used to look up quota.
47
47
  *
48
48
  * @returns Quota usage snapshots for the resolved user, keyed by quota type.
49
49
  */
@@ -140,7 +140,15 @@ function createServerRpc(connection) {
140
140
  *
141
141
  * @returns MCP servers discovered from user, workspace, plugin, and built-in sources.
142
142
  */
143
- discover: async (params) => connection.sendRequest("mcp.discover", params)
143
+ discover: async (params) => connection.sendRequest("mcp.discover", params),
144
+ /**
145
+ * Requests a side-effect-free MCP install plan from a catalog candidate handle or a caller-supplied card. This host-implemented server method is available through SDK/TUI hosts; standalone and C-ABI runtimes whose host does not implement server-method dispatch return JSON-RPC MethodNotFound. A runtime with planning available returns a normalised plan and opaque single-use plan handle; a runtime without it returns the typed planning-unavailable result. A completed plan reports resource identity, provenance, eligible transport choices, the user-scope target, required typed values and secret placeholders, the policy result, the configuration changes installing would make, and whether a reload would be needed. Planning never writes configuration, stores a secret, or reloads MCP servers, so abandoning a plan needs no call and leaves nothing behind.
146
+ *
147
+ * @param params A side-effect-free request for an MCP install plan. Computing a plan never writes configuration, stores a secret, or reloads MCP servers.
148
+ *
149
+ * @returns Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.
150
+ */
151
+ planInstall: async (params) => connection.sendRequest("mcp.planInstall", params)
144
152
  },
145
153
  /** @experimental */
146
154
  extensions: {
@@ -170,6 +178,17 @@ function createServerRpc(connection) {
170
178
  */
171
179
  registerExtensionLaunchProvider: async () => connection.sendRequest("registerExtensionLaunchProvider", {}),
172
180
  /** @experimental */
181
+ catalog: {
182
+ /**
183
+ * Requests a bounded catalog search. This host-implemented server method is available through SDK/TUI hosts; standalone and C-ABI runtimes whose host does not implement server-method dispatch return JSON-RPC MethodNotFound. A runtime with search available returns inert candidate summaries, each with an opaque single-use handle scoped to this runtime instance; a runtime without it returns the typed search-unavailable result. Public authorities may be searched anonymously, while an authority that requires credentials yields the typed authentication-required result. All returned text, URLs, and package metadata are untrusted external data and can never trigger instructions, tools, or installation. Read-only: nothing is installed, configured, or persisted.
184
+ *
185
+ * @param params A bounded catalog search. Both the query length and the result count are capped by the schema so a caller cannot request an unbounded scan.
186
+ *
187
+ * @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
188
+ */
189
+ search: async (params) => connection.sendRequest("catalog.search", params)
190
+ },
191
+ /** @experimental */
173
192
  plugins: {
174
193
  /**
175
194
  * Lists plugins installed in user/global state.
@@ -218,6 +237,15 @@ function createServerRpc(connection) {
218
237
  */
219
238
  disable: async (params) => connection.sendRequest("plugins.disable", params),
220
239
  /** @experimental */
240
+ builtin: {
241
+ /**
242
+ * Replaces this server's trusted built-in plugin directories while no sessions are active.
243
+ *
244
+ * @param params Trusted built-in plugin directories to use for this runtime process.
245
+ */
246
+ set: async (params) => connection.sendRequest("plugins.builtin.set", params)
247
+ },
248
+ /** @experimental */
221
249
  marketplaces: {
222
250
  /**
223
251
  * Lists all registered marketplaces (defaults + user-added).
@@ -268,7 +296,13 @@ function createServerRpc(connection) {
268
296
  *
269
297
  * @param params Skill names to mark as disabled in global configuration, replacing any previous list.
270
298
  */
271
- setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params)
299
+ setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
300
+ /**
301
+ * Atomically adds or removes one skill from the disabled list.
302
+ *
303
+ * @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
304
+ */
305
+ setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
272
306
  },
273
307
  /**
274
308
  * Discovers skills across global and project sources.
@@ -611,7 +645,7 @@ function createInternalServerRpc(connection) {
611
645
  /**
612
646
  * Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper.
613
647
  *
614
- * @param params Parameters for the `server.connect` handshake: an optional connection token and optional connection-level opt-ins (e.g. GitHub telemetry forwarding).
648
+ * @param params Connection-level opt-ins for the `server.connect` handshake. Transport authentication is consumed by the native protocol boundary before dispatch.
615
649
  *
616
650
  * @returns Handshake result reporting the server's protocol version and package version on success.
617
651
  *
@@ -954,6 +988,8 @@ function createSessionRpc(connection, sessionId) {
954
988
  * Sets the current agent interaction mode.
955
989
  *
956
990
  * @param params Agent interaction mode to apply to the session.
991
+ *
992
+ * @returns Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.
957
993
  */
958
994
  set: async (params) => connection.sendRequest("session.mode.set", { sessionId, ...params })
959
995
  },
@@ -1356,6 +1392,12 @@ function createSessionRpc(connection, sessionId) {
1356
1392
  * Reloads MCP server connections for the session.
1357
1393
  */
1358
1394
  reload: async () => connection.sendRequest("session.mcp.reload", { sessionId }),
1395
+ /**
1396
+ * Releases any turns waiting on an in-flight MCP load without cancelling the load, letting the agent proceed while MCP servers finish connecting in the background. No-op when no MCP load is in flight or waiting turns were already released.
1397
+ *
1398
+ * @returns Result of moving in-flight MCP loading to the background.
1399
+ */
1400
+ moveLoadingToBackground: async () => connection.sendRequest("session.mcp.moveLoadingToBackground", { sessionId }),
1359
1401
  /**
1360
1402
  * Runs an MCP sampling inference on behalf of an MCP server.
1361
1403
  *
@@ -1436,6 +1478,14 @@ function createSessionRpc(connection, sessionId) {
1436
1478
  * @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
1437
1479
  */
1438
1480
  login: async (params) => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params }),
1481
+ /**
1482
+ * Passively probes a configured remote MCP server to classify whether OAuth is required or a cached/override token is accepted. Does not start OAuth, emit pending OAuth requests, or mutate MCP connection state.
1483
+ *
1484
+ * @param params Remote MCP server name for a passive OAuth status probe.
1485
+ *
1486
+ * @returns Passive MCP OAuth probe result. `authenticated` means the server accepted the probe request while an OAuth-origin access token was attached; it does not prove the server required or independently validated that token. The probe does not make a second unauthenticated request. Failed is an expected probe-domain outcome; JSON-RPC errors are reserved for API-call failures.
1487
+ */
1488
+ probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { sessionId, ...params }),
1439
1489
  /**
1440
1490
  * Responds to a pending MCP OAuth authorization request by its request id.
1441
1491
  *
@@ -1618,6 +1668,30 @@ function createSessionRpc(connection, sessionId) {
1618
1668
  },
1619
1669
  /** @experimental */
1620
1670
  tools: {
1671
+ /**
1672
+ * Executes one tool from the session's currently offered tool set through the native invocation pipeline.
1673
+ *
1674
+ * @param params A tool name and arguments to execute through the session's native invocation pipeline.
1675
+ *
1676
+ * @returns Canonical result returned by a session tool.
1677
+ */
1678
+ execute: async (params) => connection.sendRequest("session.tools.execute", { sessionId, ...params }),
1679
+ /**
1680
+ * Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.
1681
+ *
1682
+ * @param params Options controlling how Rust-owned built-in tool descriptors are materialized.
1683
+ *
1684
+ * @returns Rust-owned built-in tool descriptors for the session.
1685
+ */
1686
+ getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", { sessionId, ...params }),
1687
+ /**
1688
+ * Projects a completed task_complete tool call into its label-safe session event payload.
1689
+ *
1690
+ * @param params Task-completion tool arguments and final result used to build a label-safe session event payload.
1691
+ *
1692
+ * @returns Task completion notification with summary from the agent
1693
+ */
1694
+ taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", { sessionId, ...params }),
1621
1695
  /**
1622
1696
  * Provides the result for a pending external tool call.
1623
1697
  *
@@ -1638,6 +1712,14 @@ function createSessionRpc(connection, sessionId) {
1638
1712
  * @returns Current lightweight tool metadata snapshot for the session.
1639
1713
  */
1640
1714
  getCurrentMetadata: async () => connection.sendRequest("session.tools.getCurrentMetadata", { sessionId }),
1715
+ /**
1716
+ * Atomically replaces the complete externally implemented tool list supplied by the calling connection. Built-in, MCP/plugin, extension-discovered, subagent, and tools supplied by other connections remain unchanged.
1717
+ *
1718
+ * @param params Complete externally implemented tool list for the calling connection. An empty list removes every tool previously supplied by that connection.
1719
+ *
1720
+ * @returns Empty result after replacing the calling connection's externally implemented tools.
1721
+ */
1722
+ set: async (params) => connection.sendRequest("session.tools.set", { sessionId, ...params }),
1641
1723
  /**
1642
1724
  * Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions.
1643
1725
  *
@@ -1720,7 +1802,7 @@ function createSessionRpc(connection, sessionId) {
1720
1802
  *
1721
1803
  * @param params Transient question to answer without adding it to conversation history.
1722
1804
  *
1723
- * @returns Transient answer generated from current conversation context.
1805
+ * @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.
1724
1806
  */
1725
1807
  ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", { sessionId, ...params }),
1726
1808
  /**
@@ -1827,19 +1909,19 @@ function createSessionRpc(connection, sessionId) {
1827
1909
  */
1828
1910
  setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
1829
1911
  /**
1830
- * Sets the allow-all permission mode for the session. Used by attach-mode clients (e.g. LocalRpcSession's `/allow-all` forwarder) to flip the target session's permission state. The `on` mode swaps in unrestricted path and URL managers and emits `session.permissions_changed` on transition; the `auto` mode keeps normal prompt paths active while attaching LLM safety recommendations. The result returns the authoritative post-mutation state so callers can update their local mirrors without racing the `session.permissions_changed` notification on the same wire.
1912
+ * Sets the permission mode for the session. `manual` follows the normal approval flow, `assisted` attaches LLM safety recommendations, and `allow-all` automatically approves permission requests. The result returns the authoritative post-mutation mode so callers can update local state without racing the `session.permissions_changed` notification.
1831
1913
  *
1832
- * @param params Allow-all mode to apply for the session.
1914
+ * @param params Permission mode to apply for the session.
1833
1915
  *
1834
- * @returns Indicates whether the operation succeeded and reports the post-mutation state.
1916
+ * @returns Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.
1835
1917
  */
1836
- setAllowAll: async (params) => connection.sendRequest("session.permissions.setAllowAll", { sessionId, ...params }),
1918
+ setMode: async (params) => connection.sendRequest("session.permissions.setMode", { sessionId, ...params }),
1837
1919
  /**
1838
- * Returns the current allow-all permission mode for the session.
1920
+ * Returns the current permission mode for the session.
1839
1921
  *
1840
- * @returns Current allow-all permission mode.
1922
+ * @returns Current permission mode.
1841
1923
  */
1842
- getAllowAll: async () => connection.sendRequest("session.permissions.getAllowAll", { sessionId }),
1924
+ getMode: async () => connection.sendRequest("session.permissions.getMode", { sessionId }),
1843
1925
  /**
1844
1926
  * Adds or removes session-scoped or location-scoped permission rules.
1845
1927
  *
@@ -2357,6 +2439,90 @@ function createInternalSessionRpc(connection, sessionId) {
2357
2439
  */
2358
2440
  sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", { sessionId, ...params }),
2359
2441
  /** @experimental */
2442
+ gitHubAuth: {
2443
+ /**
2444
+ * Gets the current authentication information for internal session hosts.
2445
+ *
2446
+ * @returns Current authentication information, or null when no authentication is active.
2447
+ */
2448
+ getCurrentAuthInfo: async () => connection.sendRequest("session.gitHubAuth.getCurrentAuthInfo", { sessionId }),
2449
+ /**
2450
+ * Gets all authentication accounts available to the internal session host.
2451
+ *
2452
+ * @returns Authentication accounts available to the internal session host.
2453
+ */
2454
+ getAllAuthAvailable: async () => connection.sendRequest("session.gitHubAuth.getAllAuthAvailable", { sessionId }),
2455
+ /**
2456
+ * Refreshes Copilot account metadata for the current authentication.
2457
+ *
2458
+ * @returns Current authentication information, or null when no authentication is active.
2459
+ */
2460
+ refreshCopilotUser: async () => connection.sendRequest("session.gitHubAuth.refreshCopilotUser", { sessionId }),
2461
+ /**
2462
+ * Logs in a GitHub user through the internal session host.
2463
+ *
2464
+ * @param params Internal GitHub login parameters.
2465
+ *
2466
+ * @returns Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
2467
+ */
2468
+ login: async (params) => connection.sendRequest("session.gitHubAuth.login", { sessionId, ...params }),
2469
+ /**
2470
+ * Switches the session to another available authentication.
2471
+ *
2472
+ * @param params Parameters for switching the session's active authentication.
2473
+ */
2474
+ switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", { sessionId, ...params }),
2475
+ /**
2476
+ * Logs out the session's current GitHub authentication.
2477
+ *
2478
+ * @returns Whether the current authentication was logged out.
2479
+ */
2480
+ logout: async () => connection.sendRequest("session.gitHubAuth.logout", { sessionId }),
2481
+ /**
2482
+ * Logs out a specific GitHub authentication.
2483
+ *
2484
+ * @param params Parameters identifying a GitHub authentication to log out.
2485
+ *
2486
+ * @returns Whether the requested authentication was logged out.
2487
+ */
2488
+ logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", { sessionId, ...params }),
2489
+ /**
2490
+ * Gets validation errors from the most recent authentication attempt.
2491
+ *
2492
+ * @returns Validation errors from the most recent authentication attempt.
2493
+ */
2494
+ lastAuthErrors: async () => connection.sendRequest("session.gitHubAuth.lastAuthErrors", { sessionId })
2495
+ },
2496
+ /** @experimental */
2497
+ canvas: {
2498
+ /** @experimental */
2499
+ provider: {
2500
+ /**
2501
+ * Registers an internal canvas provider connection and its contributions.
2502
+ *
2503
+ * @param params Internal canvas provider registration parameters.
2504
+ */
2505
+ register: async (params) => connection.sendRequest("session.canvas.provider.register", { sessionId, ...params }),
2506
+ /**
2507
+ * Unregisters an internal canvas provider connection.
2508
+ *
2509
+ * @param params Internal canvas provider unregistration parameters.
2510
+ */
2511
+ unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", { sessionId, ...params })
2512
+ }
2513
+ },
2514
+ /** @experimental */
2515
+ model: {
2516
+ /**
2517
+ * Resolves and applies organization-managed and repository model overlays.
2518
+ *
2519
+ * @param params Managed, repository, and CLI model overrides to overlay onto the session at startup.
2520
+ *
2521
+ * @returns The model identifier active on the session after the switch.
2522
+ */
2523
+ applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", { sessionId, ...params })
2524
+ },
2525
+ /** @experimental */
2360
2526
  mcp: {
2361
2527
  /**
2362
2528
  * Reloads MCP server connections for the session with an explicit host-provided configuration.
@@ -2369,7 +2535,7 @@ function createInternalSessionRpc(connection, sessionId) {
2369
2535
  /**
2370
2536
  * Configures the built-in GitHub MCP server for the session's current auth context.
2371
2537
  *
2372
- * @param params Opaque auth info used to configure GitHub MCP.
2538
+ * @param params Credential-free authentication identity used to configure GitHub MCP.
2373
2539
  *
2374
2540
  * @returns Result of configuring GitHub MCP.
2375
2541
  */
@@ -2388,6 +2554,17 @@ function createInternalSessionRpc(connection, sessionId) {
2388
2554
  unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
2389
2555
  },
2390
2556
  /** @experimental */
2557
+ commands: {
2558
+ /**
2559
+ * Finalizes persistence associated with a client-applied slash-command effect.
2560
+ *
2561
+ * @param params The pending slash-command invocation effect to finalize, plus whether the host applied or cancelled it.
2562
+ *
2563
+ * @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not.
2564
+ */
2565
+ finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", { sessionId, ...params })
2566
+ },
2567
+ /** @experimental */
2391
2568
  settings: {
2392
2569
  /**
2393
2570
  * Returns a redacted snapshot of session runtime settings, with secrets and raw feature flags excluded. Internal: the runtime settings shape is a runtime-internal surface and is deliberately kept out of the public SDK, because consumers should not depend on the runtime's internal settings layout. It remains callable in-process and is expected to be reworked as the runtime internals are consolidated.