harnery 0.37.0 → 0.39.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 +9 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +7 -2
- package/dist/commands/admission.d.ts +21 -0
- package/dist/commands/admission.d.ts.map +1 -0
- package/dist/commands/admission.js +565 -0
- package/dist/commands/agents.d.ts +7 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +93 -9
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +144 -7
- package/dist/commands/backup.d.ts +16 -0
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +239 -33
- package/dist/commands/browse-ai.d.ts +2 -2
- package/dist/commands/browse-ai.d.ts.map +1 -1
- package/dist/commands/browse-ai.js +6 -4
- package/dist/commands/browse.d.ts +8 -0
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +686 -123
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +6 -3
- package/dist/commands/fetch.js +1 -0
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +20 -4
- package/dist/commands/qa-record.d.ts +144 -0
- package/dist/commands/qa-record.d.ts.map +1 -0
- package/dist/commands/qa-record.js +0 -0
- package/dist/commands/qa-run.d.ts +7 -3
- package/dist/commands/qa-run.d.ts.map +1 -1
- package/dist/commands/qa-run.js +292 -14
- package/dist/commands/qa-status.d.ts +71 -0
- package/dist/commands/qa-status.d.ts.map +1 -0
- package/dist/commands/qa-status.js +495 -0
- package/dist/commands/qa-verify.d.ts +40 -0
- package/dist/commands/qa-verify.d.ts.map +1 -0
- package/dist/commands/qa-verify.js +180 -0
- package/dist/commands/resources.d.ts.map +1 -1
- package/dist/commands/resources.js +23 -3
- package/dist/commands/review-pack.d.ts +4 -0
- package/dist/commands/review-pack.d.ts.map +1 -0
- package/dist/commands/review-pack.js +1076 -0
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +2 -2
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/canonical-emit.d.ts +3 -2
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +2 -0
- package/dist/core/agents/cli.js +1 -3
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +5 -3
- package/dist/core/agents/live-lifecycle-v3.d.ts +2 -2
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -1
- package/dist/core/agents/qa-signal.d.ts +111 -0
- package/dist/core/agents/qa-signal.d.ts.map +1 -0
- package/dist/core/agents/qa-signal.js +231 -0
- package/dist/core/agents/render/prompt-context.d.ts +7 -5
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +63 -8
- package/dist/core/agents/session-finalizer-v3.d.ts +2 -2
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -1
- package/dist/core/agents/session-name-display.d.ts +20 -5
- package/dist/core/agents/session-name-display.d.ts.map +1 -1
- package/dist/core/agents/session-name-display.js +67 -7
- package/dist/core/agents/state/heartbeat-reader.d.ts +7 -0
- package/dist/core/agents/state/heartbeat-reader.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.d.ts +11 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +17 -0
- package/dist/core/agents/state/live-coordination-view.d.ts +3 -3
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +3 -1
- package/dist/core/agents/state/live-coordination-writer.js +5 -0
- package/dist/core/agents/state/names.d.ts +34 -1
- package/dist/core/agents/state/names.d.ts.map +1 -1
- package/dist/core/agents/state/names.js +81 -4
- package/dist/core/agents/state/stale-sweep.d.ts +2 -1
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +23 -6
- package/dist/core/agents/turn-elapsed.d.ts +51 -0
- package/dist/core/agents/turn-elapsed.d.ts.map +1 -0
- package/dist/core/agents/turn-elapsed.js +91 -0
- package/dist/core/artifacts/activity.d.ts +14 -0
- package/dist/core/artifacts/activity.d.ts.map +1 -0
- package/dist/core/artifacts/activity.js +52 -0
- package/dist/core/artifacts/constants.d.ts +1 -1
- package/dist/core/artifacts/constants.js +1 -1
- package/dist/core/artifacts/delivery-card.d.ts +39 -0
- package/dist/core/artifacts/delivery-card.d.ts.map +1 -0
- package/dist/core/artifacts/delivery-card.js +282 -0
- package/dist/core/artifacts/index.d.ts +98 -12
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +532 -65
- package/dist/core/artifacts/mutation-lock.d.ts +2 -0
- package/dist/core/artifacts/mutation-lock.d.ts.map +1 -0
- package/dist/core/artifacts/mutation-lock.js +91 -0
- package/dist/core/backup/host-snapshot.d.ts +18 -0
- package/dist/core/backup/host-snapshot.d.ts.map +1 -0
- package/dist/core/backup/host-snapshot.js +64 -0
- package/dist/core/config.d.ts +28 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +60 -10
- package/dist/core/diagnostics/advice.d.ts +38 -3
- package/dist/core/diagnostics/advice.d.ts.map +1 -1
- package/dist/core/diagnostics/advice.js +103 -99
- package/dist/core/diagnostics/bundle.d.ts +16 -0
- package/dist/core/diagnostics/bundle.d.ts.map +1 -1
- package/dist/core/diagnostics/bundle.js +212 -54
- package/dist/core/diagnostics/comparison.d.ts.map +1 -1
- package/dist/core/diagnostics/comparison.js +3 -2
- package/dist/core/diagnostics/contract.d.ts +15 -31
- package/dist/core/diagnostics/contract.d.ts.map +1 -1
- package/dist/core/diagnostics/contract.js +2 -5
- package/dist/core/diagnostics/index.d.ts +2 -0
- package/dist/core/diagnostics/index.d.ts.map +1 -1
- package/dist/core/diagnostics/index.js +2 -0
- package/dist/core/diagnostics/pressure-contract.d.ts +260 -0
- package/dist/core/diagnostics/pressure-contract.d.ts.map +1 -0
- package/dist/core/diagnostics/pressure-contract.js +70 -0
- package/dist/core/diagnostics/pressure.d.ts +25 -0
- package/dist/core/diagnostics/pressure.d.ts.map +1 -0
- package/dist/core/diagnostics/pressure.js +1138 -0
- package/dist/core/diagnostics/replay.d.ts.map +1 -1
- package/dist/core/diagnostics/replay.js +90 -10
- package/dist/core/events/v3/adapter-id.d.ts +6 -0
- package/dist/core/events/v3/adapter-id.d.ts.map +1 -0
- package/dist/core/events/v3/adapter-id.js +7 -0
- package/dist/core/events/v3/archive-retention.d.ts.map +1 -1
- package/dist/core/events/v3/archive-retention.js +3 -2
- package/dist/core/events/v3/bootstrap.d.ts +41 -4
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +130 -17
- package/dist/core/events/v3/capabilities.d.ts +16 -9
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +37 -2
- package/dist/core/events/v3/capability-drift.d.ts +2 -2
- package/dist/core/events/v3/capability-drift.d.ts.map +1 -1
- package/dist/core/events/v3/control-witness.d.ts +48 -5
- package/dist/core/events/v3/control-witness.d.ts.map +1 -1
- package/dist/core/events/v3/control-witness.js +91 -36
- package/dist/core/events/v3/control.d.ts.map +1 -1
- package/dist/core/events/v3/control.js +22 -2
- package/dist/core/events/v3/coordination-view.d.ts +3 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-view.js +69 -8
- package/dist/core/events/v3/index.d.ts +2 -1
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +2 -1
- package/dist/core/events/v3/live-feed.d.ts +7 -1
- package/dist/core/events/v3/live-feed.d.ts.map +1 -1
- package/dist/core/events/v3/live-feed.js +21 -3
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +10 -2
- package/dist/core/events/v3/producers/command-recorder.d.ts +2 -2
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/command-recorder.js +2 -1
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +2 -2
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +2 -1
- package/dist/core/events/v3/producers/hook-base.d.ts +2 -2
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +15 -5
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook.js +17 -4
- package/dist/core/events/v3/producers/intake.d.ts +4 -4
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +12 -4
- package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -1
- package/dist/core/events/v3/producers/producer-state-observer.js +2 -1
- package/dist/core/events/v3/producers/recorder.d.ts +39 -5
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +294 -26
- package/dist/core/events/v3/reader.d.ts.map +1 -1
- package/dist/core/events/v3/reader.js +10 -13
- package/dist/core/events/v3/runtime-build.d.ts.map +1 -1
- package/dist/core/events/v3/runtime-build.js +3 -2
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +2 -2
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/turn-telemetry.d.ts +2 -2
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.d.ts +16 -14
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +36 -38
- package/dist/core/hooks/backup-schedule.d.ts +34 -0
- package/dist/core/hooks/backup-schedule.d.ts.map +1 -0
- package/dist/core/hooks/backup-schedule.js +114 -0
- package/dist/core/hooks/cli.js +177 -44
- package/dist/core/hooks/codex-wsl-bridge.d.ts +2 -0
- package/dist/core/hooks/codex-wsl-bridge.d.ts.map +1 -1
- package/dist/core/hooks/codex-wsl-bridge.js +18 -4
- package/dist/core/hooks/index.d.ts +1 -0
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +1 -0
- package/dist/core/hooks/prompt-context/contract.d.ts +61 -0
- package/dist/core/hooks/prompt-context/contract.d.ts.map +1 -0
- package/dist/core/hooks/prompt-context/contract.js +102 -0
- package/dist/core/hooks/prompt-context/index.d.ts +5 -0
- package/dist/core/hooks/prompt-context/index.d.ts.map +1 -0
- package/dist/core/hooks/prompt-context/index.js +2 -0
- package/dist/core/hooks/prompt-context/runner.d.ts +24 -0
- package/dist/core/hooks/prompt-context/runner.d.ts.map +1 -0
- package/dist/core/hooks/prompt-context/runner.js +249 -0
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +10 -3
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +4 -1
- package/dist/core/qa-artifacts.d.ts +23 -0
- package/dist/core/qa-artifacts.d.ts.map +1 -0
- package/dist/core/qa-artifacts.js +132 -0
- package/dist/core/resources/contract.d.ts +75 -3
- package/dist/core/resources/contract.d.ts.map +1 -1
- package/dist/core/resources/contract.js +1 -1
- package/dist/core/resources/index.d.ts +1 -0
- package/dist/core/resources/index.d.ts.map +1 -1
- package/dist/core/resources/index.js +1 -0
- package/dist/core/resources/native.d.ts +36 -0
- package/dist/core/resources/native.d.ts.map +1 -0
- package/dist/core/resources/native.js +418 -0
- package/dist/core/resources/sampler.d.ts +9 -0
- package/dist/core/resources/sampler.d.ts.map +1 -1
- package/dist/core/resources/sampler.js +137 -6
- package/dist/core/resources/status.d.ts +61 -0
- package/dist/core/resources/status.d.ts.map +1 -0
- package/dist/core/resources/status.js +536 -0
- package/dist/core/resources/system.d.ts +27 -0
- package/dist/core/resources/system.d.ts.map +1 -0
- package/dist/core/resources/system.js +439 -0
- package/dist/core/semantic/contract.d.ts +13 -13
- package/dist/core/semantic/service.d.ts +2 -0
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +27 -4
- package/dist/core/storage/builtins.js +41 -0
- package/dist/core/supervisor/contract.d.ts +41 -3
- package/dist/core/supervisor/contract.d.ts.map +1 -1
- package/dist/core/supervisor/contract.js +3 -2
- package/dist/core/supervisor/findings.d.ts +3 -0
- package/dist/core/supervisor/findings.d.ts.map +1 -1
- package/dist/core/supervisor/findings.js +88 -0
- package/dist/core/supervisor/history.d.ts.map +1 -1
- package/dist/core/supervisor/history.js +14 -0
- package/dist/core/supervisor/ledger-state.d.ts +55 -0
- package/dist/core/supervisor/ledger-state.d.ts.map +1 -0
- package/dist/core/supervisor/ledger-state.js +0 -0
- package/dist/core/supervisor/service.d.ts.map +1 -1
- package/dist/core/supervisor/service.js +120 -7
- package/dist/core/supervisor/storage.d.ts +3 -1
- package/dist/core/supervisor/storage.d.ts.map +1 -1
- package/dist/core/supervisor/storage.js +4 -0
- package/dist/core/workflow/admission.d.ts +3 -0
- package/dist/core/workflow/admission.d.ts.map +1 -1
- package/dist/core/workflow/admission.js +28 -16
- package/dist/core/workflow/engine.js +2 -2
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +3 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +4 -3
- package/dist/lib/admission.d.ts +71 -0
- package/dist/lib/admission.d.ts.map +1 -0
- package/dist/lib/admission.js +264 -0
- package/dist/lib/agent-browser/client.d.ts +1 -1
- package/dist/lib/agent-browser/client.d.ts.map +1 -1
- package/dist/lib/agent-browser/client.js +1 -5
- package/dist/lib/browser/capture-fidelity.d.ts +46 -0
- package/dist/lib/browser/capture-fidelity.d.ts.map +1 -0
- package/dist/lib/browser/capture-fidelity.js +101 -0
- package/dist/lib/browser/client.d.ts +50 -1
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +215 -9
- package/dist/lib/browser/critique.d.ts +38 -1
- package/dist/lib/browser/critique.d.ts.map +1 -1
- package/dist/lib/browser/critique.js +34 -6
- package/dist/lib/browser/index.d.ts +6 -2
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +3 -0
- package/dist/lib/browser/page-review-budget.d.ts +13 -0
- package/dist/lib/browser/page-review-budget.d.ts.map +1 -0
- package/dist/lib/browser/page-review-budget.js +251 -0
- package/dist/lib/browser/page-review-contracts.d.ts +127 -0
- package/dist/lib/browser/page-review-contracts.d.ts.map +1 -0
- package/dist/lib/browser/page-review-contracts.js +5 -0
- package/dist/lib/browser/page-review-evidence.d.ts +48 -0
- package/dist/lib/browser/page-review-evidence.d.ts.map +1 -0
- package/dist/lib/browser/page-review-evidence.js +340 -0
- package/dist/lib/browser/page-review-judge.d.ts +64 -0
- package/dist/lib/browser/page-review-judge.d.ts.map +1 -0
- package/dist/lib/browser/page-review-judge.js +278 -0
- package/dist/lib/browser/page-review-pack.d.ts +635 -0
- package/dist/lib/browser/page-review-pack.d.ts.map +1 -0
- package/dist/lib/browser/page-review-pack.js +1831 -0
- package/dist/lib/browser/page-review-source.d.ts +12 -0
- package/dist/lib/browser/page-review-source.d.ts.map +1 -0
- package/dist/lib/browser/page-review-source.js +22 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +241 -11
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -1
- package/dist/lib/browser/qa-run-contracts.js +177 -8
- package/dist/lib/browser/qa-run.d.ts +100 -10
- package/dist/lib/browser/qa-run.d.ts.map +1 -1
- package/dist/lib/browser/qa-run.js +914 -168
- package/dist/lib/browser/qa-snapshot.d.ts +6 -0
- package/dist/lib/browser/qa-snapshot.d.ts.map +1 -1
- package/dist/lib/browser/qa-snapshot.js +259 -48
- package/dist/lib/browser/request-diagnostics.d.ts +13 -0
- package/dist/lib/browser/request-diagnostics.d.ts.map +1 -0
- package/dist/lib/browser/request-diagnostics.js +18 -0
- package/dist/lib/browser/review-capture-transaction.d.ts +13 -0
- package/dist/lib/browser/review-capture-transaction.d.ts.map +1 -0
- package/dist/lib/browser/review-capture-transaction.js +79 -0
- package/dist/lib/browser/standalone-html.d.ts.map +1 -1
- package/dist/lib/browser/standalone-html.js +4 -2
- package/dist/lib/browser/thumbnail-association.d.ts +34 -0
- package/dist/lib/browser/thumbnail-association.d.ts.map +1 -0
- package/dist/lib/browser/thumbnail-association.js +158 -0
- package/dist/lib/browser/tiling.d.ts +49 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -1
- package/dist/lib/browser/tiling.js +66 -0
- package/dist/lib/cookies/client.d.ts +9 -0
- package/dist/lib/cookies/client.d.ts.map +1 -1
- package/dist/lib/cookies/client.js +197 -44
- package/dist/lib/cookies/extra.d.ts +18 -0
- package/dist/lib/cookies/extra.d.ts.map +1 -0
- package/dist/lib/cookies/extra.js +14 -0
- package/dist/lib/cookies/index.d.ts +2 -1
- package/dist/lib/cookies/index.d.ts.map +1 -1
- package/dist/lib/cookies/index.js +2 -1
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -1
- package/dist/lib/docs-metadata-managed.js +4 -1
- package/dist/lib/durable-job.d.ts +124 -0
- package/dist/lib/durable-job.d.ts.map +1 -0
- package/dist/lib/durable-job.js +296 -0
- package/dist/lib/http/client.d.ts +7 -1
- package/dist/lib/http/client.d.ts.map +1 -1
- package/dist/lib/http/client.js +2 -0
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +7 -1
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +6 -2
- package/dist/lib/local-file-url.d.ts +12 -0
- package/dist/lib/local-file-url.d.ts.map +1 -1
- package/dist/lib/local-file-url.js +16 -2
- package/dist/lib/tunnel/state.d.ts +19 -4
- package/dist/lib/tunnel/state.d.ts.map +1 -1
- package/dist/lib/tunnel/state.js +53 -13
- package/package.json +14 -5
- package/schemas/config.schema.json +69 -2
- package/src/commander.ts +50 -2
- package/src/commands/admission.ts +699 -0
- package/src/commands/agents.ts +129 -10
- package/src/commands/artifacts.ts +227 -27
- package/src/commands/backup.ts +287 -34
- package/src/commands/browse-ai.ts +10 -5
- package/src/commands/browse.ts +895 -137
- package/src/commands/diagnostics.ts +6 -3
- package/src/commands/fetch.ts +1 -0
- package/src/commands/ledger-v3.ts +20 -3
- package/src/commands/qa-record.ts +682 -0
- package/src/commands/qa-run.ts +370 -17
- package/src/commands/qa-status.ts +617 -0
- package/src/commands/qa-verify.ts +238 -0
- package/src/commands/resources.ts +23 -3
- package/src/commands/review-pack.ts +1384 -0
- package/src/commands/tunnel.ts +2 -1
- package/src/core/agents/canonical-emit.ts +4 -2
- package/src/core/agents/cli.ts +1 -3
- package/src/core/agents/live-authority-v3.ts +7 -3
- package/src/core/agents/live-lifecycle-v3.ts +2 -2
- package/src/core/agents/qa-signal.ts +261 -0
- package/src/core/agents/render/prompt-context.ts +68 -14
- package/src/core/agents/session-finalizer-v3.ts +2 -2
- package/src/core/agents/session-name-display.ts +78 -7
- package/src/core/agents/state/heartbeat-reader.ts +7 -0
- package/src/core/agents/state/heartbeat-writer.ts +23 -0
- package/src/core/agents/state/live-coordination-view.ts +5 -4
- package/src/core/agents/state/live-coordination-writer.ts +5 -0
- package/src/core/agents/state/names.ts +93 -6
- package/src/core/agents/state/stale-sweep.ts +22 -8
- package/src/core/agents/turn-elapsed.ts +135 -0
- package/src/core/artifacts/activity.ts +71 -0
- package/src/core/artifacts/constants.ts +1 -1
- package/src/core/artifacts/delivery-card.ts +375 -0
- package/src/core/artifacts/index.ts +728 -85
- package/src/core/artifacts/mutation-lock.ts +106 -0
- package/src/core/backup/host-snapshot.ts +76 -0
- package/src/core/config.ts +89 -13
- package/src/core/diagnostics/advice.ts +148 -120
- package/src/core/diagnostics/bundle.ts +257 -63
- package/src/core/diagnostics/comparison.ts +6 -2
- package/src/core/diagnostics/contract.ts +39 -42
- package/src/core/diagnostics/index.ts +2 -0
- package/src/core/diagnostics/pressure-contract.ts +294 -0
- package/src/core/diagnostics/pressure.ts +1361 -0
- package/src/core/diagnostics/replay.ts +116 -11
- package/src/core/events/v3/adapter-id.ts +12 -0
- package/src/core/events/v3/archive-retention.ts +3 -6
- package/src/core/events/v3/bootstrap.ts +173 -16
- package/src/core/events/v3/capabilities.ts +75 -25
- package/src/core/events/v3/capability-drift.ts +2 -2
- package/src/core/events/v3/control-witness.ts +172 -41
- package/src/core/events/v3/control.ts +34 -2
- package/src/core/events/v3/coordination-view.ts +100 -11
- package/src/core/events/v3/index.ts +3 -0
- package/src/core/events/v3/live-feed.ts +23 -5
- package/src/core/events/v3/live-routing.ts +14 -2
- package/src/core/events/v3/producers/command-recorder.ts +4 -4
- package/src/core/events/v3/producers/coordination-recorder.ts +4 -4
- package/src/core/events/v3/producers/hook-base.ts +21 -16
- package/src/core/events/v3/producers/hook.ts +21 -4
- package/src/core/events/v3/producers/intake.ts +15 -8
- package/src/core/events/v3/producers/producer-state-observer.ts +2 -1
- package/src/core/events/v3/producers/recorder.ts +361 -38
- package/src/core/events/v3/reader.ts +14 -13
- package/src/core/events/v3/runtime-build.ts +3 -2
- package/src/core/events/v3/runtime-telemetry-capabilities.ts +3 -3
- package/src/core/events/v3/turn-telemetry.ts +4 -4
- package/src/core/hooks/adapter/output.ts +50 -36
- package/src/core/hooks/backup-schedule.ts +147 -0
- package/src/core/hooks/cli.ts +200 -45
- package/src/core/hooks/codex-wsl-bridge.ts +21 -5
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/prompt-context/contract.ts +177 -0
- package/src/core/hooks/prompt-context/index.ts +22 -0
- package/src/core/hooks/prompt-context/runner.ts +303 -0
- package/src/core/hooks/resolve/transcript.ts +10 -3
- package/src/core/hooks/session-name-presence.ts +6 -1
- package/src/core/qa-artifacts.ts +152 -0
- package/src/core/resources/contract.ts +83 -3
- package/src/core/resources/index.ts +1 -0
- package/src/core/resources/native.ts +481 -0
- package/src/core/resources/sampler.ts +184 -7
- package/src/core/resources/status.ts +717 -0
- package/src/core/resources/system.ts +530 -0
- package/src/core/semantic/service.ts +37 -3
- package/src/core/storage/builtins.ts +41 -0
- package/src/core/supervisor/contract.ts +45 -3
- package/src/core/supervisor/findings.ts +159 -0
- package/src/core/supervisor/history.ts +15 -0
- package/src/core/supervisor/ledger-state.ts +0 -0
- package/src/core/supervisor/service.ts +133 -5
- package/src/core/supervisor/storage.ts +7 -0
- package/src/core/workflow/admission.ts +33 -17
- package/src/core/workflow/engine.ts +2 -2
- package/src/core/workflow/live-session-v3.ts +3 -8
- package/src/core/workflow/proof.ts +4 -3
- package/src/lib/admission.ts +347 -0
- package/src/lib/agent-browser/client.ts +2 -10
- package/src/lib/browser/capture-fidelity.ts +121 -0
- package/src/lib/browser/client.ts +258 -10
- package/src/lib/browser/critique.ts +62 -7
- package/src/lib/browser/index.ts +50 -0
- package/src/lib/browser/page-review-budget.ts +309 -0
- package/src/lib/browser/page-review-contracts.ts +129 -0
- package/src/lib/browser/page-review-evidence.ts +465 -0
- package/src/lib/browser/page-review-judge.ts +376 -0
- package/src/lib/browser/page-review-pack.ts +2522 -0
- package/src/lib/browser/page-review-source.ts +30 -0
- package/src/lib/browser/qa-run-contracts.ts +417 -10
- package/src/lib/browser/qa-run.ts +1057 -191
- package/src/lib/browser/qa-snapshot.ts +289 -48
- package/src/lib/browser/request-diagnostics.ts +27 -0
- package/src/lib/browser/review-capture-transaction.ts +106 -0
- package/src/lib/browser/standalone-html.ts +4 -2
- package/src/lib/browser/thumbnail-association.ts +190 -0
- package/src/lib/browser/tiling.ts +95 -0
- package/src/lib/cookies/client.ts +228 -42
- package/src/lib/cookies/extra.ts +28 -0
- package/src/lib/cookies/index.ts +2 -0
- package/src/lib/docs-metadata-managed.ts +4 -1
- package/src/lib/durable-job.ts +407 -0
- package/src/lib/http/client.ts +13 -1
- package/src/lib/identities/assume.ts +12 -4
- package/src/lib/instructions/templates.ts +6 -2
- package/src/lib/local-file-url.ts +17 -2
- package/src/lib/tunnel/state.ts +70 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS1E,OAAO,EAGL,qBAAqB,EAMtB,MAAM,yBAAyB,CAAC;AAejC,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,wCAAwC,CAAC;AAMhD,OAAO,EAGL,KAAK,SAAS,EAEf,MAAM,0CAA0C,CAAC;AAiBlD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AA8FjE;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,CAErF;AAgFD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AASjC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,cAAc,CAAC,EAAE,qBAAqB,EACtC,OAAO,SAAmB,GACzB,IAAI,CAgWN;AAgXD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAyO7D;AA60CD,KAAK,mBAAmB,GAAG;IACzB,W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,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,KAAK,SAAa,EAClB,QAAQ,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,qBAAqB,EAA6B,EAC9E,gBAAgB,SAAwB,GACvC,wBAAwB,CA0C1B;AAED,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAEhF,wFAAwF;AACxF,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAC,EACrD,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,mBAAmB,GAAG,IAAI,CAO5B"}
|
package/dist/commands/agents.js
CHANGED
|
@@ -21,6 +21,7 @@ import { checkGitFinalization, formatGitFinalizationFailure, readSessionWriteCla
|
|
|
21
21
|
import { emitEventV3, monorepoRoot, nativeSessionIdentity, normalizeAdapter, resolveOwner, resolveOwnerBySessionEnv, resolveOwnerWithSource, sessionIdentityFromEnv, } from "../core/agents/index.js";
|
|
22
22
|
import { bootstrapLiveCoordinationAuthorityV3, LiveCoordinationAuthorityV3Error, reopenLiveCoordinationGenerationV3, } from "../core/agents/live-authority-v3.js";
|
|
23
23
|
import { isAddressableName, MailboxCapacityError, queueMailboxMessage, suggestNames, } from "../core/agents/mailbox.js";
|
|
24
|
+
import { qaSignalStatusRow } from "../core/agents/qa-signal.js";
|
|
24
25
|
import { reconcileCoordinationV3 } from "../core/agents/reconcile-coordination-v3.js";
|
|
25
26
|
import { listSessionFinalizationRequestsV3, observeHostDisappearedV3, reconcileSessionFinalizationV3, requestSessionEndExplicitV3, } from "../core/agents/session-finalizer-v3.js";
|
|
26
27
|
import { SESSION_NAME_DISPLAY_NOTE, sessionNameDisplayPending, } from "../core/agents/session-name-display.js";
|
|
@@ -28,9 +29,11 @@ import { agentDisplayName } from "../core/agents/state/activity-log.js";
|
|
|
28
29
|
import { buildLifecycleSuggestedName, buildSuggestedName, readHeartbeat as readHeartbeatCache, } from "../core/agents/state/heartbeat-writer.js";
|
|
29
30
|
import { readLiveCoordinationRow, readLiveCoordinationRows, } from "../core/agents/state/live-coordination-view.js";
|
|
30
31
|
import { foldSessionState, } from "../core/agents/state/session-state.js";
|
|
32
|
+
import { turnElapsedStatusRow } from "../core/agents/turn-elapsed.js";
|
|
31
33
|
import { coordFreshnessSeconds, resolveBinName, sessionFinalizationConfig, } from "../core/config.js";
|
|
34
|
+
import { EVENT_ADAPTER_IDS_V3 } from "../core/events/v3/adapter-id.js";
|
|
32
35
|
import { readEventV3ControlState } from "../core/events/v3/control.js";
|
|
33
|
-
import { projectCoordinationViewV3 } from "../core/events/v3/coordination-view.js";
|
|
36
|
+
import { projectCoordinationViewV3, readCoordinationViewV3, } from "../core/events/v3/coordination-view.js";
|
|
34
37
|
import { liveInstanceIdV3 } from "../core/events/v3/live-routing.js";
|
|
35
38
|
import { countSummarizedSinceV3, listDiagnosticSummariesV3, } from "../core/events/v3/producers/diagnostic-summaries.js";
|
|
36
39
|
import { listHookIntakeGroupsV3, listHookIntakeRecordsV3, } from "../core/events/v3/producers/intake.js";
|
|
@@ -40,6 +43,7 @@ import { EVENT_V3_LEDGER_RELATIVE_ROOT } from "../core/events/v3/writer.js";
|
|
|
40
43
|
import { evaluateRunQualityIfDue } from "../core/guard/index.js";
|
|
41
44
|
import { readRuntimeContextTelemetry, readRuntimeContextUsage, } from "../core/hooks/adapter/runtime-telemetry.js";
|
|
42
45
|
import { readRemoteMachines } from "../core/presence/index.js";
|
|
46
|
+
import { formatResourceSummary, readResourceStatus } from "../core/resources/status.js";
|
|
43
47
|
import { registerContextCommand } from "./context.js";
|
|
44
48
|
function readCurrentCoordinationRow(instanceId) {
|
|
45
49
|
const root = monorepoRoot();
|
|
@@ -118,6 +122,8 @@ function formatPlatformLabel(platform) {
|
|
|
118
122
|
return "Cursor";
|
|
119
123
|
if (platform === "codex")
|
|
120
124
|
return "Codex";
|
|
125
|
+
if (platform === "openclaw")
|
|
126
|
+
return "OpenClaw";
|
|
121
127
|
return "CC";
|
|
122
128
|
}
|
|
123
129
|
function activityOf(hb) {
|
|
@@ -366,7 +372,7 @@ function runEndSession(opts) {
|
|
|
366
372
|
return failCommand("session_identity_missing", "could not resolve the current session; pass --session-id or --instance-id");
|
|
367
373
|
}
|
|
368
374
|
const byInstance = listHookProducerStateRecordsV3(root, { includeTerminal: false }).filter(({ state }) => state.instance_id === target);
|
|
369
|
-
const byNative =
|
|
375
|
+
const byNative = EVENT_ADAPTER_IDS_V3.flatMap((adapter) => {
|
|
370
376
|
const state = readHookProducerStateV3(root, adapter, target);
|
|
371
377
|
return state && !state.terminal ? [{ path: "", modified_at_ms: 0, state }] : [];
|
|
372
378
|
});
|
|
@@ -456,8 +462,8 @@ function runObserveArchive(opts) {
|
|
|
456
462
|
const root = monorepoRoot();
|
|
457
463
|
if (!root)
|
|
458
464
|
return failCommand("not_in_repo", "not in an agent session");
|
|
459
|
-
if (!
|
|
460
|
-
return failCommand("invalid_adapter", "adapter must be claude-code, codex, or
|
|
465
|
+
if (!EVENT_ADAPTER_IDS_V3.includes(opts.adapter)) {
|
|
466
|
+
return failCommand("invalid_adapter", "adapter must be claude-code, codex, cursor, or openclaw");
|
|
461
467
|
}
|
|
462
468
|
const adapter = opts.adapter;
|
|
463
469
|
const observedAt = opts.observedAt ?? new Date().toISOString();
|
|
@@ -1806,11 +1812,24 @@ function runStatus(opts) {
|
|
|
1806
1812
|
catch {
|
|
1807
1813
|
/* non-fatal: status box should not fail on council errors */
|
|
1808
1814
|
}
|
|
1815
|
+
// Latest page-QA verdict for this session, with the RUNNER's clock. Session
|
|
1816
|
+
// age is not QA time; without this row an operator reads "session 58m" as if
|
|
1817
|
+
// the QA run took 58 minutes. Best-effort by contract — no pointer, a
|
|
1818
|
+
// malformed one, or any read failure renders no row.
|
|
1819
|
+
const qaSignal = qaSignalStatusRow({ coordRoot: root, instanceId: hb.instance_id });
|
|
1820
|
+
// Duration of the turn this box closes. `session` is cumulative, so without
|
|
1821
|
+
// this row an operator cannot tell a twelve-second turn from an eight-minute
|
|
1822
|
+
// one inside the same session. Best-effort by contract — no turn evidence,
|
|
1823
|
+
// no row.
|
|
1824
|
+
const turnElapsed = turnElapsedStatusRow({ coordRoot: root, instanceId: hb.instance_id });
|
|
1825
|
+
const resources = readResourceStatus(root);
|
|
1809
1826
|
const data = {
|
|
1810
1827
|
name: displayName,
|
|
1811
1828
|
instance_id: hb.instance_id,
|
|
1812
1829
|
kind: normalizeKind(hb.kind),
|
|
1813
1830
|
session_age_secs: ageSecs,
|
|
1831
|
+
turn_elapsed_secs: turnElapsed ? turnElapsed.elapsed.secs : null,
|
|
1832
|
+
turn_complete: turnElapsed ? turnElapsed.elapsed.complete : null,
|
|
1814
1833
|
activity: activityOf(hb),
|
|
1815
1834
|
activity_updated_at: hb.activity_updated_at ?? null,
|
|
1816
1835
|
activity_source: hb.activity_source ?? null,
|
|
@@ -1838,11 +1857,13 @@ function runStatus(opts) {
|
|
|
1838
1857
|
})),
|
|
1839
1858
|
})),
|
|
1840
1859
|
pending_councils: pendingCouncils,
|
|
1860
|
+
resources,
|
|
1841
1861
|
context_used: ctxUsage && "used" in ctxUsage ? ctxUsage.used : null,
|
|
1842
1862
|
context_window: ctxUsage && "window" in ctxUsage ? ctxUsage.window : null,
|
|
1843
1863
|
timestamp_iso: new Date().toISOString(),
|
|
1844
1864
|
timestamp_local: timeStr,
|
|
1845
1865
|
...(quality ? { quality } : {}),
|
|
1866
|
+
...(qaSignal ? { qa: qaSignal.pointer } : {}),
|
|
1846
1867
|
...(finalization ? { finalization } : {}),
|
|
1847
1868
|
...(sessionEnd ? { session_end: sessionEnd } : {}),
|
|
1848
1869
|
};
|
|
@@ -1853,16 +1874,20 @@ function runStatus(opts) {
|
|
|
1853
1874
|
}
|
|
1854
1875
|
const rows = [
|
|
1855
1876
|
["session", formatAge(ageSecs)],
|
|
1877
|
+
...(turnElapsed ? [["turn", turnElapsed.value]] : []),
|
|
1856
1878
|
["activity", activityOf(hb)],
|
|
1857
1879
|
["lifecycle", lifecycleLabel(hb)],
|
|
1858
1880
|
["context", ctxStr],
|
|
1881
|
+
["resources", formatResourceSummary(resources)],
|
|
1859
1882
|
["files", filesStr],
|
|
1860
1883
|
["peers", peersStr],
|
|
1861
1884
|
["time", timeStr],
|
|
1862
1885
|
];
|
|
1863
|
-
// Task gets full text; formatBox word-wraps to MAX_BOX_CONTENT_WIDTH.
|
|
1886
|
+
// Task gets full text; formatBox word-wraps to MAX_BOX_CONTENT_WIDTH. It sits
|
|
1887
|
+
// directly above `activity`, which keeps it under the session/turn clocks
|
|
1888
|
+
// whether or not the turn row rendered.
|
|
1864
1889
|
if (hb.task && hb.task.length > 0) {
|
|
1865
|
-
rows.splice(
|
|
1890
|
+
rows.splice(rows.findIndex((row) => row[0] === "activity"), 0, ["task", hb.task]);
|
|
1866
1891
|
}
|
|
1867
1892
|
if (pendingCouncils.length > 0) {
|
|
1868
1893
|
// Slot the council line right before `time` so it stays in the "what's
|
|
@@ -1878,6 +1903,10 @@ function runStatus(opts) {
|
|
|
1878
1903
|
const idx = rows.findIndex((row) => row[0] === "time");
|
|
1879
1904
|
rows.splice(idx, 0, ["quality", formatRunQuality(quality.status, quality.signal_ids)]);
|
|
1880
1905
|
}
|
|
1906
|
+
if (qaSignal) {
|
|
1907
|
+
const idx = rows.findIndex((row) => row[0] === "time");
|
|
1908
|
+
rows.splice(idx, 0, ["qa", qaSignal.value]);
|
|
1909
|
+
}
|
|
1881
1910
|
if (sessionEnd) {
|
|
1882
1911
|
const idx = rows.findIndex((row) => row[0] === "time");
|
|
1883
1912
|
rows.splice(idx, 0, [
|
|
@@ -2089,6 +2118,8 @@ function adapterToPlatform(adapter) {
|
|
|
2089
2118
|
return "cursor";
|
|
2090
2119
|
if (adapter === "codex")
|
|
2091
2120
|
return "codex";
|
|
2121
|
+
if (adapter === "openclaw")
|
|
2122
|
+
return "openclaw";
|
|
2092
2123
|
return "unknown";
|
|
2093
2124
|
}
|
|
2094
2125
|
/** Project a canonical health.* event into the HealEvent shape the aggregators
|
|
@@ -2485,6 +2516,46 @@ export function collectEventLedgerHealthV3(root, nowMs = Date.now()) {
|
|
|
2485
2516
|
catch (error) {
|
|
2486
2517
|
collectionErrors.push(`diagnostic summaries unreadable: ${errorText(error)}`);
|
|
2487
2518
|
}
|
|
2519
|
+
let coordinationAuthority = {
|
|
2520
|
+
safe: false,
|
|
2521
|
+
global_diagnostics: 0,
|
|
2522
|
+
isolated_diagnostics: 0,
|
|
2523
|
+
affected_generations: [],
|
|
2524
|
+
codes: [],
|
|
2525
|
+
};
|
|
2526
|
+
try {
|
|
2527
|
+
const view = readCoordinationViewV3(root);
|
|
2528
|
+
const globalDiagnostics = view.global_diagnostics.filter((diagnostic) => diagnostic.authority_blocking);
|
|
2529
|
+
const isolatedDiagnostics = new Map();
|
|
2530
|
+
const affectedGenerations = [];
|
|
2531
|
+
for (const [generationId, diagnostics] of Object.entries(view.diagnostics_by_generation)) {
|
|
2532
|
+
const blocking = diagnostics.filter((diagnostic) => diagnostic.authority_blocking);
|
|
2533
|
+
if (blocking.length === 0)
|
|
2534
|
+
continue;
|
|
2535
|
+
affectedGenerations.push(generationId);
|
|
2536
|
+
for (const diagnostic of blocking) {
|
|
2537
|
+
isolatedDiagnostics.set([
|
|
2538
|
+
diagnostic.code,
|
|
2539
|
+
diagnostic.source_code ?? "",
|
|
2540
|
+
diagnostic.event_id ?? "",
|
|
2541
|
+
diagnostic.generation_id ?? "",
|
|
2542
|
+
diagnostic.subject_instance_id ?? "",
|
|
2543
|
+
].join("\0"), diagnostic);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
coordinationAuthority = {
|
|
2547
|
+
safe: view.authority_safe,
|
|
2548
|
+
global_diagnostics: globalDiagnostics.length,
|
|
2549
|
+
isolated_diagnostics: isolatedDiagnostics.size,
|
|
2550
|
+
affected_generations: affectedGenerations.sort(),
|
|
2551
|
+
codes: [
|
|
2552
|
+
...new Set([...globalDiagnostics, ...isolatedDiagnostics.values()].map((diagnostic) => diagnostic.source_code ?? diagnostic.code)),
|
|
2553
|
+
].sort(),
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
catch (error) {
|
|
2557
|
+
collectionErrors.push(`coordination authority unreadable: ${errorText(error)}`);
|
|
2558
|
+
}
|
|
2488
2559
|
return {
|
|
2489
2560
|
state: "live",
|
|
2490
2561
|
mode: control.state,
|
|
@@ -2508,6 +2579,7 @@ export function collectEventLedgerHealthV3(root, nowMs = Date.now()) {
|
|
|
2508
2579
|
recent_by_category: recentByCategory,
|
|
2509
2580
|
mitigation_fail_open: mitigationFailOpen,
|
|
2510
2581
|
},
|
|
2582
|
+
coordination_authority: coordinationAuthority,
|
|
2511
2583
|
span_pressure: spanPressure,
|
|
2512
2584
|
collection_errors: collectionErrors,
|
|
2513
2585
|
};
|
|
@@ -3181,6 +3253,13 @@ function runHealth(opts) {
|
|
|
3181
3253
|
findings.push(`stop-hook remediation cap exhausted ${stopRemediation.total}x in ${opts.since}${who}; these sessions ended turns without the end-of-turn ritual — check why their evidence never lands`);
|
|
3182
3254
|
}
|
|
3183
3255
|
if (eventLedger.state === "live") {
|
|
3256
|
+
const authority = eventLedger.coordination_authority;
|
|
3257
|
+
if (authority.global_diagnostics > 0) {
|
|
3258
|
+
findings.push(`${authority.global_diagnostics} global coordination authority diagnostic(s): ${authority.codes.join(", ")}`);
|
|
3259
|
+
}
|
|
3260
|
+
if (authority.isolated_diagnostics > 0) {
|
|
3261
|
+
findings.push(`${authority.isolated_diagnostics} coordination authority diagnostic(s) isolated to ${authority.affected_generations.length} generation(s): ${authority.codes.join(", ")}`);
|
|
3262
|
+
}
|
|
3184
3263
|
// Open spans whose generation has no open turn: the turn ended without its
|
|
3185
3264
|
// tool spans closing, so an explicit end can only queue, never finalize.
|
|
3186
3265
|
const orphanGenerations = eventLedger.open_spans.generations.filter((generation) => !generation.turn_open);
|
|
@@ -3298,6 +3377,7 @@ function renderHealthBox(report) {
|
|
|
3298
3377
|
.map((request) => request.age_ms < 0 ? "age?" : formatAge(Math.floor(request.age_ms / 1000)))
|
|
3299
3378
|
.join(", ");
|
|
3300
3379
|
ledgerStr = [
|
|
3380
|
+
`authority ${ledger.coordination_authority.safe ? "safe" : "unsafe"}${ledger.coordination_authority.isolated_diagnostics > 0 ? ` (${ledger.coordination_authority.isolated_diagnostics} isolated)` : ""}`,
|
|
3301
3381
|
`open spans ${ledger.open_spans.total}${orphanGenerations > 0 ? ` (${orphanGenerations} gen turn-closed)` : ""}`,
|
|
3302
3382
|
`pending ends ${ledger.pending_finalizations.length}${pendingAges ? ` (${pendingAges})` : ""}`,
|
|
3303
3383
|
`intake ${ledger.intake_spool.total}`,
|
|
@@ -3963,11 +4043,15 @@ function runHeal(opts) {
|
|
|
3963
4043
|
}
|
|
3964
4044
|
const currentRow = readLiveCoordinationRow(root, owner);
|
|
3965
4045
|
const inferredAdapter = normalizeAdapter(opts.adapter?.trim() || currentRow?.platform || commandSessionBootstrap()?.adapter);
|
|
4046
|
+
if (inferredAdapter === "openclaw") {
|
|
4047
|
+
emitHealFailure("unsupported_adapter", "coordination cache healing is unavailable for observer-only OpenClaw generations");
|
|
4048
|
+
}
|
|
4049
|
+
const healAdapter = inferredAdapter;
|
|
3966
4050
|
const sessionId = opts.sessionId?.trim() ||
|
|
3967
4051
|
(currentSessionRepair ? sessionIdentityFromEnv() : null) ||
|
|
3968
4052
|
nativeSessionIdentity(currentRow, owner);
|
|
3969
4053
|
if (kind === "cache") {
|
|
3970
|
-
const refusal = cacheHealAuthorityRefusal(root, owner, sessionId,
|
|
4054
|
+
const refusal = cacheHealAuthorityRefusal(root, owner, sessionId, healAdapter, currentRow);
|
|
3971
4055
|
if (refusal) {
|
|
3972
4056
|
emitHealFailure(refusal.reason, refusal.message);
|
|
3973
4057
|
}
|
|
@@ -4062,7 +4146,7 @@ function runHeal(opts) {
|
|
|
4062
4146
|
});
|
|
4063
4147
|
}
|
|
4064
4148
|
if (proc.status !== 0) {
|
|
4065
|
-
emitHealFailure(healFailureReason(root, owner, sessionId,
|
|
4149
|
+
emitHealFailure(healFailureReason(root, owner, sessionId, healAdapter), spawnFailureMessage(proc, `agent-coord ${action}`));
|
|
4066
4150
|
}
|
|
4067
4151
|
// Read the derived cache to surface post-action state.
|
|
4068
4152
|
let after = null;
|
|
@@ -4163,7 +4247,7 @@ function missingAuthorityForCurrentSessionBootstrap(root, owner, sessionId) {
|
|
|
4163
4247
|
if (readLiveCoordinationRow(root, owner))
|
|
4164
4248
|
return false;
|
|
4165
4249
|
try {
|
|
4166
|
-
const nativeSessionHasProducer =
|
|
4250
|
+
const nativeSessionHasProducer = EVENT_ADAPTER_IDS_V3.some((adapter) => readHookProducerStateV3(root, adapter, sessionId) !== undefined);
|
|
4167
4251
|
if (nativeSessionHasProducer)
|
|
4168
4252
|
return false;
|
|
4169
4253
|
const instanceId = liveInstanceIdV3(owner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAkC1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAqSN"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { monorepoRoot, resolveOwner } from "../core/agents/index.js";
|
|
2
2
|
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.js";
|
|
3
|
-
import { adoptUnmanagedArtifactFiles, cleanArtifacts, createArtifact, inventoryArtifacts, releaseArtifact, renewArtifact, showArtifact, } from "../core/artifacts/index.js";
|
|
4
|
-
import { artifactDefaultRetentionDays, coordFreshnessSeconds } from "../core/config.js";
|
|
3
|
+
import { adoptUnmanagedArtifactFiles, artifactCapabilities, artifactReviewGuidance, artifactsRoot, autoCleanArtifacts, cleanArtifacts, createArtifact, discardArtifact, holdArtifact, inventoryArtifacts, migrateArtifacts, parseArtifactDeliverySpec, releaseArtifact, renderArtifactDeliveryCard, renewArtifact, repairArtifactActivity, resolveArtifactDeliveryManifest, showArtifact, unholdArtifact, writeArtifactDeliveryManifest, } from "../core/artifacts/index.js";
|
|
4
|
+
import { artifactDefaultRetentionDays, coordFreshnessSeconds, reviewPackAutoCleanEnabled, } from "../core/config.js";
|
|
5
|
+
import { deleteExpiredPacks } from "../lib/browser/page-review-pack.js";
|
|
5
6
|
export function registerArtifactsCommand(program, emit, context) {
|
|
6
7
|
const root = program
|
|
7
8
|
.command("artifacts")
|
|
@@ -12,26 +13,45 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
12
13
|
.description("Create one managed artifact workspace and print its path.")
|
|
13
14
|
.requiredOption("--purpose <text>", "What the files are for")
|
|
14
15
|
.option("--days <n>", "Retention in days (default from artifacts.default_retention_days)")
|
|
16
|
+
.option("--minutes <n>", "Retention in minutes; cannot be combined with --days")
|
|
15
17
|
.option("--big", "Acknowledge that this workspace may exceed the per-bundle size ceiling")
|
|
18
|
+
.option("--hold <id>", "Create the workspace with this hold already present")
|
|
19
|
+
.option("--hold-reason <text>", "Why the initial hold is required")
|
|
20
|
+
.option("--actor <instance-id>", "Stable owner identity for the initial hold")
|
|
16
21
|
.action((slug, opts) => {
|
|
17
22
|
run(emit, () => {
|
|
18
23
|
const repoRoot = requireRepoRoot(context);
|
|
19
|
-
|
|
24
|
+
if (opts.days !== undefined && opts.minutes !== undefined)
|
|
25
|
+
throw new Error("choose either --days or --minutes");
|
|
26
|
+
const actor = opts.actor ? { instance_id: opts.actor } : currentActor(repoRoot);
|
|
27
|
+
if (!!opts.hold !== !!opts.holdReason)
|
|
28
|
+
throw new Error("--hold and --hold-reason must be used together");
|
|
20
29
|
const retentionDays = opts.days
|
|
21
30
|
? parseDays(opts.days)
|
|
22
31
|
: artifactDefaultRetentionDays(repoRoot);
|
|
32
|
+
const retentionMinutes = opts.minutes === undefined ? undefined : parseMinutes(opts.minutes);
|
|
33
|
+
try {
|
|
34
|
+
autoCleanArtifacts(repoRoot);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
emit.log(`artifact cleanup skipped: ${error instanceof Error ? error.message : String(error)}`, "warn");
|
|
38
|
+
}
|
|
23
39
|
const created = createArtifact(repoRoot, {
|
|
24
40
|
slug,
|
|
25
41
|
purpose: opts.purpose,
|
|
26
42
|
retentionDays,
|
|
43
|
+
retentionMinutes,
|
|
27
44
|
actor,
|
|
28
45
|
big: opts.big,
|
|
46
|
+
holds: opts.hold ? [{ id: opts.hold, reason: opts.holdReason }] : [],
|
|
29
47
|
});
|
|
30
48
|
emit.data({
|
|
31
49
|
path: created.path,
|
|
32
50
|
artifact_id: created.manifest.artifact_id,
|
|
33
51
|
expires_at: created.manifest.retention.expires_at,
|
|
34
52
|
owner_instance_id: actor?.instance_id ?? null,
|
|
53
|
+
holds: created.manifest.holds,
|
|
54
|
+
after_review: artifactReviewGuidance(repoRoot, created.manifest.artifact_id),
|
|
35
55
|
});
|
|
36
56
|
});
|
|
37
57
|
});
|
|
@@ -79,15 +99,53 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
79
99
|
}));
|
|
80
100
|
});
|
|
81
101
|
});
|
|
102
|
+
root
|
|
103
|
+
.command("delivery-card <ref>")
|
|
104
|
+
.description("Discover or curate a reproducible Markdown delivery card for one artifact.")
|
|
105
|
+
.option("--title <text>", "Card heading")
|
|
106
|
+
.option("--url <label=url>", "Add a web destination; repeatable", collect, [])
|
|
107
|
+
.option("--path <label=path>", "Add an artifact-relative file or directory; repeatable", collect, [])
|
|
108
|
+
.action((ref, opts) => {
|
|
109
|
+
run(emit, () => {
|
|
110
|
+
const repoRoot = requireRepoRoot(context);
|
|
111
|
+
const suppliedItems = [
|
|
112
|
+
...opts.url.map((spec) => parseArtifactDeliverySpec("url", spec)),
|
|
113
|
+
...opts.path.map((spec) => parseArtifactDeliverySpec("path", spec)),
|
|
114
|
+
];
|
|
115
|
+
let manifest;
|
|
116
|
+
if (suppliedItems.length > 0) {
|
|
117
|
+
manifest = writeArtifactDeliveryManifest(repoRoot, ref, {
|
|
118
|
+
title: opts.title ?? "Delivery",
|
|
119
|
+
items: suppliedItems,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
manifest = resolveArtifactDeliveryManifest(repoRoot, ref);
|
|
124
|
+
if (opts.title !== undefined) {
|
|
125
|
+
manifest = writeArtifactDeliveryManifest(repoRoot, ref, {
|
|
126
|
+
title: opts.title,
|
|
127
|
+
items: manifest.items,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
emit.text(renderArtifactDeliveryCard(repoRoot, ref, manifest).markdown);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
82
134
|
root
|
|
83
135
|
.command("renew <ref>")
|
|
84
136
|
.description("Set a new retention window. Renewal does not mark the artifact active.")
|
|
85
|
-
.
|
|
137
|
+
.option("--days <n>", "Days from now; choose either --days or --minutes")
|
|
138
|
+
.option("--minutes <n>", "Minutes from now; choose either --days or --minutes")
|
|
86
139
|
.requiredOption("--reason <text>", "Why the extra retention is needed")
|
|
87
140
|
.action((ref, opts) => {
|
|
88
141
|
run(emit, () => {
|
|
89
142
|
const repoRoot = requireRepoRoot(context);
|
|
90
|
-
|
|
143
|
+
if ((opts.days === undefined) === (opts.minutes === undefined))
|
|
144
|
+
throw new Error("choose exactly one of --days or --minutes");
|
|
145
|
+
const duration = opts.minutes === undefined
|
|
146
|
+
? parseDays(opts.days)
|
|
147
|
+
: { minutes: parseMinutes(opts.minutes) };
|
|
148
|
+
const manifest = renewArtifact(repoRoot, ref, duration, opts.reason, {
|
|
91
149
|
actor: currentActor(repoRoot),
|
|
92
150
|
});
|
|
93
151
|
emit.data(manifest);
|
|
@@ -99,9 +157,66 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
99
157
|
.action((ref) => {
|
|
100
158
|
run(emit, () => {
|
|
101
159
|
const repoRoot = requireRepoRoot(context);
|
|
102
|
-
|
|
160
|
+
const manifest = releaseArtifact(repoRoot, ref, { actor: currentActor(repoRoot) });
|
|
161
|
+
emit.data({
|
|
162
|
+
...manifest,
|
|
163
|
+
after_review: artifactReviewGuidance(repoRoot, manifest.artifact_id),
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
root
|
|
168
|
+
.command("discard <ref>")
|
|
169
|
+
.description("Retire reviewed, disposable files after a grace period; deletes nothing now.")
|
|
170
|
+
.option("--minutes <n>", "Grace period in minutes; never extends an earlier expiry", "60")
|
|
171
|
+
.requiredOption("--reason <text>", "Why these reviewed files are no longer needed")
|
|
172
|
+
.action((ref, opts) => {
|
|
173
|
+
run(emit, () => {
|
|
174
|
+
const repoRoot = requireRepoRoot(context);
|
|
175
|
+
const manifest = discardArtifact(repoRoot, ref, opts.reason, {
|
|
176
|
+
minutes: parseMinutes(opts.minutes),
|
|
177
|
+
actor: currentActor(repoRoot),
|
|
178
|
+
});
|
|
179
|
+
emit.data({ manifest, entry: showArtifact(repoRoot, ref).entry, deleted: false });
|
|
103
180
|
});
|
|
104
181
|
});
|
|
182
|
+
root
|
|
183
|
+
.command("capabilities")
|
|
184
|
+
.description("Report artifact schema and hold capabilities for embedding clients.")
|
|
185
|
+
.option("--json", "Emit the capability document as JSON")
|
|
186
|
+
.action(() => emit.data(artifactCapabilities()));
|
|
187
|
+
root
|
|
188
|
+
.command("migrate")
|
|
189
|
+
.description("Preview the explicit v1 to v2 manifest migration, preserving preimages.")
|
|
190
|
+
.option("--yes", "Apply the migration to valid v1 manifests")
|
|
191
|
+
.action((opts) => run(emit, () => emit.data({ rows: migrateArtifacts(requireRepoRoot(context), opts) })));
|
|
192
|
+
root
|
|
193
|
+
.command("repair-activity")
|
|
194
|
+
.description("Preview retention corrections for unchanged, preimage-backed v1 migrations.")
|
|
195
|
+
.option("--yes", "Record verified activity corrections with preimage receipts; deletes no files")
|
|
196
|
+
.action((opts) => run(emit, () => emit.data({ rows: repairArtifactActivity(requireRepoRoot(context), opts) })));
|
|
197
|
+
root
|
|
198
|
+
.command("hold <ref>")
|
|
199
|
+
.description("Protect an artifact from cleanup until its owner removes this exact hold.")
|
|
200
|
+
.requiredOption("--id <id>", "Unique hold id within this artifact")
|
|
201
|
+
.requiredOption("--reason <text>", "Why cleanup must retain these files")
|
|
202
|
+
.option("--actor <instance-id>", "Stable hold owner; defaults to the current agent")
|
|
203
|
+
.action((ref, opts) => run(emit, () => {
|
|
204
|
+
const repoRoot = requireRepoRoot(context);
|
|
205
|
+
emit.data(holdArtifact(repoRoot, ref, {
|
|
206
|
+
id: opts.id,
|
|
207
|
+
reason: opts.reason,
|
|
208
|
+
actor: requireHoldActor(repoRoot, opts.actor),
|
|
209
|
+
}));
|
|
210
|
+
}));
|
|
211
|
+
root
|
|
212
|
+
.command("unhold <ref>")
|
|
213
|
+
.description("Remove one exact hold belonging to the supplied owner.")
|
|
214
|
+
.requiredOption("--id <id>", "Exact hold id to remove")
|
|
215
|
+
.option("--actor <instance-id>", "Stable hold owner; defaults to the current agent")
|
|
216
|
+
.action((ref, opts) => run(emit, () => {
|
|
217
|
+
const repoRoot = requireRepoRoot(context);
|
|
218
|
+
emit.data(unholdArtifact(repoRoot, ref, opts.id, { actor: requireHoldActor(repoRoot, opts.actor) }));
|
|
219
|
+
}));
|
|
105
220
|
root
|
|
106
221
|
.command("clean")
|
|
107
222
|
.description("Preview expired artifact deletion; pass --yes to delete.")
|
|
@@ -113,10 +228,23 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
113
228
|
yes: opts.yes,
|
|
114
229
|
freshnessSeconds: coordFreshnessSeconds(repoRoot),
|
|
115
230
|
});
|
|
116
|
-
|
|
231
|
+
const reviewPacks = reviewPackAutoCleanEnabled(repoRoot)
|
|
232
|
+
? deleteExpiredPacks({ roots: [artifactsRoot(repoRoot)], dryRun: !opts.yes })
|
|
233
|
+
: undefined;
|
|
234
|
+
emit.data({
|
|
235
|
+
rows,
|
|
236
|
+
meta: summarize(rows),
|
|
237
|
+
...(reviewPacks ? { review_packs: reviewPacks } : {}),
|
|
238
|
+
});
|
|
117
239
|
});
|
|
118
240
|
});
|
|
119
241
|
}
|
|
242
|
+
function requireHoldActor(repoRoot, explicit) {
|
|
243
|
+
const actor = explicit ? { instance_id: explicit } : currentActor(repoRoot);
|
|
244
|
+
if (!actor)
|
|
245
|
+
throw new Error("hold operations require --actor or a current agent identity");
|
|
246
|
+
return actor;
|
|
247
|
+
}
|
|
120
248
|
function currentActor(repoRoot) {
|
|
121
249
|
const instanceId = resolveOwner();
|
|
122
250
|
if (!instanceId)
|
|
@@ -141,6 +269,15 @@ function parseDays(value) {
|
|
|
141
269
|
}
|
|
142
270
|
return parsed;
|
|
143
271
|
}
|
|
272
|
+
function parseMinutes(value) {
|
|
273
|
+
const parsed = Number(value);
|
|
274
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 5256000)
|
|
275
|
+
throw new Error("--minutes must be between 1 and 5256000");
|
|
276
|
+
return parsed;
|
|
277
|
+
}
|
|
278
|
+
function collect(value, previous) {
|
|
279
|
+
return [...previous, value];
|
|
280
|
+
}
|
|
144
281
|
function summarize(rows) {
|
|
145
282
|
const classifications = {};
|
|
146
283
|
for (const row of rows) {
|
|
@@ -19,5 +19,21 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { Command } from "commander";
|
|
21
21
|
import type { EmitContext } from "../commander.js";
|
|
22
|
+
import { type BackupConfig } from "../core/config.js";
|
|
23
|
+
import type { HarneryStorageClass } from "../core/storage/contract.js";
|
|
24
|
+
export { hostSnapshotCachePath, newestSnapshotTime, parseBackupDuration, readHostSnapshotCache, } from "../core/backup/host-snapshot.js";
|
|
25
|
+
export declare const DEFAULT_BACKUP_MAX_BYTES: number;
|
|
26
|
+
export declare const DEFAULT_BACKUP_CLASSES: Set<HarneryStorageClass>;
|
|
27
|
+
export declare const DEFAULT_BACKUP_EXCLUDED_CLASSES: Set<HarneryStorageClass>;
|
|
28
|
+
export declare const DEFAULT_BACKUP_EXCLUDED_FAMILY_IDS: Set<string>;
|
|
29
|
+
export interface BackupSelection {
|
|
30
|
+
targets: readonly string[];
|
|
31
|
+
familyIds: readonly string[];
|
|
32
|
+
}
|
|
33
|
+
export declare function resolveBackupSelection(projectRoot: string, config?: BackupConfig, includeArtifacts?: boolean): BackupSelection;
|
|
34
|
+
export declare function backupCatalogCoverage(projectRoot: string): {
|
|
35
|
+
uncovered: readonly string[];
|
|
36
|
+
};
|
|
37
|
+
export declare function selectedLogicalBytes(targets: readonly string[]): number;
|
|
22
38
|
export declare function registerBackupCommand(program: Command, emit: EmitContext): void;
|
|
23
39
|
//# sourceMappingURL=backup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/commands/backup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/commands/backup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAeH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAMnD,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,wBAAwB,QAAqB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,0BAIjC,CAAC;AACH,eAAO,MAAM,+BAA+B,0BAK1C,CAAC;AACH,eAAO,MAAM,kCAAkC,aAU7C,CAAC;AAkDH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,YAAwC,EAChD,gBAAgB,UAAQ,GACvB,eAAe,CAmCjB;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG;IAC1D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAmBA;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAqBvE;AAmGD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CA2Q/E"}
|