orkestrator 2.36.0 → 2.36.2-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.
@@ -180,6 +180,16 @@ function logErrorKind(error) {
180
180
  }
181
181
 
182
182
  // ../protocol/src/log-vocabulary/define.ts
183
+ var ESSENTIAL_ERROR_FIELDS = {
184
+ "error.name": "label",
185
+ "error.code": "label",
186
+ "error.errno": "number",
187
+ "error.syscall": "label",
188
+ "error.exitCode": "number",
189
+ "error.signal": "label",
190
+ "error.outputOmitted": "boolean",
191
+ "error.errorCount": "number"
192
+ };
183
193
  var THROTTLE_LOG_EVENTS = {
184
194
  "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
185
195
  "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
@@ -229,7 +239,11 @@ var BACKEND_LOG_AREAS = defineLogAreas({
229
239
  backend: {
230
240
  description: "The backend process: startup, background notices and shutdown.",
231
241
  events: {
232
- starting: "The backend process is starting.",
242
+ starting: {
243
+ description: "The backend process is starting.",
244
+ essential: true,
245
+ fields: { version: "label" }
246
+ },
233
247
  "ssh-socket.resolved": "An SSH agent socket was found.",
234
248
  "ssh-socket.missing": "No usable SSH agent socket was found.",
235
249
  "standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
@@ -244,8 +258,16 @@ var BACKEND_LOG_AREAS = defineLogAreas({
244
258
  "notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
245
259
  "artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
246
260
  "shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
247
- "shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
248
- "shutdown.finished": "Shutdown finished, and the process exits with `code`.",
261
+ "shutdown.signal-received": {
262
+ description: "A signal started shutdown, which tells a clean quit from the backend being killed.",
263
+ essential: true,
264
+ fields: { signal: "label" }
265
+ },
266
+ "shutdown.finished": {
267
+ description: "Shutdown finished, and the process exits with `code`.",
268
+ essential: true,
269
+ fields: { code: "number" }
270
+ },
249
271
  "port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
250
272
  "port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
251
273
  }
@@ -288,7 +310,10 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
288
310
  "evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
289
311
  "evidence.shell-record-failed": "A shell observation could not be recorded.",
290
312
  "evidence.turn-record-failed": "Turn change evidence could not be recorded.",
313
+ "agent.exited": "An ACP agent process exited, with its `code` and `signal`, always at `warn`. `requested` is true when the bridge closed it normally, false for an unrequested or fault-driven exit.",
314
+ "http.route-failed": "An HTTP route answered 500; its error message is not logged because it can hold content.",
291
315
  "server.listening": "The HTTP server is listening.",
316
+ "session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
292
317
  "state.composer-reset": "A saved composer state was malformed and was reset.",
293
318
  "state.discarded": "Saved bridge state could not be used and was discarded.",
294
319
  "state.persist-failed": "Saving bridge state failed; a later write retries.",
@@ -342,7 +367,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
342
367
  "session.created": "A session was created or recovered.",
343
368
  "session.delete-failed": "Deleting a session failed.",
344
369
  "session.fork-failed": "Forking a session failed.",
345
- "session.policy-widening-refused": "A config request tried to widen a live session's execution policy and was refused; widened names the axes.",
370
+ "session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
346
371
  "session.rename-failed": "Renaming a session failed.",
347
372
  "session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
348
373
  "session.rewind-failed": "Rewinding session files failed.",
@@ -376,6 +401,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
376
401
  "app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
377
402
  "app-server.invariant-violation": "app-server asked for something its configuration forbids.",
378
403
  "app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
404
+ "app-server.overflow-restart-failed": "Replacing the child after a notification queue overflow failed; the next request tries again.",
379
405
  "app-server.recording": "Notification recording is on; recordings hold content.",
380
406
  "app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
381
407
  "app-server.stderr": "Metadata of an app-server stderr line, never its content.",
@@ -406,6 +432,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
406
432
  "ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
407
433
  "ordered-events.reconcile-failed": "Reconciling ordered events failed.",
408
434
  "parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
435
+ "queue.overflow": "The notification queue passed a bound and dropped its backlog.",
409
436
  "queue.task-failed": "A task on a per-thread queue failed.",
410
437
  "raw-log.write-failed": "Appending to the raw Codex log failed.",
411
438
  "recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
@@ -419,6 +446,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
419
446
  "server-request.flush-timeout": "An answer to a server request did not flush in time.",
420
447
  "server-request.handoff-failed": "Handing a server request to the router threw.",
421
448
  "session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
449
+ "session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
422
450
  "sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
423
451
  "sse.keepalive-failed": "An event stream keepalive failed.",
424
452
  "sse.observer-failed": "An event stream observer failed; it reconnects.",
@@ -447,19 +475,39 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
447
475
  events: {
448
476
  "agent.archive-failed": "Archiving or unarchiving an agent failed.",
449
477
  "http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
478
+ "session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
450
479
  "startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
451
480
  "startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
452
481
  "state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
453
482
  "state.publication-recovered": "Saving bridge state recovered.",
454
- "state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
483
+ "state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy.",
484
+ "session.resume-fell-back": {
485
+ description: "A saved conversation could not be resumed, so a new one started; its error message is not logged because it can hold content.",
486
+ essential: true,
487
+ fields: ESSENTIAL_ERROR_FIELDS
488
+ },
489
+ "turn.failed": "A turn failed; its error message is not logged because it can hold content. A cancelled turn is not a failure.",
490
+ "turn.recovery-failed": "A run recovered after a bridge restart ended in failure, or could not be followed. A cancelled run is not a failure.",
491
+ "turn.send-failed": "Sending a prompt to Cursor failed, so whether its run started is unknown; its error message is not logged because it can hold content.",
492
+ "turn.timed-out": "A turn outlived its time budget, so its run was asked to cancel; `turn.failed` follows if it never stops."
455
493
  }
456
494
  },
457
495
  "bridge.pi": {
458
496
  description: "The Pi bridge: its routes, sessions and saved state.",
459
497
  events: {
460
498
  "http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
499
+ "session.policy-widening-refused": "A request tried to widen a live session's execution policy and was refused; widened names the axes.",
500
+ "session-list.failed": "Reading the resumable sessions failed, so none were offered; its error message is not logged because it can hold content.",
461
501
  "state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
462
- "state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
502
+ "state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript.",
503
+ "session.resume-fell-back": {
504
+ description: "A saved conversation could not be reopened, so a new one started; its error message is not logged because it can hold content.",
505
+ essential: true,
506
+ fields: ESSENTIAL_ERROR_FIELDS
507
+ },
508
+ "turn.failed": "A turn failed; its error message is not logged because it can hold content. A cancelled turn is not a failure.",
509
+ "turn.refused": "Pi refused a prompt before starting a run, so nothing ran; its error message is not logged because it can hold content.",
510
+ "turn.startup-timed-out": "Pi did not start a turn within its startup deadline, so the prompt was abandoned."
463
511
  }
464
512
  }
465
513
  });
@@ -470,14 +518,31 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
470
518
  description: "The Electron main process: startup, windows, quit and the Local backend's life.",
471
519
  events: {
472
520
  "backend.docker-context-seed-failed": "An agent-test profile fell back to the default Docker context.",
473
- "backend.exited": "The Local backend exited unexpectedly; Local work is unavailable.",
474
- "backend.exited-recovering": "The Local backend exited just after a remote update; relaunching unattended.",
521
+ "backend.exited": {
522
+ description: "The Local backend exited unexpectedly; Local work is unavailable. `error.exitCode` and `error.signal` say how.",
523
+ essential: true,
524
+ fields: ESSENTIAL_ERROR_FIELDS
525
+ },
526
+ "backend.exited-recovering": {
527
+ description: "The Local backend exited just after a remote update; relaunching unattended. `error.exitCode` and `error.signal` say how.",
528
+ essential: true,
529
+ fields: ESSENTIAL_ERROR_FIELDS
530
+ },
475
531
  "backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
476
- "backend.start-failed": "The Local backend did not start; continuing with remote machines.",
532
+ "backend.start-failed": {
533
+ description: "The Local backend did not start; continuing with remote machines.",
534
+ essential: true,
535
+ fields: ESSENTIAL_ERROR_FIELDS
536
+ },
477
537
  "clipboard.write-failed": "Writing text to the system clipboard failed.",
478
538
  "dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
479
539
  "instance.already-running": "Another instance holds this data directory; this one will quit.",
480
- "main-thread.stalled": "A timer fired late, so windows, IPC and the stdout reader waited.",
540
+ "main-thread.stalled": {
541
+ description: "A timer fired late, so windows, IPC and the stdout reader waited.",
542
+ essential: true,
543
+ minLevel: "error",
544
+ fields: { lagMs: "number", intervalMs: "number" }
545
+ },
481
546
  "quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
482
547
  "relaunch.schedule-failed": "The AppImage relaunch waiter failed; using Electron's relauncher.",
483
548
  "relaunch.service-register-failed": "The AppImage relaunch service was refused; using a detached waiter.",
@@ -488,7 +553,11 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
488
553
  "saved-machines.attach-failed": "Saved machines were not imported into the command node yet.",
489
554
  "saved-machines.attached": "Saved machines were imported into the local command node.",
490
555
  "startup.failed": "The application failed to start.",
491
- "uncaught-exception": "The main process hit an uncaught exception.",
556
+ "uncaught-exception": {
557
+ description: "The main process hit an uncaught exception.",
558
+ essential: true,
559
+ fields: ESSENTIAL_ERROR_FIELDS
560
+ },
492
561
  "uncaught-exception.dialog-failed": "The uncaught exception sheet could not be shown.",
493
562
  "window.create-failed": "A menu-driven new window could not be created.",
494
563
  "window.recreate-failed": "The main window could not be recreated on activation.",
@@ -511,6 +580,12 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
511
580
  "unhandled-rejection": "An unhandled rejection occurred while the renderer was starting."
512
581
  }
513
582
  },
583
+ "desktop.permissions": {
584
+ description: "Permission requests refused on the renderer and workspace realm sessions.",
585
+ events: {
586
+ denied: "A renderer asked for a permission the policy does not grant."
587
+ }
588
+ },
514
589
  "desktop.dialog": {
515
590
  description: "Native dialogs, whose modal loops hold the main thread while they are open.",
516
591
  events: {
@@ -629,6 +704,8 @@ var GATEWAY_LOG_AREAS = defineLogAreas({
629
704
  "loopback.unavailable": "The loopback client listener could not start.",
630
705
  "auth-token.stored": "The gateway token's file was written. The path only, never the token.",
631
706
  "auth-token.persist-failed": "The gateway token could not be saved.",
707
+ "auth-guess.throttled": "A listener saw enough different wrong tokens that it now pauses new ones. Never the values.",
708
+ "host.refused": "A request named a host this gateway does not answer to. Logged once per name, up to a limit.",
632
709
  "port.fallback": "The preferred port was taken, so a nearby one is used.",
633
710
  "port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
634
711
  "request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
@@ -672,6 +749,22 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
672
749
  "bridge-runtime.installed": "A bridge runtime finished installing.",
673
750
  "opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
674
751
  "server.stopping": "A local server is being stopped, for the fixed `reason` given.",
752
+ "bridge.started": {
753
+ description: "A local bridge process was spawned; `key` names its kind and environment.",
754
+ essential: true,
755
+ fields: { key: "label", pid: "number" }
756
+ },
757
+ "bridge.exited": {
758
+ description: "A local bridge process exited, with its `code` and `signal`. `warn` when nothing asked it to, whatever the code; `info` when the backend stopped it, which `server.stopping` explains.",
759
+ essential: true,
760
+ fields: {
761
+ key: "label",
762
+ pid: "number",
763
+ code: "number",
764
+ signal: "label",
765
+ requested: "boolean"
766
+ }
767
+ },
675
768
  "reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
676
769
  "reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
677
770
  "reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
@@ -705,13 +798,29 @@ var LOGGING_LOG_AREAS = defineLogAreas({
705
798
  "capture.started": "Saving logs to disk began for this process.",
706
799
  "capture.stopped": "Saving logs to disk stopped for this process.",
707
800
  "config.invalid": "A logging environment variable held a value that was ignored.",
708
- "entries.dropped": "The log queue was full, so entries were dropped and counted.",
801
+ "entries.dropped": {
802
+ description: "Entries were dropped and counted, for the fixed `reason` given: the queue was full, a write failed or, in the essential log, one event was repeating too fast.",
803
+ essential: true,
804
+ fields: { entries: "number", bytes: "number", reason: "label" }
805
+ },
806
+ "essential.started": {
807
+ description: "This process began writing the essential log. One with no `essential.stopped` before it means the last writer died.",
808
+ essential: true,
809
+ fields: { owner: "label" }
810
+ },
811
+ "essential.stopped": {
812
+ description: "This process stopped writing the essential log, in an orderly exit.",
813
+ essential: true,
814
+ fields: { owner: "label" }
815
+ },
816
+ "essential.write-failed": "Writing the essential log failed. Its entries are counted, and a marker reports them at the next write that works.",
709
817
  "policy.changed": "The logging settings changed: saving, retention and levels, with no content.",
710
818
  "policy.bridge-predates-route": "A running bridge has no logging settings route; it applies them at its next start.",
711
819
  "policy.push-failed": "A running bridge did not take the logging settings after retries; its next start resends them.",
712
820
  "prune.failed": "Removing expired log files failed; the next sweep retries.",
713
821
  "write.failed": "Appending to the log file failed.",
714
- "unknown-area": "Code outside the type checker asked for an area that is not listed."
822
+ "unknown-area": "Code outside the type checker asked for an area that is not listed.",
823
+ ...THROTTLE_LOG_EVENTS
715
824
  }
716
825
  }
717
826
  });
@@ -836,7 +945,28 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
836
945
  "event-loop": {
837
946
  description: "This process's event loop. A stall of 10 seconds or more is written at error, so no level hides it.",
838
947
  events: {
839
- stalled: "A timer fired late, so every request in that window waited."
948
+ stalled: {
949
+ description: "A timer fired late, so every request in that window waited.",
950
+ essential: true,
951
+ minLevel: "error",
952
+ fields: { lagMs: "number", intervalMs: "number" }
953
+ }
954
+ }
955
+ },
956
+ process: {
957
+ description: "Failures of a whole process that nothing in it handled.",
958
+ events: {
959
+ "rejection.unhandled": {
960
+ description: "A promise rejection reached the fatal rejection guard, which keeps the process running.",
961
+ essential: true,
962
+ fields: { kind: "label", ...ESSENTIAL_ERROR_FIELDS }
963
+ },
964
+ "uncaught-exception": {
965
+ description: "An exception reached the top of the backend, which is about to die with it. `origin` says whether it was thrown or a rejected top-level await.",
966
+ essential: true,
967
+ fields: { origin: "label", ...ESSENTIAL_ERROR_FIELDS }
968
+ },
969
+ ...THROTTLE_LOG_EVENTS
840
970
  }
841
971
  }
842
972
  });
@@ -1074,21 +1204,43 @@ var STORAGE_LOG_AREAS = defineLogAreas({
1074
1204
  description: "The SQLite-backed stores, their snapshots and imports from older formats.",
1075
1205
  events: {
1076
1206
  "usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
1077
- "snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
1207
+ "migration.failed": {
1208
+ description: "The database could not be brought to this build's schema, so it did not open; `step` says whether the safety copy or the migration itself failed.",
1209
+ essential: true,
1210
+ fields: {
1211
+ fromVersion: "number",
1212
+ toVersion: "number",
1213
+ step: "label",
1214
+ ...ESSENTIAL_ERROR_FIELDS
1215
+ }
1216
+ },
1217
+ "snapshot.integrity-failed": {
1218
+ description: "A database snapshot failed its integrity check and was discarded.",
1219
+ essential: true,
1220
+ fields: {}
1221
+ },
1078
1222
  "snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
1079
- "snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
1223
+ "snapshot.failed": {
1224
+ description: "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
1225
+ essential: true,
1226
+ fields: { retryAt: "label", ...ESSENTIAL_ERROR_FIELDS }
1227
+ },
1080
1228
  "listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
1081
1229
  "listener.change-failed": "A resource change listener threw; the committed mutation stands.",
1082
1230
  "kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
1083
1231
  "nodes.entries-dropped": "Unreadable node registry entries were ignored.",
1084
1232
  "preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
1233
+ "preview-settings.invalid": "Invalid preview settings disabled transport and relay.",
1085
1234
  "machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
1086
1235
  "permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
1087
1236
  "retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
1088
1237
  "handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
1089
1238
  "desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
1090
1239
  "legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
1091
- "legacy-json.archive-failed": "Imported JSON store files could not be archived."
1240
+ "legacy-json.archive-failed": "Imported JSON store files could not be archived.",
1241
+ "lease.heartbeat-failed": "A held lease's heartbeat failed, which shortens the lease; the next one retries.",
1242
+ "scrub.checkpoint-failed": "Deleted content could not be scrubbed from the WAL because the truncating checkpoint failed or was blocked; the next checkpoint retries.",
1243
+ ...THROTTLE_LOG_EVENTS
1092
1244
  }
1093
1245
  }
1094
1246
  });
@@ -1114,6 +1266,7 @@ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
1114
1266
  "usage.read-failed": "Reading a stage session's token usage failed.",
1115
1267
  "checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
1116
1268
  "checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
1269
+ "worker-mail.claim-failed": "Mail queued for a worker could not be claimed at its turn end; it stays queued.",
1117
1270
  "legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
1118
1271
  }
