@github/copilot-sdk 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/README.md +12 -2
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +69 -9
- package/dist/cjs/ffiRuntimeHost.js +14 -3
- package/dist/cjs/generated/rpc.js +291 -230
- package/dist/cjs/session.js +9 -0
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +1 -0
- package/dist/client.js +69 -9
- package/dist/ffiRuntimeHost.d.ts +1 -0
- package/dist/ffiRuntimeHost.js +14 -3
- package/dist/generated/rpc.d.ts +649 -14
- package/dist/generated/rpc.js +291 -230
- package/dist/generated/session-events.d.ts +13 -3
- package/dist/index.d.ts +1 -1
- package/dist/session.d.ts +4 -1
- package/dist/session.js +9 -0
- package/dist/types.d.ts +17 -2
- package/package.json +17 -12
package/dist/generated/rpc.js
CHANGED
|
@@ -619,15 +619,45 @@ function createServerRpc(connection) {
|
|
|
619
619
|
/** @experimental */
|
|
620
620
|
managedSettings: {
|
|
621
621
|
/**
|
|
622
|
-
* 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.
|
|
622
|
+
* 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.
|
|
623
623
|
*
|
|
624
624
|
* @returns Validated device-managed settings discovered before a session exists.
|
|
625
625
|
*/
|
|
626
626
|
read: async () => connection.sendRequest("managedSettings.read", {}),
|
|
627
627
|
/**
|
|
628
|
-
* 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.
|
|
628
|
+
* 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.
|
|
629
629
|
*/
|
|
630
|
-
clearCache: async () => connection.sendRequest("managedSettings.clearCache", {})
|
|
630
|
+
clearCache: async () => connection.sendRequest("managedSettings.clearCache", {}),
|
|
631
|
+
/**
|
|
632
|
+
* 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.
|
|
633
|
+
*
|
|
634
|
+
* @param params Optional opaque account selection or GitHub token whose managed settings are resolved.
|
|
635
|
+
*
|
|
636
|
+
* @returns Effective enterprise managed settings for an account, resolved without a session.
|
|
637
|
+
*/
|
|
638
|
+
resolve: async (params) => connection.sendRequest("managedSettings.resolve", params),
|
|
639
|
+
/**
|
|
640
|
+
* 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.
|
|
641
|
+
*
|
|
642
|
+
* @returns The authoring JSON schema for managed settings recognized by this runtime.
|
|
643
|
+
*/
|
|
644
|
+
schema: async () => connection.sendRequest("managedSettings.schema", {}),
|
|
645
|
+
/**
|
|
646
|
+
* 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.
|
|
647
|
+
*
|
|
648
|
+
* @param params A candidate managed-settings document to validate without applying it.
|
|
649
|
+
*
|
|
650
|
+
* @returns Result of validating a managed-settings document.
|
|
651
|
+
*/
|
|
652
|
+
validate: async (params) => connection.sendRequest("managedSettings.validate", params),
|
|
653
|
+
/**
|
|
654
|
+
* 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.
|
|
655
|
+
*
|
|
656
|
+
* @param params Candidate managed-settings documents to merge without applying them.
|
|
657
|
+
*
|
|
658
|
+
* @returns The effective managed settings the runtime would enforce for the given documents, in the same shape `managedSettings.resolve` returns.
|
|
659
|
+
*/
|
|
660
|
+
compose: async (params) => connection.sendRequest("managedSettings.compose", params)
|
|
631
661
|
},
|
|
632
662
|
/** @experimental */
|
|
633
663
|
runtime: {
|
|
@@ -1020,7 +1050,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1020
1050
|
*
|
|
1021
1051
|
* @experimental
|
|
1022
1052
|
*/
|
|
1023
|
-
send: async (params) => connection.sendRequest("session.send", {
|
|
1053
|
+
send: async (params) => connection.sendRequest("session.send", { ...params, sessionId }),
|
|
1024
1054
|
/**
|
|
1025
1055
|
* 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.
|
|
1026
1056
|
*
|
|
@@ -1030,7 +1060,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1030
1060
|
*
|
|
1031
1061
|
* @experimental
|
|
1032
1062
|
*/
|
|
1033
|
-
sendMessages: async (params) => connection.sendRequest("session.sendMessages", {
|
|
1063
|
+
sendMessages: async (params) => connection.sendRequest("session.sendMessages", { ...params, sessionId }),
|
|
1034
1064
|
/** @experimental */
|
|
1035
1065
|
sandbox: {
|
|
1036
1066
|
/**
|
|
@@ -1046,7 +1076,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1046
1076
|
*
|
|
1047
1077
|
* @returns Result of attempting to disable sandboxing for the current session.
|
|
1048
1078
|
*/
|
|
1049
|
-
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", {
|
|
1079
|
+
disableForSession: async (params) => connection.sendRequest("session.sandbox.disableForSession", { ...params, sessionId }),
|
|
1050
1080
|
/**
|
|
1051
1081
|
* 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.
|
|
1052
1082
|
*
|
|
@@ -1054,7 +1084,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1054
1084
|
*
|
|
1055
1085
|
* @returns Result of accepting a sandbox path grant.
|
|
1056
1086
|
*/
|
|
1057
|
-
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", {
|
|
1087
|
+
grantPathForRequest: async (params) => connection.sendRequest("session.sandbox.grantPathForRequest", { ...params, sessionId })
|
|
1058
1088
|
},
|
|
1059
1089
|
/**
|
|
1060
1090
|
* Aborts the current agent turn.
|
|
@@ -1065,7 +1095,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1065
1095
|
*
|
|
1066
1096
|
* @experimental
|
|
1067
1097
|
*/
|
|
1068
|
-
abort: async (params) => connection.sendRequest("session.abort", {
|
|
1098
|
+
abort: async (params) => connection.sendRequest("session.abort", { ...params, sessionId }),
|
|
1069
1099
|
/**
|
|
1070
1100
|
* 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.
|
|
1071
1101
|
*
|
|
@@ -1075,7 +1105,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1075
1105
|
*
|
|
1076
1106
|
* @experimental
|
|
1077
1107
|
*/
|
|
1078
|
-
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", {
|
|
1108
|
+
interruptMainTurn: async (params) => connection.sendRequest("session.interruptMainTurn", { ...params, sessionId }),
|
|
1079
1109
|
/**
|
|
1080
1110
|
* Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.
|
|
1081
1111
|
*
|
|
@@ -1091,7 +1121,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1091
1121
|
*
|
|
1092
1122
|
* @experimental
|
|
1093
1123
|
*/
|
|
1094
|
-
shutdown: async (params) => connection.sendRequest("session.shutdown", {
|
|
1124
|
+
shutdown: async (params) => connection.sendRequest("session.shutdown", { ...params, sessionId }),
|
|
1095
1125
|
/** @experimental */
|
|
1096
1126
|
gitHubAuth: {
|
|
1097
1127
|
/**
|
|
@@ -1107,7 +1137,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1107
1137
|
*
|
|
1108
1138
|
* @returns Indicates whether the credential update succeeded.
|
|
1109
1139
|
*/
|
|
1110
|
-
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", {
|
|
1140
|
+
setCredentials: async (params) => connection.sendRequest("session.gitHubAuth.setCredentials", { ...params, sessionId })
|
|
1111
1141
|
},
|
|
1112
1142
|
/** @experimental */
|
|
1113
1143
|
accounts: {
|
|
@@ -1118,7 +1148,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1118
1148
|
*
|
|
1119
1149
|
* @returns The enumerated collection, keyed by the same selector as the query.
|
|
1120
1150
|
*/
|
|
1121
|
-
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", {
|
|
1151
|
+
enumerate: async (params) => connection.sendRequest("session.accounts.enumerate", { ...params, sessionId }),
|
|
1122
1152
|
/**
|
|
1123
1153
|
* Read one typed accounts datum: the active account, a neutral status summary, or the last authentication errors.
|
|
1124
1154
|
*
|
|
@@ -1126,7 +1156,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1126
1156
|
*
|
|
1127
1157
|
* @returns The read result, keyed by the same selector as the query.
|
|
1128
1158
|
*/
|
|
1129
|
-
get: async (params) => connection.sendRequest("session.accounts.get", {
|
|
1159
|
+
get: async (params) => connection.sendRequest("session.accounts.get", { ...params, sessionId }),
|
|
1130
1160
|
/**
|
|
1131
1161
|
* Apply one non-interactive accounts mutation: switch the active account, log an account out, or set credentials from a token.
|
|
1132
1162
|
*
|
|
@@ -1134,7 +1164,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1134
1164
|
*
|
|
1135
1165
|
* @returns Result of a non-interactive accounts mutation.
|
|
1136
1166
|
*/
|
|
1137
|
-
set: async (params) => connection.sendRequest("session.accounts.set", {
|
|
1167
|
+
set: async (params) => connection.sendRequest("session.accounts.set", { ...params, sessionId }),
|
|
1138
1168
|
/** @experimental */
|
|
1139
1169
|
login: {
|
|
1140
1170
|
/**
|
|
@@ -1144,7 +1174,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1144
1174
|
*
|
|
1145
1175
|
* @returns A started login flow: its opaque id and first step.
|
|
1146
1176
|
*/
|
|
1147
|
-
begin: async (params) => connection.sendRequest("session.accounts.login.begin", {
|
|
1177
|
+
begin: async (params) => connection.sendRequest("session.accounts.login.begin", { ...params, sessionId }),
|
|
1148
1178
|
/**
|
|
1149
1179
|
* Advance an in-flight login flow, optionally fulfilling an input-required step, and return the next step.
|
|
1150
1180
|
*
|
|
@@ -1152,13 +1182,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1152
1182
|
*
|
|
1153
1183
|
* @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).
|
|
1154
1184
|
*/
|
|
1155
|
-
advance: async (params) => connection.sendRequest("session.accounts.login.advance", {
|
|
1185
|
+
advance: async (params) => connection.sendRequest("session.accounts.login.advance", { ...params, sessionId }),
|
|
1156
1186
|
/**
|
|
1157
1187
|
* Cancel an in-flight login flow and release its resources.
|
|
1158
1188
|
*
|
|
1159
1189
|
* @param params Cancel an in-flight login flow.
|
|
1160
1190
|
*/
|
|
1161
|
-
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", {
|
|
1191
|
+
cancel: async (params) => connection.sendRequest("session.accounts.login.cancel", { ...params, sessionId })
|
|
1162
1192
|
}
|
|
1163
1193
|
},
|
|
1164
1194
|
/** @experimental */
|
|
@@ -1170,7 +1200,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1170
1200
|
*
|
|
1171
1201
|
* @returns Result of collecting a session debug bundle.
|
|
1172
1202
|
*/
|
|
1173
|
-
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", {
|
|
1203
|
+
collectLogs: async (params) => connection.sendRequest("session.debug.collectLogs", { ...params, sessionId })
|
|
1174
1204
|
},
|
|
1175
1205
|
/** @experimental */
|
|
1176
1206
|
canvas: {
|
|
@@ -1193,13 +1223,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1193
1223
|
*
|
|
1194
1224
|
* @returns Open canvas instance snapshot.
|
|
1195
1225
|
*/
|
|
1196
|
-
open: async (params) => connection.sendRequest("session.canvas.open", {
|
|
1226
|
+
open: async (params) => connection.sendRequest("session.canvas.open", { ...params, sessionId }),
|
|
1197
1227
|
/**
|
|
1198
1228
|
* Closes an open canvas instance.
|
|
1199
1229
|
*
|
|
1200
1230
|
* @param params Canvas close parameters.
|
|
1201
1231
|
*/
|
|
1202
|
-
close: async (params) => connection.sendRequest("session.canvas.close", {
|
|
1232
|
+
close: async (params) => connection.sendRequest("session.canvas.close", { ...params, sessionId }),
|
|
1203
1233
|
/** @experimental */
|
|
1204
1234
|
action: {
|
|
1205
1235
|
/**
|
|
@@ -1209,7 +1239,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1209
1239
|
*
|
|
1210
1240
|
* @returns Canvas action invocation result.
|
|
1211
1241
|
*/
|
|
1212
|
-
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", {
|
|
1242
|
+
invoke: async (params) => connection.sendRequest("session.canvas.action.invoke", { ...params, sessionId })
|
|
1213
1243
|
}
|
|
1214
1244
|
},
|
|
1215
1245
|
/** @experimental */
|
|
@@ -1221,7 +1251,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1221
1251
|
*
|
|
1222
1252
|
* @returns Complete current or terminal workflow run envelope.
|
|
1223
1253
|
*/
|
|
1224
|
-
run: async (params) => connection.sendRequest("session.workflow.run", {
|
|
1254
|
+
run: async (params) => connection.sendRequest("session.workflow.run", { ...params, sessionId }),
|
|
1225
1255
|
/**
|
|
1226
1256
|
* Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
|
|
1227
1257
|
*
|
|
@@ -1229,7 +1259,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1229
1259
|
*
|
|
1230
1260
|
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
1231
1261
|
*/
|
|
1232
|
-
resume: async (params) => connection.sendRequest("session.workflow.resume", {
|
|
1262
|
+
resume: async (params) => connection.sendRequest("session.workflow.resume", { ...params, sessionId }),
|
|
1233
1263
|
/**
|
|
1234
1264
|
* Gets the current or settled envelope for a dynamic workflow run.
|
|
1235
1265
|
*
|
|
@@ -1237,7 +1267,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1237
1267
|
*
|
|
1238
1268
|
* @returns Complete current or terminal workflow run envelope.
|
|
1239
1269
|
*/
|
|
1240
|
-
getRun: async (params) => connection.sendRequest("session.workflow.getRun", {
|
|
1270
|
+
getRun: async (params) => connection.sendRequest("session.workflow.getRun", { ...params, sessionId }),
|
|
1241
1271
|
/**
|
|
1242
1272
|
* Lists durable dynamic workflow runs for this session in creation order.
|
|
1243
1273
|
*
|
|
@@ -1245,7 +1275,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1245
1275
|
*
|
|
1246
1276
|
* @returns A page of workflow runs in durable creation order.
|
|
1247
1277
|
*/
|
|
1248
|
-
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", {
|
|
1278
|
+
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { ...params, sessionId }),
|
|
1249
1279
|
/**
|
|
1250
1280
|
* Gets durable and live observability detail for one dynamic workflow run.
|
|
1251
1281
|
*
|
|
@@ -1253,7 +1283,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1253
1283
|
*
|
|
1254
1284
|
* @returns Full workflow run observability detail.
|
|
1255
1285
|
*/
|
|
1256
|
-
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", {
|
|
1286
|
+
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { ...params, sessionId }),
|
|
1257
1287
|
/**
|
|
1258
1288
|
* Pages durable progress for one dynamic workflow run.
|
|
1259
1289
|
*
|
|
@@ -1261,7 +1291,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1261
1291
|
*
|
|
1262
1292
|
* @returns A bidirectional page of workflow progress.
|
|
1263
1293
|
*/
|
|
1264
|
-
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", {
|
|
1294
|
+
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { ...params, sessionId }),
|
|
1265
1295
|
/**
|
|
1266
1296
|
* Requests cancellation of a dynamic workflow run and returns its run envelope.
|
|
1267
1297
|
*
|
|
@@ -1269,7 +1299,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1269
1299
|
*
|
|
1270
1300
|
* @returns Complete current or terminal workflow run envelope.
|
|
1271
1301
|
*/
|
|
1272
|
-
cancel: async (params) => connection.sendRequest("session.workflow.cancel", {
|
|
1302
|
+
cancel: async (params) => connection.sendRequest("session.workflow.cancel", { ...params, sessionId }),
|
|
1273
1303
|
/**
|
|
1274
1304
|
* Pauses a running dynamic workflow and returns its settled run envelope.
|
|
1275
1305
|
*
|
|
@@ -1277,7 +1307,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1277
1307
|
*
|
|
1278
1308
|
* @returns Complete current or terminal workflow run envelope.
|
|
1279
1309
|
*/
|
|
1280
|
-
pause: async (params) => connection.sendRequest("session.workflow.pause", {
|
|
1310
|
+
pause: async (params) => connection.sendRequest("session.workflow.pause", { ...params, sessionId }),
|
|
1281
1311
|
/**
|
|
1282
1312
|
* Records a batch of ordered dynamic workflow progress lines.
|
|
1283
1313
|
*
|
|
@@ -1285,7 +1315,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1285
1315
|
*
|
|
1286
1316
|
* @returns Acknowledgement that a workflow request was accepted.
|
|
1287
1317
|
*/
|
|
1288
|
-
log: async (params) => connection.sendRequest("session.workflow.log", {
|
|
1318
|
+
log: async (params) => connection.sendRequest("session.workflow.log", { ...params, sessionId }),
|
|
1289
1319
|
/**
|
|
1290
1320
|
* Runs one dynamic-workflow-scoped subagent and returns its result.
|
|
1291
1321
|
*
|
|
@@ -1293,7 +1323,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1293
1323
|
*
|
|
1294
1324
|
* @returns Result of one workflow-scoped subagent call.
|
|
1295
1325
|
*/
|
|
1296
|
-
agent: async (params) => connection.sendRequest("session.workflow.agent", {
|
|
1326
|
+
agent: async (params) => connection.sendRequest("session.workflow.agent", { ...params, sessionId }),
|
|
1297
1327
|
/** @experimental */
|
|
1298
1328
|
journal: {
|
|
1299
1329
|
/**
|
|
@@ -1303,7 +1333,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1303
1333
|
*
|
|
1304
1334
|
* @returns Result of reading a workflow journal entry.
|
|
1305
1335
|
*/
|
|
1306
|
-
get: async (params) => connection.sendRequest("session.workflow.journal.get", {
|
|
1336
|
+
get: async (params) => connection.sendRequest("session.workflow.journal.get", { ...params, sessionId }),
|
|
1307
1337
|
/**
|
|
1308
1338
|
* Stores a memoized dynamic workflow journal entry.
|
|
1309
1339
|
*
|
|
@@ -1311,7 +1341,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1311
1341
|
*
|
|
1312
1342
|
* @returns Acknowledgement that a workflow request was accepted.
|
|
1313
1343
|
*/
|
|
1314
|
-
put: async (params) => connection.sendRequest("session.workflow.journal.put", {
|
|
1344
|
+
put: async (params) => connection.sendRequest("session.workflow.journal.put", { ...params, sessionId })
|
|
1315
1345
|
}
|
|
1316
1346
|
},
|
|
1317
1347
|
/** @experimental */
|
|
@@ -1329,7 +1359,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1329
1359
|
*
|
|
1330
1360
|
* @returns The model identifier active on the session after the switch.
|
|
1331
1361
|
*/
|
|
1332
|
-
switchTo: async (params) => connection.sendRequest("session.model.switchTo", {
|
|
1362
|
+
switchTo: async (params) => connection.sendRequest("session.model.switchTo", { ...params, sessionId }),
|
|
1333
1363
|
/**
|
|
1334
1364
|
* 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`.
|
|
1335
1365
|
*
|
|
@@ -1337,7 +1367,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1337
1367
|
*
|
|
1338
1368
|
* @returns Immediate acknowledgement and Auto preference snapshot after a switch request. This result never implies that a pending preference committed.
|
|
1339
1369
|
*/
|
|
1340
|
-
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", {
|
|
1370
|
+
switchAutoTier: async (params) => connection.sendRequest("session.model.switchAutoTier", { ...params, sessionId }),
|
|
1341
1371
|
/**
|
|
1342
1372
|
* Replaces or clears the host-supplied model allowlist for a running session.
|
|
1343
1373
|
*
|
|
@@ -1345,7 +1375,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1345
1375
|
*
|
|
1346
1376
|
* @returns The applied host allowlist and effective session model policy after intersection.
|
|
1347
1377
|
*/
|
|
1348
|
-
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", {
|
|
1378
|
+
setAllowedModels: async (params) => connection.sendRequest("session.model.setAllowedModels", { ...params, sessionId }),
|
|
1349
1379
|
/**
|
|
1350
1380
|
* Updates the session's reasoning effort without changing the selected model.
|
|
1351
1381
|
*
|
|
@@ -1353,7 +1383,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1353
1383
|
*
|
|
1354
1384
|
* @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.
|
|
1355
1385
|
*/
|
|
1356
|
-
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", {
|
|
1386
|
+
setReasoningEffort: async (params) => connection.sendRequest("session.model.setReasoningEffort", { ...params, sessionId }),
|
|
1357
1387
|
/**
|
|
1358
1388
|
* 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.
|
|
1359
1389
|
*
|
|
@@ -1361,7 +1391,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1361
1391
|
*
|
|
1362
1392
|
* @returns The list of models available to this session.
|
|
1363
1393
|
*/
|
|
1364
|
-
list: async (params) => connection.sendRequest("session.model.list", {
|
|
1394
|
+
list: async (params) => connection.sendRequest("session.model.list", { ...params, sessionId })
|
|
1365
1395
|
},
|
|
1366
1396
|
/** @experimental */
|
|
1367
1397
|
mode: {
|
|
@@ -1378,7 +1408,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1378
1408
|
*
|
|
1379
1409
|
* @returns Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.
|
|
1380
1410
|
*/
|
|
1381
|
-
set: async (params) => connection.sendRequest("session.mode.set", {
|
|
1411
|
+
set: async (params) => connection.sendRequest("session.mode.set", { ...params, sessionId })
|
|
1382
1412
|
},
|
|
1383
1413
|
/** @experimental */
|
|
1384
1414
|
name: {
|
|
@@ -1393,7 +1423,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1393
1423
|
*
|
|
1394
1424
|
* @param params New friendly name to apply to the session.
|
|
1395
1425
|
*/
|
|
1396
|
-
set: async (params) => connection.sendRequest("session.name.set", {
|
|
1426
|
+
set: async (params) => connection.sendRequest("session.name.set", { ...params, sessionId }),
|
|
1397
1427
|
/**
|
|
1398
1428
|
* Persists an auto-generated session summary as the session's name when no user-set name exists.
|
|
1399
1429
|
*
|
|
@@ -1401,7 +1431,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1401
1431
|
*
|
|
1402
1432
|
* @returns Indicates whether the auto-generated summary was applied as the session's name.
|
|
1403
1433
|
*/
|
|
1404
|
-
setAuto: async (params) => connection.sendRequest("session.name.setAuto", {
|
|
1434
|
+
setAuto: async (params) => connection.sendRequest("session.name.setAuto", { ...params, sessionId })
|
|
1405
1435
|
},
|
|
1406
1436
|
/** @experimental */
|
|
1407
1437
|
plan: {
|
|
@@ -1416,7 +1446,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1416
1446
|
*
|
|
1417
1447
|
* @param params Replacement contents to write to the session plan file.
|
|
1418
1448
|
*/
|
|
1419
|
-
update: async (params) => connection.sendRequest("session.plan.update", {
|
|
1449
|
+
update: async (params) => connection.sendRequest("session.plan.update", { ...params, sessionId }),
|
|
1420
1450
|
/**
|
|
1421
1451
|
* Deletes the session plan file from the workspace.
|
|
1422
1452
|
*/
|
|
@@ -1449,7 +1479,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1449
1479
|
*
|
|
1450
1480
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1451
1481
|
*/
|
|
1452
|
-
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", {
|
|
1482
|
+
updateMetadata: async (params) => connection.sendRequest("session.workspaces.updateMetadata", { ...params, sessionId }),
|
|
1453
1483
|
/**
|
|
1454
1484
|
* Ensures a local session workspace exists and returns it.
|
|
1455
1485
|
*
|
|
@@ -1457,7 +1487,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1457
1487
|
*
|
|
1458
1488
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1459
1489
|
*/
|
|
1460
|
-
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", {
|
|
1490
|
+
ensure: async (params) => connection.sendRequest("session.workspaces.ensure", { ...params, sessionId }),
|
|
1461
1491
|
/**
|
|
1462
1492
|
* Lists files stored in the session workspace files directory.
|
|
1463
1493
|
*
|
|
@@ -1471,13 +1501,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1471
1501
|
*
|
|
1472
1502
|
* @returns Contents of the requested workspace file as a UTF-8 string.
|
|
1473
1503
|
*/
|
|
1474
|
-
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", {
|
|
1504
|
+
readFile: async (params) => connection.sendRequest("session.workspaces.readFile", { ...params, sessionId }),
|
|
1475
1505
|
/**
|
|
1476
1506
|
* Creates or overwrites a file in the session workspace files directory.
|
|
1477
1507
|
*
|
|
1478
1508
|
* @param params Relative path and UTF-8 content for the workspace file to create or overwrite.
|
|
1479
1509
|
*/
|
|
1480
|
-
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", {
|
|
1510
|
+
createFile: async (params) => connection.sendRequest("session.workspaces.createFile", { ...params, sessionId }),
|
|
1481
1511
|
/**
|
|
1482
1512
|
* Returns metadata for a file or directory in the session workspace files directory.
|
|
1483
1513
|
*
|
|
@@ -1485,25 +1515,25 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1485
1515
|
*
|
|
1486
1516
|
* @returns Filesystem metadata for a path in the session workspace files directory.
|
|
1487
1517
|
*/
|
|
1488
|
-
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", {
|
|
1518
|
+
statFile: async (params) => connection.sendRequest("session.workspaces.statFile", { ...params, sessionId }),
|
|
1489
1519
|
/**
|
|
1490
1520
|
* Creates a directory in the session workspace files directory.
|
|
1491
1521
|
*
|
|
1492
1522
|
* @param params Directory to create within the session workspace files directory.
|
|
1493
1523
|
*/
|
|
1494
|
-
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", {
|
|
1524
|
+
createDirectory: async (params) => connection.sendRequest("session.workspaces.createDirectory", { ...params, sessionId }),
|
|
1495
1525
|
/**
|
|
1496
1526
|
* Removes a file or directory from the session workspace files directory.
|
|
1497
1527
|
*
|
|
1498
1528
|
* @param params File or directory to remove from the session workspace files directory.
|
|
1499
1529
|
*/
|
|
1500
|
-
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", {
|
|
1530
|
+
removePath: async (params) => connection.sendRequest("session.workspaces.removePath", { ...params, sessionId }),
|
|
1501
1531
|
/**
|
|
1502
1532
|
* Renames a file or directory within the session workspace files directory.
|
|
1503
1533
|
*
|
|
1504
1534
|
* @param params Source and destination paths for a rename within the session workspace files directory.
|
|
1505
1535
|
*/
|
|
1506
|
-
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", {
|
|
1536
|
+
renamePath: async (params) => connection.sendRequest("session.workspaces.renamePath", { ...params, sessionId }),
|
|
1507
1537
|
/**
|
|
1508
1538
|
* Lists workspace checkpoints in chronological order.
|
|
1509
1539
|
*
|
|
@@ -1517,7 +1547,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1517
1547
|
*
|
|
1518
1548
|
* @returns Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.
|
|
1519
1549
|
*/
|
|
1520
|
-
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", {
|
|
1550
|
+
readCheckpoint: async (params) => connection.sendRequest("session.workspaces.readCheckpoint", { ...params, sessionId }),
|
|
1521
1551
|
/**
|
|
1522
1552
|
* Adds a compaction summary checkpoint to the local session workspace.
|
|
1523
1553
|
*
|
|
@@ -1525,7 +1555,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1525
1555
|
*
|
|
1526
1556
|
* @returns Persisted summary metadata and refreshed workspace metadata.
|
|
1527
1557
|
*/
|
|
1528
|
-
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", {
|
|
1558
|
+
addSummary: async (params) => connection.sendRequest("session.workspaces.addSummary", { ...params, sessionId }),
|
|
1529
1559
|
/**
|
|
1530
1560
|
* Truncates local workspace compaction summaries after a rollback.
|
|
1531
1561
|
*
|
|
@@ -1533,7 +1563,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1533
1563
|
*
|
|
1534
1564
|
* @returns Current workspace metadata for the session, including its absolute filesystem path when available.
|
|
1535
1565
|
*/
|
|
1536
|
-
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", {
|
|
1566
|
+
truncateSummaries: async (params) => connection.sendRequest("session.workspaces.truncateSummaries", { ...params, sessionId }),
|
|
1537
1567
|
/**
|
|
1538
1568
|
* Reads the autopilot objective state file from the local session workspace.
|
|
1539
1569
|
*
|
|
@@ -1547,7 +1577,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1547
1577
|
*
|
|
1548
1578
|
* @returns Result of writing the autopilot objective file.
|
|
1549
1579
|
*/
|
|
1550
|
-
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", {
|
|
1580
|
+
writeAutopilotObjective: async (params) => connection.sendRequest("session.workspaces.writeAutopilotObjective", { ...params, sessionId }),
|
|
1551
1581
|
/**
|
|
1552
1582
|
* Deletes the autopilot objective state file from the local session workspace.
|
|
1553
1583
|
*
|
|
@@ -1567,7 +1597,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1567
1597
|
*
|
|
1568
1598
|
* @returns Descriptor for the saved paste file, or null when the workspace is unavailable.
|
|
1569
1599
|
*/
|
|
1570
|
-
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", {
|
|
1600
|
+
saveLargePaste: async (params) => connection.sendRequest("session.workspaces.saveLargePaste", { ...params, sessionId }),
|
|
1571
1601
|
/**
|
|
1572
1602
|
* 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`.
|
|
1573
1603
|
*
|
|
@@ -1575,7 +1605,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1575
1605
|
*
|
|
1576
1606
|
* @returns Workspace diff result for the requested mode.
|
|
1577
1607
|
*/
|
|
1578
|
-
diff: async (params) => connection.sendRequest("session.workspaces.diff", {
|
|
1608
|
+
diff: async (params) => connection.sendRequest("session.workspaces.diff", { ...params, sessionId })
|
|
1579
1609
|
},
|
|
1580
1610
|
/** @experimental */
|
|
1581
1611
|
autopilotObjective: {
|
|
@@ -1601,7 +1631,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1601
1631
|
*
|
|
1602
1632
|
* @returns Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.
|
|
1603
1633
|
*/
|
|
1604
|
-
request: async (params) => connection.sendRequest("session.completions.request", {
|
|
1634
|
+
request: async (params) => connection.sendRequest("session.completions.request", { ...params, sessionId })
|
|
1605
1635
|
},
|
|
1606
1636
|
/** @experimental */
|
|
1607
1637
|
instructions: {
|
|
@@ -1634,7 +1664,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1634
1664
|
*
|
|
1635
1665
|
* @returns Indicates whether fleet mode was successfully activated.
|
|
1636
1666
|
*/
|
|
1637
|
-
start: async (params) => connection.sendRequest("session.fleet.start", {
|
|
1667
|
+
start: async (params) => connection.sendRequest("session.fleet.start", { ...params, sessionId })
|
|
1638
1668
|
},
|
|
1639
1669
|
/** @experimental */
|
|
1640
1670
|
agent: {
|
|
@@ -1645,13 +1675,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1645
1675
|
*
|
|
1646
1676
|
* @returns Agents available to the session.
|
|
1647
1677
|
*/
|
|
1648
|
-
list: async (params) => connection.sendRequest("session.agent.list", {
|
|
1678
|
+
list: async (params) => connection.sendRequest("session.agent.list", { ...params, sessionId }),
|
|
1649
1679
|
/**
|
|
1650
1680
|
* 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.
|
|
1651
1681
|
*
|
|
1652
1682
|
* @param params An in-memory authored prompt override for an available agent.
|
|
1653
1683
|
*/
|
|
1654
|
-
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", {
|
|
1684
|
+
setPrompt: async (params) => connection.sendRequest("session.agent.setPrompt", { ...params, sessionId }),
|
|
1655
1685
|
/**
|
|
1656
1686
|
* Gets the currently selected custom agent for the session.
|
|
1657
1687
|
*
|
|
@@ -1665,7 +1695,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1665
1695
|
*
|
|
1666
1696
|
* @returns The newly selected custom agent.
|
|
1667
1697
|
*/
|
|
1668
|
-
select: async (params) => connection.sendRequest("session.agent.select", {
|
|
1698
|
+
select: async (params) => connection.sendRequest("session.agent.select", { ...params, sessionId }),
|
|
1669
1699
|
/**
|
|
1670
1700
|
* Clears the selected custom agent and returns the session to the default agent.
|
|
1671
1701
|
*/
|
|
@@ -1686,7 +1716,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1686
1716
|
*
|
|
1687
1717
|
* @returns Identifier assigned to the newly started background agent task.
|
|
1688
1718
|
*/
|
|
1689
|
-
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", {
|
|
1719
|
+
startAgent: async (params) => connection.sendRequest("session.tasks.startAgent", { ...params, sessionId }),
|
|
1690
1720
|
/**
|
|
1691
1721
|
* Lists background tasks tracked by the session.
|
|
1692
1722
|
*
|
|
@@ -1700,7 +1730,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1700
1730
|
*
|
|
1701
1731
|
* @returns Result of registering or reclaiming a client-owned task.
|
|
1702
1732
|
*/
|
|
1703
|
-
register: async (params) => connection.sendRequest("session.tasks.register", {
|
|
1733
|
+
register: async (params) => connection.sendRequest("session.tasks.register", { ...params, sessionId }),
|
|
1704
1734
|
/**
|
|
1705
1735
|
* Publishes generic progress or a terminal outcome for a client-owned task.
|
|
1706
1736
|
*
|
|
@@ -1708,7 +1738,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1708
1738
|
*
|
|
1709
1739
|
* @returns Result of publishing a client-owned task update.
|
|
1710
1740
|
*/
|
|
1711
|
-
update: async (params) => connection.sendRequest("session.tasks.update", {
|
|
1741
|
+
update: async (params) => connection.sendRequest("session.tasks.update", { ...params, sessionId }),
|
|
1712
1742
|
/**
|
|
1713
1743
|
* Refreshes metadata for any detached background shells the runtime knows about.
|
|
1714
1744
|
*
|
|
@@ -1728,7 +1758,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1728
1758
|
*
|
|
1729
1759
|
* @returns Progress information for the task, or null when no task with that ID is tracked.
|
|
1730
1760
|
*/
|
|
1731
|
-
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", {
|
|
1761
|
+
getProgress: async (params) => connection.sendRequest("session.tasks.getProgress", { ...params, sessionId }),
|
|
1732
1762
|
/**
|
|
1733
1763
|
* Returns the first sync-waiting task that can currently be promoted to background mode.
|
|
1734
1764
|
*
|
|
@@ -1742,7 +1772,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1742
1772
|
*
|
|
1743
1773
|
* @returns Indicates whether the task was successfully promoted to background mode.
|
|
1744
1774
|
*/
|
|
1745
|
-
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", {
|
|
1775
|
+
promoteToBackground: async (params) => connection.sendRequest("session.tasks.promoteToBackground", { ...params, sessionId }),
|
|
1746
1776
|
/**
|
|
1747
1777
|
* Atomically promotes the first promotable sync-waiting task to background mode and returns it.
|
|
1748
1778
|
*
|
|
@@ -1756,7 +1786,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1756
1786
|
*
|
|
1757
1787
|
* @returns Indicates whether the background task was successfully cancelled.
|
|
1758
1788
|
*/
|
|
1759
|
-
cancel: async (params) => connection.sendRequest("session.tasks.cancel", {
|
|
1789
|
+
cancel: async (params) => connection.sendRequest("session.tasks.cancel", { ...params, sessionId }),
|
|
1760
1790
|
/**
|
|
1761
1791
|
* Removes a completed or cancelled background task from tracking.
|
|
1762
1792
|
*
|
|
@@ -1764,7 +1794,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1764
1794
|
*
|
|
1765
1795
|
* @returns Indicates whether the task was removed. False when the task does not exist or is still running/idle.
|
|
1766
1796
|
*/
|
|
1767
|
-
remove: async (params) => connection.sendRequest("session.tasks.remove", {
|
|
1797
|
+
remove: async (params) => connection.sendRequest("session.tasks.remove", { ...params, sessionId }),
|
|
1768
1798
|
/**
|
|
1769
1799
|
* Sends a message to a background agent task.
|
|
1770
1800
|
*
|
|
@@ -1772,7 +1802,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1772
1802
|
*
|
|
1773
1803
|
* @returns Indicates whether the message was delivered, with an error message when delivery failed.
|
|
1774
1804
|
*/
|
|
1775
|
-
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", {
|
|
1805
|
+
sendMessage: async (params) => connection.sendRequest("session.tasks.sendMessage", { ...params, sessionId })
|
|
1776
1806
|
},
|
|
1777
1807
|
/** @experimental */
|
|
1778
1808
|
skills: {
|
|
@@ -1793,13 +1823,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1793
1823
|
*
|
|
1794
1824
|
* @param params Name of the skill to enable for the session.
|
|
1795
1825
|
*/
|
|
1796
|
-
enable: async (params) => connection.sendRequest("session.skills.enable", {
|
|
1826
|
+
enable: async (params) => connection.sendRequest("session.skills.enable", { ...params, sessionId }),
|
|
1797
1827
|
/**
|
|
1798
1828
|
* Disables a skill for the session.
|
|
1799
1829
|
*
|
|
1800
1830
|
* @param params Name of the skill to disable for the session.
|
|
1801
1831
|
*/
|
|
1802
|
-
disable: async (params) => connection.sendRequest("session.skills.disable", {
|
|
1832
|
+
disable: async (params) => connection.sendRequest("session.skills.disable", { ...params, sessionId }),
|
|
1803
1833
|
/**
|
|
1804
1834
|
* Reloads skill definitions for the session.
|
|
1805
1835
|
*
|
|
@@ -1826,19 +1856,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1826
1856
|
*
|
|
1827
1857
|
* @returns Tools exposed by the connected MCP server. Throws when the server is not connected.
|
|
1828
1858
|
*/
|
|
1829
|
-
listTools: async (params) => connection.sendRequest("session.mcp.listTools", {
|
|
1859
|
+
listTools: async (params) => connection.sendRequest("session.mcp.listTools", { ...params, sessionId }),
|
|
1830
1860
|
/**
|
|
1831
1861
|
* Enables an MCP server for the session.
|
|
1832
1862
|
*
|
|
1833
1863
|
* @param params Name of the MCP server to enable for the session.
|
|
1834
1864
|
*/
|
|
1835
|
-
enable: async (params) => connection.sendRequest("session.mcp.enable", {
|
|
1865
|
+
enable: async (params) => connection.sendRequest("session.mcp.enable", { ...params, sessionId }),
|
|
1836
1866
|
/**
|
|
1837
1867
|
* Disables an MCP server for the session.
|
|
1838
1868
|
*
|
|
1839
1869
|
* @param params Name of the MCP server to disable for the session.
|
|
1840
1870
|
*/
|
|
1841
|
-
disable: async (params) => connection.sendRequest("session.mcp.disable", {
|
|
1871
|
+
disable: async (params) => connection.sendRequest("session.mcp.disable", { ...params, sessionId }),
|
|
1842
1872
|
/**
|
|
1843
1873
|
* Reloads MCP server connections for the session.
|
|
1844
1874
|
*/
|
|
@@ -1856,7 +1886,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1856
1886
|
*
|
|
1857
1887
|
* @returns Outcome of an MCP sampling execution: success result, failure error, or cancellation.
|
|
1858
1888
|
*/
|
|
1859
|
-
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", {
|
|
1889
|
+
executeSampling: async (params) => connection.sendRequest("session.mcp.executeSampling", { ...params, sessionId }),
|
|
1860
1890
|
/**
|
|
1861
1891
|
* Cancels an in-flight MCP sampling execution by request ID.
|
|
1862
1892
|
*
|
|
@@ -1864,7 +1894,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1864
1894
|
*
|
|
1865
1895
|
* @returns Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.
|
|
1866
1896
|
*/
|
|
1867
|
-
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", {
|
|
1897
|
+
cancelSamplingExecution: async (params) => connection.sendRequest("session.mcp.cancelSamplingExecution", { ...params, sessionId }),
|
|
1868
1898
|
/**
|
|
1869
1899
|
* Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).
|
|
1870
1900
|
*
|
|
@@ -1872,7 +1902,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1872
1902
|
*
|
|
1873
1903
|
* @returns Env-value mode recorded on the session after the update.
|
|
1874
1904
|
*/
|
|
1875
|
-
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", {
|
|
1905
|
+
setEnvValueMode: async (params) => connection.sendRequest("session.mcp.setEnvValueMode", { ...params, sessionId }),
|
|
1876
1906
|
/**
|
|
1877
1907
|
* Removes the auto-managed `github` MCP server when present.
|
|
1878
1908
|
*
|
|
@@ -1884,19 +1914,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1884
1914
|
*
|
|
1885
1915
|
* @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.
|
|
1886
1916
|
*/
|
|
1887
|
-
startServer: async (params) => connection.sendRequest("session.mcp.startServer", {
|
|
1917
|
+
startServer: async (params) => connection.sendRequest("session.mcp.startServer", { ...params, sessionId }),
|
|
1888
1918
|
/**
|
|
1889
1919
|
* 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.*`).
|
|
1890
1920
|
*
|
|
1891
1921
|
* @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.
|
|
1892
1922
|
*/
|
|
1893
|
-
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", {
|
|
1923
|
+
restartServer: async (params) => connection.sendRequest("session.mcp.restartServer", { ...params, sessionId }),
|
|
1894
1924
|
/**
|
|
1895
1925
|
* Stops an individual MCP server on the session's host.
|
|
1896
1926
|
*
|
|
1897
1927
|
* @param params Server name for an individual MCP server stop.
|
|
1898
1928
|
*/
|
|
1899
|
-
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", {
|
|
1929
|
+
stopServer: async (params) => connection.sendRequest("session.mcp.stopServer", { ...params, sessionId }),
|
|
1900
1930
|
/**
|
|
1901
1931
|
* Checks whether a named MCP server is currently running on the session's host.
|
|
1902
1932
|
*
|
|
@@ -1904,7 +1934,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1904
1934
|
*
|
|
1905
1935
|
* @returns Whether the named MCP server is running.
|
|
1906
1936
|
*/
|
|
1907
|
-
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", {
|
|
1937
|
+
isServerRunning: async (params) => connection.sendRequest("session.mcp.isServerRunning", { ...params, sessionId }),
|
|
1908
1938
|
/** @experimental */
|
|
1909
1939
|
oauth: {
|
|
1910
1940
|
/**
|
|
@@ -1914,13 +1944,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1914
1944
|
*
|
|
1915
1945
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1916
1946
|
*/
|
|
1917
|
-
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", {
|
|
1947
|
+
handlePendingRequest: async (params) => connection.sendRequest("session.mcp.oauth.handlePendingRequest", { ...params, sessionId }),
|
|
1918
1948
|
/**
|
|
1919
1949
|
* Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed.
|
|
1920
1950
|
*
|
|
1921
1951
|
* @param params Identifies the MCP server whose persisted OAuth credentials were updated.
|
|
1922
1952
|
*/
|
|
1923
|
-
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", {
|
|
1953
|
+
authenticationStateChanged: async (params) => connection.sendRequest("session.mcp.oauth.authenticationStateChanged", { ...params, sessionId }),
|
|
1924
1954
|
/**
|
|
1925
1955
|
* 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.
|
|
1926
1956
|
*
|
|
@@ -1928,15 +1958,21 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1928
1958
|
*
|
|
1929
1959
|
* @returns An inert runtime-issued login handle. Preparation alone performs no activation or OAuth work.
|
|
1930
1960
|
*/
|
|
1931
|
-
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", {
|
|
1961
|
+
prepareLogin: async (params) => connection.sendRequest("session.mcp.oauth.prepareLogin", { ...params, sessionId }),
|
|
1932
1962
|
/**
|
|
1933
1963
|
* 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.
|
|
1934
1964
|
*
|
|
1935
|
-
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback
|
|
1965
|
+
* @param params Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback handling, and static OAuth client selection.
|
|
1936
1966
|
*
|
|
1937
1967
|
* @returns OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.
|
|
1938
1968
|
*/
|
|
1939
|
-
login: async (params) => connection.sendRequest("session.mcp.oauth.login", {
|
|
1969
|
+
login: async (params) => connection.sendRequest("session.mcp.oauth.login", { ...params, sessionId }),
|
|
1970
|
+
/**
|
|
1971
|
+
* Completes a runtime-managed MCP OAuth login after the authorization server redirects to a host-managed callback URL.
|
|
1972
|
+
*
|
|
1973
|
+
* @param params Host-delivered callback for a runtime-managed MCP OAuth login.
|
|
1974
|
+
*/
|
|
1975
|
+
complete: async (params) => connection.sendRequest("session.mcp.oauth.complete", { ...params, sessionId }),
|
|
1940
1976
|
/**
|
|
1941
1977
|
* 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.
|
|
1942
1978
|
*
|
|
@@ -1944,7 +1980,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1944
1980
|
*
|
|
1945
1981
|
* @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.
|
|
1946
1982
|
*/
|
|
1947
|
-
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", {
|
|
1983
|
+
probe: async (params) => connection.sendRequest("session.mcp.oauth.probe", { ...params, sessionId }),
|
|
1948
1984
|
/**
|
|
1949
1985
|
* Cancels the exact owned OAuth login issued to this original session requester, without clearing shared credentials.
|
|
1950
1986
|
*
|
|
@@ -1952,7 +1988,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1952
1988
|
*
|
|
1953
1989
|
* @returns Honest terminal cancellation result; persistence or recovery failures remain RPC errors.
|
|
1954
1990
|
*/
|
|
1955
|
-
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", {
|
|
1991
|
+
cancelLogin: async (params) => connection.sendRequest("session.mcp.oauth.cancelLogin", { ...params, sessionId }),
|
|
1956
1992
|
/**
|
|
1957
1993
|
* Responds to a pending MCP OAuth authorization request by its request id.
|
|
1958
1994
|
*
|
|
@@ -1960,7 +1996,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1960
1996
|
*
|
|
1961
1997
|
* @returns Indicates whether the pending MCP OAuth response was accepted.
|
|
1962
1998
|
*/
|
|
1963
|
-
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", {
|
|
1999
|
+
respond: async (params) => connection.sendRequest("session.mcp.oauth.respond", { ...params, sessionId })
|
|
1964
2000
|
},
|
|
1965
2001
|
/** @experimental */
|
|
1966
2002
|
headers: {
|
|
@@ -1971,7 +2007,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1971
2007
|
*
|
|
1972
2008
|
* @returns Indicates whether the pending MCP headers refresh response was accepted.
|
|
1973
2009
|
*/
|
|
1974
|
-
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", {
|
|
2010
|
+
handlePendingHeadersRefreshRequest: async (params) => connection.sendRequest("session.mcp.headers.handlePendingHeadersRefreshRequest", { ...params, sessionId })
|
|
1975
2011
|
},
|
|
1976
2012
|
/** @experimental */
|
|
1977
2013
|
apps: {
|
|
@@ -1982,7 +2018,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1982
2018
|
*
|
|
1983
2019
|
* @returns Resource contents returned by the MCP server.
|
|
1984
2020
|
*/
|
|
1985
|
-
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", {
|
|
2021
|
+
readResource: async (params) => connection.sendRequest("session.mcp.apps.readResource", { ...params, sessionId }),
|
|
1986
2022
|
/**
|
|
1987
2023
|
* 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"`.
|
|
1988
2024
|
*
|
|
@@ -1990,7 +2026,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1990
2026
|
*
|
|
1991
2027
|
* @returns App-callable tools from the named MCP server.
|
|
1992
2028
|
*/
|
|
1993
|
-
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", {
|
|
2029
|
+
listTools: async (params) => connection.sendRequest("session.mcp.apps.listTools", { ...params, sessionId }),
|
|
1994
2030
|
/**
|
|
1995
2031
|
* 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`.
|
|
1996
2032
|
*
|
|
@@ -1998,13 +2034,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1998
2034
|
*
|
|
1999
2035
|
* @returns Standard MCP CallToolResult
|
|
2000
2036
|
*/
|
|
2001
|
-
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", {
|
|
2037
|
+
callTool: async (params) => connection.sendRequest("session.mcp.apps.callTool", { ...params, sessionId }),
|
|
2002
2038
|
/**
|
|
2003
2039
|
* 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.
|
|
2004
2040
|
*
|
|
2005
2041
|
* @param params Host context to advertise to MCP App guests.
|
|
2006
2042
|
*/
|
|
2007
|
-
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", {
|
|
2043
|
+
setHostContext: async (params) => connection.sendRequest("session.mcp.apps.setHostContext", { ...params, sessionId }),
|
|
2008
2044
|
/**
|
|
2009
2045
|
* Read the current host context advertised to MCP App guests.
|
|
2010
2046
|
*
|
|
@@ -2018,7 +2054,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2018
2054
|
*
|
|
2019
2055
|
* @returns Diagnostic snapshot of MCP Apps wiring for the named server.
|
|
2020
2056
|
*/
|
|
2021
|
-
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", {
|
|
2057
|
+
diagnose: async (params) => connection.sendRequest("session.mcp.apps.diagnose", { ...params, sessionId })
|
|
2022
2058
|
},
|
|
2023
2059
|
/** @experimental */
|
|
2024
2060
|
resources: {
|
|
@@ -2029,7 +2065,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2029
2065
|
*
|
|
2030
2066
|
* @returns Resource contents returned by the MCP server.
|
|
2031
2067
|
*/
|
|
2032
|
-
read: async (params) => connection.sendRequest("session.mcp.resources.read", {
|
|
2068
|
+
read: async (params) => connection.sendRequest("session.mcp.resources.read", { ...params, sessionId }),
|
|
2033
2069
|
/**
|
|
2034
2070
|
* Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
2035
2071
|
*
|
|
@@ -2037,7 +2073,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2037
2073
|
*
|
|
2038
2074
|
* @returns One page of resources advertised by the named MCP server.
|
|
2039
2075
|
*/
|
|
2040
|
-
list: async (params) => connection.sendRequest("session.mcp.resources.list", {
|
|
2076
|
+
list: async (params) => connection.sendRequest("session.mcp.resources.list", { ...params, sessionId }),
|
|
2041
2077
|
/**
|
|
2042
2078
|
* 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`.
|
|
2043
2079
|
*
|
|
@@ -2045,7 +2081,26 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2045
2081
|
*
|
|
2046
2082
|
* @returns One page of resource templates advertised by the named MCP server.
|
|
2047
2083
|
*/
|
|
2048
|
-
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", {
|
|
2084
|
+
listTemplates: async (params) => connection.sendRequest("session.mcp.resources.listTemplates", { ...params, sessionId })
|
|
2085
|
+
},
|
|
2086
|
+
/** @experimental */
|
|
2087
|
+
prompts: {
|
|
2088
|
+
/**
|
|
2089
|
+
* Enumerate one page of prompts a connected MCP server exposes (proxies MCP `prompts/list`). Pass `cursor` to continue from a prior result's `nextCursor`.
|
|
2090
|
+
*
|
|
2091
|
+
* @param params MCP server whose prompts to enumerate.
|
|
2092
|
+
*
|
|
2093
|
+
* @returns One page of prompts advertised by the named MCP server.
|
|
2094
|
+
*/
|
|
2095
|
+
list: async (params) => connection.sendRequest("session.mcp.prompts.list", { ...params, sessionId }),
|
|
2096
|
+
/**
|
|
2097
|
+
* 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.
|
|
2098
|
+
*
|
|
2099
|
+
* @param params MCP server, prompt name, and optional string-valued arguments.
|
|
2100
|
+
*
|
|
2101
|
+
* @returns Prompt messages returned by the MCP server without sending them to the model.
|
|
2102
|
+
*/
|
|
2103
|
+
get: async (params) => connection.sendRequest("session.mcp.prompts.get", { ...params, sessionId })
|
|
2049
2104
|
}
|
|
2050
2105
|
},
|
|
2051
2106
|
/** @experimental */
|
|
@@ -2057,7 +2112,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2057
2112
|
*
|
|
2058
2113
|
* @returns Per-source session diagnostics configuration.
|
|
2059
2114
|
*/
|
|
2060
|
-
configure: async (params) => connection.sendRequest("session.diagnostics.configure", {
|
|
2115
|
+
configure: async (params) => connection.sendRequest("session.diagnostics.configure", { ...params, sessionId }),
|
|
2061
2116
|
/**
|
|
2062
2117
|
* 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.
|
|
2063
2118
|
*
|
|
@@ -2065,7 +2120,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2065
2120
|
*
|
|
2066
2121
|
* @returns One cursor-addressed page of retained session diagnostics.
|
|
2067
2122
|
*/
|
|
2068
|
-
read: async (params) => connection.sendRequest("session.diagnostics.read", {
|
|
2123
|
+
read: async (params) => connection.sendRequest("session.diagnostics.read", { ...params, sessionId })
|
|
2069
2124
|
},
|
|
2070
2125
|
/** @experimental */
|
|
2071
2126
|
connectors: {
|
|
@@ -2075,6 +2130,12 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2075
2130
|
* @returns Feature detection and hard polling limits for the EXPERIMENTAL session connector API.
|
|
2076
2131
|
*/
|
|
2077
2132
|
getCapabilities: async () => connection.sendRequest("session.connectors.getCapabilities", { sessionId }),
|
|
2133
|
+
/**
|
|
2134
|
+
* Returns the session account selection, or null.
|
|
2135
|
+
*
|
|
2136
|
+
* @returns Session account selection, or null.
|
|
2137
|
+
*/
|
|
2138
|
+
getAccount: async () => connection.sendRequest("session.connectors.getAccount", { sessionId }),
|
|
2078
2139
|
/**
|
|
2079
2140
|
* Returns authoritative session Connector state from current availability, pinned account selection, cached catalog, and live MCP projection without performing a Connector service request.
|
|
2080
2141
|
*
|
|
@@ -2088,7 +2149,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2088
2149
|
*
|
|
2089
2150
|
* @returns Validated Connector catalog snapshot cached by the session.
|
|
2090
2151
|
*/
|
|
2091
|
-
list: async (params) => connection.sendRequest("session.connectors.list", {
|
|
2152
|
+
list: async (params) => connection.sendRequest("session.connectors.list", { ...params, sessionId }),
|
|
2092
2153
|
/**
|
|
2093
2154
|
* Refreshes and validates the Connector catalog for the pinned opaque account selection.
|
|
2094
2155
|
*
|
|
@@ -2096,7 +2157,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2096
2157
|
*
|
|
2097
2158
|
* @returns Validated Connector catalog snapshot cached by the session.
|
|
2098
2159
|
*/
|
|
2099
|
-
refresh: async (params) => connection.sendRequest("session.connectors.refresh", {
|
|
2160
|
+
refresh: async (params) => connection.sendRequest("session.connectors.refresh", { ...params, sessionId }),
|
|
2100
2161
|
/**
|
|
2101
2162
|
* 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.
|
|
2102
2163
|
*
|
|
@@ -2104,7 +2165,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2104
2165
|
*
|
|
2105
2166
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2106
2167
|
*/
|
|
2107
|
-
connect: async (params) => connection.sendRequest("session.connectors.connect", {
|
|
2168
|
+
connect: async (params) => connection.sendRequest("session.connectors.connect", { ...params, sessionId }),
|
|
2108
2169
|
/**
|
|
2109
2170
|
* Re-initiates an idempotent Connector connection request without browser or UI effects, with the same typed outcomes as connect.
|
|
2110
2171
|
*
|
|
@@ -2112,7 +2173,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2112
2173
|
*
|
|
2113
2174
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2114
2175
|
*/
|
|
2115
|
-
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", {
|
|
2176
|
+
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", { ...params, sessionId }),
|
|
2116
2177
|
/**
|
|
2117
2178
|
* Continues a pending Connector connection with caller-supplied attempt, interval, and deadline bounds. The runtime never opens the returned consent URL.
|
|
2118
2179
|
*
|
|
@@ -2120,7 +2181,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2120
2181
|
*
|
|
2121
2182
|
* @returns Typed result of initiating or continuing a Connector connection.
|
|
2122
2183
|
*/
|
|
2123
|
-
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", {
|
|
2184
|
+
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", { ...params, sessionId }),
|
|
2124
2185
|
/**
|
|
2125
2186
|
* Disconnects one Connector for the pinned opaque account selection, refreshes the authoritative catalog, and removes its session-owned MCP projection.
|
|
2126
2187
|
*
|
|
@@ -2128,7 +2189,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2128
2189
|
*
|
|
2129
2190
|
* @returns Authoritative result after disconnect and MCP reconciliation.
|
|
2130
2191
|
*/
|
|
2131
|
-
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", {
|
|
2192
|
+
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", { ...params, sessionId }),
|
|
2132
2193
|
/**
|
|
2133
2194
|
* Reconciles the authoritative cached or freshly requested Connector catalog into the session Connector MCP projection and returns live status.
|
|
2134
2195
|
*
|
|
@@ -2136,14 +2197,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2136
2197
|
*
|
|
2137
2198
|
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
2138
2199
|
*/
|
|
2139
|
-
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", {
|
|
2200
|
+
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", { ...params, sessionId })
|
|
2140
2201
|
},
|
|
2141
2202
|
/** @experimental */
|
|
2142
2203
|
managedSettings: {
|
|
2143
2204
|
/**
|
|
2144
2205
|
* 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.
|
|
2145
2206
|
*
|
|
2146
|
-
* @returns
|
|
2207
|
+
* @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.
|
|
2147
2208
|
*/
|
|
2148
2209
|
get: async () => connection.sendRequest("session.managedSettings.get", { sessionId })
|
|
2149
2210
|
},
|
|
@@ -2162,13 +2223,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2162
2223
|
*
|
|
2163
2224
|
* @returns Result of installing a plugin.
|
|
2164
2225
|
*/
|
|
2165
|
-
install: async (params) => connection.sendRequest("session.plugins.install", {
|
|
2226
|
+
install: async (params) => connection.sendRequest("session.plugins.install", { ...params, sessionId }),
|
|
2166
2227
|
/**
|
|
2167
2228
|
* Uninstalls a plugin when permitted by the live session's retained managed policy.
|
|
2168
2229
|
*
|
|
2169
2230
|
* @param params Name (or spec) of the plugin to uninstall.
|
|
2170
2231
|
*/
|
|
2171
|
-
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", {
|
|
2232
|
+
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { ...params, sessionId }),
|
|
2172
2233
|
/**
|
|
2173
2234
|
* Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
2174
2235
|
*
|
|
@@ -2176,19 +2237,19 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2176
2237
|
*
|
|
2177
2238
|
* @returns Result of updating a single plugin.
|
|
2178
2239
|
*/
|
|
2179
|
-
update: async (params) => connection.sendRequest("session.plugins.update", {
|
|
2240
|
+
update: async (params) => connection.sendRequest("session.plugins.update", { ...params, sessionId }),
|
|
2180
2241
|
/**
|
|
2181
2242
|
* Enables installed plugins when permitted by the live session's retained managed policy.
|
|
2182
2243
|
*
|
|
2183
2244
|
* @param params Plugin names (or specs) to enable in the session's authoritative working directory.
|
|
2184
2245
|
*/
|
|
2185
|
-
enable: async (params) => connection.sendRequest("session.plugins.enable", {
|
|
2246
|
+
enable: async (params) => connection.sendRequest("session.plugins.enable", { ...params, sessionId }),
|
|
2186
2247
|
/**
|
|
2187
2248
|
* Disables installed plugins when permitted by the live session's retained managed policy.
|
|
2188
2249
|
*
|
|
2189
2250
|
* @param params Plugin names (or specs) to disable in the session's authoritative working directory.
|
|
2190
2251
|
*/
|
|
2191
|
-
disable: async (params) => connection.sendRequest("session.plugins.disable", {
|
|
2252
|
+
disable: async (params) => connection.sendRequest("session.plugins.disable", { ...params, sessionId }),
|
|
2192
2253
|
/** @experimental */
|
|
2193
2254
|
marketplaces: {
|
|
2194
2255
|
/**
|
|
@@ -2204,7 +2265,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2204
2265
|
*
|
|
2205
2266
|
* @returns Result of registering a new marketplace.
|
|
2206
2267
|
*/
|
|
2207
|
-
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", {
|
|
2268
|
+
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { ...params, sessionId }),
|
|
2208
2269
|
/**
|
|
2209
2270
|
* Removes a marketplace when permitted by the live session's retained managed policy.
|
|
2210
2271
|
*
|
|
@@ -2212,7 +2273,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2212
2273
|
*
|
|
2213
2274
|
* @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
|
|
2214
2275
|
*/
|
|
2215
|
-
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", {
|
|
2276
|
+
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { ...params, sessionId }),
|
|
2216
2277
|
/**
|
|
2217
2278
|
* Browses a marketplace resolved through the live session's working directory and retained managed policy.
|
|
2218
2279
|
*
|
|
@@ -2220,7 +2281,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2220
2281
|
*
|
|
2221
2282
|
* @returns Plugins advertised by the marketplace.
|
|
2222
2283
|
*/
|
|
2223
|
-
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", {
|
|
2284
|
+
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { ...params, sessionId }),
|
|
2224
2285
|
/**
|
|
2225
2286
|
* Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
|
|
2226
2287
|
*
|
|
@@ -2228,14 +2289,14 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2228
2289
|
*
|
|
2229
2290
|
* @returns Result of refreshing one or more marketplace catalogs.
|
|
2230
2291
|
*/
|
|
2231
|
-
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", {
|
|
2292
|
+
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { ...params, sessionId })
|
|
2232
2293
|
},
|
|
2233
2294
|
/**
|
|
2234
2295
|
* 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.
|
|
2235
2296
|
*
|
|
2236
2297
|
* @param params Optional flags controlling which side effects the reload performs.
|
|
2237
2298
|
*/
|
|
2238
|
-
reload: async (params) => connection.sendRequest("session.plugins.reload", {
|
|
2299
|
+
reload: async (params) => connection.sendRequest("session.plugins.reload", { ...params, sessionId })
|
|
2239
2300
|
},
|
|
2240
2301
|
/** @experimental */
|
|
2241
2302
|
provider: {
|
|
@@ -2246,7 +2307,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2246
2307
|
*
|
|
2247
2308
|
* @returns A snapshot of the provider endpoint the session is currently configured to talk to.
|
|
2248
2309
|
*/
|
|
2249
|
-
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", {
|
|
2310
|
+
getEndpoint: async (params) => connection.sendRequest("session.provider.getEndpoint", { ...params, sessionId }),
|
|
2250
2311
|
/**
|
|
2251
2312
|
* 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.
|
|
2252
2313
|
*
|
|
@@ -2254,7 +2315,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2254
2315
|
*
|
|
2255
2316
|
* @returns The selectable model entries synthesized for the models added by this call.
|
|
2256
2317
|
*/
|
|
2257
|
-
add: async (params) => connection.sendRequest("session.provider.add", {
|
|
2318
|
+
add: async (params) => connection.sendRequest("session.provider.add", { ...params, sessionId }),
|
|
2258
2319
|
/**
|
|
2259
2320
|
* 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.
|
|
2260
2321
|
*
|
|
@@ -2262,7 +2323,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2262
2323
|
*
|
|
2263
2324
|
* @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
|
|
2264
2325
|
*/
|
|
2265
|
-
sync: async (params) => connection.sendRequest("session.provider.sync", {
|
|
2326
|
+
sync: async (params) => connection.sendRequest("session.provider.sync", { ...params, sessionId }),
|
|
2266
2327
|
/**
|
|
2267
2328
|
* 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.
|
|
2268
2329
|
*
|
|
@@ -2270,7 +2331,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2270
2331
|
*
|
|
2271
2332
|
* @returns What the withdrawal actually removed from the registry.
|
|
2272
2333
|
*/
|
|
2273
|
-
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", {
|
|
2334
|
+
withdraw: async (params) => connection.sendRequest("session.provider.withdraw", { ...params, sessionId })
|
|
2274
2335
|
},
|
|
2275
2336
|
/** @experimental */
|
|
2276
2337
|
options: {
|
|
@@ -2281,7 +2342,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2281
2342
|
*
|
|
2282
2343
|
* @returns Indicates whether the session options patch was applied successfully.
|
|
2283
2344
|
*/
|
|
2284
|
-
update: async (params) => connection.sendRequest("session.options.update", {
|
|
2345
|
+
update: async (params) => connection.sendRequest("session.options.update", { ...params, sessionId })
|
|
2285
2346
|
},
|
|
2286
2347
|
/** @experimental */
|
|
2287
2348
|
lsp: {
|
|
@@ -2290,7 +2351,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2290
2351
|
*
|
|
2291
2352
|
* @param params Parameters for (re)loading the merged LSP configuration set.
|
|
2292
2353
|
*/
|
|
2293
|
-
initialize: async (params) => connection.sendRequest("session.lsp.initialize", {
|
|
2354
|
+
initialize: async (params) => connection.sendRequest("session.lsp.initialize", { ...params, sessionId })
|
|
2294
2355
|
},
|
|
2295
2356
|
/** @experimental */
|
|
2296
2357
|
extensions: {
|
|
@@ -2305,13 +2366,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2305
2366
|
*
|
|
2306
2367
|
* @param params Source-qualified extension identifier to enable for the session.
|
|
2307
2368
|
*/
|
|
2308
|
-
enable: async (params) => connection.sendRequest("session.extensions.enable", {
|
|
2369
|
+
enable: async (params) => connection.sendRequest("session.extensions.enable", { ...params, sessionId }),
|
|
2309
2370
|
/**
|
|
2310
2371
|
* Disables an extension for the session.
|
|
2311
2372
|
*
|
|
2312
2373
|
* @param params Source-qualified extension identifier to disable for the session.
|
|
2313
2374
|
*/
|
|
2314
|
-
disable: async (params) => connection.sendRequest("session.extensions.disable", {
|
|
2375
|
+
disable: async (params) => connection.sendRequest("session.extensions.disable", { ...params, sessionId }),
|
|
2315
2376
|
/**
|
|
2316
2377
|
* Reloads extension definitions and processes for the session.
|
|
2317
2378
|
*/
|
|
@@ -2321,7 +2382,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2321
2382
|
*
|
|
2322
2383
|
* @param params Parameters for session.extensions.sendAttachmentsToMessage.
|
|
2323
2384
|
*/
|
|
2324
|
-
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", {
|
|
2385
|
+
sendAttachmentsToMessage: async (params) => connection.sendRequest("session.extensions.sendAttachmentsToMessage", { ...params, sessionId })
|
|
2325
2386
|
},
|
|
2326
2387
|
/** @experimental */
|
|
2327
2388
|
tools: {
|
|
@@ -2332,7 +2393,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2332
2393
|
*
|
|
2333
2394
|
* @returns Canonical result returned by a session tool.
|
|
2334
2395
|
*/
|
|
2335
|
-
execute: async (params) => connection.sendRequest("session.tools.execute", {
|
|
2396
|
+
execute: async (params) => connection.sendRequest("session.tools.execute", { ...params, sessionId }),
|
|
2336
2397
|
/**
|
|
2337
2398
|
* Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.
|
|
2338
2399
|
*
|
|
@@ -2340,7 +2401,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2340
2401
|
*
|
|
2341
2402
|
* @returns Rust-owned built-in tool descriptors for the session.
|
|
2342
2403
|
*/
|
|
2343
|
-
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", {
|
|
2404
|
+
getBuiltinDescriptors: async (params) => connection.sendRequest("session.tools.getBuiltinDescriptors", { ...params, sessionId }),
|
|
2344
2405
|
/**
|
|
2345
2406
|
* Projects a completed task_complete tool call into its label-safe session event payload.
|
|
2346
2407
|
*
|
|
@@ -2348,7 +2409,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2348
2409
|
*
|
|
2349
2410
|
* @returns Task completion notification with summary from the agent
|
|
2350
2411
|
*/
|
|
2351
|
-
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", {
|
|
2412
|
+
taskCompleteEventData: async (params) => connection.sendRequest("session.tools.taskCompleteEventData", { ...params, sessionId }),
|
|
2352
2413
|
/**
|
|
2353
2414
|
* Provides the result for a pending external tool call.
|
|
2354
2415
|
*
|
|
@@ -2356,7 +2417,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2356
2417
|
*
|
|
2357
2418
|
* @returns Indicates whether the external tool call result was handled successfully.
|
|
2358
2419
|
*/
|
|
2359
|
-
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", {
|
|
2420
|
+
handlePendingToolCall: async (params) => connection.sendRequest("session.tools.handlePendingToolCall", { ...params, sessionId }),
|
|
2360
2421
|
/**
|
|
2361
2422
|
* Resolves, builds, and validates the runtime tool list for the session.
|
|
2362
2423
|
*
|
|
@@ -2376,7 +2437,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2376
2437
|
*
|
|
2377
2438
|
* @returns Empty result after replacing the calling connection's externally implemented tools.
|
|
2378
2439
|
*/
|
|
2379
|
-
set: async (params) => connection.sendRequest("session.tools.set", {
|
|
2440
|
+
set: async (params) => connection.sendRequest("session.tools.set", { ...params, sessionId }),
|
|
2380
2441
|
/**
|
|
2381
2442
|
* 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.
|
|
2382
2443
|
*
|
|
@@ -2384,7 +2445,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2384
2445
|
*
|
|
2385
2446
|
* @returns Empty result after applying subagent settings
|
|
2386
2447
|
*/
|
|
2387
|
-
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", {
|
|
2448
|
+
updateSubagentSettings: async (params) => connection.sendRequest("session.tools.updateSubagentSettings", { ...params, sessionId })
|
|
2388
2449
|
},
|
|
2389
2450
|
/** @experimental */
|
|
2390
2451
|
commands: {
|
|
@@ -2395,7 +2456,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2395
2456
|
*
|
|
2396
2457
|
* @returns Slash commands available in the session, after applying any include/exclude filters.
|
|
2397
2458
|
*/
|
|
2398
|
-
list: async (params) => connection.sendRequest("session.commands.list", {
|
|
2459
|
+
list: async (params) => connection.sendRequest("session.commands.list", { ...params, sessionId }),
|
|
2399
2460
|
/**
|
|
2400
2461
|
* Invokes a slash command in the session.
|
|
2401
2462
|
*
|
|
@@ -2403,7 +2464,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2403
2464
|
*
|
|
2404
2465
|
* @returns Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).
|
|
2405
2466
|
*/
|
|
2406
|
-
invoke: async (params) => connection.sendRequest("session.commands.invoke", {
|
|
2467
|
+
invoke: async (params) => connection.sendRequest("session.commands.invoke", { ...params, sessionId }),
|
|
2407
2468
|
/**
|
|
2408
2469
|
* Reports completion of a pending client-handled slash command.
|
|
2409
2470
|
*
|
|
@@ -2411,7 +2472,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2411
2472
|
*
|
|
2412
2473
|
* @returns Indicates whether the pending client-handled command was completed successfully.
|
|
2413
2474
|
*/
|
|
2414
|
-
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", {
|
|
2475
|
+
handlePendingCommand: async (params) => connection.sendRequest("session.commands.handlePendingCommand", { ...params, sessionId }),
|
|
2415
2476
|
/**
|
|
2416
2477
|
* Executes a slash command synchronously and returns any error.
|
|
2417
2478
|
*
|
|
@@ -2419,7 +2480,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2419
2480
|
*
|
|
2420
2481
|
* @returns Error message produced while executing the command, if any.
|
|
2421
2482
|
*/
|
|
2422
|
-
execute: async (params) => connection.sendRequest("session.commands.execute", {
|
|
2483
|
+
execute: async (params) => connection.sendRequest("session.commands.execute", { ...params, sessionId }),
|
|
2423
2484
|
/**
|
|
2424
2485
|
* Enqueues a slash command for FIFO processing on the local session.
|
|
2425
2486
|
*
|
|
@@ -2427,7 +2488,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2427
2488
|
*
|
|
2428
2489
|
* @returns Indicates whether the command was accepted into the local execution queue.
|
|
2429
2490
|
*/
|
|
2430
|
-
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", {
|
|
2491
|
+
enqueue: async (params) => connection.sendRequest("session.commands.enqueue", { ...params, sessionId }),
|
|
2431
2492
|
/**
|
|
2432
2493
|
* Reports whether the host actually executed a queued command and whether to continue processing.
|
|
2433
2494
|
*
|
|
@@ -2435,7 +2496,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2435
2496
|
*
|
|
2436
2497
|
* @returns Indicates whether the queued-command response was matched to a pending request.
|
|
2437
2498
|
*/
|
|
2438
|
-
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", {
|
|
2499
|
+
respondToQueuedCommand: async (params) => connection.sendRequest("session.commands.respondToQueuedCommand", { ...params, sessionId })
|
|
2439
2500
|
},
|
|
2440
2501
|
/** @experimental */
|
|
2441
2502
|
telemetry: {
|
|
@@ -2450,7 +2511,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2450
2511
|
*
|
|
2451
2512
|
* @param params Feature override key/value pairs to attach to subsequent telemetry events from this session.
|
|
2452
2513
|
*/
|
|
2453
|
-
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", {
|
|
2514
|
+
setFeatureOverrides: async (params) => connection.sendRequest("session.telemetry.setFeatureOverrides", { ...params, sessionId })
|
|
2454
2515
|
},
|
|
2455
2516
|
/** @experimental */
|
|
2456
2517
|
ui: {
|
|
@@ -2461,7 +2522,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2461
2522
|
*
|
|
2462
2523
|
* @returns Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.
|
|
2463
2524
|
*/
|
|
2464
|
-
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", {
|
|
2525
|
+
ephemeralQuery: async (params) => connection.sendRequest("session.ui.ephemeralQuery", { ...params, sessionId }),
|
|
2465
2526
|
/**
|
|
2466
2527
|
* Requests structured input from a UI-capable client.
|
|
2467
2528
|
*
|
|
@@ -2469,7 +2530,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2469
2530
|
*
|
|
2470
2531
|
* @returns The elicitation response (accept with form values, decline, or cancel)
|
|
2471
2532
|
*/
|
|
2472
|
-
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", {
|
|
2533
|
+
elicitation: async (params) => connection.sendRequest("session.ui.elicitation", { ...params, sessionId }),
|
|
2473
2534
|
/**
|
|
2474
2535
|
* Provides the user response for a pending elicitation request.
|
|
2475
2536
|
*
|
|
@@ -2477,7 +2538,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2477
2538
|
*
|
|
2478
2539
|
* @returns Indicates whether the elicitation response was accepted; false if it was already resolved by another client.
|
|
2479
2540
|
*/
|
|
2480
|
-
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", {
|
|
2541
|
+
handlePendingElicitation: async (params) => connection.sendRequest("session.ui.handlePendingElicitation", { ...params, sessionId }),
|
|
2481
2542
|
/**
|
|
2482
2543
|
* Resolves a pending `user_input.requested` event with the user's response.
|
|
2483
2544
|
*
|
|
@@ -2485,7 +2546,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2485
2546
|
*
|
|
2486
2547
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2487
2548
|
*/
|
|
2488
|
-
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", {
|
|
2549
|
+
handlePendingUserInput: async (params) => connection.sendRequest("session.ui.handlePendingUserInput", { ...params, sessionId }),
|
|
2489
2550
|
/**
|
|
2490
2551
|
* Resolves a pending `sampling.requested` event with a sampling result, or rejects it.
|
|
2491
2552
|
*
|
|
@@ -2493,7 +2554,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2493
2554
|
*
|
|
2494
2555
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2495
2556
|
*/
|
|
2496
|
-
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", {
|
|
2557
|
+
handlePendingSampling: async (params) => connection.sendRequest("session.ui.handlePendingSampling", { ...params, sessionId }),
|
|
2497
2558
|
/**
|
|
2498
2559
|
* Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision.
|
|
2499
2560
|
*
|
|
@@ -2501,7 +2562,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2501
2562
|
*
|
|
2502
2563
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2503
2564
|
*/
|
|
2504
|
-
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", {
|
|
2565
|
+
handlePendingAutoModeSwitch: async (params) => connection.sendRequest("session.ui.handlePendingAutoModeSwitch", { ...params, sessionId }),
|
|
2505
2566
|
/**
|
|
2506
2567
|
* Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action.
|
|
2507
2568
|
*
|
|
@@ -2509,7 +2570,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2509
2570
|
*
|
|
2510
2571
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2511
2572
|
*/
|
|
2512
|
-
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", {
|
|
2573
|
+
handlePendingSessionLimitsExhausted: async (params) => connection.sendRequest("session.ui.handlePendingSessionLimitsExhausted", { ...params, sessionId }),
|
|
2513
2574
|
/**
|
|
2514
2575
|
* Resolves a pending `exit_plan_mode.requested` event with the user's response.
|
|
2515
2576
|
*
|
|
@@ -2517,7 +2578,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2517
2578
|
*
|
|
2518
2579
|
* @returns Indicates whether the pending UI request was resolved by this call.
|
|
2519
2580
|
*/
|
|
2520
|
-
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", {
|
|
2581
|
+
handlePendingExitPlanMode: async (params) => connection.sendRequest("session.ui.handlePendingExitPlanMode", { ...params, sessionId }),
|
|
2521
2582
|
/**
|
|
2522
2583
|
* Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.
|
|
2523
2584
|
*
|
|
@@ -2531,7 +2592,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2531
2592
|
*
|
|
2532
2593
|
* @returns Indicates whether the handle was active and the registration count was decremented.
|
|
2533
2594
|
*/
|
|
2534
|
-
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", {
|
|
2595
|
+
unregisterDirectAutoModeSwitchHandler: async (params) => connection.sendRequest("session.ui.unregisterDirectAutoModeSwitchHandler", { ...params, sessionId })
|
|
2535
2596
|
},
|
|
2536
2597
|
/** @experimental */
|
|
2537
2598
|
permissions: {
|
|
@@ -2542,7 +2603,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2542
2603
|
*
|
|
2543
2604
|
* @returns Indicates whether the operation succeeded.
|
|
2544
2605
|
*/
|
|
2545
|
-
configure: async (params) => connection.sendRequest("session.permissions.configure", {
|
|
2606
|
+
configure: async (params) => connection.sendRequest("session.permissions.configure", { ...params, sessionId }),
|
|
2546
2607
|
/**
|
|
2547
2608
|
* Provides a decision for a pending tool permission request.
|
|
2548
2609
|
*
|
|
@@ -2550,7 +2611,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2550
2611
|
*
|
|
2551
2612
|
* @returns Indicates whether the permission decision was applied; false when the request was already resolved.
|
|
2552
2613
|
*/
|
|
2553
|
-
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", {
|
|
2614
|
+
handlePendingPermissionRequest: async (params) => connection.sendRequest("session.permissions.handlePendingPermissionRequest", { ...params, sessionId }),
|
|
2554
2615
|
/**
|
|
2555
2616
|
* Reconstructs the set of pending tool permission requests from the session's event history.
|
|
2556
2617
|
*
|
|
@@ -2564,7 +2625,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2564
2625
|
*
|
|
2565
2626
|
* @returns Indicates whether the operation succeeded.
|
|
2566
2627
|
*/
|
|
2567
|
-
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", {
|
|
2628
|
+
setApproveAll: async (params) => connection.sendRequest("session.permissions.setApproveAll", { ...params, sessionId }),
|
|
2568
2629
|
/**
|
|
2569
2630
|
* 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.
|
|
2570
2631
|
*
|
|
@@ -2572,7 +2633,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2572
2633
|
*
|
|
2573
2634
|
* @returns Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.
|
|
2574
2635
|
*/
|
|
2575
|
-
setMode: async (params) => connection.sendRequest("session.permissions.setMode", {
|
|
2636
|
+
setMode: async (params) => connection.sendRequest("session.permissions.setMode", { ...params, sessionId }),
|
|
2576
2637
|
/**
|
|
2577
2638
|
* Returns the current permission mode for the session.
|
|
2578
2639
|
*
|
|
@@ -2586,7 +2647,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2586
2647
|
*
|
|
2587
2648
|
* @returns Indicates whether the operation succeeded.
|
|
2588
2649
|
*/
|
|
2589
|
-
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", {
|
|
2650
|
+
modifyRules: async (params) => connection.sendRequest("session.permissions.modifyRules", { ...params, sessionId }),
|
|
2590
2651
|
/**
|
|
2591
2652
|
* Sets whether the client wants permission prompts bridged into session events.
|
|
2592
2653
|
*
|
|
@@ -2594,7 +2655,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2594
2655
|
*
|
|
2595
2656
|
* @returns Indicates whether the operation succeeded.
|
|
2596
2657
|
*/
|
|
2597
|
-
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", {
|
|
2658
|
+
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", { ...params, sessionId }),
|
|
2598
2659
|
/**
|
|
2599
2660
|
* Clears session-scoped tool approvals and, for full resets, exact session-approved paths.
|
|
2600
2661
|
*
|
|
@@ -2602,7 +2663,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2602
2663
|
*
|
|
2603
2664
|
* @returns Indicates whether the operation succeeded.
|
|
2604
2665
|
*/
|
|
2605
|
-
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", {
|
|
2666
|
+
resetSessionApprovals: async (params) => connection.sendRequest("session.permissions.resetSessionApprovals", { ...params, sessionId }),
|
|
2606
2667
|
/**
|
|
2607
2668
|
* Notifies the runtime that a permission prompt UI has been shown to the user.
|
|
2608
2669
|
*
|
|
@@ -2610,7 +2671,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2610
2671
|
*
|
|
2611
2672
|
* @returns Indicates whether the operation succeeded.
|
|
2612
2673
|
*/
|
|
2613
|
-
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", {
|
|
2674
|
+
notifyPromptShown: async (params) => connection.sendRequest("session.permissions.notifyPromptShown", { ...params, sessionId }),
|
|
2614
2675
|
/** @experimental */
|
|
2615
2676
|
paths: {
|
|
2616
2677
|
/**
|
|
@@ -2626,7 +2687,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2626
2687
|
*
|
|
2627
2688
|
* @returns Indicates whether the operation succeeded.
|
|
2628
2689
|
*/
|
|
2629
|
-
add: async (params) => connection.sendRequest("session.permissions.paths.add", {
|
|
2690
|
+
add: async (params) => connection.sendRequest("session.permissions.paths.add", { ...params, sessionId }),
|
|
2630
2691
|
/**
|
|
2631
2692
|
* Updates the session's primary working directory used by the permission policy.
|
|
2632
2693
|
*
|
|
@@ -2634,7 +2695,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2634
2695
|
*
|
|
2635
2696
|
* @returns Indicates whether the operation succeeded.
|
|
2636
2697
|
*/
|
|
2637
|
-
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", {
|
|
2698
|
+
updatePrimary: async (params) => connection.sendRequest("session.permissions.paths.updatePrimary", { ...params, sessionId }),
|
|
2638
2699
|
/**
|
|
2639
2700
|
* Reports whether a path falls within any of the session's allowed directories.
|
|
2640
2701
|
*
|
|
@@ -2642,7 +2703,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2642
2703
|
*
|
|
2643
2704
|
* @returns Indicates whether the supplied path is within the session's allowed directories.
|
|
2644
2705
|
*/
|
|
2645
|
-
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", {
|
|
2706
|
+
isPathWithinAllowedDirectories: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinAllowedDirectories", { ...params, sessionId }),
|
|
2646
2707
|
/**
|
|
2647
2708
|
* Reports whether a path falls within the session's workspace (primary) directory.
|
|
2648
2709
|
*
|
|
@@ -2650,7 +2711,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2650
2711
|
*
|
|
2651
2712
|
* @returns Indicates whether the supplied path is within the session's workspace directory.
|
|
2652
2713
|
*/
|
|
2653
|
-
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", {
|
|
2714
|
+
isPathWithinWorkspace: async (params) => connection.sendRequest("session.permissions.paths.isPathWithinWorkspace", { ...params, sessionId })
|
|
2654
2715
|
},
|
|
2655
2716
|
/** @experimental */
|
|
2656
2717
|
locations: {
|
|
@@ -2661,7 +2722,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2661
2722
|
*
|
|
2662
2723
|
* @returns Resolved location-permissions key and type.
|
|
2663
2724
|
*/
|
|
2664
|
-
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", {
|
|
2725
|
+
resolve: async (params) => connection.sendRequest("session.permissions.locations.resolve", { ...params, sessionId }),
|
|
2665
2726
|
/**
|
|
2666
2727
|
* Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service.
|
|
2667
2728
|
*
|
|
@@ -2669,7 +2730,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2669
2730
|
*
|
|
2670
2731
|
* @returns Summary of persisted location permissions applied to the session.
|
|
2671
2732
|
*/
|
|
2672
|
-
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", {
|
|
2733
|
+
apply: async (params) => connection.sendRequest("session.permissions.locations.apply", { ...params, sessionId }),
|
|
2673
2734
|
/**
|
|
2674
2735
|
* Persists a tool approval for a permission location and applies its rules to this session's live permission service.
|
|
2675
2736
|
*
|
|
@@ -2677,7 +2738,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2677
2738
|
*
|
|
2678
2739
|
* @returns Indicates whether the operation succeeded.
|
|
2679
2740
|
*/
|
|
2680
|
-
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", {
|
|
2741
|
+
addToolApproval: async (params) => connection.sendRequest("session.permissions.locations.addToolApproval", { ...params, sessionId })
|
|
2681
2742
|
},
|
|
2682
2743
|
/** @experimental */
|
|
2683
2744
|
folderTrust: {
|
|
@@ -2688,7 +2749,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2688
2749
|
*
|
|
2689
2750
|
* @returns Folder trust check result.
|
|
2690
2751
|
*/
|
|
2691
|
-
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", {
|
|
2752
|
+
isTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.isTrusted", { ...params, sessionId }),
|
|
2692
2753
|
/**
|
|
2693
2754
|
* Adds a folder to the user's trusted folders list.
|
|
2694
2755
|
*
|
|
@@ -2696,7 +2757,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2696
2757
|
*
|
|
2697
2758
|
* @returns Indicates whether the operation succeeded.
|
|
2698
2759
|
*/
|
|
2699
|
-
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", {
|
|
2760
|
+
addTrusted: async (params) => connection.sendRequest("session.permissions.folderTrust.addTrusted", { ...params, sessionId })
|
|
2700
2761
|
},
|
|
2701
2762
|
/** @experimental */
|
|
2702
2763
|
urls: {
|
|
@@ -2707,7 +2768,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2707
2768
|
*
|
|
2708
2769
|
* @returns Indicates whether the operation succeeded.
|
|
2709
2770
|
*/
|
|
2710
|
-
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", {
|
|
2771
|
+
setUnrestrictedMode: async (params) => connection.sendRequest("session.permissions.urls.setUnrestrictedMode", { ...params, sessionId })
|
|
2711
2772
|
}
|
|
2712
2773
|
},
|
|
2713
2774
|
/**
|
|
@@ -2719,7 +2780,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2719
2780
|
*
|
|
2720
2781
|
* @experimental
|
|
2721
2782
|
*/
|
|
2722
|
-
log: async (params) => connection.sendRequest("session.log", {
|
|
2783
|
+
log: async (params) => connection.sendRequest("session.log", { ...params, sessionId }),
|
|
2723
2784
|
/** @experimental */
|
|
2724
2785
|
metadata: {
|
|
2725
2786
|
/**
|
|
@@ -2741,7 +2802,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2741
2802
|
*
|
|
2742
2803
|
* @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.
|
|
2743
2804
|
*/
|
|
2744
|
-
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", {
|
|
2805
|
+
updateClientMetadata: async (params) => connection.sendRequest("session.metadata.updateClientMetadata", { ...params, sessionId }),
|
|
2745
2806
|
/**
|
|
2746
2807
|
* Reports whether the local session is currently processing user/agent messages.
|
|
2747
2808
|
*
|
|
@@ -2761,7 +2822,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2761
2822
|
*
|
|
2762
2823
|
* @returns Token breakdown for the session's current context window, or null if uninitialized.
|
|
2763
2824
|
*/
|
|
2764
|
-
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", {
|
|
2825
|
+
contextInfo: async (params) => connection.sendRequest("session.metadata.contextInfo", { ...params, sessionId }),
|
|
2765
2826
|
/**
|
|
2766
2827
|
* 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.
|
|
2767
2828
|
*
|
|
@@ -2775,7 +2836,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2775
2836
|
*
|
|
2776
2837
|
* @returns The heaviest individual messages in the session's context window, most-expensive first.
|
|
2777
2838
|
*/
|
|
2778
|
-
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", {
|
|
2839
|
+
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { ...params, sessionId }),
|
|
2779
2840
|
/**
|
|
2780
2841
|
* 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.
|
|
2781
2842
|
*
|
|
@@ -2783,7 +2844,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2783
2844
|
*
|
|
2784
2845
|
* @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.
|
|
2785
2846
|
*/
|
|
2786
|
-
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", {
|
|
2847
|
+
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", { ...params, sessionId }),
|
|
2787
2848
|
/**
|
|
2788
2849
|
* 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.
|
|
2789
2850
|
*
|
|
@@ -2791,7 +2852,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2791
2852
|
*
|
|
2792
2853
|
* @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.
|
|
2793
2854
|
*/
|
|
2794
|
-
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", {
|
|
2855
|
+
setWorkingDirectory: async (params) => connection.sendRequest("session.metadata.setWorkingDirectory", { ...params, sessionId }),
|
|
2795
2856
|
/**
|
|
2796
2857
|
* Re-tokenizes the session's existing messages against a model and returns aggregate token totals.
|
|
2797
2858
|
*
|
|
@@ -2799,7 +2860,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2799
2860
|
*
|
|
2800
2861
|
* @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.
|
|
2801
2862
|
*/
|
|
2802
|
-
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", {
|
|
2863
|
+
recomputeContextTokens: async (params) => connection.sendRequest("session.metadata.recomputeContextTokens", { ...params, sessionId })
|
|
2803
2864
|
},
|
|
2804
2865
|
/** @experimental */
|
|
2805
2866
|
contentExclusion: {
|
|
@@ -2810,18 +2871,18 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2810
2871
|
*
|
|
2811
2872
|
* @returns Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.
|
|
2812
2873
|
*/
|
|
2813
|
-
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", {
|
|
2874
|
+
checkPaths: async (params) => connection.sendRequest("session.contentExclusion.checkPaths", { ...params, sessionId })
|
|
2814
2875
|
},
|
|
2815
2876
|
/** @experimental */
|
|
2816
2877
|
shell: {
|
|
2817
2878
|
/**
|
|
2818
|
-
* Starts a shell command
|
|
2879
|
+
* 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.
|
|
2819
2880
|
*
|
|
2820
|
-
* @param params Shell command to run, with optional working directory and timeout in milliseconds.
|
|
2881
|
+
* @param params Shell command to run, with optional working directory and timeout in milliseconds. Spawn failures return an RPC error.
|
|
2821
2882
|
*
|
|
2822
|
-
* @returns Identifier of the spawned process,
|
|
2883
|
+
* @returns Identifier of the spawned shell process, usable with shell.kill while the process is running.
|
|
2823
2884
|
*/
|
|
2824
|
-
exec: async (params) => connection.sendRequest("session.shell.exec", {
|
|
2885
|
+
exec: async (params) => connection.sendRequest("session.shell.exec", { ...params, sessionId }),
|
|
2825
2886
|
/**
|
|
2826
2887
|
* 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.
|
|
2827
2888
|
*
|
|
@@ -2829,7 +2890,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2829
2890
|
*
|
|
2830
2891
|
* @returns Indicates whether the signal was delivered; false if the process was unknown or already exited.
|
|
2831
2892
|
*/
|
|
2832
|
-
kill: async (params) => connection.sendRequest("session.shell.kill", {
|
|
2893
|
+
kill: async (params) => connection.sendRequest("session.shell.kill", { ...params, sessionId }),
|
|
2833
2894
|
/**
|
|
2834
2895
|
* Executes a user-requested shell command through the session runtime.
|
|
2835
2896
|
*
|
|
@@ -2837,7 +2898,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2837
2898
|
*
|
|
2838
2899
|
* @returns Result of a user-requested shell command.
|
|
2839
2900
|
*/
|
|
2840
|
-
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", {
|
|
2901
|
+
executeUserRequested: async (params) => connection.sendRequest("session.shell.executeUserRequested", { ...params, sessionId }),
|
|
2841
2902
|
/**
|
|
2842
2903
|
* Cancels a user-requested shell command by request ID.
|
|
2843
2904
|
*
|
|
@@ -2845,7 +2906,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2845
2906
|
*
|
|
2846
2907
|
* @returns Cancellation result for a user-requested shell command.
|
|
2847
2908
|
*/
|
|
2848
|
-
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", {
|
|
2909
|
+
cancelUserRequested: async (params) => connection.sendRequest("session.shell.cancelUserRequested", { ...params, sessionId })
|
|
2849
2910
|
},
|
|
2850
2911
|
/** @experimental */
|
|
2851
2912
|
history: {
|
|
@@ -2856,7 +2917,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2856
2917
|
*
|
|
2857
2918
|
* @returns Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
|
|
2858
2919
|
*/
|
|
2859
|
-
compact: async (params) => connection.sendRequest("session.history.compact", {
|
|
2920
|
+
compact: async (params) => connection.sendRequest("session.history.compact", { ...params, sessionId }),
|
|
2860
2921
|
/**
|
|
2861
2922
|
* Truncates persisted session history to a specific event.
|
|
2862
2923
|
*
|
|
@@ -2864,7 +2925,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2864
2925
|
*
|
|
2865
2926
|
* @returns Number of events that were removed by the truncation.
|
|
2866
2927
|
*/
|
|
2867
|
-
truncate: async (params) => connection.sendRequest("session.history.truncate", {
|
|
2928
|
+
truncate: async (params) => connection.sendRequest("session.history.truncate", { ...params, sessionId }),
|
|
2868
2929
|
/**
|
|
2869
2930
|
* 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.
|
|
2870
2931
|
*
|
|
@@ -2878,7 +2939,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2878
2939
|
*
|
|
2879
2940
|
* @returns Files and aggregate changes for a prospective rewind.
|
|
2880
2941
|
*/
|
|
2881
|
-
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", {
|
|
2942
|
+
previewRewind: async (params) => connection.sendRequest("session.history.previewRewind", { ...params, sessionId }),
|
|
2882
2943
|
/**
|
|
2883
2944
|
* 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.
|
|
2884
2945
|
*
|
|
@@ -2886,7 +2947,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2886
2947
|
*
|
|
2887
2948
|
* @returns Structured outcome of a rewind request.
|
|
2888
2949
|
*/
|
|
2889
|
-
rewind: async (params) => connection.sendRequest("session.history.rewind", {
|
|
2950
|
+
rewind: async (params) => connection.sendRequest("session.history.rewind", { ...params, sessionId }),
|
|
2890
2951
|
/**
|
|
2891
2952
|
* Cancels any in-progress background compaction on a local session.
|
|
2892
2953
|
*
|
|
@@ -2912,7 +2973,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2912
2973
|
*
|
|
2913
2974
|
* @returns What a successful clear removed. A clear that could not be applied rejects instead of reporting a count.
|
|
2914
2975
|
*/
|
|
2915
|
-
clearContext: async (params) => connection.sendRequest("session.history.clearContext", {
|
|
2976
|
+
clearContext: async (params) => connection.sendRequest("session.history.clearContext", { ...params, sessionId })
|
|
2916
2977
|
},
|
|
2917
2978
|
/** @experimental */
|
|
2918
2979
|
queue: {
|
|
@@ -2929,7 +2990,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2929
2990
|
*
|
|
2930
2991
|
* @returns Result of moving a queued item.
|
|
2931
2992
|
*/
|
|
2932
|
-
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", {
|
|
2993
|
+
moveItem: async (params) => connection.sendRequest("session.queue.moveItem", { ...params, sessionId }),
|
|
2933
2994
|
/**
|
|
2934
2995
|
* Inserts a new queued message at a public visible position.
|
|
2935
2996
|
*
|
|
@@ -2937,7 +2998,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2937
2998
|
*
|
|
2938
2999
|
* @returns Result of inserting a queued message.
|
|
2939
3000
|
*/
|
|
2940
|
-
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", {
|
|
3001
|
+
insertAt: async (params) => connection.sendRequest("session.queue.insertAt", { ...params, sessionId }),
|
|
2941
3002
|
/**
|
|
2942
3003
|
* Removes an addressable queued item by its stable id.
|
|
2943
3004
|
*
|
|
@@ -2945,7 +3006,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2945
3006
|
*
|
|
2946
3007
|
* @returns Result of removing a queued item.
|
|
2947
3008
|
*/
|
|
2948
|
-
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", {
|
|
3009
|
+
removeAt: async (params) => connection.sendRequest("session.queue.removeAt", { ...params, sessionId }),
|
|
2949
3010
|
/**
|
|
2950
3011
|
* Updates the text of an addressable single-message queue item.
|
|
2951
3012
|
*
|
|
@@ -2953,7 +3014,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2953
3014
|
*
|
|
2954
3015
|
* @returns Result of editing a queued message.
|
|
2955
3016
|
*/
|
|
2956
|
-
updateText: async (params) => connection.sendRequest("session.queue.updateText", {
|
|
3017
|
+
updateText: async (params) => connection.sendRequest("session.queue.updateText", { ...params, sessionId }),
|
|
2957
3018
|
/**
|
|
2958
3019
|
* 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.
|
|
2959
3020
|
*
|
|
@@ -2961,7 +3022,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2961
3022
|
*
|
|
2962
3023
|
* @returns Result of withdrawing a user message.
|
|
2963
3024
|
*/
|
|
2964
|
-
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", {
|
|
3025
|
+
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { ...params, sessionId }),
|
|
2965
3026
|
/**
|
|
2966
3027
|
* Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
|
|
2967
3028
|
*
|
|
@@ -2969,7 +3030,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2969
3030
|
*
|
|
2970
3031
|
* @returns Result of editing a queued message.
|
|
2971
3032
|
*/
|
|
2972
|
-
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", {
|
|
3033
|
+
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { ...params, sessionId }),
|
|
2973
3034
|
/**
|
|
2974
3035
|
* Duplicates an addressable queued item immediately after its source.
|
|
2975
3036
|
*
|
|
@@ -2977,13 +3038,13 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2977
3038
|
*
|
|
2978
3039
|
* @returns Result of duplicating a queued item.
|
|
2979
3040
|
*/
|
|
2980
|
-
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", {
|
|
3041
|
+
duplicateAt: async (params) => connection.sendRequest("session.queue.duplicateAt", { ...params, sessionId }),
|
|
2981
3042
|
/**
|
|
2982
3043
|
* Acquires or releases the queued-lane drain pause.
|
|
2983
3044
|
*
|
|
2984
3045
|
* @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.
|
|
2985
3046
|
*/
|
|
2986
|
-
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", {
|
|
3047
|
+
setDrainPaused: async (params) => connection.sendRequest("session.queue.setDrainPaused", { ...params, sessionId }),
|
|
2987
3048
|
/**
|
|
2988
3049
|
* Moves an addressable queued message into the live turn's steering lane.
|
|
2989
3050
|
*
|
|
@@ -2991,7 +3052,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2991
3052
|
*
|
|
2992
3053
|
* @returns Result of trying to steer a queued message into a live turn.
|
|
2993
3054
|
*/
|
|
2994
|
-
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", {
|
|
3055
|
+
sendNow: async (params) => connection.sendRequest("session.queue.sendNow", { ...params, sessionId }),
|
|
2995
3056
|
/**
|
|
2996
3057
|
* Removes the most recently queued user-facing item (LIFO).
|
|
2997
3058
|
*
|
|
@@ -3012,7 +3073,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3012
3073
|
*
|
|
3013
3074
|
* @returns Batch of session events returned by a read, with cursor and continuation metadata.
|
|
3014
3075
|
*/
|
|
3015
|
-
read: async (params) => connection.sendRequest("session.eventLog.read", {
|
|
3076
|
+
read: async (params) => connection.sendRequest("session.eventLog.read", { ...params, sessionId }),
|
|
3016
3077
|
/**
|
|
3017
3078
|
* Returns a snapshot of the current tail cursor without consuming events.
|
|
3018
3079
|
*
|
|
@@ -3026,7 +3087,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3026
3087
|
*
|
|
3027
3088
|
* @returns Opaque handle representing an event-type interest registration.
|
|
3028
3089
|
*/
|
|
3029
|
-
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", {
|
|
3090
|
+
registerInterest: async (params) => connection.sendRequest("session.eventLog.registerInterest", { ...params, sessionId }),
|
|
3030
3091
|
/**
|
|
3031
3092
|
* Releases a consumer's previously-registered interest in an event type.
|
|
3032
3093
|
*
|
|
@@ -3034,7 +3095,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3034
3095
|
*
|
|
3035
3096
|
* @returns Indicates whether the operation succeeded.
|
|
3036
3097
|
*/
|
|
3037
|
-
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", {
|
|
3098
|
+
releaseInterest: async (params) => connection.sendRequest("session.eventLog.releaseInterest", { ...params, sessionId })
|
|
3038
3099
|
},
|
|
3039
3100
|
/** @experimental */
|
|
3040
3101
|
usage: {
|
|
@@ -3054,7 +3115,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3054
3115
|
*
|
|
3055
3116
|
* @returns Prediction result. Available results include prediction details; unavailable results include an explicit reason.
|
|
3056
3117
|
*/
|
|
3057
|
-
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", {
|
|
3118
|
+
predict: async (params) => connection.sendRequest("session.limitPrediction.predict", { ...params, sessionId })
|
|
3058
3119
|
},
|
|
3059
3120
|
/** @experimental */
|
|
3060
3121
|
remote: {
|
|
@@ -3065,7 +3126,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3065
3126
|
*
|
|
3066
3127
|
* @returns GitHub URL for the session and a flag indicating whether remote steering is enabled.
|
|
3067
3128
|
*/
|
|
3068
|
-
enable: async (params) => connection.sendRequest("session.remote.enable", {
|
|
3129
|
+
enable: async (params) => connection.sendRequest("session.remote.enable", { ...params, sessionId }),
|
|
3069
3130
|
/**
|
|
3070
3131
|
* Disables remote session export and steering.
|
|
3071
3132
|
*/
|
|
@@ -3077,7 +3138,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3077
3138
|
*
|
|
3078
3139
|
* @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.
|
|
3079
3140
|
*/
|
|
3080
|
-
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", {
|
|
3141
|
+
notifySteerableChanged: async (params) => connection.sendRequest("session.remote.notifySteerableChanged", { ...params, sessionId })
|
|
3081
3142
|
},
|
|
3082
3143
|
/** @experimental */
|
|
3083
3144
|
visibility: {
|
|
@@ -3094,7 +3155,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3094
3155
|
*
|
|
3095
3156
|
* @returns Effective sharing status and shareable GitHub URL after updating session visibility.
|
|
3096
3157
|
*/
|
|
3097
|
-
set: async (params) => connection.sendRequest("session.visibility.set", {
|
|
3158
|
+
set: async (params) => connection.sendRequest("session.visibility.set", { ...params, sessionId })
|
|
3098
3159
|
},
|
|
3099
3160
|
/** @experimental */
|
|
3100
3161
|
schedule: {
|
|
@@ -3111,7 +3172,7 @@ function createSessionRpc(connection, sessionId) {
|
|
|
3111
3172
|
*
|
|
3112
3173
|
* @returns Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.
|
|
3113
3174
|
*/
|
|
3114
|
-
stop: async (params) => connection.sendRequest("session.schedule.stop", {
|
|
3175
|
+
stop: async (params) => connection.sendRequest("session.schedule.stop", { ...params, sessionId })
|
|
3115
3176
|
}
|
|
3116
3177
|
};
|
|
3117
3178
|
}
|
|
@@ -3124,7 +3185,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3124
3185
|
*
|
|
3125
3186
|
* @experimental
|
|
3126
3187
|
*/
|
|
3127
|
-
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", {
|
|
3188
|
+
sendSystemNotification: async (params) => connection.sendRequest("session.sendSystemNotification", { ...params, sessionId }),
|
|
3128
3189
|
/** @experimental */
|
|
3129
3190
|
gitHubAuth: {
|
|
3130
3191
|
/**
|
|
@@ -3152,13 +3213,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3152
3213
|
*
|
|
3153
3214
|
* @returns Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.
|
|
3154
3215
|
*/
|
|
3155
|
-
login: async (params) => connection.sendRequest("session.gitHubAuth.login", {
|
|
3216
|
+
login: async (params) => connection.sendRequest("session.gitHubAuth.login", { ...params, sessionId }),
|
|
3156
3217
|
/**
|
|
3157
3218
|
* Switches the session to another available authentication.
|
|
3158
3219
|
*
|
|
3159
3220
|
* @param params Parameters for switching the session's active authentication.
|
|
3160
3221
|
*/
|
|
3161
|
-
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", {
|
|
3222
|
+
switchToAuth: async (params) => connection.sendRequest("session.gitHubAuth.switchToAuth", { ...params, sessionId }),
|
|
3162
3223
|
/**
|
|
3163
3224
|
* Logs out the session's current GitHub authentication.
|
|
3164
3225
|
*
|
|
@@ -3172,7 +3233,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3172
3233
|
*
|
|
3173
3234
|
* @returns Whether the requested authentication was logged out.
|
|
3174
3235
|
*/
|
|
3175
|
-
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", {
|
|
3236
|
+
logoutUser: async (params) => connection.sendRequest("session.gitHubAuth.logoutUser", { ...params, sessionId }),
|
|
3176
3237
|
/**
|
|
3177
3238
|
* Gets validation errors from the most recent authentication attempt.
|
|
3178
3239
|
*
|
|
@@ -3189,13 +3250,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3189
3250
|
*
|
|
3190
3251
|
* @param params Internal canvas provider registration parameters.
|
|
3191
3252
|
*/
|
|
3192
|
-
register: async (params) => connection.sendRequest("session.canvas.provider.register", {
|
|
3253
|
+
register: async (params) => connection.sendRequest("session.canvas.provider.register", { ...params, sessionId }),
|
|
3193
3254
|
/**
|
|
3194
3255
|
* Unregisters an internal canvas provider connection.
|
|
3195
3256
|
*
|
|
3196
3257
|
* @param params Internal canvas provider unregistration parameters.
|
|
3197
3258
|
*/
|
|
3198
|
-
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", {
|
|
3259
|
+
unregister: async (params) => connection.sendRequest("session.canvas.provider.unregister", { ...params, sessionId })
|
|
3199
3260
|
}
|
|
3200
3261
|
},
|
|
3201
3262
|
/** @experimental */
|
|
@@ -3207,7 +3268,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3207
3268
|
*
|
|
3208
3269
|
* @returns Complete current or terminal workflow run envelope.
|
|
3209
3270
|
*/
|
|
3210
|
-
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", {
|
|
3271
|
+
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { ...params, sessionId }),
|
|
3211
3272
|
/**
|
|
3212
3273
|
* Internal tool-originated dynamic workflow resume.
|
|
3213
3274
|
*
|
|
@@ -3215,13 +3276,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3215
3276
|
*
|
|
3216
3277
|
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
3217
3278
|
*/
|
|
3218
|
-
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", {
|
|
3279
|
+
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { ...params, sessionId }),
|
|
3219
3280
|
/**
|
|
3220
3281
|
* Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
|
|
3221
3282
|
*
|
|
3222
3283
|
* @param params Parameters for an owned durable pause checkpoint.
|
|
3223
3284
|
*/
|
|
3224
|
-
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", {
|
|
3285
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { ...params, sessionId })
|
|
3225
3286
|
},
|
|
3226
3287
|
/** @experimental */
|
|
3227
3288
|
model: {
|
|
@@ -3232,7 +3293,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3232
3293
|
*
|
|
3233
3294
|
* @returns The model identifier active on the session after the switch.
|
|
3234
3295
|
*/
|
|
3235
|
-
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", {
|
|
3296
|
+
applyStartupOverlay: async (params) => connection.sendRequest("session.model.applyStartupOverlay", { ...params, sessionId })
|
|
3236
3297
|
},
|
|
3237
3298
|
/** @experimental */
|
|
3238
3299
|
mcp: {
|
|
@@ -3243,7 +3304,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3243
3304
|
*
|
|
3244
3305
|
* @returns MCP server startup filtering result.
|
|
3245
3306
|
*/
|
|
3246
|
-
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", {
|
|
3307
|
+
reloadWithConfig: async (params) => connection.sendRequest("session.mcp.reloadWithConfig", { ...params, sessionId }),
|
|
3247
3308
|
/**
|
|
3248
3309
|
* Configures the built-in GitHub MCP server for the session's current auth context.
|
|
3249
3310
|
*
|
|
@@ -3251,19 +3312,19 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3251
3312
|
*
|
|
3252
3313
|
* @returns Result of configuring GitHub MCP.
|
|
3253
3314
|
*/
|
|
3254
|
-
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", {
|
|
3315
|
+
configureGitHub: async (params) => connection.sendRequest("session.mcp.configureGitHub", { ...params, sessionId }),
|
|
3255
3316
|
/**
|
|
3256
3317
|
* 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.
|
|
3257
3318
|
*
|
|
3258
3319
|
* @param params Registration parameters for an external MCP client.
|
|
3259
3320
|
*/
|
|
3260
|
-
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", {
|
|
3321
|
+
registerExternalClient: async (params) => connection.sendRequest("session.mcp.registerExternalClient", { ...params, sessionId }),
|
|
3261
3322
|
/**
|
|
3262
3323
|
* 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.
|
|
3263
3324
|
*
|
|
3264
3325
|
* @param params Server name identifying the external client to remove.
|
|
3265
3326
|
*/
|
|
3266
|
-
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", {
|
|
3327
|
+
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { ...params, sessionId })
|
|
3267
3328
|
},
|
|
3268
3329
|
/** @experimental */
|
|
3269
3330
|
connectors: {
|
|
@@ -3274,7 +3335,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3274
3335
|
*
|
|
3275
3336
|
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3276
3337
|
*/
|
|
3277
|
-
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", {
|
|
3338
|
+
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", { ...params, sessionId }),
|
|
3278
3339
|
/**
|
|
3279
3340
|
* Removes the runtime-owned Connector MCP projection without changing service-side connections.
|
|
3280
3341
|
*
|
|
@@ -3291,7 +3352,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3291
3352
|
*
|
|
3292
3353
|
* @returns Whether finalizing the invocation effect succeeded, and the failure reason when it did not.
|
|
3293
3354
|
*/
|
|
3294
|
-
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", {
|
|
3355
|
+
finalizeInvocationEffect: async (params) => connection.sendRequest("session.commands.finalizeInvocationEffect", { ...params, sessionId })
|
|
3295
3356
|
},
|
|
3296
3357
|
/** @experimental */
|
|
3297
3358
|
settings: {
|
|
@@ -3308,7 +3369,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3308
3369
|
*
|
|
3309
3370
|
* @returns Result of evaluating a Rust-owned settings predicate.
|
|
3310
3371
|
*/
|
|
3311
|
-
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", {
|
|
3372
|
+
evaluatePredicate: async (params) => connection.sendRequest("session.settings.evaluatePredicate", { ...params, sessionId })
|
|
3312
3373
|
},
|
|
3313
3374
|
/** @experimental */
|
|
3314
3375
|
queue: {
|
|
@@ -3331,7 +3392,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3331
3392
|
*
|
|
3332
3393
|
* @returns Whether a deferred-idle drain should run.
|
|
3333
3394
|
*/
|
|
3334
|
-
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", {
|
|
3395
|
+
beginDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.beginDeferredIdleDrain", { ...params, sessionId }),
|
|
3335
3396
|
/**
|
|
3336
3397
|
* Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.
|
|
3337
3398
|
*
|
|
@@ -3339,13 +3400,13 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3339
3400
|
*
|
|
3340
3401
|
* @returns Action selected by the native deferred-idle drain.
|
|
3341
3402
|
*/
|
|
3342
|
-
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", {
|
|
3403
|
+
finishDeferredIdleDrain: async (params) => connection.sendRequest("session.queue.finishDeferredIdleDrain", { ...params, sessionId }),
|
|
3343
3404
|
/**
|
|
3344
3405
|
* Marks session.idle as deferred by native background work state.
|
|
3345
3406
|
*
|
|
3346
3407
|
* @param params Inputs for marking session.idle deferred in native state.
|
|
3347
3408
|
*/
|
|
3348
|
-
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", {
|
|
3409
|
+
deferSessionIdle: async (params) => connection.sendRequest("session.queue.deferSessionIdle", { ...params, sessionId }),
|
|
3349
3410
|
/**
|
|
3350
3411
|
* Consumes queued native system notifications matching an internal filter.
|
|
3351
3412
|
*
|
|
@@ -3353,7 +3414,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3353
3414
|
*
|
|
3354
3415
|
* @returns Indicates whether a user-facing pending item was removed.
|
|
3355
3416
|
*/
|
|
3356
|
-
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", {
|
|
3417
|
+
consumeSystemNotifications: async (params) => connection.sendRequest("session.queue.consumeSystemNotifications", { ...params, sessionId }),
|
|
3357
3418
|
/**
|
|
3358
3419
|
* Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.
|
|
3359
3420
|
*
|
|
@@ -3384,7 +3445,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3384
3445
|
*
|
|
3385
3446
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3386
3447
|
*/
|
|
3387
|
-
add: async (params) => connection.sendRequest("session.schedule.add", {
|
|
3448
|
+
add: async (params) => connection.sendRequest("session.schedule.add", { ...params, sessionId }),
|
|
3388
3449
|
/**
|
|
3389
3450
|
* Registers a recurring cron scheduled prompt.
|
|
3390
3451
|
*
|
|
@@ -3392,7 +3453,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3392
3453
|
*
|
|
3393
3454
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3394
3455
|
*/
|
|
3395
|
-
addCron: async (params) => connection.sendRequest("session.schedule.addCron", {
|
|
3456
|
+
addCron: async (params) => connection.sendRequest("session.schedule.addCron", { ...params, sessionId }),
|
|
3396
3457
|
/**
|
|
3397
3458
|
* Registers an absolute-time scheduled prompt.
|
|
3398
3459
|
*
|
|
@@ -3400,7 +3461,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3400
3461
|
*
|
|
3401
3462
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3402
3463
|
*/
|
|
3403
|
-
addAt: async (params) => connection.sendRequest("session.schedule.addAt", {
|
|
3464
|
+
addAt: async (params) => connection.sendRequest("session.schedule.addAt", { ...params, sessionId }),
|
|
3404
3465
|
/**
|
|
3405
3466
|
* Registers a self-paced scheduled prompt.
|
|
3406
3467
|
*
|
|
@@ -3408,7 +3469,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3408
3469
|
*
|
|
3409
3470
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3410
3471
|
*/
|
|
3411
|
-
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", {
|
|
3472
|
+
addSelfPaced: async (params) => connection.sendRequest("session.schedule.addSelfPaced", { ...params, sessionId }),
|
|
3412
3473
|
/**
|
|
3413
3474
|
* Re-arms an active self-paced scheduled prompt.
|
|
3414
3475
|
*
|
|
@@ -3416,7 +3477,7 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
3416
3477
|
*
|
|
3417
3478
|
* @returns Result of registering or re-arming a scheduled prompt.
|
|
3418
3479
|
*/
|
|
3419
|
-
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", {
|
|
3480
|
+
rearmSelfPaced: async (params) => connection.sendRequest("session.schedule.rearmSelfPaced", { ...params, sessionId })
|
|
3420
3481
|
}
|
|
3421
3482
|
};
|
|
3422
3483
|
}
|