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
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* so a fresh consumer gets a CLAUDE.md whose managed region imports
|
|
15
15
|
* `@AGENTS.md`. A CLAUDE.md that already imports AGENTS.md or already carries
|
|
16
16
|
* the block (a host that generates CLAUDE.md from AGENTS.md) is left alone.
|
|
17
|
-
* -
|
|
18
|
-
*
|
|
17
|
+
* - `<adapter-skill-dir>/<skill>/SKILL.md` — fully-owned files, honoring
|
|
18
|
+
* `skills.exclude` in `.harnery/config.jsonc`. Claude Code uses
|
|
19
|
+
* `.claude/skills/`; Cursor and Codex use `.agents/skills/`.
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
22
|
import {
|
|
@@ -49,7 +50,15 @@ import {
|
|
|
49
50
|
|
|
50
51
|
const AGENTS_FILE = "AGENTS.md";
|
|
51
52
|
const CLAUDE_FILE = "CLAUDE.md";
|
|
52
|
-
const
|
|
53
|
+
const ADAPTER_SKILLS_DIR: Readonly<Record<string, string>> = {
|
|
54
|
+
"claude-code": join(".claude", "skills"),
|
|
55
|
+
cursor: join(".agents", "skills"),
|
|
56
|
+
codex: join(".agents", "skills"),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function adapterSkillsDir(adapter: string): string | null {
|
|
60
|
+
return ADAPTER_SKILLS_DIR[adapter] ?? null;
|
|
61
|
+
}
|
|
53
62
|
|
|
54
63
|
/** CLAUDE.md import-shim body: points Claude Code (which reads CLAUDE.md, not AGENTS.md) at AGENTS.md. */
|
|
55
64
|
function importBody(): string {
|
|
@@ -79,16 +88,17 @@ export function readSkillsExclude(projectRoot: string): Set<string> {
|
|
|
79
88
|
|
|
80
89
|
/**
|
|
81
90
|
* Which shipped skills exist for this project, so the block references only the
|
|
82
|
-
* ones actually present
|
|
83
|
-
*
|
|
84
|
-
*
|
|
91
|
+
* ones actually present for every supported adapter, unless excluded. Kept in
|
|
92
|
+
* one place so `applyInstructions` and `checkInstructions` render byte-identical
|
|
93
|
+
* blocks.
|
|
85
94
|
*/
|
|
86
95
|
function blockSkills(projectRoot: string, adapter: string): BlockSkills {
|
|
87
|
-
const
|
|
96
|
+
const supported = adapterSkillsDir(adapter) !== null;
|
|
88
97
|
const exclude = readSkillsExclude(projectRoot);
|
|
89
98
|
return {
|
|
90
|
-
decide:
|
|
91
|
-
council:
|
|
99
|
+
decide: supported && !exclude.has("harn-decide"),
|
|
100
|
+
council: supported && !exclude.has("harn-council"),
|
|
101
|
+
end: supported && !exclude.has("harn-end"),
|
|
92
102
|
};
|
|
93
103
|
}
|
|
94
104
|
|
|
@@ -105,13 +115,14 @@ export interface ApplyResult {
|
|
|
105
115
|
|
|
106
116
|
/**
|
|
107
117
|
* Inject / refresh the instructions block, the CLAUDE.md import shim (claude-code),
|
|
108
|
-
* and the shipped skills
|
|
118
|
+
* and the adapter-native shipped skills. Idempotent: a re-run on current content
|
|
109
119
|
* writes nothing. `dryRun` reports without touching the fs.
|
|
110
120
|
*/
|
|
111
121
|
export function applyInstructions(projectRoot: string, opts: ApplyOpts): ApplyResult {
|
|
112
122
|
const actions: string[] = [];
|
|
113
123
|
const warnings: string[] = [];
|
|
114
124
|
const claudeCode = opts.adapter === "claude-code";
|
|
125
|
+
const skillsDir = adapterSkillsDir(opts.adapter);
|
|
115
126
|
// dry-run narrates the future ("would create"); a real run narrates the past.
|
|
116
127
|
const verbed = (base: string, past: string) => (opts.dryRun ? `would ${base}` : past);
|
|
117
128
|
|
|
@@ -191,15 +202,15 @@ export function applyInstructions(projectRoot: string, opts: ApplyOpts): ApplyRe
|
|
|
191
202
|
}
|
|
192
203
|
}
|
|
193
204
|
|
|
194
|
-
// ── shipped skills
|
|
195
|
-
if (
|
|
205
|
+
// ── shipped skills ───────────────────────────────────────────────────────
|
|
206
|
+
if (skillsDir) {
|
|
196
207
|
const exclude = readSkillsExclude(projectRoot);
|
|
197
208
|
for (const skill of SKILLS) {
|
|
198
209
|
if (exclude.has(skill.id)) {
|
|
199
210
|
actions.push(`· skipped skill ${skill.id} (skills.exclude)`);
|
|
200
211
|
continue;
|
|
201
212
|
}
|
|
202
|
-
const skillPath = join(projectRoot,
|
|
213
|
+
const skillPath = join(projectRoot, skillsDir, skill.relPath);
|
|
203
214
|
const content = skill.render(opts.binName);
|
|
204
215
|
const before = existsSync(skillPath) ? readFileSync(skillPath, "utf8") : null;
|
|
205
216
|
if (before === content) {
|
|
@@ -235,6 +246,7 @@ export function removeInstructions(projectRoot: string, opts: RemoveOpts): Apply
|
|
|
235
246
|
const actions: string[] = [];
|
|
236
247
|
const warnings: string[] = [];
|
|
237
248
|
const claudeCode = opts.adapter === "claude-code";
|
|
249
|
+
const skillsDir = adapterSkillsDir(opts.adapter);
|
|
238
250
|
|
|
239
251
|
// ── AGENTS.md block + host addendum ─────────────────────────────────────
|
|
240
252
|
const agentsPath = join(projectRoot, AGENTS_FILE);
|
|
@@ -288,10 +300,10 @@ export function removeInstructions(projectRoot: string, opts: RemoveOpts): Apply
|
|
|
288
300
|
}
|
|
289
301
|
}
|
|
290
302
|
|
|
291
|
-
// ── shipped skills
|
|
292
|
-
if (
|
|
303
|
+
// ── shipped skills ───────────────────────────────────────────────────────
|
|
304
|
+
if (skillsDir) {
|
|
293
305
|
for (const skill of SKILLS) {
|
|
294
|
-
const skillPath = join(projectRoot,
|
|
306
|
+
const skillPath = join(projectRoot, skillsDir, skill.relPath);
|
|
295
307
|
if (!existsSync(skillPath)) continue;
|
|
296
308
|
if (!isOwnedFile(readFileSync(skillPath, "utf8"))) {
|
|
297
309
|
warnings.push(`left ${skill.relPath} (hand-edited; no harnery ownership marker)`);
|
|
@@ -299,7 +311,7 @@ export function removeInstructions(projectRoot: string, opts: RemoveOpts): Apply
|
|
|
299
311
|
}
|
|
300
312
|
if (!opts.dryRun) {
|
|
301
313
|
rmSync(skillPath);
|
|
302
|
-
//
|
|
314
|
+
// Drop the now-empty harn-* dir, leaving the adapter skills root intact.
|
|
303
315
|
const dir = dirname(skillPath);
|
|
304
316
|
try {
|
|
305
317
|
if (readdirSync(dir).length === 0) rmdirSync(dir);
|
|
@@ -321,7 +333,7 @@ export interface CheckResult {
|
|
|
321
333
|
|
|
322
334
|
/**
|
|
323
335
|
* Read-only drift report for `init --check`: the AGENTS.md block and each
|
|
324
|
-
* shipped skill
|
|
336
|
+
* shipped skill for the selected adapter. Fresh → exit 0; stale / missing / hand-edit
|
|
325
337
|
* → drift (exit 2); an unreadable file → error (exit 1). Mirrors the wiki-theme
|
|
326
338
|
* `--check-only` contract the first host wires into pre-commit.
|
|
327
339
|
*/
|
|
@@ -361,11 +373,12 @@ export function checkInstructions(
|
|
|
361
373
|
issues.push(`${AGENTS_FILE} host addendum: present but no longer configured (re-run init)`);
|
|
362
374
|
}
|
|
363
375
|
|
|
364
|
-
|
|
376
|
+
const skillsDir = adapterSkillsDir(opts.adapter);
|
|
377
|
+
if (skillsDir) {
|
|
365
378
|
const exclude = readSkillsExclude(projectRoot);
|
|
366
379
|
for (const skill of SKILLS) {
|
|
367
380
|
if (exclude.has(skill.id)) continue;
|
|
368
|
-
const skillPath = join(projectRoot,
|
|
381
|
+
const skillPath = join(projectRoot, skillsDir, skill.relPath);
|
|
369
382
|
const c = existsSync(skillPath) ? readFileSync(skillPath, "utf8") : "";
|
|
370
383
|
note(`skill ${skill.id}`, checkOwnedSkill(c, skillBody(skill.render, opts.binName)));
|
|
371
384
|
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, lstatSync, readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import type { Adapter } from "../../core/adapter.ts";
|
|
5
|
+
|
|
6
|
+
export type InstructionComponentRole = "always_loaded" | "just_in_time" | "runtime_config";
|
|
7
|
+
|
|
8
|
+
export interface InstructionBundleComponent {
|
|
9
|
+
path: string;
|
|
10
|
+
role: InstructionComponentRole;
|
|
11
|
+
bytes: number;
|
|
12
|
+
sha256: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface InstructionBundle {
|
|
16
|
+
schema_version: 1;
|
|
17
|
+
adapter: Adapter;
|
|
18
|
+
coord_root: string;
|
|
19
|
+
profile_root: string;
|
|
20
|
+
instruction_roots: string[];
|
|
21
|
+
instruction_bundle_id: string;
|
|
22
|
+
canonical_source_id: string;
|
|
23
|
+
components: InstructionBundleComponent[];
|
|
24
|
+
canonical_sources: InstructionBundleComponent[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface BuildBundleOptions {
|
|
28
|
+
coordRoot: string;
|
|
29
|
+
cwd: string;
|
|
30
|
+
adapter: Adapter;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Candidate {
|
|
34
|
+
absolutePath: string;
|
|
35
|
+
role: InstructionComponentRole;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Build the content identity for the repo-authored instruction surface an
|
|
40
|
+
* adapter can load at one working path. The identity intentionally excludes
|
|
41
|
+
* timestamps and git revisions: two checkouts with byte-identical effective
|
|
42
|
+
* instructions belong to the same cohort.
|
|
43
|
+
*/
|
|
44
|
+
export function buildInstructionBundle(options: BuildBundleOptions): InstructionBundle {
|
|
45
|
+
const coordRoot = resolve(options.coordRoot);
|
|
46
|
+
const cwd = resolve(options.cwd);
|
|
47
|
+
const roots = resolveInstructionRoots(coordRoot, cwd);
|
|
48
|
+
const profileRoot = roots.at(-1) ?? coordRoot;
|
|
49
|
+
const components = dedupeCandidates(
|
|
50
|
+
roots.flatMap((root) => adapterCandidates(root, options.adapter)),
|
|
51
|
+
coordRoot,
|
|
52
|
+
);
|
|
53
|
+
const canonicalSources = dedupeCandidates(
|
|
54
|
+
roots.flatMap((root) => canonicalCandidates(root)),
|
|
55
|
+
coordRoot,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
schema_version: 1,
|
|
60
|
+
adapter: options.adapter,
|
|
61
|
+
coord_root: coordRoot,
|
|
62
|
+
profile_root: relativePath(coordRoot, profileRoot),
|
|
63
|
+
instruction_roots: roots.map((root) => relativePath(coordRoot, root)),
|
|
64
|
+
instruction_bundle_id: identity("instruction-bundle-v1", options.adapter, components),
|
|
65
|
+
canonical_source_id: identity("instruction-source-v1", null, canonicalSources),
|
|
66
|
+
components,
|
|
67
|
+
canonical_sources: canonicalSources,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function resolveInstructionRoots(coordRoot: string, cwd: string): string[] {
|
|
72
|
+
const roots = [coordRoot];
|
|
73
|
+
if (!isWithin(coordRoot, cwd)) return roots;
|
|
74
|
+
|
|
75
|
+
const ancestors: string[] = [];
|
|
76
|
+
let cursor = cwd;
|
|
77
|
+
while (cursor !== coordRoot) {
|
|
78
|
+
if (existsSync(join(cursor, "AGENTS.md")) || existsSync(join(cursor, "CLAUDE.md"))) {
|
|
79
|
+
ancestors.push(cursor);
|
|
80
|
+
}
|
|
81
|
+
const parent = dirname(cursor);
|
|
82
|
+
if (parent === cursor) break;
|
|
83
|
+
cursor = parent;
|
|
84
|
+
}
|
|
85
|
+
roots.push(...ancestors.reverse().filter((root) => root !== coordRoot));
|
|
86
|
+
return roots;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function adapterCandidates(root: string, adapter: Adapter): Candidate[] {
|
|
90
|
+
const candidates: Candidate[] = [];
|
|
91
|
+
const addFile = (path: string, role: InstructionComponentRole) => {
|
|
92
|
+
if (existsSync(path) && lstatSync(path).isFile()) candidates.push({ absolutePath: path, role });
|
|
93
|
+
};
|
|
94
|
+
const addTree = (path: string, role: InstructionComponentRole) => {
|
|
95
|
+
for (const file of walkFiles(path)) candidates.push({ absolutePath: file, role });
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
if (adapter === "claude-code") {
|
|
99
|
+
addFile(join(root, "CLAUDE.md"), "always_loaded");
|
|
100
|
+
addTree(join(root, ".claude", "rules"), "always_loaded");
|
|
101
|
+
addTree(join(root, ".claude", "skills"), "just_in_time");
|
|
102
|
+
addFile(join(root, ".claude", "settings.json"), "runtime_config");
|
|
103
|
+
addFile(join(root, ".claude", "settings.local.json"), "runtime_config");
|
|
104
|
+
} else if (adapter === "cursor") {
|
|
105
|
+
addFile(join(root, "AGENTS.md"), "always_loaded");
|
|
106
|
+
addTree(join(root, ".cursor", "rules"), "always_loaded");
|
|
107
|
+
addTree(join(root, ".agents", "skills"), "just_in_time");
|
|
108
|
+
addTree(join(root, ".cursor", "skills"), "just_in_time");
|
|
109
|
+
addFile(join(root, ".cursor", "hooks.json"), "runtime_config");
|
|
110
|
+
} else {
|
|
111
|
+
addFile(join(root, "AGENTS.md"), "always_loaded");
|
|
112
|
+
addTree(join(root, ".agents", "skills"), "just_in_time");
|
|
113
|
+
addFile(join(root, ".codex", "hooks.json"), "runtime_config");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Harnery's host configuration governs hook enforcement for all adapters.
|
|
117
|
+
addFile(join(root, ".harnery", "config.jsonc"), "runtime_config");
|
|
118
|
+
return candidates;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function canonicalCandidates(root: string): Candidate[] {
|
|
122
|
+
const candidates: Candidate[] = [];
|
|
123
|
+
const agents = join(root, "AGENTS.md");
|
|
124
|
+
if (existsSync(agents) && lstatSync(agents).isFile()) {
|
|
125
|
+
candidates.push({ absolutePath: agents, role: "always_loaded" });
|
|
126
|
+
}
|
|
127
|
+
for (const file of walkFiles(join(root, ".agents"))) {
|
|
128
|
+
candidates.push({ absolutePath: file, role: "just_in_time" });
|
|
129
|
+
}
|
|
130
|
+
return candidates;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function walkFiles(root: string): string[] {
|
|
134
|
+
if (!existsSync(root) || !lstatSync(root).isDirectory()) return [];
|
|
135
|
+
const files: string[] = [];
|
|
136
|
+
const visit = (dir: string) => {
|
|
137
|
+
for (const entry of readdirSync(dir, { withFileTypes: true }).sort((a, b) =>
|
|
138
|
+
a.name.localeCompare(b.name),
|
|
139
|
+
)) {
|
|
140
|
+
const path = join(dir, entry.name);
|
|
141
|
+
if (entry.isDirectory()) visit(path);
|
|
142
|
+
else if (entry.isFile()) files.push(path);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
visit(root);
|
|
146
|
+
return files;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function dedupeCandidates(
|
|
150
|
+
candidates: Candidate[],
|
|
151
|
+
coordRoot: string,
|
|
152
|
+
): InstructionBundleComponent[] {
|
|
153
|
+
const byPath = new Map<string, Candidate>();
|
|
154
|
+
for (const candidate of candidates) {
|
|
155
|
+
const key = resolve(candidate.absolutePath);
|
|
156
|
+
const prior = byPath.get(key);
|
|
157
|
+
if (!prior || roleRank(candidate.role) < roleRank(prior.role)) byPath.set(key, candidate);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return [...byPath.values()]
|
|
161
|
+
.map(({ absolutePath, role }) => {
|
|
162
|
+
const bytes = readFileSync(absolutePath);
|
|
163
|
+
return {
|
|
164
|
+
path: relativePath(coordRoot, absolutePath),
|
|
165
|
+
role,
|
|
166
|
+
bytes: bytes.byteLength,
|
|
167
|
+
sha256: createHash("sha256").update(bytes).digest("hex"),
|
|
168
|
+
};
|
|
169
|
+
})
|
|
170
|
+
.sort((a, b) => a.path.localeCompare(b.path) || a.role.localeCompare(b.role));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function identity(
|
|
174
|
+
prefix: string,
|
|
175
|
+
adapter: Adapter | null,
|
|
176
|
+
components: InstructionBundleComponent[],
|
|
177
|
+
): string {
|
|
178
|
+
const body = components.map(({ path, role, sha256 }) => ({ path, role, sha256 }));
|
|
179
|
+
return `sha256:${createHash("sha256")
|
|
180
|
+
.update(JSON.stringify({ prefix, ...(adapter ? { adapter } : {}), components: body }))
|
|
181
|
+
.digest("hex")}`;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function relativePath(root: string, path: string): string {
|
|
185
|
+
const rel = relative(root, path);
|
|
186
|
+
return rel === "" ? "." : rel.split(sep).join("/");
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function isWithin(root: string, path: string): boolean {
|
|
190
|
+
if (!isAbsolute(root) || !isAbsolute(path)) return false;
|
|
191
|
+
const rel = relative(root, path);
|
|
192
|
+
return rel === "" || (!rel.startsWith(`..${sep}`) && rel !== "..");
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function roleRank(role: InstructionComponentRole): number {
|
|
196
|
+
if (role === "always_loaded") return 0;
|
|
197
|
+
if (role === "runtime_config") return 1;
|
|
198
|
+
return 2;
|
|
199
|
+
}
|
|
@@ -32,6 +32,24 @@ function escapeRe(s: string): string {
|
|
|
32
32
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function trimHorizontalWhitespaceBeforeNewlines(content: string): string {
|
|
36
|
+
const chunks: string[] = [];
|
|
37
|
+
let segmentStart = 0;
|
|
38
|
+
for (let index = 0; index < content.length; index++) {
|
|
39
|
+
if (content.charCodeAt(index) !== 10) continue;
|
|
40
|
+
let segmentEnd = index;
|
|
41
|
+
while (segmentEnd > segmentStart) {
|
|
42
|
+
const code = content.charCodeAt(segmentEnd - 1);
|
|
43
|
+
if (code !== 32 && code !== 9) break;
|
|
44
|
+
segmentEnd--;
|
|
45
|
+
}
|
|
46
|
+
chunks.push(content.slice(segmentStart, segmentEnd), "\n");
|
|
47
|
+
segmentStart = index + 1;
|
|
48
|
+
}
|
|
49
|
+
chunks.push(content.slice(segmentStart));
|
|
50
|
+
return chunks.join("");
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
/**
|
|
36
54
|
* Marker comment style. Markdown/HTML files wrap markers in HTML comments;
|
|
37
55
|
* shell files (git hooks) use `#` line comments. The style only changes the
|
|
@@ -94,7 +112,7 @@ export function spliceRegion(
|
|
|
94
112
|
const text = content.replace(re, () => fresh);
|
|
95
113
|
return { text, changed: text !== content, had: true, stale };
|
|
96
114
|
}
|
|
97
|
-
const trimmed = content.
|
|
115
|
+
const trimmed = content.trimEnd();
|
|
98
116
|
const text = trimmed ? `${trimmed}\n\n${fresh}\n` : `${fresh}\n`;
|
|
99
117
|
return { text, changed: true, had: false, stale: false };
|
|
100
118
|
}
|
|
@@ -112,9 +130,7 @@ export function removeRegion(
|
|
|
112
130
|
): { text: string; removed: boolean } {
|
|
113
131
|
const re = regionRe(region, style);
|
|
114
132
|
if (!re.test(content)) return { text: content, removed: false };
|
|
115
|
-
const stripped = content
|
|
116
|
-
.replace(re, "")
|
|
117
|
-
.replace(/[ \t]+\n/g, "\n")
|
|
133
|
+
const stripped = trimHorizontalWhitespaceBeforeNewlines(content.replace(re, ""))
|
|
118
134
|
.replace(/\n{3,}/g, "\n\n")
|
|
119
135
|
.trim();
|
|
120
136
|
return { text: stripped ? `${stripped}\n` : "", removed: true };
|
|
@@ -150,15 +166,13 @@ export function isOwnedFile(content: string): boolean {
|
|
|
150
166
|
export function buildOwnedSkill(opts: {
|
|
151
167
|
name: string;
|
|
152
168
|
description: string;
|
|
153
|
-
argumentHint?: string;
|
|
154
169
|
binName: string;
|
|
155
170
|
body: string;
|
|
156
171
|
}): string {
|
|
157
172
|
const fm = [
|
|
158
173
|
"---",
|
|
159
174
|
`name: ${opts.name}`,
|
|
160
|
-
`description: ${opts.description}`,
|
|
161
|
-
...(opts.argumentHint ? [`argument-hint: ${JSON.stringify(opts.argumentHint)}`] : []),
|
|
175
|
+
`description: ${JSON.stringify(opts.description)}`,
|
|
162
176
|
"---",
|
|
163
177
|
].join("\n");
|
|
164
178
|
const body = opts.body.trim();
|
|
@@ -28,10 +28,12 @@ export const HOST_ADDENDUM_REGION = "host-addendum";
|
|
|
28
28
|
|
|
29
29
|
/** Which shipped skills exist in the project the block is rendered for. */
|
|
30
30
|
export interface BlockSkills {
|
|
31
|
-
/** the `harn-decide` skill file is present
|
|
31
|
+
/** the `harn-decide` skill file is present */
|
|
32
32
|
decide: boolean;
|
|
33
33
|
/** the `harn-council` skill file is present */
|
|
34
34
|
council: boolean;
|
|
35
|
+
/** the `harn-end` skill file is present */
|
|
36
|
+
end: boolean;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
/**
|
|
@@ -39,22 +41,24 @@ export interface BlockSkills {
|
|
|
39
41
|
* lines: it costs every agent context on every turn, so it states that each
|
|
40
42
|
* surface *exists* and gives one line of *when* — the *how* lives in the skills
|
|
41
43
|
* and each command's `--help`. Skill names are fixed (`harn-decide`,
|
|
42
|
-
* `harn-council`) even for a renamed bin; only command strings
|
|
44
|
+
* `harn-council`, `harn-end`) even for a renamed bin; only command strings
|
|
45
|
+
* track `binName`.
|
|
43
46
|
*
|
|
44
47
|
* The block only points at a skill that actually exists here: a host that
|
|
45
|
-
* excludes one via `skills.exclude
|
|
46
|
-
*
|
|
47
|
-
* instead of a dangling reference to a skill it doesn't have.
|
|
48
|
+
* excludes one via `skills.exclude` gets a CLI pointer instead of a dangling
|
|
49
|
+
* reference to a skill it doesn't have.
|
|
48
50
|
*/
|
|
49
51
|
export function renderInstructionsBlock(
|
|
50
52
|
binName: string,
|
|
51
|
-
skills: BlockSkills = { decide: true, council: true },
|
|
53
|
+
skills: BlockSkills = { decide: true, council: true, end: true },
|
|
52
54
|
): string {
|
|
53
55
|
const b = binName;
|
|
54
56
|
|
|
55
|
-
const named = [
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
const named = [
|
|
58
|
+
skills.decide && "`harn-decide`",
|
|
59
|
+
skills.council && "`harn-council`",
|
|
60
|
+
skills.end && "`harn-end`",
|
|
61
|
+
].filter(Boolean) as string[];
|
|
58
62
|
const deeper =
|
|
59
63
|
named.length > 0
|
|
60
64
|
? `Procedures for the deeper flows live in the ${named.join(" and ")} skill${named.length > 1 ? "s" : ""}.`
|
|
@@ -65,6 +69,9 @@ export function renderInstructionsBlock(
|
|
|
65
69
|
const councilPointer = skills.council
|
|
66
70
|
? "The `harn-council` skill has the steward and member flow."
|
|
67
71
|
: `See \`${b} agents council --help\` for the steward and member flow.`;
|
|
72
|
+
const endPointer = skills.end
|
|
73
|
+
? "When the whole session is genuinely finished, use the `harn-end` skill as the final workflow."
|
|
74
|
+
: `When the whole session is genuinely finished, run \`${b} agents status --end-turn --end-session\` as the final tool action.`;
|
|
68
75
|
// Render the journal categories from the canonical enum so this prose can
|
|
69
76
|
// never drift from what `journal add` actually accepts (the "note, plan…" list
|
|
70
77
|
// silently lagged the tool by two categories before this).
|
|
@@ -87,6 +94,14 @@ active peers and the files they've claimed; \`${b} agents set-task "<focus>"\`
|
|
|
87
94
|
declares your current focus so peers can see it. Check for peers before editing
|
|
88
95
|
widely-shared files.
|
|
89
96
|
|
|
97
|
+
**Task lifecycle.** Beside the activity peers already see, declare whether your
|
|
98
|
+
objective is still open: \`${b} agents lifecycle blocked --reason "<why>"\` when
|
|
99
|
+
it cannot proceed, \`${b} agents lifecycle done\` when it is complete, and
|
|
100
|
+
\`${b} agents lifecycle active\` to reopen. \`done\` requires a current task and
|
|
101
|
+
a passing Git finalization check (dirty or unpushed work refuses, and nothing is
|
|
102
|
+
written). Ordinary \`set-task\` calls never change lifecycle, and a transition
|
|
103
|
+
that re-mints the session title tells you the new name to copy. ${endPointer}
|
|
104
|
+
|
|
90
105
|
**Dispatching a team.** Everything else here coordinates the agents already
|
|
91
106
|
present. These three start new ones, and they differ by how long the objective
|
|
92
107
|
outlives a single execution. \`${b} run <script>\` is one bounded pass:
|
|
@@ -251,7 +266,7 @@ The web UI is the member + steward picker; don't create from the CLI (that skips
|
|
|
251
266
|
the steward choice). Emit the link with the objective URL-encoded:
|
|
252
267
|
|
|
253
268
|
\`\`\`
|
|
254
|
-
http://localhost:
|
|
269
|
+
http://localhost:4276/councils/new?objective=<encoded>
|
|
255
270
|
\`\`\`
|
|
256
271
|
|
|
257
272
|
If the dev server isn't up, start it with \`${b} web up\`.
|
|
@@ -307,6 +322,54 @@ mismatch), and offer the right next step. Don't propose a workaround that bypass
|
|
|
307
322
|
the guard.`;
|
|
308
323
|
}
|
|
309
324
|
|
|
325
|
+
function endBody(b: string): string {
|
|
326
|
+
return `Finalize only after the work is genuinely complete. This is the deliberate,
|
|
327
|
+
high-confidence escape hatch for adapters that do not provide a trustworthy
|
|
328
|
+
native session-end callback.
|
|
329
|
+
|
|
330
|
+
## Workflow
|
|
331
|
+
|
|
332
|
+
1. Finish all in-scope work, tests, documentation, commits, pushes, and
|
|
333
|
+
user-facing reporting first.
|
|
334
|
+
2. Confirm no tool call, open turn, delegated child, file claim, or uncommitted
|
|
335
|
+
session write remains. Do not fabricate completion or use this skill to hide
|
|
336
|
+
unfinished work.
|
|
337
|
+
3. Run the closing status and end request as the final tool action:
|
|
338
|
+
|
|
339
|
+
\`\`\`bash
|
|
340
|
+
${b} agents status --end-turn --end-session
|
|
341
|
+
\`\`\`
|
|
342
|
+
|
|
343
|
+
When automatic identity resolution is unavailable, pass the current native
|
|
344
|
+
adapter session ID with \`--session-id <id>\`. The command durably queues the
|
|
345
|
+
authoritative end while it is still running. The adapter's stop hook records
|
|
346
|
+
\`session.ended\` only after this command, its tool span, and the current turn
|
|
347
|
+
have closed.
|
|
348
|
+
4. Do not run another tool after a successful request. Reproduce the status
|
|
349
|
+
output, tell the operator the end is queued, and yield. The terminal event ID
|
|
350
|
+
becomes available after the response completes and can be verified from a
|
|
351
|
+
later session or the web UI.
|
|
352
|
+
|
|
353
|
+
## Refusals and recovery
|
|
354
|
+
|
|
355
|
+
- If the command reports delegated work, finish or explicitly cancel those
|
|
356
|
+
children, then try again.
|
|
357
|
+
- If Git finalization fails, complete the repository's required commit and push
|
|
358
|
+
workflow before retrying.
|
|
359
|
+
- If the V3 ledger is unavailable or unsafe, do not fall back to deleting a
|
|
360
|
+
projection or writing a synthetic ledger row. Report the failure.
|
|
361
|
+
- Starting a new turn or tool after the request cancels the pending end. Run the
|
|
362
|
+
workflow again when the session is actually finished.
|
|
363
|
+
- On a manual \`${b} agents end\` call, use \`--outcome failed\`, \`cancelled\`,
|
|
364
|
+
\`interrupted\`, or \`unknown\` only when that describes the completed session
|
|
365
|
+
honestly.
|
|
366
|
+
|
|
367
|
+
Never use this skill to end another operator's session unless the operator
|
|
368
|
+
explicitly identifies it. Use the web control or \`${b} agents end --instance-id
|
|
369
|
+
<id>\` for that operator action; it records immediately for an idle session or
|
|
370
|
+
durably queues the end for its current turn.`;
|
|
371
|
+
}
|
|
372
|
+
|
|
310
373
|
export const SKILLS: SkillTemplate[] = [
|
|
311
374
|
{
|
|
312
375
|
id: "harn-decide",
|
|
@@ -316,7 +379,6 @@ export const SKILLS: SkillTemplate[] = [
|
|
|
316
379
|
name: "harn-decide",
|
|
317
380
|
description:
|
|
318
381
|
"File a decision into the docket instead of blocking on a human: search precedent, file it, and proceed on a reversible default; or pick up and resolve an open decision with cited evidence. Use whenever you're about to ask a human a decision-shaped question you could resolve yourself.",
|
|
319
|
-
argumentHint: "[<the decision / question you're facing> | resolve <id> | review]",
|
|
320
382
|
binName,
|
|
321
383
|
body: decideBody(binName),
|
|
322
384
|
}),
|
|
@@ -329,10 +391,20 @@ export const SKILLS: SkillTemplate[] = [
|
|
|
329
391
|
name: "harn-council",
|
|
330
392
|
description:
|
|
331
393
|
"Interact with the multi-agent council system: list / create / show / prompts (steward) / contribute (member). Guards against misrouting: refuses to contribute when you aren't a member, have already contributed, or weren't routed a prompt.",
|
|
332
|
-
argumentHint:
|
|
333
|
-
"[<id-or-fragment> | create <objective> | contribute <id> | prompts <id> | show <id>]",
|
|
334
394
|
binName,
|
|
335
395
|
body: councilBody(binName),
|
|
336
396
|
}),
|
|
337
397
|
},
|
|
398
|
+
{
|
|
399
|
+
id: "harn-end",
|
|
400
|
+
relPath: "harn-end/SKILL.md",
|
|
401
|
+
render: (binName) =>
|
|
402
|
+
buildOwnedSkill({
|
|
403
|
+
name: "harn-end",
|
|
404
|
+
description:
|
|
405
|
+
"Safely finalize the current Harnery agent session with an authoritative V3 session-ended event. Use when the operator says /harn-end, asks to end or close the current session, or when all work is complete and the session should stop counting as live.",
|
|
406
|
+
binName,
|
|
407
|
+
body: endBody(binName),
|
|
408
|
+
}),
|
|
409
|
+
},
|
|
338
410
|
];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI-side canonical event emission helper. Importable from any CLI surface
|
|
3
|
-
* to emit-then-project in one call.
|
|
4
|
-
*
|
|
5
|
-
* Pattern: every state-changing CLI command appends its event first, then
|
|
6
|
-
* runs the projector synchronously for the affected owner.
|
|
7
|
-
*/
|
|
8
|
-
import { type EmitInput, type Envelope } from "./events/emit.js";
|
|
9
|
-
export interface EmitAndProjectResult {
|
|
10
|
-
envelope: Envelope;
|
|
11
|
-
projected: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Emit a canonical event AND synchronously project it into the owner's v2
|
|
15
|
-
* heartbeat. Idempotent on event_id: replays don't double-apply.
|
|
16
|
-
*
|
|
17
|
-
* Returns the emitted envelope so callers can inspect / log.
|
|
18
|
-
*
|
|
19
|
-
* Soft-fails on any internal error: never throws into the caller, because
|
|
20
|
-
* this runs inside operator-facing CLI commands and a corrupt events.ndjson
|
|
21
|
-
* line shouldn't break `agents set-task`.
|
|
22
|
-
*/
|
|
23
|
-
export declare function emitAndProject(input: EmitInput, opts?: {
|
|
24
|
-
coordRoot?: string;
|
|
25
|
-
skipProject?: boolean;
|
|
26
|
-
}): EmitAndProjectResult | null;
|
|
27
|
-
//# sourceMappingURL=cli-emit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-emit.d.ts","sourceRoot":"","sources":["../../../src/core/agents/cli-emit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAQ,MAAM,kBAAkB,CAAC;AAIvE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACvD,oBAAoB,GAAG,IAAI,CAiC7B"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI-side canonical event emission helper. Importable from any CLI surface
|
|
3
|
-
* to emit-then-project in one call.
|
|
4
|
-
*
|
|
5
|
-
* Pattern: every state-changing CLI command appends its event first, then
|
|
6
|
-
* runs the projector synchronously for the affected owner.
|
|
7
|
-
*/
|
|
8
|
-
import { emit } from "./events/emit.js";
|
|
9
|
-
import { findCoordRoot } from "./paths.js";
|
|
10
|
-
import { projectHeartbeats } from "./state/heartbeat-projector.js";
|
|
11
|
-
/**
|
|
12
|
-
* Emit a canonical event AND synchronously project it into the owner's v2
|
|
13
|
-
* heartbeat. Idempotent on event_id: replays don't double-apply.
|
|
14
|
-
*
|
|
15
|
-
* Returns the emitted envelope so callers can inspect / log.
|
|
16
|
-
*
|
|
17
|
-
* Soft-fails on any internal error: never throws into the caller, because
|
|
18
|
-
* this runs inside operator-facing CLI commands and a corrupt events.ndjson
|
|
19
|
-
* line shouldn't break `agents set-task`.
|
|
20
|
-
*/
|
|
21
|
-
export function emitAndProject(input, opts = {}) {
|
|
22
|
-
const root = opts.coordRoot ?? findCoordRoot();
|
|
23
|
-
if (!root)
|
|
24
|
-
return null;
|
|
25
|
-
try {
|
|
26
|
-
const envelope = emit(root, input);
|
|
27
|
-
let projected = false;
|
|
28
|
-
if (!opts.skipProject) {
|
|
29
|
-
try {
|
|
30
|
-
projectHeartbeats(root, [
|
|
31
|
-
{
|
|
32
|
-
schema_version: envelope.schema_version,
|
|
33
|
-
event_id: envelope.event_id,
|
|
34
|
-
event_type: envelope.event_type,
|
|
35
|
-
ts: envelope.ts,
|
|
36
|
-
instance_id: envelope.instance_id,
|
|
37
|
-
session_id: envelope.session_id,
|
|
38
|
-
parent_session_id: envelope.parent_session_id,
|
|
39
|
-
turn_id: envelope.turn_id,
|
|
40
|
-
parent_turn_id: envelope.parent_turn_id,
|
|
41
|
-
adapter: envelope.adapter,
|
|
42
|
-
source: envelope.source,
|
|
43
|
-
data: envelope.data,
|
|
44
|
-
},
|
|
45
|
-
]);
|
|
46
|
-
projected = true;
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
/* projector failure is non-fatal; next agent-coord project run catches up */
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return { envelope, projected };
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
}
|