harnery 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commander.d.ts +30 -5
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +128 -96
- package/dist/commands/agents.d.ts +23 -3
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +464 -242
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +26 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +10 -10
- package/dist/commands/browse-session.d.ts.map +1 -1
- package/dist/commands/browse-session.js +12 -0
- package/dist/commands/browse.d.ts +1 -1
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +16 -4
- package/dist/commands/conversations.d.ts +10 -0
- package/dist/commands/conversations.d.ts.map +1 -0
- package/dist/commands/conversations.js +201 -0
- package/dist/commands/deinit.d.ts.map +1 -1
- package/dist/commands/deinit.js +5 -0
- package/dist/commands/diagnostics.d.ts +4 -0
- package/dist/commands/diagnostics.d.ts.map +1 -0
- package/dist/commands/diagnostics.js +229 -0
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -2
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +51 -7
- package/dist/commands/fetch.js +6 -5
- package/dist/commands/files.d.ts +34 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +166 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +18 -12
- package/dist/commands/inbox.d.ts +5 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +57 -0
- package/dist/commands/init.d.ts +4 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +63 -13
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +417 -2
- package/dist/commands/logs.d.ts +4 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +169 -0
- package/dist/commands/messages.d.ts +5 -0
- package/dist/commands/messages.d.ts.map +1 -0
- package/dist/commands/messages.js +45 -0
- package/dist/commands/outline.d.ts +1 -1
- package/dist/commands/outline.d.ts.map +1 -1
- package/dist/commands/outline.js +2 -2
- package/dist/commands/qa-run.d.ts +4 -0
- package/dist/commands/qa-run.d.ts.map +1 -0
- package/dist/commands/qa-run.js +141 -0
- package/dist/commands/read.d.ts +1 -1
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +2 -2
- package/dist/commands/resources.d.ts +4 -0
- package/dist/commands/resources.d.ts.map +1 -0
- package/dist/commands/resources.js +29 -0
- package/dist/commands/semantic.d.ts.map +1 -1
- package/dist/commands/semantic.js +54 -2
- package/dist/commands/storage.d.ts +4 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +238 -0
- package/dist/commands/supervisor.d.ts +4 -0
- package/dist/commands/supervisor.d.ts.map +1 -0
- package/dist/commands/supervisor.js +101 -0
- package/dist/commands/tunnel.d.ts +5 -1
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +44 -31
- package/dist/commands/web.d.ts +3 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +84 -7
- package/dist/commands/work.js +3 -3
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +17 -13
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/cli.js +215 -41
- package/dist/core/agents/health.d.ts +17 -0
- package/dist/core/agents/health.d.ts.map +1 -0
- package/dist/core/agents/health.js +109 -0
- package/dist/core/agents/live-authority-v3.d.ts +47 -1
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +244 -10
- package/dist/core/agents/live-lifecycle-v3.js +6 -1
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -1
- package/dist/core/agents/live-observation-v3.js +6 -1
- package/dist/core/agents/mailbox.d.ts +92 -0
- package/dist/core/agents/mailbox.d.ts.map +1 -0
- package/dist/core/agents/mailbox.js +325 -0
- package/dist/core/agents/reconcile-coordination-v3.d.ts +44 -0
- package/dist/core/agents/reconcile-coordination-v3.d.ts.map +1 -0
- package/dist/core/agents/reconcile-coordination-v3.js +58 -0
- package/dist/core/agents/render/prompt-context.d.ts +14 -3
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +54 -16
- package/dist/core/agents/render/session-context.d.ts +8 -0
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +34 -3
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +50 -1
- package/dist/core/agents/rules/stop-hook.d.ts +2 -0
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +93 -16
- package/dist/core/agents/rules/verdict.d.ts +1 -0
- package/dist/core/agents/rules/verdict.d.ts.map +1 -1
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +4 -0
- package/dist/core/agents/session-finalization-state-v3.js +1 -1
- package/dist/core/agents/session-finalizer-v3.js +9 -2
- package/dist/core/agents/state/activity-log.d.ts +3 -0
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +6 -3
- package/dist/core/agents/state/heartbeat-writer.d.ts +6 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +18 -0
- package/dist/core/agents/state/live-coordination-view.d.ts +5 -7
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +15 -90
- package/dist/core/agents/state/live-coordination-writer.d.ts +12 -0
- package/dist/core/agents/state/live-coordination-writer.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-writer.js +92 -0
- package/dist/core/artifacts/index.d.ts +47 -1
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +191 -6
- package/dist/core/config.d.ts +74 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +141 -4
- package/dist/core/conversations/archive.d.ts +49 -0
- package/dist/core/conversations/archive.d.ts.map +1 -0
- package/dist/core/conversations/archive.js +136 -0
- package/dist/core/conversations/catalog.d.ts +10 -0
- package/dist/core/conversations/catalog.d.ts.map +1 -0
- package/dist/core/conversations/catalog.js +72 -0
- package/dist/core/conversations/context-pack.d.ts +6 -0
- package/dist/core/conversations/context-pack.d.ts.map +1 -0
- package/dist/core/conversations/context-pack.js +60 -0
- package/dist/core/conversations/contract.d.ts +155 -0
- package/dist/core/conversations/contract.d.ts.map +1 -0
- package/dist/core/conversations/contract.js +1 -0
- package/dist/core/conversations/evaluation.d.ts +16 -0
- package/dist/core/conversations/evaluation.d.ts.map +1 -0
- package/dist/core/conversations/evaluation.js +9 -0
- package/dist/core/conversations/index.d.ts +10 -0
- package/dist/core/conversations/index.d.ts.map +1 -0
- package/dist/core/conversations/index.js +9 -0
- package/dist/core/conversations/lifecycle.d.ts +28 -0
- package/dist/core/conversations/lifecycle.d.ts.map +1 -0
- package/dist/core/conversations/lifecycle.js +29 -0
- package/dist/core/conversations/normalize.d.ts +14 -0
- package/dist/core/conversations/normalize.d.ts.map +1 -0
- package/dist/core/conversations/normalize.js +82 -0
- package/dist/core/conversations/query.d.ts +8 -0
- package/dist/core/conversations/query.d.ts.map +1 -0
- package/dist/core/conversations/query.js +280 -0
- package/dist/core/conversations/search-index.d.ts +9 -0
- package/dist/core/conversations/search-index.d.ts.map +1 -0
- package/dist/core/conversations/search-index.js +29 -0
- package/dist/core/diagnostics/advice.d.ts +9 -0
- package/dist/core/diagnostics/advice.d.ts.map +1 -0
- package/dist/core/diagnostics/advice.js +112 -0
- package/dist/core/diagnostics/bundle.d.ts +35 -0
- package/dist/core/diagnostics/bundle.d.ts.map +1 -0
- package/dist/core/diagnostics/bundle.js +874 -0
- package/dist/core/diagnostics/comparison.d.ts +5 -0
- package/dist/core/diagnostics/comparison.d.ts.map +1 -0
- package/dist/core/diagnostics/comparison.js +444 -0
- package/dist/core/diagnostics/contract.d.ts +245 -0
- package/dist/core/diagnostics/contract.d.ts.map +1 -0
- package/dist/core/diagnostics/contract.js +18 -0
- package/dist/core/diagnostics/identity.d.ts +3 -0
- package/dist/core/diagnostics/identity.d.ts.map +1 -0
- package/dist/core/diagnostics/identity.js +10 -0
- package/dist/core/diagnostics/index.d.ts +8 -0
- package/dist/core/diagnostics/index.d.ts.map +1 -0
- package/dist/core/diagnostics/index.js +7 -0
- package/dist/core/diagnostics/replay.d.ts +8 -0
- package/dist/core/diagnostics/replay.d.ts.map +1 -0
- package/dist/core/diagnostics/replay.js +213 -0
- package/dist/core/diagnostics/sanitize.d.ts +9 -0
- package/dist/core/diagnostics/sanitize.d.ts.map +1 -0
- package/dist/core/diagnostics/sanitize.js +84 -0
- package/dist/core/events/legacy-storage/canary.d.ts +18 -0
- package/dist/core/events/legacy-storage/canary.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/canary.js +150 -0
- package/dist/core/events/legacy-storage/compression.d.ts +13 -0
- package/dist/core/events/legacy-storage/compression.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/compression.js +107 -0
- package/dist/core/events/legacy-storage/fence.d.ts +15 -0
- package/dist/core/events/legacy-storage/fence.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/fence.js +115 -0
- package/dist/core/events/legacy-storage/index.d.ts +7 -0
- package/dist/core/events/legacy-storage/index.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/index.js +6 -0
- package/dist/core/events/legacy-storage/inventory.d.ts +10 -0
- package/dist/core/events/legacy-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/inventory.js +40 -0
- package/dist/core/events/legacy-storage/manifest.d.ts +23 -0
- package/dist/core/events/legacy-storage/manifest.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/manifest.js +108 -0
- package/dist/core/events/legacy-storage/reader.d.ts +15 -0
- package/dist/core/events/legacy-storage/reader.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/reader.js +154 -0
- package/dist/core/events/v3/archive-retention.d.ts +33 -0
- package/dist/core/events/v3/archive-retention.d.ts.map +1 -0
- package/dist/core/events/v3/archive-retention.js +195 -0
- package/dist/core/events/v3/authority-outbox.d.ts +7 -2
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
- package/dist/core/events/v3/authority-outbox.js +16 -3
- package/dist/core/events/v3/base-contract.d.ts +81 -41
- package/dist/core/events/v3/base-contract.d.ts.map +1 -1
- package/dist/core/events/v3/base-contract.js +17 -7
- package/dist/core/events/v3/bootstrap.d.ts +39 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +167 -3
- package/dist/core/events/v3/capabilities.d.ts +1 -1
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +4 -3
- package/dist/core/events/v3/control-witness.d.ts +44 -0
- package/dist/core/events/v3/control-witness.d.ts.map +1 -0
- package/dist/core/events/v3/control-witness.js +233 -0
- package/dist/core/events/v3/control-writer.d.ts +4 -0
- package/dist/core/events/v3/control-writer.d.ts.map +1 -0
- package/dist/core/events/v3/control-writer.js +16 -0
- package/dist/core/events/v3/control.d.ts +8 -2
- package/dist/core/events/v3/control.d.ts.map +1 -1
- package/dist/core/events/v3/control.js +46 -18
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts +42 -0
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-transaction-recovery.js +342 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-view.js +16 -1
- package/dist/core/events/v3/generated.d.ts +1 -1
- package/dist/core/events/v3/generated.js +1 -1
- package/dist/core/events/v3/index.d.ts +5 -2
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +4 -1
- package/dist/core/events/v3/live-route-observer.d.ts +31 -0
- package/dist/core/events/v3/live-route-observer.d.ts.map +1 -0
- package/dist/core/events/v3/live-route-observer.js +58 -0
- package/dist/core/events/v3/live-routing.d.ts +13 -21
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +46 -41
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +11 -1
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +76 -10
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts +129 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts.map +1 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.js +499 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +1 -1
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +14 -3
- package/dist/core/events/v3/producers/intake.d.ts +7 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +26 -2
- package/dist/core/events/v3/producers/producer-state-observer.d.ts +8 -0
- package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -0
- package/dist/core/events/v3/producers/producer-state-observer.js +45 -0
- package/dist/core/events/v3/producers/recorder.d.ts +71 -1
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +441 -25
- package/dist/core/events/v3/reader.d.ts +51 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -1
- package/dist/core/events/v3/reader.js +181 -1
- package/dist/core/events/v3/rotation-config.d.ts +9 -0
- package/dist/core/events/v3/rotation-config.d.ts.map +1 -0
- package/dist/core/events/v3/rotation-config.js +91 -0
- package/dist/core/events/v3/runtime-build.d.ts +11 -0
- package/dist/core/events/v3/runtime-build.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-build.js +39 -0
- package/dist/core/events/v3/runtime-identity.d.ts +5 -0
- package/dist/core/events/v3/runtime-identity.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-identity.js +18 -0
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +6 -5
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/runtime-telemetry-capabilities.js +1 -1
- package/dist/core/events/v3/support-storage/classify.d.ts +46 -0
- package/dist/core/events/v3/support-storage/classify.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/classify.js +149 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts +29 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/eligibility.js +35 -0
- package/dist/core/events/v3/support-storage/index.d.ts +10 -0
- package/dist/core/events/v3/support-storage/index.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/index.js +9 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts +30 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/inventory.js +94 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts +14 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/logical-authority.js +104 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts +98 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/maintenance.js +352 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts +59 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-contract.js +249 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts +34 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-reader.js +258 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts +30 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-writer.js +268 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts +15 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/recovery.js +22 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +14 -8
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
- package/dist/core/events/v3/turn-telemetry.js +32 -2
- package/dist/core/events/v3/writer.d.ts +13 -1
- package/dist/core/events/v3/writer.d.ts.map +1 -1
- package/dist/core/events/v3/writer.js +126 -12
- package/dist/core/governor/plan-read.d.ts.map +1 -1
- package/dist/core/governor/plan-read.js +5 -21
- package/dist/core/governor/planning.js +6 -8
- package/dist/core/governor/service-read.d.ts +12 -0
- package/dist/core/governor/service-read.d.ts.map +1 -1
- package/dist/core/governor/service-read.js +266 -2
- package/dist/core/governor/service.d.ts +1 -0
- package/dist/core/governor/service.d.ts.map +1 -1
- package/dist/core/governor/service.js +53 -18
- package/dist/core/guard/evidence-v3.d.ts.map +1 -1
- package/dist/core/guard/evidence-v3.js +2 -0
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +1 -0
- package/dist/core/hooks/adapter/output.d.ts +12 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +23 -5
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts +27 -4
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts.map +1 -1
- package/dist/core/hooks/adapter/runtime-telemetry.js +307 -6
- package/dist/core/hooks/cli.js +380 -207
- package/dist/core/hooks/effects/image-capture.d.ts +1 -1
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +4 -2
- package/dist/core/hooks/health.d.ts +59 -0
- package/dist/core/hooks/health.d.ts.map +1 -0
- package/dist/core/hooks/health.js +84 -0
- package/dist/core/hooks/remediation-cap.d.ts +8 -3
- package/dist/core/hooks/remediation-cap.d.ts.map +1 -1
- package/dist/core/hooks/remediation-cap.js +3 -11
- package/dist/core/hooks/resolve/coord-root.d.ts +22 -9
- package/dist/core/hooks/resolve/coord-root.d.ts.map +1 -1
- package/dist/core/hooks/resolve/coord-root.js +92 -11
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +5 -0
- package/dist/core/hooks/resolve/transcript.d.ts +8 -0
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +11 -0
- package/dist/core/inbox/contract.d.ts +64 -0
- package/dist/core/inbox/contract.d.ts.map +1 -0
- package/dist/core/inbox/contract.js +13 -0
- package/dist/core/inbox/index.d.ts +5 -0
- package/dist/core/inbox/index.d.ts.map +1 -0
- package/dist/core/inbox/index.js +4 -0
- package/dist/core/inbox/lifecycle.d.ts +22 -0
- package/dist/core/inbox/lifecycle.d.ts.map +1 -0
- package/dist/core/inbox/lifecycle.js +41 -0
- package/dist/core/inbox/service.d.ts +36 -0
- package/dist/core/inbox/service.d.ts.map +1 -0
- package/dist/core/inbox/service.js +210 -0
- package/dist/core/inbox/watcher.d.ts +7 -0
- package/dist/core/inbox/watcher.d.ts.map +1 -0
- package/dist/core/inbox/watcher.js +26 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -1
- package/dist/core/presence/codec-digest.js +14 -3
- package/dist/core/presence/relay-client.d.ts +1 -0
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +52 -8
- package/dist/core/resources/contract.d.ts +90 -0
- package/dist/core/resources/contract.d.ts.map +1 -0
- package/dist/core/resources/contract.js +2 -0
- package/dist/core/resources/index.d.ts +6 -0
- package/dist/core/resources/index.d.ts.map +1 -0
- package/dist/core/resources/index.js +5 -0
- package/dist/core/resources/sampler.d.ts +27 -0
- package/dist/core/resources/sampler.d.ts.map +1 -0
- package/dist/core/resources/sampler.js +357 -0
- package/dist/core/resources/service-status.d.ts +3 -0
- package/dist/core/resources/service-status.d.ts.map +1 -0
- package/dist/core/resources/service-status.js +48 -0
- package/dist/core/resources/service.d.ts +26 -0
- package/dist/core/resources/service.d.ts.map +1 -0
- package/dist/core/resources/service.js +292 -0
- package/dist/core/resources/storage.d.ts +13 -0
- package/dist/core/resources/storage.d.ts.map +1 -0
- package/dist/core/resources/storage.js +30 -0
- package/dist/core/semantic/adapters.d.ts +11 -8
- package/dist/core/semantic/adapters.d.ts.map +1 -1
- package/dist/core/semantic/adapters.js +169 -31
- package/dist/core/semantic/contract.d.ts +532 -48
- package/dist/core/semantic/contract.d.ts.map +1 -1
- package/dist/core/semantic/contract.js +104 -3
- package/dist/core/semantic/index.d.ts +7 -3
- package/dist/core/semantic/index.d.ts.map +1 -1
- package/dist/core/semantic/index.js +7 -3
- package/dist/core/semantic/once.d.ts +6 -1
- package/dist/core/semantic/once.d.ts.map +1 -1
- package/dist/core/semantic/once.js +80 -9
- package/dist/core/semantic/prompt.d.ts.map +1 -1
- package/dist/core/semantic/prompt.js +14 -1
- package/dist/core/semantic/review.d.ts +144 -0
- package/dist/core/semantic/review.d.ts.map +1 -0
- package/dist/core/semantic/review.js +544 -0
- package/dist/core/semantic/routes.d.ts +10 -0
- package/dist/core/semantic/routes.d.ts.map +1 -0
- package/dist/core/semantic/routes.js +21 -0
- package/dist/core/semantic/scheduler.d.ts +14 -3
- package/dist/core/semantic/scheduler.d.ts.map +1 -1
- package/dist/core/semantic/scheduler.js +30 -6
- package/dist/core/semantic/service-status.d.ts +20 -0
- package/dist/core/semantic/service-status.d.ts.map +1 -1
- package/dist/core/semantic/service-status.js +60 -4
- package/dist/core/semantic/service.d.ts +1 -0
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +104 -15
- package/dist/core/semantic/soak.d.ts +75 -0
- package/dist/core/semantic/soak.d.ts.map +1 -0
- package/dist/core/semantic/soak.js +476 -0
- package/dist/core/semantic/storage.d.ts +11 -1
- package/dist/core/semantic/storage.d.ts.map +1 -1
- package/dist/core/semantic/storage.js +4 -3
- package/dist/core/semantic/usage.d.ts +43 -0
- package/dist/core/semantic/usage.d.ts.map +1 -0
- package/dist/core/semantic/usage.js +193 -0
- package/dist/core/semantic/validate.d.ts +3 -1
- package/dist/core/semantic/validate.d.ts.map +1 -1
- package/dist/core/semantic/validate.js +34 -1
- package/dist/core/storage/atomic-json.d.ts +3 -0
- package/dist/core/storage/atomic-json.d.ts.map +1 -0
- package/dist/core/storage/atomic-json.js +15 -0
- package/dist/core/storage/buffer.d.ts +28 -0
- package/dist/core/storage/buffer.d.ts.map +1 -0
- package/dist/core/storage/buffer.js +101 -0
- package/dist/core/storage/builtins.d.ts +3 -0
- package/dist/core/storage/builtins.d.ts.map +1 -0
- package/dist/core/storage/builtins.js +722 -0
- package/dist/core/storage/catalog.d.ts +19 -0
- package/dist/core/storage/catalog.d.ts.map +1 -0
- package/dist/core/storage/catalog.js +365 -0
- package/dist/core/storage/config.d.ts +16 -0
- package/dist/core/storage/config.d.ts.map +1 -0
- package/dist/core/storage/config.js +311 -0
- package/dist/core/storage/contract.d.ts +275 -0
- package/dist/core/storage/contract.d.ts.map +1 -0
- package/dist/core/storage/contract.js +3 -0
- package/dist/core/storage/durable-history.d.ts +36 -0
- package/dist/core/storage/durable-history.d.ts.map +1 -0
- package/dist/core/storage/durable-history.js +606 -0
- package/dist/core/storage/health.d.ts +4 -0
- package/dist/core/storage/health.d.ts.map +1 -0
- package/dist/core/storage/health.js +65 -0
- package/dist/core/storage/index.d.ts +16 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +15 -0
- package/dist/core/storage/inventory.d.ts +25 -0
- package/dist/core/storage/inventory.d.ts.map +1 -0
- package/dist/core/storage/inventory.js +666 -0
- package/dist/core/storage/jsonl.d.ts +52 -0
- package/dist/core/storage/jsonl.d.ts.map +1 -0
- package/dist/core/storage/jsonl.js +156 -0
- package/dist/core/storage/log-retention.d.ts +52 -0
- package/dist/core/storage/log-retention.d.ts.map +1 -0
- package/dist/core/storage/log-retention.js +419 -0
- package/dist/core/storage/logger.d.ts +84 -0
- package/dist/core/storage/logger.d.ts.map +1 -0
- package/dist/core/storage/logger.js +413 -0
- package/dist/core/storage/maintenance-providers.d.ts +26 -0
- package/dist/core/storage/maintenance-providers.d.ts.map +1 -0
- package/dist/core/storage/maintenance-providers.js +141 -0
- package/dist/core/storage/maintenance.d.ts +125 -0
- package/dist/core/storage/maintenance.d.ts.map +1 -0
- package/dist/core/storage/maintenance.js +609 -0
- package/dist/core/storage/metrics.d.ts +60 -0
- package/dist/core/storage/metrics.d.ts.map +1 -0
- package/dist/core/storage/metrics.js +134 -0
- package/dist/core/storage/policy.d.ts +7 -0
- package/dist/core/storage/policy.d.ts.map +1 -0
- package/dist/core/storage/policy.js +110 -0
- package/dist/core/storage/process-log.d.ts +38 -0
- package/dist/core/storage/process-log.d.ts.map +1 -0
- package/dist/core/storage/process-log.js +165 -0
- package/dist/core/storage/query.d.ts +48 -0
- package/dist/core/storage/query.d.ts.map +1 -0
- package/dist/core/storage/query.js +346 -0
- package/dist/core/storage/receipts.d.ts +23 -0
- package/dist/core/storage/receipts.d.ts.map +1 -0
- package/dist/core/storage/receipts.js +117 -0
- package/dist/core/storage/segments.d.ts +84 -0
- package/dist/core/storage/segments.d.ts.map +1 -0
- package/dist/core/storage/segments.js +542 -0
- package/dist/core/storage/sink-graph.d.ts +65 -0
- package/dist/core/storage/sink-graph.d.ts.map +1 -0
- package/dist/core/storage/sink-graph.js +213 -0
- package/dist/core/storage/storm-control.d.ts +23 -0
- package/dist/core/storage/storm-control.d.ts.map +1 -0
- package/dist/core/storage/storm-control.js +59 -0
- package/dist/core/supervisor/activity.d.ts +4 -0
- package/dist/core/supervisor/activity.d.ts.map +1 -0
- package/dist/core/supervisor/activity.js +141 -0
- package/dist/core/supervisor/contract.d.ts +268 -0
- package/dist/core/supervisor/contract.d.ts.map +1 -0
- package/dist/core/supervisor/contract.js +35 -0
- package/dist/core/supervisor/explanations.d.ts +4 -0
- package/dist/core/supervisor/explanations.d.ts.map +1 -0
- package/dist/core/supervisor/explanations.js +71 -0
- package/dist/core/supervisor/findings.d.ts +20 -0
- package/dist/core/supervisor/findings.d.ts.map +1 -0
- package/dist/core/supervisor/findings.js +399 -0
- package/dist/core/supervisor/history.d.ts +9 -0
- package/dist/core/supervisor/history.d.ts.map +1 -0
- package/dist/core/supervisor/history.js +46 -0
- package/dist/core/supervisor/hook-health-alerts.d.ts +14 -0
- package/dist/core/supervisor/hook-health-alerts.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health-alerts.js +70 -0
- package/dist/core/supervisor/hook-health-storage.d.ts +5 -0
- package/dist/core/supervisor/hook-health-storage.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health-storage.js +24 -0
- package/dist/core/supervisor/hook-health.d.ts +72 -0
- package/dist/core/supervisor/hook-health.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health.js +203 -0
- package/dist/core/supervisor/hooks.d.ts +10 -0
- package/dist/core/supervisor/hooks.d.ts.map +1 -0
- package/dist/core/supervisor/hooks.js +28 -0
- package/dist/core/supervisor/index.d.ts +15 -0
- package/dist/core/supervisor/index.d.ts.map +1 -0
- package/dist/core/supervisor/index.js +14 -0
- package/dist/core/supervisor/log-feed.d.ts +9 -0
- package/dist/core/supervisor/log-feed.d.ts.map +1 -0
- package/dist/core/supervisor/log-feed.js +103 -0
- package/dist/core/supervisor/service.d.ts +29 -0
- package/dist/core/supervisor/service.d.ts.map +1 -0
- package/dist/core/supervisor/service.js +450 -0
- package/dist/core/supervisor/services.d.ts +11 -0
- package/dist/core/supervisor/services.d.ts.map +1 -0
- package/dist/core/supervisor/services.js +155 -0
- package/dist/core/supervisor/status.d.ts +3 -0
- package/dist/core/supervisor/status.d.ts.map +1 -0
- package/dist/core/supervisor/status.js +48 -0
- package/dist/core/supervisor/storage.d.ts +30 -0
- package/dist/core/supervisor/storage.d.ts.map +1 -0
- package/dist/core/supervisor/storage.js +73 -0
- package/dist/core/supervisor/timeline.d.ts +3 -0
- package/dist/core/supervisor/timeline.d.ts.map +1 -0
- package/dist/core/supervisor/timeline.js +87 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +10 -14
- package/dist/core/workflow/admission.d.ts +23 -0
- package/dist/core/workflow/admission.d.ts.map +1 -0
- package/dist/core/workflow/admission.js +136 -0
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +77 -2
- package/dist/core/workflow/index.d.ts +3 -2
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +2 -1
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +2 -1
- package/dist/core/workflow/proof.d.ts +2 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +39 -1
- package/dist/core/workflow/run-state.d.ts +3 -2
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +8 -1
- package/dist/core/workflow/types.d.ts +33 -1
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/types.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lazy-commands.d.ts +26 -0
- package/dist/lazy-commands.d.ts.map +1 -0
- package/dist/lazy-commands.js +210 -0
- package/dist/lib/browser/client.d.ts +5 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +1 -0
- package/dist/lib/browser/index.d.ts +2 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +173 -0
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
- package/dist/lib/browser/qa-run-contracts.js +226 -0
- package/dist/lib/browser/qa-run.d.ts +51 -0
- package/dist/lib/browser/qa-run.d.ts.map +1 -0
- package/dist/lib/browser/qa-run.js +684 -0
- package/dist/lib/coord-root-id.d.ts +9 -0
- package/dist/lib/coord-root-id.d.ts.map +1 -0
- package/dist/lib/coord-root-id.js +17 -0
- package/dist/lib/docs-lint.d.ts +2 -0
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +45 -80
- package/dist/lib/docs-metadata-audit.d.ts +3 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -1
- package/dist/lib/docs-metadata-audit.js +13 -23
- package/dist/lib/docs-metadata-sync.d.ts +1 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -1
- package/dist/lib/docs-metadata-sync.js +28 -10
- package/dist/lib/docs-repository-view.d.ts +22 -0
- package/dist/lib/docs-repository-view.d.ts.map +1 -0
- package/dist/lib/docs-repository-view.js +185 -0
- package/dist/lib/http/client.d.ts +11 -5
- package/dist/lib/http/client.d.ts.map +1 -1
- package/dist/lib/http/client.js +22 -4
- package/dist/lib/http/index.d.ts +1 -1
- package/dist/lib/http/index.d.ts.map +1 -1
- package/dist/lib/http/index.js +1 -1
- package/dist/lib/indexer-exclusions.d.ts +27 -0
- package/dist/lib/indexer-exclusions.d.ts.map +1 -0
- package/dist/lib/indexer-exclusions.js +176 -0
- package/dist/lib/instructions/apply.d.ts +3 -1
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +74 -3
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +11 -0
- package/dist/lib/local-file-url.d.ts +9 -0
- package/dist/lib/local-file-url.d.ts.map +1 -0
- package/dist/lib/local-file-url.js +20 -0
- package/dist/lib/web-performance.d.ts +118 -0
- package/dist/lib/web-performance.d.ts.map +1 -0
- package/dist/lib/web-performance.js +192 -0
- package/package.json +40 -2
- package/schemas/config.schema.json +58 -0
- package/schemas/event-v3.schema.json +324 -112
- package/src/commander.ts +488 -95
- package/src/commands/agents.ts +617 -237
- package/src/commands/artifacts.ts +40 -2
- package/src/commands/backup.ts +18 -14
- package/src/commands/browse-session.ts +12 -0
- package/src/commands/browse.ts +21 -7
- package/src/commands/conversations.ts +279 -0
- package/src/commands/deinit.ts +6 -0
- package/src/commands/diagnostics.ts +271 -0
- package/src/commands/docs.ts +25 -6
- package/src/commands/doctor.ts +75 -9
- package/src/commands/fetch.ts +7 -6
- package/src/commands/files.ts +243 -0
- package/src/commands/governor.ts +21 -12
- package/src/commands/inbox.ts +61 -0
- package/src/commands/init.ts +78 -16
- package/src/commands/ledger-v3.ts +503 -1
- package/src/commands/logs.ts +224 -0
- package/src/commands/messages.ts +61 -0
- package/src/commands/outline.ts +6 -2
- package/src/commands/qa-run.ts +184 -0
- package/src/commands/read.ts +6 -2
- package/src/commands/resources.ts +38 -0
- package/src/commands/semantic.ts +66 -1
- package/src/commands/storage.ts +310 -0
- package/src/commands/supervisor.ts +141 -0
- package/src/commands/tunnel.ts +66 -52
- package/src/commands/web.ts +96 -7
- package/src/commands/work.ts +3 -3
- package/src/commands/workflow.ts +21 -13
- package/src/core/agents/cli.ts +265 -55
- package/src/core/agents/health.ts +142 -0
- package/src/core/agents/live-authority-v3.ts +341 -10
- package/src/core/agents/live-lifecycle-v3.ts +6 -1
- package/src/core/agents/live-observation-v3.ts +6 -1
- package/src/core/agents/mailbox.ts +373 -0
- package/src/core/agents/reconcile-coordination-v3.ts +77 -0
- package/src/core/agents/render/prompt-context.ts +66 -15
- package/src/core/agents/render/session-context.ts +37 -3
- package/src/core/agents/rules/commit-conflict.ts +58 -1
- package/src/core/agents/rules/stop-hook.ts +105 -20
- package/src/core/agents/rules/verdict.ts +1 -0
- package/src/core/agents/session-events.ts +4 -0
- package/src/core/agents/session-finalization-state-v3.ts +1 -1
- package/src/core/agents/session-finalizer-v3.ts +8 -2
- package/src/core/agents/state/activity-log.ts +7 -2
- package/src/core/agents/state/heartbeat-writer.ts +27 -0
- package/src/core/agents/state/live-coordination-view.ts +16 -105
- package/src/core/agents/state/live-coordination-writer.ts +141 -0
- package/src/core/artifacts/index.ts +260 -11
- package/src/core/config.ts +235 -5
- package/src/core/conversations/archive.ts +237 -0
- package/src/core/conversations/catalog.ts +79 -0
- package/src/core/conversations/context-pack.ts +72 -0
- package/src/core/conversations/contract.ts +178 -0
- package/src/core/conversations/evaluation.ts +30 -0
- package/src/core/conversations/index.ts +9 -0
- package/src/core/conversations/lifecycle.ts +63 -0
- package/src/core/conversations/normalize.ts +105 -0
- package/src/core/conversations/query.ts +318 -0
- package/src/core/conversations/search-index.ts +48 -0
- package/src/core/diagnostics/advice.ts +147 -0
- package/src/core/diagnostics/bundle.ts +1142 -0
- package/src/core/diagnostics/comparison.ts +565 -0
- package/src/core/diagnostics/contract.ts +311 -0
- package/src/core/diagnostics/identity.ts +11 -0
- package/src/core/diagnostics/index.ts +7 -0
- package/src/core/diagnostics/replay.ts +314 -0
- package/src/core/diagnostics/sanitize.ts +97 -0
- package/src/core/events/legacy-storage/canary.ts +177 -0
- package/src/core/events/legacy-storage/compression.ts +130 -0
- package/src/core/events/legacy-storage/fence.ts +129 -0
- package/src/core/events/legacy-storage/index.ts +6 -0
- package/src/core/events/legacy-storage/inventory.ts +51 -0
- package/src/core/events/legacy-storage/manifest.ts +136 -0
- package/src/core/events/legacy-storage/reader.ts +178 -0
- package/src/core/events/v3/archive-retention.ts +251 -0
- package/src/core/events/v3/authority-outbox.ts +22 -1
- package/src/core/events/v3/base-contract.ts +17 -7
- package/src/core/events/v3/bootstrap.ts +195 -2
- package/src/core/events/v3/capabilities.ts +5 -3
- package/src/core/events/v3/control-witness.ts +339 -0
- package/src/core/events/v3/control-writer.ts +16 -0
- package/src/core/events/v3/control.ts +54 -18
- package/src/core/events/v3/coordination-transaction-recovery.ts +477 -0
- package/src/core/events/v3/coordination-view.ts +17 -1
- package/src/core/events/v3/generated.ts +1 -1
- package/src/core/events/v3/index.ts +14 -2
- package/src/core/events/v3/live-route-observer.ts +80 -0
- package/src/core/events/v3/live-routing.ts +65 -46
- package/src/core/events/v3/producers/coordination-recorder.ts +95 -10
- package/src/core/events/v3/producers/diagnostic-summaries.ts +593 -0
- package/src/core/events/v3/producers/hook-base.ts +15 -3
- package/src/core/events/v3/producers/intake.ts +31 -2
- package/src/core/events/v3/producers/producer-state-observer.ts +52 -0
- package/src/core/events/v3/producers/recorder.ts +681 -34
- package/src/core/events/v3/reader.ts +243 -2
- package/src/core/events/v3/rotation-config.ts +98 -0
- package/src/core/events/v3/runtime-build.ts +41 -0
- package/src/core/events/v3/runtime-identity.ts +16 -0
- package/src/core/events/v3/runtime-telemetry-capabilities.ts +14 -8
- package/src/core/events/v3/support-storage/classify.ts +209 -0
- package/src/core/events/v3/support-storage/eligibility.ts +58 -0
- package/src/core/events/v3/support-storage/index.ts +9 -0
- package/src/core/events/v3/support-storage/inventory.ts +135 -0
- package/src/core/events/v3/support-storage/logical-authority.ts +117 -0
- package/src/core/events/v3/support-storage/maintenance.ts +501 -0
- package/src/core/events/v3/support-storage/pack-contract.ts +337 -0
- package/src/core/events/v3/support-storage/pack-reader.ts +346 -0
- package/src/core/events/v3/support-storage/pack-writer.ts +352 -0
- package/src/core/events/v3/support-storage/recovery.ts +43 -0
- package/src/core/events/v3/turn-telemetry.ts +58 -7
- package/src/core/events/v3/writer.ts +168 -16
- package/src/core/governor/plan-read.ts +5 -18
- package/src/core/governor/planning.ts +5 -8
- package/src/core/governor/service-read.ts +320 -2
- package/src/core/governor/service.ts +49 -22
- package/src/core/guard/evidence-v3.ts +1 -0
- package/src/core/hooks/adapter/events.ts +1 -0
- package/src/core/hooks/adapter/output.ts +23 -5
- package/src/core/hooks/adapter/runtime-telemetry.ts +408 -13
- package/src/core/hooks/cli.ts +404 -233
- package/src/core/hooks/effects/image-capture.ts +4 -1
- package/src/core/hooks/health.ts +146 -0
- package/src/core/hooks/remediation-cap.ts +12 -6
- package/src/core/hooks/resolve/coord-root.ts +91 -11
- package/src/core/hooks/resolve/owner.ts +4 -0
- package/src/core/hooks/resolve/transcript.ts +18 -0
- package/src/core/inbox/contract.ts +81 -0
- package/src/core/inbox/index.ts +4 -0
- package/src/core/inbox/lifecycle.ts +104 -0
- package/src/core/inbox/service.ts +305 -0
- package/src/core/inbox/watcher.ts +36 -0
- package/src/core/presence/codec-digest.ts +15 -9
- package/src/core/presence/relay-client.ts +55 -7
- package/src/core/resources/contract.ts +98 -0
- package/src/core/resources/index.ts +5 -0
- package/src/core/resources/sampler.ts +458 -0
- package/src/core/resources/service-status.ts +62 -0
- package/src/core/resources/service.ts +337 -0
- package/src/core/resources/storage.ts +44 -0
- package/src/core/semantic/adapters.ts +200 -41
- package/src/core/semantic/contract.ts +135 -3
- package/src/core/semantic/index.ts +76 -2
- package/src/core/semantic/once.ts +93 -7
- package/src/core/semantic/prompt.ts +13 -1
- package/src/core/semantic/review.ts +803 -0
- package/src/core/semantic/routes.ts +30 -0
- package/src/core/semantic/scheduler.ts +49 -5
- package/src/core/semantic/service-status.ts +99 -5
- package/src/core/semantic/service.ts +116 -15
- package/src/core/semantic/soak.ts +638 -0
- package/src/core/semantic/storage.ts +20 -6
- package/src/core/semantic/usage.ts +272 -0
- package/src/core/semantic/validate.ts +31 -0
- package/src/core/storage/atomic-json.ts +15 -0
- package/src/core/storage/buffer.ts +124 -0
- package/src/core/storage/builtins.ts +972 -0
- package/src/core/storage/catalog.ts +467 -0
- package/src/core/storage/config.ts +423 -0
- package/src/core/storage/contract.ts +342 -0
- package/src/core/storage/durable-history.ts +738 -0
- package/src/core/storage/health.ts +76 -0
- package/src/core/storage/index.ts +15 -0
- package/src/core/storage/inventory.ts +859 -0
- package/src/core/storage/jsonl.ts +213 -0
- package/src/core/storage/log-retention.ts +555 -0
- package/src/core/storage/logger.ts +548 -0
- package/src/core/storage/maintenance-providers.ts +200 -0
- package/src/core/storage/maintenance.ts +929 -0
- package/src/core/storage/metrics.ts +199 -0
- package/src/core/storage/policy.ts +141 -0
- package/src/core/storage/process-log.ts +203 -0
- package/src/core/storage/query.ts +418 -0
- package/src/core/storage/receipts.ts +162 -0
- package/src/core/storage/segments.ts +721 -0
- package/src/core/storage/sink-graph.ts +343 -0
- package/src/core/storage/storm-control.ts +91 -0
- package/src/core/supervisor/activity.ts +193 -0
- package/src/core/supervisor/contract.ts +312 -0
- package/src/core/supervisor/explanations.ts +104 -0
- package/src/core/supervisor/findings.ts +788 -0
- package/src/core/supervisor/history.ts +61 -0
- package/src/core/supervisor/hook-health-alerts.ts +108 -0
- package/src/core/supervisor/hook-health-storage.ts +25 -0
- package/src/core/supervisor/hook-health.ts +301 -0
- package/src/core/supervisor/hooks.ts +35 -0
- package/src/core/supervisor/index.ts +14 -0
- package/src/core/supervisor/log-feed.ts +131 -0
- package/src/core/supervisor/service.ts +511 -0
- package/src/core/supervisor/services.ts +203 -0
- package/src/core/supervisor/status.ts +59 -0
- package/src/core/supervisor/storage.ts +126 -0
- package/src/core/supervisor/timeline.ts +133 -0
- package/src/core/work/state.ts +12 -21
- package/src/core/workflow/admission.ts +215 -0
- package/src/core/workflow/engine.ts +93 -1
- package/src/core/workflow/index.ts +10 -0
- package/src/core/workflow/live-session-v3.ts +2 -4
- package/src/core/workflow/proof.ts +54 -1
- package/src/core/workflow/run-state.ts +13 -1
- package/src/core/workflow/types.ts +39 -1
- package/src/index.ts +2 -0
- package/src/lazy-commands.ts +294 -0
- package/src/lib/browser/client.ts +6 -0
- package/src/lib/browser/index.ts +29 -0
- package/src/lib/browser/qa-run-contracts.ts +380 -0
- package/src/lib/browser/qa-run.ts +784 -0
- package/src/lib/coord-root-id.ts +23 -0
- package/src/lib/docs-lint.ts +58 -77
- package/src/lib/docs-metadata-audit.ts +26 -21
- package/src/lib/docs-metadata-sync.ts +32 -9
- package/src/lib/docs-repository-view.ts +220 -0
- package/src/lib/http/client.ts +44 -8
- package/src/lib/http/index.ts +6 -1
- package/src/lib/indexer-exclusions.ts +173 -0
- package/src/lib/instructions/apply.ts +81 -2
- package/src/lib/instructions/templates.ts +11 -0
- package/src/lib/local-file-url.ts +31 -0
- package/src/lib/web-performance.ts +335 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
3
|
+
import { monorepoRoot, resolveOwner } from "../core/agents/index.ts";
|
|
4
|
+
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.ts";
|
|
5
|
+
import type { ArtifactActor } from "../core/artifacts/index.ts";
|
|
6
|
+
import {
|
|
7
|
+
buildDiagnosticAdvice,
|
|
8
|
+
captureDiagnosticBundle,
|
|
9
|
+
compareDiagnosticBundles,
|
|
10
|
+
DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
11
|
+
listDiagnosticBundles,
|
|
12
|
+
renderDiagnosticBundleComparison,
|
|
13
|
+
replayDiagnosticBundle,
|
|
14
|
+
showDiagnosticBundle,
|
|
15
|
+
} from "../core/diagnostics/index.ts";
|
|
16
|
+
import {
|
|
17
|
+
buildSupervisorTimeline,
|
|
18
|
+
explainSupervisorFinding,
|
|
19
|
+
readSupervisorExplanation,
|
|
20
|
+
readSupervisorFindings,
|
|
21
|
+
readSupervisorStatus,
|
|
22
|
+
readSupervisorTimeline,
|
|
23
|
+
type SupervisorCapability,
|
|
24
|
+
type SupervisorFinding,
|
|
25
|
+
} from "../core/supervisor/index.ts";
|
|
26
|
+
|
|
27
|
+
export function registerDiagnosticsCommand(
|
|
28
|
+
program: Command,
|
|
29
|
+
emit: EmitContext,
|
|
30
|
+
context?: HarneryProgramContext,
|
|
31
|
+
): void {
|
|
32
|
+
const root = program
|
|
33
|
+
.command("diagnostics")
|
|
34
|
+
.description("Capture, inspect, and replay sanitized local diagnostic bundles.");
|
|
35
|
+
|
|
36
|
+
root
|
|
37
|
+
.command("list")
|
|
38
|
+
.description("List live findings and managed diagnostic bundles.")
|
|
39
|
+
.action(() => {
|
|
40
|
+
run(emit, () => {
|
|
41
|
+
const repoRoot = requireRepoRoot(context);
|
|
42
|
+
const report = readSupervisorFindings(repoRoot);
|
|
43
|
+
const findings = mergeFindings(report?.active ?? [], report?.transitions ?? []);
|
|
44
|
+
const bundles = listDiagnosticBundles(repoRoot);
|
|
45
|
+
const capability = liveFindingsCapability(repoRoot, report !== undefined);
|
|
46
|
+
emit.data({
|
|
47
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
48
|
+
kind: "diagnostic_list",
|
|
49
|
+
findings,
|
|
50
|
+
bundles,
|
|
51
|
+
capability,
|
|
52
|
+
total_findings: findings.length,
|
|
53
|
+
total_bundles: bundles.length,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
root
|
|
59
|
+
.command("show <ref>")
|
|
60
|
+
.description("Show one finding or validate one diagnostic bundle.")
|
|
61
|
+
.action((ref: string) => {
|
|
62
|
+
run(emit, () => {
|
|
63
|
+
const repoRoot = requireRepoRoot(context);
|
|
64
|
+
const finding = findFinding(repoRoot, ref);
|
|
65
|
+
if (finding) {
|
|
66
|
+
emit.data({
|
|
67
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
68
|
+
kind: "diagnostic_finding",
|
|
69
|
+
finding,
|
|
70
|
+
timeline:
|
|
71
|
+
readSupervisorTimeline(repoRoot, finding.id) ?? buildSupervisorTimeline(finding),
|
|
72
|
+
explanation:
|
|
73
|
+
readSupervisorExplanation(repoRoot, finding.id) ?? explainSupervisorFinding(finding),
|
|
74
|
+
});
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const bundle = showDiagnosticBundle(repoRoot, ref);
|
|
78
|
+
emit.data({
|
|
79
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
80
|
+
kind: "diagnostic_bundle",
|
|
81
|
+
bundle: {
|
|
82
|
+
path: bundle.path,
|
|
83
|
+
manifest: bundle.manifest,
|
|
84
|
+
summary: bundle.summary,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
root
|
|
91
|
+
.command("explain")
|
|
92
|
+
.description("Report bounded local pressure advice without taking action.")
|
|
93
|
+
.option("--bundle <artifact-ref>", "Use a frozen diagnostic bundle instead of live state")
|
|
94
|
+
.option("--json", "Emit structured JSON")
|
|
95
|
+
.action((opts: { bundle?: string; json?: boolean }) => {
|
|
96
|
+
run(emit, () => {
|
|
97
|
+
if (opts.json) emit.config({ format: "json" });
|
|
98
|
+
const repoRoot = requireRepoRoot(context);
|
|
99
|
+
if (opts.bundle) {
|
|
100
|
+
const bundle = showDiagnosticBundle(repoRoot, opts.bundle);
|
|
101
|
+
emit.data({
|
|
102
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
103
|
+
kind: "diagnostic_advice",
|
|
104
|
+
source: {
|
|
105
|
+
mode: "frozen",
|
|
106
|
+
artifact_id: bundle.manifest.artifact_id,
|
|
107
|
+
captured_at: bundle.manifest.captured_at,
|
|
108
|
+
},
|
|
109
|
+
advice: bundle.expected.advice,
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const report = readSupervisorFindings(repoRoot);
|
|
114
|
+
const findings = mergeFindings(report?.active ?? [], report?.transitions ?? []);
|
|
115
|
+
const sourceCapability = liveFindingsCapability(repoRoot, report !== undefined);
|
|
116
|
+
emit.data({
|
|
117
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
118
|
+
kind: "diagnostic_advice",
|
|
119
|
+
source: { mode: "live" },
|
|
120
|
+
advice: buildDiagnosticAdvice({
|
|
121
|
+
findings,
|
|
122
|
+
sourceCapability,
|
|
123
|
+
evaluatedAt: new Date().toISOString(),
|
|
124
|
+
}),
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
root
|
|
130
|
+
.command("capture")
|
|
131
|
+
.description("Capture sanitized supervisor inputs into a frozen managed bundle.")
|
|
132
|
+
.option("--finding <id>", "Capture the time range for one finding")
|
|
133
|
+
.option("--from <timestamp>", "Capture observations from this ISO timestamp")
|
|
134
|
+
.option("--to <timestamp>", "Capture observations through this ISO timestamp")
|
|
135
|
+
.option("--days <n>", "Managed artifact retention in days")
|
|
136
|
+
.action((opts: { finding?: string; from?: string; to?: string; days?: string }) => {
|
|
137
|
+
run(emit, () => {
|
|
138
|
+
const repoRoot = requireRepoRoot(context);
|
|
139
|
+
const captured = captureDiagnosticBundle(repoRoot, {
|
|
140
|
+
findingId: opts.finding,
|
|
141
|
+
startAt: opts.from,
|
|
142
|
+
endAt: opts.to,
|
|
143
|
+
retentionDays: opts.days === undefined ? undefined : parseDays(opts.days),
|
|
144
|
+
actor: currentActor(repoRoot),
|
|
145
|
+
});
|
|
146
|
+
emit.data({
|
|
147
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
148
|
+
kind: "diagnostic_bundle_capture",
|
|
149
|
+
bundle: {
|
|
150
|
+
path: captured.path,
|
|
151
|
+
artifact_id: captured.manifest.artifact_id,
|
|
152
|
+
captured_at: captured.manifest.captured_at,
|
|
153
|
+
finding_id: captured.manifest.finding_id,
|
|
154
|
+
summary: captured.summary,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
root
|
|
161
|
+
.command("replay <artifact-ref>")
|
|
162
|
+
.description("Replay a frozen bundle without reading live supervisor state.")
|
|
163
|
+
.action((ref: string) => {
|
|
164
|
+
run(emit, () => {
|
|
165
|
+
emit.data({
|
|
166
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
167
|
+
kind: "diagnostic_bundle_replay",
|
|
168
|
+
replay: replayDiagnosticBundle(requireRepoRoot(context), ref),
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
root
|
|
174
|
+
.command("compare <before> <after>")
|
|
175
|
+
.description("Compare two frozen bundles without reading live supervisor state.")
|
|
176
|
+
.option("--json", "Emit structured JSON")
|
|
177
|
+
.action((before: string, after: string, opts: { json?: boolean }) => {
|
|
178
|
+
run(emit, () => {
|
|
179
|
+
const comparison = compareDiagnosticBundles(requireRepoRoot(context), before, after);
|
|
180
|
+
if (opts.json) {
|
|
181
|
+
emit.config({ format: "json" });
|
|
182
|
+
emit.data({
|
|
183
|
+
schema_version: DIAGNOSTIC_COMMAND_SCHEMA_VERSION,
|
|
184
|
+
kind: "diagnostic_bundle_comparison",
|
|
185
|
+
comparison,
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
emit.text(renderDiagnosticBundleComparison(comparison));
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function liveFindingsCapability(repoRoot: string, reportPresent: boolean): SupervisorCapability {
|
|
195
|
+
if (!reportPresent) {
|
|
196
|
+
return {
|
|
197
|
+
source_kind: "supervisor.findings",
|
|
198
|
+
state: "unsupported",
|
|
199
|
+
reason_code: "source_missing",
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const status = readSupervisorStatus(repoRoot);
|
|
203
|
+
if (status.running) return { source_kind: "supervisor.findings", state: "supported" };
|
|
204
|
+
return {
|
|
205
|
+
source_kind: "supervisor.findings",
|
|
206
|
+
state: "expired",
|
|
207
|
+
reason_code: status.stale
|
|
208
|
+
? "supervisor_status_stale"
|
|
209
|
+
: status.record
|
|
210
|
+
? "supervisor_not_running"
|
|
211
|
+
: "supervisor_status_missing",
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function findFinding(repoRoot: string, id: string): SupervisorFinding | undefined {
|
|
216
|
+
const report = readSupervisorFindings(repoRoot);
|
|
217
|
+
return mergeFindings(report?.active ?? [], report?.transitions ?? []).find(
|
|
218
|
+
(finding) => finding.id === id,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function mergeFindings(
|
|
223
|
+
active: readonly SupervisorFinding[],
|
|
224
|
+
transitions: readonly SupervisorFinding[],
|
|
225
|
+
): SupervisorFinding[] {
|
|
226
|
+
const byId = new Map<string, SupervisorFinding>();
|
|
227
|
+
for (const finding of transitions) byId.set(finding.id, finding);
|
|
228
|
+
for (const finding of active) byId.set(finding.id, finding);
|
|
229
|
+
return [...byId.values()].sort(
|
|
230
|
+
(left, right) =>
|
|
231
|
+
Date.parse(right.observed_at) - Date.parse(left.observed_at) ||
|
|
232
|
+
left.id.localeCompare(right.id),
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function currentActor(repoRoot: string): ArtifactActor | undefined {
|
|
237
|
+
const instanceId = resolveOwner();
|
|
238
|
+
if (!instanceId) return undefined;
|
|
239
|
+
const heartbeat = readLiveCoordinationRow(repoRoot, instanceId);
|
|
240
|
+
return {
|
|
241
|
+
instance_id: instanceId,
|
|
242
|
+
session_id: heartbeat?.session_id,
|
|
243
|
+
name: heartbeat?.name,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function requireRepoRoot(context?: HarneryProgramContext): string {
|
|
248
|
+
const root = context?.repoRoot ?? monorepoRoot();
|
|
249
|
+
if (!root) throw new Error("not inside a Git repository");
|
|
250
|
+
return root;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function parseDays(value: string): number {
|
|
254
|
+
const parsed = Number(value);
|
|
255
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 3_650) {
|
|
256
|
+
throw new Error("--days must be between 1 and 3650");
|
|
257
|
+
}
|
|
258
|
+
return parsed;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function run(emit: EmitContext, fn: () => void): void {
|
|
262
|
+
try {
|
|
263
|
+
fn();
|
|
264
|
+
} catch (error) {
|
|
265
|
+
emit.error({
|
|
266
|
+
code: "diagnostics_failed",
|
|
267
|
+
message: error instanceof Error ? error.message : String(error),
|
|
268
|
+
});
|
|
269
|
+
emit.setExitCode(1);
|
|
270
|
+
}
|
|
271
|
+
}
|
package/src/commands/docs.ts
CHANGED
|
@@ -92,10 +92,14 @@ export function registerDocsCommand(
|
|
|
92
92
|
.command("validate")
|
|
93
93
|
.description("Validate every managed Markdown file against harnery-doc/v2")
|
|
94
94
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
95
|
-
.
|
|
95
|
+
.option("--cached", "Read paths and contents from the Git index")
|
|
96
|
+
.action(async (opts: { repo?: string; cached?: boolean }) => {
|
|
96
97
|
try {
|
|
97
98
|
ensureContext(context);
|
|
98
|
-
const rows = await runDocsMetadataAudit(
|
|
99
|
+
const rows = await runDocsMetadataAudit({
|
|
100
|
+
repo: opts.repo,
|
|
101
|
+
source: opts.cached ? "index" : "worktree",
|
|
102
|
+
});
|
|
99
103
|
const errors = rows
|
|
100
104
|
.flatMap((row) => row.issues)
|
|
101
105
|
.filter((issue) => issue.severity === "error");
|
|
@@ -128,9 +132,13 @@ export function registerDocsCommand(
|
|
|
128
132
|
.argument("[files...]", "Explicit repository-relative Markdown files; defaults to staged files")
|
|
129
133
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
130
134
|
.option("--check", "Report timestamp drift without writing")
|
|
135
|
+
.option("--cached", "Read current contents from the Git index (requires --check)")
|
|
131
136
|
.option("--reviewed", "Record an explicit runbook review and move its due date")
|
|
132
137
|
.action(
|
|
133
|
-
async (
|
|
138
|
+
async (
|
|
139
|
+
files: string[],
|
|
140
|
+
opts: { repo?: string; check?: boolean; cached?: boolean; reviewed?: boolean },
|
|
141
|
+
) => {
|
|
134
142
|
try {
|
|
135
143
|
ensureContext(context);
|
|
136
144
|
const rows = await runDocsMetadataSync({ ...opts, files });
|
|
@@ -194,8 +202,9 @@ export function registerDocsCommand(
|
|
|
194
202
|
)
|
|
195
203
|
.option("--fast", "Skip content-reading checks; filename/structure only (for pre-commit)")
|
|
196
204
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
205
|
+
.option("--cached", "Read paths and contents from the Git index")
|
|
197
206
|
.option("--format <type>", "Output format: human, json", "human")
|
|
198
|
-
.action(async (opts: { fast?: boolean; repo?: string; format: string }) => {
|
|
207
|
+
.action(async (opts: { fast?: boolean; repo?: string; cached?: boolean; format: string }) => {
|
|
199
208
|
try {
|
|
200
209
|
ensureContext(context);
|
|
201
210
|
await handleLint(opts);
|
|
@@ -311,8 +320,17 @@ async function handleDocs(opts: {
|
|
|
311
320
|
|
|
312
321
|
// --- `harn docs lint` ---
|
|
313
322
|
|
|
314
|
-
async function handleLint(opts: {
|
|
315
|
-
|
|
323
|
+
async function handleLint(opts: {
|
|
324
|
+
fast?: boolean;
|
|
325
|
+
repo?: string;
|
|
326
|
+
cached?: boolean;
|
|
327
|
+
format: string;
|
|
328
|
+
}): Promise<void> {
|
|
329
|
+
const violations = await runLint({
|
|
330
|
+
fast: opts.fast,
|
|
331
|
+
repo: opts.repo,
|
|
332
|
+
source: opts.cached ? "index" : "worktree",
|
|
333
|
+
});
|
|
316
334
|
const errors = violations.filter((v) => v.severity === "error");
|
|
317
335
|
const warnings = violations.filter((v) => v.severity === "warning");
|
|
318
336
|
const cold = await countColdHandoffs();
|
|
@@ -320,6 +338,7 @@ async function handleLint(opts: { fast?: boolean; repo?: string; format: string
|
|
|
320
338
|
emit.data({
|
|
321
339
|
fast: !!opts.fast,
|
|
322
340
|
repo: opts.repo ?? null,
|
|
341
|
+
source: opts.cached ? "index" : "worktree",
|
|
323
342
|
error_count: errors.length,
|
|
324
343
|
warning_count: warnings.length,
|
|
325
344
|
cold_handoffs: cold,
|
package/src/commands/doctor.ts
CHANGED
|
@@ -12,13 +12,17 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { spawnSync } from "node:child_process";
|
|
15
|
-
import { existsSync } from "node:fs";
|
|
15
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
16
16
|
import os from "node:os";
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import type { Command } from "commander";
|
|
19
19
|
import type { EmitContext } from "../commander.ts";
|
|
20
20
|
import { BUILTIN_ADAPTER_IDS } from "../core/adapters/index.ts";
|
|
21
21
|
import { resolveBinName, ripgrepAutoInstall } from "../core/config.ts";
|
|
22
|
+
import {
|
|
23
|
+
countSummarizedSinceV3,
|
|
24
|
+
listDiagnosticSummariesV3,
|
|
25
|
+
} from "../core/events/v3/producers/diagnostic-summaries.ts";
|
|
22
26
|
import { ADAPTER_SPECS, type AdapterId } from "../core/hooks/adapter/events.ts";
|
|
23
27
|
import { loadAdapterWiring, summarizeAdapterWiring } from "../core/hooks/adapter/wiring.ts";
|
|
24
28
|
import {
|
|
@@ -107,8 +111,10 @@ export function registerDoctorCommand(program: Command, emit: EmitContext): void
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
export async function runChecks(): Promise<Check[]> {
|
|
114
|
+
const root = findCoordProjectRoot();
|
|
110
115
|
const codexWslStatus = inspectCodexWslBridge();
|
|
111
|
-
const
|
|
116
|
+
const recentCodexMidFlightCount = root ? countRecentCodexMidFlightOnboardings(root) : 0;
|
|
117
|
+
const codexWslBridge = codexWslBridgeCheck(codexWslStatus, recentCodexMidFlightCount);
|
|
112
118
|
// Probe the adapter CLIs before the hook check runs, not in output order:
|
|
113
119
|
// an unwired adapter only matters if its CLI is actually installed, and
|
|
114
120
|
// probing once here keeps that join to one spawn per CLI.
|
|
@@ -163,18 +169,78 @@ function checkGitHookRegions(): Check {
|
|
|
163
169
|
}
|
|
164
170
|
}
|
|
165
171
|
|
|
166
|
-
function
|
|
167
|
-
|
|
172
|
+
export function codexWslBridgeCheck(
|
|
173
|
+
status: CodexWslBridgeStatus | null,
|
|
174
|
+
recentMidFlightCount = 0,
|
|
175
|
+
): Check | null {
|
|
176
|
+
if (!status && recentMidFlightCount === 0) return null;
|
|
177
|
+
const historical =
|
|
178
|
+
recentMidFlightCount === 0
|
|
179
|
+
? null
|
|
180
|
+
: `${recentMidFlightCount} Codex mid-flight onboarding${recentMidFlightCount === 1 ? "" : "s"} recorded in the last 48h`;
|
|
168
181
|
return {
|
|
169
182
|
name: "codex:WSL bridge",
|
|
170
|
-
severity: status
|
|
171
|
-
detail: status
|
|
172
|
-
hint:
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
severity: status?.ok && !historical ? "ok" : "warn",
|
|
184
|
+
detail: [status?.detail, historical].filter(Boolean).join("; "),
|
|
185
|
+
hint:
|
|
186
|
+
status?.ok && !historical
|
|
187
|
+
? undefined
|
|
188
|
+
: "forward CODEX_THREAD_ID through WSLENV in the Codex shell environment policy, then start a fresh task",
|
|
175
189
|
};
|
|
176
190
|
}
|
|
177
191
|
|
|
192
|
+
const CODEX_MID_FLIGHT_HISTORY_WINDOW_MS = 48 * 60 * 60 * 1000;
|
|
193
|
+
|
|
194
|
+
/** Count bounded, privacy-safe recovery diagnostics so a healthy environment
|
|
195
|
+
* now does not hide an intermittent Codex-to-WSL identity drop. */
|
|
196
|
+
export function countRecentCodexMidFlightOnboardings(
|
|
197
|
+
coordRoot: string,
|
|
198
|
+
nowMs = Date.now(),
|
|
199
|
+
windowMs = CODEX_MID_FLIGHT_HISTORY_WINDOW_MS,
|
|
200
|
+
): number {
|
|
201
|
+
// Occurrences past the producer's loose-exemplar bound live in summary
|
|
202
|
+
// files instead of loose diagnostics; count them too so the mitigation
|
|
203
|
+
// cannot hide an active Codex identity drop from this warning.
|
|
204
|
+
let count = 0;
|
|
205
|
+
try {
|
|
206
|
+
const listing = listDiagnosticSummariesV3(coordRoot);
|
|
207
|
+
count += countSummarizedSinceV3(
|
|
208
|
+
listing.summaries,
|
|
209
|
+
nowMs - windowMs,
|
|
210
|
+
(summary) =>
|
|
211
|
+
summary.category === "mid_flight_onboarding" && summary.metadata.adapter === "codex",
|
|
212
|
+
nowMs,
|
|
213
|
+
);
|
|
214
|
+
} catch {
|
|
215
|
+
// Summary reads are best-effort; loose diagnostics below still count.
|
|
216
|
+
}
|
|
217
|
+
const directory = path.join(coordRoot, ".harnery", "ledgers", "v3", "diagnostics");
|
|
218
|
+
if (!existsSync(directory)) return count;
|
|
219
|
+
for (const name of readdirSync(directory)) {
|
|
220
|
+
if (!name.startsWith("mid_flight_onboarding-") || !name.endsWith(".json")) continue;
|
|
221
|
+
try {
|
|
222
|
+
const row = JSON.parse(readFileSync(path.join(directory, name), "utf8")) as {
|
|
223
|
+
recorded_at?: unknown;
|
|
224
|
+
category?: unknown;
|
|
225
|
+
adapter?: unknown;
|
|
226
|
+
};
|
|
227
|
+
const recordedAt = typeof row.recorded_at === "string" ? Date.parse(row.recorded_at) : NaN;
|
|
228
|
+
if (
|
|
229
|
+
row.category === "mid_flight_onboarding" &&
|
|
230
|
+
row.adapter === "codex" &&
|
|
231
|
+
Number.isFinite(recordedAt) &&
|
|
232
|
+
recordedAt <= nowMs &&
|
|
233
|
+
nowMs - recordedAt <= windowMs
|
|
234
|
+
) {
|
|
235
|
+
count += 1;
|
|
236
|
+
}
|
|
237
|
+
} catch {
|
|
238
|
+
// A malformed best-effort diagnostic cannot make doctor fail.
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return count;
|
|
242
|
+
}
|
|
243
|
+
|
|
178
244
|
export function codexAuthorizationCheck(result: CodexHookAuthorizationResult): Check {
|
|
179
245
|
const reviewHint =
|
|
180
246
|
"terminal UI: run `/hooks`; Codex Desktop: open Settings > Hooks; after approval, start a fresh task";
|
package/src/commands/fetch.ts
CHANGED
|
@@ -86,7 +86,7 @@ async function runFetch(
|
|
|
86
86
|
const timeoutMs = Number.parseInt(opts.timeout, 10);
|
|
87
87
|
const ac = new AbortController();
|
|
88
88
|
const timer = setTimeout(() => ac.abort(), timeoutMs);
|
|
89
|
-
let result: Awaited<ReturnType<typeof fetchWithJar
|
|
89
|
+
let result: Awaited<ReturnType<typeof fetchWithJar<"bytes">>>;
|
|
90
90
|
try {
|
|
91
91
|
result = await fetchWithJar(url, {
|
|
92
92
|
method: opts.method,
|
|
@@ -96,13 +96,14 @@ async function runFetch(
|
|
|
96
96
|
redirect: opts.redirect as RequestRedirect,
|
|
97
97
|
signal: ac.signal,
|
|
98
98
|
extraHeaders: context?.extraHeaders,
|
|
99
|
+
responseType: "bytes",
|
|
99
100
|
});
|
|
100
101
|
} finally {
|
|
101
102
|
clearTimeout(timer);
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
if (opts.json) {
|
|
105
|
-
emit.data(result
|
|
106
|
+
emit.data({ ...result, body: new TextDecoder().decode(result.body) });
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
if (opts.status) {
|
|
@@ -117,14 +118,14 @@ async function runFetch(
|
|
|
117
118
|
if (opts.output) {
|
|
118
119
|
writeFileSync(opts.output, result.body);
|
|
119
120
|
emit.file(opts.output, {
|
|
120
|
-
bytes: result.body.
|
|
121
|
+
bytes: result.body.byteLength,
|
|
121
122
|
status: result.status,
|
|
122
123
|
status_text: result.statusText,
|
|
123
124
|
});
|
|
124
125
|
} else {
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
emit.text(result.body);
|
|
126
|
+
// Text destinations decode at the presentation boundary. File output
|
|
127
|
+
// above keeps the response bytes intact regardless of MIME type.
|
|
128
|
+
emit.text(new TextDecoder().decode(result.body));
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
if (jar && result.cookiesSaved > 0) {
|