harnery 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commander.d.ts.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 +1220 -588
- 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 +305 -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 +155 -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 +1512 -592
- 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 +351 -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 +165 -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
package/src/commands/web.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { spawn, spawnSync } from "node:child_process";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
+
import { createServer } from "node:net";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
import type { Command } from "commander";
|
|
6
7
|
import type { EmitContext } from "../commander.ts";
|
|
8
|
+
import { DEFAULT_WEB_PORT, resolveWebPort } from "../core/config.ts";
|
|
7
9
|
import { lazyFetchWebRoot, webRunner } from "./web-fetch.ts";
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -88,13 +90,55 @@ function resolveWebRoot(emit: EmitContext, allowFetch: boolean): string | null {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
interface UpOpts {
|
|
91
|
-
port
|
|
93
|
+
port?: string;
|
|
92
94
|
coordRoot?: string;
|
|
93
95
|
prod?: boolean;
|
|
94
96
|
fetch?: boolean;
|
|
95
97
|
maxOldSpace?: string;
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Probe the exact localhost socket Next will claim. This is deliberately a
|
|
102
|
+
* check-and-report step, not an alternate-port allocator: Harnery keeps one
|
|
103
|
+
* memorable URL and asks the caller to resolve a real conflict explicitly.
|
|
104
|
+
*/
|
|
105
|
+
export async function isWebPortAvailable(port: number): Promise<boolean> {
|
|
106
|
+
return await new Promise<boolean>((resolve, reject) => {
|
|
107
|
+
const server = createServer();
|
|
108
|
+
server.unref();
|
|
109
|
+
server.once("error", (error: NodeJS.ErrnoException) => {
|
|
110
|
+
if (error.code === "EADDRINUSE" || error.code === "EACCES") {
|
|
111
|
+
resolve(false);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
reject(error);
|
|
115
|
+
});
|
|
116
|
+
server.listen({ host: "127.0.0.1", port, exclusive: true }, () => {
|
|
117
|
+
server.close((error) => (error ? reject(error) : resolve(true)));
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function reportInvalidPort(emit: EmitContext, error: unknown): void {
|
|
123
|
+
emit.error({
|
|
124
|
+
code: "invalid_web_port",
|
|
125
|
+
message: error instanceof Error ? error.message : "invalid web port",
|
|
126
|
+
hint: `Use an integer from 1024 through 65535; the default is ${DEFAULT_WEB_PORT}.`,
|
|
127
|
+
});
|
|
128
|
+
process.exitCode = 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function requireAvailablePort(emit: EmitContext, port: number): Promise<boolean> {
|
|
132
|
+
if (await isWebPortAvailable(port)) return true;
|
|
133
|
+
emit.error({
|
|
134
|
+
code: "web_port_in_use",
|
|
135
|
+
message: `port ${port} is already in use`,
|
|
136
|
+
hint: `Stop the process using ${port}, or choose a deliberate override with \`harn web up --port <port>\`.`,
|
|
137
|
+
});
|
|
138
|
+
process.exitCode = 1;
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
|
|
98
142
|
export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
99
143
|
const web = program
|
|
100
144
|
.command("web")
|
|
@@ -106,7 +150,7 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
106
150
|
"Start the dashboard. Default: dev mode (HMR, no build needed). With " +
|
|
107
151
|
"--prod, runs next start (requires a prior `harn web build`).",
|
|
108
152
|
)
|
|
109
|
-
.option("-p, --port <port>",
|
|
153
|
+
.option("-p, --port <port>", `Listen port (default ${DEFAULT_WEB_PORT})`)
|
|
110
154
|
.option(
|
|
111
155
|
"--coord-root <dir>",
|
|
112
156
|
"Override the coord root (default: cwd; web walks up looking for .harnery/)",
|
|
@@ -125,7 +169,13 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
125
169
|
}
|
|
126
170
|
|
|
127
171
|
const coordRoot = opts.coordRoot ?? process.cwd();
|
|
128
|
-
|
|
172
|
+
let port: number;
|
|
173
|
+
try {
|
|
174
|
+
port = resolveWebPort(opts.port, opts.coordRoot);
|
|
175
|
+
} catch (error) {
|
|
176
|
+
reportInvalidPort(emit, error);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
129
179
|
const mode = opts.prod ? "start" : "dev";
|
|
130
180
|
|
|
131
181
|
if (opts.prod) {
|
|
@@ -141,6 +191,8 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
141
191
|
}
|
|
142
192
|
}
|
|
143
193
|
|
|
194
|
+
if (!(await requireAvailablePort(emit, port))) return;
|
|
195
|
+
|
|
144
196
|
const heapMb = resolveMaxOldSpaceMb(opts.maxOldSpace);
|
|
145
197
|
emit.log(`harn web · http://localhost:${port} (${mode})`, "info");
|
|
146
198
|
emit.log(`files origin · http://harnery-files.localhost:${port}`, "info");
|
|
@@ -152,7 +204,7 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
152
204
|
env: {
|
|
153
205
|
...process.env,
|
|
154
206
|
HARNERY_COORD_ROOT: coordRoot,
|
|
155
|
-
HARNERY_WEB_PORT: port,
|
|
207
|
+
HARNERY_WEB_PORT: String(port),
|
|
156
208
|
...(nodeOptionsWithHeapCap(heapMb)
|
|
157
209
|
? { NODE_OPTIONS: nodeOptionsWithHeapCap(heapMb) as string }
|
|
158
210
|
: {}),
|
|
@@ -197,14 +249,14 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
197
249
|
web
|
|
198
250
|
.command("start")
|
|
199
251
|
.description("Start the production server (next start). Requires prior `harn web build`.")
|
|
200
|
-
.option("-p, --port <port>",
|
|
252
|
+
.option("-p, --port <port>", `Listen port (default ${DEFAULT_WEB_PORT})`)
|
|
201
253
|
.option("--coord-root <dir>", "Override the coord root")
|
|
202
254
|
.option("--no-fetch", "Don't auto-fetch the dashboard if it's missing (npm installs)")
|
|
203
255
|
.option(
|
|
204
256
|
"--max-old-space <mb>",
|
|
205
257
|
`V8 old-space ceiling in MB; 0 restores Next's own sizing (default ${DEFAULT_MAX_OLD_SPACE_MB}, env HARNERY_WEB_MAX_OLD_SPACE)`,
|
|
206
258
|
)
|
|
207
|
-
.action((opts:
|
|
259
|
+
.action(async (opts: UpOpts) => {
|
|
208
260
|
const root = resolveWebRoot(emit, opts.fetch !== false);
|
|
209
261
|
if (!root) {
|
|
210
262
|
process.exitCode = 1;
|
|
@@ -221,7 +273,14 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
221
273
|
return;
|
|
222
274
|
}
|
|
223
275
|
const coordRoot = opts.coordRoot ?? process.cwd();
|
|
224
|
-
|
|
276
|
+
let port: number;
|
|
277
|
+
try {
|
|
278
|
+
port = resolveWebPort(opts.port, opts.coordRoot);
|
|
279
|
+
} catch (error) {
|
|
280
|
+
reportInvalidPort(emit, error);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (!(await requireAvailablePort(emit, port))) return;
|
|
225
284
|
const heapMb = resolveMaxOldSpaceMb(opts.maxOldSpace);
|
|
226
285
|
emit.log(`harn web · http://localhost:${port} (start)`, "info");
|
|
227
286
|
emit.log(`reading .harnery/ from: ${coordRoot}`, "info");
|
|
@@ -232,7 +291,7 @@ export function registerWebCommand(program: Command, emit: EmitContext): void {
|
|
|
232
291
|
env: {
|
|
233
292
|
...process.env,
|
|
234
293
|
HARNERY_COORD_ROOT: coordRoot,
|
|
235
|
-
HARNERY_WEB_PORT: port,
|
|
294
|
+
HARNERY_WEB_PORT: String(port),
|
|
236
295
|
...(nodeOptionsWithHeapCap(heapMb)
|
|
237
296
|
? { NODE_OPTIONS: nodeOptionsWithHeapCap(heapMb) as string }
|
|
238
297
|
: {}),
|
package/src/commands/work.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
acceptWorkItem,
|
|
16
16
|
cancelWorkItem,
|
|
17
17
|
createWorkItem,
|
|
18
|
-
|
|
18
|
+
listWorkItemsWithWarnings,
|
|
19
19
|
readWorkItem,
|
|
20
20
|
reconcileAllWorkItems,
|
|
21
21
|
reconcileWorkItem,
|
|
@@ -114,16 +114,27 @@ export function registerWorkCommand(program: Command, emit: EmitContext): void {
|
|
|
114
114
|
.option("--json", "Emit complete work records as JSON")
|
|
115
115
|
.action((opts: { state?: string; json?: boolean }) => {
|
|
116
116
|
withWorkRoot(emit, (coordRoot) => {
|
|
117
|
-
const
|
|
117
|
+
const result = listWorkItemsWithWarnings(coordRoot);
|
|
118
|
+
const records = result.records.filter(
|
|
118
119
|
(record) => !opts.state || record.projection.state === opts.state,
|
|
119
120
|
);
|
|
120
121
|
if (opts.json) {
|
|
121
122
|
emit.config({ format: "json" });
|
|
122
123
|
emit.data(records);
|
|
123
|
-
|
|
124
|
+
for (const warning of result.warnings) {
|
|
125
|
+
emit.log(renderWorkListWarning(warning.work_id, warning.reason), "warn");
|
|
126
|
+
}
|
|
127
|
+
} else if (records.length === 0 && result.warnings.length === 0) {
|
|
124
128
|
emit.text("no durable work\n");
|
|
125
129
|
} else {
|
|
126
|
-
emit.text(
|
|
130
|
+
emit.text(
|
|
131
|
+
`${[
|
|
132
|
+
...records.map(renderWorkRow),
|
|
133
|
+
...result.warnings.map((warning) =>
|
|
134
|
+
renderWorkListWarning(warning.work_id, warning.reason),
|
|
135
|
+
),
|
|
136
|
+
].join("\n")}\n`,
|
|
137
|
+
);
|
|
127
138
|
}
|
|
128
139
|
});
|
|
129
140
|
});
|
|
@@ -326,7 +337,11 @@ function registerGovernanceCommand(
|
|
|
326
337
|
// dispatch. Resolve the goal BEFORE touching the work item so a refusal leaves
|
|
327
338
|
// nothing half-done.
|
|
328
339
|
const goalId =
|
|
329
|
-
name === "reopen"
|
|
340
|
+
name === "reopen"
|
|
341
|
+
? findCompletedMissionGoverning(coordRoot, workId, (warning) => {
|
|
342
|
+
emit.log(renderGovernorEnumerationWarning(warning.goal_id, warning.reason), "warn");
|
|
343
|
+
})
|
|
344
|
+
: undefined;
|
|
330
345
|
const record = fn(coordRoot, workId, {
|
|
331
346
|
...opts,
|
|
332
347
|
...(opts.finding?.length ? { findings: opts.finding } : {}),
|
|
@@ -432,6 +447,14 @@ function renderWorkRow(record: WorkRecord): string {
|
|
|
432
447
|
return `${record.intent.id} ${projection.state.padEnd(17)} ${renderAttemptBudget(record).padEnd(18)} ${projection.next_action.padEnd(21)} ${record.intent.title}`;
|
|
433
448
|
}
|
|
434
449
|
|
|
450
|
+
function renderWorkListWarning(workId: string, reason: string): string {
|
|
451
|
+
return `warning ${workId} unreadable: ${reason}`;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function renderGovernorEnumerationWarning(goalId: string, reason: string): string {
|
|
455
|
+
return `skipped unreadable governor ${goalId}: ${reason}`;
|
|
456
|
+
}
|
|
457
|
+
|
|
435
458
|
// `max_attempts` budgets CHARGED attempts (ADR 0046), so the budget is
|
|
436
459
|
// charged/max, not the raw attempt count. When uncharged environment/upstream
|
|
437
460
|
// attempts happened, surface them as a suffix rather than folding them into the
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** First-party harness adapters supported by Harnery's canonical V3 ledger. */
|
|
2
|
+
export type Adapter = "claude-code" | "cursor" | "codex";
|
|
3
|
+
|
|
4
|
+
/** Canonical producer classes used by V3 provenance. */
|
|
5
|
+
export type EventSource = "agent-hooks" | "agent-coord" | "user" | "system";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The opt-in live probe that produces an attestation (ADR 0038).
|
|
3
3
|
*
|
|
4
|
-
* One bounded
|
|
4
|
+
* One bounded probe per adapter, through the same `spawn` the workflow engine
|
|
5
5
|
* uses, so what gets attested is the path production takes rather than a
|
|
6
|
-
* parallel test rig.
|
|
6
|
+
* parallel test rig. The probe permits a small tool-iteration budget because
|
|
7
|
+
* repository instructions can require workflow children to register before
|
|
8
|
+
* replying; a one-iteration ceiling made a healthy Claude CLI look unreachable.
|
|
7
9
|
*/
|
|
8
10
|
|
|
9
11
|
import type { SpawnResult } from "../workflow/types.ts";
|
|
@@ -24,6 +26,9 @@ import type { AdapterId, CapabilitySupport } from "./types.ts";
|
|
|
24
26
|
export const ATTESTATION_PROMPT = "Reply with the single word: ok";
|
|
25
27
|
|
|
26
28
|
export const DEFAULT_ATTESTATION_TIMEOUT_MS = 120_000;
|
|
29
|
+
// Claude may consume three iterations on repository-required set-task,
|
|
30
|
+
// identity recovery, and end-turn status before it can return the probe word.
|
|
31
|
+
export const ATTESTATION_MAX_TURNS = 4;
|
|
27
32
|
|
|
28
33
|
/** Vendor failures arrive as whole console transcripts, banner and prompt echo
|
|
29
34
|
* included. Reports are bounded evidence, so the reason is collapsed to one
|
|
@@ -123,7 +128,7 @@ export async function runAdapterAttestation(
|
|
|
123
128
|
: await adapter.spawn({
|
|
124
129
|
prompt: ATTESTATION_PROMPT,
|
|
125
130
|
timeoutMs,
|
|
126
|
-
maxTurns:
|
|
131
|
+
maxTurns: ATTESTATION_MAX_TURNS,
|
|
127
132
|
cwd,
|
|
128
133
|
subscriptionOnly,
|
|
129
134
|
});
|
|
@@ -44,7 +44,7 @@ export const BUILTIN_ADAPTER_PROFILES = {
|
|
|
44
44
|
authModel: "own-auth",
|
|
45
45
|
modelFamily: "claude",
|
|
46
46
|
effortValues: ["low", "medium", "high", "xhigh", "max"],
|
|
47
|
-
verified: { date: "2026-
|
|
47
|
+
verified: { date: "2026-08-18", version: "2.1.233 (Claude Code)" },
|
|
48
48
|
capabilities: capabilities({
|
|
49
49
|
effortSelection: supported("Mapped to `--effort <level>`."),
|
|
50
50
|
maxTurns: supported("Mapped to `--max-turns <n>`."),
|
|
@@ -70,7 +70,7 @@ export const BUILTIN_ADAPTER_PROFILES = {
|
|
|
70
70
|
authModel: "own-auth",
|
|
71
71
|
modelFamily: "gpt",
|
|
72
72
|
effortValues: ["none", "minimal", "low", "medium", "high", "xhigh"],
|
|
73
|
-
verified: { date: "2026-
|
|
73
|
+
verified: { date: "2026-08-04", version: "codex-cli 0.144.5" },
|
|
74
74
|
// Verified against codex-cli 0.144.5: `--sandbox <mode>` plus
|
|
75
75
|
// `sandbox_workspace_write.writable_roots`. Without the writable-root entry
|
|
76
76
|
// a workspace-write child still cannot write a repository's .git directory.
|
|
@@ -106,7 +106,7 @@ export const BUILTIN_ADAPTER_PROFILES = {
|
|
|
106
106
|
authModel: "own-auth",
|
|
107
107
|
modelFamily: "multi",
|
|
108
108
|
effortValues: [],
|
|
109
|
-
verified: { date: "2026-
|
|
109
|
+
verified: { date: "2026-08-18", version: "2026.08.11-e8db854" },
|
|
110
110
|
capabilities: capabilities({
|
|
111
111
|
effortSelection: unsupported(
|
|
112
112
|
"Cursor embeds effort in some parameterized model ids; Harnery does not rewrite model ids.",
|
|
@@ -115,9 +115,7 @@ export const BUILTIN_ADAPTER_PROFILES = {
|
|
|
115
115
|
sessionId: supported("Read from the JSON result envelope."),
|
|
116
116
|
cost: unsupported("The JSON result envelope carries no cost."),
|
|
117
117
|
contextTelemetry: unknown("No stable Cursor context-usage payload has been certified."),
|
|
118
|
-
preCompactionSignal:
|
|
119
|
-
"Harnery does not wire an unverified Cursor preCompact hook.",
|
|
120
|
-
),
|
|
118
|
+
preCompactionSignal: supported("Cursor preCompact is wired to a durable checkpoint."),
|
|
121
119
|
postCompactionSignal: unsupported(
|
|
122
120
|
"Harnery does not wire an unverified Cursor postCompact hook.",
|
|
123
121
|
),
|
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Emit canonical
|
|
3
|
-
*
|
|
2
|
+
* Emit canonical V3 observations by spawning `agent-coord emit-event`. Used by
|
|
3
|
+
* coordination commands whose durable state change also has a V3 audit event.
|
|
4
4
|
*
|
|
5
5
|
* Soft-fails: never throws into the caller. A failed emit logs to stderr
|
|
6
6
|
* (visible to operators in their terminal) but never breaks the CLI flow.
|
|
7
7
|
*
|
|
8
|
-
* Synchronous spawn: the projector runs before the CLI returns.
|
|
9
|
-
*
|
|
8
|
+
* Synchronous spawn: the projector runs before the CLI returns. The child has
|
|
9
|
+
* a 15-second safety budget; loaded-host checks normally finish in a few
|
|
10
|
+
* seconds and record the observation before the parent command exits.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { spawnSync } from "node:child_process";
|
|
14
|
+
import type { LiveCoordinationObservationV3 } from "../events/v3/live-observation.ts";
|
|
13
15
|
import { coordBinPath } from "./coord-bin.ts";
|
|
14
16
|
import { resolveCoordRoot } from "./coord-client.ts";
|
|
15
17
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
+
export type EventV3EmitObservation =
|
|
19
|
+
| LiveCoordinationObservationV3
|
|
20
|
+
| {
|
|
21
|
+
event_type: "coord.lifecycle_changed";
|
|
22
|
+
new_state: "active" | "blocked" | "done";
|
|
23
|
+
reason?: string;
|
|
24
|
+
suggested_session_name?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export interface EventV3EmitInput {
|
|
18
28
|
owner: string;
|
|
19
29
|
session: string;
|
|
20
30
|
adapter: "claude-code" | "cursor" | "codex";
|
|
21
|
-
|
|
22
|
-
turnId?: string;
|
|
23
|
-
parentSessionId?: string;
|
|
24
|
-
parentTurnId?: string;
|
|
31
|
+
observation: EventV3EmitObservation;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
/**
|
|
28
35
|
* Resolve the coord root for a canonical emit.
|
|
29
36
|
*
|
|
30
37
|
* Delegates to `resolveCoordRoot()`, the single resolution the hooks and the
|
|
31
|
-
* CLI's reads also use. An
|
|
32
|
-
*
|
|
33
|
-
* root, so a divergent emit root blocks rule 1/3 on a turn that did run
|
|
34
|
-
* `agents status`, and no sequence of CLI commands can satisfy it.
|
|
38
|
+
* CLI's reads also use. An observation resolved any other way can disappear
|
|
39
|
+
* from the live V3 generation even though the command itself succeeded.
|
|
35
40
|
*/
|
|
36
41
|
export function resolveEmitRoot(start: string = process.cwd()): string | null {
|
|
37
42
|
return resolveCoordRoot(start);
|
|
38
43
|
}
|
|
39
44
|
|
|
40
|
-
export function
|
|
45
|
+
export function emitEventV3(input: EventV3EmitInput): boolean {
|
|
41
46
|
const root = resolveEmitRoot();
|
|
42
47
|
if (!root) return false;
|
|
43
48
|
const binary = coordBinPath("agent-coord", root);
|
|
@@ -46,31 +51,35 @@ export function emitCanonical(input: CanonicalEmitInput): boolean {
|
|
|
46
51
|
const args = [
|
|
47
52
|
"emit-event",
|
|
48
53
|
"--type",
|
|
49
|
-
input.
|
|
54
|
+
input.observation.event_type,
|
|
50
55
|
"--owner",
|
|
51
56
|
input.owner,
|
|
52
57
|
"--session",
|
|
53
58
|
input.session,
|
|
54
59
|
"--adapter",
|
|
55
60
|
input.adapter,
|
|
56
|
-
"--data-
|
|
57
|
-
JSON.stringify(input.data),
|
|
61
|
+
"--data-stdin",
|
|
58
62
|
];
|
|
59
|
-
if (input.turnId) args.push("--turn-id", input.turnId);
|
|
60
|
-
if (input.parentSessionId) args.push("--parent-session-id", input.parentSessionId);
|
|
61
|
-
if (input.parentTurnId) args.push("--parent-turn-id", input.parentTurnId);
|
|
62
63
|
// Pin cwd + HARNERY_COORD_ROOT_OVERRIDE so the child writes to the SAME
|
|
63
64
|
// stream we resolved, regardless of where the caller's shell is cd'd.
|
|
64
65
|
const result = spawnSync(binary, args, {
|
|
65
66
|
encoding: "utf8",
|
|
66
|
-
stdio: "ignore",
|
|
67
|
-
|
|
67
|
+
stdio: ["pipe", "ignore", "pipe"],
|
|
68
|
+
input: JSON.stringify(input.observation),
|
|
69
|
+
// Budget the append generously. Under multi-agent contention a single
|
|
70
|
+
// `agent-coord emit-event` has been measured at 3.4-4.1s on a loaded
|
|
71
|
+
// host, so a 3s cap timed out every emit and blocked end-of-turn checks
|
|
72
|
+
// -- exactly the failure this module's doc warns about.
|
|
73
|
+
timeout: 15000,
|
|
68
74
|
cwd: root,
|
|
69
75
|
env: { ...process.env, HARNERY_COORD_ROOT_OVERRIDE: root },
|
|
70
76
|
});
|
|
71
77
|
if (result.error || result.status !== 0) {
|
|
72
|
-
const
|
|
73
|
-
|
|
78
|
+
const detail = typeof result.stderr === "string" ? result.stderr.trim() : "";
|
|
79
|
+
const why = result.error
|
|
80
|
+
? result.error.message
|
|
81
|
+
: `exit ${result.status}${detail ? `: ${detail}` : ""}`;
|
|
82
|
+
process.stderr.write(`emitEventV3: ${input.observation.event_type} emit failed (${why})\n`); // lint-ok-emission: soft-fail diagnostic promised by the module doc; silent drops cost blocked turns
|
|
74
83
|
return false;
|
|
75
84
|
}
|
|
76
85
|
return true;
|