@github/copilot-sdk 1.0.6-preview.1 → 1.0.6
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 +5 -3
- package/dist/cjs/generated/rpc.js +34 -17
- package/dist/client.js +5 -3
- package/dist/generated/rpc.d.ts +760 -156
- package/dist/generated/rpc.js +34 -17
- package/dist/generated/session-events.d.ts +299 -84
- package/package.json +2 -2
package/dist/cjs/client.js
CHANGED
|
@@ -1371,9 +1371,11 @@ class CopilotClient {
|
|
|
1371
1371
|
const raceAgainstExit = (p) => this.processExitPromise ? Promise.race([p, this.processExitPromise]) : p;
|
|
1372
1372
|
let serverVersion;
|
|
1373
1373
|
try {
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1376
|
-
|
|
1374
|
+
const connectParams = { token: this.effectiveConnectionToken };
|
|
1375
|
+
if (this.onGitHubTelemetry != null) {
|
|
1376
|
+
connectParams.enableGitHubTelemetryForwarding = true;
|
|
1377
|
+
}
|
|
1378
|
+
const result = await raceAgainstExit(this.internalRpc.connect(connectParams));
|
|
1377
1379
|
serverVersion = result.protocolVersion;
|
|
1378
1380
|
} catch (err) {
|
|
1379
1381
|
if (err instanceof import_node.ResponseError && (err.code === import_node.ErrorCodes.MethodNotFound || err.message === "Unhandled method connect")) {
|
|
@@ -588,7 +588,7 @@ function createInternalServerRpc(connection) {
|
|
|
588
588
|
/**
|
|
589
589
|
* 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
590
|
*
|
|
591
|
-
* @param params
|
|
591
|
+
* @param params Parameters for the `server.connect` handshake: an optional connection token and optional connection-level opt-ins (e.g. GitHub telemetry forwarding).
|
|
592
592
|
*
|
|
593
593
|
* @returns Handshake result reporting the server's protocol version and package version on success.
|
|
594
594
|
*
|
|
@@ -692,6 +692,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
692
692
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
693
693
|
},
|
|
694
694
|
/** @experimental */
|
|
695
|
+
debug: {
|
|
696
|
+
/**
|
|
697
|
+
* 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.
|
|
698
|
+
*
|
|
699
|
+
* @param params Options for collecting a redacted session debug bundle.
|
|
700
|
+
*
|
|
701
|
+
* @returns Result of collecting a redacted debug bundle.
|
|
702
|
+
*/
|
|
703
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { sessionId, ...params })
|
|
704
|
+
},
|
|
705
|
+
/** @experimental */
|
|
695
706
|
canvas: {
|
|
696
707
|
/**
|
|
697
708
|
* Lists canvases declared for the session.
|
|
@@ -1530,17 +1541,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1530
1541
|
*/
|
|
1531
1542
|
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
|
|
1532
1543
|
/**
|
|
1533
|
-
*
|
|
1544
|
+
* 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
1545
|
*
|
|
1535
|
-
* @param params
|
|
1546
|
+
* @param params Allow-all mode to apply for the session.
|
|
1536
1547
|
*
|
|
1537
1548
|
* @returns Indicates whether the operation succeeded and reports the post-mutation state.
|
|
1538
1549
|
*/
|
|
1539
1550
|
setAllowAll: async (params) => connection.sendRequest("session.permissions.setAllowAll", { sessionId, ...params }),
|
|
1540
1551
|
/**
|
|
1541
|
-
* Returns
|
|
1552
|
+
* Returns the current allow-all permission mode for the session.
|
|
1542
1553
|
*
|
|
1543
|
-
* @returns Current
|
|
1554
|
+
* @returns Current allow-all permission mode.
|
|
1544
1555
|
*/
|
|
1545
1556
|
getAllowAll: async () => connection.sendRequest("session.permissions.getAllowAll", { sessionId }),
|
|
1546
1557
|
/**
|
|
@@ -1984,18 +1995,24 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
1984
1995
|
*
|
|
1985
1996
|
* @param params Server name identifying the external client to remove.
|
|
1986
1997
|
*/
|
|
1987
|
-
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1998
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
1999
|
+
},
|
|
2000
|
+
/** @experimental */
|
|
2001
|
+
settings: {
|
|
2002
|
+
/**
|
|
2003
|
+
* 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.
|
|
2004
|
+
*
|
|
2005
|
+
* @returns Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded.
|
|
2006
|
+
*/
|
|
2007
|
+
snapshot: async () => connection.sendRequest("session.settings.snapshot", { sessionId }),
|
|
2008
|
+
/**
|
|
2009
|
+
* 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.
|
|
2010
|
+
*
|
|
2011
|
+
* @param params Named Rust-owned settings predicate to evaluate for this session.
|
|
2012
|
+
*
|
|
2013
|
+
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
2014
|
+
*/
|
|
2015
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { sessionId, ...params })
|
|
1999
2016
|
}
|
|
2000
2017
|
};
|
|
2001
2018
|
}
|
package/dist/client.js
CHANGED
|
@@ -1358,9 +1358,11 @@ class CopilotClient {
|
|
|
1358
1358
|
const raceAgainstExit = (p) => this.processExitPromise ? Promise.race([p, this.processExitPromise]) : p;
|
|
1359
1359
|
let serverVersion;
|
|
1360
1360
|
try {
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
|
|
1361
|
+
const connectParams = { token: this.effectiveConnectionToken };
|
|
1362
|
+
if (this.onGitHubTelemetry != null) {
|
|
1363
|
+
connectParams.enableGitHubTelemetryForwarding = true;
|
|
1364
|
+
}
|
|
1365
|
+
const result = await raceAgainstExit(this.internalRpc.connect(connectParams));
|
|
1364
1366
|
serverVersion = result.protocolVersion;
|
|
1365
1367
|
} catch (err) {
|
|
1366
1368
|
if (err instanceof ResponseError && (err.code === ErrorCodes.MethodNotFound || err.message === "Unhandled method connect")) {
|