orkestrator 2.35.4-beta → 2.36.0

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.
@@ -13,7 +13,16 @@ var AGENT_MAIL_LOG_AREAS = defineLogAreas({
13
13
  "agent-mail": {
14
14
  description: "Delivering agent mail into waiting agent sessions.",
15
15
  events: {
16
- "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged."
16
+ "delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged.",
17
+ "drain.new-mail-failed": "Draining newly received mail failed; the next sweep delivers it.",
18
+ "presence.sync-failed": "Mailboxes could not be synchronized.",
19
+ "inject.verified": "An injected message's delivery was checked. Ids and decisions only.",
20
+ "inject.dispatched": "Messages were dispatched into a session. Ids and decisions only.",
21
+ "stopped-worker.action-failed": "Nothing could act on mail for a stopped worker.",
22
+ "coordinator.start-failed": "The main coordinator could not be started for a new message.",
23
+ "message.placed": "A message was placed in a mailbox. Ids and decisions only, never subjects or bodies.",
24
+ "budget.hold-notify-failed": "The coordinator could not be told about held worker mail.",
25
+ "budget.reset-failed": "The mail budget could not be reset for a prompted tab."
17
26
  }
18
27
  }
19
28
  });
@@ -35,6 +44,30 @@ var BACKEND_LOG_AREAS = defineLogAreas({
35
44
  "job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
36
45
  ...THROTTLE_LOG_EVENTS
37
46
  }
47
+ },
48
+ backend: {
49
+ description: "The backend process: startup, background notices and shutdown.",
50
+ events: {
51
+ starting: "The backend process is starting.",
52
+ "ssh-socket.resolved": "An SSH agent socket was found.",
53
+ "ssh-socket.missing": "No usable SSH agent socket was found.",
54
+ "standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
55
+ "instance.publish-failed": "The instance descriptor could not be published.",
56
+ "instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
57
+ "parent.exited": "The parent process exited, so local servers are shutting down.",
58
+ "startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
59
+ "startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
60
+ "startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
61
+ "startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
62
+ "startup.looped-review-pending": "Cleanup of the retired Looped Review stays pending.",
63
+ "notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
64
+ "artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
65
+ "shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
66
+ "shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
67
+ "shutdown.finished": "Shutdown finished, and the process exits with `code`.",
68
+ "port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
69
+ "port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
70
+ }
38
71
  }
39
72
  });
40
73
 
