harnery 0.32.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/README.md +2 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +7 -1
- 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 +1408 -565
- 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 +2 -2
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +2 -2
- 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.d.ts +4 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +55 -7
- 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 +10 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +233 -51
- package/dist/commands/instructions.d.ts +4 -0
- package/dist/commands/instructions.d.ts.map +1 -0
- package/dist/commands/instructions.js +100 -0
- 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 +15 -6
- 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 +27 -25
- package/dist/core/agents/cli.js +212 -235
- 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 -70
- 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 +5 -5
- package/dist/core/agents/index.d.ts.map +1 -1
- package/dist/core/agents/index.js +5 -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 +10 -4
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +61 -55
- 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 +15 -33
- 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 +29 -46
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +59 -199
- 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 +45 -0
- package/dist/core/agents/state/session-state.d.ts.map +1 -0
- package/dist/core/agents/state/session-state.js +90 -0
- 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 +13 -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 +64 -24
- 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 +345 -400
- package/dist/core/hooks/codex-authorization.d.ts +30 -0
- package/dist/core/hooks/codex-authorization.d.ts.map +1 -0
- package/dist/core/hooks/codex-authorization.js +199 -0
- 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 +8 -3
- package/dist/core/presence/blob.d.ts.map +1 -1
- package/dist/core/presence/blob.js +54 -41
- 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/index.js +15 -1
- 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/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 +33 -0
- package/dist/lib/instructions/bundle.d.ts.map +1 -0
- package/dist/lib/instructions/bundle.js +149 -0
- 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 +27 -6
- 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 +7 -1
- package/src/commands/adapter.ts +2 -2
- package/src/commands/agents.ts +1737 -570
- 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 +7 -5
- 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 +73 -8
- package/src/commands/events.ts +256 -0
- package/src/commands/governor.ts +18 -4
- package/src/commands/init.ts +264 -57
- package/src/commands/instructions.ts +129 -0
- package/src/commands/journal.ts +4 -13
- package/src/commands/ledger-v3.ts +111 -0
- package/src/commands/presence.ts +18 -11
- 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 +39 -28
- package/src/core/agents/cli.ts +242 -263
- package/src/core/agents/codex-archive-v3.ts +138 -0
- package/src/core/agents/coord-client.ts +75 -177
- package/src/core/agents/finalization.ts +120 -38
- package/src/core/agents/index.ts +5 -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 +89 -55
- package/src/core/agents/render/session-context.ts +23 -32
- 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 +98 -242
- package/src/core/agents/state/live-coordination-view.ts +290 -0
- package/src/core/agents/state/session-state.ts +143 -0
- 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 +15 -6
- package/src/core/hooks/adapter/output.ts +7 -2
- package/src/core/hooks/adapter/parse.ts +81 -36
- package/src/core/hooks/adapter/wiring.ts +119 -13
- package/src/core/hooks/cli.ts +398 -422
- package/src/core/hooks/codex-authorization.ts +253 -0
- 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 +63 -38
- package/src/core/presence/codec-digest.ts +215 -0
- package/src/core/presence/index.ts +18 -1
- 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/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 +199 -0
- 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 -65
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +0 -1
- package/dist/core/agents/state/heartbeat-projector.js +0 -527
- 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 -312
- 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 -582
- 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 -538
- package/src/core/hooks/events/ulid.ts +0 -51
- package/src/lib/docs-frontmatter-migrate.ts +0 -427
|
@@ -1,538 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical event schema v1. Inter-module contract between agent-hooks (writer)
|
|
3
|
-
* and agent-coord (consumer + projector).
|
|
4
|
-
*
|
|
5
|
-
* Schema evolution rules:
|
|
6
|
-
* - Forward-compatible only within a major version. Consumers ignore unknown
|
|
7
|
-
* fields. Adding an optional field is a minor bump; removing or retyping a
|
|
8
|
-
* field is a major bump.
|
|
9
|
-
* - Mixed-version streams are legal during migrations; consumers branch on
|
|
10
|
-
* `schema_version`.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export const SCHEMA_VERSION = 1 as const;
|
|
14
|
-
|
|
15
|
-
/** The adapters harnery ships first-party hook wiring for. The registry's open
|
|
16
|
-
* `AdapterId` covers any adapter a host registers; this is the closed set, and
|
|
17
|
-
* it is declared exactly once. Re-exported by the two event modules that used
|
|
18
|
-
* to keep their own byte-identical copy. */
|
|
19
|
-
export type Adapter = "claude-code" | "cursor" | "codex";
|
|
20
|
-
|
|
21
|
-
export type Source = "agent-hooks" | "agent-coord" | "user" | "system";
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Common envelope every event carries. Tool events, `user_prompt.submit`, and
|
|
25
|
-
* `turn.stop` MUST carry `turn_id`; CLI/state/council/presence/health/session
|
|
26
|
-
* events MAY carry `turn_id` when agent-coord can bind them to the active turn
|
|
27
|
-
* for that owner.
|
|
28
|
-
*/
|
|
29
|
-
export interface EventEnvelope<TType extends string, TData> {
|
|
30
|
-
schema_version: typeof SCHEMA_VERSION;
|
|
31
|
-
event_id: string; // ULID, sortable, unique
|
|
32
|
-
event_type: TType;
|
|
33
|
-
ts: string; // ISO-8601 with milliseconds
|
|
34
|
-
instance_id: string; // resolved by agent-hooks
|
|
35
|
-
session_id: string; // adapter-level session
|
|
36
|
-
parent_session_id?: string; // present iff event is from a subagent
|
|
37
|
-
turn_id?: string; // present when event is bound to an assistant turn
|
|
38
|
-
parent_turn_id?: string; // present iff this turn is nested under another
|
|
39
|
-
adapter: Adapter;
|
|
40
|
-
source: Source;
|
|
41
|
-
data: TData;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ── event catalog ───────────────────────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
// Lifecycle
|
|
47
|
-
export type SessionStart = EventEnvelope<
|
|
48
|
-
"session.start",
|
|
49
|
-
{
|
|
50
|
-
started_at: string;
|
|
51
|
-
cwd: string;
|
|
52
|
-
model?: string;
|
|
53
|
-
pid: number;
|
|
54
|
-
/** Present iff this session is a `workflow run` child: the run id whose
|
|
55
|
-
* transcript owns it (child env HARNERY_WORKFLOW_RUN_ID). Optional-field
|
|
56
|
-
* addition per the schema evolution rules (minor bump). */
|
|
57
|
-
workflow_run_id?: string;
|
|
58
|
-
/** Which agent row of that run this session is running (`a1`, `a2`, …), from
|
|
59
|
-
* child env HARNERY_WORKFLOW_AGENT_ID. Lets a dashboard attribute in-flight
|
|
60
|
-
* child activity to one agent instead of only to the run. */
|
|
61
|
-
workflow_agent_id?: string;
|
|
62
|
-
}
|
|
63
|
-
>;
|
|
64
|
-
|
|
65
|
-
export type SessionEnd = EventEnvelope<
|
|
66
|
-
"session.end",
|
|
67
|
-
{
|
|
68
|
-
ended_at: string;
|
|
69
|
-
clean_exit: boolean;
|
|
70
|
-
}
|
|
71
|
-
>;
|
|
72
|
-
|
|
73
|
-
export type SubagentStart = EventEnvelope<
|
|
74
|
-
"subagent.start",
|
|
75
|
-
{
|
|
76
|
-
agent_type: string;
|
|
77
|
-
prompt_summary?: string;
|
|
78
|
-
}
|
|
79
|
-
>;
|
|
80
|
-
|
|
81
|
-
export type SubagentStop = EventEnvelope<
|
|
82
|
-
"subagent.stop",
|
|
83
|
-
{
|
|
84
|
-
exit_status: "ok" | "error" | "interrupted";
|
|
85
|
-
}
|
|
86
|
-
>;
|
|
87
|
-
|
|
88
|
-
export type UserPromptSubmit = EventEnvelope<
|
|
89
|
-
"user_prompt.submit",
|
|
90
|
-
{
|
|
91
|
-
prompt_text: string; // clamped
|
|
92
|
-
truncated?: boolean;
|
|
93
|
-
}
|
|
94
|
-
>;
|
|
95
|
-
|
|
96
|
-
export type TurnStop = EventEnvelope<
|
|
97
|
-
"turn.stop",
|
|
98
|
-
{
|
|
99
|
-
tool_call_count: number;
|
|
100
|
-
text_length: number;
|
|
101
|
-
status_box_present: boolean; // adapter sets via transcript scan for `┌─ agent-` prefix
|
|
102
|
-
/** Strict variant of status_box_present: assistant text blocks only, so a
|
|
103
|
-
* tool_result carrying the box (the status command's own output) does not
|
|
104
|
-
* count. Shadow telemetry while the rule-2/3 detector decision is open;
|
|
105
|
-
* the Stop verdict does not read it yet. */
|
|
106
|
-
status_box_present_strict?: boolean;
|
|
107
|
-
/** Whether the session's suggested name is satisfied as of this turn:
|
|
108
|
-
* either this reply showed it, or an earlier reply did. Present whenever a
|
|
109
|
-
* suggested name exists, since the Stop verdict reads it per turn. */
|
|
110
|
-
session_name_present?: boolean;
|
|
111
|
-
/** Which suggested name `session_name_present` refers to. A projector
|
|
112
|
-
* rebuild attributes the sighting to this name instead of to whichever
|
|
113
|
-
* name is current during the replay. */
|
|
114
|
-
session_name_present_for?: string;
|
|
115
|
-
/** Shadow telemetry for Windows-hosted Codex workspaces: Markdown link
|
|
116
|
-
* destinations that still use the Linux coordination root. */
|
|
117
|
-
wsl_linux_file_link_count?: number;
|
|
118
|
-
/** Up to three bounded examples for diagnosing the mismatches locally. */
|
|
119
|
-
wsl_linux_file_link_examples?: string[];
|
|
120
|
-
}
|
|
121
|
-
>;
|
|
122
|
-
|
|
123
|
-
// Session-telemetry (merge path)
|
|
124
|
-
export type CommandStart = EventEnvelope<
|
|
125
|
-
"command.start",
|
|
126
|
-
{
|
|
127
|
-
cmd_id: string;
|
|
128
|
-
intent?: string;
|
|
129
|
-
cmd: string;
|
|
130
|
-
}
|
|
131
|
-
>;
|
|
132
|
-
|
|
133
|
-
export type CommandOutput = EventEnvelope<
|
|
134
|
-
"command.output",
|
|
135
|
-
{
|
|
136
|
-
cmd_id: string;
|
|
137
|
-
stream: "stdout" | "stderr";
|
|
138
|
-
line: string;
|
|
139
|
-
}
|
|
140
|
-
>;
|
|
141
|
-
|
|
142
|
-
export type CommandEnd = EventEnvelope<
|
|
143
|
-
"command.end",
|
|
144
|
-
{
|
|
145
|
-
cmd_id: string;
|
|
146
|
-
exit: number;
|
|
147
|
-
duration_ms: number;
|
|
148
|
-
signal?: string;
|
|
149
|
-
}
|
|
150
|
-
>;
|
|
151
|
-
|
|
152
|
-
export type Narration = EventEnvelope<
|
|
153
|
-
"narration",
|
|
154
|
-
{
|
|
155
|
-
message: string;
|
|
156
|
-
}
|
|
157
|
-
>;
|
|
158
|
-
|
|
159
|
-
// Tools
|
|
160
|
-
export type ToolPreUse = EventEnvelope<
|
|
161
|
-
"tool.pre_use",
|
|
162
|
-
{
|
|
163
|
-
tool_name: string;
|
|
164
|
-
tool_input: unknown; // clamped to 8000 chars when stringified
|
|
165
|
-
intent?: string;
|
|
166
|
-
truncated?: boolean;
|
|
167
|
-
}
|
|
168
|
-
>;
|
|
169
|
-
|
|
170
|
-
export type ToolPostUse = EventEnvelope<
|
|
171
|
-
"tool.post_use",
|
|
172
|
-
{
|
|
173
|
-
tool_name: string;
|
|
174
|
-
output_summary: string; // first 500 + last 500
|
|
175
|
-
exit_status: "ok" | "error";
|
|
176
|
-
duration_ms: number;
|
|
177
|
-
truncated?: boolean;
|
|
178
|
-
}
|
|
179
|
-
>;
|
|
180
|
-
|
|
181
|
-
export type ToolPostUseFailure = EventEnvelope<
|
|
182
|
-
"tool.post_use_failure",
|
|
183
|
-
{
|
|
184
|
-
tool_name: string;
|
|
185
|
-
error: string;
|
|
186
|
-
duration_ms: number;
|
|
187
|
-
}
|
|
188
|
-
>;
|
|
189
|
-
|
|
190
|
-
export type ToolOutputChunk = EventEnvelope<
|
|
191
|
-
"tool.output_chunk",
|
|
192
|
-
{
|
|
193
|
-
chunk: string;
|
|
194
|
-
chunk_no: number;
|
|
195
|
-
stream: "stdout" | "stderr";
|
|
196
|
-
truncated?: boolean;
|
|
197
|
-
}
|
|
198
|
-
>;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* An image an agent viewed (Read tool) or produced (a Bash command wrote it).
|
|
202
|
-
* Emitted by agent-hooks as a side-effect of a tool event when the tool
|
|
203
|
-
* references an image path on disk; the bytes are content-addressed into
|
|
204
|
-
* `.harnery/images/<hash>.<ext>` (dedup) and this event records the provenance
|
|
205
|
-
* for the web image feed. Grouped by `hash` downstream → one card per distinct
|
|
206
|
-
* image with a touch timeline.
|
|
207
|
-
*/
|
|
208
|
-
export type ImageCaptured = EventEnvelope<
|
|
209
|
-
"image.captured",
|
|
210
|
-
{
|
|
211
|
-
hash: string; // sha256 of the file bytes, also the blob's basename
|
|
212
|
-
ext: string; // png | jpg | jpeg | gif | webp | bmp | svg
|
|
213
|
-
bytes: number;
|
|
214
|
-
role: "viewed" | "produced";
|
|
215
|
-
source_path: string; // repo-relative when under coordRoot, else absolute
|
|
216
|
-
tool_name: string; // "Read" (viewed) | "Bash" (produced)
|
|
217
|
-
tool_use_id?: string;
|
|
218
|
-
intent?: string; // present for viewed (carried from the tool event)
|
|
219
|
-
command_head?: string; // present for produced (first ~120 chars of the cmd)
|
|
220
|
-
}
|
|
221
|
-
>;
|
|
222
|
-
|
|
223
|
-
// Context continuity
|
|
224
|
-
export type ContextSampled = EventEnvelope<
|
|
225
|
-
"context.sampled",
|
|
226
|
-
{
|
|
227
|
-
model?: string;
|
|
228
|
-
used_tokens?: number;
|
|
229
|
-
window_tokens?: number;
|
|
230
|
-
used_percent?: number;
|
|
231
|
-
telemetry_source: "hook" | "native_event" | "result" | "transcript" | "estimate";
|
|
232
|
-
confidence: "exact" | "reported" | "estimated";
|
|
233
|
-
}
|
|
234
|
-
>;
|
|
235
|
-
|
|
236
|
-
export type ContextCheckpointCreated = EventEnvelope<
|
|
237
|
-
"context.checkpoint.created",
|
|
238
|
-
{
|
|
239
|
-
capsule_id: string;
|
|
240
|
-
generation: number;
|
|
241
|
-
path: string;
|
|
242
|
-
reason: "manual" | "pressure" | "pre_compact" | "session_end";
|
|
243
|
-
reused: boolean;
|
|
244
|
-
}
|
|
245
|
-
>;
|
|
246
|
-
|
|
247
|
-
export type ContextCompactionStarted = EventEnvelope<
|
|
248
|
-
"context.compaction.started",
|
|
249
|
-
{
|
|
250
|
-
trigger?: string;
|
|
251
|
-
pre_tokens?: number;
|
|
252
|
-
}
|
|
253
|
-
>;
|
|
254
|
-
|
|
255
|
-
export type ContextCompactionCompleted = EventEnvelope<
|
|
256
|
-
"context.compaction.completed",
|
|
257
|
-
{
|
|
258
|
-
trigger?: string;
|
|
259
|
-
pre_tokens?: number;
|
|
260
|
-
post_tokens?: number;
|
|
261
|
-
}
|
|
262
|
-
>;
|
|
263
|
-
|
|
264
|
-
export type ContextRecoveryInjected = EventEnvelope<
|
|
265
|
-
"context.recovery.injected",
|
|
266
|
-
{
|
|
267
|
-
capsule_id: string;
|
|
268
|
-
generation: number;
|
|
269
|
-
injection_event: "SessionStart" | "UserPromptSubmit";
|
|
270
|
-
}
|
|
271
|
-
>;
|
|
272
|
-
|
|
273
|
-
// File claims
|
|
274
|
-
export type ClaimAcquire = EventEnvelope<
|
|
275
|
-
"claim.acquire",
|
|
276
|
-
{
|
|
277
|
-
path: string;
|
|
278
|
-
mode: "read" | "write";
|
|
279
|
-
finalization?: {
|
|
280
|
-
disposition: "git" | "output";
|
|
281
|
-
root: string;
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
>;
|
|
285
|
-
|
|
286
|
-
export type ClaimRelease = EventEnvelope<
|
|
287
|
-
"claim.release",
|
|
288
|
-
{
|
|
289
|
-
path: string;
|
|
290
|
-
reason: "explicit" | "turn_end" | "session_end" | "heal";
|
|
291
|
-
}
|
|
292
|
-
>;
|
|
293
|
-
|
|
294
|
-
export type ClaimConflict = EventEnvelope<
|
|
295
|
-
"claim.conflict",
|
|
296
|
-
{
|
|
297
|
-
path: string;
|
|
298
|
-
peer_instance_id: string;
|
|
299
|
-
reason?: "ordering_violation" | "concurrent_write";
|
|
300
|
-
}
|
|
301
|
-
>;
|
|
302
|
-
|
|
303
|
-
// Coord state
|
|
304
|
-
export type StateTaskSet = EventEnvelope<
|
|
305
|
-
"state.task_set",
|
|
306
|
-
{
|
|
307
|
-
task: string;
|
|
308
|
-
cleared: boolean;
|
|
309
|
-
/** True exactly when this call produced the session name (first non-empty
|
|
310
|
-
* declaration of a human-facing session); never true with a null name. */
|
|
311
|
-
first_of_session?: boolean;
|
|
312
|
-
/** The name produced by this call, for the Stop-hook naming rule. */
|
|
313
|
-
suggested_session_name?: string | null;
|
|
314
|
-
}
|
|
315
|
-
>;
|
|
316
|
-
|
|
317
|
-
export type StateStatusChecked = EventEnvelope<
|
|
318
|
-
"state.status_checked",
|
|
319
|
-
{
|
|
320
|
-
format: "box" | "json" | "table";
|
|
321
|
-
agent_count: number;
|
|
322
|
-
included_self: boolean;
|
|
323
|
-
}
|
|
324
|
-
>;
|
|
325
|
-
|
|
326
|
-
export type StateJournalAppend = EventEnvelope<
|
|
327
|
-
"state.journal_append",
|
|
328
|
-
{
|
|
329
|
-
category: "note" | "plan" | "decision" | "blocker" | "question" | "done" | "handoff";
|
|
330
|
-
body_summary: string;
|
|
331
|
-
}
|
|
332
|
-
>;
|
|
333
|
-
|
|
334
|
-
export type StatePresenceChange = EventEnvelope<
|
|
335
|
-
"state.presence_change",
|
|
336
|
-
{
|
|
337
|
-
from: "mobile" | "office";
|
|
338
|
-
to: "mobile" | "office";
|
|
339
|
-
source: "hook" | "cli" | "user";
|
|
340
|
-
}
|
|
341
|
-
>;
|
|
342
|
-
|
|
343
|
-
export type StateHeartbeat = EventEnvelope<"state.heartbeat", Record<string, never>>;
|
|
344
|
-
|
|
345
|
-
/** A live session adopted a durable persona/role. The event is authoritative
|
|
346
|
-
* for replay; `.name-history` carries the same binding for heartbeat healing. */
|
|
347
|
-
export type IdentityAssumed = EventEnvelope<
|
|
348
|
-
"identity.assumed",
|
|
349
|
-
{
|
|
350
|
-
name: string;
|
|
351
|
-
agent_id: string;
|
|
352
|
-
previous_name?: string;
|
|
353
|
-
previous_agent_id?: string;
|
|
354
|
-
}
|
|
355
|
-
>;
|
|
356
|
-
|
|
357
|
-
// Council
|
|
358
|
-
export type CouncilOpen = EventEnvelope<
|
|
359
|
-
"council.open",
|
|
360
|
-
{
|
|
361
|
-
council_id: string;
|
|
362
|
-
topic: string;
|
|
363
|
-
members: string[];
|
|
364
|
-
target_doc?: string;
|
|
365
|
-
}
|
|
366
|
-
>;
|
|
367
|
-
|
|
368
|
-
export type CouncilRoundOpen = EventEnvelope<
|
|
369
|
-
"council.round_open",
|
|
370
|
-
{
|
|
371
|
-
council_id: string;
|
|
372
|
-
round_no: number;
|
|
373
|
-
}
|
|
374
|
-
>;
|
|
375
|
-
|
|
376
|
-
export type CouncilContribution = EventEnvelope<
|
|
377
|
-
"council.contribution",
|
|
378
|
-
{
|
|
379
|
-
council_id: string;
|
|
380
|
-
round_no: number;
|
|
381
|
-
member: string;
|
|
382
|
-
body_summary: string;
|
|
383
|
-
}
|
|
384
|
-
>;
|
|
385
|
-
|
|
386
|
-
export type CouncilRoundClose = EventEnvelope<
|
|
387
|
-
"council.round_close",
|
|
388
|
-
{
|
|
389
|
-
council_id: string;
|
|
390
|
-
round_no: number;
|
|
391
|
-
}
|
|
392
|
-
>;
|
|
393
|
-
|
|
394
|
-
export type CouncilClose = EventEnvelope<
|
|
395
|
-
"council.close",
|
|
396
|
-
{
|
|
397
|
-
council_id: string;
|
|
398
|
-
closed_at: string;
|
|
399
|
-
}
|
|
400
|
-
>;
|
|
401
|
-
|
|
402
|
-
export type CouncilArchive = EventEnvelope<
|
|
403
|
-
"council.archive",
|
|
404
|
-
{
|
|
405
|
-
council_id: string;
|
|
406
|
-
}
|
|
407
|
-
>;
|
|
408
|
-
|
|
409
|
-
// Decisions (rule-engine verdicts emitted by agent-coord)
|
|
410
|
-
export type DecisionBlock = EventEnvelope<
|
|
411
|
-
"decision.block",
|
|
412
|
-
{
|
|
413
|
-
rule: string;
|
|
414
|
-
reason: string;
|
|
415
|
-
}
|
|
416
|
-
>;
|
|
417
|
-
|
|
418
|
-
export type DecisionWarn = EventEnvelope<
|
|
419
|
-
"decision.warn",
|
|
420
|
-
{
|
|
421
|
-
rule: string;
|
|
422
|
-
reason: string;
|
|
423
|
-
}
|
|
424
|
-
>;
|
|
425
|
-
|
|
426
|
-
export type DecisionAllow = EventEnvelope<
|
|
427
|
-
"decision.allow",
|
|
428
|
-
{
|
|
429
|
-
rule: string;
|
|
430
|
-
}
|
|
431
|
-
>;
|
|
432
|
-
|
|
433
|
-
// Health
|
|
434
|
-
export type HealthHeartbeatHeal = EventEnvelope<
|
|
435
|
-
"health.heartbeat_heal",
|
|
436
|
-
{
|
|
437
|
-
reason: string;
|
|
438
|
-
}
|
|
439
|
-
>;
|
|
440
|
-
|
|
441
|
-
export type HealthPidmapHeal = EventEnvelope<
|
|
442
|
-
"health.pidmap_heal",
|
|
443
|
-
{
|
|
444
|
-
reason: string;
|
|
445
|
-
}
|
|
446
|
-
>;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* A heartbeat file was removed by stale-sweep or an operator kill. Symmetric
|
|
450
|
-
* with `health.heartbeat_heal` so the full lifecycle (created → healed →
|
|
451
|
-
* swept) is auditable from the event stream alone. Sweeps were silent before,
|
|
452
|
-
* which made "why did this agent vanish?" un-answerable without guesswork.
|
|
453
|
-
* `reason`: "stale" (last_heartbeat past the freshness cutoff) | "unparseable"
|
|
454
|
-
* (JSON.parse failed AND mtime was old) | "missing_ts" (no last_heartbeat AND
|
|
455
|
-
* mtime was old) | "killed" (operator `kill-heartbeat` / `agents heal --kind
|
|
456
|
-
* kill`). Fresh-mtime files are never auto-swept regardless of content.
|
|
457
|
-
*/
|
|
458
|
-
export type HealthHeartbeatSwept = EventEnvelope<
|
|
459
|
-
"health.heartbeat_swept",
|
|
460
|
-
{
|
|
461
|
-
reason: "stale" | "unparseable" | "missing_ts" | "killed";
|
|
462
|
-
age_secs?: number;
|
|
463
|
-
}
|
|
464
|
-
>;
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* fail-open verdict failure mode. Emitted by agent-hooks when
|
|
468
|
-
* `agent-coord verdict` fails to spawn / exits non-zero / returns malformed
|
|
469
|
-
* JSON / times out. Adapter falls through to ALLOW; the event preserves the
|
|
470
|
-
* fail-open for audit.
|
|
471
|
-
*/
|
|
472
|
-
export type HealthVerdictFailure = EventEnvelope<
|
|
473
|
-
"health.verdict_failure",
|
|
474
|
-
{
|
|
475
|
-
failure_kind: "spawn_failed" | "nonzero_exit" | "malformed_json" | "timeout";
|
|
476
|
-
timeout_ms?: number;
|
|
477
|
-
fallback: "allow";
|
|
478
|
-
}
|
|
479
|
-
>;
|
|
480
|
-
|
|
481
|
-
// ── Discriminated union over every event_type ────────────────────────────────
|
|
482
|
-
|
|
483
|
-
export type Event =
|
|
484
|
-
| SessionStart
|
|
485
|
-
| SessionEnd
|
|
486
|
-
| SubagentStart
|
|
487
|
-
| SubagentStop
|
|
488
|
-
| UserPromptSubmit
|
|
489
|
-
| TurnStop
|
|
490
|
-
| CommandStart
|
|
491
|
-
| CommandOutput
|
|
492
|
-
| CommandEnd
|
|
493
|
-
| Narration
|
|
494
|
-
| ToolPreUse
|
|
495
|
-
| ToolPostUse
|
|
496
|
-
| ToolPostUseFailure
|
|
497
|
-
| ToolOutputChunk
|
|
498
|
-
| ImageCaptured
|
|
499
|
-
| ContextSampled
|
|
500
|
-
| ContextCheckpointCreated
|
|
501
|
-
| ContextCompactionStarted
|
|
502
|
-
| ContextCompactionCompleted
|
|
503
|
-
| ContextRecoveryInjected
|
|
504
|
-
| ClaimAcquire
|
|
505
|
-
| ClaimRelease
|
|
506
|
-
| ClaimConflict
|
|
507
|
-
| StateTaskSet
|
|
508
|
-
| StateStatusChecked
|
|
509
|
-
| StateJournalAppend
|
|
510
|
-
| StatePresenceChange
|
|
511
|
-
| StateHeartbeat
|
|
512
|
-
| IdentityAssumed
|
|
513
|
-
| CouncilOpen
|
|
514
|
-
| CouncilRoundOpen
|
|
515
|
-
| CouncilContribution
|
|
516
|
-
| CouncilRoundClose
|
|
517
|
-
| CouncilClose
|
|
518
|
-
| CouncilArchive
|
|
519
|
-
| DecisionBlock
|
|
520
|
-
| DecisionWarn
|
|
521
|
-
| DecisionAllow
|
|
522
|
-
| HealthHeartbeatHeal
|
|
523
|
-
| HealthPidmapHeal
|
|
524
|
-
| HealthHeartbeatSwept
|
|
525
|
-
| HealthVerdictFailure;
|
|
526
|
-
|
|
527
|
-
export type EventType = Event["event_type"];
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Redaction marker that may be attached to any `data` payload during emission.
|
|
531
|
-
* Tracked here so the schema documents the convention; the actual
|
|
532
|
-
* shape lives inside `data` so it doesn't widen the envelope.
|
|
533
|
-
*/
|
|
534
|
-
export interface RedactionMarker {
|
|
535
|
-
field: string;
|
|
536
|
-
kind: "secret_signature" | "env_secret_match" | "length_clamp";
|
|
537
|
-
count: number;
|
|
538
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tiny ULID generator. Crockford-base32, 10-char timestamp (48-bit ms epoch)
|
|
3
|
-
* + 16-char random (80-bit). 26 chars total, monotonically-sortable.
|
|
4
|
-
*
|
|
5
|
-
* Library-free so the module stays dep-free (no `ulid` package). Quality is
|
|
6
|
-
* sufficient for event_id uniqueness: the kth event in a millisecond uses a
|
|
7
|
-
* fresh 80-bit random, collision probability negligible.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
11
|
-
|
|
12
|
-
export function ulid(): string {
|
|
13
|
-
const ts = encodeTime(Date.now());
|
|
14
|
-
const rnd = encodeRandom();
|
|
15
|
-
return ts + rnd;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function encodeTime(ms: number): string {
|
|
19
|
-
let out = "";
|
|
20
|
-
let n = BigInt(ms);
|
|
21
|
-
const base = BigInt(32);
|
|
22
|
-
for (let i = 0; i < 10; i++) {
|
|
23
|
-
const mod = Number(n % base);
|
|
24
|
-
out = ALPHABET[mod] + out;
|
|
25
|
-
n = n / base;
|
|
26
|
-
}
|
|
27
|
-
return out;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function encodeRandom(): string {
|
|
31
|
-
const bytes = new Uint8Array(10);
|
|
32
|
-
crypto.getRandomValues(bytes);
|
|
33
|
-
// Map each pair of bytes to 3 alphabet chars (5 bits per char, 16 chars).
|
|
34
|
-
let out = "";
|
|
35
|
-
let buf = 0n;
|
|
36
|
-
let bits = 0;
|
|
37
|
-
for (const b of bytes) {
|
|
38
|
-
buf = (buf << 8n) | BigInt(b);
|
|
39
|
-
bits += 8;
|
|
40
|
-
while (bits >= 5) {
|
|
41
|
-
bits -= 5;
|
|
42
|
-
const idx = Number((buf >> BigInt(bits)) & 0x1fn);
|
|
43
|
-
out += ALPHABET[idx];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (bits > 0) {
|
|
47
|
-
const idx = Number((buf << BigInt(5 - bits)) & 0x1fn);
|
|
48
|
-
out += ALPHABET[idx];
|
|
49
|
-
}
|
|
50
|
-
return out.slice(0, 16);
|
|
51
|
-
}
|