orkestrator 2.37.3-beta → 2.37.5-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 CHANGED
@@ -264,10 +264,13 @@ var init_bridge = __esm(() => {
264
264
  "prompt.accepted": "The route accepted a prompt and answered 202.",
265
265
  "prompt.failed": "A prompt turn failed; the session reports the error.",
266
266
  "prompt.processing-failed": "A prompt accepted by the route failed while processing.",
267
+ "prompt.processing-usage-limited": "A prompt accepted by the route ended on a usage limit; the turn already logged prompt.usage-limited.",
267
268
  "prompt.received": "A prompt reached the bridge; only its length is logged.",
268
269
  "prompt.send-failed": "A prompt request failed; the route answered with an error.",
270
+ "prompt.usage-limited": "A prompt turn ended because the account's plan allowance is used up; the session reports the limit.",
269
271
  "query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
270
272
  "query.failed": "A Claude query ended with an error result.",
273
+ "query.usage-limited": "Claude refused a query because the account's plan allowance is used up; the turn reports the limit.",
271
274
  "question.answer-failed": "The answer-question route failed.",
272
275
  "question.answering": "Answering a parked question.",
273
276
  "question.answers-prepared": "The route prepared a question answer for the session.",
@@ -474,10 +477,10 @@ var init_desktop = __esm(() => {
474
477
  "dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
475
478
  "instance.already-running": "Another instance holds this data directory; this one will quit.",
476
479
  "main-thread.stalled": {
477
- description: "A timer fired late, so windows, IPC and the stdout reader waited.",
480
+ description: "A timer fired late, so windows, IPC and the stdout reader waited. `cpuMs` is the CPU time the process used in the window: near `lagMs` the main thread was busy, far below it the thread waited.",
478
481
  essential: true,
479
482
  minLevel: "error",
480
- fields: { lagMs: "number", intervalMs: "number" }
483
+ fields: { lagMs: "number", intervalMs: "number", cpuMs: "number" }
481
484
  },
482
485
  "process-memory": "Development only: working set per Electron process type, sampled on an interval.",
483
486
  "process-memory.failed": "Development only: one process memory sample could not be read.",
@@ -527,12 +530,22 @@ var init_desktop = __esm(() => {
527
530
  denied: "A renderer asked for a permission the policy does not grant."
528
531
  }
529
532
  },
533
+ "desktop.webrequest": {
534
+ description: "Main-process webRequest listeners on Electron sessions. Listener names only; never a URL, header or error message.",
535
+ events: {
536
+ "listener.failed-closed": "A listener's decision threw or rejected, so it answered with its fail-closed response.",
537
+ "observer.failed": "A listener with no callback (a redirect observer) threw; its fallback ran.",
538
+ "callback.failed": "Electron's webRequest callback threw while a listener answered.",
539
+ ...THROTTLE_LOG_EVENTS
540
+ }
541
+ },
530
542
  "desktop.dialog": {
531
543
  description: "Native dialogs, whose modal loops hold the main thread while they are open.",
532
544
  events: {
533
545
  "attention-failed": "A dialog could not ask for the user's attention.",
534
546
  closed: "A native dialog closed.",
535
547
  "hidden-cancelled": "A hidden profile cancelled a dialog without opening native UI.",
548
+ "no-display-cancelled": "A headless Electron with no display cancelled a dialog instead of opening native UI.",
536
549
  "open-failed": "A dialog could not open; it was answered as cancelled.",
537
550
  opening: "A native dialog is opening.",
538
551
  "preview-beforeunload-ignored": "A browser preview's beforeunload handler was ignored.",
@@ -916,6 +929,7 @@ var init_native_agent = __esm(() => {
916
929
  "agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
917
930
  "coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
918
931
  "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
932
+ "monitor.silent": "The request monitor's stream stopped heartbeating, so it is replaced. `silenceMs` only.",
919
933
  "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
920
934
  "request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
921
935
  "credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
@@ -938,6 +952,7 @@ var init_native_agent = __esm(() => {
938
952
  "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.",
939
953
  "container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
940
954
  "container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
955
+ "container-server.cleanup-failed": "Cleanup after OpenCode startup failed; step names only, while the original startup error is preserved.",
941
956
  "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.",
942
957
  "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.",
943
958
  "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.",
@@ -1000,12 +1015,13 @@ var init_runtime = __esm(() => {
1000
1015
  description: "This process's event loop. A stall of 10 seconds or more is written at error, so no level hides it.",
1001
1016
  events: {
1002
1017
  stalled: {
1003
- description: "A timer fired late, so every request in that window waited. In the backend the line also names what ran: `storageMs` and the `storage*` fields describe the slow SQLite calls in the window (`operation.slow` in `storage`), `commandsInFlight` and `commands` the commands running, and `blockingCommand` one whose synchronous part overlapped it.",
1018
+ description: "A timer fired late, so every request in that window waited. In the backend the line also names what ran: `storageMs` and the `storage*` fields describe the slow SQLite calls in the window (`operation.slow` in `storage`), `commandsInFlight` and `commands` the commands running, `blockingCommand` one whose synchronous part overlapped it, and `jobsInWindow` and `jobs` the recurring jobs that ran around it. `cpuMs` is the CPU time the process used in the window: near `lagMs` its own thread was busy, far below it the thread waited.",
1004
1019
  essential: true,
1005
1020
  minLevel: "error",
1006
1021
  fields: {
1007
1022
  lagMs: "number",
1008
1023
  intervalMs: "number",
1024
+ cpuMs: "number",
1009
1025
  storageMs: "number",
1010
1026
  storageDatabase: "label",
1011
1027
  storageOp: "label",
@@ -1013,7 +1029,8 @@ var init_runtime = __esm(() => {
1013
1029
  storageLongestMs: "number",
1014
1030
  storageBusy: "boolean",
1015
1031
  commandsInFlight: "number",
1016
- blockingCommandMs: "number"
1032
+ blockingCommandMs: "number",
1033
+ jobsInWindow: "number"
1017
1034
  }
1018
1035
  }
1019
1036
  }
@@ -1057,6 +1074,8 @@ var init_terminal = __esm(() => {
1057
1074
  "pty.exit-notify-failed": "Notifying a terminal's exit failed.",
1058
1075
  "pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
1059
1076
  "setup.pty-reused": "A setup terminal reused its existing PTY.",
1077
+ "setup.pty-retired": "A setup retry ended the terminal the previous run left open, so the new run gets its own.",
1078
+ "setup.pty-retire-failed": "A setup retry could not end the previous run's process tree, so it kept that terminal and started nothing.",
1060
1079
  "setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
1061
1080
  "setup.pty-spawned": "A setup terminal's PTY started.",
1062
1081
  "setup.pty-exited": "A setup terminal's PTY exited.",
@@ -1188,6 +1207,7 @@ var init_tmux = __esm(() => {
1188
1207
  "cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
1189
1208
  "cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
1190
1209
  "cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
1210
+ "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.",
1191
1211
  "hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
1192
1212
  "hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
1193
1213
  "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
@@ -1329,6 +1349,7 @@ var init_storage = __esm(() => {
1329
1349
  "config.restrict-mode-failed": "A config file holding provider secrets could not be set to owner-only; the backend carries on.",
1330
1350
  "legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
1331
1351
  "legacy-json.archive-failed": "Imported JSON store files could not be archived.",
1352
+ "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.",
1332
1353
  "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.",
1333
1354
  "lease.heartbeat-failed": "A held lease's heartbeat failed, which shortens the lease; the next one retries.",
1334
1355
  "scrub.vacuum-failed": "Deleted-content page reclamation failed; the checkpoint is attempted independently.",
@@ -1382,9 +1403,12 @@ var init_build_pipeline = __esm(() => {
1382
1403
  "transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
1383
1404
  "restore.skipped": "A pipeline could not be restored at startup and was skipped.",
1384
1405
  "criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
1406
+ "completion-notes.publish-failed": "A finished pipeline's notes tab could not be added to the layout; the run stays complete.",
1385
1407
  "workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
1386
1408
  "rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
1387
1409
  "kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
1410
+ "kanban.environment-deleted-read-failed": "The pipelines of an environment being deleted could not be read, so their tickets keep their columns.",
1411
+ "kanban.environment-deleted-update-failed": "The ticket of a pipeline whose environment was deleted could not be moved; the deletion goes on.",
1388
1412
  "usage.read-failed": "Reading a stage session's token usage failed.",
1389
1413
  "checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
1390
1414
  "checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
@@ -1431,6 +1455,8 @@ var init_change_tracking = __esm(() => {
1431
1455
  "dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
1432
1456
  "turn.finalize-failed": "Finalizing a turn failed.",
1433
1457
  "turn.settle-failed": "Settling a late interrupted turn failed.",
1458
+ "turn.end-recovery": "A background retry of a turn end capture that timed out finished: recovered, done (no longer eligible) or exhausted.",
1459
+ "turn.end-recovery-failed": "A background retry of a turn end capture threw; it counts as a failed attempt.",
1434
1460
  "evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
1435
1461
  "measurement.failed": "Recomputing a tool's measurement failed."
1436
1462
  }
@@ -1441,6 +1467,7 @@ var init_change_tracking = __esm(() => {
1441
1467
  "baseline.update-failed": "An environment's diff baseline could not be updated.",
1442
1468
  "scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
1443
1469
  "scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
1470
+ "scan.target-missing": "A local environment's worktree folder is missing (deleted, moved or on an unmounted drive); no scan runs, the last results stay, marked stale, and the folder is checked again on the failure backoff.",
1444
1471
  "scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
1445
1472
  "scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
1446
1473
  "emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
@@ -1503,6 +1530,7 @@ var init_coordinator = __esm(() => {
1503
1530
  "node-release.no-coordinator": "Work closed on a released node belonged to a coordinator that no longer exists, so nobody was told.",
1504
1531
  "node-offline.notice-failed": "The notice that a node has been unreachable for a day could not be sent; the next failed read retries.",
1505
1532
  "node-offline.check-failed": "Whether a long-unreachable node's coordinators were told could not be checked; the next read retries.",
1533
+ "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.",
1506
1534
  "checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
1507
1535
  "checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
1508
1536
  "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`).",
@@ -1559,7 +1587,8 @@ var init_review = __esm(() => {
1559
1587
  "monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
1560
1588
  "monitor.merged-tickets-closed": "The startup sweep moved Kanban tickets whose pull request had merged to done (`count`).",
1561
1589
  "monitor.merged-tickets-close-failed": "The startup sweep closing Kanban tickets whose pull request merged failed; the next backend start retries.",
1562
- "monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
1590
+ "monitor.emit-failed": "A pull request monitor event could not be emitted to its sink.",
1591
+ "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`)."
1563
1592
  }
1564
1593
  }
1565
1594
  });
@@ -1599,6 +1628,8 @@ var init_agent_accounts = __esm(() => {
1599
1628
  "kept-note.failed": "Recording why a limit stop found no account to move to failed; the stop stands.",
1600
1629
  "container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
1601
1630
  "last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
1631
+ "shared-usage.save-failed": "The shared usage readings could not be saved; they stay in memory and the next reading saves them.",
1632
+ "shared-usage.record-failed": "A fresh usage reading could not be kept for sharing with other machines; the account's own reading stands.",
1602
1633
  "login-cleanup.failed": "A temporary login could not be cleaned up.",
1603
1634
  "login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
1604
1635
  "login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
@@ -1620,6 +1651,7 @@ var init_docker = __esm(() => {
1620
1651
  "git-mirror.mount-unavailable": "A new container gets no project Git mirror, so its clone goes to the remote.",
1621
1652
  "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.",
1622
1653
  "git-mirror.refreshed": "A project's Git mirror was built or updated.",
1654
+ "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.",
1623
1655
  "git-mirror.seeded": "A project's Git mirror was built from its host checkout and only what the remote added to it.",
1624
1656
  "git-mirror.seed-skipped": "A project's host checkout could not seed its Git mirror, so the build downloads everything.",
1625
1657
  "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.",
@@ -1633,6 +1665,9 @@ var init_docker = __esm(() => {
1633
1665
  "git-mirror.clone-fallback": "A new environment could not clone from its project's Git mirror and cloned from the remote.",
1634
1666
  "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.",
1635
1667
  "opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
1668
+ "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; that connection then sends nothing more.",
1669
+ "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.",
1670
+ "opencode.project-config-filtered": "Values were left out of a checkout's OpenCode configuration before a launched server reads it: 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.",
1636
1671
  "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.",
1637
1672
  "lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
1638
1673
  "login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
@@ -1667,6 +1702,17 @@ var init_docker = __esm(() => {
1667
1702
  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.",
1668
1703
  essential: true,
1669
1704
  fields: { provider: "label", containerPort: "number" }
1705
+ },
1706
+ "bridge.listener-refused": {
1707
+ description: "The socket listening on a container bridge's port is not the one the bridge the backend started opened, 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`.",
1708
+ essential: true,
1709
+ fields: { provider: "label", reason: "label" }
1710
+ },
1711
+ "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.",
1712
+ "bridge.listener-unrecorded": {
1713
+ 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.",
1714
+ essential: true,
1715
+ fields: { provider: "label", reason: "label" }
1670
1716
  }
1671
1717
  }
1672
1718
  },
@@ -1725,7 +1771,8 @@ var init_mcp = __esm(() => {
1725
1771
  "listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
1726
1772
  "state-listener.failed": "A Control MCP state listener threw; the others still run.",
1727
1773
  "delegation.remote-open-failed": "A delegation could not be opened on another node.",
1728
- "delegation.open-failed": "A coordinator delegation could not be opened."
1774
+ "delegation.open-failed": "A coordinator delegation could not be opened.",
1775
+ "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."
1729
1776
  }
1730
1777
  },
1731
1778
  "mcp-management": {
@@ -1822,6 +1869,7 @@ var init_nodes = __esm(() => {
1822
1869
  "ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
1823
1870
  "ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
1824
1871
  "ticket-sync.forget-failed": "A detached command node's ticket copies could not be released.",
1872
+ "usage-sync.failed": "Sharing usage readings with a node failed; the next reading or reconnect retries.",
1825
1873
  "fleet-update.requested": "The update policy asked an older leaf to install the command node's version.",
1826
1874
  "fleet-update.failed": "The update policy could not read or update a leaf; it retries later.",
1827
1875
  "fleet-update.policy-load-failed": "The stored update policy could not be read; it is off."
@@ -1938,6 +1986,24 @@ var init_scheduler = __esm(() => {
1938
1986
  });
1939
1987
  });
1940
1988
 
1989
+ // ../protocol/src/log-vocabulary/self-improvement.ts
1990
+ var SELF_IMPROVEMENT_LOG_AREAS;
1991
+ var init_self_improvement = __esm(() => {
1992
+ init_define();
1993
+ SELF_IMPROVEMENT_LOG_AREAS = defineLogAreas({
1994
+ "self-improvement": {
1995
+ description: "Self-improvement runs: diagnostics and conversation review turned into tickets. Counts and steps only, never conversation text.",
1996
+ events: {
1997
+ "run.started": "A run started; `trigger` is manual, daily or dry-run.",
1998
+ "run.finished": "A run finished; `created`, `verified`, `fixFailed` and `parts` count its tickets, confirmed fixes, failed fixes and conversation parts read.",
1999
+ "run.failed": "A run stopped before it finished; `reason` is a fixed label.",
2000
+ "review.call-failed": "One conversation review call failed; the run carries on and the part is read again next run.",
2001
+ "daily.check-failed": "The daily run check failed; the next check retries."
2002
+ }
2003
+ }
2004
+ });
2005
+ });
2006
+
1941
2007
  // ../protocol/src/log-vocabulary/web-app.ts
1942
2008
  var WEB_APP_LOG_AREAS;
1943
2009
  var init_web_app = __esm(() => {
@@ -2240,6 +2306,7 @@ var init_web_kanban = __esm(() => {
2240
2306
  "task.move-failed": "A task move failed and its status was rolled back.",
2241
2307
  "comment.add-failed": "A comment could not be added to a task.",
2242
2308
  "comment.delete-failed": "A comment could not be deleted from a task.",
2309
+ "pr.merge-failed": "Merging a ticket's pull request from its Notes tab failed; the error was shown to the user.",
2243
2310
  "image.add-failed": "An image could not be added to a task.",
2244
2311
  "image.delete-failed": "An image could not be deleted from a task.",
2245
2312
  "notes.load-failed": "Project notes could not be loaded; the editor stays disabled.",
@@ -2316,6 +2383,10 @@ var init_web_settings = __esm(() => {
2316
2383
  "web.settings": {
2317
2384
  description: "The settings screens.",
2318
2385
  events: {
2386
+ "self-improvement.status-failed": "Settings \u2192 Self-improvement could not read the status.",
2387
+ "self-improvement.projects-failed": "Settings \u2192 Self-improvement could not list the projects.",
2388
+ "self-improvement.save-failed": "Settings \u2192 Self-improvement could not save a setting.",
2389
+ "self-improvement.run-failed": "Settings \u2192 Self-improvement could not start a run.",
2319
2390
  "config.save-failed": "Global settings could not be saved.",
2320
2391
  "config.load-failed": "The settings page could not load the config.",
2321
2392
  "config.reload-failed": "Re-reading the workspace config after a save failed.",
@@ -2498,6 +2569,7 @@ var init_log_vocabulary = __esm(() => {
2498
2569
  init_host();
2499
2570
  init_transcript_artifacts();
2500
2571
  init_scheduler();
2572
+ init_self_improvement();
2501
2573
  init_web_app();
2502
2574
  init_web_build_pipeline();
2503
2575
  init_web_chat();
@@ -2550,6 +2622,7 @@ var init_log_vocabulary = __esm(() => {
2550
2622
  ...HOST_LOG_AREAS,
2551
2623
  ...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
2552
2624
  ...SCHEDULER_LOG_AREAS,
2625
+ ...SELF_IMPROVEMENT_LOG_AREAS,
2553
2626
  ...WEB_APP_LOG_AREAS,
2554
2627
  ...WEB_BUILD_PIPELINE_LOG_AREAS,
2555
2628
  ...WEB_CHAT_LOG_AREAS,
@@ -2570,7 +2643,7 @@ var init_log_vocabulary = __esm(() => {
2570
2643
  var init_renderer_errors = () => {};
2571
2644
 
2572
2645
  // ../protocol/src/log-essential-labels.ts
2573
- 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;
2646
+ 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;
2574
2647
  var init_log_essential_labels = __esm(() => {
2575
2648
  init_log_vocabulary();
2576
2649
  init_renderer_errors();
@@ -2679,6 +2752,14 @@ var init_log_essential_labels = __esm(() => {
2679
2752
  "SIGXFSZ"
2680
2753
  ]);
2681
2754
  PROVIDERS = new Set(["claude", "codex", "opencode", "cursor", "grok", "acp", "pi"]);
2755
+ BRIDGE_LISTENER_REASONS = new Set([
2756
+ "different-socket",
2757
+ "several-sockets",
2758
+ "pending",
2759
+ "scan-incomplete",
2760
+ "no-listener",
2761
+ "launch-exited"
2762
+ ]);
2682
2763
  SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
2683
2764
  STORAGE_DATABASES = new Set(["main", "ledger", "other"]);
2684
2765
  STORAGE_OPERATIONS = new Set([
@@ -10908,8 +10989,7 @@ var SERVER_BOOLEAN_FLAGS = Object.freeze([
10908
10989
  "--desktop-web-client",
10909
10990
  "--strict-docker-owner",
10910
10991
  "--strict-gateway-port",
10911
- "--tailscale-serve",
10912
- "--unsafe-allow-non-tailscale-bind"
10992
+ "--tailscale-serve"
10913
10993
  ]);
10914
10994
  function isServerFlag(token) {
10915
10995
  return SERVER_VALUE_FLAGS.includes(token) || SERVER_BOOLEAN_FLAGS.includes(token);
@@ -11238,6 +11318,30 @@ var PUBLIC_ACTIONS = {
11238
11318
  milestone: "C",
11239
11319
  summary: "Fork the conversation into a new public session."
11240
11320
  },
11321
+ "session.rewind": {
11322
+ version: 1,
11323
+ mutation: true,
11324
+ effects: ["provider-session"],
11325
+ observation: "receipt",
11326
+ milestone: "C",
11327
+ summary: "Rewind the conversation to before one of its prompts (Codex, Pi, Cursor)."
11328
+ },
11329
+ "session.branches": {
11330
+ version: 1,
11331
+ mutation: false,
11332
+ effects: [],
11333
+ observation: "immediate",
11334
+ milestone: "C",
11335
+ summary: "List the conversation's other branches, such as turns a rewind removed (Pi)."
11336
+ },
11337
+ "session.branch": {
11338
+ version: 1,
11339
+ mutation: true,
11340
+ effects: ["provider-session"],
11341
+ observation: "receipt",
11342
+ milestone: "C",
11343
+ summary: "Switch the conversation to another of its branches (Pi)."
11344
+ },
11241
11345
  "session.interactions": {
11242
11346
  version: 1,
11243
11347
  mutation: false,
@@ -11870,6 +11974,22 @@ var PUBLIC_ACTIONS = {
11870
11974
  milestone: "D",
11871
11975
  summary: "Read one piece of a planned diagnostics bundle. Nothing is uploaded."
11872
11976
  },
11977
+ "self-improvement.status": {
11978
+ version: 1,
11979
+ mutation: false,
11980
+ effects: [],
11981
+ observation: "immediate",
11982
+ milestone: "D",
11983
+ summary: "Read self-improvement's settings, the run in progress, the last run's summary, tracked tickets and conversation themes."
11984
+ },
11985
+ "self-improvement.run": {
11986
+ version: 1,
11987
+ mutation: true,
11988
+ effects: ["metadata", "process"],
11989
+ observation: "receipt",
11990
+ milestone: "D",
11991
+ 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."
11992
+ },
11873
11993
  "host.status": {
11874
11994
  version: 1,
11875
11995
  mutation: false,
@@ -12950,6 +13070,8 @@ var CLAUDE_PINNED_RUNTIME_ENV = Object.freeze({
12950
13070
  DISABLE_AUTOUPDATER: "1",
12951
13071
  FORCE_AUTOUPDATE_PLUGINS: "1"
12952
13072
  });
13073
+ var QUOTED_ARG = String.raw`"((?:[^"\\]|\\[\\"$\x60])*)"`;
13074
+ 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)?$`);
12953
13075
 
12954
13076
  // src/client/fix.ts
12955
13077
  init_layout();
@@ -13123,7 +13245,7 @@ import path5 from "path";
13123
13245
  // ../../apps/backend/package.json
13124
13246
  var package_default = {
13125
13247
  name: "@orkestrator/backend",
13126
- version: "2.37.3-beta",
13248
+ version: "2.37.5-beta",
13127
13249
  private: true,
13128
13250
  type: "module",
13129
13251
  exports: {
@@ -13154,7 +13276,7 @@ var package_default = {
13154
13276
  effect: "4.1.2",
13155
13277
  mermaid: "12.2.0",
13156
13278
  "pdfjs-dist": "6.4.299",
13157
- "playwright-core": "1.64.0",
13279
+ "playwright-core": "1.65.0",
13158
13280
  sharp: "^0.35.5",
13159
13281
  ws: "8.22.0"
13160
13282
  },
@@ -13905,6 +14027,11 @@ var BACKGROUND_CAPABLE_SHELL_TOOL_NAMES = new Set([
13905
14027
  "run_terminal_cmd",
13906
14028
  "execute_command"
13907
14029
  ]);
14030
+ var NATIVE_AGENT_BRANCH_LIST_LIMITS = Object.freeze({
14031
+ branches: 50,
14032
+ promptChars: 280,
14033
+ entryIdChars: 512
14034
+ });
13908
14035
  var DEFAULT_NATIVE_AGENT_LIVE_WINDOW = {
13909
14036
  messages: 100,
13910
14037
  targetBytes: 512 * 1024
@@ -14815,6 +14942,9 @@ function defaultSleep(ms, signal) {
14815
14942
  signal?.addEventListener("abort", done, { once: true });
14816
14943
  });
14817
14944
  }
14945
+ function observationClock(io) {
14946
+ return io.sleep ? { sleep: io.sleep.bind(io), now: () => io.now() } : {};
14947
+ }
14818
14948
  function signalName(signal) {
14819
14949
  return signal?.reason === "SIGTERM" ? "SIGTERM" : "SIGINT";
14820
14950
  }
@@ -14923,7 +15053,11 @@ async function submitForWait(context, action, input, options2, timeoutMs) {
14923
15053
  return { done: false };
14924
15054
  throw lookup;
14925
15055
  }
14926
- }, { timeoutMs: Math.max(0, deadline - Date.now()), signal: context.signal });
15056
+ }, {
15057
+ timeoutMs: Math.max(0, deadline - Date.now()),
15058
+ signal: context.signal,
15059
+ ...observationClock(context.io)
15060
+ });
14927
15061
  } catch (lookup) {
14928
15062
  const stopped = context.signal?.aborted ? new ObservationStopped("signal", signalName(context.signal)) : lookup;
14929
15063
  if (stopped instanceof ObservationStopped && stopped.reason === "deadline")
@@ -15007,7 +15141,7 @@ async function waitForOperation(context, session, initial, timeoutMs, options2 =
15007
15141
  });
15008
15142
  }
15009
15143
  return { done: false };
15010
- }, { timeoutMs, signal: context.signal });
15144
+ }, { timeoutMs, signal: context.signal, ...observationClock(context.io) });
15011
15145
  } catch (error) {
15012
15146
  if (error instanceof ObservationStopped) {
15013
15147
  throw stoppedError(error, latest.action, latest, "the operation");
@@ -15076,7 +15210,7 @@ async function waitForEnvironment(context, session, environmentId, condition, re
15076
15210
  };
15077
15211
  }
15078
15212
  return { done: false };
15079
- }, { timeoutMs, signal: context.signal });
15213
+ }, { timeoutMs, signal: context.signal, ...observationClock(context.io) });
15080
15214
  } catch (error) {
15081
15215
  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;
15082
15216
  if (stopped instanceof ObservationStopped) {
@@ -15186,7 +15320,8 @@ var attentionCommands = [
15186
15320
  return { done: false };
15187
15321
  }, {
15188
15322
  timeoutMs: parsed.options.timeout ?? DEFAULT_WAIT_MS,
15189
- signal: context.signal
15323
+ signal: context.signal,
15324
+ ...observationClock(context.io)
15190
15325
  });
15191
15326
  } catch (error) {
15192
15327
  if (!(error instanceof ObservationStopped))
@@ -15326,7 +15461,6 @@ var TICKET_SECTION_DEFINITIONS = [
15326
15461
  kinds: ["feature", "work-brief"]
15327
15462
  }
15328
15463
  ];
15329
- var DEFINITION_BY_KEY = new Map(TICKET_SECTION_DEFINITIONS.map((definition) => [definition.key, definition]));
15330
15464
  function normalizedHeading(text) {
15331
15465
  return text.replace(/\*\*|__/g, "").replace(/[:.]+\s*$/, "").replace(/\s+/g, " ").trim().toLowerCase();
15332
15466
  }
@@ -20758,6 +20892,30 @@ var AutoPipelineDraftSchema = asModel(Struct({
20758
20892
  notes: notesSchema,
20759
20893
  uncommittedFiles: ArraySchema(text).check(isMaxLength(1000))
20760
20894
  }));
20895
+ var AutoPipelineEditsSchema = Struct({
20896
+ title: String4.check(isMaxLength(240)),
20897
+ description: String4.check(isMaxLength(32000)),
20898
+ acceptanceCriteria: ArraySchema(String4.check(isMaxLength(32000))).check(isMaxLength(100))
20899
+ });
20900
+ var AutoPipelineStateSchema = asModel(Union2([
20901
+ Struct({ phase: Literal2("idle") }),
20902
+ Struct({ phase: Literal2("drafting") }),
20903
+ Struct({ phase: Literal2("failed"), error: text }),
20904
+ Struct({
20905
+ phase: Literal2("ready"),
20906
+ draft: AutoPipelineDraftSchema,
20907
+ edits: optional2(AutoPipelineEditsSchema),
20908
+ reviewed: optional2(AutoPipelineTicketSchema),
20909
+ confirmError: optional2(text)
20910
+ }),
20911
+ Struct({
20912
+ phase: Literal2("promoting"),
20913
+ draft: AutoPipelineDraftSchema,
20914
+ edits: optional2(AutoPipelineEditsSchema),
20915
+ reviewed: optional2(AutoPipelineTicketSchema)
20916
+ }),
20917
+ Struct({ phase: Literal2("promoted"), pipelineId: text })
20918
+ ]));
20761
20919
  var AutoPipelineSourcesSchema = asModel(Struct({
20762
20920
  available: Boolean3,
20763
20921
  sources: ArraySchema(Struct({ tabId: text, label: text, disabledReason: optional2(text) })).check(isMaxLength(100))
@@ -22209,6 +22367,83 @@ var sessionCommands = [
22209
22367
  };
22210
22368
  }
22211
22369
  },
22370
+ {
22371
+ path: ["session", "rewind"],
22372
+ action: "session.rewind",
22373
+ inputFields: { message: "messageId" },
22374
+ summary: "Rewind the conversation to before one of its prompts (Codex, Pi, Cursor).",
22375
+ 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`).",
22376
+ positionals: [{ name: "session", required: true }],
22377
+ options: [
22378
+ {
22379
+ name: "message",
22380
+ kind: "string",
22381
+ valueName: "MESSAGE_ID",
22382
+ description: "Required. A prompt (user message) ID from `session transcript`."
22383
+ },
22384
+ REQUEST_ID_OPTION
22385
+ ],
22386
+ async run(context, parsed) {
22387
+ if (typeof parsed.options.message !== "string" || !parsed.options.message) {
22388
+ throw new CliError("invalid-input", "--message is required");
22389
+ }
22390
+ const { session, result, receipt, warnings } = await submit(context, "session.rewind", { sessionId: parsed.positionals.session, messageId: parsed.options.message }, parsed.options);
22391
+ return {
22392
+ action: "session.rewind",
22393
+ result,
22394
+ receipt,
22395
+ warnings,
22396
+ connection: session.identity,
22397
+ human: [`rewound to before ${String(parsed.options.message)}`]
22398
+ };
22399
+ }
22400
+ },
22401
+ {
22402
+ path: ["session", "branches"],
22403
+ action: "session.branches",
22404
+ summary: "List the conversation's other branches, such as turns a rewind removed (Pi).",
22405
+ positionals: [{ name: "session", required: true }],
22406
+ options: [],
22407
+ idOutput: "branch entry IDs, one per line",
22408
+ async run(context, parsed) {
22409
+ const session = await context.session();
22410
+ const branches = await session.read("session.branches", { sessionId: parsed.positionals.session });
22411
+ return {
22412
+ action: "session.branches",
22413
+ result: branches,
22414
+ connection: session.identity,
22415
+ ids: branches.items.map((item) => item.id),
22416
+ human: table(["ENTRY ID", "PROMPT", "ENTRIES", "UPDATED"], branches.items.map((item) => [
22417
+ item.id,
22418
+ item.prompt,
22419
+ String(item.entries),
22420
+ String(item.updatedAt ?? "")
22421
+ ]))
22422
+ };
22423
+ }
22424
+ },
22425
+ {
22426
+ path: ["session", "branch"],
22427
+ action: "session.branch",
22428
+ summary: "Switch the conversation to another branch from `session branches` (Pi).",
22429
+ description: "The branch being left is kept and listed by `session branches`.",
22430
+ positionals: [
22431
+ { name: "session", required: true },
22432
+ { name: "entry-id", required: true }
22433
+ ],
22434
+ options: [REQUEST_ID_OPTION],
22435
+ async run(context, parsed) {
22436
+ const { session, result, receipt, warnings } = await submit(context, "session.branch", { sessionId: parsed.positionals.session, entryId: parsed.positionals["entry-id"] }, parsed.options);
22437
+ return {
22438
+ action: "session.branch",
22439
+ result,
22440
+ receipt,
22441
+ warnings,
22442
+ connection: session.identity,
22443
+ human: [`switched to branch ${parsed.positionals["entry-id"]}`]
22444
+ };
22445
+ }
22446
+ },
22212
22447
  {
22213
22448
  path: ["session", "interactions", "list"],
22214
22449
  action: "session.interactions",
@@ -22240,7 +22475,7 @@ var sessionCommands = [
22240
22475
  action: "session.interaction.resolve",
22241
22476
  inputFields: { revision: "expectedRevision", choose: "answers", text: "answers" },
22242
22477
  summary: "Answer one pending interaction at its current revision.",
22243
- description: "--revision must match the interaction's current revision; a replaced or expired interaction is refused (exit 8), never answered. Nothing is approved implicitly.",
22478
+ 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).",
22244
22479
  positionals: [
22245
22480
  { name: "session", required: true },
22246
22481
  { name: "interaction", required: true }
@@ -22284,9 +22519,6 @@ var sessionCommands = [
22284
22519
  throw new CliError("invalid-input", "--revision is required");
22285
22520
  const action = oneOf(options2.action, ["answer", "approve-for-session", "decline", "deny", "cancel"], "--action");
22286
22521
  const answers = parseAnswers(options2);
22287
- if (action === "answer" && answers.length === 0) {
22288
- throw new CliError("invalid-input", "--action answer needs --choose or --text");
22289
- }
22290
22522
  if (action !== "answer" && answers.length > 0) {
22291
22523
  throw new CliError("invalid-input", "--choose/--text only apply to --action answer");
22292
22524
  }
@@ -22446,7 +22678,8 @@ var sessionCommands = [
22446
22678
  return { done: false };
22447
22679
  }, {
22448
22680
  timeoutMs: parsed.options.timeout ?? DEFAULT_WAIT_MS,
22449
- signal: context.signal
22681
+ signal: context.signal,
22682
+ ...observationClock(context.io)
22450
22683
  });
22451
22684
  } catch (error) {
22452
22685
  if (!(error instanceof ObservationStopped))
@@ -25840,6 +26073,145 @@ var diagnosticsCommands = [
25840
26073
  }
25841
26074
  ];
25842
26075
 
26076
+ // src/client/commands/self-improvement.ts
26077
+ var POLL_MS = 3000;
26078
+ var WAIT_LIMIT_MS = 60 * 60 * 1000;
26079
+ function runLines(run) {
26080
+ const refs = (items) => items.map((item) => `#${item.ticket} ${item.signature}`).join("; ");
26081
+ const lines = [
26082
+ `${run.trigger === "dry-run" ? "Preview" : run.trigger === "daily" ? "Daily run" : "Run"} ${run.outcome} at ${run.finishedAt}`
26083
+ ];
26084
+ if (run.error)
26085
+ lines.push(` ${run.error}`);
26086
+ for (const item of run.created)
26087
+ lines.push(` new ticket #${item.ticket}: ${item.title}`);
26088
+ for (const item of run.wouldCreate)
26089
+ lines.push(` would file: ${item.title}`);
26090
+ if (run.verified.length)
26091
+ lines.push(` fixed and confirmed: ${refs(run.verified)}`);
26092
+ if (run.fixFailed.length) {
26093
+ lines.push(` fix did not work, back to the backlog: ${refs(run.fixFailed)}`);
26094
+ }
26095
+ if (run.partly.length)
26096
+ lines.push(` partly better, your call: ${refs(run.partly)}`);
26097
+ if (run.markedFixed.length)
26098
+ lines.push(` done on the board, now checking: ${refs(run.markedFixed)}`);
26099
+ if (run.conversations.enabled) {
26100
+ 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`);
26101
+ }
26102
+ for (const error of run.conversations.errors)
26103
+ lines.push(` conversation review: ${error}`);
26104
+ return lines;
26105
+ }
26106
+ function statusLines(status) {
26107
+ const lines = [
26108
+ `Self-improvement: ${status.enabled ? "on" : "off (Settings \u2192 Experimental)"}`,
26109
+ `Project: ${status.project?.name ?? "not chosen (Settings \u2192 Self-improvement)"}`,
26110
+ `Conversation review: ${status.settings.conversationReview ? "on" : "off"}; daily run: ${status.settings.dailyRun ? `on, next ${status.nextDailyRunAt ?? "when due"}` : "off"}`
26111
+ ];
26112
+ if (status.running)
26113
+ lines.push(`Running: ${status.running.step}, started ${status.running.startedAt}`);
26114
+ if (status.lastRun)
26115
+ lines.push("", ...runLines(status.lastRun));
26116
+ if (status.tracked.length > 0) {
26117
+ lines.push("", "Tracked:");
26118
+ for (const item of status.tracked) {
26119
+ lines.push(` ${item.ticket ? `#${item.ticket}` : "-"} ${item.status} ${item.verdict ?? ""} ${item.title}`);
26120
+ }
26121
+ }
26122
+ return lines;
26123
+ }
26124
+ var selfImprovementCommands = [
26125
+ {
26126
+ path: ["self-improvement", "status"],
26127
+ action: "self-improvement.status",
26128
+ summary: "Show self-improvement's settings, the last run, tracked tickets and themes.",
26129
+ positionals: [],
26130
+ options: [],
26131
+ async run(context) {
26132
+ const session = await context.session();
26133
+ const status = await session.read("self-improvement.status", {});
26134
+ return {
26135
+ action: "self-improvement.status",
26136
+ result: status,
26137
+ connection: session.identity,
26138
+ human: statusLines(status)
26139
+ };
26140
+ }
26141
+ },
26142
+ {
26143
+ path: ["self-improvement", "run"],
26144
+ action: "self-improvement.run",
26145
+ summary: "Start a self-improvement run (experimental); --wait follows it to the end.",
26146
+ 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.",
26147
+ positionals: [],
26148
+ options: [
26149
+ {
26150
+ name: "dry-run",
26151
+ kind: "boolean",
26152
+ description: "Report without filing or calling a model."
26153
+ },
26154
+ {
26155
+ name: "wait",
26156
+ kind: "boolean",
26157
+ description: "Wait for the run to finish and print its summary."
26158
+ },
26159
+ REQUEST_ID_OPTION
26160
+ ],
26161
+ async run(context, parsed) {
26162
+ const dryRun = optionalBoolean(parsed.options, "dry-run") === true;
26163
+ const { session, result, receipt, warnings } = await submit(context, "self-improvement.run", dryRun ? { dryRun: true } : {}, parsed.options);
26164
+ if (optionalBoolean(parsed.options, "wait") !== true) {
26165
+ return {
26166
+ action: "self-improvement.run",
26167
+ result,
26168
+ receipt,
26169
+ warnings,
26170
+ connection: session.identity,
26171
+ human: [
26172
+ `Started ${dryRun ? "a preview" : "a run"}; see it with \`orkestrator self-improvement status\`.`
26173
+ ]
26174
+ };
26175
+ }
26176
+ const startedAt = typeof result.startedAt === "string" ? result.startedAt : null;
26177
+ const ours = (startedAtOfRun) => startedAt === null || startedAtOfRun === startedAt;
26178
+ const deadline = Date.now() + WAIT_LIMIT_MS;
26179
+ let status = await session.read("self-improvement.status", {});
26180
+ while (status.running && ours(status.running.startedAt)) {
26181
+ if (Date.now() > deadline) {
26182
+ throw new CliError("deadline-exceeded", "The run is still going; check it with `self-improvement status`.");
26183
+ }
26184
+ await new Promise((resolve) => setTimeout(resolve, POLL_MS));
26185
+ status = await session.read("self-improvement.status", {});
26186
+ }
26187
+ const lastRun = status.lastRun && ours(status.lastRun.startedAt) ? status.lastRun : null;
26188
+ if (!lastRun) {
26189
+ return {
26190
+ action: "self-improvement.run",
26191
+ result: { ...result, lastRun: null },
26192
+ receipt,
26193
+ warnings,
26194
+ connection: session.identity,
26195
+ human: [
26196
+ "This request's run is no longer the last one; see `orkestrator self-improvement status`."
26197
+ ]
26198
+ };
26199
+ }
26200
+ if (lastRun.outcome === "failed") {
26201
+ throw new CliError("run-failed", `The self-improvement run failed: ${lastRun.error ?? "see self-improvement status"}`, { receipt, details: { startedAt: lastRun.startedAt } });
26202
+ }
26203
+ return {
26204
+ action: "self-improvement.run",
26205
+ result: { ...result, lastRun },
26206
+ receipt,
26207
+ warnings,
26208
+ connection: session.identity,
26209
+ human: runLines(lastRun)
26210
+ };
26211
+ }
26212
+ }
26213
+ ];
26214
+
25843
26215
  // src/client/commands/completion.ts
25844
26216
  var SHELLS2 = ["bash", "zsh", "fish"];
25845
26217
  function flagsOf(options2) {
@@ -28118,7 +28490,7 @@ async function waitForReceipt(context, session, receipt, limit, action) {
28118
28490
  return { done: false };
28119
28491
  throw error;
28120
28492
  }
28121
- }, { timeoutMs: limit, signal: context.signal });
28493
+ }, { timeoutMs: limit, signal: context.signal, ...observationClock(context.io) });
28122
28494
  } catch (error) {
28123
28495
  if (error instanceof ObservationStopped)
28124
28496
  throw stopped(error, action, receipt);
@@ -28213,7 +28585,7 @@ var hostCommands = [
28213
28585
  host = await observe(async () => {
28214
28586
  const latest = await readHost(session);
28215
28587
  return latest.checkRequest?.id === requestId ? { done: false } : { done: true, value: latest };
28216
- }, { timeoutMs: limit, signal: context.signal });
28588
+ }, { timeoutMs: limit, signal: context.signal, ...observationClock(context.io) });
28217
28589
  } catch (error) {
28218
28590
  if (error instanceof ObservationStopped) {
28219
28591
  throw stopped(error, "host.update.check", receipt);
@@ -30428,7 +30800,7 @@ async function waitForGoal(context, session, sessionId, goalId, timeoutMs, optio
30428
30800
  ...receiptOption,
30429
30801
  details: goalDetails(sessionId, verdict.goal)
30430
30802
  });
30431
- }, { timeoutMs, signal: context.signal });
30803
+ }, { timeoutMs, signal: context.signal, ...observationClock(context.io) });
30432
30804
  } catch (error) {
30433
30805
  if (!(error instanceof ObservationStopped))
30434
30806
  throw error;
@@ -32330,6 +32702,7 @@ var CLIENT_COMMANDS = [
32330
32702
  ...toolchainCommands,
32331
32703
  ...hostCommands,
32332
32704
  ...diagnosticsCommands,
32705
+ ...selfImprovementCommands,
32333
32706
  ...serviceCommands,
32334
32707
  ...completionCommands(() => CLIENT_COMMANDS)
32335
32708
  ];