orkestrator 2.35.4-beta → 2.35.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +721 -12
- package/dist/main.js +68681 -64086
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +1145 -286
- package/resources/claude-bridge/dist/index.js +1055 -141
- package/resources/codex-bridge/dist/index.js +995 -133
- package/resources/cursor-bridge/dist/index.js +909 -48
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +906 -44
- package/resources/pi-bridge/runtime/install.json +1 -1
|
@@ -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,
|
|
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: "
|
|
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.",
|
|
@@ -345,7 +379,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
345
379
|
// ../protocol/src/log-vocabulary/environment.ts
|
|
346
380
|
var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
347
381
|
environment: {
|
|
348
|
-
description: "Environment naming,
|
|
382
|
+
description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
|
|
349
383
|
events: {
|
|
350
384
|
"cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
|
|
351
385
|
"rename.failed": "Naming an environment from its pending prompt failed for the first time.",
|
|
@@ -354,6 +388,40 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
354
388
|
"setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
|
|
355
389
|
"setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
|
|
356
390
|
"setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
|
|
391
|
+
"cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
|
|
392
|
+
"cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
|
|
393
|
+
"cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
|
|
394
|
+
"cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
|
|
395
|
+
"cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
|
|
396
|
+
"cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
|
|
397
|
+
"cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
|
|
398
|
+
"orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
|
|
399
|
+
"orphan-state.removed": "Orphaned environment state directories were removed.",
|
|
400
|
+
"orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
|
|
401
|
+
"orphan-canvas.removed": "Orphaned design canvases were removed.",
|
|
402
|
+
"orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
|
|
403
|
+
"orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
|
|
404
|
+
"stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
|
|
405
|
+
"stray-workspace.removed": "Stray workspace directories were removed.",
|
|
406
|
+
"stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
|
|
407
|
+
"temp-files.removed": "Abandoned temp files were removed.",
|
|
408
|
+
"status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
|
|
409
|
+
"status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
|
|
410
|
+
"setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
|
|
411
|
+
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
412
|
+
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
413
|
+
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
414
|
+
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
415
|
+
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
416
|
+
"handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
|
|
417
|
+
"delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
|
|
418
|
+
"delete.artifacts-left": "Graph run artifact directories were not removed.",
|
|
419
|
+
"delete.worktrees-kept": "Graph runs kept branch worktrees.",
|
|
420
|
+
"delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
|
|
421
|
+
"merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
|
|
422
|
+
"move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
|
|
423
|
+
"move.recovery-failed": "Recovering an interrupted environment move failed.",
|
|
424
|
+
"stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
|
|
357
425
|
...THROTTLE_LOG_EVENTS
|
|
358
426
|
}
|
|
359
427
|
}
|
|
@@ -362,10 +430,50 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
362
430
|
// ../protocol/src/log-vocabulary/gateway.ts
|
|
363
431
|
var GATEWAY_LOG_AREAS = defineLogAreas({
|
|
364
432
|
gateway: {
|
|
365
|
-
description: "The
|
|
433
|
+
description: "The gateway other devices, browsers and the desktop connect through.",
|
|
366
434
|
events: {
|
|
367
435
|
"remote.start-failed": "The desktop could not start the remote gateway.",
|
|
368
|
-
"remote.stop-failed": "The desktop could not stop the remote gateway cleanly."
|
|
436
|
+
"remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
|
|
437
|
+
disabled: "The gateway is disabled by its environment variable.",
|
|
438
|
+
"tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
|
|
439
|
+
"tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
|
|
440
|
+
"control.listening": "The backend control listener is up.",
|
|
441
|
+
"browser.listening": "The browser listener is up.",
|
|
442
|
+
"browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
|
|
443
|
+
"browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
|
|
444
|
+
"loopback.listening": "The loopback client listener is up.",
|
|
445
|
+
"loopback.unavailable": "The loopback client listener could not start.",
|
|
446
|
+
"auth-token.stored": "The gateway token's file was written. The path only, never the token.",
|
|
447
|
+
"auth-token.persist-failed": "The gateway token could not be saved.",
|
|
448
|
+
"port.fallback": "The preferred port was taken, so a nearby one is used.",
|
|
449
|
+
"port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
|
|
450
|
+
"request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
|
|
451
|
+
"websocket.upgrade-failed": "A WebSocket upgrade failed.",
|
|
452
|
+
"events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
|
|
453
|
+
"proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
|
|
454
|
+
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
455
|
+
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
456
|
+
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"gateway.terminal": {
|
|
460
|
+
description: "The gateway's terminal WebSocket.",
|
|
461
|
+
events: {
|
|
462
|
+
"upgrade-rejected": "A terminal WebSocket upgrade was refused.",
|
|
463
|
+
"socket-error": "A terminal WebSocket reported an error.",
|
|
464
|
+
"subscription-failed": "A terminal subscription failed.",
|
|
465
|
+
"operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"gateway.tailscale": {
|
|
469
|
+
description: "Tailscale Serve for desktop web access and a standalone backend.",
|
|
470
|
+
events: {
|
|
471
|
+
"web-access.disable-failed": "Desktop web access could not be turned off.",
|
|
472
|
+
"web-access.enable-failed": "Desktop web access could not be turned on.",
|
|
473
|
+
"web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
|
|
474
|
+
"web-access.reset-failed": "Desktop web access could not be reset.",
|
|
475
|
+
"startup.init-failed": "Desktop web access could not be initialized at startup.",
|
|
476
|
+
available: "Tailscale Serve is publishing the gateway."
|
|
369
477
|
}
|
|
370
478
|
}
|
|
371
479
|
});
|
|
@@ -376,6 +484,18 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
|
|
|
376
484
|
description: "Agent bridge processes the backend runs on the host.",
|
|
377
485
|
events: {
|
|
378
486
|
"bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
|
|
487
|
+
"bridge-runtime.installing": "A bridge runtime is being installed.",
|
|
488
|
+
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
489
|
+
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
490
|
+
"server.stopping": "A local server is being stopped, for the fixed `reason` given.",
|
|
491
|
+
"reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
|
|
492
|
+
"reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
|
|
493
|
+
"reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
|
|
494
|
+
"reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
|
|
495
|
+
"reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
|
|
496
|
+
"reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
|
|
497
|
+
"reaper.server-reaping": "An orphaned server is being stopped.",
|
|
498
|
+
"reaper.server-kill-failed": "An orphaned server did not exit.",
|
|
379
499
|
...THROTTLE_LOG_EVENTS
|
|
380
500
|
}
|
|
381
501
|
}
|
|
@@ -417,7 +537,12 @@ var MODEL_LOG_AREAS = defineLogAreas({
|
|
|
417
537
|
models: {
|
|
418
538
|
description: "Agent model catalogues and their persistent caches.",
|
|
419
539
|
events: {
|
|
420
|
-
"cache.write-failed": "A successful catalogue refresh could not update the host cache."
|
|
540
|
+
"cache.write-failed": "A successful catalogue refresh could not update the host cache.",
|
|
541
|
+
"seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
|
|
542
|
+
"bridge.not-ready": "The first-use catalogue bridge did not become ready.",
|
|
543
|
+
"bridge.start-failed": "The first-use catalogue bridge failed to start.",
|
|
544
|
+
"probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
|
|
545
|
+
"download.deferred": "A model catalogue could not be downloaded yet."
|
|
421
546
|
}
|
|
422
547
|
}
|
|
423
548
|
});
|
|
@@ -428,8 +553,61 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
428
553
|
description: "Native agent sessions and what the backend reads from their bridges.",
|
|
429
554
|
events: {
|
|
430
555
|
"catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
|
|
556
|
+
"handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
|
|
557
|
+
"handoff.consume-failed": "A delivered handoff could not be marked consumed.",
|
|
558
|
+
"job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
|
|
559
|
+
"job.resend-queue-failed": "A resend could not be queued for a job.",
|
|
560
|
+
"interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
|
|
561
|
+
"interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
|
|
562
|
+
"human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
|
|
563
|
+
"question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
|
|
564
|
+
"activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
|
|
565
|
+
"activity.persist-failed": "An environment's activity could not be saved.",
|
|
566
|
+
"pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
|
|
567
|
+
"launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
|
|
568
|
+
"queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
|
|
569
|
+
"provider.retire-failed": "Retiring an obsolete provider failed.",
|
|
570
|
+
"workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
|
|
571
|
+
"catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
|
|
572
|
+
"dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
|
|
573
|
+
"coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
|
|
574
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
575
|
+
"interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
|
|
576
|
+
"resume.close-replaced-failed": "The session a resume replaced could not be closed.",
|
|
577
|
+
"sign-in.check-failed": "A turn could not be checked for a login refusal.",
|
|
578
|
+
"sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
|
|
579
|
+
"sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
|
|
580
|
+
"shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
|
|
581
|
+
"turn-recovery.failed": "Recovering an incomplete turn failed.",
|
|
582
|
+
"turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
|
|
583
|
+
"turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
|
|
584
|
+
"usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
|
|
585
|
+
"title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
|
|
431
586
|
...THROTTLE_LOG_EVENTS
|
|
432
587
|
}
|
|
588
|
+
},
|
|
589
|
+
"native-agent.goal": {
|
|
590
|
+
description: "The /goal loop: advancing goals and their verifiers.",
|
|
591
|
+
events: {
|
|
592
|
+
"advance.failed": "A goal could not advance; the next sweep retries.",
|
|
593
|
+
"attention.record-failed": "Attention for a goal could not be recorded.",
|
|
594
|
+
"turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
|
|
595
|
+
"verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
|
|
596
|
+
"verifier.stop-failed": "An earlier verifier could not be stopped.",
|
|
597
|
+
"recover.failed": "Goals could not be recovered at startup."
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
"native-agent.opencode": {
|
|
601
|
+
description: "The OpenCode provider: its request monitor, retries and agent tools.",
|
|
602
|
+
events: {
|
|
603
|
+
"retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
|
|
604
|
+
"retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
|
|
605
|
+
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
606
|
+
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
607
|
+
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
608
|
+
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
609
|
+
"request.failed": "Handling a request event failed, so the stream restarts. Error class only."
|
|
610
|
+
}
|
|
433
611
|
}
|
|
434
612
|
});
|
|
435
613
|
|
|
@@ -452,6 +630,17 @@ var PREVIEW_LOG_AREAS = defineLogAreas({
|
|
|
452
630
|
"partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
|
|
453
631
|
"port-hints.persist-failed": "Preview port hints could not be saved.",
|
|
454
632
|
"transport.close-failed": "A preview transport could not be closed.",
|
|
633
|
+
"ca-bundle.read-failed": "The upstream CA bundle could not be read.",
|
|
634
|
+
"publication.start-failed": "Private preview publication did not start.",
|
|
635
|
+
"publication.reconfigure-failed": "Preview publication could not be reconfigured.",
|
|
636
|
+
"publication.listening": "Private preview origins are listening.",
|
|
637
|
+
"certificate.reloaded": "The preview certificate was reloaded.",
|
|
638
|
+
"access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
|
|
639
|
+
"registry.invalid-definition": "An invalid stored preview service definition was ignored.",
|
|
640
|
+
"registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
|
|
641
|
+
"registry.resolver-failed": "A preview resolver failed. Error class only.",
|
|
642
|
+
"registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
|
|
643
|
+
"registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
|
|
455
644
|
...THROTTLE_LOG_EVENTS
|
|
456
645
|
}
|
|
457
646
|
}
|
|
@@ -470,9 +659,33 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
|
|
|
470
659
|
// ../protocol/src/log-vocabulary/terminal.ts
|
|
471
660
|
var TERMINAL_LOG_AREAS = defineLogAreas({
|
|
472
661
|
terminal: {
|
|
473
|
-
description: "The renderer's
|
|
662
|
+
description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
|
|
474
663
|
events: {
|
|
475
664
|
"input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
|
|
665
|
+
"orphan.reaped": "A terminal no tab references was closed.",
|
|
666
|
+
"agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
|
|
667
|
+
"activity.record-failed": "Terminal environment activity could not be recorded.",
|
|
668
|
+
"pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
|
|
669
|
+
"pty.exit-notify-failed": "Notifying a terminal's exit failed.",
|
|
670
|
+
"pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
|
|
671
|
+
"setup.pty-reused": "A setup terminal reused its existing PTY.",
|
|
672
|
+
"setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
|
|
673
|
+
"setup.pty-spawned": "A setup terminal's PTY started.",
|
|
674
|
+
"setup.pty-exited": "A setup terminal's PTY exited.",
|
|
675
|
+
"setup.preparing": "Workspace preparation started in the setup terminal.",
|
|
676
|
+
"setup.session-creating": "A setup session is being created.",
|
|
677
|
+
"setup.intro-emitted": "The setup intro was written to the terminal.",
|
|
678
|
+
"setup.completed": "Setup finished.",
|
|
679
|
+
"setup.failed": "Setup failed.",
|
|
680
|
+
"setup.already-complete": "Setup was requested but had already finished.",
|
|
681
|
+
"setup.renderer-ensured": "The renderer asked for setup to be running.",
|
|
682
|
+
"setup.renderer-requested": "The renderer asked for the setup session.",
|
|
683
|
+
"setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
|
|
684
|
+
"setup.no-commands": "An environment has no setup commands to run.",
|
|
685
|
+
"setup.already-running": "Setup was requested while it was already running.",
|
|
686
|
+
"setup.held-for-approval": "Setup is held until its commands are approved.",
|
|
687
|
+
"setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
|
|
688
|
+
"setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
|
|
476
689
|
"input.resume-failed": "Asking the backend to resume refused terminal input failed.",
|
|
477
690
|
"input.write-failed": "Writing input to a terminal session threw.",
|
|
478
691
|
"listener.remove-failed": "Removing a terminal output listener threw.",
|
|
@@ -572,13 +785,39 @@ var TERMINAL_LOG_AREAS = defineLogAreas({
|
|
|
572
785
|
// ../protocol/src/log-vocabulary/tmux.ts
|
|
573
786
|
var TMUX_LOG_AREAS = defineLogAreas({
|
|
574
787
|
tmux: {
|
|
575
|
-
description: "
|
|
788
|
+
description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
|
|
576
789
|
events: {
|
|
577
790
|
"poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
|
|
578
791
|
"poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
|
|
579
792
|
"poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
|
|
580
793
|
"poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
|
|
581
794
|
"poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
|
|
795
|
+
"cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
|
|
796
|
+
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
797
|
+
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
798
|
+
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
799
|
+
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
800
|
+
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
801
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
802
|
+
"orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
|
|
803
|
+
"orphan.reaped": "A tmux session no tab references was killed.",
|
|
804
|
+
"orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
|
|
805
|
+
"cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
|
|
806
|
+
"cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
|
|
807
|
+
"cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
|
|
808
|
+
"interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
|
|
809
|
+
"signal.arm-failed": "The Claude state signal could not be armed.",
|
|
810
|
+
"signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
|
|
811
|
+
"pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
|
|
812
|
+
"pr-probe.failed": "Probing for a pull request an agent created failed.",
|
|
813
|
+
"activity.persist-failed": "Tmux tab activity could not be saved.",
|
|
814
|
+
"fast-mode.persist-failed": "The launch fast mode could not be saved.",
|
|
815
|
+
"fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
|
|
816
|
+
"pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
|
|
817
|
+
"turn.failure-record-failed": "A failed turn could not be recorded.",
|
|
818
|
+
"slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
|
|
819
|
+
"queue.failing": "A tmux prompt queue keeps failing to dispatch.",
|
|
820
|
+
"queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
|
|
582
821
|
...THROTTLE_LOG_EVENTS
|
|
583
822
|
}
|
|
584
823
|
}
|
|
@@ -605,7 +844,8 @@ var UPDATER_LOG_AREAS = defineLogAreas({
|
|
|
605
844
|
"remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
|
|
606
845
|
"restart-prompt.failed": "The restart prompt for a downloaded update failed.",
|
|
607
846
|
unavailable: "Auto-update could not be set up in this session.",
|
|
608
|
-
"update.failed": "electron-updater reported an update error."
|
|
847
|
+
"update.failed": "electron-updater reported an update error.",
|
|
848
|
+
"standalone.restarting": "A standalone backend is restarting into a new version."
|
|
609
849
|
}
|
|
610
850
|
}
|
|
611
851
|
});
|
|
@@ -616,11 +856,460 @@ var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
|
|
|
616
856
|
description: "Web annotation requests and their background reconciler.",
|
|
617
857
|
events: {
|
|
618
858
|
"reconcile.failed": "A background reconcile pass failed; the next one retries.",
|
|
859
|
+
"legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
|
|
860
|
+
"legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
|
|
861
|
+
"legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
|
|
862
|
+
"legacy.unavailable": "Legacy annotation storage could not be read.",
|
|
863
|
+
"legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
|
|
864
|
+
"legacy.archive-failed": "Imported legacy annotation files could not be archived.",
|
|
865
|
+
"legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
|
|
866
|
+
"migration.draft-failed": "Migrating one draft failed.",
|
|
867
|
+
"draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
|
|
868
|
+
"request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
|
|
869
|
+
"evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
|
|
870
|
+
"queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
|
|
871
|
+
"request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
|
|
872
|
+
"turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
|
|
873
|
+
"gc.failed": "Annotation garbage collection failed; the next pass retries.",
|
|
874
|
+
"record.unavailable": "An annotation record is unavailable; written once per record.",
|
|
875
|
+
"storage.unavailable": "An environment's annotation store is unreadable.",
|
|
876
|
+
"change-hint.listener-failed": "A change hint listener threw.",
|
|
877
|
+
"orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
|
|
878
|
+
"storage.load-failed": "An environment's annotation storage could not be loaded.",
|
|
619
879
|
...THROTTLE_LOG_EVENTS
|
|
620
880
|
}
|
|
621
881
|
}
|
|
622
882
|
});
|
|
623
883
|
|
|
884
|
+
// ../protocol/src/log-vocabulary/storage.ts
|
|
885
|
+
var STORAGE_LOG_AREAS = defineLogAreas({
|
|
886
|
+
storage: {
|
|
887
|
+
description: "The SQLite-backed stores, their snapshots and imports from older formats.",
|
|
888
|
+
events: {
|
|
889
|
+
"usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
|
|
890
|
+
"snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
|
|
891
|
+
"snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
|
|
892
|
+
"snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
|
|
893
|
+
"listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
|
|
894
|
+
"listener.change-failed": "A resource change listener threw; the committed mutation stands.",
|
|
895
|
+
"kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
|
|
896
|
+
"nodes.entries-dropped": "Unreadable node registry entries were ignored.",
|
|
897
|
+
"preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
|
|
898
|
+
"machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
|
|
899
|
+
"permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
|
|
900
|
+
"retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
|
|
901
|
+
"handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
|
|
902
|
+
"desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
|
|
903
|
+
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
904
|
+
"legacy-json.archive-failed": "Imported JSON store files could not be archived."
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
// ../protocol/src/log-vocabulary/build-pipeline.ts
|
|
910
|
+
var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
911
|
+
"build-pipeline": {
|
|
912
|
+
description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
|
|
913
|
+
events: {
|
|
914
|
+
"sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
|
|
915
|
+
"sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
|
|
916
|
+
"result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
|
|
917
|
+
"consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
|
|
918
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
|
|
919
|
+
"interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
|
|
920
|
+
"transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
|
|
921
|
+
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
922
|
+
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
923
|
+
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
924
|
+
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
925
|
+
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
926
|
+
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
927
|
+
"usage.read-failed": "Reading a stage session's token usage failed.",
|
|
928
|
+
"checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
|
|
929
|
+
"checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
|
|
930
|
+
"legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
// ../protocol/src/log-vocabulary/agent-branch.ts
|
|
936
|
+
var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
|
|
937
|
+
"agent-branch": {
|
|
938
|
+
description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
|
|
939
|
+
events: {
|
|
940
|
+
"observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
|
|
941
|
+
"transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
|
|
942
|
+
"usage.read-failed": "Reading a reviewer's token usage failed.",
|
|
943
|
+
"result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
|
|
944
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
|
|
945
|
+
"result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
|
|
950
|
+
// ../protocol/src/log-vocabulary/change-tracking.ts
|
|
951
|
+
var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
|
|
952
|
+
"change-tracking": {
|
|
953
|
+
description: "Change tracking: turn capture, evidence pulls and measurements.",
|
|
954
|
+
events: {
|
|
955
|
+
"journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
|
|
956
|
+
"projection.failed": "Projecting a change event onto its environment failed.",
|
|
957
|
+
"startup.reconcile-failed": "Reconciling change tracking at startup failed.",
|
|
958
|
+
"turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
|
|
959
|
+
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
960
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
961
|
+
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
962
|
+
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
963
|
+
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
"diff-stats": {
|
|
967
|
+
description: "Environment diff stats and the worktree signals that drive them.",
|
|
968
|
+
events: {
|
|
969
|
+
"baseline.update-failed": "An environment's diff baseline could not be updated.",
|
|
970
|
+
"scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
|
|
971
|
+
"scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
|
|
972
|
+
"scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
|
|
973
|
+
"scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
|
|
974
|
+
"emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
|
|
975
|
+
"emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
|
|
976
|
+
"signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
// ../protocol/src/log-vocabulary/coordinator.ts
|
|
982
|
+
var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
983
|
+
coordinator: {
|
|
984
|
+
description: "Coordinators: delegations, status wakes and their store.",
|
|
985
|
+
events: {
|
|
986
|
+
"delegation.open-failed": "A delegation could not be opened; `source` says for what.",
|
|
987
|
+
"deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
|
|
988
|
+
"mail.move-failed": "Mail could not move to the new main coordinator.",
|
|
989
|
+
"work.move-failed": "Work could not move to the main coordinator.",
|
|
990
|
+
"wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
|
|
991
|
+
"wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
|
|
992
|
+
"wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
|
|
993
|
+
"wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
|
|
994
|
+
"wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
|
|
995
|
+
"wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
|
|
996
|
+
"wake.waiting-report-failed": "A waiting worker could not be reported.",
|
|
997
|
+
"wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
|
|
998
|
+
"store.malformed": "The coordinator store was malformed and is treated as empty.",
|
|
999
|
+
"store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
|
|
1000
|
+
"store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
|
|
1001
|
+
"store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
|
|
1002
|
+
"store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
|
|
1003
|
+
"remote-worker.settle-failed": "A remote worker could not be settled."
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
// ../protocol/src/log-vocabulary/review.ts
|
|
1009
|
+
var REVIEW_LOG_AREAS = defineLogAreas({
|
|
1010
|
+
review: {
|
|
1011
|
+
description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
|
|
1012
|
+
events: {
|
|
1013
|
+
"fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
|
|
1014
|
+
"graph-run.not-started": "A workflow's graph run did not start.",
|
|
1015
|
+
"reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
|
|
1016
|
+
"graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
|
|
1017
|
+
"graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
|
|
1018
|
+
"delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
|
|
1019
|
+
"fix-session.read-failed": "Reading an interactive fix session's state failed.",
|
|
1020
|
+
"fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
|
|
1021
|
+
"fix-usage.read-failed": "Reading a fix session's token usage failed.",
|
|
1022
|
+
"result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
|
|
1023
|
+
"failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
"pull-request": {
|
|
1027
|
+
description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
|
|
1028
|
+
events: {
|
|
1029
|
+
"merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
|
|
1030
|
+
"refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
|
|
1031
|
+
"arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
|
|
1032
|
+
"gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
|
|
1033
|
+
"monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
|
|
1034
|
+
"cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
|
|
1035
|
+
"auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
|
|
1036
|
+
"auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
|
|
1037
|
+
"auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
|
|
1038
|
+
"monitor.detection-failed": "Checking an environment for its pull request failed.",
|
|
1039
|
+
"monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
|
|
1040
|
+
"monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
|
|
1041
|
+
"monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
|
|
1042
|
+
"monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
|
|
1043
|
+
"monitor.state-persist-failed": "A pull request's observed state could not be saved.",
|
|
1044
|
+
"monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
|
|
1045
|
+
"monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
|
|
1046
|
+
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
1047
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
|
|
1052
|
+
// ../protocol/src/log-vocabulary/public-api.ts
|
|
1053
|
+
var PUBLIC_API_LOG_AREAS = defineLogAreas({
|
|
1054
|
+
"public-api": {
|
|
1055
|
+
description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
|
|
1056
|
+
events: {
|
|
1057
|
+
"outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
|
|
1058
|
+
"goal-checks.stop-failed": "Goal checks could not be stopped.",
|
|
1059
|
+
"exec.list-failed": "Exec workers could not be listed.",
|
|
1060
|
+
"exec.cancel-failed": "An exec could not be cancelled.",
|
|
1061
|
+
"goal-workers.list-failed": "Goal check workers could not be listed.",
|
|
1062
|
+
"operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
|
|
1063
|
+
"reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
// ../protocol/src/log-vocabulary/agent-accounts.ts
|
|
1069
|
+
var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
|
|
1070
|
+
"agent-accounts": {
|
|
1071
|
+
description: "Agent accounts: automatic switching, staged logins and plan usage.",
|
|
1072
|
+
events: {
|
|
1073
|
+
"switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
|
|
1074
|
+
"auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
|
|
1075
|
+
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
1076
|
+
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
1077
|
+
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
1078
|
+
"login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
|
|
1083
|
+
// ../protocol/src/log-vocabulary/docker.ts
|
|
1084
|
+
var DOCKER_LOG_AREAS = defineLogAreas({
|
|
1085
|
+
docker: {
|
|
1086
|
+
description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
|
|
1087
|
+
events: {
|
|
1088
|
+
"portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
|
|
1089
|
+
"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.",
|
|
1090
|
+
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
1091
|
+
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
1092
|
+
"login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
|
|
1093
|
+
"login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
|
|
1094
|
+
"login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
|
|
1095
|
+
"login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
|
|
1096
|
+
"lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
|
|
1097
|
+
"lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
|
|
1098
|
+
"replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
|
|
1099
|
+
"recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
|
|
1100
|
+
"github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
|
|
1101
|
+
"availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
|
|
1102
|
+
"start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
"docker.reachability": {
|
|
1106
|
+
description: "Whether agents in containers can reach the backend's agent tools server.",
|
|
1107
|
+
events: {
|
|
1108
|
+
"check.crashed": "A reachability check crashed.",
|
|
1109
|
+
"check.started": "A reachability check started.",
|
|
1110
|
+
"check.finished": "A reachability check finished.",
|
|
1111
|
+
"check.probe": "One probe of a finished check.",
|
|
1112
|
+
"check.summary": "Content-free status and reason for a check that did not find the host reachable.",
|
|
1113
|
+
"check.remediation": "One command the user can run to unblock containers.",
|
|
1114
|
+
"shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
|
|
1115
|
+
"shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
|
|
1116
|
+
"shutdown.removing-resources": "Shutdown is removing probe resources.",
|
|
1117
|
+
"shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
|
|
1118
|
+
"shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
|
|
1119
|
+
"probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
|
|
1120
|
+
"preflight.refused": "A stage was refused because its container cannot reach the host.",
|
|
1121
|
+
"probe.prepare-failed": "A container could not be prepared for a probe.",
|
|
1122
|
+
"probe.result": "The outcome of probing one container.",
|
|
1123
|
+
"probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
|
|
1124
|
+
"topology.detected": "The Docker topology was read.",
|
|
1125
|
+
"firewall.detected": "The host firewall was read.",
|
|
1126
|
+
"probe-network.remove-failed": "The probe network could not be removed.",
|
|
1127
|
+
"probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
|
|
1128
|
+
"event.emit-failed": "A reachability event could not be emitted.",
|
|
1129
|
+
"host-addresses.list-failed": "Host addresses could not be listed.",
|
|
1130
|
+
"probe-image.present": "The probe image is already present.",
|
|
1131
|
+
"probe-image.pulling": "The probe image is being pulled.",
|
|
1132
|
+
"probe-image.pulled": "The probe image was pulled.",
|
|
1133
|
+
"probe-image.pull-failed": "The probe image could not be pulled.",
|
|
1134
|
+
"probe-image.fallback": "The environment image is used as the probe image.",
|
|
1135
|
+
"probe-image.missing": "No probe image is available.",
|
|
1136
|
+
"network.list-failed": "Docker networks could not be listed.",
|
|
1137
|
+
"network.inspect-failed": "A Docker network could not be inspected.",
|
|
1138
|
+
"stale-containers.removing": "Stale probe containers are being removed.",
|
|
1139
|
+
"stale-networks.removing": "Stale probe networks are being removed."
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
|
|
1144
|
+
// ../protocol/src/log-vocabulary/mcp.ts
|
|
1145
|
+
var MCP_LOG_AREAS = defineLogAreas({
|
|
1146
|
+
"control-mcp": {
|
|
1147
|
+
description: "The Control MCP server other agents and devices reach Orkestrator through.",
|
|
1148
|
+
events: {
|
|
1149
|
+
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
1150
|
+
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
1151
|
+
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
1152
|
+
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
"mcp-management": {
|
|
1156
|
+
description: "Managed MCP configuration: its commands, overlays and apply loop.",
|
|
1157
|
+
events: {
|
|
1158
|
+
"command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
|
|
1159
|
+
"overlay.materialise-failed": "An MCP overlay could not be written.",
|
|
1160
|
+
"apply.tick-failed": "An MCP apply tick failed; the next one retries."
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
|
|
1165
|
+
// ../protocol/src/log-vocabulary/design.ts
|
|
1166
|
+
var DESIGN_LOG_AREAS = defineLogAreas({
|
|
1167
|
+
design: {
|
|
1168
|
+
description: "The design canvas: its library, renderer and session links.",
|
|
1169
|
+
events: {
|
|
1170
|
+
"change-signal.failed": "A design change signal failed.",
|
|
1171
|
+
"library.index-write-failed": "The design library index could not be written.",
|
|
1172
|
+
"library.refresh-failed": "The design library could not be refreshed.",
|
|
1173
|
+
"renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
|
|
1174
|
+
"task.failed": "A design background task failed.",
|
|
1175
|
+
"canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
|
|
1176
|
+
"startup.step-failed": "One part of design startup failed; `step` says which.",
|
|
1177
|
+
"legacy.retire-failed": "A migrated legacy design could not be retired.",
|
|
1178
|
+
"profiles.swept": "Design startup removed stale browser profiles.",
|
|
1179
|
+
"session-link.record-failed": "A closing conversation could not be recorded on a design link."
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
// ../protocol/src/log-vocabulary/graph.ts
|
|
1185
|
+
var GRAPH_LOG_AREAS = defineLogAreas({
|
|
1186
|
+
graph: {
|
|
1187
|
+
description: "Graph runs: launches, passes, rewinds, system actions and templates.",
|
|
1188
|
+
events: {
|
|
1189
|
+
"describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
|
|
1190
|
+
"system.stop-failed": "A system action's work could not be stopped.",
|
|
1191
|
+
"system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
|
|
1192
|
+
"attention.update-failed": "The sidebar could not be updated for a run.",
|
|
1193
|
+
"launch.ticket-link-failed": "A launched run's ticket could not be linked.",
|
|
1194
|
+
"launch.started": "A graph run was launched.",
|
|
1195
|
+
"launch.swept": "Runs that ended without an environment were removed.",
|
|
1196
|
+
"rewind.pending": "A run's code rewind has not finished.",
|
|
1197
|
+
"rewind.applied": "A run was restarted or rewound.",
|
|
1198
|
+
"rewind.waiting": "A run waits for its code rewind to finish.",
|
|
1199
|
+
"history.pruned": "Finished runs beyond an environment's history were removed.",
|
|
1200
|
+
"history.prune-failed": "Pruning an environment's run history failed.",
|
|
1201
|
+
"worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
|
|
1202
|
+
"run.unreadable": "A run is unreadable, so it is not scheduled.",
|
|
1203
|
+
"run.pass-failed": "A pass over a run failed.",
|
|
1204
|
+
"transcript.capture-failed": "A run's transcript capture failed.",
|
|
1205
|
+
"ticket.link-failed": "A run's ticket could not be linked to its environment.",
|
|
1206
|
+
"template.skipped": "A built-in template was skipped as invalid or a duplicate."
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
|
|
1211
|
+
// ../protocol/src/log-vocabulary/nodes.ts
|
|
1212
|
+
var NODES_LOG_AREAS = defineLogAreas({
|
|
1213
|
+
nodes: {
|
|
1214
|
+
description: "Command nodes: links, handovers, leaf mail and project copies.",
|
|
1215
|
+
events: {
|
|
1216
|
+
"actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
|
|
1217
|
+
"project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
|
|
1218
|
+
"mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
|
|
1219
|
+
"command.post-step-failed": "A step after a routed command failed.",
|
|
1220
|
+
"seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
|
|
1221
|
+
"contact.record-failed": "The latest controller contact could not be recorded.",
|
|
1222
|
+
"settings.send-failed": "Settings could not be sent to a node.",
|
|
1223
|
+
"verification.record-failed": "A node verification could not be recorded.",
|
|
1224
|
+
"profile.record-failed": "A node profile could not be recorded.",
|
|
1225
|
+
"detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
|
|
1226
|
+
"handover.recovery-pending": "Command handover recovery is still pending."
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
|
|
1231
|
+
// ../protocol/src/log-vocabulary/linear.ts
|
|
1232
|
+
var LINEAR_LOG_AREAS = defineLogAreas({
|
|
1233
|
+
linear: {
|
|
1234
|
+
description: "Linear issues read for build actions.",
|
|
1235
|
+
events: {
|
|
1236
|
+
"comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
|
|
1241
|
+
// ../protocol/src/log-vocabulary/usage-history.ts
|
|
1242
|
+
var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
|
|
1243
|
+
"usage-history": {
|
|
1244
|
+
description: "Recorded agent token usage.",
|
|
1245
|
+
events: {
|
|
1246
|
+
"record.failed": "Agent usage could not be recorded; a later read counts it.",
|
|
1247
|
+
"prune.failed": "Pruning recorded usage failed; the next prune retries."
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
|
|
1252
|
+
// ../protocol/src/log-vocabulary/feature.ts
|
|
1253
|
+
var FEATURE_LOG_AREAS = defineLogAreas({
|
|
1254
|
+
feature: {
|
|
1255
|
+
description: "Pipeline environments started from a feature, and feature planning.",
|
|
1256
|
+
events: {
|
|
1257
|
+
"naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
|
|
1258
|
+
"planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
|
|
1259
|
+
"planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
|
|
1264
|
+
// ../protocol/src/log-vocabulary/host.ts
|
|
1265
|
+
var HOST_LOG_AREAS = defineLogAreas({
|
|
1266
|
+
host: {
|
|
1267
|
+
description: "The host machine: its executables, load, suspends and maintenance.",
|
|
1268
|
+
events: {
|
|
1269
|
+
"path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
|
|
1270
|
+
"tool.available": "A host tool's availability was read.",
|
|
1271
|
+
"tool.missing": "A host tool was not found.",
|
|
1272
|
+
"maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
|
|
1273
|
+
"suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
|
|
1274
|
+
"load.sample-failed": "Sampling machine load failed; the next sample retries."
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
|
|
1279
|
+
// ../protocol/src/log-vocabulary/transcript-artifacts.ts
|
|
1280
|
+
var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
|
|
1281
|
+
"transcript-artifacts": {
|
|
1282
|
+
description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
|
|
1283
|
+
events: {
|
|
1284
|
+
"announce-failed": "An artifact change could not be announced.",
|
|
1285
|
+
"cleanup-failed": "An artifact cleanup failed.",
|
|
1286
|
+
"grant-revocation-failed": "A grant could not be revoked.",
|
|
1287
|
+
"ledger-listener-failed": "A ledger listener threw.",
|
|
1288
|
+
"ledger-read-failed": "The ledger could not be read.",
|
|
1289
|
+
"operation-executor-failed": "A preview operation's executor failed.",
|
|
1290
|
+
"operation-failed": "A preview operation failed.",
|
|
1291
|
+
"pdf-preview": "A PDF preview was served.",
|
|
1292
|
+
"pdf-preview-failed": "A PDF preview failed.",
|
|
1293
|
+
"pdf-print-failed": "Printing an artifact to PDF failed.",
|
|
1294
|
+
"pdf-printed": "An artifact was printed to PDF.",
|
|
1295
|
+
"runtime-unavailable": "The artifact runtime could not be created."
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
|
|
1300
|
+
// ../protocol/src/log-vocabulary/scheduler.ts
|
|
1301
|
+
var SCHEDULER_LOG_AREAS = defineLogAreas({
|
|
1302
|
+
scheduler: {
|
|
1303
|
+
description: "Scheduled jobs and the backend-owned timing that fires them.",
|
|
1304
|
+
events: {
|
|
1305
|
+
"tick.failed": "A scheduler tick failed; the next tick retries.",
|
|
1306
|
+
"job.claim-failed": "A due job could not be claimed.",
|
|
1307
|
+
"fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
|
|
1308
|
+
"fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
|
|
624
1313
|
// ../protocol/src/log-vocabulary/web-app.ts
|
|
625
1314
|
var WEB_APP_LOG_AREAS = defineLogAreas({
|
|
626
1315
|
"web.app": {
|
|
@@ -788,7 +1477,7 @@ var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
788
1477
|
"models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
|
|
789
1478
|
"models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
|
|
790
1479
|
"github-credential.check-failed": "The GitHub credential check before creating failed.",
|
|
791
|
-
"feature-build.start-failed": "Starting a
|
|
1480
|
+
"feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
|
|
792
1481
|
"settings.extensions-load-failed": "The settings dialog could not load extensions.",
|
|
793
1482
|
"settings.container-reset-failed": "The settings dialog could not reset the container.",
|
|
794
1483
|
"settings.save-failed": "The settings dialog could not save.",
|
|
@@ -1080,6 +1769,25 @@ var LOG_VOCABULARY = {
|
|
|
1080
1769
|
...TMUX_LOG_AREAS,
|
|
1081
1770
|
...UPDATER_LOG_AREAS,
|
|
1082
1771
|
...WEB_ANNOTATIONS_LOG_AREAS,
|
|
1772
|
+
...STORAGE_LOG_AREAS,
|
|
1773
|
+
...BUILD_PIPELINE_LOG_AREAS,
|
|
1774
|
+
...AGENT_BRANCH_LOG_AREAS,
|
|
1775
|
+
...CHANGE_TRACKING_LOG_AREAS,
|
|
1776
|
+
...COORDINATOR_LOG_AREAS,
|
|
1777
|
+
...REVIEW_LOG_AREAS,
|
|
1778
|
+
...PUBLIC_API_LOG_AREAS,
|
|
1779
|
+
...AGENT_ACCOUNTS_LOG_AREAS,
|
|
1780
|
+
...DOCKER_LOG_AREAS,
|
|
1781
|
+
...MCP_LOG_AREAS,
|
|
1782
|
+
...DESIGN_LOG_AREAS,
|
|
1783
|
+
...GRAPH_LOG_AREAS,
|
|
1784
|
+
...NODES_LOG_AREAS,
|
|
1785
|
+
...LINEAR_LOG_AREAS,
|
|
1786
|
+
...USAGE_HISTORY_LOG_AREAS,
|
|
1787
|
+
...FEATURE_LOG_AREAS,
|
|
1788
|
+
...HOST_LOG_AREAS,
|
|
1789
|
+
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
1790
|
+
...SCHEDULER_LOG_AREAS,
|
|
1083
1791
|
...WEB_APP_LOG_AREAS,
|
|
1084
1792
|
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
1085
1793
|
...WEB_CHAT_LOG_AREAS,
|
|
@@ -1202,8 +1910,10 @@ function stackFrames(target, message) {
|
|
|
1202
1910
|
`).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText(relativeFrame(line), MAX_FRAME_CHARS));
|
|
1203
1911
|
return frames.length > 0 ? frames : undefined;
|
|
1204
1912
|
}
|
|
1205
|
-
function describe(error, includeStack, depth) {
|
|
1913
|
+
function describe(error, includeStack, includeMessage, depth) {
|
|
1206
1914
|
if (typeof error !== "object" || error === null) {
|
|
1915
|
+
if (!includeMessage)
|
|
1916
|
+
return { name: "NonError" };
|
|
1207
1917
|
return {
|
|
1208
1918
|
name: "NonError",
|
|
1209
1919
|
message: typeof error === "string" ? boundedText(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
|
|
@@ -1220,7 +1930,7 @@ function describe(error, includeStack, depth) {
|
|
|
1220
1930
|
const details = { name };
|
|
1221
1931
|
if (commandFailure)
|
|
1222
1932
|
details.outputOmitted = true;
|
|
1223
|
-
else if (message)
|
|
1933
|
+
else if (message && includeMessage)
|
|
1224
1934
|
details.message = boundedText(message, MAX_MESSAGE_CHARS);
|
|
1225
1935
|
const code = read(error, "code");
|
|
1226
1936
|
const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
|
|
@@ -1248,13 +1958,13 @@ function describe(error, includeStack, depth) {
|
|
|
1248
1958
|
details.errorCount = members.length;
|
|
1249
1959
|
const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
|
|
1250
1960
|
if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
|
|
1251
|
-
details.cause = describe(cause, false, depth + 1);
|
|
1961
|
+
details.cause = describe(cause, false, includeMessage, depth + 1);
|
|
1252
1962
|
}
|
|
1253
1963
|
return details;
|
|
1254
1964
|
}
|
|
1255
1965
|
function formatLogError(error, options = {}) {
|
|
1256
1966
|
try {
|
|
1257
|
-
return brand(describe(error, options.stack !== false, 0));
|
|
1967
|
+
return brand(describe(error, options.stack !== false, options.message !== false, 0));
|
|
1258
1968
|
} catch {
|
|
1259
1969
|
return brand({ name: "Error", message: "[unreadable]" });
|
|
1260
1970
|
}
|
|
@@ -1433,7 +2143,10 @@ function deliver(record) {
|
|
|
1433
2143
|
line: config.format === "json" ? renderJson(record) : renderText(record),
|
|
1434
2144
|
record
|
|
1435
2145
|
});
|
|
1436
|
-
|
|
2146
|
+
return true;
|
|
2147
|
+
} catch {
|
|
2148
|
+
return false;
|
|
2149
|
+
}
|
|
1437
2150
|
}
|
|
1438
2151
|
function buildRecord(level, area, event, fields) {
|
|
1439
2152
|
const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
|
|
@@ -1589,6 +2302,19 @@ function resolveFields(fields) {
|
|
|
1589
2302
|
return { fieldsFailed: true };
|
|
1590
2303
|
}
|
|
1591
2304
|
}
|
|
2305
|
+
function deliverEvent(level, area, event, fields) {
|
|
2306
|
+
const spec = areaSpec(area);
|
|
2307
|
+
if (!spec)
|
|
2308
|
+
return deliver(buildRecord(level, "logging", "unknown-area", undefined));
|
|
2309
|
+
if (!Object.hasOwn(spec.events, event))
|
|
2310
|
+
return deliver(buildRecord(level, area, "invalid-event", undefined));
|
|
2311
|
+
return deliver(buildRecord(level, area, event, fields));
|
|
2312
|
+
}
|
|
2313
|
+
function tryWriteLog(level, area, event, fields) {
|
|
2314
|
+
if (LEVEL_RANK[level] > thresholdRank(area))
|
|
2315
|
+
return false;
|
|
2316
|
+
return deliverEvent(level, area, event, resolveFields(fields));
|
|
2317
|
+
}
|
|
1592
2318
|
function createLogger(area) {
|
|
1593
2319
|
const spec = areaSpec(area);
|
|
1594
2320
|
let seenGeneration = -1;
|
|
@@ -1601,13 +2327,7 @@ function createLogger(area) {
|
|
|
1601
2327
|
return LEVEL_RANK[level] <= rank;
|
|
1602
2328
|
};
|
|
1603
2329
|
const writeResolved = (level, event, resolved) => {
|
|
1604
|
-
|
|
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
|
-
}
|
|
2330
|
+
deliverEvent(level, area, event, resolved);
|
|
1611
2331
|
};
|
|
1612
2332
|
const write = (level, event, fields) => {
|
|
1613
2333
|
if (!enabled(level))
|
|
@@ -1782,8 +2502,19 @@ function applyLogDetail(detail, env = process.env) {
|
|
|
1782
2502
|
|
|
1783
2503
|
// ../protocol/src/node/bridge-diagnostics.ts
|
|
1784
2504
|
import { createHash } from "node:crypto";
|
|
1785
|
-
|
|
1786
|
-
|
|
2505
|
+
|
|
2506
|
+
// ../protocol/src/event-loop-stall-monitor.ts
|
|
2507
|
+
var log = createLogger("event-loop");
|
|
2508
|
+
var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
|
|
2509
|
+
|
|
2510
|
+
// ../protocol/src/node/bridge-diagnostics.ts
|
|
2511
|
+
var log2 = createLogger("bridge.diagnostics");
|
|
2512
|
+
var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
|
|
2513
|
+
var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
|
|
2514
|
+
var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
|
|
2515
|
+
var STALL_TOOL_PENDING_MS = 10 * 60000;
|
|
2516
|
+
var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
|
|
2517
|
+
var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
|
|
1787
2518
|
var MAX_PENDING_TOOLS = 128;
|
|
1788
2519
|
var MAX_REPORTED_TOOLS = 8;
|
|
1789
2520
|
var MAX_ID_LENGTH = 1024;
|
|
@@ -1844,6 +2575,28 @@ var UPDATE_KINDS = new Set([
|
|
|
1844
2575
|
"step-started",
|
|
1845
2576
|
"step-completed"
|
|
1846
2577
|
]);
|
|
2578
|
+
var COUNTER_CHANGE_THRESHOLDS = {
|
|
2579
|
+
stderrBytes: 4096,
|
|
2580
|
+
requestsSent: 1,
|
|
2581
|
+
responsesReceived: 1,
|
|
2582
|
+
timeouts: 1,
|
|
2583
|
+
notificationsReceived: Number.POSITIVE_INFINITY,
|
|
2584
|
+
protocolErrors: 1
|
|
2585
|
+
};
|
|
2586
|
+
var WAITING_PHASES = new Set([
|
|
2587
|
+
"sending",
|
|
2588
|
+
"following",
|
|
2589
|
+
"draining",
|
|
2590
|
+
"cancelling"
|
|
2591
|
+
]);
|
|
2592
|
+
function sameSet(a, b) {
|
|
2593
|
+
if (a.size !== b.size)
|
|
2594
|
+
return false;
|
|
2595
|
+
for (const value of a)
|
|
2596
|
+
if (!b.has(value))
|
|
2597
|
+
return false;
|
|
2598
|
+
return true;
|
|
2599
|
+
}
|
|
1847
2600
|
function identity(value) {
|
|
1848
2601
|
if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
|
|
1849
2602
|
return;
|
|
@@ -1854,9 +2607,6 @@ function readBridgeDebugFlag(value) {
|
|
|
1854
2607
|
}
|
|
1855
2608
|
var liveDiagnostics;
|
|
1856
2609
|
var liveScopes = new Set;
|
|
1857
|
-
function liveBridgeDiagnostics() {
|
|
1858
|
-
return liveDiagnostics;
|
|
1859
|
-
}
|
|
1860
2610
|
function setLiveBridgeDiagnostics(enabled) {
|
|
1861
2611
|
liveDiagnostics = enabled;
|
|
1862
2612
|
for (const scope of Array.from(liveScopes))
|
|
@@ -1922,26 +2672,35 @@ function safeDiagnosticMetrics(value) {
|
|
|
1922
2672
|
result.state = value.state;
|
|
1923
2673
|
return result;
|
|
1924
2674
|
}
|
|
2675
|
+
function bridgeDiagnosticsChangesEnabled() {
|
|
2676
|
+
return log2.isEnabled("trace");
|
|
2677
|
+
}
|
|
1925
2678
|
function writeBridgeDiagnostic({ bridge, event, payload }) {
|
|
1926
|
-
|
|
2679
|
+
return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
|
|
1927
2680
|
}
|
|
1928
2681
|
function bridgeDiagnosticsActive() {
|
|
1929
|
-
return
|
|
2682
|
+
return log2.isEnabled("info");
|
|
2683
|
+
}
|
|
2684
|
+
function bridgeDiagnosticsStreamEnabled(bridge) {
|
|
2685
|
+
return bridgeDebugEnabled(bridge) || log2.isEnabled("debug");
|
|
1930
2686
|
}
|
|
1931
2687
|
function writeDiagnostic(bridge, event, payload, write) {
|
|
1932
2688
|
try {
|
|
1933
2689
|
const json = JSON.stringify({ bridge, event, ...payload });
|
|
1934
2690
|
const bytes = Buffer.byteLength(json);
|
|
1935
2691
|
if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
|
|
1936
|
-
write({ bridge, event, payload: json });
|
|
1937
|
-
return;
|
|
2692
|
+
const accepted = write({ bridge, event, payload: json });
|
|
2693
|
+
return accepted !== false;
|
|
1938
2694
|
}
|
|
1939
|
-
write({
|
|
2695
|
+
const accepted = write({
|
|
1940
2696
|
bridge,
|
|
1941
2697
|
event: "snapshot-overflow",
|
|
1942
2698
|
payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
|
|
1943
2699
|
});
|
|
1944
|
-
|
|
2700
|
+
return accepted !== false;
|
|
2701
|
+
} catch {
|
|
2702
|
+
return false;
|
|
2703
|
+
}
|
|
1945
2704
|
}
|
|
1946
2705
|
|
|
1947
2706
|
class BridgeRunDiagnostics {
|
|
@@ -1973,6 +2732,7 @@ class BridgeRunDiagnostics {
|
|
|
1973
2732
|
completedTools = 0;
|
|
1974
2733
|
pending = new Map;
|
|
1975
2734
|
phase = "sending";
|
|
2735
|
+
processScope = false;
|
|
1976
2736
|
terminal = "pending";
|
|
1977
2737
|
stream = "pending";
|
|
1978
2738
|
cancellation = "none";
|
|
@@ -1980,6 +2740,8 @@ class BridgeRunDiagnostics {
|
|
|
1980
2740
|
run;
|
|
1981
2741
|
closed = false;
|
|
1982
2742
|
wasActive;
|
|
2743
|
+
baseline;
|
|
2744
|
+
changeQueued = false;
|
|
1983
2745
|
timer;
|
|
1984
2746
|
constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
|
|
1985
2747
|
this.bridge = bridge;
|
|
@@ -2025,7 +2787,8 @@ class BridgeRunDiagnostics {
|
|
|
2025
2787
|
return;
|
|
2026
2788
|
}
|
|
2027
2789
|
if (stage === "completed") {
|
|
2028
|
-
this.pending.delete(key)
|
|
2790
|
+
if (this.pending.delete(key))
|
|
2791
|
+
this.changed();
|
|
2029
2792
|
this.completedTools++;
|
|
2030
2793
|
return;
|
|
2031
2794
|
}
|
|
@@ -2040,13 +2803,23 @@ class BridgeRunDiagnostics {
|
|
|
2040
2803
|
stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
|
|
2041
2804
|
nested
|
|
2042
2805
|
});
|
|
2806
|
+
if (!existing)
|
|
2807
|
+
this.changed();
|
|
2043
2808
|
}
|
|
2044
2809
|
checkpoint(phase) {
|
|
2810
|
+
if (phase === "attached")
|
|
2811
|
+
this.processScope = true;
|
|
2812
|
+
if (phase === this.phase)
|
|
2813
|
+
return;
|
|
2045
2814
|
this.phase = phase;
|
|
2815
|
+
this.changed();
|
|
2046
2816
|
}
|
|
2047
2817
|
count(key, amount = 1) {
|
|
2048
|
-
if (
|
|
2049
|
-
|
|
2818
|
+
if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
|
|
2819
|
+
return;
|
|
2820
|
+
this.counters[key] += amount;
|
|
2821
|
+
if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
|
|
2822
|
+
this.changed();
|
|
2050
2823
|
}
|
|
2051
2824
|
translationFailed() {
|
|
2052
2825
|
this.translationFailures++;
|
|
@@ -2062,8 +2835,10 @@ class BridgeRunDiagnostics {
|
|
|
2062
2835
|
}
|
|
2063
2836
|
terminalSettled(outcome) {
|
|
2064
2837
|
this.terminal = outcome;
|
|
2065
|
-
if (outcome === "resolved")
|
|
2838
|
+
if (outcome === "resolved" && this.phase !== "draining") {
|
|
2066
2839
|
this.phase = "draining";
|
|
2840
|
+
this.changed();
|
|
2841
|
+
}
|
|
2067
2842
|
}
|
|
2068
2843
|
requestCancellation(reason = "user") {
|
|
2069
2844
|
this.cancellation = "pending";
|
|
@@ -2085,12 +2860,38 @@ class BridgeRunDiagnostics {
|
|
|
2085
2860
|
if (this.closed)
|
|
2086
2861
|
return;
|
|
2087
2862
|
const now = this.now();
|
|
2088
|
-
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
2089
2863
|
const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
|
|
2090
2864
|
if (event === "heartbeat")
|
|
2091
2865
|
this.lastTick = now;
|
|
2092
|
-
if (!
|
|
2866
|
+
if (!bridgeDiagnosticsActive())
|
|
2867
|
+
return;
|
|
2868
|
+
const stall = this.stallState(now, tickDelayMs);
|
|
2869
|
+
if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
|
|
2870
|
+
return;
|
|
2871
|
+
this.writeSnapshot(event, now, tickDelayMs, stall);
|
|
2872
|
+
}
|
|
2873
|
+
changed() {
|
|
2874
|
+
if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
|
|
2093
2875
|
return;
|
|
2876
|
+
this.changeQueued = true;
|
|
2877
|
+
queueMicrotask(() => {
|
|
2878
|
+
this.changeQueued = false;
|
|
2879
|
+
this.reportChange();
|
|
2880
|
+
});
|
|
2881
|
+
}
|
|
2882
|
+
reportChange() {
|
|
2883
|
+
if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
|
|
2884
|
+
return;
|
|
2885
|
+
const last = this.baseline;
|
|
2886
|
+
if (last && !this.changedSince(last))
|
|
2887
|
+
return;
|
|
2888
|
+
const now = this.now();
|
|
2889
|
+
try {
|
|
2890
|
+
this.writeSnapshot("change", now, 0, this.stallState(now, 0));
|
|
2891
|
+
} catch {}
|
|
2892
|
+
}
|
|
2893
|
+
writeSnapshot(event, now, tickDelayMs, stall) {
|
|
2894
|
+
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
2094
2895
|
const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
|
|
2095
2896
|
id,
|
|
2096
2897
|
kind: tool.kind,
|
|
@@ -2099,7 +2900,7 @@ class BridgeRunDiagnostics {
|
|
|
2099
2900
|
ageMs: age(tool.since)
|
|
2100
2901
|
}));
|
|
2101
2902
|
try {
|
|
2102
|
-
writeDiagnostic(this.bridge, event, {
|
|
2903
|
+
const written = writeDiagnostic(this.bridge, event, {
|
|
2103
2904
|
session: identity(this.state.id),
|
|
2104
2905
|
run: this.run,
|
|
2105
2906
|
phase: this.phase,
|
|
@@ -2126,8 +2927,64 @@ class BridgeRunDiagnostics {
|
|
|
2126
2927
|
completedTools: this.completedTools,
|
|
2127
2928
|
tickDelayMs
|
|
2128
2929
|
}, this.write);
|
|
2930
|
+
if (!written)
|
|
2931
|
+
return;
|
|
2932
|
+
this.baseline = {
|
|
2933
|
+
at: now,
|
|
2934
|
+
phase: this.phase,
|
|
2935
|
+
pending: new Set(this.pending.keys()),
|
|
2936
|
+
counters: { ...this.counters },
|
|
2937
|
+
stall
|
|
2938
|
+
};
|
|
2129
2939
|
} catch {}
|
|
2130
2940
|
}
|
|
2941
|
+
periodicDue(now, stall) {
|
|
2942
|
+
if (stall.signals.has("tick-delay"))
|
|
2943
|
+
return true;
|
|
2944
|
+
const last = this.baseline;
|
|
2945
|
+
if (!last)
|
|
2946
|
+
return true;
|
|
2947
|
+
if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
|
|
2948
|
+
return true;
|
|
2949
|
+
if (stall.signals.has("no-delta") && this.changedSince(last))
|
|
2950
|
+
return true;
|
|
2951
|
+
return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
|
|
2952
|
+
}
|
|
2953
|
+
changedSince(last) {
|
|
2954
|
+
if (this.phase !== last.phase)
|
|
2955
|
+
return true;
|
|
2956
|
+
if (this.pending.size !== last.pending.size)
|
|
2957
|
+
return true;
|
|
2958
|
+
for (const key of this.pending.keys())
|
|
2959
|
+
if (!last.pending.has(key))
|
|
2960
|
+
return true;
|
|
2961
|
+
for (const key of Object.keys(this.counters))
|
|
2962
|
+
if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
|
|
2963
|
+
return true;
|
|
2964
|
+
return false;
|
|
2965
|
+
}
|
|
2966
|
+
stallState(now, tickDelayMs) {
|
|
2967
|
+
const signals = new Set;
|
|
2968
|
+
const tools = new Set;
|
|
2969
|
+
let oldestPending;
|
|
2970
|
+
for (const [key, tool] of this.pending) {
|
|
2971
|
+
if (oldestPending === undefined || tool.since < oldestPending)
|
|
2972
|
+
oldestPending = tool.since;
|
|
2973
|
+
if (now - tool.since >= STALL_TOOL_PENDING_MS)
|
|
2974
|
+
tools.add(key);
|
|
2975
|
+
}
|
|
2976
|
+
const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
|
|
2977
|
+
if (waitingSince !== undefined) {
|
|
2978
|
+
const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
|
|
2979
|
+
if (now - quietSince >= STALL_NO_DELTA_MS)
|
|
2980
|
+
signals.add("no-delta");
|
|
2981
|
+
}
|
|
2982
|
+
if (tools.size > 0)
|
|
2983
|
+
signals.add("tool-pending");
|
|
2984
|
+
if (tickDelayMs >= STALL_TICK_DELAY_MS)
|
|
2985
|
+
signals.add("tick-delay");
|
|
2986
|
+
return { signals, tools };
|
|
2987
|
+
}
|
|
2131
2988
|
close(phase = "finished") {
|
|
2132
2989
|
if (this.closed)
|
|
2133
2990
|
return;
|
|
@@ -2140,7 +2997,47 @@ class BridgeRunDiagnostics {
|
|
|
2140
2997
|
}
|
|
2141
2998
|
}
|
|
2142
2999
|
function createBridgeDiagnostics(bridge, state, metrics) {
|
|
2143
|
-
return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () =>
|
|
3000
|
+
return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDiagnosticsStreamEnabled(bridge));
|
|
3001
|
+
}
|
|
3002
|
+
var bufferedFlushes = new Set;
|
|
3003
|
+
var SHUTDOWN_SIGNALS = ["SIGTERM", "SIGINT"];
|
|
3004
|
+
var shutdownFlushInstalled = false;
|
|
3005
|
+
function flushBufferedDebugLoggers() {
|
|
3006
|
+
for (const flush of Array.from(bufferedFlushes))
|
|
3007
|
+
flush();
|
|
3008
|
+
}
|
|
3009
|
+
function installShutdownFlush() {
|
|
3010
|
+
if (shutdownFlushInstalled)
|
|
3011
|
+
return;
|
|
3012
|
+
shutdownFlushInstalled = true;
|
|
3013
|
+
process.once("exit", flushBufferedDebugLoggers);
|
|
3014
|
+
for (const signal of SHUTDOWN_SIGNALS) {
|
|
3015
|
+
process.prependOnceListener(signal, () => {
|
|
3016
|
+
flushBufferedDebugLoggers();
|
|
3017
|
+
if (process.listenerCount(signal) === 0)
|
|
3018
|
+
process.kill(process.pid, signal);
|
|
3019
|
+
});
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
function summarize(entry, metrics) {
|
|
3023
|
+
for (const [key, value] of Object.entries(metrics)) {
|
|
3024
|
+
if (typeof value === "number") {
|
|
3025
|
+
const summary = entry.numbers.get(key);
|
|
3026
|
+
if (!summary) {
|
|
3027
|
+
entry.numbers.set(key, { n: 1, min: value, max: value, sum: value });
|
|
3028
|
+
continue;
|
|
3029
|
+
}
|
|
3030
|
+
summary.n++;
|
|
3031
|
+
summary.min = Math.min(summary.min, value);
|
|
3032
|
+
summary.max = Math.max(summary.max, value);
|
|
3033
|
+
summary.sum += value;
|
|
3034
|
+
continue;
|
|
3035
|
+
}
|
|
3036
|
+
const tally = entry.values.get(key) ?? {};
|
|
3037
|
+
const label = String(value);
|
|
3038
|
+
tally[label] = (tally[label] ?? 0) + 1;
|
|
3039
|
+
entry.values.set(key, tally);
|
|
3040
|
+
}
|
|
2144
3041
|
}
|
|
2145
3042
|
function createBufferedDebugLogger(bridge, allowedEvents, enabled = () => bridgeDebugEnabled(bridge), write = writeBridgeDiagnostic) {
|
|
2146
3043
|
const entries = new Map;
|
|
@@ -2150,16 +3047,27 @@ function createBufferedDebugLogger(bridge, allowedEvents, enabled = () => bridge
|
|
|
2150
3047
|
if (closed || entries.size === 0 && dropped === 0)
|
|
2151
3048
|
return;
|
|
2152
3049
|
try {
|
|
2153
|
-
writeDiagnostic(bridge, "debug-events", {
|
|
3050
|
+
const accepted = writeDiagnostic(bridge, "debug-events", {
|
|
2154
3051
|
dropped,
|
|
2155
|
-
events: Array.from(entries.entries()).map(([event, value]) => ({
|
|
3052
|
+
events: Array.from(entries.entries()).map(([event, value]) => ({
|
|
3053
|
+
event,
|
|
3054
|
+
count: value.count,
|
|
3055
|
+
metrics: {
|
|
3056
|
+
...Object.fromEntries(value.numbers),
|
|
3057
|
+
...Object.fromEntries(value.values)
|
|
3058
|
+
}
|
|
3059
|
+
}))
|
|
2156
3060
|
}, write);
|
|
3061
|
+
if (accepted) {
|
|
3062
|
+
entries.clear();
|
|
3063
|
+
dropped = 0;
|
|
3064
|
+
}
|
|
2157
3065
|
} catch {}
|
|
2158
|
-
entries.clear();
|
|
2159
|
-
dropped = 0;
|
|
2160
3066
|
};
|
|
2161
3067
|
const timer = setInterval(flush, INTERVAL_MS);
|
|
2162
3068
|
timer.unref();
|
|
3069
|
+
bufferedFlushes.add(flush);
|
|
3070
|
+
installShutdownFlush();
|
|
2163
3071
|
return {
|
|
2164
3072
|
record(event, ...args) {
|
|
2165
3073
|
if (closed || !enabled() || !bridgeDiagnosticsActive())
|
|
@@ -2168,23 +3076,29 @@ function createBufferedDebugLogger(bridge, allowedEvents, enabled = () => bridge
|
|
|
2168
3076
|
dropped++;
|
|
2169
3077
|
return;
|
|
2170
3078
|
}
|
|
2171
|
-
|
|
2172
|
-
if (!
|
|
2173
|
-
|
|
2174
|
-
|
|
3079
|
+
let entry = entries.get(event);
|
|
3080
|
+
if (!entry) {
|
|
3081
|
+
if (entries.size >= 16) {
|
|
3082
|
+
dropped++;
|
|
3083
|
+
return;
|
|
3084
|
+
}
|
|
3085
|
+
entry = { count: 0, numbers: new Map, values: new Map };
|
|
3086
|
+
entries.set(event, entry);
|
|
2175
3087
|
}
|
|
3088
|
+
entry.count++;
|
|
2176
3089
|
const metrics = {};
|
|
2177
3090
|
for (const arg of args.slice(0, 4)) {
|
|
2178
3091
|
if (arg && typeof arg === "object" && !(arg instanceof Error)) {
|
|
2179
3092
|
Object.assign(metrics, safeDiagnosticMetrics(arg));
|
|
2180
3093
|
}
|
|
2181
3094
|
}
|
|
2182
|
-
|
|
3095
|
+
summarize(entry, metrics);
|
|
2183
3096
|
},
|
|
2184
3097
|
flush,
|
|
2185
3098
|
close() {
|
|
2186
3099
|
flush();
|
|
2187
3100
|
closed = true;
|
|
3101
|
+
bufferedFlushes.delete(flush);
|
|
2188
3102
|
clearInterval(timer);
|
|
2189
3103
|
entries.clear();
|
|
2190
3104
|
}
|
|
@@ -4382,9 +5296,8 @@ function claudePlanWindowFromLabel(label) {
|
|
|
4382
5296
|
}
|
|
4383
5297
|
|
|
4384
5298
|
// ../../bridges/claude-bridge/src/services/logger.ts
|
|
4385
|
-
var startupDebugLogging = bridgeDebugEnabled("claude");
|
|
4386
5299
|
function isDebugLoggingEnabled() {
|
|
4387
|
-
return
|
|
5300
|
+
return bridgeDiagnosticsStreamEnabled("claude");
|
|
4388
5301
|
}
|
|
4389
5302
|
var DEBUG_EVENTS = new Set([
|
|
4390
5303
|
"[event-emitter] Emitting event",
|
|
@@ -4464,7 +5377,7 @@ function createRequestLogger(enabled = isDebugLoggingEnabled, record = buffered.
|
|
|
4464
5377
|
}
|
|
4465
5378
|
|
|
4466
5379
|
// ../../bridges/claude-bridge/src/services/event-emitter.ts
|
|
4467
|
-
var
|
|
5380
|
+
var log3 = createLogger("bridge.claude");
|
|
4468
5381
|
|
|
4469
5382
|
class EventEmitter {
|
|
4470
5383
|
subscribers = new Set;
|
|
@@ -4491,7 +5404,7 @@ class EventEmitter {
|
|
|
4491
5404
|
try {
|
|
4492
5405
|
callback(event, revision);
|
|
4493
5406
|
} catch (error) {
|
|
4494
|
-
|
|
5407
|
+
log3.error("event-subscriber.failed", { error: formatLogError(error) });
|
|
4495
5408
|
}
|
|
4496
5409
|
}
|
|
4497
5410
|
}
|
|
@@ -6727,6 +7640,7 @@ var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
|
6727
7640
|
"update_schedule",
|
|
6728
7641
|
"update_ticket"
|
|
6729
7642
|
]);
|
|
7643
|
+
var COORDINATOR_PROJECT_HOME_MESSAGE_WINDOW_MS = 3 * 60 * 60000;
|
|
6730
7644
|
|
|
6731
7645
|
// ../../bridges/claude-bridge/src/services/coordinator-skills.ts
|
|
6732
7646
|
var KEPT_FRONTMATTER_KEYS = Object.freeze([
|
|
@@ -7120,7 +8034,7 @@ async function readJsonSliceCachedWithDigest(filePath, sliceKey, select) {
|
|
|
7120
8034
|
}
|
|
7121
8035
|
|
|
7122
8036
|
// ../../bridges/claude-bridge/src/services/plugin-config.ts
|
|
7123
|
-
var
|
|
8037
|
+
var log4 = createLogger("bridge.claude");
|
|
7124
8038
|
async function pathExists(path) {
|
|
7125
8039
|
try {
|
|
7126
8040
|
await access(path);
|
|
@@ -7189,7 +8103,7 @@ async function loadPluginSettings(cwd, sources) {
|
|
|
7189
8103
|
return Object.fromEntries(entries);
|
|
7190
8104
|
}
|
|
7191
8105
|
function remapInstalledPlugins2(pluginsDir, installedPlugins) {
|
|
7192
|
-
return remapInstalledPlugins(pluginsDir, installedPlugins, (installPath) =>
|
|
8106
|
+
return remapInstalledPlugins(pluginsDir, installedPlugins, (installPath) => log4.warn("plugin.unsafe-path", { path: installPath }));
|
|
7193
8107
|
}
|
|
7194
8108
|
async function loadProjectOverridesFromGlobal(cwd) {
|
|
7195
8109
|
const plugins = await readJsonSliceCached(claudeJsonPath(), `projects:${cwd}:plugins`, (config) => claudePluginConfigList(config?.projects?.[cwd]?.plugins));
|
|
@@ -7240,7 +8154,7 @@ async function getPluginsForSdk(cwd, includeProjectSources = true, settingSource
|
|
|
7240
8154
|
});
|
|
7241
8155
|
} else {
|
|
7242
8156
|
const pluginName = config.path.split("/").pop() || "unknown";
|
|
7243
|
-
|
|
8157
|
+
log4.warn("plugin.path-missing", { pluginName, path: config.path });
|
|
7244
8158
|
}
|
|
7245
8159
|
}
|
|
7246
8160
|
return validPlugins;
|
|
@@ -8163,7 +9077,7 @@ function claudeSandboxRefusal(policy, options = {}) {
|
|
|
8163
9077
|
}
|
|
8164
9078
|
|
|
8165
9079
|
// ../../bridges/claude-bridge/src/services/session-manager-background-tasks.ts
|
|
8166
|
-
var
|
|
9080
|
+
var log5 = createLogger("bridge.claude");
|
|
8167
9081
|
var PROVISIONAL_BACKGROUND_TASK_PREFIX = "pending-bash:";
|
|
8168
9082
|
var MAX_BACKGROUND_TASK_CANDIDATES = 128;
|
|
8169
9083
|
function provisionalBackgroundTaskId(toolUseId) {
|
|
@@ -8198,7 +9112,7 @@ function registerBackgroundTaskCandidate(runtime, toolUseId) {
|
|
|
8198
9112
|
return;
|
|
8199
9113
|
const { candidates } = runtime.tasks;
|
|
8200
9114
|
if (!candidates.has(toolUseId) && candidates.size >= MAX_BACKGROUND_TASK_CANDIDATES) {
|
|
8201
|
-
|
|
9115
|
+
log5.warn("task.candidate-bound-reached", {
|
|
8202
9116
|
sessionId: runtime.session.id,
|
|
8203
9117
|
bound: MAX_BACKGROUND_TASK_CANDIDATES
|
|
8204
9118
|
});
|
|
@@ -8312,7 +9226,7 @@ async function persistShellTaskFields(session, toolUseId, fields) {
|
|
|
8312
9226
|
]
|
|
8313
9227
|
});
|
|
8314
9228
|
} catch {
|
|
8315
|
-
|
|
9229
|
+
log5.warn("task.details-persist-failed");
|
|
8316
9230
|
}
|
|
8317
9231
|
}
|
|
8318
9232
|
function cacheShellTaskFields(session, toolUseId, fields) {
|
|
@@ -8434,7 +9348,7 @@ function parkSettlingBackgroundTask(owner, task) {
|
|
|
8434
9348
|
return;
|
|
8435
9349
|
const { settling } = owner.tasks;
|
|
8436
9350
|
if (!settling.has(task.id) && settling.size >= MAX_SETTLING_BACKGROUND_TASKS) {
|
|
8437
|
-
|
|
9351
|
+
log5.warn("task.settling-bound-reached", {
|
|
8438
9352
|
sessionId: owner.session.id,
|
|
8439
9353
|
bound: MAX_SETTLING_BACKGROUND_TASKS
|
|
8440
9354
|
});
|
|
@@ -8509,7 +9423,7 @@ async function stopBackgroundTask(sessionId, taskId) {
|
|
|
8509
9423
|
if (latest && !LIVE_BACKGROUND_TASK_STATUSES.has(latest.status)) {
|
|
8510
9424
|
return { ok: true };
|
|
8511
9425
|
}
|
|
8512
|
-
|
|
9426
|
+
log5.warn("task.stop-failed", { error: formatLogError(error, { stack: false }) });
|
|
8513
9427
|
if (settleBackgroundTask(session, taskId, "killed", "The Claude control channel for this task is no longer available")) {
|
|
8514
9428
|
emitBackgroundTaskSnapshot(session);
|
|
8515
9429
|
}
|
|
@@ -10116,7 +11030,7 @@ function restoredTurnInterruption(preferences) {
|
|
|
10116
11030
|
}
|
|
10117
11031
|
|
|
10118
11032
|
// ../../bridges/claude-bridge/src/services/session-manager-lifecycle.ts
|
|
10119
|
-
var
|
|
11033
|
+
var log6 = createLogger("bridge.claude");
|
|
10120
11034
|
async function getSessionActivity(sessionId) {
|
|
10121
11035
|
const session = sessions.get(sessionId);
|
|
10122
11036
|
if (session) {
|
|
@@ -10296,7 +11210,7 @@ async function claimPromptDispatch(sessionId, requestId, startDispatch, testHook
|
|
|
10296
11210
|
try {
|
|
10297
11211
|
await updateSessionPreferences(sdkSessionId, journalUpdate([...retainedRequestIds].slice(-MAX_DISPATCHED_REQUEST_IDS)));
|
|
10298
11212
|
} catch (rollbackError) {
|
|
10299
|
-
|
|
11213
|
+
log6.error("dispatch.rollback-failed", {
|
|
10300
11214
|
error: formatLogError(rollbackError, { stack: false })
|
|
10301
11215
|
});
|
|
10302
11216
|
}
|
|
@@ -14864,7 +15778,7 @@ function reconcileClaudeUsage(terminal, streamed) {
|
|
|
14864
15778
|
}
|
|
14865
15779
|
|
|
14866
15780
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-turn-lifecycle.ts
|
|
14867
|
-
var
|
|
15781
|
+
var log7 = createLogger("bridge.claude");
|
|
14868
15782
|
function diagnosticErrorClass(error) {
|
|
14869
15783
|
try {
|
|
14870
15784
|
if (!(error instanceof Error))
|
|
@@ -14933,7 +15847,7 @@ async function reconcilePlanModeFromStatus(turn, reported) {
|
|
|
14933
15847
|
try {
|
|
14934
15848
|
await applySessionPlanMode(session, false);
|
|
14935
15849
|
} catch (error) {
|
|
14936
|
-
|
|
15850
|
+
log7.warn("plan-mode.record-failed", { sessionId, errorClass: diagnosticErrorClass(error) });
|
|
14937
15851
|
}
|
|
14938
15852
|
}
|
|
14939
15853
|
function setCompletionBlockedByBackgroundTasks(turn, blocked) {
|
|
@@ -15176,7 +16090,7 @@ function createTurnState(session, sessionId, init) {
|
|
|
15176
16090
|
}
|
|
15177
16091
|
|
|
15178
16092
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-admission.ts
|
|
15179
|
-
var
|
|
16093
|
+
var log8 = createLogger("bridge.claude");
|
|
15180
16094
|
var STREAM_EVENT_COALESCE_MS = 100;
|
|
15181
16095
|
function admitPrompt(sessionId, options) {
|
|
15182
16096
|
const session = sessions.get(sessionId);
|
|
@@ -15309,7 +16223,7 @@ async function readTranscriptForPrompt(session) {
|
|
|
15309
16223
|
try {
|
|
15310
16224
|
return await readPersistedSessionMessagesOnce(session);
|
|
15311
16225
|
} catch (error) {
|
|
15312
|
-
|
|
16226
|
+
log8.warn("transcript.hydrate-failed", { error: formatLogError(error, { stack: false }) });
|
|
15313
16227
|
return TRANSCRIPT_READ_FAILED;
|
|
15314
16228
|
}
|
|
15315
16229
|
}
|
|
@@ -15459,7 +16373,7 @@ var ORKESTRATOR_ARTIFACT_MCP_SERVER_NAME = "orkestrator-artifacts";
|
|
|
15459
16373
|
var ORKESTRATOR_ARTIFACT_MCP_PATH = "/artifact-mcp";
|
|
15460
16374
|
|
|
15461
16375
|
// ../../bridges/claude-bridge/src/services/mcp-config.ts
|
|
15462
|
-
var
|
|
16376
|
+
var log9 = createLogger("bridge.claude");
|
|
15463
16377
|
var AGENT_MCP_SERVER_NAME = "orkestrator";
|
|
15464
16378
|
var AGENT_MCP_URL_ENV = "ORKESTRATOR_AGENT_MCP_URL";
|
|
15465
16379
|
var AGENT_MCP_TOKEN_ENV = "ORKESTRATOR_AGENT_MCP_TOKEN";
|
|
@@ -15544,7 +16458,7 @@ function toSdkServers(configs) {
|
|
|
15544
16458
|
if (sdkConfig) {
|
|
15545
16459
|
servers[name] = sdkConfig;
|
|
15546
16460
|
} else {
|
|
15547
|
-
|
|
16461
|
+
log9.warn("mcp.config-ignored");
|
|
15548
16462
|
}
|
|
15549
16463
|
}
|
|
15550
16464
|
return servers;
|
|
@@ -15909,7 +16823,7 @@ function claudeReadiness() {
|
|
|
15909
16823
|
}
|
|
15910
16824
|
|
|
15911
16825
|
// ../../bridges/claude-bridge/src/services/claude-model-catalog.ts
|
|
15912
|
-
var
|
|
16826
|
+
var log10 = createLogger("bridge.claude");
|
|
15913
16827
|
var CLAUDE_MODEL_CACHE_TTL_MS = 60 * 60000;
|
|
15914
16828
|
var CLAUDE_MODEL_PROBE_TIMEOUT_MS = 25000;
|
|
15915
16829
|
var remembered;
|
|
@@ -16050,7 +16964,7 @@ async function probeModels(at) {
|
|
|
16050
16964
|
await rememberModels(models, account, at);
|
|
16051
16965
|
return { source: "sdk", models: catalogModels(models) };
|
|
16052
16966
|
} catch (error) {
|
|
16053
|
-
|
|
16967
|
+
log10.warn("models.fetch-failed", { error: formatLogError(error) });
|
|
16054
16968
|
return fallbackCatalog();
|
|
16055
16969
|
} finally {
|
|
16056
16970
|
clearTimeout(timer);
|
|
@@ -18162,14 +19076,14 @@ function isValidMcpFormContent(schema, content) {
|
|
|
18162
19076
|
}
|
|
18163
19077
|
|
|
18164
19078
|
// ../../bridges/claude-bridge/src/services/session-manager-interactions.ts
|
|
18165
|
-
var
|
|
19079
|
+
var log11 = createLogger("bridge.claude");
|
|
18166
19080
|
function answerQuestion(requestId, answers) {
|
|
18167
19081
|
const question = pendingQuestions.get(requestId);
|
|
18168
19082
|
if (!question) {
|
|
18169
19083
|
debugLog("[session-manager] Question not found for requestId:", requestId);
|
|
18170
19084
|
return false;
|
|
18171
19085
|
}
|
|
18172
|
-
|
|
19086
|
+
log11.info("question.answering", { requestId, answerCount: Object.keys(answers).length });
|
|
18173
19087
|
const resolver = questionResolvers.get(requestId);
|
|
18174
19088
|
if (resolver) {
|
|
18175
19089
|
debugLog("[session-manager] Resolving promise for question:", requestId);
|
|
@@ -18221,7 +19135,7 @@ function respondToPlanApproval(requestId, approved, feedback) {
|
|
|
18221
19135
|
debugLog("[session-manager] Refusing incomplete plan approval", { requestId });
|
|
18222
19136
|
return false;
|
|
18223
19137
|
}
|
|
18224
|
-
|
|
19138
|
+
log11.info("plan-approval.responding", {
|
|
18225
19139
|
requestId,
|
|
18226
19140
|
approved,
|
|
18227
19141
|
hasFeedback: typeof feedback === "string" && feedback.length > 0
|
|
@@ -19461,7 +20375,7 @@ function classifyUsageLimitError(text) {
|
|
|
19461
20375
|
}
|
|
19462
20376
|
|
|
19463
20377
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-handlers/result.ts
|
|
19464
|
-
var
|
|
20378
|
+
var log12 = createLogger("bridge.claude");
|
|
19465
20379
|
function claudeStartupFailureMessage(reason) {
|
|
19466
20380
|
switch (reason) {
|
|
19467
20381
|
case "org_pin_api_key_conflict":
|
|
@@ -19634,7 +20548,7 @@ async function handleResultMessage(turn, message) {
|
|
|
19634
20548
|
debugLog("[session-manager] Query stopped by the user", { sessionId });
|
|
19635
20549
|
finishTurnInputIfSettled(turn);
|
|
19636
20550
|
} else {
|
|
19637
|
-
|
|
20551
|
+
log12.error("query.failed", { subtype: resultMsg.subtype, sessionId, isError: resultIsError });
|
|
19638
20552
|
const startupFailure = resultMsg.startup_failure_reason ? claudeStartupFailureMessage(resultMsg.startup_failure_reason) : undefined;
|
|
19639
20553
|
const usageLimit = resultMsg.subtype === "success" && classifyUsageLimitError(resultMsg.result) ? resultMsg.result.trim().slice(0, MAX_USAGE_LIMIT_ERROR_CHARS) : undefined;
|
|
19640
20554
|
const resultError = startupFailure || resultMsg.errors?.filter(Boolean).join(`
|
|
@@ -20064,7 +20978,7 @@ async function handleSystemMessage(turn, message) {
|
|
|
20064
20978
|
}
|
|
20065
20979
|
|
|
20066
20980
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-handlers/user.ts
|
|
20067
|
-
var
|
|
20981
|
+
var log13 = createLogger("bridge.claude");
|
|
20068
20982
|
function handleUserMessage(turn, message) {
|
|
20069
20983
|
const { session, sessionId, stream } = turn;
|
|
20070
20984
|
const { toolTracker, taskRegistry, activeTaskIds } = stream;
|
|
@@ -20114,7 +21028,7 @@ function handleUserMessage(turn, message) {
|
|
|
20114
21028
|
if (turn.planApprovedThisTurn) {
|
|
20115
21029
|
for (const tool of toolTracker.getTools()) {
|
|
20116
21030
|
if (tool.toolName === "ExitPlanMode" && tool.toolState === "failure" && tool.toolUseId) {
|
|
20117
|
-
|
|
21031
|
+
log13.warn("plan-exit.failure-overridden", { sessionId, toolUseId: tool.toolUseId });
|
|
20118
21032
|
toolTracker.updateToolResult(tool.toolUseId, {
|
|
20119
21033
|
state: "success",
|
|
20120
21034
|
output: "Plan approved by the user. Proceeding with implementation.",
|
|
@@ -20186,7 +21100,7 @@ async function handleTurnMessage(turn, message) {
|
|
|
20186
21100
|
}
|
|
20187
21101
|
|
|
20188
21102
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-can-use-tool.ts
|
|
20189
|
-
var
|
|
21103
|
+
var log14 = createLogger("bridge.claude");
|
|
20190
21104
|
function boundedPlan(content) {
|
|
20191
21105
|
if (typeof content !== "string" || content.trim().length === 0)
|
|
20192
21106
|
return {};
|
|
@@ -20245,7 +21159,7 @@ async function askUserQuestion(turn, input, permissionContext) {
|
|
|
20245
21159
|
});
|
|
20246
21160
|
try {
|
|
20247
21161
|
const answers = await Promise.race([answerPromise, timeoutPromise]);
|
|
20248
|
-
|
|
21162
|
+
log14.info("question.answers-received", { questionId, answerCount: Object.keys(answers).length });
|
|
20249
21163
|
return {
|
|
20250
21164
|
behavior: "allow",
|
|
20251
21165
|
updatedInput: {
|
|
@@ -20254,7 +21168,7 @@ async function askUserQuestion(turn, input, permissionContext) {
|
|
|
20254
21168
|
}
|
|
20255
21169
|
};
|
|
20256
21170
|
} catch (error) {
|
|
20257
|
-
|
|
21171
|
+
log14.warn("question.wait-failed", { error: formatLogError(error) });
|
|
20258
21172
|
const message = error instanceof Error ? error.message : "Question was cancelled";
|
|
20259
21173
|
if (pendingQuestions.has(questionId)) {
|
|
20260
21174
|
eventEmitter.emit({
|
|
@@ -20335,7 +21249,7 @@ async function requestPlanApproval(turn, input, permissionContext) {
|
|
|
20335
21249
|
});
|
|
20336
21250
|
try {
|
|
20337
21251
|
const response = await Promise.race([approvalPromise, timeoutPromise]);
|
|
20338
|
-
|
|
21252
|
+
log14.info("plan-approval.result", {
|
|
20339
21253
|
approvalId,
|
|
20340
21254
|
approved: response.approved,
|
|
20341
21255
|
hasFeedback: typeof response.feedback === "string" && response.feedback.length > 0
|
|
@@ -20384,7 +21298,7 @@ Please revise the plan based on this feedback.` : `I've reviewed the plan and I
|
|
|
20384
21298
|
};
|
|
20385
21299
|
}
|
|
20386
21300
|
} catch (error) {
|
|
20387
|
-
|
|
21301
|
+
log14.warn("plan-approval.wait-failed", { error: formatLogError(error) });
|
|
20388
21302
|
const errorMessage = error instanceof Error ? error.message : "Plan approval was cancelled";
|
|
20389
21303
|
if (pendingPlanApprovals.has(approvalId)) {
|
|
20390
21304
|
eventEmitter.emit({
|
|
@@ -20474,7 +21388,7 @@ function createClaudeRuntimeTurn(turn) {
|
|
|
20474
21388
|
}
|
|
20475
21389
|
|
|
20476
21390
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-launch.ts
|
|
20477
|
-
var
|
|
21391
|
+
var log15 = createLogger("bridge.claude");
|
|
20478
21392
|
async function consumeClaudeRuntime(runtime, frames, markEnded) {
|
|
20479
21393
|
let failure;
|
|
20480
21394
|
try {
|
|
@@ -20550,7 +21464,7 @@ function releaseOrphanedForeground(runtime, error) {
|
|
|
20550
21464
|
eventEmitter.emit({ type: "session.idle", sessionId, data: { success: true } });
|
|
20551
21465
|
return;
|
|
20552
21466
|
}
|
|
20553
|
-
|
|
21467
|
+
log15.error("runtime.ended-under-resumed-turn", { sessionId });
|
|
20554
21468
|
session.status = "error";
|
|
20555
21469
|
session.error = error instanceof Error ? error.message : String(error);
|
|
20556
21470
|
eventEmitter.emit({ type: "session.error", sessionId, data: { error: session.error } });
|
|
@@ -20714,7 +21628,7 @@ async function runTurnOnRuntime(turn, plan, testHooks) {
|
|
|
20714
21628
|
}
|
|
20715
21629
|
|
|
20716
21630
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt-settle.ts
|
|
20717
|
-
var
|
|
21631
|
+
var log16 = createLogger("bridge.claude");
|
|
20718
21632
|
function settleTurnEnd(turn) {
|
|
20719
21633
|
const { session, sessionId, options, structuredRequestId, abortController, stream, diagnostics } = turn;
|
|
20720
21634
|
diagnostics?.streamSettled("resolved");
|
|
@@ -20835,7 +21749,7 @@ function settleFailedTurn(turn, error) {
|
|
|
20835
21749
|
recordInterruptedStructuredOutputIfCurrent(turn);
|
|
20836
21750
|
return;
|
|
20837
21751
|
}
|
|
20838
|
-
|
|
21752
|
+
log16.error("prompt.failed", { errorClass: diagnosticErrorClass(error) });
|
|
20839
21753
|
if (session.abortController === abortController) {
|
|
20840
21754
|
const killedBy = killedClaudeProcessSignal(error);
|
|
20841
21755
|
const failure = killedBy ? claudeProcessKilledMessage(killedBy) : error instanceof Error ? error.message : String(error);
|
|
@@ -20944,7 +21858,7 @@ function finalizeTurn(turn) {
|
|
|
20944
21858
|
}
|
|
20945
21859
|
|
|
20946
21860
|
// ../../bridges/claude-bridge/src/services/session-manager-prompt.ts
|
|
20947
|
-
var
|
|
21861
|
+
var log17 = createLogger("bridge.claude");
|
|
20948
21862
|
function turnWriterLiveness(turn) {
|
|
20949
21863
|
const tasks = Object.values(turn.session.backgroundTasks ?? {});
|
|
20950
21864
|
if (tasks.some((task) => LIVE_BACKGROUND_TASK_STATUSES.has(task.status)))
|
|
@@ -20987,7 +21901,7 @@ async function sendPrompt(sessionId, prompt, options, testHooks) {
|
|
|
20987
21901
|
try {
|
|
20988
21902
|
await sendPrompt(sessionId, followUp.prompt, followUp.options);
|
|
20989
21903
|
} catch (repromptError) {
|
|
20990
|
-
|
|
21904
|
+
log17.error(followUp.failureEvent, { error: formatLogError(repromptError) });
|
|
20991
21905
|
return Promise.reject(repromptError);
|
|
20992
21906
|
}
|
|
20993
21907
|
} catch (error) {
|
|
@@ -20999,7 +21913,7 @@ async function sendPrompt(sessionId, prompt, options, testHooks) {
|
|
|
20999
21913
|
}
|
|
21000
21914
|
}
|
|
21001
21915
|
// ../../bridges/claude-bridge/src/services/session-manager-close.ts
|
|
21002
|
-
var
|
|
21916
|
+
var log18 = createLogger("bridge.claude");
|
|
21003
21917
|
var CLOSE_CONFIRMATION_BUDGET_MS = 1e4;
|
|
21004
21918
|
|
|
21005
21919
|
class SessionCloseNotConfirmedError extends Error {
|
|
@@ -21062,7 +21976,7 @@ async function closeQueryControls(controls, deadline) {
|
|
|
21062
21976
|
if (await settlesBy(Promise.resolve(control.close()), deadline))
|
|
21063
21977
|
return;
|
|
21064
21978
|
} catch (error) {
|
|
21065
|
-
|
|
21979
|
+
log18.error("query.close-failed", {
|
|
21066
21980
|
errorClass: error instanceof Error ? error.name : typeof error
|
|
21067
21981
|
});
|
|
21068
21982
|
}
|
|
@@ -21082,18 +21996,18 @@ async function settlesBy(work, deadline) {
|
|
|
21082
21996
|
}
|
|
21083
21997
|
}
|
|
21084
21998
|
// ../../bridges/claude-bridge/src/routes/config.ts
|
|
21085
|
-
var
|
|
21999
|
+
var log19 = createLogger("bridge.claude");
|
|
21086
22000
|
var config2 = new Hono2;
|
|
21087
22001
|
config2.get("/models", async (c) => {
|
|
21088
22002
|
if (c.req.query("forceRefresh") === "true")
|
|
21089
22003
|
invalidateClaudeModelCatalog();
|
|
21090
22004
|
const startedAt = Date.now();
|
|
21091
|
-
|
|
22005
|
+
log19.debug("models.requested");
|
|
21092
22006
|
const [{ models, source }, versions] = await Promise.all([
|
|
21093
22007
|
getAvailableModelCatalog(),
|
|
21094
22008
|
getClaudeRuntimeVersions()
|
|
21095
22009
|
]);
|
|
21096
|
-
|
|
22010
|
+
log19.debug("models.responded", { count: models.length, durationMs: Date.now() - startedAt });
|
|
21097
22011
|
const response = {
|
|
21098
22012
|
models,
|
|
21099
22013
|
source,
|
|
@@ -22074,7 +22988,7 @@ function bridgeTranscriptPageRouteBody(source, query) {
|
|
|
22074
22988
|
}
|
|
22075
22989
|
|
|
22076
22990
|
// ../../bridges/claude-bridge/src/routes/session-transcript.ts
|
|
22077
|
-
var
|
|
22991
|
+
var log20 = createLogger("bridge.claude");
|
|
22078
22992
|
function claudeTranscriptSource(id, generation) {
|
|
22079
22993
|
const sessionData = peekSession(id);
|
|
22080
22994
|
if (!sessionData)
|
|
@@ -22127,7 +23041,7 @@ function registerSessionTranscriptRoutes(app, generation, materialize) {
|
|
|
22127
23041
|
const response = c.json(bridgeTranscriptRouteBody(read.source, query3(c)));
|
|
22128
23042
|
if (read.needsHydration) {
|
|
22129
23043
|
hydratePersistedSessionMessages(id).catch((error) => {
|
|
22130
|
-
|
|
23044
|
+
log20.warn("transcript.background-hydrate-failed", {
|
|
22131
23045
|
error: formatLogError(error, { stack: false })
|
|
22132
23046
|
});
|
|
22133
23047
|
});
|
|
@@ -22139,7 +23053,7 @@ function registerSessionTranscriptRoutes(app, generation, materialize) {
|
|
|
22139
23053
|
}
|
|
22140
23054
|
|
|
22141
23055
|
// ../../bridges/claude-bridge/src/routes/session.ts
|
|
22142
|
-
var
|
|
23056
|
+
var log21 = createLogger("bridge.claude");
|
|
22143
23057
|
var session = new Hono2;
|
|
22144
23058
|
var TRANSCRIPT_GENERATION = randomUUID5();
|
|
22145
23059
|
var MAX_QUESTION_ANSWER_REQUEST_BYTES = AGENT_INTERACTION_LIMITS.maxSerializedPayloadBytes + 1024;
|
|
@@ -22215,14 +23129,14 @@ session.post("/create", async (c) => {
|
|
|
22215
23129
|
const clientSessionKey = body.clientSessionKey;
|
|
22216
23130
|
const policy = effectiveExecutionPolicy(isNativeAgentExecutionPolicy(body.policy) ? body.policy : undefined);
|
|
22217
23131
|
const newSession = policy ? await createOrRecoverSession(title, clientSessionKey, policy) : await createOrRecoverSession(title, clientSessionKey);
|
|
22218
|
-
|
|
23132
|
+
log21.info("session.created", { sessionId: newSession.id });
|
|
22219
23133
|
const response = {
|
|
22220
23134
|
sessionId: newSession.id,
|
|
22221
23135
|
title: newSession.title
|
|
22222
23136
|
};
|
|
22223
23137
|
return c.json(response, 201);
|
|
22224
23138
|
} catch (error) {
|
|
22225
|
-
|
|
23139
|
+
log21.error("session.create-failed", { error: formatLogError(error) });
|
|
22226
23140
|
return c.json({ error: error instanceof Error ? error.message : "Failed to create session" }, 500);
|
|
22227
23141
|
}
|
|
22228
23142
|
});
|
|
@@ -22230,7 +23144,7 @@ session.get("/list", async (c) => {
|
|
|
22230
23144
|
try {
|
|
22231
23145
|
await reconcilePersistedSessions();
|
|
22232
23146
|
} catch (error) {
|
|
22233
|
-
|
|
23147
|
+
log21.warn("sessions.reconcile-failed", { error: formatLogError(error) });
|
|
22234
23148
|
}
|
|
22235
23149
|
const sessions = listSessions();
|
|
22236
23150
|
const response = {
|
|
@@ -22249,7 +23163,7 @@ async function resolveSession(id, failureMessage) {
|
|
|
22249
23163
|
try {
|
|
22250
23164
|
return { ok: true, session: getSession(id) ?? await ensurePersistedSession(id) };
|
|
22251
23165
|
} catch (error) {
|
|
22252
|
-
|
|
23166
|
+
log21.error("session.resolve-failed", { action: failureMessage, error: formatLogError(error) });
|
|
22253
23167
|
return {
|
|
22254
23168
|
ok: false,
|
|
22255
23169
|
body: { error: errorMessage(error, failureMessage) },
|
|
@@ -22270,7 +23184,7 @@ session.get("/:id", async (c) => {
|
|
|
22270
23184
|
try {
|
|
22271
23185
|
await hydratePersistedSessionMessages(id);
|
|
22272
23186
|
} catch (error) {
|
|
22273
|
-
|
|
23187
|
+
log21.error("session.task-state-hydrate-failed", { error: formatLogError(error) });
|
|
22274
23188
|
return c.json({ error: errorMessage(error, "Failed to hydrate session task state") }, sessionErrorStatus(error));
|
|
22275
23189
|
}
|
|
22276
23190
|
}
|
|
@@ -22321,7 +23235,7 @@ session.get("/:id/usage", async (c) => {
|
|
|
22321
23235
|
const contextUsage = await refreshClaudeContextUsage(resolved.session);
|
|
22322
23236
|
return c.json({ contextUsage });
|
|
22323
23237
|
} catch (error) {
|
|
22324
|
-
|
|
23238
|
+
log21.warn("context-usage.read-failed", { error: formatLogError(error, { stack: false }) });
|
|
22325
23239
|
return c.json({ error: "Context usage is temporarily unavailable" }, 503);
|
|
22326
23240
|
}
|
|
22327
23241
|
});
|
|
@@ -22396,7 +23310,7 @@ session.get("/:id/commands", async (c) => {
|
|
|
22396
23310
|
try {
|
|
22397
23311
|
return c.json(await readClaudeCommandCatalogue(c.req.param("id")));
|
|
22398
23312
|
} catch (error) {
|
|
22399
|
-
|
|
23313
|
+
log21.warn("commands.read-failed", { error: formatLogError(error, { stack: false }) });
|
|
22400
23314
|
return c.json({ error: errorMessage(error, "Claude command discovery failed") }, 503);
|
|
22401
23315
|
}
|
|
22402
23316
|
});
|
|
@@ -22641,7 +23555,7 @@ session.post("/:id/prompt", async (c) => {
|
|
|
22641
23555
|
rejectStarted?.(sessionOperationError("conflict", "Prompt stopped before launch"));
|
|
22642
23556
|
}, (error) => {
|
|
22643
23557
|
rejectStarted?.(error);
|
|
22644
|
-
|
|
23558
|
+
log21.error("prompt.processing-failed", { error: formatLogError(error) });
|
|
22645
23559
|
});
|
|
22646
23560
|
return { started, completion };
|
|
22647
23561
|
});
|
|
@@ -22655,7 +23569,7 @@ session.post("/:id/prompt", async (c) => {
|
|
|
22655
23569
|
duplicate: true
|
|
22656
23570
|
});
|
|
22657
23571
|
}
|
|
22658
|
-
|
|
23572
|
+
log21.debug("prompt.accepted", { sessionId: id });
|
|
22659
23573
|
return c.json({
|
|
22660
23574
|
status: "processing",
|
|
22661
23575
|
requestId,
|
|
@@ -22668,7 +23582,7 @@ session.post("/:id/prompt", async (c) => {
|
|
|
22668
23582
|
if (sessionData.rewindInProgress === true) {
|
|
22669
23583
|
return c.json({ error: "Session is restoring files from a checkpoint" }, 409);
|
|
22670
23584
|
}
|
|
22671
|
-
|
|
23585
|
+
log21.info("prompt.received", {
|
|
22672
23586
|
sessionId: id,
|
|
22673
23587
|
promptLength: prompt.length,
|
|
22674
23588
|
model,
|
|
@@ -22696,16 +23610,16 @@ session.post("/:id/prompt", async (c) => {
|
|
|
22696
23610
|
...workflowResultTurn ? { workflowResultTurn } : {},
|
|
22697
23611
|
...providerPrompt !== undefined ? { providerPrompt } : {}
|
|
22698
23612
|
}).catch((error) => {
|
|
22699
|
-
|
|
23613
|
+
log21.error("prompt.processing-failed", { error: formatLogError(error) });
|
|
22700
23614
|
});
|
|
22701
|
-
|
|
23615
|
+
log21.debug("prompt.accepted", { sessionId: id });
|
|
22702
23616
|
return c.json({
|
|
22703
23617
|
status: "processing",
|
|
22704
23618
|
requestId,
|
|
22705
23619
|
turnStartedAt: sessionData.turnStartedAt
|
|
22706
23620
|
}, 202);
|
|
22707
23621
|
} catch (error) {
|
|
22708
|
-
|
|
23622
|
+
log21.error("prompt.send-failed", { error: formatLogError(error) });
|
|
22709
23623
|
return c.json({ error: errorMessage(error, "Failed to send prompt") }, sessionErrorStatus(error));
|
|
22710
23624
|
}
|
|
22711
23625
|
});
|
|
@@ -22749,7 +23663,7 @@ session.delete("/:id", async (c) => {
|
|
|
22749
23663
|
}
|
|
22750
23664
|
return c.json({ error: "Session not found" }, 404);
|
|
22751
23665
|
} catch (error) {
|
|
22752
|
-
|
|
23666
|
+
log21.error("session.delete-failed", { error: formatLogError(error) });
|
|
22753
23667
|
return c.json({ error: errorMessage(error, "Failed to delete session") }, sessionErrorStatus(error));
|
|
22754
23668
|
}
|
|
22755
23669
|
});
|
|
@@ -22764,7 +23678,7 @@ session.post("/:id/rename", async (c) => {
|
|
|
22764
23678
|
const renamed = await renameSessionDurably(id, title);
|
|
22765
23679
|
return renamed ? c.json({ status: "renamed", title }) : c.json({ error: "Session not found" }, 404);
|
|
22766
23680
|
} catch (error) {
|
|
22767
|
-
|
|
23681
|
+
log21.error("session.rename-failed", { error: formatLogError(error) });
|
|
22768
23682
|
return c.json({ error: errorMessage(error, "Failed to rename session") }, sessionErrorStatus(error));
|
|
22769
23683
|
}
|
|
22770
23684
|
});
|
|
@@ -22793,7 +23707,7 @@ session.post("/:id/fork", async (c) => {
|
|
|
22793
23707
|
title: forked.title
|
|
22794
23708
|
}, 201);
|
|
22795
23709
|
} catch (error) {
|
|
22796
|
-
|
|
23710
|
+
log21.error("session.fork-failed", { error: formatLogError(error) });
|
|
22797
23711
|
return c.json({ error: errorMessage(error, "Failed to fork session") }, sessionErrorStatus(error));
|
|
22798
23712
|
}
|
|
22799
23713
|
});
|
|
@@ -22812,7 +23726,7 @@ session.post("/:id/compact", async (c) => {
|
|
|
22812
23726
|
return c.json({ error: "Session is restoring files from a checkpoint" }, 409);
|
|
22813
23727
|
}
|
|
22814
23728
|
sendPrompt(id, "/compact").catch((error) => {
|
|
22815
|
-
|
|
23729
|
+
log21.error("session.compact-failed", { error: formatLogError(error) });
|
|
22816
23730
|
});
|
|
22817
23731
|
return c.json({ status: "processing" }, 202);
|
|
22818
23732
|
});
|
|
@@ -22830,7 +23744,7 @@ session.post("/:id/rewind", async (c) => {
|
|
|
22830
23744
|
const result = await rewindSessionFiles(id, messageId, dryRun);
|
|
22831
23745
|
return c.json({ status: dryRun ? "previewed" : "rewound", result });
|
|
22832
23746
|
} catch (error) {
|
|
22833
|
-
|
|
23747
|
+
log21.error("session.rewind-failed", { error: formatLogError(error) });
|
|
22834
23748
|
return c.json({ error: errorMessage(error, "Failed to rewind session files") }, sessionErrorStatus(error));
|
|
22835
23749
|
}
|
|
22836
23750
|
});
|
|
@@ -22841,7 +23755,7 @@ session.post("/:id/tasks/:taskId/stop", async (c) => {
|
|
|
22841
23755
|
return c.json({ status: "stopped" });
|
|
22842
23756
|
return c.json({ error: stopped.message }, stopped.reason === "no_control_channel" ? 409 : 404);
|
|
22843
23757
|
} catch (error) {
|
|
22844
|
-
|
|
23758
|
+
log21.error("task.stop-route-failed", { error: formatLogError(error) });
|
|
22845
23759
|
return c.json({ error: errorMessage(error, "Failed to stop background task") }, sessionErrorStatus(error));
|
|
22846
23760
|
}
|
|
22847
23761
|
});
|
|
@@ -22912,7 +23826,7 @@ session.post("/:id/questions/:questionId/answer", questionAnswerBodyLimit, async
|
|
|
22912
23826
|
const pendingQuestions = getPendingQuestions(sessionId);
|
|
22913
23827
|
const pendingQuestion = pendingQuestions.find((q) => q.id === questionId);
|
|
22914
23828
|
if (!pendingQuestion) {
|
|
22915
|
-
|
|
23829
|
+
log21.info("question.stale", { questionId });
|
|
22916
23830
|
return c.json(stalePrompt("Question is no longer pending"), STALE_PROMPT_STATUS);
|
|
22917
23831
|
}
|
|
22918
23832
|
if (!isBoundedClaudeQuestionAnswers(answersArray, pendingQuestion.questions.length)) {
|
|
@@ -22923,7 +23837,7 @@ session.post("/:id/questions/:questionId/answer", questionAnswerBodyLimit, async
|
|
|
22923
23837
|
const questionAnswers = answersArray[index] || [];
|
|
22924
23838
|
answersRecord[q.question] = serializeClaudeQuestionAnswer(questionAnswers, q.multiSelect === true);
|
|
22925
23839
|
});
|
|
22926
|
-
|
|
23840
|
+
log21.debug("question.answers-prepared", {
|
|
22927
23841
|
questionId,
|
|
22928
23842
|
questionCount: pendingQuestion.questions.length,
|
|
22929
23843
|
answerCount: answersArray.reduce((count, answers) => count + answers.length, 0)
|
|
@@ -22935,7 +23849,7 @@ session.post("/:id/questions/:questionId/answer", questionAnswerBodyLimit, async
|
|
|
22935
23849
|
return c.json(stalePrompt("Question is no longer pending"), STALE_PROMPT_STATUS);
|
|
22936
23850
|
}
|
|
22937
23851
|
} catch (error) {
|
|
22938
|
-
|
|
23852
|
+
log21.error("question.answer-failed", { error: formatLogError(error) });
|
|
22939
23853
|
return c.json({ error: error instanceof Error ? error.message : "Failed to answer question" }, 500);
|
|
22940
23854
|
}
|
|
22941
23855
|
});
|
|
@@ -22975,7 +23889,7 @@ session.post("/:id/plan-approvals/:approvalId/respond", planApprovalBodyLimit, a
|
|
|
22975
23889
|
if (approved && (typeof pendingApproval.plan !== "string" || pendingApproval.plan.trim().length === 0 || pendingApproval.planTruncated === true)) {
|
|
22976
23890
|
return c.json({ error: "A complete plan is required before approval", status: "rejected" }, 409);
|
|
22977
23891
|
}
|
|
22978
|
-
|
|
23892
|
+
log21.info("plan-approval.response-received", {
|
|
22979
23893
|
sessionId,
|
|
22980
23894
|
approvalId,
|
|
22981
23895
|
approved,
|
|
@@ -22988,7 +23902,7 @@ session.post("/:id/plan-approvals/:approvalId/respond", planApprovalBodyLimit, a
|
|
|
22988
23902
|
return c.json(stalePrompt("Plan approval is no longer pending"), STALE_PROMPT_STATUS);
|
|
22989
23903
|
}
|
|
22990
23904
|
} catch (error) {
|
|
22991
|
-
|
|
23905
|
+
log21.error("plan-approval.response-failed", { error: formatLogError(error) });
|
|
22992
23906
|
return c.json({ error: error instanceof Error ? error.message : "Failed to respond to plan approval" }, 500);
|
|
22993
23907
|
}
|
|
22994
23908
|
});
|
|
@@ -23270,7 +24184,7 @@ var streamSSE = (c, cb, onError) => {
|
|
|
23270
24184
|
};
|
|
23271
24185
|
|
|
23272
24186
|
// ../../bridges/claude-bridge/src/routes/events.ts
|
|
23273
|
-
var
|
|
24187
|
+
var log22 = createLogger("bridge.claude");
|
|
23274
24188
|
var serializedEventData = new WeakMap;
|
|
23275
24189
|
function serializeEventData(event) {
|
|
23276
24190
|
let data = serializedEventData.get(event);
|
|
@@ -23445,10 +24359,10 @@ function createEventsRouter(limits = {}) {
|
|
|
23445
24359
|
events.get("/subscribe", (c) => {
|
|
23446
24360
|
const origin = c.req.header("origin");
|
|
23447
24361
|
const userAgent = c.req.header("user-agent");
|
|
23448
|
-
|
|
24362
|
+
log22.debug("sse.subscribe-requested", { origin, userAgent });
|
|
23449
24363
|
return streamSSE(c, async (stream) => {
|
|
23450
24364
|
const connectedAt = new Date().toISOString();
|
|
23451
|
-
|
|
24365
|
+
log22.debug("sse.opened", { connectedAt });
|
|
23452
24366
|
let isOpen = true;
|
|
23453
24367
|
let resolveConnectionClosed;
|
|
23454
24368
|
const connectionClosed = new Promise((resolve) => {
|
|
@@ -23459,7 +24373,7 @@ function createEventsRouter(limits = {}) {
|
|
|
23459
24373
|
resolveRequestAborted = resolve;
|
|
23460
24374
|
});
|
|
23461
24375
|
const onRequestAbort = () => {
|
|
23462
|
-
|
|
24376
|
+
log22.debug("sse.aborted");
|
|
23463
24377
|
isOpen = false;
|
|
23464
24378
|
resolveRequestAborted();
|
|
23465
24379
|
};
|
|
@@ -23473,7 +24387,7 @@ function createEventsRouter(limits = {}) {
|
|
|
23473
24387
|
if (!isOpen)
|
|
23474
24388
|
return;
|
|
23475
24389
|
isOpen = false;
|
|
23476
|
-
|
|
24390
|
+
log22.info("sse.closed", { reason });
|
|
23477
24391
|
resolveConnectionClosed();
|
|
23478
24392
|
};
|
|
23479
24393
|
const writeFrame = createBoundedSseWriter(async (frame) => {
|
|
@@ -23516,7 +24430,7 @@ function createEventsRouter(limits = {}) {
|
|
|
23516
24430
|
}
|
|
23517
24431
|
writeFrame(frame).catch((error) => {
|
|
23518
24432
|
if (!c.req.raw.signal.aborted) {
|
|
23519
|
-
|
|
24433
|
+
log22.warn("sse.write-failed", { error: formatLogError(error) });
|
|
23520
24434
|
closeConnection("write failed");
|
|
23521
24435
|
}
|
|
23522
24436
|
});
|
|
@@ -23568,7 +24482,7 @@ function createEventsRouter(limits = {}) {
|
|
|
23568
24482
|
data: JSON.stringify({ timestamp: new Date().toISOString() })
|
|
23569
24483
|
}).catch((error) => {
|
|
23570
24484
|
if (!c.req.raw.signal.aborted) {
|
|
23571
|
-
|
|
24485
|
+
log22.warn("sse.keepalive-failed", { error: formatLogError(error, { stack: false }) });
|
|
23572
24486
|
closeConnection("keepalive failed");
|
|
23573
24487
|
}
|
|
23574
24488
|
});
|
|
@@ -23576,10 +24490,10 @@ function createEventsRouter(limits = {}) {
|
|
|
23576
24490
|
await Promise.race([connectionClosed, requestAborted]);
|
|
23577
24491
|
} catch (error) {
|
|
23578
24492
|
if (!c.req.raw.signal.aborted) {
|
|
23579
|
-
|
|
24493
|
+
log22.warn("sse.handshake-failed", { error: formatLogError(error) });
|
|
23580
24494
|
}
|
|
23581
24495
|
} finally {
|
|
23582
|
-
|
|
24496
|
+
log22.debug("sse.cleanup");
|
|
23583
24497
|
isOpen = false;
|
|
23584
24498
|
c.req.raw.signal.removeEventListener("abort", onRequestAbort);
|
|
23585
24499
|
if (keepaliveInterval)
|
|
@@ -23595,7 +24509,7 @@ var events = createEventsRouter();
|
|
|
23595
24509
|
var events_default = events;
|
|
23596
24510
|
|
|
23597
24511
|
// ../../bridges/claude-bridge/src/routes/mcp.ts
|
|
23598
|
-
var
|
|
24512
|
+
var log23 = createLogger("bridge.claude");
|
|
23599
24513
|
var mcp = new Hono2;
|
|
23600
24514
|
mcp.get("/servers", async (c) => {
|
|
23601
24515
|
try {
|
|
@@ -23606,14 +24520,14 @@ mcp.get("/servers", async (c) => {
|
|
|
23606
24520
|
cwd
|
|
23607
24521
|
});
|
|
23608
24522
|
} catch (error) {
|
|
23609
|
-
|
|
24523
|
+
log23.error("mcp.read-failed", { error: formatLogError(error) });
|
|
23610
24524
|
return c.json({ error: error instanceof Error ? error.message : "Failed to get MCP servers" }, 500);
|
|
23611
24525
|
}
|
|
23612
24526
|
});
|
|
23613
24527
|
var mcp_default = mcp;
|
|
23614
24528
|
|
|
23615
24529
|
// ../../bridges/claude-bridge/src/routes/plugins.ts
|
|
23616
|
-
var
|
|
24530
|
+
var log24 = createLogger("bridge.claude");
|
|
23617
24531
|
var plugins = new Hono2;
|
|
23618
24532
|
plugins.get("/", async (c) => {
|
|
23619
24533
|
try {
|
|
@@ -23624,7 +24538,7 @@ plugins.get("/", async (c) => {
|
|
|
23624
24538
|
cwd
|
|
23625
24539
|
});
|
|
23626
24540
|
} catch (error) {
|
|
23627
|
-
|
|
24541
|
+
log24.error("plugins.read-failed", { error: formatLogError(error) });
|
|
23628
24542
|
return c.json({ error: error instanceof Error ? error.message : "Failed to get plugins" }, 500);
|
|
23629
24543
|
}
|
|
23630
24544
|
});
|
|
@@ -25297,11 +26211,11 @@ var serve = (options, listeningListener) => {
|
|
|
25297
26211
|
};
|
|
25298
26212
|
|
|
25299
26213
|
// ../../bridges/claude-bridge/src/index.ts
|
|
25300
|
-
var
|
|
26214
|
+
var log25 = createLogger("bridge.claude");
|
|
25301
26215
|
configureBridgeLogger();
|
|
25302
26216
|
var app = new Hono2;
|
|
25303
26217
|
app.onError((error, c) => {
|
|
25304
|
-
|
|
26218
|
+
log25.error("http.request-failed", {
|
|
25305
26219
|
method: c.req.method,
|
|
25306
26220
|
path: c.req.path,
|
|
25307
26221
|
error: formatLogError(error)
|
|
@@ -25430,7 +26344,7 @@ if (parentPid !== null) {
|
|
|
25430
26344
|
startParentWatchdog({
|
|
25431
26345
|
parentPid,
|
|
25432
26346
|
onParentExit: () => {
|
|
25433
|
-
|
|
26347
|
+
log25.warn("parent.gone", { parentPid });
|
|
25434
26348
|
process.exit(0);
|
|
25435
26349
|
}
|
|
25436
26350
|
});
|
|
@@ -25441,13 +26355,13 @@ function startBridgeServer(env = process.env, start = serve) {
|
|
|
25441
26355
|
}
|
|
25442
26356
|
const port = parseInt(env.PORT || "4097", 10);
|
|
25443
26357
|
const hostname = env.HOSTNAME || "0.0.0.0";
|
|
25444
|
-
|
|
26358
|
+
log25.debug("server.starting", { hostname, port });
|
|
25445
26359
|
const server = start({
|
|
25446
26360
|
fetch: app.fetch,
|
|
25447
26361
|
port,
|
|
25448
26362
|
hostname
|
|
25449
26363
|
});
|
|
25450
|
-
|
|
26364
|
+
log25.info("server.listening", { hostname, port });
|
|
25451
26365
|
return server;
|
|
25452
26366
|
}
|
|
25453
26367
|
var __testing = {
|