@github/copilot-sdk 1.0.6-preview.1 → 1.0.7-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.
- package/dist/cjs/client.js +9 -5
- package/dist/cjs/generated/rpc.js +64 -28
- package/dist/client.js +9 -5
- package/dist/generated/rpc.d.ts +893 -155
- package/dist/generated/rpc.js +64 -28
- package/dist/generated/session-events.d.ts +373 -84
- package/dist/types.d.ts +7 -0
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -1055,7 +1055,8 @@ class CopilotClient {
|
|
|
1055
1055
|
gitHubToken: config.gitHubToken,
|
|
1056
1056
|
remoteSession: config.remoteSession,
|
|
1057
1057
|
cloud: config.cloud,
|
|
1058
|
-
expAssignments: config.expAssignments
|
|
1058
|
+
expAssignments: config.expAssignments,
|
|
1059
|
+
enableManagedSettings: config.enableManagedSettings
|
|
1059
1060
|
});
|
|
1060
1061
|
const {
|
|
1061
1062
|
sessionId: returnedSessionId,
|
|
@@ -1245,7 +1246,8 @@ class CopilotClient {
|
|
|
1245
1246
|
gitHubToken: config.gitHubToken,
|
|
1246
1247
|
remoteSession: config.remoteSession,
|
|
1247
1248
|
openCanvases: config.openCanvases,
|
|
1248
|
-
expAssignments: config.expAssignments
|
|
1249
|
+
expAssignments: config.expAssignments,
|
|
1250
|
+
enableManagedSettings: config.enableManagedSettings
|
|
1249
1251
|
});
|
|
1250
1252
|
const { workspacePath, capabilities, openCanvases } = response;
|
|
1251
1253
|
session["_workspacePath"] = workspacePath;
|
|
@@ -1371,9 +1373,11 @@ class CopilotClient {
|
|
|
1371
1373
|
const raceAgainstExit = (p) => this.processExitPromise ? Promise.race([p, this.processExitPromise]) : p;
|
|
1372
1374
|
let serverVersion;
|
|
1373
1375
|
try {
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1376
|
-
|
|
1376
|
+
const connectParams = { token: this.effectiveConnectionToken };
|
|
1377
|
+
if (this.onGitHubTelemetry != null) {
|
|
1378
|
+
connectParams.enableGitHubTelemetryForwarding = true;
|
|
1379
|
+
}
|
|
1380
|
+
const result = await raceAgainstExit(this.internalRpc.connect(connectParams));
|
|
1377
1381
|
serverVersion = result.protocolVersion;
|
|
1378
1382
|
} catch (err) {
|
|
1379
1383
|
if (err instanceof import_node.ResponseError && (err.code === import_node.ErrorCodes.MethodNotFound || err.message === "Unhandled method connect")) {
|
|
@@ -321,6 +321,15 @@ function createServerRpc(connection) {
|
|
|
321
321
|
getDiscoveryPaths: async (params) => connection.sendRequest("instructions.getDiscoveryPaths", params)
|
|
322
322
|
},
|
|
323
323
|
/** @experimental */
|
|
324
|
+
commands: {
|
|
325
|
+
/**
|
|
326
|
+
* Lists the well-known built-in slash commands that work as the first message in a new session (e.g. /plan, /env), without requiring an active session. Commands that depend on session state, authentication, or a synced session are omitted.
|
|
327
|
+
*
|
|
328
|
+
* @returns Slash commands available in the session, after applying any include/exclude filters.
|
|
329
|
+
*/
|
|
330
|
+
list: async () => connection.sendRequest("commands.list", {})
|
|
331
|
+
},
|
|
332
|
+
/** @experimental */
|
|
324
333
|
user: {
|
|
325
334
|
/** @experimental */
|
|
326
335
|
settings: {
|
|
@@ -588,7 +597,7 @@ function createInternalServerRpc(connection) {
|
|
|
588
597
|
/**
|
|
589
598
|
* 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.
|
|
590
599
|
*
|
|
591
|
-
* @param params
|
|
600
|
+
* @param params Parameters for the `server.connect` handshake: an optional connection token and optional connection-level opt-ins (e.g. GitHub telemetry forwarding).
|
|
592
601
|
*
|
|
593
602
|
* @returns Handshake result reporting the server's protocol version and package version on success.
|
|
594
603
|
*
|
|
@@ -656,6 +665,16 @@ function createSessionRpc(connection, sessionId) {
|
|
|
656
665
|
* @experimental
|
|
657
666
|
*/
|
|
658
667
|
send: async (params) => connection.sendRequest("session.send", { sessionId, ...params }),
|
|
668
|
+
/**
|
|
669
|
+
* Sends zero or more user messages to the session in a single turn and returns their message IDs. All provided messages are appended to the conversation in order, then exactly one agent turn runs over the resulting history. When the list is empty, one turn runs over the existing history with no new user message. Remote-backed (Mission Control) sessions do not support this method and will return an error.
|
|
670
|
+
*
|
|
671
|
+
* @param params Parameters for sending zero or more user messages to the session in a single turn. Remote-backed (Mission Control) sessions do not support this method and will return an error.
|
|
672
|
+
*
|
|
673
|
+
* @returns Result of sending zero or more user messages
|
|
674
|
+
*
|
|
675
|
+
* @experimental
|
|
676
|
+
*/
|
|
677
|
+
sendMessages: async (params) => connection.sendRequest("session.sendMessages", { sessionId, ...params }),
|
|
659
678
|
/**
|
|
660
679
|
* Aborts the current agent turn.
|
|
661
680
|
*
|
|
@@ -692,6 +711,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
692
711
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
693
712
|
},
|
|
694
713
|
/** @experimental */
|
|
714
|
+
debug: {
|
|
715
|
+
/**
|
|
716
|
+
* Collects a redacted session debug log bundle into a local archive or staging directory. The runtime includes session-owned logs by default and accepts caller-provided diagnostic entries so host applications can add their own files without changing this API shape.
|
|
717
|
+
*
|
|
718
|
+
* @param params Options for collecting a redacted session debug bundle.
|
|
719
|
+
*
|
|
720
|
+
* @returns Result of collecting a redacted debug bundle.
|
|
721
|
+
*/
|
|
722
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { sessionId, ...params })
|
|
723
|
+
},
|
|
724
|
+
/** @experimental */
|
|
695
725
|
canvas: {
|
|
696
726
|
/**
|
|
697
727
|
* Lists canvases declared for the session.
|
|
@@ -1142,6 +1172,18 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1142
1172
|
* @returns Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).
|
|
1143
1173
|
*/
|
|
1144
1174
|
removeGitHub: async () => connection.sendRequest("session.mcp.removeGitHub", { sessionId }),
|
|
1175
|
+
/**
|
|
1176
|
+
* Starts an individual MCP server on the live session from a caller-supplied config. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.
|
|
1177
|
+
*
|
|
1178
|
+
* @param params Server name and configuration for an individual MCP server start.
|
|
1179
|
+
*/
|
|
1180
|
+
startServer: async (params) => connection.sendRequest("session.mcp.startServer", { sessionId, ...params }),
|
|
1181
|
+
/**
|
|
1182
|
+
* Restarts an individual MCP server on the live session (stops then starts). Omit `config` for a config-free restart-by-name of an already-configured server; supply `config` to restart with a replacement configuration. Session-scoped and ephemeral: does NOT modify persistent user configuration (`mcp.config.*`).
|
|
1183
|
+
*
|
|
1184
|
+
* @param params Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server.
|
|
1185
|
+
*/
|
|
1186
|
+
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", { sessionId, ...params }),
|
|
1145
1187
|
/**
|
|
1146
1188
|
* Stops an individual MCP server on the session's host.
|
|
1147
1189
|
*
|
|
@@ -1530,17 +1572,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1530
1572
|
*/
|
|
1531
1573
|
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
|
|
1532
1574
|
/**
|
|
1533
|
-
*
|
|
1575
|
+
* 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.
|
|
1534
1576
|
*
|
|
1535
|
-
* @param params
|
|
1577
|
+
* @param params Allow-all mode to apply for the session.
|
|
1536
1578
|
*
|
|
1537
1579
|
* @returns Indicates whether the operation succeeded and reports the post-mutation state.
|
|
1538
1580
|
*/
|
|
1539
1581
|
setAllowAll: async (params) => connection.sendRequest("session.permissions.setAllowAll", { sessionId, ...params }),
|
|
1540
1582
|
/**
|
|
1541
|
-
* Returns
|
|
1583
|
+
* Returns the current allow-all permission mode for the session.
|
|
1542
1584
|
*
|
|
1543
|
-
* @returns Current
|
|
1585
|
+
* @returns Current allow-all permission mode.
|
|
1544
1586
|
*/
|
|
1545
1587
|
getAllowAll: async () => connection.sendRequest("session.permissions.getAllowAll", { sessionId }),
|
|
1546
1588
|
/**
|
|
@@ -1962,40 +2004,34 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
1962
2004
|
*/
|
|
1963
2005
|
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", { sessionId, ...params }),
|
|
1964
2006
|
/**
|
|
1965
|
-
*
|
|
2007
|
+
* Registers a pre-connected external MCP client (e.g. IDE) on the session's host. The caller retains lifecycle ownership of the client and transport. Marked internal because the `client` and `transport` arguments are in-process MCP SDK instances that cannot be serialized across the JSON-RPC boundary; once the CLI moves on top of the SDK, external clients will be expressed as transport configs the runtime can construct itself.
|
|
1966
2008
|
*
|
|
1967
|
-
* @param params
|
|
2009
|
+
* @param params Registration parameters for an external MCP client.
|
|
1968
2010
|
*/
|
|
1969
|
-
|
|
2011
|
+
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", { sessionId, ...params }),
|
|
1970
2012
|
/**
|
|
1971
|
-
*
|
|
2013
|
+
* Unregisters a previously registered external MCP client by server name. Marked internal as the paired companion of `registerExternalClient`: only in-process callers that registered a client this way can meaningfully unregister it. Disappears alongside `registerExternalClient`: once external clients are described to the runtime as config rather than handed in as instances, lifecycle (including deregistration) is owned entirely by the runtime.
|
|
1972
2014
|
*
|
|
1973
|
-
* @param params Server name
|
|
2015
|
+
* @param params Server name identifying the external client to remove.
|
|
1974
2016
|
*/
|
|
1975
|
-
|
|
2017
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
2018
|
+
},
|
|
2019
|
+
/** @experimental */
|
|
2020
|
+
settings: {
|
|
1976
2021
|
/**
|
|
1977
|
-
*
|
|
2022
|
+
* 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.
|
|
1978
2023
|
*
|
|
1979
|
-
* @
|
|
2024
|
+
* @returns Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded.
|
|
1980
2025
|
*/
|
|
1981
|
-
|
|
2026
|
+
snapshot: async () => connection.sendRequest("session.settings.snapshot", { sessionId }),
|
|
1982
2027
|
/**
|
|
1983
|
-
*
|
|
2028
|
+
* Evaluates a named Rust-owned settings predicate without exposing raw feature flags. Internal: the raw feature-flag names and composition are runtime-internal, so this predicate-evaluation helper is kept out of the public SDK surface and is callable in-process only.
|
|
1984
2029
|
*
|
|
1985
|
-
* @param params
|
|
2030
|
+
* @param params Named Rust-owned settings predicate to evaluate for this session.
|
|
2031
|
+
*
|
|
2032
|
+
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
1986
2033
|
*/
|
|
1987
|
-
|
|
1988
|
-
/** @experimental */
|
|
1989
|
-
oauth: {
|
|
1990
|
-
/**
|
|
1991
|
-
* 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.
|
|
1992
|
-
*
|
|
1993
|
-
* @param params MCP OAuth request id and optional provider response.
|
|
1994
|
-
*
|
|
1995
|
-
* @returns Empty result after recording the MCP OAuth response.
|
|
1996
|
-
*/
|
|
1997
|
-
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", { sessionId, ...params })
|
|
1998
|
-
}
|
|
2034
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { sessionId, ...params })
|
|
1999
2035
|
}
|
|
2000
2036
|
};
|
|
2001
2037
|
}
|
package/dist/client.js
CHANGED
|
@@ -1042,7 +1042,8 @@ class CopilotClient {
|
|
|
1042
1042
|
gitHubToken: config.gitHubToken,
|
|
1043
1043
|
remoteSession: config.remoteSession,
|
|
1044
1044
|
cloud: config.cloud,
|
|
1045
|
-
expAssignments: config.expAssignments
|
|
1045
|
+
expAssignments: config.expAssignments,
|
|
1046
|
+
enableManagedSettings: config.enableManagedSettings
|
|
1046
1047
|
});
|
|
1047
1048
|
const {
|
|
1048
1049
|
sessionId: returnedSessionId,
|
|
@@ -1232,7 +1233,8 @@ class CopilotClient {
|
|
|
1232
1233
|
gitHubToken: config.gitHubToken,
|
|
1233
1234
|
remoteSession: config.remoteSession,
|
|
1234
1235
|
openCanvases: config.openCanvases,
|
|
1235
|
-
expAssignments: config.expAssignments
|
|
1236
|
+
expAssignments: config.expAssignments,
|
|
1237
|
+
enableManagedSettings: config.enableManagedSettings
|
|
1236
1238
|
});
|
|
1237
1239
|
const { workspacePath, capabilities, openCanvases } = response;
|
|
1238
1240
|
session["_workspacePath"] = workspacePath;
|
|
@@ -1358,9 +1360,11 @@ class CopilotClient {
|
|
|
1358
1360
|
const raceAgainstExit = (p) => this.processExitPromise ? Promise.race([p, this.processExitPromise]) : p;
|
|
1359
1361
|
let serverVersion;
|
|
1360
1362
|
try {
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
|
|
1363
|
+
const connectParams = { token: this.effectiveConnectionToken };
|
|
1364
|
+
if (this.onGitHubTelemetry != null) {
|
|
1365
|
+
connectParams.enableGitHubTelemetryForwarding = true;
|
|
1366
|
+
}
|
|
1367
|
+
const result = await raceAgainstExit(this.internalRpc.connect(connectParams));
|
|
1364
1368
|
serverVersion = result.protocolVersion;
|
|
1365
1369
|
} catch (err) {
|
|
1366
1370
|
if (err instanceof ResponseError && (err.code === ErrorCodes.MethodNotFound || err.message === "Unhandled method connect")) {
|