harnery 0.30.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/commander.d.ts +8 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +14 -13
- package/dist/commands/adapter.d.ts +12 -0
- package/dist/commands/adapter.d.ts.map +1 -0
- package/dist/commands/{harness.js → adapter.js} +35 -35
- package/dist/commands/agents.d.ts +3 -2
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +185 -74
- package/dist/commands/artifacts.d.ts +4 -0
- package/dist/commands/artifacts.d.ts.map +1 -0
- package/dist/commands/artifacts.js +143 -0
- package/dist/commands/backup.d.ts +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +5 -2
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +310 -7
- package/dist/commands/checkpoint.d.ts +12 -0
- package/dist/commands/checkpoint.d.ts.map +1 -0
- package/dist/commands/checkpoint.js +162 -0
- package/dist/commands/context.d.ts +2 -2
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +3 -151
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +31 -7
- package/dist/commands/deinit.d.ts +2 -2
- package/dist/commands/deinit.js +15 -15
- package/dist/commands/doctor.js +23 -23
- package/dist/commands/governor.d.ts +4 -0
- package/dist/commands/governor.d.ts.map +1 -0
- package/dist/commands/{supervisor.js → governor.js} +133 -108
- package/dist/commands/grep.d.ts +1 -1
- package/dist/commands/grep.d.ts.map +1 -1
- package/dist/commands/grep.js +19 -2
- package/dist/commands/init.d.ts +12 -12
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +44 -30
- package/dist/commands/{session.d.ts → journal.d.ts} +2 -2
- package/dist/commands/journal.d.ts.map +1 -0
- package/dist/commands/{scratch.js → journal.js} +47 -47
- package/dist/commands/policy.js +1 -1
- package/dist/commands/presence.js +2 -2
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +3 -3
- package/dist/commands/tunnel.d.ts +16 -0
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +213 -27
- package/dist/commands/web-fetch.js +1 -1
- package/dist/commands/web.d.ts +19 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +51 -0
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +38 -22
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +35 -28
- package/dist/core/{harnesses → adapters}/attest-projection.d.ts +2 -2
- package/dist/core/adapters/attest-projection.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/attest.d.ts +16 -16
- package/dist/core/adapters/attest.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/attest.js +9 -9
- package/dist/core/{harnesses → adapters}/attestation.d.ts +16 -16
- package/dist/core/adapters/attestation.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/attestation.js +20 -20
- package/dist/core/{harnesses → adapters}/bench.d.ts +12 -12
- package/dist/core/adapters/bench.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/bench.js +12 -12
- package/dist/core/adapters/index.d.ts +13 -0
- package/dist/core/adapters/index.d.ts.map +1 -0
- package/dist/core/adapters/index.js +6 -0
- package/dist/core/{harnesses → adapters}/profiles.d.ts +11 -11
- package/dist/core/adapters/profiles.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/profiles.js +11 -11
- package/dist/core/adapters/registry.d.ts +15 -0
- package/dist/core/adapters/registry.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/registry.js +11 -11
- package/dist/core/{harnesses → adapters}/types.d.ts +23 -23
- package/dist/core/adapters/types.d.ts.map +1 -0
- package/dist/core/{harnesses → adapters}/types.js +1 -1
- package/dist/core/agents/canonical-emit.d.ts +9 -14
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +15 -44
- package/dist/core/agents/cli-emit.js +1 -1
- package/dist/core/agents/cli.js +30 -26
- package/dist/core/agents/codex-replay.d.ts +1 -1
- package/dist/core/agents/codex-replay.js +6 -6
- package/dist/core/agents/coord-bin.d.ts +33 -0
- package/dist/core/agents/coord-bin.d.ts.map +1 -0
- package/dist/core/agents/coord-bin.js +89 -0
- package/dist/core/agents/coord-client.d.ts +78 -8
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +303 -75
- package/dist/core/agents/events/consume.d.ts +1 -1
- package/dist/core/agents/events/emit.d.ts +5 -6
- package/dist/core/agents/events/emit.d.ts.map +1 -1
- package/dist/core/agents/events/emit.js +2 -2
- package/dist/core/agents/paths.d.ts +5 -2
- package/dist/core/agents/paths.d.ts.map +1 -1
- package/dist/core/agents/paths.js +7 -13
- package/dist/core/agents/render/prompt-context.d.ts +21 -9
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +82 -30
- package/dist/core/agents/render/session-context.d.ts +1 -1
- package/dist/core/agents/render/session-context.js +5 -5
- package/dist/core/agents/rules/claim-conflict.d.ts +2 -6
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +1 -1
- package/dist/core/agents/rules/commit-conflict.js +98 -22
- package/dist/core/agents/rules/stop-hook.d.ts +9 -9
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +23 -5
- package/dist/core/agents/rules/verdict.d.ts +14 -0
- package/dist/core/agents/rules/verdict.d.ts.map +1 -0
- package/dist/core/agents/rules/verdict.js +1 -0
- package/dist/core/agents/session-events.js +3 -3
- package/dist/core/agents/state/council.d.ts +1 -1
- package/dist/core/agents/state/council.js +1 -1
- package/dist/core/agents/state/heartbeat-projector.d.ts +3 -2
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-projector.js +14 -10
- package/dist/core/agents/state/heartbeat-writer.d.ts +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +12 -12
- package/dist/core/agents/state/{scratch.d.ts → journal.d.ts} +7 -7
- package/dist/core/agents/state/{scratch.d.ts.map → journal.d.ts.map} +1 -1
- package/dist/core/agents/state/{scratch.js → journal.js} +12 -12
- package/dist/core/agents/state/pidmap.d.ts +28 -4
- package/dist/core/agents/state/pidmap.d.ts.map +1 -1
- package/dist/core/agents/state/pidmap.js +130 -15
- package/dist/core/agents/state/proc-start.d.ts +95 -0
- package/dist/core/agents/state/proc-start.d.ts.map +1 -0
- package/dist/core/agents/state/proc-start.js +199 -0
- package/dist/core/agents/state/shell-mutation.d.ts +1 -1
- package/dist/core/agents/state/shell-mutation.js +1 -1
- package/dist/core/agents/state/stale-sweep.js +7 -7
- package/dist/core/artifacts/index.d.ts +86 -0
- package/dist/core/artifacts/index.d.ts.map +1 -0
- package/dist/core/artifacts/index.js +421 -0
- package/dist/core/config.d.ts +9 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +26 -2
- package/dist/core/context/index.d.ts +12 -12
- package/dist/core/context/index.js +10 -10
- package/dist/core/governor/adapter-spread.d.ts +52 -0
- package/dist/core/governor/adapter-spread.d.ts.map +1 -0
- package/dist/core/governor/adapter-spread.js +52 -0
- package/dist/core/governor/index.d.ts +7 -0
- package/dist/core/governor/index.d.ts.map +1 -0
- package/dist/core/governor/index.js +6 -0
- package/dist/core/governor/plan-api.d.ts +38 -0
- package/dist/core/governor/plan-api.d.ts.map +1 -0
- package/dist/core/governor/plan-api.js +83 -0
- package/dist/core/governor/plan-read.d.ts +5 -0
- package/dist/core/governor/plan-read.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/plan-read.js +66 -52
- package/dist/core/{supervisor → governor}/plan-types.d.ts +57 -56
- package/dist/core/governor/plan-types.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/plan-types.js +4 -4
- package/dist/core/governor/planning.d.ts +48 -0
- package/dist/core/governor/planning.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/planning.js +125 -94
- package/dist/core/governor/read.d.ts +6 -0
- package/dist/core/governor/read.d.ts.map +1 -0
- package/dist/core/governor/read.js +4 -0
- package/dist/core/governor/runner.d.ts +37 -0
- package/dist/core/governor/runner.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/runner.js +15 -15
- package/dist/core/governor/service-read.d.ts +6 -0
- package/dist/core/governor/service-read.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/service-read.js +12 -12
- package/dist/core/governor/service.d.ts +114 -0
- package/dist/core/governor/service.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/service.js +57 -57
- package/dist/core/governor/state.d.ts +116 -0
- package/dist/core/governor/state.d.ts.map +1 -0
- package/dist/core/{supervisor → governor}/state.js +228 -108
- package/dist/core/hooks/adapter/detect.d.ts +9 -0
- package/dist/core/hooks/{harness → adapter}/detect.d.ts.map +1 -1
- package/dist/core/hooks/{harness → adapter}/detect.js +8 -8
- package/dist/core/hooks/{harness → adapter}/events.d.ts +15 -14
- package/dist/core/hooks/adapter/events.d.ts.map +1 -0
- package/dist/core/hooks/{harness → adapter}/events.js +5 -5
- package/dist/core/hooks/{harness → adapter}/output.d.ts +20 -14
- package/dist/core/hooks/adapter/output.d.ts.map +1 -0
- package/dist/core/hooks/{harness → adapter}/output.js +30 -22
- package/dist/core/hooks/{harness → adapter}/parse.d.ts +5 -5
- package/dist/core/hooks/{harness → adapter}/parse.d.ts.map +1 -1
- package/dist/core/hooks/{harness → adapter}/parse.js +4 -4
- package/dist/core/hooks/{harness → adapter}/wiring.d.ts +15 -15
- package/dist/core/hooks/{harness → adapter}/wiring.d.ts.map +1 -1
- package/dist/core/hooks/{harness → adapter}/wiring.js +13 -13
- package/dist/core/hooks/cli.d.ts +3 -3
- package/dist/core/hooks/cli.js +187 -162
- package/dist/core/hooks/effects/image-capture.d.ts +5 -5
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +3 -3
- package/dist/core/hooks/effects/index.d.ts +12 -12
- package/dist/core/hooks/effects/index.d.ts.map +1 -1
- package/dist/core/hooks/effects/index.js +19 -19
- package/dist/core/hooks/events/emit.d.ts +2 -2
- package/dist/core/hooks/events/emit.d.ts.map +1 -1
- package/dist/core/hooks/events/emit.js +1 -1
- package/dist/core/hooks/events/rotate.js +1 -1
- package/dist/core/hooks/events/schema.d.ts +13 -5
- package/dist/core/hooks/events/schema.d.ts.map +1 -1
- package/dist/core/hooks/guard-path.d.ts +2 -2
- package/dist/core/hooks/guard-path.js +2 -2
- package/dist/core/hooks/index.d.ts +1 -1
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/resolve/anchor.d.ts +14 -5
- package/dist/core/hooks/resolve/anchor.d.ts.map +1 -1
- package/dist/core/hooks/resolve/anchor.js +64 -7
- package/dist/core/hooks/resolve/coord-root.d.ts +16 -11
- package/dist/core/hooks/resolve/coord-root.d.ts.map +1 -1
- package/dist/core/hooks/resolve/coord-root.js +18 -43
- package/dist/core/hooks/resolve/intent.js +1 -1
- package/dist/core/hooks/resolve/owner.d.ts +1 -1
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +11 -5
- package/dist/core/{scratch → journal}/index.d.ts +25 -25
- package/dist/core/{scratch → journal}/index.d.ts.map +1 -1
- package/dist/core/{scratch → journal}/index.js +38 -38
- package/dist/core/policy/evaluate.d.ts +1 -1
- package/dist/core/policy/evaluate.d.ts.map +1 -1
- package/dist/core/policy/evaluate.js +7 -7
- package/dist/core/policy/types.d.ts +3 -3
- package/dist/core/policy/types.d.ts.map +1 -1
- package/dist/core/work/state.d.ts +12 -4
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +50 -17
- package/dist/core/workflow/adapters.d.ts +17 -0
- package/dist/core/workflow/adapters.d.ts.map +1 -0
- package/dist/core/workflow/adapters.js +21 -0
- package/dist/core/workflow/approvals.js +6 -6
- package/dist/core/workflow/billing.d.ts +9 -9
- package/dist/core/workflow/billing.js +9 -9
- package/dist/core/workflow/child-env.d.ts +10 -2
- package/dist/core/workflow/child-env.d.ts.map +1 -1
- package/dist/core/workflow/child-env.js +12 -4
- package/dist/core/workflow/engine.d.ts +15 -5
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +138 -83
- package/dist/core/workflow/evidence-preflight.d.ts +24 -0
- package/dist/core/workflow/evidence-preflight.d.ts.map +1 -0
- package/dist/core/workflow/evidence-preflight.js +134 -0
- package/dist/core/workflow/index.d.ts +1 -1
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/proof.d.ts +11 -5
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +45 -36
- package/dist/core/workflow/run-state.d.ts +1 -1
- package/dist/core/workflow/run-state.js +7 -7
- package/dist/core/workflow/sandbox-projection.d.ts +6 -6
- package/dist/core/workflow/sandbox-projection.d.ts.map +1 -1
- package/dist/core/workflow/sandbox-projection.js +11 -11
- package/dist/core/workflow/spawn-claude.d.ts +3 -3
- package/dist/core/workflow/spawn-claude.d.ts.map +1 -1
- package/dist/core/workflow/spawn-claude.js +9 -6
- package/dist/core/workflow/spawn-codex.d.ts +4 -4
- package/dist/core/workflow/spawn-codex.d.ts.map +1 -1
- package/dist/core/workflow/spawn-codex.js +9 -6
- package/dist/core/workflow/spawn-cursor.d.ts +4 -4
- package/dist/core/workflow/spawn-cursor.d.ts.map +1 -1
- package/dist/core/workflow/spawn-cursor.js +9 -6
- package/dist/core/workflow/spawn-failure.d.ts +1 -1
- package/dist/core/workflow/spawn-failure.js +1 -1
- package/dist/core/workflow/specialists.js +2 -2
- package/dist/core/workflow/{journal.d.ts → transcript.d.ts} +8 -8
- package/dist/core/workflow/transcript.d.ts.map +1 -0
- package/dist/core/workflow/{journal.js → transcript.js} +14 -14
- package/dist/core/workflow/types.d.ts +98 -51
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/types.js +11 -1
- package/dist/core/workflow/validate.d.ts +1 -1
- package/dist/core/workflow/validate.js +1 -1
- package/dist/core/workflow/workspaces/cancellation.js +2 -2
- package/dist/core/workflow/workspaces/cleanup.js +2 -2
- package/dist/core/workflow/workspaces/execution.js +6 -6
- package/dist/core/workflow/workspaces/inspect.js +9 -9
- package/dist/core/workflow/workspaces/integration.js +14 -14
- package/dist/core/workflow/workspaces/lifecycle.d.ts +1 -1
- package/dist/core/workflow/workspaces/lifecycle.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/lifecycle.js +9 -9
- package/dist/core/workflow/workspaces/local-git.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/local-git.js +39 -5
- package/dist/core/workflow/workspaces/recovery.js +3 -3
- package/dist/core/workflow/workspaces/state.d.ts +1 -1
- package/dist/core/workflow/workspaces/state.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/state.js +3 -3
- package/dist/core/workflow/workspaces/types.d.ts +1 -1
- package/dist/core/workflow/workspaces/types.d.ts.map +1 -1
- package/dist/lib/browser/asserts.d.ts +28 -0
- package/dist/lib/browser/asserts.d.ts.map +1 -0
- package/dist/lib/browser/asserts.js +152 -0
- package/dist/lib/browser/client.d.ts +49 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +155 -14
- package/dist/lib/browser/content-checks.d.ts +108 -0
- package/dist/lib/browser/content-checks.d.ts.map +1 -0
- package/dist/lib/browser/content-checks.js +474 -0
- package/dist/lib/browser/critique.d.ts +91 -0
- package/dist/lib/browser/critique.d.ts.map +1 -0
- package/dist/lib/browser/critique.js +167 -0
- package/dist/lib/browser/geometry.d.ts +32 -0
- package/dist/lib/browser/geometry.d.ts.map +1 -1
- package/dist/lib/browser/geometry.js +244 -1
- package/dist/lib/browser/index.d.ts +4 -1
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -0
- package/dist/lib/claude-desktop.d.ts.map +1 -1
- package/dist/lib/claude-desktop.js +4 -1
- package/dist/lib/context/index.js +9 -2
- package/dist/lib/council/index.d.ts +6 -6
- package/dist/lib/council/index.d.ts.map +1 -1
- package/dist/lib/council/index.js +8 -8
- package/dist/lib/identities/assume.d.ts +2 -2
- package/dist/lib/identities/assume.js +7 -7
- package/dist/lib/instructions/apply.d.ts +3 -3
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +75 -27
- package/dist/lib/instructions/host-addendum.d.ts +54 -0
- package/dist/lib/instructions/host-addendum.d.ts.map +1 -0
- package/dist/lib/instructions/host-addendum.js +107 -0
- package/dist/lib/instructions/templates.d.ts +10 -3
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +41 -12
- package/dist/lib/machine.d.ts +2 -2
- package/dist/lib/machine.js +2 -2
- package/package.json +26 -21
- package/schemas/config.schema.json +26 -1
- package/src/commander.ts +22 -13
- package/src/commands/{harness.ts → adapter.ts} +46 -46
- package/src/commands/agents.ts +200 -78
- package/src/commands/artifacts.ts +168 -0
- package/src/commands/backup.ts +47 -33
- package/src/commands/browse.ts +438 -2
- package/src/commands/checkpoint.ts +196 -0
- package/src/commands/context.ts +3 -176
- package/src/commands/decision.ts +41 -7
- package/src/commands/deinit.ts +16 -16
- package/src/commands/doctor.ts +28 -28
- package/src/commands/{supervisor.ts → governor.ts} +184 -154
- package/src/commands/grep.ts +19 -2
- package/src/commands/init.ts +50 -34
- package/src/commands/{scratch.ts → journal.ts} +60 -60
- package/src/commands/policy.ts +1 -1
- package/src/commands/presence.ts +2 -2
- package/src/commands/sync.ts +3 -3
- package/src/commands/tunnel.ts +256 -38
- package/src/commands/web-fetch.ts +1 -1
- package/src/commands/web.ts +56 -1
- package/src/commands/work.ts +50 -35
- package/src/commands/workflow.ts +43 -34
- package/src/core/{harnesses → adapters}/attest-projection.ts +2 -2
- package/src/core/{harnesses → adapters}/attest.ts +27 -27
- package/src/core/{harnesses → adapters}/attestation.ts +41 -41
- package/src/core/{harnesses → adapters}/bench.ts +34 -43
- package/src/core/adapters/index.ts +56 -0
- package/src/core/{harnesses → adapters}/profiles.ts +16 -16
- package/src/core/{harnesses → adapters}/registry.ts +23 -23
- package/src/core/{harnesses → adapters}/types.ts +23 -23
- package/src/core/agents/canonical-emit.ts +16 -43
- package/src/core/agents/cli-emit.ts +1 -1
- package/src/core/agents/cli.ts +30 -28
- package/src/core/agents/codex-replay.ts +6 -6
- package/src/core/agents/coord-bin.ts +92 -0
- package/src/core/agents/coord-client.ts +302 -78
- package/src/core/agents/events/consume.ts +1 -1
- package/src/core/agents/events/emit.ts +7 -6
- package/src/core/agents/paths.ts +7 -11
- package/src/core/agents/render/prompt-context.ts +107 -31
- package/src/core/agents/render/session-context.ts +6 -6
- package/src/core/agents/rules/claim-conflict.ts +4 -7
- package/src/core/agents/rules/commit-conflict.ts +103 -22
- package/src/core/agents/rules/stop-hook.ts +33 -17
- package/src/core/agents/rules/verdict.ts +13 -0
- package/src/core/agents/session-events.ts +4 -4
- package/src/core/agents/state/council.ts +1 -1
- package/src/core/agents/state/heartbeat-projector.ts +16 -12
- package/src/core/agents/state/heartbeat-writer.ts +12 -12
- package/src/core/agents/state/{scratch.ts → journal.ts} +12 -12
- package/src/core/agents/state/pidmap.ts +130 -15
- package/src/core/agents/state/proc-start.ts +208 -0
- package/src/core/agents/state/shell-mutation.ts +1 -1
- package/src/core/agents/state/stale-sweep.ts +7 -7
- package/src/core/artifacts/index.ts +557 -0
- package/src/core/config.ts +30 -2
- package/src/core/context/index.ts +15 -15
- package/src/core/governor/adapter-spread.ts +82 -0
- package/src/core/governor/index.ts +91 -0
- package/src/core/governor/plan-api.ts +115 -0
- package/src/core/{supervisor → governor}/plan-read.ts +112 -97
- package/src/core/{supervisor → governor}/plan-types.ts +59 -56
- package/src/core/{supervisor → governor}/planning.ts +223 -192
- package/src/core/governor/read.ts +59 -0
- package/src/core/{supervisor → governor}/runner.ts +39 -39
- package/src/core/{supervisor → governor}/service-read.ts +22 -22
- package/src/core/{supervisor → governor}/service.ts +117 -119
- package/src/core/{supervisor → governor}/state.ts +325 -167
- package/src/core/hooks/adapter/detect.ts +30 -0
- package/src/core/hooks/{harness → adapter}/events.ts +16 -14
- package/src/core/hooks/{harness → adapter}/output.ts +31 -23
- package/src/core/hooks/{harness → adapter}/parse.ts +5 -5
- package/src/core/hooks/{harness → adapter}/wiring.ts +21 -21
- package/src/core/hooks/cli.ts +197 -173
- package/src/core/hooks/effects/image-capture.ts +6 -6
- package/src/core/hooks/effects/index.ts +19 -19
- package/src/core/hooks/events/emit.ts +3 -3
- package/src/core/hooks/events/rotate.ts +1 -1
- package/src/core/hooks/events/schema.ts +15 -7
- package/src/core/hooks/guard-path.ts +2 -2
- package/src/core/hooks/index.ts +1 -1
- package/src/core/hooks/resolve/anchor.ts +63 -8
- package/src/core/hooks/resolve/coord-root.ts +18 -40
- package/src/core/hooks/resolve/intent.ts +1 -1
- package/src/core/hooks/resolve/owner.ts +11 -5
- package/src/core/{scratch → journal}/index.ts +53 -53
- package/src/core/policy/evaluate.ts +8 -8
- package/src/core/policy/types.ts +3 -3
- package/src/core/work/state.ts +65 -23
- package/src/core/workflow/adapters.ts +33 -0
- package/src/core/workflow/approvals.ts +7 -7
- package/src/core/workflow/billing.ts +12 -12
- package/src/core/workflow/child-env.ts +13 -4
- package/src/core/workflow/engine.ts +155 -90
- package/src/core/workflow/evidence-preflight.ts +165 -0
- package/src/core/workflow/index.ts +3 -3
- package/src/core/workflow/proof.ts +60 -50
- package/src/core/workflow/run-state.ts +7 -7
- package/src/core/workflow/sandbox-projection.ts +16 -16
- package/src/core/workflow/spawn-claude.ts +13 -10
- package/src/core/workflow/spawn-codex.ts +13 -10
- package/src/core/workflow/spawn-cursor.ts +13 -10
- package/src/core/workflow/spawn-failure.ts +1 -1
- package/src/core/workflow/specialists.ts +2 -2
- package/src/core/workflow/{journal.ts → transcript.ts} +16 -16
- package/src/core/workflow/types.ts +108 -51
- package/src/core/workflow/validate.ts +1 -1
- package/src/core/workflow/workspaces/cancellation.ts +2 -2
- package/src/core/workflow/workspaces/cleanup.ts +2 -2
- package/src/core/workflow/workspaces/execution.ts +6 -6
- package/src/core/workflow/workspaces/inspect.ts +14 -11
- package/src/core/workflow/workspaces/integration.ts +18 -14
- package/src/core/workflow/workspaces/lifecycle.ts +10 -10
- package/src/core/workflow/workspaces/local-git.ts +47 -5
- package/src/core/workflow/workspaces/recovery.ts +3 -3
- package/src/core/workflow/workspaces/state.ts +4 -3
- package/src/core/workflow/workspaces/types.ts +1 -1
- package/src/lib/browser/asserts.ts +177 -0
- package/src/lib/browser/client.ts +189 -14
- package/src/lib/browser/content-checks.ts +571 -0
- package/src/lib/browser/critique.ts +231 -0
- package/src/lib/browser/geometry.ts +297 -1
- package/src/lib/browser/index.ts +34 -0
- package/src/lib/claude-desktop.ts +4 -1
- package/src/lib/context/index.ts +11 -1
- package/src/lib/council/index.ts +9 -9
- package/src/lib/identities/assume.ts +7 -7
- package/src/lib/instructions/apply.ts +87 -25
- package/src/lib/instructions/host-addendum.ts +126 -0
- package/src/lib/instructions/templates.ts +44 -15
- package/src/lib/machine.ts +2 -2
- package/dist/commands/harness.d.ts +0 -12
- package/dist/commands/harness.d.ts.map +0 -1
- package/dist/commands/scratch.d.ts +0 -4
- package/dist/commands/scratch.d.ts.map +0 -1
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -162
- package/dist/commands/supervisor.d.ts +0 -4
- package/dist/commands/supervisor.d.ts.map +0 -1
- package/dist/core/harnesses/attest-projection.d.ts.map +0 -1
- package/dist/core/harnesses/attest.d.ts.map +0 -1
- package/dist/core/harnesses/attestation.d.ts.map +0 -1
- package/dist/core/harnesses/bench.d.ts.map +0 -1
- package/dist/core/harnesses/index.d.ts +0 -13
- package/dist/core/harnesses/index.d.ts.map +0 -1
- package/dist/core/harnesses/index.js +0 -6
- package/dist/core/harnesses/profiles.d.ts.map +0 -1
- package/dist/core/harnesses/registry.d.ts +0 -15
- package/dist/core/harnesses/registry.d.ts.map +0 -1
- package/dist/core/harnesses/types.d.ts.map +0 -1
- package/dist/core/hooks/harness/detect.d.ts +0 -9
- package/dist/core/hooks/harness/events.d.ts.map +0 -1
- package/dist/core/hooks/harness/output.d.ts.map +0 -1
- package/dist/core/supervisor/index.d.ts +0 -7
- package/dist/core/supervisor/index.d.ts.map +0 -1
- package/dist/core/supervisor/index.js +0 -6
- package/dist/core/supervisor/plan-api.d.ts +0 -23
- package/dist/core/supervisor/plan-api.d.ts.map +0 -1
- package/dist/core/supervisor/plan-api.js +0 -50
- package/dist/core/supervisor/plan-read.d.ts +0 -5
- package/dist/core/supervisor/plan-read.d.ts.map +0 -1
- package/dist/core/supervisor/plan-types.d.ts.map +0 -1
- package/dist/core/supervisor/planning.d.ts +0 -33
- package/dist/core/supervisor/planning.d.ts.map +0 -1
- package/dist/core/supervisor/read.d.ts +0 -6
- package/dist/core/supervisor/read.d.ts.map +0 -1
- package/dist/core/supervisor/read.js +0 -4
- package/dist/core/supervisor/runner.d.ts +0 -37
- package/dist/core/supervisor/runner.d.ts.map +0 -1
- package/dist/core/supervisor/service-read.d.ts +0 -6
- package/dist/core/supervisor/service-read.d.ts.map +0 -1
- package/dist/core/supervisor/service.d.ts +0 -114
- package/dist/core/supervisor/service.d.ts.map +0 -1
- package/dist/core/supervisor/state.d.ts +0 -95
- package/dist/core/supervisor/state.d.ts.map +0 -1
- package/dist/core/workflow/harnesses.d.ts +0 -17
- package/dist/core/workflow/harnesses.d.ts.map +0 -1
- package/dist/core/workflow/harnesses.js +0 -21
- package/dist/core/workflow/journal.d.ts.map +0 -1
- package/src/commands/session.ts +0 -187
- package/src/core/harnesses/index.ts +0 -56
- package/src/core/hooks/harness/detect.ts +0 -30
- package/src/core/supervisor/index.ts +0 -89
- package/src/core/supervisor/plan-api.ts +0 -73
- package/src/core/supervisor/read.ts +0 -59
- package/src/core/workflow/harnesses.ts +0 -33
- /package/dist/core/{harnesses → adapters}/attest-projection.js +0 -0
package/dist/commands/agents.js
CHANGED
|
@@ -16,16 +16,18 @@ import { spawnSync } from "node:child_process";
|
|
|
16
16
|
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
17
17
|
import { homedir, tmpdir } from "node:os";
|
|
18
18
|
import { basename, join, resolve } from "node:path";
|
|
19
|
+
import { coordBinPath } from "../core/agents/coord-bin.js";
|
|
19
20
|
import { readStreamTailBounded } from "../core/agents/events/consume.js";
|
|
20
|
-
import { emitCanonical, monorepoRoot,
|
|
21
|
+
import { emitCanonical, monorepoRoot, normalizeAdapter, readHeartbeat, resolveOwner, resolveOwnerBySessionEnv, resolveOwnerWithSource, } from "../core/agents/index.js";
|
|
21
22
|
import { coordFreshnessSeconds, resolveBinName } from "../core/config.js";
|
|
22
23
|
import { readRemoteMachines } from "../core/presence/index.js";
|
|
24
|
+
import { registerContextCommand } from "./context.js";
|
|
23
25
|
/** Cap for CLI scans of the unbounded event ledger (`trace` / `health`). Well
|
|
24
26
|
* under V8's ~512MB max string length so a `readFileSync` of the whole file can
|
|
25
27
|
* never throw; covers ample recent history for a diagnostic scan. */
|
|
26
28
|
const STREAM_SCAN_CAP_BYTES = 128 * 1024 * 1024; // 128 MiB
|
|
27
29
|
import { parsePsChainLine } from "../core/hooks/resolve/anchor.js";
|
|
28
|
-
import { appendEntry, resolveOwnerByName } from "../core/
|
|
30
|
+
import { appendEntry, resolveOwnerByName } from "../core/journal/index.js";
|
|
29
31
|
import { buildCouncilId, buildInviteMarkdown, COUNCIL_SCHEMA_VERSION, contributorsInRound, councilBodyDir, councilsArchiveDir, deleteArchivedCouncil, effectiveSteward, findManifestByPartialId, listKnownAgents, listManifests, moveFromArchive, moveToArchive, normalizeAgentName, pendingCouncilsForMember, readArchivedManifest, readManifest, readRoundPrompts, roundDir, setCouncilSteward, writeContribution, writeManifest, writePrompt, } from "../lib/council/index.js";
|
|
30
32
|
import { assumeIdentity, IdentityAssumeError } from "../lib/identities/assume.js";
|
|
31
33
|
import { displayName as displayAgentName, ensureIdentity, listIdentities, lookupById as lookupIdentityById, lookupByName as lookupIdentityByName, } from "../lib/identities/index.js";
|
|
@@ -55,6 +57,41 @@ const SUBAGENT_NOTE = "Bash identity is process-level in v1; if you're running i
|
|
|
55
57
|
export function coordHelperOpts(root) {
|
|
56
58
|
return { cwd: root, env: { ...process.env, HARNERY_COORD_ROOT_OVERRIDE: root } };
|
|
57
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the bundled `agent-coord` helper, or exit with an error that names the
|
|
62
|
+
* problem. Every heartbeat mutation goes through that binary, so a caller who
|
|
63
|
+
* cannot find it has nothing useful to do — but it has to SAY so, because the
|
|
64
|
+
* alternative was spawning a path that did not exist and then crashing on the
|
|
65
|
+
* result (see `spawnFailureMessage`).
|
|
66
|
+
*/
|
|
67
|
+
function agentCoordOrExit(root) {
|
|
68
|
+
const binary = coordBinPath("agent-coord", root);
|
|
69
|
+
if (!binary) {
|
|
70
|
+
emit.error({
|
|
71
|
+
code: "coord_helper_missing",
|
|
72
|
+
message: `agent-coord helper not found for coord root ${root}; reinstall or rebuild harnery`,
|
|
73
|
+
});
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
return binary;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Describe a failed `spawnSync` without assuming it ran.
|
|
80
|
+
*
|
|
81
|
+
* When the binary cannot be executed at all (ENOENT, EACCES) node reports
|
|
82
|
+
* `status: null` AND `stderr: null`, so the obvious `result.stderr.trim()`
|
|
83
|
+
* threw "null is not an object" — replacing a legible "helper not found" with a
|
|
84
|
+
* crash that pointed at the wrong layer entirely. `error` carries the real
|
|
85
|
+
* cause on that path, so prefer it.
|
|
86
|
+
*/
|
|
87
|
+
function spawnFailureMessage(result, what) {
|
|
88
|
+
if (result.error)
|
|
89
|
+
return `${what}: ${result.error.message}`;
|
|
90
|
+
const stderr = result.stderr?.trim();
|
|
91
|
+
if (stderr)
|
|
92
|
+
return stderr;
|
|
93
|
+
return result.status === null ? `${what}: did not run` : `${what} exited ${result.status}`;
|
|
94
|
+
}
|
|
58
95
|
function formatPlatformLabel(platform) {
|
|
59
96
|
if (platform === "cursor")
|
|
60
97
|
return "Cursor";
|
|
@@ -63,11 +100,12 @@ function formatPlatformLabel(platform) {
|
|
|
63
100
|
return "CC";
|
|
64
101
|
}
|
|
65
102
|
let emit;
|
|
66
|
-
export function registerAgentsCommand(program, emitParam) {
|
|
103
|
+
export function registerAgentsCommand(program, emitParam, programContext) {
|
|
67
104
|
emit = emitParam;
|
|
68
105
|
const cmd = program
|
|
69
106
|
.command("agents")
|
|
70
|
-
.description("
|
|
107
|
+
.description("The live agent sessions in this project: who is running now, what they hold, and their coordination state (whoami / list / status / health).");
|
|
108
|
+
registerContextCommand(cmd, emitParam, programContext);
|
|
71
109
|
cmd
|
|
72
110
|
.command("whoami")
|
|
73
111
|
.description("Print the current agent's name + instance_id + files claimed")
|
|
@@ -97,7 +135,7 @@ export function registerAgentsCommand(program, emitParam) {
|
|
|
97
135
|
cmd
|
|
98
136
|
.command("suggest-name [description...]")
|
|
99
137
|
.description('Reprint a session name ("Agent <you> - <description>") for the operator to set as their ' +
|
|
100
|
-
"
|
|
138
|
+
"adapter tab title. With no arg, derives it from your current task. The primary naming path " +
|
|
101
139
|
"is set-task (it suggests a name on the first focus declaration); reach for this to reprint " +
|
|
102
140
|
"or re-suggest after a topic pivot. Read-only.")
|
|
103
141
|
.option("--json", "JSON output instead of the bare name")
|
|
@@ -154,7 +192,7 @@ export function registerAgentsCommand(program, emitParam) {
|
|
|
154
192
|
});
|
|
155
193
|
cmd
|
|
156
194
|
.command("ping <name> <message...>")
|
|
157
|
-
.description("Append a 'handoff' entry to a peer agent's
|
|
195
|
+
.description("Append a 'handoff' entry to a peer agent's journal. Body prefixed with " +
|
|
158
196
|
"`from agent-<me>:`. Use to leave actionable coordination notes for peers " +
|
|
159
197
|
"currently holding files you need.")
|
|
160
198
|
.option("--json", "JSON output")
|
|
@@ -194,17 +232,17 @@ export function registerAgentsCommand(program, emitParam) {
|
|
|
194
232
|
runHealth(opts);
|
|
195
233
|
});
|
|
196
234
|
cmd
|
|
197
|
-
.command("
|
|
198
|
-
.description("
|
|
235
|
+
.command("adapter-probe <id>")
|
|
236
|
+
.description("Adapter wiring probe: ppid chain, comm names, pid-map anchor, sample payload paths. " +
|
|
199
237
|
"With --replay-samples, also replays every checked-in sample payload against the live " +
|
|
200
238
|
"adapter in an isolated sandbox to catch adapter / payload-shape drift. " +
|
|
201
239
|
"Complements heal-events (drift telemetry). Id: claude_code | cursor.")
|
|
202
240
|
.option("--json", "JSON envelope output")
|
|
203
|
-
.option("--replay-samples", "Replay docs/api/<
|
|
241
|
+
.option("--replay-samples", "Replay docs/api/<adapter>-hooks/samples/*.json against the live adapter in an isolated sandbox. " +
|
|
204
242
|
"Exits non-zero if any sample crashes the adapter.")
|
|
205
243
|
.option("--sample <path>", "Replay only the named sample file (basename match). Implies --replay-samples.")
|
|
206
244
|
.action((id, opts) => {
|
|
207
|
-
|
|
245
|
+
runAdapterProbe(id, opts);
|
|
208
246
|
});
|
|
209
247
|
cmd
|
|
210
248
|
.command("heal")
|
|
@@ -226,7 +264,6 @@ export function registerAgentsCommand(program, emitParam) {
|
|
|
226
264
|
.action((opts) => {
|
|
227
265
|
runHeal(opts);
|
|
228
266
|
});
|
|
229
|
-
registerCouncilCommands(cmd);
|
|
230
267
|
registerIdentityCommands(cmd);
|
|
231
268
|
}
|
|
232
269
|
function registerIdentityCommands(parent) {
|
|
@@ -368,7 +405,7 @@ function runIdentityAssume(target, opts) {
|
|
|
368
405
|
process.exit(1);
|
|
369
406
|
}
|
|
370
407
|
}
|
|
371
|
-
function registerCouncilCommands(parent) {
|
|
408
|
+
export function registerCouncilCommands(parent) {
|
|
372
409
|
const council = parent
|
|
373
410
|
.command("council")
|
|
374
411
|
.description("Multi-agent deliberation: convene a temporary group around an " +
|
|
@@ -453,7 +490,7 @@ function registerCouncilCommands(parent) {
|
|
|
453
490
|
"(or omit [steward]) to drop the field and revert to the default " +
|
|
454
491
|
"(the convener). Refuses to mutate archived councils. By default, " +
|
|
455
492
|
"rejects names not in the known-agents list (active heartbeats + " +
|
|
456
|
-
"
|
|
493
|
+
"journals archived in the last 30 days); pass --allow-unknown " +
|
|
457
494
|
"to bypass when bootstrapping.")
|
|
458
495
|
.option("--clear", "Clear the steward field, reverting to created_by default")
|
|
459
496
|
.option("--allow-unknown", "Skip the known-agents check (bootstrap an agent that hasn't run yet)")
|
|
@@ -467,7 +504,7 @@ function registerCouncilCommands(parent) {
|
|
|
467
504
|
"Pass either --message <inline> or --file <path>. Writes to " +
|
|
468
505
|
".harnery/councils/<id>/round-<N>/<agent-Name>.md. Pass --as <member> " +
|
|
469
506
|
"to contribute under a council seat name that differs from the running " +
|
|
470
|
-
"agent's heartbeat name (useful for cross-
|
|
507
|
+
"agent's heartbeat name (useful for cross-adapter councils where each " +
|
|
471
508
|
"reviewer has a different auto-generated session name).")
|
|
472
509
|
.option("--message <text>", "Inline contribution text (caps at 4KB)")
|
|
473
510
|
.option("--file <path>", "Path to a file containing the contribution")
|
|
@@ -536,7 +573,7 @@ function runWhoami(opts) {
|
|
|
536
573
|
if (!hb) {
|
|
537
574
|
emit.error({
|
|
538
575
|
code: "no_heartbeat",
|
|
539
|
-
message:
|
|
576
|
+
message: noHeartbeatMessage(myOwner),
|
|
540
577
|
});
|
|
541
578
|
process.exit(1);
|
|
542
579
|
}
|
|
@@ -720,6 +757,42 @@ function normalizeKind(kind) {
|
|
|
720
757
|
return "unknown";
|
|
721
758
|
return kind;
|
|
722
759
|
}
|
|
760
|
+
/**
|
|
761
|
+
* The `no_heartbeat` diagnostic, quoting the owner id in FULL.
|
|
762
|
+
*
|
|
763
|
+
* This id is actionable: the reader's next move is `agents heal --kind
|
|
764
|
+
* heartbeat --owner <id>`, and heartbeats are keyed by the whole
|
|
765
|
+
* `instance_id` (`.harnery/active/<instance_id>.json`). An abbreviated id
|
|
766
|
+
* here reads as complete, so it gets copy-pasted into `--owner` and mints a
|
|
767
|
+
* heartbeat at a filename no reader resolves — an orphan that leaves the
|
|
768
|
+
* session looking unhealable. Abbreviate ids for display elsewhere, never in
|
|
769
|
+
* a message whose whole purpose is to hand the reader an id to pass back.
|
|
770
|
+
*/
|
|
771
|
+
function noHeartbeatMessage(owner) {
|
|
772
|
+
return `resolved owner=${owner} but no heartbeat exists at .harnery/active/${owner}.json`;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* The instance_id of a live heartbeat that `prefix` strictly prefixes, or null.
|
|
776
|
+
*
|
|
777
|
+
* Used to recognize an abbreviated id handed back by a reader when the caller
|
|
778
|
+
* supplied no canonical id of their own. Ambiguity is treated as "no answer":
|
|
779
|
+
* two live sessions sharing the prefix means we cannot name the one intended,
|
|
780
|
+
* and refusing with the wrong id in the message would be worse than the orphan.
|
|
781
|
+
*/
|
|
782
|
+
function liveIdWithPrefix(root, prefix) {
|
|
783
|
+
const activeDir = resolve(root, ".harnery", "active");
|
|
784
|
+
if (!existsSync(activeDir))
|
|
785
|
+
return null;
|
|
786
|
+
const matches = new Set();
|
|
787
|
+
for (const file of readdirSync(activeDir)) {
|
|
788
|
+
if (!file.endsWith(".json"))
|
|
789
|
+
continue;
|
|
790
|
+
const id = file.slice(0, -".json".length);
|
|
791
|
+
if (id !== prefix && id.startsWith(prefix))
|
|
792
|
+
matches.add(id);
|
|
793
|
+
}
|
|
794
|
+
return matches.size === 1 ? matches.values().next().value : null;
|
|
795
|
+
}
|
|
723
796
|
async function runWatch(pollMs) {
|
|
724
797
|
const root = monorepoRoot();
|
|
725
798
|
if (!root) {
|
|
@@ -1011,8 +1084,8 @@ function ensureCursorSession(root) {
|
|
|
1011
1084
|
const sessionId = cursorEnvSessionId();
|
|
1012
1085
|
if (!sessionId)
|
|
1013
1086
|
return;
|
|
1014
|
-
const agentHook =
|
|
1015
|
-
if (!
|
|
1087
|
+
const agentHook = coordBinPath("agent-hook", root);
|
|
1088
|
+
if (!agentHook)
|
|
1016
1089
|
return;
|
|
1017
1090
|
const payload = JSON.stringify({
|
|
1018
1091
|
conversation_id: sessionId,
|
|
@@ -1023,7 +1096,7 @@ function ensureCursorSession(root) {
|
|
|
1023
1096
|
composer_mode: "agent",
|
|
1024
1097
|
is_background_agent: false,
|
|
1025
1098
|
});
|
|
1026
|
-
spawnSync("bash", [agentHook, "session-start", "--
|
|
1099
|
+
spawnSync("bash", [agentHook, "session-start", "--adapter", "cursor"], {
|
|
1027
1100
|
input: payload,
|
|
1028
1101
|
cwd: root,
|
|
1029
1102
|
encoding: "utf8",
|
|
@@ -1059,7 +1132,7 @@ function runReleaseClaim(path) {
|
|
|
1059
1132
|
let canonical = path;
|
|
1060
1133
|
if (path.startsWith(`${root}/`))
|
|
1061
1134
|
canonical = path.slice(root.length + 1);
|
|
1062
|
-
const helper =
|
|
1135
|
+
const helper = agentCoordOrExit(root);
|
|
1063
1136
|
const result = spawnSync(helper, ["release-claim", myOwner, canonical], {
|
|
1064
1137
|
encoding: "utf8",
|
|
1065
1138
|
...coordHelperOpts(root),
|
|
@@ -1067,7 +1140,7 @@ function runReleaseClaim(path) {
|
|
|
1067
1140
|
if (result.status !== 0) {
|
|
1068
1141
|
emit.error({
|
|
1069
1142
|
code: "release_claim_failed",
|
|
1070
|
-
message: result
|
|
1143
|
+
message: spawnFailureMessage(result, "agent-coord"),
|
|
1071
1144
|
});
|
|
1072
1145
|
process.exit(1);
|
|
1073
1146
|
}
|
|
@@ -1105,7 +1178,7 @@ function runSetTask(task, opts) {
|
|
|
1105
1178
|
const priorHb = readHeartbeat(myOwner);
|
|
1106
1179
|
const firstOfSession = !priorHb?.task_updated_at;
|
|
1107
1180
|
// Heartbeat mutation goes through agent-coord (atomic temp+rename).
|
|
1108
|
-
const helper =
|
|
1181
|
+
const helper = agentCoordOrExit(root);
|
|
1109
1182
|
const result = spawnSync(helper, ["set-task", myOwner, task], {
|
|
1110
1183
|
encoding: "utf8",
|
|
1111
1184
|
...coordHelperOpts(root),
|
|
@@ -1113,7 +1186,7 @@ function runSetTask(task, opts) {
|
|
|
1113
1186
|
if (result.status !== 0) {
|
|
1114
1187
|
emit.error({
|
|
1115
1188
|
code: "set_task_failed",
|
|
1116
|
-
message: result
|
|
1189
|
+
message: spawnFailureMessage(result, "agent-coord"),
|
|
1117
1190
|
});
|
|
1118
1191
|
process.exit(1);
|
|
1119
1192
|
}
|
|
@@ -1122,11 +1195,11 @@ function runSetTask(task, opts) {
|
|
|
1122
1195
|
type: "state.task_set",
|
|
1123
1196
|
owner: myOwner,
|
|
1124
1197
|
session: hb?.session_id ?? myOwner,
|
|
1125
|
-
|
|
1198
|
+
adapter: normalizeAdapter(hb?.platform),
|
|
1126
1199
|
data: { task, cleared: !task || task.length === 0 },
|
|
1127
1200
|
});
|
|
1128
1201
|
// On the first focus declaration of a session, surface a suggested session
|
|
1129
|
-
// name for the operator to set as their
|
|
1202
|
+
// name for the operator to set as their adapter tab title. Read the result
|
|
1130
1203
|
// (`suggested_session_name`) and reproduce it in a fenced code block so the
|
|
1131
1204
|
// UI's Copy button hands over the exact string. null on every later call.
|
|
1132
1205
|
const built = firstOfSession && !opts?.sessionId ? buildSuggestedName(hb?.name ?? "unknown", [task]) : null;
|
|
@@ -1231,7 +1304,7 @@ function runStatus(opts) {
|
|
|
1231
1304
|
if (!hb) {
|
|
1232
1305
|
emit.error({
|
|
1233
1306
|
code: "no_heartbeat",
|
|
1234
|
-
message:
|
|
1307
|
+
message: noHeartbeatMessage(myOwner),
|
|
1235
1308
|
});
|
|
1236
1309
|
process.exit(1);
|
|
1237
1310
|
}
|
|
@@ -1240,7 +1313,7 @@ function runStatus(opts) {
|
|
|
1240
1313
|
// populated for back-compat with consumers reading v1 directly. The stamp
|
|
1241
1314
|
// goes through agent-coord (atomic write).
|
|
1242
1315
|
try {
|
|
1243
|
-
const helper =
|
|
1316
|
+
const helper = agentCoordOrExit(root);
|
|
1244
1317
|
spawnSync(helper, ["stamp-status-call", myOwner], {
|
|
1245
1318
|
encoding: "utf8",
|
|
1246
1319
|
timeout: 2000,
|
|
@@ -1254,7 +1327,7 @@ function runStatus(opts) {
|
|
|
1254
1327
|
type: "state.status_checked",
|
|
1255
1328
|
owner: myOwner,
|
|
1256
1329
|
session: hb.session_id ?? myOwner,
|
|
1257
|
-
|
|
1330
|
+
adapter: normalizeAdapter(hb.platform),
|
|
1258
1331
|
data: {
|
|
1259
1332
|
format: opts.json ? "json" : "box",
|
|
1260
1333
|
agent_count: 0, // computed below, not yet available here; Phase 5 verdict reads owner-scope only
|
|
@@ -1721,14 +1794,14 @@ function readCanonicalEventsInWindow(root, cutoffMs) {
|
|
|
1721
1794
|
}
|
|
1722
1795
|
return out;
|
|
1723
1796
|
}
|
|
1724
|
-
/**
|
|
1797
|
+
/** adapter ("claude-code") → legacy platform label ("claude_code") so the
|
|
1725
1798
|
* existing formatPlatformLabel rendering keeps working unchanged. */
|
|
1726
|
-
function
|
|
1727
|
-
if (
|
|
1799
|
+
function adapterToPlatform(adapter) {
|
|
1800
|
+
if (adapter === "claude-code")
|
|
1728
1801
|
return "claude_code";
|
|
1729
|
-
if (
|
|
1802
|
+
if (adapter === "cursor")
|
|
1730
1803
|
return "cursor";
|
|
1731
|
-
if (
|
|
1804
|
+
if (adapter === "codex")
|
|
1732
1805
|
return "codex";
|
|
1733
1806
|
return "claude_code";
|
|
1734
1807
|
}
|
|
@@ -1750,7 +1823,7 @@ function canonicalToHealEvent(ev, nameById) {
|
|
|
1750
1823
|
agent,
|
|
1751
1824
|
kind,
|
|
1752
1825
|
reason,
|
|
1753
|
-
platform:
|
|
1826
|
+
platform: adapterToPlatform(ev.adapter),
|
|
1754
1827
|
};
|
|
1755
1828
|
if (kind === "pidmap" && data.pid !== undefined && data.pid !== null) {
|
|
1756
1829
|
out.pid = String(data.pid);
|
|
@@ -2508,14 +2581,14 @@ function renderHealthBox(report) {
|
|
|
2508
2581
|
}
|
|
2509
2582
|
}
|
|
2510
2583
|
}
|
|
2511
|
-
function
|
|
2584
|
+
function runAdapterProbe(id, opts) {
|
|
2512
2585
|
if (opts.json)
|
|
2513
2586
|
emit.config({ format: "json" });
|
|
2514
|
-
const
|
|
2515
|
-
if (
|
|
2587
|
+
const adapter = id.trim();
|
|
2588
|
+
if (adapter !== "claude_code" && adapter !== "cursor") {
|
|
2516
2589
|
emit.error({
|
|
2517
|
-
code: "
|
|
2518
|
-
message: "
|
|
2590
|
+
code: "bad_adapter",
|
|
2591
|
+
message: "adapter id must be claude_code or cursor",
|
|
2519
2592
|
});
|
|
2520
2593
|
process.exit(1);
|
|
2521
2594
|
}
|
|
@@ -2527,13 +2600,13 @@ function runHarnessProbe(id, opts) {
|
|
|
2527
2600
|
});
|
|
2528
2601
|
process.exit(1);
|
|
2529
2602
|
}
|
|
2530
|
-
const subagentDir =
|
|
2531
|
-
const sampleDir =
|
|
2532
|
-
const dispatchEntry =
|
|
2533
|
-
? "harnery/bin/agent-hook session-start --
|
|
2534
|
-
: "harnery/bin/agent-hook session-start --
|
|
2603
|
+
const subagentDir = adapter === "cursor" ? ".harnery/.cursor-subagent-map" : `.harnery/.subagent-map/${adapter}`;
|
|
2604
|
+
const sampleDir = adapter === "cursor" ? "docs/api/cursor-hooks/samples" : "docs/api/claude-code-hooks/samples";
|
|
2605
|
+
const dispatchEntry = adapter === "cursor"
|
|
2606
|
+
? "harnery/bin/agent-hook session-start --adapter cursor"
|
|
2607
|
+
: "harnery/bin/agent-hook session-start --adapter claude-code";
|
|
2535
2608
|
// TS-native probe. The owner + anchor-pid resolution it reports lives in
|
|
2536
|
-
// `
|
|
2609
|
+
// `findAdapterAnchorPid` (core/hooks/cli.ts, the /proc walk mirrored below)
|
|
2537
2610
|
// and `resolveOwner` here, so the probe reports exactly what the live hot
|
|
2538
2611
|
// path resolves.
|
|
2539
2612
|
const anchorTokens = new Set(["claude", "claude-code", "cursor", "codex"]);
|
|
@@ -2573,7 +2646,7 @@ function runHarnessProbe(id, opts) {
|
|
|
2573
2646
|
walkPid = ppid;
|
|
2574
2647
|
}
|
|
2575
2648
|
const data = {
|
|
2576
|
-
|
|
2649
|
+
adapter,
|
|
2577
2650
|
anchor_pid: anchorPid,
|
|
2578
2651
|
hook_pid: String(process.pid),
|
|
2579
2652
|
resolved_owner: resolveOwner() ?? "",
|
|
@@ -2581,13 +2654,13 @@ function runHarnessProbe(id, opts) {
|
|
|
2581
2654
|
subagent_map_dir: subagentDir,
|
|
2582
2655
|
sample_ref: sampleDir,
|
|
2583
2656
|
dispatch_entry: dispatchEntry,
|
|
2584
|
-
note: "heal-events counts drift;
|
|
2657
|
+
note: "heal-events counts drift; adapter-probe answers wiring",
|
|
2585
2658
|
};
|
|
2586
2659
|
const wantReplay = opts.replaySamples || !!opts.sample;
|
|
2587
2660
|
let samples = [];
|
|
2588
2661
|
let replayExitCode = 0;
|
|
2589
2662
|
if (wantReplay) {
|
|
2590
|
-
const result =
|
|
2663
|
+
const result = replayAdapterSamples(adapter, root, sampleDir, opts.sample);
|
|
2591
2664
|
samples = result.samples;
|
|
2592
2665
|
replayExitCode = result.exitCode;
|
|
2593
2666
|
data.samples = samples;
|
|
@@ -2596,7 +2669,7 @@ function runHarnessProbe(id, opts) {
|
|
|
2596
2669
|
emit.data(data);
|
|
2597
2670
|
if (process.stdout.isTTY && !opts.json) {
|
|
2598
2671
|
const lines = [
|
|
2599
|
-
`
|
|
2672
|
+
`Adapter probe: ${adapter}`,
|
|
2600
2673
|
` anchor_pid: ${String(data.anchor_pid) || "(empty, expected in sandbox/non-IDE)"}`,
|
|
2601
2674
|
` hook_pid: ${String(data.hook_pid)}`,
|
|
2602
2675
|
` resolved_owner: ${String(data.resolved_owner) || "(none)"}`,
|
|
@@ -2636,11 +2709,11 @@ function runHarnessProbe(id, opts) {
|
|
|
2636
2709
|
}
|
|
2637
2710
|
}
|
|
2638
2711
|
/**
|
|
2639
|
-
* Replay every JSON fixture in <root>/<sampleDir> against the live
|
|
2712
|
+
* Replay every JSON fixture in <root>/<sampleDir> against the live adapter
|
|
2640
2713
|
* dispatcher in an isolated sandbox.
|
|
2641
2714
|
*
|
|
2642
2715
|
* Sandbox isolation strategy:
|
|
2643
|
-
* - mkdtempSync(tmpdir(), "harn-
|
|
2716
|
+
* - mkdtempSync(tmpdir(), "harn-adapter-probe-") creates a non-git tmp dir.
|
|
2644
2717
|
* - The dispatcher's coord-root resolution falls back to
|
|
2645
2718
|
* `HARNERY_COORD_ROOT_OVERRIDE` when git rev-parse fails. We set it to the sandbox.
|
|
2646
2719
|
* - We rewrite the payload's `cwd` field (Cursor cds to it) to the sandbox,
|
|
@@ -2652,7 +2725,7 @@ function runHarnessProbe(id, opts) {
|
|
|
2652
2725
|
* payload with `.hook_event_name`. Event name resolution falls back to the
|
|
2653
2726
|
* filename (without `.json`) when neither field exists.
|
|
2654
2727
|
*/
|
|
2655
|
-
function
|
|
2728
|
+
function replayAdapterSamples(adapter, root, relativeSampleDir, filter) {
|
|
2656
2729
|
const sampleDir = resolve(root, relativeSampleDir);
|
|
2657
2730
|
if (!existsSync(sampleDir)) {
|
|
2658
2731
|
return {
|
|
@@ -2673,7 +2746,7 @@ function replayHarnessSamples(harness, root, relativeSampleDir, filter) {
|
|
|
2673
2746
|
};
|
|
2674
2747
|
}
|
|
2675
2748
|
// agent-hook is the single entry point. Replay sample payloads against it,
|
|
2676
|
-
// mapping the
|
|
2749
|
+
// mapping the adapter-native hook_event_name to the agent-hook CLI subcommand.
|
|
2677
2750
|
const agentHook = resolve(root, "harnery/bin/agent-hook");
|
|
2678
2751
|
if (!existsSync(agentHook)) {
|
|
2679
2752
|
return {
|
|
@@ -2711,8 +2784,8 @@ function replayHarnessSamples(harness, root, relativeSampleDir, filter) {
|
|
|
2711
2784
|
stopFailure: "stop-failure",
|
|
2712
2785
|
StopFailure: "stop-failure",
|
|
2713
2786
|
};
|
|
2714
|
-
const
|
|
2715
|
-
const sandbox = mkdtempSync(join(tmpdir(), "harn-
|
|
2787
|
+
const adapterFlag = adapter === "claude_code" ? "claude-code" : adapter;
|
|
2788
|
+
const sandbox = mkdtempSync(join(tmpdir(), "harn-adapter-probe-"));
|
|
2716
2789
|
const results = [];
|
|
2717
2790
|
try {
|
|
2718
2791
|
for (const file of fixtures) {
|
|
@@ -2749,7 +2822,7 @@ function replayHarnessSamples(harness, root, relativeSampleDir, filter) {
|
|
|
2749
2822
|
payloadObj.workspace_roots = [sandbox];
|
|
2750
2823
|
}
|
|
2751
2824
|
const subcommand = EVENT_SUBCOMMAND[event] ?? event;
|
|
2752
|
-
const dispatch = spawnSync("bash", [agentHook, subcommand, "--
|
|
2825
|
+
const dispatch = spawnSync("bash", [agentHook, subcommand, "--adapter", adapterFlag], {
|
|
2753
2826
|
cwd: sandbox,
|
|
2754
2827
|
encoding: "utf8",
|
|
2755
2828
|
input: JSON.stringify(payloadObj),
|
|
@@ -2757,8 +2830,8 @@ function replayHarnessSamples(harness, root, relativeSampleDir, filter) {
|
|
|
2757
2830
|
env: {
|
|
2758
2831
|
...process.env,
|
|
2759
2832
|
HARNERY_COORD_ROOT_OVERRIDE: sandbox,
|
|
2760
|
-
|
|
2761
|
-
HARNERY_AGENT_COORD_PLATFORM:
|
|
2833
|
+
HARNERY_AGENT_COORD_ADAPTER: adapter,
|
|
2834
|
+
HARNERY_AGENT_COORD_PLATFORM: adapter,
|
|
2762
2835
|
HARNERY_AGENT_COORD_OFF: "0",
|
|
2763
2836
|
},
|
|
2764
2837
|
});
|
|
@@ -2893,8 +2966,8 @@ function runPing(name, message, opts) {
|
|
|
2893
2966
|
peer_instance_id: peerOwner,
|
|
2894
2967
|
from: fromName,
|
|
2895
2968
|
body,
|
|
2896
|
-
|
|
2897
|
-
|
|
2969
|
+
journal_path: doc.path,
|
|
2970
|
+
journal_bytes: doc.bytes,
|
|
2898
2971
|
};
|
|
2899
2972
|
if (opts.json) {
|
|
2900
2973
|
emit.config({ format: "json" });
|
|
@@ -3024,6 +3097,41 @@ function runHeal(opts) {
|
|
|
3024
3097
|
process.exit(1);
|
|
3025
3098
|
}
|
|
3026
3099
|
const action = kind === "pidmap" ? "heal-pidmap" : kind === "heartbeat" ? "heal-heartbeat" : "kill-heartbeat";
|
|
3100
|
+
// Refuse to mint a heartbeat at a TRUNCATED owner id.
|
|
3101
|
+
//
|
|
3102
|
+
// Heartbeats are keyed by the whole instance_id, so healing at an
|
|
3103
|
+
// abbreviated id writes `.harnery/active/<prefix>.json` while every reader
|
|
3104
|
+
// (`status`, `set-task`, `whoami`) resolves `<instance_id>.json`. The heal
|
|
3105
|
+
// reports success, the session stays broken, and an orphan file is left
|
|
3106
|
+
// behind that the singleton fallback can then mis-resolve other callers to.
|
|
3107
|
+
//
|
|
3108
|
+
// A distinct instance_id (subagent, workflow child) is never a prefix of its
|
|
3109
|
+
// own session_id, so a strict prefix is unambiguously an abbreviated id
|
|
3110
|
+
// rather than a legitimately different owner. Only guard the create path: an
|
|
3111
|
+
// existing heartbeat at `owner` means the id is real, whatever its shape.
|
|
3112
|
+
//
|
|
3113
|
+
// Two sources for the canonical id, because the reported failure arrives
|
|
3114
|
+
// without `--session-id`: someone copies a truncated id out of a diagnostic
|
|
3115
|
+
// and passes it as `--owner` alone. Comparing against `--session-id` alone
|
|
3116
|
+
// therefore misses the exact path that produced the orphan; a live heartbeat
|
|
3117
|
+
// whose instance_id this id is a prefix of settles it just as well, and is
|
|
3118
|
+
// present in precisely the case that matters (the session the reader was
|
|
3119
|
+
// trying to heal is registered, just not under the abbreviated name).
|
|
3120
|
+
if (kind === "heartbeat" && !readHeartbeat(owner)) {
|
|
3121
|
+
const canonical = opts.sessionId && opts.sessionId.trim() !== owner && opts.sessionId.trim().startsWith(owner)
|
|
3122
|
+
? opts.sessionId.trim()
|
|
3123
|
+
: liveIdWithPrefix(root, owner);
|
|
3124
|
+
if (canonical) {
|
|
3125
|
+
const source = opts.sessionId?.trim() === canonical ? "--session-id" : "a live heartbeat";
|
|
3126
|
+
emit.error({
|
|
3127
|
+
code: "truncated_owner",
|
|
3128
|
+
message: `--owner ${owner} is a prefix of ${canonical} (${source}), and no heartbeat exists ` +
|
|
3129
|
+
`at .harnery/active/${owner}.json. Healing here would create a heartbeat no reader ` +
|
|
3130
|
+
`resolves. Re-run with --owner ${canonical}.`,
|
|
3131
|
+
});
|
|
3132
|
+
process.exit(1);
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3027
3135
|
// Build positional args. agent-coord's arg layout:
|
|
3028
3136
|
// heal-pidmap <instance_id> [<pid>]
|
|
3029
3137
|
// heal-heartbeat <instance_id> [<session_id>]
|
|
@@ -3034,8 +3142,8 @@ function runHeal(opts) {
|
|
|
3034
3142
|
if (kind === "heartbeat" && opts.sessionId)
|
|
3035
3143
|
helperArgs.push(opts.sessionId);
|
|
3036
3144
|
// heal-pidmap / heal-heartbeat / kill-heartbeat are handled by the
|
|
3037
|
-
// agent-coord binary
|
|
3038
|
-
const helper =
|
|
3145
|
+
// bundled agent-coord binary.
|
|
3146
|
+
const helper = agentCoordOrExit(root);
|
|
3039
3147
|
const proc = spawnSync(helper, helperArgs, {
|
|
3040
3148
|
encoding: "utf8",
|
|
3041
3149
|
...coordHelperOpts(root),
|
|
@@ -3043,7 +3151,7 @@ function runHeal(opts) {
|
|
|
3043
3151
|
if (proc.status !== 0) {
|
|
3044
3152
|
emit.error({
|
|
3045
3153
|
code: "heal_failed",
|
|
3046
|
-
message: proc
|
|
3154
|
+
message: spawnFailureMessage(proc, `agent-coord ${action}`),
|
|
3047
3155
|
});
|
|
3048
3156
|
process.exit(1);
|
|
3049
3157
|
}
|
|
@@ -3078,7 +3186,10 @@ function runHeal(opts) {
|
|
|
3078
3186
|
],
|
|
3079
3187
|
meta: {
|
|
3080
3188
|
kind,
|
|
3081
|
-
|
|
3189
|
+
// The path actually spawned, not a guess at the layout: the helper is
|
|
3190
|
+
// resolved from harnery's own package location, which differs between a
|
|
3191
|
+
// submodule, an installed dependency, and a standalone checkout.
|
|
3192
|
+
helper,
|
|
3082
3193
|
},
|
|
3083
3194
|
});
|
|
3084
3195
|
if (!opts.json) {
|
|
@@ -3109,7 +3220,7 @@ function emitCouncilStateEvent(type, manifest, extraData) {
|
|
|
3109
3220
|
type,
|
|
3110
3221
|
owner: myOwner,
|
|
3111
3222
|
session: hb?.session_id ?? myOwner,
|
|
3112
|
-
|
|
3223
|
+
adapter: normalizeAdapter(hb?.platform),
|
|
3113
3224
|
data: { council_id: manifest.council_id, ...extraData },
|
|
3114
3225
|
});
|
|
3115
3226
|
}
|
|
@@ -3214,7 +3325,7 @@ function runCouncilCreate(objective, opts) {
|
|
|
3214
3325
|
type: "council.open",
|
|
3215
3326
|
owner: myOwner,
|
|
3216
3327
|
session: myHbForEmit?.session_id ?? myOwner,
|
|
3217
|
-
|
|
3328
|
+
adapter: normalizeAdapter(myHbForEmit?.platform),
|
|
3218
3329
|
data: {
|
|
3219
3330
|
council_id: councilId,
|
|
3220
3331
|
topic: trimmedObjective,
|
|
@@ -3223,7 +3334,7 @@ function runCouncilCreate(objective, opts) {
|
|
|
3223
3334
|
},
|
|
3224
3335
|
});
|
|
3225
3336
|
}
|
|
3226
|
-
// Best-effort: ping each currently-active member's
|
|
3337
|
+
// Best-effort: ping each currently-active member's journal with a
|
|
3227
3338
|
// handoff entry pointing them at the council. Members not currently active
|
|
3228
3339
|
// get nothing here; the Phase 2 SessionStart adapter will surface the
|
|
3229
3340
|
// invite on their next session.
|
|
@@ -3646,7 +3757,7 @@ function runCouncilSetSteward(id, stewardArg, opts) {
|
|
|
3646
3757
|
const known_names = known.map((a) => a.name).join(", ") || "(none)";
|
|
3647
3758
|
emit.error({
|
|
3648
3759
|
code: "steward_not_known",
|
|
3649
|
-
message: `'${steward}' is not a known agent (active heartbeats +
|
|
3760
|
+
message: `'${steward}' is not a known agent (active heartbeats + journals archived in the last 30 days). Pass --allow-unknown to bootstrap. Known: ${known_names}`,
|
|
3650
3761
|
});
|
|
3651
3762
|
process.exit(1);
|
|
3652
3763
|
}
|
|
@@ -3679,7 +3790,7 @@ function runCouncilSetSteward(id, stewardArg, opts) {
|
|
|
3679
3790
|
emit.text(`council ${next.council_id} steward set to ${label}.\n`);
|
|
3680
3791
|
}
|
|
3681
3792
|
}
|
|
3682
|
-
/** Build a markdown
|
|
3793
|
+
/** Build a markdown journal of every round's contributions on disk. */
|
|
3683
3794
|
function buildTranscript(manifest) {
|
|
3684
3795
|
const body = councilBodyDir(manifest.council_id);
|
|
3685
3796
|
const out = [];
|
|
@@ -3749,7 +3860,7 @@ function runCouncilContribute(id, opts) {
|
|
|
3749
3860
|
}
|
|
3750
3861
|
// Resolve the contributor name. Two paths:
|
|
3751
3862
|
// 1. --as <member> override: caller explicitly names the council seat. Used
|
|
3752
|
-
// for cross-
|
|
3863
|
+
// for cross-adapter councils where each reviewer agent has a different
|
|
3753
3864
|
// auto-generated session name from a different name pool; they can
|
|
3754
3865
|
// contribute under a fixed seat name without renaming the session.
|
|
3755
3866
|
// 2. Heartbeat-derived (default): resolve owner via ppid walk + read the
|
|
@@ -3792,7 +3903,7 @@ function runCouncilContribute(id, opts) {
|
|
|
3792
3903
|
if (!myHb?.name) {
|
|
3793
3904
|
emit.error({
|
|
3794
3905
|
code: "no_self_name",
|
|
3795
|
-
message: `resolved owner ${myOwner
|
|
3906
|
+
message: `resolved owner ${myOwner} has no name on heartbeat (pass --as <member> to override)`,
|
|
3796
3907
|
});
|
|
3797
3908
|
process.exit(1);
|
|
3798
3909
|
}
|
|
@@ -3936,7 +4047,7 @@ function runCouncilPrompt(id, member, opts) {
|
|
|
3936
4047
|
process.exit(1);
|
|
3937
4048
|
}
|
|
3938
4049
|
// Resolve caller identity (steward authority check). Same --as override
|
|
3939
|
-
// shape as `contribute` for cross-
|
|
4050
|
+
// shape as `contribute` for cross-adapter scripting.
|
|
3940
4051
|
let callerName;
|
|
3941
4052
|
let actualName = null;
|
|
3942
4053
|
if (opts.as) {
|
|
@@ -4142,7 +4253,7 @@ function runCouncilAdvance(id, opts) {
|
|
|
4142
4253
|
* Shared advance helper used by both `advance` and auto-advance from
|
|
4143
4254
|
* `contribute`. Increments current_round, flips round_status back to open,
|
|
4144
4255
|
* creates the new round directory, writes the manifest, and pings each
|
|
4145
|
-
* member's
|
|
4256
|
+
* member's journal with the advance notification.
|
|
4146
4257
|
*/
|
|
4147
4258
|
function advanceCouncil(manifest, force) {
|
|
4148
4259
|
const nextRound = manifest.current_round + 1;
|
|
@@ -4156,7 +4267,7 @@ function advanceCouncil(manifest, force) {
|
|
|
4156
4267
|
if (rd && !existsSync(rd))
|
|
4157
4268
|
mkdirSync(rd, { recursive: true });
|
|
4158
4269
|
writeManifest(next);
|
|
4159
|
-
// Ping each member's
|
|
4270
|
+
// Ping each member's journal with the advance notification.
|
|
4160
4271
|
// (Convener already knows; we skip pinging them if they convened it from
|
|
4161
4272
|
// their own session.)
|
|
4162
4273
|
const myOwner = resolveOwner();
|
|
@@ -4172,7 +4283,7 @@ function advanceCouncil(manifest, force) {
|
|
|
4172
4283
|
appendEntry(memberOwner, "handoff", `from council advance (${manifest.council_id}): round ${nextRound} is now open${force ? " (advanced with --force; some round-N members dropped)" : ""}. Run 'harn agents council show ${manifest.council_id}' to read prior round + 'harn agents council contribute ${manifest.council_id}' to weigh in.`);
|
|
4173
4284
|
}
|
|
4174
4285
|
catch {
|
|
4175
|
-
/* best-effort; member
|
|
4286
|
+
/* best-effort; member journal may not exist yet */
|
|
4176
4287
|
}
|
|
4177
4288
|
}
|
|
4178
4289
|
return next;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.js";
|
|
3
|
+
export declare function registerArtifactsCommand(program: Command, emit: EmitContext, context?: HarneryProgramContext): void;
|
|
4
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAa1E,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAmGN"}
|