@github/copilot-sdk 1.0.6-preview.0 → 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 +48 -25
- package/dist/client.js +5 -3
- package/dist/generated/rpc.d.ts +920 -197
- package/dist/generated/rpc.js +48 -25
- package/dist/generated/session-events.d.ts +299 -84
- package/package.json +2 -2
package/dist/generated/rpc.js
CHANGED
|
@@ -560,7 +560,7 @@ function createInternalServerRpc(connection) {
|
|
|
560
560
|
/**
|
|
561
561
|
* 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.
|
|
562
562
|
*
|
|
563
|
-
* @param params
|
|
563
|
+
* @param params Parameters for the `server.connect` handshake: an optional connection token and optional connection-level opt-ins (e.g. GitHub telemetry forwarding).
|
|
564
564
|
*
|
|
565
565
|
* @returns Handshake result reporting the server's protocol version and package version on success.
|
|
566
566
|
*
|
|
@@ -593,14 +593,6 @@ function createInternalServerRpc(connection) {
|
|
|
593
593
|
* @returns Dynamic-context board entry count, when available.
|
|
594
594
|
*/
|
|
595
595
|
getBoardEntryCount: async (params) => connection.sendRequest("sessions.getBoardEntryCount", params),
|
|
596
|
-
/**
|
|
597
|
-
* Cursor-based long-poll for sessions spawned by the runtime (e.g. in response to a Mission Control `start_session` command). The cursor is an opaque token; pass it back to receive only spawn events that occurred AFTER the cursor was issued. Omit the cursor on the first call to receive any events buffered since the runtime started. Internal: this is a CLI background-daemon plumbing primitive. SDK consumers that need to react to runtime-spawned sessions should subscribe to a higher-level event stream rather than driving a long-poll loop.
|
|
598
|
-
*
|
|
599
|
-
* @param params Cursor and optional long-poll wait for polling runtime-spawned sessions.
|
|
600
|
-
*
|
|
601
|
-
* @returns Batch of spawn events plus a cursor for follow-up polls.
|
|
602
|
-
*/
|
|
603
|
-
pollSpawnedSessions: async (params) => connection.sendRequest("sessions.pollSpawnedSessions", params),
|
|
604
596
|
/**
|
|
605
597
|
* Registers extension-provided tools on the given session, gated by an optional `enabled` callback. Returns an opaque unsubscribe function the caller must invoke to deregister the tools when the extension is torn down. Marked internal because `loader`, `enabled`, and the returned `unsubscribe` are in-process handles that cannot cross the JSON-RPC boundary. Disappears once extension discovery / launch / tool registration are owned by the runtime: SDK consumers will pass pure config (search paths, disabled ids) via `SessionOptions` and the runtime will resolve, launch, register, and tear down extensions itself.
|
|
606
598
|
*
|
|
@@ -672,6 +664,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
672
664
|
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { sessionId, ...params })
|
|
673
665
|
},
|
|
674
666
|
/** @experimental */
|
|
667
|
+
debug: {
|
|
668
|
+
/**
|
|
669
|
+
* 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.
|
|
670
|
+
*
|
|
671
|
+
* @param params Options for collecting a redacted session debug bundle.
|
|
672
|
+
*
|
|
673
|
+
* @returns Result of collecting a redacted debug bundle.
|
|
674
|
+
*/
|
|
675
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { sessionId, ...params })
|
|
676
|
+
},
|
|
677
|
+
/** @experimental */
|
|
675
678
|
canvas: {
|
|
676
679
|
/**
|
|
677
680
|
* Lists canvases declared for the session.
|
|
@@ -1510,17 +1513,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1510
1513
|
*/
|
|
1511
1514
|
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
|
|
1512
1515
|
/**
|
|
1513
|
-
*
|
|
1516
|
+
* 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.
|
|
1514
1517
|
*
|
|
1515
|
-
* @param params
|
|
1518
|
+
* @param params Allow-all mode to apply for the session.
|
|
1516
1519
|
*
|
|
1517
1520
|
* @returns Indicates whether the operation succeeded and reports the post-mutation state.
|
|
1518
1521
|
*/
|
|
1519
1522
|
setAllowAll: async (params) => connection.sendRequest("session.permissions.setAllowAll", { sessionId, ...params }),
|
|
1520
1523
|
/**
|
|
1521
|
-
* Returns
|
|
1524
|
+
* Returns the current allow-all permission mode for the session.
|
|
1522
1525
|
*
|
|
1523
|
-
* @returns Current
|
|
1526
|
+
* @returns Current allow-all permission mode.
|
|
1524
1527
|
*/
|
|
1525
1528
|
getAllowAll: async () => connection.sendRequest("session.permissions.getAllowAll", { sessionId }),
|
|
1526
1529
|
/**
|
|
@@ -1690,6 +1693,20 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1690
1693
|
* @returns Token breakdown for the session's current context window, or null if uninitialized.
|
|
1691
1694
|
*/
|
|
1692
1695
|
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", { sessionId, ...params }),
|
|
1696
|
+
/**
|
|
1697
|
+
* Returns the experimental per-source attribution breakdown of the session's current context window as a flat list of entries (skills, subagents, MCP servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via parentId), plus the successful compaction count. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`. Returns null until the session has initialized its system prompt and tool metadata.
|
|
1698
|
+
*
|
|
1699
|
+
* @returns Per-source attribution breakdown for the session's current context window, or null if uninitialized.
|
|
1700
|
+
*/
|
|
1701
|
+
getContextAttribution: async () => connection.sendRequest("session.metadata.getContextAttribution", { sessionId }),
|
|
1702
|
+
/**
|
|
1703
|
+
* Returns the largest individual messages currently in the session's context window, most-expensive first. Companion to `metadata.getContextAttribution`. Returns an empty list until the session has initialized.
|
|
1704
|
+
*
|
|
1705
|
+
* @param params Parameters for the heaviest-messages query.
|
|
1706
|
+
*
|
|
1707
|
+
* @returns The heaviest individual messages in the session's context window, most-expensive first.
|
|
1708
|
+
*/
|
|
1709
|
+
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { sessionId, ...params }),
|
|
1693
1710
|
/**
|
|
1694
1711
|
* Records a working-directory/git context change and emits a `session.context_changed` event.
|
|
1695
1712
|
*
|
|
@@ -1950,18 +1967,24 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
1950
1967
|
*
|
|
1951
1968
|
* @param params Server name identifying the external client to remove.
|
|
1952
1969
|
*/
|
|
1953
|
-
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1970
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
1971
|
+
},
|
|
1972
|
+
/** @experimental */
|
|
1973
|
+
settings: {
|
|
1974
|
+
/**
|
|
1975
|
+
* 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.
|
|
1976
|
+
*
|
|
1977
|
+
* @returns Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded.
|
|
1978
|
+
*/
|
|
1979
|
+
snapshot: async () => connection.sendRequest("session.settings.snapshot", { sessionId }),
|
|
1980
|
+
/**
|
|
1981
|
+
* 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.
|
|
1982
|
+
*
|
|
1983
|
+
* @param params Named Rust-owned settings predicate to evaluate for this session.
|
|
1984
|
+
*
|
|
1985
|
+
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
1986
|
+
*/
|
|
1987
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { sessionId, ...params })
|
|
1965
1988
|
}
|
|
1966
1989
|
};
|
|
1967
1990
|
}
|