@@ -42,11 +75,12 @@ var BACKEND_LOG_AREAS = defineLogAreas({
42
75
  var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
43
76
  var BRIDGE_LOG_AREAS = defineLogAreas({
44
77
  "bridge.diagnostics": {
45
- description: "Metadata snapshots of bridge turns and processes, written while Save Logs for Debugging is on. docs/architecture/bridge-diagnostics.md reads them.",
78
+ description: "Metadata snapshots of bridge turns and processes: lifecycle, stalls and a keepalive at info, every minute at debug, and each change at trace. docs/architecture/bridge-diagnostics.md reads them.",
46
79
  tag: "bridge-diagnostics",
47
80
  maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
48
81
  events: {
49
- heartbeat: "The once-a-minute snapshot of a turn or process that is still open.",
82
+ heartbeat: "A periodic snapshot of an open turn or process: every minute at debug; at info only as stall evidence (a stall starting or clearing, a late timer, a change during a silent stall) or the ten-minute keepalive.",
83
+ change: "At trace only: a snapshot written as soon as the phase, the pending tools or a counter past its threshold changes.",
50
84
  "send-started": "A turn or process diagnostic scope began.",
51
85
  "send-resolved": "The provider accepted a dispatch.",
52
86
  "cancel-requested": "Cancellation of a turn was requested.",
@@ -127,6 +161,7 @@ var BRIDGE_LOG_AREAS = defineLogAreas({
127
161
  "session.created": "A session was created or recovered.",
128
162
  "session.delete-failed": "Deleting a session failed.",
129
163
  "session.fork-failed": "Forking a session failed.",
164
+ "session.policy-widening-refused": "A config request tried to widen a live session's execution policy and was refused; widened names the axes.",
130
165
  "session.rename-failed": "Renaming a session failed.",
131
166
  "session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
132
167
  "session.rewind-failed": "Rewinding session files failed.",
@@ -259,6 +294,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
259
294
  "backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
260
295
  "backend.start-failed": "The Local backend did not start; continuing with remote machines.",
261
296
  "clipboard.write-failed": "Writing text to the system clipboard failed.",
297
+ "dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
262
298
  "instance.already-running": "Another instance holds this data directory; this one will quit.",
263
299
  "main-thread.stalled": "A timer fired late, so windows, IPC and the stdout reader waited.",
264
300
  "quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
@@ -331,7 +367,8 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
331
367
  description: "Preparing the pinned agent toolchain at desktop startup.",
332
368
  events: {
333
369
  "bootstrap-progress.show-failed": "The toolchain progress window could not be shown.",
334
- "prepare.failed": "Preparing the pinned agent tools failed."
370
+ "prepare.failed": "Preparing the pinned agent tools failed.",
371
+ "prepare.ready": "The pinned agent tools were verified and activated; durationMs is how long startup waited."
335
372
  }
336
373
  },
337
374
  "artifact-host": {
@@ -345,7 +382,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
345
382
  // ../protocol/src/log-vocabulary/environment.ts
346
383
  var ENVIRONMENT_LOG_AREAS = defineLogAreas({
347
384
  environment: {
348
- description: "Environment naming, held setup and cleanup after deletion.",
385
+ description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
349
386
  events: {
350
387
  "cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
351
388
  "rename.failed": "Naming an environment from its pending prompt failed for the first time.",
@@ -354,6 +391,40 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
354
391
  "setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
355
392
  "setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
356
393
  "setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
394
+ "cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
395
+ "cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
396
+ "cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
397
+ "cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
398
+ "cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
399
+ "cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
400
+ "cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
401
+ "orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
402
+ "orphan-state.removed": "Orphaned environment state directories were removed.",
403
+ "orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
404
+ "orphan-canvas.removed": "Orphaned design canvases were removed.",
405
+ "orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
406
+ "orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
407
+ "stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
408
+ "stray-workspace.removed": "Stray workspace directories were removed.",
409
+ "stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
410
+ "temp-files.removed": "Abandoned temp files were removed.",
411
+ "status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
412
+ "status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
413
+ "setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
414
+ "setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
415
+ "lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
416
+ "tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
417
+ "tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
418
+ "orphan-session.reaped": "A native session no tab references was torn down.",
419
+ "handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
420
+ "delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
421
+ "delete.artifacts-left": "Graph run artifact directories were not removed.",
422
+ "delete.worktrees-kept": "Graph runs kept branch worktrees.",
423
+ "delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
424
+ "merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
425
+ "move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
426
+ "move.recovery-failed": "Recovering an interrupted environment move failed.",
427
+ "stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
357
428
  ...THROTTLE_LOG_EVENTS
358
429
  }
359
430
  }
@@ -362,10 +433,50 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
362
433
  // ../protocol/src/log-vocabulary/gateway.ts
363
434
  var GATEWAY_LOG_AREAS = defineLogAreas({
364
435
  gateway: {
365
- description: "The remote gateway other devices and browsers connect through.",
436
+ description: "The gateway other devices, browsers and the desktop connect through.",
366
437
  events: {
367
438
  "remote.start-failed": "The desktop could not start the remote gateway.",
368
- "remote.stop-failed": "The desktop could not stop the remote gateway cleanly."
439
+ "remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
440
+ disabled: "The gateway is disabled by its environment variable.",
441
+ "tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
442
+ "tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
443
+ "control.listening": "The backend control listener is up.",
444
+ "browser.listening": "The browser listener is up.",
445
+ "browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
446
+ "browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
447
+ "loopback.listening": "The loopback client listener is up.",
448
+ "loopback.unavailable": "The loopback client listener could not start.",
449
+ "auth-token.stored": "The gateway token's file was written. The path only, never the token.",
450
+ "auth-token.persist-failed": "The gateway token could not be saved.",
451
+ "port.fallback": "The preferred port was taken, so a nearby one is used.",
452
+ "port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
453
+ "request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
454
+ "websocket.upgrade-failed": "A WebSocket upgrade failed.",
455
+ "events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
456
+ "proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
457
+ "throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
458
+ "throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
459
+ "throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
460
+ }
461
+ },
462
+ "gateway.terminal": {
463
+ description: "The gateway's terminal WebSocket.",
464
+ events: {
465
+ "upgrade-rejected": "A terminal WebSocket upgrade was refused.",
466
+ "socket-error": "A terminal WebSocket reported an error.",
467
+ "subscription-failed": "A terminal subscription failed.",
468
+ "operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
469
+ }
470
+ },
471
+ "gateway.tailscale": {
472
+ description: "Tailscale Serve for desktop web access and a standalone backend.",
473
+ events: {
474
+ "web-access.disable-failed": "Desktop web access could not be turned off.",
475
+ "web-access.enable-failed": "Desktop web access could not be turned on.",
476
+ "web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
477
+ "web-access.reset-failed": "Desktop web access could not be reset.",
478
+ "startup.init-failed": "Desktop web access could not be initialized at startup.",
479
+ available: "Tailscale Serve is publishing the gateway."
369
480
  }
370
481
  }
371
482
  });
@@ -376,6 +487,18 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
376
487
  description: "Agent bridge processes the backend runs on the host.",
377
488
  events: {
378
489
  "bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
490
+ "bridge-runtime.installing": "A bridge runtime is being installed.",
491
+ "bridge-runtime.installed": "A bridge runtime finished installing.",
492
+ "opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
493
+ "server.stopping": "A local server is being stopped, for the fixed `reason` given.",
494
+ "reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
495
+ "reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
496
+ "reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
497
+ "reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
498
+ "reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
499
+ "reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
500
+ "reaper.server-reaping": "An orphaned server is being stopped.",
501
+ "reaper.server-kill-failed": "An orphaned server did not exit.",
379
502
  ...THROTTLE_LOG_EVENTS
380
503
  }
381
504
  }
@@ -417,7 +540,12 @@ var MODEL_LOG_AREAS = defineLogAreas({
417
540
  models: {
418
541
  description: "Agent model catalogues and their persistent caches.",
419
542
  events: {
420
- "cache.write-failed": "A successful catalogue refresh could not update the host cache."
543
+ "cache.write-failed": "A successful catalogue refresh could not update the host cache.",
544
+ "seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
545
+ "bridge.not-ready": "The first-use catalogue bridge did not become ready.",
546
+ "bridge.start-failed": "The first-use catalogue bridge failed to start.",
547
+ "probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
548
+ "download.deferred": "A model catalogue could not be downloaded yet."
421
549
  }
422
550
  }
423
551
  });
@@ -428,8 +556,62 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
428
556
  description: "Native agent sessions and what the backend reads from their bridges.",
429
557
  events: {
430
558
  "catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
559
+ "compact.instructions-ignored": "A bridge compacted without confirming the instructions sent with /compact: it predates them.",
560
+ "handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
561
+ "handoff.consume-failed": "A delivered handoff could not be marked consumed.",
562
+ "job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
563
+ "job.resend-queue-failed": "A resend could not be queued for a job.",
564
+ "interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
565
+ "interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
566
+ "human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
567
+ "question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
568
+ "activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
569
+ "activity.persist-failed": "An environment's activity could not be saved.",
570
+ "pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
571
+ "launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
572
+ "queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
573
+ "provider.retire-failed": "Retiring an obsolete provider failed.",
574
+ "workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
575
+ "catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
576
+ "dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
577
+ "coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
578
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
579
+ "interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
580
+ "resume.close-replaced-failed": "The session a resume replaced could not be closed.",
581
+ "sign-in.check-failed": "A turn could not be checked for a login refusal.",
582
+ "sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
583
+ "sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
584
+ "shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
585
+ "turn-recovery.failed": "Recovering an incomplete turn failed.",
586
+ "turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
587
+ "turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
588
+ "usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
589
+ "title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
431
590
  ...THROTTLE_LOG_EVENTS
432
591
  }
592
+ },
593
+ "native-agent.goal": {
594
+ description: "The /goal loop: advancing goals and their verifiers.",
595
+ events: {
596
+ "advance.failed": "A goal could not advance; the next sweep retries.",
597
+ "attention.record-failed": "Attention for a goal could not be recorded.",
598
+ "turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
599
+ "verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
600
+ "verifier.stop-failed": "An earlier verifier could not be stopped.",
601
+ "recover.failed": "Goals could not be recovered at startup."
602
+ }
603
+ },
604
+ "native-agent.opencode": {
605
+ description: "The OpenCode provider: its request monitor, retries and agent tools.",
606
+ events: {
607
+ "retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
608
+ "retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
609
+ "agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
610
+ "coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
611
+ "monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
612
+ "worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
613
+ "request.failed": "Handling a request event failed, so the stream restarts. Error class only."
614
+ }
433
615
  }
434
616
  });
435
617
 
@@ -452,6 +634,17 @@ var PREVIEW_LOG_AREAS = defineLogAreas({
452
634
  "partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
453
635
  "port-hints.persist-failed": "Preview port hints could not be saved.",
454
636
  "transport.close-failed": "A preview transport could not be closed.",
637
+ "ca-bundle.read-failed": "The upstream CA bundle could not be read.",
638
+ "publication.start-failed": "Private preview publication did not start.",
639
+ "publication.reconfigure-failed": "Preview publication could not be reconfigured.",
640
+ "publication.listening": "Private preview origins are listening.",
641
+ "certificate.reloaded": "The preview certificate was reloaded.",
642
+ "access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
643
+ "registry.invalid-definition": "An invalid stored preview service definition was ignored.",
644
+ "registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
645
+ "registry.resolver-failed": "A preview resolver failed. Error class only.",
646
+ "registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
647
+ "registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
455
648
  ...THROTTLE_LOG_EVENTS
456
649
  }
457
650
  }
@@ -470,9 +663,33 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
470
663
  // ../protocol/src/log-vocabulary/terminal.ts
471
664
  var TERMINAL_LOG_AREAS = defineLogAreas({
472
665
  terminal: {
473
- description: "The renderer's terminal. Its lines stay in the browser console, never the saved log.",
666
+ description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
474
667
  events: {
475
668
  "input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
669
+ "orphan.reaped": "A terminal no tab references was closed.",
670
+ "agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
671
+ "activity.record-failed": "Terminal environment activity could not be recorded.",
672
+ "pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
673
+ "pty.exit-notify-failed": "Notifying a terminal's exit failed.",
674
+ "pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
675
+ "setup.pty-reused": "A setup terminal reused its existing PTY.",
676
+ "setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
677
+ "setup.pty-spawned": "A setup terminal's PTY started.",
678
+ "setup.pty-exited": "A setup terminal's PTY exited.",
679
+ "setup.preparing": "Workspace preparation started in the setup terminal.",
680
+ "setup.session-creating": "A setup session is being created.",
681
+ "setup.intro-emitted": "The setup intro was written to the terminal.",
682
+ "setup.completed": "Setup finished.",
683
+ "setup.failed": "Setup failed.",
684
+ "setup.already-complete": "Setup was requested but had already finished.",
685
+ "setup.renderer-ensured": "The renderer asked for setup to be running.",
686
+ "setup.renderer-requested": "The renderer asked for the setup session.",
687
+ "setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
688
+ "setup.no-commands": "An environment has no setup commands to run.",
689
+ "setup.already-running": "Setup was requested while it was already running.",
690
+ "setup.held-for-approval": "Setup is held until its commands are approved.",
691
+ "setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
692
+ "setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
476
693
  "input.resume-failed": "Asking the backend to resume refused terminal input failed.",
477
694
  "input.write-failed": "Writing input to a terminal session threw.",
478
695
  "listener.remove-failed": "Removing a terminal output listener threw.",
@@ -572,13 +789,41 @@ var TERMINAL_LOG_AREAS = defineLogAreas({
572
789
  // ../protocol/src/log-vocabulary/tmux.ts
573
790
  var TMUX_LOG_AREAS = defineLogAreas({
574
791
  tmux: {
575
- description: "The poll loop behind a Claude tmux tab.",
792
+ description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
576
793
  events: {
577
794
  "poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
578
795
  "poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
579
796
  "poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
580
797
  "poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
581
798
  "poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
799
+ "cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
800
+ "cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
801
+ "cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
802
+ "cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
803
+ "hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
804
+ "hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
805
+ "naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
806
+ "orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
807
+ "orphan.reaped": "A tmux session no tab references was killed.",
808
+ "orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
809
+ "cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
810
+ "cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
811
+ "cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
812
+ "interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
813
+ "signal.arm-failed": "The Claude state signal could not be armed.",
814
+ "signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
815
+ "hook-signal.arm-failed": "The tmux hook doorbell could not be armed.",
816
+ "hook-signal.degraded": "The tmux hook doorbell missed a hook, so idle tabs poll every second until it is re-armed.",
817
+ "pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
818
+ "pr-probe.failed": "Probing for a pull request an agent created failed.",
819
+ "activity.persist-failed": "Tmux tab activity could not be saved.",
820
+ "fast-mode.persist-failed": "The launch fast mode could not be saved.",
821
+ "fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
822
+ "pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
823
+ "turn.failure-record-failed": "A failed turn could not be recorded.",
824
+ "slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
825
+ "queue.failing": "A tmux prompt queue keeps failing to dispatch.",
826
+ "queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
582
827
  ...THROTTLE_LOG_EVENTS
583
828
  }
584
829
  }
@@ -605,7 +850,8 @@ var UPDATER_LOG_AREAS = defineLogAreas({
605
850
  "remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
606
851
  "restart-prompt.failed": "The restart prompt for a downloaded update failed.",
607
852
  unavailable: "Auto-update could not be set up in this session.",
608
- "update.failed": "electron-updater reported an update error."
853
+ "update.failed": "electron-updater reported an update error.",
854
+ "standalone.restarting": "A standalone backend is restarting into a new version."
609
855
  }
610
856
  }
611
857
  });
@@ -616,11 +862,473 @@ var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
616
862
  description: "Web annotation requests and their background reconciler.",
617
863
  events: {
618
864
  "reconcile.failed": "A background reconcile pass failed; the next one retries.",
865
+ "legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
866
+ "legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
867
+ "legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
868
+ "legacy.unavailable": "Legacy annotation storage could not be read.",
869
+ "legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
870
+ "legacy.archive-failed": "Imported legacy annotation files could not be archived.",
871
+ "legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
872
+ "migration.draft-failed": "Migrating one draft failed.",
873
+ "draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
874
+ "request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
875
+ "evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
876
+ "queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
877
+ "request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
878
+ "turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
879
+ "gc.failed": "Annotation garbage collection failed; the next pass retries.",
880
+ "record.unavailable": "An annotation record is unavailable; written once per record.",
881
+ "storage.unavailable": "An environment's annotation store is unreadable.",
882
+ "change-hint.listener-failed": "A change hint listener threw.",
883
+ "orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
884
+ "storage.load-failed": "An environment's annotation storage could not be loaded.",
619
885
  ...THROTTLE_LOG_EVENTS
620
886
  }
621
887
  }
622
888
  });
623
889
 
890
+ // ../protocol/src/log-vocabulary/storage.ts
891
+ var STORAGE_LOG_AREAS = defineLogAreas({
892
+ storage: {
893
+ description: "The SQLite-backed stores, their snapshots and imports from older formats.",
894
+ events: {
895
+ "usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
896
+ "snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
897
+ "snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
898
+ "snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
899
+ "listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
900
+ "listener.change-failed": "A resource change listener threw; the committed mutation stands.",
901
+ "kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
902
+ "nodes.entries-dropped": "Unreadable node registry entries were ignored.",
903
+ "preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
904
+ "machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
905
+ "permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
906
+ "retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
907
+ "handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
908
+ "desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
909
+ "legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
910
+ "legacy-json.archive-failed": "Imported JSON store files could not be archived."
911
+ }
912
+ }
913
+ });
914
+
915
+ // ../protocol/src/log-vocabulary/build-pipeline.ts
916
+ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
917
+ "build-pipeline": {
918
+ description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
919
+ events: {
920
+ "sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
921
+ "sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
922
+ "result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
923
+ "consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
924
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
925
+ "interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
926
+ "transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
927
+ "transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
928
+ "restore.skipped": "A pipeline could not be restored at startup and was skipped.",
929
+ "criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
930
+ "workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
931
+ "rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
932
+ "kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
933
+ "usage.read-failed": "Reading a stage session's token usage failed.",
934
+ "checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
935
+ "checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
936
+ "legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
937
+ }
938
+ }
939
+ });
940
+
941
+ // ../protocol/src/log-vocabulary/agent-branch.ts
942
+ var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
943
+ "agent-branch": {
944
+ description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
945
+ events: {
946
+ "observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
947
+ "transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
948
+ "usage.read-failed": "Reading a reviewer's token usage failed.",
949
+ "result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
950
+ "dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
951
+ "result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
952
+ }
953
+ }
954
+ });
955
+
956
+ // ../protocol/src/log-vocabulary/change-tracking.ts
957
+ var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
958
+ "change-tracking": {
959
+ description: "Change tracking: turn capture, evidence pulls and measurements.",
960
+ events: {
961
+ "journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
962
+ "projection.failed": "Projecting a change event onto its environment failed.",
963
+ "startup.reconcile-failed": "Reconciling change tracking at startup failed.",
964
+ "turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
965
+ "dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
966
+ "turn.finalize-failed": "Finalizing a turn failed.",
967
+ "turn.settle-failed": "Settling a late interrupted turn failed.",
968
+ "evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
969
+ "measurement.failed": "Recomputing a tool's measurement failed."
970
+ }
971
+ },
972
+ "diff-stats": {
973
+ description: "Environment diff stats and the worktree signals that drive them.",
974
+ events: {
975
+ "baseline.update-failed": "An environment's diff baseline could not be updated.",
976
+ "scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
977
+ "scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
978
+ "scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
979
+ "scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
980
+ "emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
981
+ "emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
982
+ "signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
983
+ }
984
+ }
985
+ });
986
+
987
+ // ../protocol/src/log-vocabulary/coordinator.ts
988
+ var COORDINATOR_LOG_AREAS = defineLogAreas({
989
+ coordinator: {
990
+ description: "Coordinators: delegations, status wakes and their store.",
991
+ events: {
992
+ "delegation.open-failed": "A delegation could not be opened; `source` says for what.",
993
+ "deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
994
+ "mail.move-failed": "Mail could not move to the new main coordinator.",
995
+ "work.move-failed": "Work could not move to the main coordinator.",
996
+ "wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
997
+ "wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
998
+ "wake.observe-feature-plan-failed": "A feature plan could not be observed for status wakes.",
999
+ "wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
1000
+ "wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
1001
+ "wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
1002
+ "wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
1003
+ "wake.waiting-report-failed": "A waiting worker could not be reported.",
1004
+ "wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
1005
+ "store.malformed": "The coordinator store was malformed and is treated as empty.",
1006
+ "store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
1007
+ "store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
1008
+ "store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
1009
+ "store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
1010
+ "remote-worker.settle-failed": "A remote worker could not be settled.",
1011
+ "checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
1012
+ "checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
1013
+ "checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded, or `outcome` says why not (`timed-out`, `failed`).",
1014
+ "checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway."
1015
+ }
1016
+ }
1017
+ });
1018
+
1019
+ // ../protocol/src/log-vocabulary/review.ts
1020
+ var REVIEW_LOG_AREAS = defineLogAreas({
1021
+ review: {
1022
+ description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
1023
+ events: {
1024
+ "fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
1025
+ "graph-run.not-started": "A workflow's graph run did not start.",
1026
+ "reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
1027
+ "graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
1028
+ "graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
1029
+ "delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
1030
+ "fix-session.read-failed": "Reading an interactive fix session's state failed.",
1031
+ "fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
1032
+ "fix-usage.read-failed": "Reading a fix session's token usage failed.",
1033
+ "result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
1034
+ "failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
1035
+ }
1036
+ },
1037
+ "pull-request": {
1038
+ description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
1039
+ events: {
1040
+ "merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
1041
+ "refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
1042
+ "arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
1043
+ "gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
1044
+ "monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
1045
+ "cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
1046
+ "checkout.follow-merge-lookup-failed": "A merged pull request's project could not be read, so its checkout was not fast-forwarded.",
1047
+ "auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
1048
+ "auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
1049
+ "auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
1050
+ "monitor.detection-failed": "Checking an environment for its pull request failed.",
1051
+ "monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
1052
+ "monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
1053
+ "monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
1054
+ "monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
1055
+ "monitor.state-persist-failed": "A pull request's observed state could not be saved.",
1056
+ "monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
1057
+ "monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
1058
+ "monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
1059
+ "monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
1060
+ }
1061
+ }
1062
+ });
1063
+
1064
+ // ../protocol/src/log-vocabulary/public-api.ts
1065
+ var PUBLIC_API_LOG_AREAS = defineLogAreas({
1066
+ "public-api": {
1067
+ description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
1068
+ events: {
1069
+ "outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
1070
+ "goal-checks.stop-failed": "Goal checks could not be stopped.",
1071
+ "exec.list-failed": "Exec workers could not be listed.",
1072
+ "exec.cancel-failed": "An exec could not be cancelled.",
1073
+ "goal-workers.list-failed": "Goal check workers could not be listed.",
1074
+ "operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
1075
+ "reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
1076
+ }
1077
+ }
1078
+ });
1079
+
1080
+ // ../protocol/src/log-vocabulary/agent-accounts.ts
1081
+ var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
1082
+ "agent-accounts": {
1083
+ description: "Agent accounts: automatic switching, staged logins and plan usage.",
1084
+ events: {
1085
+ "switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
1086
+ "auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
1087
+ "container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
1088
+ "last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
1089
+ "login-cleanup.failed": "A temporary login could not be cleaned up.",
1090
+ "login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
1091
+ "login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
1092
+ "login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
1093
+ }
1094
+ }
1095
+ });
1096
+
1097
+ // ../protocol/src/log-vocabulary/docker.ts
1098
+ var DOCKER_LOG_AREAS = defineLogAreas({
1099
+ docker: {
1100
+ description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
1101
+ events: {
1102
+ "portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
1103
+ "project-seed.refused": "A project .env, .env.local or opencode.json was not copied into a new container: a link, not a regular file, outside the project, too large or unreadable.",
1104
+ "opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
1105
+ "lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
1106
+ "login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
1107
+ "login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
1108
+ "login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
1109
+ "login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
1110
+ "login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
1111
+ "lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
1112
+ "lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
1113
+ "replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
1114
+ "recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
1115
+ "github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
1116
+ "availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
1117
+ "start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
1118
+ }
1119
+ },
1120
+ "docker.reachability": {
1121
+ description: "Whether agents in containers can reach the backend's agent tools server.",
1122
+ events: {
1123
+ "check.crashed": "A reachability check crashed.",
1124
+ "check.started": "A reachability check started.",
1125
+ "check.finished": "A reachability check finished.",
1126
+ "check.probe": "One probe of a finished check.",
1127
+ "check.summary": "Content-free status and reason for a check that did not find the host reachable.",
1128
+ "check.remediation": "One command the user can run to unblock containers.",
1129
+ "shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
1130
+ "shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
1131
+ "shutdown.removing-resources": "Shutdown is removing probe resources.",
1132
+ "shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
1133
+ "shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
1134
+ "probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
1135
+ "preflight.refused": "A stage was refused because its container cannot reach the host.",
1136
+ "probe.prepare-failed": "A container could not be prepared for a probe.",
1137
+ "probe.result": "The outcome of probing one container.",
1138
+ "probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
1139
+ "topology.detected": "The Docker topology was read.",
1140
+ "firewall.detected": "The host firewall was read.",
1141
+ "probe-network.remove-failed": "The probe network could not be removed.",
1142
+ "probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
1143
+ "event.emit-failed": "A reachability event could not be emitted.",
1144
+ "host-addresses.list-failed": "Host addresses could not be listed.",
1145
+ "probe-image.present": "The probe image is already present.",
1146
+ "probe-image.pulling": "The probe image is being pulled.",
1147
+ "probe-image.pulled": "The probe image was pulled.",
1148
+ "probe-image.pull-failed": "The probe image could not be pulled.",
1149
+ "probe-image.fallback": "The environment image is used as the probe image.",
1150
+ "probe-image.missing": "No probe image is available.",
1151
+ "network.list-failed": "Docker networks could not be listed.",
1152
+ "network.inspect-failed": "A Docker network could not be inspected.",
1153
+ "stale-containers.removing": "Stale probe containers are being removed.",
1154
+ "stale-networks.removing": "Stale probe networks are being removed."
1155
+ }
1156
+ }
1157
+ });
1158
+
1159
+ // ../protocol/src/log-vocabulary/mcp.ts
1160
+ var MCP_LOG_AREAS = defineLogAreas({
1161
+ "control-mcp": {
1162
+ description: "The Control MCP server other agents and devices reach Orkestrator through.",
1163
+ events: {
1164
+ "listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
1165
+ "state-listener.failed": "A Control MCP state listener threw; the others still run.",
1166
+ "delegation.remote-open-failed": "A delegation could not be opened on another node.",
1167
+ "delegation.open-failed": "A coordinator delegation could not be opened."
1168
+ }
1169
+ },
1170
+ "mcp-management": {
1171
+ description: "Managed MCP configuration: its commands, overlays and apply loop.",
1172
+ events: {
1173
+ "command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
1174
+ "overlay.materialise-failed": "An MCP overlay could not be written.",
1175
+ "apply.tick-failed": "An MCP apply tick failed; the next one retries."
1176
+ }
1177
+ }
1178
+ });
1179
+
1180
+ // ../protocol/src/log-vocabulary/design.ts
1181
+ var DESIGN_LOG_AREAS = defineLogAreas({
1182
+ design: {
1183
+ description: "The design canvas: its library, renderer and session links.",
1184
+ events: {
1185
+ "change-signal.failed": "A design change signal failed.",
1186
+ "library.index-write-failed": "The design library index could not be written.",
1187
+ "library.refresh-failed": "The design library could not be refreshed.",
1188
+ "renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
1189
+ "task.failed": "A design background task failed.",
1190
+ "canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
1191
+ "startup.step-failed": "One part of design startup failed; `step` says which.",
1192
+ "legacy.retire-failed": "A migrated legacy design could not be retired.",
1193
+ "profiles.swept": "Design startup removed stale browser profiles.",
1194
+ "session-link.record-failed": "A closing conversation could not be recorded on a design link."
1195
+ }
1196
+ }
1197
+ });
1198
+
1199
+ // ../protocol/src/log-vocabulary/graph.ts
1200
+ var GRAPH_LOG_AREAS = defineLogAreas({
1201
+ graph: {
1202
+ description: "Graph runs: launches, passes, rewinds, system actions and templates.",
1203
+ events: {
1204
+ "describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
1205
+ "system.stop-failed": "A system action's work could not be stopped.",
1206
+ "system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
1207
+ "attention.update-failed": "The sidebar could not be updated for a run.",
1208
+ "launch.ticket-link-failed": "A launched run's ticket could not be linked.",
1209
+ "launch.started": "A graph run was launched.",
1210
+ "launch.swept": "Runs that ended without an environment were removed.",
1211
+ "rewind.pending": "A run's code rewind has not finished.",
1212
+ "rewind.applied": "A run was restarted or rewound.",
1213
+ "rewind.waiting": "A run waits for its code rewind to finish.",
1214
+ "history.pruned": "Finished runs beyond an environment's history were removed.",
1215
+ "history.prune-failed": "Pruning an environment's run history failed.",
1216
+ "worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
1217
+ "run.unreadable": "A run is unreadable, so it is not scheduled.",
1218
+ "run.pass-failed": "A pass over a run failed.",
1219
+ "transcript.capture-failed": "A run's transcript capture failed.",
1220
+ "ticket.link-failed": "A run's ticket could not be linked to its environment.",
1221
+ "template.skipped": "A built-in template was skipped as invalid or a duplicate."
1222
+ }
1223
+ }
1224
+ });
1225
+
1226
+ // ../protocol/src/log-vocabulary/nodes.ts
1227
+ var NODES_LOG_AREAS = defineLogAreas({
1228
+ nodes: {
1229
+ description: "Command nodes: links, handovers, leaf mail, ticket sync and project copies.",
1230
+ events: {
1231
+ "actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
1232
+ "project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
1233
+ "mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
1234
+ "command.post-step-failed": "A step after a routed command failed.",
1235
+ "seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
1236
+ "contact.record-failed": "The latest controller contact could not be recorded.",
1237
+ "settings.send-failed": "Settings could not be sent to a node.",
1238
+ "verification.record-failed": "A node verification could not be recorded.",
1239
+ "profile.record-failed": "A node profile could not be recorded.",
1240
+ "detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
1241
+ "handover.recovery-pending": "Command handover recovery is still pending.",
1242
+ "ticket-sync.work-record-failed": "A remote build started but its ticket work location could not be saved.",
1243
+ "ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
1244
+ "ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
1245
+ "ticket-sync.forget-failed": "A detached command node's ticket copies could not be released."
1246
+ }
1247
+ }
1248
+ });
1249
+
1250
+ // ../protocol/src/log-vocabulary/linear.ts
1251
+ var LINEAR_LOG_AREAS = defineLogAreas({
1252
+ linear: {
1253
+ description: "Linear issues read for build actions.",
1254
+ events: {
1255
+ "comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
1256
+ }
1257
+ }
1258
+ });
1259
+
1260
+ // ../protocol/src/log-vocabulary/usage-history.ts
1261
+ var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
1262
+ "usage-history": {
1263
+ description: "Recorded agent token usage.",
1264
+ events: {
1265
+ "record.failed": "Agent usage could not be recorded; a later read counts it.",
1266
+ "prune.failed": "Pruning recorded usage failed; the next prune retries."
1267
+ }
1268
+ }
1269
+ });
1270
+
1271
+ // ../protocol/src/log-vocabulary/feature.ts
1272
+ var FEATURE_LOG_AREAS = defineLogAreas({
1273
+ feature: {
1274
+ description: "Pipeline environments started from a feature, and feature planning.",
1275
+ events: {
1276
+ "naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
1277
+ "planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
1278
+ "planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
1279
+ }
1280
+ }
1281
+ });
1282
+
1283
+ // ../protocol/src/log-vocabulary/host.ts
1284
+ var HOST_LOG_AREAS = defineLogAreas({
1285
+ host: {
1286
+ description: "The host machine: its executables, load, suspends and maintenance.",
1287
+ events: {
1288
+ "path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
1289
+ "tool.available": "A host tool's availability was read.",
1290
+ "tool.missing": "A host tool was not found.",
1291
+ "maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
1292
+ "suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
1293
+ "load.sample-failed": "Sampling machine load failed; the next sample retries."
1294
+ }
1295
+ }
1296
+ });
1297
+
1298
+ // ../protocol/src/log-vocabulary/transcript-artifacts.ts
1299
+ var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
1300
+ "transcript-artifacts": {
1301
+ description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
1302
+ events: {
1303
+ "announce-failed": "An artifact change could not be announced.",
1304
+ "cleanup-failed": "An artifact cleanup failed.",
1305
+ "grant-revocation-failed": "A grant could not be revoked.",
1306
+ "ledger-listener-failed": "A ledger listener threw.",
1307
+ "ledger-read-failed": "The ledger could not be read.",
1308
+ "operation-executor-failed": "A preview operation's executor failed.",
1309
+ "operation-failed": "A preview operation failed.",
1310
+ "pdf-preview": "A PDF preview was served.",
1311
+ "pdf-preview-failed": "A PDF preview failed.",
1312
+ "pdf-print-failed": "Printing an artifact to PDF failed.",
1313
+ "pdf-printed": "An artifact was printed to PDF.",
1314
+ "runtime-unavailable": "The artifact runtime could not be created."
1315
+ }
1316
+ }
1317
+ });
1318
+
1319
+ // ../protocol/src/log-vocabulary/scheduler.ts
1320
+ var SCHEDULER_LOG_AREAS = defineLogAreas({
1321
+ scheduler: {
1322
+ description: "Scheduled jobs and the backend-owned timing that fires them.",
1323
+ events: {
1324
+ "tick.failed": "A scheduler tick failed; the next tick retries.",
1325
+ "job.claim-failed": "A due job could not be claimed.",
1326
+ "fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
1327
+ "fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
1328
+ }
1329
+ }
1330
+ });
1331
+
624
1332
  // ../protocol/src/log-vocabulary/web-app.ts
