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