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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { liveInstanceIdV3 } from "../events/v3/live-routing.js";
|
|
2
|
+
import { readLedgerV3 } from "../events/v3/reader.js";
|
|
3
|
+
/** Stop-hook remediation restarts to walk back through before giving up. */
|
|
4
|
+
const MAX_REMEDIATION_WALK_BACK = 8;
|
|
5
|
+
function timeMs(event) {
|
|
6
|
+
if (!event)
|
|
7
|
+
return Number.NaN;
|
|
8
|
+
return Date.parse(event.time.observed_at);
|
|
9
|
+
}
|
|
10
|
+
function generationOf(event) {
|
|
11
|
+
return "generation_id" in event.scope ? event.scope.generation_id : undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Measure the newest turn for `instanceId` from an already-read event stream.
|
|
15
|
+
*
|
|
16
|
+
* A Stop-hook bounce ends one `turn.started` and opens another carrying
|
|
17
|
+
* `stop_remediation`. The operator experiences those as one turn, so the walk
|
|
18
|
+
* back over remediation restarts reports elapsed time since their prompt, not
|
|
19
|
+
* since the last retry. The walk stays inside one generation: a resumed
|
|
20
|
+
* session must not absorb the previous generation's turn into its own.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveTurnElapsed(events, instanceId, now = Date.now()) {
|
|
23
|
+
const owner = liveInstanceIdV3(instanceId);
|
|
24
|
+
const ownerEvents = events.filter((event) => event.scope.instance_id === owner);
|
|
25
|
+
const starts = ownerEvents.filter((event) => event.event_type === "turn.started" && timeMs(event) <= now);
|
|
26
|
+
if (starts.length === 0)
|
|
27
|
+
return null;
|
|
28
|
+
let index = starts.length - 1;
|
|
29
|
+
const generation = generationOf(starts[index]);
|
|
30
|
+
let restarts = 0;
|
|
31
|
+
while (index > 0 && restarts < MAX_REMEDIATION_WALK_BACK) {
|
|
32
|
+
const turn = starts[index];
|
|
33
|
+
if (turn?.payload.stop_remediation !== true)
|
|
34
|
+
break;
|
|
35
|
+
const previous = starts[index - 1];
|
|
36
|
+
if (!previous || generationOf(previous) !== generation)
|
|
37
|
+
break;
|
|
38
|
+
index -= 1;
|
|
39
|
+
restarts += 1;
|
|
40
|
+
}
|
|
41
|
+
const startMs = timeMs(starts[index]);
|
|
42
|
+
if (!Number.isFinite(startMs))
|
|
43
|
+
return null;
|
|
44
|
+
// A terminal only closes the measurement when nothing restarted the turn
|
|
45
|
+
// after it, so match against the newest start rather than the walked-back
|
|
46
|
+
// one. Otherwise the `turn.completed` that a Stop-hook bounce produced would
|
|
47
|
+
// end the measurement mid-remediation.
|
|
48
|
+
const newestStartMs = timeMs(starts[starts.length - 1]);
|
|
49
|
+
const terminal = ownerEvents.find((event) => event.event_type === "turn.completed" &&
|
|
50
|
+
generationOf(event) === generation &&
|
|
51
|
+
timeMs(event) >= newestStartMs);
|
|
52
|
+
const terminalMs = timeMs(terminal);
|
|
53
|
+
const endMs = Number.isFinite(terminalMs) ? terminalMs : now;
|
|
54
|
+
return {
|
|
55
|
+
secs: Math.max(0, Math.floor((endMs - startMs) / 1000)),
|
|
56
|
+
complete: Number.isFinite(terminalMs),
|
|
57
|
+
remediation_restarts: restarts,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Render a turn duration for the box. Seconds stay visible below an hour
|
|
62
|
+
* because most turns land there and a bare `4m` cannot be compared with the
|
|
63
|
+
* turn before it.
|
|
64
|
+
*/
|
|
65
|
+
export function formatTurnElapsed(secs) {
|
|
66
|
+
if (secs < 60)
|
|
67
|
+
return `${secs}s`;
|
|
68
|
+
if (secs < 3600)
|
|
69
|
+
return `${Math.floor(secs / 60)}m ${secs % 60}s`;
|
|
70
|
+
const hours = Math.floor(secs / 3600);
|
|
71
|
+
const minutes = Math.floor((secs % 3600) / 60);
|
|
72
|
+
return `${hours}h ${minutes}m`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The whole status-box contribution in one best-effort call: read the ledger
|
|
76
|
+
* and render this session's `turn` row. Null means render no row.
|
|
77
|
+
*/
|
|
78
|
+
export function turnElapsedStatusRow(target, now = Date.now()) {
|
|
79
|
+
try {
|
|
80
|
+
const ledger = readLedgerV3(target.coordRoot);
|
|
81
|
+
if (!ledger.complete)
|
|
82
|
+
return null;
|
|
83
|
+
const elapsed = resolveTurnElapsed(ledger.events.map((positioned) => positioned.event), target.instanceId, now);
|
|
84
|
+
if (!elapsed)
|
|
85
|
+
return null;
|
|
86
|
+
return { value: formatTurnElapsed(elapsed.secs), elapsed };
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A checkpoint taken before an internal manifest write, never an expiry override. */
|
|
2
|
+
export interface ArtifactActivity {
|
|
3
|
+
last_changed_at: string;
|
|
4
|
+
root_entries_sha256: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function validArtifactActivity(value: unknown): value is ArtifactActivity;
|
|
7
|
+
export declare function artifactRootEntries(path: string): string;
|
|
8
|
+
/** Metadata writes change both the manifest and its parent directory timestamps.
|
|
9
|
+
* Keep the prior root activity while its payload entries match the checkpoint.
|
|
10
|
+
* A root deletion or rename changes that fingerprint; nested changes retain
|
|
11
|
+
* their ordinary filesystem timestamps. Symlinks are inspected, never followed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readArtifactActivity(path: string, now: Date, previous?: ArtifactActivity): ArtifactActivity;
|
|
14
|
+
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/core/artifacts/activity.ts"],"names":[],"mappings":"AAKA,sFAAsF;AACtF,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAS/E;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUxD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,IAAI,EACT,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,gBAAgB,CA2BlB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { lstatSync, readdirSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { ARTIFACT_MANIFEST } from "./constants.js";
|
|
5
|
+
export function validArtifactActivity(value) {
|
|
6
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
7
|
+
return false;
|
|
8
|
+
const item = value;
|
|
9
|
+
return (typeof item.last_changed_at === "string" &&
|
|
10
|
+
Number.isFinite(Date.parse(item.last_changed_at)) &&
|
|
11
|
+
typeof item.root_entries_sha256 === "string" &&
|
|
12
|
+
/^[a-f0-9]{64}$/.test(item.root_entries_sha256));
|
|
13
|
+
}
|
|
14
|
+
export function artifactRootEntries(path) {
|
|
15
|
+
return createHash("sha256")
|
|
16
|
+
.update(JSON.stringify(readdirSync(path)
|
|
17
|
+
.filter((name) => name !== ARTIFACT_MANIFEST)
|
|
18
|
+
.sort()))
|
|
19
|
+
.digest("hex");
|
|
20
|
+
}
|
|
21
|
+
/** Metadata writes change both the manifest and its parent directory timestamps.
|
|
22
|
+
* Keep the prior root activity while its payload entries match the checkpoint.
|
|
23
|
+
* A root deletion or rename changes that fingerprint; nested changes retain
|
|
24
|
+
* their ordinary filesystem timestamps. Symlinks are inspected, never followed.
|
|
25
|
+
*/
|
|
26
|
+
export function readArtifactActivity(path, now, previous) {
|
|
27
|
+
const entries = artifactRootEntries(path);
|
|
28
|
+
const nowMs = now.getTime();
|
|
29
|
+
const accept = (timestamp) => Number.isFinite(timestamp) && timestamp <= nowMs + 5 * 60 * 1000
|
|
30
|
+
? Math.min(timestamp, nowMs)
|
|
31
|
+
: 0;
|
|
32
|
+
const walk = (entry, root = false) => {
|
|
33
|
+
const stat = lstatSync(entry);
|
|
34
|
+
let latest = root && previous?.root_entries_sha256 === entries
|
|
35
|
+
? accept(Date.parse(previous.last_changed_at))
|
|
36
|
+
: Math.max(accept(stat.mtimeMs), accept(stat.ctimeMs));
|
|
37
|
+
if (stat.isDirectory() && !stat.isSymbolicLink()) {
|
|
38
|
+
for (const name of readdirSync(entry)) {
|
|
39
|
+
// Only this unit's own control manifest is metadata. Nested artifact
|
|
40
|
+
// manifests are payload from the containing workspace's point of view.
|
|
41
|
+
if (root && previous && name === ARTIFACT_MANIFEST)
|
|
42
|
+
continue;
|
|
43
|
+
latest = Math.max(latest, walk(join(entry, name)));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return latest;
|
|
47
|
+
};
|
|
48
|
+
const latest = Math.max(accept(Date.parse(previous?.last_changed_at ?? "")), walk(path, true));
|
|
49
|
+
if (artifactRootEntries(path) !== entries)
|
|
50
|
+
throw new Error("artifact entries changed during scan");
|
|
51
|
+
return { last_changed_at: new Date(latest).toISOString(), root_entries_sha256: entries };
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const ARTIFACT_DELIVERY_MANIFEST = ".harnery-delivery.json";
|
|
2
|
+
export declare const ARTIFACT_DELIVERY_SCHEMA_VERSION: 1;
|
|
3
|
+
export declare const ARTIFACT_DELIVERY_AUTO_ITEM_LIMIT = 5;
|
|
4
|
+
export interface ArtifactDeliveryUrl {
|
|
5
|
+
kind: "url";
|
|
6
|
+
label: string;
|
|
7
|
+
target: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ArtifactDeliveryPath {
|
|
10
|
+
kind: "path";
|
|
11
|
+
label: string;
|
|
12
|
+
path: string;
|
|
13
|
+
}
|
|
14
|
+
export type ArtifactDeliveryItem = ArtifactDeliveryUrl | ArtifactDeliveryPath;
|
|
15
|
+
export interface ArtifactDeliveryManifest {
|
|
16
|
+
schema_version: typeof ARTIFACT_DELIVERY_SCHEMA_VERSION;
|
|
17
|
+
title: string;
|
|
18
|
+
items: ArtifactDeliveryItem[];
|
|
19
|
+
}
|
|
20
|
+
export interface ArtifactDeliveryCard {
|
|
21
|
+
artifact_path: string;
|
|
22
|
+
manifest_path: string;
|
|
23
|
+
markdown: string;
|
|
24
|
+
auto_items: number;
|
|
25
|
+
omitted_auto_items: number;
|
|
26
|
+
}
|
|
27
|
+
interface DisplayEnvironment {
|
|
28
|
+
platform?: NodeJS.Platform;
|
|
29
|
+
wslDistroName?: string;
|
|
30
|
+
webPort?: number;
|
|
31
|
+
tunnelUrl?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function writeArtifactDeliveryManifest(repoRoot: string, ref: string, input: Omit<ArtifactDeliveryManifest, "schema_version">): ArtifactDeliveryManifest;
|
|
34
|
+
export declare function readArtifactDeliveryManifest(repoRoot: string, ref: string): ArtifactDeliveryManifest;
|
|
35
|
+
export declare function resolveArtifactDeliveryManifest(repoRoot: string, ref: string): ArtifactDeliveryManifest;
|
|
36
|
+
export declare function renderArtifactDeliveryCard(repoRoot: string, ref: string, manifest?: ArtifactDeliveryManifest, environment?: DisplayEnvironment): ArtifactDeliveryCard;
|
|
37
|
+
export declare function parseArtifactDeliverySpec(kind: "url" | "path", spec: string): ArtifactDeliveryItem;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=delivery-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-card.d.ts","sourceRoot":"","sources":["../../../src/core/artifacts/delivery-card.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,gCAAgC,EAAG,CAAU,CAAC;AAC3D,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAE9E,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,OAAO,gCAAgC,CAAC;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,IAAI,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,GACtD,wBAAwB,CAmB1B;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,wBAAwB,CAY1B;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,wBAAwB,CAU1B;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,QAAQ,2BAAiD,EACzD,WAAW,GAAE,kBAAuB,GACnC,oBAAoB,CAsDtB;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,KAAK,GAAG,MAAM,EACpB,IAAI,EAAE,MAAM,GACX,oBAAoB,CAQtB"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { existsSync, lstatSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
4
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
5
|
+
import { encodeLinkSafeComponent } from "../../lib/local-file-url.js";
|
|
6
|
+
import { findLiveTunnelForOrigin } from "../../lib/tunnel/state.js";
|
|
7
|
+
import { resolveWebPort } from "../config.js";
|
|
8
|
+
import { ARTIFACT_MANIFEST } from "./constants.js";
|
|
9
|
+
import { resolveArtifactRef, showArtifact } from "./index.js";
|
|
10
|
+
export const ARTIFACT_DELIVERY_MANIFEST = ".harnery-delivery.json";
|
|
11
|
+
export const ARTIFACT_DELIVERY_SCHEMA_VERSION = 1;
|
|
12
|
+
export const ARTIFACT_DELIVERY_AUTO_ITEM_LIMIT = 5;
|
|
13
|
+
export function writeArtifactDeliveryManifest(repoRoot, ref, input) {
|
|
14
|
+
const artifactPath = managedArtifactPath(repoRoot, ref);
|
|
15
|
+
const manifest = validateManifest(artifactPath, {
|
|
16
|
+
schema_version: ARTIFACT_DELIVERY_SCHEMA_VERSION,
|
|
17
|
+
...input,
|
|
18
|
+
});
|
|
19
|
+
const target = resolve(artifactPath, ARTIFACT_DELIVERY_MANIFEST);
|
|
20
|
+
const tmp = `${target}.tmp.${process.pid}.${randomUUID().slice(0, 8)}`;
|
|
21
|
+
try {
|
|
22
|
+
writeFileSync(tmp, `${JSON.stringify(manifest, null, 2)}\n`, {
|
|
23
|
+
encoding: "utf8",
|
|
24
|
+
mode: 0o600,
|
|
25
|
+
flag: "wx",
|
|
26
|
+
});
|
|
27
|
+
renameSync(tmp, target);
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
rmSync(tmp, { force: true });
|
|
31
|
+
}
|
|
32
|
+
return manifest;
|
|
33
|
+
}
|
|
34
|
+
export function readArtifactDeliveryManifest(repoRoot, ref) {
|
|
35
|
+
const artifactPath = managedArtifactPath(repoRoot, ref);
|
|
36
|
+
const path = resolve(artifactPath, ARTIFACT_DELIVERY_MANIFEST);
|
|
37
|
+
let parsed;
|
|
38
|
+
try {
|
|
39
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
throw new Error(`cannot read ${ARTIFACT_DELIVERY_MANIFEST}: ${error instanceof Error ? error.message : String(error)}`);
|
|
43
|
+
}
|
|
44
|
+
return validateManifest(artifactPath, parsed);
|
|
45
|
+
}
|
|
46
|
+
export function resolveArtifactDeliveryManifest(repoRoot, ref) {
|
|
47
|
+
const artifactPath = managedArtifactPath(repoRoot, ref);
|
|
48
|
+
if (!existsSync(resolve(artifactPath, ARTIFACT_DELIVERY_MANIFEST))) {
|
|
49
|
+
return {
|
|
50
|
+
schema_version: ARTIFACT_DELIVERY_SCHEMA_VERSION,
|
|
51
|
+
title: "Artifact delivery",
|
|
52
|
+
items: [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return readArtifactDeliveryManifest(repoRoot, ref);
|
|
56
|
+
}
|
|
57
|
+
export function renderArtifactDeliveryCard(repoRoot, ref, manifest = resolveArtifactDeliveryManifest(repoRoot, ref), environment = {}) {
|
|
58
|
+
const artifactPath = managedArtifactPath(repoRoot, ref);
|
|
59
|
+
const valid = validateManifest(artifactPath, manifest);
|
|
60
|
+
const linkBase = deliveryLinkBase(repoRoot, environment);
|
|
61
|
+
const rows = [];
|
|
62
|
+
for (const item of valid.items.filter((candidate) => candidate.kind === "url")) {
|
|
63
|
+
rows.push({ label: item.label, target: item.target, href: item.target, icon: "🌐" });
|
|
64
|
+
}
|
|
65
|
+
rows.push({
|
|
66
|
+
label: "Artifact folder",
|
|
67
|
+
target: displayPath(artifactPath, environment),
|
|
68
|
+
href: artifactBrowserUrl(repoRoot, artifactPath, linkBase, true),
|
|
69
|
+
icon: "📁",
|
|
70
|
+
});
|
|
71
|
+
for (const item of valid.items.filter((candidate) => candidate.kind === "path")) {
|
|
72
|
+
const absolute = resolveArtifactItem(artifactPath, item.path);
|
|
73
|
+
rows.push({
|
|
74
|
+
label: item.label,
|
|
75
|
+
target: displayPath(absolute, environment),
|
|
76
|
+
href: artifactBrowserUrl(repoRoot, absolute, linkBase, lstatSync(absolute).isDirectory()),
|
|
77
|
+
icon: iconForPath(absolute),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const discovered = valid.items.length === 0 ? discoverArtifactRootItems(artifactPath) : [];
|
|
81
|
+
const autoItems = discovered.slice(0, ARTIFACT_DELIVERY_AUTO_ITEM_LIMIT);
|
|
82
|
+
for (const item of autoItems) {
|
|
83
|
+
rows.push({
|
|
84
|
+
label: item.name,
|
|
85
|
+
target: displayPath(item.path, environment),
|
|
86
|
+
href: artifactBrowserUrl(repoRoot, item.path, linkBase, item.directory),
|
|
87
|
+
icon: iconForPath(item.path),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const omittedAutoItems = discovered.length - autoItems.length;
|
|
91
|
+
let links = rows
|
|
92
|
+
.map((row) => `- ${row.icon} [${escapeMarkdown(row.label)}](${markdownDestination(row.href)})`)
|
|
93
|
+
.join("\n");
|
|
94
|
+
if (omittedAutoItems > 0) {
|
|
95
|
+
links += `\n- 📁 **More root items:** ${omittedAutoItems} additional ${omittedAutoItems === 1 ? "entry" : "entries"}; open the artifact folder.`;
|
|
96
|
+
}
|
|
97
|
+
const plain = rows.map((row) => `${row.label.toUpperCase()}\n${row.target}`).join("\n\n");
|
|
98
|
+
return {
|
|
99
|
+
artifact_path: artifactPath,
|
|
100
|
+
manifest_path: resolve(artifactPath, ARTIFACT_DELIVERY_MANIFEST),
|
|
101
|
+
markdown: `### ${escapeMarkdown(valid.title)}\n\n${links}\n\n\`\`\`text\n${plain}\n\`\`\``,
|
|
102
|
+
auto_items: autoItems.length,
|
|
103
|
+
omitted_auto_items: omittedAutoItems,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export function parseArtifactDeliverySpec(kind, spec) {
|
|
107
|
+
const delimiter = spec.indexOf("=");
|
|
108
|
+
if (delimiter < 1 || delimiter === spec.length - 1) {
|
|
109
|
+
throw new Error(`${kind} entries must use LABEL=VALUE`);
|
|
110
|
+
}
|
|
111
|
+
const label = spec.slice(0, delimiter).trim();
|
|
112
|
+
const value = spec.slice(delimiter + 1).trim();
|
|
113
|
+
return kind === "url" ? { kind, label, target: value } : { kind, label, path: value };
|
|
114
|
+
}
|
|
115
|
+
function managedArtifactPath(repoRoot, ref) {
|
|
116
|
+
showArtifact(repoRoot, ref);
|
|
117
|
+
return realpathSync(resolveArtifactRef(repoRoot, ref));
|
|
118
|
+
}
|
|
119
|
+
function validateManifest(artifactPath, value) {
|
|
120
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
121
|
+
throw new Error("delivery manifest must be an object");
|
|
122
|
+
}
|
|
123
|
+
const candidate = value;
|
|
124
|
+
if (candidate.schema_version !== ARTIFACT_DELIVERY_SCHEMA_VERSION) {
|
|
125
|
+
throw new Error(`delivery manifest schema_version must be ${ARTIFACT_DELIVERY_SCHEMA_VERSION}`);
|
|
126
|
+
}
|
|
127
|
+
const title = typeof candidate.title === "string" ? candidate.title.trim() : "";
|
|
128
|
+
if (!title)
|
|
129
|
+
throw new Error("delivery title must not be empty");
|
|
130
|
+
if (!Array.isArray(candidate.items))
|
|
131
|
+
throw new Error("delivery manifest items must be an array");
|
|
132
|
+
const labels = new Set();
|
|
133
|
+
const items = candidate.items.map((raw) => {
|
|
134
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
135
|
+
throw new Error("each delivery item must be an object");
|
|
136
|
+
}
|
|
137
|
+
const item = raw;
|
|
138
|
+
const label = typeof item.label === "string" ? item.label.trim() : "";
|
|
139
|
+
if (!label)
|
|
140
|
+
throw new Error("delivery item labels must not be empty");
|
|
141
|
+
const normalizedLabel = label.toLowerCase();
|
|
142
|
+
if (normalizedLabel === "artifact folder") {
|
|
143
|
+
throw new Error('"Artifact folder" is reserved and included automatically');
|
|
144
|
+
}
|
|
145
|
+
if (labels.has(normalizedLabel))
|
|
146
|
+
throw new Error(`duplicate delivery label: ${label}`);
|
|
147
|
+
labels.add(normalizedLabel);
|
|
148
|
+
if (item.kind === "url") {
|
|
149
|
+
const target = typeof item.target === "string" ? item.target.trim() : "";
|
|
150
|
+
let url;
|
|
151
|
+
try {
|
|
152
|
+
url = new URL(target);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
throw new Error(`invalid delivery URL for ${label}`);
|
|
156
|
+
}
|
|
157
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
158
|
+
throw new Error(`delivery URL for ${label} must use http or https`);
|
|
159
|
+
}
|
|
160
|
+
return { kind: "url", label, target: url.toString() };
|
|
161
|
+
}
|
|
162
|
+
if (item.kind === "path") {
|
|
163
|
+
const path = typeof item.path === "string" ? item.path.trim() : "";
|
|
164
|
+
if (!path || isAbsolute(path)) {
|
|
165
|
+
throw new Error(`delivery path for ${label} must be relative to the artifact folder`);
|
|
166
|
+
}
|
|
167
|
+
const absolute = resolveArtifactItem(artifactPath, path);
|
|
168
|
+
const normalized = relative(artifactPath, absolute).split(sep).join("/");
|
|
169
|
+
return { kind: "path", label, path: normalized };
|
|
170
|
+
}
|
|
171
|
+
throw new Error(`delivery item ${label} has an unsupported kind`);
|
|
172
|
+
});
|
|
173
|
+
return {
|
|
174
|
+
schema_version: ARTIFACT_DELIVERY_SCHEMA_VERSION,
|
|
175
|
+
title,
|
|
176
|
+
items,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function resolveArtifactItem(artifactPath, itemPath) {
|
|
180
|
+
const root = realpathSync(artifactPath);
|
|
181
|
+
const lexical = resolve(root, itemPath);
|
|
182
|
+
if (lexical === root || !lexical.startsWith(`${root}${sep}`)) {
|
|
183
|
+
throw new Error(`delivery path escapes the artifact folder: ${itemPath}`);
|
|
184
|
+
}
|
|
185
|
+
let target;
|
|
186
|
+
try {
|
|
187
|
+
target = realpathSync(lexical);
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
throw new Error(`delivery path does not exist: ${itemPath} (${error instanceof Error ? error.message : String(error)})`);
|
|
191
|
+
}
|
|
192
|
+
if (!target.startsWith(`${root}${sep}`)) {
|
|
193
|
+
throw new Error(`delivery path escapes the artifact folder through a symlink: ${itemPath}`);
|
|
194
|
+
}
|
|
195
|
+
const stat = lstatSync(target);
|
|
196
|
+
if (!stat.isFile() && !stat.isDirectory()) {
|
|
197
|
+
throw new Error(`delivery path must be a file or directory: ${itemPath}`);
|
|
198
|
+
}
|
|
199
|
+
return target;
|
|
200
|
+
}
|
|
201
|
+
function discoverArtifactRootItems(artifactPath) {
|
|
202
|
+
return readdirSync(artifactPath, { withFileTypes: true })
|
|
203
|
+
.filter((entry) => !entry.name.startsWith(".") &&
|
|
204
|
+
entry.name !== ARTIFACT_MANIFEST &&
|
|
205
|
+
entry.name !== ARTIFACT_DELIVERY_MANIFEST &&
|
|
206
|
+
(entry.isFile() || entry.isDirectory()))
|
|
207
|
+
.map((entry) => ({
|
|
208
|
+
name: entry.name,
|
|
209
|
+
path: resolveArtifactItem(artifactPath, entry.name),
|
|
210
|
+
directory: entry.isDirectory(),
|
|
211
|
+
}))
|
|
212
|
+
.sort((left, right) => {
|
|
213
|
+
if (left.directory !== right.directory)
|
|
214
|
+
return left.directory ? -1 : 1;
|
|
215
|
+
return left.name.localeCompare(right.name, "en");
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function displayPath(path, environment) {
|
|
219
|
+
const distro = environment.wslDistroName ?? process.env.WSL_DISTRO_NAME;
|
|
220
|
+
const platform = environment.platform ?? process.platform;
|
|
221
|
+
if (platform === "linux" && distro) {
|
|
222
|
+
const suffix = resolve(path).replaceAll("/", "\\");
|
|
223
|
+
return `\\\\wsl.localhost\\${distro}${suffix}`;
|
|
224
|
+
}
|
|
225
|
+
if (platform === "linux" &&
|
|
226
|
+
(process.env.WSL_INTEROP || process.env.HARNERY_AGENT_COORD_BRIDGE === "codex-wsl")) {
|
|
227
|
+
try {
|
|
228
|
+
return execFileSync("wslpath", ["-w", resolve(path)], { encoding: "utf8" }).trim();
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
// Fall through to the native path when wslpath is unavailable.
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return resolve(path);
|
|
235
|
+
}
|
|
236
|
+
function deliveryLinkBase(repoRoot, environment) {
|
|
237
|
+
const webPort = environment.webPort ?? resolveWebPort(undefined, repoRoot);
|
|
238
|
+
// Every href below is a dashboard route, so only a tunnel that serves the
|
|
239
|
+
// dashboard's own origin will answer them. A tunnel sharing this upstream
|
|
240
|
+
// port under another Host serves a different site and would 400 on /browse
|
|
241
|
+
// and /files, so fall back to the local URL rather than publish that host.
|
|
242
|
+
const tunnelUrl = environment.tunnelUrl === undefined
|
|
243
|
+
? findLiveTunnelForOrigin(webPort, `localhost:${webPort}`, repoRoot)?.url
|
|
244
|
+
: environment.tunnelUrl;
|
|
245
|
+
return (tunnelUrl ?? `http://localhost:${webPort}`).replace(/\/+$/, "");
|
|
246
|
+
}
|
|
247
|
+
function artifactBrowserUrl(repoRoot, target, base, directory) {
|
|
248
|
+
const relPath = relative(realpathSync(repoRoot), realpathSync(target)).split(sep).join("/");
|
|
249
|
+
const query = directory
|
|
250
|
+
? `dir=${encodeLinkSafeComponent(relPath)}`
|
|
251
|
+
: `path=${encodeLinkSafeComponent(relPath)}`;
|
|
252
|
+
return `${base}/${directory ? "browse" : "files"}?${query}`;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Render a destination for a Markdown inline link.
|
|
256
|
+
*
|
|
257
|
+
* The angle-bracket form is valid CommonMark but not every renderer implements
|
|
258
|
+
* it, and one that does not can style the text as a link while dropping the
|
|
259
|
+
* href, leaving something that looks clickable and is not. So use the plain
|
|
260
|
+
* form, which every renderer handles, and reserve the brackets for a supplied
|
|
261
|
+
* URL that actually needs them.
|
|
262
|
+
*/
|
|
263
|
+
function markdownDestination(href) {
|
|
264
|
+
return /[\s()<>]/.test(href) ? `<${href}>` : href;
|
|
265
|
+
}
|
|
266
|
+
function iconForPath(path) {
|
|
267
|
+
if (lstatSync(path).isDirectory())
|
|
268
|
+
return "📁";
|
|
269
|
+
if (imagePath(path))
|
|
270
|
+
return "🖼️";
|
|
271
|
+
if (/\.(?:m4v|mkv|mov|mp4|webm)$/i.test(path))
|
|
272
|
+
return "🎬";
|
|
273
|
+
if (/\.(?:aac|flac|m4a|mp3|ogg|wav)$/i.test(path))
|
|
274
|
+
return "🎵";
|
|
275
|
+
return "📄";
|
|
276
|
+
}
|
|
277
|
+
function imagePath(path) {
|
|
278
|
+
return /\.(?:avif|gif|jpe?g|png|svg|webp)$/i.test(path);
|
|
279
|
+
}
|
|
280
|
+
function escapeMarkdown(value) {
|
|
281
|
+
return value.replaceAll("\\", "\\\\").replaceAll("[", "\\[").replaceAll("]", "\\]");
|
|
282
|
+
}
|
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* managed unit with a small manifest. Cleanup fails closed: only a valid,
|
|
8
8
|
* expired, inactive, untracked managed unit is deletable.
|
|
9
9
|
*/
|
|
10
|
+
import { type ArtifactActivity } from "./activity.js";
|
|
10
11
|
import { ARTIFACT_SCHEMA_VERSION } from "./constants.js";
|
|
11
12
|
export { ARTIFACT_MANIFEST, ARTIFACT_SCHEMA_VERSION, ARTIFACTS_DIR } from "./constants.js";
|
|
13
|
+
export type { ArtifactDeliveryCard, ArtifactDeliveryItem, ArtifactDeliveryManifest, ArtifactDeliveryPath, ArtifactDeliveryUrl, } from "./delivery-card.js";
|
|
14
|
+
export { ARTIFACT_DELIVERY_AUTO_ITEM_LIMIT, ARTIFACT_DELIVERY_MANIFEST, ARTIFACT_DELIVERY_SCHEMA_VERSION, parseArtifactDeliverySpec, readArtifactDeliveryManifest, renderArtifactDeliveryCard, resolveArtifactDeliveryManifest, writeArtifactDeliveryManifest, } from "./delivery-card.js";
|
|
12
15
|
export interface ArtifactActor {
|
|
13
16
|
instance_id: string;
|
|
14
17
|
session_id?: string;
|
|
@@ -30,6 +33,7 @@ export interface ArtifactManifestV2 {
|
|
|
30
33
|
released_at?: string;
|
|
31
34
|
released_by?: ArtifactActor;
|
|
32
35
|
oversize_acknowledged?: boolean;
|
|
36
|
+
activity?: ArtifactActivity;
|
|
33
37
|
}
|
|
34
38
|
export interface ArtifactHold {
|
|
35
39
|
id: string;
|
|
@@ -47,6 +51,8 @@ export declare function artifactCapabilities(): {
|
|
|
47
51
|
readonly atomic_create_holds: true;
|
|
48
52
|
readonly owner_scoped_unhold: true;
|
|
49
53
|
readonly explicit_v1_migration: true;
|
|
54
|
+
readonly minute_retention: true;
|
|
55
|
+
readonly discard_after_review: true;
|
|
50
56
|
};
|
|
51
57
|
export type ArtifactClassification = "managed-held" | "managed-active" | "managed-current" | "managed-expired" | "managed-oversize" | "managed-over-budget" | "managed-tracked" | "invalid-manifest" | "unmanaged" | "symlink" | "unknown";
|
|
52
58
|
export interface ArtifactInventoryEntry {
|
|
@@ -122,8 +128,16 @@ export declare function showArtifact(repoRoot: string, ref: string, opts?: {
|
|
|
122
128
|
entry: ArtifactInventoryEntry;
|
|
123
129
|
manifest: ArtifactManifestV2;
|
|
124
130
|
};
|
|
125
|
-
export declare function renewArtifact(repoRoot: string, ref: string, days: number
|
|
131
|
+
export declare function renewArtifact(repoRoot: string, ref: string, days: number | {
|
|
132
|
+
minutes: number;
|
|
133
|
+
}, reason: string, input?: ArtifactMutationInput): ArtifactManifestV2;
|
|
126
134
|
export declare function releaseArtifact(repoRoot: string, ref: string, input?: ArtifactMutationInput): ArtifactManifestV2;
|
|
135
|
+
/** Retire reviewed evidence without deleting it or extending an earlier deadline. */
|
|
136
|
+
export declare function discardArtifact(repoRoot: string, ref: string, reason: string, input?: ArtifactMutationInput & {
|
|
137
|
+
minutes?: number;
|
|
138
|
+
}): ArtifactManifestV2;
|
|
139
|
+
/** Advice only: a successful check does not establish that its evidence is disposable. */
|
|
140
|
+
export declare function artifactReviewGuidance(repoRoot: string, ref: string): string;
|
|
127
141
|
export declare function holdArtifact(repoRoot: string, ref: string, input: ArtifactHoldInput & {
|
|
128
142
|
actor: ArtifactActor;
|
|
129
143
|
now?: Date;
|
|
@@ -148,24 +162,27 @@ export declare function cleanArtifacts(repoRoot: string, opts?: {
|
|
|
148
162
|
}): ArtifactInventoryEntry[];
|
|
149
163
|
export interface ArtifactAutoCleanResult {
|
|
150
164
|
ran: boolean;
|
|
151
|
-
reason: "swept" | "disabled" | "fresh" | "no-root";
|
|
165
|
+
reason: "swept" | "partial" | "failed" | "disabled" | "fresh" | "no-root";
|
|
152
166
|
deleted: number;
|
|
153
167
|
bytes: number;
|
|
154
168
|
}
|
|
155
169
|
/**
|
|
156
|
-
* Throttled expired-artifact sweep, fired
|
|
170
|
+
* Throttled expired-artifact sweep, fired at SessionStart and before new work.
|
|
157
171
|
*
|
|
158
172
|
* Retention was previously enforced only when someone remembered to run
|
|
159
173
|
* `artifacts clean --yes`, so expired workspaces accumulated indefinitely on
|
|
160
|
-
* busy hosts. This runs the exact same guarded deletion (
|
|
161
|
-
*
|
|
174
|
+
* busy hosts. This runs the exact same guarded deletion (expired or over-budget
|
|
175
|
+
* managed entries, each re-classified immediately before removal;
|
|
162
176
|
* unmanaged and legacy directories are never touched) at most once per
|
|
163
|
-
* interval (default
|
|
164
|
-
*
|
|
177
|
+
* interval (default 1h after completion, 1m between partial/failed slices).
|
|
178
|
+
* The owner-aware lock serializes callers; interrupted attempts can retry.
|
|
179
|
+
* Disable with `artifacts.auto_clean: false` or
|
|
165
180
|
* `HARNERY_ARTIFACT_AUTO_CLEAN=0`.
|
|
166
181
|
*/
|
|
167
182
|
export declare function autoCleanArtifacts(repoRoot: string, opts?: {
|
|
168
183
|
now?: Date;
|
|
184
|
+
maxDeletes?: number;
|
|
185
|
+
timeBudgetMs?: number;
|
|
169
186
|
}): ArtifactAutoCleanResult;
|
|
170
187
|
export declare function resolveArtifactRef(repoRoot: string, ref: string): string;
|
|
171
188
|
/** Validate only the current schema. Legacy conversion belongs to migrateArtifacts. */
|
|
@@ -179,5 +196,23 @@ export interface ArtifactMigrationEntry {
|
|
|
179
196
|
/** Explicit, bounded v1 cutover. Preview never writes; every applied unit keeps its exact preimage. */
|
|
180
197
|
export declare function migrateArtifacts(repoRoot: string, opts?: {
|
|
181
198
|
yes?: boolean;
|
|
199
|
+
now?: Date;
|
|
182
200
|
}): ArtifactMigrationEntry[];
|
|
201
|
+
export interface ArtifactActivityRepairEntry {
|
|
202
|
+
path: string;
|
|
203
|
+
action: "keep" | "would-repair" | "repaired";
|
|
204
|
+
reason: string;
|
|
205
|
+
previous_expires_at?: string;
|
|
206
|
+
repaired_expires_at?: string;
|
|
207
|
+
receipt_path?: string;
|
|
208
|
+
}
|
|
209
|
+
/** Repair only a provable, untouched v1-to-v2 migration. Never delete payloads.
|
|
210
|
+
* Old migrations saved the original manifest but not the original root stat.
|
|
211
|
+
* The exact preimage and coincident root/manifest/receipt timestamps bound this
|
|
212
|
+
* correction. Any later root change or metadata mutation requires manual review.
|
|
213
|
+
*/
|
|
214
|
+
export declare function repairArtifactActivity(repoRoot: string, opts?: {
|
|
215
|
+
yes?: boolean;
|
|
216
|
+
now?: Date;
|
|
217
|
+
}): ArtifactActivityRepairEntry[];
|
|
183
218
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA2BH,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAqB,uBAAuB,EAAiB,MAAM,gBAAgB,CAAC;AAG3F,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC3F,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iC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