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
|
@@ -1184,12 +1184,22 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
1184
1184
|
denied: "A renderer asked for a permission the policy does not grant."
|
|
1185
1185
|
}
|
|
1186
1186
|
},
|
|
1187
|
+
"desktop.webrequest": {
|
|
1188
|
+
description: "Main-process webRequest listeners on Electron sessions. Listener names only; never a URL, header or error message.",
|
|
1189
|
+
events: {
|
|
1190
|
+
"listener.failed-closed": "A listener's decision threw or rejected, so it answered with its fail-closed response.",
|
|
1191
|
+
"observer.failed": "A listener with no callback (a redirect observer) threw; its fallback ran.",
|
|
1192
|
+
"callback.failed": "Electron's webRequest callback threw while a listener answered.",
|
|
1193
|
+
...THROTTLE_LOG_EVENTS
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1187
1196
|
"desktop.dialog": {
|
|
1188
1197
|
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
1189
1198
|
events: {
|
|
1190
1199
|
"attention-failed": "A dialog could not ask for the user's attention.",
|
|
1191
1200
|
closed: "A native dialog closed.",
|
|
1192
1201
|
"hidden-cancelled": "A hidden profile cancelled a dialog without opening native UI.",
|
|
1202
|
+
"no-display-cancelled": "A headless Electron with no display cancelled a dialog instead of opening native UI.",
|
|
1193
1203
|
"open-failed": "A dialog could not open; it was answered as cancelled.",
|
|
1194
1204
|
opening: "A native dialog is opening.",
|
|
1195
1205
|
"preview-beforeunload-ignored": "A browser preview's beforeunload handler was ignored.",
|
|
@@ -1272,6 +1282,9 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
1272
1282
|
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
1273
1283
|
"setup.tab-publish-failed": "The setup terminal's tab could not be published.",
|
|
1274
1284
|
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
1285
|
+
"git-https-probe.failed": "Checking whether a project's GitHub remote works over HTTPS failed; `reason` says why.",
|
|
1286
|
+
"git-https-remedy.failed": "Deciding whether to offer HTTPS after an SSH failure threw; no remedy is offered.",
|
|
1287
|
+
"git-origin.switched-to-https": "A project's origin remote was switched from GitHub SSH to HTTPS at the user's request.",
|
|
1275
1288
|
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
1276
1289
|
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
1277
1290
|
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
@@ -1542,11 +1555,38 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
1542
1555
|
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
1543
1556
|
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
1544
1557
|
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
1558
|
+
"monitor.silent": "The request monitor's stream stopped heartbeating, so it is replaced. `silenceMs` only.",
|
|
1545
1559
|
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
1546
1560
|
"request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
|
|
1547
1561
|
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
|
|
1548
1562
|
"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.",
|
|
1549
|
-
"host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only."
|
|
1563
|
+
"host-database.unreadable": "The shared OpenCode database could not be inspected, so host OpenCode opens it as usual. Error class only.",
|
|
1564
|
+
"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."
|
|
1565
|
+
}
|
|
1566
|
+
},
|
|
1567
|
+
"native-agent.opencode2": {
|
|
1568
|
+
description: "The OpenCode 2.x provider: its event monitor, steering, routing, host and container servers.",
|
|
1569
|
+
events: {
|
|
1570
|
+
"events.dropped": "The 2.x event stream ended or failed, so reads go to the server until it reconnects. Error class only.",
|
|
1571
|
+
"steer.unconfirmed": "A 2.x steer got no definite answer, so its delivery is reconciled from history. Error class only.",
|
|
1572
|
+
"provider.dispose-failed": "Disposing the 2.x provider of a replaced server failed. Error class only.",
|
|
1573
|
+
"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.",
|
|
1574
|
+
"mcp.remove-failed": "Removing a closed session's Orkestrator MCP server from the 2.x server failed. Error class only.",
|
|
1575
|
+
"protocol.select-failed": "A workflow could not read the OpenCode line setting, so its new session takes 1.x. Error class only.",
|
|
1576
|
+
"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.",
|
|
1577
|
+
"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.",
|
|
1578
|
+
"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.",
|
|
1579
|
+
"container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
|
|
1580
|
+
"container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
|
|
1581
|
+
"container-server.cleanup-failed": "Cleanup after OpenCode startup failed; step names only, while the original startup error is preserved.",
|
|
1582
|
+
"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.",
|
|
1583
|
+
"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.",
|
|
1584
|
+
"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.",
|
|
1585
|
+
"credential.server-exit-unclean": "The private 2.x server started to copy a sign-in did not stop cleanly. Error class only.",
|
|
1586
|
+
"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.",
|
|
1587
|
+
"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.",
|
|
1588
|
+
"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.",
|
|
1589
|
+
"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."
|
|
1550
1590
|
}
|
|
1551
1591
|
}
|
|
1552
1592
|
});
|
|
@@ -1773,6 +1813,7 @@ var TMUX_LOG_AREAS = defineLogAreas({
|
|
|
1773
1813
|
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
1774
1814
|
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
1775
1815
|
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
1816
|
+
"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.",
|
|
1776
1817
|
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
1777
1818
|
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
1778
1819
|
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
@@ -1902,6 +1943,7 @@ var STORAGE_LOG_AREAS = defineLogAreas({
|
|
|
1902
1943
|
"config.restrict-mode-failed": "A config file holding provider secrets could not be set to owner-only; the backend carries on.",
|
|
1903
1944
|
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
1904
1945
|
"legacy-json.archive-failed": "Imported JSON store files could not be archived.",
|
|
1946
|
+
"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.",
|
|
1905
1947
|
"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.",
|
|
1906
1948
|
"lease.heartbeat-failed": "A held lease's heartbeat failed, which shortens the lease; the next one retries.",
|
|
1907
1949
|
"scrub.vacuum-failed": "Deleted-content page reclamation failed; the checkpoint is attempted independently.",
|
|
@@ -1951,6 +1993,7 @@ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
|
1951
1993
|
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
1952
1994
|
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
1953
1995
|
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
1996
|
+
"completion-notes.publish-failed": "A finished pipeline's notes tab could not be added to the layout; the run stays complete.",
|
|
1954
1997
|
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
1955
1998
|
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
1956
1999
|
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
@@ -1992,6 +2035,8 @@ var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
|
|
|
1992
2035
|
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
1993
2036
|
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
1994
2037
|
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
2038
|
+
"turn.end-recovery": "A background retry of a turn end capture that timed out finished: recovered, done (no longer eligible) or exhausted.",
|
|
2039
|
+
"turn.end-recovery-failed": "A background retry of a turn end capture threw; it counts as a failed attempt.",
|
|
1995
2040
|
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
1996
2041
|
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
1997
2042
|
}
|
|
@@ -2060,6 +2105,7 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
|
2060
2105
|
"node-release.no-coordinator": "Work closed on a released node belonged to a coordinator that no longer exists, so nobody was told.",
|
|
2061
2106
|
"node-offline.notice-failed": "The notice that a node has been unreachable for a day could not be sent; the next failed read retries.",
|
|
2062
2107
|
"node-offline.check-failed": "Whether a long-unreachable node's coordinators were told could not be checked; the next read retries.",
|
|
2108
|
+
"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.",
|
|
2063
2109
|
"checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
|
|
2064
2110
|
"checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
|
|
2065
2111
|
"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`).",
|
|
@@ -2112,7 +2158,8 @@ var REVIEW_LOG_AREAS = defineLogAreas({
|
|
|
2112
2158
|
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
2113
2159
|
"monitor.merged-tickets-closed": "The startup sweep moved Kanban tickets whose pull request had merged to done (`count`).",
|
|
2114
2160
|
"monitor.merged-tickets-close-failed": "The startup sweep closing Kanban tickets whose pull request merged failed; the next backend start retries.",
|
|
2115
|
-
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
2161
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink.",
|
|
2162
|
+
"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`)."
|
|
2116
2163
|
}
|
|
2117
2164
|
}
|
|
2118
2165
|
});
|
|
@@ -2144,6 +2191,8 @@ var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
|
|
|
2144
2191
|
"kept-note.failed": "Recording why a limit stop found no account to move to failed; the stop stands.",
|
|
2145
2192
|
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
2146
2193
|
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
2194
|
+
"shared-usage.save-failed": "The shared usage readings could not be saved; they stay in memory and the next reading saves them.",
|
|
2195
|
+
"shared-usage.record-failed": "A fresh usage reading could not be kept for sharing with other machines; the account's own reading stands.",
|
|
2147
2196
|
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
2148
2197
|
"login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
|
|
2149
2198
|
"login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
|
|
@@ -2161,6 +2210,7 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
2161
2210
|
"git-mirror.mount-unavailable": "A new container gets no project Git mirror, so its clone goes to the remote.",
|
|
2162
2211
|
"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.",
|
|
2163
2212
|
"git-mirror.refreshed": "A project's Git mirror was built or updated.",
|
|
2213
|
+
"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.",
|
|
2164
2214
|
"git-mirror.seeded": "A project's Git mirror was built from its host checkout and only what the remote added to it.",
|
|
2165
2215
|
"git-mirror.seed-skipped": "A project's host checkout could not seed its Git mirror, so the build downloads everything.",
|
|
2166
2216
|
"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.",
|
|
@@ -2174,6 +2224,9 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
2174
2224
|
"git-mirror.clone-fallback": "A new environment could not clone from its project's Git mirror and cloned from the remote.",
|
|
2175
2225
|
"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.",
|
|
2176
2226
|
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
2227
|
+
"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.",
|
|
2228
|
+
"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.",
|
|
2229
|
+
"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.",
|
|
2177
2230
|
"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.",
|
|
2178
2231
|
"lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
|
|
2179
2232
|
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
@@ -2208,6 +2261,17 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
2208
2261
|
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.",
|
|
2209
2262
|
essential: true,
|
|
2210
2263
|
fields: { provider: "label", containerPort: "number" }
|
|
2264
|
+
},
|
|
2265
|
+
"bridge.listener-refused": {
|
|
2266
|
+
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`.",
|
|
2267
|
+
essential: true,
|
|
2268
|
+
fields: { provider: "label", reason: "label" }
|
|
2269
|
+
},
|
|
2270
|
+
"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.",
|
|
2271
|
+
"bridge.listener-unrecorded": {
|
|
2272
|
+
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.",
|
|
2273
|
+
essential: true,
|
|
2274
|
+
fields: { provider: "label", reason: "label" }
|
|
2211
2275
|
}
|
|
2212
2276
|
}
|
|
2213
2277
|
},
|
|
@@ -2262,7 +2326,8 @@ var MCP_LOG_AREAS = defineLogAreas({
|
|
|
2262
2326
|
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
2263
2327
|
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
2264
2328
|
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
2265
|
-
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
2329
|
+
"delegation.open-failed": "A coordinator delegation could not be opened.",
|
|
2330
|
+
"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."
|
|
2266
2331
|
}
|
|
2267
2332
|
},
|
|
2268
2333
|
"mcp-management": {
|
|
@@ -2347,6 +2412,7 @@ var NODES_LOG_AREAS = defineLogAreas({
|
|
|
2347
2412
|
"ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
|
|
2348
2413
|
"ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
|
|
2349
2414
|
"ticket-sync.forget-failed": "A detached command node's ticket copies could not be released.",
|
|
2415
|
+
"usage-sync.failed": "Sharing usage readings with a node failed; the next reading or reconnect retries.",
|
|
2350
2416
|
"fleet-update.requested": "The update policy asked an older leaf to install the command node's version.",
|
|
2351
2417
|
"fleet-update.failed": "The update policy could not read or update a leaf; it retries later.",
|
|
2352
2418
|
"fleet-update.policy-load-failed": "The stored update policy could not be read; it is off."
|
|
@@ -2438,6 +2504,20 @@ var SCHEDULER_LOG_AREAS = defineLogAreas({
|
|
|
2438
2504
|
}
|
|
2439
2505
|
});
|
|
2440
2506
|
|
|
2507
|
+
// ../protocol/src/log-vocabulary/self-improvement.ts
|
|
2508
|
+
var SELF_IMPROVEMENT_LOG_AREAS = defineLogAreas({
|
|
2509
|
+
"self-improvement": {
|
|
2510
|
+
description: "Self-improvement runs: diagnostics and conversation review turned into tickets. Counts and steps only, never conversation text.",
|
|
2511
|
+
events: {
|
|
2512
|
+
"run.started": "A run started; `trigger` is manual, daily or dry-run.",
|
|
2513
|
+
"run.finished": "A run finished; `created`, `verified`, `fixFailed` and `parts` count its tickets, confirmed fixes, failed fixes and conversation parts read.",
|
|
2514
|
+
"run.failed": "A run stopped before it finished; `reason` is a fixed label.",
|
|
2515
|
+
"review.call-failed": "One conversation review call failed; the run carries on and the part is read again next run.",
|
|
2516
|
+
"daily.check-failed": "The daily run check failed; the next check retries."
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
});
|
|
2520
|
+
|
|
2441
2521
|
// ../protocol/src/log-vocabulary/web-app.ts
|
|
2442
2522
|
var WEB_APP_LOG_AREAS = defineLogAreas({
|
|
2443
2523
|
"web.app": {
|
|
@@ -2773,6 +2853,10 @@ var WEB_SETTINGS_LOG_AREAS = defineLogAreas({
|
|
|
2773
2853
|
"web.settings": {
|
|
2774
2854
|
description: "The settings screens.",
|
|
2775
2855
|
events: {
|
|
2856
|
+
"self-improvement.status-failed": "Settings → Self-improvement could not read the status.",
|
|
2857
|
+
"self-improvement.projects-failed": "Settings → Self-improvement could not list the projects.",
|
|
2858
|
+
"self-improvement.save-failed": "Settings → Self-improvement could not save a setting.",
|
|
2859
|
+
"self-improvement.run-failed": "Settings → Self-improvement could not start a run.",
|
|
2776
2860
|
"config.save-failed": "Global settings could not be saved.",
|
|
2777
2861
|
"config.load-failed": "The settings page could not load the config.",
|
|
2778
2862
|
"config.reload-failed": "Re-reading the workspace config after a save failed.",
|
|
@@ -2942,6 +3026,7 @@ var LOG_VOCABULARY = {
|
|
|
2942
3026
|
...HOST_LOG_AREAS,
|
|
2943
3027
|
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
2944
3028
|
...SCHEDULER_LOG_AREAS,
|
|
3029
|
+
...SELF_IMPROVEMENT_LOG_AREAS,
|
|
2945
3030
|
...WEB_APP_LOG_AREAS,
|
|
2946
3031
|
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
2947
3032
|
...WEB_CHAT_LOG_AREAS,
|
|
@@ -3063,6 +3148,14 @@ var SIGNALS = new Set([
|
|
|
3063
3148
|
"SIGXFSZ"
|
|
3064
3149
|
]);
|
|
3065
3150
|
var PROVIDERS = new Set(["claude", "codex", "opencode", "cursor", "grok", "acp", "pi"]);
|
|
3151
|
+
var BRIDGE_LISTENER_REASONS = new Set([
|
|
3152
|
+
"different-socket",
|
|
3153
|
+
"several-sockets",
|
|
3154
|
+
"pending",
|
|
3155
|
+
"scan-incomplete",
|
|
3156
|
+
"no-listener",
|
|
3157
|
+
"launch-exited"
|
|
3158
|
+
]);
|
|
3066
3159
|
var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
3067
3160
|
var SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
|
|
3068
3161
|
var STORAGE_DATABASES = new Set(["main", "ledger", "other"]);
|
|
@@ -3922,8 +4015,10 @@ function reservePromptAdmission(state, closed) {
|
|
|
3922
4015
|
function releasePromptClaim(state, claim) {
|
|
3923
4016
|
if (claim === undefined)
|
|
3924
4017
|
return;
|
|
3925
|
-
if (state.promptClaim === claim)
|
|
4018
|
+
if (state.promptClaim === claim) {
|
|
3926
4019
|
state.promptClaim = undefined;
|
|
4020
|
+
state.lastAccessed = Date.now();
|
|
4021
|
+
}
|
|
3927
4022
|
if (state.cancelRequestedClaim === claim)
|
|
3928
4023
|
state.cancelRequestedClaim = undefined;
|
|
3929
4024
|
if (state.promptStartup?.claim === claim)
|
|
@@ -3981,24 +4076,60 @@ function sessionIsWorking(state) {
|
|
|
3981
4076
|
function sessionIsBlocked(state) {
|
|
3982
4077
|
return state.approvals.size > 0;
|
|
3983
4078
|
}
|
|
4079
|
+
// ../protocol/src/node/bounded-wait.ts
|
|
4080
|
+
function boundedWait(work, timeoutMs, options = {}) {
|
|
4081
|
+
return new Promise((resolve, reject) => {
|
|
4082
|
+
let timedOut = false;
|
|
4083
|
+
const timer = setTimeout(() => {
|
|
4084
|
+
timedOut = true;
|
|
4085
|
+
resolve({ settled: false });
|
|
4086
|
+
}, timeoutMs);
|
|
4087
|
+
unrefTimer(timer);
|
|
4088
|
+
Promise.resolve(work).then((value) => {
|
|
4089
|
+
if (!timedOut) {
|
|
4090
|
+
clearTimeout(timer);
|
|
4091
|
+
resolve({ settled: true, value });
|
|
4092
|
+
return;
|
|
4093
|
+
}
|
|
4094
|
+
disposeLate(options.onLate, value);
|
|
4095
|
+
}, (error) => {
|
|
4096
|
+
if (!timedOut) {
|
|
4097
|
+
clearTimeout(timer);
|
|
4098
|
+
reject(error);
|
|
4099
|
+
}
|
|
4100
|
+
});
|
|
4101
|
+
});
|
|
4102
|
+
}
|
|
4103
|
+
async function boundedWaitOrThrow(work, timeoutMs, timeoutError, options = {}) {
|
|
4104
|
+
const result = await boundedWait(work, timeoutMs, options);
|
|
4105
|
+
if (!result.settled)
|
|
4106
|
+
throw timeoutError();
|
|
4107
|
+
return result.value;
|
|
4108
|
+
}
|
|
4109
|
+
function unrefTimer(timer) {
|
|
4110
|
+
const handle = timer;
|
|
4111
|
+
if (typeof handle === "object" && typeof handle.unref === "function")
|
|
4112
|
+
handle.unref();
|
|
4113
|
+
}
|
|
4114
|
+
function disposeLate(onLate, value) {
|
|
4115
|
+
if (!onLate)
|
|
4116
|
+
return;
|
|
4117
|
+
try {
|
|
4118
|
+
const disposal = onLate(value);
|
|
4119
|
+
if (disposal && typeof disposal.then === "function") {
|
|
4120
|
+
Promise.resolve(disposal).catch(() => {
|
|
4121
|
+
return;
|
|
4122
|
+
});
|
|
4123
|
+
}
|
|
4124
|
+
} catch {}
|
|
4125
|
+
}
|
|
4126
|
+
|
|
3984
4127
|
// ../../bridges/pi-bridge/src/timeout.ts
|
|
3985
4128
|
class TimeoutError extends Error {
|
|
3986
4129
|
name = "TimeoutError";
|
|
3987
4130
|
}
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
try {
|
|
3991
|
-
return await Promise.race([
|
|
3992
|
-
work,
|
|
3993
|
-
new Promise((_, reject) => {
|
|
3994
|
-
timer = setTimeout(() => reject(new TimeoutError(message)), timeoutMs);
|
|
3995
|
-
timer.unref();
|
|
3996
|
-
})
|
|
3997
|
-
]);
|
|
3998
|
-
} finally {
|
|
3999
|
-
if (timer)
|
|
4000
|
-
clearTimeout(timer);
|
|
4001
|
-
}
|
|
4131
|
+
function withTimeout(work, timeoutMs, message) {
|
|
4132
|
+
return boundedWaitOrThrow(work, timeoutMs, () => new TimeoutError(message));
|
|
4002
4133
|
}
|
|
4003
4134
|
// ../../bridges/pi-bridge/src/pi-sdk.ts
|
|
4004
4135
|
import {
|
|
@@ -5347,6 +5478,58 @@ var PROTECTED_SEGMENTS = new Set([
|
|
|
5347
5478
|
".mcp.json"
|
|
5348
5479
|
]);
|
|
5349
5480
|
|
|
5481
|
+
// ../protocol/src/agent-mail.ts
|
|
5482
|
+
var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
|
|
5483
|
+
var AGENT_MAIL_MAX_STORE_BYTES = 32 * 1024 * 1024;
|
|
5484
|
+
var AGENT_MAIL_DEFAULT_RETENTION_DAYS = 14;
|
|
5485
|
+
var AGENT_MAIL_MAX_ATTACHMENT_BYTES = 8 * 1024 * 1024;
|
|
5486
|
+
var AGENT_MAIL_MAX_TOTAL_ATTACHMENT_BYTES = 32 * 1024 * 1024;
|
|
5487
|
+
var AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET = 16;
|
|
5488
|
+
var AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT = 40;
|
|
5489
|
+
var AGENT_MAIL_TOOL_NAMES = Object.freeze([
|
|
5490
|
+
"list_mailboxes",
|
|
5491
|
+
"send_message",
|
|
5492
|
+
"check_inbox",
|
|
5493
|
+
"read_message",
|
|
5494
|
+
"ack_message",
|
|
5495
|
+
"reply_message",
|
|
5496
|
+
"get_message_status"
|
|
5497
|
+
]);
|
|
5498
|
+
var DEFAULT_AGENT_MESSAGING_SETTINGS = Object.freeze({
|
|
5499
|
+
enabled: true,
|
|
5500
|
+
allowCrossProject: false,
|
|
5501
|
+
defaultInjectPolicy: "off",
|
|
5502
|
+
wakePeers: false,
|
|
5503
|
+
autonomousWakeBudget: AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET,
|
|
5504
|
+
hourlyWakeLimit: AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT,
|
|
5505
|
+
coordinatorStatusWakes: "settled",
|
|
5506
|
+
retentionDays: AGENT_MAIL_DEFAULT_RETENTION_DAYS,
|
|
5507
|
+
paused: false
|
|
5508
|
+
});
|
|
5509
|
+
function agentMailCapabilities(tabType, agent, locked = true) {
|
|
5510
|
+
if (tabType === "agent-native") {
|
|
5511
|
+
if (!locked || !agent)
|
|
5512
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
5513
|
+
if (agent === "claude" || agent === "codex" || agent === "opencode" || agent === "pi" || agent === "cursor" || agent === "grok") {
|
|
5514
|
+
return { canPull: true, canSend: true, canInject: true };
|
|
5515
|
+
}
|
|
5516
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
5517
|
+
}
|
|
5518
|
+
if (tabType === "claude-tmux")
|
|
5519
|
+
return { canPull: true, canSend: true, canInject: true };
|
|
5520
|
+
if (tabType === "pipeline-worker") {
|
|
5521
|
+
return agent ? { canPull: true, canSend: true, canInject: true } : { canPull: false, canSend: false, canInject: false };
|
|
5522
|
+
}
|
|
5523
|
+
if (["claude", "codex", "opencode"].includes(tabType)) {
|
|
5524
|
+
return { canPull: true, canSend: true, canInject: false };
|
|
5525
|
+
}
|
|
5526
|
+
if (["cursor", "grok", "pi"].includes(tabType)) {
|
|
5527
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
5528
|
+
}
|
|
5529
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
5530
|
+
}
|
|
5531
|
+
var NATIVE_AGENT_MAIL_CAPABILITIES = Object.freeze(Object.fromEntries(AGENT_PLATFORMS.map((agent) => [agent, agentMailCapabilities("agent-native", agent)])));
|
|
5532
|
+
|
|
5350
5533
|
// ../protocol/src/review-evidence-frames.ts
|
|
5351
5534
|
var COORDINATOR_WORKER_NO_PR_INSTRUCTION = "Do not open a pull request, even if the prompt below asks you to: commit your work and report back. Orkestrator raises the pull request from a PR tab once the work has been reviewed.";
|
|
5352
5535
|
var COORDINATOR_WORKER_VALIDATION_INSTRUCTION = "Run the focused checks your changes need and report them. When the prompt below says review follows, leave the required full test suite, typecheck, lint and build passes to review preparation unless it explicitly asks you to run them. When no review follows or the prompt does not say, follow the repository's validation requirements before handoff. Report any required full validation you did not run; do not assume a later review will run it.";
|
|
@@ -5928,6 +6111,11 @@ var BACKGROUND_CAPABLE_SHELL_TOOL_NAMES = new Set([
|
|
|
5928
6111
|
"run_terminal_cmd",
|
|
5929
6112
|
"execute_command"
|
|
5930
6113
|
]);
|
|
6114
|
+
var NATIVE_AGENT_BRANCH_LIST_LIMITS = Object.freeze({
|
|
6115
|
+
branches: 50,
|
|
6116
|
+
promptChars: 280,
|
|
6117
|
+
entryIdChars: 512
|
|
6118
|
+
});
|
|
5931
6119
|
var NATIVE_AGENT_COMMAND_EXECUTION_KINDS = [
|
|
5932
6120
|
"provider-prompt",
|
|
5933
6121
|
"provider-command",
|
|
@@ -6786,6 +6974,7 @@ function applySessionEvent(state, event) {
|
|
|
6786
6974
|
break;
|
|
6787
6975
|
case "compaction_end":
|
|
6788
6976
|
state.compacting = false;
|
|
6977
|
+
state.lastAccessed = Date.now();
|
|
6789
6978
|
applyCompaction(state, event);
|
|
6790
6979
|
break;
|
|
6791
6980
|
case "thinking_level_changed":
|
|
@@ -7630,58 +7819,6 @@ var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
|
7630
7819
|
]);
|
|
7631
7820
|
var COORDINATOR_PROJECT_HOME_MESSAGE_WINDOW_MS = 3 * 60 * 60000;
|
|
7632
7821
|
|
|
7633
|
-
// ../protocol/src/agent-mail.ts
|
|
7634
|
-
var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
|
|
7635
|
-
var AGENT_MAIL_MAX_STORE_BYTES = 32 * 1024 * 1024;
|
|
7636
|
-
var AGENT_MAIL_DEFAULT_RETENTION_DAYS = 14;
|
|
7637
|
-
var AGENT_MAIL_MAX_ATTACHMENT_BYTES = 8 * 1024 * 1024;
|
|
7638
|
-
var AGENT_MAIL_MAX_TOTAL_ATTACHMENT_BYTES = 32 * 1024 * 1024;
|
|
7639
|
-
var AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET = 16;
|
|
7640
|
-
var AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT = 40;
|
|
7641
|
-
var AGENT_MAIL_TOOL_NAMES = Object.freeze([
|
|
7642
|
-
"list_mailboxes",
|
|
7643
|
-
"send_message",
|
|
7644
|
-
"check_inbox",
|
|
7645
|
-
"read_message",
|
|
7646
|
-
"ack_message",
|
|
7647
|
-
"reply_message",
|
|
7648
|
-
"get_message_status"
|
|
7649
|
-
]);
|
|
7650
|
-
var DEFAULT_AGENT_MESSAGING_SETTINGS = Object.freeze({
|
|
7651
|
-
enabled: true,
|
|
7652
|
-
allowCrossProject: false,
|
|
7653
|
-
defaultInjectPolicy: "off",
|
|
7654
|
-
wakePeers: false,
|
|
7655
|
-
autonomousWakeBudget: AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET,
|
|
7656
|
-
hourlyWakeLimit: AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT,
|
|
7657
|
-
coordinatorStatusWakes: "settled",
|
|
7658
|
-
retentionDays: AGENT_MAIL_DEFAULT_RETENTION_DAYS,
|
|
7659
|
-
paused: false
|
|
7660
|
-
});
|
|
7661
|
-
function agentMailCapabilities(tabType, agent, locked = true) {
|
|
7662
|
-
if (tabType === "agent-native") {
|
|
7663
|
-
if (!locked || !agent)
|
|
7664
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
7665
|
-
if (agent === "claude" || agent === "codex" || agent === "opencode" || agent === "pi" || agent === "cursor" || agent === "grok") {
|
|
7666
|
-
return { canPull: true, canSend: true, canInject: true };
|
|
7667
|
-
}
|
|
7668
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
7669
|
-
}
|
|
7670
|
-
if (tabType === "claude-tmux")
|
|
7671
|
-
return { canPull: true, canSend: true, canInject: true };
|
|
7672
|
-
if (tabType === "pipeline-worker") {
|
|
7673
|
-
return agent ? { canPull: true, canSend: true, canInject: true } : { canPull: false, canSend: false, canInject: false };
|
|
7674
|
-
}
|
|
7675
|
-
if (["claude", "codex", "opencode"].includes(tabType)) {
|
|
7676
|
-
return { canPull: true, canSend: true, canInject: false };
|
|
7677
|
-
}
|
|
7678
|
-
if (["cursor", "grok", "pi"].includes(tabType)) {
|
|
7679
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
7680
|
-
}
|
|
7681
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
7682
|
-
}
|
|
7683
|
-
var NATIVE_AGENT_MAIL_CAPABILITIES = Object.freeze(Object.fromEntries(AGENT_PLATFORMS.map((agent) => [agent, agentMailCapabilities("agent-native", agent)])));
|
|
7684
|
-
|
|
7685
7822
|
// ../protocol/src/suborks.ts
|
|
7686
7823
|
var SUBORK_TOOL_NAME = "ask_agents";
|
|
7687
7824
|
var AGENT_SUBORK_TOOL_NAMES = Object.freeze([SUBORK_TOOL_NAME]);
|
|
@@ -31916,15 +32053,8 @@ async function closeConnections(state, connections) {
|
|
|
31916
32053
|
const settled = Promise.allSettled(connections.map(async (connection) => {
|
|
31917
32054
|
await connection.close();
|
|
31918
32055
|
}));
|
|
31919
|
-
|
|
31920
|
-
|
|
31921
|
-
timer = setTimeout(() => resolve("timeout"), closeTimeoutMs);
|
|
31922
|
-
timer.unref();
|
|
31923
|
-
});
|
|
31924
|
-
const outcome = await Promise.race([settled.then(() => "closed"), deadline]);
|
|
31925
|
-
if (timer)
|
|
31926
|
-
clearTimeout(timer);
|
|
31927
|
-
if (outcome === "timeout") {
|
|
32056
|
+
const outcome = await boundedWait(settled, closeTimeoutMs);
|
|
32057
|
+
if (!outcome.settled) {
|
|
31928
32058
|
state.health.recordNotice({
|
|
31929
32059
|
message: "An MCP server did not close in time; the bridge moved on without waiting",
|
|
31930
32060
|
method: "mcp/close",
|
|
@@ -32014,31 +32144,7 @@ function recordConnectFailure(state, server, error) {
|
|
|
32014
32144
|
};
|
|
32015
32145
|
}
|
|
32016
32146
|
async function connectWithTimeout(transport, server, context) {
|
|
32017
|
-
|
|
32018
|
-
let timedOut = false;
|
|
32019
|
-
let timer;
|
|
32020
|
-
const deadline = new Promise((_resolve, reject) => {
|
|
32021
|
-
timer = setTimeout(() => {
|
|
32022
|
-
timedOut = true;
|
|
32023
|
-
reject(new Error(`MCP server ${server.id} timed out`));
|
|
32024
|
-
}, connectTimeoutMs);
|
|
32025
|
-
timer.unref();
|
|
32026
|
-
});
|
|
32027
|
-
try {
|
|
32028
|
-
return await Promise.race([attempt, deadline]);
|
|
32029
|
-
} catch (error) {
|
|
32030
|
-
if (timedOut) {
|
|
32031
|
-
attempt.then((late) => late.close().catch(() => {
|
|
32032
|
-
return;
|
|
32033
|
-
}), () => {
|
|
32034
|
-
return;
|
|
32035
|
-
});
|
|
32036
|
-
}
|
|
32037
|
-
throw error;
|
|
32038
|
-
} finally {
|
|
32039
|
-
if (timer)
|
|
32040
|
-
clearTimeout(timer);
|
|
32041
|
-
}
|
|
32147
|
+
return await boundedWaitOrThrow(transport.connect(server, context), connectTimeoutMs, () => new Error(`MCP server ${server.id} timed out`), { onLate: (late) => late.close() });
|
|
32042
32148
|
}
|
|
32043
32149
|
function registerListedTool(server, listed, connection) {
|
|
32044
32150
|
const remoteName = listed.name.trim();
|
|
@@ -33723,7 +33829,8 @@ var SHARED_RULES = [
|
|
|
33723
33829
|
["auth-failed", /terminal prompts disabled|invalid username or password|bad credentials/i],
|
|
33724
33830
|
["auth-failed", /permission denied \(|permission to \S+ denied|host key verification failed/i],
|
|
33725
33831
|
["auth-failed", /gh auth login|not logged in|unauthorized|http 401|returned error: 40[13]/i],
|
|
33726
|
-
["network-failed", /could not resolve host|connection
|
|
33832
|
+
["network-failed", /could not resolve host|(?:connection|operation) timed out/i],
|
|
33833
|
+
["network-failed", /connection (?:refused|reset)/i],
|
|
33727
33834
|
["network-failed", /network is unreachable|no route to host|temporary failure in name/i],
|
|
33728
33835
|
["network-failed", /early eof|failed to connect|remote end hung up/i],
|
|
33729
33836
|
["network-failed", /unable to access ['"]?https?:\/\//i],
|
|
@@ -36365,6 +36472,18 @@ async function overlayCommandChanges(state, options = {}) {
|
|
|
36365
36472
|
} catch {}
|
|
36366
36473
|
}
|
|
36367
36474
|
|
|
36475
|
+
// ../../bridges/pi-bridge/src/project-extensions.ts
|
|
36476
|
+
var PROJECT_EXTENSIONS_REFUSED_NOTE = "Pi runs extensions inside the bridge process, where they could answer approvals themselves, so discovered extensions and configured packages do not load under any approval policy; local project skills and prompt templates still do.";
|
|
36477
|
+
function projectExtensionsRefusedForApprovals(policy, readOnly = false) {
|
|
36478
|
+
return policy?.projectResources === true && !readOnly;
|
|
36479
|
+
}
|
|
36480
|
+
function excludeConfiguredPackages(settingsManager) {
|
|
36481
|
+
for (const key of ["getGlobalSettings", "getProjectSettings"]) {
|
|
36482
|
+
const read = settingsManager[key].bind(settingsManager);
|
|
36483
|
+
settingsManager[key] = () => ({ ...read(), packages: [] });
|
|
36484
|
+
}
|
|
36485
|
+
}
|
|
36486
|
+
|
|
36368
36487
|
// ../../bridges/pi-bridge/src/session-list-cache.ts
|
|
36369
36488
|
import { createHash as createHash6 } from "node:crypto";
|
|
36370
36489
|
import { readdir, stat as stat2 } from "node:fs/promises";
|
|
@@ -36689,8 +36808,13 @@ function piAppendedInstructions(state) {
|
|
|
36689
36808
|
}
|
|
36690
36809
|
async function createPiSessionServices(state, options) {
|
|
36691
36810
|
const loaderPolicy = piResourceLoaderPolicy(state, options.cwd);
|
|
36811
|
+
const settingsManager = options.settingsManager ?? SettingsManager.create(options.cwd, options.agentDir, {
|
|
36812
|
+
projectTrusted: loaderPolicy.projectTrusted
|
|
36813
|
+
});
|
|
36814
|
+
excludeConfiguredPackages(settingsManager);
|
|
36692
36815
|
const services = await createAgentSessionServices({
|
|
36693
36816
|
...options,
|
|
36817
|
+
settingsManager,
|
|
36694
36818
|
resourceLoaderOptions: {
|
|
36695
36819
|
...loaderPolicy.discovery,
|
|
36696
36820
|
appendSystemPromptOverride: (base) => [...base, ...piAppendedInstructions(state)],
|
|
@@ -36919,10 +37043,10 @@ async function runDeferredCommandReload(state) {
|
|
|
36919
37043
|
return;
|
|
36920
37044
|
await reloadSessionCommands(state, session);
|
|
36921
37045
|
}
|
|
36922
|
-
function projectResourceDiscoveryOptions(enabled = false, readOnly = false) {
|
|
37046
|
+
function projectResourceDiscoveryOptions(enabled = false, readOnly = false, _approvals) {
|
|
36923
37047
|
const discoverProjectResources = enabled && !readOnly;
|
|
36924
37048
|
return {
|
|
36925
|
-
noExtensions:
|
|
37049
|
+
noExtensions: true,
|
|
36926
37050
|
noSkills: !discoverProjectResources,
|
|
36927
37051
|
noPromptTemplates: !discoverProjectResources,
|
|
36928
37052
|
noContextFiles: readOnly
|
|
@@ -36936,7 +37060,7 @@ function coordinatorProjectSkillPaths(cwd = workingDirectory) {
|
|
|
36936
37060
|
].filter((path) => existsSync2(path));
|
|
36937
37061
|
}
|
|
36938
37062
|
function piResourceLoaderPolicy(state, cwd = workingDirectory) {
|
|
36939
|
-
const discovery = projectResourceDiscoveryOptions(state.policy?.projectResources, state.readOnly === true);
|
|
37063
|
+
const discovery = projectResourceDiscoveryOptions(state.policy?.projectResources, state.readOnly === true, state.policy?.approvals);
|
|
36940
37064
|
const coordinator = state.policy?.id === "coordinator-read-only" && process.env[BRIDGE_EXECUTION_POLICY_ENV2] === "coordinator-read-only";
|
|
36941
37065
|
return {
|
|
36942
37066
|
discovery: coordinator ? { ...discovery, noSkills: false, additionalSkillPaths: coordinatorProjectSkillPaths(cwd) } : discovery,
|
|
@@ -37346,7 +37470,7 @@ async function forkSession(state, messageId) {
|
|
|
37346
37470
|
throw error;
|
|
37347
37471
|
}
|
|
37348
37472
|
}
|
|
37349
|
-
async function navigateSessionHistory(state, messageOrEntryId) {
|
|
37473
|
+
async function navigateSessionHistory(state, messageOrEntryId, position = "before") {
|
|
37350
37474
|
if (state.status === "running" || state.dispatching)
|
|
37351
37475
|
throw new SessionBusyError;
|
|
37352
37476
|
const session = await ensureSession(state);
|
|
@@ -37356,6 +37480,10 @@ async function navigateSessionHistory(state, messageOrEntryId) {
|
|
|
37356
37480
|
const result = await session.navigateTree(target, { summarize: false });
|
|
37357
37481
|
if (result.cancelled || result.aborted)
|
|
37358
37482
|
throw new Error("Pi did not change the active branch");
|
|
37483
|
+
if (position === "at" && session.sessionManager.getLeafId() !== target) {
|
|
37484
|
+
session.sessionManager.branch(target);
|
|
37485
|
+
session.refreshContext();
|
|
37486
|
+
}
|
|
37359
37487
|
rememberHistoryLeaf(state, session.sessionManager);
|
|
37360
37488
|
resetRenderedHistory(state);
|
|
37361
37489
|
hydrateHistory(state);
|
|
@@ -38417,15 +38545,15 @@ ${structuredPromptInstruction(input.schema)}` : input.prompt;
|
|
|
38417
38545
|
diagnostics?.streamSettled("rejected");
|
|
38418
38546
|
announceAccepted(false);
|
|
38419
38547
|
});
|
|
38420
|
-
const
|
|
38421
|
-
if (
|
|
38548
|
+
const startup = await boundedWait(accepted, startupDeadlineMs);
|
|
38549
|
+
if (!startup.settled) {
|
|
38422
38550
|
const error = new PromptStartupTimeoutError(startupDeadlineMs);
|
|
38423
38551
|
abandonStartup(state, session, claim, accepted, settled, input, diagnostics, error, evidenceTurnId);
|
|
38424
38552
|
throw error;
|
|
38425
38553
|
}
|
|
38426
38554
|
if (claim !== undefined && state.promptStartup?.claim === claim)
|
|
38427
38555
|
state.promptStartup = undefined;
|
|
38428
|
-
if (!
|
|
38556
|
+
if (!startup.value) {
|
|
38429
38557
|
forgetEvidenceTurn(state, evidenceTurnId);
|
|
38430
38558
|
await settled;
|
|
38431
38559
|
if (commandRun && state.commandRun === commandRun)
|
|
@@ -38499,21 +38627,6 @@ ${structuredPromptInstruction(input.schema)}` : input.prompt;
|
|
|
38499
38627
|
})
|
|
38500
38628
|
};
|
|
38501
38629
|
}
|
|
38502
|
-
async function withinStartupDeadline(accepted, deadlineMs) {
|
|
38503
|
-
let timer;
|
|
38504
|
-
try {
|
|
38505
|
-
return await Promise.race([
|
|
38506
|
-
accepted,
|
|
38507
|
-
new Promise((resolve) => {
|
|
38508
|
-
timer = setTimeout(() => resolve("timeout"), deadlineMs);
|
|
38509
|
-
timer.unref();
|
|
38510
|
-
})
|
|
38511
|
-
]);
|
|
38512
|
-
} finally {
|
|
38513
|
-
if (timer)
|
|
38514
|
-
clearTimeout(timer);
|
|
38515
|
-
}
|
|
38516
|
-
}
|
|
38517
38630
|
function abandonStartup(state, session, claim, accepted, settled, input, diagnostics, error, evidenceTurnId) {
|
|
38518
38631
|
log7.warn("turn.startup-timed-out", { sessionId: state.id });
|
|
38519
38632
|
state.status = "error";
|
|
@@ -38995,10 +39108,11 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
38995
39108
|
|
|
38996
39109
|
// ../../bridges/pi-bridge/src/public.ts
|
|
38997
39110
|
function piReportedPolicy(policy, readOnly) {
|
|
38998
|
-
|
|
39111
|
+
const reported = withoutProviderSandbox(policy, {
|
|
38999
39112
|
agent: "Pi",
|
|
39000
39113
|
toolsetBlocksNetwork: readOnly === true || policy.approvals === "deny"
|
|
39001
39114
|
});
|
|
39115
|
+
return projectExtensionsRefusedForApprovals(policy, readOnly === true) ? appendNativeAgentPolicyNote(reported, PROJECT_EXTENSIONS_REFUSED_NOTE) : reported;
|
|
39002
39116
|
}
|
|
39003
39117
|
function publicSession(state) {
|
|
39004
39118
|
const contextUsage = publicContextUsage(state);
|
|
@@ -39306,6 +39420,11 @@ function applyBridgeLogPolicy(value, env = process.env) {
|
|
|
39306
39420
|
return { status: 200, body: { applied: true, seq: policy.seq, diagnostics } };
|
|
39307
39421
|
}
|
|
39308
39422
|
|
|
39423
|
+
// ../protocol/src/terminal-text.ts
|
|
39424
|
+
var MAX_STRING_LENGTH = 8 * 1024;
|
|
39425
|
+
var BUDGET_FLOOR = 4 * 1024;
|
|
39426
|
+
var MAX_MOVE = 4 * 1024;
|
|
39427
|
+
|
|
39309
39428
|
// ../protocol/src/human-prompts.ts
|
|
39310
39429
|
var HUMAN_PROMPT_SCAN_BYTES = 16 * 1024;
|
|
39311
39430
|
var HUMAN_PROMPT_KINDS = new Set([
|
|
@@ -39376,6 +39495,68 @@ import { createHash as createHash9, randomBytes as randomBytes9 } from "node:cry
|
|
|
39376
39495
|
import { pathToFileURL } from "node:url";
|
|
39377
39496
|
import { gzip } from "node:zlib";
|
|
39378
39497
|
|
|
39498
|
+
// ../../bridges/pi-bridge/src/liveness.ts
|
|
39499
|
+
var METHODS = new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
|
|
39500
|
+
var FIXED_SUBJECTS = new Set(["refresh", "dispatch", "detail", "page"]);
|
|
39501
|
+
function sessionRouteLabel(request) {
|
|
39502
|
+
const method = request.method && METHODS.has(request.method) ? request.method : "OTHER";
|
|
39503
|
+
let path = request.action ?? "session";
|
|
39504
|
+
if (request.subject !== undefined) {
|
|
39505
|
+
path += `/${FIXED_SUBJECTS.has(request.subject) ? request.subject : ":id"}`;
|
|
39506
|
+
}
|
|
39507
|
+
if (request.detail !== undefined)
|
|
39508
|
+
path += "/hold";
|
|
39509
|
+
return `${method} ${path}`;
|
|
39510
|
+
}
|
|
39511
|
+
function touchesLiveness(request) {
|
|
39512
|
+
if (request.method === "GET" || request.method === "HEAD")
|
|
39513
|
+
return false;
|
|
39514
|
+
if (request.action === "title")
|
|
39515
|
+
return false;
|
|
39516
|
+
if (request.action === "approvals" && request.detail !== undefined)
|
|
39517
|
+
return false;
|
|
39518
|
+
return true;
|
|
39519
|
+
}
|
|
39520
|
+
function observeSessionRequest(state, request, now = Date.now()) {
|
|
39521
|
+
const touched = touchesLiveness(request);
|
|
39522
|
+
if (touched)
|
|
39523
|
+
state.lastAccessed = now;
|
|
39524
|
+
const label = sessionRouteLabel(request);
|
|
39525
|
+
const routes = state.routeCounts ??= new Map;
|
|
39526
|
+
const count = routes.get(label) ?? { requests: 0, touches: 0 };
|
|
39527
|
+
count.requests += 1;
|
|
39528
|
+
if (touched)
|
|
39529
|
+
count.touches += 1;
|
|
39530
|
+
routes.set(label, count);
|
|
39531
|
+
return touched;
|
|
39532
|
+
}
|
|
39533
|
+
function publicLiveness(state) {
|
|
39534
|
+
return {
|
|
39535
|
+
routes: Object.fromEntries(Array.from(state.routeCounts ?? [], ([label, count]) => [label, { ...count }]))
|
|
39536
|
+
};
|
|
39537
|
+
}
|
|
39538
|
+
|
|
39539
|
+
// ../protocol/src/contract/ipc-error.ts
|
|
39540
|
+
var REGISTERED_ERROR_CODES = {
|
|
39541
|
+
"unknown-command": { domain: "text", command: "text" },
|
|
39542
|
+
"unsupported-version": { domain: "text", range: "range", command: "text" },
|
|
39543
|
+
"unsupported-field": { domain: "text", field: "text", command: "text" },
|
|
39544
|
+
"kanban-request-id-conflict": { record: "text" },
|
|
39545
|
+
"native-job-receipt-capacity": { limit: "count" },
|
|
39546
|
+
"native-agent-provider-session-missing": {},
|
|
39547
|
+
"container-lifecycle": { reason: "text" },
|
|
39548
|
+
"mcp-management": { reason: "text" },
|
|
39549
|
+
"pane-layout-revision-conflict": {},
|
|
39550
|
+
"design-revision-conflict": {},
|
|
39551
|
+
"prompt-queue-message-conflict": {},
|
|
39552
|
+
"unknown-node": {},
|
|
39553
|
+
"node-admin-refused": {},
|
|
39554
|
+
"node-scope-closed": {},
|
|
39555
|
+
"node-unavailable": {}
|
|
39556
|
+
};
|
|
39557
|
+
var REGISTERED_ERROR_CODE_LIST = Object.keys(REGISTERED_ERROR_CODES);
|
|
39558
|
+
var MAX_COUNT = 2 ** 31 - 1;
|
|
39559
|
+
|
|
39379
39560
|
// ../protocol/src/mcp-management.ts
|
|
39380
39561
|
var MCP_CONFIG_REPORTING_VERSION = 1;
|
|
39381
39562
|
var MCP_MANAGEMENT_LIMITS = {
|
|
@@ -40015,6 +40196,7 @@ async function readResourceCommands(options) {
|
|
|
40015
40196
|
const settingsManager = SettingsManager.create(options.cwd, options.agentDir, {
|
|
40016
40197
|
projectTrusted: options.policy.projectTrusted
|
|
40017
40198
|
});
|
|
40199
|
+
excludeConfiguredPackages(settingsManager);
|
|
40018
40200
|
const loader = new DefaultResourceLoader({
|
|
40019
40201
|
...options.policy.discovery,
|
|
40020
40202
|
cwd: options.cwd,
|
|
@@ -40134,6 +40316,70 @@ async function runClose(state, budgetMs) {
|
|
|
40134
40316
|
return "closed";
|
|
40135
40317
|
}
|
|
40136
40318
|
|
|
40319
|
+
// ../../bridges/pi-bridge/src/session-branches.ts
|
|
40320
|
+
var MAX_LISTED_BRANCHES = NATIVE_AGENT_BRANCH_LIST_LIMITS.branches;
|
|
40321
|
+
var MAX_BRANCH_PROMPT_CHARS = NATIVE_AGENT_BRANCH_LIST_LIMITS.promptChars;
|
|
40322
|
+
function isConversationEntry(entry) {
|
|
40323
|
+
return entry.type === "message" || entry.type === "custom_message";
|
|
40324
|
+
}
|
|
40325
|
+
function promptText(entry) {
|
|
40326
|
+
if (entry.type !== "message" || entry.message.role !== "user")
|
|
40327
|
+
return;
|
|
40328
|
+
const text = readContentText(entry.message.content).replace(/\s+/g, " ").trim();
|
|
40329
|
+
return text.length > MAX_BRANCH_PROMPT_CHARS ? `${text.slice(0, MAX_BRANCH_PROMPT_CHARS - 1)}…` : text;
|
|
40330
|
+
}
|
|
40331
|
+
function listSessionBranches(manager) {
|
|
40332
|
+
const entries = manager.getEntries();
|
|
40333
|
+
const byId = new Map;
|
|
40334
|
+
const hasChildren = new Set;
|
|
40335
|
+
for (const entry of entries) {
|
|
40336
|
+
byId.set(entry.id, entry);
|
|
40337
|
+
if (entry.parentId)
|
|
40338
|
+
hasChildren.add(entry.parentId);
|
|
40339
|
+
}
|
|
40340
|
+
const activeEntryId = manager.getLeafId();
|
|
40341
|
+
const activePath = new Set;
|
|
40342
|
+
for (let cursor = activeEntryId ? byId.get(activeEntryId) : undefined;cursor; cursor = cursor.parentId ? byId.get(cursor.parentId) : undefined) {
|
|
40343
|
+
if (activePath.has(cursor.id))
|
|
40344
|
+
break;
|
|
40345
|
+
activePath.add(cursor.id);
|
|
40346
|
+
}
|
|
40347
|
+
const leaves = entries.map((entry, index) => ({ entry, index })).filter(({ entry }) => !hasChildren.has(entry.id) && !activePath.has(entry.id)).sort((left, right) => right.entry.timestamp.localeCompare(left.entry.timestamp) || right.index - left.index).map(({ entry }) => entry);
|
|
40348
|
+
const branches = [];
|
|
40349
|
+
let truncated = false;
|
|
40350
|
+
for (const leaf of leaves) {
|
|
40351
|
+
const own = [];
|
|
40352
|
+
const seen = new Set;
|
|
40353
|
+
let depth = 0;
|
|
40354
|
+
let newestPrompt;
|
|
40355
|
+
for (let cursor = leaf;cursor && !seen.has(cursor.id); cursor = cursor.parentId ? byId.get(cursor.parentId) : undefined) {
|
|
40356
|
+
seen.add(cursor.id);
|
|
40357
|
+
depth += 1;
|
|
40358
|
+
if (!activePath.has(cursor.id))
|
|
40359
|
+
own.push(cursor);
|
|
40360
|
+
newestPrompt ??= promptText(cursor);
|
|
40361
|
+
}
|
|
40362
|
+
if (!own.some(isConversationEntry))
|
|
40363
|
+
continue;
|
|
40364
|
+
if (branches.length >= MAX_LISTED_BRANCHES) {
|
|
40365
|
+
truncated = true;
|
|
40366
|
+
break;
|
|
40367
|
+
}
|
|
40368
|
+
const firstOwnPrompt = own.slice().reverse().map(promptText).find((text) => text !== undefined);
|
|
40369
|
+
branches.push({
|
|
40370
|
+
entryId: leaf.id,
|
|
40371
|
+
prompt: firstOwnPrompt ?? newestPrompt ?? "",
|
|
40372
|
+
entries: depth,
|
|
40373
|
+
updatedAt: leaf.timestamp
|
|
40374
|
+
});
|
|
40375
|
+
}
|
|
40376
|
+
return { activeEntryId, branches, truncated };
|
|
40377
|
+
}
|
|
40378
|
+
async function readSessionBranches(state) {
|
|
40379
|
+
const session = await ensureSession(state);
|
|
40380
|
+
return listSessionBranches(session.sessionManager);
|
|
40381
|
+
}
|
|
40382
|
+
|
|
40137
40383
|
// ../../bridges/pi-bridge/src/session-activity.ts
|
|
40138
40384
|
function sessionActivityObservation(sessionId) {
|
|
40139
40385
|
const state = sessions.get(sessionId);
|
|
@@ -40596,9 +40842,7 @@ async function routeSession(request, response, url, clientSignal) {
|
|
|
40596
40842
|
}
|
|
40597
40843
|
return json(response, 404, { error: "Session not found" });
|
|
40598
40844
|
}
|
|
40599
|
-
|
|
40600
|
-
state.lastAccessed = Date.now();
|
|
40601
|
-
}
|
|
40845
|
+
observeSessionRequest(state, { method: request.method, action, subject, detail });
|
|
40602
40846
|
if (request.method === "GET" && (!action || action === "status") || action === "config" && (request.method === "GET" || request.method === "POST")) {
|
|
40603
40847
|
await withTimeout(hydrateSessionComposer(state).catch(() => {
|
|
40604
40848
|
return;
|
|
@@ -40643,7 +40887,8 @@ async function routeSession(request, response, url, clientSignal) {
|
|
|
40643
40887
|
summary: publicRuntime(state),
|
|
40644
40888
|
...state.health.snapshot(),
|
|
40645
40889
|
mcpConfigReporting: MCP_CONFIG_REPORTING_VERSION,
|
|
40646
|
-
...mcpConfig ? { mcpConfig } : {}
|
|
40890
|
+
...mcpConfig ? { mcpConfig } : {},
|
|
40891
|
+
liveness: publicLiveness(state)
|
|
40647
40892
|
});
|
|
40648
40893
|
}
|
|
40649
40894
|
if (action === "dispatch" && request.method === "GET") {
|
|
@@ -40715,8 +40960,11 @@ async function routeSession(request, response, url, clientSignal) {
|
|
|
40715
40960
|
await persistBarrier();
|
|
40716
40961
|
return json(response, 200, { rewound: true });
|
|
40717
40962
|
}
|
|
40963
|
+
if (action === "branches" && !subject && request.method === "GET") {
|
|
40964
|
+
return json(response, 200, await readSessionBranches(state));
|
|
40965
|
+
}
|
|
40718
40966
|
if (action === "branches" && subject && request.method === "POST") {
|
|
40719
|
-
await navigateSessionHistory(state, decodeURIComponent(subject));
|
|
40967
|
+
await navigateSessionHistory(state, decodeURIComponent(subject), "at");
|
|
40720
40968
|
await persistBarrier();
|
|
40721
40969
|
return json(response, 200, { switched: true });
|
|
40722
40970
|
}
|
|
@@ -40849,6 +41097,7 @@ async function handleCompact(request, response, state) {
|
|
|
40849
41097
|
state.manualCompaction = undefined;
|
|
40850
41098
|
settle(stopped);
|
|
40851
41099
|
state.compacting = false;
|
|
41100
|
+
state.lastAccessed = Date.now();
|
|
40852
41101
|
state.dispatching = false;
|
|
40853
41102
|
state.revision += 1;
|
|
40854
41103
|
schedulePersist();
|