harnery 0.38.0 → 0.40.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/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +32 -8
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +97 -6
- 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.d.ts +8 -0
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +466 -231
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +6 -3
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +20 -4
- package/dist/commands/qa-run.d.ts.map +1 -1
- package/dist/commands/qa-run.js +26 -3
- package/dist/commands/qa-status.d.ts.map +1 -1
- package/dist/commands/qa-status.js +7 -2
- package/dist/commands/resources.d.ts.map +1 -1
- package/dist/commands/resources.js +23 -3
- package/dist/commands/review-pack.d.ts.map +1 -1
- package/dist/commands/review-pack.js +98 -23
- 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 +13 -6
- 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/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/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 +2 -1
- package/dist/core/agents/state/names.d.ts +35 -2
- package/dist/core/agents/state/names.d.ts.map +1 -1
- package/dist/core/agents/state/names.js +80 -5
- 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/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 +42 -7
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +288 -76
- 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 +20 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +44 -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.map +1 -1
- package/dist/core/diagnostics/bundle.js +111 -47
- 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 +120 -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/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 +3 -2
- 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 +16 -5
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +31 -9
- 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 +61 -18
- 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/qa-artifacts.d.ts +3 -0
- package/dist/core/qa-artifacts.d.ts.map +1 -1
- package/dist/core/qa-artifacts.js +25 -3
- package/dist/core/resources/contract.d.ts +69 -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 +2 -0
- package/dist/core/resources/sampler.d.ts.map +1 -1
- package/dist/core/resources/sampler.js +31 -1
- 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 +6 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +4 -3
- package/dist/lib/browser/capture-fidelity.d.ts +7 -0
- package/dist/lib/browser/capture-fidelity.d.ts.map +1 -1
- package/dist/lib/browser/capture-fidelity.js +17 -0
- package/dist/lib/browser/client.d.ts +9 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +85 -37
- package/dist/lib/browser/index.d.ts +3 -1
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -1
- 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 +1 -1
- package/dist/lib/browser/page-review-judge.d.ts.map +1 -1
- package/dist/lib/browser/page-review-judge.js +46 -38
- package/dist/lib/browser/page-review-pack.d.ts +44 -22
- package/dist/lib/browser/page-review-pack.d.ts.map +1 -1
- package/dist/lib/browser/page-review-pack.js +116 -36
- 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 +35 -9
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -1
- package/dist/lib/browser/qa-run-contracts.js +48 -14
- package/dist/lib/browser/qa-run.d.ts.map +1 -1
- package/dist/lib/browser/qa-run.js +215 -68
- 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/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 +30 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -1
- package/dist/lib/browser/tiling.js +38 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -1
- package/dist/lib/docs-metadata-managed.js +4 -1
- 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 +1 -0
- 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 +7 -4
- package/schemas/config.schema.json +69 -2
- package/src/commands/agents.ts +42 -9
- package/src/commands/artifacts.ts +130 -6
- package/src/commands/backup.ts +287 -34
- package/src/commands/browse.ts +564 -267
- package/src/commands/diagnostics.ts +6 -3
- package/src/commands/ledger-v3.ts +20 -3
- package/src/commands/qa-run.ts +37 -3
- package/src/commands/qa-status.ts +11 -2
- package/src/commands/resources.ts +23 -3
- package/src/commands/review-pack.ts +165 -62
- package/src/commands/tunnel.ts +2 -1
- package/src/core/agents/canonical-emit.ts +4 -2
- package/src/core/agents/cli.ts +14 -6
- package/src/core/agents/live-authority-v3.ts +7 -3
- package/src/core/agents/live-lifecycle-v3.ts +2 -2
- package/src/core/agents/render/prompt-context.ts +68 -14
- package/src/core/agents/session-finalizer-v3.ts +2 -2
- package/src/core/agents/state/live-coordination-view.ts +4 -4
- package/src/core/agents/state/names.ts +92 -7
- 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/delivery-card.ts +375 -0
- package/src/core/artifacts/index.ts +385 -91
- package/src/core/artifacts/mutation-lock.ts +106 -0
- package/src/core/backup/host-snapshot.ts +76 -0
- package/src/core/config.ts +66 -13
- package/src/core/diagnostics/advice.ts +148 -120
- package/src/core/diagnostics/bundle.ts +138 -52
- 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 +163 -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/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 +6 -6
- package/src/core/events/v3/producers/producer-state-observer.ts +2 -1
- package/src/core/events/v3/producers/recorder.ts +50 -21
- 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 +65 -14
- 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/qa-artifacts.ts +29 -3
- package/src/core/resources/contract.ts +76 -3
- package/src/core/resources/index.ts +1 -0
- package/src/core/resources/native.ts +481 -0
- package/src/core/resources/sampler.ts +46 -1
- 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 +6 -8
- package/src/core/workflow/proof.ts +4 -3
- package/src/lib/browser/capture-fidelity.ts +23 -0
- package/src/lib/browser/client.ts +96 -44
- package/src/lib/browser/index.ts +15 -1
- 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 +56 -40
- package/src/lib/browser/page-review-pack.ts +181 -43
- package/src/lib/browser/page-review-source.ts +30 -0
- package/src/lib/browser/qa-run-contracts.ts +62 -18
- package/src/lib/browser/qa-run.ts +259 -71
- package/src/lib/browser/qa-snapshot.ts +289 -48
- 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 +63 -0
- package/src/lib/docs-metadata-managed.ts +4 -1
- package/src/lib/identities/assume.ts +12 -4
- package/src/lib/instructions/templates.ts +1 -0
- package/src/lib/local-file-url.ts +17 -2
- package/src/lib/tunnel/state.ts +70 -13
package/src/commands/agents.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { tmpdir } from "node:os";
|
|
|
27
27
|
import { basename, join, resolve } from "node:path";
|
|
28
28
|
import type { Command } from "commander";
|
|
29
29
|
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
30
|
+
import type { Adapter } from "../core/adapter.ts";
|
|
30
31
|
import { coordBinPath } from "../core/agents/coord-bin.ts";
|
|
31
32
|
import {
|
|
32
33
|
checkGitFinalization,
|
|
@@ -85,11 +86,13 @@ import {
|
|
|
85
86
|
foldSessionState,
|
|
86
87
|
type TaskState,
|
|
87
88
|
} from "../core/agents/state/session-state.ts";
|
|
89
|
+
import { turnElapsedStatusRow } from "../core/agents/turn-elapsed.ts";
|
|
88
90
|
import {
|
|
89
91
|
coordFreshnessSeconds,
|
|
90
92
|
resolveBinName,
|
|
91
93
|
sessionFinalizationConfig,
|
|
92
94
|
} from "../core/config.ts";
|
|
95
|
+
import { EVENT_ADAPTER_IDS_V3, type EventAdapterIdV3 } from "../core/events/v3/adapter-id.ts";
|
|
93
96
|
import type { EventTypeV3 } from "../core/events/v3/contract.ts";
|
|
94
97
|
import { readEventV3ControlState } from "../core/events/v3/control.ts";
|
|
95
98
|
import {
|
|
@@ -118,6 +121,7 @@ import {
|
|
|
118
121
|
readRuntimeContextUsage,
|
|
119
122
|
} from "../core/hooks/adapter/runtime-telemetry.ts";
|
|
120
123
|
import { type RemoteMachine, readRemoteMachines } from "../core/presence/index.ts";
|
|
124
|
+
import { formatResourceSummary, readResourceStatus } from "../core/resources/status.ts";
|
|
121
125
|
import { registerContextCommand } from "./context.ts";
|
|
122
126
|
|
|
123
127
|
type LiveCoordinationRow = ReturnType<typeof readLiveCoordinationRows>[number];
|
|
@@ -239,6 +243,7 @@ function spawnFailureMessage(
|
|
|
239
243
|
function formatPlatformLabel(platform?: string | null): string {
|
|
240
244
|
if (platform === "cursor") return "Cursor";
|
|
241
245
|
if (platform === "codex") return "Codex";
|
|
246
|
+
if (platform === "openclaw") return "OpenClaw";
|
|
242
247
|
return "CC";
|
|
243
248
|
}
|
|
244
249
|
|
|
@@ -669,7 +674,7 @@ function runEndSession(opts: { sessionId?: string; instanceId?: string; outcome:
|
|
|
669
674
|
const byInstance = listHookProducerStateRecordsV3(root, { includeTerminal: false }).filter(
|
|
670
675
|
({ state }) => state.instance_id === target,
|
|
671
676
|
);
|
|
672
|
-
const byNative =
|
|
677
|
+
const byNative = EVENT_ADAPTER_IDS_V3.flatMap((adapter) => {
|
|
673
678
|
const state = readHookProducerStateV3(root, adapter, target);
|
|
674
679
|
return state && !state.terminal ? [{ path: "", modified_at_ms: 0, state }] : [];
|
|
675
680
|
});
|
|
@@ -786,10 +791,13 @@ function runObserveArchive(opts: {
|
|
|
786
791
|
}) {
|
|
787
792
|
const root = monorepoRoot();
|
|
788
793
|
if (!root) return failCommand("not_in_repo", "not in an agent session");
|
|
789
|
-
if (!(
|
|
790
|
-
return failCommand(
|
|
794
|
+
if (!(EVENT_ADAPTER_IDS_V3 as readonly string[]).includes(opts.adapter)) {
|
|
795
|
+
return failCommand(
|
|
796
|
+
"invalid_adapter",
|
|
797
|
+
"adapter must be claude-code, codex, cursor, or openclaw",
|
|
798
|
+
);
|
|
791
799
|
}
|
|
792
|
-
const adapter = opts.adapter as
|
|
800
|
+
const adapter = opts.adapter as EventAdapterIdV3;
|
|
793
801
|
const observedAt = opts.observedAt ?? new Date().toISOString();
|
|
794
802
|
if (Number.isNaN(Date.parse(observedAt))) {
|
|
795
803
|
return failCommand("invalid_observed_at", "observed-at must be an ISO timestamp");
|
|
@@ -2408,12 +2416,20 @@ function runStatus(opts: {
|
|
|
2408
2416
|
// the QA run took 58 minutes. Best-effort by contract — no pointer, a
|
|
2409
2417
|
// malformed one, or any read failure renders no row.
|
|
2410
2418
|
const qaSignal = qaSignalStatusRow({ coordRoot: root, instanceId: hb.instance_id });
|
|
2419
|
+
// Duration of the turn this box closes. `session` is cumulative, so without
|
|
2420
|
+
// this row an operator cannot tell a twelve-second turn from an eight-minute
|
|
2421
|
+
// one inside the same session. Best-effort by contract — no turn evidence,
|
|
2422
|
+
// no row.
|
|
2423
|
+
const turnElapsed = turnElapsedStatusRow({ coordRoot: root, instanceId: hb.instance_id });
|
|
2424
|
+
const resources = readResourceStatus(root);
|
|
2411
2425
|
|
|
2412
2426
|
const data = {
|
|
2413
2427
|
name: displayName,
|
|
2414
2428
|
instance_id: hb.instance_id,
|
|
2415
2429
|
kind: normalizeKind(hb.kind),
|
|
2416
2430
|
session_age_secs: ageSecs,
|
|
2431
|
+
turn_elapsed_secs: turnElapsed ? turnElapsed.elapsed.secs : null,
|
|
2432
|
+
turn_complete: turnElapsed ? turnElapsed.elapsed.complete : null,
|
|
2417
2433
|
activity: activityOf(hb),
|
|
2418
2434
|
activity_updated_at: hb.activity_updated_at ?? null,
|
|
2419
2435
|
activity_source: hb.activity_source ?? null,
|
|
@@ -2441,6 +2457,7 @@ function runStatus(opts: {
|
|
|
2441
2457
|
})),
|
|
2442
2458
|
})),
|
|
2443
2459
|
pending_councils: pendingCouncils,
|
|
2460
|
+
resources,
|
|
2444
2461
|
context_used: ctxUsage && "used" in ctxUsage ? ctxUsage.used : null,
|
|
2445
2462
|
context_window: ctxUsage && "window" in ctxUsage ? ctxUsage.window : null,
|
|
2446
2463
|
timestamp_iso: new Date().toISOString(),
|
|
@@ -2459,16 +2476,24 @@ function runStatus(opts: {
|
|
|
2459
2476
|
|
|
2460
2477
|
const rows: Array<[string, string]> = [
|
|
2461
2478
|
["session", formatAge(ageSecs)],
|
|
2479
|
+
...(turnElapsed ? ([["turn", turnElapsed.value]] as Array<[string, string]>) : []),
|
|
2462
2480
|
["activity", activityOf(hb)],
|
|
2463
2481
|
["lifecycle", lifecycleLabel(hb)],
|
|
2464
2482
|
["context", ctxStr],
|
|
2483
|
+
["resources", formatResourceSummary(resources)],
|
|
2465
2484
|
["files", filesStr],
|
|
2466
2485
|
["peers", peersStr],
|
|
2467
2486
|
["time", timeStr],
|
|
2468
2487
|
];
|
|
2469
|
-
// Task gets full text; formatBox word-wraps to MAX_BOX_CONTENT_WIDTH.
|
|
2488
|
+
// Task gets full text; formatBox word-wraps to MAX_BOX_CONTENT_WIDTH. It sits
|
|
2489
|
+
// directly above `activity`, which keeps it under the session/turn clocks
|
|
2490
|
+
// whether or not the turn row rendered.
|
|
2470
2491
|
if (hb.task && hb.task.length > 0) {
|
|
2471
|
-
rows.splice(
|
|
2492
|
+
rows.splice(
|
|
2493
|
+
rows.findIndex((row) => row[0] === "activity"),
|
|
2494
|
+
0,
|
|
2495
|
+
["task", hb.task],
|
|
2496
|
+
);
|
|
2472
2497
|
}
|
|
2473
2498
|
if (pendingCouncils.length > 0) {
|
|
2474
2499
|
// Slot the council line right before `time` so it stays in the "what's
|
|
@@ -2755,6 +2780,7 @@ function adapterToPlatform(adapter: string | undefined): string {
|
|
|
2755
2780
|
if (adapter === "claude-code") return "claude-code";
|
|
2756
2781
|
if (adapter === "cursor") return "cursor";
|
|
2757
2782
|
if (adapter === "codex") return "codex";
|
|
2783
|
+
if (adapter === "openclaw") return "openclaw";
|
|
2758
2784
|
return "unknown";
|
|
2759
2785
|
}
|
|
2760
2786
|
|
|
@@ -5061,13 +5087,20 @@ function runHeal(opts: {
|
|
|
5061
5087
|
const inferredAdapter = normalizeAdapter(
|
|
5062
5088
|
opts.adapter?.trim() || currentRow?.platform || commandSessionBootstrap()?.adapter,
|
|
5063
5089
|
);
|
|
5090
|
+
if (inferredAdapter === "openclaw") {
|
|
5091
|
+
emitHealFailure(
|
|
5092
|
+
"unsupported_adapter",
|
|
5093
|
+
"coordination cache healing is unavailable for observer-only OpenClaw generations",
|
|
5094
|
+
);
|
|
5095
|
+
}
|
|
5096
|
+
const healAdapter: Adapter = inferredAdapter;
|
|
5064
5097
|
const sessionId =
|
|
5065
5098
|
opts.sessionId?.trim() ||
|
|
5066
5099
|
(currentSessionRepair ? sessionIdentityFromEnv() : null) ||
|
|
5067
5100
|
nativeSessionIdentity(currentRow, owner);
|
|
5068
5101
|
|
|
5069
5102
|
if (kind === "cache") {
|
|
5070
|
-
const refusal = cacheHealAuthorityRefusal(root, owner, sessionId,
|
|
5103
|
+
const refusal = cacheHealAuthorityRefusal(root, owner, sessionId, healAdapter, currentRow);
|
|
5071
5104
|
if (refusal) {
|
|
5072
5105
|
emitHealFailure(refusal.reason, refusal.message);
|
|
5073
5106
|
}
|
|
@@ -5183,7 +5216,7 @@ function runHeal(opts: {
|
|
|
5183
5216
|
|
|
5184
5217
|
if (proc.status !== 0) {
|
|
5185
5218
|
emitHealFailure(
|
|
5186
|
-
healFailureReason(root, owner, sessionId,
|
|
5219
|
+
healFailureReason(root, owner, sessionId, healAdapter),
|
|
5187
5220
|
spawnFailureMessage(proc, `agent-coord ${action}`),
|
|
5188
5221
|
);
|
|
5189
5222
|
}
|
|
@@ -5306,7 +5339,7 @@ function missingAuthorityForCurrentSessionBootstrap(
|
|
|
5306
5339
|
): boolean {
|
|
5307
5340
|
if (readLiveCoordinationRow(root, owner)) return false;
|
|
5308
5341
|
try {
|
|
5309
|
-
const nativeSessionHasProducer =
|
|
5342
|
+
const nativeSessionHasProducer = EVENT_ADAPTER_IDS_V3.some(
|
|
5310
5343
|
(adapter) => readHookProducerStateV3(root, adapter, sessionId) !== undefined,
|
|
5311
5344
|
);
|
|
5312
5345
|
if (nativeSessionHasProducer) return false;
|
|
@@ -4,19 +4,34 @@ import { monorepoRoot, resolveOwner } from "../core/agents/index.ts";
|
|
|
4
4
|
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.ts";
|
|
5
5
|
import {
|
|
6
6
|
type ArtifactActor,
|
|
7
|
+
type ArtifactDeliveryManifest,
|
|
7
8
|
adoptUnmanagedArtifactFiles,
|
|
8
9
|
artifactCapabilities,
|
|
10
|
+
artifactReviewGuidance,
|
|
11
|
+
artifactsRoot,
|
|
12
|
+
autoCleanArtifacts,
|
|
9
13
|
cleanArtifacts,
|
|
10
14
|
createArtifact,
|
|
15
|
+
discardArtifact,
|
|
11
16
|
holdArtifact,
|
|
12
17
|
inventoryArtifacts,
|
|
13
18
|
migrateArtifacts,
|
|
19
|
+
parseArtifactDeliverySpec,
|
|
14
20
|
releaseArtifact,
|
|
21
|
+
renderArtifactDeliveryCard,
|
|
15
22
|
renewArtifact,
|
|
23
|
+
repairArtifactActivity,
|
|
24
|
+
resolveArtifactDeliveryManifest,
|
|
16
25
|
showArtifact,
|
|
17
26
|
unholdArtifact,
|
|
27
|
+
writeArtifactDeliveryManifest,
|
|
18
28
|
} from "../core/artifacts/index.ts";
|
|
19
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
artifactDefaultRetentionDays,
|
|
31
|
+
coordFreshnessSeconds,
|
|
32
|
+
reviewPackAutoCleanEnabled,
|
|
33
|
+
} from "../core/config.ts";
|
|
34
|
+
import { deleteExpiredPacks } from "../lib/browser/page-review-pack.ts";
|
|
20
35
|
|
|
21
36
|
export function registerArtifactsCommand(
|
|
22
37
|
program: Command,
|
|
@@ -33,6 +48,7 @@ export function registerArtifactsCommand(
|
|
|
33
48
|
.description("Create one managed artifact workspace and print its path.")
|
|
34
49
|
.requiredOption("--purpose <text>", "What the files are for")
|
|
35
50
|
.option("--days <n>", "Retention in days (default from artifacts.default_retention_days)")
|
|
51
|
+
.option("--minutes <n>", "Retention in minutes; cannot be combined with --days")
|
|
36
52
|
.option("--big", "Acknowledge that this workspace may exceed the per-bundle size ceiling")
|
|
37
53
|
.option("--hold <id>", "Create the workspace with this hold already present")
|
|
38
54
|
.option("--hold-reason <text>", "Why the initial hold is required")
|
|
@@ -43,6 +59,7 @@ export function registerArtifactsCommand(
|
|
|
43
59
|
opts: {
|
|
44
60
|
purpose: string;
|
|
45
61
|
days?: string;
|
|
62
|
+
minutes?: string;
|
|
46
63
|
big?: boolean;
|
|
47
64
|
hold?: string;
|
|
48
65
|
holdReason?: string;
|
|
@@ -51,16 +68,29 @@ export function registerArtifactsCommand(
|
|
|
51
68
|
) => {
|
|
52
69
|
run(emit, () => {
|
|
53
70
|
const repoRoot = requireRepoRoot(context);
|
|
71
|
+
if (opts.days !== undefined && opts.minutes !== undefined)
|
|
72
|
+
throw new Error("choose either --days or --minutes");
|
|
54
73
|
const actor = opts.actor ? { instance_id: opts.actor } : currentActor(repoRoot);
|
|
55
74
|
if (!!opts.hold !== !!opts.holdReason)
|
|
56
75
|
throw new Error("--hold and --hold-reason must be used together");
|
|
57
76
|
const retentionDays = opts.days
|
|
58
77
|
? parseDays(opts.days)
|
|
59
78
|
: artifactDefaultRetentionDays(repoRoot);
|
|
79
|
+
const retentionMinutes =
|
|
80
|
+
opts.minutes === undefined ? undefined : parseMinutes(opts.minutes);
|
|
81
|
+
try {
|
|
82
|
+
autoCleanArtifacts(repoRoot);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
emit.log(
|
|
85
|
+
`artifact cleanup skipped: ${error instanceof Error ? error.message : String(error)}`,
|
|
86
|
+
"warn",
|
|
87
|
+
);
|
|
88
|
+
}
|
|
60
89
|
const created = createArtifact(repoRoot, {
|
|
61
90
|
slug,
|
|
62
91
|
purpose: opts.purpose,
|
|
63
92
|
retentionDays,
|
|
93
|
+
retentionMinutes,
|
|
64
94
|
actor,
|
|
65
95
|
big: opts.big,
|
|
66
96
|
holds: opts.hold ? [{ id: opts.hold, reason: opts.holdReason! }] : [],
|
|
@@ -71,6 +101,7 @@ export function registerArtifactsCommand(
|
|
|
71
101
|
expires_at: created.manifest.retention.expires_at,
|
|
72
102
|
owner_instance_id: actor?.instance_id ?? null,
|
|
73
103
|
holds: created.manifest.holds,
|
|
104
|
+
after_review: artifactReviewGuidance(repoRoot, created.manifest.artifact_id),
|
|
74
105
|
});
|
|
75
106
|
});
|
|
76
107
|
},
|
|
@@ -131,15 +162,59 @@ export function registerArtifactsCommand(
|
|
|
131
162
|
});
|
|
132
163
|
});
|
|
133
164
|
|
|
165
|
+
root
|
|
166
|
+
.command("delivery-card <ref>")
|
|
167
|
+
.description("Discover or curate a reproducible Markdown delivery card for one artifact.")
|
|
168
|
+
.option("--title <text>", "Card heading")
|
|
169
|
+
.option("--url <label=url>", "Add a web destination; repeatable", collect, [])
|
|
170
|
+
.option(
|
|
171
|
+
"--path <label=path>",
|
|
172
|
+
"Add an artifact-relative file or directory; repeatable",
|
|
173
|
+
collect,
|
|
174
|
+
[],
|
|
175
|
+
)
|
|
176
|
+
.action((ref: string, opts: { title?: string; url: string[]; path: string[] }) => {
|
|
177
|
+
run(emit, () => {
|
|
178
|
+
const repoRoot = requireRepoRoot(context);
|
|
179
|
+
const suppliedItems = [
|
|
180
|
+
...opts.url.map((spec) => parseArtifactDeliverySpec("url", spec)),
|
|
181
|
+
...opts.path.map((spec) => parseArtifactDeliverySpec("path", spec)),
|
|
182
|
+
];
|
|
183
|
+
let manifest: ArtifactDeliveryManifest;
|
|
184
|
+
if (suppliedItems.length > 0) {
|
|
185
|
+
manifest = writeArtifactDeliveryManifest(repoRoot, ref, {
|
|
186
|
+
title: opts.title ?? "Delivery",
|
|
187
|
+
items: suppliedItems,
|
|
188
|
+
});
|
|
189
|
+
} else {
|
|
190
|
+
manifest = resolveArtifactDeliveryManifest(repoRoot, ref);
|
|
191
|
+
if (opts.title !== undefined) {
|
|
192
|
+
manifest = writeArtifactDeliveryManifest(repoRoot, ref, {
|
|
193
|
+
title: opts.title,
|
|
194
|
+
items: manifest.items,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
emit.text(renderArtifactDeliveryCard(repoRoot, ref, manifest).markdown);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
134
202
|
root
|
|
135
203
|
.command("renew <ref>")
|
|
136
204
|
.description("Set a new retention window. Renewal does not mark the artifact active.")
|
|
137
|
-
.
|
|
205
|
+
.option("--days <n>", "Days from now; choose either --days or --minutes")
|
|
206
|
+
.option("--minutes <n>", "Minutes from now; choose either --days or --minutes")
|
|
138
207
|
.requiredOption("--reason <text>", "Why the extra retention is needed")
|
|
139
|
-
.action((ref: string, opts: { days
|
|
208
|
+
.action((ref: string, opts: { days?: string; minutes?: string; reason: string }) => {
|
|
140
209
|
run(emit, () => {
|
|
141
210
|
const repoRoot = requireRepoRoot(context);
|
|
142
|
-
|
|
211
|
+
if ((opts.days === undefined) === (opts.minutes === undefined))
|
|
212
|
+
throw new Error("choose exactly one of --days or --minutes");
|
|
213
|
+
const duration =
|
|
214
|
+
opts.minutes === undefined
|
|
215
|
+
? parseDays(opts.days!)
|
|
216
|
+
: { minutes: parseMinutes(opts.minutes) };
|
|
217
|
+
const manifest = renewArtifact(repoRoot, ref, duration, opts.reason, {
|
|
143
218
|
actor: currentActor(repoRoot),
|
|
144
219
|
});
|
|
145
220
|
emit.data(manifest);
|
|
@@ -152,7 +227,27 @@ export function registerArtifactsCommand(
|
|
|
152
227
|
.action((ref: string) => {
|
|
153
228
|
run(emit, () => {
|
|
154
229
|
const repoRoot = requireRepoRoot(context);
|
|
155
|
-
|
|
230
|
+
const manifest = releaseArtifact(repoRoot, ref, { actor: currentActor(repoRoot) });
|
|
231
|
+
emit.data({
|
|
232
|
+
...manifest,
|
|
233
|
+
after_review: artifactReviewGuidance(repoRoot, manifest.artifact_id),
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
root
|
|
239
|
+
.command("discard <ref>")
|
|
240
|
+
.description("Retire reviewed, disposable files after a grace period; deletes nothing now.")
|
|
241
|
+
.option("--minutes <n>", "Grace period in minutes; never extends an earlier expiry", "60")
|
|
242
|
+
.requiredOption("--reason <text>", "Why these reviewed files are no longer needed")
|
|
243
|
+
.action((ref: string, opts: { minutes: string; reason: string }) => {
|
|
244
|
+
run(emit, () => {
|
|
245
|
+
const repoRoot = requireRepoRoot(context);
|
|
246
|
+
const manifest = discardArtifact(repoRoot, ref, opts.reason, {
|
|
247
|
+
minutes: parseMinutes(opts.minutes),
|
|
248
|
+
actor: currentActor(repoRoot),
|
|
249
|
+
});
|
|
250
|
+
emit.data({ manifest, entry: showArtifact(repoRoot, ref).entry, deleted: false });
|
|
156
251
|
});
|
|
157
252
|
});
|
|
158
253
|
|
|
@@ -170,6 +265,17 @@ export function registerArtifactsCommand(
|
|
|
170
265
|
run(emit, () => emit.data({ rows: migrateArtifacts(requireRepoRoot(context), opts) })),
|
|
171
266
|
);
|
|
172
267
|
|
|
268
|
+
root
|
|
269
|
+
.command("repair-activity")
|
|
270
|
+
.description("Preview retention corrections for unchanged, preimage-backed v1 migrations.")
|
|
271
|
+
.option(
|
|
272
|
+
"--yes",
|
|
273
|
+
"Record verified activity corrections with preimage receipts; deletes no files",
|
|
274
|
+
)
|
|
275
|
+
.action((opts: { yes?: boolean }) =>
|
|
276
|
+
run(emit, () => emit.data({ rows: repairArtifactActivity(requireRepoRoot(context), opts) })),
|
|
277
|
+
);
|
|
278
|
+
|
|
173
279
|
root
|
|
174
280
|
.command("hold <ref>")
|
|
175
281
|
.description("Protect an artifact from cleanup until its owner removes this exact hold.")
|
|
@@ -214,7 +320,14 @@ export function registerArtifactsCommand(
|
|
|
214
320
|
yes: opts.yes,
|
|
215
321
|
freshnessSeconds: coordFreshnessSeconds(repoRoot),
|
|
216
322
|
});
|
|
217
|
-
|
|
323
|
+
const reviewPacks = reviewPackAutoCleanEnabled(repoRoot)
|
|
324
|
+
? deleteExpiredPacks({ roots: [artifactsRoot(repoRoot)], dryRun: !opts.yes })
|
|
325
|
+
: undefined;
|
|
326
|
+
emit.data({
|
|
327
|
+
rows,
|
|
328
|
+
meta: summarize(rows),
|
|
329
|
+
...(reviewPacks ? { review_packs: reviewPacks } : {}),
|
|
330
|
+
});
|
|
218
331
|
});
|
|
219
332
|
});
|
|
220
333
|
}
|
|
@@ -250,6 +363,17 @@ function parseDays(value: string): number {
|
|
|
250
363
|
return parsed;
|
|
251
364
|
}
|
|
252
365
|
|
|
366
|
+
function parseMinutes(value: string): number {
|
|
367
|
+
const parsed = Number(value);
|
|
368
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 5256000)
|
|
369
|
+
throw new Error("--minutes must be between 1 and 5256000");
|
|
370
|
+
return parsed;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function collect(value: string, previous: string[]): string[] {
|
|
374
|
+
return [...previous, value];
|
|
375
|
+
}
|
|
376
|
+
|
|
253
377
|
function summarize(
|
|
254
378
|
rows: { classification: string; action: string; bytes?: number | null }[],
|
|
255
379
|
): Record<string, unknown> {
|