orkestrator 2.39.6-beta → 2.39.8-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +114 -31
- package/dist/main.js +26836 -17707
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +771 -206
- package/resources/claude-bridge/dist/index.js +16297 -15163
- package/resources/codex-bridge/dist/index.js +401 -174
- package/resources/cursor-bridge/dist/index.js +563 -91
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +980 -280
- package/resources/pi-bridge/runtime/bun.lock +3 -0
- package/resources/pi-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/runtime/package.json +3 -0
- package/resources/pi-bridge/runtime/patches/@earendil-works%2Fpi-coding-agent@1.5.2.patch +26 -0
package/dist/client.js
CHANGED
|
@@ -71,6 +71,22 @@ var init_agent_platforms = __esm(() => {
|
|
|
71
71
|
]);
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
+
// ../protocol/src/timers.ts
|
|
75
|
+
function unref(handle) {
|
|
76
|
+
handle.unref?.();
|
|
77
|
+
return handle;
|
|
78
|
+
}
|
|
79
|
+
var unrefTimers;
|
|
80
|
+
var init_timers = __esm(() => {
|
|
81
|
+
unrefTimers = {
|
|
82
|
+
now: () => Date.now(),
|
|
83
|
+
setTimeout: (callback, ms) => unref(setTimeout(callback, ms)),
|
|
84
|
+
clearTimeout: (handle) => clearTimeout(handle),
|
|
85
|
+
setInterval: (callback, ms) => unref(setInterval(callback, ms)),
|
|
86
|
+
clearInterval: (handle) => clearInterval(handle)
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
|
|
74
90
|
// ../protocol/src/agent-account-auto-switch.ts
|
|
75
91
|
var AUTO_SWITCH_RESET_TOLERANCE_MS, WEEK_MINUTES, FIVE_HOUR_MINUTES;
|
|
76
92
|
var init_agent_account_auto_switch = __esm(() => {
|
|
@@ -222,7 +238,9 @@ var init_bridge = __esm(() => {
|
|
|
222
238
|
events: {
|
|
223
239
|
"idle-sweep.failed": "An idle sweep threw; the next tick retries.",
|
|
224
240
|
"shutdown.failed": "Releasing the bridge failed during shutdown; it still exits.",
|
|
225
|
-
"credential.not-hardened": "The bridge could not mark itself non-dumpable, so a same-uid process can read its memory; `reason` says why."
|
|
241
|
+
"credential.not-hardened": "The bridge could not mark itself non-dumpable, so a same-uid process can read its memory; `reason` says why.",
|
|
242
|
+
"replay-recorder.notice": "The provider-traffic recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
243
|
+
"replay-recorder.write-failed": "Writing a provider-traffic recording failed; its lines were dropped."
|
|
226
244
|
}
|
|
227
245
|
},
|
|
228
246
|
"bridge.acp": {
|
|
@@ -300,6 +318,8 @@ var init_bridge = __esm(() => {
|
|
|
300
318
|
"question.stale": "An answer arrived for a question no longer pending; the route answered stale.",
|
|
301
319
|
"question.wait-failed": "A parked question ended without an answer: cancelled, timed out or closed.",
|
|
302
320
|
"read-only-connection.bedrock-withheld": "A read-only turn did not take the user settings' Bedrock connection: it names no bearer token or static key pair, so the CLI would resolve AWS profiles, whose credential_process runs outside the read-only boundary.",
|
|
321
|
+
"rejoin.inventory-failed": "Re-reading a running CLI's pending requests on a rejoin failed; they stay unknown and the prompt is written anyway.",
|
|
322
|
+
"rejoin.inventory-read": "A prompt joined a running CLI and re-read the requests it still waits on; outcome is read, unsupported, timeout, failed or skipped.",
|
|
303
323
|
"runtime.ended-under-resumed-turn": "The Claude runtime ended while a resumed root turn was still open.",
|
|
304
324
|
"server.listening": "The HTTP server is listening.",
|
|
305
325
|
"server.starting": "The HTTP server is about to bind.",
|
|
@@ -323,7 +343,7 @@ var init_bridge = __esm(() => {
|
|
|
323
343
|
"sse.subscribe-requested": "A client asked to subscribe to the event stream.",
|
|
324
344
|
"sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
|
|
325
345
|
"task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
|
|
326
|
-
"task.details-persist-failed": "
|
|
346
|
+
"task.details-persist-failed": "Background task details could not be saved; the transcript remains available.",
|
|
327
347
|
"task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
|
|
328
348
|
"task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
|
|
329
349
|
"task.stop-route-failed": "The stop-task route failed.",
|
|
@@ -650,6 +670,7 @@ var init_environment = __esm(() => {
|
|
|
650
670
|
"cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
|
|
651
671
|
"isolation.port-block-unavailable": "No host port block could be reserved for a local environment; its processes start without the port variables. Environment id and error only.",
|
|
652
672
|
"project-seed.refused": "A project file the Environment Files setting matched was not copied into a new local worktree: a link, not a regular file, outside the project, too large, behind a link in the worktree, or over the match bounds. Path and reason only, never contents.",
|
|
673
|
+
"worktree.created": "A local worktree was recorded as running. `startPoint` names the resolution path, `resolveMs` measures base resolution, and `durationMs` measures provisioning the worktree. `creationToWorktreeReadyMs` spans creation through the durable running transition. Environment id and timings only.",
|
|
653
674
|
"rename.failed": "Naming an environment from its pending prompt failed for the first time.",
|
|
654
675
|
"rename.still-failing": "That rename is still failing; written at the 2nd, 4th, 8th... failure.",
|
|
655
676
|
"rename.recovered": "A rename from a pending prompt succeeded after failing.",
|
|
@@ -743,7 +764,8 @@ var init_gateway = __esm(() => {
|
|
|
743
764
|
"upgrade-rejected": "A terminal WebSocket upgrade was refused.",
|
|
744
765
|
"socket-error": "A terminal WebSocket reported an error.",
|
|
745
766
|
"subscription-failed": "A terminal subscription failed.",
|
|
746
|
-
"operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
|
|
767
|
+
"operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input.",
|
|
768
|
+
"size-release-failed": "A closed terminal WebSocket could not give up its client's size ownership; the lease still lapses."
|
|
747
769
|
}
|
|
748
770
|
},
|
|
749
771
|
"gateway.tailscale": {
|
|
@@ -773,6 +795,7 @@ var init_local_server = __esm(() => {
|
|
|
773
795
|
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
774
796
|
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
775
797
|
"server.stopping": "A local server is being stopped, for the fixed `reason` given.",
|
|
798
|
+
"bridge.port-taken": "Another process took a bridge's port between allocation and bind, so the start is retried on a fresh port; `attempt` is the attempt that lost the port.",
|
|
776
799
|
"bridge.started": {
|
|
777
800
|
description: "A local bridge process was spawned; `key` names its kind and environment.",
|
|
778
801
|
essential: true,
|
|
@@ -995,8 +1018,8 @@ var init_native_agent = __esm(() => {
|
|
|
995
1018
|
"steer.withdraw-failed": "A stop could not withdraw the user's steer still in a 2.x inbox, so it stays for the next run (to-do 8100 (retired)). Error class only.",
|
|
996
1019
|
"provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
|
|
997
1020
|
"location.reload-unconfirmed": "After a 2.x location reload, the wait for the rebuilt location's plugins failed or timed out; catalogues are re-read anyway. Error class or `plugins: timeout` only.",
|
|
998
|
-
"background.unreadable": "Whether a 2.x session still has background sub-
|
|
999
|
-
"background.stop-failed": "A stop could not interrupt one of a 2.x session's running background sub-agents. Error class only.",
|
|
1021
|
+
"background.unreadable": "Whether a 2.x session still has background work (sub-agents or shells) could not be read, so a workflow keeps waiting and a stop terminates no background shell. Error class only.",
|
|
1022
|
+
"background.stop-failed": "A stop could not interrupt one of a 2.x session's running background sub-agents or terminate one of its background shells. Error class only.",
|
|
1000
1023
|
"credential.legacy-reconciled": "A host 2.x database from before OpenCode 1.x was retired was reconciled with auth.json once. Counts of credentials written and removed only.",
|
|
1001
1024
|
"credential.legacy-reconcile-failed": "The one-time reconcile of a host 2.x database with auth.json failed; the next host start retries it. Error class only.",
|
|
1002
1025
|
"transcript.unknown-row": "A 2.x history row of a kind the transcript does not know was dropped (a newer server). Its kind name only, once per kind.",
|
|
@@ -1173,6 +1196,9 @@ var init_terminal = __esm(() => {
|
|
|
1173
1196
|
"session.stopped-while-disconnected": "A session ended while its event stream was down.",
|
|
1174
1197
|
"session.disconnect-failed": "Closing or detaching a terminal session failed.",
|
|
1175
1198
|
"session.resize-failed": "Resizing a terminal session failed, other than for a gone session.",
|
|
1199
|
+
"size.owner-changed": "Another client took over setting a shared terminal's size, by a claim or because nobody held it.",
|
|
1200
|
+
"size.owner-released": "A client gave up setting shared terminals' sizes: its view closed or its connection dropped.",
|
|
1201
|
+
"size.release-failed": "Giving up a terminal's size ownership failed; its lease still lapses.",
|
|
1176
1202
|
"session.id-stored": "A new backend session id was saved for a terminal tab.",
|
|
1177
1203
|
"session-key.environment-missing": "A local session key was built with no environment id.",
|
|
1178
1204
|
"clipboard.image-failed": "An image pasted into a terminal could not be saved.",
|
|
@@ -2027,6 +2053,24 @@ var init_linear = __esm(() => {
|
|
|
2027
2053
|
});
|
|
2028
2054
|
});
|
|
2029
2055
|
|
|
2056
|
+
// ../protocol/src/log-vocabulary/credentials.ts
|
|
2057
|
+
var CREDENTIALS_LOG_AREAS;
|
|
2058
|
+
var init_credentials = __esm(() => {
|
|
2059
|
+
init_define();
|
|
2060
|
+
CREDENTIALS_LOG_AREAS = defineLogAreas({
|
|
2061
|
+
credentials: {
|
|
2062
|
+
description: "Agent credentials: the credential vault, access requests, grants and the runs and requests that use them. Never a value, a command or output.",
|
|
2063
|
+
events: {
|
|
2064
|
+
"vault.keychain-unavailable": "The system keychain could not be used at startup, so saved values use the fallback store this backend reports in Settings.",
|
|
2065
|
+
"vault.read-failed": "Reading a credential value from the vault failed; the use is cancelled before anything runs.",
|
|
2066
|
+
"run.failed": "A credential run failed unexpectedly after it started; its operation is recorded as outcome unknown.",
|
|
2067
|
+
"sweep.failed": "The periodic expiry sweep failed; every use still checks expiry itself.",
|
|
2068
|
+
"start.failed": "The credential service could not start; agent credential tools are unavailable on this backend."
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
});
|
|
2072
|
+
});
|
|
2073
|
+
|
|
2030
2074
|
// ../protocol/src/log-vocabulary/usage-history.ts
|
|
2031
2075
|
var USAGE_HISTORY_LOG_AREAS;
|
|
2032
2076
|
var init_usage_history = __esm(() => {
|
|
@@ -2194,7 +2238,8 @@ var init_web_app = __esm(() => {
|
|
|
2194
2238
|
"environment.delete-failed": "Deleting an environment from the action bar failed.",
|
|
2195
2239
|
"merge.started": "A user-requested PR merge started.",
|
|
2196
2240
|
"merge.completed": "A user-requested PR merge command returned.",
|
|
2197
|
-
"merge.failed": "A user-requested PR merge failed."
|
|
2241
|
+
"merge.failed": "A user-requested PR merge failed.",
|
|
2242
|
+
"pr-target.repository-config-unavailable": "The project settings a PR or Resolve prompt takes its target branch from could not be read; the prompt falls back to main."
|
|
2198
2243
|
}
|
|
2199
2244
|
}
|
|
2200
2245
|
});
|
|
@@ -2242,6 +2287,8 @@ var init_web_chat = __esm(() => {
|
|
|
2242
2287
|
"question.dismiss-failed": "An agent's question could not be dismissed.",
|
|
2243
2288
|
"rich-block.render-failed": "A rich block's renderer failed and its source is shown instead.",
|
|
2244
2289
|
"rich-block.copy-failed": "A rich block's copy action could not write to the clipboard.",
|
|
2290
|
+
"plan.copy-failed": "A plan card's Markdown could not be copied to the clipboard.",
|
|
2291
|
+
"plan.export-failed": "A plan card's Markdown could not be saved as a file.",
|
|
2245
2292
|
"scroll-viewport.not-found": "The scroll viewport was still missing when polling for it ended."
|
|
2246
2293
|
}
|
|
2247
2294
|
},
|
|
@@ -2334,6 +2381,7 @@ var init_web_environment = __esm(() => {
|
|
|
2334
2381
|
"rename.pr-state-cleared": "A rename changed the branch, so stale PR state was cleared.",
|
|
2335
2382
|
"unread.clear-failed": "An environment's unread work could not be cleared on the backend.",
|
|
2336
2383
|
"create.failed": "Creating an environment from the dialog failed.",
|
|
2384
|
+
"launch-base.unavailable": "The create dialog could not read the base branch's tip; the environment resolves its base when it starts.",
|
|
2337
2385
|
"create.port-mappings-invalid": "Creation was refused: a port is not between 1 and 65535.",
|
|
2338
2386
|
"create.attachment-read-failed": "A file dropped on the create dialog could not be read.",
|
|
2339
2387
|
"auto-start.failed": "A background start after creating an environment was rejected.",
|
|
@@ -2396,6 +2444,7 @@ var init_web_files = __esm(() => {
|
|
|
2396
2444
|
description: "The files panel, file viewer and file search.",
|
|
2397
2445
|
events: {
|
|
2398
2446
|
"file.save-failed": "A file could not be saved.",
|
|
2447
|
+
"file.conflict-read-failed": "After a save was refused because the file changed, its newer version could not be read back.",
|
|
2399
2448
|
"git-changes.load-failed": "The files panel could not load the git changes.",
|
|
2400
2449
|
"file-tree.load-failed": "The file tree could not be loaded.",
|
|
2401
2450
|
"changes.refresh-failed": "Refreshing the files panel's changes failed.",
|
|
@@ -2711,6 +2760,7 @@ var init_log_vocabulary = __esm(() => {
|
|
|
2711
2760
|
init_graph();
|
|
2712
2761
|
init_nodes();
|
|
2713
2762
|
init_linear();
|
|
2763
|
+
init_credentials();
|
|
2714
2764
|
init_usage_history();
|
|
2715
2765
|
init_feature();
|
|
2716
2766
|
init_host();
|
|
@@ -2764,6 +2814,7 @@ var init_log_vocabulary = __esm(() => {
|
|
|
2764
2814
|
...GRAPH_LOG_AREAS,
|
|
2765
2815
|
...NODES_LOG_AREAS,
|
|
2766
2816
|
...LINEAR_LOG_AREAS,
|
|
2817
|
+
...CREDENTIALS_LOG_AREAS,
|
|
2767
2818
|
...USAGE_HISTORY_LOG_AREAS,
|
|
2768
2819
|
...FEATURE_LOG_AREAS,
|
|
2769
2820
|
...HOST_LOG_AREAS,
|
|
@@ -3967,6 +4018,7 @@ function createLostExitReaper(options2) {
|
|
|
3967
4018
|
const maxCheckMs = options2.maxCheckMs ?? REAP_MAX_CHECK_MS;
|
|
3968
4019
|
const maxChecks = options2.maxChecks ?? REAP_MAX_CHECKS;
|
|
3969
4020
|
const maxPending = options2.maxPending ?? REAP_MAX_PENDING;
|
|
4021
|
+
const timers = options2.timers ?? unrefTimers;
|
|
3970
4022
|
const pending = new Map;
|
|
3971
4023
|
let reaped = 0;
|
|
3972
4024
|
let abandoned = 0;
|
|
@@ -3996,7 +4048,7 @@ function createLostExitReaper(options2) {
|
|
|
3996
4048
|
return false;
|
|
3997
4049
|
};
|
|
3998
4050
|
const schedule = (pid, reported, startedAt, delayMs, checks) => {
|
|
3999
|
-
const timer = setTimeout(() => {
|
|
4051
|
+
const timer = timers.setTimeout(() => {
|
|
4000
4052
|
pending.delete(pid);
|
|
4001
4053
|
let again;
|
|
4002
4054
|
try {
|
|
@@ -4012,7 +4064,6 @@ function createLostExitReaper(options2) {
|
|
|
4012
4064
|
}
|
|
4013
4065
|
schedule(pid, reported, startedAt, Math.min(delayMs * 2, maxCheckMs), checks + 1);
|
|
4014
4066
|
}, delayMs);
|
|
4015
|
-
timer.unref?.();
|
|
4016
4067
|
pending.set(pid, timer);
|
|
4017
4068
|
};
|
|
4018
4069
|
return {
|
|
@@ -4030,7 +4081,7 @@ function createLostExitReaper(options2) {
|
|
|
4030
4081
|
stats: () => ({ pending: pending.size, reaped, abandoned }),
|
|
4031
4082
|
stop() {
|
|
4032
4083
|
for (const timer of pending.values())
|
|
4033
|
-
clearTimeout(timer);
|
|
4084
|
+
timers.clearTimeout(timer);
|
|
4034
4085
|
pending.clear();
|
|
4035
4086
|
}
|
|
4036
4087
|
};
|
|
@@ -4086,6 +4137,7 @@ function reapAfterLostExit(pid, reported) {
|
|
|
4086
4137
|
var log, REAP_GRACE_MS = 2000, REAP_MAX_CHECK_MS = 30000, REAP_MAX_CHECKS = 12, REAP_MAX_PENDING = 256, WNOHANG = 1, defaultReaper;
|
|
4087
4138
|
var init_lost_exit_reaper = __esm(() => {
|
|
4088
4139
|
init_logger();
|
|
4140
|
+
init_timers();
|
|
4089
4141
|
init_shell_process_state();
|
|
4090
4142
|
log = createLogger("process");
|
|
4091
4143
|
});
|
|
@@ -8856,7 +8908,7 @@ var init_manifest = __esm(() => {
|
|
|
8856
8908
|
claude: "2.1.326",
|
|
8857
8909
|
codex: "0.169.0",
|
|
8858
8910
|
grok: "1.0.88",
|
|
8859
|
-
opencode2: "2.3.
|
|
8911
|
+
opencode2: "2.3.1",
|
|
8860
8912
|
pi: "1.5.2"
|
|
8861
8913
|
};
|
|
8862
8914
|
PINNED_SUPPORT_TOOL_VERSIONS = {
|
|
@@ -8993,32 +9045,32 @@ var init_manifest = __esm(() => {
|
|
|
8993
9045
|
}
|
|
8994
9046
|
},
|
|
8995
9047
|
openCode2Artifact("darwin", "arm64", {
|
|
8996
|
-
size:
|
|
8997
|
-
sha256: "
|
|
9048
|
+
size: 109080555,
|
|
9049
|
+
sha256: "b01885024413cc021aa0ecc359a2f397217f74121f43569b318e192058f34f47"
|
|
8998
9050
|
}, {
|
|
8999
|
-
size:
|
|
9000
|
-
sha256: "
|
|
9051
|
+
size: 225750880,
|
|
9052
|
+
sha256: "25b6895db61be9a429ecc5513ca21ec4f5cbf62d6039950dd72e5aab6b9b319d"
|
|
9001
9053
|
}),
|
|
9002
9054
|
openCode2Artifact("darwin", "x64", {
|
|
9003
|
-
size:
|
|
9004
|
-
sha256: "
|
|
9055
|
+
size: 114447514,
|
|
9056
|
+
sha256: "6952e3e3a786967f05f5d4887e177e967ef4e940353bdfed5440410f02702a4b"
|
|
9005
9057
|
}, {
|
|
9006
|
-
size:
|
|
9007
|
-
sha256: "
|
|
9058
|
+
size: 240468704,
|
|
9059
|
+
sha256: "235a6377bf3dbef847eb9828efb8bca1666d04b9b699cc67d50b029d6c6f2d99"
|
|
9008
9060
|
}),
|
|
9009
9061
|
openCode2Artifact("linux", "arm64", {
|
|
9010
|
-
size:
|
|
9011
|
-
sha256: "
|
|
9062
|
+
size: 120539224,
|
|
9063
|
+
sha256: "97c127e0f17afd4a0110490aee5728e9047bba201bb132b2ebbcc724831a0aeb"
|
|
9012
9064
|
}, {
|
|
9013
|
-
size:
|
|
9014
|
-
sha256: "
|
|
9065
|
+
size: 247843832,
|
|
9066
|
+
sha256: "7f6127effa38a997d22a518e75fea5cf664f35ddc6a7a29850653aea5ec5b234"
|
|
9015
9067
|
}),
|
|
9016
9068
|
openCode2Artifact("linux", "x64", {
|
|
9017
|
-
size:
|
|
9018
|
-
sha256: "
|
|
9069
|
+
size: 122080965,
|
|
9070
|
+
sha256: "020e4bdadf62962f806f75393657ed26d462debec8e34ee7d3b6e0cb3b45c783"
|
|
9019
9071
|
}, {
|
|
9020
|
-
size:
|
|
9021
|
-
sha256: "
|
|
9072
|
+
size: 252848304,
|
|
9073
|
+
sha256: "1a8ef837bb8bdd06f2e16e0ed1a49b05aefb96b95102834dbb178cdd6223205d"
|
|
9022
9074
|
}),
|
|
9023
9075
|
{
|
|
9024
9076
|
name: "claude",
|
|
@@ -12965,6 +13017,9 @@ function normalizeDebugLogRetentionDays(value) {
|
|
|
12965
13017
|
return isValidDebugLogRetentionDays(value) ? value : DEFAULT_DEBUG_LOG_RETENTION_DAYS;
|
|
12966
13018
|
}
|
|
12967
13019
|
|
|
13020
|
+
// ../protocol/src/node/application-logging.ts
|
|
13021
|
+
init_timers();
|
|
13022
|
+
|
|
12968
13023
|
// ../protocol/src/node/essential-log.ts
|
|
12969
13024
|
init_log_essential();
|
|
12970
13025
|
init_logger();
|
|
@@ -13345,7 +13400,7 @@ import path5 from "path";
|
|
|
13345
13400
|
// ../../apps/backend/package.json
|
|
13346
13401
|
var package_default = {
|
|
13347
13402
|
name: "@orkestrator/backend",
|
|
13348
|
-
version: "2.39.
|
|
13403
|
+
version: "2.39.8-beta",
|
|
13349
13404
|
private: true,
|
|
13350
13405
|
type: "module",
|
|
13351
13406
|
exports: {
|
|
@@ -22498,21 +22553,49 @@ var sessionCommands = [
|
|
|
22498
22553
|
path: ["session", "branch"],
|
|
22499
22554
|
action: "session.branch",
|
|
22500
22555
|
summary: "Switch the conversation to another branch from `session branches` (Pi).",
|
|
22501
|
-
description: "The branch being left is kept and listed by `session branches`.",
|
|
22556
|
+
description: "The branch being left is kept and listed by `session branches`. --summarize also keeps Pi's summary of it in the conversation, which costs one model call.",
|
|
22502
22557
|
positionals: [
|
|
22503
22558
|
{ name: "session", required: true },
|
|
22504
22559
|
{ name: "entry-id", required: true }
|
|
22505
22560
|
],
|
|
22506
|
-
options: [
|
|
22561
|
+
options: [
|
|
22562
|
+
{
|
|
22563
|
+
name: "summarize",
|
|
22564
|
+
kind: "boolean",
|
|
22565
|
+
description: "Ask Pi to summarize the branch being left (one model call) and keep the summary."
|
|
22566
|
+
},
|
|
22567
|
+
REQUEST_ID_OPTION
|
|
22568
|
+
],
|
|
22507
22569
|
async run(context, parsed) {
|
|
22508
|
-
const
|
|
22570
|
+
const summarize = parsed.options.summarize === true;
|
|
22571
|
+
const entryId = parsed.positionals["entry-id"];
|
|
22572
|
+
const input = {
|
|
22573
|
+
sessionId: parsed.positionals.session,
|
|
22574
|
+
entryId,
|
|
22575
|
+
...summarize ? { summarize: true } : {}
|
|
22576
|
+
};
|
|
22577
|
+
const submitted = summarize ? await submitForWait(context, "session.branch", input, parsed.options, DEFAULT_WAIT_MS) : await submit(context, "session.branch", input, parsed.options);
|
|
22578
|
+
const { session, warnings } = submitted;
|
|
22579
|
+
let { result, receipt } = submitted;
|
|
22580
|
+
if (summarize && receipt) {
|
|
22581
|
+
if (!isTerminalReceipt(receipt)) {
|
|
22582
|
+
const remaining = "deadline" in submitted && submitted.deadline !== undefined ? Math.max(0, submitted.deadline - Date.now()) : DEFAULT_WAIT_MS;
|
|
22583
|
+
receipt = await waitForOperation(context, session, receipt, remaining);
|
|
22584
|
+
}
|
|
22585
|
+
const failure = receiptFailure(receipt);
|
|
22586
|
+
if (failure)
|
|
22587
|
+
throw failure;
|
|
22588
|
+
result = receipt.result ?? result;
|
|
22589
|
+
}
|
|
22509
22590
|
return {
|
|
22510
22591
|
action: "session.branch",
|
|
22511
22592
|
result,
|
|
22512
22593
|
receipt,
|
|
22513
22594
|
warnings,
|
|
22514
22595
|
connection: session.identity,
|
|
22515
|
-
human: [
|
|
22596
|
+
human: [
|
|
22597
|
+
!summarize ? `switched to branch ${entryId}` : result?.summarized === true ? `switched to branch ${entryId}, keeping a summary of the branch left` : `switched to branch ${entryId}; Pi kept no summary of the branch left`
|
|
22598
|
+
]
|
|
22516
22599
|
};
|
|
22517
22600
|
}
|
|
22518
22601
|
},
|