harnery 0.30.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.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 +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 +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 +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/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/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 +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 +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 +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 +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 +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/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/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/init.d.ts
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* if skipped):
|
|
6
6
|
* 1. Create the `.harnery/` coord root; without it `findCoordRoot` returns
|
|
7
7
|
* null and every hook no-ops forever.
|
|
8
|
-
* 2. Register the agent-hook entries in the
|
|
8
|
+
* 2. Register the agent-hook entries in the adapter settings file.
|
|
9
9
|
*
|
|
10
|
-
* Wires whichever
|
|
11
|
-
* Cursor `.cursor/hooks.json`, or Codex `.codex/hooks.json`): the per-
|
|
12
|
-
* file path, event list, and hook-entry shape all come from
|
|
10
|
+
* Wires whichever adapter `--adapter` names (Claude Code `.claude/settings.json`,
|
|
11
|
+
* Cursor `.cursor/hooks.json`, or Codex `.codex/hooks.json`): the per-adapter
|
|
12
|
+
* file path, event list, and hook-entry shape all come from ADAPTER_SPECS.
|
|
13
13
|
*
|
|
14
14
|
* `harn init` does both, non-destructively: it merges hook entries into an
|
|
15
15
|
* existing settings file (preserving any other hooks) and skips entries that are
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import type { Command } from "commander";
|
|
19
19
|
import type { EmitContext } from "../commander.js";
|
|
20
|
-
import { type
|
|
21
|
-
import { type HookGroup, type SettingsFile } from "../core/hooks/
|
|
20
|
+
import { type AdapterId, type AdapterSpec } from "../core/hooks/adapter/events.js";
|
|
21
|
+
import { type HookGroup, type SettingsFile } from "../core/hooks/adapter/wiring.js";
|
|
22
22
|
export type { HookGroup, SettingsFile };
|
|
23
23
|
export declare function registerInitCommand(program: Command, emit: EmitContext, binName?: string): void;
|
|
24
24
|
/**
|
|
25
|
-
* Merge agent-hook entries into a
|
|
25
|
+
* Merge agent-hook entries into a adapter settings object in place, idempotently.
|
|
26
26
|
* Preserves every existing hook; rewrites events already wired to
|
|
27
27
|
* `agent-hook <subcommand>` when their command string is stale (e.g. an older
|
|
28
|
-
* harnery wired a bare relative path). Honors the
|
|
28
|
+
* harnery wired a bare relative path). Honors the adapter's entry shape
|
|
29
29
|
* (Claude/Codex nest under an inner `hooks` array; Cursor uses a flat
|
|
30
|
-
* `{ command }`) and ensures the root `version` key when the
|
|
30
|
+
* `{ command }`) and ensures the root `version` key when the adapter requires
|
|
31
31
|
* one. Pure (no fs/git) so it's unit-testable.
|
|
32
32
|
*
|
|
33
33
|
* The trailing space in the match (`agent-hook ${subcommand} `) is load-bearing:
|
|
34
34
|
* it keeps `stop` from matching `stop-failure`.
|
|
35
35
|
*/
|
|
36
|
-
export declare function wireHooks(settings: SettingsFile, spec:
|
|
36
|
+
export declare function wireHooks(settings: SettingsFile, spec: AdapterSpec, agentHookPath: string, adapter: AdapterId): {
|
|
37
37
|
wired: number;
|
|
38
38
|
already: number;
|
|
39
39
|
removed: number;
|
|
@@ -45,8 +45,8 @@ export declare function wireHooks(settings: SettingsFile, spec: HarnessSpec, age
|
|
|
45
45
|
* contains `agent-hook ` (the trailing space matches `agent-hook <subcommand>`),
|
|
46
46
|
* so any non-harnery hook the consumer added is preserved. Emptied
|
|
47
47
|
* `hooks[settingsKey]` arrays are dropped; an emptied `hooks` object is dropped
|
|
48
|
-
* entirely.
|
|
49
|
-
*
|
|
48
|
+
* entirely. Adapter-agnostic (scans every key) so it removes entries left by any
|
|
49
|
+
* adapter. Pure (no fs) so it's unit-testable. Returns the count removed and the
|
|
50
50
|
* count of non-harnery hooks left behind.
|
|
51
51
|
*/
|
|
52
52
|
export declare function unwireHooks(settings: SettingsFile): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAC;AAUzC,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAYxC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CA4I/F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,GACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAqCvE;AAyDD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAmB1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAmDhG;AASD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAkCxF"}
|
package/dist/commands/init.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* if skipped):
|
|
6
6
|
* 1. Create the `.harnery/` coord root; without it `findCoordRoot` returns
|
|
7
7
|
* null and every hook no-ops forever.
|
|
8
|
-
* 2. Register the agent-hook entries in the
|
|
8
|
+
* 2. Register the agent-hook entries in the adapter settings file.
|
|
9
9
|
*
|
|
10
|
-
* Wires whichever
|
|
11
|
-
* Cursor `.cursor/hooks.json`, or Codex `.codex/hooks.json`): the per-
|
|
12
|
-
* file path, event list, and hook-entry shape all come from
|
|
10
|
+
* Wires whichever adapter `--adapter` names (Claude Code `.claude/settings.json`,
|
|
11
|
+
* Cursor `.cursor/hooks.json`, or Codex `.codex/hooks.json`): the per-adapter
|
|
12
|
+
* file path, event list, and hook-entry shape all come from ADAPTER_SPECS.
|
|
13
13
|
*
|
|
14
14
|
* `harn init` does both, non-destructively: it merges hook entries into an
|
|
15
15
|
* existing settings file (preserving any other hooks) and skips entries that are
|
|
@@ -20,27 +20,28 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
20
20
|
import { dirname, relative, resolve } from "node:path";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
22
|
import { DEFAULT_BIN_NAME, pinnedBinName, stripJsonComments } from "../core/config.js";
|
|
23
|
-
import {
|
|
24
|
-
import { commandWiresSubcommand, groupCommands, makeEntry, } from "../core/hooks/
|
|
25
|
-
import { applyInstructions, checkInstructions } from "../lib/instructions/apply.js";
|
|
23
|
+
import { ADAPTER_SPECS } from "../core/hooks/adapter/events.js";
|
|
24
|
+
import { commandWiresSubcommand, groupCommands, makeEntry, } from "../core/hooks/adapter/wiring.js";
|
|
25
|
+
import { applyInstructions, checkInstructions, } from "../lib/instructions/apply.js";
|
|
26
|
+
import { HostAddendumError } from "../lib/instructions/host-addendum.js";
|
|
26
27
|
// This file is src/commands/init.ts → harnery package root is two levels up.
|
|
27
28
|
const HARNERY_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
28
29
|
export function registerInitCommand(program, emit, binName) {
|
|
29
30
|
program
|
|
30
31
|
.command("init")
|
|
31
|
-
.description("Bootstrap harnery in this project: create .harnery/, wire the
|
|
32
|
+
.description("Bootstrap harnery in this project: create .harnery/, wire the adapter " +
|
|
32
33
|
"hooks, and inject the agent-facing instructions block + skills " +
|
|
33
34
|
"(idempotent; safe to re-run). Use --dry-run to preview, --check to " +
|
|
34
35
|
"report drift without writing (exit 0 fresh / 2 drift / 1 error).")
|
|
35
|
-
.option("--
|
|
36
|
+
.option("--adapter <id>", "claude-code | cursor | codex", "claude-code")
|
|
36
37
|
.option("--dry-run", "Show what would change without writing")
|
|
37
38
|
.option("--check", "Report instructions/skills drift without writing; exit 0/2/1")
|
|
38
39
|
.option("--project-root <path>", "Project root (default: git toplevel, else cwd)")
|
|
39
40
|
.action((opts) => {
|
|
40
|
-
const
|
|
41
|
-
const spec =
|
|
41
|
+
const adapter = opts.adapter;
|
|
42
|
+
const spec = ADAPTER_SPECS[adapter];
|
|
42
43
|
if (!spec) {
|
|
43
|
-
emit.text(`Unknown
|
|
44
|
+
emit.text(`Unknown adapter '${opts.adapter}'. Expected: claude-code | cursor | codex.`);
|
|
44
45
|
emit.setExitCode(1);
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
@@ -53,7 +54,7 @@ export function registerInitCommand(program, emit, binName) {
|
|
|
53
54
|
const bin = pinnedBinName(projectRoot) ?? (binName?.trim() ? binName : DEFAULT_BIN_NAME);
|
|
54
55
|
// ── --check: read-only drift report on the block + skills ──────────────
|
|
55
56
|
if (opts.check === true) {
|
|
56
|
-
const { status, issues } = checkInstructions(projectRoot, { binName: bin,
|
|
57
|
+
const { status, issues } = checkInstructions(projectRoot, { binName: bin, adapter });
|
|
57
58
|
const head = status === "fresh"
|
|
58
59
|
? "harn init --check: instructions + skills are current"
|
|
59
60
|
: status === "drift"
|
|
@@ -94,7 +95,7 @@ export function registerInitCommand(program, emit, binName) {
|
|
|
94
95
|
}
|
|
95
96
|
// ── 1c. workflow billing default ───────────────────────────────────────
|
|
96
97
|
// Every init'd project gets `workflow.subscriptionOnly: true`: workflow
|
|
97
|
-
// children ride the logged-in (subscription)
|
|
98
|
+
// children ride the logged-in (subscription) adapter auth, and the pin
|
|
98
99
|
// makes per-token API billing structurally impossible unless the project
|
|
99
100
|
// deliberately flips it. A committed `workflow` key of any shape is a
|
|
100
101
|
// deliberate choice and is never touched.
|
|
@@ -103,7 +104,7 @@ export function registerInitCommand(program, emit, binName) {
|
|
|
103
104
|
if (stamp)
|
|
104
105
|
actions.push(stamp);
|
|
105
106
|
}
|
|
106
|
-
// ── 2.
|
|
107
|
+
// ── 2. adapter hooks ───────────────────────────────────────────────────
|
|
107
108
|
const settingsPath = resolve(projectRoot, spec.settingsFile);
|
|
108
109
|
const agentHook = relative(projectRoot, resolve(HARNERY_ROOT, "bin", "agent-hook"));
|
|
109
110
|
let settings;
|
|
@@ -121,9 +122,9 @@ export function registerInitCommand(program, emit, binName) {
|
|
|
121
122
|
else {
|
|
122
123
|
settings = {};
|
|
123
124
|
}
|
|
124
|
-
const { wired, already, removed, upgraded } = wireHooks(settings, spec, agentHook,
|
|
125
|
+
const { wired, already, removed, upgraded } = wireHooks(settings, spec, agentHook, adapter);
|
|
125
126
|
if (wired === 0 && removed === 0 && upgraded === 0) {
|
|
126
|
-
actions.push(`· all ${spec.events.length} ${
|
|
127
|
+
actions.push(`· all ${spec.events.length} ${adapter} hooks already wired in ${rel(projectRoot, settingsPath)}`);
|
|
127
128
|
}
|
|
128
129
|
else if (dryRun) {
|
|
129
130
|
actions.push(`+ would wire ${wired} hook(s), upgrade ${upgraded} stale command(s), and remove ` +
|
|
@@ -136,24 +137,37 @@ export function registerInitCommand(program, emit, binName) {
|
|
|
136
137
|
`${removed} legacy hook(s) in ${rel(projectRoot, settingsPath)} (${already} already present)`);
|
|
137
138
|
}
|
|
138
139
|
// ── 3. agent-facing instructions block + skills ────────────────────────
|
|
139
|
-
|
|
140
|
+
// A misconfigured host addendum aborts here rather than half-writing: the
|
|
141
|
+
// apply step validates the configured source before it touches a file, so
|
|
142
|
+
// a bad path leaves the repo exactly as it found it.
|
|
143
|
+
let applied;
|
|
144
|
+
try {
|
|
145
|
+
applied = applyInstructions(projectRoot, { binName: bin, adapter, dryRun });
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
if (!(err instanceof HostAddendumError))
|
|
149
|
+
throw err;
|
|
150
|
+
emit.text(`${bin} init: ${err.message}`);
|
|
151
|
+
emit.setExitCode(1);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
140
154
|
actions.push(...applied.actions);
|
|
141
155
|
emit.text(render(projectRoot, dryRun, actions, applied.warnings));
|
|
142
156
|
});
|
|
143
157
|
}
|
|
144
158
|
/**
|
|
145
|
-
* Merge agent-hook entries into a
|
|
159
|
+
* Merge agent-hook entries into a adapter settings object in place, idempotently.
|
|
146
160
|
* Preserves every existing hook; rewrites events already wired to
|
|
147
161
|
* `agent-hook <subcommand>` when their command string is stale (e.g. an older
|
|
148
|
-
* harnery wired a bare relative path). Honors the
|
|
162
|
+
* harnery wired a bare relative path). Honors the adapter's entry shape
|
|
149
163
|
* (Claude/Codex nest under an inner `hooks` array; Cursor uses a flat
|
|
150
|
-
* `{ command }`) and ensures the root `version` key when the
|
|
164
|
+
* `{ command }`) and ensures the root `version` key when the adapter requires
|
|
151
165
|
* one. Pure (no fs/git) so it's unit-testable.
|
|
152
166
|
*
|
|
153
167
|
* The trailing space in the match (`agent-hook ${subcommand} `) is load-bearing:
|
|
154
168
|
* it keeps `stop` from matching `stop-failure`.
|
|
155
169
|
*/
|
|
156
|
-
export function wireHooks(settings, spec, agentHookPath,
|
|
170
|
+
export function wireHooks(settings, spec, agentHookPath, adapter) {
|
|
157
171
|
if (spec.rootVersion !== undefined && settings.version === undefined) {
|
|
158
172
|
settings.version = spec.rootVersion;
|
|
159
173
|
}
|
|
@@ -173,7 +187,7 @@ export function wireHooks(settings, spec, agentHookPath, harness) {
|
|
|
173
187
|
settings.hooks[settingsKey] = kept;
|
|
174
188
|
}
|
|
175
189
|
for (const { settingsKey, subcommand } of spec.events) {
|
|
176
|
-
const command = hookCommand(spec, agentHookPath, subcommand,
|
|
190
|
+
const command = hookCommand(spec, agentHookPath, subcommand, adapter);
|
|
177
191
|
const groups = settings.hooks[settingsKey] ?? [];
|
|
178
192
|
let present = false;
|
|
179
193
|
for (const group of groups) {
|
|
@@ -192,18 +206,18 @@ export function wireHooks(settings, spec, agentHookPath, harness) {
|
|
|
192
206
|
return { wired, already, removed, upgraded };
|
|
193
207
|
}
|
|
194
208
|
/**
|
|
195
|
-
* The canonical hook command for one event. When the
|
|
209
|
+
* The canonical hook command for one event. When the adapter exports a
|
|
196
210
|
* project-dir env var to hook processes (Claude Code's CLAUDE_PROJECT_DIR),
|
|
197
211
|
* anchor the agent-hook path on it: hook processes inherit the session
|
|
198
212
|
* shell's cwd, which follows `cd` away from the project root — a bare
|
|
199
213
|
* relative path silently fails to spawn from there (no events, no image
|
|
200
|
-
* capture, no guards). `:-.` keeps the command working on
|
|
214
|
+
* capture, no guards). `:-.` keeps the command working on adapter versions
|
|
201
215
|
* that don't set the var. Only the env expansion is quoted so the
|
|
202
216
|
* `agent-hook <subcommand> ` wiring match stays byte-identical.
|
|
203
217
|
*/
|
|
204
|
-
function hookCommand(spec, agentHookPath, subcommand,
|
|
218
|
+
function hookCommand(spec, agentHookPath, subcommand, adapter) {
|
|
205
219
|
const anchor = spec.projectDirEnv ? `"\${${spec.projectDirEnv}:-.}"/` : "";
|
|
206
|
-
return `bash ${anchor}${agentHookPath} ${subcommand} --
|
|
220
|
+
return `bash ${anchor}${agentHookPath} ${subcommand} --adapter ${adapter}`;
|
|
207
221
|
}
|
|
208
222
|
/**
|
|
209
223
|
* Rewrite any harnery-owned command for `subcommand` inside one hook group to
|
|
@@ -242,8 +256,8 @@ function rewriteStaleCommands(group, subcommand, canonical, onPresent) {
|
|
|
242
256
|
* contains `agent-hook ` (the trailing space matches `agent-hook <subcommand>`),
|
|
243
257
|
* so any non-harnery hook the consumer added is preserved. Emptied
|
|
244
258
|
* `hooks[settingsKey]` arrays are dropped; an emptied `hooks` object is dropped
|
|
245
|
-
* entirely.
|
|
246
|
-
*
|
|
259
|
+
* entirely. Adapter-agnostic (scans every key) so it removes entries left by any
|
|
260
|
+
* adapter. Pure (no fs) so it's unit-testable. Returns the count removed and the
|
|
247
261
|
* count of non-harnery hooks left behind.
|
|
248
262
|
*/
|
|
249
263
|
export function unwireHooks(settings) {
|
|
@@ -334,7 +348,7 @@ export function stampBinName(configPath, binName, dryRun) {
|
|
|
334
348
|
return `+ added binName "${binName}" to ${rel(configPath)}`;
|
|
335
349
|
}
|
|
336
350
|
/** The commented workflow-billing default block init stamps into config.jsonc. */
|
|
337
|
-
const WORKFLOW_DEFAULT_BLOCK = ` // Workflow children ride the logged-in (subscription)
|
|
351
|
+
const WORKFLOW_DEFAULT_BLOCK = ` // Workflow children ride the logged-in (subscription) adapter auth; this pin\n` +
|
|
338
352
|
` // scrubs API-key vars from child envs so runs can never bill per-token rates.\n` +
|
|
339
353
|
` // Key-only hosts (CI): set false, or HARNERY_WORKFLOW_SUBSCRIPTION_ONLY=0.\n` +
|
|
340
354
|
` "workflow": { "subscriptionOnly": true }`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
2
|
import type { EmitContext } from "../commander.js";
|
|
3
|
-
export declare function
|
|
4
|
-
//# sourceMappingURL=
|
|
3
|
+
export declare function registerJournalCommand(program: Command, emitParam: EmitContext): void;
|
|
4
|
+
//# sourceMappingURL=journal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/commands/journal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA6BnD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,GAAG,IAAI,CA2RrF"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync, statSync, unlinkSync, watch } from "node:fs";
|
|
2
2
|
import { resolve as resolvePath } from "node:path";
|
|
3
|
-
import { emitCanonical,
|
|
3
|
+
import { emitCanonical, normalizeAdapter, readHeartbeat } from "../core/agents/index.js";
|
|
4
4
|
import { resolveBinName } from "../core/config.js";
|
|
5
|
-
import { appendEntry,
|
|
5
|
+
import { appendEntry, archiveJournal, currentOwnerOrThrow, JOURNAL_CATEGORIES, journalDir, journalPath, lintJournal, listArchives, loadJournal, parseJournal, pruneArchives, resolveOwnerByName, sweepOrphanJournals, } from "../core/journal/index.js";
|
|
6
6
|
/**
|
|
7
|
-
* `harn
|
|
7
|
+
* `harn journal`: per-agent markdown journal at `.harnery/journal/<instance_id>.md`.
|
|
8
8
|
* Used both for self-notes (surviving compaction) and peer coordination (other
|
|
9
9
|
* agents pull-read it on demand). SessionEnd hook archives; SessionStart
|
|
10
10
|
* janitor surfaces the most-recent archive as a recovery cue.
|
|
11
11
|
*/
|
|
12
12
|
let emit;
|
|
13
|
-
export function
|
|
13
|
+
export function registerJournalCommand(program, emitParam) {
|
|
14
14
|
emit = emitParam;
|
|
15
15
|
const root = program
|
|
16
|
-
.command("
|
|
16
|
+
.command("journal")
|
|
17
17
|
.description("Per-agent markdown journal: append-only timestamped entries. " +
|
|
18
18
|
"Survives in-session compaction, archived at session end, pruned after 7 days.");
|
|
19
19
|
// ── add ───────────────────────────────────────────────────────────────
|
|
20
20
|
root
|
|
21
21
|
.command("add <category> <text...>")
|
|
22
|
-
.description(`Append an entry to my
|
|
22
|
+
.description(`Append an entry to my journal. Category: ${JOURNAL_CATEGORIES.join(" | ")}`)
|
|
23
23
|
.action((category, text) => {
|
|
24
24
|
const cat = validateCategory(category);
|
|
25
25
|
const body = text.join(" ");
|
|
26
26
|
if (!body.trim()) {
|
|
27
|
-
emit.error({ code: "empty_body", message: "
|
|
27
|
+
emit.error({ code: "empty_body", message: "journal add: body is empty" });
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
try {
|
|
@@ -32,10 +32,10 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
32
32
|
const doc = appendEntry(owner, cat, body);
|
|
33
33
|
const hb = readHeartbeat(owner);
|
|
34
34
|
emitCanonical({
|
|
35
|
-
type: "state.
|
|
35
|
+
type: "state.journal_append",
|
|
36
36
|
owner,
|
|
37
37
|
session: hb?.session_id ?? owner,
|
|
38
|
-
|
|
38
|
+
adapter: normalizeAdapter(hb?.platform),
|
|
39
39
|
data: {
|
|
40
40
|
category: cat,
|
|
41
41
|
body_summary: body.length > 1000 ? `${body.slice(0, 997)}...` : body,
|
|
@@ -58,8 +58,8 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
58
58
|
// ── read ──────────────────────────────────────────────────────────────
|
|
59
59
|
root
|
|
60
60
|
.command("read")
|
|
61
|
-
.description("Render a
|
|
62
|
-
.option("--name <name>", "Read the named peer's
|
|
61
|
+
.description("Render a journal to stdout. No --name: my own. With --name: a peer's.")
|
|
62
|
+
.option("--name <name>", "Read the named peer's journal (case-insensitive)")
|
|
63
63
|
.option("--owner <id>", "Read by instance_id directly")
|
|
64
64
|
.option("--archive <basename>", "Read an archive file (e.g. <owner>-<ts>.md)")
|
|
65
65
|
.option("--limit <n>", "Cap entries rendered (newest first)", "50")
|
|
@@ -75,8 +75,8 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
75
75
|
// ── list ──────────────────────────────────────────────────────────────
|
|
76
76
|
root
|
|
77
77
|
.command("list")
|
|
78
|
-
.description("Summarize all active
|
|
79
|
-
.option("--archives", "List archive files instead of active
|
|
78
|
+
.description("Summarize all active journals + archive count")
|
|
79
|
+
.option("--archives", "List archive files instead of active journals")
|
|
80
80
|
.action((opts) => {
|
|
81
81
|
try {
|
|
82
82
|
if (opts.archives) {
|
|
@@ -97,13 +97,13 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
97
97
|
emit.data({ rows: items });
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const dir =
|
|
100
|
+
const dir = journalDir();
|
|
101
101
|
const rows = [];
|
|
102
102
|
for (const f of readdirSync(dir)) {
|
|
103
103
|
if (!f.endsWith(".md"))
|
|
104
104
|
continue;
|
|
105
105
|
const instanceId = f.replace(/\.md$/, "");
|
|
106
|
-
const doc =
|
|
106
|
+
const doc = loadJournal(instanceId);
|
|
107
107
|
if (!doc)
|
|
108
108
|
continue;
|
|
109
109
|
rows.push({
|
|
@@ -126,28 +126,28 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
126
126
|
// ── tail ──────────────────────────────────────────────────────────────
|
|
127
127
|
root
|
|
128
128
|
.command("tail")
|
|
129
|
-
.description("Follow my
|
|
130
|
-
.option("--name <name>", "Tail the named peer's
|
|
129
|
+
.description("Follow my journal (or a peer's) for new entries.")
|
|
130
|
+
.option("--name <name>", "Tail the named peer's journal")
|
|
131
131
|
.option("--owner <id>", "Tail by instance_id directly")
|
|
132
132
|
.action(async (opts) => {
|
|
133
133
|
try {
|
|
134
134
|
const owner = resolveTargetOwner(opts);
|
|
135
|
-
const path =
|
|
135
|
+
const path = journalPath(owner);
|
|
136
136
|
if (!existsSync(path)) {
|
|
137
|
-
emit.error({ code: "
|
|
137
|
+
emit.error({ code: "no_journal", message: `no journal at ${path} yet` });
|
|
138
138
|
process.exit(1);
|
|
139
139
|
}
|
|
140
140
|
process.stderr.write(`tailing ${path}\n`); // lint-ok-emission: tail banner, immediate stderr flush before streaming
|
|
141
141
|
let lastSize = statSync(path).size;
|
|
142
142
|
// Print initial render
|
|
143
|
-
process.stdout.write(`${
|
|
143
|
+
process.stdout.write(`${renderJournal(loadJournal(owner), 10)}\n`); // lint-ok-emission: streaming tail body
|
|
144
144
|
const w = watch(path, { persistent: true }, () => {
|
|
145
145
|
try {
|
|
146
146
|
const curr = statSync(path).size;
|
|
147
147
|
if (curr === lastSize)
|
|
148
148
|
return;
|
|
149
149
|
lastSize = curr;
|
|
150
|
-
const doc =
|
|
150
|
+
const doc = loadJournal(owner);
|
|
151
151
|
if (!doc)
|
|
152
152
|
return;
|
|
153
153
|
const newest = doc.entries[0];
|
|
@@ -177,7 +177,7 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
177
177
|
// ── clear ─────────────────────────────────────────────────────────────
|
|
178
178
|
root
|
|
179
179
|
.command("clear")
|
|
180
|
-
.description("Delete my
|
|
180
|
+
.description("Delete my journal (rare; mainly for testing)")
|
|
181
181
|
.option("--yes", "Confirm deletion")
|
|
182
182
|
.action((opts) => {
|
|
183
183
|
if (!opts.yes) {
|
|
@@ -186,7 +186,7 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
186
186
|
}
|
|
187
187
|
try {
|
|
188
188
|
const owner = currentOwnerOrThrow();
|
|
189
|
-
const path =
|
|
189
|
+
const path = journalPath(owner);
|
|
190
190
|
if (existsSync(path)) {
|
|
191
191
|
unlinkSync(path);
|
|
192
192
|
emit.data({ cleared: true, path });
|
|
@@ -203,9 +203,9 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
203
203
|
// ── lint ──────────────────────────────────────────────────────────────
|
|
204
204
|
root
|
|
205
205
|
.command("lint")
|
|
206
|
-
.description("Validate
|
|
207
|
-
.option("--all", "Lint every
|
|
208
|
-
.option("--owner <id>", "Lint a specific owner's
|
|
206
|
+
.description("Validate journal format + size")
|
|
207
|
+
.option("--all", "Lint every journal in .harnery/journal/")
|
|
208
|
+
.option("--owner <id>", "Lint a specific owner's journal")
|
|
209
209
|
.action((opts) => {
|
|
210
210
|
try {
|
|
211
211
|
runLint(opts);
|
|
@@ -218,12 +218,12 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
218
218
|
// ── archive (manual / hook helper) ────────────────────────────────────
|
|
219
219
|
root
|
|
220
220
|
.command("archive")
|
|
221
|
-
.description("Archive my
|
|
222
|
-
.option("--owner <id>", "Archive a specific owner's
|
|
221
|
+
.description("Archive my journal now (idempotent; fired by SessionEnd hook)")
|
|
222
|
+
.option("--owner <id>", "Archive a specific owner's journal")
|
|
223
223
|
.action((opts) => {
|
|
224
224
|
try {
|
|
225
225
|
const owner = opts.owner ?? currentOwnerOrThrow();
|
|
226
|
-
const dest =
|
|
226
|
+
const dest = archiveJournal(owner);
|
|
227
227
|
emit.data({ instance_id: owner, archived: !!dest, path: dest });
|
|
228
228
|
}
|
|
229
229
|
catch (err) {
|
|
@@ -256,9 +256,9 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
256
256
|
const ageStr = ageMin < 60 ? `${ageMin}m` : `${Math.floor(ageMin / 60)}h ${ageMin % 60}m`;
|
|
257
257
|
const bodyOneLine = last.body.replace(/\s+/g, " ").trim();
|
|
258
258
|
const bodyTrunc = bodyOneLine.length > 100 ? `${bodyOneLine.slice(0, 99)}…` : bodyOneLine;
|
|
259
|
-
const cue = `Recent
|
|
259
|
+
const cue = `Recent journal archive (${ageStr} ago): agent-${doc.header.name}: ` +
|
|
260
260
|
`last entry [${last.category}] "${bodyTrunc}". ` +
|
|
261
|
-
`Read full: \`${resolveBinName()}
|
|
261
|
+
`Read full: \`${resolveBinName()} journal read --archive ${newest.basename}\`.`;
|
|
262
262
|
process.stdout.write(`${cue}\n`); // lint-ok-emission: bash hook reads stdout to compose SessionStart additionalContext
|
|
263
263
|
}
|
|
264
264
|
catch (_err) {
|
|
@@ -268,13 +268,13 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
268
268
|
// ── janitor (SessionStart hook) ───────────────────────────────────────
|
|
269
269
|
root
|
|
270
270
|
.command("janitor")
|
|
271
|
-
.description("Prune old archives + sweep orphan
|
|
271
|
+
.description("Prune old archives + sweep orphan journals (heartbeat gone). Fired by SessionStart hook.")
|
|
272
272
|
.option("--days <n>", "Archive retention in days", "7")
|
|
273
273
|
.option("--quiet", "Suppress stdout output")
|
|
274
274
|
.action((opts) => {
|
|
275
275
|
try {
|
|
276
276
|
const days = Number.parseInt(opts.days, 10);
|
|
277
|
-
const swept =
|
|
277
|
+
const swept = sweepOrphanJournals();
|
|
278
278
|
const pruned = pruneArchives(days);
|
|
279
279
|
if (!opts.quiet) {
|
|
280
280
|
emit.data({
|
|
@@ -294,7 +294,7 @@ export function registerScratchCommand(program, emitParam) {
|
|
|
294
294
|
function runRead(opts) {
|
|
295
295
|
const limit = Number.parseInt(opts.limit, 10);
|
|
296
296
|
if (opts.archive) {
|
|
297
|
-
const dir =
|
|
297
|
+
const dir = journalDir();
|
|
298
298
|
const path = resolvePath(dir, "archived", opts.archive);
|
|
299
299
|
if (!existsSync(path)) {
|
|
300
300
|
emit.error({ code: "no_archive", message: `archive not found: ${opts.archive}` });
|
|
@@ -305,23 +305,23 @@ function runRead(opts) {
|
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
307
|
const owner = resolveTargetOwner(opts);
|
|
308
|
-
const doc =
|
|
308
|
+
const doc = loadJournal(owner);
|
|
309
309
|
if (!doc) {
|
|
310
310
|
emit.error({
|
|
311
|
-
code: "
|
|
312
|
-
message: `no
|
|
311
|
+
code: "no_journal",
|
|
312
|
+
message: `no journal for owner=${owner.slice(0, 8)}… (file not created yet)`,
|
|
313
313
|
});
|
|
314
314
|
process.exit(1);
|
|
315
315
|
}
|
|
316
316
|
const hb = readHeartbeat(owner);
|
|
317
317
|
const staleBanner = renderStaleBannerIfNeeded(hb?.last_heartbeat);
|
|
318
|
-
process.stdout.write(`${staleBanner +
|
|
318
|
+
process.stdout.write(`${staleBanner + renderJournal(doc, limit)}\n`); // lint-ok-emission: pretty render, multi-line markdown for direct TTY/pipe consumption
|
|
319
319
|
}
|
|
320
320
|
function runLint(opts) {
|
|
321
|
-
const dir =
|
|
321
|
+
const dir = journalDir();
|
|
322
322
|
const files = [];
|
|
323
323
|
if (opts.owner) {
|
|
324
|
-
files.push(
|
|
324
|
+
files.push(journalPath(opts.owner));
|
|
325
325
|
}
|
|
326
326
|
else if (opts.all) {
|
|
327
327
|
for (const f of readdirSync(dir)) {
|
|
@@ -331,7 +331,7 @@ function runLint(opts) {
|
|
|
331
331
|
}
|
|
332
332
|
else {
|
|
333
333
|
const owner = currentOwnerOrThrow();
|
|
334
|
-
files.push(
|
|
334
|
+
files.push(journalPath(owner));
|
|
335
335
|
}
|
|
336
336
|
let totalIssues = 0;
|
|
337
337
|
const reports = [];
|
|
@@ -341,7 +341,7 @@ function runLint(opts) {
|
|
|
341
341
|
continue;
|
|
342
342
|
}
|
|
343
343
|
const content = readFileSync(path, "utf8");
|
|
344
|
-
const issues =
|
|
344
|
+
const issues = lintJournal(content);
|
|
345
345
|
if (issues.length > 0)
|
|
346
346
|
totalIssues += issues.length;
|
|
347
347
|
reports.push({ path, issues });
|
|
@@ -352,10 +352,10 @@ function runLint(opts) {
|
|
|
352
352
|
}
|
|
353
353
|
// ─── Helpers ──────────────────────────────────────────────────────────────
|
|
354
354
|
function validateCategory(c) {
|
|
355
|
-
if (!
|
|
355
|
+
if (!JOURNAL_CATEGORIES.includes(c)) {
|
|
356
356
|
emit.error({
|
|
357
357
|
code: "bad_category",
|
|
358
|
-
message: `category must be one of: ${
|
|
358
|
+
message: `category must be one of: ${JOURNAL_CATEGORIES.join(", ")}`,
|
|
359
359
|
});
|
|
360
360
|
process.exit(1);
|
|
361
361
|
}
|
|
@@ -377,9 +377,9 @@ function resolveTargetOwner(opts) {
|
|
|
377
377
|
}
|
|
378
378
|
return currentOwnerOrThrow();
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function renderJournal(doc, limit) {
|
|
381
381
|
const lines = [];
|
|
382
|
-
lines.push(`#
|
|
382
|
+
lines.push(`# Journal: agent-${doc.header.name}`);
|
|
383
383
|
if (doc.header.session_id)
|
|
384
384
|
lines.push(`session_id: ${doc.header.session_id}`);
|
|
385
385
|
if (doc.header.machine)
|
|
@@ -418,7 +418,7 @@ function parseSafe(path) {
|
|
|
418
418
|
if (!existsSync(path))
|
|
419
419
|
return null;
|
|
420
420
|
const content = readFileSync(path, "utf8");
|
|
421
|
-
return
|
|
421
|
+
return parseJournal(path, content);
|
|
422
422
|
}
|
|
423
423
|
catch {
|
|
424
424
|
return null;
|
package/dist/commands/policy.js
CHANGED
|
@@ -33,7 +33,7 @@ export function renderPolicy(policy, digest) {
|
|
|
33
33
|
`unknown cost: ${policy.unknown_cost}`,
|
|
34
34
|
`network: ${policy.network}`,
|
|
35
35
|
`external actions: ${policy.external_actions}`,
|
|
36
|
-
`
|
|
36
|
+
`adapters: ${policy.allowed_adapters?.join(", ") ?? "any"}`,
|
|
37
37
|
`models: ${policy.allowed_models?.join(", ") ?? "any"}`,
|
|
38
38
|
`paths: ${policy.allowed_paths?.join(", ") ?? "any"}`,
|
|
39
39
|
`isolation: ${policy.allowed_isolation?.join(", ") ?? "any"}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { monorepoRoot } from "../core/agents/coord-client.js";
|
|
2
|
-
import { emitCanonical,
|
|
2
|
+
import { emitCanonical, normalizeAdapter, readHeartbeat, resolveOwner, } from "../core/agents/index.js";
|
|
3
3
|
import { fetchPresence, publishPresence, readRemoteMachines, relayDaemonStatus, runRelayDaemon, } from "../core/presence/index.js";
|
|
4
4
|
import { ageSeconds, applyDetection, clearPresence, formatAge, presenceFilePath, readPresence, writePresence, } from "../lib/presence.js";
|
|
5
5
|
/**
|
|
@@ -200,7 +200,7 @@ function emitPresenceChange(from, to, source) {
|
|
|
200
200
|
type: "state.presence_change",
|
|
201
201
|
owner,
|
|
202
202
|
session: hb?.session_id ?? owner,
|
|
203
|
-
|
|
203
|
+
adapter: normalizeAdapter(hb?.platform),
|
|
204
204
|
data: { from, to, source },
|
|
205
205
|
});
|
|
206
206
|
}
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* via rclone (typically a Google Drive remote, but any rclone remote works).
|
|
4
4
|
*
|
|
5
5
|
* Scope: a deliberately small set of file types: durable identities,
|
|
6
|
-
* archived
|
|
6
|
+
* archived journals, council manifests. The high-churn machine-local
|
|
7
7
|
* stuff (events.ndjson, .pid-map/, active/, .last-intent.*) stays put.
|
|
8
8
|
*
|
|
9
9
|
* Subcommands:
|
package/dist/commands/sync.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* via rclone (typically a Google Drive remote, but any rclone remote works).
|
|
4
4
|
*
|
|
5
5
|
* Scope: a deliberately small set of file types: durable identities,
|
|
6
|
-
* archived
|
|
6
|
+
* archived journals, council manifests. The high-churn machine-local
|
|
7
7
|
* stuff (events.ndjson, .pid-map/, active/, .last-intent.*) stays put.
|
|
8
8
|
*
|
|
9
9
|
* Subcommands:
|
|
@@ -25,7 +25,7 @@ import path from "node:path";
|
|
|
25
25
|
import { syncJsoncConfig } from "../core/config.js";
|
|
26
26
|
// What we sync. Anything matching one of these (relative to .harnery/) is
|
|
27
27
|
// considered part of the sync set. Everything else stays local-only.
|
|
28
|
-
const SYNC_PATHS = ["identities/", "
|
|
28
|
+
const SYNC_PATHS = ["identities/", "journal/archived/", "councils/"];
|
|
29
29
|
function configPath() {
|
|
30
30
|
return path.join(os.homedir(), ".config", "harnery", "sync.json");
|
|
31
31
|
}
|
|
@@ -119,7 +119,7 @@ export function registerSyncCommand(program, emit) {
|
|
|
119
119
|
const sync = program
|
|
120
120
|
.command("sync")
|
|
121
121
|
.description("Cross-machine sync of curated .harnery/ subset (identities, archived " +
|
|
122
|
-
"
|
|
122
|
+
"journals, council manifests) via rclone. Google Drive is the " +
|
|
123
123
|
"expected remote; any rclone backend works.");
|
|
124
124
|
sync
|
|
125
125
|
.command("init")
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
2
|
import type { EmitContext, HarneryProgramContext } from "../commander.js";
|
|
3
|
+
import { type TunnelState } from "../lib/tunnel/state.js";
|
|
4
|
+
/**
|
|
5
|
+
* Restart ONE instance's gate in place, deliberately leaving the provider
|
|
6
|
+
* process running.
|
|
7
|
+
*
|
|
8
|
+
* That asymmetry is the whole point. A Cloudflare quick tunnel's hostname is
|
|
9
|
+
* minted by cloudflared at startup, so a full `down`/`up` hands back a NEW
|
|
10
|
+
* random *.trycloudflare.com URL and breaks every link already shared — a
|
|
11
|
+
* miserable trade for adding one IP. cloudflared only ever forwards to
|
|
12
|
+
* `localhost:<gate_port>`, so the gate beneath it can be swapped out and the
|
|
13
|
+
* edge reconnects without noticing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reloadOne(state: TunnelState): Promise<{
|
|
16
|
+
ok: boolean;
|
|
17
|
+
message: string;
|
|
18
|
+
}>;
|
|
3
19
|
export declare function registerTunnelCommand(program: Command, emitParam: EmitContext, contextParam?: HarneryProgramContext): void;
|
|
4
20
|
//# sourceMappingURL=tunnel.d.ts.map
|