1119
1272
  }
@@ -1183,6 +1336,10 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
1183
1336
  "wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
1184
1337
  "wake.waiting-report-failed": "A waiting worker could not be reported.",
1185
1338
  "wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
1339
+ "pr-watch.added": "A pull request a coordinator conversation showed joined the project's watch; `source` says how.",
1340
+ "pr-watch.observe-failed": "A watched pull request could not be observed; the next sweep retries.",
1341
+ "pr-watch.read-failed": "GitHub could not be read for a watched pull request; `code` is the error category.",
1342
+ "pr-watch.removed": "A watched pull request stopped being watched without a reading; `reason` is `deleted` (GitHub confirmed it is gone) or `unreadable` (not found for the give-up period).",
1186
1343
  "store.malformed": "The coordinator store was malformed and is treated as empty.",
1187
1344
  "store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
1188
1345
  "store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
@@ -1191,8 +1348,10 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
1191
1348
  "remote-worker.settle-failed": "A remote worker could not be settled.",
1192
1349
  "checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
1193
1350
  "checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
1194
- "checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded, or `outcome` says why not (`timed-out`, `failed`).",
1195
- "checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway."
1351
+ "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`).",
1352
+ "checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway.",
1353
+ "checkout.message-check": "Before a typed message to the main coordinator, the backend answered whether to fast-forward the project checkout: `outcome` (`offer`, `fast-forwarded`, `turn-running`, `not-behind`, `blocked`, `no-status`), `fetch` (`fetched`, `failed`, `timed-out`, `skipped`) and `durationMs`.",
1354
+ "checkout.message-check-failed": "Before a typed message to the main coordinator, fast-forwarding to the upstream commit already fetched failed after a slow or failed fetch; the message was sent anyway."
1196
1355
  }
1197
1356
  }
1198
1357
  });
@@ -1295,7 +1454,27 @@ var DOCKER_LOG_AREAS = defineLogAreas({
1295
1454
  "recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
1296
1455
  "github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
1297
1456
  "availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
1298
- "start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
1457
+ "start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports.",
1458
+ "writer-lease.lost": {
1459
+ description: "This backend lost the registry writer lease, for the fixed `reason` given. Schedules stop and container changes are refused until it restarts.",
1460
+ essential: true,
1461
+ fields: { reason: "label" }
1462
+ },
1463
+ "writer-lease.regained": {
1464
+ description: "This backend took the registry writer lease over from a holder that stopped refreshing it (it crashed, was killed or stalled), `staleForMs` after its last refresh. The counterpart of that holder's `writer-lease.lost` with reason `reclaimed`; a lease left by a clean shutdown is acquired silently.",
1465
+ essential: true,
1466
+ fields: { staleForMs: "number" }
1467
+ },
1468
+ "writer-lease.not-acquired": {
1469
+ description: "This backend started without the registry writer lease, for the fixed `reason` given. A second backend on one data directory is normal: it serves reads, runs no schedules and refuses container changes.",
1470
+ essential: true,
1471
+ fields: { reason: "label" }
1472
+ },
1473
+ "bridge.launched": {
1474
+ 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.",
1475
+ essential: true,
1476
+ fields: { provider: "label", containerPort: "number" }
1477
+ }
1299
1478
  }
1300
1479
  },
