@github/copilot-sdk-darwin-arm64 1.0.16 → 1.0.17-preview.1
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/copilot-sdk/client.d.ts +1 -0
- package/copilot-sdk/extension.js +383 -242
- package/copilot-sdk/ffiRuntimeHost.d.ts +1 -0
- package/copilot-sdk/generated/rpc.d.ts +649 -14
- package/copilot-sdk/generated/session-events.d.ts +13 -3
- package/copilot-sdk/index.d.ts +1 -1
- package/copilot-sdk/index.js +383 -242
- package/copilot-sdk/session.d.ts +4 -1
- package/copilot-sdk/types.d.ts +17 -2
- package/package.json +3 -2
- package/prebuilds/darwin-arm64/copilot-runtime +0 -0
- package/prebuilds/darwin-arm64/runtime.node +2 -2
- package/ripgrep/bin/darwin-arm64/rg +0 -0
- package/schemas/api.schema.json +1022 -21
- package/schemas/session-events.schema.json +23 -5
- package/tgrep/bin/darwin-arm64/tgrep +0 -0
package/copilot-sdk/extension.js
CHANGED
|
@@ -3876,7 +3876,7 @@ var init_ffiRuntimeHost = __esm({
|
|
|
3876
3876
|
);
|
|
3877
3877
|
if (!this.connectionId) {
|
|
3878
3878
|
this.unregisterCallback();
|
|
3879
|
-
this.
|
|
3879
|
+
await this.shutdownHost();
|
|
3880
3880
|
this.serverId = 0;
|
|
3881
3881
|
throw new Error("copilot_runtime_connection_open failed.");
|
|
3882
3882
|
}
|
|
@@ -3885,7 +3885,7 @@ var init_ffiRuntimeHost = __esm({
|
|
|
3885
3885
|
} finally {
|
|
3886
3886
|
this.starting = false;
|
|
3887
3887
|
if (this.disposed) {
|
|
3888
|
-
|
|
3888
|
+
await this.tryFinalizeCleanup();
|
|
3889
3889
|
}
|
|
3890
3890
|
}
|
|
3891
3891
|
}
|
|
@@ -3924,6 +3924,17 @@ var init_ffiRuntimeHost = __esm({
|
|
|
3924
3924
|
);
|
|
3925
3925
|
}
|
|
3926
3926
|
}
|
|
3927
|
+
shutdownHost() {
|
|
3928
|
+
return new Promise((resolvePromise, rejectPromise) => {
|
|
3929
|
+
this.lib.hostShutdown.async(this.serverId, (error, result) => {
|
|
3930
|
+
if (error) {
|
|
3931
|
+
rejectPromise(error);
|
|
3932
|
+
} else {
|
|
3933
|
+
resolvePromise(result);
|
|
3934
|
+
}
|
|
3935
|
+
});
|
|
3936
|
+
});
|
|
3937
|
+
}
|
|
3927
3938
|
unregisterCallback() {
|
|
3928
3939
|
if (this.outboundCallback === void 0) {
|
|
3929
3940
|
return true;
|
|
@@ -3996,7 +4007,7 @@ var init_ffiRuntimeHost = __esm({
|
|
|
3996
4007
|
}
|
|
3997
4008
|
if (this.serverId) {
|
|
3998
4009
|
try {
|
|
3999
|
-
if (!this.
|
|
4010
|
+
if (!await this.shutdownHost()) {
|
|
4000
4011
|
console.error(
|
|
4001
4012
|
`In-process FFI host shutdown did not recognize server ${this.serverId}.`
|
|
4002
4013
|
);
|
|
@@ -4660,15 +4671,45 @@ function createServerRpc(connection) {
|
|
|
4660
4671
|
/** @experimental */
|
|
4661
4672
|
managedSettings: {
|
|
4662
4673
|
/**
|
|
4663
|
-
* 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.
|
|
4674
|
+
* 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.
|
|
4664
4675
|
*
|
|
4665
4676
|
* @returns Validated device-managed settings discovered before a session exists.
|
|
4666
4677
|
*/
|
|
4667
4678
|
read: async () => connection.sendRequest("managedSettings.read", {}),
|
|
4668
4679
|
/**
|
|
4669
|
-
* 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.
|
|
4680
|
+
* 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.
|
|
4681
|
+
*/
|
|
4682
|
+
clearCache: async () => connection.sendRequest("managedSettings.clearCache", {}),
|
|
4683
|
+
/**
|
|
4684
|
+
* 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.
|
|
4685
|
+
*
|
|
4686
|
+
* @param params Optional opaque account selection or GitHub token whose managed settings are resolved.
|
|
4687
|
+
*
|
|
4688
|
+
* @returns Effective enterprise managed settings for an account, resolved without a session.
|
|
4670
4689
|
*/
|
|
4671
|
-
|
|
4690
|
+
resolve: async (params) => connection.sendRequest("managedSettings.resolve", params),
|
|
4691
|
+
/**
|
|
4692
|
+
* 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.
|
|
4693
|
+
*
|
|
4694
|
+
* @returns The authoring JSON schema for managed settings recognized by this runtime.
|
|
4695
|
+
*/
|
|
4696
|
+
schema: async () => connection.sendRequest("managedSettings.schema", {}),
|
|
4697
|
+
/**
|
|
4698
|
+
* 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.
|
|
4699
|
+
*
|
|
4700
|
+
* @param params A candidate managed-settings document to validate without applying it.
|
|
4701
|
+
*
|
|
4702
|
+
* @returns Result of validating a managed-settings document.
|
|
4703
|
+
*/
|
|
4704
|
+
validate: async (params) => connection.sendRequest("managedSettings.validate", params),
|
|
4705
|
+
/**
|
|
4706
|
+
* 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.
|
|
4707
|
+
*
|
|
4708
|
+
* @param params Candidate managed-settings documents to merge without applying them.
|
|
4709
|
+
*
|
|
4710
|
+
* @returns The effective managed settings the runtime would enforce for the given documents, in the same shape `managedSettings.resolve` returns.
|
|
4711
|
+
*/
|
|
4712
|
+
compose: async (params) => connection.sendRequest("managedSettings.compose", params)
|
|
4672
4713
|
},
|
|
4673
4714
|
/** @experimental */
|
|
4674
4715
|
runtime: {
|
|
@@ -5061,7 +5102,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5061
5102
|
*
|
|
5062
5103
|
* @experimental
|
|
5063
5104
|
*/
|
|
5064
|
-
send: async (params) => connection.sendRequest("session.send", {
|
|
5105
|
+
send: async (params) => connection.sendRequest("session.send", { ...params, sessionId }),
|
|
5065
5106
|
/**
|
|
5066
5107
|
* 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.
|
|
5067
5108
|
*
|
|
@@ -5071,7 +5112,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5071
5112
|
*
|
|
5072
5113
|
* @experimental
|
|
5073
5114
|
*/
|
|
5074
|
-
sendMessages: async (params) => connection.sendRequest("session.sendMessages", {
|
|
5115
|
+
sendMessages: async (params) => connection.sendRequest("session.sendMessages", { ...params, sessionId }),
|
|
5075
5116
|
/** @experimental */
|
|
5076
5117
|
sandbox: {
|
|
5077
5118
|
/**
|
|
@@ -5087,7 +5128,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5087
5128
|
*
|
|
5088
5129
|
* @returns Result of attempting to disable sandboxing for the current session.
|
|
5089
5130
|
*/
|
|
5090
|
-
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", {
|
|
5131
|
+
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", { ...params, sessionId }),
|
|
5091
5132
|
/**
|
|
5092
5133
|
* 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.
|
|
5093
5134
|
*
|
|
@@ -5095,7 +5136,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5095
5136
|
*
|
|
5096
5137
|
* @returns Result of accepting a sandbox path grant.
|
|
5097
5138
|
*/
|
|
5098
|
-
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", {
|
|
5139
|
+
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", { ...params, sessionId })
|
|
5099
5140
|
},
|
|
5100
5141
|
/**
|
|
5101
5142
|
* Aborts the current agent turn.
|
|
@@ -5106,7 +5147,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5106
5147
|
*
|
|
5107
5148
|
* @experimental
|
|
5108
5149
|
*/
|
|
5109
|
-
abort: async (params) => connection.sendRequest("session.abort", {
|
|
5150
|
+
abort: async (params) => connection.sendRequest("session.abort", { ...params, sessionId }),
|
|
5110
5151
|
/**
|
|
5111
5152
|
* 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.
|
|
5112
5153
|
*
|
|
@@ -5116,7 +5157,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5116
5157
|
*
|
|
5117
5158
|
* @experimental
|
|
5118
5159
|
*/
|
|
5119
|
-
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", {
|
|
5160
|
+
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", { ...params, sessionId }),
|
|
5120
5161
|
/**
|
|
5121
5162
|
* Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.
|
|
5122
5163
|
*
|
|
@@ -5132,7 +5173,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5132
5173
|
*
|
|
5133
5174
|
* @experimental
|
|
5134
5175
|
*/
|
|
5135
|
-
shutdown: async (params) => connection.sendRequest("session.shutdown", {
|
|
5176
|
+
shutdown: async (params) => connection.sendRequest("session.shutdown", { ...params, sessionId }),
|
|
5136
5177
|
/** @experimental */
|
|
5137
5178
|
gitHubAuth: {
|
|
5138
5179
|
/**
|
|
@@ -5148,7 +5189,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5148
5189
|
*
|
|
5149
5190
|
* @returns Indicates whether the credential update succeeded.
|
|
5150
5191
|
*/
|
|
5151
|
-
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", {
|
|
5192
|
+
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { ...params, sessionId })
|
|
5152
5193
|
},
|
|
5153
5194
|
/** @experimental */
|
|
5154
5195
|
accounts: {
|
|
@@ -5159,7 +5200,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5159
5200
|
*
|
|
5160
5201
|
* @returns The enumerated collection, keyed by the same selector as the query.
|
|
5161
5202
|
*/
|
|
5162
|
-
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", {
|
|
5203
|
+
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", { ...params, sessionId }),
|
|
5163
5204
|
/**
|
|
5164
5205
|
* Read one typed accounts datum: the active account, a neutral status summary, or the last authentication errors.
|
|
5165
5206
|
*
|
|
@@ -5167,7 +5208,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5167
5208
|
*
|
|
5168
5209
|
* @returns The read result, keyed by the same selector as the query.
|
|
5169
5210
|
*/
|
|
5170
|
-
get: async (params) => connection.sendRequest("session.accounts.get", {
|
|
5211
|
+
get: async (params) => connection.sendRequest("session.accounts.get", { ...params, sessionId }),
|
|
5171
5212
|
/**
|
|
5172
5213
|
* Apply one non-interactive accounts mutation: switch the active account, log an account out, or set credentials from a token.
|
|
5173
5214
|
*
|
|
@@ -5175,7 +5216,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5175
5216
|
*
|
|
5176
5217
|
* @returns Result of a non-interactive accounts mutation.
|
|
5177
5218
|
*/
|
|
5178
|
-
set: async (params) => connection.sendRequest("session.accounts.set", {
|
|
5219
|
+
set: async (params) => connection.sendRequest("session.accounts.set", { ...params, sessionId }),
|
|
5179
5220
|
/** @experimental */
|
|
5180
5221
|
login: {
|
|
5181
5222
|
/**
|
|
@@ -5185,7 +5226,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5185
5226
|
*
|
|
5186
5227
|
* @returns A started login flow: its opaque id and first step.
|
|
5187
5228
|
*/
|
|
5188
|
-
begin: async (params) => connection.sendRequest("session.accounts.login.begin", {
|
|
5229
|
+
begin: async (params) => connection.sendRequest("session.accounts.login.begin", { ...params, sessionId }),
|
|
5189
5230
|
/**
|
|
5190
5231
|
* Advance an in-flight login flow, optionally fulfilling an input-required step, and return the next step.
|
|
5191
5232
|
*
|
|
@@ -5193,13 +5234,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5193
5234
|
*
|
|
5194
5235
|
* @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).
|
|
5195
5236
|
*/
|
|
5196
|
-
advance: async (params) => connection.sendRequest("session.accounts.login.advance", {
|
|
5237
|
+
advance: async (params) => connection.sendRequest("session.accounts.login.advance", { ...params, sessionId }),
|
|
5197
5238
|
/**
|
|
5198
5239
|
* Cancel an in-flight login flow and release its resources.
|
|
5199
5240
|
*
|
|
5200
5241
|
* @param params Cancel an in-flight login flow.
|
|
5201
5242
|
*/
|
|
5202
|
-
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", {
|
|
5243
|
+
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", { ...params, sessionId })
|
|
5203
5244
|
}
|
|
5204
5245
|
},
|
|
5205
5246
|
/** @experimental */
|
|
@@ -5211,7 +5252,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5211
5252
|
*
|
|
5212
5253
|
* @returns Result of collecting a session debug bundle.
|
|
5213
5254
|
*/
|
|
5214
|
-
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", {
|
|
5255
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { ...params, sessionId })
|
|
5215
5256
|
},
|
|
5216
5257
|
/** @experimental */
|
|
5217
5258
|
canvas: {
|
|
@@ -5234,13 +5275,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5234
5275
|
*
|
|
5235
5276
|
* @returns Open canvas instance snapshot.
|
|
5236
5277
|
*/
|
|
5237
|
-
open: async (params) => connection.sendRequest("session.canvas.open", {
|
|
5278
|
+
open: async (params) => connection.sendRequest("session.canvas.open", { ...params, sessionId }),
|
|
5238
5279
|
/**
|
|
5239
5280
|
* Closes an open canvas instance.
|
|
5240
5281
|
*
|
|
5241
5282
|
* @param params Canvas close parameters.
|
|
5242
5283
|
*/
|
|
5243
|
-
close: async (params) => connection.sendRequest("session.canvas.close", {
|
|
5284
|
+
close: async (params) => connection.sendRequest("session.canvas.close", { ...params, sessionId }),
|
|
5244
5285
|
/** @experimental */
|
|
5245
5286
|
action: {
|
|
5246
5287
|
/**
|
|
@@ -5250,7 +5291,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5250
5291
|
*
|
|
5251
5292
|
* @returns Canvas action invocation result.
|
|
5252
5293
|
*/
|
|
5253
|
-
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", {
|
|
5294
|
+
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", { ...params, sessionId })
|
|
5254
5295
|
}
|
|
5255
5296
|
},
|
|
5256
5297
|
/** @experimental */
|
|
@@ -5262,7 +5303,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5262
5303
|
*
|
|
5263
5304
|
* @returns Complete current or terminal workflow run envelope.
|
|
5264
5305
|
*/
|
|
5265
|
-
run: async (params) => connection.sendRequest("session.workflow.run", {
|
|
5306
|
+
run: async (params) => connection.sendRequest("session.workflow.run", { ...params, sessionId }),
|
|
5266
5307
|
/**
|
|
5267
5308
|
* Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
|
|
5268
5309
|
*
|
|
@@ -5270,7 +5311,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5270
5311
|
*
|
|
5271
5312
|
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
5272
5313
|
*/
|
|
5273
|
-
resume: async (params) => connection.sendRequest("session.workflow.resume", {
|
|
5314
|
+
resume: async (params) => connection.sendRequest("session.workflow.resume", { ...params, sessionId }),
|
|
5274
5315
|
/**
|
|
5275
5316
|
* Gets the current or settled envelope for a dynamic workflow run.
|
|
5276
5317
|
*
|
|
@@ -5278,7 +5319,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5278
5319
|
*
|
|
5279
5320
|
* @returns Complete current or terminal workflow run envelope.
|
|
5280
5321
|
*/
|
|
5281
|
-
getRun: async (params) => connection.sendRequest("session.workflow.getRun", {
|
|
5322
|
+
getRun: async (params) => connection.sendRequest("session.workflow.getRun", { ...params, sessionId }),
|
|
5282
5323
|
/**
|
|
5283
5324
|
* Lists durable dynamic workflow runs for this session in creation order.
|
|
5284
5325
|
*
|
|
@@ -5286,7 +5327,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5286
5327
|
*
|
|
5287
5328
|
* @returns A page of workflow runs in durable creation order.
|
|
5288
5329
|
*/
|
|
5289
|
-
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", {
|
|
5330
|
+
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { ...params, sessionId }),
|
|
5290
5331
|
/**
|
|
5291
5332
|
* Gets durable and live observability detail for one dynamic workflow run.
|
|
5292
5333
|
*
|
|
@@ -5294,7 +5335,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5294
5335
|
*
|
|
5295
5336
|
* @returns Full workflow run observability detail.
|
|
5296
5337
|
*/
|
|
5297
|
-
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", {
|
|
5338
|
+
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { ...params, sessionId }),
|
|
5298
5339
|
/**
|
|
5299
5340
|
* Pages durable progress for one dynamic workflow run.
|
|
5300
5341
|
*
|
|
@@ -5302,7 +5343,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5302
5343
|
*
|
|
5303
5344
|
* @returns A bidirectional page of workflow progress.
|
|
5304
5345
|
*/
|
|
5305
|
-
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", {
|
|
5346
|
+
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { ...params, sessionId }),
|
|
5306
5347
|
/**
|
|
5307
5348
|
* Requests cancellation of a dynamic workflow run and returns its run envelope.
|
|
5308
5349
|
*
|
|
@@ -5310,7 +5351,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5310
5351
|
*
|
|
5311
5352
|
* @returns Complete current or terminal workflow run envelope.
|
|
5312
5353
|
*/
|
|
5313
|
-
cancel: async (params) => connection.sendRequest("session.workflow.cancel", {
|
|
5354
|
+
cancel: async (params) => connection.sendRequest("session.workflow.cancel", { ...params, sessionId }),
|
|
5314
5355
|
/**
|
|
5315
5356
|
* Pauses a running dynamic workflow and returns its settled run envelope.
|
|
5316
5357
|
*
|
|
@@ -5318,7 +5359,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5318
5359
|
*
|
|
5319
5360
|
* @returns Complete current or terminal workflow run envelope.
|
|
5320
5361
|
*/
|
|
5321
|
-
pause: async (params) => connection.sendRequest("session.workflow.pause", {
|
|
5362
|
+
pause: async (params) => connection.sendRequest("session.workflow.pause", { ...params, sessionId }),
|
|
5322
5363
|
/**
|
|
5323
5364
|
* Records a batch of ordered dynamic workflow progress lines.
|
|
5324
5365
|
*
|
|
@@ -5326,7 +5367,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5326
5367
|
*
|
|
5327
5368
|
* @returns Acknowledgement that a workflow request was accepted.
|
|
5328
5369
|
*/
|
|
5329
|
-
log: async (params) => connection.sendRequest("session.workflow.log", {
|
|
5370
|
+
log: async (params) => connection.sendRequest("session.workflow.log", { ...params, sessionId }),
|
|
5330
5371
|
/**
|
|
5331
5372
|
* Runs one dynamic-workflow-scoped subagent and returns its result.
|
|
5332
5373
|
*
|
|
@@ -5334,7 +5375,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5334
5375
|
*
|
|
5335
5376
|
* @returns Result of one workflow-scoped subagent call.
|
|
5336
5377
|
*/
|
|
5337
|
-
agent: async (params) => connection.sendRequest("session.workflow.agent", {
|
|
5378
|
+
agent: async (params) => connection.sendRequest("session.workflow.agent", { ...params, sessionId }),
|
|
5338
5379
|
/** @experimental */
|
|
5339
5380
|
journal: {
|
|
5340
5381
|
/**
|
|
@@ -5344,7 +5385,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5344
5385
|
*
|
|
5345
5386
|
* @returns Result of reading a workflow journal entry.
|
|
5346
5387
|
*/
|
|
5347
|
-
get: async (params) => connection.sendRequest("session.workflow.journal.get", {
|
|
5388
|
+
get: async (params) => connection.sendRequest("session.workflow.journal.get", { ...params, sessionId }),
|
|
5348
5389
|
/**
|
|
5349
5390
|
* Stores a memoized dynamic workflow journal entry.
|
|
5350
5391
|
*
|
|
@@ -5352,7 +5393,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5352
5393
|
*
|
|
5353
5394
|
* @returns Acknowledgement that a workflow request was accepted.
|
|
5354
5395
|
*/
|
|
5355
|
-
put: async (params) => connection.sendRequest("session.workflow.journal.put", {
|
|
5396
|
+
put: async (params) => connection.sendRequest("session.workflow.journal.put", { ...params, sessionId })
|
|
5356
5397
|
}
|
|
5357
5398
|
},
|
|
5358
5399
|
/** @experimental */
|
|
@@ -5370,7 +5411,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5370
5411
|
*
|
|
5371
5412
|
* @returns The model identifier active on the session after the switch.
|
|
5372
5413
|
*/
|
|
5373
|
-
switchTo: async (params) => connection.sendRequest("session.model.switchTo", {
|
|
5414
|
+
switchTo: async (params) => connection.sendRequest("session.model.switchTo", { ...params, sessionId }),
|
|
5374
5415
|
/**
|
|
5375
5416
|
* 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`.
|
|
5376
5417
|
*
|
|
@@ -5378,7 +5419,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5378
5419
|
*
|
|
5379
5420
|
* @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed.
|
|
5380
5421
|
*/
|
|
5381
|
-
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", {
|
|
5422
|
+
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", { ...params, sessionId }),
|
|
5382
5423
|
/**
|
|
5383
5424
|
* Replaces or clears the host-supplied model allowlist for a running session.
|
|
5384
5425
|
*
|
|
@@ -5386,7 +5427,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5386
5427
|
*
|
|
5387
5428
|
* @returns The applied host allowlist and effective session model policy after intersection.
|
|
5388
5429
|
*/
|
|
5389
|
-
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", {
|
|
5430
|
+
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", { ...params, sessionId }),
|
|
5390
5431
|
/**
|
|
5391
5432
|
* Updates the session's reasoning effort without changing the selected model.
|
|
5392
5433
|
*
|
|
@@ -5394,7 +5435,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5394
5435
|
*
|
|
5395
5436
|
* @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.
|
|
5396
5437
|
*/
|
|
5397
|
-
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", {
|
|
5438
|
+
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { ...params, sessionId }),
|
|
5398
5439
|
/**
|
|
5399
5440
|
* 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.
|
|
5400
5441
|
*
|
|
@@ -5402,7 +5443,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5402
5443
|
*
|
|
5403
5444
|
* @returns The list of models available to this session.
|
|
5404
5445
|
*/
|
|
5405
|
-
list: async (params) => connection.sendRequest("session.model.list", {
|
|
5446
|
+
list: async (params) => connection.sendRequest("session.model.list", { ...params, sessionId })
|
|
5406
5447
|
},
|
|
5407
5448
|
/** @experimental */
|
|
5408
5449
|
mode: {
|
|
@@ -5419,7 +5460,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5419
5460
|
*
|
|
5420
5461
|
* @returns Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.
|
|
5421
5462
|
*/
|
|
5422
|
-
set: async (params) => connection.sendRequest("session.mode.set", {
|
|
5463
|
+
set: async (params) => connection.sendRequest("session.mode.set", { ...params, sessionId })
|
|
5423
5464
|
},
|
|
5424
5465
|
/** @experimental */
|
|
5425
5466
|
name: {
|
|
@@ -5434,7 +5475,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5434
5475
|
*
|
|
5435
5476
|
* @param params New friendly name to apply to the session.
|
|
5436
5477
|
*/
|
|
5437
|
-
set: async (params) => connection.sendRequest("session.name.set", {
|
|
5478
|
+
set: async (params) => connection.sendRequest("session.name.set", { ...params, sessionId }),
|
|
5438
5479
|
/**
|
|
5439
5480
|
* Persists an auto-generated session summary as the session's name when no user-set name exists.
|
|
5440
5481
|
*
|
|
@@ -5442,7 +5483,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5442
5483
|
*
|
|
5443
5484
|
* @returns Indicates whether the auto-generated summary was applied as the session's name.
|
|
5444
5485
|
*/
|
|
5445
|
-
setAuto: async (params) => connection.sendRequest("session.name.setAuto", {
|
|
5486
|
+
setAuto: async (params) => connection.sendRequest("session.name.setAuto", { ...params, sessionId })
|
|
5446
5487
|
},
|
|
5447
5488
|
/** @experimental */
|
|
5448
5489
|
plan: {
|
|
@@ -5457,7 +5498,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5457
5498
|
*
|
|
5458
5499
|
* @param params Replacement contents to write to the session plan file.
|
|
5459
5500
|
*/
|
|
5460
|
-
update: async (params) => connection.sendRequest("session.plan.update", {
|
|
5501
|
+
update: async (params) => connection.sendRequest("session.plan.update", { ...params, sessionId }),
|
|
5461
5502
|
/**
|
|
5462
5503
|
* Deletes the session plan file from the workspace.
|
|
5463
5504
|
*/
|
|
@@ -5490,7 +5531,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5490
5531
|
*
|
|
5491
5532
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
5492
5533
|
*/
|
|
5493
|
-
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", {
|
|
5534
|
+
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", { ...params, sessionId }),
|
|
5494
5535
|
/**
|
|
5495
5536
|
* Ensures a local session workspace exists and returns it.
|
|
5496
5537
|
*
|
|
@@ -5498,7 +5539,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5498
5539
|
*
|
|
5499
5540
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
5500
5541
|
*/
|
|
5501
|
-
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", {
|
|
5542
|
+
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", { ...params, sessionId }),
|
|
5502
5543
|
/**
|
|
5503
5544
|
* Lists files stored in the session workspace files directory.
|
|
5504
5545
|
*
|
|
@@ -5512,13 +5553,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5512
5553
|
*
|
|
5513
5554
|
* @returns Contents of the requested workspace file as a UTF-8 string.
|
|
5514
5555
|
*/
|
|
5515
|
-
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", {
|
|
5556
|
+
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", { ...params, sessionId }),
|
|
5516
5557
|
/**
|
|
5517
5558
|
* Creates or overwrites a file in the session workspace files directory.
|
|
5518
5559
|
*
|
|
5519
5560
|
* @param params Relative path and UTF-8 content for the workspace file to create or overwrite.
|
|
5520
5561
|
*/
|
|
5521
|
-
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", {
|
|
5562
|
+
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", { ...params, sessionId }),
|
|
5522
5563
|
/**
|
|
5523
5564
|
* Returns metadata for a file or directory in the session workspace files directory.
|
|
5524
5565
|
*
|
|
@@ -5526,25 +5567,25 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5526
5567
|
*
|
|
5527
5568
|
* @returns Filesystem metadata for a path in the session workspace files directory.
|
|
5528
5569
|
*/
|
|
5529
|
-
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", {
|
|
5570
|
+
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", { ...params, sessionId }),
|
|
5530
5571
|
/**
|
|
5531
5572
|
* Creates a directory in the session workspace files directory.
|
|
5532
5573
|
*
|
|
5533
5574
|
* @param params Directory to create within the session workspace files directory.
|
|
5534
5575
|
*/
|
|
5535
|
-
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", {
|
|
5576
|
+
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", { ...params, sessionId }),
|
|
5536
5577
|
/**
|
|
5537
5578
|
* Removes a file or directory from the session workspace files directory.
|
|
5538
5579
|
*
|
|
5539
5580
|
* @param params File or directory to remove from the session workspace files directory.
|
|
5540
5581
|
*/
|
|
5541
|
-
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", {
|
|
5582
|
+
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", { ...params, sessionId }),
|
|
5542
5583
|
/**
|
|
5543
5584
|
* Renames a file or directory within the session workspace files directory.
|
|
5544
5585
|
*
|
|
5545
5586
|
* @param params Source and destination paths for a rename within the session workspace files directory.
|
|
5546
5587
|
*/
|
|
5547
|
-
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", {
|
|
5588
|
+
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", { ...params, sessionId }),
|
|
5548
5589
|
/**
|
|
5549
5590
|
* Lists workspace checkpoints in chronological order.
|
|
5550
5591
|
*
|
|
@@ -5558,7 +5599,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5558
5599
|
*
|
|
5559
5600
|
* @returns Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
|
|
5560
5601
|
*/
|
|
5561
|
-
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", {
|
|
5602
|
+
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", { ...params, sessionId }),
|
|
5562
5603
|
/**
|
|
5563
5604
|
* Adds a compaction summary checkpoint to the local session workspace.
|
|
5564
5605
|
*
|
|
@@ -5566,7 +5607,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5566
5607
|
*
|
|
5567
5608
|
* @returns Persisted summary metadata and refreshed workspace metadata.
|
|
5568
5609
|
*/
|
|
5569
|
-
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", {
|
|
5610
|
+
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", { ...params, sessionId }),
|
|
5570
5611
|
/**
|
|
5571
5612
|
* Truncates local workspace compaction summaries after a rollback.
|
|
5572
5613
|
*
|
|
@@ -5574,7 +5615,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5574
5615
|
*
|
|
5575
5616
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
5576
5617
|
*/
|
|
5577
|
-
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", {
|
|
5618
|
+
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", { ...params, sessionId }),
|
|
5578
5619
|
/**
|
|
5579
5620
|
* Reads the autopilot objective state file from the local session workspace.
|
|
5580
5621
|
*
|
|
@@ -5588,7 +5629,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5588
5629
|
*
|
|
5589
5630
|
* @returns Result of writing the autopilot objective file.
|
|
5590
5631
|
*/
|
|
5591
|
-
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", {
|
|
5632
|
+
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", { ...params, sessionId }),
|
|
5592
5633
|
/**
|
|
5593
5634
|
* Deletes the autopilot objective state file from the local session workspace.
|
|
5594
5635
|
*
|
|
@@ -5608,7 +5649,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5608
5649
|
*
|
|
5609
5650
|
* @returns Descriptor for the saved paste file, or null when the workspace is unavailable.
|
|
5610
5651
|
*/
|
|
5611
|
-
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", {
|
|
5652
|
+
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", { ...params, sessionId }),
|
|
5612
5653
|
/**
|
|
5613
5654
|
* 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`.
|
|
5614
5655
|
*
|
|
@@ -5616,7 +5657,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5616
5657
|
*
|
|
5617
5658
|
* @returns Workspace diff result for the requested mode.
|
|
5618
5659
|
*/
|
|
5619
|
-
diff: async (params) => connection.sendRequest("session.workspaces.diff", {
|
|
5660
|
+
diff: async (params) => connection.sendRequest("session.workspaces.diff", { ...params, sessionId })
|
|
5620
5661
|
},
|
|
5621
5662
|
/** @experimental */
|
|
5622
5663
|
autopilotObjective: {
|
|
@@ -5642,7 +5683,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5642
5683
|
*
|
|
5643
5684
|
* @returns Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.
|
|
5644
5685
|
*/
|
|
5645
|
-
request: async (params) => connection.sendRequest("session.completions.request", {
|
|
5686
|
+
request: async (params) => connection.sendRequest("session.completions.request", { ...params, sessionId })
|
|
5646
5687
|
},
|
|
5647
5688
|
/** @experimental */
|
|
5648
5689
|
instructions: {
|
|
@@ -5675,7 +5716,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5675
5716
|
*
|
|
5676
5717
|
* @returns Indicates whether fleet mode was successfully activated.
|
|
5677
5718
|
*/
|
|
5678
|
-
start: async (params) => connection.sendRequest("session.fleet.start", {
|
|
5719
|
+
start: async (params) => connection.sendRequest("session.fleet.start", { ...params, sessionId })
|
|
5679
5720
|
},
|
|
5680
5721
|
/** @experimental */
|
|
5681
5722
|
agent: {
|
|
@@ -5686,13 +5727,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5686
5727
|
*
|
|
5687
5728
|
* @returns Agents available to the session.
|
|
5688
5729
|
*/
|
|
5689
|
-
list: async (params) => connection.sendRequest("session.agent.list", {
|
|
5730
|
+
list: async (params) => connection.sendRequest("session.agent.list", { ...params, sessionId }),
|
|
5690
5731
|
/**
|
|
5691
5732
|
* 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.
|
|
5692
5733
|
*
|
|
5693
5734
|
* @param params An in-memory authored prompt override for an available agent.
|
|
5694
5735
|
*/
|
|
5695
|
-
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", {
|
|
5736
|
+
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", { ...params, sessionId }),
|
|
5696
5737
|
/**
|
|
5697
5738
|
* Gets the currently selected custom agent for the session.
|
|
5698
5739
|
*
|
|
@@ -5706,7 +5747,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5706
5747
|
*
|
|
5707
5748
|
* @returns The newly selected custom agent.
|
|
5708
5749
|
*/
|
|
5709
|
-
select: async (params) => connection.sendRequest("session.agent.select", {
|
|
5750
|
+
select: async (params) => connection.sendRequest("session.agent.select", { ...params, sessionId }),
|
|
5710
5751
|
/**
|
|
5711
5752
|
* Clears the selected custom agent and returns the session to the default agent.
|
|
5712
5753
|
*/
|
|
@@ -5727,7 +5768,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5727
5768
|
*
|
|
5728
5769
|
* @returns Identifier assigned to the newly started background agent task.
|
|
5729
5770
|
*/
|
|
5730
|
-
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", {
|
|
5771
|
+
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", { ...params, sessionId }),
|
|
5731
5772
|
/**
|
|
5732
5773
|
* Lists background tasks tracked by the session.
|
|
5733
5774
|
*
|
|
@@ -5741,7 +5782,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5741
5782
|
*
|
|
5742
5783
|
* @returns Result of registering or reclaiming a client-owned task.
|
|
5743
5784
|
*/
|
|
5744
|
-
register: async (params) => connection.sendRequest("session.tasks.register", {
|
|
5785
|
+
register: async (params) => connection.sendRequest("session.tasks.register", { ...params, sessionId }),
|
|
5745
5786
|
/**
|
|
5746
5787
|
* Publishes generic progress or a terminal outcome for a client-owned task.
|
|
5747
5788
|
*
|
|
@@ -5749,7 +5790,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5749
5790
|
*
|
|
5750
5791
|
* @returns Result of publishing a client-owned task update.
|
|
5751
5792
|
*/
|
|
5752
|
-
update: async (params) => connection.sendRequest("session.tasks.update", {
|
|
5793
|
+
update: async (params) => connection.sendRequest("session.tasks.update", { ...params, sessionId }),
|
|
5753
5794
|
/**
|
|
5754
5795
|
* Refreshes metadata for any detached background shells the runtime knows about.
|
|
5755
5796
|
*
|
|
@@ -5769,7 +5810,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5769
5810
|
*
|
|
5770
5811
|
* @returns Progress information for the task, or null when no task with that ID is tracked.
|
|
5771
5812
|
*/
|
|
5772
|
-
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", {
|
|
5813
|
+
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", { ...params, sessionId }),
|
|
5773
5814
|
/**
|
|
5774
5815
|
* Returns the first sync-waiting task that can currently be promoted to background mode.
|
|
5775
5816
|
*
|
|
@@ -5783,7 +5824,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5783
5824
|
*
|
|
5784
5825
|
* @returns Indicates whether the task was successfully promoted to background mode.
|
|
5785
5826
|
*/
|
|
5786
|
-
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", {
|
|
5827
|
+
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", { ...params, sessionId }),
|
|
5787
5828
|
/**
|
|
5788
5829
|
* Atomically promotes the first promotable sync-waiting task to background mode and returns it.
|
|
5789
5830
|
*
|
|
@@ -5797,7 +5838,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5797
5838
|
*
|
|
5798
5839
|
* @returns Indicates whether the background task was successfully cancelled.
|
|
5799
5840
|
*/
|
|
5800
|
-
cancel: async (params) => connection.sendRequest("session.tasks.cancel", {
|
|
5841
|
+
cancel: async (params) => connection.sendRequest("session.tasks.cancel", { ...params, sessionId }),
|
|
5801
5842
|
/**
|
|
5802
5843
|
* Removes a completed or cancelled background task from tracking.
|
|
5803
5844
|
*
|
|
@@ -5805,7 +5846,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5805
5846
|
*
|
|
5806
5847
|
* @returns Indicates whether the task was removed. False when the task does not exist or is still running/idle.
|
|
5807
5848
|
*/
|
|
5808
|
-
remove: async (params) => connection.sendRequest("session.tasks.remove", {
|
|
5849
|
+
remove: async (params) => connection.sendRequest("session.tasks.remove", { ...params, sessionId }),
|
|
5809
5850
|
/**
|
|
5810
5851
|
* Sends a message to a background agent task.
|
|
5811
5852
|
*
|
|
@@ -5813,7 +5854,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5813
5854
|
*
|
|
5814
5855
|
* @returns Indicates whether the message was delivered, with an error message when delivery failed.
|
|
5815
5856
|
*/
|
|
5816
|
-
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", {
|
|
5857
|
+
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", { ...params, sessionId })
|
|
5817
5858
|
},
|
|
5818
5859
|
/** @experimental */
|
|
5819
5860
|
skills: {
|
|
@@ -5834,13 +5875,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5834
5875
|
*
|
|
5835
5876
|
* @param params Name of the skill to enable for the session.
|
|
5836
5877
|
*/
|
|
5837
|
-
enable: async (params) => connection.sendRequest("session.skills.enable", {
|
|
5878
|
+
enable: async (params) => connection.sendRequest("session.skills.enable", { ...params, sessionId }),
|
|
5838
5879
|
/**
|
|
5839
5880
|
* Disables a skill for the session.
|
|
5840
5881
|
*
|
|
5841
5882
|
* @param params Name of the skill to disable for the session.
|
|
5842
5883
|
*/
|
|
5843
|
-
disable: async (params) => connection.sendRequest("session.skills.disable", {
|
|
5884
|
+
disable: async (params) => connection.sendRequest("session.skills.disable", { ...params, sessionId }),
|
|
5844
5885
|
/**
|
|
5845
5886
|
* Reloads skill definitions for the session.
|
|
5846
5887
|
*
|
|
@@ -5867,19 +5908,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5867
5908
|
*
|
|
5868
5909
|
* @returns Tools exposed by the connected MCP server. Throws when the server is not connected.
|
|
5869
5910
|
*/
|
|
5870
|
-
listTools: async (params) => connection.sendRequest("session.mcp.listTools", {
|
|
5911
|
+
listTools: async (params) => connection.sendRequest("session.mcp.listTools", { ...params, sessionId }),
|
|
5871
5912
|
/**
|
|
5872
5913
|
* Enables an MCP server for the session.
|
|
5873
5914
|
*
|
|
5874
5915
|
* @param params Name of the MCP server to enable for the session.
|
|
5875
5916
|
*/
|
|
5876
|
-
enable: async (params) => connection.sendRequest("session.mcp.enable", {
|
|
5917
|
+
enable: async (params) => connection.sendRequest("session.mcp.enable", { ...params, sessionId }),
|
|
5877
5918
|
/**
|
|
5878
5919
|
* Disables an MCP server for the session.
|
|
5879
5920
|
*
|
|
5880
5921
|
* @param params Name of the MCP server to disable for the session.
|
|
5881
5922
|
*/
|
|
5882
|
-
disable: async (params) => connection.sendRequest("session.mcp.disable", {
|
|
5923
|
+
disable: async (params) => connection.sendRequest("session.mcp.disable", { ...params, sessionId }),
|
|
5883
5924
|
/**
|
|
5884
5925
|
* Reloads MCP server connections for the session.
|
|
5885
5926
|
*/
|
|
@@ -5897,7 +5938,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5897
5938
|
*
|
|
5898
5939
|
* @returns Outcome of an MCP sampling execution: success result, failure error, or cancellation.
|
|
5899
5940
|
*/
|
|
5900
|
-
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", {
|
|
5941
|
+
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", { ...params, sessionId }),
|
|
5901
5942
|
/**
|
|
5902
5943
|
* Cancels an in-flight MCP sampling execution by request ID.
|
|
5903
5944
|
*
|
|
@@ -5905,7 +5946,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5905
5946
|
*
|
|
5906
5947
|
* @returns Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
|
|
5907
5948
|
*/
|
|
5908
|
-
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", {
|
|
5949
|
+
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", { ...params, sessionId }),
|
|
5909
5950
|
/**
|
|
5910
5951
|
* Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).
|
|
5911
5952
|
*
|
|
@@ -5913,7 +5954,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5913
5954
|
*
|
|
5914
5955
|
* @returns Env-value mode recorded on the session after the update.
|
|
5915
5956
|
*/
|
|
5916
|
-
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", {
|
|
5957
|
+
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", { ...params, sessionId }),
|
|
5917
5958
|
/**
|
|
5918
5959
|
* Removes the auto-managed `github` MCP server when present.
|
|
5919
5960
|
*
|
|
@@ -5925,19 +5966,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5925
5966
|
*
|
|
5926
5967
|
* @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.
|
|
5927
5968
|
*/
|
|
5928
|
-
startServer: async (params) => connection.sendRequest("session.mcp.startServer", {
|
|
5969
|
+
startServer: async (params) => connection.sendRequest("session.mcp.startServer", { ...params, sessionId }),
|
|
5929
5970
|
/**
|
|
5930
5971
|
* 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.*`).
|
|
5931
5972
|
*
|
|
5932
5973
|
* @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.
|
|
5933
5974
|
*/
|
|
5934
|
-
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", {
|
|
5975
|
+
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", { ...params, sessionId }),
|
|
5935
5976
|
/**
|
|
5936
5977
|
* Stops an individual MCP server on the session's host.
|
|
5937
5978
|
*
|
|
5938
5979
|
* @param params Server name for an individual MCP server stop.
|
|
5939
5980
|
*/
|
|
5940
|
-
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", {
|
|
5981
|
+
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", { ...params, sessionId }),
|
|
5941
5982
|
/**
|
|
5942
5983
|
* Checks whether a named MCP server is currently running on the session's host.
|
|
5943
5984
|
*
|
|
@@ -5945,7 +5986,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5945
5986
|
*
|
|
5946
5987
|
* @returns Whether the named MCP server is running.
|
|
5947
5988
|
*/
|
|
5948
|
-
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", {
|
|
5989
|
+
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", { ...params, sessionId }),
|
|
5949
5990
|
/** @experimental */
|
|
5950
5991
|
oauth: {
|
|
5951
5992
|
/**
|
|
@@ -5955,13 +5996,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5955
5996
|
*
|
|
5956
5997
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
5957
5998
|
*/
|
|
5958
|
-
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", {
|
|
5999
|
+
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", { ...params, sessionId }),
|
|
5959
6000
|
/**
|
|
5960
6001
|
* Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed.
|
|
5961
6002
|
*
|
|
5962
6003
|
* @param params Identifies the MCP server whose persisted OAuth credentials were updated.
|
|
5963
6004
|
*/
|
|
5964
|
-
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", {
|
|
6005
|
+
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { ...params, sessionId }),
|
|
5965
6006
|
/**
|
|
5966
6007
|
* 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.
|
|
5967
6008
|
*
|
|
@@ -5969,15 +6010,21 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5969
6010
|
*
|
|
5970
6011
|
* @returns An inert runtime-issued login handle. Preparation alone performs no activation or OAuth work.
|
|
5971
6012
|
*/
|
|
5972
|
-
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", {
|
|
6013
|
+
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", { ...params, sessionId }),
|
|
5973
6014
|
/**
|
|
5974
6015
|
* 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.
|
|
5975
6016
|
*
|
|
5976
|
-
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback
|
|
6017
|
+
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback handling, and static OAuth client selection.
|
|
5977
6018
|
*
|
|
5978
6019
|
* @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
|
|
5979
6020
|
*/
|
|
5980
|
-
login: async (params) => connection.sendRequest("session.mcp.oauth.login", {
|
|
6021
|
+
login: async (params) => connection.sendRequest("session.mcp.oauth.login", { ...params, sessionId }),
|
|
6022
|
+
/**
|
|
6023
|
+
* Completes a runtime-managed MCP OAuth login after the authorization server redirects to a host-managed callback URL.
|
|
6024
|
+
*
|
|
6025
|
+
* @param params Host-delivered callback for a runtime-managed MCP OAuth login.
|
|
6026
|
+
*/
|
|
6027
|
+
complete: async (params) => connection.sendRequest("session.mcp.oauth.complete", { ...params, sessionId }),
|
|
5981
6028
|
/**
|
|
5982
6029
|
* 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.
|
|
5983
6030
|
*
|
|
@@ -5985,7 +6032,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5985
6032
|
*
|
|
5986
6033
|
* @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.
|
|
5987
6034
|
*/
|
|
5988
|
-
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", {
|
|
6035
|
+
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { ...params, sessionId }),
|
|
5989
6036
|
/**
|
|
5990
6037
|
* Cancels the exact owned OAuth login issued to this original session requester, without clearing shared credentials.
|
|
5991
6038
|
*
|
|
@@ -5993,7 +6040,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
5993
6040
|
*
|
|
5994
6041
|
* @returns Honest terminal cancellation result; persistence or recovery failures remain RPC errors.
|
|
5995
6042
|
*/
|
|
5996
|
-
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", {
|
|
6043
|
+
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", { ...params, sessionId }),
|
|
5997
6044
|
/**
|
|
5998
6045
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
5999
6046
|
*
|
|
@@ -6001,7 +6048,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6001
6048
|
*
|
|
6002
6049
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
6003
6050
|
*/
|
|
6004
|
-
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", {
|
|
6051
|
+
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", { ...params, sessionId })
|
|
6005
6052
|
},
|
|
6006
6053
|
/** @experimental */
|
|
6007
6054
|
headers: {
|
|
@@ -6012,7 +6059,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6012
6059
|
*
|
|
6013
6060
|
* @returns Indicates whether the pending MCP headers refresh response was accepted.
|
|
6014
6061
|
*/
|
|
6015
|
-
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", {
|
|
6062
|
+
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", { ...params, sessionId })
|
|
6016
6063
|
},
|
|
6017
6064
|
/** @experimental */
|
|
6018
6065
|
apps: {
|
|
@@ -6023,7 +6070,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6023
6070
|
*
|
|
6024
6071
|
* @returns Resource contents returned by the MCP server.
|
|
6025
6072
|
*/
|
|
6026
|
-
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", {
|
|
6073
|
+
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", { ...params, sessionId }),
|
|
6027
6074
|
/**
|
|
6028
6075
|
* 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"`.
|
|
6029
6076
|
*
|
|
@@ -6031,7 +6078,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6031
6078
|
*
|
|
6032
6079
|
* @returns App-callable tools from the named MCP server.
|
|
6033
6080
|
*/
|
|
6034
|
-
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", {
|
|
6081
|
+
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", { ...params, sessionId }),
|
|
6035
6082
|
/**
|
|
6036
6083
|
* 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`.
|
|
6037
6084
|
*
|
|
@@ -6039,13 +6086,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6039
6086
|
*
|
|
6040
6087
|
* @returns Standard MCP CallToolResult
|
|
6041
6088
|
*/
|
|
6042
|
-
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", {
|
|
6089
|
+
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", { ...params, sessionId }),
|
|
6043
6090
|
/**
|
|
6044
6091
|
* 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.
|
|
6045
6092
|
*
|
|
6046
6093
|
* @param params Host context to advertise to MCP App guests.
|
|
6047
6094
|
*/
|
|
6048
|
-
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", {
|
|
6095
|
+
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", { ...params, sessionId }),
|
|
6049
6096
|
/**
|
|
6050
6097
|
* Read the current host context advertised to MCP App guests.
|
|
6051
6098
|
*
|
|
@@ -6059,7 +6106,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6059
6106
|
*
|
|
6060
6107
|
* @returns Diagnostic snapshot of MCP Apps wiring for the named server.
|
|
6061
6108
|
*/
|
|
6062
|
-
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", {
|
|
6109
|
+
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", { ...params, sessionId })
|
|
6063
6110
|
},
|
|
6064
6111
|
/** @experimental */
|
|
6065
6112
|
resources: {
|
|
@@ -6070,7 +6117,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6070
6117
|
*
|
|
6071
6118
|
* @returns Resource contents returned by the MCP server.
|
|
6072
6119
|
*/
|
|
6073
|
-
read: async (params) => connection.sendRequest("session.mcp.resources.read", {
|
|
6120
|
+
read: async (params) => connection.sendRequest("session.mcp.resources.read", { ...params, sessionId }),
|
|
6074
6121
|
/**
|
|
6075
6122
|
* Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
6076
6123
|
*
|
|
@@ -6078,7 +6125,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6078
6125
|
*
|
|
6079
6126
|
* @returns One page of resources advertised by the named MCP server.
|
|
6080
6127
|
*/
|
|
6081
|
-
list: async (params) => connection.sendRequest("session.mcp.resources.list", {
|
|
6128
|
+
list: async (params) => connection.sendRequest("session.mcp.resources.list", { ...params, sessionId }),
|
|
6082
6129
|
/**
|
|
6083
6130
|
* 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`.
|
|
6084
6131
|
*
|
|
@@ -6086,7 +6133,26 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6086
6133
|
*
|
|
6087
6134
|
* @returns One page of resource templates advertised by the named MCP server.
|
|
6088
6135
|
*/
|
|
6089
|
-
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", {
|
|
6136
|
+
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", { ...params, sessionId })
|
|
6137
|
+
},
|
|
6138
|
+
/** @experimental */
|
|
6139
|
+
prompts: {
|
|
6140
|
+
/**
|
|
6141
|
+
* Enumerate one page of prompts a connected MCP server exposes (proxies MCP `prompts/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
6142
|
+
*
|
|
6143
|
+
* @param params MCP server whose prompts to enumerate.
|
|
6144
|
+
*
|
|
6145
|
+
* @returns One page of prompts advertised by the named MCP server.
|
|
6146
|
+
*/
|
|
6147
|
+
list: async (params) => connection.sendRequest("session.mcp.prompts.list", { ...params, sessionId }),
|
|
6148
|
+
/**
|
|
6149
|
+
* 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.
|
|
6150
|
+
*
|
|
6151
|
+
* @param params MCP server, prompt name, and optional string-valued arguments.
|
|
6152
|
+
*
|
|
6153
|
+
* @returns Prompt messages returned by the MCP server without sending them to the model.
|
|
6154
|
+
*/
|
|
6155
|
+
get: async (params) => connection.sendRequest("session.mcp.prompts.get", { ...params, sessionId })
|
|
6090
6156
|
}
|
|
6091
6157
|
},
|
|
6092
6158
|
/** @experimental */
|
|
@@ -6098,7 +6164,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6098
6164
|
*
|
|
6099
6165
|
* @returns Per-source session diagnostics configuration.
|
|
6100
6166
|
*/
|
|
6101
|
-
configure: async (params) => connection.sendRequest("session.diagnostics.configure", {
|
|
6167
|
+
configure: async (params) => connection.sendRequest("session.diagnostics.configure", { ...params, sessionId }),
|
|
6102
6168
|
/**
|
|
6103
6169
|
* 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.
|
|
6104
6170
|
*
|
|
@@ -6106,7 +6172,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6106
6172
|
*
|
|
6107
6173
|
* @returns One cursor-addressed page of retained session diagnostics.
|
|
6108
6174
|
*/
|
|
6109
|
-
read: async (params) => connection.sendRequest("session.diagnostics.read", {
|
|
6175
|
+
read: async (params) => connection.sendRequest("session.diagnostics.read", { ...params, sessionId })
|
|
6110
6176
|
},
|
|
6111
6177
|
/** @experimental */
|
|
6112
6178
|
connectors: {
|
|
@@ -6116,6 +6182,12 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6116
6182
|
* @returns Feature detection and hard polling limits for the EXPERIMENTAL session connector API.
|
|
6117
6183
|
*/
|
|
6118
6184
|
getCapabilities: async () => connection.sendRequest("session.connectors.getCapabilities", { sessionId }),
|
|
6185
|
+
/**
|
|
6186
|
+
* Returns the session account selection, or null.
|
|
6187
|
+
*
|
|
6188
|
+
* @returns Session account selection, or null.
|
|
6189
|
+
*/
|
|
6190
|
+
getAccount: async () => connection.sendRequest("session.connectors.getAccount", { sessionId }),
|
|
6119
6191
|
/**
|
|
6120
6192
|
* Returns authoritative session Connector state from current availability, pinned account selection, cached catalog, and live MCP projection without performing a Connector service request.
|
|
6121
6193
|
*
|
|
@@ -6129,7 +6201,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6129
6201
|
*
|
|
6130
6202
|
* @returns Validated Connector catalog snapshot cached by the session.
|
|
6131
6203
|
*/
|
|
6132
|
-
list: async (params) => connection.sendRequest("session.connectors.list", {
|
|
6204
|
+
list: async (params) => connection.sendRequest("session.connectors.list", { ...params, sessionId }),
|
|
6133
6205
|
/**
|
|
6134
6206
|
* Refreshes and validates the Connector catalog for the pinned opaque account selection.
|
|
6135
6207
|
*
|
|
@@ -6137,7 +6209,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6137
6209
|
*
|
|
6138
6210
|
* @returns Validated Connector catalog snapshot cached by the session.
|
|
6139
6211
|
*/
|
|
6140
|
-
refresh: async (params) => connection.sendRequest("session.connectors.refresh", {
|
|
6212
|
+
refresh: async (params) => connection.sendRequest("session.connectors.refresh", { ...params, sessionId }),
|
|
6141
6213
|
/**
|
|
6142
6214
|
* 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.
|
|
6143
6215
|
*
|
|
@@ -6145,7 +6217,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6145
6217
|
*
|
|
6146
6218
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
6147
6219
|
*/
|
|
6148
|
-
connect: async (params) => connection.sendRequest("session.connectors.connect", {
|
|
6220
|
+
connect: async (params) => connection.sendRequest("session.connectors.connect", { ...params, sessionId }),
|
|
6149
6221
|
/**
|
|
6150
6222
|
* Re-initiates an idempotent Connector connection request without browser or UI effects, with the same typed outcomes as connect.
|
|
6151
6223
|
*
|
|
@@ -6153,7 +6225,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6153
6225
|
*
|
|
6154
6226
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
6155
6227
|
*/
|
|
6156
|
-
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", {
|
|
6228
|
+
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", { ...params, sessionId }),
|
|
6157
6229
|
/**
|
|
6158
6230
|
* Continues a pending Connector connection with caller-supplied attempt, interval, and deadline bounds. The runtime never opens the returned consent URL.
|
|
6159
6231
|
*
|
|
@@ -6161,7 +6233,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6161
6233
|
*
|
|
6162
6234
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
6163
6235
|
*/
|
|
6164
|
-
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", {
|
|
6236
|
+
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", { ...params, sessionId }),
|
|
6165
6237
|
/**
|
|
6166
6238
|
* Disconnects one Connector for the pinned opaque account selection, refreshes the authoritative catalog, and removes its session-owned MCP projection.
|
|
6167
6239
|
*
|
|
@@ -6169,7 +6241,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6169
6241
|
*
|
|
6170
6242
|
* @returns Authoritative result after disconnect and MCP reconciliation.
|
|
6171
6243
|
*/
|
|
6172
|
-
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", {
|
|
6244
|
+
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", { ...params, sessionId }),
|
|
6173
6245
|
/**
|
|
6174
6246
|
* Reconciles the authoritative cached or freshly requested Connector catalog into the session Connector MCP projection and returns live status.
|
|
6175
6247
|
*
|
|
@@ -6177,14 +6249,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6177
6249
|
*
|
|
6178
6250
|
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
6179
6251
|
*/
|
|
6180
|
-
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", {
|
|
6252
|
+
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", { ...params, sessionId })
|
|
6181
6253
|
},
|
|
6182
6254
|
/** @experimental */
|
|
6183
6255
|
managedSettings: {
|
|
6184
6256
|
/**
|
|
6185
6257
|
* 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.
|
|
6186
6258
|
*
|
|
6187
|
-
* @returns
|
|
6259
|
+
* @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.
|
|
6188
6260
|
*/
|
|
6189
6261
|
get: async () => connection.sendRequest("session.managedSettings.get", { sessionId })
|
|
6190
6262
|
},
|
|
@@ -6203,13 +6275,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6203
6275
|
*
|
|
6204
6276
|
* @returns Result of installing a plugin.
|
|
6205
6277
|
*/
|
|
6206
|
-
install: async (params) => connection.sendRequest("session.plugins.install", {
|
|
6278
|
+
install: async (params) => connection.sendRequest("session.plugins.install", { ...params, sessionId }),
|
|
6207
6279
|
/**
|
|
6208
6280
|
* Uninstalls a plugin when permitted by the live session's retained managed policy.
|
|
6209
6281
|
*
|
|
6210
6282
|
* @param params Name (or spec) of the plugin to uninstall.
|
|
6211
6283
|
*/
|
|
6212
|
-
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", {
|
|
6284
|
+
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { ...params, sessionId }),
|
|
6213
6285
|
/**
|
|
6214
6286
|
* Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
6215
6287
|
*
|
|
@@ -6217,19 +6289,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6217
6289
|
*
|
|
6218
6290
|
* @returns Result of updating a single plugin.
|
|
6219
6291
|
*/
|
|
6220
|
-
update: async (params) => connection.sendRequest("session.plugins.update", {
|
|
6292
|
+
update: async (params) => connection.sendRequest("session.plugins.update", { ...params, sessionId }),
|
|
6221
6293
|
/**
|
|
6222
6294
|
* Enables installed plugins when permitted by the live session's retained managed policy.
|
|
6223
6295
|
*
|
|
6224
6296
|
* @param params Plugin names (or specs) to enable in the session's authoritative working directory.
|
|
6225
6297
|
*/
|
|
6226
|
-
enable: async (params) => connection.sendRequest("session.plugins.enable", {
|
|
6298
|
+
enable: async (params) => connection.sendRequest("session.plugins.enable", { ...params, sessionId }),
|
|
6227
6299
|
/**
|
|
6228
6300
|
* Disables installed plugins when permitted by the live session's retained managed policy.
|
|
6229
6301
|
*
|
|
6230
6302
|
* @param params Plugin names (or specs) to disable in the session's authoritative working directory.
|
|
6231
6303
|
*/
|
|
6232
|
-
disable: async (params) => connection.sendRequest("session.plugins.disable", {
|
|
6304
|
+
disable: async (params) => connection.sendRequest("session.plugins.disable", { ...params, sessionId }),
|
|
6233
6305
|
/** @experimental */
|
|
6234
6306
|
marketplaces: {
|
|
6235
6307
|
/**
|
|
@@ -6245,7 +6317,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6245
6317
|
*
|
|
6246
6318
|
* @returns Result of registering a new marketplace.
|
|
6247
6319
|
*/
|
|
6248
|
-
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", {
|
|
6320
|
+
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { ...params, sessionId }),
|
|
6249
6321
|
/**
|
|
6250
6322
|
* Removes a marketplace when permitted by the live session's retained managed policy.
|
|
6251
6323
|
*
|
|
@@ -6253,7 +6325,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6253
6325
|
*
|
|
6254
6326
|
* @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
|
|
6255
6327
|
*/
|
|
6256
|
-
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", {
|
|
6328
|
+
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { ...params, sessionId }),
|
|
6257
6329
|
/**
|
|
6258
6330
|
* Browses a marketplace resolved through the live session's working directory and retained managed policy.
|
|
6259
6331
|
*
|
|
@@ -6261,7 +6333,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6261
6333
|
*
|
|
6262
6334
|
* @returns Plugins advertised by the marketplace.
|
|
6263
6335
|
*/
|
|
6264
|
-
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", {
|
|
6336
|
+
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { ...params, sessionId }),
|
|
6265
6337
|
/**
|
|
6266
6338
|
* Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
|
|
6267
6339
|
*
|
|
@@ -6269,14 +6341,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6269
6341
|
*
|
|
6270
6342
|
* @returns Result of refreshing one or more marketplace catalogs.
|
|
6271
6343
|
*/
|
|
6272
|
-
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", {
|
|
6344
|
+
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { ...params, sessionId })
|
|
6273
6345
|
},
|
|
6274
6346
|
/**
|
|
6275
6347
|
* 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.
|
|
6276
6348
|
*
|
|
6277
6349
|
* @param params Optional flags controlling which side effects the reload performs.
|
|
6278
6350
|
*/
|
|
6279
|
-
reload: async (params) => connection.sendRequest("session.plugins.reload", {
|
|
6351
|
+
reload: async (params) => connection.sendRequest("session.plugins.reload", { ...params, sessionId })
|
|
6280
6352
|
},
|
|
6281
6353
|
/** @experimental */
|
|
6282
6354
|
provider: {
|
|
@@ -6287,7 +6359,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6287
6359
|
*
|
|
6288
6360
|
* @returns A snapshot of the provider endpoint the session is currently configured to talk to.
|
|
6289
6361
|
*/
|
|
6290
|
-
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", {
|
|
6362
|
+
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", { ...params, sessionId }),
|
|
6291
6363
|
/**
|
|
6292
6364
|
* 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.
|
|
6293
6365
|
*
|
|
@@ -6295,7 +6367,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6295
6367
|
*
|
|
6296
6368
|
* @returns The selectable model entries synthesized for the models added by this call.
|
|
6297
6369
|
*/
|
|
6298
|
-
add: async (params) => connection.sendRequest("session.provider.add", {
|
|
6370
|
+
add: async (params) => connection.sendRequest("session.provider.add", { ...params, sessionId }),
|
|
6299
6371
|
/**
|
|
6300
6372
|
* 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.
|
|
6301
6373
|
*
|
|
@@ -6303,7 +6375,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6303
6375
|
*
|
|
6304
6376
|
* @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
|
|
6305
6377
|
*/
|
|
6306
|
-
sync: async (params) => connection.sendRequest("session.provider.sync", {
|
|
6378
|
+
sync: async (params) => connection.sendRequest("session.provider.sync", { ...params, sessionId }),
|
|
6307
6379
|
/**
|
|
6308
6380
|
* 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.
|
|
6309
6381
|
*
|
|
@@ -6311,7 +6383,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6311
6383
|
*
|
|
6312
6384
|
* @returns What the withdrawal actually removed from the registry.
|
|
6313
6385
|
*/
|
|
6314
|
-
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", {
|
|
6386
|
+
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", { ...params, sessionId })
|
|
6315
6387
|
},
|
|
6316
6388
|
/** @experimental */
|
|
6317
6389
|
options: {
|
|
@@ -6322,7 +6394,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6322
6394
|
*
|
|
6323
6395
|
* @returns Indicates whether the session options patch was applied successfully.
|
|
6324
6396
|
*/
|
|
6325
|
-
update: async (params) => connection.sendRequest("session.options.update", {
|
|
6397
|
+
update: async (params) => connection.sendRequest("session.options.update", { ...params, sessionId })
|
|
6326
6398
|
},
|
|
6327
6399
|
/** @experimental */
|
|
6328
6400
|
lsp: {
|
|
@@ -6331,7 +6403,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6331
6403
|
*
|
|
6332
6404
|
* @param params Parameters for (re)loading the merged LSP configuration set.
|
|
6333
6405
|
*/
|
|
6334
|
-
initialize: async (params) => connection.sendRequest("session.lsp.initialize", {
|
|
6406
|
+
initialize: async (params) => connection.sendRequest("session.lsp.initialize", { ...params, sessionId })
|
|
6335
6407
|
},
|
|
6336
6408
|
/** @experimental */
|
|
6337
6409
|
extensions: {
|
|
@@ -6346,13 +6418,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6346
6418
|
*
|
|
6347
6419
|
* @param params Source-qualified extension identifier to enable for the session.
|
|
6348
6420
|
*/
|
|
6349
|
-
enable: async (params) => connection.sendRequest("session.extensions.enable", {
|
|
6421
|
+
enable: async (params) => connection.sendRequest("session.extensions.enable", { ...params, sessionId }),
|
|
6350
6422
|
/**
|
|
6351
6423
|
* Disables an extension for the session.
|
|
6352
6424
|
*
|
|
6353
6425
|
* @param params Source-qualified extension identifier to disable for the session.
|
|
6354
6426
|
*/
|
|
6355
|
-
disable: async (params) => connection.sendRequest("session.extensions.disable", {
|
|
6427
|
+
disable: async (params) => connection.sendRequest("session.extensions.disable", { ...params, sessionId }),
|
|
6356
6428
|
/**
|
|
6357
6429
|
* Reloads extension definitions and processes for the session.
|
|
6358
6430
|
*/
|
|
@@ -6362,7 +6434,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6362
6434
|
*
|
|
6363
6435
|
* @param params Parameters for session.extensions.sendAttachmentsToMessage.
|
|
6364
6436
|
*/
|
|
6365
|
-
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", {
|
|
6437
|
+
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", { ...params, sessionId })
|
|
6366
6438
|
},
|
|
6367
6439
|
/** @experimental */
|
|
6368
6440
|
tools: {
|
|
@@ -6373,7 +6445,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6373
6445
|
*
|
|
6374
6446
|
* @returns Canonical result returned by a session tool.
|
|
6375
6447
|
*/
|
|
6376
|
-
execute: async (params) => connection.sendRequest("session.tools.execute", {
|
|
6448
|
+
execute: async (params) => connection.sendRequest("session.tools.execute", { ...params, sessionId }),
|
|
6377
6449
|
/**
|
|
6378
6450
|
* Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.
|
|
6379
6451
|
*
|
|
@@ -6381,7 +6453,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6381
6453
|
*
|
|
6382
6454
|
* @returns Rust-owned built-in tool descriptors for the session.
|
|
6383
6455
|
*/
|
|
6384
|
-
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", {
|
|
6456
|
+
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", { ...params, sessionId }),
|
|
6385
6457
|
/**
|
|
6386
6458
|
* Projects a completed task_complete tool call into its label-safe session event payload.
|
|
6387
6459
|
*
|
|
@@ -6389,7 +6461,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6389
6461
|
*
|
|
6390
6462
|
* @returns Task completion notification with summary from the agent
|
|
6391
6463
|
*/
|
|
6392
|
-
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", {
|
|
6464
|
+
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", { ...params, sessionId }),
|
|
6393
6465
|
/**
|
|
6394
6466
|
* Provides the result for a pending external tool call.
|
|
6395
6467
|
*
|
|
@@ -6397,7 +6469,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6397
6469
|
*
|
|
6398
6470
|
* @returns Indicates whether the external tool call result was handled successfully.
|
|
6399
6471
|
*/
|
|
6400
|
-
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", {
|
|
6472
|
+
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", { ...params, sessionId }),
|
|
6401
6473
|
/**
|
|
6402
6474
|
* Resolves, builds, and validates the runtime tool list for the session.
|
|
6403
6475
|
*
|
|
@@ -6417,7 +6489,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6417
6489
|
*
|
|
6418
6490
|
* @returns Empty result after replacing the calling connection's externally implemented tools.
|
|
6419
6491
|
*/
|
|
6420
|
-
set: async (params) => connection.sendRequest("session.tools.set", {
|
|
6492
|
+
set: async (params) => connection.sendRequest("session.tools.set", { ...params, sessionId }),
|
|
6421
6493
|
/**
|
|
6422
6494
|
* 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.
|
|
6423
6495
|
*
|
|
@@ -6425,7 +6497,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6425
6497
|
*
|
|
6426
6498
|
* @returns Empty result after applying subagent settings
|
|
6427
6499
|
*/
|
|
6428
|
-
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", {
|
|
6500
|
+
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", { ...params, sessionId })
|
|
6429
6501
|
},
|
|
6430
6502
|
/** @experimental */
|
|
6431
6503
|
commands: {
|
|
@@ -6436,7 +6508,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6436
6508
|
*
|
|
6437
6509
|
* @returns Slash commands available in the session, after applying any include/exclude filters.
|
|
6438
6510
|
*/
|
|
6439
|
-
list: async (params) => connection.sendRequest("session.commands.list", {
|
|
6511
|
+
list: async (params) => connection.sendRequest("session.commands.list", { ...params, sessionId }),
|
|
6440
6512
|
/**
|
|
6441
6513
|
* Invokes a slash command in the session.
|
|
6442
6514
|
*
|
|
@@ -6444,7 +6516,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6444
6516
|
*
|
|
6445
6517
|
* @returns Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
|
|
6446
6518
|
*/
|
|
6447
|
-
invoke: async (params) => connection.sendRequest("session.commands.invoke", {
|
|
6519
|
+
invoke: async (params) => connection.sendRequest("session.commands.invoke", { ...params, sessionId }),
|
|
6448
6520
|
/**
|
|
6449
6521
|
* Reports completion of a pending client-handled slash command.
|
|
6450
6522
|
*
|
|
@@ -6452,7 +6524,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6452
6524
|
*
|
|
6453
6525
|
* @returns Indicates whether the pending client-handled command was completed successfully.
|
|
6454
6526
|
*/
|
|
6455
|
-
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", {
|
|
6527
|
+
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", { ...params, sessionId }),
|
|
6456
6528
|
/**
|
|
6457
6529
|
* Executes a slash command synchronously and returns any error.
|
|
6458
6530
|
*
|
|
@@ -6460,7 +6532,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6460
6532
|
*
|
|
6461
6533
|
* @returns Error message produced while executing the command, if any.
|
|
6462
6534
|
*/
|
|
6463
|
-
execute: async (params) => connection.sendRequest("session.commands.execute", {
|
|
6535
|
+
execute: async (params) => connection.sendRequest("session.commands.execute", { ...params, sessionId }),
|
|
6464
6536
|
/**
|
|
6465
6537
|
* Enqueues a slash command for FIFO processing on the local session.
|
|
6466
6538
|
*
|
|
@@ -6468,7 +6540,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6468
6540
|
*
|
|
6469
6541
|
* @returns Indicates whether the command was accepted into the local execution queue.
|
|
6470
6542
|
*/
|
|
6471
|
-
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", {
|
|
6543
|
+
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", { ...params, sessionId }),
|
|
6472
6544
|
/**
|
|
6473
6545
|
* Reports whether the host actually executed a queued command and whether to continue processing.
|
|
6474
6546
|
*
|
|
@@ -6476,7 +6548,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6476
6548
|
*
|
|
6477
6549
|
* @returns Indicates whether the queued-command response was matched to a pending request.
|
|
6478
6550
|
*/
|
|
6479
|
-
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", {
|
|
6551
|
+
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", { ...params, sessionId })
|
|
6480
6552
|
},
|
|
6481
6553
|
/** @experimental */
|
|
6482
6554
|
telemetry: {
|
|
@@ -6491,7 +6563,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6491
6563
|
*
|
|
6492
6564
|
* @param params Feature override key/value pairs to attach to subsequent telemetry events from this session.
|
|
6493
6565
|
*/
|
|
6494
|
-
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", {
|
|
6566
|
+
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", { ...params, sessionId })
|
|
6495
6567
|
},
|
|
6496
6568
|
/** @experimental */
|
|
6497
6569
|
ui: {
|
|
@@ -6502,7 +6574,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6502
6574
|
*
|
|
6503
6575
|
* @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.
|
|
6504
6576
|
*/
|
|
6505
|
-
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", {
|
|
6577
|
+
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", { ...params, sessionId }),
|
|
6506
6578
|
/**
|
|
6507
6579
|
* Requests structured input from a UI-capable client.
|
|
6508
6580
|
*
|
|
@@ -6510,7 +6582,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6510
6582
|
*
|
|
6511
6583
|
* @returns The elicitation response (accept with form values, decline, or cancel)
|
|
6512
6584
|
*/
|
|
6513
|
-
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", {
|
|
6585
|
+
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", { ...params, sessionId }),
|
|
6514
6586
|
/**
|
|
6515
6587
|
* Provides the user response for a pending elicitation request.
|
|
6516
6588
|
*
|
|
@@ -6518,7 +6590,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6518
6590
|
*
|
|
6519
6591
|
* @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
|
|
6520
6592
|
*/
|
|
6521
|
-
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", {
|
|
6593
|
+
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", { ...params, sessionId }),
|
|
6522
6594
|
/**
|
|
6523
6595
|
* Resolves a pending `user_input.requested` event with the user's response.
|
|
6524
6596
|
*
|
|
@@ -6526,7 +6598,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6526
6598
|
*
|
|
6527
6599
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
6528
6600
|
*/
|
|
6529
|
-
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", {
|
|
6601
|
+
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", { ...params, sessionId }),
|
|
6530
6602
|
/**
|
|
6531
6603
|
* Resolves a pending `sampling.requested` event with a sampling result, or rejects it.
|
|
6532
6604
|
*
|
|
@@ -6534,7 +6606,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6534
6606
|
*
|
|
6535
6607
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
6536
6608
|
*/
|
|
6537
|
-
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", {
|
|
6609
|
+
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", { ...params, sessionId }),
|
|
6538
6610
|
/**
|
|
6539
6611
|
* Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision.
|
|
6540
6612
|
*
|
|
@@ -6542,7 +6614,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6542
6614
|
*
|
|
6543
6615
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
6544
6616
|
*/
|
|
6545
|
-
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", {
|
|
6617
|
+
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { ...params, sessionId }),
|
|
6546
6618
|
/**
|
|
6547
6619
|
* Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action.
|
|
6548
6620
|
*
|
|
@@ -6550,7 +6622,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6550
6622
|
*
|
|
6551
6623
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
6552
6624
|
*/
|
|
6553
|
-
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", {
|
|
6625
|
+
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { ...params, sessionId }),
|
|
6554
6626
|
/**
|
|
6555
6627
|
* Resolves a pending `exit_plan_mode.requested` event with the user's response.
|
|
6556
6628
|
*
|
|
@@ -6558,7 +6630,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6558
6630
|
*
|
|
6559
6631
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
6560
6632
|
*/
|
|
6561
|
-
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", {
|
|
6633
|
+
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", { ...params, sessionId }),
|
|
6562
6634
|
/**
|
|
6563
6635
|
* Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.
|
|
6564
6636
|
*
|
|
@@ -6572,7 +6644,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6572
6644
|
*
|
|
6573
6645
|
* @returns Indicates whether the handle was active and the registration count was decremented.
|
|
6574
6646
|
*/
|
|
6575
|
-
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", {
|
|
6647
|
+
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", { ...params, sessionId })
|
|
6576
6648
|
},
|
|
6577
6649
|
/** @experimental */
|
|
6578
6650
|
permissions: {
|
|
@@ -6583,7 +6655,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6583
6655
|
*
|
|
6584
6656
|
* @returns Indicates whether the operation succeeded.
|
|
6585
6657
|
*/
|
|
6586
|
-
configure: async (params) => connection.sendRequest("session.permissions.configure", {
|
|
6658
|
+
configure: async (params) => connection.sendRequest("session.permissions.configure", { ...params, sessionId }),
|
|
6587
6659
|
/**
|
|
6588
6660
|
* Provides a decision for a pending tool permission request.
|
|
6589
6661
|
*
|
|
@@ -6591,7 +6663,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6591
6663
|
*
|
|
6592
6664
|
* @returns Indicates whether the permission decision was applied; false when the request was already resolved.
|
|
6593
6665
|
*/
|
|
6594
|
-
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", {
|
|
6666
|
+
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { ...params, sessionId }),
|
|
6595
6667
|
/**
|
|
6596
6668
|
* Reconstructs the set of pending tool permission requests from the session's event history.
|
|
6597
6669
|
*
|
|
@@ -6605,7 +6677,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6605
6677
|
*
|
|
6606
6678
|
* @returns Indicates whether the operation succeeded.
|
|
6607
6679
|
*/
|
|
6608
|
-
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", {
|
|
6680
|
+
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { ...params, sessionId }),
|
|
6609
6681
|
/**
|
|
6610
6682
|
* 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.
|
|
6611
6683
|
*
|
|
@@ -6613,7 +6685,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6613
6685
|
*
|
|
6614
6686
|
* @returns Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.
|
|
6615
6687
|
*/
|
|
6616
|
-
setMode: async (params) => connection.sendRequest("session.permissions.setMode", {
|
|
6688
|
+
setMode: async (params) => connection.sendRequest("session.permissions.setMode", { ...params, sessionId }),
|
|
6617
6689
|
/**
|
|
6618
6690
|
* Returns the current permission mode for the session.
|
|
6619
6691
|
*
|
|
@@ -6627,7 +6699,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6627
6699
|
*
|
|
6628
6700
|
* @returns Indicates whether the operation succeeded.
|
|
6629
6701
|
*/
|
|
6630
|
-
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", {
|
|
6702
|
+
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", { ...params, sessionId }),
|
|
6631
6703
|
/**
|
|
6632
6704
|
* Sets whether the client wants permission prompts bridged into session events.
|
|
6633
6705
|
*
|
|
@@ -6635,7 +6707,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6635
6707
|
*
|
|
6636
6708
|
* @returns Indicates whether the operation succeeded.
|
|
6637
6709
|
*/
|
|
6638
|
-
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", {
|
|
6710
|
+
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", { ...params, sessionId }),
|
|
6639
6711
|
/**
|
|
6640
6712
|
* Clears session-scoped tool approvals and, for full resets, exact session-approved paths.
|
|
6641
6713
|
*
|
|
@@ -6643,7 +6715,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6643
6715
|
*
|
|
6644
6716
|
* @returns Indicates whether the operation succeeded.
|
|
6645
6717
|
*/
|
|
6646
|
-
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", {
|
|
6718
|
+
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", { ...params, sessionId }),
|
|
6647
6719
|
/**
|
|
6648
6720
|
* Notifies the runtime that a permission prompt UI has been shown to the user.
|
|
6649
6721
|
*
|
|
@@ -6651,7 +6723,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6651
6723
|
*
|
|
6652
6724
|
* @returns Indicates whether the operation succeeded.
|
|
6653
6725
|
*/
|
|
6654
|
-
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", {
|
|
6726
|
+
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", { ...params, sessionId }),
|
|
6655
6727
|
/** @experimental */
|
|
6656
6728
|
paths: {
|
|
6657
6729
|
/**
|
|
@@ -6667,7 +6739,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6667
6739
|
*
|
|
6668
6740
|
* @returns Indicates whether the operation succeeded.
|
|
6669
6741
|
*/
|
|
6670
|
-
add: async (params) => connection.sendRequest("session.permissions.paths.add", {
|
|
6742
|
+
add: async (params) => connection.sendRequest("session.permissions.paths.add", { ...params, sessionId }),
|
|
6671
6743
|
/**
|
|
6672
6744
|
* Updates the session's primary working directory used by the permission policy.
|
|
6673
6745
|
*
|
|
@@ -6675,7 +6747,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6675
6747
|
*
|
|
6676
6748
|
* @returns Indicates whether the operation succeeded.
|
|
6677
6749
|
*/
|
|
6678
|
-
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", {
|
|
6750
|
+
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", { ...params, sessionId }),
|
|
6679
6751
|
/**
|
|
6680
6752
|
* Reports whether a path falls within any of the session's allowed directories.
|
|
6681
6753
|
*
|
|
@@ -6683,7 +6755,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6683
6755
|
*
|
|
6684
6756
|
* @returns Indicates whether the supplied path is within the session's allowed directories.
|
|
6685
6757
|
*/
|
|
6686
|
-
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", {
|
|
6758
|
+
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", { ...params, sessionId }),
|
|
6687
6759
|
/**
|
|
6688
6760
|
* Reports whether a path falls within the session's workspace (primary) directory.
|
|
6689
6761
|
*
|
|
@@ -6691,7 +6763,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6691
6763
|
*
|
|
6692
6764
|
* @returns Indicates whether the supplied path is within the session's workspace directory.
|
|
6693
6765
|
*/
|
|
6694
|
-
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", {
|
|
6766
|
+
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", { ...params, sessionId })
|
|
6695
6767
|
},
|
|
6696
6768
|
/** @experimental */
|
|
6697
6769
|
locations: {
|
|
@@ -6702,7 +6774,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6702
6774
|
*
|
|
6703
6775
|
* @returns Resolved location-permissions key and type.
|
|
6704
6776
|
*/
|
|
6705
|
-
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", {
|
|
6777
|
+
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", { ...params, sessionId }),
|
|
6706
6778
|
/**
|
|
6707
6779
|
* Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service.
|
|
6708
6780
|
*
|
|
@@ -6710,7 +6782,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6710
6782
|
*
|
|
6711
6783
|
* @returns Summary of persisted location permissions applied to the session.
|
|
6712
6784
|
*/
|
|
6713
|
-
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", {
|
|
6785
|
+
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", { ...params, sessionId }),
|
|
6714
6786
|
/**
|
|
6715
6787
|
* Persists a tool approval for a permission location and applies its rules to this session's live permission service.
|
|
6716
6788
|
*
|
|
@@ -6718,7 +6790,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6718
6790
|
*
|
|
6719
6791
|
* @returns Indicates whether the operation succeeded.
|
|
6720
6792
|
*/
|
|
6721
|
-
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", {
|
|
6793
|
+
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", { ...params, sessionId })
|
|
6722
6794
|
},
|
|
6723
6795
|
/** @experimental */
|
|
6724
6796
|
folderTrust: {
|
|
@@ -6729,7 +6801,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6729
6801
|
*
|
|
6730
6802
|
* @returns Folder trust check result.
|
|
6731
6803
|
*/
|
|
6732
|
-
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", {
|
|
6804
|
+
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", { ...params, sessionId }),
|
|
6733
6805
|
/**
|
|
6734
6806
|
* Adds a folder to the user's trusted folders list.
|
|
6735
6807
|
*
|
|
@@ -6737,7 +6809,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6737
6809
|
*
|
|
6738
6810
|
* @returns Indicates whether the operation succeeded.
|
|
6739
6811
|
*/
|
|
6740
|
-
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", {
|
|
6812
|
+
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", { ...params, sessionId })
|
|
6741
6813
|
},
|
|
6742
6814
|
/** @experimental */
|
|
6743
6815
|
urls: {
|
|
@@ -6748,7 +6820,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6748
6820
|
*
|
|
6749
6821
|
* @returns Indicates whether the operation succeeded.
|
|
6750
6822
|
*/
|
|
6751
|
-
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", {
|
|
6823
|
+
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", { ...params, sessionId })
|
|
6752
6824
|
}
|
|
6753
6825
|
},
|
|
6754
6826
|
/**
|
|
@@ -6760,7 +6832,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6760
6832
|
*
|
|
6761
6833
|
* @experimental
|
|
6762
6834
|
*/
|
|
6763
|
-
log: async (params) => connection.sendRequest("session.log", {
|
|
6835
|
+
log: async (params) => connection.sendRequest("session.log", { ...params, sessionId }),
|
|
6764
6836
|
/** @experimental */
|
|
6765
6837
|
metadata: {
|
|
6766
6838
|
/**
|
|
@@ -6782,7 +6854,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6782
6854
|
*
|
|
6783
6855
|
* @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.
|
|
6784
6856
|
*/
|
|
6785
|
-
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", {
|
|
6857
|
+
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", { ...params, sessionId }),
|
|
6786
6858
|
/**
|
|
6787
6859
|
* Reports whether the local session is currently processing user/agent messages.
|
|
6788
6860
|
*
|
|
@@ -6802,7 +6874,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6802
6874
|
*
|
|
6803
6875
|
* @returns Token breakdown for the session's current context window, or null if uninitialized.
|
|
6804
6876
|
*/
|
|
6805
|
-
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", {
|
|
6877
|
+
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", { ...params, sessionId }),
|
|
6806
6878
|
/**
|
|
6807
6879
|
* 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.
|
|
6808
6880
|
*
|
|
@@ -6816,7 +6888,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6816
6888
|
*
|
|
6817
6889
|
* @returns The heaviest individual messages in the session's context window, most-expensive first.
|
|
6818
6890
|
*/
|
|
6819
|
-
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", {
|
|
6891
|
+
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { ...params, sessionId }),
|
|
6820
6892
|
/**
|
|
6821
6893
|
* 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.
|
|
6822
6894
|
*
|
|
@@ -6824,7 +6896,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6824
6896
|
*
|
|
6825
6897
|
* @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.
|
|
6826
6898
|
*/
|
|
6827
|
-
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", {
|
|
6899
|
+
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", { ...params, sessionId }),
|
|
6828
6900
|
/**
|
|
6829
6901
|
* 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.
|
|
6830
6902
|
*
|
|
@@ -6832,7 +6904,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6832
6904
|
*
|
|
6833
6905
|
* @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.
|
|
6834
6906
|
*/
|
|
6835
|
-
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", {
|
|
6907
|
+
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", { ...params, sessionId }),
|
|
6836
6908
|
/**
|
|
6837
6909
|
* Re-tokenizes the session's existing messages against a model and returns aggregate token totals.
|
|
6838
6910
|
*
|
|
@@ -6840,7 +6912,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6840
6912
|
*
|
|
6841
6913
|
* @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.
|
|
6842
6914
|
*/
|
|
6843
|
-
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", {
|
|
6915
|
+
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", { ...params, sessionId })
|
|
6844
6916
|
},
|
|
6845
6917
|
/** @experimental */
|
|
6846
6918
|
contentExclusion: {
|
|
@@ -6851,18 +6923,18 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6851
6923
|
*
|
|
6852
6924
|
* @returns Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
|
|
6853
6925
|
*/
|
|
6854
|
-
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", {
|
|
6926
|
+
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", { ...params, sessionId })
|
|
6855
6927
|
},
|
|
6856
6928
|
/** @experimental */
|
|
6857
6929
|
shell: {
|
|
6858
6930
|
/**
|
|
6859
|
-
* Starts a shell command
|
|
6931
|
+
* 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.
|
|
6860
6932
|
*
|
|
6861
|
-
* @param params Shell command to run, with optional working directory and timeout in milliseconds.
|
|
6933
|
+
* @param params Shell command to run, with optional working directory and timeout in milliseconds. Spawn failures return an RPC error.
|
|
6862
6934
|
*
|
|
6863
|
-
* @returns Identifier of the spawned process,
|
|
6935
|
+
* @returns Identifier of the spawned shell process, usable with shell.kill while the process is running.
|
|
6864
6936
|
*/
|
|
6865
|
-
exec: async (params) => connection.sendRequest("session.shell.exec", {
|
|
6937
|
+
exec: async (params) => connection.sendRequest("session.shell.exec", { ...params, sessionId }),
|
|
6866
6938
|
/**
|
|
6867
6939
|
* 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.
|
|
6868
6940
|
*
|
|
@@ -6870,7 +6942,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6870
6942
|
*
|
|
6871
6943
|
* @returns Indicates whether the signal was delivered; false if the process was unknown or already exited.
|
|
6872
6944
|
*/
|
|
6873
|
-
kill: async (params) => connection.sendRequest("session.shell.kill", {
|
|
6945
|
+
kill: async (params) => connection.sendRequest("session.shell.kill", { ...params, sessionId }),
|
|
6874
6946
|
/**
|
|
6875
6947
|
* Executes a user-requested shell command through the session runtime.
|
|
6876
6948
|
*
|
|
@@ -6878,7 +6950,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6878
6950
|
*
|
|
6879
6951
|
* @returns Result of a user-requested shell command.
|
|
6880
6952
|
*/
|
|
6881
|
-
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", {
|
|
6953
|
+
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", { ...params, sessionId }),
|
|
6882
6954
|
/**
|
|
6883
6955
|
* Cancels a user-requested shell command by request ID.
|
|
6884
6956
|
*
|
|
@@ -6886,7 +6958,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6886
6958
|
*
|
|
6887
6959
|
* @returns Cancellation result for a user-requested shell command.
|
|
6888
6960
|
*/
|
|
6889
|
-
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", {
|
|
6961
|
+
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", { ...params, sessionId })
|
|
6890
6962
|
},
|
|
6891
6963
|
/** @experimental */
|
|
6892
6964
|
history: {
|
|
@@ -6897,7 +6969,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6897
6969
|
*
|
|
6898
6970
|
* @returns Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
|
|
6899
6971
|
*/
|
|
6900
|
-
compact: async (params) => connection.sendRequest("session.history.compact", {
|
|
6972
|
+
compact: async (params) => connection.sendRequest("session.history.compact", { ...params, sessionId }),
|
|
6901
6973
|
/**
|
|
6902
6974
|
* Truncates persisted session history to a specific event.
|
|
6903
6975
|
*
|
|
@@ -6905,7 +6977,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6905
6977
|
*
|
|
6906
6978
|
* @returns Number of events that were removed by the truncation.
|
|
6907
6979
|
*/
|
|
6908
|
-
truncate: async (params) => connection.sendRequest("session.history.truncate", {
|
|
6980
|
+
truncate: async (params) => connection.sendRequest("session.history.truncate", { ...params, sessionId }),
|
|
6909
6981
|
/**
|
|
6910
6982
|
* 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.
|
|
6911
6983
|
*
|
|
@@ -6919,7 +6991,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6919
6991
|
*
|
|
6920
6992
|
* @returns Files and aggregate changes for a prospective rewind.
|
|
6921
6993
|
*/
|
|
6922
|
-
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", {
|
|
6994
|
+
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", { ...params, sessionId }),
|
|
6923
6995
|
/**
|
|
6924
6996
|
* 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.
|
|
6925
6997
|
*
|
|
@@ -6927,7 +6999,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6927
6999
|
*
|
|
6928
7000
|
* @returns Structured outcome of a rewind request.
|
|
6929
7001
|
*/
|
|
6930
|
-
rewind: async (params) => connection.sendRequest("session.history.rewind", {
|
|
7002
|
+
rewind: async (params) => connection.sendRequest("session.history.rewind", { ...params, sessionId }),
|
|
6931
7003
|
/**
|
|
6932
7004
|
* Cancels any in-progress background compaction on a local session.
|
|
6933
7005
|
*
|
|
@@ -6953,7 +7025,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6953
7025
|
*
|
|
6954
7026
|
* @returns What a successful clear removed. A clear that could not be applied rejects instead of reporting a count.
|
|
6955
7027
|
*/
|
|
6956
|
-
clearContext: async (params) => connection.sendRequest("session.history.clearContext", {
|
|
7028
|
+
clearContext: async (params) => connection.sendRequest("session.history.clearContext", { ...params, sessionId })
|
|
6957
7029
|
},
|
|
6958
7030
|
/** @experimental */
|
|
6959
7031
|
queue: {
|
|
@@ -6970,7 +7042,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6970
7042
|
*
|
|
6971
7043
|
* @returns Result of moving a queued item.
|
|
6972
7044
|
*/
|
|
6973
|
-
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", {
|
|
7045
|
+
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", { ...params, sessionId }),
|
|
6974
7046
|
/**
|
|
6975
7047
|
* Inserts a new queued message at a public visible position.
|
|
6976
7048
|
*
|
|
@@ -6978,7 +7050,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6978
7050
|
*
|
|
6979
7051
|
* @returns Result of inserting a queued message.
|
|
6980
7052
|
*/
|
|
6981
|
-
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", {
|
|
7053
|
+
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", { ...params, sessionId }),
|
|
6982
7054
|
/**
|
|
6983
7055
|
* Removes an addressable queued item by its stable id.
|
|
6984
7056
|
*
|
|
@@ -6986,7 +7058,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6986
7058
|
*
|
|
6987
7059
|
* @returns Result of removing a queued item.
|
|
6988
7060
|
*/
|
|
6989
|
-
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", {
|
|
7061
|
+
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", { ...params, sessionId }),
|
|
6990
7062
|
/**
|
|
6991
7063
|
* Updates the text of an addressable single-message queue item.
|
|
6992
7064
|
*
|
|
@@ -6994,7 +7066,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
6994
7066
|
*
|
|
6995
7067
|
* @returns Result of editing a queued message.
|
|
6996
7068
|
*/
|
|
6997
|
-
updateText: async (params) => connection.sendRequest("session.queue.updateText", {
|
|
7069
|
+
updateText: async (params) => connection.sendRequest("session.queue.updateText", { ...params, sessionId }),
|
|
6998
7070
|
/**
|
|
6999
7071
|
* 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.
|
|
7000
7072
|
*
|
|
@@ -7002,7 +7074,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7002
7074
|
*
|
|
7003
7075
|
* @returns Result of withdrawing a user message.
|
|
7004
7076
|
*/
|
|
7005
|
-
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", {
|
|
7077
|
+
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { ...params, sessionId }),
|
|
7006
7078
|
/**
|
|
7007
7079
|
* Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
|
|
7008
7080
|
*
|
|
@@ -7010,7 +7082,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7010
7082
|
*
|
|
7011
7083
|
* @returns Result of editing a queued message.
|
|
7012
7084
|
*/
|
|
7013
|
-
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", {
|
|
7085
|
+
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { ...params, sessionId }),
|
|
7014
7086
|
/**
|
|
7015
7087
|
* Duplicates an addressable queued item immediately after its source.
|
|
7016
7088
|
*
|
|
@@ -7018,13 +7090,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7018
7090
|
*
|
|
7019
7091
|
* @returns Result of duplicating a queued item.
|
|
7020
7092
|
*/
|
|
7021
|
-
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", {
|
|
7093
|
+
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", { ...params, sessionId }),
|
|
7022
7094
|
/**
|
|
7023
7095
|
* Acquires or releases the queued-lane drain pause.
|
|
7024
7096
|
*
|
|
7025
7097
|
* @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.
|
|
7026
7098
|
*/
|
|
7027
|
-
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", {
|
|
7099
|
+
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", { ...params, sessionId }),
|
|
7028
7100
|
/**
|
|
7029
7101
|
* Moves an addressable queued message into the live turn's steering lane.
|
|
7030
7102
|
*
|
|
@@ -7032,7 +7104,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7032
7104
|
*
|
|
7033
7105
|
* @returns Result of trying to steer a queued message into a live turn.
|
|
7034
7106
|
*/
|
|
7035
|
-
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", {
|
|
7107
|
+
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", { ...params, sessionId }),
|
|
7036
7108
|
/**
|
|
7037
7109
|
* Removes the most recently queued user-facing item (LIFO).
|
|
7038
7110
|
*
|
|
@@ -7053,7 +7125,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7053
7125
|
*
|
|
7054
7126
|
* @returns Batch of session events returned by a read, with cursor and continuation metadata.
|
|
7055
7127
|
*/
|
|
7056
|
-
read: async (params) => connection.sendRequest("session.eventLog.read", {
|
|
7128
|
+
read: async (params) => connection.sendRequest("session.eventLog.read", { ...params, sessionId }),
|
|
7057
7129
|
/**
|
|
7058
7130
|
* Returns a snapshot of the current tail cursor without consuming events.
|
|
7059
7131
|
*
|
|
@@ -7067,7 +7139,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7067
7139
|
*
|
|
7068
7140
|
* @returns Opaque handle representing an event-type interest registration.
|
|
7069
7141
|
*/
|
|
7070
|
-
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", {
|
|
7142
|
+
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", { ...params, sessionId }),
|
|
7071
7143
|
/**
|
|
7072
7144
|
* Releases a consumer's previously-registered interest in an event type.
|
|
7073
7145
|
*
|
|
@@ -7075,7 +7147,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7075
7147
|
*
|
|
7076
7148
|
* @returns Indicates whether the operation succeeded.
|
|
7077
7149
|
*/
|
|
7078
|
-
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", {
|
|
7150
|
+
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", { ...params, sessionId })
|
|
7079
7151
|
},
|
|
7080
7152
|
/** @experimental */
|
|
7081
7153
|
usage: {
|
|
@@ -7095,7 +7167,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7095
7167
|
*
|
|
7096
7168
|
* @returns Prediction result. Available results include prediction details; unavailable results include an explicit reason.
|
|
7097
7169
|
*/
|
|
7098
|
-
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", {
|
|
7170
|
+
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", { ...params, sessionId })
|
|
7099
7171
|
},
|
|
7100
7172
|
/** @experimental */
|
|
7101
7173
|
remote: {
|
|
@@ -7106,7 +7178,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7106
7178
|
*
|
|
7107
7179
|
* @returns GitHub URL for the session and a flag indicating whether remote steering is enabled.
|
|
7108
7180
|
*/
|
|
7109
|
-
enable: async (params) => connection.sendRequest("session.remote.enable", {
|
|
7181
|
+
enable: async (params) => connection.sendRequest("session.remote.enable", { ...params, sessionId }),
|
|
7110
7182
|
/**
|
|
7111
7183
|
* Disables remote session export and steering.
|
|
7112
7184
|
*/
|
|
@@ -7118,7 +7190,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7118
7190
|
*
|
|
7119
7191
|
* @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.
|
|
7120
7192
|
*/
|
|
7121
|
-
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", {
|
|
7193
|
+
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", { ...params, sessionId })
|
|
7122
7194
|
},
|
|
7123
7195
|
/** @experimental */
|
|
7124
7196
|
visibility: {
|
|
@@ -7135,7 +7207,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7135
7207
|
*
|
|
7136
7208
|
* @returns Effective sharing status and shareable GitHub URL after updating session visibility.
|
|
7137
7209
|
*/
|
|
7138
|
-
set: async (params) => connection.sendRequest("session.visibility.set", {
|
|
7210
|
+
set: async (params) => connection.sendRequest("session.visibility.set", { ...params, sessionId })
|
|
7139
7211
|
},
|
|
7140
7212
|
/** @experimental */
|
|
7141
7213
|
schedule: {
|
|
@@ -7152,7 +7224,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
7152
7224
|
*
|
|
7153
7225
|
* @returns Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.
|
|
7154
7226
|
*/
|
|
7155
|
-
stop: async (params) => connection.sendRequest("session.schedule.stop", {
|
|
7227
|
+
stop: async (params) => connection.sendRequest("session.schedule.stop", { ...params, sessionId })
|
|
7156
7228
|
}
|
|
7157
7229
|
};
|
|
7158
7230
|
}
|
|
@@ -7165,7 +7237,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7165
7237
|
*
|
|
7166
7238
|
* @experimental
|
|
7167
7239
|
*/
|
|
7168
|
-
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", {
|
|
7240
|
+
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", { ...params, sessionId }),
|
|
7169
7241
|
/** @experimental */
|
|
7170
7242
|
gitHubAuth: {
|
|
7171
7243
|
/**
|
|
@@ -7193,13 +7265,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7193
7265
|
*
|
|
7194
7266
|
* @returns Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
|
|
7195
7267
|
*/
|
|
7196
|
-
login: async (params) => connection.sendRequest("session.gitHubAuth.login", {
|
|
7268
|
+
login: async (params) => connection.sendRequest("session.gitHubAuth.login", { ...params, sessionId }),
|
|
7197
7269
|
/**
|
|
7198
7270
|
* Switches the session to another available authentication.
|
|
7199
7271
|
*
|
|
7200
7272
|
* @param params Parameters for switching the session's active authentication.
|
|
7201
7273
|
*/
|
|
7202
|
-
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", {
|
|
7274
|
+
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", { ...params, sessionId }),
|
|
7203
7275
|
/**
|
|
7204
7276
|
* Logs out the session's current GitHub authentication.
|
|
7205
7277
|
*
|
|
@@ -7213,7 +7285,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7213
7285
|
*
|
|
7214
7286
|
* @returns Whether the requested authentication was logged out.
|
|
7215
7287
|
*/
|
|
7216
|
-
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", {
|
|
7288
|
+
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", { ...params, sessionId }),
|
|
7217
7289
|
/**
|
|
7218
7290
|
* Gets validation errors from the most recent authentication attempt.
|
|
7219
7291
|
*
|
|
@@ -7230,13 +7302,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7230
7302
|
*
|
|
7231
7303
|
* @param params Internal canvas provider registration parameters.
|
|
7232
7304
|
*/
|
|
7233
|
-
register: async (params) => connection.sendRequest("session.canvas.provider.register", {
|
|
7305
|
+
register: async (params) => connection.sendRequest("session.canvas.provider.register", { ...params, sessionId }),
|
|
7234
7306
|
/**
|
|
7235
7307
|
* Unregisters an internal canvas provider connection.
|
|
7236
7308
|
*
|
|
7237
7309
|
* @param params Internal canvas provider unregistration parameters.
|
|
7238
7310
|
*/
|
|
7239
|
-
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", {
|
|
7311
|
+
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", { ...params, sessionId })
|
|
7240
7312
|
}
|
|
7241
7313
|
},
|
|
7242
7314
|
/** @experimental */
|
|
@@ -7248,7 +7320,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7248
7320
|
*
|
|
7249
7321
|
* @returns Complete current or terminal workflow run envelope.
|
|
7250
7322
|
*/
|
|
7251
|
-
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", {
|
|
7323
|
+
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { ...params, sessionId }),
|
|
7252
7324
|
/**
|
|
7253
7325
|
* Internal tool-originated dynamic workflow resume.
|
|
7254
7326
|
*
|
|
@@ -7256,13 +7328,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7256
7328
|
*
|
|
7257
7329
|
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
7258
7330
|
*/
|
|
7259
|
-
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", {
|
|
7331
|
+
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { ...params, sessionId }),
|
|
7260
7332
|
/**
|
|
7261
7333
|
* Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
|
|
7262
7334
|
*
|
|
7263
7335
|
* @param params Parameters for an owned durable pause checkpoint.
|
|
7264
7336
|
*/
|
|
7265
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", {
|
|
7337
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { ...params, sessionId })
|
|
7266
7338
|
},
|
|
7267
7339
|
/** @experimental */
|
|
7268
7340
|
model: {
|
|
@@ -7273,7 +7345,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7273
7345
|
*
|
|
7274
7346
|
* @returns The model identifier active on the session after the switch.
|
|
7275
7347
|
*/
|
|
7276
|
-
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", {
|
|
7348
|
+
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", { ...params, sessionId })
|
|
7277
7349
|
},
|
|
7278
7350
|
/** @experimental */
|
|
7279
7351
|
mcp: {
|
|
@@ -7284,7 +7356,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7284
7356
|
*
|
|
7285
7357
|
* @returns MCP server startup filtering result.
|
|
7286
7358
|
*/
|
|
7287
|
-
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", {
|
|
7359
|
+
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", { ...params, sessionId }),
|
|
7288
7360
|
/**
|
|
7289
7361
|
* Configures the built-in GitHub MCP server for the session's current auth context.
|
|
7290
7362
|
*
|
|
@@ -7292,19 +7364,19 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7292
7364
|
*
|
|
7293
7365
|
* @returns Result of configuring GitHub MCP.
|
|
7294
7366
|
*/
|
|
7295
|
-
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", {
|
|
7367
|
+
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", { ...params, sessionId }),
|
|
7296
7368
|
/**
|
|
7297
7369
|
* 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.
|
|
7298
7370
|
*
|
|
7299
7371
|
* @param params Registration parameters for an external MCP client.
|
|
7300
7372
|
*/
|
|
7301
|
-
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", {
|
|
7373
|
+
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", { ...params, sessionId }),
|
|
7302
7374
|
/**
|
|
7303
7375
|
* 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.
|
|
7304
7376
|
*
|
|
7305
7377
|
* @param params Server name identifying the external client to remove.
|
|
7306
7378
|
*/
|
|
7307
|
-
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", {
|
|
7379
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { ...params, sessionId })
|
|
7308
7380
|
},
|
|
7309
7381
|
/** @experimental */
|
|
7310
7382
|
connectors: {
|
|
@@ -7315,7 +7387,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7315
7387
|
*
|
|
7316
7388
|
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
7317
7389
|
*/
|
|
7318
|
-
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", {
|
|
7390
|
+
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", { ...params, sessionId }),
|
|
7319
7391
|
/**
|
|
7320
7392
|
* Removes the runtime-owned Connector MCP projection without changing service-side connections.
|
|
7321
7393
|
*
|
|
@@ -7332,7 +7404,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7332
7404
|
*
|
|
7333
7405
|
* @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not.
|
|
7334
7406
|
*/
|
|
7335
|
-
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", {
|
|
7407
|
+
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", { ...params, sessionId })
|
|
7336
7408
|
},
|
|
7337
7409
|
/** @experimental */
|
|
7338
7410
|
settings: {
|
|
@@ -7349,7 +7421,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7349
7421
|
*
|
|
7350
7422
|
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
7351
7423
|
*/
|
|
7352
|
-
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", {
|
|
7424
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { ...params, sessionId })
|
|
7353
7425
|
},
|
|
7354
7426
|
/** @experimental */
|
|
7355
7427
|
queue: {
|
|
@@ -7372,7 +7444,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7372
7444
|
*
|
|
7373
7445
|
* @returns Whether a deferred-idle drain should run.
|
|
7374
7446
|
*/
|
|
7375
|
-
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", {
|
|
7447
|
+
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", { ...params, sessionId }),
|
|
7376
7448
|
/**
|
|
7377
7449
|
* Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.
|
|
7378
7450
|
*
|
|
@@ -7380,13 +7452,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7380
7452
|
*
|
|
7381
7453
|
* @returns Action selected by the native deferred-idle drain.
|
|
7382
7454
|
*/
|
|
7383
|
-
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", {
|
|
7455
|
+
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", { ...params, sessionId }),
|
|
7384
7456
|
/**
|
|
7385
7457
|
* Marks session.idle as deferred by native background work state.
|
|
7386
7458
|
*
|
|
7387
7459
|
* @param params Inputs for marking session.idle deferred in native state.
|
|
7388
7460
|
*/
|
|
7389
|
-
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", {
|
|
7461
|
+
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", { ...params, sessionId }),
|
|
7390
7462
|
/**
|
|
7391
7463
|
* Consumes queued native system notifications matching an internal filter.
|
|
7392
7464
|
*
|
|
@@ -7394,7 +7466,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7394
7466
|
*
|
|
7395
7467
|
* @returns Indicates whether a user-facing pending item was removed.
|
|
7396
7468
|
*/
|
|
7397
|
-
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", {
|
|
7469
|
+
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", { ...params, sessionId }),
|
|
7398
7470
|
/**
|
|
7399
7471
|
* Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.
|
|
7400
7472
|
*
|
|
@@ -7425,7 +7497,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7425
7497
|
*
|
|
7426
7498
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
7427
7499
|
*/
|
|
7428
|
-
add: async (params) => connection.sendRequest("session.schedule.add", {
|
|
7500
|
+
add: async (params) => connection.sendRequest("session.schedule.add", { ...params, sessionId }),
|
|
7429
7501
|
/**
|
|
7430
7502
|
* Registers a recurring cron scheduled prompt.
|
|
7431
7503
|
*
|
|
@@ -7433,7 +7505,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7433
7505
|
*
|
|
7434
7506
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
7435
7507
|
*/
|
|
7436
|
-
addCron: async (params) => connection.sendRequest("session.schedule.addCron", {
|
|
7508
|
+
addCron: async (params) => connection.sendRequest("session.schedule.addCron", { ...params, sessionId }),
|
|
7437
7509
|
/**
|
|
7438
7510
|
* Registers an absolute-time scheduled prompt.
|
|
7439
7511
|
*
|
|
@@ -7441,7 +7513,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7441
7513
|
*
|
|
7442
7514
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
7443
7515
|
*/
|
|
7444
|
-
addAt: async (params) => connection.sendRequest("session.schedule.addAt", {
|
|
7516
|
+
addAt: async (params) => connection.sendRequest("session.schedule.addAt", { ...params, sessionId }),
|
|
7445
7517
|
/**
|
|
7446
7518
|
* Registers a self-paced scheduled prompt.
|
|
7447
7519
|
*
|
|
@@ -7449,7 +7521,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7449
7521
|
*
|
|
7450
7522
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
7451
7523
|
*/
|
|
7452
|
-
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", {
|
|
7524
|
+
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", { ...params, sessionId }),
|
|
7453
7525
|
/**
|
|
7454
7526
|
* Re-arms an active self-paced scheduled prompt.
|
|
7455
7527
|
*
|
|
@@ -7457,7 +7529,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
7457
7529
|
*
|
|
7458
7530
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
7459
7531
|
*/
|
|
7460
|
-
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", {
|
|
7532
|
+
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", { ...params, sessionId })
|
|
7461
7533
|
}
|
|
7462
7534
|
};
|
|
7463
7535
|
}
|
|
@@ -8926,6 +8998,7 @@ var CopilotSession = class {
|
|
|
8926
8998
|
sessionId;
|
|
8927
8999
|
connection;
|
|
8928
9000
|
_workspacePath;
|
|
9001
|
+
_transcriptRecovery;
|
|
8929
9002
|
eventHandlers = /* @__PURE__ */ new Set();
|
|
8930
9003
|
typedEventHandlers = /* @__PURE__ */ new Map();
|
|
8931
9004
|
toolHandlers = /* @__PURE__ */ new Map();
|
|
@@ -9115,6 +9188,14 @@ var CopilotSession = class {
|
|
|
9115
9188
|
get workspacePath() {
|
|
9116
9189
|
return this._workspacePath;
|
|
9117
9190
|
}
|
|
9191
|
+
/** Recovery observed while loading this session; undefined on a clean resume. */
|
|
9192
|
+
get transcriptRecovery() {
|
|
9193
|
+
return this._transcriptRecovery;
|
|
9194
|
+
}
|
|
9195
|
+
/** @internal */
|
|
9196
|
+
setTranscriptRecovery(recovery) {
|
|
9197
|
+
this._transcriptRecovery = recovery;
|
|
9198
|
+
}
|
|
9118
9199
|
/**
|
|
9119
9200
|
* Host capabilities reported when the session was created or resumed.
|
|
9120
9201
|
* Use this to check feature support before calling capability-gated APIs.
|
|
@@ -11294,6 +11375,7 @@ var CopilotClient = class _CopilotClient {
|
|
|
11294
11375
|
requestAdapter = null;
|
|
11295
11376
|
messageWriter = null;
|
|
11296
11377
|
connectionClosed = false;
|
|
11378
|
+
connectionEpoch = 0;
|
|
11297
11379
|
socket = null;
|
|
11298
11380
|
runtimePort = null;
|
|
11299
11381
|
actualHost = "localhost";
|
|
@@ -11703,6 +11785,7 @@ var CopilotClient = class _CopilotClient {
|
|
|
11703
11785
|
}
|
|
11704
11786
|
async doStart() {
|
|
11705
11787
|
this.forceStopping = false;
|
|
11788
|
+
this.connectionEpoch++;
|
|
11706
11789
|
this.connectionClosed = false;
|
|
11707
11790
|
this.processTransportError = null;
|
|
11708
11791
|
this.state = "connecting";
|
|
@@ -11738,6 +11821,9 @@ var CopilotClient = class _CopilotClient {
|
|
|
11738
11821
|
if (this.requestHandler) {
|
|
11739
11822
|
await this.connection.sendRequest("llmInference.setProvider", {});
|
|
11740
11823
|
}
|
|
11824
|
+
if (this.connectionClosed) {
|
|
11825
|
+
throw new Error("CLI server connection closed during startup");
|
|
11826
|
+
}
|
|
11741
11827
|
this.state = "connected";
|
|
11742
11828
|
} catch (error) {
|
|
11743
11829
|
const startupError = this.processTransportError ?? error;
|
|
@@ -11857,10 +11943,23 @@ var CopilotClient = class _CopilotClient {
|
|
|
11857
11943
|
this.socket = null;
|
|
11858
11944
|
try {
|
|
11859
11945
|
if (!socket.destroyed) {
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11946
|
+
let timeout;
|
|
11947
|
+
try {
|
|
11948
|
+
await new Promise((resolve22) => {
|
|
11949
|
+
socket.once("close", () => resolve22());
|
|
11950
|
+
if (this.connectionClosed) {
|
|
11951
|
+
socket.destroy();
|
|
11952
|
+
} else {
|
|
11953
|
+
timeout = setTimeout(
|
|
11954
|
+
() => socket.destroy(),
|
|
11955
|
+
RUNTIME_SHUTDOWN_TIMEOUT_MS
|
|
11956
|
+
);
|
|
11957
|
+
socket.end();
|
|
11958
|
+
}
|
|
11959
|
+
});
|
|
11960
|
+
} finally {
|
|
11961
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
11962
|
+
}
|
|
11864
11963
|
}
|
|
11865
11964
|
} catch (error) {
|
|
11866
11965
|
errors.push(
|
|
@@ -12523,6 +12622,7 @@ var CopilotClient = class _CopilotClient {
|
|
|
12523
12622
|
allowedModels: config.allowedModels,
|
|
12524
12623
|
...await getTraceContext(this.onGetTraceContext),
|
|
12525
12624
|
sessionId,
|
|
12625
|
+
allowTranscriptRecovery: config.allowTranscriptRecovery,
|
|
12526
12626
|
clientName: config.clientName,
|
|
12527
12627
|
model: config.model,
|
|
12528
12628
|
reasoningEffort: config.reasoningEffort,
|
|
@@ -12629,10 +12729,11 @@ var CopilotClient = class _CopilotClient {
|
|
|
12629
12729
|
}
|
|
12630
12730
|
}
|
|
12631
12731
|
}
|
|
12632
|
-
const { workspacePath, capabilities, openCanvases } = response;
|
|
12732
|
+
const { workspacePath, capabilities, openCanvases, transcriptRecovery } = response;
|
|
12633
12733
|
session["_workspacePath"] = workspacePath;
|
|
12634
12734
|
session.setCapabilities(capabilities);
|
|
12635
12735
|
session.setOpenCanvases(openCanvases ?? []);
|
|
12736
|
+
session.setTranscriptRecovery(transcriptRecovery);
|
|
12636
12737
|
if (config.onMcpAuthRequest) {
|
|
12637
12738
|
await this.connection.sendRequest("session.eventLog.registerInterest", {
|
|
12638
12739
|
sessionId,
|
|
@@ -13621,8 +13722,13 @@ stderr: ${stderrOutput}` : ""}`
|
|
|
13621
13722
|
);
|
|
13622
13723
|
const connection = this.connection;
|
|
13623
13724
|
const messageWriter = this.messageWriter;
|
|
13725
|
+
const cliProcess = this.isExternalServer ? null : this.cliProcess;
|
|
13726
|
+
const connectionEpoch = this.connectionEpoch;
|
|
13727
|
+
const isCurrentConnection = () => connectionEpoch === this.connectionEpoch && this.connection === connection && (cliProcess === null || this.cliProcess === cliProcess);
|
|
13728
|
+
let disconnecting = false;
|
|
13729
|
+
let exitFallback;
|
|
13624
13730
|
const markDisconnected = () => {
|
|
13625
|
-
if (
|
|
13731
|
+
if (!isCurrentConnection()) {
|
|
13626
13732
|
connection.dispose();
|
|
13627
13733
|
return;
|
|
13628
13734
|
}
|
|
@@ -13636,13 +13742,48 @@ stderr: ${stderrOutput}` : ""}`
|
|
|
13636
13742
|
this.githubTokenProviders.clear();
|
|
13637
13743
|
this.requestAdapter?.cancelPending();
|
|
13638
13744
|
connection.dispose();
|
|
13745
|
+
this.socket?.destroy();
|
|
13746
|
+
this.connection = null;
|
|
13747
|
+
this.messageWriter = null;
|
|
13748
|
+
this._rpc = null;
|
|
13749
|
+
this._internalRpc = null;
|
|
13750
|
+
this.modelsCache = null;
|
|
13639
13751
|
};
|
|
13640
|
-
|
|
13752
|
+
const disconnectAfterDrain = () => {
|
|
13753
|
+
if (exitFallback !== void 0) {
|
|
13754
|
+
clearTimeout(exitFallback);
|
|
13755
|
+
exitFallback = void 0;
|
|
13756
|
+
}
|
|
13757
|
+
if (!isCurrentConnection()) {
|
|
13758
|
+
connection.dispose();
|
|
13759
|
+
return;
|
|
13760
|
+
}
|
|
13761
|
+
if (disconnecting) return;
|
|
13762
|
+
disconnecting = true;
|
|
13763
|
+
this.connectionClosed = true;
|
|
13641
13764
|
if (messageWriter) messageWriter.suppressWriteErrors = true;
|
|
13642
13765
|
void connection.drain().then(markDisconnected);
|
|
13643
|
-
}
|
|
13766
|
+
};
|
|
13767
|
+
this.connection.onClose(disconnectAfterDrain);
|
|
13768
|
+
if (cliProcess) {
|
|
13769
|
+
cliProcess.once("exit", () => {
|
|
13770
|
+
if (!isCurrentConnection()) {
|
|
13771
|
+
connection.dispose();
|
|
13772
|
+
return;
|
|
13773
|
+
}
|
|
13774
|
+
if (disconnecting) return;
|
|
13775
|
+
if (this.socket) {
|
|
13776
|
+
disconnectAfterDrain();
|
|
13777
|
+
return;
|
|
13778
|
+
}
|
|
13779
|
+
this.connectionClosed = true;
|
|
13780
|
+
if (messageWriter) messageWriter.suppressWriteErrors = true;
|
|
13781
|
+
exitFallback = setTimeout(disconnectAfterDrain, RUNTIME_SHUTDOWN_TIMEOUT_MS);
|
|
13782
|
+
exitFallback.unref();
|
|
13783
|
+
});
|
|
13784
|
+
}
|
|
13644
13785
|
this.connection.onError(() => {
|
|
13645
|
-
if (this.connection === connection) {
|
|
13786
|
+
if (connectionEpoch === this.connectionEpoch && this.connection === connection) {
|
|
13646
13787
|
this.state = "disconnected";
|
|
13647
13788
|
}
|
|
13648
13789
|
});
|