@github/copilot-language-server 1.543.0 → 1.544.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/main.js +954 -949
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/cliVersion.js +31 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/client.js +244 -108
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/extension.js +3 -1
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/ffiRuntimeHost.js +14 -19
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/generated/rpc.js +293 -22
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/index.js +2 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/runtimeArtifacts.js +254 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/session.js +144 -16
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/types.js +8 -0
- package/dist/node_modules/@github/copilot-sdk/package.json +103 -88
- package/package.json +14 -14
|
@@ -42,6 +42,7 @@ async function joinSession(config = {}) {
|
|
|
42
42
|
const {
|
|
43
43
|
extensionSdkPath: _stripped,
|
|
44
44
|
factories,
|
|
45
|
+
requestedEnvironmentVariables,
|
|
45
46
|
...rest
|
|
46
47
|
} = config;
|
|
47
48
|
void _stripped;
|
|
@@ -52,7 +53,8 @@ async function joinSession(config = {}) {
|
|
|
52
53
|
onPermissionRequest: config.onPermissionRequest ?? import_types.defaultJoinSessionPermissionHandler,
|
|
53
54
|
suppressResumeEvent: config.suppressResumeEvent ?? true
|
|
54
55
|
},
|
|
55
|
-
factories
|
|
56
|
+
factories,
|
|
57
|
+
requestedEnvironmentVariables?.length ? { requestedEnvironmentVariables } : void 0
|
|
56
58
|
);
|
|
57
59
|
}
|
|
58
60
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -85,7 +85,7 @@ function loadLibrary(libraryPath) {
|
|
|
85
85
|
return loadedLibrary;
|
|
86
86
|
}
|
|
87
87
|
function buildArgvJson(cliEntrypoint, args) {
|
|
88
|
-
const argv = cliEntrypoint.toLowerCase().endsWith(".js") ? ["node", cliEntrypoint, "--embedded-host", "--no-auto-update"] : [cliEntrypoint, "--embedded-host", "--no-auto-update"];
|
|
88
|
+
const argv = cliEntrypoint ? cliEntrypoint.toLowerCase().endsWith(".js") ? ["node", cliEntrypoint, "--embedded-host", "--no-auto-update"] : [cliEntrypoint, "--embedded-host", "--no-auto-update"] : [];
|
|
89
89
|
argv.push(...args);
|
|
90
90
|
return Buffer.from(JSON.stringify(argv), "utf8");
|
|
91
91
|
}
|
|
@@ -140,24 +140,21 @@ class FfiRuntimeHost {
|
|
|
140
140
|
/** The stream JSON-RPC writes client→server frames to. */
|
|
141
141
|
sendStream;
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
144
|
-
* The cdylib is resolved as `prebuilds/<prebuildsFolder>/runtime.node` relative to
|
|
145
|
-
* the entrypoint directory (the napi-rs `<node-platform>-<arch>` layout, e.g.
|
|
146
|
-
* `linux-x64`). Throws if it cannot be found.
|
|
143
|
+
* Loads the runtime cdylib at the given path and prepares the FFI host.
|
|
147
144
|
*/
|
|
148
|
-
static create(
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (!(0, import_node_fs.existsSync)(libraryPath)) {
|
|
153
|
-
throw new Error(`FFI runtime library not found. Looked for '${libraryPath}'.`);
|
|
145
|
+
static create(libraryPath, cliEntrypoint, environment, args) {
|
|
146
|
+
const fullLibraryPath = (0, import_node_path.resolve)(libraryPath);
|
|
147
|
+
if (!(0, import_node_fs.existsSync)(fullLibraryPath)) {
|
|
148
|
+
throw new Error(`FFI runtime library not found at '${fullLibraryPath}'.`);
|
|
154
149
|
}
|
|
155
|
-
return new FfiRuntimeHost(
|
|
150
|
+
return new FfiRuntimeHost(
|
|
151
|
+
fullLibraryPath,
|
|
152
|
+
cliEntrypoint ? (0, import_node_path.resolve)(cliEntrypoint) : void 0,
|
|
153
|
+
environment,
|
|
154
|
+
args
|
|
155
|
+
);
|
|
156
156
|
}
|
|
157
|
-
/**
|
|
158
|
-
* Starts the in-process runtime: spawns the CLI worker via the native host,
|
|
159
|
-
* waits for readiness, and opens the FFI JSON-RPC connection.
|
|
160
|
-
*/
|
|
157
|
+
/** Starts the in-process Rust runtime and opens the FFI JSON-RPC connection. */
|
|
161
158
|
async start() {
|
|
162
159
|
const argvJson = buildArgvJson(this.cliEntrypoint, this.args);
|
|
163
160
|
const envJson = buildEnvJson(this.environment);
|
|
@@ -177,9 +174,7 @@ class FfiRuntimeHost {
|
|
|
177
174
|
);
|
|
178
175
|
});
|
|
179
176
|
if (!this.serverId) {
|
|
180
|
-
throw new Error(
|
|
181
|
-
`copilot_runtime_host_start failed (library '${this.libraryPath}', entrypoint '${this.cliEntrypoint}').`
|
|
182
|
-
);
|
|
177
|
+
throw new Error(`copilot_runtime_host_start failed (library '${this.libraryPath}').`);
|
|
183
178
|
}
|
|
184
179
|
this.outboundCallback = import_koffi.default.register(
|
|
185
180
|
(_userData, bytesPtr, bytesLen) => this.feedInbound(bytesPtr, bytesLen),
|
|
@@ -39,11 +39,22 @@ function createServerRpc(connection) {
|
|
|
39
39
|
*/
|
|
40
40
|
ping: async (params) => connection.sendRequest("ping", params),
|
|
41
41
|
/** @experimental */
|
|
42
|
+
hooks: {
|
|
43
|
+
/**
|
|
44
|
+
* Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources.
|
|
45
|
+
*
|
|
46
|
+
* @param params Optional project paths and host-exclusion behavior for server-scoped hook discovery.
|
|
47
|
+
*
|
|
48
|
+
* @returns Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources.
|
|
49
|
+
*/
|
|
50
|
+
discover: async (params) => connection.sendRequest("hooks.discover", params)
|
|
51
|
+
},
|
|
52
|
+
/** @experimental */
|
|
42
53
|
models: {
|
|
43
54
|
/**
|
|
44
55
|
* Lists Copilot models available to the authenticated user.
|
|
45
56
|
*
|
|
46
|
-
* @param params Optional GitHub token used to list models
|
|
57
|
+
* @param params Optional opaque account selection or compatibility GitHub token used to list models.
|
|
47
58
|
*
|
|
48
59
|
* @returns List of Copilot models available to the resolved user, including capabilities and billing metadata.
|
|
49
60
|
*/
|
|
@@ -69,9 +80,9 @@ function createServerRpc(connection) {
|
|
|
69
80
|
/** @experimental */
|
|
70
81
|
account: {
|
|
71
82
|
/**
|
|
72
|
-
* Gets Copilot quota usage for the
|
|
83
|
+
* Gets Copilot quota usage for the current or opaquely selected authenticated user.
|
|
73
84
|
*
|
|
74
|
-
* @param params Optional GitHub token used to look up quota
|
|
85
|
+
* @param params Optional opaque account selection or compatibility GitHub token used to look up quota.
|
|
75
86
|
*
|
|
76
87
|
* @returns Quota usage snapshots for the resolved user, keyed by quota type.
|
|
77
88
|
*/
|
|
@@ -89,9 +100,9 @@ function createServerRpc(connection) {
|
|
|
89
100
|
*/
|
|
90
101
|
getAllUsers: async () => connection.sendRequest("account.getAllUsers", {}),
|
|
91
102
|
/**
|
|
92
|
-
*
|
|
103
|
+
* Validates and stores authentication credentials. When login is omitted, resolves the authenticated user from the token before persistence.
|
|
93
104
|
*
|
|
94
|
-
* @param params Credentials to store
|
|
105
|
+
* @param params Credentials to validate and store. Omit login to resolve the authenticated user from the token.
|
|
95
106
|
*
|
|
96
107
|
* @returns Result of a successful login; throws on failure
|
|
97
108
|
*/
|
|
@@ -168,7 +179,15 @@ function createServerRpc(connection) {
|
|
|
168
179
|
*
|
|
169
180
|
* @returns MCP servers discovered from user, workspace, plugin, and built-in sources.
|
|
170
181
|
*/
|
|
171
|
-
discover: async (params) => connection.sendRequest("mcp.discover", params)
|
|
182
|
+
discover: async (params) => connection.sendRequest("mcp.discover", params),
|
|
183
|
+
/**
|
|
184
|
+
* 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.
|
|
185
|
+
*
|
|
186
|
+
* @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.
|
|
187
|
+
*
|
|
188
|
+
* @returns Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.
|
|
189
|
+
*/
|
|
190
|
+
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params)
|
|
172
191
|
},
|
|
173
192
|
/** @experimental */
|
|
174
193
|
extensions: {
|
|
@@ -192,12 +211,23 @@ function createServerRpc(connection) {
|
|
|
192
211
|
disable: async (params) => connection.sendRequest("extensions.disable", params)
|
|
193
212
|
},
|
|
194
213
|
/**
|
|
195
|
-
* Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime
|
|
214
|
+
* Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime uses its built-in extension launcher.
|
|
196
215
|
*
|
|
197
216
|
* @experimental
|
|
198
217
|
*/
|
|
199
218
|
registerExtensionLaunchProvider: async () => connection.sendRequest("registerExtensionLaunchProvider", {}),
|
|
200
219
|
/** @experimental */
|
|
220
|
+
catalog: {
|
|
221
|
+
/**
|
|
222
|
+
* 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.
|
|
223
|
+
*
|
|
224
|
+
* @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.
|
|
225
|
+
*
|
|
226
|
+
* @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
|
|
227
|
+
*/
|
|
228
|
+
search: async (params) => connection.sendRequest("catalog.search", params)
|
|
229
|
+
},
|
|
230
|
+
/** @experimental */
|
|
201
231
|
plugins: {
|
|
202
232
|
/**
|
|
203
233
|
* Lists plugins installed in user/global state.
|
|
@@ -246,6 +276,15 @@ function createServerRpc(connection) {
|
|
|
246
276
|
*/
|
|
247
277
|
disable: async (params) => connection.sendRequest("plugins.disable", params),
|
|
248
278
|
/** @experimental */
|
|
279
|
+
builtin: {
|
|
280
|
+
/**
|
|
281
|
+
* Replaces this server's trusted built-in plugin directories while no sessions are active.
|
|
282
|
+
*
|
|
283
|
+
* @param params Trusted built-in plugin directories to use for this runtime process.
|
|
284
|
+
*/
|
|
285
|
+
set: async (params) => connection.sendRequest("plugins.builtin.set", params)
|
|
286
|
+
},
|
|
287
|
+
/** @experimental */
|
|
249
288
|
marketplaces: {
|
|
250
289
|
/**
|
|
251
290
|
* Lists all registered marketplaces (defaults + user-added).
|
|
@@ -296,7 +335,13 @@ function createServerRpc(connection) {
|
|
|
296
335
|
*
|
|
297
336
|
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
298
337
|
*/
|
|
299
|
-
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params)
|
|
338
|
+
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
339
|
+
/**
|
|
340
|
+
* Atomically adds or removes one skill from the disabled list.
|
|
341
|
+
*
|
|
342
|
+
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
343
|
+
*/
|
|
344
|
+
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
300
345
|
},
|
|
301
346
|
/**
|
|
302
347
|
* Discovers skills across global and project sources.
|
|
@@ -393,7 +438,11 @@ function createServerRpc(connection) {
|
|
|
393
438
|
*
|
|
394
439
|
* @returns Validated device-managed settings discovered before a session exists.
|
|
395
440
|
*/
|
|
396
|
-
read: async () => connection.sendRequest("managedSettings.read", {})
|
|
441
|
+
read: async () => connection.sendRequest("managedSettings.read", {}),
|
|
442
|
+
/**
|
|
443
|
+
* Force-refreshes enterprise managed settings for every account: wipes the persistent server-policy cache (the whole `<cacheHome>/managed-settings` directory) and drops this runtime process's in-memory retained server policy. It does not itself fetch policy — the effect is that the next time a session resolves managed settings for an account, that resolution re-fetches the account's org policy from the network instead of serving a cached response. Note that `managedSettings.read` returns only device/MDM settings and never triggers the account server-policy fetch, so a host implementing "sync account policy" should start a fresh session resolution rather than treat a subsequent `managedSettings.read` as the refreshed org policy. Mirrors the invalidation a sign-out performs, broadened from the one signing-out account to all of them; device/MDM layers describe the machine, not the account, and are left untouched. Rejects if the on-disk cache cannot be removed.
|
|
444
|
+
*/
|
|
445
|
+
clearCache: async () => connection.sendRequest("managedSettings.clearCache", {})
|
|
397
446
|
},
|
|
398
447
|
/** @experimental */
|
|
399
448
|
runtime: {
|
|
@@ -472,6 +521,14 @@ function createServerRpc(connection) {
|
|
|
472
521
|
* @returns Sessions matching the filter, ordered most-recently-modified first.
|
|
473
522
|
*/
|
|
474
523
|
list: async (params) => connection.sendRequest("sessions.list", params),
|
|
524
|
+
/**
|
|
525
|
+
* Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session.
|
|
526
|
+
*
|
|
527
|
+
* @param params Pagination options for reading an inactive or active local session's persisted event journal.
|
|
528
|
+
*
|
|
529
|
+
* @returns Batch of session events returned by a read, with cursor and continuation metadata.
|
|
530
|
+
*/
|
|
531
|
+
readPersistedEvents: async (params) => connection.sendRequest("sessions.readPersistedEvents", params),
|
|
475
532
|
/**
|
|
476
533
|
* Finds the local session bound to a GitHub task ID, if any.
|
|
477
534
|
*
|
|
@@ -639,7 +696,7 @@ function createInternalServerRpc(connection) {
|
|
|
639
696
|
/**
|
|
640
697
|
* 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.
|
|
641
698
|
*
|
|
642
|
-
* @param params
|
|
699
|
+
* @param params Connection-level opt-ins for the `server.connect` handshake. Transport authentication is consumed by the native protocol boundary before dispatch.
|
|
643
700
|
*
|
|
644
701
|
* @returns Handshake result reporting the server's protocol version and package version on success.
|
|
645
702
|
*
|
|
@@ -739,6 +796,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
739
796
|
* @experimental
|
|
740
797
|
*/
|
|
741
798
|
sendMessages: async (params) => connection.sendRequest("session.sendMessages", { sessionId, ...params }),
|
|
799
|
+
/** @experimental */
|
|
800
|
+
sandbox: {
|
|
801
|
+
/**
|
|
802
|
+
* Returns whether managed policy requires sandbox enforcement and whether an enforcement failure has permanently blocked the session.
|
|
803
|
+
*
|
|
804
|
+
* @returns Managed sandbox enforcement state for a session.
|
|
805
|
+
*/
|
|
806
|
+
getEnforcementStatus: async () => connection.sendRequest("session.sandbox.getEnforcementStatus", { sessionId })
|
|
807
|
+
},
|
|
742
808
|
/**
|
|
743
809
|
* Aborts the current agent turn.
|
|
744
810
|
*
|
|
@@ -940,9 +1006,9 @@ function createSessionRpc(connection, sessionId) {
|
|
|
940
1006
|
/** @experimental */
|
|
941
1007
|
model: {
|
|
942
1008
|
/**
|
|
943
|
-
* Gets the
|
|
1009
|
+
* Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.
|
|
944
1010
|
*
|
|
945
|
-
* @returns The
|
|
1011
|
+
* @returns The session's authoritative model snapshot. Auto preference fields are configuration for the virtual `auto` model and do not change the selected model identifier. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume.
|
|
946
1012
|
*/
|
|
947
1013
|
getCurrent: async () => connection.sendRequest("session.model.getCurrent", { sessionId }),
|
|
948
1014
|
/**
|
|
@@ -953,6 +1019,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
953
1019
|
* @returns The model identifier active on the session after the switch.
|
|
954
1020
|
*/
|
|
955
1021
|
switchTo: async (params) => connection.sendRequest("session.model.switchTo", { sessionId, ...params }),
|
|
1022
|
+
/**
|
|
1023
|
+
* Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`.
|
|
1024
|
+
*
|
|
1025
|
+
* @param params An Auto preference request for the session. This updates Auto configuration only; it does not change the selected model to `auto`.
|
|
1026
|
+
*
|
|
1027
|
+
* @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed.
|
|
1028
|
+
*/
|
|
1029
|
+
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", { sessionId, ...params }),
|
|
956
1030
|
/**
|
|
957
1031
|
* Updates the session's reasoning effort without changing the selected model.
|
|
958
1032
|
*
|
|
@@ -982,6 +1056,8 @@ function createSessionRpc(connection, sessionId) {
|
|
|
982
1056
|
* Sets the current agent interaction mode.
|
|
983
1057
|
*
|
|
984
1058
|
* @param params Agent interaction mode to apply to the session.
|
|
1059
|
+
*
|
|
1060
|
+
* @returns Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.
|
|
985
1061
|
*/
|
|
986
1062
|
set: async (params) => connection.sendRequest("session.mode.set", { sessionId, ...params })
|
|
987
1063
|
},
|
|
@@ -1157,6 +1233,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1157
1233
|
diff: async (params) => connection.sendRequest("session.workspaces.diff", { sessionId, ...params })
|
|
1158
1234
|
},
|
|
1159
1235
|
/** @experimental */
|
|
1236
|
+
autopilotObjective: {
|
|
1237
|
+
/**
|
|
1238
|
+
* Reads the current canonical autopilot objective state for this session.
|
|
1239
|
+
*
|
|
1240
|
+
* @returns Canonical runtime state for the session's current autopilot objective.
|
|
1241
|
+
*/
|
|
1242
|
+
getState: async () => connection.sendRequest("session.autopilotObjective.getState", { sessionId })
|
|
1243
|
+
},
|
|
1244
|
+
/** @experimental */
|
|
1160
1245
|
completions: {
|
|
1161
1246
|
/**
|
|
1162
1247
|
* Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them).
|
|
@@ -1250,6 +1335,22 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1250
1335
|
* @returns Background tasks currently tracked by the session.
|
|
1251
1336
|
*/
|
|
1252
1337
|
list: async () => connection.sendRequest("session.tasks.list", { sessionId }),
|
|
1338
|
+
/**
|
|
1339
|
+
* Registers a client-owned task, or reclaims an orphaned task belonging to the same extension principal.
|
|
1340
|
+
*
|
|
1341
|
+
* @param params Registers or reclaims a client-owned task.
|
|
1342
|
+
*
|
|
1343
|
+
* @returns Result of registering or reclaiming a client-owned task.
|
|
1344
|
+
*/
|
|
1345
|
+
register: async (params) => connection.sendRequest("session.tasks.register", { sessionId, ...params }),
|
|
1346
|
+
/**
|
|
1347
|
+
* Publishes generic progress or a terminal outcome for a client-owned task.
|
|
1348
|
+
*
|
|
1349
|
+
* @param params Updates a client-owned task.
|
|
1350
|
+
*
|
|
1351
|
+
* @returns Result of publishing a client-owned task update.
|
|
1352
|
+
*/
|
|
1353
|
+
update: async (params) => connection.sendRequest("session.tasks.update", { sessionId, ...params }),
|
|
1253
1354
|
/**
|
|
1254
1355
|
* Refreshes metadata for any detached background shells the runtime knows about.
|
|
1255
1356
|
*
|
|
@@ -1384,6 +1485,12 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1384
1485
|
* Reloads MCP server connections for the session.
|
|
1385
1486
|
*/
|
|
1386
1487
|
reload: async () => connection.sendRequest("session.mcp.reload", { sessionId }),
|
|
1488
|
+
/**
|
|
1489
|
+
* 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.
|
|
1490
|
+
*
|
|
1491
|
+
* @returns Result of moving in-flight MCP loading to the background.
|
|
1492
|
+
*/
|
|
1493
|
+
moveLoadingToBackground: async () => connection.sendRequest("session.mcp.moveLoadingToBackground", { sessionId }),
|
|
1387
1494
|
/**
|
|
1388
1495
|
* Runs an MCP sampling inference on behalf of an MCP server.
|
|
1389
1496
|
*
|
|
@@ -1464,6 +1571,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1464
1571
|
* @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
|
|
1465
1572
|
*/
|
|
1466
1573
|
login: async (params) => connection.sendRequest("session.mcp.oauth.login", { sessionId, ...params }),
|
|
1574
|
+
/**
|
|
1575
|
+
* 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.
|
|
1576
|
+
*
|
|
1577
|
+
* @param params Remote MCP server name for a passive OAuth status probe.
|
|
1578
|
+
*
|
|
1579
|
+
* @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.
|
|
1580
|
+
*/
|
|
1581
|
+
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { sessionId, ...params }),
|
|
1467
1582
|
/**
|
|
1468
1583
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1469
1584
|
*
|
|
@@ -1646,6 +1761,30 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1646
1761
|
},
|
|
1647
1762
|
/** @experimental */
|
|
1648
1763
|
tools: {
|
|
1764
|
+
/**
|
|
1765
|
+
* Executes one tool from the session's currently offered tool set through the native invocation pipeline.
|
|
1766
|
+
*
|
|
1767
|
+
* @param params A tool name and arguments to execute through the session's native invocation pipeline.
|
|
1768
|
+
*
|
|
1769
|
+
* @returns Canonical result returned by a session tool.
|
|
1770
|
+
*/
|
|
1771
|
+
execute: async (params) => connection.sendRequest("session.tools.execute", { sessionId, ...params }),
|
|
1772
|
+
/**
|
|
1773
|
+
* Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.
|
|
1774
|
+
*
|
|
1775
|
+
* @param params Options controlling how Rust-owned built-in tool descriptors are materialized.
|
|
1776
|
+
*
|
|
1777
|
+
* @returns Rust-owned built-in tool descriptors for the session.
|
|
1778
|
+
*/
|
|
1779
|
+
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", { sessionId, ...params }),
|
|
1780
|
+
/**
|
|
1781
|
+
* Projects a completed task_complete tool call into its label-safe session event payload.
|
|
1782
|
+
*
|
|
1783
|
+
* @param params Task-completion tool arguments and final result used to build a label-safe session event payload.
|
|
1784
|
+
*
|
|
1785
|
+
* @returns Task completion notification with summary from the agent
|
|
1786
|
+
*/
|
|
1787
|
+
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", { sessionId, ...params }),
|
|
1649
1788
|
/**
|
|
1650
1789
|
* Provides the result for a pending external tool call.
|
|
1651
1790
|
*
|
|
@@ -1666,6 +1805,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1666
1805
|
* @returns Current lightweight tool metadata snapshot for the session.
|
|
1667
1806
|
*/
|
|
1668
1807
|
getCurrentMetadata: async () => connection.sendRequest("session.tools.getCurrentMetadata", { sessionId }),
|
|
1808
|
+
/**
|
|
1809
|
+
* 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.
|
|
1810
|
+
*
|
|
1811
|
+
* @param params Complete externally implemented tool list for the calling connection. An empty list removes every tool previously supplied by that connection.
|
|
1812
|
+
*
|
|
1813
|
+
* @returns Empty result after replacing the calling connection's externally implemented tools.
|
|
1814
|
+
*/
|
|
1815
|
+
set: async (params) => connection.sendRequest("session.tools.set", { sessionId, ...params }),
|
|
1669
1816
|
/**
|
|
1670
1817
|
* Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions.
|
|
1671
1818
|
*
|
|
@@ -1748,7 +1895,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1748
1895
|
*
|
|
1749
1896
|
* @param params Transient question to answer without adding it to conversation history.
|
|
1750
1897
|
*
|
|
1751
|
-
* @returns
|
|
1898
|
+
* @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.
|
|
1752
1899
|
*/
|
|
1753
1900
|
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", { sessionId, ...params }),
|
|
1754
1901
|
/**
|
|
@@ -1855,19 +2002,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1855
2002
|
*/
|
|
1856
2003
|
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { sessionId, ...params }),
|
|
1857
2004
|
/**
|
|
1858
|
-
* Sets the
|
|
2005
|
+
* 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.
|
|
1859
2006
|
*
|
|
1860
|
-
* @param params
|
|
2007
|
+
* @param params Permission mode to apply for the session.
|
|
1861
2008
|
*
|
|
1862
|
-
* @returns Indicates whether the
|
|
2009
|
+
* @returns Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.
|
|
1863
2010
|
*/
|
|
1864
|
-
|
|
2011
|
+
setMode: async (params) => connection.sendRequest("session.permissions.setMode", { sessionId, ...params }),
|
|
1865
2012
|
/**
|
|
1866
|
-
* Returns the current
|
|
2013
|
+
* Returns the current permission mode for the session.
|
|
1867
2014
|
*
|
|
1868
|
-
* @returns Current
|
|
2015
|
+
* @returns Current permission mode.
|
|
1869
2016
|
*/
|
|
1870
|
-
|
|
2017
|
+
getMode: async () => connection.sendRequest("session.permissions.getMode", { sessionId }),
|
|
1871
2018
|
/**
|
|
1872
2019
|
* Adds or removes session-scoped or location-scoped permission rules.
|
|
1873
2020
|
*
|
|
@@ -1909,7 +2056,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1909
2056
|
*/
|
|
1910
2057
|
list: async () => connection.sendRequest("session.permissions.paths.list", { sessionId }),
|
|
1911
2058
|
/**
|
|
1912
|
-
* Adds a directory to the session's allow-list.
|
|
2059
|
+
* Adds a directory to the session's allow-list and activates conventional skill and agent definitions under it.
|
|
1913
2060
|
*
|
|
1914
2061
|
* @param params Directory path to add to the session's allowed directories.
|
|
1915
2062
|
*
|
|
@@ -2385,6 +2532,109 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2385
2532
|
*/
|
|
2386
2533
|
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", { sessionId, ...params }),
|
|
2387
2534
|
/** @experimental */
|
|
2535
|
+
gitHubAuth: {
|
|
2536
|
+
/**
|
|
2537
|
+
* Gets the current authentication information for internal session hosts.
|
|
2538
|
+
*
|
|
2539
|
+
* @returns Current authentication information, or null when no authentication is active.
|
|
2540
|
+
*/
|
|
2541
|
+
getCurrentAuthInfo: async () => connection.sendRequest("session.gitHubAuth.getCurrentAuthInfo", { sessionId }),
|
|
2542
|
+
/**
|
|
2543
|
+
* Gets all authentication accounts available to the internal session host.
|
|
2544
|
+
*
|
|
2545
|
+
* @returns Authentication accounts available to the internal session host.
|
|
2546
|
+
*/
|
|
2547
|
+
getAllAuthAvailable: async () => connection.sendRequest("session.gitHubAuth.getAllAuthAvailable", { sessionId }),
|
|
2548
|
+
/**
|
|
2549
|
+
* Refreshes Copilot account metadata for the current authentication.
|
|
2550
|
+
*
|
|
2551
|
+
* @returns Current authentication information, or null when no authentication is active.
|
|
2552
|
+
*/
|
|
2553
|
+
refreshCopilotUser: async () => connection.sendRequest("session.gitHubAuth.refreshCopilotUser", { sessionId }),
|
|
2554
|
+
/**
|
|
2555
|
+
* Logs in a GitHub user through the internal session host.
|
|
2556
|
+
*
|
|
2557
|
+
* @param params Internal GitHub login parameters.
|
|
2558
|
+
*
|
|
2559
|
+
* @returns Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
|
|
2560
|
+
*/
|
|
2561
|
+
login: async (params) => connection.sendRequest("session.gitHubAuth.login", { sessionId, ...params }),
|
|
2562
|
+
/**
|
|
2563
|
+
* Switches the session to another available authentication.
|
|
2564
|
+
*
|
|
2565
|
+
* @param params Parameters for switching the session's active authentication.
|
|
2566
|
+
*/
|
|
2567
|
+
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", { sessionId, ...params }),
|
|
2568
|
+
/**
|
|
2569
|
+
* Logs out the session's current GitHub authentication.
|
|
2570
|
+
*
|
|
2571
|
+
* @returns Whether the current authentication was logged out.
|
|
2572
|
+
*/
|
|
2573
|
+
logout: async () => connection.sendRequest("session.gitHubAuth.logout", { sessionId }),
|
|
2574
|
+
/**
|
|
2575
|
+
* Logs out a specific GitHub authentication.
|
|
2576
|
+
*
|
|
2577
|
+
* @param params Parameters identifying a GitHub authentication to log out.
|
|
2578
|
+
*
|
|
2579
|
+
* @returns Whether the requested authentication was logged out.
|
|
2580
|
+
*/
|
|
2581
|
+
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", { sessionId, ...params }),
|
|
2582
|
+
/**
|
|
2583
|
+
* Gets validation errors from the most recent authentication attempt.
|
|
2584
|
+
*
|
|
2585
|
+
* @returns Validation errors from the most recent authentication attempt.
|
|
2586
|
+
*/
|
|
2587
|
+
lastAuthErrors: async () => connection.sendRequest("session.gitHubAuth.lastAuthErrors", { sessionId })
|
|
2588
|
+
},
|
|
2589
|
+
/** @experimental */
|
|
2590
|
+
canvas: {
|
|
2591
|
+
/** @experimental */
|
|
2592
|
+
provider: {
|
|
2593
|
+
/**
|
|
2594
|
+
* Registers an internal canvas provider connection and its contributions.
|
|
2595
|
+
*
|
|
2596
|
+
* @param params Internal canvas provider registration parameters.
|
|
2597
|
+
*/
|
|
2598
|
+
register: async (params) => connection.sendRequest("session.canvas.provider.register", { sessionId, ...params }),
|
|
2599
|
+
/**
|
|
2600
|
+
* Unregisters an internal canvas provider connection.
|
|
2601
|
+
*
|
|
2602
|
+
* @param params Internal canvas provider unregistration parameters.
|
|
2603
|
+
*/
|
|
2604
|
+
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", { sessionId, ...params })
|
|
2605
|
+
}
|
|
2606
|
+
},
|
|
2607
|
+
/** @experimental */
|
|
2608
|
+
factory: {
|
|
2609
|
+
/**
|
|
2610
|
+
* Internal tool-originated factory invocation.
|
|
2611
|
+
*
|
|
2612
|
+
* @param params Internal parameters for invoking a registered factory from a tool.
|
|
2613
|
+
*
|
|
2614
|
+
* @returns Complete current or terminal factory run envelope.
|
|
2615
|
+
*/
|
|
2616
|
+
runFromTool: async (params) => connection.sendRequest("session.factory.runFromTool", { sessionId, ...params }),
|
|
2617
|
+
/**
|
|
2618
|
+
* Internal tool-originated factory resume.
|
|
2619
|
+
*
|
|
2620
|
+
* @param params Internal parameters for resuming a factory run from a tool.
|
|
2621
|
+
*
|
|
2622
|
+
* @returns Resolved persisted factory identity and resumed run envelope.
|
|
2623
|
+
*/
|
|
2624
|
+
resumeFromTool: async (params) => connection.sendRequest("session.factory.resumeFromTool", { sessionId, ...params })
|
|
2625
|
+
},
|
|
2626
|
+
/** @experimental */
|
|
2627
|
+
model: {
|
|
2628
|
+
/**
|
|
2629
|
+
* Resolves and applies organization-managed and repository model overlays.
|
|
2630
|
+
*
|
|
2631
|
+
* @param params Managed, repository, and CLI model overrides to overlay onto the session at startup.
|
|
2632
|
+
*
|
|
2633
|
+
* @returns The model identifier active on the session after the switch.
|
|
2634
|
+
*/
|
|
2635
|
+
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", { sessionId, ...params })
|
|
2636
|
+
},
|
|
2637
|
+
/** @experimental */
|
|
2388
2638
|
mcp: {
|
|
2389
2639
|
/**
|
|
2390
2640
|
* Reloads MCP server connections for the session with an explicit host-provided configuration.
|
|
@@ -2397,7 +2647,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2397
2647
|
/**
|
|
2398
2648
|
* Configures the built-in GitHub MCP server for the session's current auth context.
|
|
2399
2649
|
*
|
|
2400
|
-
* @param params
|
|
2650
|
+
* @param params Credential-free authentication identity used to configure GitHub MCP.
|
|
2401
2651
|
*
|
|
2402
2652
|
* @returns Result of configuring GitHub MCP.
|
|
2403
2653
|
*/
|
|
@@ -2416,6 +2666,17 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2416
2666
|
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
2417
2667
|
},
|
|
2418
2668
|
/** @experimental */
|
|
2669
|
+
commands: {
|
|
2670
|
+
/**
|
|
2671
|
+
* Finalizes persistence associated with a client-applied slash-command effect.
|
|
2672
|
+
*
|
|
2673
|
+
* @param params The pending slash-command invocation effect to finalize, plus whether the host applied or cancelled it.
|
|
2674
|
+
*
|
|
2675
|
+
* @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not.
|
|
2676
|
+
*/
|
|
2677
|
+
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", { sessionId, ...params })
|
|
2678
|
+
},
|
|
2679
|
+
/** @experimental */
|
|
2419
2680
|
settings: {
|
|
2420
2681
|
/**
|
|
2421
2682
|
* 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.
|
|
@@ -2558,6 +2819,11 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2558
2819
|
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
2559
2820
|
return handler.abort(params);
|
|
2560
2821
|
});
|
|
2822
|
+
connection.onRequest("tasks.cancel", async (params) => {
|
|
2823
|
+
const handler = getHandlers(params.sessionId).tasks;
|
|
2824
|
+
if (!handler) throw new Error(`No tasks handler registered for session: ${params.sessionId}`);
|
|
2825
|
+
return handler.cancel(params);
|
|
2826
|
+
});
|
|
2561
2827
|
connection.onRequest("sessionFs.readFile", async (params) => {
|
|
2562
2828
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
2563
2829
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
@@ -2660,6 +2926,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
2660
2926
|
if (!handler) return;
|
|
2661
2927
|
await handler.event(params);
|
|
2662
2928
|
});
|
|
2929
|
+
connection.onRequest("gitHubToken.getToken", async (params) => {
|
|
2930
|
+
const handler = handlers.gitHubToken;
|
|
2931
|
+
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
2932
|
+
return handler.getToken(params);
|
|
2933
|
+
});
|
|
2663
2934
|
}
|
|
2664
2935
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2665
2936
|
0 && (module.exports = {
|
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
CopilotWebSocketCloseStatus: () => import_types2.CopilotWebSocketCloseStatus,
|
|
28
28
|
CopilotWebSocketForwarder: () => import_types2.CopilotWebSocketForwarder,
|
|
29
29
|
CopilotWebSocketHandler: () => import_types2.CopilotWebSocketHandler,
|
|
30
|
+
DisableBypassPermissionsModes: () => import_types.DisableBypassPermissionsModes,
|
|
30
31
|
FactoryResumeError: () => import_factory.FactoryResumeError,
|
|
31
32
|
RuntimeConnection: () => import_types.RuntimeConnection,
|
|
32
33
|
SYSTEM_MESSAGE_SECTIONS: () => import_types2.SYSTEM_MESSAGE_SECTIONS,
|
|
@@ -60,6 +61,7 @@ var import_types2 = require("./types.js");
|
|
|
60
61
|
CopilotWebSocketCloseStatus,
|
|
61
62
|
CopilotWebSocketForwarder,
|
|
62
63
|
CopilotWebSocketHandler,
|
|
64
|
+
DisableBypassPermissionsModes,
|
|
63
65
|
FactoryResumeError,
|
|
64
66
|
RuntimeConnection,
|
|
65
67
|
SYSTEM_MESSAGE_SECTIONS,
|