1301
1480
  "docker.reachability": {
@@ -2003,6 +2182,146 @@ var LOG_VOCABULARY = {
2003
2182
  ...WEB_SYNC_LOG_AREAS
2004
2183
  };
2005
2184
 
2185
+ // ../protocol/src/log-essential-labels.ts
2186
+ var ERROR_NAMES = new Set([
2187
+ "Error",
2188
+ "TypeError",
2189
+ "RangeError",
2190
+ "ReferenceError",
2191
+ "SyntaxError",
2192
+ "URIError",
2193
+ "EvalError",
2194
+ "AggregateError",
2195
+ "AbortError",
2196
+ "TimeoutError",
2197
+ "SystemError"
2198
+ ]);
2199
+ var ERROR_CODES = new Set([
2200
+ "EACCES",
2201
+ "EADDRINUSE",
2202
+ "EADDRNOTAVAIL",
2203
+ "EAGAIN",
2204
+ "EBADF",
2205
+ "EBUSY",
2206
+ "ECANCELED",
2207
+ "ECONNABORTED",
2208
+ "ECONNREFUSED",
2209
+ "ECONNRESET",
2210
+ "EEXIST",
2211
+ "EHOSTUNREACH",
2212
+ "EINTR",
2213
+ "EINVAL",
2214
+ "EIO",
2215
+ "EISDIR",
2216
+ "EMFILE",
2217
+ "ENETUNREACH",
2218
+ "ENFILE",
2219
+ "ENOENT",
2220
+ "ENOMEM",
2221
+ "ENOSPC",
2222
+ "ENOSYS",
2223
+ "ENOTDIR",
2224
+ "ENOTEMPTY",
2225
+ "ENOTFOUND",
2226
+ "EPERM",
2227
+ "EPIPE",
2228
+ "EROFS",
2229
+ "ETIMEDOUT",
2230
+ "EXDEV",
2231
+ "SQLITE_BUSY",
2232
+ "SQLITE_CORRUPT",
2233
+ "SQLITE_FULL",
2234
+ "SQLITE_IOERR",
2235
+ "SQLITE_NOTADB",
2236
+ "SQLITE_READONLY",
2237
+ "ERR_CANCELED",
2238
+ "ERR_STREAM_DESTROYED"
2239
+ ]);
2240
+ var SYSCALLS = new Set([
2241
+ "open",
2242
+ "read",
2243
+ "write",
2244
+ "stat",
2245
+ "lstat",
2246
+ "mkdir",
2247
+ "rmdir",
2248
+ "readdir",
2249
+ "rename",
2250
+ "unlink",
2251
+ "fsync",
2252
+ "fdatasync",
2253
+ "close",
2254
+ "access",
2255
+ "chmod",
2256
+ "copyfile",
2257
+ "connect",
2258
+ "listen",
2259
+ "bind",
2260
+ "spawn",
2261
+ "kill",
2262
+ "getaddrinfo"
2263
+ ]);
2264
+ var SIGNALS = new Set([
2265
+ "SIGABRT",
2266
+ "SIGALRM",
2267
+ "SIGBUS",
2268
+ "SIGCHLD",
2269
+ "SIGCONT",
2270
+ "SIGFPE",
2271
+ "SIGHUP",
2272
+ "SIGILL",
2273
+ "SIGINT",
2274
+ "SIGKILL",
2275
+ "SIGPIPE",
2276
+ "SIGQUIT",
2277
+ "SIGSEGV",
2278
+ "SIGSTOP",
2279
+ "SIGTERM",
2280
+ "SIGTRAP",
2281
+ "SIGTSTP",
2282
+ "SIGTTIN",
2283
+ "SIGTTOU",
2284
+ "SIGUSR1",
2285
+ "SIGUSR2",
2286
+ "SIGWINCH",
2287
+ "SIGXCPU",
2288
+ "SIGXFSZ"
2289
+ ]);
2290
+ var PROVIDERS = new Set(["claude", "codex", "opencode", "cursor", "grok", "acp", "pi"]);
2291
+ var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
2292
+ var SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
2293
+
2294
+ // ../protocol/src/log-essential.ts
2295
+ var vocabulary = LOG_VOCABULARY;
2296
+ var UNDECLARED_ERROR_LABELS = new Set([
2297
+ "site",
2298
+ "kind",
2299
+ "step",
2300
+ "reason",
2301
+ "signal",
2302
+ "code"
2303
+ ]);
2304
+ function eventSpec(area, event) {
2305
+ const spec = Object.hasOwn(vocabulary, area) ? vocabulary[area] : undefined;
2306
+ if (!spec || !Object.hasOwn(spec.events, event))
2307
+ return null;
2308
+ const definition = spec.events[event];
2309
+ return typeof definition === "object" && definition.essential ? definition : null;
2310
+ }
2311
+ function declaredEssential(area, event, level) {
2312
+ const spec = eventSpec(area, event);
2313
+ return spec && (spec.minLevel !== "error" || level === "error") ? spec : null;
2314
+ }
2315
+ function hasEssentialEvents(area) {
2316
+ const spec = Object.hasOwn(vocabulary, area) ? vocabulary[area] : undefined;
2317
+ return spec !== undefined && Object.values(spec.events).some((event) => typeof event === "object" && event.essential);
2318
+ }
2319
+ function isEssentialEntry(area, event, level) {
2320
+ if (area === "logging" && event === "essential.write-failed")
2321
+ return false;
2322
+ return level === "error" || declaredEssential(area, event, level) !== null;
2323
+ }
2324
+
2006
2325
  // ../protocol/src/logger.ts
2007
2326
  var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
2008
2327
  var MAX_FIELD_CHARS = 2048;
@@ -2047,7 +2366,9 @@ var DEFAULT_CONFIG = {
2047
2366
  level: "info",
2048
2367
  areaLevels: {},
2049
2368
  format: "text",
2050
- sink: consoleSink
2369
+ sink: consoleSink,
2370
+ essentialSink: null,
2371
+ relayEssential: false
2051
2372
  };
2052
2373
  var config = DEFAULT_CONFIG;
2053
2374
  var generation = 0;
@@ -2158,17 +2479,38 @@ function renderText(record) {
2158
2479
  function renderJson(record) {
2159
2480
  return escapeLogLine(JSON.stringify(record));
2160
2481
  }
2482
+ function offerEssential(record) {
2483
+ if (!config.essentialSink || !isEssentialEntry(record.area, record.event, record.level))
2484
+ return;
2485
+ try {
2486
+ config.essentialSink(record);
2487
+ } catch {}
2488
+ }
2161
2489
  function deliver(record) {
2490
+ let delivered = true;
2162
2491
  try {
2163
2492
  config.sink({
2164
2493
  method: OUTPUT_METHOD[record.level],
2165
2494
  line: config.format === "json" ? renderJson(record) : renderText(record),
2166
2495
  record
2167
2496
  });
2168
- return true;
2169
2497
  } catch {
2170
- return false;
2498
+ delivered = false;
2499
+ }
2500
+ offerEssential(record);
2501
+ return delivered;
2502
+ }
2503
+ function deliverEssentialOnly(record) {
2504
+ if (config.essentialSink) {
2505
+ offerEssential(record);
2506
+ return;
2171
2507
  }
2508
+ if (!config.relayEssential)
2509
+ return;
2510
+ const marked = { ...record, essentialOnly: true };
2511
+ try {
2512
+ config.sink({ method: OUTPUT_METHOD[record.level], line: renderJson(marked), record: marked });
2513
+ } catch {}
2172
2514
  }
2173
2515
  function buildRecord(level, area, event, fields) {
2174
2516
  const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
@@ -2333,12 +2675,17 @@ function deliverEvent(level, area, event, fields) {
2333
2675
  return deliver(buildRecord(level, area, event, fields));
2334
2676
  }
2335
2677
  function tryWriteLog(level, area, event, fields) {
2336
- if (LEVEL_RANK[level] > thresholdRank(area))
2678
+ if (LEVEL_RANK[level] > thresholdRank(area)) {
2679
+ if (isEssentialEntry(area, event, level)) {
2680
+ deliverEssentialOnly(buildRecord(level, area, event, resolveFields(fields)));
2681
+ }
2337
2682
  return false;
2683
+ }
2338
2684
  return deliverEvent(level, area, event, resolveFields(fields));
2339
2685
  }
2340
2686
  function createLogger(area) {
2341
2687
  const spec = areaSpec(area);
2688
+ const mayHoldEssential = hasEssentialEvents(area);
2342
2689
  let seenGeneration = -1;
2343
2690
  let rank = 0;
2344
2691
  const enabled = (level) => {
@@ -2351,9 +2698,16 @@ function createLogger(area) {
2351
2698
  const writeResolved = (level, event, resolved) => {
2352
2699
  deliverEvent(level, area, event, resolved);
2353
2700
  };
2701
+ const writeFiltered = (level, event, fields) => {
2702
+ if (!mayHoldEssential || !isEssentialEntry(area, event, level))
2703
+ return;
2704
+ deliverEssentialOnly(buildRecord(level, area, event, resolveFields(fields)));
2705
+ };
2354
2706
  const write = (level, event, fields) => {
2355
- if (!enabled(level))
2707
+ if (!enabled(level)) {
2708
+ writeFiltered(level, event, fields);
2356
2709
  return;
2710
+ }
2357
2711
  writeResolved(level, event, resolveFields(fields));
2358
2712
  };
2359
2713
  return {
@@ -2364,8 +2718,10 @@ function createLogger(area) {
2364
2718
  trace: (event, fields) => write("trace", event, fields),
2365
2719
  throttled: (level, event, options) => {
2366
2720
  syncThrottleLevels();
2367
- if (!enabled(level))
2721
+ if (!enabled(level)) {
2722
+ writeFiltered(level, event, options.fields);
2368
2723
  return;
2724
+ }
2369
2725
  if (!spec || !Object.hasOwn(spec.events, event) || event.startsWith("throttle.") || !Object.hasOwn(spec.events, "throttle.recovered")) {
2370
2726
  deliver(buildRecord(level, spec ? area : "logging", spec ? "invalid-event" : "unknown-area", undefined));
2371
2727
  return;
@@ -10591,7 +10947,7 @@ var PERMISSION_RULE_PROVIDERS = [
10591
10947
  "grok",
10592
10948
  "pi"
10593
10949
  ];
10594
- var PROVIDERS = new Set(PERMISSION_RULE_PROVIDERS);
10950
+ var PROVIDERS2 = new Set(PERMISSION_RULE_PROVIDERS);
10595
10951
  var KINDS = new Set(PERMISSION_RULE_KINDS);
10596
10952
  var SCOPES = new Set(PERMISSION_RULE_SCOPES);
10597
10953
  var UNQUOTED_REFUSED = new Set([
@@ -10850,7 +11206,7 @@ var AGENT_INTERACTION_AUTHORIZATION_KINDS = [
10850
11206
  ];
10851
11207
  var INPUT_KINDS = new Set(AGENT_INTERACTION_INPUT_KINDS);
10852
11208
  var AUTHORIZATION_KINDS = new Set(AGENT_INTERACTION_AUTHORIZATION_KINDS);
10853
- var PROVIDERS2 = new Set(AGENT_INTERACTION_PROVIDERS);
11209
+ var PROVIDERS3 = new Set(AGENT_INTERACTION_PROVIDERS);
10854
11210
  var KINDS2 = new Set(AGENT_INTERACTION_KINDS);
10855
11211
  var ORIGINS = new Set(AGENT_INTERACTION_ORIGINS);
10856
11212
  var STATES = new Set(AGENT_INTERACTION_STATES);
@@ -11037,6 +11393,13 @@ var NATIVE_AGENT_USER_MCP_SERVERS_MAX = 32;
11037
11393
  function isNativeAgentUserMcpServerList(value) {
11038
11394
  return Array.isArray(value) && value.length <= NATIVE_AGENT_USER_MCP_SERVERS_MAX && value.every(isNativeAgentMcpServerName) && new Set(value).size === value.length;
11039
11395
  }
11396
+ function nativeAgentUserMcpGrant(policy) {
11397
+ const listed = policy?.capabilityPolicy?.userMcpServers;
11398
+ if (!isNativeAgentUserMcpServerList(listed))
11399
+ return;
11400
+ const denied = new Set(nativeAgentDeniedCapabilities(policy).map(nativeAgentMcpServer).filter((name) => name !== undefined));
11401
+ return listed.filter((name) => !denied.has(name));
11402
+ }
11040
11403
  var NATIVE_AGENT_USER_MCP_SELECTION = Object.freeze({
11041
11404
  claude: Object.freeze({ ordinary: true, readOnly: true }),
11042
11405
  codex: Object.freeze({ ordinary: true, readOnly: true }),
@@ -11386,6 +11749,8 @@ function startParentWatchdog(options) {
11386
11749
  var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
11387
11750
  var AGENT_MAIL_MAX_STORE_BYTES = 32 * 1024 * 1024;
11388
11751
  var AGENT_MAIL_DEFAULT_RETENTION_DAYS = 14;
11752
+ var AGENT_MAIL_MAX_ATTACHMENT_BYTES = 8 * 1024 * 1024;
11753
+ var AGENT_MAIL_MAX_TOTAL_ATTACHMENT_BYTES = 32 * 1024 * 1024;
11389
11754
  var AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET = 16;
11390
11755
  var AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT = 40;
11391
11756
  var ORKESTRATOR_MCP_SERVER_NAME = "orkestrator";
@@ -11420,6 +11785,9 @@ function agentMailCapabilities(tabType, agent, locked = true) {
11420
11785
  }
11421
11786
  if (tabType === "claude-tmux")
11422
11787
  return { canPull: true, canSend: true, canInject: true };
11788
+ if (tabType === "pipeline-worker") {
11789
+ return agent ? { canPull: true, canSend: true, canInject: true } : { canPull: false, canSend: false, canInject: false };
11790
+ }
11423
11791
  if (["claude", "codex", "opencode"].includes(tabType)) {
11424
11792
  return { canPull: true, canSend: true, canInject: false };
11425
11793
  }
@@ -11477,7 +11845,7 @@ function truncateErrorUtf8(value, maximumBytes) {
11477
11845
  }
11478
11846
  function normalizedBillingError(text, status, provider) {
11479
11847
  const grok = provider === "grok" || /\bgrok build\b/i.test(text);
11480
- const label = grok ? "Grok Build" : provider === "cursor" ? "Cursor Agent" : "The agent";
11848
+ const label = grok ? "Grok Build" : "The agent";
11481
11849
  if (GROK_USAGE_EXHAUSTED.test(text) || USAGE_EXHAUSTED.test(text)) {
11482
11850
  return grok ? GROK_USAGE_EXHAUSTED_MESSAGE : `${label} usage balance is exhausted. Add usage credits, then retry this message.`;
11483
11851
  }
@@ -11592,6 +11960,51 @@ function formatAcpRpcError(error, provider) {
11592
11960
  return primary ?? detail ?? "ACP request failed";
11593
11961
  }
11594
11962
 
11963
+ // ../../bridges/acp-bridge/src/acp-jsonl-framer.ts
11964
+ class JsonlLineFramer {
11965
+ #maxLineBytes;
11966
+ #held = [];
11967
+ #heldBytes = 0;
11968
+ constructor(maxLineBytes) {
11969
+ this.#maxLineBytes = maxLineBytes;
11970
+ }
11971
+ accept(chunk, onLine) {
11972
+ let start = 0;
11973
+ let newline = chunk.indexOf(10, start);
11974
+ while (newline >= 0) {
11975
+ const lineBytes = this.#heldBytes + newline - start;
11976
+ if (lineBytes > this.#maxLineBytes) {
11977
+ this.discard();
11978
+ return "oversized";
11979
+ }
11980
+ onLine(this.#takeLine(chunk.subarray(start, newline), lineBytes));
11981
+ start = newline + 1;
11982
+ newline = chunk.indexOf(10, start);
11983
+ }
11984
+ if (start < chunk.length) {
11985
+ this.#held.push(start === 0 ? chunk : chunk.subarray(start));
11986
+ this.#heldBytes += chunk.length - start;
11987
+ }
11988
+ if (this.#heldBytes > this.#maxLineBytes) {
11989
+ this.discard();
11990
+ return "unterminated-oversized";
11991
+ }
11992
+ return;
11993
+ }
11994
+ discard() {
11995
+ this.#held = [];
11996
+ this.#heldBytes = 0;
11997
+ }
11998
+ #takeLine(tail, lineBytes) {
11999
+ if (this.#held.length === 0)
12000
+ return tail.toString("utf8");
12001
+ this.#held.push(tail);
12002
+ const line = Buffer.concat(this.#held, lineBytes).toString("utf8");
12003
+ this.discard();
12004
+ return line;
12005
+ }
12006
+ }
12007
+
11595
12008
  // ../../bridges/acp-bridge/src/acp-credentials.ts
11596
12009
  import { promises as fs } from "node:fs";
11597
12010
  import { homedir } from "node:os";
@@ -11694,6 +12107,9 @@ function effectiveExecutionPolicy(requested, env = process.env) {
11694
12107
  return requested;
11695
12108
  return coordinatorProcessPolicy();
11696
12109
  }
12110
+ function liveExecutionPolicy(state) {
12111
+ return state.policyPending ? undefined : state.policy;
12112
+ }
11697
12113
  function effectiveTurnExecutionPolicy(input) {
11698
12114
  return input.readOnly ? coordinatorProcessPolicy() : effectiveExecutionPolicy(input.policy);
11699
12115
  }
@@ -12625,6 +13041,7 @@ function grokMcpConfigStatus(loaded, current) {
12625
13041
  }
12626
13042
 
12627
13043
  // ../../bridges/acp-bridge/src/acp-context.ts
13044
+ var log3 = createLogger("bridge.acp");
12628
13045
  var CURSOR_TODO_STATUSES = ["pending", "in_progress", "completed", "cancelled"];
12629
13046
  var providerConfig = loadAcpProviderConfig();
12630
13047
  var provider = providerConfig.id;
@@ -12651,8 +13068,6 @@ var clientSessionKeys = new Map;
12651
13068
  var sessionCreations = new Map;
12652
13069
  var sessionResumes = new Map;
12653
13070
  var anonymousSessionCreations = 0;
12654
- var activeCursorToolReplays = 0;
12655
- var cursorToolReplayProcesses = new Set;
12656
13071
  var sessionListProbe = null;
12657
13072
  var persistenceTail = Promise.resolve();
12658
13073
  var persistenceScheduled = false;
@@ -12737,10 +13152,6 @@ var MAX_MODEL_ID_BYTES = 1024;
12737
13152
  var MAX_TOOL_NAME_BYTES = 256;
12738
13153
  var MAX_TOOL_TITLE_BYTES = 4 * 1024;
12739
13154
  var MAX_TOOL_PATH_BYTES = 16 * 1024;
12740
- var MAX_REPLAY_RECONCILE_TOOLS = 4096;
12741
- var MAX_CURSOR_TOOL_REPLAY_PROCESSES = 8;
12742
- var CURSOR_TOOL_REPLAY_DELAY_MS = 500;
12743
- var MAX_LIVE_CURSOR_TOOL_REPLAYS_PER_TURN = parseBoundedInteger(process.env.ACP_MAX_LIVE_CURSOR_TOOL_REPLAYS, 8, 0, 64);
12744
13155
  var MAX_DIFF_EDIT_DISTANCE = 512;
12745
13156
  var DIFF_CONTEXT_LINES = 3;
12746
13157
  var MAX_SESSIONS = parseBoundedInteger(process.env.ACP_MAX_SESSIONS, 256, 1, 256);
@@ -12799,7 +13210,7 @@ class AcpProcess {
12799
13210
  #closed = false;
12800
13211
  #readOnlyProfile;
12801
13212
  #terminationOutcome;
12802
- #stdoutBuffer = Buffer.alloc(0);
13213
+ #stdoutFramer = new JsonlLineFramer(MAX_LINE_BYTES);
12803
13214
  onUpdate = unattachedUpdate;
12804
13215
  earlyCommandsUpdate = null;
12805
13216
  onVendor = () => {
@@ -12869,6 +13280,13 @@ class AcpProcess {
12869
13280
  }
12870
13281
  this.child.once("error", (error) => this.#close(error));
12871
13282
  this.child.once("exit", (code, signal) => {
13283
+ log3.warn("agent.exited", {
13284
+ provider,
13285
+ pid: this.child.pid ?? null,
13286
+ code,
13287
+ signal,
13288
+ requested: this.#terminationOutcome === "resolved"
13289
+ });
12872
13290
  this.#close(new Error(`${provider} ACP process exited (code ${code ?? "null"}, signal ${signal ?? "null"})`), this.#terminationOutcome ?? (code === 0 ? "resolved" : "rejected"));
12873
13291
  });
12874
13292
  }
@@ -13002,24 +13420,11 @@ class AcpProcess {
13002
13420
  #acceptChunk(chunk) {
13003
13421
  if (this.#closed)
13004
13422
  return;
13005
- this.#stdoutBuffer = Buffer.concat([this.#stdoutBuffer, chunk]);
13006
- while (true) {
13007
- const newline = this.#stdoutBuffer.indexOf(10);
13008
- if (newline < 0)
13009
- break;
13010
- if (newline > MAX_LINE_BYTES) {
13011
- this.#close(new Error(`${provider} ACP emitted an oversized JSONL frame`));
13012
- this.#terminateChild("rejected");
13013
- return;
13014
- }
13015
- const line = this.#stdoutBuffer.subarray(0, newline).toString("utf8");
13016
- this.#stdoutBuffer = this.#stdoutBuffer.subarray(newline + 1);
13017
- this.#acceptLine(line);
13018
- }
13019
- if (this.#stdoutBuffer.length > MAX_LINE_BYTES) {
13020
- this.#close(new Error(`${provider} ACP emitted an unterminated oversized JSONL frame`));
13021
- this.#terminateChild("rejected");
13022
- }
13423
+ const failure = this.#stdoutFramer.accept(chunk, (line) => this.#acceptLine(line));
13424
+ if (!failure)
13425
+ return;
13426
+ this.#close(new Error(failure === "oversized" ? `${provider} ACP emitted an oversized JSONL frame` : `${provider} ACP emitted an unterminated oversized JSONL frame`));
13427
+ this.#terminateChild("rejected");
13023
13428
  }
13024
13429
  #acceptLine(line) {
13025
13430
  if (!line.trim())
@@ -13320,9 +13725,6 @@ function setSessionListProbe(value) {
13320
13725
  function adjustAnonymousSessionCreations(delta) {
13321
13726
  anonymousSessionCreations += delta;
13322
13727
  }
13323
- function adjustActiveCursorToolReplays(delta) {
13324
- activeCursorToolReplays += delta;
13325
- }
13326
13728
  function setPersistenceScheduled(value) {
13327
13729
  persistenceScheduled = value;
13328
13730
  }
@@ -13335,6 +13737,97 @@ function setShuttingDown(value) {
13335
13737
  function setCatalogProbe(value) {
13336
13738
  catalogProbe = value;
13337
13739
  }
13740
+ // ../protocol/src/execution-policy-narrowing.ts
13741
+ var APPROVALS_STRICTNESS = {
13742
+ "auto-approve": 0,
13743
+ ask: 1,
13744
+ deny: 2
13745
+ };
13746
+ var SANDBOX_STRICTNESS = {
13747
+ none: 0,
13748
+ container: 1,
13749
+ provider: 2
13750
+ };
13751
+ function networkStrictness(value) {
13752
+ return value === "restricted" ? 1 : 0;
13753
+ }
13754
+ function isSubset(candidate, of) {
13755
+ const allowed = new Set(of);
13756
+ return candidate.every((item) => allowed.has(item));
13757
+ }
13758
+ function rawCapabilityDenials(policy) {
13759
+ return [
13760
+ ...policy.capabilityPolicy?.deny ?? [],
13761
+ ...policy.capabilityPolicy?.extendedDeny ?? []
13762
+ ];
13763
+ }
13764
+ function executionPolicyWidenings(current, next) {
13765
+ if (!current)
13766
+ return [];
13767
+ const widened = [];
13768
+ if (next.id !== current.id)
13769
+ widened.push("id");
13770
+ if (APPROVALS_STRICTNESS[next.approvals] < APPROVALS_STRICTNESS[current.approvals]) {
13771
+ widened.push("approvals");
13772
+ }
13773
+ if (SANDBOX_STRICTNESS[next.sandbox] < SANDBOX_STRICTNESS[current.sandbox]) {
13774
+ widened.push("sandbox");
13775
+ }
13776
+ if (next.projectResources && !current.projectResources)
13777
+ widened.push("projectResources");
13778
+ if (networkStrictness(next.networkAccess) < networkStrictness(current.networkAccess)) {
13779
+ widened.push("networkAccess");
13780
+ }
13781
+ if (networkStrictness(next.containerNetworkAccess) < networkStrictness(current.containerNetworkAccess)) {
13782
+ widened.push("containerNetworkAccess");
13783
+ }
13784
+ const currentAllow = current.toolPolicy?.allow;
13785
+ const nextAllow = next.toolPolicy?.allow;
13786
+ const allowNarrows = currentAllow === undefined ? nextAllow === undefined || nextAllow.length === 0 : nextAllow !== undefined && isSubset(nextAllow, currentAllow);
13787
+ if (!allowNarrows)
13788
+ widened.push("toolPolicy.allow");
13789
+ if (!isSubset(current.toolPolicy?.deny ?? [], next.toolPolicy?.deny ?? [])) {
13790
+ widened.push("toolPolicy.deny");
13791
+ }
13792
+ if (!isSubset(rawCapabilityDenials(current), rawCapabilityDenials(next))) {
13793
+ widened.push("capabilityPolicy.deny");
13794
+ }
13795
+ if (!isSubset(next.capabilityPolicy?.allow ?? [], current.capabilityPolicy?.allow ?? [])) {
13796
+ widened.push("capabilityPolicy.allow");
13797
+ }
13798
+ const currentServers = nativeAgentUserMcpGrant(current);
13799
+ const nextServers = nativeAgentUserMcpGrant(next);
13800
+ if (currentServers !== undefined && (nextServers === undefined || !isSubset(nextServers, currentServers))) {
13801
+ widened.push("capabilityPolicy.userMcpServers");
13802
+ }
13803
+ return widened;
13804
+ }
13805
+ var POLICY_WIDENING_REFUSED_CODE = "policy-widening-refused";
13806
+ function policyWideningRefusal(widened) {
13807
+ return {
13808
+ error: "Execution policy can only be narrowed on a live session; a wider policy applies after the agent bridge restarts.",
13809
+ code: POLICY_WIDENING_REFUSED_CODE,
13810
+ widened
13811
+ };
13812
+ }
13813
+
13814
+ class PolicyWideningRefusedError extends Error {
13815
+ widened;
13816
+ constructor(widened) {
13817
+ super(policyWideningRefusal(widened).error);
13818
+ this.widened = widened;
13819
+ this.name = "PolicyWideningRefusedError";
13820
+ }
13821
+ refusal() {
13822
+ return policyWideningRefusal(this.widened);
13823
+ }
13824
+ }
13825
+ function assertExecutionPolicyNotWidened(current, next) {
13826
+ const widened = executionPolicyWidenings(current, next);
13827
+ if (widened.length > 0)
13828
+ throw new PolicyWideningRefusedError(widened);
13829
+ }
13830
+
13338
13831
  // ../protocol/src/web-annotations-errors.ts
13339
13832
  var WEB_ANNOTATION_ERROR_CODES = Object.freeze([
13340
13833
  "conflict",
@@ -13598,9 +14091,6 @@ var WEB_ANNOTATION_BLOCKED_REASON_LABELS = Object.freeze({
13598
14091
  "dispatch-rejected": "Held — the agent rejected this request; retry or cancel"
13599
14092
  });
13600
14093
 
13601
- // ../../bridges/acp-bridge/src/acp-tools.ts
13602
- import { createHash as createHash4 } from "node:crypto";
13603
-
13604
14094
  // ../protocol/src/node/bridge-transcript-text.ts
13605
14095
  import { Buffer as Buffer2 } from "node:buffer";
13606
14096
  function sliceUtf8(value, maximumBytes) {
@@ -13967,7 +14457,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
13967
14457
  }
13968
14458
 
13969
14459
  // ../../bridges/acp-bridge/src/acp-persist-writer.ts
13970
- var log3 = createLogger("bridge.acp");
14460
+ var log4 = createLogger("bridge.acp");
13971
14461
  function boundPersistedSnapshot(snapshot) {
13972
14462
  const bounded = {
13973
14463
  ...snapshot,
@@ -14164,7 +14654,7 @@ function schedulePersist() {
14164
14654
  await writePersistedState();
14165
14655
  });
14166
14656
  setPersistenceTail(operation.catch((error) => {
14167
- log3.warn("state.persist-failed", { error: formatLogError(error, { stack: false }) });
14657
+ log4.warn("state.persist-failed", { error: formatLogError(error, { stack: false }) });
14168
14658
  }));
14169
14659
  }
14170
14660
  function persistState() {
@@ -15040,9 +15530,6 @@ function applyToolCallUpdate(state, update, isInitial) {
15040
15530
  syncActiveSubagentTool(state, part);
15041
15531
  if (!commitToolPartMutation(state, part, source))
15042
15532
  return;
15043
- if (state.historyReplay === false && state.status === "running" && !turnRequiresCompleteOutput(state) && isSettledToolPart(part) && isGenericCursorToolPart(part)) {
15044
- scheduleCursorToolMetadataReconcile(state);
15045
- }
15046
15533
  return part;
15047
15534
  }
15048
15535
  function namesAnotherCall(update, part) {
@@ -15057,303 +15544,9 @@ function continuesAcrossTurns(state, part, isInitial) {
15057
15544
  }
15058
15545
  return !isInitial && !isSettledToolPart(part);
15059
15546
  }
15060
- function collectReplayToolMetadata(collector, update, isInitial) {
15061
- const id = boundedString2(update.toolCallId, MAX_TOOL_ID_BYTES)?.trim();
15062
- if (!id)
15063
- return;
15064
- let call = collector.byId.get(id);
15065
- if (!call && isInitial) {
15066
- call = { id, retainedBytes: 0 };
15067
- call.retainedBytes = replayToolMetadataBytes(call);
15068
- while (collector.byId.size >= collector.capacity) {
15069
- if (!evictOldestReplayTool(collector, id))
15070
- break;
15071
- }
15072
- if (!makeReplayToolRoom(collector, call.retainedBytes, id))
15073
- return;
15074
- collector.retainedBytes += call.retainedBytes;
15075
- collector.byId.set(id, call);
15076
- }
15077
- if (!call)
15078
- return;
15079
- const candidate = { ...call };
15080
- if ("title" in update) {
15081
- candidate.title = boundedNullableString(update.title, MAX_TOOL_TITLE_BYTES);
15082
- }
15083
- if ("name" in update) {
15084
- candidate.toolName = boundedNullableString(update.name, MAX_TOOL_NAME_BYTES);
15085
- }
15086
- if ("kind" in update && !candidate.toolName) {
15087
- candidate.toolName = boundedNullableString(update.kind, MAX_TOOL_NAME_BYTES);
15088
- }
15089
- if ("rawInput" in update && isObject3(update.rawInput)) {
15090
- candidate.toolName ??= boundedString2(update.rawInput._toolName, MAX_TOOL_NAME_BYTES);
15091
- candidate.toolArgs = boundedToolArguments(update.rawInput);
15092
- }
15093
- if ("content" in update) {
15094
- candidate.contentOutputHash = replayOutputHash(toolCallContentText(update.content));
15095
- }
15096
- if ("rawOutput" in update) {
15097
- const rawOutput = update.rawOutput === null ? undefined : stringifyToolPayload(update.rawOutput);
15098
- candidate.rawOutputHash = replayOutputHash(rawOutput);
15099
- }
15100
- candidate.retainedBytes = replayToolMetadataBytes(candidate);
15101
- const growth = candidate.retainedBytes - call.retainedBytes;
15102
- if (growth > 0 && !makeReplayToolRoom(collector, growth, id))
15103
- return;
15104
- collector.retainedBytes += growth;
15105
- Object.assign(call, candidate);
15106
- }
15107
- function evictOldestReplayTool(collector, keepId) {
15108
- for (const [id, call] of collector.byId) {
15109
- if (id === keepId)
15110
- continue;
15111
- collector.byId.delete(id);
15112
- collector.retainedBytes -= call.retainedBytes;
15113
- return true;
15114
- }
15115
- return false;
15116
- }
15117
- function makeReplayToolRoom(collector, bytes, keepId) {
15118
- while (collector.retainedBytes + bytes > collector.maximumBytes) {
15119
- if (!evictOldestReplayTool(collector, keepId))
15120
- break;
15121
- }
15122
- return collector.retainedBytes + bytes <= collector.maximumBytes;
15123
- }
15124
- function replayOutputHash(value) {
15125
- return value === undefined ? undefined : createHash4("sha256").update(value).digest("hex");
15126
- }
15127
- function replayToolMetadataBytes(call) {
15128
- return Buffer.byteLength(JSON.stringify({
15129
- id: call.id,
15130
- title: call.title,
15131
- toolName: call.toolName,
15132
- toolArgs: call.toolArgs,
15133
- contentOutputHash: call.contentOutputHash,
15134
- rawOutputHash: call.rawOutputHash
15135
- }));
15136
- }
15137
- function orderedReplayTools(collector) {
15138
- return [...collector.byId.values()];
15139
- }
15140
- function transcriptToolParts(state) {
15141
- return state.messages.flatMap((message) => message.parts.flatMap((part) => part.type === "tool-invocation" ? [part] : []));
15142
- }
15143
- function normalizedToolKind(value) {
15144
- const normalized = value?.trim().toLowerCase();
15145
- return normalized || undefined;
15146
- }
15147
- function hasToolArguments(value) {
15148
- return value !== undefined && Object.keys(value).length > 0;
15149
- }
15150
- function isGenericCursorToolTitle(value) {
15151
- const normalized = value?.trim().toLowerCase();
15152
- return normalized === "read file" || normalized === "read lints" || normalized === "edit file" || normalized === "grep" || normalized === "find";
15153
- }
15154
15547
  function isSettledToolPart(part) {
15155
15548
  return part.toolState === "success" || part.toolState === "failure";
15156
15549
  }
15157
- function isGenericCursorToolPart(part) {
15158
- return isGenericCursorToolTitle(part.toolTitle) && !hasToolArguments(part.toolArgs);
15159
- }
15160
- function cursorToolReplayTargets(state, options = {}) {
15161
- if (provider !== "cursor")
15162
- return [];
15163
- const parts = transcriptToolParts(state).slice(-MAX_REPLAY_RECONCILE_TOOLS);
15164
- const firstGeneric = parts.findIndex((part) => isGenericCursorToolPart(part));
15165
- if (firstGeneric === -1)
15166
- return [];
15167
- const targets = parts.slice(firstGeneric);
15168
- if (!options.requireSettled)
15169
- return targets;
15170
- const settled = targets.filter((part) => isSettledToolPart(part));
15171
- if (!settled.some((part) => isGenericCursorToolPart(part)))
15172
- return [];
15173
- return settled;
15174
- }
15175
- function applyReplayToolMetadata(state, capturedTargets, collector, options = {}) {
15176
- const liveToolParts = new Set(transcriptToolParts(state));
15177
- const targets = capturedTargets.filter((part) => liveToolParts.has(part));
15178
- const replayed = orderedReplayTools(collector);
15179
- if (targets.length === 0 || replayed.length === 0)
15180
- return false;
15181
- const unused = new Set(replayed.keys());
15182
- const allowKindFallback = options.allowKindFallback !== false;
15183
- let changed = false;
15184
- for (const part of targets) {
15185
- const targetKind = normalizedToolKind(part.toolName);
15186
- const targetOutputHash = replayOutputHash(part.toolOutput);
15187
- const sameKind = [...unused].filter((index) => {
15188
- const replay = replayed[index];
15189
- if (normalizedToolKind(replay?.toolName) !== targetKind)
15190
- return false;
15191
- const replayHash = replay?.contentOutputHash ?? replay?.rawOutputHash;
15192
- return !(targetOutputHash !== undefined && replayHash !== undefined && replayHash !== targetOutputHash);
15193
- });
15194
- const targetPath = part.toolDiff?.filePath ?? toolArgumentPath(part.toolArgs);
15195
- const pathMatches = targetPath ? sameKind.filter((index) => toolArgumentPath(replayed[index]?.toolArgs) === targetPath) : [];
15196
- const outputMatches = targetOutputHash ? sameKind.filter((index) => {
15197
- const replay = replayed[index];
15198
- const replayHash = replay?.contentOutputHash ?? replay?.rawOutputHash;
15199
- return replayHash !== undefined && replayHash === targetOutputHash;
15200
- }) : [];
15201
- const candidateIndexes = pathMatches.length > 0 ? pathMatches : outputMatches;
15202
- const replayIndex = candidateIndexes.length === 1 ? candidateIndexes[0] : allowKindFallback && sameKind.length === 1 ? sameKind[0] : undefined;
15203
- if (replayIndex === undefined)
15204
- continue;
15205
- const replay = replayed[replayIndex];
15206
- if (!replay)
15207
- continue;
15208
- unused.delete(replayIndex);
15209
- let partChanged = false;
15210
- if (!part.toolName && replay.toolName) {
15211
- part.toolName = replay.toolName;
15212
- partChanged = true;
15213
- }
15214
- if (!hasToolArguments(part.toolArgs) && hasToolArguments(replay.toolArgs)) {
15215
- part.toolArgs = replay.toolArgs;
15216
- partChanged = true;
15217
- }
15218
- if (replay.title && isGenericCursorToolTitle(part.toolTitle) && replay.title !== part.toolTitle) {
15219
- const previousTitle = part.toolTitle;
15220
- part.toolTitle = replay.title;
15221
- if (!part.content || part.content === previousTitle)
15222
- part.content = replay.title;
15223
- partChanged = true;
15224
- }
15225
- if (partChanged) {
15226
- changed = true;
15227
- acpToolSourceStates.delete(part);
15228
- notePartMutation(state, part);
15229
- }
15230
- }
15231
- if (changed)
15232
- boundTranscript(state);
15233
- return changed;
15234
- }
15235
- async function reconcileCursorToolMetadata(state, child, targets, promptSequence, options = {}) {
15236
- if (provider !== "cursor" || shuttingDown || state.closing !== undefined || sessions.get(state.id) !== state || state.child !== child || state.promptSequence !== promptSequence || targets.length === 0)
15237
- return;
15238
- if (activeCursorToolReplays >= MAX_CURSOR_TOOL_REPLAY_PROCESSES)
15239
- return;
15240
- const capacity = Math.min(targets.length, MAX_REPLAY_RECONCILE_TOOLS);
15241
- if (capacity === 0)
15242
- return;
15243
- const collector = {
15244
- capacity,
15245
- maximumBytes: MAX_TRANSCRIPT_BYTES,
15246
- retainedBytes: 0,
15247
- byId: new Map
15248
- };
15249
- adjustActiveCursorToolReplays(1);
15250
- let replayChild;
15251
- try {
15252
- replayChild = new AcpProcess;
15253
- cursorToolReplayProcesses.add(replayChild);
15254
- (state.cursorToolReplayChildren ??= new Set).add(replayChild);
15255
- replayChild.onUpdate = (params) => {
15256
- if (params.sessionId !== state.acpSessionId || !isObject3(params.update))
15257
- return;
15258
- const update = params.update;
15259
- const kind = typeof update.sessionUpdate === "string" ? update.sessionUpdate : typeof update.type === "string" ? update.type : "";
15260
- if (kind === "tool_call" || kind === "tool_call_update") {
15261
- collectReplayToolMetadata(collector, update, kind === "tool_call");
15262
- }
15263
- };
15264
- const initialized = await replayChild.initialize();
15265
- const capabilities = isObject3(initialized.agentCapabilities) ? initialized.agentCapabilities : undefined;
15266
- if (capabilities?.loadSession !== true)
15267
- return;
15268
- await replayChild.request("session/load", {
15269
- cwd: workingDirectory,
15270
- additionalDirectories: [],
15271
- mcpServers: configuredAcpMcpServers(state.agentMcp),
15272
- sessionId: state.acpSessionId
15273
- });
15274
- if (!shuttingDown && sessions.get(state.id) === state && state.child === child && state.promptSequence === promptSequence && applyReplayToolMetadata(state, targets, collector, options)) {
15275
- state.revision += 1;
15276
- schedulePersist();
15277
- }
15278
- } catch {} finally {
15279
- try {
15280
- await replayChild?.close();
15281
- } finally {
15282
- if (replayChild) {
15283
- cursorToolReplayProcesses.delete(replayChild);
15284
- state.cursorToolReplayChildren?.delete(replayChild);
15285
- }
15286
- adjustActiveCursorToolReplays(-1);
15287
- }
15288
- }
15289
- }
15290
- function liveCursorReplayBudgetExhausted(state) {
15291
- const used = state.cursorToolReplayTurn === state.promptSequence ? state.cursorToolReplayRuns ?? 0 : 0;
15292
- return used >= MAX_LIVE_CURSOR_TOOL_REPLAYS_PER_TURN;
15293
- }
15294
- function recordCursorToolReplayRun(state) {
15295
- if (state.cursorToolReplayTurn !== state.promptSequence) {
15296
- state.cursorToolReplayTurn = state.promptSequence;
15297
- state.cursorToolReplayRuns = 0;
15298
- }
15299
- state.cursorToolReplayRuns = (state.cursorToolReplayRuns ?? 0) + 1;
15300
- }
15301
- function scheduleCursorToolMetadataReconcile(state, options = {}) {
15302
- if (provider !== "cursor" || shuttingDown || sessions.get(state.id) !== state || state.closing) {
15303
- return;
15304
- }
15305
- if (!options.final && liveCursorReplayBudgetExhausted(state))
15306
- return;
15307
- if (options.final || !state.cursorToolReplayPending) {
15308
- state.cursorToolReplayPending = options.final ? "final" : "live";
15309
- }
15310
- if (state.cursorToolReplayRunning)
15311
- return;
15312
- if (state.cursorToolReplayTimer) {
15313
- if (!options.final)
15314
- return;
15315
- clearTimeout(state.cursorToolReplayTimer);
15316
- state.cursorToolReplayTimer = undefined;
15317
- }
15318
- const run = () => {
15319
- state.cursorToolReplayTimer = undefined;
15320
- if (shuttingDown || sessions.get(state.id) !== state || state.closing)
15321
- return;
15322
- const mode = state.cursorToolReplayPending;
15323
- state.cursorToolReplayPending = undefined;
15324
- if (!mode)
15325
- return;
15326
- if (turnRequiresCompleteOutput(state))
15327
- return;
15328
- const child = state.child;
15329
- const targets = cursorToolReplayTargets(state, { requireSettled: mode === "live" });
15330
- if (!child || targets.length === 0)
15331
- return;
15332
- const promptSequence = state.promptSequence;
15333
- recordCursorToolReplayRun(state);
15334
- state.cursorToolReplayRunning = true;
15335
- reconcileCursorToolMetadata(state, child, targets, promptSequence, {
15336
- allowKindFallback: mode === "final"
15337
- }).catch(() => {
15338
- return;
15339
- }).finally(() => {
15340
- state.cursorToolReplayRunning = false;
15341
- if (state.cursorToolReplayPending) {
15342
- scheduleCursorToolMetadataReconcile(state, {
15343
- final: state.cursorToolReplayPending === "final"
15344
- });
15345
- }
15346
- });
15347
- };
15348
- state.cursorToolReplayTimer = setTimeout(run, options.final ? 0 : CURSOR_TOOL_REPLAY_DELAY_MS);
15349
- state.cursorToolReplayTimer.unref();
15350
- }
15351
- function cancelCursorToolMetadataReconcile(state) {
15352
- if (state.cursorToolReplayTimer)
15353
- clearTimeout(state.cursorToolReplayTimer);
15354
- state.cursorToolReplayTimer = undefined;
15355
- state.cursorToolReplayPending = undefined;
15356
- }
15357
15550
  function acpParentTaskUseId(update) {
15358
15551
  const candidates = [update.parentToolCallId, update.parent_tool_call_id];
15359
15552
  if (isObject3(update._meta)) {
@@ -16463,7 +16656,7 @@ function providerLabel(provider) {
16463
16656
  const configured = loadAcpProviderConfig();
16464
16657
  return configured.id === provider ? configured.name : provider;
16465
16658
  } catch {
16466
- return provider === "grok" ? "Grok" : provider === "cursor" ? "Cursor" : provider;
16659
+ return provider === "grok" ? "Grok" : provider;
16467
16660
  }
16468
16661
  }
16469
16662
  var CONVERSATION_MODES = [
@@ -17682,7 +17875,7 @@ async function readJournal(path, maxEntries) {
17682
17875
  }
17683
17876
 
17684
17877
  // ../../bridges/acp-bridge/src/grok-interjection.ts
17685
- import { createHash as createHash5, randomBytes as randomBytes5 } from "node:crypto";
17878
+ import { createHash as createHash4, randomBytes as randomBytes5 } from "node:crypto";
17686
17879
  var GROK_INTERJECT_METHOD = "_x.ai/interject";
17687
17880
  var GROK_INTERJECTION_NOTIFICATION = "_x.ai/session/interjection";
17688
17881
  var MAX_GROK_INTERJECTION_JOURNAL = 256;
@@ -17693,7 +17886,7 @@ function grokRunId(promptSequence) {
17693
17886
  return `grok:${grokBridgeGeneration}:${promptSequence}`;
17694
17887
  }
17695
17888
  function grokInterjectionDigest(text) {
17696
- return createHash5("sha256").update(text).digest("hex");
17889
+ return createHash4("sha256").update(text).digest("hex");
17697
17890
  }
17698
17891
  function parseGrokInterjectResult(value) {
17699
17892
  if (!isObject6(value) || value.status !== "queued")
@@ -17852,7 +18045,7 @@ var SOURCES = new Set([
17852
18045
  var EXECUTION_KINDS = new Set(NATIVE_AGENT_COMMAND_EXECUTION_KINDS);
17853
18046
  var ORIGINS2 = new Set(NATIVE_AGENT_COMMAND_ORIGINS);
17854
18047
  var UNAVAILABLE_REASONS = new Set(NATIVE_AGENT_COMMAND_UNAVAILABLE_REASONS);
17855
- var ERROR_CODES = new Set(NATIVE_AGENT_COMMAND_CATALOGUE_ERROR_CODES);
18048
+ var ERROR_CODES2 = new Set(NATIVE_AGENT_COMMAND_CATALOGUE_ERROR_CODES);
17856
18049
  var encoder = new TextEncoder;
17857
18050
  function utf8ByteLength(value) {
17858
18051
  if (/^[\x00-\x7f]*$/.test(value))
@@ -18124,7 +18317,7 @@ function compactCommandSelection(state) {
18124
18317
  }
18125
18318
 
18126
18319
  // ../../bridges/acp-bridge/src/acp-persistence.ts
18127
- var log4 = createLogger("bridge.acp");
18320
+ var log5 = createLogger("bridge.acp");
18128
18321
  async function listNormalizedModels(signal) {
18129
18322
  const live = mergeComposerCatalog(provider, [
18130
18323
  ...catalogCache ? [catalogCache] : [],
@@ -18172,14 +18365,14 @@ function restoreSessionConfig(candidate) {
18172
18365
  const restored = parsePersistedAcpSessionConfig(provider, candidate.sessionConfig);
18173
18366
  if (restored)
18174
18367
  return restored;
18175
- log4.warn("state.session-config-reset");
18368
+ log5.warn("state.session-config-reset");
18176
18369
  return emptySessionConfig();
18177
18370
  }
18178
18371
  if (candidate.composer !== undefined) {
18179
18372
  const composer = parsePersistedComposerState(provider, candidate.composer);
18180
18373
  if (composer)
18181
18374
  return { ...emptySessionConfig(), composer };
18182
- log4.warn("state.composer-reset");
18375
+ log5.warn("state.composer-reset");
18183
18376
  }
18184
18377
  return emptySessionConfig();
18185
18378
  }
@@ -18262,7 +18455,7 @@ async function restorePersistedState() {
18262
18455
  sessions.clear();
18263
18456
  bumpCursorDiscoveryRevision();
18264
18457
  clientSessionKeys.clear();
18265
- log4.warn("state.discarded", { error: formatLogError(error, { stack: false }) });
18458
+ log5.warn("state.discarded", { error: formatLogError(error, { stack: false }) });
18266
18459
  const file = stateFile;
18267
18460
  if (!file)
18268
18461
  return;
@@ -18335,6 +18528,7 @@ async function loadPersistedState() {
18335
18528
  transcriptTruncated: candidate.transcriptTruncated === true || Number.isSafeInteger(candidate.droppedMessages) && Number(candidate.droppedMessages) > 0 || Number.isSafeInteger(candidate.droppedParts) && Number(candidate.droppedParts) > 0,
18336
18529
  sessionConfig: restoreSessionConfig(candidate),
18337
18530
  policy: restorePersistedPolicy(candidate.policy),
18531
+ policyPending: true,
18338
18532
  ...typeof candidate.readOnly === "boolean" ? { readOnly: candidate.readOnly } : {},
18339
18533
  dispatching: false,
18340
18534
  historyReplay: false,
@@ -18789,7 +18983,7 @@ class InteractionDeadline {
18789
18983
  }
18790
18984
 
18791
18985
  // ../../bridges/acp-bridge/src/acp-command-changes.ts
18792
- import { createHash as createHash7 } from "node:crypto";
18986
+ import { createHash as createHash6 } from "node:crypto";
18793
18987
  import { resolve as resolve6 } from "node:path";
18794
18988
 
18795
18989
  // ../protocol/src/node/workspace-change-probe.ts
@@ -19791,7 +19985,7 @@ function workspaceObservationReportIssues(value) {
19791
19985
  }
19792
19986
 
19793
19987
  // ../protocol/src/node/change-tracking/evidence-spool.ts
19794
- import { createHash as createHash6, randomUUID as randomUUID2 } from "node:crypto";
19988
+ import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
19795
19989
  import { readdirSync, readFileSync as readFileSync2 } from "node:fs";
19796
19990
  import { appendFile as appendFile2, mkdir as mkdir2, rename as rename2, rm as rm3, writeFile as writeFile2 } from "node:fs/promises";
19797
19991
  import { join as join7 } from "node:path";
@@ -19807,10 +20001,10 @@ var DEFAULT_EVIDENCE_SPOOL_LIMITS = {
19807
20001
  var ENTRIES_FILE = "entries.jsonl";
19808
20002
  var BODY_DIRECTORY = "bodies";
19809
20003
  function evidenceBodyId(bytes) {
19810
- return `sha256:${createHash6("sha256").update(bytes).digest("hex")}`;
20004
+ return `sha256:${createHash5("sha256").update(bytes).digest("hex")}`;
19811
20005
  }
19812
20006
  function stableEvidenceId(...parts) {
19813
- const hash = createHash6("sha256");
20007
+ const hash = createHash5("sha256");
19814
20008
  for (const part of parts)
19815
20009
  hash.update(`${part ?? ""}\x00`);
19816
20010
  return hash.digest("hex").slice(0, 40);
@@ -20453,7 +20647,7 @@ function canonicalEvidence(evidence) {
20453
20647
  }
20454
20648
 
20455
20649
  // ../../bridges/acp-bridge/src/change-evidence.ts
20456
- var log5 = createLogger("bridge.acp");
20650
+ var log6 = createLogger("bridge.acp");
20457
20651
  var MAX_DIFF_BLOCKS_PER_CALL = 100;
20458
20652
  var MAX_HELD_DIFF_BYTES = 32 * 1024 * 1024;
20459
20653
  var MAX_SEEN_CALL_IDS = 8192;
@@ -20752,7 +20946,7 @@ function recordAcpToolEvidence(state, part, update) {
20752
20946
  if (isTerminal(phase))
20753
20947
  settleRecord(state, part, record);
20754
20948
  } catch (error) {
20755
- log5.warn("evidence.record-failed", {
20949
+ log6.warn("evidence.record-failed", {
20756
20950
  errorClass: error instanceof Error ? error.name : "unknown"
20757
20951
  });
20758
20952
  }
@@ -20796,7 +20990,7 @@ function recordAcpShellObservation(state, toolUseId, observation) {
20796
20990
  ...observation.unavailableReason ? { unavailableReason: observation.unavailableReason } : {}
20797
20991
  });
20798
20992
  } catch (error) {
20799
- log5.warn("evidence.shell-record-failed", {
20993
+ log6.warn("evidence.shell-record-failed", {
20800
20994
  errorClass: error instanceof Error ? error.name : "unknown"
20801
20995
  });
20802
20996
  }
@@ -20828,14 +21022,14 @@ function endAcpTurnEvidence(state, outcome) {
20828
21022
  const writers = state.activeSubagentToolIds.size > 0 || turn.backgroundLaunched ? "may-write" : "quiescent";
20829
21023
  changeEvidenceRecorder().turn({ conversationId: state.id, turnId: turn.turnId }, outcome, writers);
20830
21024
  } catch (error) {
20831
- log5.warn("evidence.turn-record-failed", {
21025
+ log6.warn("evidence.turn-record-failed", {
20832
21026
  errorClass: error instanceof Error ? error.name : "unknown"
20833
21027
  });
20834
21028
  }
20835
21029
  }
20836
21030
 
20837
21031
  // ../../bridges/acp-bridge/src/acp-command-changes.ts
20838
- var log6 = createLogger("bridge.acp");
21032
+ var log7 = createLogger("bridge.acp");
20839
21033
  var MAX_WINDOWS_PER_SESSION = 256;
20840
21034
  var MAX_CACHED_JOURNALS = MAX_RESUMABLE_SESSIONS;
20841
21035
  var probe;
@@ -20949,7 +21143,7 @@ function closeWindow(active, state, toolUseId, role) {
20949
21143
  recordAcpShellObservation(state, toolUseId, observation);
20950
21144
  recordCommandChange(state, toolUseId, legacyCommandChange(observation));
20951
21145
  }).catch((error) => {
20952
- log6.warn("command-change.record-failed", {
21146
+ log7.warn("command-change.record-failed", {
20953
21147
  errorClass: error instanceof Error ? error.name : "unknown"
20954
21148
  });
20955
21149
  });
@@ -21008,7 +21202,7 @@ async function applyJournaledCommandChanges(state) {
21008
21202
  function journalFor(acpSessionId) {
21009
21203
  if (!journalDirectory || !acpSessionId)
21010
21204
  return;
21011
- const name = createHash7("sha256").update(acpSessionId).digest("hex").slice(0, 40);
21205
+ const name = createHash6("sha256").update(acpSessionId).digest("hex").slice(0, 40);
21012
21206
  const path = resolve6(journalDirectory, `${name}.jsonl`);
21013
21207
  let journal = journals.get(path);
21014
21208
  if (journal) {
@@ -21124,9 +21318,21 @@ async function adoptAcpSession(acpSessionId, signal, patch, policy, agentMcp) {
21124
21318
  operation.then(clear, clear);
21125
21319
  return signal ? raceAbort(operation, signal) : operation;
21126
21320
  }
21321
+ async function replaceSessionPolicy(state, policy) {
21322
+ state.policyPending = false;
21323
+ if (JSON.stringify(state.policy) === JSON.stringify(policy))
21324
+ return;
21325
+ const previous = state.child;
21326
+ state.child = null;
21327
+ clearApprovals(state);
21328
+ state.policy = policy;
21329
+ await previous?.close();
21330
+ }
21127
21331
  async function resumeExistingSession(state, signal, patch, policy, agentMcp) {
21128
21332
  if (state.closing)
21129
21333
  throw new HttpError(409, SESSION_CLOSING_ERROR);
21334
+ if (policy)
21335
+ assertExecutionPolicyNotWidened(liveExecutionPolicy(state), policy);
21130
21336
  if (state.status === "running" || state.dispatching) {
21131
21337
  throw new HttpError(409, "Session is already running");
21132
21338
  }
@@ -21134,13 +21340,8 @@ async function resumeExistingSession(state, signal, patch, policy, agentMcp) {
21134
21340
  state.agentMcp = agentMcp;
21135
21341
  state.dispatching = true;
21136
21342
  try {
21137
- if (policy && JSON.stringify(state.policy) !== JSON.stringify(policy)) {
21138
- const previous = state.child;
21139
- state.child = null;
21140
- clearApprovals(state);
21141
- state.policy = policy;
21142
- await previous?.close();
21143
- }
21343
+ if (policy)
21344
+ await replaceSessionPolicy(state, policy);
21144
21345
  await ensureSessionProcess(state, signal);
21145
21346
  if (patch)
21146
21347
  await applyComposerPatch(state, patch, signal);
@@ -21245,6 +21446,15 @@ async function createSession(clientSessionKey, signal, spawnOptions = {}) {
21245
21446
  if (existing) {
21246
21447
  if (existing.closing)
21247
21448
  throw new HttpError(409, SESSION_CLOSING_ERROR);
21449
+ const policy = spawnOptions.policy;
21450
+ if (policy) {
21451
+ assertExecutionPolicyNotWidened(liveExecutionPolicy(existing), policy);
21452
+ if (JSON.stringify(existing.policy) !== JSON.stringify(policy) && (existing.status === "running" || existing.dispatching)) {
21453
+ throw new HttpError(409, "Session is already running");
21454
+ }
21455
+ await replaceSessionPolicy(existing, policy);
21456
+ schedulePersist();
21457
+ }
21248
21458
  if (typeof spawnOptions.readOnly === "boolean") {
21249
21459
  if (existing.readOnly === true !== spawnOptions.readOnly && (existing.status === "running" || existing.dispatching)) {
21250
21460
  throw new HttpError(409, "Session is already running");
@@ -21258,8 +21468,10 @@ async function createSession(clientSessionKey, signal, spawnOptions = {}) {
21258
21468
  }
21259
21469
  }
21260
21470
  const pending = sessionCreations.get(clientSessionKey);
21261
- if (pending)
21262
- return pending;
21471
+ if (pending) {
21472
+ await pending;
21473
+ return createSession(clientSessionKey, signal, spawnOptions);
21474
+ }
21263
21475
  }
21264
21476
  if (activeSessionReservations() >= MAX_SESSIONS)
21265
21477
  throw new HttpError(429, "ACP session limit reached");
@@ -23036,7 +23248,8 @@ function configureLoggerFromEnvironment(env, options = {}) {
23036
23248
  configureLogger({
23037
23249
  ...levels.level ? { level: levels.level } : {},
23038
23250
  areaLevels: levels.areaLevels,
23039
- format
23251
+ format,
23252
+ relayEssential: options.relayToSupervisor === true
23040
23253
  });
23041
23254
  const log = createLogger("logging");
23042
23255
  if (levels.invalid.length > 0) {
@@ -23684,7 +23897,7 @@ var DEFAULT_MCP_MANAGEMENT_ROLLOUT = Object.freeze({
23684
23897
 
23685
23898
  // ../protocol/src/node/bridge-transcript-summary.ts
23686
23899
  import { Buffer as Buffer5 } from "node:buffer";
23687
- import { createHash as createHash8 } from "node:crypto";
23900
+ import { createHash as createHash7 } from "node:crypto";
23688
23901
 
23689
23902
  // ../protocol/src/node/progressive-transcript.ts
23690
23903
  var BRIDGE_TRANSCRIPT_MAX_MESSAGES = 100;
@@ -23850,7 +24063,7 @@ function digestPayload(payload) {
23850
24063
  const serialized = JSON.stringify(payload);
23851
24064
  return {
23852
24065
  bytes: Buffer5.byteLength(serialized),
23853
- digest: createHash8("sha256").update(serialized).digest("base64url").slice(0, 32)
24066
+ digest: createHash7("sha256").update(serialized).digest("base64url").slice(0, 32)
23854
24067
  };
23855
24068
  }
23856
24069
  function topLevelKey(part, index) {
@@ -24250,7 +24463,6 @@ function closeSessionRetaining(state) {
24250
24463
  async function runClose(state) {
24251
24464
  state.closing = "fenced";
24252
24465
  denyPendingRequests(state);
24253
- cancelCursorToolMetadataReconcile(state);
24254
24466
  if (state.status === "running" || state.dispatching) {
24255
24467
  state.retryCancelledPromptSequence = state.dispatching ? state.promptSequence + 1 : state.promptSequence;
24256
24468
  state.child?.notify("session/cancel", { sessionId: state.acpSessionId });
@@ -24275,8 +24487,6 @@ async function runClose(state) {
24275
24487
  }
24276
24488
  if (state.child)
24277
24489
  children.add(state.child);
24278
- for (const child of state.cursorToolReplayChildren ?? [])
24279
- children.add(child);
24280
24490
  for (const child of children)
24281
24491
  await child.close();
24282
24492
  if (Array.from(children).some((child) => !exited(child)))
@@ -24881,6 +25091,9 @@ async function route(request, response, clientSignal) {
24881
25091
  }
24882
25092
  if ((action === "prompt" || action === "compact") && request.method === "POST") {
24883
25093
  let body = await readJson(request);
25094
+ if (isNativeAgentExecutionPolicy(body.policy)) {
25095
+ assertExecutionPolicyNotWidened(liveExecutionPolicy(state), effectiveExecutionPolicy(body.policy) ?? body.policy);
25096
+ }
24884
25097
  if (action === "compact") {
24885
25098
  body = {
24886
25099
  prompt: "/compact",
@@ -24945,6 +25158,7 @@ async function route(request, response, clientSignal) {
24945
25158
  if (state.status === "running" || state.dispatching) {
24946
25159
  return json(response, 409, { error: "Session is already running" });
24947
25160
  }
25161
+ state.policyPending = false;
24948
25162
  if (selectedCommand && state.commandsLive) {
24949
25163
  const resolved = resolveSelectedCommand(state, selectedCommand);
24950
25164
  if (!resolved.ok)
@@ -25156,7 +25370,6 @@ ${structuredPromptInstruction(schema)}` : prompt;
25156
25370
  }
25157
25371
  state.revision += 1;
25158
25372
  schedulePersist();
25159
- scheduleCursorToolMetadataReconcile(state, { final: true });
25160
25373
  }, (error) => {
25161
25374
  state.status = "error";
25162
25375
  state.error = error instanceof Error ? error.message : String(error);
@@ -25167,7 +25380,6 @@ ${structuredPromptInstruction(schema)}` : prompt;
25167
25380
  state.completedAttemptUsage = undefined;
25168
25381
  state.currentTurnRequestId = undefined;
25169
25382
  state.currentTurnSawVendorUsage = undefined;
25170
- cancelCursorToolMetadataReconcile(state);
25171
25383
  reconcileStaleToolParts(state, true);
25172
25384
  settleCommandChangeWindows(state);
25173
25385
  endAcpTurnEvidence(state, "failed");
@@ -25211,7 +25423,6 @@ ${structuredPromptInstruction(schema)}` : prompt;
25211
25423
  return await closeSessionRetaining(state) === "closed" ? json(response, 200, { deleted: true }) : json(response, 503, { error: "Session close did not complete" });
25212
25424
  }
25213
25425
  denyPendingRequests(state);
25214
- cancelCursorToolMetadataReconcile(state);
25215
25426
  await state.child?.close();
25216
25427
  sessions.delete(state.id);
25217
25428
  if (state.clientSessionKey)
@@ -25493,6 +25704,9 @@ function installFatalRejectionGuard(options) {
25493
25704
  try {
25494
25705
  warn(`${options.label} Unhandled promise rejection (continuing): ${describe(reason)}`);
25495
25706
  } catch {}
25707
+ try {
25708
+ options.onRejection?.(reason);
25709
+ } catch {}
25496
25710
  };
25497
25711
  target.on("unhandledRejection", handler);
25498
25712
  return () => {
@@ -25500,6 +25714,15 @@ function installFatalRejectionGuard(options) {
25500
25714
  };
25501
25715
  }
25502
25716
 
25717
+ // ../protocol/src/node/process-failure-log.ts
25718
+ var log8 = createLogger("process");
25719
+ function logUnhandledRejection(reason) {
25720
+ log8.throttled("error", "rejection.unhandled", {
25721
+ error: reason,
25722
+ fields: () => ({ error: formatLogError(reason, { message: false }) })
25723
+ });
25724
+ }
25725
+
25503
25726
  // ../../bridges/acp-bridge/src/acp-client-disconnect.ts
25504
25727
  function watchClientDisconnect(request, response, onDisconnect) {
25505
25728
  const socket = request.socket;
@@ -25527,7 +25750,7 @@ function watchClientDisconnect(request, response, onDisconnect) {
25527
25750
  }
25528
25751
 
25529
25752
  // ../../bridges/acp-bridge/src/acp-server.ts
25530
- var log7 = createLogger("bridge.acp");
25753
+ var log9 = createLogger("bridge.acp");
25531
25754
  configureBridgeLogger();
25532
25755
  await restorePersistedState();
25533
25756
  var server = createServer((request, response) => {
@@ -25541,11 +25764,22 @@ var server = createServer((request, response) => {
25541
25764
  json(response, 401, { error: error.message, kind: "authentication-required" });
25542
25765
  return;
25543
25766
  }
25767
+ if (error instanceof PolicyWideningRefusedError) {
25768
+ log9.warn("session.policy-widening-refused", { widened: error.widened.join(",") });
25769
+ json(response, 403, error.refusal());
25770
+ return;
25771
+ }
25544
25772
  const status = error instanceof HttpError ? error.status : 500;
25773
+ if (status === 500 && !controller.signal.aborted) {
25774
+ log9.warn("http.route-failed", {
25775
+ method: request.method,
25776
+ error: formatLogError(error, { message: false })
25777
+ });
25778
+ }
25545
25779
  json(response, status, { error: error instanceof Error ? error.message : String(error) });
25546
25780
  }).finally(stopWatchingClient);
25547
25781
  });
25548
- server.listen(port, hostname, () => log7.info("server.listening", { provider, hostname, port }));
25782
+ server.listen(port, hostname, () => log9.info("server.listening", { provider, hostname, port }));
25549
25783
  var shutdownPromise = null;
25550
25784
  function shutdown() {
25551
25785
  if (shutdownPromise)
@@ -25555,18 +25789,14 @@ function shutdown() {
25555
25789
  for (const state of sessions.values()) {
25556
25790
  for (const approval of Array.from(state.approvals.values()))
25557
25791
  approval.respond();
25558
- cancelCursorToolMetadataReconcile(state);
25559
25792
  }
25560
- await Promise.allSettled([
25561
- ...[...sessions.values()].map((state) => state.child?.close()),
25562
- ...[...cursorToolReplayProcesses].map((child) => child.close())
25563
- ]);
25793
+ await Promise.allSettled([...sessions.values()].map((state) => state.child?.close()));
25564
25794
  await flushStreamingPersist();
25565
25795
  await new Promise((resolvePromise) => server.close(() => resolvePromise()));
25566
25796
  })();
25567
25797
  return shutdownPromise;
25568
25798
  }
25569
- installFatalRejectionGuard({ label: "[acp-bridge]" });
25799
+ installFatalRejectionGuard({ label: "[acp-bridge]", onRejection: logUnhandledRejection });
25570
25800
  var parentPid = parseParentPid(process.env[PARENT_PID_ENV]);
25571
25801
  if (parentPid !== null) {
25572
25802
  startParentWatchdog({
@@ -25596,7 +25826,6 @@ export {
25596
25826
  CURSOR_CHILD_DISCOVERY_SKEW_MS,
25597
25827
  CURSOR_JSONL_SOURCE_PREFIX,
25598
25828
  CURSOR_TODO_STATUSES,
25599
- CURSOR_TOOL_REPLAY_DELAY_MS,
25600
25829
  DIFF_CONTEXT_LINES,
25601
25830
  EXTERNAL_SESSION_PREFIX,
25602
25831
  FLATTENED_RETRIABLE_PROVIDER_SUFFIX,
@@ -25619,7 +25848,6 @@ export {
25619
25848
  MAX_CURSOR_TASK_PROMPT_BYTES,
25620
25849
  MAX_CURSOR_TODOS,
25621
25850
  MAX_CURSOR_TODO_CANDIDATES,
25622
- MAX_CURSOR_TOOL_REPLAY_PROCESSES,
25623
25851
  MAX_CURSOR_TRANSCRIPT_HYDRATE_CHILDREN,
25624
25852
  MAX_DIFF_EDIT_DISTANCE,
25625
25853
  MAX_EVICTED_TOOL_CALL_IDS,
@@ -25628,7 +25856,6 @@ export {
25628
25856
  MAX_GROK_INTERJECTION_TEXT_BYTES,
25629
25857
  MAX_HISTORY_MESSAGE_IDS,
25630
25858
  MAX_LINE_BYTES,
25631
- MAX_LIVE_CURSOR_TOOL_REPLAYS_PER_TURN,
25632
25859
  MAX_MESSAGES,
25633
25860
  MAX_MESSAGE_TEXT_BYTES,
25634
25861
  MAX_MODEL_ID_BYTES,
@@ -25638,7 +25865,6 @@ export {
25638
25865
  MAX_PERSISTED_SESSION_CONFIG_BYTES,
25639
25866
  MAX_PERSISTED_STRUCTURED_BYTES,
25640
25867
  MAX_PROMPT_JOURNAL,
25641
- MAX_REPLAY_RECONCILE_TOOLS,
25642
25868
  MAX_RESUMABLE_SESSIONS,
25643
25869
  MAX_SESSIONS,
25644
25870
  MAX_SESSION_LIST_PAGES,
@@ -25680,9 +25906,7 @@ export {
25680
25906
  acpToolSourceStates,
25681
25907
  acpTurnTokenCount,
25682
25908
  activateSubagent,
25683
- activeCursorToolReplays,
25684
25909
  activeSessionReservations,
25685
- adjustActiveCursorToolReplays,
25686
25910
  adjustAnonymousSessionCreations,
25687
25911
  adoptAcpSession,
25688
25912
  agentRuntime,
@@ -25697,7 +25921,6 @@ export {
25697
25921
  applyCursorUpdateTodos,
25698
25922
  applyGrokInterjectionBroadcast,
25699
25923
  applyOriginPolicy,
25700
- applyReplayToolMetadata,
25701
25924
  applySessionUpdate,
25702
25925
  applySubagentFinished,
25703
25926
  applySubagentSpawned,
@@ -25718,13 +25941,11 @@ export {
25718
25941
  boundedString2 as boundedString,
25719
25942
  boundedToolArguments,
25720
25943
  bumpCursorDiscoveryRevision,
25721
- cancelCursorToolMetadataReconcile,
25722
25944
  catalogCache,
25723
25945
  catalogProbe,
25724
25946
  clearApprovals,
25725
25947
  clearInteractions,
25726
25948
  clientSessionKeys,
25727
- collectReplayToolMetadata,
25728
25949
  commitToolPartMutation,
25729
25950
  composerPatchFromSpawn,
25730
25951
  configuredAcpMcpServers,
@@ -25738,14 +25959,11 @@ export {
25738
25959
  currentCursorDiscoveryRevision,
25739
25960
  cursorSubagentTypeLabel,
25740
25961
  cursorTaskNamedState,
25741
- cursorToolReplayProcesses,
25742
- cursorToolReplayTargets,
25743
25962
  diffFileLines,
25744
25963
  dispatchAcpPrompt,
25745
25964
  emptySessionConfig,
25746
25965
  ensureAcpToolSource,
25747
25966
  ensureSessionProcess,
25748
- evictOldestReplayTool,
25749
25967
  executable,
25750
25968
  externalSessionToken,
25751
25969
  failAllActiveSubagents,
@@ -25762,7 +25980,6 @@ export {
25762
25980
  grokQuestionTimeoutMs,
25763
25981
  grokRunId,
25764
25982
  grokWrappedToolCall,
25765
- hasToolArguments,
25766
25983
  hostname,
25767
25984
  indexActiveSubagentsFromTranscript,
25768
25985
  isAcpTodosToolName,
@@ -25771,8 +25988,6 @@ export {
25771
25988
  isCursorTaskMethod,
25772
25989
  isCursorTodosToolName,
25773
25990
  isCursorUpdateTodosMethod,
25774
- isGenericCursorToolPart,
25775
- isGenericCursorToolTitle,
25776
25991
  isGrokTodoWriteToolName,
25777
25992
  isObject3 as isObject,
25778
25993
  isSettledToolPart,
@@ -25786,9 +26001,7 @@ export {
25786
26001
  listNormalizedModels,
25787
26002
  listResumableSessions,
25788
26003
  listResumableSessionsReserved,
25789
- liveCursorReplayBudgetExhausted,
25790
26004
  loadPersistedState,
25791
- makeReplayToolRoom,
25792
26005
  mapAcpToolState,
25793
26006
  markGrokInterjectionQueued,
25794
26007
  mcpConnectionKey,
@@ -25799,9 +26012,7 @@ export {
25799
26012
  normalizeBridgeMessage,
25800
26013
  normalizeBridgePart,
25801
26014
  normalizeBridgeToolDiff,
25802
- normalizedToolKind,
25803
26015
  omitActiveSpawnDuration,
25804
- orderedReplayTools,
25805
26016
  orkestratorToolPermissionOption,
25806
26017
  parkGrokElicitation,
25807
26018
  parkGrokInteraction,
@@ -25845,10 +26056,8 @@ export {
25845
26056
  pushToolPart,
25846
26057
  raceAbort,
25847
26058
  readJson,
25848
- reconcileCursorToolMetadata,
25849
26059
  reconcileStaleToolParts,
25850
26060
  recordCursorTaskPrompt,
25851
- recordCursorToolReplayRun,
25852
26061
  recordTurnUsage,
25853
26062
  rememberCatalog,
25854
26063
  rememberHistoryMessage,
@@ -25856,8 +26065,6 @@ export {
25856
26065
  rememberTrimmedToolCalls,
25857
26066
  renderAcpToolSource,
25858
26067
  renderDiffHunks,
25859
- replayOutputHash,
25860
- replayToolMetadataBytes,
25861
26068
  requestGrokInterjection,
25862
26069
  requestPathname,
25863
26070
  requestPromptWithRetriableProviderRetries,
@@ -25876,7 +26083,6 @@ export {
25876
26083
  route,
25877
26084
  safeDiffPath,
25878
26085
  saturatedText,
25879
- scheduleCursorToolMetadataReconcile,
25880
26086
  schedulePersist,
25881
26087
  scheduleStreamingPersist,
25882
26088
  sendJson,
@@ -25917,7 +26123,6 @@ export {
25917
26123
  toolCallLifecycle,
25918
26124
  toolCallLocationPath,
25919
26125
  toolPartAgentId,
25920
- transcriptToolParts,
25921
26126
  trimNoticePartId,
25922
26127
  trimPartsTo,
25923
26128
  trimmedToolCalls,