orkestrator 2.37.1-beta → 2.37.4-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 +454 -23
- package/dist/main.js +185742 -168918
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +229 -77
- package/resources/claude-bridge/dist/index.js +395 -169
- package/resources/codex-bridge/dist/index.js +270 -90
- package/resources/cursor-bridge/dist/index.js +1375 -397
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +382 -133
- package/resources/pi-bridge/runtime/install.json +1 -1
package/dist/client.js
CHANGED
|
@@ -527,12 +527,22 @@ var init_desktop = __esm(() => {
|
|
|
527
527
|
denied: "A renderer asked for a permission the policy does not grant."
|
|
528
528
|
}
|
|
529
529
|
},
|
|
530
|
+
"desktop.webrequest": {
|
|
531
|
+
description: "Main-process webRequest listeners on Electron sessions. Listener names only; never a URL, header or error message.",
|
|
532
|
+
events: {
|
|
533
|
+
"listener.failed-closed": "A listener's decision threw or rejected, so it answered with its fail-closed response.",
|
|
534
|
+
"observer.failed": "A listener with no callback (a redirect observer) threw; its fallback ran.",
|
|
535
|
+
"callback.failed": "Electron's webRequest callback threw while a listener answered.",
|
|
536
|
+
...THROTTLE_LOG_EVENTS
|
|
537
|
+
}
|
|
538
|
+
},
|
|
530
539
|
"desktop.dialog": {
|
|
531
540
|
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
532
541
|
events: {
|
|
533
542
|
"attention-failed": "A dialog could not ask for the user's attention.",
|
|
534
543
|
closed: "A native dialog closed.",
|
|
535
544
|
"hidden-cancelled": "A hidden profile cancelled a dialog without opening native UI.",
|
|
545
|
+
"no-display-cancelled": "A headless Electron with no display cancelled a dialog instead of opening native UI.",
|
|
536
546
|
"open-failed": "A dialog could not open; it was answered as cancelled.",
|
|
537
547
|
opening: "A native dialog is opening.",
|
|
538
548
|
"preview-beforeunload-ignored": "A browser preview's beforeunload handler was ignored.",
|
|
@@ -619,6 +629,9 @@ var init_environment = __esm(() => {
|
|
|
619
629
|
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
620
630
|
"setup.tab-publish-failed": "The setup terminal's tab could not be published.",
|
|
621
631
|
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
632
|
+
"git-https-probe.failed": "Checking whether a project's GitHub remote works over HTTPS failed; `reason` says why.",
|
|
633
|
+
"git-https-remedy.failed": "Deciding whether to offer HTTPS after an SSH failure threw; no remedy is offered.",
|
|
634
|
+
"git-origin.switched-to-https": "A project's origin remote was switched from GitHub SSH to HTTPS at the user's request.",
|
|
622
635
|
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
623
636
|
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
624
637
|
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
@@ -913,11 +926,38 @@ var init_native_agent = __esm(() => {
|
|
|
913
926
|
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
914
927
|
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
915
928
|
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
929
|
+
"monitor.silent": "The request monitor's stream stopped heartbeating, so it is replaced. `silenceMs` only.",
|
|
916
930
|
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
917
931
|
"request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
|
|
918
932
|
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
|
|
919
933
|
"host-database.separated": "Host OpenCode uses Orkestrator's own database because the shared one has no `session` table (an OpenCode 2 database); `reason` says why.",
|
|
920
|
-
"host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only."
|
|
934
|
+
"host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only.",
|
|
935
|
+
"login.opencode2-mirror-failed": "A provider sign-in change reached OpenCode 1 but could not be copied into the OpenCode 2 database; the user is told to retry. Error class only."
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
"native-agent.opencode2": {
|
|
939
|
+
description: "The OpenCode 2.x provider: its event monitor, steering, routing, host and container servers.",
|
|
940
|
+
events: {
|
|
941
|
+
"events.dropped": "The 2.x event stream ended or failed, so reads go to the server until it reconnects. Error class only.",
|
|
942
|
+
"steer.unconfirmed": "A 2.x steer got no definite answer, so its delivery is reconciled from history. Error class only.",
|
|
943
|
+
"provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
|
|
944
|
+
"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.",
|
|
945
|
+
"mcp.remove-failed": "Removing a closed session's Orkestrator MCP server from the 2.x server failed. Error class only.",
|
|
946
|
+
"protocol.select-failed": "A workflow could not read the OpenCode line setting, so its new session takes 1.x. Error class only.",
|
|
947
|
+
"host-server.ready": "A local environment's (or a coordinator conversation's) 2.x server answered `/api/info` as 2.x. Environment id, pid and whether it is a coordinator's only.",
|
|
948
|
+
"coordinator-research.unavailable": "A coordinator's 2.x server could not register its research servers, so the conversation runs without them until the server restarts. Error class only.",
|
|
949
|
+
"host-server.terminate-failed": "A 2.x server that did not become ready could not be stopped; its process entry is kept for shutdown. Error class only.",
|
|
950
|
+
"container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
|
|
951
|
+
"container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
|
|
952
|
+
"container-server.cleanup-failed": "Cleanup after OpenCode startup failed; step names only, while the original startup error is preserved.",
|
|
953
|
+
"container-server.warm-incomplete": "The first workspace request to a container's new 2.x server failed, so its plugins load on the next one. Error class only.",
|
|
954
|
+
"resume-list.unavailable": "The 2.x sessions could not be listed for the resume picker, so it shows the 1.x list alone. Error class only.",
|
|
955
|
+
"credential.mirrored": "A provider sign-in change was copied into the 2.x database. `outcome` (written, removed, unchanged, skipped) only; never a provider id or value.",
|
|
956
|
+
"credential.server-exit-unclean": "The private 2.x server started to copy a sign-in did not stop cleanly. Error class only.",
|
|
957
|
+
"user-config.mirror-failed": "The user's global OpenCode configuration could not be mirrored for a host 2.x server, which starts without it. Error class only.",
|
|
958
|
+
"user-config.unreadable": "A file of the user's OpenCode configuration could not be read for the 2.x mirror. `source`, the file's name and the error code only.",
|
|
959
|
+
"user-config.rejected": "Files of the user's OpenCode configuration are not a JSONC object, so the 2.x mirror leaves them out. `source` and file names only, never contents.",
|
|
960
|
+
"user-config.plugins-withheld": "The user's OpenCode configuration lists plugins, which the 2.x mirror leaves out (1.x plugins do not run on 2.x). `source` only."
|
|
921
961
|
}
|
|
922
962
|
}
|
|
923
963
|
});
|
|
@@ -1160,6 +1200,7 @@ var init_tmux = __esm(() => {
|
|
|
1160
1200
|
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
1161
1201
|
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
1162
1202
|
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
1203
|
+
"cleanup.kill-incomplete": "An environment's tmux sessions could not all be shown gone (a session survived, or the socket was unreachable while another tmux process might own it), so cleanup stays incomplete.",
|
|
1163
1204
|
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
1164
1205
|
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
1165
1206
|
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
@@ -1301,6 +1342,7 @@ var init_storage = __esm(() => {
|
|
|
1301
1342
|
"config.restrict-mode-failed": "A config file holding provider secrets could not be set to owner-only; the backend carries on.",
|
|
1302
1343
|
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
1303
1344
|
"legacy-json.archive-failed": "Imported JSON store files could not be archived.",
|
|
1345
|
+
"native-session-owners.backfill-failed": "Native-session rows could not be given their environment as owner at open; an environment delete then parses those rows instead, and the next open retries.",
|
|
1304
1346
|
"lease.timed-out": "A waiter gave up on a lease; `lease` and `family` name it, `holderAgeMs` is the time since its holder's last heartbeat (null when the holder had just gone), `waitedMs` how long the waiter waited.",
|
|
1305
1347
|
"lease.heartbeat-failed": "A held lease's heartbeat failed, which shortens the lease; the next one retries.",
|
|
1306
1348
|
"scrub.vacuum-failed": "Deleted-content page reclamation failed; the checkpoint is attempted independently.",
|
|
@@ -1354,6 +1396,7 @@ var init_build_pipeline = __esm(() => {
|
|
|
1354
1396
|
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
1355
1397
|
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
1356
1398
|
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
1399
|
+
"completion-notes.publish-failed": "A finished pipeline's notes tab could not be added to the layout; the run stays complete.",
|
|
1357
1400
|
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
1358
1401
|
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
1359
1402
|
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
@@ -1403,6 +1446,8 @@ var init_change_tracking = __esm(() => {
|
|
|
1403
1446
|
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
1404
1447
|
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
1405
1448
|
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
1449
|
+
"turn.end-recovery": "A background retry of a turn end capture that timed out finished: recovered, done (no longer eligible) or exhausted.",
|
|
1450
|
+
"turn.end-recovery-failed": "A background retry of a turn end capture threw; it counts as a failed attempt.",
|
|
1406
1451
|
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
1407
1452
|
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
1408
1453
|
}
|
|
@@ -1475,6 +1520,7 @@ var init_coordinator = __esm(() => {
|
|
|
1475
1520
|
"node-release.no-coordinator": "Work closed on a released node belonged to a coordinator that no longer exists, so nobody was told.",
|
|
1476
1521
|
"node-offline.notice-failed": "The notice that a node has been unreachable for a day could not be sent; the next failed read retries.",
|
|
1477
1522
|
"node-offline.check-failed": "Whether a long-unreachable node's coordinators were told could not be checked; the next read retries.",
|
|
1523
|
+
"node-reconnect.notice-failed": "The message that a node a coordinator tried while it was disconnected is back could not be sent; it is not retried, since the coordinator already holds the refusal.",
|
|
1478
1524
|
"checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
|
|
1479
1525
|
"checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
|
|
1480
1526
|
"checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded (`fast-forwarded-fetched` when the fetch was slow or failed and the upstream commit already fetched was merged), or `outcome` says why not (`timed-out`, `failed`).",
|
|
@@ -1531,7 +1577,8 @@ var init_review = __esm(() => {
|
|
|
1531
1577
|
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
1532
1578
|
"monitor.merged-tickets-closed": "The startup sweep moved Kanban tickets whose pull request had merged to done (`count`).",
|
|
1533
1579
|
"monitor.merged-tickets-close-failed": "The startup sweep closing Kanban tickets whose pull request merged failed; the next backend start retries.",
|
|
1534
|
-
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
1580
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink.",
|
|
1581
|
+
"branch-cleanup.kept": "A merge or cleanup kept a pull request's head branch because it is not the branch created for the environment (`reason`)."
|
|
1535
1582
|
}
|
|
1536
1583
|
}
|
|
1537
1584
|
});
|
|
@@ -1571,6 +1618,8 @@ var init_agent_accounts = __esm(() => {
|
|
|
1571
1618
|
"kept-note.failed": "Recording why a limit stop found no account to move to failed; the stop stands.",
|
|
1572
1619
|
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
1573
1620
|
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
1621
|
+
"shared-usage.save-failed": "The shared usage readings could not be saved; they stay in memory and the next reading saves them.",
|
|
1622
|
+
"shared-usage.record-failed": "A fresh usage reading could not be kept for sharing with other machines; the account's own reading stands.",
|
|
1574
1623
|
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
1575
1624
|
"login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
|
|
1576
1625
|
"login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
|
|
@@ -1592,6 +1641,7 @@ var init_docker = __esm(() => {
|
|
|
1592
1641
|
"git-mirror.mount-unavailable": "A new container gets no project Git mirror, so its clone goes to the remote.",
|
|
1593
1642
|
"git-mirror.mount-withheld": "A new restricted container gets no project Git mirror because its firewall would not let it reach the project's remote, so it cannot read what the remote serves through the mirror either.",
|
|
1594
1643
|
"git-mirror.refreshed": "A project's Git mirror was built or updated.",
|
|
1644
|
+
"git-mirror.access-changed": "A project's Git mirror was withdrawn because containers are now given a different credential (another access kind, or a token acting as another or an unreadable account), so no reader keeps what it could not fetch itself.",
|
|
1595
1645
|
"git-mirror.seeded": "A project's Git mirror was built from its host checkout and only what the remote added to it.",
|
|
1596
1646
|
"git-mirror.seed-skipped": "A project's host checkout could not seed its Git mirror, so the build downloads everything.",
|
|
1597
1647
|
"git-mirror.refresh-failed": "A project's Git mirror could not be updated. New clones still work, from the mirror as it was or from the remote.",
|
|
@@ -1605,6 +1655,9 @@ var init_docker = __esm(() => {
|
|
|
1605
1655
|
"git-mirror.clone-fallback": "A new environment could not clone from its project's Git mirror and cloned from the remote.",
|
|
1606
1656
|
"project-seed.refused": "A project .env, .env.local or opencode.json was not copied into a new container: a link, not a regular file, outside the project, too large or unreadable.",
|
|
1607
1657
|
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
1658
|
+
"opencode.listener-replaced": "The process on a container's OpenCode port (`provider`: `opencode` or `opencode2`) is not the server the backend launched and recorded, so its password was withheld and the next start replaces it. `stage` is `request` when the re-check after a refused connection or an unexpected answer found it (to-do 7550); that connection then sends nothing more.",
|
|
1659
|
+
"opencode.project-config-too-large": "A checkout's opencode.json or opencode.jsonc was larger than the limit, so a launched OpenCode server does not read it. File name only.",
|
|
1660
|
+
"opencode.project-config-filtered": "Values were left out of a checkout's OpenCode configuration before a launched server reads it (to-do 7550): counts of plugin keys, `{env:}` and `{file:}` references and dropped instructions (including separate instructionGlob and instructionUrl counts), and the names of files that were not a JSONC object. Never values.",
|
|
1608
1661
|
"log-driver.unbounded": "The Docker daemon offers neither the local nor the json-file log driver, so new containers keep its default driver, whose log may be uncapped. Written once per backend.",
|
|
1609
1662
|
"lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
|
|
1610
1663
|
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
@@ -1639,6 +1692,17 @@ var init_docker = __esm(() => {
|
|
|
1639
1692
|
description: "A bridge process was launched in a container, for the first time there or as a relaunch; `provider` names it. A relaunch keeps the run before it in the previous log.",
|
|
1640
1693
|
essential: true,
|
|
1641
1694
|
fields: { provider: "label", containerPort: "number" }
|
|
1695
|
+
},
|
|
1696
|
+
"bridge.listener-refused": {
|
|
1697
|
+
description: "The socket listening on a container bridge's port is not the one the bridge the backend started opened (to-do 7250), so its token is not handed out and the next start replaces it. `reason` is a fixed label: `different-socket`, `several-sockets`, `pending` (a start has not recorded its bridge yet, or failed before it did) or `scan-incomplete`.",
|
|
1698
|
+
essential: true,
|
|
1699
|
+
fields: { provider: "label", reason: "label" }
|
|
1700
|
+
},
|
|
1701
|
+
"bridge.listener-adopted": "A running container bridge had no listener record, because a backend from before the record started it, so the socket on its port was recorded as the bridge's; `provider` names it.",
|
|
1702
|
+
"bridge.listener-unrecorded": {
|
|
1703
|
+
description: "A bridge the backend just launched could not be recorded as its port's listener, for the fixed `reason` given (`no-listener`, `several-sockets`, `launch-exited` or `scan-incomplete`); what listens on the port is stopped and the start fails.",
|
|
1704
|
+
essential: true,
|
|
1705
|
+
fields: { provider: "label", reason: "label" }
|
|
1642
1706
|
}
|
|
1643
1707
|
}
|
|
1644
1708
|
},
|
|
@@ -1697,7 +1761,8 @@ var init_mcp = __esm(() => {
|
|
|
1697
1761
|
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
1698
1762
|
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
1699
1763
|
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
1700
|
-
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
1764
|
+
"delegation.open-failed": "A coordinator delegation could not be opened.",
|
|
1765
|
+
"delegation.turn-origin-unreadable": "A coordinator's last turn origin could not be read, so its delegated prompt is marked as arising from agent mail."
|
|
1701
1766
|
}
|
|
1702
1767
|
},
|
|
1703
1768
|
"mcp-management": {
|
|
@@ -1794,6 +1859,7 @@ var init_nodes = __esm(() => {
|
|
|
1794
1859
|
"ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
|
|
1795
1860
|
"ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
|
|
1796
1861
|
"ticket-sync.forget-failed": "A detached command node's ticket copies could not be released.",
|
|
1862
|
+
"usage-sync.failed": "Sharing usage readings with a node failed; the next reading or reconnect retries.",
|
|
1797
1863
|
"fleet-update.requested": "The update policy asked an older leaf to install the command node's version.",
|
|
1798
1864
|
"fleet-update.failed": "The update policy could not read or update a leaf; it retries later.",
|
|
1799
1865
|
"fleet-update.policy-load-failed": "The stored update policy could not be read; it is off."
|
|
@@ -1910,6 +1976,24 @@ var init_scheduler = __esm(() => {
|
|
|
1910
1976
|
});
|
|
1911
1977
|
});
|
|
1912
1978
|
|
|
1979
|
+
// ../protocol/src/log-vocabulary/self-improvement.ts
|
|
1980
|
+
var SELF_IMPROVEMENT_LOG_AREAS;
|
|
1981
|
+
var init_self_improvement = __esm(() => {
|
|
1982
|
+
init_define();
|
|
1983
|
+
SELF_IMPROVEMENT_LOG_AREAS = defineLogAreas({
|
|
1984
|
+
"self-improvement": {
|
|
1985
|
+
description: "Self-improvement runs: diagnostics and conversation review turned into tickets. Counts and steps only, never conversation text.",
|
|
1986
|
+
events: {
|
|
1987
|
+
"run.started": "A run started; `trigger` is manual, daily or dry-run.",
|
|
1988
|
+
"run.finished": "A run finished; `created`, `verified`, `fixFailed` and `parts` count its tickets, confirmed fixes, failed fixes and conversation parts read.",
|
|
1989
|
+
"run.failed": "A run stopped before it finished; `reason` is a fixed label.",
|
|
1990
|
+
"review.call-failed": "One conversation review call failed; the run carries on and the part is read again next run.",
|
|
1991
|
+
"daily.check-failed": "The daily run check failed; the next check retries."
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
});
|
|
1995
|
+
});
|
|
1996
|
+
|
|
1913
1997
|
// ../protocol/src/log-vocabulary/web-app.ts
|
|
1914
1998
|
var WEB_APP_LOG_AREAS;
|
|
1915
1999
|
var init_web_app = __esm(() => {
|
|
@@ -2288,6 +2372,10 @@ var init_web_settings = __esm(() => {
|
|
|
2288
2372
|
"web.settings": {
|
|
2289
2373
|
description: "The settings screens.",
|
|
2290
2374
|
events: {
|
|
2375
|
+
"self-improvement.status-failed": "Settings \u2192 Self-improvement could not read the status.",
|
|
2376
|
+
"self-improvement.projects-failed": "Settings \u2192 Self-improvement could not list the projects.",
|
|
2377
|
+
"self-improvement.save-failed": "Settings \u2192 Self-improvement could not save a setting.",
|
|
2378
|
+
"self-improvement.run-failed": "Settings \u2192 Self-improvement could not start a run.",
|
|
2291
2379
|
"config.save-failed": "Global settings could not be saved.",
|
|
2292
2380
|
"config.load-failed": "The settings page could not load the config.",
|
|
2293
2381
|
"config.reload-failed": "Re-reading the workspace config after a save failed.",
|
|
@@ -2470,6 +2558,7 @@ var init_log_vocabulary = __esm(() => {
|
|
|
2470
2558
|
init_host();
|
|
2471
2559
|
init_transcript_artifacts();
|
|
2472
2560
|
init_scheduler();
|
|
2561
|
+
init_self_improvement();
|
|
2473
2562
|
init_web_app();
|
|
2474
2563
|
init_web_build_pipeline();
|
|
2475
2564
|
init_web_chat();
|
|
@@ -2522,6 +2611,7 @@ var init_log_vocabulary = __esm(() => {
|
|
|
2522
2611
|
...HOST_LOG_AREAS,
|
|
2523
2612
|
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
2524
2613
|
...SCHEDULER_LOG_AREAS,
|
|
2614
|
+
...SELF_IMPROVEMENT_LOG_AREAS,
|
|
2525
2615
|
...WEB_APP_LOG_AREAS,
|
|
2526
2616
|
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
2527
2617
|
...WEB_CHAT_LOG_AREAS,
|
|
@@ -2542,7 +2632,7 @@ var init_log_vocabulary = __esm(() => {
|
|
|
2542
2632
|
var init_renderer_errors = () => {};
|
|
2543
2633
|
|
|
2544
2634
|
// ../protocol/src/log-essential-labels.ts
|
|
2545
|
-
var ERROR_NAMES, ERROR_CODES, SYSCALLS, SIGNALS, PROVIDERS, UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", SOURCE, STORAGE_DATABASES, STORAGE_OPERATIONS, TRANSACTION_MODES, STORAGE_TABLES;
|
|
2635
|
+
var ERROR_NAMES, ERROR_CODES, SYSCALLS, SIGNALS, PROVIDERS, BRIDGE_LISTENER_REASONS, UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", SOURCE, STORAGE_DATABASES, STORAGE_OPERATIONS, TRANSACTION_MODES, STORAGE_TABLES;
|
|
2546
2636
|
var init_log_essential_labels = __esm(() => {
|
|
2547
2637
|
init_log_vocabulary();
|
|
2548
2638
|
init_renderer_errors();
|
|
@@ -2651,6 +2741,14 @@ var init_log_essential_labels = __esm(() => {
|
|
|
2651
2741
|
"SIGXFSZ"
|
|
2652
2742
|
]);
|
|
2653
2743
|
PROVIDERS = new Set(["claude", "codex", "opencode", "cursor", "grok", "acp", "pi"]);
|
|
2744
|
+
BRIDGE_LISTENER_REASONS = new Set([
|
|
2745
|
+
"different-socket",
|
|
2746
|
+
"several-sockets",
|
|
2747
|
+
"pending",
|
|
2748
|
+
"scan-incomplete",
|
|
2749
|
+
"no-listener",
|
|
2750
|
+
"launch-exited"
|
|
2751
|
+
]);
|
|
2654
2752
|
SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
|
|
2655
2753
|
STORAGE_DATABASES = new Set(["main", "ledger", "other"]);
|
|
2656
2754
|
STORAGE_OPERATIONS = new Set([
|
|
@@ -3557,7 +3655,8 @@ var init_command_failure_reason = __esm(() => {
|
|
|
3557
3655
|
["auth-failed", /terminal prompts disabled|invalid username or password|bad credentials/i],
|
|
3558
3656
|
["auth-failed", /permission denied \(|permission to \S+ denied|host key verification failed/i],
|
|
3559
3657
|
["auth-failed", /gh auth login|not logged in|unauthorized|http 401|returned error: 40[13]/i],
|
|
3560
|
-
["network-failed", /could not resolve host|connection
|
|
3658
|
+
["network-failed", /could not resolve host|(?:connection|operation) timed out/i],
|
|
3659
|
+
["network-failed", /connection (?:refused|reset)/i],
|
|
3561
3660
|
["network-failed", /network is unreachable|no route to host|temporary failure in name/i],
|
|
3562
3661
|
["network-failed", /early eof|failed to connect|remote end hung up/i],
|
|
3563
3662
|
["network-failed", /unable to access ['"]?https?:\/\//i],
|
|
@@ -8490,6 +8589,9 @@ function isToolchainName(value) {
|
|
|
8490
8589
|
function isSupportToolName(value) {
|
|
8491
8590
|
return Object.hasOwn(PINNED_SUPPORT_TOOL_VERSIONS, value);
|
|
8492
8591
|
}
|
|
8592
|
+
function agentPlatformForToolchain(name) {
|
|
8593
|
+
return Object.hasOwn(TOOLCHAIN_PLATFORM_OVERRIDES, name) ? TOOLCHAIN_PLATFORM_OVERRIDES[name] : name;
|
|
8594
|
+
}
|
|
8493
8595
|
function codexCodeModeHost(target, archive, executable) {
|
|
8494
8596
|
return {
|
|
8495
8597
|
fileName: CODEX_CODE_MODE_HOST_FILE_NAME,
|
|
@@ -8528,6 +8630,25 @@ function claudeArchiveUrl(target) {
|
|
|
8528
8630
|
const pkg = `claude-code-${target}`;
|
|
8529
8631
|
return `https://registry.npmjs.org/@anthropic-ai/${pkg}/-/${pkg}-${PINNED_TOOLCHAIN_VERSIONS.claude}.tgz`;
|
|
8530
8632
|
}
|
|
8633
|
+
function openCode2Artifact(platform, architecture, archive, executable) {
|
|
8634
|
+
const version = PINNED_TOOLCHAIN_VERSIONS.opencode2;
|
|
8635
|
+
const pkg = `cli-${platform}-${architecture}`;
|
|
8636
|
+
return {
|
|
8637
|
+
name: "opencode2",
|
|
8638
|
+
version,
|
|
8639
|
+
platform,
|
|
8640
|
+
architecture,
|
|
8641
|
+
archive: {
|
|
8642
|
+
format: "tar.gz",
|
|
8643
|
+
url: `https://registry.npmjs.org/@opencode/${pkg}/-/${pkg}-${version}.tgz`,
|
|
8644
|
+
entryPath: "package/bin/opencode",
|
|
8645
|
+
size: archive.size,
|
|
8646
|
+
sha256: archive.sha256,
|
|
8647
|
+
allowedHosts: NPM_REGISTRY_HOSTS
|
|
8648
|
+
},
|
|
8649
|
+
executable: { fileName: "opencode2", ...executable }
|
|
8650
|
+
};
|
|
8651
|
+
}
|
|
8531
8652
|
function selectPinnedToolchainArtifacts(artifacts, platform, architecture) {
|
|
8532
8653
|
if (platform !== "darwin" && platform !== "linux") {
|
|
8533
8654
|
throw new Error(`Unsupported toolchain platform: ${platform}`);
|
|
@@ -8546,13 +8667,14 @@ function selectPinnedToolchainArtifacts(artifacts, platform, architecture) {
|
|
|
8546
8667
|
function pinnedToolchainArtifacts(platform = process.platform, architecture = process.arch) {
|
|
8547
8668
|
return selectPinnedToolchainArtifacts(PINNED_TOOLCHAIN_ARTIFACTS, platform, architecture);
|
|
8548
8669
|
}
|
|
8549
|
-
var PINNED_TOOLCHAIN_VERSIONS, PINNED_SUPPORT_TOOL_VERSIONS, PINNED_TOOL_VERSIONS, GITHUB_RELEASE_HOSTS, NPM_REGISTRY_HOSTS, GROK_DOWNLOAD_HOSTS, CODEX_RELEASE_BASE, PI_RELEASE_BASE, GH_RELEASE_BASE, OPENCODE_RELEASE_BASE, CODEX_CODE_MODE_HOST_FILE_NAME = "codex-code-mode-host", PINNED_TOOLCHAIN_ARTIFACTS;
|
|
8670
|
+
var PINNED_TOOLCHAIN_VERSIONS, PINNED_SUPPORT_TOOL_VERSIONS, PINNED_TOOL_VERSIONS, TOOLCHAIN_PLATFORM_OVERRIDES, GITHUB_RELEASE_HOSTS, NPM_REGISTRY_HOSTS, GROK_DOWNLOAD_HOSTS, CODEX_RELEASE_BASE, PI_RELEASE_BASE, GH_RELEASE_BASE, OPENCODE_RELEASE_BASE, CODEX_CODE_MODE_HOST_FILE_NAME = "codex-code-mode-host", PINNED_TOOLCHAIN_ARTIFACTS;
|
|
8550
8671
|
var init_manifest = __esm(() => {
|
|
8551
8672
|
PINNED_TOOLCHAIN_VERSIONS = {
|
|
8552
8673
|
claude: "2.1.319",
|
|
8553
8674
|
codex: "0.167.0",
|
|
8554
8675
|
grok: "1.0.77",
|
|
8555
8676
|
opencode: "1.19.5",
|
|
8677
|
+
opencode2: "2.2.6",
|
|
8556
8678
|
pi: "1.5.0"
|
|
8557
8679
|
};
|
|
8558
8680
|
PINNED_SUPPORT_TOOL_VERSIONS = {
|
|
@@ -8562,6 +8684,9 @@ var init_manifest = __esm(() => {
|
|
|
8562
8684
|
...PINNED_TOOLCHAIN_VERSIONS,
|
|
8563
8685
|
...PINNED_SUPPORT_TOOL_VERSIONS
|
|
8564
8686
|
};
|
|
8687
|
+
TOOLCHAIN_PLATFORM_OVERRIDES = {
|
|
8688
|
+
opencode2: "opencode"
|
|
8689
|
+
};
|
|
8565
8690
|
GITHUB_RELEASE_HOSTS = [
|
|
8566
8691
|
"github.com",
|
|
8567
8692
|
"release-assets.githubusercontent.com",
|
|
@@ -8764,6 +8889,34 @@ var init_manifest = __esm(() => {
|
|
|
8764
8889
|
sha256: "7df4e4136301f16589b0f30bf91a61380fca5f8ef22dd36570f5ebe1d4ec802c"
|
|
8765
8890
|
}
|
|
8766
8891
|
},
|
|
8892
|
+
openCode2Artifact("darwin", "arm64", {
|
|
8893
|
+
size: 108258354,
|
|
8894
|
+
sha256: "613ebb74dd8eff767bb9d442a37b40c4d9946ba27f1538985068a1b9678137a3"
|
|
8895
|
+
}, {
|
|
8896
|
+
size: 231791968,
|
|
8897
|
+
sha256: "90e4d03597b03d2051b65b4d793467764e55bacd8e22bf4824479c7233ea0e15"
|
|
8898
|
+
}),
|
|
8899
|
+
openCode2Artifact("darwin", "x64", {
|
|
8900
|
+
size: 113659134,
|
|
8901
|
+
sha256: "4f1475c0b642ece32681dbd4a2fd5f7c1ef6183dced0ecac3861cb3d18a49a15"
|
|
8902
|
+
}, {
|
|
8903
|
+
size: 246528608,
|
|
8904
|
+
sha256: "6273561d1f9b3ff20d350aba47874fd12b2c4aed7ee62c1979f579c9570ef1fc"
|
|
8905
|
+
}),
|
|
8906
|
+
openCode2Artifact("linux", "arm64", {
|
|
8907
|
+
size: 119688147,
|
|
8908
|
+
sha256: "22352e200630ec61a48a65b9f5c2b627328ae5002658d81c067f67c5fb689898"
|
|
8909
|
+
}, {
|
|
8910
|
+
size: 253873144,
|
|
8911
|
+
sha256: "ce4f5e7502b6e32ccd8b05654410e8e8607b9660737222b0b1279621bcea2b03"
|
|
8912
|
+
}),
|
|
8913
|
+
openCode2Artifact("linux", "x64", {
|
|
8914
|
+
size: 121218733,
|
|
8915
|
+
sha256: "dfcd69f1d511ae10ed626768b41d84b8100cc4aa64cecb69da38ba7a29d33551"
|
|
8916
|
+
}, {
|
|
8917
|
+
size: 258824368,
|
|
8918
|
+
sha256: "50503d24577fa4117a7c95ee85b2cd679606a87eacf20ca54ed5db5c9e1cf895"
|
|
8919
|
+
}),
|
|
8767
8920
|
{
|
|
8768
8921
|
name: "claude",
|
|
8769
8922
|
version: PINNED_TOOLCHAIN_VERSIONS.claude,
|
|
@@ -10683,7 +10836,7 @@ import { lstat as lstat4, mkdir as mkdir5, readdir as readdir5, readlink as read
|
|
|
10683
10836
|
import path23 from "path";
|
|
10684
10837
|
async function resolveToolchainSelection(options2) {
|
|
10685
10838
|
const known = Object.keys(PINNED_TOOL_VERSIONS);
|
|
10686
|
-
const withSupportTools = (chosen) => known.filter((name) => chosen
|
|
10839
|
+
const withSupportTools = (chosen) => known.filter((name) => chosen(name) || isSupportToolName(name));
|
|
10687
10840
|
if (options2.tools !== undefined) {
|
|
10688
10841
|
if (options2.tools.length === 0)
|
|
10689
10842
|
throw new Error("At least one tool must be selected");
|
|
@@ -10691,12 +10844,17 @@ async function resolveToolchainSelection(options2) {
|
|
|
10691
10844
|
if (unknown.length > 0) {
|
|
10692
10845
|
throw new Error(`Unknown tool: ${unknown.join(", ")}. Expected: ${known.join(", ")}`);
|
|
10693
10846
|
}
|
|
10694
|
-
|
|
10847
|
+
const tools = new Set(options2.tools);
|
|
10848
|
+
return { tools: withSupportTools((name) => tools.has(name)), source: "explicit" };
|
|
10695
10849
|
}
|
|
10696
10850
|
const selection = await loadAgentPlatformSelection(options2.dataDir);
|
|
10697
10851
|
if (selection.needsFirstRunChoice)
|
|
10698
10852
|
return { tools: known, source: "all" };
|
|
10699
|
-
|
|
10853
|
+
const platforms = new Set(selection.enabled);
|
|
10854
|
+
return {
|
|
10855
|
+
tools: withSupportTools((name) => platforms.has(agentPlatformForToolchain(name))),
|
|
10856
|
+
source: "config"
|
|
10857
|
+
};
|
|
10700
10858
|
}
|
|
10701
10859
|
async function planToolchainInstall(options2) {
|
|
10702
10860
|
const selection = await resolveToolchainSelection(options2);
|
|
@@ -11150,6 +11308,30 @@ var PUBLIC_ACTIONS = {
|
|
|
11150
11308
|
milestone: "C",
|
|
11151
11309
|
summary: "Fork the conversation into a new public session."
|
|
11152
11310
|
},
|
|
11311
|
+
"session.rewind": {
|
|
11312
|
+
version: 1,
|
|
11313
|
+
mutation: true,
|
|
11314
|
+
effects: ["provider-session"],
|
|
11315
|
+
observation: "receipt",
|
|
11316
|
+
milestone: "C",
|
|
11317
|
+
summary: "Rewind the conversation to before one of its prompts (Codex, Pi, Cursor)."
|
|
11318
|
+
},
|
|
11319
|
+
"session.branches": {
|
|
11320
|
+
version: 1,
|
|
11321
|
+
mutation: false,
|
|
11322
|
+
effects: [],
|
|
11323
|
+
observation: "immediate",
|
|
11324
|
+
milestone: "C",
|
|
11325
|
+
summary: "List the conversation's other branches, such as turns a rewind removed (Pi)."
|
|
11326
|
+
},
|
|
11327
|
+
"session.branch": {
|
|
11328
|
+
version: 1,
|
|
11329
|
+
mutation: true,
|
|
11330
|
+
effects: ["provider-session"],
|
|
11331
|
+
observation: "receipt",
|
|
11332
|
+
milestone: "C",
|
|
11333
|
+
summary: "Switch the conversation to another of its branches (Pi)."
|
|
11334
|
+
},
|
|
11153
11335
|
"session.interactions": {
|
|
11154
11336
|
version: 1,
|
|
11155
11337
|
mutation: false,
|
|
@@ -11782,6 +11964,22 @@ var PUBLIC_ACTIONS = {
|
|
|
11782
11964
|
milestone: "D",
|
|
11783
11965
|
summary: "Read one piece of a planned diagnostics bundle. Nothing is uploaded."
|
|
11784
11966
|
},
|
|
11967
|
+
"self-improvement.status": {
|
|
11968
|
+
version: 1,
|
|
11969
|
+
mutation: false,
|
|
11970
|
+
effects: [],
|
|
11971
|
+
observation: "immediate",
|
|
11972
|
+
milestone: "D",
|
|
11973
|
+
summary: "Read self-improvement's settings, the run in progress, the last run's summary, tracked tickets and conversation themes."
|
|
11974
|
+
},
|
|
11975
|
+
"self-improvement.run": {
|
|
11976
|
+
version: 1,
|
|
11977
|
+
mutation: true,
|
|
11978
|
+
effects: ["metadata", "process"],
|
|
11979
|
+
observation: "receipt",
|
|
11980
|
+
milestone: "D",
|
|
11981
|
+
summary: "Start a self-improvement run in the background: diagnostics and, when on, the conversation review, filed as tickets. dryRun reports without filing or calling a model."
|
|
11982
|
+
},
|
|
11785
11983
|
"host.status": {
|
|
11786
11984
|
version: 1,
|
|
11787
11985
|
mutation: false,
|
|
@@ -12862,6 +13060,8 @@ var CLAUDE_PINNED_RUNTIME_ENV = Object.freeze({
|
|
|
12862
13060
|
DISABLE_AUTOUPDATER: "1",
|
|
12863
13061
|
FORCE_AUTOUPDATE_PLUGINS: "1"
|
|
12864
13062
|
});
|
|
13063
|
+
var QUOTED_ARG = String.raw`"((?:[^"\\]|\\[\\"$\x60])*)"`;
|
|
13064
|
+
var OPENCODE_LAUNCH_PATTERN = new RegExp("^" + Object.entries(OPENCODE_PINNED_RUNTIME_ENV).map(([name, value]) => `${name}=${value} `).join("") + `opencode(?: --model ${QUOTED_ARG})?(?: --prompt ${QUOTED_ARG})?(\\r?\\n)?$`);
|
|
12865
13065
|
|
|
12866
13066
|
// src/client/fix.ts
|
|
12867
13067
|
init_layout();
|
|
@@ -13035,7 +13235,7 @@ import path5 from "path";
|
|
|
13035
13235
|
// ../../apps/backend/package.json
|
|
13036
13236
|
var package_default = {
|
|
13037
13237
|
name: "@orkestrator/backend",
|
|
13038
|
-
version: "2.37.
|
|
13238
|
+
version: "2.37.4-beta",
|
|
13039
13239
|
private: true,
|
|
13040
13240
|
type: "module",
|
|
13041
13241
|
exports: {
|
|
@@ -13817,6 +14017,11 @@ var BACKGROUND_CAPABLE_SHELL_TOOL_NAMES = new Set([
|
|
|
13817
14017
|
"run_terminal_cmd",
|
|
13818
14018
|
"execute_command"
|
|
13819
14019
|
]);
|
|
14020
|
+
var NATIVE_AGENT_BRANCH_LIST_LIMITS = Object.freeze({
|
|
14021
|
+
branches: 50,
|
|
14022
|
+
promptChars: 280,
|
|
14023
|
+
entryIdChars: 512
|
|
14024
|
+
});
|
|
13820
14025
|
var DEFAULT_NATIVE_AGENT_LIVE_WINDOW = {
|
|
13821
14026
|
messages: 100,
|
|
13822
14027
|
targetBytes: 512 * 1024
|
|
@@ -14727,6 +14932,9 @@ function defaultSleep(ms, signal) {
|
|
|
14727
14932
|
signal?.addEventListener("abort", done, { once: true });
|
|
14728
14933
|
});
|
|
14729
14934
|
}
|
|
14935
|
+
function observationClock(io) {
|
|
14936
|
+
return io.sleep ? { sleep: io.sleep.bind(io), now: () => io.now() } : {};
|
|
14937
|
+
}
|
|
14730
14938
|
function signalName(signal) {
|
|
14731
14939
|
return signal?.reason === "SIGTERM" ? "SIGTERM" : "SIGINT";
|
|
14732
14940
|
}
|
|
@@ -14835,7 +15043,11 @@ async function submitForWait(context, action, input, options2, timeoutMs) {
|
|
|
14835
15043
|
return { done: false };
|
|
14836
15044
|
throw lookup;
|
|
14837
15045
|
}
|
|
14838
|
-
}, {
|
|
15046
|
+
}, {
|
|
15047
|
+
timeoutMs: Math.max(0, deadline - Date.now()),
|
|
15048
|
+
signal: context.signal,
|
|
15049
|
+
...observationClock(context.io)
|
|
15050
|
+
});
|
|
14839
15051
|
} catch (lookup) {
|
|
14840
15052
|
const stopped = context.signal?.aborted ? new ObservationStopped("signal", signalName(context.signal)) : lookup;
|
|
14841
15053
|
if (stopped instanceof ObservationStopped && stopped.reason === "deadline")
|
|
@@ -14919,7 +15131,7 @@ async function waitForOperation(context, session, initial, timeoutMs, options2 =
|
|
|
14919
15131
|
});
|
|
14920
15132
|
}
|
|
14921
15133
|
return { done: false };
|
|
14922
|
-
}, { timeoutMs, signal: context.signal });
|
|
15134
|
+
}, { timeoutMs, signal: context.signal, ...observationClock(context.io) });
|
|
14923
15135
|
} catch (error) {
|
|
14924
15136
|
if (error instanceof ObservationStopped) {
|
|
14925
15137
|
throw stoppedError(error, latest.action, latest, "the operation");
|
|
@@ -14988,7 +15200,7 @@ async function waitForEnvironment(context, session, environmentId, condition, re
|
|
|
14988
15200
|
};
|
|
14989
15201
|
}
|
|
14990
15202
|
return { done: false };
|
|
14991
|
-
}, { timeoutMs, signal: context.signal });
|
|
15203
|
+
}, { timeoutMs, signal: context.signal, ...observationClock(context.io) });
|
|
14992
15204
|
} catch (error) {
|
|
14993
15205
|
const stopped = context.signal?.aborted ? new ObservationStopped("signal", signalName(context.signal)) : Date.now() >= deadline && error instanceof CliError && error.code === "connection-failed" ? new ObservationStopped("deadline") : error;
|
|
14994
15206
|
if (stopped instanceof ObservationStopped) {
|
|
@@ -15098,7 +15310,8 @@ var attentionCommands = [
|
|
|
15098
15310
|
return { done: false };
|
|
15099
15311
|
}, {
|
|
15100
15312
|
timeoutMs: parsed.options.timeout ?? DEFAULT_WAIT_MS,
|
|
15101
|
-
signal: context.signal
|
|
15313
|
+
signal: context.signal,
|
|
15314
|
+
...observationClock(context.io)
|
|
15102
15315
|
});
|
|
15103
15316
|
} catch (error) {
|
|
15104
15317
|
if (!(error instanceof ObservationStopped))
|
|
@@ -22003,7 +22216,10 @@ var sessionCommands = [
|
|
|
22003
22216
|
warnings,
|
|
22004
22217
|
connection: session.identity,
|
|
22005
22218
|
ids: receipt ? [receipt.operationId] : [],
|
|
22006
|
-
human:
|
|
22219
|
+
human: [
|
|
22220
|
+
...receipt ? receiptLines(receipt) : ["steered"],
|
|
22221
|
+
...result?.deliveredAs === "new-turn" ? ["The turn had ended, so the text was sent as a new turn."] : result?.deliveredAs === "queued" ? ["The turn had moved on, so the text was queued as the next turn."] : []
|
|
22222
|
+
]
|
|
22007
22223
|
};
|
|
22008
22224
|
}
|
|
22009
22225
|
},
|
|
@@ -22118,6 +22334,83 @@ var sessionCommands = [
|
|
|
22118
22334
|
};
|
|
22119
22335
|
}
|
|
22120
22336
|
},
|
|
22337
|
+
{
|
|
22338
|
+
path: ["session", "rewind"],
|
|
22339
|
+
action: "session.rewind",
|
|
22340
|
+
inputFields: { message: "messageId" },
|
|
22341
|
+
summary: "Rewind the conversation to before one of its prompts (Codex, Pi, Cursor).",
|
|
22342
|
+
description: "Removes that prompt, its response and every later turn from the conversation. Files are not reverted. Codex and Cursor cannot bring the turns back; Pi keeps them as a branch (`session branches`).",
|
|
22343
|
+
positionals: [{ name: "session", required: true }],
|
|
22344
|
+
options: [
|
|
22345
|
+
{
|
|
22346
|
+
name: "message",
|
|
22347
|
+
kind: "string",
|
|
22348
|
+
valueName: "MESSAGE_ID",
|
|
22349
|
+
description: "Required. A prompt (user message) ID from `session transcript`."
|
|
22350
|
+
},
|
|
22351
|
+
REQUEST_ID_OPTION
|
|
22352
|
+
],
|
|
22353
|
+
async run(context, parsed) {
|
|
22354
|
+
if (typeof parsed.options.message !== "string" || !parsed.options.message) {
|
|
22355
|
+
throw new CliError("invalid-input", "--message is required");
|
|
22356
|
+
}
|
|
22357
|
+
const { session, result, receipt, warnings } = await submit(context, "session.rewind", { sessionId: parsed.positionals.session, messageId: parsed.options.message }, parsed.options);
|
|
22358
|
+
return {
|
|
22359
|
+
action: "session.rewind",
|
|
22360
|
+
result,
|
|
22361
|
+
receipt,
|
|
22362
|
+
warnings,
|
|
22363
|
+
connection: session.identity,
|
|
22364
|
+
human: [`rewound to before ${String(parsed.options.message)}`]
|
|
22365
|
+
};
|
|
22366
|
+
}
|
|
22367
|
+
},
|
|
22368
|
+
{
|
|
22369
|
+
path: ["session", "branches"],
|
|
22370
|
+
action: "session.branches",
|
|
22371
|
+
summary: "List the conversation's other branches, such as turns a rewind removed (Pi).",
|
|
22372
|
+
positionals: [{ name: "session", required: true }],
|
|
22373
|
+
options: [],
|
|
22374
|
+
idOutput: "branch entry IDs, one per line",
|
|
22375
|
+
async run(context, parsed) {
|
|
22376
|
+
const session = await context.session();
|
|
22377
|
+
const branches = await session.read("session.branches", { sessionId: parsed.positionals.session });
|
|
22378
|
+
return {
|
|
22379
|
+
action: "session.branches",
|
|
22380
|
+
result: branches,
|
|
22381
|
+
connection: session.identity,
|
|
22382
|
+
ids: branches.items.map((item) => item.id),
|
|
22383
|
+
human: table(["ENTRY ID", "PROMPT", "ENTRIES", "UPDATED"], branches.items.map((item) => [
|
|
22384
|
+
item.id,
|
|
22385
|
+
item.prompt,
|
|
22386
|
+
String(item.entries),
|
|
22387
|
+
String(item.updatedAt ?? "")
|
|
22388
|
+
]))
|
|
22389
|
+
};
|
|
22390
|
+
}
|
|
22391
|
+
},
|
|
22392
|
+
{
|
|
22393
|
+
path: ["session", "branch"],
|
|
22394
|
+
action: "session.branch",
|
|
22395
|
+
summary: "Switch the conversation to another branch from `session branches` (Pi).",
|
|
22396
|
+
description: "The branch being left is kept and listed by `session branches`.",
|
|
22397
|
+
positionals: [
|
|
22398
|
+
{ name: "session", required: true },
|
|
22399
|
+
{ name: "entry-id", required: true }
|
|
22400
|
+
],
|
|
22401
|
+
options: [REQUEST_ID_OPTION],
|
|
22402
|
+
async run(context, parsed) {
|
|
22403
|
+
const { session, result, receipt, warnings } = await submit(context, "session.branch", { sessionId: parsed.positionals.session, entryId: parsed.positionals["entry-id"] }, parsed.options);
|
|
22404
|
+
return {
|
|
22405
|
+
action: "session.branch",
|
|
22406
|
+
result,
|
|
22407
|
+
receipt,
|
|
22408
|
+
warnings,
|
|
22409
|
+
connection: session.identity,
|
|
22410
|
+
human: [`switched to branch ${parsed.positionals["entry-id"]}`]
|
|
22411
|
+
};
|
|
22412
|
+
}
|
|
22413
|
+
},
|
|
22121
22414
|
{
|
|
22122
22415
|
path: ["session", "interactions", "list"],
|
|
22123
22416
|
action: "session.interactions",
|
|
@@ -22149,7 +22442,7 @@ var sessionCommands = [
|
|
|
22149
22442
|
action: "session.interaction.resolve",
|
|
22150
22443
|
inputFields: { revision: "expectedRevision", choose: "answers", text: "answers" },
|
|
22151
22444
|
summary: "Answer one pending interaction at its current revision.",
|
|
22152
|
-
description: "--revision must match the interaction's current revision; a replaced or expired interaction is refused (exit 8), never answered. Nothing is approved implicitly.",
|
|
22445
|
+
description: "--revision must match the interaction's current revision; a replaced or expired interaction is refused (exit 8), never answered. Nothing is approved implicitly. --action answer without --choose or --text approves an approval that has no questions; the backend refuses it for an interaction with a required question (exit 2).",
|
|
22153
22446
|
positionals: [
|
|
22154
22447
|
{ name: "session", required: true },
|
|
22155
22448
|
{ name: "interaction", required: true }
|
|
@@ -22193,9 +22486,6 @@ var sessionCommands = [
|
|
|
22193
22486
|
throw new CliError("invalid-input", "--revision is required");
|
|
22194
22487
|
const action = oneOf(options2.action, ["answer", "approve-for-session", "decline", "deny", "cancel"], "--action");
|
|
22195
22488
|
const answers = parseAnswers(options2);
|
|
22196
|
-
if (action === "answer" && answers.length === 0) {
|
|
22197
|
-
throw new CliError("invalid-input", "--action answer needs --choose or --text");
|
|
22198
|
-
}
|
|
22199
22489
|
if (action !== "answer" && answers.length > 0) {
|
|
22200
22490
|
throw new CliError("invalid-input", "--choose/--text only apply to --action answer");
|
|
22201
22491
|
}
|
|
@@ -22355,7 +22645,8 @@ var sessionCommands = [
|
|
|
22355
22645
|
return { done: false };
|
|
22356
22646
|
}, {
|
|
22357
22647
|
timeoutMs: parsed.options.timeout ?? DEFAULT_WAIT_MS,
|
|
22358
|
-
signal: context.signal
|
|
22648
|
+
signal: context.signal,
|
|
22649
|
+
...observationClock(context.io)
|
|
22359
22650
|
});
|
|
22360
22651
|
} catch (error) {
|
|
22361
22652
|
if (!(error instanceof ObservationStopped))
|
|
@@ -25749,6 +26040,145 @@ var diagnosticsCommands = [
|
|
|
25749
26040
|
}
|
|
25750
26041
|
];
|
|
25751
26042
|
|
|
26043
|
+
// src/client/commands/self-improvement.ts
|
|
26044
|
+
var POLL_MS = 3000;
|
|
26045
|
+
var WAIT_LIMIT_MS = 60 * 60 * 1000;
|
|
26046
|
+
function runLines(run) {
|
|
26047
|
+
const refs = (items) => items.map((item) => `#${item.ticket} ${item.signature}`).join("; ");
|
|
26048
|
+
const lines = [
|
|
26049
|
+
`${run.trigger === "dry-run" ? "Preview" : run.trigger === "daily" ? "Daily run" : "Run"} ${run.outcome} at ${run.finishedAt}`
|
|
26050
|
+
];
|
|
26051
|
+
if (run.error)
|
|
26052
|
+
lines.push(` ${run.error}`);
|
|
26053
|
+
for (const item of run.created)
|
|
26054
|
+
lines.push(` new ticket #${item.ticket}: ${item.title}`);
|
|
26055
|
+
for (const item of run.wouldCreate)
|
|
26056
|
+
lines.push(` would file: ${item.title}`);
|
|
26057
|
+
if (run.verified.length)
|
|
26058
|
+
lines.push(` fixed and confirmed: ${refs(run.verified)}`);
|
|
26059
|
+
if (run.fixFailed.length) {
|
|
26060
|
+
lines.push(` fix did not work, back to the backlog: ${refs(run.fixFailed)}`);
|
|
26061
|
+
}
|
|
26062
|
+
if (run.partly.length)
|
|
26063
|
+
lines.push(` partly better, your call: ${refs(run.partly)}`);
|
|
26064
|
+
if (run.markedFixed.length)
|
|
26065
|
+
lines.push(` done on the board, now checking: ${refs(run.markedFixed)}`);
|
|
26066
|
+
if (run.conversations.enabled) {
|
|
26067
|
+
lines.push(` conversations: read ${run.conversations.read}, ${run.conversations.notesAdded} new notes, ${run.conversations.themes} themes, about $${run.conversations.costUsd.toFixed(2)} at list prices`);
|
|
26068
|
+
}
|
|
26069
|
+
for (const error of run.conversations.errors)
|
|
26070
|
+
lines.push(` conversation review: ${error}`);
|
|
26071
|
+
return lines;
|
|
26072
|
+
}
|
|
26073
|
+
function statusLines(status) {
|
|
26074
|
+
const lines = [
|
|
26075
|
+
`Self-improvement: ${status.enabled ? "on" : "off (Settings \u2192 Experimental)"}`,
|
|
26076
|
+
`Project: ${status.project?.name ?? "not chosen (Settings \u2192 Self-improvement)"}`,
|
|
26077
|
+
`Conversation review: ${status.settings.conversationReview ? "on" : "off"}; daily run: ${status.settings.dailyRun ? `on, next ${status.nextDailyRunAt ?? "when due"}` : "off"}`
|
|
26078
|
+
];
|
|
26079
|
+
if (status.running)
|
|
26080
|
+
lines.push(`Running: ${status.running.step}, started ${status.running.startedAt}`);
|
|
26081
|
+
if (status.lastRun)
|
|
26082
|
+
lines.push("", ...runLines(status.lastRun));
|
|
26083
|
+
if (status.tracked.length > 0) {
|
|
26084
|
+
lines.push("", "Tracked:");
|
|
26085
|
+
for (const item of status.tracked) {
|
|
26086
|
+
lines.push(` ${item.ticket ? `#${item.ticket}` : "-"} ${item.status} ${item.verdict ?? ""} ${item.title}`);
|
|
26087
|
+
}
|
|
26088
|
+
}
|
|
26089
|
+
return lines;
|
|
26090
|
+
}
|
|
26091
|
+
var selfImprovementCommands = [
|
|
26092
|
+
{
|
|
26093
|
+
path: ["self-improvement", "status"],
|
|
26094
|
+
action: "self-improvement.status",
|
|
26095
|
+
summary: "Show self-improvement's settings, the last run, tracked tickets and themes.",
|
|
26096
|
+
positionals: [],
|
|
26097
|
+
options: [],
|
|
26098
|
+
async run(context) {
|
|
26099
|
+
const session = await context.session();
|
|
26100
|
+
const status = await session.read("self-improvement.status", {});
|
|
26101
|
+
return {
|
|
26102
|
+
action: "self-improvement.status",
|
|
26103
|
+
result: status,
|
|
26104
|
+
connection: session.identity,
|
|
26105
|
+
human: statusLines(status)
|
|
26106
|
+
};
|
|
26107
|
+
}
|
|
26108
|
+
},
|
|
26109
|
+
{
|
|
26110
|
+
path: ["self-improvement", "run"],
|
|
26111
|
+
action: "self-improvement.run",
|
|
26112
|
+
summary: "Start a self-improvement run (experimental); --wait follows it to the end.",
|
|
26113
|
+
description: "Exports this machine's diagnostics, reviews conversations when that is on, and files what it finds on the chosen project's board. --dry-run reports what it would file without filing it or calling a model.",
|
|
26114
|
+
positionals: [],
|
|
26115
|
+
options: [
|
|
26116
|
+
{
|
|
26117
|
+
name: "dry-run",
|
|
26118
|
+
kind: "boolean",
|
|
26119
|
+
description: "Report without filing or calling a model."
|
|
26120
|
+
},
|
|
26121
|
+
{
|
|
26122
|
+
name: "wait",
|
|
26123
|
+
kind: "boolean",
|
|
26124
|
+
description: "Wait for the run to finish and print its summary."
|
|
26125
|
+
},
|
|
26126
|
+
REQUEST_ID_OPTION
|
|
26127
|
+
],
|
|
26128
|
+
async run(context, parsed) {
|
|
26129
|
+
const dryRun = optionalBoolean(parsed.options, "dry-run") === true;
|
|
26130
|
+
const { session, result, receipt, warnings } = await submit(context, "self-improvement.run", dryRun ? { dryRun: true } : {}, parsed.options);
|
|
26131
|
+
if (optionalBoolean(parsed.options, "wait") !== true) {
|
|
26132
|
+
return {
|
|
26133
|
+
action: "self-improvement.run",
|
|
26134
|
+
result,
|
|
26135
|
+
receipt,
|
|
26136
|
+
warnings,
|
|
26137
|
+
connection: session.identity,
|
|
26138
|
+
human: [
|
|
26139
|
+
`Started ${dryRun ? "a preview" : "a run"}; see it with \`orkestrator self-improvement status\`.`
|
|
26140
|
+
]
|
|
26141
|
+
};
|
|
26142
|
+
}
|
|
26143
|
+
const startedAt = typeof result.startedAt === "string" ? result.startedAt : null;
|
|
26144
|
+
const ours = (startedAtOfRun) => startedAt === null || startedAtOfRun === startedAt;
|
|
26145
|
+
const deadline = Date.now() + WAIT_LIMIT_MS;
|
|
26146
|
+
let status = await session.read("self-improvement.status", {});
|
|
26147
|
+
while (status.running && ours(status.running.startedAt)) {
|
|
26148
|
+
if (Date.now() > deadline) {
|
|
26149
|
+
throw new CliError("deadline-exceeded", "The run is still going; check it with `self-improvement status`.");
|
|
26150
|
+
}
|
|
26151
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_MS));
|
|
26152
|
+
status = await session.read("self-improvement.status", {});
|
|
26153
|
+
}
|
|
26154
|
+
const lastRun = status.lastRun && ours(status.lastRun.startedAt) ? status.lastRun : null;
|
|
26155
|
+
if (!lastRun) {
|
|
26156
|
+
return {
|
|
26157
|
+
action: "self-improvement.run",
|
|
26158
|
+
result: { ...result, lastRun: null },
|
|
26159
|
+
receipt,
|
|
26160
|
+
warnings,
|
|
26161
|
+
connection: session.identity,
|
|
26162
|
+
human: [
|
|
26163
|
+
"This request's run is no longer the last one; see `orkestrator self-improvement status`."
|
|
26164
|
+
]
|
|
26165
|
+
};
|
|
26166
|
+
}
|
|
26167
|
+
if (lastRun.outcome === "failed") {
|
|
26168
|
+
throw new CliError("run-failed", `The self-improvement run failed: ${lastRun.error ?? "see self-improvement status"}`, { receipt, details: { startedAt: lastRun.startedAt } });
|
|
26169
|
+
}
|
|
26170
|
+
return {
|
|
26171
|
+
action: "self-improvement.run",
|
|
26172
|
+
result: { ...result, lastRun },
|
|
26173
|
+
receipt,
|
|
26174
|
+
warnings,
|
|
26175
|
+
connection: session.identity,
|
|
26176
|
+
human: runLines(lastRun)
|
|
26177
|
+
};
|
|
26178
|
+
}
|
|
26179
|
+
}
|
|
26180
|
+
];
|
|
26181
|
+
|
|
25752
26182
|
// src/client/commands/completion.ts
|
|
25753
26183
|
var SHELLS2 = ["bash", "zsh", "fish"];
|
|
25754
26184
|
function flagsOf(options2) {
|
|
@@ -28027,7 +28457,7 @@ async function waitForReceipt(context, session, receipt, limit, action) {
|
|
|
28027
28457
|
return { done: false };
|
|
28028
28458
|
throw error;
|
|
28029
28459
|
}
|
|
28030
|
-
}, { timeoutMs: limit, signal: context.signal });
|
|
28460
|
+
}, { timeoutMs: limit, signal: context.signal, ...observationClock(context.io) });
|
|
28031
28461
|
} catch (error) {
|
|
28032
28462
|
if (error instanceof ObservationStopped)
|
|
28033
28463
|
throw stopped(error, action, receipt);
|
|
@@ -28122,7 +28552,7 @@ var hostCommands = [
|
|
|
28122
28552
|
host = await observe(async () => {
|
|
28123
28553
|
const latest = await readHost(session);
|
|
28124
28554
|
return latest.checkRequest?.id === requestId ? { done: false } : { done: true, value: latest };
|
|
28125
|
-
}, { timeoutMs: limit, signal: context.signal });
|
|
28555
|
+
}, { timeoutMs: limit, signal: context.signal, ...observationClock(context.io) });
|
|
28126
28556
|
} catch (error) {
|
|
28127
28557
|
if (error instanceof ObservationStopped) {
|
|
28128
28558
|
throw stopped(error, "host.update.check", receipt);
|
|
@@ -30337,7 +30767,7 @@ async function waitForGoal(context, session, sessionId, goalId, timeoutMs, optio
|
|
|
30337
30767
|
...receiptOption,
|
|
30338
30768
|
details: goalDetails(sessionId, verdict.goal)
|
|
30339
30769
|
});
|
|
30340
|
-
}, { timeoutMs, signal: context.signal });
|
|
30770
|
+
}, { timeoutMs, signal: context.signal, ...observationClock(context.io) });
|
|
30341
30771
|
} catch (error) {
|
|
30342
30772
|
if (!(error instanceof ObservationStopped))
|
|
30343
30773
|
throw error;
|
|
@@ -32239,6 +32669,7 @@ var CLIENT_COMMANDS = [
|
|
|
32239
32669
|
...toolchainCommands,
|
|
32240
32670
|
...hostCommands,
|
|
32241
32671
|
...diagnosticsCommands,
|
|
32672
|
+
...selfImprovementCommands,
|
|
32242
32673
|
...serviceCommands,
|
|
32243
32674
|
...completionCommands(() => CLIENT_COMMANDS)
|
|
32244
32675
|
];
|