harnery 0.29.0 → 0.31.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 +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 +61 -60
- 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/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 +193 -23
- 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 +2 -1
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +55 -25
- 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 +28 -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 +4 -4
- package/dist/core/agents/canonical-emit.js +5 -5
- 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-client.d.ts +21 -2
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +122 -27
- 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/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 +71 -51
- package/dist/core/governor/plan-types.d.ts +181 -0
- 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 +143 -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 +290 -116
- 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 +175 -151
- 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 +17 -17
- 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 +3 -3
- package/dist/core/hooks/resolve/coord-root.js +4 -4
- 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/runner.d.ts.map +1 -1
- package/dist/core/work/runner.js +11 -2
- package/dist/core/work/state.d.ts +28 -3
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +148 -16
- 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 +151 -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 +3 -2
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +2 -1
- package/dist/core/workflow/proof.d.ts +28 -5
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +77 -34
- 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 +28 -8
- 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 +26 -8
- 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 +27 -8
- package/dist/core/workflow/spawn-failure.d.ts +15 -1
- package/dist/core/workflow/spawn-failure.d.ts.map +1 -1
- package/dist/core/workflow/spawn-failure.js +35 -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 +119 -46
- 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/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/exec.d.ts +7 -0
- package/dist/lib/exec.d.ts.map +1 -1
- package/dist/lib/exec.js +6 -3
- 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 +71 -64
- 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/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 +237 -34
- package/src/commands/web-fetch.ts +1 -1
- package/src/commands/web.ts +56 -1
- package/src/commands/work.ts +72 -38
- 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 +28 -23
- package/src/core/agents/canonical-emit.ts +6 -6
- 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-client.ts +119 -28
- package/src/core/agents/events/consume.ts +1 -1
- package/src/core/agents/events/emit.ts +7 -6
- 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 +120 -96
- package/src/core/{supervisor → governor}/plan-types.ts +64 -50
- package/src/core/{supervisor → governor}/planning.ts +240 -188
- 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 +389 -174
- 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 +185 -162
- package/src/core/hooks/effects/image-capture.ts +6 -6
- package/src/core/hooks/effects/index.ts +17 -17
- 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 +4 -4
- 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/runner.ts +11 -2
- package/src/core/work/state.ts +185 -21
- 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 +166 -90
- package/src/core/workflow/evidence-preflight.ts +165 -0
- package/src/core/workflow/index.ts +6 -3
- package/src/core/workflow/proof.ts +94 -48
- 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 +34 -12
- package/src/core/workflow/spawn-codex.ts +30 -12
- package/src/core/workflow/spawn-cursor.ts +31 -12
- package/src/core/workflow/spawn-failure.ts +41 -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 +130 -46
- 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/council/index.ts +9 -9
- package/src/lib/exec.ts +13 -3
- 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 +0 -170
- 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
|
@@ -10,12 +10,19 @@
|
|
|
10
10
|
* files), so they compile into `dist/` and resolve identically under Bun and
|
|
11
11
|
* Node — no `files`-field copy or package-path guesswork.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { JOURNAL_CATEGORIES } from "../../core/journal/index.js";
|
|
14
14
|
import { buildOwnedSkill } from "./splice.js";
|
|
15
15
|
/** Managed-region name for the AGENTS.md orientation block. */
|
|
16
16
|
export const INSTRUCTIONS_REGION = "instructions";
|
|
17
17
|
/** Managed-region name for the CLAUDE.md `@AGENTS.md` import shim. */
|
|
18
18
|
export const IMPORT_REGION = "import";
|
|
19
|
+
/**
|
|
20
|
+
* Managed-region name for the consumer's own coordination policy, spliced from
|
|
21
|
+
* the file named by `instructions.hostAddendumFile`. Harnery places and
|
|
22
|
+
* versions the region; the content is the host's and is never rendered here.
|
|
23
|
+
* See `host-addendum.ts`.
|
|
24
|
+
*/
|
|
25
|
+
export const HOST_ADDENDUM_REGION = "host-addendum";
|
|
19
26
|
/**
|
|
20
27
|
* The always-on orientation spliced into `AGENTS.md`. Target ≤ 80 rendered
|
|
21
28
|
* lines: it costs every agent context on every turn, so it states that each
|
|
@@ -24,7 +31,7 @@ export const IMPORT_REGION = "import";
|
|
|
24
31
|
* `harn-council`) even for a renamed bin; only command strings track `binName`.
|
|
25
32
|
*
|
|
26
33
|
* The block only points at a skill that actually exists here: a host that
|
|
27
|
-
* excludes one via `skills.exclude`, or a
|
|
34
|
+
* excludes one via `skills.exclude`, or a adapter with no skill primitive
|
|
28
35
|
* (cursor/codex get the block but no skill files), gets a `--help` pointer
|
|
29
36
|
* instead of a dangling reference to a skill it doesn't have.
|
|
30
37
|
*/
|
|
@@ -33,24 +40,25 @@ export function renderInstructionsBlock(binName, skills = { decide: true, counci
|
|
|
33
40
|
const named = [skills.decide && "`harn-decide`", skills.council && "`harn-council`"].filter(Boolean);
|
|
34
41
|
const deeper = named.length > 0
|
|
35
42
|
? `Procedures for the deeper flows live in the ${named.join(" and ")} skill${named.length > 1 ? "s" : ""}.`
|
|
36
|
-
: `See \`${b} decision --help\` and \`${b} council --help\` for the deeper procedures.`;
|
|
43
|
+
: `See \`${b} decision --help\` and \`${b} agents council --help\` for the deeper procedures.`;
|
|
37
44
|
const decidePointer = skills.decide
|
|
38
45
|
? "The `harn-decide` skill has the file / claim / resolve-with-evidence procedure."
|
|
39
46
|
: `See \`${b} decision --help\` for the file / claim / resolve-with-evidence procedure.`;
|
|
40
47
|
const councilPointer = skills.council
|
|
41
48
|
? "The `harn-council` skill has the steward and member flow."
|
|
42
|
-
: `See \`${b} council --help\` for the steward and member flow.`;
|
|
43
|
-
// Render the
|
|
44
|
-
// never drift from what `
|
|
49
|
+
: `See \`${b} agents council --help\` for the steward and member flow.`;
|
|
50
|
+
// Render the journal categories from the canonical enum so this prose can
|
|
51
|
+
// never drift from what `journal add` actually accepts (the "note, plan…" list
|
|
45
52
|
// silently lagged the tool by two categories before this).
|
|
46
|
-
const
|
|
47
|
-
? `${
|
|
48
|
-
:
|
|
53
|
+
const journalCats = JOURNAL_CATEGORIES.length > 1
|
|
54
|
+
? `${JOURNAL_CATEGORIES.slice(0, -1).join(", ")}, or ${JOURNAL_CATEGORIES.at(-1)}`
|
|
55
|
+
: JOURNAL_CATEGORIES[0];
|
|
49
56
|
return `## harnery coordination
|
|
50
57
|
|
|
51
58
|
This project runs [harnery](https://harnery.com) for multi-agent coordination.
|
|
52
59
|
You share this checkout with other agents; the surfaces below keep you oriented
|
|
53
|
-
and out of each other's way
|
|
60
|
+
and out of each other's way, and let you dispatch a team of your own when a job
|
|
61
|
+
is bigger than one session. Run \`${b} <command> --help\` for any command's full
|
|
54
62
|
surface. ${deeper}
|
|
55
63
|
|
|
56
64
|
**Identity + peers.** You are one of several agents in this repo.
|
|
@@ -59,6 +67,20 @@ active peers and the files they've claimed; \`${b} agents set-task "<focus>"\`
|
|
|
59
67
|
declares your current focus so peers can see it. Check for peers before editing
|
|
60
68
|
widely-shared files.
|
|
61
69
|
|
|
70
|
+
**Dispatching a team.** Everything else here coordinates the agents already
|
|
71
|
+
present. These three start new ones, and they differ by how long the objective
|
|
72
|
+
outlives a single execution. \`${b} run <script>\` is one bounded pass:
|
|
73
|
+
plain JS stages fan out to headless subagents that are born
|
|
74
|
+
coordination-registered, with deterministic code deciding the routing between
|
|
75
|
+
stages. \`${b} work create <title> <workflow>\` wraps an objective that has to
|
|
76
|
+
survive many such passes, holding it across retries, failures, and review.
|
|
77
|
+
\`${b} governor create\` drives a whole graph of work toward a goal, choosing
|
|
78
|
+
what runs next and how much it may settle without asking a human. Reach for the
|
|
79
|
+
first when one pass will do, the second when the objective must outlive the
|
|
80
|
+
attempt, and the third when a human would otherwise have to babysit the loop. A
|
|
81
|
+
run that needs authorization parks durably instead of failing, so check
|
|
82
|
+
\`${b} approval list\` when one appears to be waiting rather than stuck.
|
|
83
|
+
|
|
62
84
|
**Durable role handoff.** When you are replacing a prior session in the same
|
|
63
85
|
named role, run \`${b} agents identity assume <name>\` before declaring your task.
|
|
64
86
|
It reclaims an abandoned namesake (no live process) and refuses only when another
|
|
@@ -70,11 +92,18 @@ coordination ledger. Lead a shell command with a \`# intent: <why>\` comment (or
|
|
|
70
92
|
the tool's description) so the recorded event carries a reason instead of
|
|
71
93
|
\`(no intent)\`.
|
|
72
94
|
|
|
73
|
-
**
|
|
95
|
+
**Journal.** \`${b} journal add <category> "<text>"\` (category = ${journalCats})
|
|
74
96
|
leaves breadcrumbs that survive context compaction;
|
|
75
|
-
\`${b}
|
|
97
|
+
\`${b} journal read\` reads yours, \`${b} journal read --name <peer>\` reads a peer's.
|
|
76
98
|
Use it for anything future-you or a peer will need to pick up your thread.
|
|
77
99
|
|
|
100
|
+
**Working artifacts.** For screenshots, exports, audit dumps, rollback inputs,
|
|
101
|
+
and other untracked files that must survive a session, create a managed workspace
|
|
102
|
+
with \`${b} artifacts create <slug> --purpose "<why>"\`. Write files under the
|
|
103
|
+
returned path, then run \`${b} artifacts release <id>\` when active work is done.
|
|
104
|
+
Do not create a repo-root temp directory; \`${b} artifacts clean\` previews
|
|
105
|
+
expired cleanup and requires \`--yes\` to delete anything.
|
|
106
|
+
|
|
78
107
|
**Decision docket.** When you would otherwise stop to ask a human a decision you
|
|
79
108
|
can't resolve from the repo, file it instead. \`${b} decision file "<question>"\`
|
|
80
109
|
records it and lets you proceed on a stated default; \`${b} decision search "<terms>"\`
|
package/dist/lib/machine.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resolve a human-friendly label for the current machine. Used to tag
|
|
3
|
-
* coordination artifacts (
|
|
3
|
+
* coordination artifacts (journal-doc headers, session telemetry) by the host
|
|
4
4
|
* they originated on.
|
|
5
5
|
*
|
|
6
6
|
* Precedence (first non-empty wins):
|
|
7
7
|
* 1. HARNERY_MACHINE env var: transient / per-launch / CI override
|
|
8
|
-
* 2. ~/.config/harnery/machine file: persistent,
|
|
8
|
+
* 2. ~/.config/harnery/machine file: persistent, adapter-neutral identity
|
|
9
9
|
* 3. os.hostname() (normalized): automatic floor; never empty
|
|
10
10
|
*
|
|
11
11
|
* The env var sits on top for ad-hoc overrides; the file is the durable home for
|
package/dist/lib/machine.js
CHANGED
|
@@ -4,12 +4,12 @@ import { resolve } from "node:path";
|
|
|
4
4
|
import { coordEnv } from "./env.js";
|
|
5
5
|
/**
|
|
6
6
|
* Resolve a human-friendly label for the current machine. Used to tag
|
|
7
|
-
* coordination artifacts (
|
|
7
|
+
* coordination artifacts (journal-doc headers, session telemetry) by the host
|
|
8
8
|
* they originated on.
|
|
9
9
|
*
|
|
10
10
|
* Precedence (first non-empty wins):
|
|
11
11
|
* 1. HARNERY_MACHINE env var: transient / per-launch / CI override
|
|
12
|
-
* 2. ~/.config/harnery/machine file: persistent,
|
|
12
|
+
* 2. ~/.config/harnery/machine file: persistent, adapter-neutral identity
|
|
13
13
|
* 3. os.hostname() (normalized): automatic floor; never empty
|
|
14
14
|
*
|
|
15
15
|
* The env var sits on top for ad-hoc overrides; the file is the durable home for
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harnery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Multi-agent coordination for AI coding agents - Claude Code, Cursor, and Codex.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ryan Kelly",
|
|
@@ -47,15 +47,20 @@
|
|
|
47
47
|
"types": "./dist/core/agents/session-events.d.ts",
|
|
48
48
|
"import": "./dist/core/agents/session-events.js"
|
|
49
49
|
},
|
|
50
|
+
"./core/artifacts": {
|
|
51
|
+
"bun": "./src/core/artifacts/index.ts",
|
|
52
|
+
"types": "./dist/core/artifacts/index.d.ts",
|
|
53
|
+
"import": "./dist/core/artifacts/index.js"
|
|
54
|
+
},
|
|
50
55
|
"./core/hooks": {
|
|
51
56
|
"bun": "./src/core/hooks/index.ts",
|
|
52
57
|
"types": "./dist/core/hooks/index.d.ts",
|
|
53
58
|
"import": "./dist/core/hooks/index.js"
|
|
54
59
|
},
|
|
55
|
-
"./core/
|
|
56
|
-
"bun": "./src/core/
|
|
57
|
-
"types": "./dist/core/
|
|
58
|
-
"import": "./dist/core/
|
|
60
|
+
"./core/adapters": {
|
|
61
|
+
"bun": "./src/core/adapters/index.ts",
|
|
62
|
+
"types": "./dist/core/adapters/index.d.ts",
|
|
63
|
+
"import": "./dist/core/adapters/index.js"
|
|
59
64
|
},
|
|
60
65
|
"./core/context": {
|
|
61
66
|
"bun": "./src/core/context/index.ts",
|
|
@@ -77,20 +82,20 @@
|
|
|
77
82
|
"types": "./dist/core/work/read.d.ts",
|
|
78
83
|
"import": "./dist/core/work/read.js"
|
|
79
84
|
},
|
|
80
|
-
"./core/
|
|
81
|
-
"bun": "./src/core/
|
|
82
|
-
"types": "./dist/core/
|
|
83
|
-
"import": "./dist/core/
|
|
85
|
+
"./core/governor": {
|
|
86
|
+
"bun": "./src/core/governor/index.ts",
|
|
87
|
+
"types": "./dist/core/governor/index.d.ts",
|
|
88
|
+
"import": "./dist/core/governor/index.js"
|
|
84
89
|
},
|
|
85
|
-
"./core/
|
|
86
|
-
"bun": "./src/core/
|
|
87
|
-
"types": "./dist/core/
|
|
88
|
-
"import": "./dist/core/
|
|
90
|
+
"./core/governor/state": {
|
|
91
|
+
"bun": "./src/core/governor/read.ts",
|
|
92
|
+
"types": "./dist/core/governor/read.d.ts",
|
|
93
|
+
"import": "./dist/core/governor/read.js"
|
|
89
94
|
},
|
|
90
|
-
"./core/
|
|
91
|
-
"bun": "./src/core/
|
|
92
|
-
"types": "./dist/core/
|
|
93
|
-
"import": "./dist/core/
|
|
95
|
+
"./core/governor/plans": {
|
|
96
|
+
"bun": "./src/core/governor/plan-read.ts",
|
|
97
|
+
"types": "./dist/core/governor/plan-read.d.ts",
|
|
98
|
+
"import": "./dist/core/governor/plan-read.js"
|
|
94
99
|
},
|
|
95
100
|
"./core/policy": {
|
|
96
101
|
"bun": "./src/core/policy/index.ts",
|
|
@@ -132,10 +137,10 @@
|
|
|
132
137
|
"types": "./dist/lib/readability/index.d.ts",
|
|
133
138
|
"import": "./dist/lib/readability/index.js"
|
|
134
139
|
},
|
|
135
|
-
"./core/
|
|
136
|
-
"bun": "./src/core/
|
|
137
|
-
"types": "./dist/core/
|
|
138
|
-
"import": "./dist/core/
|
|
140
|
+
"./core/journal": {
|
|
141
|
+
"bun": "./src/core/journal/index.ts",
|
|
142
|
+
"types": "./dist/core/journal/index.d.ts",
|
|
143
|
+
"import": "./dist/core/journal/index.js"
|
|
139
144
|
},
|
|
140
145
|
"./lib/tunnel/state": {
|
|
141
146
|
"bun": "./src/lib/tunnel/state.ts",
|
|
@@ -35,6 +35,20 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
"artifacts": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"description": "Defaults for repository-local working artifacts under .harnery/artifacts/.",
|
|
42
|
+
"properties": {
|
|
43
|
+
"default_retention_days": {
|
|
44
|
+
"type": "number",
|
|
45
|
+
"exclusiveMinimum": 0,
|
|
46
|
+
"maximum": 3650,
|
|
47
|
+
"default": 3,
|
|
48
|
+
"description": "Retention for `harn artifacts create` when --days is absent. Env override: HARNERY_ARTIFACT_RETENTION_DAYS."
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
38
52
|
"web": {
|
|
39
53
|
"type": "object",
|
|
40
54
|
"additionalProperties": false,
|
|
@@ -113,6 +127,17 @@
|
|
|
113
127
|
}
|
|
114
128
|
}
|
|
115
129
|
},
|
|
130
|
+
"instructions": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"description": "Agent-facing instructions harnery manages in AGENTS.md.",
|
|
134
|
+
"properties": {
|
|
135
|
+
"hostAddendumFile": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"description": "Repo-relative path to a markdown file holding this project's own coordination policy. `harn init` splices its contents into a second managed region in AGENTS.md, `init --check` reports drift against it, and `deinit` (or removing this key) takes the region back out. Harnery never parses the content. Must resolve inside the project and be non-empty."
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
116
141
|
"presence": {
|
|
117
142
|
"type": "object",
|
|
118
143
|
"additionalProperties": false,
|
|
@@ -165,7 +190,7 @@
|
|
|
165
190
|
"sync": {
|
|
166
191
|
"type": "object",
|
|
167
192
|
"additionalProperties": false,
|
|
168
|
-
"description": "`harn sync` (rclone) defaults for the curated cross-machine subset (identities/,
|
|
193
|
+
"description": "`harn sync` (rclone) defaults for the curated cross-machine subset (identities/, journal/archived/, councils/). Env overrides: HARNERY_SYNC_REMOTE, HARNERY_SYNC_PREFIX. `harn sync init` also records these in ~/.config/harnery/sync.json (a lower-precedence fallback than this section).",
|
|
169
194
|
"properties": {
|
|
170
195
|
"remote": {
|
|
171
196
|
"type": "string",
|
package/src/commander.ts
CHANGED
|
@@ -18,15 +18,17 @@ import { readFileSync } from "node:fs";
|
|
|
18
18
|
import { dirname, join } from "node:path";
|
|
19
19
|
import { fileURLToPath } from "node:url";
|
|
20
20
|
import { Command } from "commander";
|
|
21
|
-
import {
|
|
21
|
+
import { registerAdapterCommand } from "./commands/adapter.ts";
|
|
22
|
+
import { registerAgentsCommand, registerCouncilCommands } from "./commands/agents.ts";
|
|
23
|
+
import { registerArtifactsCommand } from "./commands/artifacts.ts";
|
|
22
24
|
import { registerBackupCommand } from "./commands/backup.ts";
|
|
23
25
|
import { registerBrowseCommand } from "./commands/browse.ts";
|
|
24
26
|
import { registerBrowseAiCommand } from "./commands/browse-ai.ts";
|
|
25
27
|
import { registerCallersCommand } from "./commands/callers.ts";
|
|
28
|
+
import { registerCheckpointCommand } from "./commands/checkpoint.ts";
|
|
26
29
|
import { registerClaudeDesktopCommand } from "./commands/claude-desktop.ts";
|
|
27
30
|
import { registerCompletionCommand } from "./commands/completion.ts";
|
|
28
31
|
import { registerConfigGetCommand } from "./commands/config-get.ts";
|
|
29
|
-
import { registerContextCommand } from "./commands/context.ts";
|
|
30
32
|
import { registerCookiesCommand } from "./commands/cookies.ts";
|
|
31
33
|
import { registerDecisionCommand } from "./commands/decision.ts";
|
|
32
34
|
import { registerDeinitCommand } from "./commands/deinit.ts";
|
|
@@ -38,17 +40,15 @@ import { registerEmlCommand } from "./commands/eml.ts";
|
|
|
38
40
|
import { registerEnvCommand } from "./commands/env.ts";
|
|
39
41
|
import { registerFetchCommand } from "./commands/fetch.ts";
|
|
40
42
|
import { registerFileHistoryCommand } from "./commands/file-history.ts";
|
|
43
|
+
import { registerGovernorCommand } from "./commands/governor.ts";
|
|
41
44
|
import { registerGrepCommand } from "./commands/grep.ts";
|
|
42
|
-
import { registerHarnessCommand } from "./commands/harness.ts";
|
|
43
45
|
import { registerInitCommand } from "./commands/init.ts";
|
|
46
|
+
import { registerJournalCommand } from "./commands/journal.ts";
|
|
44
47
|
import { registerOutlineCommand } from "./commands/outline.ts";
|
|
45
48
|
import { registerPolicyCommand } from "./commands/policy.ts";
|
|
46
49
|
import { registerPresenceCommand } from "./commands/presence.ts";
|
|
47
50
|
import { registerReadCommand } from "./commands/read.ts";
|
|
48
51
|
import { registerRelayCommand } from "./commands/relay.ts";
|
|
49
|
-
import { registerScratchCommand } from "./commands/scratch.ts";
|
|
50
|
-
import { registerSessionCommand } from "./commands/session.ts";
|
|
51
|
-
import { registerSupervisorCommand } from "./commands/supervisor.ts";
|
|
52
52
|
import { registerSyncCommand } from "./commands/sync.ts";
|
|
53
53
|
import { registerSectionCommand, registerTocCommand } from "./commands/toc.ts";
|
|
54
54
|
import { registerTokensCommand } from "./commands/tokens.ts";
|
|
@@ -143,6 +143,14 @@ export interface HarneryProgramContext {
|
|
|
143
143
|
* zones behind a WAF). harn standalone skips the callback entirely.
|
|
144
144
|
*/
|
|
145
145
|
extraHeaders?: (url: string) => Record<string, string>;
|
|
146
|
+
/**
|
|
147
|
+
* Host-injected vision-model call for `browse --check-critique`. harnery
|
|
148
|
+
* ships no model client or API key; a consumer wires this to its own
|
|
149
|
+
* multimodal provider (OpenAI/Anthropic/etc). Given one page tile + the
|
|
150
|
+
* rubric, it returns that tile's findings. When omitted, `--check-critique`
|
|
151
|
+
* reports `skipped` rather than a false pass.
|
|
152
|
+
*/
|
|
153
|
+
critiqueProvider?: import("./lib/browser/critique.ts").CritiqueProvider;
|
|
146
154
|
/**
|
|
147
155
|
* Shell-completion provider-key lookup. Consumers wire this to a function
|
|
148
156
|
* mapping (commandPath, option/positional) to a provider key, so that
|
|
@@ -250,7 +258,7 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
|
|
|
250
258
|
|
|
251
259
|
program
|
|
252
260
|
.name(opts.binName ?? "harn")
|
|
253
|
-
.description("Multi-agent coordination +
|
|
261
|
+
.description("Multi-agent coordination + adapter adapters + portable CLI utilities.")
|
|
254
262
|
.version(readVersion());
|
|
255
263
|
|
|
256
264
|
registerTokensCommand(program, emit);
|
|
@@ -266,22 +274,23 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
|
|
|
266
274
|
registerCallersCommand(program, emit, opts.context);
|
|
267
275
|
registerEditBatchCommand(program, emit);
|
|
268
276
|
registerGrepCommand(program, emit, opts.context);
|
|
269
|
-
|
|
277
|
+
registerAdapterCommand(program, emit);
|
|
270
278
|
registerPolicyCommand(program, emit);
|
|
271
279
|
registerCookiesCommand(program, emit);
|
|
272
280
|
registerFetchCommand(program, emit, opts.context);
|
|
273
281
|
registerReadCommand(program, emit);
|
|
274
282
|
registerBrowseCommand(program, emit, opts.context);
|
|
275
283
|
registerBrowseAiCommand(program, emit);
|
|
276
|
-
registerSessionCommand(program, emit);
|
|
277
284
|
registerCompletionCommand(program, emit, opts.context);
|
|
278
|
-
|
|
279
|
-
|
|
285
|
+
registerCheckpointCommand(program, emit, opts.context);
|
|
286
|
+
registerJournalCommand(program, emit);
|
|
287
|
+
registerArtifactsCommand(program, emit, opts.context);
|
|
280
288
|
registerDecisionCommand(program, emit);
|
|
281
289
|
registerDevtoolsCommand(program, emit);
|
|
282
290
|
registerTunnelCommand(program, emit, opts.context);
|
|
283
291
|
registerDocsCommand(program, emit, opts.context);
|
|
284
|
-
registerAgentsCommand(program, emit);
|
|
292
|
+
registerAgentsCommand(program, emit, opts.context);
|
|
293
|
+
registerCouncilCommands(program);
|
|
285
294
|
registerDoctorCommand(program, emit);
|
|
286
295
|
registerInitCommand(program, emit, opts.binName);
|
|
287
296
|
registerDeinitCommand(program, emit, opts.binName);
|
|
@@ -290,7 +299,7 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
|
|
|
290
299
|
registerSyncCommand(program, emit);
|
|
291
300
|
registerWorkflowCommand(program, emit);
|
|
292
301
|
registerWorkCommand(program, emit);
|
|
293
|
-
|
|
302
|
+
registerGovernorCommand(program, emit);
|
|
294
303
|
if (include("web")) registerWebCommand(program, emit);
|
|
295
304
|
|
|
296
305
|
return program;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
2
|
import type { EmitContext } from "../commander.ts";
|
|
3
|
-
import { workflowSubscriptionOnly } from "../core/config.ts";
|
|
4
3
|
import {
|
|
4
|
+
type AdapterAttestationReport,
|
|
5
|
+
type AdapterBenchReport,
|
|
5
6
|
type BenchResult,
|
|
6
|
-
|
|
7
|
-
type HarnessAttestationReport,
|
|
8
|
-
type HarnessBenchReport,
|
|
7
|
+
createBuiltinAdapterRegistry,
|
|
9
8
|
listAttestations,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "../core/
|
|
13
|
-
import type {
|
|
9
|
+
runAdapterAttestation,
|
|
10
|
+
runAdapterBench,
|
|
11
|
+
} from "../core/adapters/index.ts";
|
|
12
|
+
import type { AdapterProfile } from "../core/adapters/types.ts";
|
|
13
|
+
import { workflowSubscriptionOnly } from "../core/config.ts";
|
|
14
14
|
|
|
15
15
|
interface FormatOpts {
|
|
16
16
|
json?: boolean;
|
|
@@ -27,22 +27,22 @@ interface AttestOpts extends FormatOpts {
|
|
|
27
27
|
projection?: boolean;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const registry =
|
|
30
|
+
const registry = createBuiltinAdapterRegistry();
|
|
31
31
|
|
|
32
|
-
export function
|
|
32
|
+
export function registerAdapterCommand(program: Command, emit: EmitContext): void {
|
|
33
33
|
const command = program
|
|
34
|
-
.command("
|
|
35
|
-
.description("Inspect registered
|
|
34
|
+
.command("adapter")
|
|
35
|
+
.description("Inspect registered adapter capabilities and run their conformance bench.");
|
|
36
36
|
|
|
37
37
|
command
|
|
38
38
|
.command("list")
|
|
39
|
-
.description("List registered
|
|
39
|
+
.description("List registered adapter adapters and their high-signal capability claims.")
|
|
40
40
|
.option("--json", "Machine-readable profile catalog")
|
|
41
41
|
.action((opts: FormatOpts) => {
|
|
42
42
|
const profiles = registry.list().map((adapter) => adapter.profile);
|
|
43
43
|
if (opts.json) {
|
|
44
44
|
emit.config({ format: "json" });
|
|
45
|
-
emit.data({
|
|
45
|
+
emit.data({ adapters: profiles });
|
|
46
46
|
} else {
|
|
47
47
|
emit.text(renderProfileTable(profiles));
|
|
48
48
|
}
|
|
@@ -50,14 +50,14 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
50
50
|
|
|
51
51
|
command
|
|
52
52
|
.command("show <id>")
|
|
53
|
-
.description("Show one
|
|
53
|
+
.description("Show one adapter's complete capability declaration.")
|
|
54
54
|
.option("--json", "Machine-readable profile")
|
|
55
55
|
.action((id: string, opts: FormatOpts) => {
|
|
56
56
|
const adapter = registry.get(id);
|
|
57
57
|
if (!adapter) {
|
|
58
58
|
emit.error({
|
|
59
|
-
code: "
|
|
60
|
-
message: `unknown
|
|
59
|
+
code: "unknown_adapter",
|
|
60
|
+
message: `unknown adapter ${JSON.stringify(id)} (registered: ${registry.ids().join(", ")})`,
|
|
61
61
|
});
|
|
62
62
|
emit.setExitCode(1);
|
|
63
63
|
return;
|
|
@@ -71,13 +71,13 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
command
|
|
74
|
-
.command("bench [
|
|
74
|
+
.command("bench [adapters...]")
|
|
75
75
|
.description("Run the offline adapter-contract bench (no model calls); drift exits non-zero.")
|
|
76
76
|
.option("--require-installed", "Also fail when a registered vendor CLI is missing")
|
|
77
77
|
.option("--json", "Machine-readable conformance report")
|
|
78
|
-
.action((
|
|
78
|
+
.action((adapters: string[], opts: BenchOpts) => {
|
|
79
79
|
try {
|
|
80
|
-
const report =
|
|
80
|
+
const report = runAdapterBench(registry, { adapters });
|
|
81
81
|
if (opts.json) {
|
|
82
82
|
emit.config({ format: "json" });
|
|
83
83
|
emit.data(report);
|
|
@@ -86,13 +86,13 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
86
86
|
}
|
|
87
87
|
emit.setExitCode(report.drift || (opts.requireInstalled && report.skipped) ? 1 : 0);
|
|
88
88
|
} catch (error) {
|
|
89
|
-
emit.error({ code: "
|
|
89
|
+
emit.error({ code: "adapter_bench_failed", message: (error as Error).message });
|
|
90
90
|
emit.setExitCode(1);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
command
|
|
95
|
-
.command("attest [
|
|
95
|
+
.command("attest [adapters...]")
|
|
96
96
|
.description(
|
|
97
97
|
"Record what the installed vendor CLIs actually do. Runs one real model turn each; needs --yes.",
|
|
98
98
|
)
|
|
@@ -101,18 +101,18 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
101
101
|
"--subscription-only",
|
|
102
102
|
"Scrub API-key vars so the child uses its stored login (repo default via config.jsonc workflow.subscriptionOnly)",
|
|
103
103
|
)
|
|
104
|
-
.option("--timeout <ms>", "Per-
|
|
104
|
+
.option("--timeout <ms>", "Per-adapter probe timeout in milliseconds")
|
|
105
105
|
.option(
|
|
106
106
|
"--projection",
|
|
107
|
-
"Also probe whether a declared sandbox is enforced; costs two extra turns per capable
|
|
107
|
+
"Also probe whether a declared sandbox is enforced; costs two extra turns per capable adapter",
|
|
108
108
|
)
|
|
109
109
|
.option("--json", "Machine-readable attestation report")
|
|
110
|
-
.action(async (
|
|
110
|
+
.action(async (adapters: string[], opts: AttestOpts) => {
|
|
111
111
|
if (!opts.yes) {
|
|
112
112
|
emit.error({
|
|
113
|
-
code: "
|
|
113
|
+
code: "adapter_attest_unconfirmed",
|
|
114
114
|
message:
|
|
115
|
-
"
|
|
115
|
+
"adapter attest runs one real model turn per adapter and spends vendor tokens. Re-run with --yes.",
|
|
116
116
|
});
|
|
117
117
|
emit.setExitCode(1);
|
|
118
118
|
return;
|
|
@@ -120,7 +120,7 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
120
120
|
const timeoutMs = opts.timeout ? Number(opts.timeout) : undefined;
|
|
121
121
|
if (timeoutMs !== undefined && (!Number.isFinite(timeoutMs) || timeoutMs <= 0)) {
|
|
122
122
|
emit.error({
|
|
123
|
-
code: "
|
|
123
|
+
code: "adapter_attest_bad_timeout",
|
|
124
124
|
message: "--timeout must be a positive number",
|
|
125
125
|
});
|
|
126
126
|
emit.setExitCode(1);
|
|
@@ -128,8 +128,8 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
128
128
|
}
|
|
129
129
|
try {
|
|
130
130
|
const subscriptionOnly = opts.subscriptionOnly || workflowSubscriptionOnly();
|
|
131
|
-
const report = await
|
|
132
|
-
|
|
131
|
+
const report = await runAdapterAttestation(registry, {
|
|
132
|
+
adapters,
|
|
133
133
|
timeoutMs,
|
|
134
134
|
subscriptionOnly,
|
|
135
135
|
projection: opts.projection === true,
|
|
@@ -145,7 +145,7 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
145
145
|
// to install every vendor CLI.
|
|
146
146
|
emit.setExitCode(report.recorded === 0 ? 1 : 0);
|
|
147
147
|
} catch (error) {
|
|
148
|
-
emit.error({ code: "
|
|
148
|
+
emit.error({ code: "adapter_attest_failed", message: (error as Error).message });
|
|
149
149
|
emit.setExitCode(1);
|
|
150
150
|
}
|
|
151
151
|
});
|
|
@@ -163,14 +163,14 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
if (records.length === 0) {
|
|
166
|
-
emit.text("No attestations recorded. Run `
|
|
166
|
+
emit.text("No attestations recorded. Run `adapter attest --yes` to create one.");
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
emit.text(
|
|
170
170
|
renderTable(
|
|
171
|
-
["
|
|
171
|
+
["ADAPTER", "VERSION", "BILLING", "OBSERVED AT", "OBSERVATIONS"],
|
|
172
172
|
records.map((record) => [
|
|
173
|
-
record.
|
|
173
|
+
record.adapter,
|
|
174
174
|
record.binary_version,
|
|
175
175
|
record.subscription_only ? "subscription" : "any",
|
|
176
176
|
record.observed_at,
|
|
@@ -181,15 +181,15 @@ export function registerHarnessCommand(program: Command, emit: EmitContext): voi
|
|
|
181
181
|
),
|
|
182
182
|
);
|
|
183
183
|
} catch (error) {
|
|
184
|
-
emit.error({ code: "
|
|
184
|
+
emit.error({ code: "adapter_attestations_failed", message: (error as Error).message });
|
|
185
185
|
emit.setExitCode(1);
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
export function renderAttestationReport(report:
|
|
190
|
+
export function renderAttestationReport(report: AdapterAttestationReport): string {
|
|
191
191
|
const rows = report.results.map((result) => [
|
|
192
|
-
result.
|
|
192
|
+
result.adapter,
|
|
193
193
|
result.outcome,
|
|
194
194
|
result.binaryVersion ?? "",
|
|
195
195
|
result.observations
|
|
@@ -198,14 +198,14 @@ export function renderAttestationReport(report: HarnessAttestationReport): strin
|
|
|
198
198
|
.join(" ")
|
|
199
199
|
: result.note,
|
|
200
200
|
]);
|
|
201
|
-
const table = renderTable(["
|
|
201
|
+
const table = renderTable(["ADAPTER", "OUTCOME", "VERSION", "OBSERVED"], rows);
|
|
202
202
|
const tail = report.incomplete
|
|
203
|
-
? "Some
|
|
204
|
-
: "Every selected
|
|
203
|
+
? "Some adapters were not attested; their bench rows keep an adapter basis."
|
|
204
|
+
: "Every selected adapter was attested.";
|
|
205
205
|
return `${table}\n\nrecorded: ${report.recorded}/${report.results.length}\n${tail}`;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
export function renderProfileTable(profiles: readonly
|
|
208
|
+
export function renderProfileTable(profiles: readonly AdapterProfile[]): string {
|
|
209
209
|
const rows = profiles.map((profile) => [
|
|
210
210
|
profile.id,
|
|
211
211
|
profile.binary,
|
|
@@ -214,10 +214,10 @@ export function renderProfileTable(profiles: readonly HarnessProfile[]): string
|
|
|
214
214
|
profile.capabilities.sessionId.support,
|
|
215
215
|
profile.capabilities.cost.support,
|
|
216
216
|
]);
|
|
217
|
-
return renderTable(["
|
|
217
|
+
return renderTable(["ADAPTER", "BINARY", "MODEL", "EFFORT", "SESSION", "COST"], rows);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
export function renderProfile(profile:
|
|
220
|
+
export function renderProfile(profile: AdapterProfile): string {
|
|
221
221
|
const lines = [
|
|
222
222
|
`${profile.displayName} (${profile.id})`,
|
|
223
223
|
`binary: ${profile.binary}`,
|
|
@@ -237,9 +237,9 @@ export function renderProfile(profile: HarnessProfile): string {
|
|
|
237
237
|
return lines.join("\n");
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
export function renderBenchReport(report:
|
|
240
|
+
export function renderBenchReport(report: AdapterBenchReport): string {
|
|
241
241
|
const rows = report.results.map((result) => [
|
|
242
|
-
result.
|
|
242
|
+
result.adapter,
|
|
243
243
|
result.dimension,
|
|
244
244
|
result.declared,
|
|
245
245
|
result.observed,
|
|
@@ -247,7 +247,7 @@ export function renderBenchReport(report: HarnessBenchReport): string {
|
|
|
247
247
|
result.basis,
|
|
248
248
|
]);
|
|
249
249
|
const table = renderTable(
|
|
250
|
-
["
|
|
250
|
+
["ADAPTER", "DIMENSION", "DECLARED", "OBSERVED", "VERDICT", "BASIS"],
|
|
251
251
|
rows,
|
|
252
252
|
);
|
|
253
253
|
const summary = Object.entries(report.summary)
|