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,43 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `agent-hook` tool handlers (see effects/index.ts for the family rationale).
|
|
2
|
+
* Privacy-safe image artifact capture for normalized tool hooks.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* the canonical stream. The web image feed (`/images`) groups those events by
|
|
10
|
-
* hash and streams them live over the existing SSE infra.
|
|
11
|
-
*
|
|
12
|
-
* Why this lives at the hook layer: it's the single adapter-agnostic chokepoint
|
|
13
|
-
* that sees every tool call across Claude Code / Cursor / Codex with the full
|
|
14
|
-
* `tool_input` (file paths) and `tool_response`. No per-command code needed.
|
|
15
|
-
*
|
|
16
|
-
* Everything here is best-effort and MUST NOT throw; callers wrap it in
|
|
17
|
-
* try/catch + logError, matching every other effect.
|
|
4
|
+
* Image bytes are content-addressed under `.harnery/images/`. The canonical V3
|
|
5
|
+
* ledger receives an `artifact.observed` record after the source tool event is
|
|
6
|
+
* durable, so the web feed can recover provenance without retaining command,
|
|
7
|
+
* output, intent, or absolute paths.
|
|
18
8
|
*/
|
|
9
|
+
import type { EventV3 } from "../../events/v3/contract.js";
|
|
19
10
|
import type { ParsedPayload } from "../adapter/parse.js";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
payload: ParsedPayload | null;
|
|
27
|
-
instanceId: string;
|
|
28
|
-
sessionId: string;
|
|
29
|
-
adapter: Adapter;
|
|
11
|
+
export interface CapturedImageArtifact {
|
|
12
|
+
hash: string;
|
|
13
|
+
ext: string;
|
|
14
|
+
bytes: number;
|
|
15
|
+
role: "viewed" | "produced";
|
|
16
|
+
workspace_path?: string;
|
|
30
17
|
}
|
|
18
|
+
/** Copy every qualifying image referenced by one tool hook into the blob store. */
|
|
19
|
+
export declare function captureImages(coordRoot: string, eventType: "tool.requested" | "tool.completed", payload: ParsedPayload | null): CapturedImageArtifact[];
|
|
31
20
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
export declare function captureImages(coordRoot: string, ctx: CaptureContext): void;
|
|
36
|
-
/**
|
|
37
|
-
* Prune `.harnery/images/` past a size cap (default 2 GB) and an age cap
|
|
38
|
-
* (default 30 days), oldest-mtime-first. Fired on session.start next to
|
|
39
|
-
* journalJanitor. Pure-fs, fail-soft. Orphaned `image.captured` events whose
|
|
40
|
-
* blob was pruned render as an "expired" placeholder in the gallery.
|
|
21
|
+
* Emit content-addressed image references as canonical V3 artifact events.
|
|
22
|
+
* Each observation uses a one-event producer boot, which preserves independent
|
|
23
|
+
* producer sequence continuity while the ledger writer serializes appends.
|
|
41
24
|
*/
|
|
25
|
+
export declare function recordImageArtifactsV3(coordRoot: string, sourceEvent: EventV3, artifacts: readonly CapturedImageArtifact[]): void;
|
|
26
|
+
export declare function buildImageArtifactEventV3(sourceEvent: EventV3, artifact: CapturedImageArtifact): EventV3;
|
|
27
|
+
/** Prune the bounded blob store by age and total size, oldest first. */
|
|
42
28
|
export declare function imageJanitor(coordRoot: string): void;
|
|
43
29
|
//# sourceMappingURL=image-capture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-capture.d.ts","sourceRoot":"","sources":["../../../../src/core/hooks/effects/image-capture.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"image-capture.d.ts","sourceRoot":"","sources":["../../../../src/core/hooks/effects/image-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAgBzD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD,mFAAmF;AACnF,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,gBAAgB,GAAG,gBAAgB,EAC9C,OAAO,EAAE,aAAa,GAAG,IAAI,GAC5B,qBAAqB,EAAE,CA0BzB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,SAAS,qBAAqB,EAAE,GAC1C,IAAI,CAKN;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,OAAO,EACpB,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CA4CT;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CA0CpD"}
|
|
@@ -1,170 +1,116 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `agent-hook` tool handlers (see effects/index.ts for the family rationale).
|
|
2
|
+
* Privacy-safe image artifact capture for normalized tool hooks.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* the canonical stream. The web image feed (`/images`) groups those events by
|
|
10
|
-
* hash and streams them live over the existing SSE infra.
|
|
11
|
-
*
|
|
12
|
-
* Why this lives at the hook layer: it's the single adapter-agnostic chokepoint
|
|
13
|
-
* that sees every tool call across Claude Code / Cursor / Codex with the full
|
|
14
|
-
* `tool_input` (file paths) and `tool_response`. No per-command code needed.
|
|
15
|
-
*
|
|
16
|
-
* Everything here is best-effort and MUST NOT throw; callers wrap it in
|
|
17
|
-
* try/catch + logError, matching every other effect.
|
|
4
|
+
* Image bytes are content-addressed under `.harnery/images/`. The canonical V3
|
|
5
|
+
* ledger receives an `artifact.observed` record after the source tool event is
|
|
6
|
+
* durable, so the web feed can recover provenance without retaining command,
|
|
7
|
+
* output, intent, or absolute paths.
|
|
18
8
|
*/
|
|
19
|
-
import { createHash } from "node:crypto";
|
|
9
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
20
10
|
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
21
|
-
import { isAbsolute, join, resolve } from "node:path";
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
* excluded: book renders aren't an "image feed" and don't thumbnail inline. */
|
|
11
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
12
|
+
import { buildEventV3 } from "../../events/v3/builder.js";
|
|
13
|
+
import { writeEventV3 } from "../../events/v3/writer.js";
|
|
25
14
|
const IMAGE_EXTS = new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"]);
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const MEDIA_TYPES = {
|
|
16
|
+
png: "image/png",
|
|
17
|
+
jpg: "image/jpeg",
|
|
18
|
+
jpeg: "image/jpeg",
|
|
19
|
+
gif: "image/gif",
|
|
20
|
+
webp: "image/webp",
|
|
21
|
+
bmp: "image/bmp",
|
|
22
|
+
svg: "image/svg+xml",
|
|
23
|
+
};
|
|
28
24
|
const MAX_CAPTURE_BYTES = 25 * 1024 * 1024;
|
|
29
|
-
/** A produced image must have been written within this window of the command
|
|
30
|
-
* finishing, otherwise a path merely *mentioned* in output (an old baseline,
|
|
31
|
-
* a doc reference) would be captured. Viewed images skip this gate. */
|
|
32
25
|
const PRODUCED_MTIME_WINDOW_MS = 120_000;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
? collectViewed(toolName, ctx.data, cwd)
|
|
47
|
-
: collectProduced(toolName, ctx.payload, cwd);
|
|
48
|
-
if (candidates.length === 0)
|
|
49
|
-
return;
|
|
50
|
-
for (const cand of candidates) {
|
|
51
|
-
// Never re-capture our own blob store (would loop on Reads of the gallery).
|
|
52
|
-
if (cand.path.startsWith(`${imagesDir}/`))
|
|
26
|
+
const IMAGE_PATH_RE = /[\w./~@:+-]+\.(?:png|jpe?g|gif|webp|bmp|svg)\b/gi;
|
|
27
|
+
/** Copy every qualifying image referenced by one tool hook into the blob store. */
|
|
28
|
+
export function captureImages(coordRoot, eventType, payload) {
|
|
29
|
+
const images = join(coordRoot, ".harnery", "images");
|
|
30
|
+
const cwd = payload?.cwd ? resolve(payload.cwd) : process.cwd();
|
|
31
|
+
const toolName = payload?.tool_name ?? "";
|
|
32
|
+
const candidates = eventType === "tool.requested"
|
|
33
|
+
? collectViewed(toolName, payload?.tool_input, cwd)
|
|
34
|
+
: collectProduced(toolName, payload, cwd);
|
|
35
|
+
const captured = [];
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
for (const candidate of candidates) {
|
|
38
|
+
if (candidate.path.startsWith(`${images}${sep}`))
|
|
53
39
|
continue;
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
40
|
+
const blob = captureOne(images, candidate);
|
|
41
|
+
if (!blob)
|
|
56
42
|
continue;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
instance_id: ctx.instanceId,
|
|
60
|
-
session_id: ctx.sessionId,
|
|
61
|
-
adapter: ctx.adapter,
|
|
62
|
-
data: {
|
|
63
|
-
hash: captured.hash,
|
|
64
|
-
ext: captured.ext,
|
|
65
|
-
bytes: captured.bytes,
|
|
66
|
-
role: cand.role,
|
|
67
|
-
source_path: canonicalize(coordRoot, cand.path),
|
|
68
|
-
tool_name: toolName,
|
|
69
|
-
tool_use_id: ctx.data.tool_use_id,
|
|
70
|
-
...(cand.intent ? { intent: cand.intent } : {}),
|
|
71
|
-
...(cand.commandHead ? { command_head: cand.commandHead } : {}),
|
|
72
|
-
},
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/** Read tool → the file_path it's about to show (the "agent saw this" signal). */
|
|
78
|
-
function collectViewed(toolName, data, cwd) {
|
|
79
|
-
if (toolName !== "Read")
|
|
80
|
-
return [];
|
|
81
|
-
const input = parseToolInput(data.tool_input);
|
|
82
|
-
const filePath = input?.file_path;
|
|
83
|
-
if (typeof filePath !== "string" || !filePath)
|
|
84
|
-
return [];
|
|
85
|
-
if (!hasImageExt(filePath))
|
|
86
|
-
return [];
|
|
87
|
-
return [
|
|
88
|
-
{
|
|
89
|
-
path: toAbsolute(filePath, cwd),
|
|
90
|
-
role: "viewed",
|
|
91
|
-
intent: typeof data.intent === "string" ? data.intent : undefined,
|
|
92
|
-
requireRecentMtime: false,
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
/** Bash tool → scan the command + its output for freshly-written image files. */
|
|
97
|
-
function collectProduced(toolName, payload, cwd) {
|
|
98
|
-
if (toolName !== "Bash")
|
|
99
|
-
return [];
|
|
100
|
-
const command = bashCommand(payload);
|
|
101
|
-
const responseText = stringifyResponse(payload?.tool_response);
|
|
102
|
-
const commandHead = command ? command.slice(0, 120) : undefined;
|
|
103
|
-
const seen = new Set();
|
|
104
|
-
const out = [];
|
|
105
|
-
for (const text of [command, responseText]) {
|
|
106
|
-
if (!text)
|
|
43
|
+
const dedupeKey = `${blob.hash}:${candidate.role}`;
|
|
44
|
+
if (seen.has(dedupeKey))
|
|
107
45
|
continue;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
46
|
+
seen.add(dedupeKey);
|
|
47
|
+
const workspacePath = safeWorkspacePath(coordRoot, candidate.path);
|
|
48
|
+
captured.push({
|
|
49
|
+
...blob,
|
|
50
|
+
role: candidate.role,
|
|
51
|
+
...(workspacePath ? { workspace_path: workspacePath } : {}),
|
|
52
|
+
});
|
|
116
53
|
}
|
|
117
|
-
return
|
|
54
|
+
return captured;
|
|
118
55
|
}
|
|
119
56
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
57
|
+
* Emit content-addressed image references as canonical V3 artifact events.
|
|
58
|
+
* Each observation uses a one-event producer boot, which preserves independent
|
|
59
|
+
* producer sequence continuity while the ledger writer serializes appends.
|
|
123
60
|
*/
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
catch {
|
|
130
|
-
return null; // path doesn't exist (common for "produced" false-positives)
|
|
131
|
-
}
|
|
132
|
-
if (!st.isFile() || st.size === 0 || st.size > MAX_CAPTURE_BYTES)
|
|
133
|
-
return null;
|
|
134
|
-
if (cand.requireRecentMtime && Date.now() - st.mtimeMs > PRODUCED_MTIME_WINDOW_MS) {
|
|
135
|
-
return null; // mentioned but not freshly produced by this command
|
|
136
|
-
}
|
|
137
|
-
const ext = extOf(cand.path);
|
|
138
|
-
if (!ext || !IMAGE_EXTS.has(ext))
|
|
139
|
-
return null;
|
|
140
|
-
let bytes;
|
|
141
|
-
try {
|
|
142
|
-
bytes = readFileSync(cand.path);
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
return null;
|
|
61
|
+
export function recordImageArtifactsV3(coordRoot, sourceEvent, artifacts) {
|
|
62
|
+
if (!("generation_id" in sourceEvent.scope) || !sourceEvent.attestation_id)
|
|
63
|
+
return;
|
|
64
|
+
for (const artifact of artifacts) {
|
|
65
|
+
writeEventV3(coordRoot, buildImageArtifactEventV3(sourceEvent, artifact));
|
|
146
66
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (!
|
|
150
|
-
|
|
151
|
-
mkdirSync(imagesDir, { recursive: true });
|
|
152
|
-
const tmp = `${dest}.tmp.${process.pid}`;
|
|
153
|
-
writeFileSync(tmp, bytes);
|
|
154
|
-
renameSync(tmp, dest);
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
return null; // couldn't store, don't emit a dangling event
|
|
158
|
-
}
|
|
67
|
+
}
|
|
68
|
+
export function buildImageArtifactEventV3(sourceEvent, artifact) {
|
|
69
|
+
if (!("generation_id" in sourceEvent.scope) || !sourceEvent.attestation_id) {
|
|
70
|
+
throw new Error("image artifacts require a generation-scoped source event");
|
|
159
71
|
}
|
|
160
|
-
return
|
|
72
|
+
return buildEventV3("artifact.observed", {
|
|
73
|
+
producer: {
|
|
74
|
+
producer_id: "prd_agent-hook-image-capture",
|
|
75
|
+
boot_id: `boot_${randomUUID()}`,
|
|
76
|
+
sequence: 1,
|
|
77
|
+
component: "agent-hook",
|
|
78
|
+
build_id: sourceEvent.producer.build_id,
|
|
79
|
+
platform: sourceEvent.producer.platform,
|
|
80
|
+
...(sourceEvent.producer.bridge ? { bridge: sourceEvent.producer.bridge } : {}),
|
|
81
|
+
},
|
|
82
|
+
scope: {
|
|
83
|
+
root_id: sourceEvent.scope.root_id,
|
|
84
|
+
instance_id: sourceEvent.scope.instance_id,
|
|
85
|
+
session_id: sourceEvent.scope.session_id,
|
|
86
|
+
generation_id: sourceEvent.scope.generation_id,
|
|
87
|
+
...(sourceEvent.scope.run_id ? { run_id: sourceEvent.scope.run_id } : {}),
|
|
88
|
+
...(sourceEvent.scope.workflow_id ? { workflow_id: sourceEvent.scope.workflow_id } : {}),
|
|
89
|
+
...(sourceEvent.scope.workflow_agent_id
|
|
90
|
+
? { workflow_agent_id: sourceEvent.scope.workflow_agent_id }
|
|
91
|
+
: {}),
|
|
92
|
+
},
|
|
93
|
+
attestation_id: sourceEvent.attestation_id,
|
|
94
|
+
links: { caused_by: [sourceEvent.event_id] },
|
|
95
|
+
provenance: {
|
|
96
|
+
...sourceEvent.provenance,
|
|
97
|
+
attestation: "derived",
|
|
98
|
+
confidence: "high",
|
|
99
|
+
},
|
|
100
|
+
payload: {
|
|
101
|
+
artifact: {
|
|
102
|
+
artifact_id: `art_${artifact.hash}`,
|
|
103
|
+
kind: "image",
|
|
104
|
+
media_type: MEDIA_TYPES[artifact.ext] ?? "image/png",
|
|
105
|
+
bytes: artifact.bytes,
|
|
106
|
+
retention_class: "bounded_local",
|
|
107
|
+
...(artifact.workspace_path ? { workspace_path: artifact.workspace_path } : {}),
|
|
108
|
+
},
|
|
109
|
+
operation: artifact.role === "viewed" ? "viewed" : "created",
|
|
110
|
+
},
|
|
111
|
+
});
|
|
161
112
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Prune `.harnery/images/` past a size cap (default 2 GB) and an age cap
|
|
164
|
-
* (default 30 days), oldest-mtime-first. Fired on session.start next to
|
|
165
|
-
* journalJanitor. Pure-fs, fail-soft. Orphaned `image.captured` events whose
|
|
166
|
-
* blob was pruned render as an "expired" placeholder in the gallery.
|
|
167
|
-
*/
|
|
113
|
+
/** Prune the bounded blob store by age and total size, oldest first. */
|
|
168
114
|
export function imageJanitor(coordRoot) {
|
|
169
115
|
try {
|
|
170
116
|
const dir = join(coordRoot, ".harnery", "images");
|
|
@@ -176,113 +122,158 @@ export function imageJanitor(coordRoot) {
|
|
|
176
122
|
const entries = [];
|
|
177
123
|
for (const name of readdirSync(dir)) {
|
|
178
124
|
if (name.endsWith(".tmp") || name.includes(".tmp.")) {
|
|
179
|
-
// Orphaned temp from a crashed copy; sweep it.
|
|
180
125
|
rmSync(join(dir, name), { force: true });
|
|
181
126
|
continue;
|
|
182
127
|
}
|
|
183
128
|
const full = join(dir, name);
|
|
184
|
-
let st;
|
|
185
129
|
try {
|
|
186
|
-
|
|
130
|
+
const stat = statSync(full);
|
|
131
|
+
if (stat.isFile())
|
|
132
|
+
entries.push({ path: full, size: stat.size, mtimeMs: stat.mtimeMs });
|
|
187
133
|
}
|
|
188
134
|
catch {
|
|
189
|
-
|
|
135
|
+
// A concurrent cleanup or write can make one entry disappear.
|
|
190
136
|
}
|
|
191
|
-
if (!st.isFile())
|
|
192
|
-
continue;
|
|
193
|
-
entries.push({ path: full, size: st.size, mtimeMs: st.mtimeMs });
|
|
194
137
|
}
|
|
195
|
-
// Age cap.
|
|
196
138
|
let total = 0;
|
|
197
139
|
const survivors = [];
|
|
198
|
-
for (const
|
|
199
|
-
if (now -
|
|
200
|
-
rmSync(
|
|
201
|
-
continue;
|
|
140
|
+
for (const entry of entries) {
|
|
141
|
+
if (now - entry.mtimeMs > maxAgeMs) {
|
|
142
|
+
rmSync(entry.path, { force: true });
|
|
202
143
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
// Size cap: drop oldest first until under.
|
|
207
|
-
if (total > maxBytes) {
|
|
208
|
-
survivors.sort((a, b) => a.mtimeMs - b.mtimeMs);
|
|
209
|
-
for (const e of survivors) {
|
|
210
|
-
if (total <= maxBytes)
|
|
211
|
-
break;
|
|
212
|
-
rmSync(e.path, { force: true });
|
|
213
|
-
total -= e.size;
|
|
144
|
+
else {
|
|
145
|
+
total += entry.size;
|
|
146
|
+
survivors.push(entry);
|
|
214
147
|
}
|
|
215
148
|
}
|
|
149
|
+
survivors.sort((a, b) => a.mtimeMs - b.mtimeMs);
|
|
150
|
+
for (const entry of survivors) {
|
|
151
|
+
if (total <= maxBytes)
|
|
152
|
+
break;
|
|
153
|
+
rmSync(entry.path, { force: true });
|
|
154
|
+
total -= entry.size;
|
|
155
|
+
}
|
|
216
156
|
}
|
|
217
157
|
catch {
|
|
218
|
-
// best-effort
|
|
158
|
+
// Hook effects are always best-effort.
|
|
219
159
|
}
|
|
220
160
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
|
|
161
|
+
function collectViewed(toolName, toolInput, cwd) {
|
|
162
|
+
const name = normalizedToolName(toolName);
|
|
163
|
+
if (name !== "read" && name !== "view_image" && name !== "image")
|
|
164
|
+
return [];
|
|
165
|
+
const input = objectInput(toolInput);
|
|
166
|
+
const filePath = input?.file_path ?? input?.path ?? input?.image_path;
|
|
167
|
+
if (typeof filePath !== "string" || !hasImageExt(filePath))
|
|
168
|
+
return [];
|
|
169
|
+
return [{ path: toAbsolute(filePath, cwd), role: "viewed", requireRecentMtime: false }];
|
|
228
170
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
231
|
-
|
|
171
|
+
function collectProduced(toolName, payload, cwd) {
|
|
172
|
+
const name = normalizedToolName(toolName);
|
|
173
|
+
const producerTools = new Set([
|
|
174
|
+
"bash",
|
|
175
|
+
"shell",
|
|
176
|
+
"exec_command",
|
|
177
|
+
"imagegen",
|
|
178
|
+
"image_gen",
|
|
179
|
+
"browse",
|
|
180
|
+
"browse_ai",
|
|
181
|
+
"screenshot",
|
|
182
|
+
]);
|
|
183
|
+
if (!producerTools.has(name))
|
|
184
|
+
return [];
|
|
185
|
+
const input = objectInput(payload?.tool_input);
|
|
186
|
+
const command = [input?.command, input?.cmd].find((value) => typeof value === "string") ?? "";
|
|
187
|
+
const response = stringify(payload?.tool_response).slice(0, 2_000_000);
|
|
188
|
+
const seen = new Set();
|
|
189
|
+
const out = [];
|
|
190
|
+
for (const text of [String(command), response]) {
|
|
191
|
+
for (const match of text.matchAll(IMAGE_PATH_RE)) {
|
|
192
|
+
const absolute = toAbsolute(match[0], cwd);
|
|
193
|
+
if (seen.has(absolute))
|
|
194
|
+
continue;
|
|
195
|
+
seen.add(absolute);
|
|
196
|
+
out.push({ path: absolute, role: "produced", requireRecentMtime: true });
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return out;
|
|
200
|
+
}
|
|
201
|
+
function captureOne(imagesDir, candidate) {
|
|
232
202
|
try {
|
|
233
|
-
const
|
|
234
|
-
|
|
203
|
+
const stat = statSync(candidate.path);
|
|
204
|
+
if (!stat.isFile() || stat.size === 0 || stat.size > MAX_CAPTURE_BYTES)
|
|
205
|
+
return null;
|
|
206
|
+
if (candidate.requireRecentMtime && Date.now() - stat.mtimeMs > PRODUCED_MTIME_WINDOW_MS) {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
const ext = extOf(candidate.path);
|
|
210
|
+
if (!IMAGE_EXTS.has(ext))
|
|
211
|
+
return null;
|
|
212
|
+
const bytes = readFileSync(candidate.path);
|
|
213
|
+
const hash = createHash("sha256").update(bytes).digest("hex");
|
|
214
|
+
const destination = join(imagesDir, `${hash}.${ext}`);
|
|
215
|
+
if (!existsSync(destination)) {
|
|
216
|
+
mkdirSync(imagesDir, { recursive: true });
|
|
217
|
+
const temporary = `${destination}.tmp.${process.pid}.${randomUUID().slice(0, 8)}`;
|
|
218
|
+
writeFileSync(temporary, bytes, { mode: 0o600 });
|
|
219
|
+
renameSync(temporary, destination);
|
|
220
|
+
}
|
|
221
|
+
return { hash, ext, bytes: stat.size };
|
|
235
222
|
}
|
|
236
223
|
catch {
|
|
237
224
|
return null;
|
|
238
225
|
}
|
|
239
226
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const ti = payload?.raw?.tool_input;
|
|
243
|
-
const cmd = ti?.command;
|
|
244
|
-
return typeof cmd === "string" ? cmd : "";
|
|
227
|
+
function normalizedToolName(value) {
|
|
228
|
+
return (value.split(/[.:/]/).pop() ?? value).toLowerCase().replaceAll("-", "_");
|
|
245
229
|
}
|
|
246
|
-
function
|
|
247
|
-
if (value
|
|
248
|
-
return
|
|
230
|
+
function objectInput(value) {
|
|
231
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
232
|
+
return value;
|
|
233
|
+
}
|
|
234
|
+
if (typeof value !== "string")
|
|
235
|
+
return null;
|
|
236
|
+
try {
|
|
237
|
+
const parsed = JSON.parse(value);
|
|
238
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed)
|
|
239
|
+
? parsed
|
|
240
|
+
: null;
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function stringify(value) {
|
|
249
247
|
if (typeof value === "string")
|
|
250
248
|
return value;
|
|
251
249
|
try {
|
|
252
|
-
return JSON.stringify(value);
|
|
250
|
+
return JSON.stringify(value ?? "");
|
|
253
251
|
}
|
|
254
252
|
catch {
|
|
255
253
|
return "";
|
|
256
254
|
}
|
|
257
255
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
return
|
|
256
|
+
function toAbsolute(value, cwd) {
|
|
257
|
+
if (value.startsWith("~/") && process.env.HOME)
|
|
258
|
+
return resolve(process.env.HOME, value.slice(2));
|
|
259
|
+
return isAbsolute(value) ? resolve(value) : resolve(cwd, value);
|
|
262
260
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
|
|
261
|
+
function safeWorkspacePath(coordRoot, value) {
|
|
262
|
+
const rel = relative(resolve(coordRoot), resolve(value));
|
|
263
|
+
if (!rel || isAbsolute(rel) || rel === ".." || rel.startsWith(`..${sep}`))
|
|
264
|
+
return undefined;
|
|
265
|
+
const normalized = rel.split(sep).join("/");
|
|
266
|
+
return normalized.length <= 240 && !normalized.startsWith("/") ? normalized : undefined;
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
const dot = clean.lastIndexOf(".");
|
|
270
|
-
if (dot < 0)
|
|
271
|
-
return "";
|
|
272
|
-
return clean.slice(dot + 1).toLowerCase();
|
|
268
|
+
function hasImageExt(value) {
|
|
269
|
+
return IMAGE_EXTS.has(extOf(value));
|
|
273
270
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if (home)
|
|
279
|
-
path = join(home, path.slice(2));
|
|
280
|
-
}
|
|
281
|
-
return isAbsolute(path) ? path : resolve(cwd, path);
|
|
271
|
+
function extOf(value) {
|
|
272
|
+
const clean = value.split(/[?#]/)[0] ?? value;
|
|
273
|
+
const dot = clean.lastIndexOf(".");
|
|
274
|
+
return dot < 0 ? "" : clean.slice(dot + 1).toLowerCase();
|
|
282
275
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return p.slice(coordRoot.length + 1);
|
|
287
|
-
return p;
|
|
276
|
+
function envInt(name, fallback) {
|
|
277
|
+
const parsed = Number(process.env[name]);
|
|
278
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
|
288
279
|
}
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
* Everything here is best-effort: it never throws and never blocks the hook on a
|
|
12
12
|
* slow dependency (telemetry runs detached).
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
export { captureImages, imageJanitor } from "./image-capture.js";
|
|
14
|
+
export { captureImages, imageJanitor, recordImageArtifactsV3 } from "./image-capture.js";
|
|
16
15
|
/**
|
|
17
16
|
* Play a notification sound via the cross-platform utility
|
|
18
17
|
* (afplay on macOS, powershell.exe on WSL). The
|
|
@@ -49,13 +48,6 @@ export declare function journalArchive(repoRoot: string, owner: string): void;
|
|
|
49
48
|
* adapter.
|
|
50
49
|
*/
|
|
51
50
|
export declare function runSessionSyncExtension(repoRoot: string, force: boolean): void;
|
|
52
|
-
/**
|
|
53
|
-
* Fire the turn-summary extension (Haiku auto-summary of the turn → heartbeat
|
|
54
|
-
* `turn_summary`). Detached + unref'd; it makes an Anthropic API call and must
|
|
55
|
-
* never block the Stop hook. Claude-Code-only. The
|
|
56
|
-
* script self-guards on ANTHROPIC_API_KEY / curl / jq / matching session.
|
|
57
|
-
*/
|
|
58
|
-
export declare function runTurnSummary(repoRoot: string, owner: string, sessionId: string, transcriptPath: string | undefined): void;
|
|
59
51
|
/** Reset per-turn sound rate-limit counters at the start of a new turn. */
|
|
60
52
|
export declare function resetSoundCounters(sessionId: string): void;
|
|
61
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/hooks/effects/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/hooks/effects/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEzF;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,SAAI,GACX,IAAI,CAYN;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAW3F;AAMD,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAYrD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAa3D;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAYpE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAqB9E;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAa1D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOnD"}
|
|
@@ -17,7 +17,7 @@ import os from "node:os";
|
|
|
17
17
|
import { join } from "node:path";
|
|
18
18
|
import { applyDetection } from "../../../lib/presence.js";
|
|
19
19
|
import { coordBinPath } from "../../agents/coord-bin.js";
|
|
20
|
-
export { captureImages, imageJanitor } from "./image-capture.js";
|
|
20
|
+
export { captureImages, imageJanitor, recordImageArtifactsV3 } from "./image-capture.js";
|
|
21
21
|
/**
|
|
22
22
|
* Play a notification sound via the cross-platform utility
|
|
23
23
|
* (afplay on macOS, powershell.exe on WSL). The
|
|
@@ -137,29 +137,6 @@ export function runSessionSyncExtension(repoRoot, force) {
|
|
|
137
137
|
// best-effort
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
/**
|
|
141
|
-
* Fire the turn-summary extension (Haiku auto-summary of the turn → heartbeat
|
|
142
|
-
* `turn_summary`). Detached + unref'd; it makes an Anthropic API call and must
|
|
143
|
-
* never block the Stop hook. Claude-Code-only. The
|
|
144
|
-
* script self-guards on ANTHROPIC_API_KEY / curl / jq / matching session.
|
|
145
|
-
*/
|
|
146
|
-
export function runTurnSummary(repoRoot, owner, sessionId, transcriptPath) {
|
|
147
|
-
try {
|
|
148
|
-
if (!transcriptPath || !existsSync(transcriptPath))
|
|
149
|
-
return;
|
|
150
|
-
const script = join(repoRoot, "scripts", "hooks", "harness", "claude-code", "extensions", "turn-summary.sh");
|
|
151
|
-
if (!existsSync(script))
|
|
152
|
-
return;
|
|
153
|
-
const child = spawn("bash", [script, owner, sessionId, transcriptPath], {
|
|
154
|
-
detached: true,
|
|
155
|
-
stdio: "ignore",
|
|
156
|
-
});
|
|
157
|
-
child.unref();
|
|
158
|
-
}
|
|
159
|
-
catch {
|
|
160
|
-
// best-effort
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
140
|
/** Reset per-turn sound rate-limit counters at the start of a new turn. */
|
|
164
141
|
export function resetSoundCounters(sessionId) {
|
|
165
142
|
try {
|