@github/copilot-language-server 1.552.0 → 1.554.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/README.md +94 -1
- package/dist/contextWorker.js +14 -14
- package/dist/main.js +1030 -1020
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/cliVersion.js +1 -1
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/client.js +507 -37
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/copilotRequestHandler.js +156 -20
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/extension.js +13 -9
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/ffiRuntimeHost.js +14 -3
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/generated/rpc.js +1366 -304
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/host.js +67 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/index.js +12 -7
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/installationConfirmation.js +98 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/runtimeArtifacts.js +1 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/schema.js +40 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/session.js +474 -151
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/sessionFsProvider.js +57 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/types.js +5 -2
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/{factory.js → workflow.js} +33 -33
- package/dist/node_modules/@github/copilot-sdk/package.json +27 -16
- package/dist/node_modules/zod/locales/package.json +1 -2
- package/dist/node_modules/zod/mini/package.json +1 -2
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/node_modules/zod/v3/package.json +1 -2
- package/dist/node_modules/zod/v4/classic/errors.js +2 -2
- package/dist/node_modules/zod/v4/classic/from-json-schema.cjs +16 -31
- package/dist/node_modules/zod/v4/classic/from-json-schema.js +16 -31
- package/dist/node_modules/zod/v4/classic/package.json +1 -2
- package/dist/node_modules/zod/v4/classic/schemas.cjs +119 -358
- package/dist/node_modules/zod/v4/classic/schemas.js +118 -356
- package/dist/node_modules/zod/v4/core/api.cjs +2 -7
- package/dist/node_modules/zod/v4/core/api.js +2 -7
- package/dist/node_modules/zod/v4/core/core.cjs +1 -3
- package/dist/node_modules/zod/v4/core/core.js +2 -4
- package/dist/node_modules/zod/v4/core/errors.cjs +23 -26
- package/dist/node_modules/zod/v4/core/errors.js +23 -26
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +20 -16
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +20 -16
- package/dist/node_modules/zod/v4/core/package.json +1 -2
- package/dist/node_modules/zod/v4/core/parse.cjs +7 -7
- package/dist/node_modules/zod/v4/core/parse.js +7 -7
- package/dist/node_modules/zod/v4/core/regexes.cjs +3 -9
- package/dist/node_modules/zod/v4/core/regexes.js +1 -7
- package/dist/node_modules/zod/v4/core/schemas.cjs +65 -211
- package/dist/node_modules/zod/v4/core/schemas.js +64 -210
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs +1 -12
- package/dist/node_modules/zod/v4/core/to-json-schema.js +1 -12
- package/dist/node_modules/zod/v4/core/util.cjs +30 -54
- package/dist/node_modules/zod/v4/core/util.js +32 -55
- package/dist/node_modules/zod/v4/core/versions.cjs +2 -2
- package/dist/node_modules/zod/v4/core/versions.js +2 -2
- package/dist/node_modules/zod/v4/locales/en.cjs +0 -4
- package/dist/node_modules/zod/v4/locales/en.js +0 -4
- package/dist/node_modules/zod/v4/locales/fr.cjs +7 -24
- package/dist/node_modules/zod/v4/locales/fr.js +7 -24
- package/dist/node_modules/zod/v4/locales/index.cjs +1 -8
- package/dist/node_modules/zod/v4/locales/index.js +0 -3
- package/dist/node_modules/zod/v4/locales/it.cjs +1 -1
- package/dist/node_modules/zod/v4/locales/it.js +1 -1
- package/dist/node_modules/zod/v4/locales/ka.cjs +8 -8
- package/dist/node_modules/zod/v4/locales/ka.js +8 -8
- package/dist/node_modules/zod/v4/locales/package.json +1 -2
- package/dist/node_modules/zod/v4/locales/uz.cjs +0 -1
- package/dist/node_modules/zod/v4/locales/uz.js +0 -1
- package/dist/node_modules/zod/v4/mini/package.json +1 -2
- package/dist/node_modules/zod/v4/mini/schemas.cjs +4 -41
- package/dist/node_modules/zod/v4/mini/schemas.js +4 -40
- package/dist/node_modules/zod/v4/package.json +1 -2
- package/dist/node_modules/zod/v4-mini/package.json +1 -2
- package/package.json +20 -20
- package/dist/node_modules/zod/v4/locales/el.cjs +0 -136
- package/dist/node_modules/zod/v4/locales/el.js +0 -109
- package/dist/node_modules/zod/v4/locales/hr.cjs +0 -149
- package/dist/node_modules/zod/v4/locales/hr.js +0 -122
- package/dist/node_modules/zod/v4/locales/ro.cjs +0 -146
- package/dist/node_modules/zod/v4/locales/ro.js +0 -119
|
@@ -28,6 +28,68 @@ __export(rpc_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(rpc_exports);
|
|
29
29
|
function createServerRpc(connection) {
|
|
30
30
|
return {
|
|
31
|
+
/** @experimental */
|
|
32
|
+
environments: {
|
|
33
|
+
/**
|
|
34
|
+
* Lists GitHub Mission Control environments visible to the authenticated identity. Does not require a running host and excludes host relay credentials.
|
|
35
|
+
*
|
|
36
|
+
* @param params Optional discovery filters supported by GitHub Mission Control.
|
|
37
|
+
*
|
|
38
|
+
* @returns Environments visible to the authenticated caller and matching the supplied filters.
|
|
39
|
+
*/
|
|
40
|
+
list: async (params) => connection.sendRequest("environments.list", params),
|
|
41
|
+
/**
|
|
42
|
+
* Gets safe discovery information for a GitHub Mission Control environment without requiring a running host.
|
|
43
|
+
*
|
|
44
|
+
* @param params Identify a Mission Control environment to retrieve.
|
|
45
|
+
*
|
|
46
|
+
* @returns Safe discovery information for the requested environment.
|
|
47
|
+
*/
|
|
48
|
+
get: async (params) => connection.sendRequest("environments.get", params),
|
|
49
|
+
/**
|
|
50
|
+
* Deletes a user-managed GitHub Mission Control environment. GitHub-managed environments cannot be deleted. Does not stop a running host, which may register again.
|
|
51
|
+
*
|
|
52
|
+
* @param params Identify a user-managed Mission Control environment to delete.
|
|
53
|
+
*
|
|
54
|
+
* @returns Acknowledgement that the requested environment was deleted.
|
|
55
|
+
*/
|
|
56
|
+
delete: async (params) => connection.sendRequest("environments.delete", params)
|
|
57
|
+
},
|
|
58
|
+
/** @experimental */
|
|
59
|
+
host: {
|
|
60
|
+
/**
|
|
61
|
+
* Publishes an attached resident session for this listener's lifetime without copying it.
|
|
62
|
+
*
|
|
63
|
+
* @param params Publishes a resident session attached to the listener's owning connection.
|
|
64
|
+
*
|
|
65
|
+
* @returns The existing runtime identity and its resource on the listener.
|
|
66
|
+
*/
|
|
67
|
+
publishSession: async (params) => connection.sendRequest("host.publishSession", params),
|
|
68
|
+
/**
|
|
69
|
+
* Reads the complete advertised live and dormant session catalog of an existing host owned by this connection. Does not start hosting, subscribe to sessions, or guarantee resumability.
|
|
70
|
+
*
|
|
71
|
+
* @param params Reads a running host's catalog or the runtime's saved default catalog.
|
|
72
|
+
*
|
|
73
|
+
* @returns The complete live and dormant advertised catalog, without subscribing to sessions.
|
|
74
|
+
*/
|
|
75
|
+
listSessions: async (params) => connection.sendRequest("host.listSessions", params),
|
|
76
|
+
/**
|
|
77
|
+
* Starts a connection-owned AHP host with explicit localServer and/or githubEnvironment transports as a supervised SDK participant.
|
|
78
|
+
*
|
|
79
|
+
* @param params Starts a supervised AHP host with at least one explicitly selected transport.
|
|
80
|
+
*
|
|
81
|
+
* @returns Listener readiness, returned only after binding and the supervised participant's SDK handshake.
|
|
82
|
+
*/
|
|
83
|
+
start: async (params) => connection.sendRequest("host.start", params),
|
|
84
|
+
/**
|
|
85
|
+
* Stops a listener owned by this SDK connection and joins its cleanup without deleting sessions.
|
|
86
|
+
*
|
|
87
|
+
* @param params Stops a connection-owned listener and joins its teardown.
|
|
88
|
+
*
|
|
89
|
+
* @returns Empty acknowledgement for a completed host lifecycle operation.
|
|
90
|
+
*/
|
|
91
|
+
dispose: async (params) => connection.sendRequest("host.dispose", params)
|
|
92
|
+
},
|
|
31
93
|
/**
|
|
32
94
|
* Checks server responsiveness and returns protocol information.
|
|
33
95
|
*
|
|
@@ -67,6 +129,56 @@ function createServerRpc(connection) {
|
|
|
67
129
|
getBuiltInCatalog: async () => connection.sendRequest("models.getBuiltInCatalog", {})
|
|
68
130
|
},
|
|
69
131
|
/** @experimental */
|
|
132
|
+
sandbox: {
|
|
133
|
+
/**
|
|
134
|
+
* Reports whether the host running this runtime can run the command sandbox, without starting a session or spawning a sandboxed command.
|
|
135
|
+
*
|
|
136
|
+
* @returns Whether the host running this runtime can run the command sandbox. The runtime checks `supported` once per process. A capability answer can change while the process runs, for example after the user installs a missing package.
|
|
137
|
+
*/
|
|
138
|
+
getHostSupport: async () => connection.sendRequest("sandbox.getHostSupport", {}),
|
|
139
|
+
/** @experimental */
|
|
140
|
+
proxyCa: {
|
|
141
|
+
/**
|
|
142
|
+
* Reports whether the persistent certificate authority of the sandbox credential proxy exists, whether OS trust includes it, and whether it must be rotated. Changes nothing.
|
|
143
|
+
*
|
|
144
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
145
|
+
*
|
|
146
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
147
|
+
*/
|
|
148
|
+
getStatus: async (params) => connection.sendRequest("sandbox.proxyCa.getStatus", params),
|
|
149
|
+
/**
|
|
150
|
+
* Creates the persistent certificate authority of the sandbox credential proxy if none is stored, without changing OS trust, and returns the path of its public certificate. Keeps an existing certificate authority, even one that must be rotated. Fails where OS trust is unsupported. Trust it with sandbox.proxyCa.trust: the CLI trusts only the hosts in the saved user settings, so it refuses a certificate authority that also covers hosts from sandboxConfig.
|
|
151
|
+
*
|
|
152
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
153
|
+
*
|
|
154
|
+
* @returns Result of creating the persistent certificate authority of the sandbox credential proxy.
|
|
155
|
+
*/
|
|
156
|
+
create: async (params) => connection.sendRequest("sandbox.proxyCa.create", params),
|
|
157
|
+
/**
|
|
158
|
+
* Replaces the persistent certificate authority of the sandbox credential proxy with a new one for the current credential hosts. If OS trust included the old one, removes it and trusts the new one, which can show an OS authentication prompt. Running sandboxed tools keep the old certificate authority until they restart.
|
|
159
|
+
*
|
|
160
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
161
|
+
*
|
|
162
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
163
|
+
*/
|
|
164
|
+
rotate: async (params) => connection.sendRequest("sandbox.proxyCa.rotate", params),
|
|
165
|
+
/**
|
|
166
|
+
* Adds the persistent certificate authority of the sandbox credential proxy to OS trust, so sandboxed clients that read only OS trust accept the proxy. Call create first. Refuses a certificate authority that is not constrained to the current credential hosts. Can show an OS authentication prompt.
|
|
167
|
+
*
|
|
168
|
+
* @param params Identifies the credential hosts that the persistent certificate authority of the sandbox credential proxy must cover. The runtime always adds the hosts from the saved user settings.
|
|
169
|
+
*
|
|
170
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
171
|
+
*/
|
|
172
|
+
trust: async (params) => connection.sendRequest("sandbox.proxyCa.trust", params),
|
|
173
|
+
/**
|
|
174
|
+
* Removes the persistent certificate authority of the sandbox credential proxy from OS trust. Keeps the stored certificate authority. Can show an OS authentication prompt. Sandboxed clients that read only OS trust then reject the proxy; clients that read the per-process certificate bundle continue to work.
|
|
175
|
+
*
|
|
176
|
+
* @returns Status of the persistent certificate authority of the sandbox credential proxy.
|
|
177
|
+
*/
|
|
178
|
+
remove: async () => connection.sendRequest("sandbox.proxyCa.remove", {})
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
/** @experimental */
|
|
70
182
|
tools: {
|
|
71
183
|
/**
|
|
72
184
|
* Lists built-in tools available for a model.
|
|
@@ -187,7 +299,74 @@ function createServerRpc(connection) {
|
|
|
187
299
|
*
|
|
188
300
|
* @returns Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.
|
|
189
301
|
*/
|
|
190
|
-
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params)
|
|
302
|
+
planInstall: async (params) => connection.sendRequest("mcp.planInstall", params),
|
|
303
|
+
/**
|
|
304
|
+
* Consumes a bound catalogue plan and retains one exact fully resolved personal remote MCP operation requiring no supplied values or configured secrets. Returns its runtime operation ID and original expiry before any confirmation, activation, writer initialisation or installation effect. Register the original connection, operation and selected-session binding before calling applyInstall. Missing lower owned admission is unavailable, never a raw-config fallback.
|
|
305
|
+
*
|
|
306
|
+
* @param params Side-effect-free preparation of one original bound remote MCP choice.
|
|
307
|
+
*
|
|
308
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
309
|
+
*/
|
|
310
|
+
prepareInstall: async (params) => connection.sendRequest("mcp.prepareInstall", params),
|
|
311
|
+
/**
|
|
312
|
+
* Consumes a retained prepared MCP operation once, revalidates its original authority, requests explicit human consent through installations.confirm on the original connection, then revalidates source and applies the sealed transaction. An uncertain result requires original-operation inspection or recovery, never replay.
|
|
313
|
+
*
|
|
314
|
+
* @param params Applies exactly one previously prepared operation on its original connection.
|
|
315
|
+
*
|
|
316
|
+
* @returns An installation result together with the exact honoured contract, or a negotiation refusal.
|
|
317
|
+
*/
|
|
318
|
+
applyInstall: async (params) => connection.sendRequest("mcp.applyInstall", params),
|
|
319
|
+
/**
|
|
320
|
+
* Prepares a read-only removal plan for an exact owned receipt under the selected existing session. Returns the original operation ID before confirmation; neither planning nor abandonment changes configuration or shared OAuth credentials.
|
|
321
|
+
*
|
|
322
|
+
* @param params Read-only preparation of one owned removal under fresh selected-session authority.
|
|
323
|
+
*
|
|
324
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
325
|
+
*/
|
|
326
|
+
planUninstall: async (params) => connection.sendRequest("mcp.planUninstall", params),
|
|
327
|
+
/**
|
|
328
|
+
* Consumes the original owned-removal plan once and requests fresh exact human confirmation on its original connection. Drift is refused; unrelated manual configuration and shared OAuth credentials are preserved.
|
|
329
|
+
*
|
|
330
|
+
* @param params One-use application of the exact retained removal plan.
|
|
331
|
+
*
|
|
332
|
+
* @returns An installation result together with the exact honoured contract, or a negotiation refusal.
|
|
333
|
+
*/
|
|
334
|
+
applyUninstall: async (params) => connection.sendRequest("mcp.applyUninstall", params),
|
|
335
|
+
/** @experimental */
|
|
336
|
+
installations: {
|
|
337
|
+
/**
|
|
338
|
+
* Reads receipt-owned MCP inventory for the selected account and host without activating servers or reconstructing missing ownership. Configuration ownership does not prove session-specific usability.
|
|
339
|
+
*
|
|
340
|
+
* @param params New-work inventory or recovery request under an explicitly selected existing session.
|
|
341
|
+
*
|
|
342
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
343
|
+
*/
|
|
344
|
+
list: async (params) => connection.sendRequest("mcp.installations.list", params),
|
|
345
|
+
/**
|
|
346
|
+
* Reconciles already-confirmed durable MCP transactions, then inspects owned inventory. Does not replay apply or reconstruct deleted ownership metadata; unresolved or unsafe evidence remains an explicit refusal.
|
|
347
|
+
*
|
|
348
|
+
* @param params New-work inventory or recovery request under an explicitly selected existing session.
|
|
349
|
+
*
|
|
350
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
351
|
+
*/
|
|
352
|
+
recover: async (params) => connection.sendRequest("mcp.installations.recover", params),
|
|
353
|
+
/**
|
|
354
|
+
* Inspects a known operation only on its original connection. Remains available after account or selected-session loss; does not acquire new authority or rebind an operation.
|
|
355
|
+
*
|
|
356
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
357
|
+
*
|
|
358
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
359
|
+
*/
|
|
360
|
+
status: async (params) => connection.sendRequest("mcp.installations.status", params),
|
|
361
|
+
/**
|
|
362
|
+
* Requests cancellation of a known operation on its original connection, including before apply or confirmation. Already-started effects retain their transaction lease and report an honest terminal or recovery outcome.
|
|
363
|
+
*
|
|
364
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
365
|
+
*
|
|
366
|
+
* @returns Management result with contract receipt, or a typed request/negotiation refusal.
|
|
367
|
+
*/
|
|
368
|
+
cancel: async (params) => connection.sendRequest("mcp.installations.cancel", params)
|
|
369
|
+
}
|
|
191
370
|
},
|
|
192
371
|
/** @experimental */
|
|
193
372
|
extensions: {
|
|
@@ -210,6 +389,115 @@ function createServerRpc(connection) {
|
|
|
210
389
|
*/
|
|
211
390
|
disable: async (params) => connection.sendRequest("extensions.disable", params)
|
|
212
391
|
},
|
|
392
|
+
/** @experimental */
|
|
393
|
+
skills: {
|
|
394
|
+
/**
|
|
395
|
+
* Plans installation of a verified Agent Finder Skill candidate without writing files. The returned review is safe to present to a user and installing always leaves the Skill disabled until separately enabled.
|
|
396
|
+
*
|
|
397
|
+
* @param params Side-effect-free planning of one verified Agent Finder Skill candidate.
|
|
398
|
+
*
|
|
399
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
400
|
+
*/
|
|
401
|
+
planInstall: async (params) => connection.sendRequest("skills.planInstall", params),
|
|
402
|
+
/**
|
|
403
|
+
* Consumes one verified Skill installation plan, requests explicit human consent through installations.confirm on the original connection, then revalidates and installs the Skill disabled.
|
|
404
|
+
*
|
|
405
|
+
* @param params Applies exactly one retained verified Skill installation plan.
|
|
406
|
+
*
|
|
407
|
+
* @returns Skill installation result with the honoured contract, or a typed request/negotiation refusal.
|
|
408
|
+
*/
|
|
409
|
+
applyInstall: async (params) => connection.sendRequest("skills.applyInstall", params),
|
|
410
|
+
/** @experimental */
|
|
411
|
+
installations: {
|
|
412
|
+
/**
|
|
413
|
+
* Lists owned verified Agent Finder Skill installations for the selected existing session. Listing is never gated by the Skill-install feature flag.
|
|
414
|
+
*
|
|
415
|
+
* @param params Inventory request under an explicitly selected existing session.
|
|
416
|
+
*
|
|
417
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
418
|
+
*/
|
|
419
|
+
list: async (params) => connection.sendRequest("skills.installations.list", params),
|
|
420
|
+
/**
|
|
421
|
+
* Reconciles interrupted owned Skill installation work for the selected existing session, then inspects owned inventory. Recovery is never gated by the Skill-install feature flag.
|
|
422
|
+
*
|
|
423
|
+
* @param params Inventory request under an explicitly selected existing session.
|
|
424
|
+
*
|
|
425
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
426
|
+
*/
|
|
427
|
+
recover: async (params) => connection.sendRequest("skills.installations.recover", params),
|
|
428
|
+
/**
|
|
429
|
+
* Inspects a known Skill installation operation on its original runtime connection. Status is never gated by the Skill-install feature flag.
|
|
430
|
+
*
|
|
431
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
432
|
+
*
|
|
433
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
434
|
+
*/
|
|
435
|
+
status: async (params) => connection.sendRequest("skills.installations.status", params),
|
|
436
|
+
/**
|
|
437
|
+
* Requests cancellation of a known Skill installation operation before commit. Already-started durable work requires recovery instead of silent replay.
|
|
438
|
+
*
|
|
439
|
+
* @param params Existing-operation control. A new session selector is deliberately not accepted.
|
|
440
|
+
*
|
|
441
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
442
|
+
*/
|
|
443
|
+
cancel: async (params) => connection.sendRequest("skills.installations.cancel", params),
|
|
444
|
+
/**
|
|
445
|
+
* Atomically persists enablement for one owned Agent Finder Skill and reconciles the selected bound session. Enablement is installation-scoped by receipt identity and is never gated by the Skill-install feature flag.
|
|
446
|
+
*
|
|
447
|
+
* @param params Persisted enablement update for one owned Skill installation.
|
|
448
|
+
*
|
|
449
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
450
|
+
*/
|
|
451
|
+
setEnabled: async (params) => connection.sendRequest("skills.installations.setEnabled", params)
|
|
452
|
+
},
|
|
453
|
+
/**
|
|
454
|
+
* Prepares a read-only removal plan for an owned verified Agent Finder Skill installation. Uninstall planning is never gated by the Skill-install feature flag.
|
|
455
|
+
*
|
|
456
|
+
* @param params Read-only preparation of one owned Skill removal under fresh selected-session authority.
|
|
457
|
+
*
|
|
458
|
+
* @returns Skill installation management result with the honoured contract, or a typed refusal.
|
|
459
|
+
*/
|
|
460
|
+
planUninstall: async (params) => connection.sendRequest("skills.planUninstall", params),
|
|
461
|
+
/**
|
|
462
|
+
* Consumes an owned Skill removal plan, requests explicit human consent through installations.confirm, refuses drift, and removes the exact owned files through quarantine.
|
|
463
|
+
*
|
|
464
|
+
* @param params One-use application of the exact retained Skill removal plan.
|
|
465
|
+
*
|
|
466
|
+
* @returns Skill installation result with the honoured contract, or a typed request/negotiation refusal.
|
|
467
|
+
*/
|
|
468
|
+
applyUninstall: async (params) => connection.sendRequest("skills.applyUninstall", params),
|
|
469
|
+
/** @experimental */
|
|
470
|
+
config: {
|
|
471
|
+
/**
|
|
472
|
+
* Replaces the global list of disabled skills.
|
|
473
|
+
*
|
|
474
|
+
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
475
|
+
*/
|
|
476
|
+
setDisabledSkills: async (params) => connection.sendRequest("skills.config.setDisabledSkills", params),
|
|
477
|
+
/**
|
|
478
|
+
* Atomically adds or removes one skill from the disabled list.
|
|
479
|
+
*
|
|
480
|
+
* @param params Adds or removes a single skill from the global disabled list, leaving every other entry untouched.
|
|
481
|
+
*/
|
|
482
|
+
setSkillDisabled: async (params) => connection.sendRequest("skills.config.setSkillDisabled", params)
|
|
483
|
+
},
|
|
484
|
+
/**
|
|
485
|
+
* Discovers skills across global and project sources.
|
|
486
|
+
*
|
|
487
|
+
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
488
|
+
*
|
|
489
|
+
* @returns Skills discovered across global and project sources.
|
|
490
|
+
*/
|
|
491
|
+
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
492
|
+
/**
|
|
493
|
+
* Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.
|
|
494
|
+
*
|
|
495
|
+
* @param params Optional project paths to enumerate.
|
|
496
|
+
*
|
|
497
|
+
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
498
|
+
*/
|
|
499
|
+
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
500
|
+
},
|
|
213
501
|
/**
|
|
214
502
|
* 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.
|
|
215
503
|
*
|
|
@@ -225,7 +513,15 @@ function createServerRpc(connection) {
|
|
|
225
513
|
*
|
|
226
514
|
* @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
|
|
227
515
|
*/
|
|
228
|
-
search: async (params) => connection.sendRequest("catalog.search", params)
|
|
516
|
+
search: async (params) => connection.sendRequest("catalog.search", params),
|
|
517
|
+
/**
|
|
518
|
+
* Terminates one retained catalog selection group. A selected outcome returns the native host a fresh single-use candidate handle plus the original searchId for a later explicit mcp.planInstall call; non-selected outcomes release the group without producing a planning input. Candidate state, cards, URLs, credentials and private identifiers remain inside the runtime. The model-facing catalog_select tool projects the result separately and never exposes the candidate handle or searchId.
|
|
519
|
+
*
|
|
520
|
+
* @param params Terminates one retained catalog selection group through an opaque reference previously returned by the model-safe search projection.
|
|
521
|
+
*
|
|
522
|
+
* @returns Typed outcome of catalog.select. Only the selected host result carries a fresh candidate handle; the model-facing projection removes both that handle and searchId.
|
|
523
|
+
*/
|
|
524
|
+
select: async (params) => connection.sendRequest("catalog.select", params)
|
|
229
525
|
},
|
|
230
526
|
/** @experimental */
|
|
231
527
|
plugins: {
|
|
@@ -327,40 +623,6 @@ function createServerRpc(connection) {
|
|
|
327
623
|
}
|
|
328
624
|
},
|
|
329
625
|
/** @experimental */
|
|
330
|
-
skills: {
|
|
331
|
-
/** @experimental */
|
|
332
|
-
config: {
|
|
333
|
-
/**
|
|
334
|
-
* Replaces the global list of disabled skills.
|
|
335
|
-
*
|
|
336
|
-
* @param params Skill names to mark as disabled in global configuration, replacing any previous list.
|
|
337
|
-
*/
|
|
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)
|
|
345
|
-
},
|
|
346
|
-
/**
|
|
347
|
-
* Discovers skills across global and project sources.
|
|
348
|
-
*
|
|
349
|
-
* @param params Optional project paths and additional skill directories to include in discovery.
|
|
350
|
-
*
|
|
351
|
-
* @returns Skills discovered across global and project sources.
|
|
352
|
-
*/
|
|
353
|
-
discover: async (params) => connection.sendRequest("skills.discover", params),
|
|
354
|
-
/**
|
|
355
|
-
* Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.
|
|
356
|
-
*
|
|
357
|
-
* @param params Optional project paths to enumerate.
|
|
358
|
-
*
|
|
359
|
-
* @returns Canonical locations where skills can be created so the runtime will recognize them.
|
|
360
|
-
*/
|
|
361
|
-
getDiscoveryPaths: async (params) => connection.sendRequest("skills.getDiscoveryPaths", params)
|
|
362
|
-
},
|
|
363
|
-
/** @experimental */
|
|
364
626
|
agents: {
|
|
365
627
|
/**
|
|
366
628
|
* Discovers custom agents across user, project, plugin, and remote sources.
|
|
@@ -412,21 +674,15 @@ function createServerRpc(connection) {
|
|
|
412
674
|
/** @experimental */
|
|
413
675
|
settings: {
|
|
414
676
|
/**
|
|
415
|
-
*
|
|
416
|
-
*/
|
|
417
|
-
reload: async () => connection.sendRequest("user.settings.reload", {}),
|
|
418
|
-
/**
|
|
419
|
-
* Lists every known user setting (settings.json overlaid with the legacy config.json, config.json wins), each with its effective value, its default, and whether it is at the default — so settings the user has never set still appear with their default value. Does not include repository- or enterprise-managed overrides that the runtime layers on top at session time.
|
|
677
|
+
* Lists every known user setting from settings.json, each with its effective value, its default, and whether it is at the default — so settings the user has never set still appear with their default value. Does not include repository- or enterprise-managed overrides that the runtime layers on top at session time.
|
|
420
678
|
*
|
|
421
|
-
* @returns Per-key metadata for every known user setting
|
|
679
|
+
* @returns Per-key metadata for every known user setting in settings.json, including settings left at their default. Excludes repository- and enterprise-managed overrides.
|
|
422
680
|
*/
|
|
423
681
|
get: async () => connection.sendRequest("user.settings.get", {}),
|
|
424
682
|
/**
|
|
425
|
-
* Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null is removed.
|
|
683
|
+
* Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null is removed.
|
|
426
684
|
*
|
|
427
685
|
* @param params Partial user settings to write to settings.json. Each top-level key is written individually, replacing the existing value; a key whose value is null is removed.
|
|
428
|
-
*
|
|
429
|
-
* @returns Outcome of writing user settings.
|
|
430
686
|
*/
|
|
431
687
|
set: async (params) => connection.sendRequest("user.settings.set", params)
|
|
432
688
|
}
|
|
@@ -434,15 +690,56 @@ function createServerRpc(connection) {
|
|
|
434
690
|
/** @experimental */
|
|
435
691
|
managedSettings: {
|
|
436
692
|
/**
|
|
437
|
-
* Discovers device-managed settings from production MDM and managed-file sources, validates them against the runtime-owned managed-settings schema, and returns the canonical JSON without requiring a session.
|
|
693
|
+
* Discovers device-managed settings from production MDM and managed-file sources, validates them against the runtime-owned managed-settings schema, and returns the canonical JSON without requiring a session. `managedSettings.resolve` returns the same device settings together with the account's server policy.
|
|
438
694
|
*
|
|
439
695
|
* @returns Validated device-managed settings discovered before a session exists.
|
|
440
696
|
*/
|
|
441
697
|
read: async () => connection.sendRequest("managedSettings.read", {}),
|
|
442
698
|
/**
|
|
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.
|
|
699
|
+
* 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 call `managedSettings.resolve` or 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
700
|
*/
|
|
445
|
-
clearCache: async () => connection.sendRequest("managedSettings.clearCache", {})
|
|
701
|
+
clearCache: async () => connection.sendRequest("managedSettings.clearCache", {}),
|
|
702
|
+
/**
|
|
703
|
+
* Resolves the effective enterprise managed settings without a session, from the device channel and, when an account is available, the account's server policy through the same per-account cache sessions use. A cached server policy less than an hour old is used without a fetch; otherwise the policy is fetched, and when the fetch fails a cached policy up to 24 hours old is used instead, unless `forceRemoteSettingsRefresh` requires a live fetch. With no account requested or signed in, it reports device policy only; signing out removes the account's cached policy. It can fetch server policy over the network when the cache is stale, so call it off latency-critical paths such as startup rather than before listing models. The policy helper is not run. `layers` lists each channel's document before merging, and `values` and `meta` carry typed effective values and their lock state for the keys typed so far.
|
|
704
|
+
*
|
|
705
|
+
* @param params Optional opaque account selection or GitHub token whose managed settings are resolved.
|
|
706
|
+
*
|
|
707
|
+
* @returns Effective enterprise managed settings for an account, resolved without a session.
|
|
708
|
+
*/
|
|
709
|
+
resolve: async (params) => connection.sendRequest("managedSettings.resolve", params),
|
|
710
|
+
/** @experimental */
|
|
711
|
+
permissions: {
|
|
712
|
+
/**
|
|
713
|
+
* Pure, sessionless evaluation of operations against a supplied permissionsContext. Performs no policy discovery, I/O, prompting, navigation, permission grants, or sandbox changes. Obtain the context from managedSettings.resolve or session.managedSettings.get, or reuse an in-memory context. Results preserve input order and duplicates. Consumers must block deny, obtain approval for ask, and use their normal permission flow for unmanaged. Unknown policy returns failClosed with every operation denied. This is not a substitute for user permissions or other security controls.
|
|
714
|
+
*
|
|
715
|
+
* @param params Managed policy context and ordered operations for pure, sessionless evaluation.
|
|
716
|
+
*
|
|
717
|
+
* @returns Ordered managed permission verdicts and the supplied policy's fail-closed posture.
|
|
718
|
+
*/
|
|
719
|
+
evaluate: async (params) => connection.sendRequest("managedSettings.permissions.evaluate", params)
|
|
720
|
+
},
|
|
721
|
+
/**
|
|
722
|
+
* Returns the managed-settings authoring JSON schema with descriptive `x-composition` annotations aligned with the shared settings-engine vocabulary. These annotations are not a complete runtime composition contract: model, effortLevel, and contextTier remain coupled. Use `managedSettings.compose` for the runtime's effective result. Performs no I/O.
|
|
723
|
+
*
|
|
724
|
+
* @returns The authoring JSON schema for managed settings recognized by this runtime.
|
|
725
|
+
*/
|
|
726
|
+
schema: async () => connection.sendRequest("managedSettings.schema", {}),
|
|
727
|
+
/**
|
|
728
|
+
* Validates a candidate managed-settings document the way the runtime validates delivered policy, without applying it. Reports errors that would reject the document, warnings for content the runtime ignores, and the canonical document it would apply. Document text nested more than 64 levels deep is rejected. Performs no I/O.
|
|
729
|
+
*
|
|
730
|
+
* @param params A candidate managed-settings document to validate without applying it.
|
|
731
|
+
*
|
|
732
|
+
* @returns Result of validating a managed-settings document.
|
|
733
|
+
*/
|
|
734
|
+
validate: async (params) => connection.sendRequest("managedSettings.validate", params),
|
|
735
|
+
/**
|
|
736
|
+
* Merges candidate managed-settings documents for the device, server, and policy-helper channels into the effective settings the runtime would enforce on this host, using the same precedence and composition rules as live resolution, without applying them. Like live resolution, a server's advisory sandbox force-enable is declined on a host that cannot run the sandbox. Does not fetch policy or read policy files, but may perform blocking OS or subprocess probes for sandbox support. Preview documents are limited to 1 MiB and 64 levels of nesting.
|
|
737
|
+
*
|
|
738
|
+
* @param params Candidate managed-settings documents to merge without applying them.
|
|
739
|
+
*
|
|
740
|
+
* @returns The effective managed settings the runtime would enforce for the given documents, in the same shape `managedSettings.resolve` returns.
|
|
741
|
+
*/
|
|
742
|
+
compose: async (params) => connection.sendRequest("managedSettings.compose", params)
|
|
446
743
|
},
|
|
447
744
|
/** @experimental */
|
|
448
745
|
runtime: {
|
|
@@ -456,7 +753,7 @@ function createServerRpc(connection) {
|
|
|
456
753
|
/**
|
|
457
754
|
* Registers an SDK client as the session filesystem provider.
|
|
458
755
|
*
|
|
459
|
-
* @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.
|
|
756
|
+
* @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. A registered provider is authoritative for path interpretation and filesystem facts used by workspace permission validation. Paths are interpreted lexically; home-relative paths (`~` and `~/...`) and Windows drive-relative paths such as `C:foo` are unsupported. Until provider-side canonicalization is supported, providers must not expose symlinks inside allowed roots that escape those roots.
|
|
460
757
|
*
|
|
461
758
|
* @returns Indicates whether the calling client was registered as the session filesystem provider.
|
|
462
759
|
*/
|
|
@@ -696,11 +993,81 @@ function createServerRpc(connection) {
|
|
|
696
993
|
* @returns Outcome of an agentRegistry.spawn call.
|
|
697
994
|
*/
|
|
698
995
|
spawn: async (params) => connection.sendRequest("agentRegistry.spawn", params)
|
|
996
|
+
},
|
|
997
|
+
/** @experimental */
|
|
998
|
+
connectors: {
|
|
999
|
+
/**
|
|
1000
|
+
* Returns feature availability.
|
|
1001
|
+
*
|
|
1002
|
+
* @returns Feature availability.
|
|
1003
|
+
*/
|
|
1004
|
+
getCapabilities: async () => connection.sendRequest("connectors.getCapabilities", {}),
|
|
1005
|
+
/**
|
|
1006
|
+
* Returns eligible accounts.
|
|
1007
|
+
*
|
|
1008
|
+
* @returns Eligible accounts.
|
|
1009
|
+
*/
|
|
1010
|
+
getAccounts: async () => connection.sendRequest("connectors.getAccounts", {}),
|
|
1011
|
+
/**
|
|
1012
|
+
* Lists entries for the selected account.
|
|
1013
|
+
*
|
|
1014
|
+
* @param params Selected account.
|
|
1015
|
+
*
|
|
1016
|
+
* @returns Entries for the selected account.
|
|
1017
|
+
*/
|
|
1018
|
+
list: async (params) => connection.sendRequest("connectors.list", params),
|
|
1019
|
+
/**
|
|
1020
|
+
* Refreshes entries for the selected account.
|
|
1021
|
+
*
|
|
1022
|
+
* @param params Selected account.
|
|
1023
|
+
*
|
|
1024
|
+
* @returns Entries for the selected account.
|
|
1025
|
+
*/
|
|
1026
|
+
refresh: async (params) => connection.sendRequest("connectors.refresh", params)
|
|
699
1027
|
}
|
|
700
1028
|
};
|
|
701
1029
|
}
|
|
702
1030
|
function createInternalServerRpc(connection) {
|
|
703
1031
|
return {
|
|
1032
|
+
/** @experimental */
|
|
1033
|
+
host: {
|
|
1034
|
+
/**
|
|
1035
|
+
* Requests app-owned materialization over the owning SDK participant.
|
|
1036
|
+
*
|
|
1037
|
+
* @param params One application-owned session handoff, requested by the supervised hosting participant.
|
|
1038
|
+
*
|
|
1039
|
+
* @returns The resident session the application has materialized on its own connection.
|
|
1040
|
+
*/
|
|
1041
|
+
createSession: async (params) => connection.sendRequest("host.createSession", params),
|
|
1042
|
+
/**
|
|
1043
|
+
* Releases app ownership retention after AHP detaches.
|
|
1044
|
+
*
|
|
1045
|
+
* @param params Ends one participation, not the application's session lifetime.
|
|
1046
|
+
*
|
|
1047
|
+
* @returns Empty acknowledgement for a completed host lifecycle operation.
|
|
1048
|
+
*/
|
|
1049
|
+
releaseSession: async (params) => connection.sendRequest("host.releaseSession", params),
|
|
1050
|
+
/**
|
|
1051
|
+
* Resolves current authenticated credentials and remote-control policy only for the runtime-owned Mission Control hosting participant.
|
|
1052
|
+
*
|
|
1053
|
+
* @returns Private credentials delivered only to a runtime-owned Mission Control hosting participant.
|
|
1054
|
+
*/
|
|
1055
|
+
getEnvironmentCredentials: async () => connection.sendRequest("host.getEnvironmentCredentials", {}),
|
|
1056
|
+
/**
|
|
1057
|
+
* Returns listener settings only to the supervised hosting participant over its SDK connection.
|
|
1058
|
+
*
|
|
1059
|
+
* @returns Normalized listener settings delivered only to the supervised hosting participant.
|
|
1060
|
+
*/
|
|
1061
|
+
getConfiguration: async () => connection.sendRequest("host.getConfiguration", {}),
|
|
1062
|
+
/**
|
|
1063
|
+
* Reports a supervised hosting participant's bound AHP endpoint after its SDK handshake.
|
|
1064
|
+
*
|
|
1065
|
+
* @param params Readiness reported by the supervised hosting participant on its own SDK connection.
|
|
1066
|
+
*
|
|
1067
|
+
* @returns Empty acknowledgement for a completed host lifecycle operation.
|
|
1068
|
+
*/
|
|
1069
|
+
ready: async (params) => connection.sendRequest("host.ready", params)
|
|
1070
|
+
},
|
|
704
1071
|
/**
|
|
705
1072
|
* 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.
|
|
706
1073
|
*
|
|
@@ -712,6 +1079,169 @@ function createInternalServerRpc(connection) {
|
|
|
712
1079
|
*/
|
|
713
1080
|
connect: async (params) => connection.sendRequest("connect", params),
|
|
714
1081
|
/** @experimental */
|
|
1082
|
+
mcp: {
|
|
1083
|
+
/** @experimental */
|
|
1084
|
+
registry: {
|
|
1085
|
+
/**
|
|
1086
|
+
* Allocates an ID for one cancellable MCP registry search. The ID exists before the search starts, so callers can cancel before it starts. The networking stack supplies the cancellation namespace. The runtime retains at most 1,024 unused IDs. At capacity, another allocation can reclaim an unused ID. Active searches retain their IDs until they finish.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns Request id naming a cancellable registry search.
|
|
1089
|
+
*/
|
|
1090
|
+
allocateRequestId: async () => connection.sendRequest("mcp.registry.allocateRequestId", {}),
|
|
1091
|
+
/**
|
|
1092
|
+
* Searches the MCP registry the supplied credential may read, resolving the registry endpoint from policy first. Hosts usually send credential-free `AuthIdentity`; a `token` identity can be resolved only when it embeds a token, while `env` and `gh-cli` identities can use a token embedded in the request first. The runtime follows registry pages, keeps the newest entry per server name, cuts the list to `limit`, and sorts an empty-query result by GitHub stars. Each server object is carried opaquely.
|
|
1093
|
+
*
|
|
1094
|
+
* @param params Registry search terms, the credential to search under, and the request id that makes the search cancellable.
|
|
1095
|
+
*
|
|
1096
|
+
* @returns Servers selected from the registry response.
|
|
1097
|
+
*/
|
|
1098
|
+
search: async (params) => connection.sendRequest("mcp.registry.search", params),
|
|
1099
|
+
/**
|
|
1100
|
+
* Abandons the registry search that uses the given request ID. It acts only on IDs from `mcp.registry.allocateRequestId`, so it never cancels another component's request. Answers `canceled: true` when it stops a running search. Answers `canceled: false` for unknown or reclaimed IDs, completed or canceled searches, and unused reservations. It releases an unused reservation, so a later search with that ID is refused.
|
|
1101
|
+
*
|
|
1102
|
+
* @param params Registry search to abandon.
|
|
1103
|
+
*
|
|
1104
|
+
* @returns Whether the cancel reached a live search.
|
|
1105
|
+
*/
|
|
1106
|
+
cancel: async (params) => connection.sendRequest("mcp.registry.cancel", params)
|
|
1107
|
+
},
|
|
1108
|
+
/**
|
|
1109
|
+
* Reports whether the gh-replaceable GitHub MCP tools may be clipped for a session, which a host feeds back as the `excludeGhReplaceableTools` build option. The tools are redundant only when the session can reach a shell *and* the host has the `gh` that would replace them, so both halves are decided here. The shell half runs the platform shell tool through the runtime's own tool-filter matcher, so entry forms like `builtin:bash` and `builtin:*` behave exactly as they do when a session builds its tool catalog. The host half probes for `gh`, and is skipped entirely when the filters already rule the shell out. Host presence alone is not enough: a session restricted to, say, `view` would otherwise lose the built-in issue-read fallback while having no shell to replace it with. The answer describes the host the runtime runs on, so it is never forwarded to a remote engine.
|
|
1110
|
+
*
|
|
1111
|
+
* @param params The session tool filters that decide whether the session still has a shell to run `gh` with.
|
|
1112
|
+
*
|
|
1113
|
+
* @returns Whether the gh-replaceable GitHub MCP tools may be clipped for the session described by the request.
|
|
1114
|
+
*/
|
|
1115
|
+
shouldExcludeGitHubTools: async (params) => connection.sendRequest("mcp.shouldExcludeGitHubTools", params)
|
|
1116
|
+
},
|
|
1117
|
+
/** @experimental */
|
|
1118
|
+
agents: {
|
|
1119
|
+
/**
|
|
1120
|
+
* Lists the agents this runtime ships, by name. A consumer separating shipped agents from ones the user or a plugin authored should compare against these names rather than against `AgentInfo.source`: an authored agent may carry the `builtin` source while not being one of these, and the runtime treats the two as separate questions. `disableableNames` is the subset a user may turn off, which a client needs to decide whether to offer a toggle. `yamlBasedNames` is the subset backed by a shipped YAML definition, which a client needs before asking the runtime to load one.
|
|
1121
|
+
*
|
|
1122
|
+
* @returns The agents this runtime ships, named so a consumer can tell them apart from authored ones.
|
|
1123
|
+
*/
|
|
1124
|
+
getBuiltins: async () => connection.sendRequest("agents.getBuiltins", {}),
|
|
1125
|
+
/**
|
|
1126
|
+
* Lists the shipped agents a client should offer right now, filtered by the feature flags it passes. `getBuiltins` names every agent the runtime knows about; some of those are gated, so a client rendering a picker wants this narrower list together with the description to show beside each name.
|
|
1127
|
+
*
|
|
1128
|
+
* @param params The feature flags to evaluate shipped agents against.
|
|
1129
|
+
*
|
|
1130
|
+
* @returns The shipped agents available under the requested flags.
|
|
1131
|
+
*/
|
|
1132
|
+
getAvailableBuiltins: async (params) => connection.sendRequest("agents.getAvailableBuiltins", params),
|
|
1133
|
+
/**
|
|
1134
|
+
* Loads one shipped agent's YAML definition, for a client that needs what the agent declares rather than only its name. `getBuiltins` reports which names have a definition to load: a name outside its `yamlBasedNames` is special-cased in code and has none. The definition crosses as its own JSON rather than as contract-typed fields, because the runtime parses it with the agent schema's tolerant shape and re-typing it here would drop the keys that shape accepts and this one does not. The projected `__nativeCustomAgent` view the runtime derives is included, so a caller reading the declared model and a caller rendering the agent see the same definition.
|
|
1135
|
+
*
|
|
1136
|
+
* @param params The shipped agent whose definition to load.
|
|
1137
|
+
*
|
|
1138
|
+
* @returns One shipped agent's definition.
|
|
1139
|
+
*/
|
|
1140
|
+
getBuiltinDefinition: async (params) => connection.sendRequest("agents.getBuiltinDefinition", params),
|
|
1141
|
+
/**
|
|
1142
|
+
* Projects one shipped agent the way a picker lists it, reading only the metadata at the head of the definition file and stopping before the prompt body. `getBuiltinDefinition` answers the whole definition instead, so a client listing every shipped agent should prefer this one: the cost of a listing grows with the number of agents, and the prompt body is the part a listing never shows. The two also differ in shape. This returns the projected custom agent on its own, whereas `getBuiltinDefinition` returns the authored definition with that projection nested under `__nativeCustomAgent`.
|
|
1143
|
+
*
|
|
1144
|
+
* @param params The shipped agent whose listing entry to load.
|
|
1145
|
+
*
|
|
1146
|
+
* @returns One shipped agent, projected for a listing.
|
|
1147
|
+
*/
|
|
1148
|
+
getBuiltinListingDefinition: async (params) => connection.sendRequest("agents.getBuiltinListingDefinition", params),
|
|
1149
|
+
/**
|
|
1150
|
+
* Resolves the model a custom agent asks for against the models actually available, and answers both the model to switch to and the warning a user should see when the agent's preference cannot be met. A custom agent may name several acceptable models in preference order, so the decision is a match rather than a lookup, and an agent whose preference is unavailable is a normal outcome that produces a warning rather than an error. A host must call this rather than pick the first available name itself, because the preference order and the wording of the warning are what keep one installation's agent selection the same as another's.
|
|
1151
|
+
*
|
|
1152
|
+
* @param params The models a custom agent asks for, and the models actually available.
|
|
1153
|
+
*
|
|
1154
|
+
* @returns The model to switch to, and the warning to show when the agent's preference could not be met.
|
|
1155
|
+
*/
|
|
1156
|
+
customAgentInitialModelDecision: async (params) => connection.sendRequest("agents.customAgentInitialModelDecision", params)
|
|
1157
|
+
},
|
|
1158
|
+
/** @experimental */
|
|
1159
|
+
globalState: {
|
|
1160
|
+
/**
|
|
1161
|
+
* Reads the host's machine-wide state: which plugins are installed and the one-off flags and timestamps that record what the user has already been shown or migrated. This is the state that outlives a single session and a single workspace, so a host reads it to decide whether to run a first-launch step, offer an onboarding prompt, or skip one it has already completed. The stored credentials are deliberately not part of this result; a caller that needs an authenticated identity asks the account methods for it instead. Reading is non-destructive and every field is optional, because a fresh install has recorded nothing yet.
|
|
1162
|
+
*
|
|
1163
|
+
* @returns The host's machine-wide state. Every field is optional because a fresh install has recorded nothing yet, so a reader must treat an absent field as `not yet`, never as a negative answer. Stored credentials are deliberately absent from this shape.
|
|
1164
|
+
*/
|
|
1165
|
+
load: async () => connection.sendRequest("globalState.load", {}),
|
|
1166
|
+
/**
|
|
1167
|
+
* Reads the host's machine-wide state exactly as `globalState.load` does, but from a caller-supplied configuration directory instead of the one the server resolved for itself. Use this when a consumer scopes a session to its own Copilot home — the SDK's per-session `configDir` override — so the state read matches the directory that session actually uses. An absent or empty `configDir` resolves the server's own home, making this identical to `globalState.load`. The stored credentials are omitted here for the same reason they are omitted from `globalState.load`: a caller that needs an authenticated identity asks the account methods instead, so pointing this at another directory cannot be used to read the credentials kept in it.
|
|
1168
|
+
*
|
|
1169
|
+
* @param params Selects the configuration directory whose machine-wide state to read.
|
|
1170
|
+
*
|
|
1171
|
+
* @returns The host's machine-wide state. Every field is optional because a fresh install has recorded nothing yet, so a reader must treat an absent field as `not yet`, never as a negative answer. Stored credentials are deliberately absent from this shape.
|
|
1172
|
+
*/
|
|
1173
|
+
loadForConfigDir: async (params) => connection.sendRequest("globalState.loadForConfigDir", params),
|
|
1174
|
+
/**
|
|
1175
|
+
* Records one top-level key in the host's machine-wide state, the counterpart to `globalState.load`. A host calls this to remember that it has shown an onboarding step, asked a one-off question, or completed a migration, so the next run can skip it. Only the named key is replaced and the rest of the document is preserved, which lets two writers record different flags without overwriting each other; passing no value removes the key instead. Only the keys a host records itself are writable: `appTipShown`, `askedSetupTerminals`, `autoFeedbackLastPromptedAt`, `firstLaunchAt`, `recentModelIds`, `sandboxCredentialProxyCaDeclined` and `sandboxOnboardingShown`. Every other key is refused, including `installedPlugins`, the stored credentials, `trustedFolders`, the staff flags and the signed-in accounts. Plugin enablement must use the plugin APIs, which apply repository and managed-policy checks.
|
|
1176
|
+
*
|
|
1177
|
+
* @param params A single top-level key to record in the host's machine-wide state. The write replaces only that key and leaves the rest of the document untouched, so two writers recording different one-off flags do not overwrite each other. The stored credential keys cannot be written through this method.
|
|
1178
|
+
*/
|
|
1179
|
+
writeKey: async (params) => connection.sendRequest("globalState.writeKey", params)
|
|
1180
|
+
},
|
|
1181
|
+
/** @experimental */
|
|
1182
|
+
gitHubRepository: {
|
|
1183
|
+
/**
|
|
1184
|
+
* Resolves the GitHub repository that owns a working-tree path by reading the selected git remote configured for it, preferring `origin`. Returns a null `repository` when the path is inside a git working tree but that selected remote does not resolve to a GitHub host. Fails when the path is not inside a git working tree at all, so a caller can tell 'not a repository' apart from 'a repository with no GitHub remote'.
|
|
1185
|
+
*
|
|
1186
|
+
* @param params Working-tree path whose owning GitHub repository should be resolved.
|
|
1187
|
+
*
|
|
1188
|
+
* @returns The GitHub repository that owns the requested path, when the selected remote (`origin`, else the first) is on a GitHub host.
|
|
1189
|
+
*/
|
|
1190
|
+
atPath: async (params) => connection.sendRequest("gitHubRepository.atPath", params)
|
|
1191
|
+
},
|
|
1192
|
+
/** @experimental */
|
|
1193
|
+
gitHubOwners: {
|
|
1194
|
+
/**
|
|
1195
|
+
* Registers a cancellable owner listing and returns its request id. Separate from `gitHubOwners.list` so the id exists before the listing starts: a caller that abandons the listing the moment it begins would otherwise have nothing to name in `gitHubOwners.cancel`. The id serves one listing only. Long-abandoned unused ids can be released by later allocations.
|
|
1196
|
+
*
|
|
1197
|
+
* @returns A freshly registered request id. Registering it before the listing starts is what lets a cancel that races the request still find the owner listing slot. The id serves one listing only. Long-abandoned unused ids can be released by later allocations.
|
|
1198
|
+
*/
|
|
1199
|
+
nextRequestId: async () => connection.sendRequest("gitHubOwners.nextRequestId", {}),
|
|
1200
|
+
/**
|
|
1201
|
+
* Lists the logins the authenticated user may act as — their own account first, then the organizations they belong to — by asking the GitHub API under the supplied credential. No credential travels in the request: `authInfo` selects one the runtime already holds, and the runtime resolves the token and the GitHub host from it. A failure the caller should render arrives as `message`; one it should raise arrives as `throwError`.
|
|
1202
|
+
*
|
|
1203
|
+
* @param params Credential to list owners under, and the request id that makes the listing cancellable.
|
|
1204
|
+
*
|
|
1205
|
+
* @returns Outcome of an owner listing. Exactly one of `owners` and `message` is present, except that `throwError` reports a failure the caller is expected to raise rather than render.
|
|
1206
|
+
*/
|
|
1207
|
+
list: async (params) => connection.sendRequest("gitHubOwners.list", params),
|
|
1208
|
+
/**
|
|
1209
|
+
* Abandons an owner listing started with the given request id. Answers `canceled: true` while a listing with that id is running. Answers `canceled: false` when the id was never registered, was registered but not used, was released after being abandoned, or its listing has ended. Canceling an unused id releases it, and a later `list` with that id is refused. The cancel acts only on owner listings and never reaches another request of the host.
|
|
1210
|
+
*
|
|
1211
|
+
* @param params The owner listing to abandon.
|
|
1212
|
+
*
|
|
1213
|
+
* @returns Whether the id named a running owner listing.
|
|
1214
|
+
*/
|
|
1215
|
+
cancel: async (params) => connection.sendRequest("gitHubOwners.cancel", params)
|
|
1216
|
+
},
|
|
1217
|
+
/** @experimental */
|
|
1218
|
+
git: {
|
|
1219
|
+
/**
|
|
1220
|
+
* Reads the remote that the branch checked out in a working tree tracks, as `branch.<name>.remote` configures it. Reports `origin` rather than failing whenever there is no tracking configuration to read — on a detached HEAD, on a branch with no upstream, or when git itself fails — because a caller asking which remote to talk to needs an answer it can act on, not an error. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on.
|
|
1221
|
+
*
|
|
1222
|
+
* @param params Working-tree path a git query applies to.
|
|
1223
|
+
*
|
|
1224
|
+
* @returns The remote the checked-out branch tracks.
|
|
1225
|
+
*/
|
|
1226
|
+
currentBranchRemote: async (params) => connection.sendRequest("git.currentBranchRemote", params),
|
|
1227
|
+
/**
|
|
1228
|
+
* Collects the repository context of a working directory in one call: working tree root, repository identifier and host, current branch, and the HEAD and base commits. Every repository field is omitted when the path is not inside a git working tree, and the requested path is echoed back as `cwd`. The answer is the same `SessionWorkingDirectoryContext` that `session.metadata.recordContextChange` accepts, so a caller polling for a context change can forward the result unchanged. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on. It can become public once an SDK consumer needs to derive session context from a directory itself.
|
|
1229
|
+
*
|
|
1230
|
+
* @param params Working-tree path a git query applies to.
|
|
1231
|
+
*
|
|
1232
|
+
* @returns Updated working directory and git context. Emitted as the new payload of `session.context_changed`.
|
|
1233
|
+
*/
|
|
1234
|
+
workingDirectoryContext: async (params) => connection.sendRequest("git.workingDirectoryContext", params),
|
|
1235
|
+
/**
|
|
1236
|
+
* Lists the GitHub repositories a working tree's remotes point at, one entry per distinct repository, so a caller can resolve a base and head repository without parsing remote URLs itself. When several remotes name the same repository, only the first is listed, and the entry keeps that remote name. Remotes pointing at no GitHub host are left out, so an empty list means the tree reaches GitHub through no remote. Failing to read the remotes is reported as an error rather than as an empty list, because the two mean different things to a caller. Marked internal because it exists to carry a CLI call site off the napi boundary onto the SDK contract; it is migration plumbing, not a surface consumers are meant to depend on.
|
|
1237
|
+
*
|
|
1238
|
+
* @param params Git working tree whose GitHub remotes should be listed.
|
|
1239
|
+
*
|
|
1240
|
+
* @returns The GitHub repositories a working tree's remotes point at.
|
|
1241
|
+
*/
|
|
1242
|
+
reposFromRemotes: async (params) => connection.sendRequest("git.reposFromRemotes", params)
|
|
1243
|
+
},
|
|
1244
|
+
/** @experimental */
|
|
715
1245
|
sessions: {
|
|
716
1246
|
/**
|
|
717
1247
|
* Reads lightweight persisted metadata for one local session without opening it.
|
|
@@ -751,6 +1281,30 @@ function createInternalServerRpc(connection) {
|
|
|
751
1281
|
* @param params Session ID to delete from disk.
|
|
752
1282
|
*/
|
|
753
1283
|
delete: async (params) => connection.sendRequest("sessions.delete", params),
|
|
1284
|
+
/**
|
|
1285
|
+
* Creates the workspace record for a session that has not been opened yet. A host that hands a session off to another application — writing the record and then launching that application against the session ID — needs the record on disk before any session exists to carry it, which the session-scoped workspace methods cannot do. Replaces any existing record and resets the checkpoint index. When writing to the local filesystem, a stored `fork_count` survives on disk. Returns the record it built, so a surviving stored `fork_count` can differ from the answer.
|
|
1286
|
+
*
|
|
1287
|
+
* @param params Identity, state location and starting context for a workspace record.
|
|
1288
|
+
*
|
|
1289
|
+
* @returns The workspace record that was written.
|
|
1290
|
+
*/
|
|
1291
|
+
createWorkspace: async (params) => connection.sendRequest("sessions.createWorkspace", params),
|
|
1292
|
+
/**
|
|
1293
|
+
* Reads a session's workspace record straight from disk, without opening the session. Resuming by session ID has to know where the session lives before it can connect, so the lookup cannot come from the session-scoped workspace methods, which resolve their location from a live session's context. Returns no record when the file is absent.
|
|
1294
|
+
*
|
|
1295
|
+
* @param params Where the session's state lives, as a root directory and the session ID under it.
|
|
1296
|
+
*
|
|
1297
|
+
* @returns The workspace record on disk, omitted when the session has none.
|
|
1298
|
+
*/
|
|
1299
|
+
loadWorkspace: async (params) => connection.sendRequest("sessions.loadWorkspace", params),
|
|
1300
|
+
/**
|
|
1301
|
+
* Merges fields into a session's workspace record on disk, creating the record when it is absent. The counterpart to `sessions.loadWorkspace`, for the same before-the-session-exists case. It preserves stored workspace-schema fields the request does not supply, does not preserve stored keys outside the workspace schema, and never replaces a stored `fork_count`.
|
|
1302
|
+
*
|
|
1303
|
+
* @param params Where the session's state lives, plus workspace-schema fields to merge into its workspace record. Stored keys outside the schema are not preserved, and a stored `fork_count` is never replaced.
|
|
1304
|
+
*
|
|
1305
|
+
* @returns The merge completed. The record carries the supplied workspace-schema fields, but a stored `fork_count` stays.
|
|
1306
|
+
*/
|
|
1307
|
+
updateWorkspaceFields: async (params) => connection.sendRequest("sessions.updateWorkspaceFields", params),
|
|
754
1308
|
/**
|
|
755
1309
|
* Gets the dynamic-context board entry count associated with a session, when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`, `rem_consolidation_complete`) can pair START / END board counts around the detached rem-agent spawn. "Dynamic context board" is a runtime-internal concept that is not part of the public SDK contract; the long-term plan is to relocate the telemetry emission into the runtime so this method can be deleted entirely.
|
|
756
1310
|
*
|
|
@@ -770,6 +1324,50 @@ function createInternalServerRpc(connection) {
|
|
|
770
1324
|
}
|
|
771
1325
|
function createSessionRpc(connection, sessionId) {
|
|
772
1326
|
return {
|
|
1327
|
+
/** @experimental */
|
|
1328
|
+
providers: {
|
|
1329
|
+
/**
|
|
1330
|
+
* Returns adapter definitions and supported operations in this session's effective provider catalog, without running discovery. Does not list provider instances or select inference models.
|
|
1331
|
+
*
|
|
1332
|
+
* @returns Normalized model-provider adapter definitions available to the session, not discovered instances.
|
|
1333
|
+
*/
|
|
1334
|
+
getCatalog: async () => connection.sendRequest("session.providers.getCatalog", { sessionId }),
|
|
1335
|
+
/**
|
|
1336
|
+
* Discovers reachable instances using an adapter from this session's effective provider catalog and provider-specific discovery input.
|
|
1337
|
+
*
|
|
1338
|
+
* @param params Provider discovery parameters.
|
|
1339
|
+
*
|
|
1340
|
+
* @returns Provider instances found by a discovery operation.
|
|
1341
|
+
*/
|
|
1342
|
+
discover: async (params) => connection.sendRequest("session.providers.discover", { ...params, sessionId }),
|
|
1343
|
+
/**
|
|
1344
|
+
* Gets current health and version information for a discovered model-provider instance.
|
|
1345
|
+
*
|
|
1346
|
+
* @param params Provider status request parameters.
|
|
1347
|
+
*
|
|
1348
|
+
* @returns Current health information for a provider instance.
|
|
1349
|
+
*/
|
|
1350
|
+
getStatus: async (params) => connection.sendRequest("session.providers.getStatus", { ...params, sessionId }),
|
|
1351
|
+
/** @experimental */
|
|
1352
|
+
models: {
|
|
1353
|
+
/**
|
|
1354
|
+
* Lists models installed or otherwise available from a discovered model-provider instance.
|
|
1355
|
+
*
|
|
1356
|
+
* @param params Provider model inventory request parameters.
|
|
1357
|
+
*
|
|
1358
|
+
* @returns Models offered for agent conversations by one provider instance. Adapters exclude known-incompatible models, but retain candidates with unknown capabilities. Listing does not guarantee compatibility.
|
|
1359
|
+
*/
|
|
1360
|
+
list: async (params) => connection.sendRequest("session.providers.models.list", { ...params, sessionId }),
|
|
1361
|
+
/**
|
|
1362
|
+
* Translates a discovered model into the provider and model configuration needed to use it, and reports whether each is already registered in this session. Prepares only: it registers nothing, writes nothing, and performs no provider requests.
|
|
1363
|
+
*
|
|
1364
|
+
* @param params A discovered instance and one of its models to translate into provider configuration. Pass back the instance and model as returned by `session.providers.discover` and `session.providers.models.list`.
|
|
1365
|
+
*
|
|
1366
|
+
* @returns Provider configuration prepared from a discovered model. Preparing a plan changes nothing: it neither registers the model with the session nor writes durable configuration. To apply it, pass `provider` and `model` to `session.provider.add`, omitting whichever the dispositions report as already configured.
|
|
1367
|
+
*/
|
|
1368
|
+
prepareConfiguration: async (params) => connection.sendRequest("session.providers.models.prepareConfiguration", { ...params, sessionId })
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
773
1371
|
/**
|
|
774
1372
|
* Suspends the session while preserving persisted state for later resume.
|
|
775
1373
|
*
|
|
@@ -785,7 +1383,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
785
1383
|
*
|
|
786
1384
|
* @experimental
|
|
787
1385
|
*/
|
|
788
|
-
send: async (params) => connection.sendRequest("session.send", {
|
|
1386
|
+
send: async (params) => connection.sendRequest("session.send", { ...params, sessionId }),
|
|
789
1387
|
/**
|
|
790
1388
|
* 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.
|
|
791
1389
|
*
|
|
@@ -795,7 +1393,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
795
1393
|
*
|
|
796
1394
|
* @experimental
|
|
797
1395
|
*/
|
|
798
|
-
sendMessages: async (params) => connection.sendRequest("session.sendMessages", {
|
|
1396
|
+
sendMessages: async (params) => connection.sendRequest("session.sendMessages", { ...params, sessionId }),
|
|
799
1397
|
/** @experimental */
|
|
800
1398
|
sandbox: {
|
|
801
1399
|
/**
|
|
@@ -804,6 +1402,12 @@ function createSessionRpc(connection, sessionId) {
|
|
|
804
1402
|
* @returns Managed sandbox enforcement state for a session.
|
|
805
1403
|
*/
|
|
806
1404
|
getEnforcementStatus: async () => connection.sendRequest("session.sandbox.getEnforcementStatus", { sessionId }),
|
|
1405
|
+
/**
|
|
1406
|
+
* Lists possible secret-bearing environment variables available to new sandboxed shells that are not already covered by credential masking. Uses local name rules and known-provider host suggestions, never returns secret values, and changes no settings or network permissions. Returns no suggestions while the session is not sandboxed.
|
|
1407
|
+
*
|
|
1408
|
+
* @returns Possible unconfigured secrets in the sandbox shell environment, sorted by variable name, with no secret values.
|
|
1409
|
+
*/
|
|
1410
|
+
getCredentialSuggestions: async () => connection.sendRequest("session.sandbox.getCredentialSuggestions", { sessionId }),
|
|
807
1411
|
/**
|
|
808
1412
|
* Disables sandboxing for the remainder of the current session and approves the referenced pending sandbox-bypass permission request. The request is rejected unless the exact request is still pending and the effective sandbox policy permits bypass.
|
|
809
1413
|
*
|
|
@@ -811,7 +1415,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
811
1415
|
*
|
|
812
1416
|
* @returns Result of attempting to disable sandboxing for the current session.
|
|
813
1417
|
*/
|
|
814
|
-
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", {
|
|
1418
|
+
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", { ...params, sessionId }),
|
|
1419
|
+
/**
|
|
1420
|
+
* Adds the path offered by a pending sandbox escalation permission request's sandboxPathGrant to the session's sandbox policy and approves the request, so the blocked operation re-runs inside the sandbox rather than outside it. The request is rejected unless the exact request is still pending, carries a sandboxPathGrant, and the grant still takes effect under the current managed policy. Does not persist the path; hosts that store sandbox settings save it themselves.
|
|
1421
|
+
*
|
|
1422
|
+
* @param params Request to accept the sandbox path grant offered on an active sandbox escalation permission prompt.
|
|
1423
|
+
*
|
|
1424
|
+
* @returns Result of accepting a sandbox path grant.
|
|
1425
|
+
*/
|
|
1426
|
+
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", { ...params, sessionId })
|
|
815
1427
|
},
|
|
816
1428
|
/**
|
|
817
1429
|
* Aborts the current agent turn.
|
|
@@ -822,7 +1434,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
822
1434
|
*
|
|
823
1435
|
* @experimental
|
|
824
1436
|
*/
|
|
825
|
-
abort: async (params) => connection.sendRequest("session.abort", {
|
|
1437
|
+
abort: async (params) => connection.sendRequest("session.abort", { ...params, sessionId }),
|
|
826
1438
|
/**
|
|
827
1439
|
* Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive. No-op when the main loop is not processing.
|
|
828
1440
|
*
|
|
@@ -832,7 +1444,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
832
1444
|
*
|
|
833
1445
|
* @experimental
|
|
834
1446
|
*/
|
|
835
|
-
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", {
|
|
1447
|
+
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", { ...params, sessionId }),
|
|
836
1448
|
/**
|
|
837
1449
|
* Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.
|
|
838
1450
|
*
|
|
@@ -848,7 +1460,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
848
1460
|
*
|
|
849
1461
|
* @experimental
|
|
850
1462
|
*/
|
|
851
|
-
shutdown: async (params) => connection.sendRequest("session.shutdown", {
|
|
1463
|
+
shutdown: async (params) => connection.sendRequest("session.shutdown", { ...params, sessionId }),
|
|
852
1464
|
/** @experimental */
|
|
853
1465
|
gitHubAuth: {
|
|
854
1466
|
/**
|
|
@@ -864,7 +1476,59 @@ function createSessionRpc(connection, sessionId) {
|
|
|
864
1476
|
*
|
|
865
1477
|
* @returns Indicates whether the credential update succeeded.
|
|
866
1478
|
*/
|
|
867
|
-
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", {
|
|
1479
|
+
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { ...params, sessionId })
|
|
1480
|
+
},
|
|
1481
|
+
/** @experimental */
|
|
1482
|
+
accounts: {
|
|
1483
|
+
/**
|
|
1484
|
+
* Enumerate a typed accounts collection: the signed-in accounts, or the providers offered for interactive login.
|
|
1485
|
+
*
|
|
1486
|
+
* @param params Enumerate request carrying the typed collection query.
|
|
1487
|
+
*
|
|
1488
|
+
* @returns The enumerated collection, keyed by the same selector as the query.
|
|
1489
|
+
*/
|
|
1490
|
+
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", { ...params, sessionId }),
|
|
1491
|
+
/**
|
|
1492
|
+
* Read one typed accounts datum: the active account, a neutral status summary, or the last authentication errors.
|
|
1493
|
+
*
|
|
1494
|
+
* @param params Read request carrying the typed datum query.
|
|
1495
|
+
*
|
|
1496
|
+
* @returns The read result, keyed by the same selector as the query.
|
|
1497
|
+
*/
|
|
1498
|
+
get: async (params) => connection.sendRequest("session.accounts.get", { ...params, sessionId }),
|
|
1499
|
+
/**
|
|
1500
|
+
* Apply one non-interactive accounts mutation: switch the active account, log an account out, or set credentials from a token.
|
|
1501
|
+
*
|
|
1502
|
+
* @param params Mutation request carrying the typed write command.
|
|
1503
|
+
*
|
|
1504
|
+
* @returns Result of a non-interactive accounts mutation.
|
|
1505
|
+
*/
|
|
1506
|
+
set: async (params) => connection.sendRequest("session.accounts.set", { ...params, sessionId }),
|
|
1507
|
+
/** @experimental */
|
|
1508
|
+
login: {
|
|
1509
|
+
/**
|
|
1510
|
+
* Begin an interactive login flow for a provider kind (dispatch is kind-only) and return its opaque flow id and first step.
|
|
1511
|
+
*
|
|
1512
|
+
* @param params Begin an interactive login flow for a provider kind. Dispatch is kind-only.
|
|
1513
|
+
*
|
|
1514
|
+
* @returns A started login flow: its opaque id and first step.
|
|
1515
|
+
*/
|
|
1516
|
+
begin: async (params) => connection.sendRequest("session.accounts.login.begin", { ...params, sessionId }),
|
|
1517
|
+
/**
|
|
1518
|
+
* Advance an in-flight login flow, optionally fulfilling an input-required step, and return the next step.
|
|
1519
|
+
*
|
|
1520
|
+
* @param params Advance an in-flight login flow, optionally fulfilling an input-required step.
|
|
1521
|
+
*
|
|
1522
|
+
* @returns One step in an interactive login flow. The consumer acts on the step and calls advance to proceed. Browser-open is encoded as two distinct steps by design: `open-url` is CONSUMER-driven (the provider surfaces the authorize URL and the consumer opens it — github.com/GHEC web), while `needs-interaction` is PROVIDER-driven (the provider opens the browser or broker UI itself and does not surface a URL — Entra).
|
|
1523
|
+
*/
|
|
1524
|
+
advance: async (params) => connection.sendRequest("session.accounts.login.advance", { ...params, sessionId }),
|
|
1525
|
+
/**
|
|
1526
|
+
* Cancel an in-flight login flow and release its resources.
|
|
1527
|
+
*
|
|
1528
|
+
* @param params Cancel an in-flight login flow.
|
|
1529
|
+
*/
|
|
1530
|
+
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", { ...params, sessionId })
|
|
1531
|
+
}
|
|
868
1532
|
},
|
|
869
1533
|
/** @experimental */
|
|
870
1534
|
debug: {
|
|
@@ -875,7 +1539,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
875
1539
|
*
|
|
876
1540
|
* @returns Result of collecting a session debug bundle.
|
|
877
1541
|
*/
|
|
878
|
-
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", {
|
|
1542
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { ...params, sessionId })
|
|
879
1543
|
},
|
|
880
1544
|
/** @experimental */
|
|
881
1545
|
canvas: {
|
|
@@ -898,13 +1562,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
898
1562
|
*
|
|
899
1563
|
* @returns Open canvas instance snapshot.
|
|
900
1564
|
*/
|
|
901
|
-
open: async (params) => connection.sendRequest("session.canvas.open", {
|
|
1565
|
+
open: async (params) => connection.sendRequest("session.canvas.open", { ...params, sessionId }),
|
|
902
1566
|
/**
|
|
903
1567
|
* Closes an open canvas instance.
|
|
904
1568
|
*
|
|
905
1569
|
* @param params Canvas close parameters.
|
|
906
1570
|
*/
|
|
907
|
-
close: async (params) => connection.sendRequest("session.canvas.close", {
|
|
1571
|
+
close: async (params) => connection.sendRequest("session.canvas.close", { ...params, sessionId }),
|
|
908
1572
|
/** @experimental */
|
|
909
1573
|
action: {
|
|
910
1574
|
/**
|
|
@@ -914,109 +1578,109 @@ function createSessionRpc(connection, sessionId) {
|
|
|
914
1578
|
*
|
|
915
1579
|
* @returns Canvas action invocation result.
|
|
916
1580
|
*/
|
|
917
|
-
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", {
|
|
1581
|
+
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", { ...params, sessionId })
|
|
918
1582
|
}
|
|
919
1583
|
},
|
|
920
1584
|
/** @experimental */
|
|
921
|
-
|
|
1585
|
+
workflow: {
|
|
922
1586
|
/**
|
|
923
|
-
* Runs a registered
|
|
1587
|
+
* Runs a registered dynamic workflow by name at the top level.
|
|
924
1588
|
*
|
|
925
|
-
* @param params Parameters for invoking a registered
|
|
1589
|
+
* @param params Parameters for invoking a registered workflow.
|
|
926
1590
|
*
|
|
927
|
-
* @returns Complete current or terminal
|
|
1591
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
928
1592
|
*/
|
|
929
|
-
run: async (params) => connection.sendRequest("session.
|
|
1593
|
+
run: async (params) => connection.sendRequest("session.workflow.run", { ...params, sessionId }),
|
|
930
1594
|
/**
|
|
931
|
-
* Resumes a
|
|
1595
|
+
* Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
|
|
932
1596
|
*
|
|
933
|
-
* @param params Parameters for resuming a
|
|
1597
|
+
* @param params Parameters for resuming a workflow run from its persisted identity.
|
|
934
1598
|
*
|
|
935
|
-
* @returns Resolved persisted
|
|
1599
|
+
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
936
1600
|
*/
|
|
937
|
-
resume: async (params) => connection.sendRequest("session.
|
|
1601
|
+
resume: async (params) => connection.sendRequest("session.workflow.resume", { ...params, sessionId }),
|
|
938
1602
|
/**
|
|
939
|
-
* Gets the current or settled envelope for a
|
|
1603
|
+
* Gets the current or settled envelope for a dynamic workflow run.
|
|
940
1604
|
*
|
|
941
|
-
* @param params Parameters for retrieving a
|
|
1605
|
+
* @param params Parameters for retrieving a workflow run.
|
|
942
1606
|
*
|
|
943
|
-
* @returns Complete current or terminal
|
|
1607
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
944
1608
|
*/
|
|
945
|
-
getRun: async (params) => connection.sendRequest("session.
|
|
1609
|
+
getRun: async (params) => connection.sendRequest("session.workflow.getRun", { ...params, sessionId }),
|
|
946
1610
|
/**
|
|
947
|
-
* Lists durable
|
|
1611
|
+
* Lists durable dynamic workflow runs for this session in creation order.
|
|
948
1612
|
*
|
|
949
|
-
* @param params Parameters for paging
|
|
1613
|
+
* @param params Parameters for paging workflow runs.
|
|
950
1614
|
*
|
|
951
|
-
* @returns A page of
|
|
1615
|
+
* @returns A page of workflow runs in durable creation order.
|
|
952
1616
|
*/
|
|
953
|
-
listRuns: async (params) => connection.sendRequest("session.
|
|
1617
|
+
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { ...params, sessionId }),
|
|
954
1618
|
/**
|
|
955
|
-
* Gets durable and live observability detail for one
|
|
1619
|
+
* Gets durable and live observability detail for one dynamic workflow run.
|
|
956
1620
|
*
|
|
957
|
-
* @param params Parameters for retrieving a
|
|
1621
|
+
* @param params Parameters for retrieving a workflow run.
|
|
958
1622
|
*
|
|
959
|
-
* @returns Full
|
|
1623
|
+
* @returns Full workflow run observability detail.
|
|
960
1624
|
*/
|
|
961
|
-
getRunDetail: async (params) => connection.sendRequest("session.
|
|
1625
|
+
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { ...params, sessionId }),
|
|
962
1626
|
/**
|
|
963
|
-
* Pages durable progress for one
|
|
1627
|
+
* Pages durable progress for one dynamic workflow run.
|
|
964
1628
|
*
|
|
965
|
-
* @param params Parameters for paging
|
|
1629
|
+
* @param params Parameters for paging workflow progress.
|
|
966
1630
|
*
|
|
967
|
-
* @returns A bidirectional page of
|
|
1631
|
+
* @returns A bidirectional page of workflow progress.
|
|
968
1632
|
*/
|
|
969
|
-
getRunProgress: async (params) => connection.sendRequest("session.
|
|
1633
|
+
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { ...params, sessionId }),
|
|
970
1634
|
/**
|
|
971
|
-
* Requests cancellation of a
|
|
1635
|
+
* Requests cancellation of a dynamic workflow run and returns its run envelope.
|
|
972
1636
|
*
|
|
973
|
-
* @param params Parameters for cancelling a
|
|
1637
|
+
* @param params Parameters for cancelling a workflow run.
|
|
974
1638
|
*
|
|
975
|
-
* @returns Complete current or terminal
|
|
1639
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
976
1640
|
*/
|
|
977
|
-
cancel: async (params) => connection.sendRequest("session.
|
|
1641
|
+
cancel: async (params) => connection.sendRequest("session.workflow.cancel", { ...params, sessionId }),
|
|
978
1642
|
/**
|
|
979
|
-
* Pauses a running
|
|
1643
|
+
* Pauses a running dynamic workflow and returns its settled run envelope.
|
|
980
1644
|
*
|
|
981
|
-
* @param params Parameters for pausing a running
|
|
1645
|
+
* @param params Parameters for pausing a running workflow.
|
|
982
1646
|
*
|
|
983
|
-
* @returns Complete current or terminal
|
|
1647
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
984
1648
|
*/
|
|
985
|
-
pause: async (params) => connection.sendRequest("session.
|
|
1649
|
+
pause: async (params) => connection.sendRequest("session.workflow.pause", { ...params, sessionId }),
|
|
986
1650
|
/**
|
|
987
|
-
* Records a batch of ordered
|
|
1651
|
+
* Records a batch of ordered dynamic workflow progress lines.
|
|
988
1652
|
*
|
|
989
|
-
* @param params Parameters for recording
|
|
1653
|
+
* @param params Parameters for recording workflow progress.
|
|
990
1654
|
*
|
|
991
|
-
* @returns Acknowledgement that a
|
|
1655
|
+
* @returns Acknowledgement that a workflow request was accepted.
|
|
992
1656
|
*/
|
|
993
|
-
log: async (params) => connection.sendRequest("session.
|
|
1657
|
+
log: async (params) => connection.sendRequest("session.workflow.log", { ...params, sessionId }),
|
|
994
1658
|
/**
|
|
995
|
-
* Runs one
|
|
1659
|
+
* Runs one dynamic-workflow-scoped subagent and returns its result.
|
|
996
1660
|
*
|
|
997
|
-
* @param params Parameters for one
|
|
1661
|
+
* @param params Parameters for one workflow-scoped subagent call.
|
|
998
1662
|
*
|
|
999
|
-
* @returns Result of one
|
|
1663
|
+
* @returns Result of one workflow-scoped subagent call.
|
|
1000
1664
|
*/
|
|
1001
|
-
agent: async (params) => connection.sendRequest("session.
|
|
1665
|
+
agent: async (params) => connection.sendRequest("session.workflow.agent", { ...params, sessionId }),
|
|
1002
1666
|
/** @experimental */
|
|
1003
1667
|
journal: {
|
|
1004
1668
|
/**
|
|
1005
|
-
* Reads a memoized
|
|
1669
|
+
* Reads a memoized dynamic workflow journal entry.
|
|
1006
1670
|
*
|
|
1007
|
-
* @param params Parameters for reading a
|
|
1671
|
+
* @param params Parameters for reading a workflow journal entry.
|
|
1008
1672
|
*
|
|
1009
|
-
* @returns Result of reading a
|
|
1673
|
+
* @returns Result of reading a workflow journal entry.
|
|
1010
1674
|
*/
|
|
1011
|
-
get: async (params) => connection.sendRequest("session.
|
|
1675
|
+
get: async (params) => connection.sendRequest("session.workflow.journal.get", { ...params, sessionId }),
|
|
1012
1676
|
/**
|
|
1013
|
-
* Stores a memoized
|
|
1677
|
+
* Stores a memoized dynamic workflow journal entry.
|
|
1014
1678
|
*
|
|
1015
|
-
* @param params Parameters for storing a
|
|
1679
|
+
* @param params Parameters for storing a workflow journal entry.
|
|
1016
1680
|
*
|
|
1017
|
-
* @returns Acknowledgement that a
|
|
1681
|
+
* @returns Acknowledgement that a workflow request was accepted.
|
|
1018
1682
|
*/
|
|
1019
|
-
put: async (params) => connection.sendRequest("session.
|
|
1683
|
+
put: async (params) => connection.sendRequest("session.workflow.journal.put", { ...params, sessionId })
|
|
1020
1684
|
}
|
|
1021
1685
|
},
|
|
1022
1686
|
/** @experimental */
|
|
@@ -1034,7 +1698,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1034
1698
|
*
|
|
1035
1699
|
* @returns The model identifier active on the session after the switch.
|
|
1036
1700
|
*/
|
|
1037
|
-
switchTo: async (params) => connection.sendRequest("session.model.switchTo", {
|
|
1701
|
+
switchTo: async (params) => connection.sendRequest("session.model.switchTo", { ...params, sessionId }),
|
|
1038
1702
|
/**
|
|
1039
1703
|
* 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`.
|
|
1040
1704
|
*
|
|
@@ -1042,7 +1706,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1042
1706
|
*
|
|
1043
1707
|
* @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed.
|
|
1044
1708
|
*/
|
|
1045
|
-
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", {
|
|
1709
|
+
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", { ...params, sessionId }),
|
|
1046
1710
|
/**
|
|
1047
1711
|
* Replaces or clears the host-supplied model allowlist for a running session.
|
|
1048
1712
|
*
|
|
@@ -1050,7 +1714,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1050
1714
|
*
|
|
1051
1715
|
* @returns The applied host allowlist and effective session model policy after intersection.
|
|
1052
1716
|
*/
|
|
1053
|
-
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", {
|
|
1717
|
+
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", { ...params, sessionId }),
|
|
1054
1718
|
/**
|
|
1055
1719
|
* Updates the session's reasoning effort without changing the selected model.
|
|
1056
1720
|
*
|
|
@@ -1058,7 +1722,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1058
1722
|
*
|
|
1059
1723
|
* @returns Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.
|
|
1060
1724
|
*/
|
|
1061
|
-
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", {
|
|
1725
|
+
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { ...params, sessionId }),
|
|
1062
1726
|
/**
|
|
1063
1727
|
* Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
|
|
1064
1728
|
*
|
|
@@ -1066,7 +1730,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1066
1730
|
*
|
|
1067
1731
|
* @returns The list of models available to this session.
|
|
1068
1732
|
*/
|
|
1069
|
-
list: async (params) => connection.sendRequest("session.model.list", {
|
|
1733
|
+
list: async (params) => connection.sendRequest("session.model.list", { ...params, sessionId })
|
|
1070
1734
|
},
|
|
1071
1735
|
/** @experimental */
|
|
1072
1736
|
mode: {
|
|
@@ -1083,7 +1747,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1083
1747
|
*
|
|
1084
1748
|
* @returns Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.
|
|
1085
1749
|
*/
|
|
1086
|
-
set: async (params) => connection.sendRequest("session.mode.set", {
|
|
1750
|
+
set: async (params) => connection.sendRequest("session.mode.set", { ...params, sessionId })
|
|
1087
1751
|
},
|
|
1088
1752
|
/** @experimental */
|
|
1089
1753
|
name: {
|
|
@@ -1098,7 +1762,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1098
1762
|
*
|
|
1099
1763
|
* @param params New friendly name to apply to the session.
|
|
1100
1764
|
*/
|
|
1101
|
-
set: async (params) => connection.sendRequest("session.name.set", {
|
|
1765
|
+
set: async (params) => connection.sendRequest("session.name.set", { ...params, sessionId }),
|
|
1102
1766
|
/**
|
|
1103
1767
|
* Persists an auto-generated session summary as the session's name when no user-set name exists.
|
|
1104
1768
|
*
|
|
@@ -1106,7 +1770,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1106
1770
|
*
|
|
1107
1771
|
* @returns Indicates whether the auto-generated summary was applied as the session's name.
|
|
1108
1772
|
*/
|
|
1109
|
-
setAuto: async (params) => connection.sendRequest("session.name.setAuto", {
|
|
1773
|
+
setAuto: async (params) => connection.sendRequest("session.name.setAuto", { ...params, sessionId })
|
|
1110
1774
|
},
|
|
1111
1775
|
/** @experimental */
|
|
1112
1776
|
plan: {
|
|
@@ -1121,7 +1785,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1121
1785
|
*
|
|
1122
1786
|
* @param params Replacement contents to write to the session plan file.
|
|
1123
1787
|
*/
|
|
1124
|
-
update: async (params) => connection.sendRequest("session.plan.update", {
|
|
1788
|
+
update: async (params) => connection.sendRequest("session.plan.update", { ...params, sessionId }),
|
|
1125
1789
|
/**
|
|
1126
1790
|
* Deletes the session plan file from the workspace.
|
|
1127
1791
|
*/
|
|
@@ -1154,7 +1818,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1154
1818
|
*
|
|
1155
1819
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1156
1820
|
*/
|
|
1157
|
-
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", {
|
|
1821
|
+
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", { ...params, sessionId }),
|
|
1158
1822
|
/**
|
|
1159
1823
|
* Ensures a local session workspace exists and returns it.
|
|
1160
1824
|
*
|
|
@@ -1162,7 +1826,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1162
1826
|
*
|
|
1163
1827
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1164
1828
|
*/
|
|
1165
|
-
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", {
|
|
1829
|
+
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", { ...params, sessionId }),
|
|
1166
1830
|
/**
|
|
1167
1831
|
* Lists files stored in the session workspace files directory.
|
|
1168
1832
|
*
|
|
@@ -1176,13 +1840,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1176
1840
|
*
|
|
1177
1841
|
* @returns Contents of the requested workspace file as a UTF-8 string.
|
|
1178
1842
|
*/
|
|
1179
|
-
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", {
|
|
1843
|
+
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", { ...params, sessionId }),
|
|
1180
1844
|
/**
|
|
1181
1845
|
* Creates or overwrites a file in the session workspace files directory.
|
|
1182
1846
|
*
|
|
1183
1847
|
* @param params Relative path and UTF-8 content for the workspace file to create or overwrite.
|
|
1184
1848
|
*/
|
|
1185
|
-
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", {
|
|
1849
|
+
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", { ...params, sessionId }),
|
|
1186
1850
|
/**
|
|
1187
1851
|
* Returns metadata for a file or directory in the session workspace files directory.
|
|
1188
1852
|
*
|
|
@@ -1190,25 +1854,25 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1190
1854
|
*
|
|
1191
1855
|
* @returns Filesystem metadata for a path in the session workspace files directory.
|
|
1192
1856
|
*/
|
|
1193
|
-
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", {
|
|
1857
|
+
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", { ...params, sessionId }),
|
|
1194
1858
|
/**
|
|
1195
1859
|
* Creates a directory in the session workspace files directory.
|
|
1196
1860
|
*
|
|
1197
1861
|
* @param params Directory to create within the session workspace files directory.
|
|
1198
1862
|
*/
|
|
1199
|
-
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", {
|
|
1863
|
+
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", { ...params, sessionId }),
|
|
1200
1864
|
/**
|
|
1201
1865
|
* Removes a file or directory from the session workspace files directory.
|
|
1202
1866
|
*
|
|
1203
1867
|
* @param params File or directory to remove from the session workspace files directory.
|
|
1204
1868
|
*/
|
|
1205
|
-
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", {
|
|
1869
|
+
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", { ...params, sessionId }),
|
|
1206
1870
|
/**
|
|
1207
1871
|
* Renames a file or directory within the session workspace files directory.
|
|
1208
1872
|
*
|
|
1209
1873
|
* @param params Source and destination paths for a rename within the session workspace files directory.
|
|
1210
1874
|
*/
|
|
1211
|
-
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", {
|
|
1875
|
+
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", { ...params, sessionId }),
|
|
1212
1876
|
/**
|
|
1213
1877
|
* Lists workspace checkpoints in chronological order.
|
|
1214
1878
|
*
|
|
@@ -1222,7 +1886,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1222
1886
|
*
|
|
1223
1887
|
* @returns Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
|
|
1224
1888
|
*/
|
|
1225
|
-
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", {
|
|
1889
|
+
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", { ...params, sessionId }),
|
|
1226
1890
|
/**
|
|
1227
1891
|
* Adds a compaction summary checkpoint to the local session workspace.
|
|
1228
1892
|
*
|
|
@@ -1230,7 +1894,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1230
1894
|
*
|
|
1231
1895
|
* @returns Persisted summary metadata and refreshed workspace metadata.
|
|
1232
1896
|
*/
|
|
1233
|
-
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", {
|
|
1897
|
+
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", { ...params, sessionId }),
|
|
1234
1898
|
/**
|
|
1235
1899
|
* Truncates local workspace compaction summaries after a rollback.
|
|
1236
1900
|
*
|
|
@@ -1238,7 +1902,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1238
1902
|
*
|
|
1239
1903
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1240
1904
|
*/
|
|
1241
|
-
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", {
|
|
1905
|
+
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", { ...params, sessionId }),
|
|
1242
1906
|
/**
|
|
1243
1907
|
* Reads the autopilot objective state file from the local session workspace.
|
|
1244
1908
|
*
|
|
@@ -1252,7 +1916,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1252
1916
|
*
|
|
1253
1917
|
* @returns Result of writing the autopilot objective file.
|
|
1254
1918
|
*/
|
|
1255
|
-
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", {
|
|
1919
|
+
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", { ...params, sessionId }),
|
|
1256
1920
|
/**
|
|
1257
1921
|
* Deletes the autopilot objective state file from the local session workspace.
|
|
1258
1922
|
*
|
|
@@ -1272,7 +1936,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1272
1936
|
*
|
|
1273
1937
|
* @returns Descriptor for the saved paste file, or null when the workspace is unavailable.
|
|
1274
1938
|
*/
|
|
1275
|
-
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", {
|
|
1939
|
+
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", { ...params, sessionId }),
|
|
1276
1940
|
/**
|
|
1277
1941
|
* Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`.
|
|
1278
1942
|
*
|
|
@@ -1280,7 +1944,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1280
1944
|
*
|
|
1281
1945
|
* @returns Workspace diff result for the requested mode.
|
|
1282
1946
|
*/
|
|
1283
|
-
diff: async (params) => connection.sendRequest("session.workspaces.diff", {
|
|
1947
|
+
diff: async (params) => connection.sendRequest("session.workspaces.diff", { ...params, sessionId })
|
|
1284
1948
|
},
|
|
1285
1949
|
/** @experimental */
|
|
1286
1950
|
autopilotObjective: {
|
|
@@ -1306,7 +1970,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1306
1970
|
*
|
|
1307
1971
|
* @returns Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.
|
|
1308
1972
|
*/
|
|
1309
|
-
request: async (params) => connection.sendRequest("session.completions.request", {
|
|
1973
|
+
request: async (params) => connection.sendRequest("session.completions.request", { ...params, sessionId })
|
|
1310
1974
|
},
|
|
1311
1975
|
/** @experimental */
|
|
1312
1976
|
instructions: {
|
|
@@ -1315,7 +1979,22 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1315
1979
|
*
|
|
1316
1980
|
* @returns Instruction sources loaded for the session, in merge order.
|
|
1317
1981
|
*/
|
|
1318
|
-
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId })
|
|
1982
|
+
getSources: async () => connection.sendRequest("session.instructions.getSources", { sessionId }),
|
|
1983
|
+
/**
|
|
1984
|
+
* For local sessions, invalidates instruction discovery and the model-facing prompt, then returns freshly discovered sources. The updated prompt takes effect on the next turn. Remote sessions must reload on their agent host instead.
|
|
1985
|
+
*
|
|
1986
|
+
* @returns Instruction sources loaded for the session, in merge order.
|
|
1987
|
+
*/
|
|
1988
|
+
reload: async () => connection.sendRequest("session.instructions.reload", { sessionId })
|
|
1989
|
+
},
|
|
1990
|
+
/** @experimental */
|
|
1991
|
+
customizations: {
|
|
1992
|
+
/**
|
|
1993
|
+
* For local sessions, reconciles repository context and discovered instructions, plugins, skills, agents, hooks, MCP servers, and extensions after files appear or change under the working directory. Independent component failures are returned in outcomes and errors; a rejected call can have partially applied earlier steps. Remote sessions must reload on their agent host instead. The model-facing context is rebuilt on the next turn.
|
|
1994
|
+
*
|
|
1995
|
+
* @returns Results of reloading discovered session customizations. Inspect outcomes for reloaded, skipped, or failed subsystems; a rejection may follow partial mutation. Changes to the model-facing prompt and tools apply on the next turn.
|
|
1996
|
+
*/
|
|
1997
|
+
reload: async () => connection.sendRequest("session.customizations.reload", { sessionId })
|
|
1319
1998
|
},
|
|
1320
1999
|
/** @experimental */
|
|
1321
2000
|
fleet: {
|
|
@@ -1326,7 +2005,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1326
2005
|
*
|
|
1327
2006
|
* @returns Indicates whether fleet mode was successfully activated.
|
|
1328
2007
|
*/
|
|
1329
|
-
start: async (params) => connection.sendRequest("session.fleet.start", {
|
|
2008
|
+
start: async (params) => connection.sendRequest("session.fleet.start", { ...params, sessionId })
|
|
1330
2009
|
},
|
|
1331
2010
|
/** @experimental */
|
|
1332
2011
|
agent: {
|
|
@@ -1337,13 +2016,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1337
2016
|
*
|
|
1338
2017
|
* @returns Agents available to the session.
|
|
1339
2018
|
*/
|
|
1340
|
-
list: async (params) => connection.sendRequest("session.agent.list", {
|
|
2019
|
+
list: async (params) => connection.sendRequest("session.agent.list", { ...params, sessionId }),
|
|
1341
2020
|
/**
|
|
1342
2021
|
* Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them.
|
|
1343
2022
|
*
|
|
1344
2023
|
* @param params An in-memory authored prompt override for an available agent.
|
|
1345
2024
|
*/
|
|
1346
|
-
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", {
|
|
2025
|
+
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", { ...params, sessionId }),
|
|
1347
2026
|
/**
|
|
1348
2027
|
* Gets the currently selected custom agent for the session.
|
|
1349
2028
|
*
|
|
@@ -1357,7 +2036,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1357
2036
|
*
|
|
1358
2037
|
* @returns The newly selected custom agent.
|
|
1359
2038
|
*/
|
|
1360
|
-
select: async (params) => connection.sendRequest("session.agent.select", {
|
|
2039
|
+
select: async (params) => connection.sendRequest("session.agent.select", { ...params, sessionId }),
|
|
1361
2040
|
/**
|
|
1362
2041
|
* Clears the selected custom agent and returns the session to the default agent.
|
|
1363
2042
|
*/
|
|
@@ -1378,7 +2057,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1378
2057
|
*
|
|
1379
2058
|
* @returns Identifier assigned to the newly started background agent task.
|
|
1380
2059
|
*/
|
|
1381
|
-
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", {
|
|
2060
|
+
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", { ...params, sessionId }),
|
|
1382
2061
|
/**
|
|
1383
2062
|
* Lists background tasks tracked by the session.
|
|
1384
2063
|
*
|
|
@@ -1392,7 +2071,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1392
2071
|
*
|
|
1393
2072
|
* @returns Result of registering or reclaiming a client-owned task.
|
|
1394
2073
|
*/
|
|
1395
|
-
register: async (params) => connection.sendRequest("session.tasks.register", {
|
|
2074
|
+
register: async (params) => connection.sendRequest("session.tasks.register", { ...params, sessionId }),
|
|
1396
2075
|
/**
|
|
1397
2076
|
* Publishes generic progress or a terminal outcome for a client-owned task.
|
|
1398
2077
|
*
|
|
@@ -1400,7 +2079,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1400
2079
|
*
|
|
1401
2080
|
* @returns Result of publishing a client-owned task update.
|
|
1402
2081
|
*/
|
|
1403
|
-
update: async (params) => connection.sendRequest("session.tasks.update", {
|
|
2082
|
+
update: async (params) => connection.sendRequest("session.tasks.update", { ...params, sessionId }),
|
|
1404
2083
|
/**
|
|
1405
2084
|
* Refreshes metadata for any detached background shells the runtime knows about.
|
|
1406
2085
|
*
|
|
@@ -1420,7 +2099,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1420
2099
|
*
|
|
1421
2100
|
* @returns Progress information for the task, or null when no task with that ID is tracked.
|
|
1422
2101
|
*/
|
|
1423
|
-
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", {
|
|
2102
|
+
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", { ...params, sessionId }),
|
|
1424
2103
|
/**
|
|
1425
2104
|
* Returns the first sync-waiting task that can currently be promoted to background mode.
|
|
1426
2105
|
*
|
|
@@ -1434,7 +2113,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1434
2113
|
*
|
|
1435
2114
|
* @returns Indicates whether the task was successfully promoted to background mode.
|
|
1436
2115
|
*/
|
|
1437
|
-
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", {
|
|
2116
|
+
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", { ...params, sessionId }),
|
|
1438
2117
|
/**
|
|
1439
2118
|
* Atomically promotes the first promotable sync-waiting task to background mode and returns it.
|
|
1440
2119
|
*
|
|
@@ -1448,7 +2127,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1448
2127
|
*
|
|
1449
2128
|
* @returns Indicates whether the background task was successfully cancelled.
|
|
1450
2129
|
*/
|
|
1451
|
-
cancel: async (params) => connection.sendRequest("session.tasks.cancel", {
|
|
2130
|
+
cancel: async (params) => connection.sendRequest("session.tasks.cancel", { ...params, sessionId }),
|
|
1452
2131
|
/**
|
|
1453
2132
|
* Removes a completed or cancelled background task from tracking.
|
|
1454
2133
|
*
|
|
@@ -1456,7 +2135,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1456
2135
|
*
|
|
1457
2136
|
* @returns Indicates whether the task was removed. False when the task does not exist or is still running/idle.
|
|
1458
2137
|
*/
|
|
1459
|
-
remove: async (params) => connection.sendRequest("session.tasks.remove", {
|
|
2138
|
+
remove: async (params) => connection.sendRequest("session.tasks.remove", { ...params, sessionId }),
|
|
1460
2139
|
/**
|
|
1461
2140
|
* Sends a message to a background agent task.
|
|
1462
2141
|
*
|
|
@@ -1464,7 +2143,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1464
2143
|
*
|
|
1465
2144
|
* @returns Indicates whether the message was delivered, with an error message when delivery failed.
|
|
1466
2145
|
*/
|
|
1467
|
-
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", {
|
|
2146
|
+
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", { ...params, sessionId })
|
|
1468
2147
|
},
|
|
1469
2148
|
/** @experimental */
|
|
1470
2149
|
skills: {
|
|
@@ -1485,13 +2164,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1485
2164
|
*
|
|
1486
2165
|
* @param params Name of the skill to enable for the session.
|
|
1487
2166
|
*/
|
|
1488
|
-
enable: async (params) => connection.sendRequest("session.skills.enable", {
|
|
2167
|
+
enable: async (params) => connection.sendRequest("session.skills.enable", { ...params, sessionId }),
|
|
1489
2168
|
/**
|
|
1490
2169
|
* Disables a skill for the session.
|
|
1491
2170
|
*
|
|
1492
2171
|
* @param params Name of the skill to disable for the session.
|
|
1493
2172
|
*/
|
|
1494
|
-
disable: async (params) => connection.sendRequest("session.skills.disable", {
|
|
2173
|
+
disable: async (params) => connection.sendRequest("session.skills.disable", { ...params, sessionId }),
|
|
1495
2174
|
/**
|
|
1496
2175
|
* Reloads skill definitions for the session.
|
|
1497
2176
|
*
|
|
@@ -1506,11 +2185,17 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1506
2185
|
/** @experimental */
|
|
1507
2186
|
mcp: {
|
|
1508
2187
|
/**
|
|
1509
|
-
* Lists MCP servers
|
|
2188
|
+
* Lists materialized MCP servers and their connection status. Cache misses may start and wait for MCP servers.
|
|
1510
2189
|
*
|
|
1511
2190
|
* @returns MCP servers configured for the session, with their connection status and host-level state.
|
|
1512
2191
|
*/
|
|
1513
2192
|
list: async () => connection.sendRequest("session.mcp.list", { sessionId }),
|
|
2193
|
+
/**
|
|
2194
|
+
* Lists effective MCP configuration without starting, restarting, authenticating, or waiting for servers. An optional live observation is from an already materialized matching server; this is not a readiness guarantee.
|
|
2195
|
+
*
|
|
2196
|
+
* @returns Effective MCP configuration with optional live observations from matching already materialized servers.
|
|
2197
|
+
*/
|
|
2198
|
+
listConfigured: async () => connection.sendRequest("session.mcp.listConfigured", { sessionId }),
|
|
1514
2199
|
/**
|
|
1515
2200
|
* Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.
|
|
1516
2201
|
*
|
|
@@ -1518,19 +2203,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1518
2203
|
*
|
|
1519
2204
|
* @returns Tools exposed by the connected MCP server. Throws when the server is not connected.
|
|
1520
2205
|
*/
|
|
1521
|
-
listTools: async (params) => connection.sendRequest("session.mcp.listTools", {
|
|
2206
|
+
listTools: async (params) => connection.sendRequest("session.mcp.listTools", { ...params, sessionId }),
|
|
1522
2207
|
/**
|
|
1523
2208
|
* Enables an MCP server for the session.
|
|
1524
2209
|
*
|
|
1525
2210
|
* @param params Name of the MCP server to enable for the session.
|
|
1526
2211
|
*/
|
|
1527
|
-
enable: async (params) => connection.sendRequest("session.mcp.enable", {
|
|
2212
|
+
enable: async (params) => connection.sendRequest("session.mcp.enable", { ...params, sessionId }),
|
|
1528
2213
|
/**
|
|
1529
2214
|
* Disables an MCP server for the session.
|
|
1530
2215
|
*
|
|
1531
2216
|
* @param params Name of the MCP server to disable for the session.
|
|
1532
2217
|
*/
|
|
1533
|
-
disable: async (params) => connection.sendRequest("session.mcp.disable", {
|
|
2218
|
+
disable: async (params) => connection.sendRequest("session.mcp.disable", { ...params, sessionId }),
|
|
1534
2219
|
/**
|
|
1535
2220
|
* Reloads MCP server connections for the session.
|
|
1536
2221
|
*/
|
|
@@ -1548,7 +2233,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1548
2233
|
*
|
|
1549
2234
|
* @returns Outcome of an MCP sampling execution: success result, failure error, or cancellation.
|
|
1550
2235
|
*/
|
|
1551
|
-
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", {
|
|
2236
|
+
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", { ...params, sessionId }),
|
|
1552
2237
|
/**
|
|
1553
2238
|
* Cancels an in-flight MCP sampling execution by request ID.
|
|
1554
2239
|
*
|
|
@@ -1556,7 +2241,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1556
2241
|
*
|
|
1557
2242
|
* @returns Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
|
|
1558
2243
|
*/
|
|
1559
|
-
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", {
|
|
2244
|
+
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", { ...params, sessionId }),
|
|
1560
2245
|
/**
|
|
1561
2246
|
* Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).
|
|
1562
2247
|
*
|
|
@@ -1564,7 +2249,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1564
2249
|
*
|
|
1565
2250
|
* @returns Env-value mode recorded on the session after the update.
|
|
1566
2251
|
*/
|
|
1567
|
-
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", {
|
|
2252
|
+
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", { ...params, sessionId }),
|
|
1568
2253
|
/**
|
|
1569
2254
|
* Removes the auto-managed `github` MCP server when present.
|
|
1570
2255
|
*
|
|
@@ -1576,19 +2261,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1576
2261
|
*
|
|
1577
2262
|
* @param params Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server.
|
|
1578
2263
|
*/
|
|
1579
|
-
startServer: async (params) => connection.sendRequest("session.mcp.startServer", {
|
|
2264
|
+
startServer: async (params) => connection.sendRequest("session.mcp.startServer", { ...params, sessionId }),
|
|
1580
2265
|
/**
|
|
1581
2266
|
* 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.*`).
|
|
1582
2267
|
*
|
|
1583
2268
|
* @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.
|
|
1584
2269
|
*/
|
|
1585
|
-
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", {
|
|
2270
|
+
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", { ...params, sessionId }),
|
|
1586
2271
|
/**
|
|
1587
2272
|
* Stops an individual MCP server on the session's host.
|
|
1588
2273
|
*
|
|
1589
2274
|
* @param params Server name for an individual MCP server stop.
|
|
1590
2275
|
*/
|
|
1591
|
-
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", {
|
|
2276
|
+
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", { ...params, sessionId }),
|
|
1592
2277
|
/**
|
|
1593
2278
|
* Checks whether a named MCP server is currently running on the session's host.
|
|
1594
2279
|
*
|
|
@@ -1596,7 +2281,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1596
2281
|
*
|
|
1597
2282
|
* @returns Whether the named MCP server is running.
|
|
1598
2283
|
*/
|
|
1599
|
-
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", {
|
|
2284
|
+
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", { ...params, sessionId }),
|
|
1600
2285
|
/** @experimental */
|
|
1601
2286
|
oauth: {
|
|
1602
2287
|
/**
|
|
@@ -1606,21 +2291,35 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1606
2291
|
*
|
|
1607
2292
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1608
2293
|
*/
|
|
1609
|
-
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", {
|
|
2294
|
+
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", { ...params, sessionId }),
|
|
1610
2295
|
/**
|
|
1611
2296
|
* Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed.
|
|
1612
2297
|
*
|
|
1613
2298
|
* @param params Identifies the MCP server whose persisted OAuth credentials were updated.
|
|
1614
2299
|
*/
|
|
1615
|
-
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", {
|
|
2300
|
+
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { ...params, sessionId }),
|
|
2301
|
+
/**
|
|
2302
|
+
* Prepares an inert, expiring owned OAuth login bound to the original session requester and exact installation. Does not activate, connect, read credentials or open a browser.
|
|
2303
|
+
*
|
|
2304
|
+
* @param params Effect-free preparation bound to the existing local session, requester and installation, with frozen options.
|
|
2305
|
+
*
|
|
2306
|
+
* @returns An inert runtime-issued login handle. Preparation alone performs no activation or OAuth work.
|
|
2307
|
+
*/
|
|
2308
|
+
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", { ...params, sessionId }),
|
|
1616
2309
|
/**
|
|
1617
|
-
* Starts OAuth authentication for a remote MCP server.
|
|
2310
|
+
* Starts OAuth authentication for a remote MCP server. Owned servers require the original one-use prepareLogin handle and exact installation ID; manual servers retain the existing direct login behaviour.
|
|
1618
2311
|
*
|
|
1619
|
-
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback
|
|
2312
|
+
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback handling, and static OAuth client selection.
|
|
1620
2313
|
*
|
|
1621
2314
|
* @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
|
|
1622
2315
|
*/
|
|
1623
|
-
login: async (params) => connection.sendRequest("session.mcp.oauth.login", {
|
|
2316
|
+
login: async (params) => connection.sendRequest("session.mcp.oauth.login", { ...params, sessionId }),
|
|
2317
|
+
/**
|
|
2318
|
+
* Completes a runtime-managed MCP OAuth login after the authorization server redirects to a host-managed callback URL.
|
|
2319
|
+
*
|
|
2320
|
+
* @param params Host-delivered callback for a runtime-managed MCP OAuth login.
|
|
2321
|
+
*/
|
|
2322
|
+
complete: async (params) => connection.sendRequest("session.mcp.oauth.complete", { ...params, sessionId }),
|
|
1624
2323
|
/**
|
|
1625
2324
|
* 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.
|
|
1626
2325
|
*
|
|
@@ -1628,7 +2327,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1628
2327
|
*
|
|
1629
2328
|
* @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.
|
|
1630
2329
|
*/
|
|
1631
|
-
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", {
|
|
2330
|
+
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { ...params, sessionId }),
|
|
2331
|
+
/**
|
|
2332
|
+
* Cancels the exact owned OAuth login issued to this original session requester, without clearing shared credentials.
|
|
2333
|
+
*
|
|
2334
|
+
* @param params Targets only the original prepared/applying owned login on this exact session requester.
|
|
2335
|
+
*
|
|
2336
|
+
* @returns Honest terminal cancellation result; persistence or recovery failures remain RPC errors.
|
|
2337
|
+
*/
|
|
2338
|
+
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", { ...params, sessionId }),
|
|
1632
2339
|
/**
|
|
1633
2340
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1634
2341
|
*
|
|
@@ -1636,7 +2343,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1636
2343
|
*
|
|
1637
2344
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1638
2345
|
*/
|
|
1639
|
-
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", {
|
|
2346
|
+
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", { ...params, sessionId })
|
|
1640
2347
|
},
|
|
1641
2348
|
/** @experimental */
|
|
1642
2349
|
headers: {
|
|
@@ -1647,7 +2354,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1647
2354
|
*
|
|
1648
2355
|
* @returns Indicates whether the pending MCP headers refresh response was accepted.
|
|
1649
2356
|
*/
|
|
1650
|
-
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", {
|
|
2357
|
+
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", { ...params, sessionId })
|
|
1651
2358
|
},
|
|
1652
2359
|
/** @experimental */
|
|
1653
2360
|
apps: {
|
|
@@ -1658,7 +2365,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1658
2365
|
*
|
|
1659
2366
|
* @returns Resource contents returned by the MCP server.
|
|
1660
2367
|
*/
|
|
1661
|
-
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", {
|
|
2368
|
+
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", { ...params, sessionId }),
|
|
1662
2369
|
/**
|
|
1663
2370
|
* List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `["model","app"]`) or includes `"app"`.
|
|
1664
2371
|
*
|
|
@@ -1666,7 +2373,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1666
2373
|
*
|
|
1667
2374
|
* @returns App-callable tools from the named MCP server.
|
|
1668
2375
|
*/
|
|
1669
|
-
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", {
|
|
2376
|
+
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", { ...params, sessionId }),
|
|
1670
2377
|
/**
|
|
1671
2378
|
* Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`.
|
|
1672
2379
|
*
|
|
@@ -1674,13 +2381,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1674
2381
|
*
|
|
1675
2382
|
* @returns Standard MCP CallToolResult
|
|
1676
2383
|
*/
|
|
1677
|
-
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", {
|
|
2384
|
+
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", { ...params, sessionId }),
|
|
1678
2385
|
/**
|
|
1679
2386
|
* Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI.
|
|
1680
2387
|
*
|
|
1681
2388
|
* @param params Host context to advertise to MCP App guests.
|
|
1682
2389
|
*/
|
|
1683
|
-
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", {
|
|
2390
|
+
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", { ...params, sessionId }),
|
|
1684
2391
|
/**
|
|
1685
2392
|
* Read the current host context advertised to MCP App guests.
|
|
1686
2393
|
*
|
|
@@ -1694,7 +2401,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1694
2401
|
*
|
|
1695
2402
|
* @returns Diagnostic snapshot of MCP Apps wiring for the named server.
|
|
1696
2403
|
*/
|
|
1697
|
-
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", {
|
|
2404
|
+
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", { ...params, sessionId })
|
|
1698
2405
|
},
|
|
1699
2406
|
/** @experimental */
|
|
1700
2407
|
resources: {
|
|
@@ -1705,7 +2412,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1705
2412
|
*
|
|
1706
2413
|
* @returns Resource contents returned by the MCP server.
|
|
1707
2414
|
*/
|
|
1708
|
-
read: async (params) => connection.sendRequest("session.mcp.resources.read", {
|
|
2415
|
+
read: async (params) => connection.sendRequest("session.mcp.resources.read", { ...params, sessionId }),
|
|
1709
2416
|
/**
|
|
1710
2417
|
* Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
1711
2418
|
*
|
|
@@ -1713,7 +2420,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1713
2420
|
*
|
|
1714
2421
|
* @returns One page of resources advertised by the named MCP server.
|
|
1715
2422
|
*/
|
|
1716
|
-
list: async (params) => connection.sendRequest("session.mcp.resources.list", {
|
|
2423
|
+
list: async (params) => connection.sendRequest("session.mcp.resources.list", { ...params, sessionId }),
|
|
1717
2424
|
/**
|
|
1718
2425
|
* Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
1719
2426
|
*
|
|
@@ -1721,23 +2428,230 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1721
2428
|
*
|
|
1722
2429
|
* @returns One page of resource templates advertised by the named MCP server.
|
|
1723
2430
|
*/
|
|
1724
|
-
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", {
|
|
2431
|
+
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", { ...params, sessionId })
|
|
2432
|
+
},
|
|
2433
|
+
/** @experimental */
|
|
2434
|
+
prompts: {
|
|
2435
|
+
/**
|
|
2436
|
+
* Enumerate one page of prompts a connected MCP server exposes (proxies MCP `prompts/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
2437
|
+
*
|
|
2438
|
+
* @param params MCP server whose prompts to enumerate.
|
|
2439
|
+
*
|
|
2440
|
+
* @returns One page of prompts advertised by the named MCP server.
|
|
2441
|
+
*/
|
|
2442
|
+
list: async (params) => connection.sendRequest("session.mcp.prompts.list", { ...params, sessionId }),
|
|
2443
|
+
/**
|
|
2444
|
+
* Get a prompt's messages from a connected MCP server (proxies MCP `prompts/get`). Content is preserved as opaque JSON. Does not send messages to the model, execute tools, or fetch referenced resources.
|
|
2445
|
+
*
|
|
2446
|
+
* @param params MCP server, prompt name, and optional string-valued arguments.
|
|
2447
|
+
*
|
|
2448
|
+
* @returns Prompt messages returned by the MCP server without sending them to the model.
|
|
2449
|
+
*/
|
|
2450
|
+
get: async (params) => connection.sendRequest("session.mcp.prompts.get", { ...params, sessionId })
|
|
1725
2451
|
}
|
|
1726
2452
|
},
|
|
1727
2453
|
/** @experimental */
|
|
2454
|
+
diagnostics: {
|
|
2455
|
+
/**
|
|
2456
|
+
* Patches configured session diagnostic sources without restarting their producers. Setting a source level to off clears its retained diagnostics and invalidates cursors selecting that source.
|
|
2457
|
+
*
|
|
2458
|
+
* @param params Patch session diagnostic thresholds for explicitly supplied sources.
|
|
2459
|
+
*
|
|
2460
|
+
* @returns Per-source session diagnostics configuration.
|
|
2461
|
+
*/
|
|
2462
|
+
configure: async (params) => connection.sendRequest("session.diagnostics.configure", { ...params, sessionId }),
|
|
2463
|
+
/**
|
|
2464
|
+
* Reads a bounded batch of retained session diagnostics for the selected sources. Records are never consumed and each reader advances independently through its opaque cursor.
|
|
2465
|
+
*
|
|
2466
|
+
* @param params Cursor-based request for session diagnostics. The default limit is 100 (maximum 500); the default waitMs is zero (maximum 30000).
|
|
2467
|
+
*
|
|
2468
|
+
* @returns One cursor-addressed page of retained session diagnostics.
|
|
2469
|
+
*/
|
|
2470
|
+
read: async (params) => connection.sendRequest("session.diagnostics.read", { ...params, sessionId })
|
|
2471
|
+
},
|
|
2472
|
+
/** @experimental */
|
|
2473
|
+
connectors: {
|
|
2474
|
+
/**
|
|
2475
|
+
* Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
|
|
2476
|
+
*
|
|
2477
|
+
* @returns Feature detection and hard polling limits for the EXPERIMENTAL session connector API.
|
|
2478
|
+
*/
|
|
2479
|
+
getCapabilities: async () => connection.sendRequest("session.connectors.getCapabilities", { sessionId }),
|
|
2480
|
+
/**
|
|
2481
|
+
* Returns the session account selection, or null.
|
|
2482
|
+
*
|
|
2483
|
+
* @returns Session account selection, or null.
|
|
2484
|
+
*/
|
|
2485
|
+
getAccount: async () => connection.sendRequest("session.connectors.getAccount", { sessionId }),
|
|
2486
|
+
/**
|
|
2487
|
+
* Returns authoritative session Connector state from current availability, pinned account selection, cached catalog, and live MCP projection without performing a Connector service request.
|
|
2488
|
+
*
|
|
2489
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
2490
|
+
*/
|
|
2491
|
+
getStatus: async () => connection.sendRequest("session.connectors.getStatus", { sessionId }),
|
|
2492
|
+
/**
|
|
2493
|
+
* Returns the cached Connector catalog for the pinned opaque account selection, fetching it only when this session has no cached catalog.
|
|
2494
|
+
*
|
|
2495
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
2496
|
+
*
|
|
2497
|
+
* @returns Validated Connector catalog snapshot cached by the session.
|
|
2498
|
+
*/
|
|
2499
|
+
list: async (params) => connection.sendRequest("session.connectors.list", { ...params, sessionId }),
|
|
2500
|
+
/**
|
|
2501
|
+
* Refreshes and validates the Connector catalog for the pinned opaque account selection.
|
|
2502
|
+
*
|
|
2503
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
2504
|
+
*
|
|
2505
|
+
* @returns Validated Connector catalog snapshot cached by the session.
|
|
2506
|
+
*/
|
|
2507
|
+
refresh: async (params) => connection.sendRequest("session.connectors.refresh", { ...params, sessionId }),
|
|
2508
|
+
/**
|
|
2509
|
+
* Initiates an idempotent Connector connection request without opening a browser. Returns connected when the service is immediately authoritative, consent_required with a validated URL, or pending with an opaque continuation ID.
|
|
2510
|
+
*
|
|
2511
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
2512
|
+
*
|
|
2513
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2514
|
+
*/
|
|
2515
|
+
connect: async (params) => connection.sendRequest("session.connectors.connect", { ...params, sessionId }),
|
|
2516
|
+
/**
|
|
2517
|
+
* Re-initiates an idempotent Connector connection request without browser or UI effects, with the same typed outcomes as connect.
|
|
2518
|
+
*
|
|
2519
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
2520
|
+
*
|
|
2521
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2522
|
+
*/
|
|
2523
|
+
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", { ...params, sessionId }),
|
|
2524
|
+
/**
|
|
2525
|
+
* Continues a pending Connector connection with caller-supplied attempt, interval, and deadline bounds. The runtime never opens the returned consent URL.
|
|
2526
|
+
*
|
|
2527
|
+
* @param params Explicitly bounded continuation of a pending Connector connection.
|
|
2528
|
+
*
|
|
2529
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2530
|
+
*/
|
|
2531
|
+
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", { ...params, sessionId }),
|
|
2532
|
+
/**
|
|
2533
|
+
* Disconnects one Connector for the pinned opaque account selection, refreshes the authoritative catalog, and removes its session-owned MCP projection.
|
|
2534
|
+
*
|
|
2535
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
2536
|
+
*
|
|
2537
|
+
* @returns Authoritative result after disconnect and MCP reconciliation.
|
|
2538
|
+
*/
|
|
2539
|
+
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", { ...params, sessionId }),
|
|
2540
|
+
/**
|
|
2541
|
+
* Reconciles the authoritative cached or freshly requested Connector catalog into the session Connector MCP projection and returns live status.
|
|
2542
|
+
*
|
|
2543
|
+
* @param params Requests authoritative Connector-to-MCP reconciliation for the pinned account.
|
|
2544
|
+
*
|
|
2545
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
2546
|
+
*/
|
|
2547
|
+
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", { ...params, sessionId })
|
|
2548
|
+
},
|
|
2549
|
+
/** @experimental */
|
|
2550
|
+
managedSettings: {
|
|
2551
|
+
/**
|
|
2552
|
+
* Waits for the live session's in-flight managed-settings application, then returns the retained effective snapshot used by runtime enforcement and by `session.managed_settings_resolved`. It does not perform another account, device, or server resolution, and rejects when resolution has not produced a snapshot.
|
|
2553
|
+
*
|
|
2554
|
+
* @returns Effective enterprise managed settings and contributing channels. Session events report applied policy; sessionless resolve reports an account/device snapshot, and compose reports a non-applying preview of candidate documents. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively. Session-local SDK-client policy is included only in session results. Marked experimental while the managed-settings surface stabilizes.
|
|
2555
|
+
*/
|
|
2556
|
+
get: async () => connection.sendRequest("session.managedSettings.get", { sessionId })
|
|
2557
|
+
},
|
|
2558
|
+
/** @experimental */
|
|
1728
2559
|
plugins: {
|
|
1729
2560
|
/**
|
|
1730
|
-
* Lists
|
|
2561
|
+
* Lists globally installed, live, built-in, and enterprise-managed desired plugins using the live session's authoritative account, working directory, and retained managed policy.
|
|
1731
2562
|
*
|
|
1732
2563
|
* @returns Plugins installed for the session, with their enabled state and version metadata.
|
|
1733
2564
|
*/
|
|
1734
2565
|
list: async () => connection.sendRequest("session.plugins.list", { sessionId }),
|
|
2566
|
+
/**
|
|
2567
|
+
* Installs a plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
2568
|
+
*
|
|
2569
|
+
* @param params Plugin source resolved relative to the session's authoritative working directory.
|
|
2570
|
+
*
|
|
2571
|
+
* @returns Result of installing a plugin.
|
|
2572
|
+
*/
|
|
2573
|
+
install: async (params) => connection.sendRequest("session.plugins.install", { ...params, sessionId }),
|
|
2574
|
+
/**
|
|
2575
|
+
* Uninstalls a plugin when permitted by the live session's retained managed policy.
|
|
2576
|
+
*
|
|
2577
|
+
* @param params Name (or spec) of the plugin to uninstall.
|
|
2578
|
+
*/
|
|
2579
|
+
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { ...params, sessionId }),
|
|
2580
|
+
/**
|
|
2581
|
+
* Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
2582
|
+
*
|
|
2583
|
+
* @param params Name (or spec) of the plugin to update.
|
|
2584
|
+
*
|
|
2585
|
+
* @returns Result of updating a single plugin.
|
|
2586
|
+
*/
|
|
2587
|
+
update: async (params) => connection.sendRequest("session.plugins.update", { ...params, sessionId }),
|
|
2588
|
+
/**
|
|
2589
|
+
* Enables installed plugins when permitted by the live session's retained managed policy.
|
|
2590
|
+
*
|
|
2591
|
+
* @param params Plugin names (or specs) to enable in the session's authoritative working directory.
|
|
2592
|
+
*/
|
|
2593
|
+
enable: async (params) => connection.sendRequest("session.plugins.enable", { ...params, sessionId }),
|
|
2594
|
+
/**
|
|
2595
|
+
* Disables installed plugins when permitted by the live session's retained managed policy.
|
|
2596
|
+
*
|
|
2597
|
+
* @param params Plugin names (or specs) to disable in the session's authoritative working directory.
|
|
2598
|
+
*/
|
|
2599
|
+
disable: async (params) => connection.sendRequest("session.plugins.disable", { ...params, sessionId }),
|
|
2600
|
+
/** @experimental */
|
|
2601
|
+
marketplaces: {
|
|
2602
|
+
/**
|
|
2603
|
+
* Lists registered and enterprise-managed desired marketplaces using the live session's retained policy.
|
|
2604
|
+
*
|
|
2605
|
+
* @returns All registered marketplaces, including built-in defaults.
|
|
2606
|
+
*/
|
|
2607
|
+
list: async () => connection.sendRequest("session.plugins.marketplaces.list", { sessionId }),
|
|
2608
|
+
/**
|
|
2609
|
+
* Adds a marketplace when permitted by the live session's retained managed policy.
|
|
2610
|
+
*
|
|
2611
|
+
* @param params Marketplace source and optional working directory for relative-path resolution.
|
|
2612
|
+
*
|
|
2613
|
+
* @returns Result of registering a new marketplace.
|
|
2614
|
+
*/
|
|
2615
|
+
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { ...params, sessionId }),
|
|
2616
|
+
/**
|
|
2617
|
+
* Removes a marketplace when permitted by the live session's retained managed policy.
|
|
2618
|
+
*
|
|
2619
|
+
* @param params Name of the marketplace to remove and an optional force flag.
|
|
2620
|
+
*
|
|
2621
|
+
* @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
|
|
2622
|
+
*/
|
|
2623
|
+
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { ...params, sessionId }),
|
|
2624
|
+
/**
|
|
2625
|
+
* Browses a marketplace resolved through the live session's working directory and retained managed policy.
|
|
2626
|
+
*
|
|
2627
|
+
* @param params Name of the marketplace whose plugin catalog to fetch.
|
|
2628
|
+
*
|
|
2629
|
+
* @returns Plugins advertised by the marketplace.
|
|
2630
|
+
*/
|
|
2631
|
+
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { ...params, sessionId }),
|
|
2632
|
+
/**
|
|
2633
|
+
* Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
|
|
2634
|
+
*
|
|
2635
|
+
* @param params Optional marketplace name; omit to refresh all.
|
|
2636
|
+
*
|
|
2637
|
+
* @returns Result of refreshing one or more marketplace catalogs.
|
|
2638
|
+
*/
|
|
2639
|
+
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { ...params, sessionId })
|
|
2640
|
+
},
|
|
1735
2641
|
/**
|
|
1736
2642
|
* Reloads the session's plugin set, refreshing MCP servers, custom agents, hooks, and skills cache so SDK-driven changes via `server.plugins.*` take effect immediately.
|
|
1737
2643
|
*
|
|
1738
2644
|
* @param params Optional flags controlling which side effects the reload performs.
|
|
1739
2645
|
*/
|
|
1740
|
-
reload: async (params) => connection.sendRequest("session.plugins.reload", {
|
|
2646
|
+
reload: async (params) => connection.sendRequest("session.plugins.reload", { ...params, sessionId }),
|
|
2647
|
+
/**
|
|
2648
|
+
* Installs or updates the plugins the session's managed settings require now, without waiting for the next automatic attempt after a failure, then reloads plugins. Reports progress and failures with the same `session.info` and `session.warning` events as automatic preparation. Fails when the runtime does not prepare managed plugins for the session.
|
|
2649
|
+
*
|
|
2650
|
+
* @param params Plugins required by the session's managed settings to install or update again.
|
|
2651
|
+
*
|
|
2652
|
+
* @returns Per-plugin outcomes of retrying the plugins required by the session's managed settings.
|
|
2653
|
+
*/
|
|
2654
|
+
retryManaged: async (params) => connection.sendRequest("session.plugins.retryManaged", { ...params, sessionId })
|
|
1741
2655
|
},
|
|
1742
2656
|
/** @experimental */
|
|
1743
2657
|
provider: {
|
|
@@ -1748,7 +2662,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1748
2662
|
*
|
|
1749
2663
|
* @returns A snapshot of the provider endpoint the session is currently configured to talk to.
|
|
1750
2664
|
*/
|
|
1751
|
-
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", {
|
|
2665
|
+
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", { ...params, sessionId }),
|
|
1752
2666
|
/**
|
|
1753
2667
|
* Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models, so a model may reference a provider added in the same call; across calls a model may reference any provider already registered (from session creation or a prior add). A model whose referenced provider is not registered by the end of the call is rejected. Newly added models become selectable via `model.list` / `model.switchTo` and are inherited by sub-agents spawned afterwards.
|
|
1754
2668
|
*
|
|
@@ -1756,7 +2670,23 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1756
2670
|
*
|
|
1757
2671
|
* @returns The selectable model entries synthesized for the models added by this call.
|
|
1758
2672
|
*/
|
|
1759
|
-
add: async (params) => connection.sendRequest("session.provider.add", {
|
|
2673
|
+
add: async (params) => connection.sendRequest("session.provider.add", { ...params, sessionId }),
|
|
2674
|
+
/**
|
|
2675
|
+
* Atomically updates the session's BYOK provider and model registry by applying the supplied snapshot, replacing existing entries, updating models, or removing entries absent from the snapshot.
|
|
2676
|
+
*
|
|
2677
|
+
* @param params Authoritative BYOK provider and model registry snapshot to apply atomically to the session.
|
|
2678
|
+
*
|
|
2679
|
+
* @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
|
|
2680
|
+
*/
|
|
2681
|
+
sync: async (params) => connection.sendRequest("session.provider.sync", { ...params, sessionId }),
|
|
2682
|
+
/**
|
|
2683
|
+
* Withdraws named host-managed models from the session's BYOK registry, leaving every other entry untouched. The scoped counterpart to `provider.sync`: a snapshot can only describe entries the caller knows about, so using it to remove one model silently withdraws rows registered by another source, such as a plugin calling `provider.add` at runtime. Naming what to remove leaves unrelated entries alone. Selection ids that are not registered are ignored, so withdrawal is idempotent. A provider is removed only when one of the withdrawn models was the last entry referencing it; a provider that simply has no models, which is the normal state while its rows are supplied by catalog discovery, is left in place.
|
|
2684
|
+
*
|
|
2685
|
+
* @param params Host-managed model selection ids to withdraw from the session's BYOK registry.
|
|
2686
|
+
*
|
|
2687
|
+
* @returns What the withdrawal actually removed from the registry.
|
|
2688
|
+
*/
|
|
2689
|
+
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", { ...params, sessionId })
|
|
1760
2690
|
},
|
|
1761
2691
|
/** @experimental */
|
|
1762
2692
|
options: {
|
|
@@ -1767,7 +2697,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1767
2697
|
*
|
|
1768
2698
|
* @returns Indicates whether the session options patch was applied successfully.
|
|
1769
2699
|
*/
|
|
1770
|
-
update: async (params) => connection.sendRequest("session.options.update", {
|
|
2700
|
+
update: async (params) => connection.sendRequest("session.options.update", { ...params, sessionId })
|
|
1771
2701
|
},
|
|
1772
2702
|
/** @experimental */
|
|
1773
2703
|
lsp: {
|
|
@@ -1776,7 +2706,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1776
2706
|
*
|
|
1777
2707
|
* @param params Parameters for (re)loading the merged LSP configuration set.
|
|
1778
2708
|
*/
|
|
1779
|
-
initialize: async (params) => connection.sendRequest("session.lsp.initialize", {
|
|
2709
|
+
initialize: async (params) => connection.sendRequest("session.lsp.initialize", { ...params, sessionId })
|
|
1780
2710
|
},
|
|
1781
2711
|
/** @experimental */
|
|
1782
2712
|
extensions: {
|
|
@@ -1787,27 +2717,33 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1787
2717
|
*/
|
|
1788
2718
|
list: async () => connection.sendRequest("session.extensions.list", { sessionId }),
|
|
1789
2719
|
/**
|
|
1790
|
-
* Enables an extension for the session.
|
|
2720
|
+
* Enables an extension for the session and persists the preference when the session has a settings store. Hosts synchronizing effective membership should use extensions.reconcile instead.
|
|
1791
2721
|
*
|
|
1792
2722
|
* @param params Source-qualified extension identifier to enable for the session.
|
|
1793
2723
|
*/
|
|
1794
|
-
enable: async (params) => connection.sendRequest("session.extensions.enable", {
|
|
2724
|
+
enable: async (params) => connection.sendRequest("session.extensions.enable", { ...params, sessionId }),
|
|
1795
2725
|
/**
|
|
1796
|
-
* Disables an extension for the session.
|
|
2726
|
+
* Disables an extension for the session and persists the preference when the session has a settings store. Hosts synchronizing effective membership should use extensions.reconcile instead.
|
|
1797
2727
|
*
|
|
1798
2728
|
* @param params Source-qualified extension identifier to disable for the session.
|
|
1799
2729
|
*/
|
|
1800
|
-
disable: async (params) => connection.sendRequest("session.extensions.disable", {
|
|
2730
|
+
disable: async (params) => connection.sendRequest("session.extensions.disable", { ...params, sessionId }),
|
|
1801
2731
|
/**
|
|
1802
2732
|
* Reloads extension definitions and processes for the session.
|
|
1803
2733
|
*/
|
|
1804
2734
|
reload: async () => connection.sendRequest("session.extensions.reload", { sessionId }),
|
|
2735
|
+
/**
|
|
2736
|
+
* Host-only reconciliation of authoritative session-effective extension membership and enablement. Refreshes runtime-owned discovery and preferences without persisting settings, installing plugins, or restarting unchanged activations. Returns ExtensionList only after required starts and process/contribution cleanup settle. Takes no caller inventory or overrides. Missing controllers, unready/incomplete discovery, unavailable workspaces, superseded inputs, and lifecycle failures are errors, not empty membership. Independently proven revocations may be applied before an error; retry converges without restarting healthy activations. Error data contains lifecycleChangesApplied and code: extension_reconciliation_host_required, extension_reconciliation_unavailable, extension_reconciliation_not_ready, extension_reconciliation_discovery_failed, extension_reconciliation_workspace_unavailable, extension_reconciliation_superseded, or extension_reconciliation_lifecycle_failed. Mark host reconciliation state applied only on success. On older runtimes, method-not-found must not fall back to global discovery and persistent extension disables.
|
|
2737
|
+
*
|
|
2738
|
+
* @returns Extensions discovered for the session, with their current status.
|
|
2739
|
+
*/
|
|
2740
|
+
reconcile: async () => connection.sendRequest("session.extensions.reconcile", { sessionId }),
|
|
1805
2741
|
/**
|
|
1806
2742
|
* Push attachments into the next user-message turn from an extension. The host should surface them as composer pills and forward them via the next session.send call. Callable only by extension-owned connections.
|
|
1807
2743
|
*
|
|
1808
2744
|
* @param params Parameters for session.extensions.sendAttachmentsToMessage.
|
|
1809
2745
|
*/
|
|
1810
|
-
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", {
|
|
2746
|
+
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", { ...params, sessionId })
|
|
1811
2747
|
},
|
|
1812
2748
|
/** @experimental */
|
|
1813
2749
|
tools: {
|
|
@@ -1818,7 +2754,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1818
2754
|
*
|
|
1819
2755
|
* @returns Canonical result returned by a session tool.
|
|
1820
2756
|
*/
|
|
1821
|
-
execute: async (params) => connection.sendRequest("session.tools.execute", {
|
|
2757
|
+
execute: async (params) => connection.sendRequest("session.tools.execute", { ...params, sessionId }),
|
|
1822
2758
|
/**
|
|
1823
2759
|
* Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.
|
|
1824
2760
|
*
|
|
@@ -1826,7 +2762,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1826
2762
|
*
|
|
1827
2763
|
* @returns Rust-owned built-in tool descriptors for the session.
|
|
1828
2764
|
*/
|
|
1829
|
-
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", {
|
|
2765
|
+
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", { ...params, sessionId }),
|
|
1830
2766
|
/**
|
|
1831
2767
|
* Projects a completed task_complete tool call into its label-safe session event payload.
|
|
1832
2768
|
*
|
|
@@ -1834,7 +2770,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1834
2770
|
*
|
|
1835
2771
|
* @returns Task completion notification with summary from the agent
|
|
1836
2772
|
*/
|
|
1837
|
-
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", {
|
|
2773
|
+
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", { ...params, sessionId }),
|
|
1838
2774
|
/**
|
|
1839
2775
|
* Provides the result for a pending external tool call.
|
|
1840
2776
|
*
|
|
@@ -1842,7 +2778,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1842
2778
|
*
|
|
1843
2779
|
* @returns Indicates whether the external tool call result was handled successfully.
|
|
1844
2780
|
*/
|
|
1845
|
-
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", {
|
|
2781
|
+
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", { ...params, sessionId }),
|
|
2782
|
+
/**
|
|
2783
|
+
* Lists the external tool calls of the session and its sub-agents that are still waiting for session.tools.handlePendingToolCall.
|
|
2784
|
+
*
|
|
2785
|
+
* @returns External tool calls still waiting for a result.
|
|
2786
|
+
*/
|
|
2787
|
+
listPendingRequests: async () => connection.sendRequest("session.tools.listPendingRequests", { sessionId }),
|
|
1846
2788
|
/**
|
|
1847
2789
|
* Resolves, builds, and validates the runtime tool list for the session.
|
|
1848
2790
|
*
|
|
@@ -1862,7 +2804,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1862
2804
|
*
|
|
1863
2805
|
* @returns Empty result after replacing the calling connection's externally implemented tools.
|
|
1864
2806
|
*/
|
|
1865
|
-
set: async (params) => connection.sendRequest("session.tools.set", {
|
|
2807
|
+
set: async (params) => connection.sendRequest("session.tools.set", { ...params, sessionId }),
|
|
1866
2808
|
/**
|
|
1867
2809
|
* Sets the current session's live subagent settings override, which takes precedence over persisted user settings until cleared. Persisted user settings remain the source of truth for future sessions.
|
|
1868
2810
|
*
|
|
@@ -1870,7 +2812,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1870
2812
|
*
|
|
1871
2813
|
* @returns Empty result after applying subagent settings
|
|
1872
2814
|
*/
|
|
1873
|
-
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", {
|
|
2815
|
+
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", { ...params, sessionId })
|
|
1874
2816
|
},
|
|
1875
2817
|
/** @experimental */
|
|
1876
2818
|
commands: {
|
|
@@ -1881,7 +2823,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1881
2823
|
*
|
|
1882
2824
|
* @returns Slash commands available in the session, after applying any include/exclude filters.
|
|
1883
2825
|
*/
|
|
1884
|
-
list: async (params) => connection.sendRequest("session.commands.list", {
|
|
2826
|
+
list: async (params) => connection.sendRequest("session.commands.list", { ...params, sessionId }),
|
|
1885
2827
|
/**
|
|
1886
2828
|
* Invokes a slash command in the session.
|
|
1887
2829
|
*
|
|
@@ -1889,7 +2831,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1889
2831
|
*
|
|
1890
2832
|
* @returns Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
|
|
1891
2833
|
*/
|
|
1892
|
-
invoke: async (params) => connection.sendRequest("session.commands.invoke", {
|
|
2834
|
+
invoke: async (params) => connection.sendRequest("session.commands.invoke", { ...params, sessionId }),
|
|
1893
2835
|
/**
|
|
1894
2836
|
* Reports completion of a pending client-handled slash command.
|
|
1895
2837
|
*
|
|
@@ -1897,7 +2839,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1897
2839
|
*
|
|
1898
2840
|
* @returns Indicates whether the pending client-handled command was completed successfully.
|
|
1899
2841
|
*/
|
|
1900
|
-
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", {
|
|
2842
|
+
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", { ...params, sessionId }),
|
|
1901
2843
|
/**
|
|
1902
2844
|
* Executes a slash command synchronously and returns any error.
|
|
1903
2845
|
*
|
|
@@ -1905,7 +2847,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1905
2847
|
*
|
|
1906
2848
|
* @returns Error message produced while executing the command, if any.
|
|
1907
2849
|
*/
|
|
1908
|
-
execute: async (params) => connection.sendRequest("session.commands.execute", {
|
|
2850
|
+
execute: async (params) => connection.sendRequest("session.commands.execute", { ...params, sessionId }),
|
|
1909
2851
|
/**
|
|
1910
2852
|
* Enqueues a slash command for FIFO processing on the local session.
|
|
1911
2853
|
*
|
|
@@ -1913,7 +2855,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1913
2855
|
*
|
|
1914
2856
|
* @returns Indicates whether the command was accepted into the local execution queue.
|
|
1915
2857
|
*/
|
|
1916
|
-
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", {
|
|
2858
|
+
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", { ...params, sessionId }),
|
|
1917
2859
|
/**
|
|
1918
2860
|
* Reports whether the host actually executed a queued command and whether to continue processing.
|
|
1919
2861
|
*
|
|
@@ -1921,7 +2863,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1921
2863
|
*
|
|
1922
2864
|
* @returns Indicates whether the queued-command response was matched to a pending request.
|
|
1923
2865
|
*/
|
|
1924
|
-
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", {
|
|
2866
|
+
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", { ...params, sessionId })
|
|
1925
2867
|
},
|
|
1926
2868
|
/** @experimental */
|
|
1927
2869
|
telemetry: {
|
|
@@ -1936,7 +2878,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1936
2878
|
*
|
|
1937
2879
|
* @param params Feature override key/value pairs to attach to subsequent telemetry events from this session.
|
|
1938
2880
|
*/
|
|
1939
|
-
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", {
|
|
2881
|
+
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", { ...params, sessionId })
|
|
1940
2882
|
},
|
|
1941
2883
|
/** @experimental */
|
|
1942
2884
|
ui: {
|
|
@@ -1947,7 +2889,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1947
2889
|
*
|
|
1948
2890
|
* @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.
|
|
1949
2891
|
*/
|
|
1950
|
-
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", {
|
|
2892
|
+
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", { ...params, sessionId }),
|
|
1951
2893
|
/**
|
|
1952
2894
|
* Requests structured input from a UI-capable client.
|
|
1953
2895
|
*
|
|
@@ -1955,7 +2897,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1955
2897
|
*
|
|
1956
2898
|
* @returns The elicitation response (accept with form values, decline, or cancel)
|
|
1957
2899
|
*/
|
|
1958
|
-
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", {
|
|
2900
|
+
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", { ...params, sessionId }),
|
|
1959
2901
|
/**
|
|
1960
2902
|
* Provides the user response for a pending elicitation request.
|
|
1961
2903
|
*
|
|
@@ -1963,7 +2905,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1963
2905
|
*
|
|
1964
2906
|
* @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
|
|
1965
2907
|
*/
|
|
1966
|
-
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", {
|
|
2908
|
+
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", { ...params, sessionId }),
|
|
1967
2909
|
/**
|
|
1968
2910
|
* Resolves a pending `user_input.requested` event with the user's response.
|
|
1969
2911
|
*
|
|
@@ -1971,7 +2913,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1971
2913
|
*
|
|
1972
2914
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
1973
2915
|
*/
|
|
1974
|
-
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", {
|
|
2916
|
+
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", { ...params, sessionId }),
|
|
1975
2917
|
/**
|
|
1976
2918
|
* Resolves a pending `sampling.requested` event with a sampling result, or rejects it.
|
|
1977
2919
|
*
|
|
@@ -1979,7 +2921,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1979
2921
|
*
|
|
1980
2922
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
1981
2923
|
*/
|
|
1982
|
-
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", {
|
|
2924
|
+
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", { ...params, sessionId }),
|
|
1983
2925
|
/**
|
|
1984
2926
|
* Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision.
|
|
1985
2927
|
*
|
|
@@ -1987,7 +2929,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1987
2929
|
*
|
|
1988
2930
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
1989
2931
|
*/
|
|
1990
|
-
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", {
|
|
2932
|
+
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { ...params, sessionId }),
|
|
1991
2933
|
/**
|
|
1992
2934
|
* Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action.
|
|
1993
2935
|
*
|
|
@@ -1995,7 +2937,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1995
2937
|
*
|
|
1996
2938
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
1997
2939
|
*/
|
|
1998
|
-
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", {
|
|
2940
|
+
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { ...params, sessionId }),
|
|
1999
2941
|
/**
|
|
2000
2942
|
* Resolves a pending `exit_plan_mode.requested` event with the user's response.
|
|
2001
2943
|
*
|
|
@@ -2003,7 +2945,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2003
2945
|
*
|
|
2004
2946
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2005
2947
|
*/
|
|
2006
|
-
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", {
|
|
2948
|
+
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", { ...params, sessionId }),
|
|
2007
2949
|
/**
|
|
2008
2950
|
* Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.
|
|
2009
2951
|
*
|
|
@@ -2017,7 +2959,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2017
2959
|
*
|
|
2018
2960
|
* @returns Indicates whether the handle was active and the registration count was decremented.
|
|
2019
2961
|
*/
|
|
2020
|
-
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", {
|
|
2962
|
+
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", { ...params, sessionId })
|
|
2021
2963
|
},
|
|
2022
2964
|
/** @experimental */
|
|
2023
2965
|
permissions: {
|
|
@@ -2028,7 +2970,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2028
2970
|
*
|
|
2029
2971
|
* @returns Indicates whether the operation succeeded.
|
|
2030
2972
|
*/
|
|
2031
|
-
configure: async (params) => connection.sendRequest("session.permissions.configure", {
|
|
2973
|
+
configure: async (params) => connection.sendRequest("session.permissions.configure", { ...params, sessionId }),
|
|
2032
2974
|
/**
|
|
2033
2975
|
* Provides a decision for a pending tool permission request.
|
|
2034
2976
|
*
|
|
@@ -2036,7 +2978,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2036
2978
|
*
|
|
2037
2979
|
* @returns Indicates whether the permission decision was applied; false when the request was already resolved.
|
|
2038
2980
|
*/
|
|
2039
|
-
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", {
|
|
2981
|
+
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { ...params, sessionId }),
|
|
2040
2982
|
/**
|
|
2041
2983
|
* Reconstructs the set of pending tool permission requests from the session's event history.
|
|
2042
2984
|
*
|
|
@@ -2050,7 +2992,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2050
2992
|
*
|
|
2051
2993
|
* @returns Indicates whether the operation succeeded.
|
|
2052
2994
|
*/
|
|
2053
|
-
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", {
|
|
2995
|
+
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { ...params, sessionId }),
|
|
2054
2996
|
/**
|
|
2055
2997
|
* 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.
|
|
2056
2998
|
*
|
|
@@ -2058,7 +3000,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2058
3000
|
*
|
|
2059
3001
|
* @returns Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.
|
|
2060
3002
|
*/
|
|
2061
|
-
setMode: async (params) => connection.sendRequest("session.permissions.setMode", {
|
|
3003
|
+
setMode: async (params) => connection.sendRequest("session.permissions.setMode", { ...params, sessionId }),
|
|
2062
3004
|
/**
|
|
2063
3005
|
* Returns the current permission mode for the session.
|
|
2064
3006
|
*
|
|
@@ -2072,7 +3014,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2072
3014
|
*
|
|
2073
3015
|
* @returns Indicates whether the operation succeeded.
|
|
2074
3016
|
*/
|
|
2075
|
-
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", {
|
|
3017
|
+
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", { ...params, sessionId }),
|
|
2076
3018
|
/**
|
|
2077
3019
|
* Sets whether the client wants permission prompts bridged into session events.
|
|
2078
3020
|
*
|
|
@@ -2080,15 +3022,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2080
3022
|
*
|
|
2081
3023
|
* @returns Indicates whether the operation succeeded.
|
|
2082
3024
|
*/
|
|
2083
|
-
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", {
|
|
3025
|
+
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", { ...params, sessionId }),
|
|
2084
3026
|
/**
|
|
2085
|
-
* Clears session-scoped tool
|
|
3027
|
+
* Clears session-scoped tool approvals and, for full resets, exact session-approved paths.
|
|
2086
3028
|
*
|
|
2087
|
-
* @param params Clears session-scoped tool
|
|
3029
|
+
* @param params Clears session-scoped tool approvals and optionally clears location-scoped approvals and exact session-approved paths.
|
|
2088
3030
|
*
|
|
2089
3031
|
* @returns Indicates whether the operation succeeded.
|
|
2090
3032
|
*/
|
|
2091
|
-
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", {
|
|
3033
|
+
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", { ...params, sessionId }),
|
|
2092
3034
|
/**
|
|
2093
3035
|
* Notifies the runtime that a permission prompt UI has been shown to the user.
|
|
2094
3036
|
*
|
|
@@ -2096,13 +3038,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2096
3038
|
*
|
|
2097
3039
|
* @returns Indicates whether the operation succeeded.
|
|
2098
3040
|
*/
|
|
2099
|
-
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", {
|
|
3041
|
+
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", { ...params, sessionId }),
|
|
2100
3042
|
/** @experimental */
|
|
2101
3043
|
paths: {
|
|
2102
3044
|
/**
|
|
2103
|
-
* Returns the session's
|
|
3045
|
+
* Returns the session's recursive directory grants, exact session-approved paths, and primary working directory.
|
|
2104
3046
|
*
|
|
2105
|
-
* @returns Snapshot of the session's
|
|
3047
|
+
* @returns Snapshot of the session's recursive directory grants, exact session-approved paths, and primary working directory.
|
|
2106
3048
|
*/
|
|
2107
3049
|
list: async () => connection.sendRequest("session.permissions.paths.list", { sessionId }),
|
|
2108
3050
|
/**
|
|
@@ -2112,7 +3054,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2112
3054
|
*
|
|
2113
3055
|
* @returns Indicates whether the operation succeeded.
|
|
2114
3056
|
*/
|
|
2115
|
-
add: async (params) => connection.sendRequest("session.permissions.paths.add", {
|
|
3057
|
+
add: async (params) => connection.sendRequest("session.permissions.paths.add", { ...params, sessionId }),
|
|
2116
3058
|
/**
|
|
2117
3059
|
* Updates the session's primary working directory used by the permission policy.
|
|
2118
3060
|
*
|
|
@@ -2120,7 +3062,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2120
3062
|
*
|
|
2121
3063
|
* @returns Indicates whether the operation succeeded.
|
|
2122
3064
|
*/
|
|
2123
|
-
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", {
|
|
3065
|
+
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", { ...params, sessionId }),
|
|
2124
3066
|
/**
|
|
2125
3067
|
* Reports whether a path falls within any of the session's allowed directories.
|
|
2126
3068
|
*
|
|
@@ -2128,7 +3070,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2128
3070
|
*
|
|
2129
3071
|
* @returns Indicates whether the supplied path is within the session's allowed directories.
|
|
2130
3072
|
*/
|
|
2131
|
-
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", {
|
|
3073
|
+
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", { ...params, sessionId }),
|
|
2132
3074
|
/**
|
|
2133
3075
|
* Reports whether a path falls within the session's workspace (primary) directory.
|
|
2134
3076
|
*
|
|
@@ -2136,7 +3078,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2136
3078
|
*
|
|
2137
3079
|
* @returns Indicates whether the supplied path is within the session's workspace directory.
|
|
2138
3080
|
*/
|
|
2139
|
-
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", {
|
|
3081
|
+
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", { ...params, sessionId })
|
|
2140
3082
|
},
|
|
2141
3083
|
/** @experimental */
|
|
2142
3084
|
locations: {
|
|
@@ -2147,7 +3089,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2147
3089
|
*
|
|
2148
3090
|
* @returns Resolved location-permissions key and type.
|
|
2149
3091
|
*/
|
|
2150
|
-
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", {
|
|
3092
|
+
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", { ...params, sessionId }),
|
|
2151
3093
|
/**
|
|
2152
3094
|
* Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service.
|
|
2153
3095
|
*
|
|
@@ -2155,7 +3097,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2155
3097
|
*
|
|
2156
3098
|
* @returns Summary of persisted location permissions applied to the session.
|
|
2157
3099
|
*/
|
|
2158
|
-
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", {
|
|
3100
|
+
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", { ...params, sessionId }),
|
|
2159
3101
|
/**
|
|
2160
3102
|
* Persists a tool approval for a permission location and applies its rules to this session's live permission service.
|
|
2161
3103
|
*
|
|
@@ -2163,7 +3105,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2163
3105
|
*
|
|
2164
3106
|
* @returns Indicates whether the operation succeeded.
|
|
2165
3107
|
*/
|
|
2166
|
-
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", {
|
|
3108
|
+
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", { ...params, sessionId })
|
|
2167
3109
|
},
|
|
2168
3110
|
/** @experimental */
|
|
2169
3111
|
folderTrust: {
|
|
@@ -2174,7 +3116,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2174
3116
|
*
|
|
2175
3117
|
* @returns Folder trust check result.
|
|
2176
3118
|
*/
|
|
2177
|
-
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", {
|
|
3119
|
+
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", { ...params, sessionId }),
|
|
2178
3120
|
/**
|
|
2179
3121
|
* Adds a folder to the user's trusted folders list.
|
|
2180
3122
|
*
|
|
@@ -2182,7 +3124,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2182
3124
|
*
|
|
2183
3125
|
* @returns Indicates whether the operation succeeded.
|
|
2184
3126
|
*/
|
|
2185
|
-
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", {
|
|
3127
|
+
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", { ...params, sessionId })
|
|
2186
3128
|
},
|
|
2187
3129
|
/** @experimental */
|
|
2188
3130
|
urls: {
|
|
@@ -2193,7 +3135,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2193
3135
|
*
|
|
2194
3136
|
* @returns Indicates whether the operation succeeded.
|
|
2195
3137
|
*/
|
|
2196
|
-
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", {
|
|
3138
|
+
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", { ...params, sessionId })
|
|
2197
3139
|
}
|
|
2198
3140
|
},
|
|
2199
3141
|
/**
|
|
@@ -2205,7 +3147,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2205
3147
|
*
|
|
2206
3148
|
* @experimental
|
|
2207
3149
|
*/
|
|
2208
|
-
log: async (params) => connection.sendRequest("session.log", {
|
|
3150
|
+
log: async (params) => connection.sendRequest("session.log", { ...params, sessionId }),
|
|
2209
3151
|
/** @experimental */
|
|
2210
3152
|
metadata: {
|
|
2211
3153
|
/**
|
|
@@ -2227,7 +3169,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2227
3169
|
*
|
|
2228
3170
|
* @returns Client-owned, case-sensitive string metadata persisted with a local session. Clients should namespace keys by owner. Keys must be non-empty and at most 256 UTF-8 bytes; keys under `copilot/` and `github/` are reserved. Values may contain at most 16 KiB of UTF-8 data. A bag may contain at most 128 entries and its serialized sidecar may contain at most 64 KiB. The runtime stores but never interprets these values.
|
|
2229
3171
|
*/
|
|
2230
|
-
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", {
|
|
3172
|
+
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", { ...params, sessionId }),
|
|
2231
3173
|
/**
|
|
2232
3174
|
* Reports whether the local session is currently processing user/agent messages.
|
|
2233
3175
|
*
|
|
@@ -2247,7 +3189,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2247
3189
|
*
|
|
2248
3190
|
* @returns Token breakdown for the session's current context window, or null if uninitialized.
|
|
2249
3191
|
*/
|
|
2250
|
-
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", {
|
|
3192
|
+
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", { ...params, sessionId }),
|
|
2251
3193
|
/**
|
|
2252
3194
|
* 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.
|
|
2253
3195
|
*
|
|
@@ -2261,7 +3203,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2261
3203
|
*
|
|
2262
3204
|
* @returns The heaviest individual messages in the session's context window, most-expensive first.
|
|
2263
3205
|
*/
|
|
2264
|
-
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", {
|
|
3206
|
+
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { ...params, sessionId }),
|
|
2265
3207
|
/**
|
|
2266
3208
|
* Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.
|
|
2267
3209
|
*
|
|
@@ -2269,7 +3211,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2269
3211
|
*
|
|
2270
3212
|
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
|
|
2271
3213
|
*/
|
|
2272
|
-
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", {
|
|
3214
|
+
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", { ...params, sessionId }),
|
|
2273
3215
|
/**
|
|
2274
3216
|
* Updates the session's working directory. For local sessions the target is validated first (an absolute path that exists on disk) and the permission primary directory is re-based; a rejected validation fails the call before any session state changes.
|
|
2275
3217
|
*
|
|
@@ -2277,7 +3219,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2277
3219
|
*
|
|
2278
3220
|
* @returns Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path.
|
|
2279
3221
|
*/
|
|
2280
|
-
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", {
|
|
3222
|
+
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", { ...params, sessionId }),
|
|
2281
3223
|
/**
|
|
2282
3224
|
* Re-tokenizes the session's existing messages against a model and returns aggregate token totals.
|
|
2283
3225
|
*
|
|
@@ -2285,7 +3227,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2285
3227
|
*
|
|
2286
3228
|
* @returns Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session.
|
|
2287
3229
|
*/
|
|
2288
|
-
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", {
|
|
3230
|
+
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", { ...params, sessionId })
|
|
2289
3231
|
},
|
|
2290
3232
|
/** @experimental */
|
|
2291
3233
|
contentExclusion: {
|
|
@@ -2296,18 +3238,18 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2296
3238
|
*
|
|
2297
3239
|
* @returns Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
|
|
2298
3240
|
*/
|
|
2299
|
-
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", {
|
|
3241
|
+
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", { ...params, sessionId })
|
|
2300
3242
|
},
|
|
2301
3243
|
/** @experimental */
|
|
2302
3244
|
shell: {
|
|
2303
3245
|
/**
|
|
2304
|
-
* Starts a shell command
|
|
3246
|
+
* Starts a shell command, returning an RPC error if it cannot be spawned. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via "shell.kill", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via "setsid") leaves the signalled group, so either can leave a background process running.
|
|
2305
3247
|
*
|
|
2306
|
-
* @param params Shell command to run, with optional working directory and timeout in milliseconds.
|
|
3248
|
+
* @param params Shell command to run, with optional working directory and timeout in milliseconds. Spawn failures return an RPC error.
|
|
2307
3249
|
*
|
|
2308
|
-
* @returns Identifier of the spawned process,
|
|
3250
|
+
* @returns Identifier of the spawned shell process, usable with shell.kill while the process is running.
|
|
2309
3251
|
*/
|
|
2310
|
-
exec: async (params) => connection.sendRequest("session.shell.exec", {
|
|
3252
|
+
exec: async (params) => connection.sendRequest("session.shell.exec", { ...params, sessionId }),
|
|
2311
3253
|
/**
|
|
2312
3254
|
* Sends a signal to a shell process previously started via "shell.exec". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via "setsid") is no longer in the signalled group and survives.
|
|
2313
3255
|
*
|
|
@@ -2315,7 +3257,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2315
3257
|
*
|
|
2316
3258
|
* @returns Indicates whether the signal was delivered; false if the process was unknown or already exited.
|
|
2317
3259
|
*/
|
|
2318
|
-
kill: async (params) => connection.sendRequest("session.shell.kill", {
|
|
3260
|
+
kill: async (params) => connection.sendRequest("session.shell.kill", { ...params, sessionId }),
|
|
2319
3261
|
/**
|
|
2320
3262
|
* Executes a user-requested shell command through the session runtime.
|
|
2321
3263
|
*
|
|
@@ -2323,7 +3265,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2323
3265
|
*
|
|
2324
3266
|
* @returns Result of a user-requested shell command.
|
|
2325
3267
|
*/
|
|
2326
|
-
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", {
|
|
3268
|
+
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", { ...params, sessionId }),
|
|
2327
3269
|
/**
|
|
2328
3270
|
* Cancels a user-requested shell command by request ID.
|
|
2329
3271
|
*
|
|
@@ -2331,7 +3273,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2331
3273
|
*
|
|
2332
3274
|
* @returns Cancellation result for a user-requested shell command.
|
|
2333
3275
|
*/
|
|
2334
|
-
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", {
|
|
3276
|
+
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", { ...params, sessionId })
|
|
2335
3277
|
},
|
|
2336
3278
|
/** @experimental */
|
|
2337
3279
|
history: {
|
|
@@ -2342,7 +3284,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2342
3284
|
*
|
|
2343
3285
|
* @returns Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
|
|
2344
3286
|
*/
|
|
2345
|
-
compact: async (params) => connection.sendRequest("session.history.compact", {
|
|
3287
|
+
compact: async (params) => connection.sendRequest("session.history.compact", { ...params, sessionId }),
|
|
2346
3288
|
/**
|
|
2347
3289
|
* Truncates persisted session history to a specific event.
|
|
2348
3290
|
*
|
|
@@ -2350,7 +3292,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2350
3292
|
*
|
|
2351
3293
|
* @returns Number of events that were removed by the truncation.
|
|
2352
3294
|
*/
|
|
2353
|
-
truncate: async (params) => connection.sendRequest("session.history.truncate", {
|
|
3295
|
+
truncate: async (params) => connection.sendRequest("session.history.truncate", { ...params, sessionId }),
|
|
2354
3296
|
/**
|
|
2355
3297
|
* Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: "session-busy"` and no points, which the caller can retry.
|
|
2356
3298
|
*
|
|
@@ -2364,7 +3306,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2364
3306
|
*
|
|
2365
3307
|
* @returns Files and aggregate changes for a prospective rewind.
|
|
2366
3308
|
*/
|
|
2367
|
-
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", {
|
|
3309
|
+
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", { ...params, sessionId }),
|
|
2368
3310
|
/**
|
|
2369
3311
|
* Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds.
|
|
2370
3312
|
*
|
|
@@ -2372,7 +3314,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2372
3314
|
*
|
|
2373
3315
|
* @returns Structured outcome of a rewind request.
|
|
2374
3316
|
*/
|
|
2375
|
-
rewind: async (params) => connection.sendRequest("session.history.rewind", {
|
|
3317
|
+
rewind: async (params) => connection.sendRequest("session.history.rewind", { ...params, sessionId }),
|
|
2376
3318
|
/**
|
|
2377
3319
|
* Cancels any in-progress background compaction on a local session.
|
|
2378
3320
|
*
|
|
@@ -2398,7 +3340,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2398
3340
|
*
|
|
2399
3341
|
* @returns What a successful clear removed. A clear that could not be applied rejects instead of reporting a count.
|
|
2400
3342
|
*/
|
|
2401
|
-
clearContext: async (params) => connection.sendRequest("session.history.clearContext", {
|
|
3343
|
+
clearContext: async (params) => connection.sendRequest("session.history.clearContext", { ...params, sessionId })
|
|
2402
3344
|
},
|
|
2403
3345
|
/** @experimental */
|
|
2404
3346
|
queue: {
|
|
@@ -2415,7 +3357,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2415
3357
|
*
|
|
2416
3358
|
* @returns Result of moving a queued item.
|
|
2417
3359
|
*/
|
|
2418
|
-
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", {
|
|
3360
|
+
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", { ...params, sessionId }),
|
|
2419
3361
|
/**
|
|
2420
3362
|
* Inserts a new queued message at a public visible position.
|
|
2421
3363
|
*
|
|
@@ -2423,7 +3365,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2423
3365
|
*
|
|
2424
3366
|
* @returns Result of inserting a queued message.
|
|
2425
3367
|
*/
|
|
2426
|
-
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", {
|
|
3368
|
+
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", { ...params, sessionId }),
|
|
2427
3369
|
/**
|
|
2428
3370
|
* Removes an addressable queued item by its stable id.
|
|
2429
3371
|
*
|
|
@@ -2431,7 +3373,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2431
3373
|
*
|
|
2432
3374
|
* @returns Result of removing a queued item.
|
|
2433
3375
|
*/
|
|
2434
|
-
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", {
|
|
3376
|
+
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", { ...params, sessionId }),
|
|
2435
3377
|
/**
|
|
2436
3378
|
* Updates the text of an addressable single-message queue item.
|
|
2437
3379
|
*
|
|
@@ -2439,7 +3381,23 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2439
3381
|
*
|
|
2440
3382
|
* @returns Result of editing a queued message.
|
|
2441
3383
|
*/
|
|
2442
|
-
updateText: async (params) => connection.sendRequest("session.queue.updateText", {
|
|
3384
|
+
updateText: async (params) => connection.sendRequest("session.queue.updateText", { ...params, sessionId }),
|
|
3385
|
+
/**
|
|
3386
|
+
* Atomically withdraws an unchanged user message of a local session: from the queued or steering lane while unconsumed, or from the running turn it started while the model has not answered it and nothing the user sent after it is pending. Withdrawing from the running turn interrupts that turn and removes its events from history. A client retaining the original draft may restore it only when removed is true.
|
|
3387
|
+
*
|
|
3388
|
+
* @param params Conditional withdrawal of a single user message, from its queue or from the running turn it started.
|
|
3389
|
+
*
|
|
3390
|
+
* @returns Result of withdrawing a user message.
|
|
3391
|
+
*/
|
|
3392
|
+
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { ...params, sessionId }),
|
|
3393
|
+
/**
|
|
3394
|
+
* Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
|
|
3395
|
+
*
|
|
3396
|
+
* @param params Append to one pending steering message without changing its identity or delivery position.
|
|
3397
|
+
*
|
|
3398
|
+
* @returns Result of editing a queued message.
|
|
3399
|
+
*/
|
|
3400
|
+
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { ...params, sessionId }),
|
|
2443
3401
|
/**
|
|
2444
3402
|
* Duplicates an addressable queued item immediately after its source.
|
|
2445
3403
|
*
|
|
@@ -2447,13 +3405,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2447
3405
|
*
|
|
2448
3406
|
* @returns Result of duplicating a queued item.
|
|
2449
3407
|
*/
|
|
2450
|
-
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", {
|
|
3408
|
+
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", { ...params, sessionId }),
|
|
2451
3409
|
/**
|
|
2452
3410
|
* Acquires or releases the queued-lane drain pause.
|
|
2453
3411
|
*
|
|
2454
3412
|
* @param params Parameters for acquiring or releasing the queued-lane drain pause. Acquisition is exclusive and non-idempotent: `paused: true` against an already-paused session fails with `queue_already_paused`. The pause is never released automatically — it is not tied to the caller's lifetime, so a client that exits without sending `paused: false` leaves the lane frozen. Release is unowned: `paused: false` clears the pause for any caller, including one that never acquired it.
|
|
2455
3413
|
*/
|
|
2456
|
-
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", {
|
|
3414
|
+
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", { ...params, sessionId }),
|
|
2457
3415
|
/**
|
|
2458
3416
|
* Moves an addressable queued message into the live turn's steering lane.
|
|
2459
3417
|
*
|
|
@@ -2461,7 +3419,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2461
3419
|
*
|
|
2462
3420
|
* @returns Result of trying to steer a queued message into a live turn.
|
|
2463
3421
|
*/
|
|
2464
|
-
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", {
|
|
3422
|
+
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", { ...params, sessionId }),
|
|
2465
3423
|
/**
|
|
2466
3424
|
* Removes the most recently queued user-facing item (LIFO).
|
|
2467
3425
|
*
|
|
@@ -2482,7 +3440,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2482
3440
|
*
|
|
2483
3441
|
* @returns Batch of session events returned by a read, with cursor and continuation metadata.
|
|
2484
3442
|
*/
|
|
2485
|
-
read: async (params) => connection.sendRequest("session.eventLog.read", {
|
|
3443
|
+
read: async (params) => connection.sendRequest("session.eventLog.read", { ...params, sessionId }),
|
|
2486
3444
|
/**
|
|
2487
3445
|
* Returns a snapshot of the current tail cursor without consuming events.
|
|
2488
3446
|
*
|
|
@@ -2496,7 +3454,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2496
3454
|
*
|
|
2497
3455
|
* @returns Opaque handle representing an event-type interest registration.
|
|
2498
3456
|
*/
|
|
2499
|
-
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", {
|
|
3457
|
+
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", { ...params, sessionId }),
|
|
2500
3458
|
/**
|
|
2501
3459
|
* Releases a consumer's previously-registered interest in an event type.
|
|
2502
3460
|
*
|
|
@@ -2504,7 +3462,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2504
3462
|
*
|
|
2505
3463
|
* @returns Indicates whether the operation succeeded.
|
|
2506
3464
|
*/
|
|
2507
|
-
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", {
|
|
3465
|
+
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", { ...params, sessionId })
|
|
2508
3466
|
},
|
|
2509
3467
|
/** @experimental */
|
|
2510
3468
|
usage: {
|
|
@@ -2516,6 +3474,27 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2516
3474
|
getMetrics: async () => connection.sendRequest("session.usage.getMetrics", { sessionId })
|
|
2517
3475
|
},
|
|
2518
3476
|
/** @experimental */
|
|
3477
|
+
quota: {
|
|
3478
|
+
/**
|
|
3479
|
+
* Gets the session's current quota and account projection without making a network request.
|
|
3480
|
+
*
|
|
3481
|
+
* @returns The incumbent session-owned quota and account projection.
|
|
3482
|
+
*/
|
|
3483
|
+
get: async () => connection.sendRequest("session.quota.get", { sessionId }),
|
|
3484
|
+
/**
|
|
3485
|
+
* Refreshes the session's provider model catalog bypassing its cache, folds quota snapshots into session state, and returns the updated projection. Failures leave the last known quota intact.
|
|
3486
|
+
*
|
|
3487
|
+
* @returns The incumbent session-owned quota and account projection.
|
|
3488
|
+
*/
|
|
3489
|
+
refresh: async () => connection.sendRequest("session.quota.refresh", { sessionId }),
|
|
3490
|
+
/**
|
|
3491
|
+
* Returns and clears the session's pending quota warnings. Reading or refreshing quota does not drain warnings.
|
|
3492
|
+
*
|
|
3493
|
+
* @returns Pending warnings returned and cleared by session.quota.takeWarnings.
|
|
3494
|
+
*/
|
|
3495
|
+
takeWarnings: async () => connection.sendRequest("session.quota.takeWarnings", { sessionId })
|
|
3496
|
+
},
|
|
3497
|
+
/** @experimental */
|
|
2519
3498
|
limitPrediction: {
|
|
2520
3499
|
/**
|
|
2521
3500
|
* Predicts an AI-credit session limit for the session's resolved model. Returns an unavailable result instead of falling back when the current model is unresolved auto.
|
|
@@ -2524,7 +3503,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2524
3503
|
*
|
|
2525
3504
|
* @returns Prediction result. Available results include prediction details; unavailable results include an explicit reason.
|
|
2526
3505
|
*/
|
|
2527
|
-
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", {
|
|
3506
|
+
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", { ...params, sessionId })
|
|
2528
3507
|
},
|
|
2529
3508
|
/** @experimental */
|
|
2530
3509
|
remote: {
|
|
@@ -2535,7 +3514,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2535
3514
|
*
|
|
2536
3515
|
* @returns GitHub URL for the session and a flag indicating whether remote steering is enabled.
|
|
2537
3516
|
*/
|
|
2538
|
-
enable: async (params) => connection.sendRequest("session.remote.enable", {
|
|
3517
|
+
enable: async (params) => connection.sendRequest("session.remote.enable", { ...params, sessionId }),
|
|
2539
3518
|
/**
|
|
2540
3519
|
* Disables remote session export and steering.
|
|
2541
3520
|
*/
|
|
@@ -2547,7 +3526,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2547
3526
|
*
|
|
2548
3527
|
* @returns Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own.
|
|
2549
3528
|
*/
|
|
2550
|
-
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", {
|
|
3529
|
+
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", { ...params, sessionId })
|
|
2551
3530
|
},
|
|
2552
3531
|
/** @experimental */
|
|
2553
3532
|
visibility: {
|
|
@@ -2564,7 +3543,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2564
3543
|
*
|
|
2565
3544
|
* @returns Effective sharing status and shareable GitHub URL after updating session visibility.
|
|
2566
3545
|
*/
|
|
2567
|
-
set: async (params) => connection.sendRequest("session.visibility.set", {
|
|
3546
|
+
set: async (params) => connection.sendRequest("session.visibility.set", { ...params, sessionId })
|
|
2568
3547
|
},
|
|
2569
3548
|
/** @experimental */
|
|
2570
3549
|
schedule: {
|
|
@@ -2581,7 +3560,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2581
3560
|
*
|
|
2582
3561
|
* @returns Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.
|
|
2583
3562
|
*/
|
|
2584
|
-
stop: async (params) => connection.sendRequest("session.schedule.stop", {
|
|
3563
|
+
stop: async (params) => connection.sendRequest("session.schedule.stop", { ...params, sessionId })
|
|
2585
3564
|
}
|
|
2586
3565
|
};
|
|
2587
3566
|
}
|
|
@@ -2594,7 +3573,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2594
3573
|
*
|
|
2595
3574
|
* @experimental
|
|
2596
3575
|
*/
|
|
2597
|
-
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", {
|
|
3576
|
+
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", { ...params, sessionId }),
|
|
2598
3577
|
/** @experimental */
|
|
2599
3578
|
gitHubAuth: {
|
|
2600
3579
|
/**
|
|
@@ -2622,13 +3601,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2622
3601
|
*
|
|
2623
3602
|
* @returns Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
|
|
2624
3603
|
*/
|
|
2625
|
-
login: async (params) => connection.sendRequest("session.gitHubAuth.login", {
|
|
3604
|
+
login: async (params) => connection.sendRequest("session.gitHubAuth.login", { ...params, sessionId }),
|
|
2626
3605
|
/**
|
|
2627
3606
|
* Switches the session to another available authentication.
|
|
2628
3607
|
*
|
|
2629
3608
|
* @param params Parameters for switching the session's active authentication.
|
|
2630
3609
|
*/
|
|
2631
|
-
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", {
|
|
3610
|
+
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", { ...params, sessionId }),
|
|
2632
3611
|
/**
|
|
2633
3612
|
* Logs out the session's current GitHub authentication.
|
|
2634
3613
|
*
|
|
@@ -2642,7 +3621,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2642
3621
|
*
|
|
2643
3622
|
* @returns Whether the requested authentication was logged out.
|
|
2644
3623
|
*/
|
|
2645
|
-
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", {
|
|
3624
|
+
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", { ...params, sessionId }),
|
|
2646
3625
|
/**
|
|
2647
3626
|
* Gets validation errors from the most recent authentication attempt.
|
|
2648
3627
|
*
|
|
@@ -2659,39 +3638,39 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2659
3638
|
*
|
|
2660
3639
|
* @param params Internal canvas provider registration parameters.
|
|
2661
3640
|
*/
|
|
2662
|
-
register: async (params) => connection.sendRequest("session.canvas.provider.register", {
|
|
3641
|
+
register: async (params) => connection.sendRequest("session.canvas.provider.register", { ...params, sessionId }),
|
|
2663
3642
|
/**
|
|
2664
3643
|
* Unregisters an internal canvas provider connection.
|
|
2665
3644
|
*
|
|
2666
3645
|
* @param params Internal canvas provider unregistration parameters.
|
|
2667
3646
|
*/
|
|
2668
|
-
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", {
|
|
3647
|
+
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", { ...params, sessionId })
|
|
2669
3648
|
}
|
|
2670
3649
|
},
|
|
2671
3650
|
/** @experimental */
|
|
2672
|
-
|
|
3651
|
+
workflow: {
|
|
2673
3652
|
/**
|
|
2674
|
-
* Internal tool-originated
|
|
3653
|
+
* Internal tool-originated dynamic workflow invocation.
|
|
2675
3654
|
*
|
|
2676
|
-
* @param params Internal parameters for invoking a registered
|
|
3655
|
+
* @param params Internal parameters for invoking a registered workflow from a tool.
|
|
2677
3656
|
*
|
|
2678
|
-
* @returns Complete current or terminal
|
|
3657
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
2679
3658
|
*/
|
|
2680
|
-
runFromTool: async (params) => connection.sendRequest("session.
|
|
3659
|
+
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { ...params, sessionId }),
|
|
2681
3660
|
/**
|
|
2682
|
-
* Internal tool-originated
|
|
3661
|
+
* Internal tool-originated dynamic workflow resume.
|
|
2683
3662
|
*
|
|
2684
|
-
* @param params Internal parameters for resuming a
|
|
3663
|
+
* @param params Internal parameters for resuming a workflow run from a tool.
|
|
2685
3664
|
*
|
|
2686
|
-
* @returns Resolved persisted
|
|
3665
|
+
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
2687
3666
|
*/
|
|
2688
|
-
resumeFromTool: async (params) => connection.sendRequest("session.
|
|
3667
|
+
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { ...params, sessionId }),
|
|
2689
3668
|
/**
|
|
2690
|
-
* Atomically pauses an owned
|
|
3669
|
+
* Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
|
|
2691
3670
|
*
|
|
2692
3671
|
* @param params Parameters for an owned durable pause checkpoint.
|
|
2693
3672
|
*/
|
|
2694
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.
|
|
3673
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { ...params, sessionId })
|
|
2695
3674
|
},
|
|
2696
3675
|
/** @experimental */
|
|
2697
3676
|
model: {
|
|
@@ -2702,10 +3681,20 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2702
3681
|
*
|
|
2703
3682
|
* @returns The model identifier active on the session after the switch.
|
|
2704
3683
|
*/
|
|
2705
|
-
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", {
|
|
3684
|
+
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", { ...params, sessionId }),
|
|
3685
|
+
/**
|
|
3686
|
+
* Clears an unchanged startup model/provider seed before default-model resolution. Never clears a resumed or user-selected model.
|
|
3687
|
+
*/
|
|
3688
|
+
clearStartupSeed: async (params) => connection.sendRequest("session.model.clearStartupSeed", { ...params, sessionId })
|
|
2706
3689
|
},
|
|
2707
3690
|
/** @experimental */
|
|
2708
3691
|
mcp: {
|
|
3692
|
+
/**
|
|
3693
|
+
* Records the IDE the host is connected to, so the agent's system prompt can name it and its workspace folder. Null or an omitted `ide` clears the recorded value, which is how a host reports that it is disconnected; there is no separate clear method. Both `ideName` and `workspaceFolder` are required together, because half a state cannot be attributed to a project.
|
|
3694
|
+
*
|
|
3695
|
+
* @param params Records which IDE the host is connected to, or clears it.
|
|
3696
|
+
*/
|
|
3697
|
+
setConnectedIdeInfo: async (params) => connection.sendRequest("session.mcp.setConnectedIdeInfo", { ...params, sessionId }),
|
|
2709
3698
|
/**
|
|
2710
3699
|
* Reloads MCP server connections for the session with an explicit host-provided configuration.
|
|
2711
3700
|
*
|
|
@@ -2713,7 +3702,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2713
3702
|
*
|
|
2714
3703
|
* @returns MCP server startup filtering result.
|
|
2715
3704
|
*/
|
|
2716
|
-
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", {
|
|
3705
|
+
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", { ...params, sessionId }),
|
|
2717
3706
|
/**
|
|
2718
3707
|
* Configures the built-in GitHub MCP server for the session's current auth context.
|
|
2719
3708
|
*
|
|
@@ -2721,19 +3710,36 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2721
3710
|
*
|
|
2722
3711
|
* @returns Result of configuring GitHub MCP.
|
|
2723
3712
|
*/
|
|
2724
|
-
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", {
|
|
3713
|
+
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", { ...params, sessionId }),
|
|
2725
3714
|
/**
|
|
2726
3715
|
* 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.
|
|
2727
3716
|
*
|
|
2728
3717
|
* @param params Registration parameters for an external MCP client.
|
|
2729
3718
|
*/
|
|
2730
|
-
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", {
|
|
3719
|
+
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", { ...params, sessionId }),
|
|
2731
3720
|
/**
|
|
2732
3721
|
* 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.
|
|
2733
3722
|
*
|
|
2734
3723
|
* @param params Server name identifying the external client to remove.
|
|
2735
3724
|
*/
|
|
2736
|
-
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", {
|
|
3725
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { ...params, sessionId })
|
|
3726
|
+
},
|
|
3727
|
+
/** @experimental */
|
|
3728
|
+
connectors: {
|
|
3729
|
+
/**
|
|
3730
|
+
* Reconciles the authoritative Connector catalog into the session MCP projection during startup with a bounded deadline and fail-closed cleanup.
|
|
3731
|
+
*
|
|
3732
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
3733
|
+
*
|
|
3734
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3735
|
+
*/
|
|
3736
|
+
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", { ...params, sessionId }),
|
|
3737
|
+
/**
|
|
3738
|
+
* Removes the runtime-owned Connector MCP projection without changing service-side connections.
|
|
3739
|
+
*
|
|
3740
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3741
|
+
*/
|
|
3742
|
+
withdrawProjection: async () => connection.sendRequest("session.connectors.withdrawProjection", { sessionId })
|
|
2737
3743
|
},
|
|
2738
3744
|
/** @experimental */
|
|
2739
3745
|
commands: {
|
|
@@ -2744,7 +3750,34 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2744
3750
|
*
|
|
2745
3751
|
* @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not.
|
|
2746
3752
|
*/
|
|
2747
|
-
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", {
|
|
3753
|
+
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", { ...params, sessionId })
|
|
3754
|
+
},
|
|
3755
|
+
/** @experimental */
|
|
3756
|
+
ui: {
|
|
3757
|
+
/**
|
|
3758
|
+
* Resolves a pending elicitation request after direct interaction in the trusted in-process client. Only an accepted response to the built-in ask_user tool can become trusted human evidence.
|
|
3759
|
+
*
|
|
3760
|
+
* @param params Pending elicitation request ID and the user's response (accept/decline/cancel + form values).
|
|
3761
|
+
*
|
|
3762
|
+
* @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
|
|
3763
|
+
*/
|
|
3764
|
+
handleHumanAskUser: async (params) => connection.sendRequest("session.ui.handleHumanAskUser", { ...params, sessionId }),
|
|
3765
|
+
/**
|
|
3766
|
+
* Resolves a pending `user_input.requested` event after direct interaction in the trusted in-process client.
|
|
3767
|
+
*
|
|
3768
|
+
* @param params Request ID of a pending `user_input.requested` event and the user's response.
|
|
3769
|
+
*
|
|
3770
|
+
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
3771
|
+
*/
|
|
3772
|
+
handleHumanUserInput: async (params) => connection.sendRequest("session.ui.handleHumanUserInput", { ...params, sessionId }),
|
|
3773
|
+
/**
|
|
3774
|
+
* Resolves a pending `exit_plan_mode.requested` event after direct interaction in the trusted in-process client.
|
|
3775
|
+
*
|
|
3776
|
+
* @param params Request ID of a pending `exit_plan_mode.requested` event and the user's response.
|
|
3777
|
+
*
|
|
3778
|
+
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
3779
|
+
*/
|
|
3780
|
+
handleHumanExitPlanMode: async (params) => connection.sendRequest("session.ui.handleHumanExitPlanMode", { ...params, sessionId })
|
|
2748
3781
|
},
|
|
2749
3782
|
/** @experimental */
|
|
2750
3783
|
settings: {
|
|
@@ -2761,7 +3794,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2761
3794
|
*
|
|
2762
3795
|
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
2763
3796
|
*/
|
|
2764
|
-
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", {
|
|
3797
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { ...params, sessionId })
|
|
2765
3798
|
},
|
|
2766
3799
|
/** @experimental */
|
|
2767
3800
|
queue: {
|
|
@@ -2784,7 +3817,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2784
3817
|
*
|
|
2785
3818
|
* @returns Whether a deferred-idle drain should run.
|
|
2786
3819
|
*/
|
|
2787
|
-
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", {
|
|
3820
|
+
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", { ...params, sessionId }),
|
|
2788
3821
|
/**
|
|
2789
3822
|
* Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.
|
|
2790
3823
|
*
|
|
@@ -2792,13 +3825,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2792
3825
|
*
|
|
2793
3826
|
* @returns Action selected by the native deferred-idle drain.
|
|
2794
3827
|
*/
|
|
2795
|
-
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", {
|
|
3828
|
+
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", { ...params, sessionId }),
|
|
2796
3829
|
/**
|
|
2797
3830
|
* Marks session.idle as deferred by native background work state.
|
|
2798
3831
|
*
|
|
2799
3832
|
* @param params Inputs for marking session.idle deferred in native state.
|
|
2800
3833
|
*/
|
|
2801
|
-
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", {
|
|
3834
|
+
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", { ...params, sessionId }),
|
|
2802
3835
|
/**
|
|
2803
3836
|
* Consumes queued native system notifications matching an internal filter.
|
|
2804
3837
|
*
|
|
@@ -2806,7 +3839,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2806
3839
|
*
|
|
2807
3840
|
* @returns Indicates whether a user-facing pending item was removed.
|
|
2808
3841
|
*/
|
|
2809
|
-
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", {
|
|
3842
|
+
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", { ...params, sessionId }),
|
|
2810
3843
|
/**
|
|
2811
3844
|
* Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.
|
|
2812
3845
|
*
|
|
@@ -2819,6 +3852,15 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2819
3852
|
process: async () => connection.sendRequest("session.queue.process", { sessionId })
|
|
2820
3853
|
},
|
|
2821
3854
|
/** @experimental */
|
|
3855
|
+
usage: {
|
|
3856
|
+
/**
|
|
3857
|
+
* Internal host-only replacement of absolute code-change totals reported by a relay host.
|
|
3858
|
+
*
|
|
3859
|
+
* @param params Internal absolute code-change totals reported by the owning host.
|
|
3860
|
+
*/
|
|
3861
|
+
setCodeChanges: async (params) => connection.sendRequest("session.usage.setCodeChanges", { ...params, sessionId })
|
|
3862
|
+
},
|
|
3863
|
+
/** @experimental */
|
|
2822
3864
|
schedule: {
|
|
2823
3865
|
/**
|
|
2824
3866
|
* Hydrates the native schedule registry from persisted session events.
|
|
@@ -2837,7 +3879,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2837
3879
|
*
|
|
2838
3880
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
2839
3881
|
*/
|
|
2840
|
-
add: async (params) => connection.sendRequest("session.schedule.add", {
|
|
3882
|
+
add: async (params) => connection.sendRequest("session.schedule.add", { ...params, sessionId }),
|
|
2841
3883
|
/**
|
|
2842
3884
|
* Registers a recurring cron scheduled prompt.
|
|
2843
3885
|
*
|
|
@@ -2845,7 +3887,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2845
3887
|
*
|
|
2846
3888
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
2847
3889
|
*/
|
|
2848
|
-
addCron: async (params) => connection.sendRequest("session.schedule.addCron", {
|
|
3890
|
+
addCron: async (params) => connection.sendRequest("session.schedule.addCron", { ...params, sessionId }),
|
|
2849
3891
|
/**
|
|
2850
3892
|
* Registers an absolute-time scheduled prompt.
|
|
2851
3893
|
*
|
|
@@ -2853,7 +3895,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2853
3895
|
*
|
|
2854
3896
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
2855
3897
|
*/
|
|
2856
|
-
addAt: async (params) => connection.sendRequest("session.schedule.addAt", {
|
|
3898
|
+
addAt: async (params) => connection.sendRequest("session.schedule.addAt", { ...params, sessionId }),
|
|
2857
3899
|
/**
|
|
2858
3900
|
* Registers a self-paced scheduled prompt.
|
|
2859
3901
|
*
|
|
@@ -2861,7 +3903,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2861
3903
|
*
|
|
2862
3904
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
2863
3905
|
*/
|
|
2864
|
-
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", {
|
|
3906
|
+
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", { ...params, sessionId }),
|
|
2865
3907
|
/**
|
|
2866
3908
|
* Re-arms an active self-paced scheduled prompt.
|
|
2867
3909
|
*
|
|
@@ -2869,7 +3911,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2869
3911
|
*
|
|
2870
3912
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
2871
3913
|
*/
|
|
2872
|
-
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", {
|
|
3914
|
+
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", { ...params, sessionId })
|
|
2873
3915
|
}
|
|
2874
3916
|
};
|
|
2875
3917
|
}
|
|
@@ -2879,14 +3921,14 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2879
3921
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
2880
3922
|
return handler.getToken(params);
|
|
2881
3923
|
});
|
|
2882
|
-
connection.onRequest("
|
|
2883
|
-
const handler = getHandlers(params.sessionId).
|
|
2884
|
-
if (!handler) throw new Error(`No
|
|
3924
|
+
connection.onRequest("workflow.execute", async (params) => {
|
|
3925
|
+
const handler = getHandlers(params.sessionId).workflow;
|
|
3926
|
+
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
2885
3927
|
return handler.execute(params);
|
|
2886
3928
|
});
|
|
2887
|
-
connection.onRequest("
|
|
2888
|
-
const handler = getHandlers(params.sessionId).
|
|
2889
|
-
if (!handler) throw new Error(`No
|
|
3929
|
+
connection.onRequest("workflow.abort", async (params) => {
|
|
3930
|
+
const handler = getHandlers(params.sessionId).workflow;
|
|
3931
|
+
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
2890
3932
|
return handler.abort(params);
|
|
2891
3933
|
});
|
|
2892
3934
|
connection.onRequest("tasks.cancel", async (params) => {
|
|
@@ -2899,11 +3941,21 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2899
3941
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
2900
3942
|
return handler.readFile(params);
|
|
2901
3943
|
});
|
|
3944
|
+
connection.onRequest("sessionFs.readFileBytes", async (params) => {
|
|
3945
|
+
const handler = getHandlers(params.sessionId).sessionFs;
|
|
3946
|
+
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
3947
|
+
return handler.readFileBytes(params);
|
|
3948
|
+
});
|
|
2902
3949
|
connection.onRequest("sessionFs.writeFile", async (params) => {
|
|
2903
3950
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
2904
3951
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
2905
3952
|
return handler.writeFile(params);
|
|
2906
3953
|
});
|
|
3954
|
+
connection.onRequest("sessionFs.writeFileBytes", async (params) => {
|
|
3955
|
+
const handler = getHandlers(params.sessionId).sessionFs;
|
|
3956
|
+
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
3957
|
+
return handler.writeFileBytes(params);
|
|
3958
|
+
});
|
|
2907
3959
|
connection.onRequest("sessionFs.appendFile", async (params) => {
|
|
2908
3960
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
2909
3961
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
@@ -2976,6 +4028,11 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2976
4028
|
});
|
|
2977
4029
|
}
|
|
2978
4030
|
function registerClientGlobalApiHandlers(connection, handlers) {
|
|
4031
|
+
connection.onNotification("host.exited", async (params) => {
|
|
4032
|
+
const handler = handlers.host;
|
|
4033
|
+
if (!handler) return;
|
|
4034
|
+
await handler.exited(params);
|
|
4035
|
+
});
|
|
2979
4036
|
connection.onRequest("extensionLaunchProvider.resolve", async (params) => {
|
|
2980
4037
|
const handler = handlers.extensionLaunchProvider;
|
|
2981
4038
|
if (!handler) throw new Error("No extensionLaunchProvider client-global handler registered");
|
|
@@ -3001,6 +4058,11 @@ function registerClientGlobalApiHandlers(connection, handlers) {
|
|
|
3001
4058
|
if (!handler) throw new Error("No gitHubToken client-global handler registered");
|
|
3002
4059
|
return handler.getToken(params);
|
|
3003
4060
|
});
|
|
4061
|
+
connection.onRequest("installations.confirm", async (params) => {
|
|
4062
|
+
const handler = handlers.installations;
|
|
4063
|
+
if (!handler) throw new Error("No installations client-global handler registered");
|
|
4064
|
+
return handler.confirm(params);
|
|
4065
|
+
});
|
|
3004
4066
|
}
|
|
3005
4067
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3006
4068
|
0 && (module.exports = {
|