harnery 0.33.0 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +4 -0
- package/dist/commands/adapter.js +2 -2
- package/dist/commands/agents.d.ts +144 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +1237 -590
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +7 -6
- package/dist/commands/backup.d.ts +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +29 -16
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +234 -12
- package/dist/commands/checkpoint.d.ts.map +1 -1
- package/dist/commands/checkpoint.js +3 -2
- package/dist/commands/claude-desktop.d.ts +1 -1
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +3 -74
- package/dist/commands/context.js +1 -6
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +22 -38
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +91 -28
- package/dist/commands/doctor.js +10 -1
- package/dist/commands/events.d.ts +5 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +189 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +13 -4
- package/dist/commands/init.d.ts +9 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +223 -51
- package/dist/commands/journal.d.ts.map +1 -1
- package/dist/commands/journal.js +4 -13
- package/dist/commands/ledger-v3.d.ts +5 -0
- package/dist/commands/ledger-v3.d.ts.map +1 -0
- package/dist/commands/ledger-v3.js +91 -0
- package/dist/commands/presence.d.ts.map +1 -1
- package/dist/commands/presence.js +11 -5
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/web.d.ts +6 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +67 -7
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +22 -5
- package/dist/core/adapter.d.ts +5 -0
- package/dist/core/adapter.d.ts.map +1 -0
- package/dist/core/adapter.js +1 -0
- package/dist/core/adapters/attest.d.ts +5 -2
- package/dist/core/adapters/attest.d.ts.map +1 -1
- package/dist/core/adapters/attest.js +8 -3
- package/dist/core/adapters/profiles.d.ts +6 -6
- package/dist/core/adapters/profiles.d.ts.map +1 -1
- package/dist/core/adapters/profiles.js +4 -4
- package/dist/core/agents/canonical-emit.d.ts +17 -15
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +22 -22
- package/dist/core/agents/cli.js +207 -234
- package/dist/core/agents/codex-archive-v3.d.ts +14 -0
- package/dist/core/agents/codex-archive-v3.d.ts.map +1 -0
- package/dist/core/agents/codex-archive-v3.js +110 -0
- package/dist/core/agents/coord-client.d.ts +19 -81
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +65 -155
- package/dist/core/agents/finalization.d.ts +4 -1
- package/dist/core/agents/finalization.d.ts.map +1 -1
- package/dist/core/agents/finalization.js +89 -32
- package/dist/core/agents/index.d.ts +4 -5
- package/dist/core/agents/index.d.ts.map +1 -1
- package/dist/core/agents/index.js +4 -5
- package/dist/core/agents/live-authority-v3.d.ts +59 -0
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -0
- package/dist/core/agents/live-authority-v3.js +233 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts +20 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -0
- package/dist/core/agents/live-lifecycle-v3.js +91 -0
- package/dist/core/agents/live-observation-v3.d.ts +25 -0
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -0
- package/dist/core/agents/live-observation-v3.js +157 -0
- package/dist/core/agents/render/prompt-context.d.ts +4 -4
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +23 -58
- package/dist/core/agents/render/session-context.d.ts +1 -1
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +8 -32
- package/dist/core/agents/rules/claim-conflict.d.ts +3 -3
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +79 -127
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +3 -18
- package/dist/core/agents/rules/stop-hook.d.ts +9 -50
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +193 -236
- package/dist/core/agents/session-events.d.ts +5 -7
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +127 -95
- package/dist/core/agents/session-finalization-state-v3.d.ts +30 -0
- package/dist/core/agents/session-finalization-state-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalization-state-v3.js +40 -0
- package/dist/core/agents/session-finalizer-v3.d.ts +107 -0
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalizer-v3.js +734 -0
- package/dist/core/agents/session-name-display.d.ts +40 -0
- package/dist/core/agents/session-name-display.d.ts.map +1 -0
- package/dist/core/agents/session-name-display.js +119 -0
- package/dist/core/agents/state/activity-log.d.ts +3 -3
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +7 -16
- package/dist/core/agents/state/heartbeat-writer.d.ts +23 -55
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +56 -228
- package/dist/core/agents/state/live-coordination-view.d.ts +31 -0
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-view.js +209 -0
- package/dist/core/agents/state/session-state.d.ts +4 -3
- package/dist/core/agents/state/session-state.d.ts.map +1 -1
- package/dist/core/agents/state/session-state.js +18 -9
- package/dist/core/agents/state/stale-sweep.d.ts +1 -1
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +26 -15
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +5 -7
- package/dist/core/config.d.ts +33 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -2
- package/dist/core/context/index.d.ts +1 -4
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/index.js +9 -9
- package/dist/core/events/span-parent.d.ts +15 -0
- package/dist/core/events/span-parent.d.ts.map +1 -0
- package/dist/core/events/span-parent.js +34 -0
- package/dist/core/events/v3/advance.d.ts +14 -0
- package/dist/core/events/v3/advance.d.ts.map +1 -0
- package/dist/core/events/v3/advance.js +134 -0
- package/dist/core/events/v3/authority-outbox.d.ts +78 -0
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -0
- package/dist/core/events/v3/authority-outbox.js +399 -0
- package/dist/core/events/v3/base-builder.d.ts +20 -0
- package/dist/core/events/v3/base-builder.d.ts.map +1 -0
- package/dist/core/events/v3/base-builder.js +29 -0
- package/dist/core/events/v3/base-contract.d.ts +7576 -0
- package/dist/core/events/v3/base-contract.d.ts.map +1 -0
- package/dist/core/events/v3/base-contract.js +647 -0
- package/dist/core/events/v3/bootstrap.d.ts +34 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -0
- package/dist/core/events/v3/bootstrap.js +175 -0
- package/dist/core/events/v3/builder.d.ts +20 -0
- package/dist/core/events/v3/builder.d.ts.map +1 -0
- package/dist/core/events/v3/builder.js +28 -0
- package/dist/core/events/v3/canonical.d.ts +31 -0
- package/dist/core/events/v3/canonical.d.ts.map +1 -0
- package/dist/core/events/v3/canonical.js +100 -0
- package/dist/core/events/v3/capabilities.d.ts +31 -0
- package/dist/core/events/v3/capabilities.d.ts.map +1 -0
- package/dist/core/events/v3/capabilities.js +107 -0
- package/dist/core/events/v3/capability-drift.d.ts +22 -0
- package/dist/core/events/v3/capability-drift.d.ts.map +1 -0
- package/dist/core/events/v3/capability-drift.js +134 -0
- package/dist/core/events/v3/catalog.d.ts +38 -0
- package/dist/core/events/v3/catalog.d.ts.map +1 -0
- package/dist/core/events/v3/catalog.js +135 -0
- package/dist/core/events/v3/clock-order.d.ts +34 -0
- package/dist/core/events/v3/clock-order.d.ts.map +1 -0
- package/dist/core/events/v3/clock-order.js +35 -0
- package/dist/core/events/v3/contract.d.ts +171 -0
- package/dist/core/events/v3/contract.d.ts.map +1 -0
- package/dist/core/events/v3/contract.js +180 -0
- package/dist/core/events/v3/control.d.ts +111 -0
- package/dist/core/events/v3/control.d.ts.map +1 -0
- package/dist/core/events/v3/control.js +419 -0
- package/dist/core/events/v3/coordination-view.d.ts +69 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-view.js +119 -0
- package/dist/core/events/v3/economics.d.ts +77 -0
- package/dist/core/events/v3/economics.d.ts.map +1 -0
- package/dist/core/events/v3/economics.js +274 -0
- package/dist/core/events/v3/finalization-view.d.ts +26 -0
- package/dist/core/events/v3/finalization-view.d.ts.map +1 -0
- package/dist/core/events/v3/finalization-view.js +37 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts +25 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts.map +1 -0
- package/dist/core/events/v3/fingerprint-keys.js +217 -0
- package/dist/core/events/v3/generated.d.ts +4 -0
- package/dist/core/events/v3/generated.d.ts.map +1 -0
- package/dist/core/events/v3/generated.js +47 -0
- package/dist/core/events/v3/ids.d.ts +9 -0
- package/dist/core/events/v3/ids.d.ts.map +1 -0
- package/dist/core/events/v3/ids.js +25 -0
- package/dist/core/events/v3/index.d.ts +35 -0
- package/dist/core/events/v3/index.d.ts.map +1 -0
- package/dist/core/events/v3/index.js +33 -0
- package/dist/core/events/v3/latency.d.ts +63 -0
- package/dist/core/events/v3/latency.d.ts.map +1 -0
- package/dist/core/events/v3/latency.js +412 -0
- package/dist/core/events/v3/live-feed.d.ts +45 -0
- package/dist/core/events/v3/live-feed.d.ts.map +1 -0
- package/dist/core/events/v3/live-feed.js +246 -0
- package/dist/core/events/v3/live-observation.d.ts +35 -0
- package/dist/core/events/v3/live-observation.d.ts.map +1 -0
- package/dist/core/events/v3/live-observation.js +1 -0
- package/dist/core/events/v3/live-routing.d.ts +57 -0
- package/dist/core/events/v3/live-routing.d.ts.map +1 -0
- package/dist/core/events/v3/live-routing.js +107 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts +67 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command-recorder.js +477 -0
- package/dist/core/events/v3/producers/command.d.ts +50 -0
- package/dist/core/events/v3/producers/command.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command.js +135 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +53 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination-recorder.js +376 -0
- package/dist/core/events/v3/producers/coordination.d.ts +90 -0
- package/dist/core/events/v3/producers/coordination.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination.js +229 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +54 -0
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook-base.js +424 -0
- package/dist/core/events/v3/producers/hook.d.ts +29 -0
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook.js +71 -0
- package/dist/core/events/v3/producers/intake.d.ts +65 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -0
- package/dist/core/events/v3/producers/intake.js +244 -0
- package/dist/core/events/v3/producers/recorder.d.ts +240 -0
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/recorder.js +2176 -0
- package/dist/core/events/v3/projection.d.ts +101 -0
- package/dist/core/events/v3/projection.d.ts.map +1 -0
- package/dist/core/events/v3/projection.js +479 -0
- package/dist/core/events/v3/reader.d.ts +75 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -0
- package/dist/core/events/v3/reader.js +778 -0
- package/dist/core/events/v3/recovery-record.d.ts +47 -0
- package/dist/core/events/v3/recovery-record.d.ts.map +1 -0
- package/dist/core/events/v3/recovery-record.js +167 -0
- package/dist/core/events/v3/recovery.d.ts +22 -0
- package/dist/core/events/v3/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/recovery.js +227 -0
- package/dist/core/events/v3/span-state.d.ts +52 -0
- package/dist/core/events/v3/span-state.d.ts.map +1 -0
- package/dist/core/events/v3/span-state.js +142 -0
- package/dist/core/events/v3/targets.d.ts +23 -0
- package/dist/core/events/v3/targets.d.ts.map +1 -0
- package/dist/core/events/v3/targets.js +134 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +41 -0
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -0
- package/dist/core/events/v3/turn-telemetry.js +168 -0
- package/dist/core/events/v3/validate.d.ts +9 -0
- package/dist/core/events/v3/validate.d.ts.map +1 -0
- package/dist/core/events/v3/validate.js +281 -0
- package/dist/core/events/v3/writer.d.ts +56 -0
- package/dist/core/events/v3/writer.d.ts.map +1 -0
- package/dist/core/events/v3/writer.js +335 -0
- package/dist/core/governor/index.d.ts +1 -1
- package/dist/core/governor/index.d.ts.map +1 -1
- package/dist/core/governor/index.js +1 -1
- package/dist/core/governor/plan-api.d.ts +2 -1
- package/dist/core/governor/plan-api.d.ts.map +1 -1
- package/dist/core/governor/plan-api.js +6 -3
- package/dist/core/governor/read.d.ts +1 -1
- package/dist/core/governor/read.d.ts.map +1 -1
- package/dist/core/governor/read.js +1 -1
- package/dist/core/governor/state.d.ts +9 -0
- package/dist/core/governor/state.d.ts.map +1 -1
- package/dist/core/governor/state.js +40 -3
- package/dist/core/guard/config.d.ts +5 -0
- package/dist/core/guard/config.d.ts.map +1 -0
- package/dist/core/guard/config.js +157 -0
- package/dist/core/guard/coordinator.d.ts +14 -0
- package/dist/core/guard/coordinator.d.ts.map +1 -0
- package/dist/core/guard/coordinator.js +173 -0
- package/dist/core/guard/evaluator.d.ts +4 -0
- package/dist/core/guard/evaluator.d.ts.map +1 -0
- package/dist/core/guard/evaluator.js +242 -0
- package/dist/core/guard/evidence-v3.d.ts +15 -0
- package/dist/core/guard/evidence-v3.d.ts.map +1 -0
- package/dist/core/guard/evidence-v3.js +171 -0
- package/dist/core/guard/index.d.ts +10 -0
- package/dist/core/guard/index.d.ts.map +1 -0
- package/dist/core/guard/index.js +6 -0
- package/dist/core/guard/live-source-v3.d.ts +40 -0
- package/dist/core/guard/live-source-v3.d.ts.map +1 -0
- package/dist/core/guard/live-source-v3.js +128 -0
- package/dist/core/guard/storage.d.ts +27 -0
- package/dist/core/guard/storage.d.ts.map +1 -0
- package/dist/core/guard/storage.js +140 -0
- package/dist/core/guard/types.d.ts +119 -0
- package/dist/core/guard/types.d.ts.map +1 -0
- package/dist/core/guard/types.js +1 -0
- package/dist/core/hooks/adapter/detect.d.ts +18 -1
- package/dist/core/hooks/adapter/detect.d.ts.map +1 -1
- package/dist/core/hooks/adapter/detect.js +29 -0
- package/dist/core/hooks/adapter/events.d.ts +7 -4
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +12 -4
- package/dist/core/hooks/adapter/output.d.ts +2 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.d.ts +7 -4
- package/dist/core/hooks/adapter/parse.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.js +63 -25
- package/dist/core/hooks/adapter/wiring.d.ts +30 -4
- package/dist/core/hooks/adapter/wiring.d.ts.map +1 -1
- package/dist/core/hooks/adapter/wiring.js +89 -11
- package/dist/core/hooks/cli.d.ts +1 -1
- package/dist/core/hooks/cli.js +306 -444
- package/dist/core/hooks/effects/image-capture.d.ts +20 -34
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +212 -221
- package/dist/core/hooks/effects/index.d.ts +1 -9
- package/dist/core/hooks/effects/index.d.ts.map +1 -1
- package/dist/core/hooks/effects/index.js +1 -24
- package/dist/core/hooks/events/input-hash.d.ts +7 -0
- package/dist/core/hooks/events/input-hash.d.ts.map +1 -0
- package/dist/core/hooks/events/input-hash.js +43 -0
- package/dist/core/hooks/index.d.ts +4 -3
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +2 -3
- package/dist/core/hooks/resolve/coord-root.d.ts +1 -1
- package/dist/core/hooks/resolve/coord-root.js +1 -1
- package/dist/core/hooks/resolve/owner.d.ts +16 -15
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +51 -42
- package/dist/core/hooks/resolve/transcript.d.ts +33 -3
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +161 -14
- package/dist/core/hooks/session-name-presence.d.ts +9 -10
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +15 -15
- package/dist/core/hooks/unsafe-cross-shell.d.ts +1 -1
- package/dist/core/hooks/unsafe-cross-shell.d.ts.map +1 -1
- package/dist/core/journal/index.d.ts +2 -2
- package/dist/core/journal/index.d.ts.map +1 -1
- package/dist/core/journal/index.js +9 -22
- package/dist/core/presence/blob.d.ts +4 -3
- package/dist/core/presence/blob.d.ts.map +1 -1
- package/dist/core/presence/blob.js +45 -44
- package/dist/core/presence/codec-digest.d.ts +29 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -0
- package/dist/core/presence/codec-digest.js +170 -0
- package/dist/core/presence/relay-client.d.ts +1 -1
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +5 -5
- package/dist/core/work/index.d.ts +1 -1
- package/dist/core/work/index.d.ts.map +1 -1
- package/dist/core/work/index.js +1 -1
- package/dist/core/work/read.d.ts +1 -1
- package/dist/core/work/read.d.ts.map +1 -1
- package/dist/core/work/read.js +1 -1
- package/dist/core/work/runner.d.ts.map +1 -1
- package/dist/core/work/runner.js +6 -0
- package/dist/core/work/state.d.ts +9 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +17 -3
- package/dist/core/workflow/engine.js +24 -25
- package/dist/core/workflow/live-session-v3.d.ts +19 -0
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -0
- package/dist/core/workflow/live-session-v3.js +86 -0
- package/dist/core/workflow/scope-id.d.ts +3 -0
- package/dist/core/workflow/scope-id.d.ts.map +1 -0
- package/dist/core/workflow/scope-id.js +5 -0
- package/dist/core/workflow/workspaces/leases.d.ts +4 -0
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/leases.js +53 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/browser/client.d.ts +41 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +203 -0
- package/dist/lib/browser/critique.d.ts +28 -2
- package/dist/lib/browser/critique.d.ts.map +1 -1
- package/dist/lib/browser/critique.js +74 -18
- package/dist/lib/browser/geometry.d.ts +1 -1
- package/dist/lib/browser/geometry.d.ts.map +1 -1
- package/dist/lib/browser/geometry.js +130 -6
- package/dist/lib/browser/index.d.ts +3 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +3 -0
- package/dist/lib/browser/qa-plan.d.ts +174 -0
- package/dist/lib/browser/qa-plan.d.ts.map +1 -0
- package/dist/lib/browser/qa-plan.js +321 -0
- package/dist/lib/browser/qa-reuse.d.ts +99 -0
- package/dist/lib/browser/qa-reuse.d.ts.map +1 -0
- package/dist/lib/browser/qa-reuse.js +222 -0
- package/dist/lib/browser/qa-snapshot.d.ts +64 -0
- package/dist/lib/browser/qa-snapshot.d.ts.map +1 -0
- package/dist/lib/browser/qa-snapshot.js +171 -0
- package/dist/lib/browser/runts.d.ts.map +1 -1
- package/dist/lib/browser/runts.js +22 -1
- package/dist/lib/browser/tiling.d.ts +71 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -0
- package/dist/lib/browser/tiling.js +118 -0
- package/dist/lib/claude-desktop.d.ts +0 -47
- package/dist/lib/claude-desktop.d.ts.map +1 -1
- package/dist/lib/claude-desktop.js +1 -169
- package/dist/lib/context/index.d.ts +0 -3
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/context/index.js +20 -42
- package/dist/lib/council/index.d.ts +2 -2
- package/dist/lib/council/index.d.ts.map +1 -1
- package/dist/lib/council/index.js +9 -20
- package/dist/lib/docs-frontmatter.d.ts +1 -6
- package/dist/lib/docs-frontmatter.d.ts.map +1 -1
- package/dist/lib/docs-frontmatter.js +12 -78
- package/dist/lib/docs-index.d.ts +9 -0
- package/dist/lib/docs-index.d.ts.map +1 -1
- package/dist/lib/docs-index.js +32 -3
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +14 -30
- package/dist/lib/docs-metadata-audit.d.ts +19 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -0
- package/dist/lib/docs-metadata-audit.js +132 -0
- package/dist/lib/docs-metadata-managed.d.ts +23 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -0
- package/dist/lib/docs-metadata-managed.js +78 -0
- package/dist/lib/docs-metadata-sync.d.ts +20 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -0
- package/dist/lib/docs-metadata-sync.js +222 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts +273 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2-schema.js +134 -0
- package/dist/lib/docs-metadata-v2.d.ts +21 -0
- package/dist/lib/docs-metadata-v2.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2.js +424 -0
- package/dist/lib/docs-new.d.ts +11 -0
- package/dist/lib/docs-new.d.ts.map +1 -0
- package/dist/lib/docs-new.js +52 -0
- package/dist/lib/docs-sweep.d.ts.map +1 -1
- package/dist/lib/docs-sweep.js +45 -29
- package/dist/lib/headless/index.d.ts +98 -0
- package/dist/lib/headless/index.d.ts.map +1 -0
- package/dist/lib/headless/index.js +211 -0
- package/dist/lib/identities/assume.d.ts +4 -4
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +52 -68
- package/dist/lib/instructions/apply.d.ts +5 -4
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +32 -20
- package/dist/lib/instructions/bundle.d.ts +1 -1
- package/dist/lib/instructions/bundle.d.ts.map +1 -1
- package/dist/lib/instructions/bundle.js +1 -1
- package/dist/lib/instructions/splice.d.ts +0 -1
- package/dist/lib/instructions/splice.d.ts.map +1 -1
- package/dist/lib/instructions/splice.js +22 -6
- package/dist/lib/instructions/templates.d.ts +7 -5
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +79 -9
- package/package.json +26 -5
- package/schemas/config.schema.json +120 -2
- package/schemas/docs-metadata-v2.schema.json +441 -0
- package/schemas/event-v3.schema.json +24472 -0
- package/src/commander.ts +4 -0
- package/src/commands/adapter.ts +2 -2
- package/src/commands/agents.ts +1530 -593
- package/src/commands/artifacts.ts +7 -6
- package/src/commands/backup.ts +29 -21
- package/src/commands/browse.ts +349 -8
- package/src/commands/checkpoint.ts +4 -3
- package/src/commands/claude-desktop.ts +2 -101
- package/src/commands/context.ts +1 -6
- package/src/commands/decision.ts +27 -44
- package/src/commands/docs.ts +100 -33
- package/src/commands/doctor.ts +14 -1
- package/src/commands/events.ts +256 -0
- package/src/commands/governor.ts +18 -4
- package/src/commands/init.ts +253 -57
- package/src/commands/instructions.ts +1 -1
- package/src/commands/journal.ts +4 -13
- package/src/commands/ledger-v3.ts +111 -0
- package/src/commands/presence.ts +11 -10
- package/src/commands/sync.ts +1 -1
- package/src/commands/web.ts +67 -8
- package/src/commands/work.ts +28 -5
- package/src/core/adapter.ts +5 -0
- package/src/core/adapters/attest.ts +8 -3
- package/src/core/adapters/profiles.ts +4 -6
- package/src/core/agents/canonical-emit.ts +34 -25
- package/src/core/agents/cli.ts +236 -262
- package/src/core/agents/codex-archive-v3.ts +138 -0
- package/src/core/agents/coord-client.ts +75 -188
- package/src/core/agents/finalization.ts +120 -38
- package/src/core/agents/index.ts +4 -5
- package/src/core/agents/live-authority-v3.ts +375 -0
- package/src/core/agents/live-lifecycle-v3.ts +140 -0
- package/src/core/agents/live-observation-v3.ts +216 -0
- package/src/core/agents/render/prompt-context.ts +29 -60
- package/src/core/agents/render/session-context.ts +10 -31
- package/src/core/agents/rules/claim-conflict.ts +85 -126
- package/src/core/agents/rules/commit-conflict.ts +3 -14
- package/src/core/agents/rules/stop-hook.ts +239 -293
- package/src/core/agents/session-events.ts +137 -104
- package/src/core/agents/session-finalization-state-v3.ts +90 -0
- package/src/core/agents/session-finalizer-v3.ts +953 -0
- package/src/core/agents/session-name-display.ts +149 -0
- package/src/core/agents/state/activity-log.ts +6 -14
- package/src/core/agents/state/heartbeat-writer.ts +82 -277
- package/src/core/agents/state/live-coordination-view.ts +290 -0
- package/src/core/agents/state/session-state.ts +24 -12
- package/src/core/agents/state/stale-sweep.ts +40 -17
- package/src/core/artifacts/index.ts +4 -5
- package/src/core/config.ts +148 -3
- package/src/core/context/index.ts +9 -17
- package/src/core/events/span-parent.ts +46 -0
- package/src/core/events/v3/advance.ts +168 -0
- package/src/core/events/v3/authority-outbox.ts +548 -0
- package/src/core/events/v3/base-builder.ts +60 -0
- package/src/core/events/v3/base-contract.ts +882 -0
- package/src/core/events/v3/bootstrap.ts +226 -0
- package/src/core/events/v3/builder.ts +59 -0
- package/src/core/events/v3/canonical.ts +153 -0
- package/src/core/events/v3/capabilities.ts +171 -0
- package/src/core/events/v3/capability-drift.ts +177 -0
- package/src/core/events/v3/catalog.ts +202 -0
- package/src/core/events/v3/clock-order.ts +41 -0
- package/src/core/events/v3/contract.ts +365 -0
- package/src/core/events/v3/control.ts +576 -0
- package/src/core/events/v3/coordination-view.ts +193 -0
- package/src/core/events/v3/economics.ts +384 -0
- package/src/core/events/v3/finalization-view.ts +67 -0
- package/src/core/events/v3/fingerprint-keys.ts +260 -0
- package/src/core/events/v3/generated.ts +48 -0
- package/src/core/events/v3/ids.ts +33 -0
- package/src/core/events/v3/index.ts +322 -0
- package/src/core/events/v3/latency.ts +551 -0
- package/src/core/events/v3/live-feed.ts +319 -0
- package/src/core/events/v3/live-observation.ts +39 -0
- package/src/core/events/v3/live-routing.ts +135 -0
- package/src/core/events/v3/producers/command-recorder.ts +631 -0
- package/src/core/events/v3/producers/command.ts +201 -0
- package/src/core/events/v3/producers/coordination-recorder.ts +538 -0
- package/src/core/events/v3/producers/coordination.ts +355 -0
- package/src/core/events/v3/producers/hook-base.ts +578 -0
- package/src/core/events/v3/producers/hook.ts +119 -0
- package/src/core/events/v3/producers/intake.ts +319 -0
- package/src/core/events/v3/producers/recorder.ts +2805 -0
- package/src/core/events/v3/projection.ts +653 -0
- package/src/core/events/v3/reader.ts +1127 -0
- package/src/core/events/v3/recovery-record.ts +244 -0
- package/src/core/events/v3/recovery.ts +271 -0
- package/src/core/events/v3/span-state.ts +187 -0
- package/src/core/events/v3/targets.ts +182 -0
- package/src/core/events/v3/turn-telemetry.ts +259 -0
- package/src/core/events/v3/validate.ts +361 -0
- package/src/core/events/v3/writer.ts +419 -0
- package/src/core/governor/index.ts +3 -0
- package/src/core/governor/plan-api.ts +10 -2
- package/src/core/governor/read.ts +3 -0
- package/src/core/governor/state.ts +52 -5
- package/src/core/guard/config.ts +206 -0
- package/src/core/guard/coordinator.ts +227 -0
- package/src/core/guard/evaluator.ts +343 -0
- package/src/core/guard/evidence-v3.ts +227 -0
- package/src/core/guard/index.ts +35 -0
- package/src/core/guard/live-source-v3.ts +204 -0
- package/src/core/guard/storage.ts +188 -0
- package/src/core/guard/types.ts +152 -0
- package/src/core/hooks/adapter/detect.ts +28 -1
- package/src/core/hooks/adapter/events.ts +14 -6
- package/src/core/hooks/adapter/output.ts +7 -2
- package/src/core/hooks/adapter/parse.ts +80 -38
- package/src/core/hooks/adapter/wiring.ts +119 -13
- package/src/core/hooks/cli.ts +352 -466
- package/src/core/hooks/effects/image-capture.ts +228 -238
- package/src/core/hooks/effects/index.ts +1 -36
- package/src/core/hooks/events/input-hash.ts +47 -0
- package/src/core/hooks/index.ts +4 -11
- package/src/core/hooks/resolve/coord-root.ts +1 -1
- package/src/core/hooks/resolve/owner.ts +52 -45
- package/src/core/hooks/resolve/transcript.ts +171 -14
- package/src/core/hooks/session-name-presence.ts +14 -15
- package/src/core/hooks/unsafe-cross-shell.ts +1 -1
- package/src/core/journal/index.ts +15 -22
- package/src/core/presence/blob.ts +48 -41
- package/src/core/presence/codec-digest.ts +215 -0
- package/src/core/presence/relay-client.ts +5 -5
- package/src/core/work/index.ts +3 -0
- package/src/core/work/read.ts +3 -0
- package/src/core/work/runner.ts +6 -0
- package/src/core/work/state.ts +27 -3
- package/src/core/workflow/engine.ts +24 -24
- package/src/core/workflow/live-session-v3.ts +126 -0
- package/src/core/workflow/scope-id.ts +6 -0
- package/src/core/workflow/workspaces/leases.ts +56 -19
- package/src/index.ts +1 -1
- package/src/lib/browser/client.ts +230 -0
- package/src/lib/browser/critique.ts +104 -27
- package/src/lib/browser/geometry.ts +143 -14
- package/src/lib/browser/index.ts +34 -0
- package/src/lib/browser/qa-plan.ts +501 -0
- package/src/lib/browser/qa-reuse.ts +306 -0
- package/src/lib/browser/qa-snapshot.ts +223 -0
- package/src/lib/browser/runts.ts +27 -2
- package/src/lib/browser/tiling.ts +164 -0
- package/src/lib/claude-desktop.ts +1 -232
- package/src/lib/context/index.ts +22 -46
- package/src/lib/council/index.ts +9 -21
- package/src/lib/docs-frontmatter.ts +8 -79
- package/src/lib/docs-index.ts +33 -3
- package/src/lib/docs-lint.ts +15 -29
- package/src/lib/docs-metadata-audit.ts +166 -0
- package/src/lib/docs-metadata-managed.ts +83 -0
- package/src/lib/docs-metadata-sync.ts +262 -0
- package/src/lib/docs-metadata-v2-schema.ts +138 -0
- package/src/lib/docs-metadata-v2.ts +646 -0
- package/src/lib/docs-new.ts +63 -0
- package/src/lib/docs-sweep.ts +42 -28
- package/src/lib/headless/index.ts +287 -0
- package/src/lib/identities/assume.ts +67 -86
- package/src/lib/instructions/apply.ts +33 -20
- package/src/lib/instructions/bundle.ts +2 -2
- package/src/lib/instructions/splice.ts +21 -7
- package/src/lib/instructions/templates.ts +85 -13
- package/dist/core/agents/cli-emit.d.ts +0 -27
- package/dist/core/agents/cli-emit.d.ts.map +0 -1
- package/dist/core/agents/cli-emit.js +0 -57
- package/dist/core/agents/codex-replay.d.ts +0 -29
- package/dist/core/agents/codex-replay.d.ts.map +0 -1
- package/dist/core/agents/codex-replay.js +0 -138
- package/dist/core/agents/events/consume.d.ts +0 -82
- package/dist/core/agents/events/consume.d.ts.map +0 -1
- package/dist/core/agents/events/consume.js +0 -195
- package/dist/core/agents/events/emit.d.ts +0 -42
- package/dist/core/agents/events/emit.d.ts.map +0 -1
- package/dist/core/agents/events/emit.js +0 -75
- package/dist/core/agents/events/ulid.d.ts +0 -11
- package/dist/core/agents/events/ulid.d.ts.map +0 -1
- package/dist/core/agents/events/ulid.js +0 -47
- package/dist/core/agents/state/heartbeat-projector.d.ts +0 -76
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +0 -1
- package/dist/core/agents/state/heartbeat-projector.js +0 -581
- package/dist/core/hooks/events/emit.d.ts +0 -31
- package/dist/core/hooks/events/emit.d.ts.map +0 -1
- package/dist/core/hooks/events/emit.js +0 -93
- package/dist/core/hooks/events/rotate.d.ts +0 -43
- package/dist/core/hooks/events/rotate.d.ts.map +0 -1
- package/dist/core/hooks/events/rotate.js +0 -142
- package/dist/core/hooks/events/schema.d.ts +0 -341
- package/dist/core/hooks/events/schema.d.ts.map +0 -1
- package/dist/core/hooks/events/schema.js +0 -12
- package/dist/core/hooks/events/ulid.d.ts +0 -10
- package/dist/core/hooks/events/ulid.d.ts.map +0 -1
- package/dist/core/hooks/events/ulid.js +0 -47
- package/dist/lib/docs-frontmatter-migrate.d.ts +0 -33
- package/dist/lib/docs-frontmatter-migrate.d.ts.map +0 -1
- package/dist/lib/docs-frontmatter-migrate.js +0 -364
- package/src/core/agents/cli-emit.ts +0 -64
- package/src/core/agents/codex-replay.ts +0 -163
- package/src/core/agents/events/consume.ts +0 -254
- package/src/core/agents/events/emit.ts +0 -115
- package/src/core/agents/events/ulid.ts +0 -51
- package/src/core/agents/state/heartbeat-projector.ts +0 -645
- package/src/core/hooks/events/emit.ts +0 -125
- package/src/core/hooks/events/rotate.ts +0 -151
- package/src/core/hooks/events/schema.ts +0 -582
- package/src/core/hooks/events/ulid.ts +0 -51
- package/src/lib/docs-frontmatter-migrate.ts +0 -427
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAc1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAmGN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { monorepoRoot,
|
|
1
|
+
import { monorepoRoot, resolveOwner } from "../core/agents/index.js";
|
|
2
|
+
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.js";
|
|
2
3
|
import { cleanArtifacts, createArtifact, inventoryArtifacts, releaseArtifact, renewArtifact, showArtifact, } from "../core/artifacts/index.js";
|
|
3
4
|
import { artifactDefaultRetentionDays, coordFreshnessSeconds } from "../core/config.js";
|
|
4
5
|
export function registerArtifactsCommand(program, emit, context) {
|
|
@@ -14,7 +15,7 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
14
15
|
.action((slug, opts) => {
|
|
15
16
|
run(emit, () => {
|
|
16
17
|
const repoRoot = requireRepoRoot(context);
|
|
17
|
-
const actor = currentActor();
|
|
18
|
+
const actor = currentActor(repoRoot);
|
|
18
19
|
const retentionDays = opts.days
|
|
19
20
|
? parseDays(opts.days)
|
|
20
21
|
: artifactDefaultRetentionDays(repoRoot);
|
|
@@ -64,7 +65,7 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
64
65
|
run(emit, () => {
|
|
65
66
|
const repoRoot = requireRepoRoot(context);
|
|
66
67
|
const manifest = renewArtifact(repoRoot, ref, parseDays(opts.days), opts.reason, {
|
|
67
|
-
actor: currentActor(),
|
|
68
|
+
actor: currentActor(repoRoot),
|
|
68
69
|
});
|
|
69
70
|
emit.data(manifest);
|
|
70
71
|
});
|
|
@@ -75,7 +76,7 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
75
76
|
.action((ref) => {
|
|
76
77
|
run(emit, () => {
|
|
77
78
|
const repoRoot = requireRepoRoot(context);
|
|
78
|
-
emit.data(releaseArtifact(repoRoot, ref, { actor: currentActor() }));
|
|
79
|
+
emit.data(releaseArtifact(repoRoot, ref, { actor: currentActor(repoRoot) }));
|
|
79
80
|
});
|
|
80
81
|
});
|
|
81
82
|
root
|
|
@@ -93,11 +94,11 @@ export function registerArtifactsCommand(program, emit, context) {
|
|
|
93
94
|
});
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
|
-
function currentActor() {
|
|
97
|
+
function currentActor(repoRoot) {
|
|
97
98
|
const instanceId = resolveOwner();
|
|
98
99
|
if (!instanceId)
|
|
99
100
|
return undefined;
|
|
100
|
-
const hb =
|
|
101
|
+
const hb = readLiveCoordinationRow(repoRoot, instanceId);
|
|
101
102
|
return {
|
|
102
103
|
instance_id: instanceId,
|
|
103
104
|
session_id: hb?.session_id,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* paths and are init'd on first `harn backup init`. Subcommands:
|
|
7
7
|
*
|
|
8
8
|
* init restic init the repo (one-time)
|
|
9
|
-
* snapshot restic backup
|
|
9
|
+
* snapshot restic backup of the durable, privacy-safe V3 state
|
|
10
10
|
* list restic snapshots
|
|
11
11
|
* restore restic restore <id>
|
|
12
12
|
* prune restic forget --keep-daily 7 --keep-weekly 4 --prune
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/commands/backup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA4EnD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/commands/backup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA4EnD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CA6N/E"}
|
package/dist/commands/backup.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* paths and are init'd on first `harn backup init`. Subcommands:
|
|
7
7
|
*
|
|
8
8
|
* init restic init the repo (one-time)
|
|
9
|
-
* snapshot restic backup
|
|
9
|
+
* snapshot restic backup of the durable, privacy-safe V3 state
|
|
10
10
|
* list restic snapshots
|
|
11
11
|
* restore restic restore <id>
|
|
12
12
|
* prune restic forget --keep-daily 7 --keep-weekly 4 --prune
|
|
@@ -108,40 +108,53 @@ export function registerBackupCommand(program, emit) {
|
|
|
108
108
|
// -- snapshot --
|
|
109
109
|
backup
|
|
110
110
|
.command("snapshot")
|
|
111
|
-
.description("Take a restic snapshot of
|
|
112
|
-
".lock files and artifacts/ by default). Pass --target to back up a different path.")
|
|
113
|
-
.option("--target <path>", "Path to snapshot (default: .harnery/ from cwd walk-up)")
|
|
111
|
+
.description("Take a restic snapshot of the durable, privacy-safe V3 ledger and coordination state.")
|
|
114
112
|
.option("--tag <tag>", "Restic tag (repeatable)", collect, [])
|
|
115
113
|
.option("--repo <path>", "Repository path")
|
|
116
114
|
.option("--password-file <path>", "Password file")
|
|
117
|
-
.option("--include-events", "Don't exclude events.ndjson (default: excluded; large + machine-local)")
|
|
118
115
|
.option("--include-artifacts", "Include managed working artifacts (default: excluded; potentially large + ephemeral)")
|
|
119
116
|
.action((opts) => {
|
|
120
117
|
if (!checkRestic(emit)) {
|
|
121
118
|
emit.setExitCode(1);
|
|
122
119
|
return;
|
|
123
120
|
}
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
121
|
+
const harnery = findHarneryDir();
|
|
122
|
+
if (!harnery) {
|
|
126
123
|
emit.error({
|
|
127
124
|
code: "target_missing",
|
|
128
|
-
message: "No .harnery/ found above cwd;
|
|
125
|
+
message: "No .harnery/ found above cwd; run from an initialized project",
|
|
129
126
|
});
|
|
130
127
|
emit.setExitCode(1);
|
|
131
128
|
return;
|
|
132
129
|
}
|
|
133
130
|
const passThrough = [];
|
|
134
|
-
if (!opts.includeEvents) {
|
|
135
|
-
passThrough.push("--exclude", "events.ndjson");
|
|
136
|
-
passThrough.push("--exclude", ".lock");
|
|
137
|
-
passThrough.push("--exclude", ".log.lock");
|
|
138
|
-
}
|
|
139
|
-
if (!opts.includeArtifacts)
|
|
140
|
-
passThrough.push("--exclude", "artifacts");
|
|
141
131
|
for (const t of opts.tag) {
|
|
142
132
|
passThrough.push("--tag", t);
|
|
143
133
|
}
|
|
144
|
-
const
|
|
134
|
+
const safeTargets = [
|
|
135
|
+
"ledgers",
|
|
136
|
+
"councils",
|
|
137
|
+
"journal",
|
|
138
|
+
"work",
|
|
139
|
+
"workflows",
|
|
140
|
+
"decisions",
|
|
141
|
+
"config.jsonc",
|
|
142
|
+
".name-history",
|
|
143
|
+
]
|
|
144
|
+
.map((entry) => path.join(harnery, entry))
|
|
145
|
+
.filter(existsSync);
|
|
146
|
+
if (opts.includeArtifacts && existsSync(path.join(harnery, "artifacts"))) {
|
|
147
|
+
safeTargets.push(path.join(harnery, "artifacts"));
|
|
148
|
+
}
|
|
149
|
+
if (safeTargets.length === 0) {
|
|
150
|
+
emit.error({
|
|
151
|
+
code: "backup_empty",
|
|
152
|
+
message: "No durable V3 state is available to back up",
|
|
153
|
+
});
|
|
154
|
+
emit.setExitCode(1);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const r = runRestic(["backup", ...safeTargets], {
|
|
145
158
|
repo: opts.repo,
|
|
146
159
|
passwordFile: opts.passwordFile,
|
|
147
160
|
stdio: "inherit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"browse.d.ts","sourceRoot":"","sources":["../../src/commands/browse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA+N1E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,WAAW,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CA+cN"}
|
package/dist/commands/browse.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
4
4
|
import { resolveBinName } from "../core/config.js";
|
|
5
5
|
import { Browser, browserProxyFromEnv, browserProxyGateFromEnv, captureDevOverlay, DEFAULT_CRITIQUE_RUBRIC, extractObservedIp, parseAssertSpec, runCritique, tilesFromFullPage, WEBRTC_PROXY_ONLY_ARG, writeNetscapeCookieFile, wslHeadedLaunchArgs, } from "../lib/browser/index.js";
|
|
6
|
+
import { buildQaManifest, classifySignatures, } from "../lib/browser/qa-plan.js";
|
|
7
|
+
import { DEFAULT_REUSE_MISMATCH_RATIO, planCritiqueReuse, QA_CRITIQUE_CONTRACT_VERSION, rubricDigest, } from "../lib/browser/qa-reuse.js";
|
|
8
|
+
import { loadQaSnapshot, resolveQaBaseline, saveQaSnapshot } from "../lib/browser/qa-snapshot.js";
|
|
6
9
|
import { startBrowserSessionServer, } from "../lib/browser/session-control.js";
|
|
7
10
|
import { diffAgainstBaseline, saveBaseline, } from "../lib/browser/visual-diff.js";
|
|
8
11
|
import { CookieJar } from "../lib/cookies/index.js";
|
|
@@ -203,6 +206,34 @@ export function registerBrowseCommand(program, emitParam, context) {
|
|
|
203
206
|
.option("--diff-threshold <ratio>", "mismatchRatio (mismatchedPixels / totalPixels) below which the diff is " +
|
|
204
207
|
"considered a match (0–1, default 0.01 = 1%).", "0.01")
|
|
205
208
|
.option("--diff-fail", "Exit non-zero if --diff mismatchRatio exceeds --diff-threshold; requires --diff.")
|
|
209
|
+
.option("--qa-plan", "Classify this render against the persisted QA baseline and emit a review manifest " +
|
|
210
|
+
"(change class, scope selectors, required contexts, provider-call ceiling) under " +
|
|
211
|
+
"`qaPlan` in the JSON envelope — BEFORE any vision spend. Text/data-only edits plan " +
|
|
212
|
+
"zero model calls; ambiguity widens, never narrows. Baseline comes from the snapshot " +
|
|
213
|
+
"store (seed one with --qa-snapshot); no baseline classifies as `unknown`.")
|
|
214
|
+
.option("--qa-snapshot", "Persist this render (signature + DOM + full-page screenshot) as the QA baseline for the " +
|
|
215
|
+
"target + context, replacing any prior snapshot atomically. Run it on a page state you " +
|
|
216
|
+
"trust — typically right after a passing QA run — so the next --qa-plan inherits its " +
|
|
217
|
+
"baseline for free.")
|
|
218
|
+
.option("--qa-target <key>", "Override the snapshot-store key (default: the url argument). Lets a production render " +
|
|
219
|
+
"seed the baseline for a local file/route: browse the prod URL with --qa-snapshot " +
|
|
220
|
+
"--qa-target <local-target>, then --qa-plan the local target.")
|
|
221
|
+
.option("--qa-theme <theme>", "Context label for the QA snapshot store: light | dark (default light). Labels the " +
|
|
222
|
+
"stored/compared context; it does not switch the page's rendered theme.", "light")
|
|
223
|
+
.option("--qa-state <name>", "Context state label for the QA snapshot store (default 'default').", "default")
|
|
224
|
+
.option("--qa-scope <selector>", "Explicit scope selector from the producing task (repeatable) — resolution-order rung 1; " +
|
|
225
|
+
"overrides lifted anchors in the --qa-plan manifest.", (value, previous = []) => [...previous, value], [])
|
|
226
|
+
.option("--qa-states <names>", "Comma-separated interaction states to review (promotes the plan to interaction-state).", (value) => value
|
|
227
|
+
.split(",")
|
|
228
|
+
.map((s) => s.trim())
|
|
229
|
+
.filter(Boolean))
|
|
230
|
+
.option("--qa-reuse", "Reuse the baseline run's critique verdicts for tiles whose pixels provably didn't " +
|
|
231
|
+
"change (band-diff against the persisted --qa-snapshot screenshot; strict mismatch " +
|
|
232
|
+
"threshold). Only clean regions are reused — a region with baseline findings or any " +
|
|
233
|
+
"pixel drift is always re-reviewed. Requires --check-critique; misses degrade to a " +
|
|
234
|
+
"full fresh review, never an error. Stats land under `qaReuse` in the JSON envelope.")
|
|
235
|
+
.option("--qa-reuse-threshold <ratio>", "Band-diff mismatch ratio at or below which a clean tile region is reused " +
|
|
236
|
+
`(default ${DEFAULT_REUSE_MISMATCH_RATIO}; lower it toward 0 for stricter reuse).`)
|
|
206
237
|
.option("--no-dev-overlay", "Skip auto-capture of Next.js dev-overlay issues. Default: capture every queued error (kind/code/message/stack) when a <nextjs-portal> shadow root is present. Necessary because Next.js 16 + React 19 route hydration errors + most React warnings through onCaughtError → next-devtools' errorQueue, NOT through console.error, so Playwright's standard listener doesn't see them. Surfaces them in the JSON envelope under `devOverlay`.")
|
|
207
238
|
.action(async (url, opts) => {
|
|
208
239
|
try {
|
|
@@ -388,18 +419,119 @@ async function runBrowse(url, opts, context) {
|
|
|
388
419
|
contrast: opts.checkContrast !== undefined ? { scope: contentScope(opts.checkContrast) } : null,
|
|
389
420
|
});
|
|
390
421
|
}
|
|
422
|
+
// Diff-aware QA planning. Signature capture must also happen BEFORE any
|
|
423
|
+
// annotation overlays are injected — an annotation box is a DOM change.
|
|
424
|
+
let qaPlan;
|
|
425
|
+
let qaCapture;
|
|
426
|
+
if (opts.qaPlan || opts.qaSnapshot) {
|
|
427
|
+
const qa = await runQaPlanning(browser, url, navResult.url, opts);
|
|
428
|
+
qaPlan = qa.report;
|
|
429
|
+
qaCapture = qa.capture;
|
|
430
|
+
if (qaPlan?.manifest) {
|
|
431
|
+
const m = qaPlan.manifest;
|
|
432
|
+
emit.log(`qa-plan: class=${m.change_class} scopes=${m.scopes.map((s) => s.selector).join(",") || "-"} ` +
|
|
433
|
+
`contexts=${m.contexts.length} model-calls<=${m.predicted.model_calls_ceiling} baseline=${m.baseline_source}`, "info");
|
|
434
|
+
}
|
|
435
|
+
}
|
|
391
436
|
// Vision critique. Capture tiles BEFORE any annotation overlays are injected
|
|
392
437
|
// so the model sees the real page, not our boxes.
|
|
393
438
|
let critique;
|
|
439
|
+
let qaReuse;
|
|
440
|
+
let critiqueTiles;
|
|
441
|
+
let critiqueFullPage;
|
|
394
442
|
if (opts.checkCritique !== undefined) {
|
|
395
|
-
const
|
|
443
|
+
const rubric = opts.checkCritiqueRubric ?? DEFAULT_CRITIQUE_RUBRIC;
|
|
444
|
+
const captured = await captureCritiqueTiles(browser, opts, context?.critiqueProvider?.tileBudgetPx);
|
|
445
|
+
critiqueTiles = captured.tiles;
|
|
446
|
+
critiqueFullPage = captured.fullPage;
|
|
447
|
+
let tilesToReview = captured.tiles;
|
|
448
|
+
if (opts.qaReuse) {
|
|
449
|
+
const reuseContext = {
|
|
450
|
+
viewport: opts.viewport ?? "desktop",
|
|
451
|
+
theme: opts.qaTheme === "dark" ? "dark" : "light",
|
|
452
|
+
state: opts.qaState ?? "default",
|
|
453
|
+
};
|
|
454
|
+
const stored = loadQaSnapshot(opts.qaTarget ?? url, reuseContext, {});
|
|
455
|
+
if (stored?.screenshotPath && stored.critique) {
|
|
456
|
+
qaReuse = planCritiqueReuse({
|
|
457
|
+
baselineScreenshot: readFileSync(stored.screenshotPath),
|
|
458
|
+
baselineCritique: stored.critique,
|
|
459
|
+
currentScreenshot: captured.fullPage,
|
|
460
|
+
tiles: captured.tiles,
|
|
461
|
+
rubric,
|
|
462
|
+
mismatchThreshold: opts.qaReuseThreshold
|
|
463
|
+
? Number.parseFloat(opts.qaReuseThreshold)
|
|
464
|
+
: undefined,
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
qaReuse = {
|
|
469
|
+
mode: "band-diff",
|
|
470
|
+
review: captured.tiles,
|
|
471
|
+
decisions: [],
|
|
472
|
+
tiles_total: captured.tiles.length,
|
|
473
|
+
tiles_reused: 0,
|
|
474
|
+
tiles_reviewed: captured.tiles.length,
|
|
475
|
+
provider_calls_avoided: 0,
|
|
476
|
+
mismatch_threshold: DEFAULT_REUSE_MISMATCH_RATIO,
|
|
477
|
+
invalidation: "no persisted baseline snapshot with critique results for this target/context",
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
tilesToReview = qaReuse.review;
|
|
481
|
+
emit.log(`qa-reuse: ${qaReuse.tiles_reused}/${qaReuse.tiles_total} tiles reused (band-diff), ` +
|
|
482
|
+
`${qaReuse.tiles_reviewed} reviewed fresh${qaReuse.invalidation ? ` — ${qaReuse.invalidation}` : ""}`, "info");
|
|
483
|
+
}
|
|
396
484
|
critique = await runCritique({
|
|
397
485
|
url: navResult.url,
|
|
398
|
-
rubric
|
|
399
|
-
tiles,
|
|
486
|
+
rubric,
|
|
487
|
+
tiles: tilesToReview,
|
|
400
488
|
provider: context?.critiqueProvider,
|
|
401
489
|
});
|
|
402
490
|
}
|
|
491
|
+
// Persist the QA baseline AFTER critique so a passing run's verdicts ride
|
|
492
|
+
// along with the snapshot (still before annotations mutate the page).
|
|
493
|
+
if (opts.qaSnapshot && qaCapture) {
|
|
494
|
+
const screenshotPng = critiqueFullPage ?? (await browser.fullPageScreenshotBuffer());
|
|
495
|
+
// Persist critique results only when the full tile set was freshly
|
|
496
|
+
// reviewed — a partially-reused run must never become the next
|
|
497
|
+
// baseline's finding record.
|
|
498
|
+
const fullCoverage = critique?.provider &&
|
|
499
|
+
critique.outcome !== "skipped" &&
|
|
500
|
+
critiqueTiles !== undefined &&
|
|
501
|
+
(!qaReuse || qaReuse.tiles_reused === 0);
|
|
502
|
+
const persistedCritique = fullCoverage && critique && critiqueTiles
|
|
503
|
+
? {
|
|
504
|
+
contract_version: QA_CRITIQUE_CONTRACT_VERSION,
|
|
505
|
+
rubric_digest: rubricDigest(opts.checkCritiqueRubric ?? DEFAULT_CRITIQUE_RUBRIC),
|
|
506
|
+
outcome: critique.outcome,
|
|
507
|
+
findings: critique.findings,
|
|
508
|
+
tiles: critiqueTiles.map((t) => ({
|
|
509
|
+
index: t.index,
|
|
510
|
+
label: t.label,
|
|
511
|
+
x: t.x ?? 0,
|
|
512
|
+
scrollY: t.scrollY,
|
|
513
|
+
width: t.width,
|
|
514
|
+
height: t.height,
|
|
515
|
+
})),
|
|
516
|
+
}
|
|
517
|
+
: undefined;
|
|
518
|
+
const saved = saveQaSnapshot(qaCapture.target, qaCapture.context, {
|
|
519
|
+
signature: qaCapture.signature,
|
|
520
|
+
domHtml: qaCapture.domHtml,
|
|
521
|
+
screenshotPng,
|
|
522
|
+
...(persistedCritique ? { critique: persistedCritique } : {}),
|
|
523
|
+
}, {});
|
|
524
|
+
if (qaPlan) {
|
|
525
|
+
qaPlan.snapshotSaved = {
|
|
526
|
+
path: saved.path,
|
|
527
|
+
target: qaCapture.target,
|
|
528
|
+
context: qaCapture.context,
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
emit.log(`qa-snapshot: saved baseline for ${qaCapture.target} ` +
|
|
532
|
+
`[${qaCapture.context.viewport}/${qaCapture.context.theme}/${qaCapture.context.state}]` +
|
|
533
|
+
`${persistedCritique ? " (with critique results)" : ""}`, "info");
|
|
534
|
+
}
|
|
403
535
|
let asserts;
|
|
404
536
|
if (opts.assert && opts.assert.length > 0) {
|
|
405
537
|
const specs = opts.assert.map(parseAssertSpec);
|
|
@@ -487,10 +619,10 @@ async function runBrowse(url, opts, context) {
|
|
|
487
619
|
if (opts.baseline || opts.diff) {
|
|
488
620
|
throw new Error("--baseline / --diff require trio mode (screenshot file). Remove --snapshot/--html/--json or capture the screenshot first.");
|
|
489
621
|
}
|
|
490
|
-
await runPrintMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult);
|
|
622
|
+
await runPrintMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult, qaPlan, qaReuse ? summarizeReuse(qaReuse) : undefined);
|
|
491
623
|
}
|
|
492
624
|
else {
|
|
493
|
-
await runTrioMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult);
|
|
625
|
+
await runTrioMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult, qaPlan, qaReuse ? summarizeReuse(qaReuse) : undefined);
|
|
494
626
|
}
|
|
495
627
|
if (visibility && opts.checkVisibleAnnotate !== false) {
|
|
496
628
|
await browser.clearVisibilityAnnotations();
|
|
@@ -688,7 +820,7 @@ function splitBatchSteps(input) {
|
|
|
688
820
|
// ---------------------------------------------------------------------------
|
|
689
821
|
// Print mode (--snapshot / --html / --json): stdout, no file writes
|
|
690
822
|
// ---------------------------------------------------------------------------
|
|
691
|
-
async function runPrintMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult) {
|
|
823
|
+
async function runPrintMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult, qaPlan, qaReuse) {
|
|
692
824
|
let body = null;
|
|
693
825
|
if (opts.html) {
|
|
694
826
|
body = await browser.htmlContent(opts.selector);
|
|
@@ -734,6 +866,10 @@ async function runPrintMode(browser, navResult, opts, evalResult, visibility, wi
|
|
|
734
866
|
result.asserts = asserts;
|
|
735
867
|
if (devOverlay)
|
|
736
868
|
result.devOverlay = devOverlay;
|
|
869
|
+
if (qaPlan)
|
|
870
|
+
result.qaPlan = qaPlan;
|
|
871
|
+
if (qaReuse)
|
|
872
|
+
result.qaReuse = qaReuse;
|
|
737
873
|
if (batchResult && batchResult.clipboardReads.length > 0) {
|
|
738
874
|
result.batchClipboardReads = batchResult.clipboardReads;
|
|
739
875
|
}
|
|
@@ -755,7 +891,7 @@ async function runPrintMode(browser, navResult, opts, evalResult, visibility, wi
|
|
|
755
891
|
// ---------------------------------------------------------------------------
|
|
756
892
|
// Trio mode (default): write <prefix>.{png,html,json}
|
|
757
893
|
// ---------------------------------------------------------------------------
|
|
758
|
-
async function runTrioMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult) {
|
|
894
|
+
async function runTrioMode(browser, navResult, opts, evalResult, visibility, widths, overflow, runts, layoutLint, hit, content, critique, asserts, devOverlay, batchResult, qaPlan, qaReuse) {
|
|
759
895
|
const prefix = resolveOutPrefix(opts.out);
|
|
760
896
|
mkdirSync(dirname(prefix), { recursive: true });
|
|
761
897
|
const written = [];
|
|
@@ -837,6 +973,10 @@ async function runTrioMode(browser, navResult, opts, evalResult, visibility, wid
|
|
|
837
973
|
envelope.asserts = asserts;
|
|
838
974
|
if (devOverlay)
|
|
839
975
|
envelope.devOverlay = devOverlay;
|
|
976
|
+
if (qaPlan)
|
|
977
|
+
envelope.qaPlan = qaPlan;
|
|
978
|
+
if (qaReuse)
|
|
979
|
+
envelope.qaReuse = qaReuse;
|
|
840
980
|
if (batchResult && batchResult.clipboardReads.length > 0) {
|
|
841
981
|
envelope.batchClipboardReads = batchResult.clipboardReads;
|
|
842
982
|
}
|
|
@@ -1198,9 +1338,75 @@ function applyContentFailGates(opts, content) {
|
|
|
1198
1338
|
// ---------------------------------------------------------------------------
|
|
1199
1339
|
// Vision critique tiling
|
|
1200
1340
|
// ---------------------------------------------------------------------------
|
|
1201
|
-
|
|
1341
|
+
/** Envelope-safe reuse stats: everything except the `review` tiles, whose
|
|
1342
|
+
* base64 PNGs would bloat the JSON by megabytes. */
|
|
1343
|
+
function summarizeReuse(plan) {
|
|
1344
|
+
const { review: _review, ...rest } = plan;
|
|
1345
|
+
return rest;
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Diff-aware QA planning inside a browse run: capture the page's QA signature
|
|
1349
|
+
* (before any annotation overlay mutates the DOM) and classify against the
|
|
1350
|
+
* persisted baseline. Persistence happens later in the run — after critique —
|
|
1351
|
+
* so a passing run's verdicts ride along with the snapshot; this helper only
|
|
1352
|
+
* supplies the live-page inputs (signature, page height, explicit scope match
|
|
1353
|
+
* counts). Classification and manifest math live in lib/browser/qa-plan.ts.
|
|
1354
|
+
*/
|
|
1355
|
+
async function runQaPlanning(browser, targetArg, renderedUrl, opts) {
|
|
1356
|
+
const context = {
|
|
1357
|
+
viewport: opts.viewport ?? "desktop",
|
|
1358
|
+
theme: opts.qaTheme === "dark" ? "dark" : "light",
|
|
1359
|
+
state: opts.qaState ?? "default",
|
|
1360
|
+
};
|
|
1361
|
+
const target = opts.qaTarget ?? targetArg;
|
|
1362
|
+
const captured = await browser.qaSignature();
|
|
1363
|
+
const signature = {
|
|
1364
|
+
url: renderedUrl,
|
|
1365
|
+
capturedAt: new Date().toISOString(),
|
|
1366
|
+
nodes: captured.nodes,
|
|
1367
|
+
stylesheets: captured.stylesheets,
|
|
1368
|
+
...(captured.truncated ? { truncated: true } : {}),
|
|
1369
|
+
};
|
|
1370
|
+
const report = {
|
|
1371
|
+
signature: {
|
|
1372
|
+
nodes: captured.nodes.length,
|
|
1373
|
+
stylesheets: captured.stylesheets.length,
|
|
1374
|
+
truncated: captured.truncated,
|
|
1375
|
+
},
|
|
1376
|
+
};
|
|
1377
|
+
if (opts.qaPlan) {
|
|
1378
|
+
const baseline = await resolveQaBaseline({ target, context });
|
|
1379
|
+
const classification = classifySignatures(baseline.signature, signature);
|
|
1380
|
+
// Full-page tile ceiling from the real page height and the critique
|
|
1381
|
+
// tiling knobs, so the predicted cost matches what --check-critique
|
|
1382
|
+
// would actually spend.
|
|
1383
|
+
const pageHeight = await browser.currentPage.evaluate(() => Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight ?? 0));
|
|
1384
|
+
const band = Number.parseInt(opts.checkCritiqueBand ?? "1400", 10);
|
|
1385
|
+
const overlap = Number.parseInt(opts.checkCritiqueOverlap ?? "120", 10);
|
|
1386
|
+
const maxTiles = Number.parseInt(opts.checkCritiqueMaxTiles ?? "24", 10);
|
|
1387
|
+
const estimatedFullPageTiles = Math.min(maxTiles, Math.max(1, Math.ceil(pageHeight / Math.max(1, band - overlap))));
|
|
1388
|
+
const explicitScopes = [];
|
|
1389
|
+
for (const selector of opts.qaScope ?? []) {
|
|
1390
|
+
const matches = await browser.currentPage.evaluate((sel) => document.querySelectorAll(sel).length, selector);
|
|
1391
|
+
explicitScopes.push({ selector, reason: "explicit input (--qa-scope)", matches });
|
|
1392
|
+
}
|
|
1393
|
+
report.classification = classification;
|
|
1394
|
+
report.manifest = buildQaManifest(classification, {
|
|
1395
|
+
baselineSource: baseline.source,
|
|
1396
|
+
...(explicitScopes.length > 0 ? { explicitScopes } : {}),
|
|
1397
|
+
...(opts.qaStates?.length ? { states: opts.qaStates } : {}),
|
|
1398
|
+
...(opts.assert?.length ? { outcomeAssertions: opts.assert } : {}),
|
|
1399
|
+
estimatedFullPageTiles,
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
return { report, capture: { target, context, signature, domHtml: captured.domHtml } };
|
|
1403
|
+
}
|
|
1404
|
+
async function captureCritiqueTiles(browser, opts, tileBudgetPx) {
|
|
1202
1405
|
const maxTiles = Math.max(1, Number.parseInt(opts.checkCritiqueMaxTiles ?? "24", 10));
|
|
1203
|
-
|
|
1406
|
+
// The routed provider's vision long-edge budget caps band height so tiles
|
|
1407
|
+
// are never silently downscaled by the model.
|
|
1408
|
+
const bandFlag = Math.max(200, Number.parseInt(opts.checkCritiqueBand ?? "1400", 10));
|
|
1409
|
+
const band = tileBudgetPx ? Math.max(200, Math.min(bandFlag, tileBudgetPx)) : bandFlag;
|
|
1204
1410
|
const overlap = Math.max(0, Number.parseInt(opts.checkCritiqueOverlap ?? "120", 10));
|
|
1205
1411
|
// Capture the whole page ONCE, then crop tiles from the pixels. Playwright's
|
|
1206
1412
|
// clip is viewport-relative, so a below-fold band clip throws ("clipped area
|
|
@@ -1210,14 +1416,30 @@ async function captureCritiqueTiles(browser, opts) {
|
|
|
1210
1416
|
const elementRects = typeof opts.checkCritique === "string"
|
|
1211
1417
|
? await browser.elementTiles(opts.checkCritique)
|
|
1212
1418
|
: undefined;
|
|
1213
|
-
|
|
1419
|
+
// Content-aware seams: atoms let band cuts snap into gaps and over-tall
|
|
1420
|
+
// selector tiles band internally. Extraction failing is never fatal — the
|
|
1421
|
+
// tiler falls back to fixed bands, today's behavior.
|
|
1422
|
+
let atoms;
|
|
1423
|
+
try {
|
|
1424
|
+
atoms = await browser.visualAtoms();
|
|
1425
|
+
}
|
|
1426
|
+
catch {
|
|
1427
|
+
atoms = undefined;
|
|
1428
|
+
}
|
|
1429
|
+
const tiles = tilesFromFullPage(buffer, {
|
|
1430
|
+
elementRects,
|
|
1431
|
+
bandHeight: band,
|
|
1432
|
+
overlap,
|
|
1433
|
+
maxTiles,
|
|
1434
|
+
atoms,
|
|
1435
|
+
});
|
|
1214
1436
|
if (elementRects && elementRects.length > maxTiles) {
|
|
1215
1437
|
emit.log(`check-critique: ${elementRects.length} elements matched, capped to ${maxTiles} tiles`, "warn");
|
|
1216
1438
|
}
|
|
1217
1439
|
else if (!elementRects && tiles.length >= maxTiles) {
|
|
1218
1440
|
emit.log(`check-critique: page banded to the ${maxTiles}-tile cap (raise --check-critique-max-tiles for full coverage)`, "warn");
|
|
1219
1441
|
}
|
|
1220
|
-
return tiles;
|
|
1442
|
+
return { tiles, fullPage: buffer };
|
|
1221
1443
|
}
|
|
1222
1444
|
function logCritiqueSummary(critique) {
|
|
1223
1445
|
if (critique.outcome === "skipped") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/commands/checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/commands/checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAW1E;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CA2HN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { monorepoRoot,
|
|
1
|
+
import { monorepoRoot, resolveOwner } from "../core/agents/index.js";
|
|
2
|
+
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.js";
|
|
2
3
|
import { checkpointContext, readContextState, readLatestCapsule, } from "../core/context/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* `harn checkpoint`: durable context continuity across compaction.
|
|
@@ -126,7 +127,7 @@ function resolveContinuityIdentity(context, opts) {
|
|
|
126
127
|
if (!instanceId) {
|
|
127
128
|
throw new Error("could not resolve the current agent; pass --instance and --session");
|
|
128
129
|
}
|
|
129
|
-
const heartbeat =
|
|
130
|
+
const heartbeat = readLiveCoordinationRow(coordRoot, instanceId);
|
|
130
131
|
const sessionId = opts.session ?? heartbeat?.session_id ?? instanceId;
|
|
131
132
|
const adapter = opts.adapter
|
|
132
133
|
? parseAdapter(opts.adapter)
|
|
@@ -15,5 +15,5 @@ import type { EmitContext, HarneryProgramContext } from "../commander.js";
|
|
|
15
15
|
* desktop app picks the copies up, and opening one resumes with full
|
|
16
16
|
* history.
|
|
17
17
|
*/
|
|
18
|
-
export declare function registerClaudeDesktopCommand(program: Command, emit: EmitContext,
|
|
18
|
+
export declare function registerClaudeDesktopCommand(program: Command, emit: EmitContext, _context?: HarneryProgramContext): void;
|
|
19
19
|
//# sourceMappingURL=claude-desktop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-desktop.d.ts","sourceRoot":"","sources":["../../src/commands/claude-desktop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"claude-desktop.d.ts","sourceRoot":"","sources":["../../src/commands/claude-desktop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAU1E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,QAAQ,CAAC,EAAE,qBAAqB,GAC/B,IAAI,CA8JN"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { applyMirror, applyTidy, findDesktopDataDirs, listAccounts, planMirror, planTidy, readCliAccount, readDesktopLifecycleIndex, } from "../lib/claude-desktop.js";
|
|
1
|
+
import { applyMirror, findDesktopDataDirs, listAccounts, planMirror, readCliAccount, } from "../lib/claude-desktop.js";
|
|
3
2
|
/**
|
|
4
3
|
* `claude-desktop`: make Claude desktop-app sessions survive account
|
|
5
4
|
* switches.
|
|
@@ -15,10 +14,10 @@ import { applyMirror, applyTidy, findDesktopDataDirs, listAccounts, planMirror,
|
|
|
15
14
|
* desktop app picks the copies up, and opening one resumes with full
|
|
16
15
|
* history.
|
|
17
16
|
*/
|
|
18
|
-
export function registerClaudeDesktopCommand(program, emit,
|
|
17
|
+
export function registerClaudeDesktopCommand(program, emit, _context) {
|
|
19
18
|
const cmd = program
|
|
20
19
|
.command("claude-desktop")
|
|
21
|
-
.description("Claude desktop-app session index: list
|
|
20
|
+
.description("Claude desktop-app session index: list and mirror sessions across accounts")
|
|
22
21
|
.action(() => {
|
|
23
22
|
const dirs = requireDataDirs(emit, undefined);
|
|
24
23
|
for (const dir of dirs) {
|
|
@@ -142,76 +141,6 @@ export function registerClaudeDesktopCommand(program, emit, context) {
|
|
|
142
141
|
});
|
|
143
142
|
}
|
|
144
143
|
});
|
|
145
|
-
cmd
|
|
146
|
-
.command("tidy")
|
|
147
|
-
.description("Archive desktop sidebar entries whose mapped Harnery lifecycle is done. " +
|
|
148
|
-
"Dry-run by default; --yes applies atomic entry updates.")
|
|
149
|
-
.option("--data-dir <path>", "Explicit desktop-app data directory")
|
|
150
|
-
.option("--account <uuid-prefix>", "Only entries under accounts matching this UUID prefix (repeatable)", collect, [])
|
|
151
|
-
.option("--include-legacy-prefix", "Also archive unmatched historical entries whose title starts with [DONE]")
|
|
152
|
-
.option("--yes", "Apply the archive plan (default is dry-run)")
|
|
153
|
-
.action(async (opts) => {
|
|
154
|
-
const dirs = requireDataDirs(emit, opts.dataDir);
|
|
155
|
-
const coordRoot = context?.resolveCoordRoot?.() ?? context?.repoRoot ?? monorepoRoot() ?? process.cwd();
|
|
156
|
-
const lifecycle = await readDesktopLifecycleIndex(coordRoot);
|
|
157
|
-
for (const dir of dirs) {
|
|
158
|
-
const plan = planTidy(listAccounts(dir), lifecycle, {
|
|
159
|
-
accounts: opts.account,
|
|
160
|
-
includeLegacyPrefix: opts.includeLegacyPrefix,
|
|
161
|
-
});
|
|
162
|
-
const planned = plan.actions.map((action) => ({
|
|
163
|
-
account_uuid: action.entry.accountUuid,
|
|
164
|
-
cli_session_id: action.entry.cliSessionId,
|
|
165
|
-
title: action.entry.title,
|
|
166
|
-
source: action.source,
|
|
167
|
-
lifecycle_updated_at: action.lifecycle?.updatedAt ?? null,
|
|
168
|
-
file: action.entry.file,
|
|
169
|
-
}));
|
|
170
|
-
const skipped = plan.skipped
|
|
171
|
-
.map((skip) => ({
|
|
172
|
-
account_uuid: skip.entry.accountUuid,
|
|
173
|
-
cli_session_id: skip.entry.cliSessionId,
|
|
174
|
-
title: skip.entry.title,
|
|
175
|
-
reason: skip.reason,
|
|
176
|
-
lifecycle: skip.lifecycle?.state ?? null,
|
|
177
|
-
}))
|
|
178
|
-
.filter((skip) => skip.reason !== "already_archived");
|
|
179
|
-
const skippedByReason = Object.fromEntries([
|
|
180
|
-
"already_archived",
|
|
181
|
-
"blocked_title",
|
|
182
|
-
"lifecycle_active",
|
|
183
|
-
"lifecycle_blocked",
|
|
184
|
-
"unmatched",
|
|
185
|
-
].map((reason) => [
|
|
186
|
-
reason,
|
|
187
|
-
plan.skipped.filter((skip) => skip.reason === reason).length,
|
|
188
|
-
]));
|
|
189
|
-
if (!opts.yes) {
|
|
190
|
-
emit.data({
|
|
191
|
-
data_dir: dir,
|
|
192
|
-
dry_run: true,
|
|
193
|
-
planned,
|
|
194
|
-
skipped,
|
|
195
|
-
skipped_by_reason: skippedByReason,
|
|
196
|
-
hint: plan.actions.length > 0 ? "re-run with --yes to archive" : "nothing to archive",
|
|
197
|
-
});
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
const result = applyTidy(plan);
|
|
201
|
-
emit.data({
|
|
202
|
-
data_dir: dir,
|
|
203
|
-
dry_run: false,
|
|
204
|
-
archived: result.archived,
|
|
205
|
-
already_archived: result.alreadyArchived,
|
|
206
|
-
planned,
|
|
207
|
-
skipped,
|
|
208
|
-
skipped_by_reason: skippedByReason,
|
|
209
|
-
hint: result.archived > 0
|
|
210
|
-
? "fully quit the Claude desktop app (tray icon, not the X) and relaunch to refresh the sidebar"
|
|
211
|
-
: "nothing to archive",
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
144
|
}
|
|
216
145
|
function collect(value, previous) {
|
|
217
146
|
return previous.concat([value]);
|
package/dist/commands/context.js
CHANGED
|
@@ -84,10 +84,6 @@ function renderSelf(s) {
|
|
|
84
84
|
body.push(` agent-${s.name ?? "?"} (${formatAge(s.session_age_secs)} old, owner=${s.instance_id.slice(0, 8)}…)`);
|
|
85
85
|
if (s.task)
|
|
86
86
|
body.push(` task: "${s.task}"`);
|
|
87
|
-
if (s.last_tool) {
|
|
88
|
-
const target = s.last_tool_target ? ` ${truncate(s.last_tool_target, 80)}` : "";
|
|
89
|
-
body.push(` last: ${s.last_tool}${target}`);
|
|
90
|
-
}
|
|
91
87
|
if (s.files_held.length > 0) {
|
|
92
88
|
body.push(` holds ${s.files_held.length} file(s):`);
|
|
93
89
|
for (const f of s.files_held.slice(0, 5))
|
|
@@ -150,8 +146,7 @@ function renderPeers(p) {
|
|
|
150
146
|
const lines = p.rows.map((peer) => {
|
|
151
147
|
const taskBit = peer.task ? ` "${truncate(peer.task, 40)}"` : "";
|
|
152
148
|
const filesBit = peer.files > 0 ? `${peer.files}f` : "0f";
|
|
153
|
-
|
|
154
|
-
return ` agent-${peer.name.padEnd(12)}${taskBit} (${peer.age_min}m old, ${filesBit}${lastBit})`;
|
|
149
|
+
return ` agent-${peer.name.padEnd(12)}${taskBit} (${peer.age_min}m old, ${filesBit})`;
|
|
155
150
|
});
|
|
156
151
|
return section("peers", lines);
|
|
157
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/commands/decision.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/commands/decision.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAwCnD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,GAAG,IAAI,CAgStF"}
|