625
1333
  var WEB_APP_LOG_AREAS = defineLogAreas({
626
1334
  "web.app": {
@@ -788,7 +1496,7 @@ var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
788
1496
  "models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
789
1497
  "models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
790
1498
  "github-credential.check-failed": "The GitHub credential check before creating failed.",
791
- "feature-build.start-failed": "Starting a feature build from the dialog failed.",
1499
+ "feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
792
1500
  "settings.extensions-load-failed": "The settings dialog could not load extensions.",
793
1501
  "settings.container-reset-failed": "The settings dialog could not reset the container.",
794
1502
  "settings.save-failed": "The settings dialog could not save.",
@@ -1080,6 +1788,25 @@ var LOG_VOCABULARY = {
1080
1788
  ...TMUX_LOG_AREAS,
1081
1789
  ...UPDATER_LOG_AREAS,
1082
1790
  ...WEB_ANNOTATIONS_LOG_AREAS,
1791
+ ...STORAGE_LOG_AREAS,
1792
+ ...BUILD_PIPELINE_LOG_AREAS,
1793
+ ...AGENT_BRANCH_LOG_AREAS,
1794
+ ...CHANGE_TRACKING_LOG_AREAS,
1795
+ ...COORDINATOR_LOG_AREAS,
1796
+ ...REVIEW_LOG_AREAS,
1797
+ ...PUBLIC_API_LOG_AREAS,
1798
+ ...AGENT_ACCOUNTS_LOG_AREAS,
1799
+ ...DOCKER_LOG_AREAS,
1800
+ ...MCP_LOG_AREAS,
1801
+ ...DESIGN_LOG_AREAS,
1802
+ ...GRAPH_LOG_AREAS,
1803
+ ...NODES_LOG_AREAS,
1804
+ ...LINEAR_LOG_AREAS,
1805
+ ...USAGE_HISTORY_LOG_AREAS,
1806
+ ...FEATURE_LOG_AREAS,
1807
+ ...HOST_LOG_AREAS,
1808
+ ...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
1809
+ ...SCHEDULER_LOG_AREAS,
1083
1810
  ...WEB_APP_LOG_AREAS,
1084
1811
  ...WEB_BUILD_PIPELINE_LOG_AREAS,
1085
1812
  ...WEB_CHAT_LOG_AREAS,
@@ -1098,7 +1825,7 @@ var LOG_VOCABULARY = {
1098
1825
  // ../protocol/src/secret-redaction.ts
1099
1826
  var TEXT_RULES = [
1100
1827
  {
1101
- pattern: /([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
1828
+ pattern: /(?<![a-z0-9+.-])([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
1102
1829
  replacement: "$1[redacted]@"
1103
1830
  },
1104
1831
  {
@@ -1118,7 +1845,7 @@ var TEXT_RULES = [
1118
1845
  { pattern: /\bAKIA[0-9A-Z]{12,}/g, replacement: "[redacted]" },
1119
1846
  { pattern: /\bAIza[0-9A-Za-z_-]{20,}/g, replacement: "[redacted]" },
1120
1847
  {
1121
- pattern: /\b((?:[A-Za-z0-9]+[_-])*(?:api[_-]?key|apikey|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|secret|client[_-]?secret|password|passwd|passphrase|authorization))("?\s*[:=]\s*)("?)(?!Bearer\b|Basic\b|\[redacted\])[^\s"',;)&]{6,}\3/gi,
1848
+ pattern: /(?<![A-Za-z0-9_-])(-*\b(?:[A-Za-z0-9]+[_-])*(?:api[_-]?key|apikey|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|secret|client[_-]?secret|password|passwd|passphrase|authorization))("?\s*[:=]\s*)("?)(?!Bearer\b|Basic\b|\[redacted\])[^\s"',;)&]{6,}\3/gi,
1122
1849
  replacement: "$1$2[redacted]"
1123
1850
  }
1124
1851
  ];
@@ -1202,8 +1929,10 @@ function stackFrames(target, message) {
1202
1929
  `).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText(relativeFrame(line), MAX_FRAME_CHARS));
1203
1930
  return frames.length > 0 ? frames : undefined;
1204
1931
  }
1205
- function describe(error, includeStack, depth) {
1932
+ function describe(error, includeStack, includeMessage, depth) {
1206
1933
  if (typeof error !== "object" || error === null) {
1934
+ if (!includeMessage)
1935
+ return { name: "NonError" };
1207
1936
  return {
1208
1937
  name: "NonError",
1209
1938
  message: typeof error === "string" ? boundedText(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
@@ -1220,7 +1949,7 @@ function describe(error, includeStack, depth) {
1220
1949
  const details = { name };
1221
1950
  if (commandFailure)
1222
1951
  details.outputOmitted = true;
1223
- else if (message)
1952
+ else if (message && includeMessage)
1224
1953
  details.message = boundedText(message, MAX_MESSAGE_CHARS);
1225
1954
  const code = read(error, "code");
1226
1955
  const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
@@ -1248,13 +1977,13 @@ function describe(error, includeStack, depth) {
1248
1977
  details.errorCount = members.length;
1249
1978
  const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
1250
1979
  if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
1251
- details.cause = describe(cause, false, depth + 1);
1980
+ details.cause = describe(cause, false, includeMessage, depth + 1);
1252
1981
  }
1253
1982
  return details;
1254
1983
  }
1255
1984
  function formatLogError(error, options = {}) {
1256
1985
  try {
1257
- return brand(describe(error, options.stack !== false, 0));
1986
+ return brand(describe(error, options.stack !== false, options.message !== false, 0));
1258
1987
  } catch {
1259
1988
  return brand({ name: "Error", message: "[unreadable]" });
1260
1989
  }
@@ -1433,7 +2162,10 @@ function deliver(record) {
1433
2162
  line: config.format === "json" ? renderJson(record) : renderText(record),
1434
2163
  record
1435
2164
  });
1436
- } catch {}
2165
+ return true;
2166
+ } catch {
2167
+ return false;
2168
+ }
1437
2169
  }
1438
2170
  function buildRecord(level, area, event, fields) {
1439
2171
  const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
@@ -1589,6 +2321,19 @@ function resolveFields(fields) {
1589
2321
  return { fieldsFailed: true };
1590
2322
  }
1591
2323
  }
2324
+ function deliverEvent(level, area, event, fields) {
2325
+ const spec = areaSpec(area);
2326
+ if (!spec)
2327
+ return deliver(buildRecord(level, "logging", "unknown-area", undefined));
2328
+ if (!Object.hasOwn(spec.events, event))
2329
+ return deliver(buildRecord(level, area, "invalid-event", undefined));
2330
+ return deliver(buildRecord(level, area, event, fields));
2331
+ }
2332
+ function tryWriteLog(level, area, event, fields) {
2333
+ if (LEVEL_RANK[level] > thresholdRank(area))
2334
+ return false;
2335
+ return deliverEvent(level, area, event, resolveFields(fields));
2336
+ }
1592
2337
  function createLogger(area) {
1593
2338
  const spec = areaSpec(area);
1594
2339
  let seenGeneration = -1;
@@ -1601,13 +2346,7 @@ function createLogger(area) {
1601
2346
  return LEVEL_RANK[level] <= rank;
1602
2347
  };
1603
2348
  const writeResolved = (level, event, resolved) => {
1604
- if (!spec) {
1605
- deliver(buildRecord(level, "logging", "unknown-area", undefined));
1606
- } else if (Object.hasOwn(spec.events, event)) {
1607
- deliver(buildRecord(level, area, event, resolved));
1608
- } else {
1609
- deliver(buildRecord(level, area, "invalid-event", undefined));
1610
- }
2349
+ deliverEvent(level, area, event, resolved);
1611
2350
  };
1612
2351
  const write = (level, event, fields) => {
1613
2352
  if (!enabled(level))
@@ -1782,8 +2521,19 @@ function applyLogDetail(detail, env = process.env) {
1782
2521
 
1783
2522
  // ../protocol/src/node/bridge-diagnostics.ts
1784
2523
  import { createHash } from "node:crypto";
1785
- var log = createLogger("bridge.diagnostics");
1786
- var INTERVAL_MS = 60000;
2524
+
2525
+ // ../protocol/src/event-loop-stall-monitor.ts
2526
+ var log = createLogger("event-loop");
2527
+ var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
2528
+
2529
+ // ../protocol/src/node/bridge-diagnostics.ts
2530
+ var log2 = createLogger("bridge.diagnostics");
2531
+ var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
2532
+ var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
2533
+ var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
2534
+ var STALL_TOOL_PENDING_MS = 10 * 60000;
2535
+ var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
2536
+ var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
1787
2537
  var MAX_PENDING_TOOLS = 128;
1788
2538
  var MAX_REPORTED_TOOLS = 8;
1789
2539
  var MAX_ID_LENGTH = 1024;
@@ -1844,6 +2594,28 @@ var UPDATE_KINDS = new Set([
1844
2594
  "step-started",
1845
2595
  "step-completed"
1846
2596
  ]);
2597
+ var COUNTER_CHANGE_THRESHOLDS = {
2598
+ stderrBytes: 4096,
2599
+ requestsSent: 1,
2600
+ responsesReceived: 1,
2601
+ timeouts: 1,
2602
+ notificationsReceived: Number.POSITIVE_INFINITY,
2603
+ protocolErrors: 1
2604
+ };
2605
+ var WAITING_PHASES = new Set([
2606
+ "sending",
2607
+ "following",
2608
+ "draining",
2609
+ "cancelling"
2610
+ ]);
2611
+ function sameSet(a, b) {
2612
+ if (a.size !== b.size)
2613
+ return false;
2614
+ for (const value of a)
2615
+ if (!b.has(value))
2616
+ return false;
2617
+ return true;
2618
+ }
1847
2619
  function identity(value) {
1848
2620
  if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
1849
2621
  return;
@@ -1854,9 +2626,6 @@ function readBridgeDebugFlag(value) {
1854
2626
  }
1855
2627
  var liveDiagnostics;
1856
2628
  var liveScopes = new Set;
1857
- function liveBridgeDiagnostics() {
1858
- return liveDiagnostics;
1859
- }
1860
2629
  function setLiveBridgeDiagnostics(enabled) {
1861
2630
  liveDiagnostics = enabled;
1862
2631
  for (const scope of Array.from(liveScopes))
@@ -1922,26 +2691,35 @@ function safeDiagnosticMetrics(value) {
1922
2691
  result.state = value.state;
1923
2692
  return result;
1924
2693
  }
2694
+ function bridgeDiagnosticsChangesEnabled() {
2695
+ return log2.isEnabled("trace");
2696
+ }
1925
2697
  function writeBridgeDiagnostic({ bridge, event, payload }) {
1926
- log.info(event, { bridge, payload });
2698
+ return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
1927
2699
  }
1928
2700
  function bridgeDiagnosticsActive() {
1929
- return log.isEnabled("info");
2701
+ return log2.isEnabled("info");
2702
+ }
2703
+ function bridgeDiagnosticsStreamEnabled(bridge) {
2704
+ return bridgeDebugEnabled(bridge) || log2.isEnabled("debug");
1930
2705
  }
1931
2706
  function writeDiagnostic(bridge, event, payload, write) {
1932
2707
  try {
1933
2708
  const json = JSON.stringify({ bridge, event, ...payload });
1934
2709
  const bytes = Buffer.byteLength(json);
1935
2710
  if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
1936
- write({ bridge, event, payload: json });
1937
- return;
2711
+ const accepted = write({ bridge, event, payload: json });
2712
+ return accepted !== false;
1938
2713
  }
1939
- write({
2714
+ const accepted = write({
1940
2715
  bridge,
1941
2716
  event: "snapshot-overflow",
1942
2717
  payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
1943
2718
  });
1944
- } catch {}
2719
+ return accepted !== false;
2720
+ } catch {
2721
+ return false;
2722
+ }
1945
2723
  }
1946
2724
 
1947
2725
  class BridgeRunDiagnostics {
@@ -1973,6 +2751,7 @@ class BridgeRunDiagnostics {
1973
2751
  completedTools = 0;
1974
2752
  pending = new Map;
1975
2753
  phase = "sending";
2754
+ processScope = false;
1976
2755
  terminal = "pending";
1977
2756
  stream = "pending";
1978
2757
  cancellation = "none";
@@ -1980,6 +2759,8 @@ class BridgeRunDiagnostics {
1980
2759
  run;
1981
2760
  closed = false;
1982
2761
  wasActive;
2762
+ baseline;
2763
+ changeQueued = false;
1983
2764
  timer;
1984
2765
  constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
1985
2766
  this.bridge = bridge;
@@ -2025,7 +2806,8 @@ class BridgeRunDiagnostics {
2025
2806
  return;
2026
2807
  }
2027
2808
  if (stage === "completed") {
2028
- this.pending.delete(key);
2809
+ if (this.pending.delete(key))
2810
+ this.changed();
2029
2811
  this.completedTools++;
2030
2812
  return;
2031
2813
  }
@@ -2040,13 +2822,23 @@ class BridgeRunDiagnostics {
2040
2822
  stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
2041
2823
  nested
2042
2824
  });
2825
+ if (!existing)
2826
+ this.changed();
2043
2827
  }
2044
2828
  checkpoint(phase) {
2829
+ if (phase === "attached")
2830
+ this.processScope = true;
2831
+ if (phase === this.phase)
2832
+ return;
2045
2833
  this.phase = phase;
2834
+ this.changed();
2046
2835
  }
2047
2836
  count(key, amount = 1) {
2048
- if (!this.closed && Number.isSafeInteger(amount) && amount >= 0)
2049
- this.counters[key] += amount;
2837
+ if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
2838
+ return;
2839
+ this.counters[key] += amount;
2840
+ if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
2841
+ this.changed();
2050
2842
  }
2051
2843
  translationFailed() {
2052
2844
  this.translationFailures++;
@@ -2062,8 +2854,10 @@ class BridgeRunDiagnostics {
2062
2854
  }
2063
2855
  terminalSettled(outcome) {
2064
2856
  this.terminal = outcome;
2065
- if (outcome === "resolved")
2857
+ if (outcome === "resolved" && this.phase !== "draining") {
2066
2858
  this.phase = "draining";
2859
+ this.changed();
2860
+ }
2067
2861
  }
2068
2862
  requestCancellation(reason = "user") {
2069
2863
  this.cancellation = "pending";
@@ -2085,12 +2879,38 @@ class BridgeRunDiagnostics {
2085
2879
  if (this.closed)
2086
2880
  return;
2087
2881
  const now = this.now();
2088
- const age = (time) => time === undefined ? null : Math.max(0, now - time);
2089
2882
  const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
2090
2883
  if (event === "heartbeat")
2091
2884
  this.lastTick = now;
2092
- if (!this.active() || !bridgeDiagnosticsActive())
2885
+ if (!bridgeDiagnosticsActive())
2093
2886
  return;
2887
+ const stall = this.stallState(now, tickDelayMs);
2888
+ if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
2889
+ return;
2890
+ this.writeSnapshot(event, now, tickDelayMs, stall);
2891
+ }
2892
+ changed() {
2893
+ if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
2894
+ return;
2895
+ this.changeQueued = true;
2896
+ queueMicrotask(() => {
2897
+ this.changeQueued = false;
2898
+ this.reportChange();
2899
+ });
2900
+ }
2901
+ reportChange() {
2902
+ if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
2903
+ return;
2904
+ const last = this.baseline;
2905
+ if (last && !this.changedSince(last))
2906
+ return;
2907
+ const now = this.now();
2908
+ try {
2909
+ this.writeSnapshot("change", now, 0, this.stallState(now, 0));
2910
+ } catch {}
2911
+ }
2912
+ writeSnapshot(event, now, tickDelayMs, stall) {
2913
+ const age = (time) => time === undefined ? null : Math.max(0, now - time);
2094
2914
  const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
2095
2915
  id,
2096
2916
  kind: tool.kind,
@@ -2099,7 +2919,7 @@ class BridgeRunDiagnostics {
2099
2919
  ageMs: age(tool.since)
2100
2920
  }));
2101
2921
  try {
2102
- writeDiagnostic(this.bridge, event, {
2922
+ const written = writeDiagnostic(this.bridge, event, {
2103
2923
  session: identity(this.state.id),
2104
2924
  run: this.run,
2105
2925
  phase: this.phase,
@@ -2126,8 +2946,64 @@ class BridgeRunDiagnostics {
2126
2946
  completedTools: this.completedTools,
2127
2947
  tickDelayMs
2128
2948
  }, this.write);
2949
+ if (!written)
2950
+ return;
2951
+ this.baseline = {
2952
+ at: now,
2953
+ phase: this.phase,
2954
+ pending: new Set(this.pending.keys()),
2955
+ counters: { ...this.counters },
2956
+ stall
2957
+ };
2129
2958
  } catch {}
2130
2959
  }
2960
+ periodicDue(now, stall) {
2961
+ if (stall.signals.has("tick-delay"))
2962
+ return true;
2963
+ const last = this.baseline;
2964
+ if (!last)
2965
+ return true;
2966
+ if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
2967
+ return true;
2968
+ if (stall.signals.has("no-delta") && this.changedSince(last))
2969
+ return true;
2970
+ return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
2971
+ }
2972
+ changedSince(last) {
2973
+ if (this.phase !== last.phase)
2974
+ return true;
2975
+ if (this.pending.size !== last.pending.size)
2976
+ return true;
2977
+ for (const key of this.pending.keys())
2978
+ if (!last.pending.has(key))
2979
+ return true;
2980
+ for (const key of Object.keys(this.counters))
2981
+ if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
2982
+ return true;
2983
+ return false;
2984
+ }
2985
+ stallState(now, tickDelayMs) {
2986
+ const signals = new Set;
2987
+ const tools = new Set;
2988
+ let oldestPending;
2989
+ for (const [key, tool] of this.pending) {
2990
+ if (oldestPending === undefined || tool.since < oldestPending)
2991
+ oldestPending = tool.since;
2992
+ if (now - tool.since >= STALL_TOOL_PENDING_MS)
2993
+ tools.add(key);
2994
+ }
2995
+ const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
2996
+ if (waitingSince !== undefined) {
2997
+ const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
2998
+ if (now - quietSince >= STALL_NO_DELTA_MS)
2999
+ signals.add("no-delta");
3000
+ }
3001
+ if (tools.size > 0)
3002
+ signals.add("tool-pending");
3003
+ if (tickDelayMs >= STALL_TICK_DELAY_MS)
3004
+ signals.add("tick-delay");
3005
+ return { signals, tools };
3006
+ }
2131
3007
  close(phase = "finished") {
2132
3008
  if (this.closed)
2133
3009
  return;
@@ -2140,7 +3016,47 @@ class BridgeRunDiagnostics {
2140
3016
  }
2141
3017
  }
2142
3018
  function createBridgeDiagnostics(bridge, state, metrics) {
2143
- return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDebugEnabled(bridge));
3019
+ return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDiagnosticsStreamEnabled(bridge));
3020
+ }
3021
+ var bufferedFlushes = new Set;
3022
+ var SHUTDOWN_SIGNALS = ["SIGTERM", "SIGINT"];
3023
+ var shutdownFlushInstalled = false;
3024
+ function flushBufferedDebugLoggers() {
3025
+ for (const flush of Array.from(bufferedFlushes))
3026
+ flush();
3027
+ }
3028
+ function installShutdownFlush() {
3029
+ if (shutdownFlushInstalled)
3030
+ return;
3031
+ shutdownFlushInstalled = true;
3032
+ process.once("exit", flushBufferedDebugLoggers);
3033
+ for (const signal of SHUTDOWN_SIGNALS) {
3034
+ process.prependOnceListener(signal, () => {
3035
+ flushBufferedDebugLoggers();
3036
+ if (process.listenerCount(signal) === 0)
3037
+ process.kill(process.pid, signal);
3038
+ });
3039
+ }
3040
+ }
3041
+ function summarize(entry, metrics) {
3042
+ for (const [key, value] of Object.entries(metrics)) {
3043
+ if (typeof value === "number") {
3044
+ const summary = entry.numbers.get(key);
3045
+ if (!summary) {
3046
+ entry.numbers.set(key, { n: 1, min: value, max: value, sum: value });
3047
+ continue;
3048
+ }
3049
+ summary.n++;
3050
+ summary.min = Math.min(summary.min, value);
3051
+ summary.max = Math.max(summary.max, value);
3052
+ summary.sum += value;
3053
+ continue;
3054
+ }
3055
+ const tally = entry.values.get(key) ?? {};
3056
+ const label = String(value);
3057
+ tally[label] = (tally[label] ?? 0) + 1;
3058
+ entry.values.set(key, tally);
3059
+ }
2144
3060
  }
2145
3061
  function createBufferedDebugLogger(bridge, allowedEvents, enabled = () => bridgeDebugEnabled(bridge), write = writeBridgeDiagnostic) {
2146
3062
  const entries = new Map;
@@ -2150,16 +3066,27 @@ function createBufferedDebugLogger(bridge, allowedEvents, enabled = () => bridge
2150
3066
  if (closed || entries.size === 0 && dropped === 0)
2151
3067
  return;
2152
3068
  try {
2153
- writeDiagnostic(bridge, "debug-events", {
3069
+ const accepted = writeDiagnostic(bridge, "debug-events", {
2154
3070
  dropped,
2155
- events: Array.from(entries.entries()).map(([event, value]) => ({ event, ...value }))
3071
+ events: Array.from(entries.entries()).map(([event, value]) => ({
3072
+ event,
3073
+ count: value.count,
3074
+ metrics: {
3075
+ ...Object.fromEntries(value.numbers),
3076
+ ...Object.fromEntries(value.values)
3077
+ }
3078
+ }))
2156
3079
  }, write);
3080
+ if (accepted) {
3081
+ entries.clear();
3082
+ dropped = 0;
3083
+ }
2157
3084
  } catch {}
2158
- entries.clear();
2159
- dropped = 0;
2160
3085
  };
2161
3086
  const timer = setInterval(flush, INTERVAL_MS);
2162
3087
  timer.unref();
3088
+ bufferedFlushes.add(flush);
3089
+ installShutdownFlush();
2163
3090
  return {
2164
3091
  record(event, ...args) {
2165
3092
  if (closed || !enabled() || !bridgeDiagnosticsActive())
@@ -2168,23 +3095,29 @@ function createBufferedDebugLogger(bridge, allowedEvents, enabled = () => bridge
2168
3095
  dropped++;
2169
3096
  return;
2170
3097
  }
2171
- const previous = entries.get(event);
2172
- if (!previous && entries.size >= 16) {
2173
- dropped++;
2174
- return;
3098
+ let entry = entries.get(event);
3099
+ if (!entry) {
3100
+ if (entries.size >= 16) {
3101
+ dropped++;
3102
+ return;
3103
+ }
3104
+ entry = { count: 0, numbers: new Map, values: new Map };
3105
+ entries.set(event, entry);
2175
3106
  }
3107
+ entry.count++;
2176
3108
  const metrics = {};
2177
3109
  for (const arg of args.slice(0, 4)) {
2178
3110
  if (arg && typeof arg === "object" && !(arg instanceof Error)) {
2179
3111
  Object.assign(metrics, safeDiagnosticMetrics(arg));
2180
3112
  }
2181
3113
  }
2182
- entries.set(event, { count: (previous?.count ?? 0) + 1, metrics });
3114
+ summarize(entry, metrics);
2183
3115
  },
2184
3116
  flush,
2185
3117
  close() {
2186
3118
  flush();
2187
3119
  closed = true;
3120
+ bufferedFlushes.delete(flush);
2188
3121
  clearInterval(timer);
2189
3122
  entries.clear();
2190
3123
  }
@@ -4382,9 +5315,8 @@ function claudePlanWindowFromLabel(label) {
4382
5315
  }
4383
5316
 
4384
5317
  // ../../bridges/claude-bridge/src/services/logger.ts
4385
- var startupDebugLogging = bridgeDebugEnabled("claude");
4386
5318
  function isDebugLoggingEnabled() {
4387
- return liveBridgeDiagnostics() ?? startupDebugLogging;
5319
+ return bridgeDiagnosticsStreamEnabled("claude");
4388
5320
  }
4389
5321
  var DEBUG_EVENTS = new Set([
4390
5322
  "[event-emitter] Emitting event",
@@ -4464,7 +5396,7 @@ function createRequestLogger(enabled = isDebugLoggingEnabled, record = buffered.
4464
5396
  }
4465
5397
 
4466
5398
  // ../../bridges/claude-bridge/src/services/event-emitter.ts
4467
- var log2 = createLogger("bridge.claude");
5399
+ var log3 = createLogger("bridge.claude");
4468
5400
 
4469
5401
  class EventEmitter {
4470
5402
  subscribers = new Set;
@@ -4491,7 +5423,7 @@ class EventEmitter {
4491
5423
  try {
4492
5424
  callback(event, revision);
4493
5425
  } catch (error) {
4494
- log2.error("event-subscriber.failed", { error: formatLogError(error) });
5426
+ log3.error("event-subscriber.failed", { error: formatLogError(error) });
4495
5427
  }
4496
5428
  }
4497
5429
  }
@@ -6367,6 +7299,27 @@ var SUPPRESSED_COMPOSER_PARAMETERS = Object.freeze({
6367
7299
  claude: Object.freeze(["parameter:thinking", "parameter:context1m"]),
6368
7300
  cursor: Object.freeze(["parameter:variant"])
6369
7301
  });
7302
+ var COMPACT_INSTRUCTIONS_MAX_LENGTH = 16000;
7303
+ function parseCompactInstructionsBody(body) {
7304
+ if (body === undefined || body === null)
7305
+ return { ok: true };
7306
+ if (typeof body !== "object" || Array.isArray(body)) {
7307
+ return { ok: false, error: "Compact request body must be an object" };
7308
+ }
7309
+ const raw = body.instructions;
7310
+ if (raw === undefined)
7311
+ return { ok: true };
7312
+ if (typeof raw !== "string")
7313
+ return { ok: false, error: "instructions must be a string" };
7314
+ const instructions = raw.trim();
7315
+ if (instructions.length > COMPACT_INSTRUCTIONS_MAX_LENGTH) {
7316
+ return {
7317
+ ok: false,
7318
+ error: `instructions must be at most ${COMPACT_INSTRUCTIONS_MAX_LENGTH} characters`
7319
+ };
7320
+ }
7321
+ return instructions ? { ok: true, instructions } : { ok: true };
7322
+ }
6370
7323
  function isNativeAgentExecutionPolicy(value) {
6371
7324
  if (!value || typeof value !== "object" || Array.isArray(value))
6372
7325
  return false;
@@ -6727,6 +7680,7 @@ var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
6727
7680
  "update_schedule",
6728
7681
  "update_ticket"
6729
7682
  ]);
7683
+ var COORDINATOR_PROJECT_HOME_MESSAGE_WINDOW_MS = 3 * 60 * 60000;
6730
7684
 
6731
7685
  // ../../bridges/claude-bridge/src/services/coordinator-skills.ts
6732
7686
  var KEPT_FRONTMATTER_KEYS = Object.freeze([
@@ -7120,7 +8074,7 @@ async function readJsonSliceCachedWithDigest(filePath, sliceKey, select) {
7120
8074
  }
7121
8075
 
7122
8076
  // ../../bridges/claude-bridge/src/services/plugin-config.ts
7123
- var log3 = createLogger("bridge.claude");
8077
+ var log4 = createLogger("bridge.claude");
7124
8078
  async function pathExists(path) {
7125
8079
  try {
7126
8080
  await access(path);
@@ -7189,7 +8143,7 @@ async function loadPluginSettings(cwd, sources) {
7189
8143
  return Object.fromEntries(entries);
7190
8144
  }
7191
8145
  function remapInstalledPlugins2(pluginsDir, installedPlugins) {
7192
- return remapInstalledPlugins(pluginsDir, installedPlugins, (installPath) => log3.warn("plugin.unsafe-path", { path: installPath }));
8146
+ return remapInstalledPlugins(pluginsDir, installedPlugins, (installPath) => log4.warn("plugin.unsafe-path", { path: installPath }));
7193
8147
  }
7194
8148
  async function loadProjectOverridesFromGlobal(cwd) {
7195
8149
  const plugins = await readJsonSliceCached(claudeJsonPath(), `projects:${cwd}:plugins`, (config) => claudePluginConfigList(config?.projects?.[cwd]?.plugins));
@@ -7240,7 +8194,7 @@ async function getPluginsForSdk(cwd, includeProjectSources = true, settingSource
7240
8194
  });
7241
8195
  } else {
7242
8196
  const pluginName = config.path.split("/").pop() || "unknown";
7243
- log3.warn("plugin.path-missing", { pluginName, path: config.path });
8197
+ log4.warn("plugin.path-missing", { pluginName, path: config.path });
7244
8198
  }
7245
8199
  }
7246
8200
  return validPlugins;
@@ -8163,7 +9117,7 @@ function claudeSandboxRefusal(policy, options = {}) {
8163
9117
  }
8164
9118
 
8165
9119
  // ../../bridges/claude-bridge/src/services/session-manager-background-tasks.ts
8166
- var log4 = createLogger("bridge.claude");
9120
+ var log5 = createLogger("bridge.claude");
8167
9121
  var PROVISIONAL_BACKGROUND_TASK_PREFIX = "pending-bash:";
8168
9122
  var MAX_BACKGROUND_TASK_CANDIDATES = 128;
8169
9123
  function provisionalBackgroundTaskId(toolUseId) {
@@ -8198,7 +9152,7 @@ function registerBackgroundTaskCandidate(runtime, toolUseId) {
8198
9152
  return;
8199
9153
  const { candidates } = runtime.tasks;
8200
9154
  if (!candidates.has(toolUseId) && candidates.size >= MAX_BACKGROUND_TASK_CANDIDATES) {
8201
- log4.warn("task.candidate-bound-reached", {
9155
+ log5.warn("task.candidate-bound-reached", {
8202
9156
  sessionId: runtime.session.id,
8203
9157
  bound: MAX_BACKGROUND_TASK_CANDIDATES
8204
9158
  });
@@ -8312,7 +9266,7 @@ async function persistShellTaskFields(session, toolUseId, fields) {
8312
9266
  ]
8313
9267
  });
8314
9268
  } catch {
8315
- log4.warn("task.details-persist-failed");
9269
+ log5.warn("task.details-persist-failed");
8316
9270
  }
8317
9271
  }
8318
9272
  function cacheShellTaskFields(session, toolUseId, fields) {
@@ -8434,7 +9388,7 @@ function parkSettlingBackgroundTask(owner, task) {
8434
9388
  return;
8435
9389
  const { settling } = owner.tasks;
8436
9390
  if (!settling.has(task.id) && settling.size >= MAX_SETTLING_BACKGROUND_TASKS) {
8437
- log4.warn("task.settling-bound-reached", {
9391
+ log5.warn("task.settling-bound-reached", {
8438
9392
  sessionId: owner.session.id,
8439
9393
  bound: MAX_SETTLING_BACKGROUND_TASKS
8440
9394
  });
@@ -8509,7 +9463,7 @@ async function stopBackgroundTask(sessionId, taskId) {
8509
9463
  if (latest && !LIVE_BACKGROUND_TASK_STATUSES.has(latest.status)) {
8510
9464
  return { ok: true };
8511
9465
  }
8512
- log4.warn("task.stop-failed", { error: formatLogError(error, { stack: false }) });
9466
+ log5.warn("task.stop-failed", { error: formatLogError(error, { stack: false }) });
8513
9467
  if (settleBackgroundTask(session, taskId, "killed", "The Claude control channel for this task is no longer available")) {
8514
9468
  emitBackgroundTaskSnapshot(session);
8515
9469
  }
@@ -9060,6 +10014,14 @@ class ToolTracker {
9060
10014
  getTool(toolUseId) {
9061
10015
  return this.tools.get(toolUseId);
9062
10016
  }
10017
+ getToolWithCreatedAt(toolUseId, createdAt) {
10018
+ const existing = this.tools.get(toolUseId);
10019
+ if (!existing || !createdAt || existing.createdAt)
10020
+ return existing;
10021
+ const stamped = { ...existing, createdAt };
10022
+ this.tools.set(toolUseId, stamped);
10023
+ return stamped;
10024
+ }
9063
10025
  }
9064
10026
  function parseMcpToolName(toolName, knownServerNames) {
9065
10027
  if (!toolName.startsWith("mcp_")) {
@@ -9271,11 +10233,13 @@ function refreshSettledToolRows(session, sessionId, toolTracker, toolUseIds, pub
9271
10233
  return part;
9272
10234
  }
9273
10235
  pending.delete(part.toolUseId);
9274
- const tracked = toolTracker.getTool(part.toolUseId);
9275
- if (!tracked || published?.has(message))
10236
+ if (published?.has(message))
10237
+ return part;
10238
+ const tracked = toolTracker.getToolWithCreatedAt(part.toolUseId, part.createdAt);
10239
+ if (!tracked || tracked === part)
9276
10240
  return part;
9277
10241
  changed = true;
9278
- return part.createdAt && !tracked.createdAt ? { ...tracked, createdAt: part.createdAt } : tracked;
10242
+ return tracked;
9279
10243
  });
9280
10244
  if (changed) {
9281
10245
  message.parts = parts;
@@ -9522,10 +10486,9 @@ function buildMessageParts(orderedParts, toolTracker) {
9522
10486
  parentTaskUseId: entry.parentTaskUseId
9523
10487
  });
9524
10488
  } else if (entry.type === "tool-ref") {
9525
- const tool = toolTracker.getTool(entry.value);
9526
- if (tool) {
9527
- result.push(entry.timestamp && !tool.createdAt ? { ...tool, createdAt: entry.timestamp } : tool);
9528
- }
10489
+ const tool = toolTracker.getToolWithCreatedAt(entry.value, entry.timestamp);
10490
+ if (tool)
10491
+ result.push(tool);
9529
10492
  } else if (entry.type === "text") {
9530
10493
  result.push({
9531
10494
  type: "text",
@@ -10116,7 +11079,7 @@ function restoredTurnInterruption(preferences) {
10116
11079
  }
10117
11080
 
10118
11081
  // ../../bridges/claude-bridge/src/services/session-manager-lifecycle.ts
10119
- var log5 = createLogger("bridge.claude");
11082
+ var log6 = createLogger("bridge.claude");
10120
11083
  async function getSessionActivity(sessionId) {
10121
11084
  const session = sessions.get(sessionId);
10122
11085
  if (session) {
@@ -10296,7 +11259,7 @@ async function claimPromptDispatch(sessionId, requestId, startDispatch, testHook
10296
11259
  try {
10297
11260
  await updateSessionPreferences(sdkSessionId, journalUpdate([...retainedRequestIds].slice(-MAX_DISPATCHED_REQUEST_IDS)));
10298
11261
  } catch (rollbackError) {
10299
- log5.error("dispatch.rollback-failed", {
11262
+ log6.error("dispatch.rollback-failed", {
10300
11263
  error: formatLogError(rollbackError, { stack: false })
10301
11264
  });
10302
11265
  }
@@ -14277,7 +15240,7 @@ class PromptStream {
14277
15240
  const { session, sessionId } = this;
14278
15241
  const message = row.message;
14279
15242
  if (!message)
14280
- return;
15243
+ return false;
14281
15244
  const parts = message.parts;
14282
15245
  if (!row.published || row.publishedModelId !== message.modelId) {
14283
15246
  row.published = true;
@@ -14286,7 +15249,7 @@ class PromptStream {
14286
15249
  message.revision = (message.revision ?? 0) + 1;
14287
15250
  markTranscriptChanged(session);
14288
15251
  eventEmitter.emit({ type: "message.updated", sessionId, data: { message } });
14289
- return;
15252
+ return true;
14290
15253
  }
14291
15254
  const changedParts = [];
14292
15255
  for (let index = 0;index < parts.length; index += 1) {
@@ -14296,7 +15259,7 @@ class PromptStream {
14296
15259
  }
14297
15260
  }
14298
15261
  if (changedParts.length === 0 && parts.length === row.publishedParts.length) {
14299
- return;
15262
+ return false;
14300
15263
  }
14301
15264
  row.publishedParts = parts.slice();
14302
15265
  message.revision = (message.revision ?? 0) + 1;
@@ -14312,6 +15275,7 @@ class PromptStream {
14312
15275
  revision: message.revision
14313
15276
  }
14314
15277
  });
15278
+ return true;
14315
15279
  }
14316
15280
  newestRowMessage() {
14317
15281
  for (let index = this.rows.length - 1;index >= 0; index -= 1) {
@@ -14343,6 +15307,7 @@ class PromptStream {
14343
15307
  this.rebuildOrderedParts(row);
14344
15308
  const parts = buildMessageParts(row.orderedParts, this.toolTracker);
14345
15309
  const content = getMessageTextFromParts(parts);
15310
+ let sdkUuidChanged = false;
14346
15311
  if (!row.message) {
14347
15312
  if (parts.length === 0 && !content)
14348
15313
  return;
@@ -14363,14 +15328,17 @@ class PromptStream {
14363
15328
  row.message.parts = parts;
14364
15329
  if (row.modelId)
14365
15330
  row.message.modelId = row.modelId;
14366
- if (row.sdkUuid)
15331
+ if (row.sdkUuid && row.message.sdkUuid !== row.sdkUuid) {
14367
15332
  row.message.sdkUuid = row.sdkUuid;
15333
+ sdkUuidChanged = true;
15334
+ }
14368
15335
  }
15336
+ if (!this.emitRow(row) && !sdkUuidChanged)
15337
+ return;
14369
15338
  if (row.message && session.messages.at(-1) !== row.message) {
14370
15339
  (session.revisedRows ??= new RecentlyRevisedRows).note(row.message.id);
14371
15340
  }
14372
15341
  markTranscriptChanged(session);
14373
- this.emitRow(row);
14374
15342
  }
14375
15343
  flushStreamedAssistantMessage() {
14376
15344
  this.clearFlushTimer();
@@ -14864,7 +15832,7 @@ function reconcileClaudeUsage(terminal, streamed) {
14864
15832
  }
14865
15833
 
14866
15834
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-turn-lifecycle.ts
14867
- var log6 = createLogger("bridge.claude");
15835
+ var log7 = createLogger("bridge.claude");
14868
15836
  function diagnosticErrorClass(error) {
14869
15837
  try {
14870
15838
  if (!(error instanceof Error))
@@ -14933,7 +15901,7 @@ async function reconcilePlanModeFromStatus(turn, reported) {
14933
15901
  try {
14934
15902
  await applySessionPlanMode(session, false);
14935
15903
  } catch (error) {
14936
- log6.warn("plan-mode.record-failed", { sessionId, errorClass: diagnosticErrorClass(error) });
15904
+ log7.warn("plan-mode.record-failed", { sessionId, errorClass: diagnosticErrorClass(error) });
14937
15905
  }
14938
15906
  }
14939
15907
  function setCompletionBlockedByBackgroundTasks(turn, blocked) {
@@ -15176,7 +16144,7 @@ function createTurnState(session, sessionId, init) {
15176
16144
  }
15177
16145
 
15178
16146
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-admission.ts
15179
- var log7 = createLogger("bridge.claude");
16147
+ var log8 = createLogger("bridge.claude");
15180
16148
  var STREAM_EVENT_COALESCE_MS = 100;
15181
16149
  function admitPrompt(sessionId, options) {
15182
16150
  const session = sessions.get(sessionId);
@@ -15309,7 +16277,7 @@ async function readTranscriptForPrompt(session) {
15309
16277
  try {
15310
16278
  return await readPersistedSessionMessagesOnce(session);
15311
16279
  } catch (error) {
15312
- log7.warn("transcript.hydrate-failed", { error: formatLogError(error, { stack: false }) });
16280
+ log8.warn("transcript.hydrate-failed", { error: formatLogError(error, { stack: false }) });
15313
16281
  return TRANSCRIPT_READ_FAILED;
15314
16282
  }
15315
16283
  }
@@ -15459,7 +16427,7 @@ var ORKESTRATOR_ARTIFACT_MCP_SERVER_NAME = "orkestrator-artifacts";
15459
16427
  var ORKESTRATOR_ARTIFACT_MCP_PATH = "/artifact-mcp";
15460
16428
 
15461
16429
  // ../../bridges/claude-bridge/src/services/mcp-config.ts
15462
- var log8 = createLogger("bridge.claude");
16430
+ var log9 = createLogger("bridge.claude");
15463
16431
  var AGENT_MCP_SERVER_NAME = "orkestrator";
15464
16432
  var AGENT_MCP_URL_ENV = "ORKESTRATOR_AGENT_MCP_URL";
15465
16433
  var AGENT_MCP_TOKEN_ENV = "ORKESTRATOR_AGENT_MCP_TOKEN";
@@ -15544,7 +16512,7 @@ function toSdkServers(configs) {
15544
16512
  if (sdkConfig) {
15545
16513
  servers[name] = sdkConfig;
15546
16514
  } else {
15547
- log8.warn("mcp.config-ignored");
16515
+ log9.warn("mcp.config-ignored");
15548
16516
  }
15549
16517
  }
15550
16518
  return servers;
@@ -15909,7 +16877,7 @@ function claudeReadiness() {
15909
16877
  }
15910
16878
 
15911
16879
  // ../../bridges/claude-bridge/src/services/claude-model-catalog.ts
15912
- var log9 = createLogger("bridge.claude");
16880
+ var log10 = createLogger("bridge.claude");
15913
16881
  var CLAUDE_MODEL_CACHE_TTL_MS = 60 * 60000;
15914
16882
  var CLAUDE_MODEL_PROBE_TIMEOUT_MS = 25000;
15915
16883
  var remembered;
@@ -16050,7 +17018,7 @@ async function probeModels(at) {
16050
17018
  await rememberModels(models, account, at);
16051
17019
  return { source: "sdk", models: catalogModels(models) };
16052
17020
  } catch (error) {
16053
- log9.warn("models.fetch-failed", { error: formatLogError(error) });
17021
+ log10.warn("models.fetch-failed", { error: formatLogError(error) });
16054
17022
  return fallbackCatalog();
16055
17023
  } finally {
16056
17024
  clearTimeout(timer);
@@ -18162,14 +19130,14 @@ function isValidMcpFormContent(schema, content) {
18162
19130
  }
18163
19131
 
18164
19132
  // ../../bridges/claude-bridge/src/services/session-manager-interactions.ts
18165
- var log10 = createLogger("bridge.claude");
19133
+ var log11 = createLogger("bridge.claude");
18166
19134
  function answerQuestion(requestId, answers) {
18167
19135
  const question = pendingQuestions.get(requestId);
18168
19136
  if (!question) {
18169
19137
  debugLog("[session-manager] Question not found for requestId:", requestId);
18170
19138
  return false;
18171
19139
  }
18172
- log10.info("question.answering", { requestId, answerCount: Object.keys(answers).length });
19140
+ log11.info("question.answering", { requestId, answerCount: Object.keys(answers).length });
18173
19141
  const resolver = questionResolvers.get(requestId);
18174
19142
  if (resolver) {
18175
19143
  debugLog("[session-manager] Resolving promise for question:", requestId);
@@ -18221,7 +19189,7 @@ function respondToPlanApproval(requestId, approved, feedback) {
18221
19189
  debugLog("[session-manager] Refusing incomplete plan approval", { requestId });
18222
19190
  return false;
18223
19191
  }
18224
- log10.info("plan-approval.responding", {
19192
+ log11.info("plan-approval.responding", {
18225
19193
  requestId,
18226
19194
  approved,
18227
19195
  hasFeedback: typeof feedback === "string" && feedback.length > 0
@@ -19461,7 +20429,7 @@ function classifyUsageLimitError(text) {
19461
20429
  }
19462
20430
 
19463
20431
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-handlers/result.ts
19464
- var log11 = createLogger("bridge.claude");
20432
+ var log12 = createLogger("bridge.claude");
19465
20433
  function claudeStartupFailureMessage(reason) {
19466
20434
  switch (reason) {
19467
20435
  case "org_pin_api_key_conflict":
@@ -19634,7 +20602,7 @@ async function handleResultMessage(turn, message) {
19634
20602
  debugLog("[session-manager] Query stopped by the user", { sessionId });
19635
20603
  finishTurnInputIfSettled(turn);
19636
20604
  } else {
19637
- log11.error("query.failed", { subtype: resultMsg.subtype, sessionId, isError: resultIsError });
20605
+ log12.error("query.failed", { subtype: resultMsg.subtype, sessionId, isError: resultIsError });
19638
20606
  const startupFailure = resultMsg.startup_failure_reason ? claudeStartupFailureMessage(resultMsg.startup_failure_reason) : undefined;
19639
20607
  const usageLimit = resultMsg.subtype === "success" && classifyUsageLimitError(resultMsg.result) ? resultMsg.result.trim().slice(0, MAX_USAGE_LIMIT_ERROR_CHARS) : undefined;
19640
20608
  const resultError = startupFailure || resultMsg.errors?.filter(Boolean).join(`
@@ -20064,7 +21032,7 @@ async function handleSystemMessage(turn, message) {
20064
21032
  }
20065
21033
 
20066
21034
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-handlers/user.ts
20067
- var log12 = createLogger("bridge.claude");
21035
+ var log13 = createLogger("bridge.claude");
20068
21036
  function handleUserMessage(turn, message) {
20069
21037
  const { session, sessionId, stream } = turn;
20070
21038
  const { toolTracker, taskRegistry, activeTaskIds } = stream;
@@ -20114,7 +21082,7 @@ function handleUserMessage(turn, message) {
20114
21082
  if (turn.planApprovedThisTurn) {
20115
21083
  for (const tool of toolTracker.getTools()) {
20116
21084
  if (tool.toolName === "ExitPlanMode" && tool.toolState === "failure" && tool.toolUseId) {
20117
- log12.warn("plan-exit.failure-overridden", { sessionId, toolUseId: tool.toolUseId });
21085
+ log13.warn("plan-exit.failure-overridden", { sessionId, toolUseId: tool.toolUseId });
20118
21086
  toolTracker.updateToolResult(tool.toolUseId, {
20119
21087
  state: "success",
20120
21088
  output: "Plan approved by the user. Proceeding with implementation.",
@@ -20186,7 +21154,7 @@ async function handleTurnMessage(turn, message) {
20186
21154
  }
20187
21155
 
20188
21156
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-can-use-tool.ts
20189
- var log13 = createLogger("bridge.claude");
21157
+ var log14 = createLogger("bridge.claude");
20190
21158
  function boundedPlan(content) {
20191
21159
  if (typeof content !== "string" || content.trim().length === 0)
20192
21160
  return {};
@@ -20245,7 +21213,7 @@ async function askUserQuestion(turn, input, permissionContext) {
20245
21213
  });
20246
21214
  try {
20247
21215
  const answers = await Promise.race([answerPromise, timeoutPromise]);
20248
- log13.info("question.answers-received", { questionId, answerCount: Object.keys(answers).length });
21216
+ log14.info("question.answers-received", { questionId, answerCount: Object.keys(answers).length });
20249
21217
  return {
20250
21218
  behavior: "allow",
20251
21219
  updatedInput: {
@@ -20254,7 +21222,7 @@ async function askUserQuestion(turn, input, permissionContext) {
20254
21222
  }
20255
21223
  };
20256
21224
  } catch (error) {
20257
- log13.warn("question.wait-failed", { error: formatLogError(error) });
21225
+ log14.warn("question.wait-failed", { error: formatLogError(error) });
20258
21226
  const message = error instanceof Error ? error.message : "Question was cancelled";
20259
21227
  if (pendingQuestions.has(questionId)) {
20260
21228
  eventEmitter.emit({
@@ -20335,7 +21303,7 @@ async function requestPlanApproval(turn, input, permissionContext) {
20335
21303
  });
20336
21304
  try {
20337
21305
  const response = await Promise.race([approvalPromise, timeoutPromise]);
20338
- log13.info("plan-approval.result", {
21306
+ log14.info("plan-approval.result", {
20339
21307
  approvalId,
20340
21308
  approved: response.approved,
20341
21309
  hasFeedback: typeof response.feedback === "string" && response.feedback.length > 0
@@ -20384,7 +21352,7 @@ Please revise the plan based on this feedback.` : `I've reviewed the plan and I
20384
21352
  };
20385
21353
  }
20386
21354
  } catch (error) {
20387
- log13.warn("plan-approval.wait-failed", { error: formatLogError(error) });
21355
+ log14.warn("plan-approval.wait-failed", { error: formatLogError(error) });
20388
21356
  const errorMessage = error instanceof Error ? error.message : "Plan approval was cancelled";
20389
21357
  if (pendingPlanApprovals.has(approvalId)) {
20390
21358
  eventEmitter.emit({
@@ -20474,7 +21442,7 @@ function createClaudeRuntimeTurn(turn) {
20474
21442
  }
20475
21443
 
20476
21444
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-launch.ts
20477
- var log14 = createLogger("bridge.claude");
21445
+ var log15 = createLogger("bridge.claude");
20478
21446
  async function consumeClaudeRuntime(runtime, frames, markEnded) {
20479
21447
  let failure;
20480
21448
  try {
@@ -20550,7 +21518,7 @@ function releaseOrphanedForeground(runtime, error) {
20550
21518
  eventEmitter.emit({ type: "session.idle", sessionId, data: { success: true } });
20551
21519
  return;
20552
21520
  }
20553
- log14.error("runtime.ended-under-resumed-turn", { sessionId });
21521
+ log15.error("runtime.ended-under-resumed-turn", { sessionId });
20554
21522
  session.status = "error";
20555
21523
  session.error = error instanceof Error ? error.message : String(error);
20556
21524
  eventEmitter.emit({ type: "session.error", sessionId, data: { error: session.error } });
@@ -20714,7 +21682,7 @@ async function runTurnOnRuntime(turn, plan, testHooks) {
20714
21682
  }
20715
21683
 
20716
21684
  // ../../bridges/claude-bridge/src/services/session-manager-prompt-settle.ts
20717
- var log15 = createLogger("bridge.claude");
21685
+ var log16 = createLogger("bridge.claude");
20718
21686
  function settleTurnEnd(turn) {
20719
21687
  const { session, sessionId, options, structuredRequestId, abortController, stream, diagnostics } = turn;
20720
21688
  diagnostics?.streamSettled("resolved");
@@ -20835,7 +21803,7 @@ function settleFailedTurn(turn, error) {
20835
21803
  recordInterruptedStructuredOutputIfCurrent(turn);
20836
21804
  return;
20837
21805
  }
20838
- log15.error("prompt.failed", { errorClass: diagnosticErrorClass(error) });
21806
+ log16.error("prompt.failed", { errorClass: diagnosticErrorClass(error) });
20839
21807
  if (session.abortController === abortController) {
20840
21808
  const killedBy = killedClaudeProcessSignal(error);
20841
21809
  const failure = killedBy ? claudeProcessKilledMessage(killedBy) : error instanceof Error ? error.message : String(error);
@@ -20944,7 +21912,7 @@ function finalizeTurn(turn) {
20944
21912
  }
20945
21913
 
20946
21914
  // ../../bridges/claude-bridge/src/services/session-manager-prompt.ts
20947
- var log16 = createLogger("bridge.claude");
21915
+ var log17 = createLogger("bridge.claude");
20948
21916
  function turnWriterLiveness(turn) {
20949
21917
  const tasks = Object.values(turn.session.backgroundTasks ?? {});
20950
21918
  if (tasks.some((task) => LIVE_BACKGROUND_TASK_STATUSES.has(task.status)))
@@ -20987,7 +21955,7 @@ async function sendPrompt(sessionId, prompt, options, testHooks) {
20987
21955
  try {
20988
21956
  await sendPrompt(sessionId, followUp.prompt, followUp.options);
20989
21957
  } catch (repromptError) {
20990
- log16.error(followUp.failureEvent, { error: formatLogError(repromptError) });
21958
+ log17.error(followUp.failureEvent, { error: formatLogError(repromptError) });
20991
21959
  return Promise.reject(repromptError);
20992
21960
  }
20993
21961
  } catch (error) {
@@ -20999,7 +21967,7 @@ async function sendPrompt(sessionId, prompt, options, testHooks) {
20999
21967
  }
21000
21968
  }
21001
21969
  // ../../bridges/claude-bridge/src/services/session-manager-close.ts
21002
- var log17 = createLogger("bridge.claude");
21970
+ var log18 = createLogger("bridge.claude");
21003
21971
  var CLOSE_CONFIRMATION_BUDGET_MS = 1e4;
21004
21972
 
21005
21973
  class SessionCloseNotConfirmedError extends Error {
@@ -21062,7 +22030,7 @@ async function closeQueryControls(controls, deadline) {
21062
22030
  if (await settlesBy(Promise.resolve(control.close()), deadline))
21063
22031
  return;
21064
22032
  } catch (error) {
21065
- log17.error("query.close-failed", {
22033
+ log18.error("query.close-failed", {
21066
22034
  errorClass: error instanceof Error ? error.name : typeof error
21067
22035
  });
21068
22036
  }
@@ -21082,18 +22050,18 @@ async function settlesBy(work, deadline) {
21082
22050
  }
21083
22051
  }
21084
22052
  // ../../bridges/claude-bridge/src/routes/config.ts
21085
- var log18 = createLogger("bridge.claude");
22053
+ var log19 = createLogger("bridge.claude");
21086
22054
  var config2 = new Hono2;
21087
22055
  config2.get("/models", async (c) => {
21088
22056
  if (c.req.query("forceRefresh") === "true")
21089
22057
  invalidateClaudeModelCatalog();
21090
22058
  const startedAt = Date.now();
21091
- log18.debug("models.requested");
22059
+ log19.debug("models.requested");
21092
22060
  const [{ models, source }, versions] = await Promise.all([
21093
22061
  getAvailableModelCatalog(),
21094
22062
  getClaudeRuntimeVersions()
21095
22063
  ]);
21096
- log18.debug("models.responded", { count: models.length, durationMs: Date.now() - startedAt });
22064
+ log19.debug("models.responded", { count: models.length, durationMs: Date.now() - startedAt });
21097
22065
  const response = {
21098
22066
  models,
21099
22067
  source,
@@ -21346,6 +22314,72 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
21346
22314
  };
21347
22315
  }
21348
22316
 
22317
+ // ../../bridges/claude-bridge/src/services/execution-policy-narrowing.ts
22318
+ var APPROVALS_STRICTNESS = {
22319
+ "auto-approve": 0,
22320
+ ask: 1,
22321
+ deny: 2
22322
+ };
22323
+ var SANDBOX_STRICTNESS = {
22324
+ none: 0,
22325
+ container: 1,
22326
+ provider: 2
22327
+ };
22328
+ function networkStrictness(value) {
22329
+ return value === "restricted" ? 1 : 0;
22330
+ }
22331
+ function isSubset(candidate, of) {
22332
+ const allowed = new Set(of);
22333
+ return candidate.every((item) => allowed.has(item));
22334
+ }
22335
+ function rawCapabilityDenials(policy) {
22336
+ return [
22337
+ ...policy.capabilityPolicy?.deny ?? [],
22338
+ ...policy.capabilityPolicy?.extendedDeny ?? []
22339
+ ];
22340
+ }
22341
+ function executionPolicyWidenings(current, next) {
22342
+ if (!current)
22343
+ return [];
22344
+ const widened = [];
22345
+ if (next.id !== current.id)
22346
+ widened.push("id");
22347
+ if (APPROVALS_STRICTNESS[next.approvals] < APPROVALS_STRICTNESS[current.approvals]) {
22348
+ widened.push("approvals");
22349
+ }
22350
+ if (SANDBOX_STRICTNESS[next.sandbox] < SANDBOX_STRICTNESS[current.sandbox]) {
22351
+ widened.push("sandbox");
22352
+ }
22353
+ if (next.projectResources && !current.projectResources)
22354
+ widened.push("projectResources");
22355
+ if (networkStrictness(next.networkAccess) < networkStrictness(current.networkAccess)) {
22356
+ widened.push("networkAccess");
22357
+ }
22358
+ if (networkStrictness(next.containerNetworkAccess) < networkStrictness(current.containerNetworkAccess)) {
22359
+ widened.push("containerNetworkAccess");
22360
+ }
22361
+ const currentAllow = current.toolPolicy?.allow;
22362
+ const nextAllow = next.toolPolicy?.allow;
22363
+ const allowNarrows = currentAllow === undefined ? nextAllow === undefined || nextAllow.length === 0 : nextAllow !== undefined && isSubset(nextAllow, currentAllow);
22364
+ if (!allowNarrows)
22365
+ widened.push("toolPolicy.allow");
22366
+ if (!isSubset(current.toolPolicy?.deny ?? [], next.toolPolicy?.deny ?? [])) {
22367
+ widened.push("toolPolicy.deny");
22368
+ }
22369
+ if (!isSubset(rawCapabilityDenials(current), rawCapabilityDenials(next))) {
22370
+ widened.push("capabilityPolicy.deny");
22371
+ }
22372
+ if (!isSubset(next.capabilityPolicy?.allow ?? [], current.capabilityPolicy?.allow ?? [])) {
22373
+ widened.push("capabilityPolicy.allow");
22374
+ }
22375
+ const currentServers = nativeAgentUserMcpGrant(current);
22376
+ const nextServers = nativeAgentUserMcpGrant(next);
22377
+ if (currentServers !== undefined && (nextServers === undefined || !isSubset(nextServers, currentServers))) {
22378
+ widened.push("capabilityPolicy.userMcpServers");
22379
+ }
22380
+ return widened;
22381
+ }
22382
+
21349
22383
  // ../../bridges/claude-bridge/src/routes/session-close.ts
21350
22384
  function registerSessionCloseRoute(app) {
21351
22385
  app.post("/:id/close", async (c) => {
@@ -22074,7 +23108,7 @@ function bridgeTranscriptPageRouteBody(source, query) {
22074
23108
  }
22075
23109
 
22076
23110
  // ../../bridges/claude-bridge/src/routes/session-transcript.ts
22077
- var log19 = createLogger("bridge.claude");
23111
+ var log20 = createLogger("bridge.claude");
22078
23112
  function claudeTranscriptSource(id, generation) {
22079
23113
  const sessionData = peekSession(id);
22080
23114
  if (!sessionData)
@@ -22127,7 +23161,7 @@ function registerSessionTranscriptRoutes(app, generation, materialize) {
22127
23161
  const response = c.json(bridgeTranscriptRouteBody(read.source, query3(c)));
22128
23162
  if (read.needsHydration) {
22129
23163
  hydratePersistedSessionMessages(id).catch((error) => {
22130
- log19.warn("transcript.background-hydrate-failed", {
23164
+ log20.warn("transcript.background-hydrate-failed", {
22131
23165
  error: formatLogError(error, { stack: false })
22132
23166
  });
22133
23167
  });
@@ -22139,7 +23173,7 @@ function registerSessionTranscriptRoutes(app, generation, materialize) {
22139
23173
  }
22140
23174
 
22141
23175
  // ../../bridges/claude-bridge/src/routes/session.ts
22142
- var log20 = createLogger("bridge.claude");
23176
+ var log21 = createLogger("bridge.claude");
22143
23177
  var session = new Hono2;
22144
23178
  var TRANSCRIPT_GENERATION = randomUUID5();
22145
23179
  var MAX_QUESTION_ANSWER_REQUEST_BYTES = AGENT_INTERACTION_LIMITS.maxSerializedPayloadBytes + 1024;
@@ -22160,6 +23194,10 @@ var interactionBodyLimit = bodyLimit({
22160
23194
  maxSize: MAX_QUESTION_ANSWER_REQUEST_BYTES,
22161
23195
  onError: (c) => c.json({ error: "Interaction response is too large" }, 413)
22162
23196
  });
23197
+ var compactBodyLimit = bodyLimit({
23198
+ maxSize: COMPACT_INSTRUCTIONS_MAX_LENGTH * 6 + 1024,
23199
+ onError: (c) => c.json({ error: "Compact request is too large" }, 413)
23200
+ });
22163
23201
  var holdBodyLimit = bodyLimit({
22164
23202
  maxSize: 1024,
22165
23203
  onError: (c) => c.json({ error: "Hold request is too large" }, 413)
@@ -22215,14 +23253,14 @@ session.post("/create", async (c) => {
22215
23253
  const clientSessionKey = body.clientSessionKey;
22216
23254
  const policy = effectiveExecutionPolicy(isNativeAgentExecutionPolicy(body.policy) ? body.policy : undefined);
22217
23255
  const newSession = policy ? await createOrRecoverSession(title, clientSessionKey, policy) : await createOrRecoverSession(title, clientSessionKey);
22218
- log20.info("session.created", { sessionId: newSession.id });
23256
+ log21.info("session.created", { sessionId: newSession.id });
22219
23257
  const response = {
22220
23258
  sessionId: newSession.id,
22221
23259
  title: newSession.title
22222
23260
  };
22223
23261
  return c.json(response, 201);
22224
23262
  } catch (error) {
22225
- log20.error("session.create-failed", { error: formatLogError(error) });
23263
+ log21.error("session.create-failed", { error: formatLogError(error) });
22226
23264
  return c.json({ error: error instanceof Error ? error.message : "Failed to create session" }, 500);
22227
23265
  }
22228
23266
  });
@@ -22230,7 +23268,7 @@ session.get("/list", async (c) => {
22230
23268
  try {
22231
23269
  await reconcilePersistedSessions();
22232
23270
  } catch (error) {
22233
- log20.warn("sessions.reconcile-failed", { error: formatLogError(error) });
23271
+ log21.warn("sessions.reconcile-failed", { error: formatLogError(error) });
22234
23272
  }
22235
23273
  const sessions = listSessions();
22236
23274
  const response = {
@@ -22249,7 +23287,7 @@ async function resolveSession(id, failureMessage) {
22249
23287
  try {
22250
23288
  return { ok: true, session: getSession(id) ?? await ensurePersistedSession(id) };
22251
23289
  } catch (error) {
22252
- log20.error("session.resolve-failed", { action: failureMessage, error: formatLogError(error) });
23290
+ log21.error("session.resolve-failed", { action: failureMessage, error: formatLogError(error) });
22253
23291
  return {
22254
23292
  ok: false,
22255
23293
  body: { error: errorMessage(error, failureMessage) },
@@ -22270,7 +23308,7 @@ session.get("/:id", async (c) => {
22270
23308
  try {
22271
23309
  await hydratePersistedSessionMessages(id);
22272
23310
  } catch (error) {
22273
- log20.error("session.task-state-hydrate-failed", { error: formatLogError(error) });
23311
+ log21.error("session.task-state-hydrate-failed", { error: formatLogError(error) });
22274
23312
  return c.json({ error: errorMessage(error, "Failed to hydrate session task state") }, sessionErrorStatus(error));
22275
23313
  }
22276
23314
  }
@@ -22321,7 +23359,7 @@ session.get("/:id/usage", async (c) => {
22321
23359
  const contextUsage = await refreshClaudeContextUsage(resolved.session);
22322
23360
  return c.json({ contextUsage });
22323
23361
  } catch (error) {
22324
- log20.warn("context-usage.read-failed", { error: formatLogError(error, { stack: false }) });
23362
+ log21.warn("context-usage.read-failed", { error: formatLogError(error, { stack: false }) });
22325
23363
  return c.json({ error: "Context usage is temporarily unavailable" }, 503);
22326
23364
  }
22327
23365
  });
@@ -22367,6 +23405,24 @@ session.post("/:id/config", async (c) => {
22367
23405
  if (Object.hasOwn(body, "policy") && !isNativeAgentExecutionPolicy(body.policy)) {
22368
23406
  return c.json({ error: "Invalid execution policy" }, 400);
22369
23407
  }
23408
+ const nextPolicy = effectiveExecutionPolicy(isNativeAgentExecutionPolicy(body.policy) ? body.policy : undefined);
23409
+ const refusePolicyWidening = () => {
23410
+ const widened = nextPolicy ? executionPolicyWidenings(sessionData.executionPolicy, nextPolicy) : [];
23411
+ if (widened.length > 0) {
23412
+ log21.warn("session.policy-widening-refused", {
23413
+ sessionId: sessionData.id,
23414
+ widened: widened.join(",")
23415
+ });
23416
+ return c.json({
23417
+ error: "Execution policy can only be narrowed on a live session; a wider policy applies after the agent bridge restarts.",
23418
+ code: "policy-widening-refused",
23419
+ widened
23420
+ }, 403);
23421
+ }
23422
+ };
23423
+ const refusal = refusePolicyWidening();
23424
+ if (refusal)
23425
+ return refusal;
22370
23426
  const { effort, parameterValues } = resolveUltracodeEffort(typeof body.reasoningId === "string" ? body.reasoningId : undefined, body.parameterValues && typeof body.parameterValues === "object" && !Array.isArray(body.parameterValues) ? body.parameterValues : undefined);
22371
23427
  const approvalMode = claudeApprovalMode(body.approvalMode);
22372
23428
  const permissionMode = body.mode === "plan" ? "plan" : body.mode === "build" ? approvalMode ?? "bypassPermissions" : approvalMode !== undefined && sessionData.planMode !== true ? approvalMode : undefined;
@@ -22381,7 +23437,9 @@ session.post("/:id/config", async (c) => {
22381
23437
  } catch (error) {
22382
23438
  return c.json({ error: error instanceof Error ? error.message : "Failed to configure session" }, sessionErrorStatus(error));
22383
23439
  }
22384
- const nextPolicy = effectiveExecutionPolicy(isNativeAgentExecutionPolicy(body.policy) ? body.policy : undefined);
23440
+ const stalePolicyRefusal = refusePolicyWidening();
23441
+ if (stalePolicyRefusal)
23442
+ return stalePolicyRefusal;
22385
23443
  if (nextPolicy) {
22386
23444
  sessionData.executionPolicy = structuredClone(nextPolicy);
22387
23445
  }
@@ -22396,7 +23454,7 @@ session.get("/:id/commands", async (c) => {
22396
23454
  try {
22397
23455
  return c.json(await readClaudeCommandCatalogue(c.req.param("id")));
22398
23456
  } catch (error) {
22399
- log20.warn("commands.read-failed", { error: formatLogError(error, { stack: false }) });
23457
+ log21.warn("commands.read-failed", { error: formatLogError(error, { stack: false }) });
22400
23458
  return c.json({ error: errorMessage(error, "Claude command discovery failed") }, 503);
22401
23459
  }
22402
23460
  });
@@ -22641,7 +23699,7 @@ session.post("/:id/prompt", async (c) => {
22641
23699
  rejectStarted?.(sessionOperationError("conflict", "Prompt stopped before launch"));
22642
23700
  }, (error) => {
22643
23701
  rejectStarted?.(error);
22644
- log20.error("prompt.processing-failed", { error: formatLogError(error) });
23702
+ log21.error("prompt.processing-failed", { error: formatLogError(error) });
22645
23703
  });
22646
23704
  return { started, completion };
22647
23705
  });
@@ -22655,7 +23713,7 @@ session.post("/:id/prompt", async (c) => {
22655
23713
  duplicate: true
22656
23714
  });
22657
23715
  }
22658
- log20.debug("prompt.accepted", { sessionId: id });
23716
+ log21.debug("prompt.accepted", { sessionId: id });
22659
23717
  return c.json({
22660
23718
  status: "processing",
22661
23719
  requestId,
@@ -22668,7 +23726,7 @@ session.post("/:id/prompt", async (c) => {
22668
23726
  if (sessionData.rewindInProgress === true) {
22669
23727
  return c.json({ error: "Session is restoring files from a checkpoint" }, 409);
22670
23728
  }
22671
- log20.info("prompt.received", {
23729
+ log21.info("prompt.received", {
22672
23730
  sessionId: id,
22673
23731
  promptLength: prompt.length,
22674
23732
  model,
@@ -22696,16 +23754,16 @@ session.post("/:id/prompt", async (c) => {
22696
23754
  ...workflowResultTurn ? { workflowResultTurn } : {},
22697
23755
  ...providerPrompt !== undefined ? { providerPrompt } : {}
22698
23756
  }).catch((error) => {
22699
- log20.error("prompt.processing-failed", { error: formatLogError(error) });
23757
+ log21.error("prompt.processing-failed", { error: formatLogError(error) });
22700
23758
  });
22701
- log20.debug("prompt.accepted", { sessionId: id });
23759
+ log21.debug("prompt.accepted", { sessionId: id });
22702
23760
  return c.json({
22703
23761
  status: "processing",
22704
23762
  requestId,
22705
23763
  turnStartedAt: sessionData.turnStartedAt
22706
23764
  }, 202);
22707
23765
  } catch (error) {
22708
- log20.error("prompt.send-failed", { error: formatLogError(error) });
23766
+ log21.error("prompt.send-failed", { error: formatLogError(error) });
22709
23767
  return c.json({ error: errorMessage(error, "Failed to send prompt") }, sessionErrorStatus(error));
22710
23768
  }
22711
23769
  });
@@ -22749,7 +23807,7 @@ session.delete("/:id", async (c) => {
22749
23807
  }
22750
23808
  return c.json({ error: "Session not found" }, 404);
22751
23809
  } catch (error) {
22752
- log20.error("session.delete-failed", { error: formatLogError(error) });
23810
+ log21.error("session.delete-failed", { error: formatLogError(error) });
22753
23811
  return c.json({ error: errorMessage(error, "Failed to delete session") }, sessionErrorStatus(error));
22754
23812
  }
22755
23813
  });
@@ -22764,7 +23822,7 @@ session.post("/:id/rename", async (c) => {
22764
23822
  const renamed = await renameSessionDurably(id, title);
22765
23823
  return renamed ? c.json({ status: "renamed", title }) : c.json({ error: "Session not found" }, 404);
22766
23824
  } catch (error) {
22767
- log20.error("session.rename-failed", { error: formatLogError(error) });
23825
+ log21.error("session.rename-failed", { error: formatLogError(error) });
22768
23826
  return c.json({ error: errorMessage(error, "Failed to rename session") }, sessionErrorStatus(error));
22769
23827
  }
22770
23828
  });
@@ -22793,12 +23851,24 @@ session.post("/:id/fork", async (c) => {
22793
23851
  title: forked.title
22794
23852
  }, 201);
22795
23853
  } catch (error) {
22796
- log20.error("session.fork-failed", { error: formatLogError(error) });
23854
+ log21.error("session.fork-failed", { error: formatLogError(error) });
22797
23855
  return c.json({ error: errorMessage(error, "Failed to fork session") }, sessionErrorStatus(error));
22798
23856
  }
22799
23857
  });
22800
- session.post("/:id/compact", async (c) => {
23858
+ session.post("/:id/compact", compactBodyLimit, async (c) => {
22801
23859
  const id = c.req.param("id");
23860
+ const text = await c.req.text().catch(() => "");
23861
+ let body;
23862
+ if (text.trim()) {
23863
+ try {
23864
+ body = JSON.parse(text);
23865
+ } catch {
23866
+ return c.json({ error: "Compact request body is not JSON" }, 400);
23867
+ }
23868
+ }
23869
+ const parsed = parseCompactInstructionsBody(body);
23870
+ if (!parsed.ok)
23871
+ return c.json({ error: parsed.error }, 400);
22802
23872
  const resolved = await resolveSession(id, "Failed to compact session");
22803
23873
  if (!resolved.ok)
22804
23874
  return c.json(resolved.body, resolved.status);
@@ -22811,10 +23881,11 @@ session.post("/:id/compact", async (c) => {
22811
23881
  if (sessionData.rewindInProgress === true) {
22812
23882
  return c.json({ error: "Session is restoring files from a checkpoint" }, 409);
22813
23883
  }
22814
- sendPrompt(id, "/compact").catch((error) => {
22815
- log20.error("session.compact-failed", { error: formatLogError(error) });
23884
+ const { instructions } = parsed;
23885
+ sendPrompt(id, instructions ? `/compact ${instructions}` : "/compact").catch((error) => {
23886
+ log21.error("session.compact-failed", { error: formatLogError(error) });
22816
23887
  });
22817
- return c.json({ status: "processing" }, 202);
23888
+ return c.json(instructions ? { status: "processing", instructions: "applied" } : { status: "processing" }, 202);
22818
23889
  });
22819
23890
  session.post("/:id/rewind", async (c) => {
22820
23891
  const id = c.req.param("id");
@@ -22830,7 +23901,7 @@ session.post("/:id/rewind", async (c) => {
22830
23901
  const result = await rewindSessionFiles(id, messageId, dryRun);
22831
23902
  return c.json({ status: dryRun ? "previewed" : "rewound", result });
22832
23903
  } catch (error) {
22833
- log20.error("session.rewind-failed", { error: formatLogError(error) });
23904
+ log21.error("session.rewind-failed", { error: formatLogError(error) });
22834
23905
  return c.json({ error: errorMessage(error, "Failed to rewind session files") }, sessionErrorStatus(error));
22835
23906
  }
22836
23907
  });
@@ -22841,7 +23912,7 @@ session.post("/:id/tasks/:taskId/stop", async (c) => {
22841
23912
  return c.json({ status: "stopped" });
22842
23913
  return c.json({ error: stopped.message }, stopped.reason === "no_control_channel" ? 409 : 404);
22843
23914
  } catch (error) {
22844
- log20.error("task.stop-route-failed", { error: formatLogError(error) });
23915
+ log21.error("task.stop-route-failed", { error: formatLogError(error) });
22845
23916
  return c.json({ error: errorMessage(error, "Failed to stop background task") }, sessionErrorStatus(error));
22846
23917
  }
22847
23918
  });
@@ -22912,7 +23983,7 @@ session.post("/:id/questions/:questionId/answer", questionAnswerBodyLimit, async
22912
23983
  const pendingQuestions = getPendingQuestions(sessionId);
22913
23984
  const pendingQuestion = pendingQuestions.find((q) => q.id === questionId);
22914
23985
  if (!pendingQuestion) {
22915
- log20.info("question.stale", { questionId });
23986
+ log21.info("question.stale", { questionId });
22916
23987
  return c.json(stalePrompt("Question is no longer pending"), STALE_PROMPT_STATUS);
22917
23988
  }
22918
23989
  if (!isBoundedClaudeQuestionAnswers(answersArray, pendingQuestion.questions.length)) {
@@ -22923,7 +23994,7 @@ session.post("/:id/questions/:questionId/answer", questionAnswerBodyLimit, async
22923
23994
  const questionAnswers = answersArray[index] || [];
22924
23995
  answersRecord[q.question] = serializeClaudeQuestionAnswer(questionAnswers, q.multiSelect === true);
22925
23996
  });
22926
- log20.debug("question.answers-prepared", {
23997
+ log21.debug("question.answers-prepared", {
22927
23998
  questionId,
22928
23999
  questionCount: pendingQuestion.questions.length,
22929
24000
  answerCount: answersArray.reduce((count, answers) => count + answers.length, 0)
@@ -22935,7 +24006,7 @@ session.post("/:id/questions/:questionId/answer", questionAnswerBodyLimit, async
22935
24006
  return c.json(stalePrompt("Question is no longer pending"), STALE_PROMPT_STATUS);
22936
24007
  }
22937
24008
  } catch (error) {
22938
- log20.error("question.answer-failed", { error: formatLogError(error) });
24009
+ log21.error("question.answer-failed", { error: formatLogError(error) });
22939
24010
  return c.json({ error: error instanceof Error ? error.message : "Failed to answer question" }, 500);
22940
24011
  }
22941
24012
  });
@@ -22975,7 +24046,7 @@ session.post("/:id/plan-approvals/:approvalId/respond", planApprovalBodyLimit, a
22975
24046
  if (approved && (typeof pendingApproval.plan !== "string" || pendingApproval.plan.trim().length === 0 || pendingApproval.planTruncated === true)) {
22976
24047
  return c.json({ error: "A complete plan is required before approval", status: "rejected" }, 409);
22977
24048
  }
22978
- log20.info("plan-approval.response-received", {
24049
+ log21.info("plan-approval.response-received", {
22979
24050
  sessionId,
22980
24051
  approvalId,
22981
24052
  approved,
@@ -22988,7 +24059,7 @@ session.post("/:id/plan-approvals/:approvalId/respond", planApprovalBodyLimit, a
22988
24059
  return c.json(stalePrompt("Plan approval is no longer pending"), STALE_PROMPT_STATUS);
22989
24060
  }
22990
24061
  } catch (error) {
22991
- log20.error("plan-approval.response-failed", { error: formatLogError(error) });
24062
+ log21.error("plan-approval.response-failed", { error: formatLogError(error) });
22992
24063
  return c.json({ error: error instanceof Error ? error.message : "Failed to respond to plan approval" }, 500);
22993
24064
  }
22994
24065
  });
@@ -23270,7 +24341,7 @@ var streamSSE = (c, cb, onError) => {
23270
24341
  };
23271
24342
 
23272
24343
  // ../../bridges/claude-bridge/src/routes/events.ts
23273
- var log21 = createLogger("bridge.claude");
24344
+ var log22 = createLogger("bridge.claude");
23274
24345
  var serializedEventData = new WeakMap;
23275
24346
  function serializeEventData(event) {
23276
24347
  let data = serializedEventData.get(event);
@@ -23445,10 +24516,10 @@ function createEventsRouter(limits = {}) {
23445
24516
  events.get("/subscribe", (c) => {
23446
24517
  const origin = c.req.header("origin");
23447
24518
  const userAgent = c.req.header("user-agent");
23448
- log21.debug("sse.subscribe-requested", { origin, userAgent });
24519
+ log22.debug("sse.subscribe-requested", { origin, userAgent });
23449
24520
  return streamSSE(c, async (stream) => {
23450
24521
  const connectedAt = new Date().toISOString();
23451
- log21.debug("sse.opened", { connectedAt });
24522
+ log22.debug("sse.opened", { connectedAt });
23452
24523
  let isOpen = true;
23453
24524
  let resolveConnectionClosed;
23454
24525
  const connectionClosed = new Promise((resolve) => {
@@ -23459,7 +24530,7 @@ function createEventsRouter(limits = {}) {
23459
24530
  resolveRequestAborted = resolve;
23460
24531
  });
23461
24532
  const onRequestAbort = () => {
23462
- log21.debug("sse.aborted");
24533
+ log22.debug("sse.aborted");
23463
24534
  isOpen = false;
23464
24535
  resolveRequestAborted();
23465
24536
  };
@@ -23473,7 +24544,7 @@ function createEventsRouter(limits = {}) {
23473
24544
  if (!isOpen)
23474
24545
  return;
23475
24546
  isOpen = false;
23476
- log21.info("sse.closed", { reason });
24547
+ log22.info("sse.closed", { reason });
23477
24548
  resolveConnectionClosed();
23478
24549
  };
23479
24550
  const writeFrame = createBoundedSseWriter(async (frame) => {
@@ -23516,7 +24587,7 @@ function createEventsRouter(limits = {}) {
23516
24587
  }
23517
24588
  writeFrame(frame).catch((error) => {
23518
24589
  if (!c.req.raw.signal.aborted) {
23519
- log21.warn("sse.write-failed", { error: formatLogError(error) });
24590
+ log22.warn("sse.write-failed", { error: formatLogError(error) });
23520
24591
  closeConnection("write failed");
23521
24592
  }
23522
24593
  });
@@ -23568,7 +24639,7 @@ function createEventsRouter(limits = {}) {
23568
24639
  data: JSON.stringify({ timestamp: new Date().toISOString() })
23569
24640
  }).catch((error) => {
23570
24641
  if (!c.req.raw.signal.aborted) {
23571
- log21.debug("sse.keepalive-failed", { error: formatLogError(error, { stack: false }) });
24642
+ log22.warn("sse.keepalive-failed", { error: formatLogError(error, { stack: false }) });
23572
24643
  closeConnection("keepalive failed");
23573
24644
  }
23574
24645
  });
@@ -23576,10 +24647,10 @@ function createEventsRouter(limits = {}) {
23576
24647
  await Promise.race([connectionClosed, requestAborted]);
23577
24648
  } catch (error) {
23578
24649
  if (!c.req.raw.signal.aborted) {
23579
- log21.warn("sse.handshake-failed", { error: formatLogError(error) });
24650
+ log22.warn("sse.handshake-failed", { error: formatLogError(error) });
23580
24651
  }
23581
24652
  } finally {
23582
- log21.debug("sse.cleanup");
24653
+ log22.debug("sse.cleanup");
23583
24654
  isOpen = false;
23584
24655
  c.req.raw.signal.removeEventListener("abort", onRequestAbort);
23585
24656
  if (keepaliveInterval)
@@ -23595,7 +24666,7 @@ var events = createEventsRouter();
23595
24666
  var events_default = events;
23596
24667
 
23597
24668
  // ../../bridges/claude-bridge/src/routes/mcp.ts
23598
- var log22 = createLogger("bridge.claude");
24669
+ var log23 = createLogger("bridge.claude");
23599
24670
  var mcp = new Hono2;
23600
24671
  mcp.get("/servers", async (c) => {
23601
24672
  try {
@@ -23606,14 +24677,14 @@ mcp.get("/servers", async (c) => {
23606
24677
  cwd
23607
24678
  });
23608
24679
  } catch (error) {
23609
- log22.error("mcp.read-failed", { error: formatLogError(error) });
24680
+ log23.error("mcp.read-failed", { error: formatLogError(error) });
23610
24681
  return c.json({ error: error instanceof Error ? error.message : "Failed to get MCP servers" }, 500);
23611
24682
  }
23612
24683
  });
23613
24684
  var mcp_default = mcp;
23614
24685
 
23615
24686
  // ../../bridges/claude-bridge/src/routes/plugins.ts
23616
- var log23 = createLogger("bridge.claude");
24687
+ var log24 = createLogger("bridge.claude");
23617
24688
  var plugins = new Hono2;
23618
24689
  plugins.get("/", async (c) => {
23619
24690
  try {
@@ -23624,7 +24695,7 @@ plugins.get("/", async (c) => {
23624
24695
  cwd
23625
24696
  });
23626
24697
  } catch (error) {
23627
- log23.error("plugins.read-failed", { error: formatLogError(error) });
24698
+ log24.error("plugins.read-failed", { error: formatLogError(error) });
23628
24699
  return c.json({ error: error instanceof Error ? error.message : "Failed to get plugins" }, 500);
23629
24700
  }
23630
24701
  });
@@ -25297,11 +26368,11 @@ var serve = (options, listeningListener) => {
25297
26368
  };
25298
26369
 
25299
26370
  // ../../bridges/claude-bridge/src/index.ts
25300
- var log24 = createLogger("bridge.claude");
26371
+ var log25 = createLogger("bridge.claude");
25301
26372
  configureBridgeLogger();
25302
26373
  var app = new Hono2;
25303
26374
  app.onError((error, c) => {
25304
- log24.error("http.request-failed", {
26375
+ log25.error("http.request-failed", {
25305
26376
  method: c.req.method,
25306
26377
  path: c.req.path,
25307
26378
  error: formatLogError(error)
@@ -25430,7 +26501,7 @@ if (parentPid !== null) {
25430
26501
  startParentWatchdog({
25431
26502
  parentPid,
25432
26503
  onParentExit: () => {
25433
- log24.warn("parent.gone", { parentPid });
26504
+ log25.warn("parent.gone", { parentPid });
25434
26505
  process.exit(0);
25435
26506
  }
25436
26507
  });
@@ -25441,13 +26512,13 @@ function startBridgeServer(env = process.env, start = serve) {
25441
26512
  }
25442
26513
  const port = parseInt(env.PORT || "4097", 10);
25443
26514
  const hostname = env.HOSTNAME || "0.0.0.0";
25444
- log24.debug("server.starting", { hostname, port });
26515
+ log25.debug("server.starting", { hostname, port });
25445
26516
  const server = start({
25446
26517
  fetch: app.fetch,
25447
26518
  port,
25448
26519
  hostname
25449
26520
  });
25450
- log24.info("server.listening", { hostname, port });
26521
+ log25.info("server.listening", { hostname, port });
25451
26522
  return server;
25452
26523
  }
25453
26524
  var __testing = {