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,224 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
4
|
+
import { resolveCoordRoot as resolveCanonicalCoordRoot } from "../core/agents/coord-client.ts";
|
|
5
|
+
import { createStorageCatalog } from "../core/storage/catalog.ts";
|
|
6
|
+
import {
|
|
7
|
+
HARNERY_STRUCTURED_LOG_PROVIDER_ID,
|
|
8
|
+
type HarneryLogLevel,
|
|
9
|
+
type HarneryRegisteredStorageFamily,
|
|
10
|
+
} from "../core/storage/contract.ts";
|
|
11
|
+
import { inspectStructuredLogRetention } from "../core/storage/log-retention.ts";
|
|
12
|
+
import { queryLogs, rotationFollowCursor } from "../core/storage/query.ts";
|
|
13
|
+
import { familyLogDirectory } from "../core/storage/segments.ts";
|
|
14
|
+
|
|
15
|
+
interface QueryOptions {
|
|
16
|
+
family?: string[];
|
|
17
|
+
level?: HarneryLogLevel;
|
|
18
|
+
event?: string;
|
|
19
|
+
since?: string;
|
|
20
|
+
until?: string;
|
|
21
|
+
maxRecords: number;
|
|
22
|
+
maxBytes: number;
|
|
23
|
+
json?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function registerLogsCommand(
|
|
27
|
+
program: Command,
|
|
28
|
+
emit: EmitContext,
|
|
29
|
+
context?: HarneryProgramContext,
|
|
30
|
+
): void {
|
|
31
|
+
const logs = program.command("logs").description("List and query bounded Harnery log families");
|
|
32
|
+
logs
|
|
33
|
+
.command("list")
|
|
34
|
+
.option("--json", "Emit structured output")
|
|
35
|
+
.action((options: { json?: boolean }) =>
|
|
36
|
+
run(emit, async () => {
|
|
37
|
+
const catalog = catalogFor(context);
|
|
38
|
+
const capturedAt = new Date();
|
|
39
|
+
const rows = logFamilies(catalog.families).map((family) =>
|
|
40
|
+
logFamilyRow(family, capturedAt),
|
|
41
|
+
);
|
|
42
|
+
if (options.json) {
|
|
43
|
+
emit.config({ format: "json" });
|
|
44
|
+
emit.data({
|
|
45
|
+
schema: "harnery.logs-list/v2",
|
|
46
|
+
captured_at: capturedAt.toISOString(),
|
|
47
|
+
diagnostics: catalog.log_storage_diagnostics,
|
|
48
|
+
dormant_families: catalog.dormant_log_storage_families,
|
|
49
|
+
families: rows,
|
|
50
|
+
});
|
|
51
|
+
} else emit.rows(rows.map(logFamilyTableRow));
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const configureQuery = (command: Command) =>
|
|
56
|
+
command
|
|
57
|
+
.option("--family <id...>", "Restrict to named families")
|
|
58
|
+
.option("--level <level>", "Minimum severity")
|
|
59
|
+
.option("--event <event>", "Exact event name")
|
|
60
|
+
.option("--since <timestamp>", "Earliest timestamp")
|
|
61
|
+
.option("--until <timestamp>", "Latest timestamp")
|
|
62
|
+
.option("--max-records <n>", "Global record scan budget", integer, 10_000)
|
|
63
|
+
.option("--max-bytes <n>", "Global byte scan budget", integer, 10 * 1024 * 1024)
|
|
64
|
+
.option("--json", "Emit structured output");
|
|
65
|
+
|
|
66
|
+
configureQuery(logs.command("query").description("Query sealed and active log segments")).action(
|
|
67
|
+
(options: QueryOptions) =>
|
|
68
|
+
run(emit, async () => {
|
|
69
|
+
const result = await queryLogs(
|
|
70
|
+
logFamilies(catalogFor(context).families),
|
|
71
|
+
queryFrom(options),
|
|
72
|
+
);
|
|
73
|
+
if (options.json) {
|
|
74
|
+
emit.config({ format: "json" });
|
|
75
|
+
emit.data({ schema: "harnery.logs-query/v1", ...result });
|
|
76
|
+
} else emit.rows(result.records as unknown as Record<string, unknown>[]);
|
|
77
|
+
}),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
configureQuery(logs.command("export").description("Export matching records as JSONL")).action(
|
|
81
|
+
(options: QueryOptions) =>
|
|
82
|
+
run(emit, async () => {
|
|
83
|
+
const result = await queryLogs(
|
|
84
|
+
logFamilies(catalogFor(context).families),
|
|
85
|
+
queryFrom(options),
|
|
86
|
+
);
|
|
87
|
+
for (const record of result.records) emit.text(JSON.stringify(record));
|
|
88
|
+
if (result.truncated)
|
|
89
|
+
emit.log("log export stopped at the configured global scan budget", "warn");
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
logs
|
|
94
|
+
.command("tail")
|
|
95
|
+
.argument("<family>")
|
|
96
|
+
.description("Read recent records and a rotation-aware follow cursor")
|
|
97
|
+
.option("-n, --lines <n>", "Number of recent records", integer, 50)
|
|
98
|
+
.option("--max-bytes <n>", "Global byte scan budget", integer, 10 * 1024 * 1024)
|
|
99
|
+
.action((familyId: string, options: { lines: number; maxBytes: number }) =>
|
|
100
|
+
run(emit, async () => {
|
|
101
|
+
const family = catalogFor(context).require(familyId);
|
|
102
|
+
if (!isLogFamily(family)) throw new Error(`storage family is not a log: ${familyId}`);
|
|
103
|
+
const result = await queryLogs([family], {
|
|
104
|
+
max_records: 10_000,
|
|
105
|
+
max_bytes: options.maxBytes,
|
|
106
|
+
});
|
|
107
|
+
emit.data({
|
|
108
|
+
schema: "harnery.logs-tail-cursor/v1",
|
|
109
|
+
records: result.records.slice(-options.lines),
|
|
110
|
+
truncated: result.truncated,
|
|
111
|
+
cursor: rotationFollowCursor(family),
|
|
112
|
+
});
|
|
113
|
+
}),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function logFamilyRow(family: HarneryRegisteredStorageFamily, now: Date) {
|
|
118
|
+
const inspection = inspectStructuredLogRetention(family, now);
|
|
119
|
+
const effective = family.effective_log_retention;
|
|
120
|
+
return {
|
|
121
|
+
family_id: family.id,
|
|
122
|
+
class: family.storage_class,
|
|
123
|
+
directory: structuredLogDirectory(family),
|
|
124
|
+
registered_roots: family.resolved_roots,
|
|
125
|
+
policy_version: family.policy.policy_version,
|
|
126
|
+
effective_policy: effective
|
|
127
|
+
? {
|
|
128
|
+
state: effective.state,
|
|
129
|
+
max_bytes: effective.max_bytes,
|
|
130
|
+
max_age_days: effective.max_age_days,
|
|
131
|
+
max_age_ms: effective.max_age_ms,
|
|
132
|
+
fingerprint: effective.effective_policy_fingerprint,
|
|
133
|
+
provenance: effective.provenance,
|
|
134
|
+
diagnostics: effective.diagnostics,
|
|
135
|
+
}
|
|
136
|
+
: null,
|
|
137
|
+
usage: inspection.usage,
|
|
138
|
+
pressure: inspection.pressure,
|
|
139
|
+
retention: inspection.retention,
|
|
140
|
+
sealed_segments: inspection.sealed_segments.length,
|
|
141
|
+
obsolete_manifest_snapshots: inspection.obsolete_snapshots.length,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function structuredLogDirectory(family: HarneryRegisteredStorageFamily): string | null {
|
|
146
|
+
if (
|
|
147
|
+
family.provider.provider_id !== HARNERY_STRUCTURED_LOG_PROVIDER_ID ||
|
|
148
|
+
family.format !== "jsonl"
|
|
149
|
+
) {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
const root = family.resolved_roots.find(
|
|
153
|
+
(candidate) => candidate.match === "provider-partition" && candidate.ownership !== "external",
|
|
154
|
+
);
|
|
155
|
+
return root?.partition ? familyLogDirectory(family) : null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function logFamilyTableRow(row: ReturnType<typeof logFamilyRow>): Record<string, unknown> {
|
|
159
|
+
return {
|
|
160
|
+
family_id: row.family_id,
|
|
161
|
+
class: row.class,
|
|
162
|
+
max_bytes: row.effective_policy?.max_bytes ?? "unavailable",
|
|
163
|
+
max_age_days: row.effective_policy?.max_age_days ?? "unavailable",
|
|
164
|
+
managed_bytes: row.usage.managed_bytes,
|
|
165
|
+
unmanaged_bytes: row.usage.unmanaged_bytes,
|
|
166
|
+
pressure: row.pressure.state,
|
|
167
|
+
pressure_ratio:
|
|
168
|
+
row.pressure.ratio === null ? "unavailable" : Number(row.pressure.ratio.toFixed(3)),
|
|
169
|
+
retention: row.retention.state,
|
|
170
|
+
enforcement: row.retention.enforcement,
|
|
171
|
+
reasons: row.retention.reason_codes.join(",") || "none",
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function catalogFor(context?: HarneryProgramContext) {
|
|
176
|
+
const coordRoot = resolve(
|
|
177
|
+
context?.resolveCoordRoot?.() ??
|
|
178
|
+
context?.repoRoot ??
|
|
179
|
+
process.env.HARNERY_COORD_ROOT ??
|
|
180
|
+
resolveCanonicalCoordRoot() ??
|
|
181
|
+
process.cwd(),
|
|
182
|
+
);
|
|
183
|
+
return createStorageCatalog(
|
|
184
|
+
{ coord_root: coordRoot, project_root: resolve(context?.repoRoot ?? coordRoot) },
|
|
185
|
+
context?.storage,
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function logFamilies(
|
|
190
|
+
families: readonly HarneryRegisteredStorageFamily[],
|
|
191
|
+
): HarneryRegisteredStorageFamily[] {
|
|
192
|
+
return families.filter(isLogFamily);
|
|
193
|
+
}
|
|
194
|
+
function isLogFamily(family: HarneryRegisteredStorageFamily): boolean {
|
|
195
|
+
return family.storage_class === "operational-log" || family.storage_class === "debug-log";
|
|
196
|
+
}
|
|
197
|
+
function integer(value: string): number {
|
|
198
|
+
const parsed = Number.parseInt(value, 10);
|
|
199
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0)
|
|
200
|
+
throw new Error(`invalid positive integer: ${value}`);
|
|
201
|
+
return parsed;
|
|
202
|
+
}
|
|
203
|
+
function queryFrom(options: QueryOptions) {
|
|
204
|
+
return {
|
|
205
|
+
...(options.family ? { family_ids: options.family } : {}),
|
|
206
|
+
...(options.level ? { minimum_level: options.level } : {}),
|
|
207
|
+
...(options.event ? { event: options.event } : {}),
|
|
208
|
+
...(options.since ? { since: options.since } : {}),
|
|
209
|
+
...(options.until ? { until: options.until } : {}),
|
|
210
|
+
max_records: options.maxRecords,
|
|
211
|
+
max_bytes: options.maxBytes,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
async function run(emit: EmitContext, action: () => Promise<void>): Promise<void> {
|
|
215
|
+
try {
|
|
216
|
+
await action();
|
|
217
|
+
} catch (error) {
|
|
218
|
+
emit.error({
|
|
219
|
+
code: "logs_query_failed",
|
|
220
|
+
message: error instanceof Error ? error.message : String(error),
|
|
221
|
+
});
|
|
222
|
+
emit.setExitCode(1);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext } from "../commander.ts";
|
|
3
|
+
import type { HarneryInboxService } from "../core/inbox/service.ts";
|
|
4
|
+
|
|
5
|
+
export function registerMessagesCommand(
|
|
6
|
+
program: Command,
|
|
7
|
+
emit: EmitContext,
|
|
8
|
+
service?: HarneryInboxService,
|
|
9
|
+
): void {
|
|
10
|
+
program
|
|
11
|
+
.command("messages")
|
|
12
|
+
.description("Queue a durable coordination message; dry-run unless --yes")
|
|
13
|
+
.requiredOption("--from <instance>")
|
|
14
|
+
.requiredOption("--from-name <name>")
|
|
15
|
+
.requiredOption("--to <instance>")
|
|
16
|
+
.requiredOption("--to-name <name>")
|
|
17
|
+
.requiredOption("--body <text>")
|
|
18
|
+
.option("--yes", "Append and sync the message")
|
|
19
|
+
.option("--json", "Emit stable JSON")
|
|
20
|
+
.action(
|
|
21
|
+
(options: {
|
|
22
|
+
from: string;
|
|
23
|
+
fromName: string;
|
|
24
|
+
to: string;
|
|
25
|
+
toName: string;
|
|
26
|
+
body: string;
|
|
27
|
+
yes?: boolean;
|
|
28
|
+
json?: boolean;
|
|
29
|
+
}) => {
|
|
30
|
+
try {
|
|
31
|
+
const result = options.yes
|
|
32
|
+
? requireInboxService(service).send({
|
|
33
|
+
sender_instance_id: options.from,
|
|
34
|
+
sender_display_name: options.fromName,
|
|
35
|
+
recipient_instance_id: options.to,
|
|
36
|
+
recipient_display_name: options.toName,
|
|
37
|
+
body: options.body,
|
|
38
|
+
})
|
|
39
|
+
: {
|
|
40
|
+
state: "dry-run" as const,
|
|
41
|
+
recipient_instance_id: options.to,
|
|
42
|
+
body_bytes: Buffer.byteLength(options.body),
|
|
43
|
+
writes: false,
|
|
44
|
+
};
|
|
45
|
+
if (options.json) emit.config({ format: "json" });
|
|
46
|
+
emit.data({ schema: "harnery.message-send/v1", ...result });
|
|
47
|
+
} catch (error) {
|
|
48
|
+
emit.error({
|
|
49
|
+
code: "message_send_failed",
|
|
50
|
+
message: error instanceof Error ? error.message : String(error),
|
|
51
|
+
});
|
|
52
|
+
emit.setExitCode(1);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function requireInboxService(service?: HarneryInboxService): HarneryInboxService {
|
|
59
|
+
if (!service) throw new Error("coordination inbox is not configured by this host");
|
|
60
|
+
return service;
|
|
61
|
+
}
|
package/src/commands/outline.ts
CHANGED
|
@@ -55,11 +55,15 @@ interface OutlineResult {
|
|
|
55
55
|
symbols: SymbolEntry[];
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export function registerOutlineCommand(
|
|
58
|
+
export function registerOutlineCommand(
|
|
59
|
+
program: Command,
|
|
60
|
+
emit: EmitContext,
|
|
61
|
+
binName = resolveBinName(),
|
|
62
|
+
): void {
|
|
59
63
|
program
|
|
60
64
|
.command("outline <file>")
|
|
61
65
|
.description(
|
|
62
|
-
`Print the structural skeleton of a code file (imports + top-level decls + line numbers). Supports TS/JS/TSX/JSX (AST), PHP/Python (regex). Use \`${
|
|
66
|
+
`Print the structural skeleton of a code file (imports + top-level decls + line numbers). Supports TS/JS/TSX/JSX (AST), PHP/Python (regex). Use \`${binName} toc\` for markdown.`,
|
|
63
67
|
)
|
|
64
68
|
.option("--json", "Structured JSON envelope")
|
|
65
69
|
.option("--exports-only", "Only show exported symbols")
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// `qa-run <target>`: run the whole page-QA matrix (planner, deterministic
|
|
2
|
+
// gates, interactions, critique, snapshot) in one command. The agent's loop
|
|
3
|
+
// collapses to: build the job, run this, read page-qa-result.json.
|
|
4
|
+
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { join, resolve } from "node:path";
|
|
7
|
+
import type { Command } from "commander";
|
|
8
|
+
import type { EmitContext } from "../commander.ts";
|
|
9
|
+
import { QA_RUN_RESULT_FILENAME, runQaMatrix } from "../lib/browser/qa-run.ts";
|
|
10
|
+
import {
|
|
11
|
+
QA_RUN_JOB_SCHEMA_VERSION,
|
|
12
|
+
type QaRunJob,
|
|
13
|
+
validateQaRunJob,
|
|
14
|
+
} from "../lib/browser/qa-run-contracts.ts";
|
|
15
|
+
|
|
16
|
+
interface QaRunOpts {
|
|
17
|
+
job?: string;
|
|
18
|
+
mode: string;
|
|
19
|
+
concurrency?: string;
|
|
20
|
+
allowMetered?: boolean;
|
|
21
|
+
outDir?: string;
|
|
22
|
+
json?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function registerQaRunCommand(program: Command, emit: EmitContext): void {
|
|
26
|
+
program
|
|
27
|
+
.command("qa-run <target>")
|
|
28
|
+
.description(
|
|
29
|
+
"Run the whole page-QA matrix in one command: QA planner, deterministic " +
|
|
30
|
+
"gates per viewport/theme/state through a bounded process pool, serial " +
|
|
31
|
+
"interaction assertions, manifest-required vision critique, and the QA " +
|
|
32
|
+
"snapshot. Writes page-qa-result.json with a fail-closed verdict.",
|
|
33
|
+
)
|
|
34
|
+
.option(
|
|
35
|
+
"--job <file>",
|
|
36
|
+
"QA job document (JSON). Validated before any browser starts — secret-bearing " +
|
|
37
|
+
"fields are refused, and the job may widen but never narrow the planner's coverage. " +
|
|
38
|
+
"Absent: a minimal implicit job for <target> is used.",
|
|
39
|
+
)
|
|
40
|
+
.option(
|
|
41
|
+
"--mode <mode>",
|
|
42
|
+
"signoff persists a QA snapshot on a passing run; review never does.",
|
|
43
|
+
"signoff",
|
|
44
|
+
)
|
|
45
|
+
.option(
|
|
46
|
+
"--concurrency <n>",
|
|
47
|
+
"Concurrent deterministic captures (1-8; default 2). Interactions and critique " +
|
|
48
|
+
"always run serially.",
|
|
49
|
+
)
|
|
50
|
+
.option(
|
|
51
|
+
"--allow-metered",
|
|
52
|
+
"Permit the critique provider's metered-API fallback. Default: subscription-backed " +
|
|
53
|
+
"headless harnesses only — exhaustion becomes an incomplete blocker, never a metered call.",
|
|
54
|
+
)
|
|
55
|
+
.option(
|
|
56
|
+
"--out-dir <dir>",
|
|
57
|
+
"Artifact + result directory (default: .qa-run/<timestamp> under the current directory).",
|
|
58
|
+
)
|
|
59
|
+
.option("--json", "Print the full QaRunResult JSON to stdout.")
|
|
60
|
+
.addHelpText(
|
|
61
|
+
"after",
|
|
62
|
+
"\nExit codes: 0 verdict passed · 1 usage or job-validation error · " +
|
|
63
|
+
"2 verdict failed · 4 verdict incomplete.",
|
|
64
|
+
)
|
|
65
|
+
.action(async (target: string, opts: QaRunOpts, command: Command) => {
|
|
66
|
+
if (opts.mode !== "signoff" && opts.mode !== "review") {
|
|
67
|
+
emit.error({
|
|
68
|
+
code: "qa_run_invalid_mode",
|
|
69
|
+
message: '--mode must be "signoff" or "review"',
|
|
70
|
+
});
|
|
71
|
+
process.exitCode = 1;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const modeExplicit = command.getOptionValueSource("mode") === "cli";
|
|
75
|
+
|
|
76
|
+
let jobDocument: unknown;
|
|
77
|
+
if (opts.job) {
|
|
78
|
+
let rawText: string;
|
|
79
|
+
try {
|
|
80
|
+
rawText = readFileSync(opts.job, "utf8");
|
|
81
|
+
} catch (err: unknown) {
|
|
82
|
+
emit.error({
|
|
83
|
+
code: "qa_run_job_unreadable",
|
|
84
|
+
message: `cannot read --job file ${opts.job}: ${err instanceof Error ? err.message : String(err)}`,
|
|
85
|
+
});
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let parsed: unknown;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(rawText);
|
|
92
|
+
} catch (err: unknown) {
|
|
93
|
+
emit.error({
|
|
94
|
+
code: "qa_run_job_invalid_json",
|
|
95
|
+
message: `--job file ${opts.job} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,
|
|
96
|
+
});
|
|
97
|
+
process.exitCode = 1;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
101
|
+
const raw = parsed as Record<string, unknown>;
|
|
102
|
+
// The CLI target argument is authoritative; a job file may omit
|
|
103
|
+
// target and mode. An explicit --mode overrides the job's mode.
|
|
104
|
+
jobDocument = {
|
|
105
|
+
...raw,
|
|
106
|
+
target,
|
|
107
|
+
...(raw.mode === undefined || modeExplicit ? { mode: opts.mode } : {}),
|
|
108
|
+
};
|
|
109
|
+
} else {
|
|
110
|
+
jobDocument = parsed;
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
jobDocument = { schema_version: QA_RUN_JOB_SCHEMA_VERSION, target, mode: opts.mode };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// All validation errors print at once, before any browser starts.
|
|
117
|
+
const validation = validateQaRunJob(jobDocument);
|
|
118
|
+
if (!validation.ok) {
|
|
119
|
+
for (const message of validation.errors) emit.log(`job: ${message}`, "error");
|
|
120
|
+
emit.error({
|
|
121
|
+
code: "qa_run_invalid_job",
|
|
122
|
+
message: `job validation failed with ${validation.errors.length} error${validation.errors.length === 1 ? "" : "s"}`,
|
|
123
|
+
});
|
|
124
|
+
process.exitCode = 1;
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const policy = { ...validation.job.policy };
|
|
129
|
+
if (opts.concurrency !== undefined) {
|
|
130
|
+
const n = Number.parseInt(opts.concurrency, 10);
|
|
131
|
+
if (!Number.isInteger(n) || n < 1 || n > 8) {
|
|
132
|
+
emit.error({
|
|
133
|
+
code: "qa_run_invalid_concurrency",
|
|
134
|
+
message: "--concurrency must be an integer between 1 and 8",
|
|
135
|
+
});
|
|
136
|
+
process.exitCode = 1;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
policy.command_concurrency = n;
|
|
140
|
+
}
|
|
141
|
+
if (opts.allowMetered) policy.allow_metered_critique = true;
|
|
142
|
+
const job: QaRunJob = { ...validation.job, policy };
|
|
143
|
+
|
|
144
|
+
const outDir = resolve(
|
|
145
|
+
opts.outDir ?? join(".qa-run", new Date().toISOString().replace(/[:.]/g, "-")),
|
|
146
|
+
);
|
|
147
|
+
const cliScript = process.argv[1];
|
|
148
|
+
if (!cliScript) {
|
|
149
|
+
emit.error({
|
|
150
|
+
code: "qa_run_no_cli_script",
|
|
151
|
+
message: "cannot resolve the host CLI script path for child browse invocations",
|
|
152
|
+
});
|
|
153
|
+
process.exitCode = 1;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
// Children run the same host CLI, so they inherit the host's browse
|
|
157
|
+
// wiring (critique provider, cookie jar, profiles) unchanged.
|
|
158
|
+
const browseArgv = [process.execPath, cliScript, "browse"];
|
|
159
|
+
|
|
160
|
+
const result = await runQaMatrix({
|
|
161
|
+
job,
|
|
162
|
+
outDir,
|
|
163
|
+
browseArgv,
|
|
164
|
+
onLog: (message) => emit.log(message, "info"),
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
if (opts.json) emit.data(result);
|
|
168
|
+
const resultPath = join(outDir, QA_RUN_RESULT_FILENAME);
|
|
169
|
+
for (const blocker of result.blockers) {
|
|
170
|
+
emit.log(
|
|
171
|
+
`blocker [${blocker.stage}${blocker.context_id ? ` ${blocker.context_id}` : ""}]: ${blocker.reason}`,
|
|
172
|
+
"warn",
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
emit.log(
|
|
176
|
+
`verdict: ${result.verdict} — ${result.contexts.length} context${result.contexts.length === 1 ? "" : "s"}, ` +
|
|
177
|
+
`${result.commands.length} command${result.commands.length === 1 ? "" : "s"}, ` +
|
|
178
|
+
`${result.blockers.length} blocker${result.blockers.length === 1 ? "" : "s"}; result: ${resultPath}`,
|
|
179
|
+
result.verdict === "passed" ? "info" : "warn",
|
|
180
|
+
);
|
|
181
|
+
if (result.verdict === "failed") process.exitCode = 2;
|
|
182
|
+
else if (result.verdict === "incomplete") process.exitCode = 4;
|
|
183
|
+
});
|
|
184
|
+
}
|
package/src/commands/read.ts
CHANGED
|
@@ -11,12 +11,16 @@ let emit: EmitContext;
|
|
|
11
11
|
/**
|
|
12
12
|
* `harn read`: extract clean readable markdown from HTML.
|
|
13
13
|
*/
|
|
14
|
-
export function registerReadCommand(
|
|
14
|
+
export function registerReadCommand(
|
|
15
|
+
program: Command,
|
|
16
|
+
emitParam: EmitContext,
|
|
17
|
+
binName = resolveBinName(),
|
|
18
|
+
): void {
|
|
15
19
|
emit = emitParam;
|
|
16
20
|
program
|
|
17
21
|
.command("read [html-file]")
|
|
18
22
|
.description(
|
|
19
|
-
`Extract clean readable markdown from HTML. Reads from file or stdin (use '-'). Pair with \`${
|
|
23
|
+
`Extract clean readable markdown from HTML. Reads from file or stdin (use '-'). Pair with \`${binName} fetch\` or \`${binName} browse\` for scrape-to-markdown.`,
|
|
20
24
|
)
|
|
21
25
|
.option("-o, --output <file>", "Write markdown to file instead of stdout")
|
|
22
26
|
.option("--url <url>", "Base URL: used to resolve relative links")
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
4
|
+
import { sampleResources } from "../core/resources/index.ts";
|
|
5
|
+
|
|
6
|
+
export function registerResourcesCommand(
|
|
7
|
+
program: Command,
|
|
8
|
+
emit: EmitContext,
|
|
9
|
+
context?: HarneryProgramContext,
|
|
10
|
+
): void {
|
|
11
|
+
const resources = program
|
|
12
|
+
.command("resources")
|
|
13
|
+
.description("Observe local CPU and memory pressure by agent and process tree");
|
|
14
|
+
|
|
15
|
+
resources
|
|
16
|
+
.command("snapshot")
|
|
17
|
+
.description("Capture one machine and process-resource snapshot")
|
|
18
|
+
.option("--root <path>", "Explicit coordination root")
|
|
19
|
+
.action((options: { root?: string }) => {
|
|
20
|
+
try {
|
|
21
|
+
emit.data(sampleResources(resolve(options.root ?? coordRoot(context))).snapshot);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
fail(emit, "resource_snapshot_failed", error);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function coordRoot(context?: HarneryProgramContext): string {
|
|
29
|
+
return context?.resolveCoordRoot?.() ?? context?.repoRoot ?? process.cwd();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function fail(emit: EmitContext, code: string, error: unknown): void {
|
|
33
|
+
emit.error({
|
|
34
|
+
code,
|
|
35
|
+
message: error instanceof Error ? error.message : String(error),
|
|
36
|
+
});
|
|
37
|
+
emit.setExitCode(1);
|
|
38
|
+
}
|
package/src/commands/semantic.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFileSync, statSync } from "node:fs";
|
|
1
2
|
import { resolve } from "node:path";
|
|
2
3
|
import type { Command } from "commander";
|
|
3
4
|
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
@@ -5,13 +6,16 @@ import {
|
|
|
5
6
|
createSemanticAdapters,
|
|
6
7
|
discoverSemanticReaders,
|
|
7
8
|
inspectSemanticDocument,
|
|
9
|
+
prepareSemanticReviewStudy,
|
|
8
10
|
readSemanticManifest,
|
|
9
11
|
readSemanticServiceStatus,
|
|
12
|
+
readSemanticSoakReport,
|
|
10
13
|
requestSemanticServiceStop,
|
|
11
14
|
runSemanticOnce,
|
|
12
15
|
runSemanticServiceDaemon,
|
|
13
16
|
semanticPaths,
|
|
14
17
|
spawnSemanticService,
|
|
18
|
+
storeSemanticReviewSubmission,
|
|
15
19
|
} from "../core/semantic/index.ts";
|
|
16
20
|
|
|
17
21
|
export function registerSemanticCommand(
|
|
@@ -64,7 +68,7 @@ export function registerSemanticCommand(
|
|
|
64
68
|
|
|
65
69
|
service
|
|
66
70
|
.command("status")
|
|
67
|
-
.description("Show
|
|
71
|
+
.description("Show reader liveness, rolling calls, token usage, routes, and pending work")
|
|
68
72
|
.option("--root <path>", "Explicit coordination root")
|
|
69
73
|
.action((options: { root?: string }) => {
|
|
70
74
|
try {
|
|
@@ -129,6 +133,67 @@ export function registerSemanticCommand(
|
|
|
129
133
|
}
|
|
130
134
|
});
|
|
131
135
|
|
|
136
|
+
semantic
|
|
137
|
+
.command("soak")
|
|
138
|
+
.description("Summarize recent reader outcomes, controlled cues, stability, and token usage")
|
|
139
|
+
.option("--root <path>", "Explicit coordination root")
|
|
140
|
+
.option("--minutes <count>", "Lookback window in whole minutes", integer)
|
|
141
|
+
.action((options: { root?: string; minutes?: number }) => {
|
|
142
|
+
try {
|
|
143
|
+
emit.data(
|
|
144
|
+
readSemanticSoakReport(resolve(options.root ?? coordRoot(context)), {
|
|
145
|
+
...(options.minutes !== undefined ? { minutes: options.minutes } : {}),
|
|
146
|
+
}),
|
|
147
|
+
);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
emitFailure(emit, "semantic_soak_failed", error);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const review = semantic
|
|
154
|
+
.command("review")
|
|
155
|
+
.description("Prepare and record a local human review of accepted semantic readings");
|
|
156
|
+
|
|
157
|
+
review
|
|
158
|
+
.command("prepare")
|
|
159
|
+
.description("Capture current accepted readings and return the next bounded review set")
|
|
160
|
+
.option("--root <path>", "Explicit coordination root")
|
|
161
|
+
.option("--limit <count>", "Maximum candidates in this review set", integer)
|
|
162
|
+
.action((options: { root?: string; limit?: number }) => {
|
|
163
|
+
try {
|
|
164
|
+
emit.data(
|
|
165
|
+
prepareSemanticReviewStudy(resolve(options.root ?? coordRoot(context)), {
|
|
166
|
+
...(options.limit !== undefined ? { limit: options.limit } : {}),
|
|
167
|
+
}),
|
|
168
|
+
);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
emitFailure(emit, "semantic_review_prepare_failed", error);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
review
|
|
175
|
+
.command("submit")
|
|
176
|
+
.description("Validate one frozen review set and store its controlled-label receipt")
|
|
177
|
+
.requiredOption("--file <path>", "JSON submission file")
|
|
178
|
+
.option("--root <path>", "Explicit coordination root")
|
|
179
|
+
.action((options: { file: string; root?: string }) => {
|
|
180
|
+
try {
|
|
181
|
+
const file = resolve(options.file);
|
|
182
|
+
const size = statSync(file).size;
|
|
183
|
+
if (size <= 0 || size > 128 * 1024) {
|
|
184
|
+
throw new Error("semantic review submission has invalid size");
|
|
185
|
+
}
|
|
186
|
+
emit.data(
|
|
187
|
+
storeSemanticReviewSubmission(
|
|
188
|
+
resolve(options.root ?? coordRoot(context)),
|
|
189
|
+
JSON.parse(readFileSync(file, "utf8")),
|
|
190
|
+
),
|
|
191
|
+
);
|
|
192
|
+
} catch (error) {
|
|
193
|
+
emitFailure(emit, "semantic_review_submit_failed", error);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
132
197
|
semantic
|
|
133
198
|
.command("doctor")
|
|
134
199
|
.description("Inspect semantic reader availability without making a model request")
|