harnery 0.0.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +84 -2
- package/bin/agent-coord +42 -0
- package/bin/agent-hook +44 -0
- package/bin/harn +40 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/commander.d.ts +128 -0
- package/dist/commander.d.ts.map +1 -0
- package/dist/commander.js +126 -0
- package/dist/commands/agents.d.ts +18 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +3946 -0
- package/dist/commands/backup.d.ts +22 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +262 -0
- package/dist/commands/browse-ai.d.ts +4 -0
- package/dist/commands/browse-ai.d.ts.map +1 -0
- package/dist/commands/browse-ai.js +156 -0
- package/dist/commands/browse.d.ts +4 -0
- package/dist/commands/browse.d.ts.map +1 -0
- package/dist/commands/browse.js +590 -0
- package/dist/commands/callers.d.ts +4 -0
- package/dist/commands/callers.d.ts.map +1 -0
- package/dist/commands/callers.js +276 -0
- package/dist/commands/completion.d.ts +17 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +158 -0
- package/dist/commands/config-get.d.ts +4 -0
- package/dist/commands/config-get.d.ts.map +1 -0
- package/dist/commands/config-get.js +131 -0
- package/dist/commands/context.d.ts +11 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +185 -0
- package/dist/commands/cookies.d.ts +4 -0
- package/dist/commands/cookies.d.ts.map +1 -0
- package/dist/commands/cookies.js +140 -0
- package/dist/commands/docs.d.ts +4 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +137 -0
- package/dist/commands/doctor.d.ts +25 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +200 -0
- package/dist/commands/edit-batch.d.ts +18 -0
- package/dist/commands/edit-batch.d.ts.map +1 -0
- package/dist/commands/edit-batch.js +172 -0
- package/dist/commands/eml.d.ts +4 -0
- package/dist/commands/eml.d.ts.map +1 -0
- package/dist/commands/eml.js +428 -0
- package/dist/commands/env.d.ts +4 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +201 -0
- package/dist/commands/fetch.d.ts +4 -0
- package/dist/commands/fetch.d.ts.map +1 -0
- package/dist/commands/fetch.js +99 -0
- package/dist/commands/file-history.d.ts +4 -0
- package/dist/commands/file-history.d.ts.map +1 -0
- package/dist/commands/file-history.js +152 -0
- package/dist/commands/grep.d.ts +4 -0
- package/dist/commands/grep.d.ts.map +1 -0
- package/dist/commands/grep.js +317 -0
- package/dist/commands/init.d.ts +82 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +288 -0
- package/dist/commands/outline.d.ts +4 -0
- package/dist/commands/outline.d.ts.map +1 -0
- package/dist/commands/outline.js +509 -0
- package/dist/commands/presence.d.ts +12 -0
- package/dist/commands/presence.d.ts.map +1 -0
- package/dist/commands/presence.js +123 -0
- package/dist/commands/read.d.ts +7 -0
- package/dist/commands/read.d.ts.map +1 -0
- package/dist/commands/read.js +46 -0
- package/dist/commands/scratch.d.ts +4 -0
- package/dist/commands/scratch.d.ts.map +1 -0
- package/dist/commands/scratch.js +426 -0
- package/dist/commands/session.d.ts +4 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +162 -0
- package/dist/commands/sync.d.ts +24 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +275 -0
- package/dist/commands/toc.d.ts +5 -0
- package/dist/commands/toc.d.ts.map +1 -0
- package/dist/commands/toc.js +153 -0
- package/dist/commands/tokens.d.ts +4 -0
- package/dist/commands/tokens.d.ts.map +1 -0
- package/dist/commands/tokens.js +48 -0
- package/dist/commands/tunnel.d.ts +4 -0
- package/dist/commands/tunnel.d.ts.map +1 -0
- package/dist/commands/tunnel.js +513 -0
- package/dist/commands/uninstall.d.ts +22 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +126 -0
- package/dist/commands/web.d.ts +4 -0
- package/dist/commands/web.d.ts.map +1 -0
- package/dist/commands/web.js +165 -0
- package/dist/core/agents/canonical-emit.d.ts +27 -0
- package/dist/core/agents/canonical-emit.d.ts.map +1 -0
- package/dist/core/agents/canonical-emit.js +72 -0
- package/dist/core/agents/cli-emit.d.ts +27 -0
- package/dist/core/agents/cli-emit.d.ts.map +1 -0
- package/dist/core/agents/cli-emit.js +57 -0
- package/dist/core/agents/cli.d.ts +10 -0
- package/dist/core/agents/cli.d.ts.map +1 -0
- package/dist/core/agents/cli.js +757 -0
- package/dist/core/agents/codex-replay.d.ts +29 -0
- package/dist/core/agents/codex-replay.d.ts.map +1 -0
- package/dist/core/agents/codex-replay.js +138 -0
- package/dist/core/agents/coord-client.d.ts +98 -0
- package/dist/core/agents/coord-client.d.ts.map +1 -0
- package/dist/core/agents/coord-client.js +212 -0
- package/dist/core/agents/events/consume.d.ts +59 -0
- package/dist/core/agents/events/consume.d.ts.map +1 -0
- package/dist/core/agents/events/consume.js +147 -0
- package/dist/core/agents/events/emit.d.ts +42 -0
- package/dist/core/agents/events/emit.d.ts.map +1 -0
- package/dist/core/agents/events/emit.js +70 -0
- package/dist/core/agents/events/ulid.d.ts +11 -0
- package/dist/core/agents/events/ulid.d.ts.map +1 -0
- package/dist/core/agents/events/ulid.js +47 -0
- package/dist/core/agents/index.d.ts +14 -0
- package/dist/core/agents/index.d.ts.map +1 -0
- package/dist/core/agents/index.js +13 -0
- package/dist/core/agents/paths.d.ts +6 -0
- package/dist/core/agents/paths.d.ts.map +1 -0
- package/dist/core/agents/paths.js +17 -0
- package/dist/core/agents/render/prompt-context.d.ts +43 -0
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -0
- package/dist/core/agents/render/prompt-context.js +335 -0
- package/dist/core/agents/render/session-context.d.ts +39 -0
- package/dist/core/agents/render/session-context.d.ts.map +1 -0
- package/dist/core/agents/render/session-context.js +283 -0
- package/dist/core/agents/rules/claim-conflict.d.ts +35 -0
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -0
- package/dist/core/agents/rules/claim-conflict.js +244 -0
- package/dist/core/agents/rules/commit-conflict.d.ts +59 -0
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -0
- package/dist/core/agents/rules/commit-conflict.js +244 -0
- package/dist/core/agents/rules/stop-hook.d.ts +44 -0
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -0
- package/dist/core/agents/rules/stop-hook.js +161 -0
- package/dist/core/agents/session-events.d.ts +41 -0
- package/dist/core/agents/session-events.d.ts.map +1 -0
- package/dist/core/agents/session-events.js +205 -0
- package/dist/core/agents/state/activity-log.d.ts +18 -0
- package/dist/core/agents/state/activity-log.d.ts.map +1 -0
- package/dist/core/agents/state/activity-log.js +34 -0
- package/dist/core/agents/state/council.d.ts +39 -0
- package/dist/core/agents/state/council.d.ts.map +1 -0
- package/dist/core/agents/state/council.js +216 -0
- package/dist/core/agents/state/heartbeat-projector.d.ts +59 -0
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +1 -0
- package/dist/core/agents/state/heartbeat-projector.js +436 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts +64 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -0
- package/dist/core/agents/state/heartbeat-writer.js +271 -0
- package/dist/core/agents/state/names.d.ts +35 -0
- package/dist/core/agents/state/names.d.ts.map +1 -0
- package/dist/core/agents/state/names.js +376 -0
- package/dist/core/agents/state/pidmap.d.ts +11 -0
- package/dist/core/agents/state/pidmap.d.ts.map +1 -0
- package/dist/core/agents/state/pidmap.js +32 -0
- package/dist/core/agents/state/scratch.d.ts +27 -0
- package/dist/core/agents/state/scratch.d.ts.map +1 -0
- package/dist/core/agents/state/scratch.js +90 -0
- package/dist/core/agents/state/shell-mutation.d.ts +17 -0
- package/dist/core/agents/state/shell-mutation.d.ts.map +1 -0
- package/dist/core/agents/state/shell-mutation.js +41 -0
- package/dist/core/agents/state/stale-sweep.d.ts +16 -0
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -0
- package/dist/core/agents/state/stale-sweep.js +166 -0
- package/dist/core/config.d.ts +29 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +108 -0
- package/dist/core/hooks/cli.d.ts +21 -0
- package/dist/core/hooks/cli.d.ts.map +1 -0
- package/dist/core/hooks/cli.js +1123 -0
- package/dist/core/hooks/effects/image-capture.d.ts +43 -0
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -0
- package/dist/core/hooks/effects/image-capture.js +288 -0
- package/dist/core/hooks/effects/index.d.ts +64 -0
- package/dist/core/hooks/effects/index.d.ts.map +1 -0
- package/dist/core/hooks/effects/index.js +197 -0
- package/dist/core/hooks/events/emit.d.ts +31 -0
- package/dist/core/hooks/events/emit.d.ts.map +1 -0
- package/dist/core/hooks/events/emit.js +89 -0
- package/dist/core/hooks/events/schema.d.ts +235 -0
- package/dist/core/hooks/events/schema.d.ts.map +1 -0
- package/dist/core/hooks/events/schema.js +12 -0
- package/dist/core/hooks/events/ulid.d.ts +10 -0
- package/dist/core/hooks/events/ulid.d.ts.map +1 -0
- package/dist/core/hooks/events/ulid.js +47 -0
- package/dist/core/hooks/harness/detect.d.ts +9 -0
- package/dist/core/hooks/harness/detect.d.ts.map +1 -0
- package/dist/core/hooks/harness/detect.js +29 -0
- package/dist/core/hooks/harness/events.d.ts +45 -0
- package/dist/core/hooks/harness/events.d.ts.map +1 -0
- package/dist/core/hooks/harness/events.js +71 -0
- package/dist/core/hooks/harness/output.d.ts +46 -0
- package/dist/core/hooks/harness/output.d.ts.map +1 -0
- package/dist/core/hooks/harness/output.js +87 -0
- package/dist/core/hooks/harness/parse.d.ts +67 -0
- package/dist/core/hooks/harness/parse.d.ts.map +1 -0
- package/dist/core/hooks/harness/parse.js +132 -0
- package/dist/core/hooks/index.d.ts +8 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/hooks/index.js +7 -0
- package/dist/core/hooks/resolve/anchor.d.ts +37 -0
- package/dist/core/hooks/resolve/anchor.d.ts.map +1 -0
- package/dist/core/hooks/resolve/anchor.js +48 -0
- package/dist/core/hooks/resolve/coord-root.d.ts +6 -0
- package/dist/core/hooks/resolve/coord-root.d.ts.map +1 -0
- package/dist/core/hooks/resolve/coord-root.js +27 -0
- package/dist/core/hooks/resolve/intent.d.ts +33 -0
- package/dist/core/hooks/resolve/intent.d.ts.map +1 -0
- package/dist/core/hooks/resolve/intent.js +79 -0
- package/dist/core/hooks/resolve/owner.d.ts +42 -0
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -0
- package/dist/core/hooks/resolve/owner.js +140 -0
- package/dist/core/hooks/resolve/transcript.d.ts +26 -0
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -0
- package/dist/core/hooks/resolve/transcript.js +73 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/lib/agent-browser/client.d.ts +99 -0
- package/dist/lib/agent-browser/client.d.ts.map +1 -0
- package/dist/lib/agent-browser/client.js +177 -0
- package/dist/lib/agent-browser/index.d.ts +2 -0
- package/dist/lib/agent-browser/index.d.ts.map +1 -0
- package/dist/lib/agent-browser/index.js +1 -0
- package/dist/lib/browser/client.d.ts +193 -0
- package/dist/lib/browser/client.d.ts.map +1 -0
- package/dist/lib/browser/client.js +325 -0
- package/dist/lib/browser/dev-overlay.d.ts +23 -0
- package/dist/lib/browser/dev-overlay.d.ts.map +1 -0
- package/dist/lib/browser/dev-overlay.js +153 -0
- package/dist/lib/browser/index.d.ts +5 -0
- package/dist/lib/browser/index.d.ts.map +1 -0
- package/dist/lib/browser/index.js +2 -0
- package/dist/lib/browser/layout.d.ts +79 -0
- package/dist/lib/browser/layout.d.ts.map +1 -0
- package/dist/lib/browser/layout.js +220 -0
- package/dist/lib/browser/visibility.d.ts +86 -0
- package/dist/lib/browser/visibility.d.ts.map +1 -0
- package/dist/lib/browser/visibility.js +333 -0
- package/dist/lib/browser/visual-diff.d.ts +38 -0
- package/dist/lib/browser/visual-diff.d.ts.map +1 -0
- package/dist/lib/browser/visual-diff.js +107 -0
- package/dist/lib/completion/bash.d.ts +25 -0
- package/dist/lib/completion/bash.d.ts.map +1 -0
- package/dist/lib/completion/bash.js +284 -0
- package/dist/lib/completion/fish.d.ts +16 -0
- package/dist/lib/completion/fish.d.ts.map +1 -0
- package/dist/lib/completion/fish.js +118 -0
- package/dist/lib/completion/index.d.ts +5 -0
- package/dist/lib/completion/index.d.ts.map +1 -0
- package/dist/lib/completion/index.js +4 -0
- package/dist/lib/completion/walk.d.ts +68 -0
- package/dist/lib/completion/walk.d.ts.map +1 -0
- package/dist/lib/completion/walk.js +102 -0
- package/dist/lib/completion/zsh.d.ts +13 -0
- package/dist/lib/completion/zsh.d.ts.map +1 -0
- package/dist/lib/completion/zsh.js +249 -0
- package/dist/lib/context/index.d.ts +107 -0
- package/dist/lib/context/index.d.ts.map +1 -0
- package/dist/lib/context/index.js +275 -0
- package/dist/lib/cookies/client.d.ts +131 -0
- package/dist/lib/cookies/client.d.ts.map +1 -0
- package/dist/lib/cookies/client.js +239 -0
- package/dist/lib/cookies/index.d.ts +2 -0
- package/dist/lib/cookies/index.d.ts.map +1 -0
- package/dist/lib/cookies/index.js +1 -0
- package/dist/lib/council/index.d.ts +266 -0
- package/dist/lib/council/index.d.ts.map +1 -0
- package/dist/lib/council/index.js +674 -0
- package/dist/lib/docs-index.d.ts +28 -0
- package/dist/lib/docs-index.d.ts.map +1 -0
- package/dist/lib/docs-index.js +169 -0
- package/dist/lib/docs-lint.d.ts +26 -0
- package/dist/lib/docs-lint.d.ts.map +1 -0
- package/dist/lib/docs-lint.js +378 -0
- package/dist/lib/docs-sweep.d.ts +34 -0
- package/dist/lib/docs-sweep.d.ts.map +1 -0
- package/dist/lib/docs-sweep.js +304 -0
- package/dist/lib/docs.d.ts +27 -0
- package/dist/lib/docs.d.ts.map +1 -0
- package/dist/lib/docs.js +142 -0
- package/dist/lib/env.d.ts +11 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +12 -0
- package/dist/lib/exec.d.ts +32 -0
- package/dist/lib/exec.d.ts.map +1 -0
- package/dist/lib/exec.js +54 -0
- package/dist/lib/format.d.ts +29 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +139 -0
- package/dist/lib/http/client.d.ts +56 -0
- package/dist/lib/http/client.d.ts.map +1 -0
- package/dist/lib/http/client.js +160 -0
- package/dist/lib/http/index.d.ts +2 -0
- package/dist/lib/http/index.d.ts.map +1 -0
- package/dist/lib/http/index.js +1 -0
- package/dist/lib/identities/index.d.ts +77 -0
- package/dist/lib/identities/index.d.ts.map +1 -0
- package/dist/lib/identities/index.js +190 -0
- package/dist/lib/machine.d.ts +19 -0
- package/dist/lib/machine.d.ts.map +1 -0
- package/dist/lib/machine.js +61 -0
- package/dist/lib/presence.d.ts +48 -0
- package/dist/lib/presence.d.ts.map +1 -0
- package/dist/lib/presence.js +123 -0
- package/dist/lib/readability/client.d.ts +39 -0
- package/dist/lib/readability/client.d.ts.map +1 -0
- package/dist/lib/readability/client.js +121 -0
- package/dist/lib/readability/index.d.ts +2 -0
- package/dist/lib/readability/index.d.ts.map +1 -0
- package/dist/lib/readability/index.js +1 -0
- package/dist/lib/scratch/index.d.ts +74 -0
- package/dist/lib/scratch/index.d.ts.map +1 -0
- package/dist/lib/scratch/index.js +393 -0
- package/dist/lib/tunnel/gate.d.ts +12 -0
- package/dist/lib/tunnel/gate.d.ts.map +1 -0
- package/dist/lib/tunnel/gate.js +101 -0
- package/dist/lib/tunnel/state.d.ts +34 -0
- package/dist/lib/tunnel/state.d.ts.map +1 -0
- package/dist/lib/tunnel/state.js +132 -0
- package/package.json +160 -8
- package/schemas/.gitkeep +0 -0
- package/schemas/config.schema.json +109 -0
- package/src/cli.ts +22 -0
- package/src/commander.ts +242 -0
- package/src/commands/.gitkeep +0 -0
- package/src/commands/agents.ts +4567 -0
- package/src/commands/backup.ts +305 -0
- package/src/commands/browse-ai.ts +198 -0
- package/src/commands/browse.ts +849 -0
- package/src/commands/callers.ts +363 -0
- package/src/commands/completion.ts +193 -0
- package/src/commands/config-get.ts +161 -0
- package/src/commands/context.ts +209 -0
- package/src/commands/cookies.ts +198 -0
- package/src/commands/docs.ts +174 -0
- package/src/commands/doctor.ts +231 -0
- package/src/commands/edit-batch.ts +233 -0
- package/src/commands/eml.ts +519 -0
- package/src/commands/env.ts +254 -0
- package/src/commands/fetch.ts +136 -0
- package/src/commands/file-history.ts +202 -0
- package/src/commands/grep.ts +371 -0
- package/src/commands/init.ts +335 -0
- package/src/commands/outline.ts +583 -0
- package/src/commands/presence.ts +152 -0
- package/src/commands/read.ts +64 -0
- package/src/commands/scratch.ts +445 -0
- package/src/commands/session.ts +187 -0
- package/src/commands/sync.ts +306 -0
- package/src/commands/toc.ts +218 -0
- package/src/commands/tokens.ts +79 -0
- package/src/commands/tunnel.ts +633 -0
- package/src/commands/uninstall.ts +144 -0
- package/src/commands/web.ts +193 -0
- package/src/core/agents/canonical-emit.ts +77 -0
- package/src/core/agents/cli-emit.ts +64 -0
- package/src/core/agents/cli.ts +838 -0
- package/src/core/agents/codex-replay.ts +163 -0
- package/src/core/agents/coord-client.ts +249 -0
- package/src/core/agents/events/consume.ts +196 -0
- package/src/core/agents/events/emit.ts +108 -0
- package/src/core/agents/events/ulid.ts +51 -0
- package/src/core/agents/index.ts +14 -0
- package/src/core/agents/paths.ts +16 -0
- package/src/core/agents/render/prompt-context.ts +401 -0
- package/src/core/agents/render/session-context.ts +341 -0
- package/src/core/agents/rules/claim-conflict.ts +282 -0
- package/src/core/agents/rules/commit-conflict.ts +303 -0
- package/src/core/agents/rules/stop-hook.ts +229 -0
- package/src/core/agents/session-events.ts +228 -0
- package/src/core/agents/state/activity-log.ts +33 -0
- package/src/core/agents/state/council.ts +265 -0
- package/src/core/agents/state/heartbeat-projector.ts +488 -0
- package/src/core/agents/state/heartbeat-writer.ts +333 -0
- package/src/core/agents/state/names.ts +399 -0
- package/src/core/agents/state/pidmap.ts +38 -0
- package/src/core/agents/state/scratch.ts +121 -0
- package/src/core/agents/state/shell-mutation.ts +44 -0
- package/src/core/agents/state/stale-sweep.ts +190 -0
- package/src/core/config.ts +111 -0
- package/src/core/hooks/cli.ts +1247 -0
- package/src/core/hooks/effects/image-capture.ts +330 -0
- package/src/core/hooks/effects/index.ts +210 -0
- package/src/core/hooks/events/emit.ts +120 -0
- package/src/core/hooks/events/schema.ts +430 -0
- package/src/core/hooks/events/ulid.ts +51 -0
- package/src/core/hooks/harness/detect.ts +30 -0
- package/src/core/hooks/harness/events.ts +102 -0
- package/src/core/hooks/harness/output.ts +100 -0
- package/src/core/hooks/harness/parse.ts +180 -0
- package/src/core/hooks/index.ts +16 -0
- package/src/core/hooks/resolve/anchor.ts +51 -0
- package/src/core/hooks/resolve/coord-root.ts +25 -0
- package/src/core/hooks/resolve/intent.ts +89 -0
- package/src/core/hooks/resolve/owner.ts +140 -0
- package/src/core/hooks/resolve/transcript.ts +72 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/index.ts +15 -0
- package/src/lib/agent-browser/client.ts +239 -0
- package/src/lib/agent-browser/index.ts +1 -0
- package/src/lib/browser/client.ts +449 -0
- package/src/lib/browser/dev-overlay.ts +207 -0
- package/src/lib/browser/index.ts +24 -0
- package/src/lib/browser/layout.ts +288 -0
- package/src/lib/browser/visibility.ts +419 -0
- package/src/lib/browser/visual-diff.ts +150 -0
- package/src/lib/completion/bash.ts +291 -0
- package/src/lib/completion/fish.ts +134 -0
- package/src/lib/completion/index.ts +10 -0
- package/src/lib/completion/walk.ts +184 -0
- package/src/lib/completion/zsh.ts +262 -0
- package/src/lib/context/index.ts +386 -0
- package/src/lib/cookies/client.ts +301 -0
- package/src/lib/cookies/index.ts +13 -0
- package/src/lib/council/index.ts +803 -0
- package/src/lib/docs-index.ts +216 -0
- package/src/lib/docs-lint.ts +413 -0
- package/src/lib/docs-sweep.ts +348 -0
- package/src/lib/docs.ts +199 -0
- package/src/lib/env.ts +12 -0
- package/src/lib/exec.ts +74 -0
- package/src/lib/format.ts +147 -0
- package/src/lib/http/client.ts +211 -0
- package/src/lib/http/index.ts +1 -0
- package/src/lib/identities/index.ts +210 -0
- package/src/lib/machine.ts +61 -0
- package/src/lib/presence.ts +154 -0
- package/src/lib/readability/client.ts +169 -0
- package/src/lib/readability/index.ts +5 -0
- package/src/lib/readability/turndown-plugin-gfm.d.ts +10 -0
- package/src/lib/scratch/index.ts +470 -0
- package/src/lib/tunnel/gate.ts +113 -0
- package/src/lib/tunnel/state.ts +167 -0
- package/src/web/.gitkeep +0 -0
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ryan Kelly
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,85 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/harnery-logo-reversed-transparent.svg">
|
|
4
|
+
<img src="assets/harnery-logo-transparent.svg" alt="Harnery" width="300">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
# Harnery
|
|
9
|
+
|
|
10
|
+
> Multi-agent coordination + harness adapters + portable CLI utilities for Claude Code / Cursor / Codex.
|
|
11
|
+
|
|
12
|
+
[](https://github.com/ryanjkelly/harnery/actions/workflows/ci.yml)
|
|
13
|
+
[](https://www.npmjs.com/package/harnery)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
|
|
16
|
+
> ⚠️ **Pre-1.0.** API surface is still settling. Pin a specific minor version (`harnery@^0.1.0`) and read the [CHANGELOG](CHANGELOG.md) before each upgrade.
|
|
17
|
+
|
|
18
|
+
## What it is
|
|
19
|
+
|
|
20
|
+
`harnery` is a utility layer extracted from years of building agent tooling across a multi-project monorepo. It bundles:
|
|
21
|
+
|
|
22
|
+
- **Multi-agent coordination:** per-agent heartbeats in `.harnery/active/`, claim-time and commit-time guards, the canonical event stream, harness adapters for Claude Code / Cursor / Codex.
|
|
23
|
+
- **Portable CLI utilities:** `tokens`, `eml`, `env`, `grep`, `docs`, `repo`, `wip`, `share`, `browse`, `fetch`, `read`, and more. Cross-platform and dependency-light, with sensible defaults out of the box.
|
|
24
|
+
- **Standalone web UI:** `harn web up` boots a local Next.js dashboard for the coord layer, councils, and per-project state. Ships with the git clone, not the npm package (see [Install](#install)).
|
|
25
|
+
- **Backup + sync:** `harn backup` snapshots `.harnery/` via [restic](https://restic.net/); `harn sync` keeps a curated subset live across machines via [rclone](https://rclone.org/) (Google Drive or any rclone remote).
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g harnery
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or as a per-project dep:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install harnery
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
harn --help
|
|
43
|
+
harn doctor # one-time runtime + dep check
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> **npm gives you the engine + CLI.** The `web/` dashboard and the `docs/` site live in the git repo, not the npm package (which is the CLI + coord engine: `bin`, `dist`, `src`, `schemas`). To run the dashboard, `git clone` the repo, `bun install`, and `harn web up` from there, pointing it at your project with `--coord-root <dir>` (or just run it from inside the project). `harn web up` prints these exact steps if you invoke it without the clone present.
|
|
47
|
+
|
|
48
|
+
## Use as a CLI library
|
|
49
|
+
|
|
50
|
+
Project-specific CLIs compose Harnery's command tree and add their own commands on top:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
// mycli/src/program.ts
|
|
54
|
+
import { createHarneryProgram } from 'harnery/commander';
|
|
55
|
+
import { deployCommand, dbCommand } from './commands';
|
|
56
|
+
|
|
57
|
+
const program = createHarneryProgram({
|
|
58
|
+
binName: 'mycli',
|
|
59
|
+
context: { projectName: 'my-monorepo' },
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
program.addCommand(deployCommand);
|
|
63
|
+
program.addCommand(dbCommand);
|
|
64
|
+
|
|
65
|
+
await program.parseAsync(process.argv);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`mycli agents status` then resolves to **the same code** as `harn agents status`, loaded as a library. See [examples/extending-with-commander.ts](examples/extending-with-commander.ts) for the full pattern.
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
Full docs at **[harnery.com](https://harnery.com)**:
|
|
73
|
+
|
|
74
|
+
- [Getting started](https://harnery.com/getting-started/install)
|
|
75
|
+
- [CLI reference](https://harnery.com/cli/)
|
|
76
|
+
- [Concepts](https://harnery.com/concepts/coord-layer)
|
|
77
|
+
- [Configuration schema](https://harnery.com/reference/config-schema)
|
|
78
|
+
|
|
79
|
+
## Contributing
|
|
80
|
+
|
|
81
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Bug reports and feature requests via [GitHub Issues](https://github.com/ryanjkelly/harnery/issues).
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
[MIT](LICENSE) © Ryan Kelly
|
package/bin/agent-coord
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Wrapper for agent-coord. Runs TypeScript directly via Bun.
|
|
3
|
+
#
|
|
4
|
+
# The canonical event-stream stamps `source: "agent-coord"`; consumers
|
|
5
|
+
# (hooks, CLI spawners) treat the path `harnery/bin/agent-coord` as an
|
|
6
|
+
# opaque address. Sibling launcher is `harnery/bin/harn` for the main
|
|
7
|
+
# harn CLI.
|
|
8
|
+
SCRIPT_PATH="${BASH_SOURCE[0]:-$0}"
|
|
9
|
+
while [ -L "$SCRIPT_PATH" ]; do
|
|
10
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
11
|
+
LINK_TARGET="$(readlink "$SCRIPT_PATH")"
|
|
12
|
+
case "$LINK_TARGET" in
|
|
13
|
+
/*) SCRIPT_PATH="$LINK_TARGET" ;;
|
|
14
|
+
*) SCRIPT_PATH="$SCRIPT_DIR/$LINK_TARGET" ;;
|
|
15
|
+
esac
|
|
16
|
+
done
|
|
17
|
+
MODULE_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
18
|
+
|
|
19
|
+
# Find bun in common install locations if not already on PATH. Hooks fire
|
|
20
|
+
# under bash subshells whose PATH may differ from the interactive shell.
|
|
21
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
22
|
+
for candidate in \
|
|
23
|
+
"$HOME/.bun/bin/bun" \
|
|
24
|
+
"/usr/local/bin/bun" \
|
|
25
|
+
"/opt/homebrew/bin/bun"; do
|
|
26
|
+
if [ -x "$candidate" ]; then
|
|
27
|
+
export PATH="$(dirname "$candidate"):$PATH"
|
|
28
|
+
break
|
|
29
|
+
fi
|
|
30
|
+
done
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Bun-first (zero-build TS); Node-with-dist/ fallback. The published package
|
|
34
|
+
# ships dist/, so this works on a Node-only host with no Bun installed.
|
|
35
|
+
if command -v bun >/dev/null 2>&1; then
|
|
36
|
+
exec bun run "$MODULE_DIR/src/core/agents/cli.ts" "$@"
|
|
37
|
+
elif [ -f "$MODULE_DIR/dist/core/agents/cli.js" ]; then
|
|
38
|
+
exec node "$MODULE_DIR/dist/core/agents/cli.js" "$@"
|
|
39
|
+
else
|
|
40
|
+
echo "agent-coord: needs Bun or a built dist/. Install Bun (https://bun.sh), or build: npm install && npm run build." >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
package/bin/agent-hook
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Wrapper for agent-hook. Runs TypeScript directly via Bun.
|
|
3
|
+
#
|
|
4
|
+
# Lives in harnery/ as of commit 4 of the harnery v0.1 strangler-fig. The
|
|
5
|
+
# binary name stays `agent-hook` because every harness's hooks.json /
|
|
6
|
+
# settings.json line spawns by that bare name + path. Sibling launchers
|
|
7
|
+
# are `harnery/bin/harn` (main CLI) + `harnery/bin/agent-coord` (coord
|
|
8
|
+
# state).
|
|
9
|
+
SCRIPT_PATH="${BASH_SOURCE[0]:-$0}"
|
|
10
|
+
while [ -L "$SCRIPT_PATH" ]; do
|
|
11
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
12
|
+
LINK_TARGET="$(readlink "$SCRIPT_PATH")"
|
|
13
|
+
case "$LINK_TARGET" in
|
|
14
|
+
/*) SCRIPT_PATH="$LINK_TARGET" ;;
|
|
15
|
+
*) SCRIPT_PATH="$SCRIPT_DIR/$LINK_TARGET" ;;
|
|
16
|
+
esac
|
|
17
|
+
done
|
|
18
|
+
MODULE_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
19
|
+
|
|
20
|
+
# Find bun in common install locations if not already on PATH. Hooks fire
|
|
21
|
+
# under bash subshells whose PATH may differ from the interactive shell.
|
|
22
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
23
|
+
for candidate in \
|
|
24
|
+
"$HOME/.bun/bin/bun" \
|
|
25
|
+
"/usr/local/bin/bun" \
|
|
26
|
+
"/opt/homebrew/bin/bun"; do
|
|
27
|
+
if [ -x "$candidate" ]; then
|
|
28
|
+
export PATH="$(dirname "$candidate"):$PATH"
|
|
29
|
+
break
|
|
30
|
+
fi
|
|
31
|
+
done
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Bun-first (zero-build TS); Node-with-dist/ fallback. The published package
|
|
35
|
+
# ships dist/, so harness hooks that spawn `agent-hook` work on a Node-only
|
|
36
|
+
# host with no Bun installed.
|
|
37
|
+
if command -v bun >/dev/null 2>&1; then
|
|
38
|
+
exec bun run "$MODULE_DIR/src/core/hooks/cli.ts" "$@"
|
|
39
|
+
elif [ -f "$MODULE_DIR/dist/core/hooks/cli.js" ]; then
|
|
40
|
+
exec node "$MODULE_DIR/dist/core/hooks/cli.js" "$@"
|
|
41
|
+
else
|
|
42
|
+
echo "agent-hook: needs Bun or a built dist/. Install Bun (https://bun.sh), or build: npm install && npm run build." >&2
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
package/bin/harn
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Wrapper for the harn CLI. Prefers Bun for daily dev (zero-build TS execution);
|
|
3
|
+
# falls back to Node if the package was built to dist/ and Bun is unavailable.
|
|
4
|
+
|
|
5
|
+
SCRIPT_PATH="${BASH_SOURCE[0]:-$0}"
|
|
6
|
+
while [ -L "$SCRIPT_PATH" ]; do
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
8
|
+
LINK_TARGET="$(readlink "$SCRIPT_PATH")"
|
|
9
|
+
case "$LINK_TARGET" in
|
|
10
|
+
/*) SCRIPT_PATH="$LINK_TARGET" ;;
|
|
11
|
+
*) SCRIPT_PATH="$SCRIPT_DIR/$LINK_TARGET" ;;
|
|
12
|
+
esac
|
|
13
|
+
done
|
|
14
|
+
MODULE_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
15
|
+
|
|
16
|
+
# Locate bun in common install paths if not already on PATH. Hook invocations
|
|
17
|
+
# under bash subshells may have a different PATH than the interactive shell.
|
|
18
|
+
if ! command -v bun >/dev/null 2>&1; then
|
|
19
|
+
for candidate in \
|
|
20
|
+
"$HOME/.bun/bin/bun" \
|
|
21
|
+
"/usr/local/bin/bun" \
|
|
22
|
+
"/opt/homebrew/bin/bun"; do
|
|
23
|
+
if [ -x "$candidate" ]; then
|
|
24
|
+
export PATH="$(dirname "$candidate"):$PATH"
|
|
25
|
+
break
|
|
26
|
+
fi
|
|
27
|
+
done
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Bun-first (zero-build TS); Node-with-dist/ fallback when Bun isn't available.
|
|
31
|
+
# The published npm package ships dist/ (built by prepublishOnly), so the Node
|
|
32
|
+
# branch works out of the box. A bare git clone has neither until you build.
|
|
33
|
+
if command -v bun >/dev/null 2>&1; then
|
|
34
|
+
exec bun run "$MODULE_DIR/src/cli.ts" "$@"
|
|
35
|
+
elif [ -f "$MODULE_DIR/dist/cli.js" ]; then
|
|
36
|
+
exec node "$MODULE_DIR/dist/cli.js" "$@"
|
|
37
|
+
else
|
|
38
|
+
echo "harn: needs Bun or a built dist/. Install Bun (https://bun.sh) for zero-build, or build the Node bundle: npm install && npm run build." >&2
|
|
39
|
+
exit 1
|
|
40
|
+
fi
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `harn` CLI entry point.
|
|
3
|
+
*
|
|
4
|
+
* Parses argv, runs the Commander program returned by createHarneryProgram().
|
|
5
|
+
* Consumer CLIs import createHarneryProgram() from `harnery/commander` and
|
|
6
|
+
* compose their own commands on top. See examples/extending-with-commander.ts.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `harn` CLI entry point.
|
|
3
|
+
*
|
|
4
|
+
* Parses argv, runs the Commander program returned by createHarneryProgram().
|
|
5
|
+
* Consumer CLIs import createHarneryProgram() from `harnery/commander` and
|
|
6
|
+
* compose their own commands on top. See examples/extending-with-commander.ts.
|
|
7
|
+
*/
|
|
8
|
+
import { createHarneryProgram } from "./commander.js";
|
|
9
|
+
async function main() {
|
|
10
|
+
const program = createHarneryProgram({
|
|
11
|
+
binName: "harn",
|
|
12
|
+
});
|
|
13
|
+
await program.parseAsync(process.argv);
|
|
14
|
+
}
|
|
15
|
+
main().catch((err) => {
|
|
16
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `createHarneryProgram` is the composition point.
|
|
3
|
+
*
|
|
4
|
+
* harn (this package's CLI) calls this with `binName: 'harn'`.
|
|
5
|
+
* Consumer CLIs call this with their own binName, then `.addCommand()`
|
|
6
|
+
* their domain-specific subcommands and `parseAsync()`.
|
|
7
|
+
*
|
|
8
|
+
* The returned Commander program is harnery's full command tree. Adding
|
|
9
|
+
* a command with the same name on the consumer side overrides it, which is
|
|
10
|
+
* useful for project-specific overlays but uncommon.
|
|
11
|
+
*
|
|
12
|
+
* Future commands wire in via `registerXxxCommand(program)` calls below.
|
|
13
|
+
* Each subdirectory under src/commands/ exports its `register…` function
|
|
14
|
+
* (Commander pattern).
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from "commander";
|
|
17
|
+
export interface HarneryContextOpts {
|
|
18
|
+
/**
|
|
19
|
+
* The binary name shown in --help output. Defaults to "harn". Consumer
|
|
20
|
+
* CLIs pass their own, e.g. `binName: "mycli"`.
|
|
21
|
+
*/
|
|
22
|
+
binName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Project-scoped context. Commands that touch state (.harnery/agents/,
|
|
25
|
+
* .harnery/config.jsonc) consult this to resolve paths + project identity.
|
|
26
|
+
* Optional: harn standalone runs without it.
|
|
27
|
+
*/
|
|
28
|
+
context?: HarneryProgramContext;
|
|
29
|
+
/**
|
|
30
|
+
* Adapter that lets consumers route structured emissions into their own
|
|
31
|
+
* OutputContext (e.g. an AsyncLocalStorage-bound writer). When omitted,
|
|
32
|
+
* harn standalone falls back to a default JSON-to-stdout emitter (see
|
|
33
|
+
* `defaultEmit` below).
|
|
34
|
+
*/
|
|
35
|
+
emit?: EmitContext;
|
|
36
|
+
/**
|
|
37
|
+
* Top-level command names harnery should NOT register. Use when a
|
|
38
|
+
* consumer wants to replace harnery's implementation with its own
|
|
39
|
+
* (Commander throws on duplicate registration). Example: the host CLI has
|
|
40
|
+
* a project-specific `harn web` (docker stack shim) and passes
|
|
41
|
+
* `skipCommands: ["web"]` so harnery's generic `web` doesn't collide.
|
|
42
|
+
*/
|
|
43
|
+
skipCommands?: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
export interface HarneryProgramContext {
|
|
46
|
+
/** Project name (e.g., "my-monorepo"). Used in user-facing log lines + telemetry tags. */
|
|
47
|
+
projectName?: string;
|
|
48
|
+
/** Override the monorepo-root resolver. Default: walk up looking for `.harnery/`. */
|
|
49
|
+
resolveCoordRoot?: () => string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Absolute path to the monorepo root. Commands like `env` use this as the
|
|
52
|
+
* default `cwd` for `git` invocations. When omitted, commands fall back to
|
|
53
|
+
* `process.cwd()`.
|
|
54
|
+
*/
|
|
55
|
+
repoRoot?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Submodule directory names relative to `repoRoot`. Consumed by `env` to
|
|
58
|
+
* report N/M initialized. When omitted, the `env` command skips the
|
|
59
|
+
* submodule row.
|
|
60
|
+
*/
|
|
61
|
+
submodules?: readonly string[];
|
|
62
|
+
/**
|
|
63
|
+
* Optional callback that returns extra HTTP headers to attach to outbound
|
|
64
|
+
* `fetch` calls based on the target URL. Useful for consumers that need
|
|
65
|
+
* to inject auth or bypass headers on certain hostnames (e.g. private
|
|
66
|
+
* zones behind a WAF). harn standalone skips the callback entirely.
|
|
67
|
+
*/
|
|
68
|
+
extraHeaders?: (url: string) => Record<string, string>;
|
|
69
|
+
/**
|
|
70
|
+
* Shell-completion provider-key lookup. Consumers wire this to a function
|
|
71
|
+
* mapping (commandPath, option/positional) to a provider key, so that
|
|
72
|
+
* `--workspace` / `--env` etc. tab-complete dynamically against
|
|
73
|
+
* consumer-specific data sources. harn standalone falls back to no-op
|
|
74
|
+
* (static completion only).
|
|
75
|
+
*/
|
|
76
|
+
completionLookup?: (key: {
|
|
77
|
+
commandPath: string;
|
|
78
|
+
option?: string;
|
|
79
|
+
positional?: number;
|
|
80
|
+
}) => string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Shell-completion provider runner. Invoked by the hidden `__complete`
|
|
83
|
+
* subcommand at tab-time to produce the actual list of completions for
|
|
84
|
+
* a given provider key.
|
|
85
|
+
*/
|
|
86
|
+
completionRunner?: (key: string, partial: string) => Promise<string[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Extra path prefixes that should be excluded from `harn docs lint`
|
|
89
|
+
* convention checks (auto-generated API reference dumps, vendored
|
|
90
|
+
* content directories, etc.). Combined with harnery's built-in
|
|
91
|
+
* exclusions (`.claude/`, `.harnery/`, `.codex/`, `.cursor/`).
|
|
92
|
+
*/
|
|
93
|
+
extraDocsExcludedPrefixes?: readonly string[];
|
|
94
|
+
/**
|
|
95
|
+
* Default Host header for `tunnel up` when `--vhost` is omitted: a literal
|
|
96
|
+
* host, or a resolver evaluated at start time (e.g. read a dev stack's
|
|
97
|
+
* configured hostname so the tunnel lands on the right vhost). When unset, or
|
|
98
|
+
* the resolver returns null, the tunnel falls back to harnery's built-in
|
|
99
|
+
* default (`localhost`).
|
|
100
|
+
*/
|
|
101
|
+
tunnelDefaultVhost?: string | (() => string | null | undefined);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Minimum emission surface harnery commands need to talk to a host CLI's
|
|
105
|
+
* OutputContext. Intentionally tiny: just the methods commands actually
|
|
106
|
+
* call. Designed to grow additively: consumers that want richer output
|
|
107
|
+
* routing implement these methods; everyone else gets `defaultEmit`'s
|
|
108
|
+
* JSON-to-stdout fallback.
|
|
109
|
+
*/
|
|
110
|
+
export interface EmitContext {
|
|
111
|
+
config(opts: {
|
|
112
|
+
format?: string;
|
|
113
|
+
}): void;
|
|
114
|
+
data(payload: unknown): void;
|
|
115
|
+
rows(rows: Record<string, unknown>[]): void;
|
|
116
|
+
text(s: string): void;
|
|
117
|
+
file(path: string, summary: Record<string, unknown>): void;
|
|
118
|
+
error(err: {
|
|
119
|
+
code: string;
|
|
120
|
+
message: string;
|
|
121
|
+
hint?: string;
|
|
122
|
+
} | Error | unknown): void;
|
|
123
|
+
log(msg: string, level?: "debug" | "info" | "warn" | "error"): void;
|
|
124
|
+
setExitCode(n: number): void;
|
|
125
|
+
}
|
|
126
|
+
export declare const defaultEmit: EmitContext;
|
|
127
|
+
export declare function createHarneryProgram(opts?: HarneryContextOpts): Command;
|
|
128
|
+
//# sourceMappingURL=commander.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander.d.ts","sourceRoot":"","sources":["../src/commander.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+BpC,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAEhC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvD;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,KAAK,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACvE;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACjE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3D,KAAK,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC;IACrF,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACpE,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,EAAE,WAkCzB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,kBAAuB,GAAG,OAAO,CA2C3E"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `createHarneryProgram` is the composition point.
|
|
3
|
+
*
|
|
4
|
+
* harn (this package's CLI) calls this with `binName: 'harn'`.
|
|
5
|
+
* Consumer CLIs call this with their own binName, then `.addCommand()`
|
|
6
|
+
* their domain-specific subcommands and `parseAsync()`.
|
|
7
|
+
*
|
|
8
|
+
* The returned Commander program is harnery's full command tree. Adding
|
|
9
|
+
* a command with the same name on the consumer side overrides it, which is
|
|
10
|
+
* useful for project-specific overlays but uncommon.
|
|
11
|
+
*
|
|
12
|
+
* Future commands wire in via `registerXxxCommand(program)` calls below.
|
|
13
|
+
* Each subdirectory under src/commands/ exports its `register…` function
|
|
14
|
+
* (Commander pattern).
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from "commander";
|
|
17
|
+
import { registerAgentsCommand } from "./commands/agents.js";
|
|
18
|
+
import { registerBackupCommand } from "./commands/backup.js";
|
|
19
|
+
import { registerBrowseCommand } from "./commands/browse.js";
|
|
20
|
+
import { registerBrowseAiCommand } from "./commands/browse-ai.js";
|
|
21
|
+
import { registerCallersCommand } from "./commands/callers.js";
|
|
22
|
+
import { registerCompletionCommand } from "./commands/completion.js";
|
|
23
|
+
import { registerConfigGetCommand } from "./commands/config-get.js";
|
|
24
|
+
import { registerContextCommand } from "./commands/context.js";
|
|
25
|
+
import { registerCookiesCommand } from "./commands/cookies.js";
|
|
26
|
+
import { registerDocsCommand } from "./commands/docs.js";
|
|
27
|
+
import { registerDoctorCommand } from "./commands/doctor.js";
|
|
28
|
+
import { registerEditBatchCommand } from "./commands/edit-batch.js";
|
|
29
|
+
import { registerEmlCommand } from "./commands/eml.js";
|
|
30
|
+
import { registerEnvCommand } from "./commands/env.js";
|
|
31
|
+
import { registerFetchCommand } from "./commands/fetch.js";
|
|
32
|
+
import { registerFileHistoryCommand } from "./commands/file-history.js";
|
|
33
|
+
import { registerGrepCommand } from "./commands/grep.js";
|
|
34
|
+
import { registerInitCommand } from "./commands/init.js";
|
|
35
|
+
import { registerOutlineCommand } from "./commands/outline.js";
|
|
36
|
+
import { registerPresenceCommand } from "./commands/presence.js";
|
|
37
|
+
import { registerReadCommand } from "./commands/read.js";
|
|
38
|
+
import { registerScratchCommand } from "./commands/scratch.js";
|
|
39
|
+
import { registerSessionCommand } from "./commands/session.js";
|
|
40
|
+
import { registerSyncCommand } from "./commands/sync.js";
|
|
41
|
+
import { registerSectionCommand, registerTocCommand } from "./commands/toc.js";
|
|
42
|
+
import { registerTokensCommand } from "./commands/tokens.js";
|
|
43
|
+
import { registerTunnelCommand } from "./commands/tunnel.js";
|
|
44
|
+
import { registerUninstallCommand } from "./commands/uninstall.js";
|
|
45
|
+
import { registerWebCommand } from "./commands/web.js";
|
|
46
|
+
export const defaultEmit = {
|
|
47
|
+
config() {
|
|
48
|
+
// No-op for harn standalone: there's only one format (JSON) and it's
|
|
49
|
+
// already the default. Consumer adapters route this to their own
|
|
50
|
+
// output-context configurator.
|
|
51
|
+
},
|
|
52
|
+
data(payload) {
|
|
53
|
+
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
54
|
+
},
|
|
55
|
+
rows(rows) {
|
|
56
|
+
process.stdout.write(`${JSON.stringify(rows)}\n`);
|
|
57
|
+
},
|
|
58
|
+
text(s) {
|
|
59
|
+
process.stdout.write(s.endsWith("\n") ? s : `${s}\n`);
|
|
60
|
+
},
|
|
61
|
+
file(path, summary) {
|
|
62
|
+
process.stdout.write(`${JSON.stringify({ ok: true, file: path, ...summary })}\n`);
|
|
63
|
+
},
|
|
64
|
+
error(err) {
|
|
65
|
+
const payload = err instanceof Error
|
|
66
|
+
? { code: err.name || "error", message: err.message }
|
|
67
|
+
: typeof err === "object" && err !== null
|
|
68
|
+
? err
|
|
69
|
+
: { code: "error", message: String(err) };
|
|
70
|
+
process.stderr.write(`${JSON.stringify({ error: payload })}\n`);
|
|
71
|
+
process.exitCode = 1;
|
|
72
|
+
},
|
|
73
|
+
log(msg, level = "info") {
|
|
74
|
+
process.stderr.write(`[${level}] ${msg}\n`);
|
|
75
|
+
},
|
|
76
|
+
setExitCode(n) {
|
|
77
|
+
process.exitCode = n;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
export function createHarneryProgram(opts = {}) {
|
|
81
|
+
const program = new Command();
|
|
82
|
+
const emit = opts.emit ?? defaultEmit;
|
|
83
|
+
const skip = new Set(opts.skipCommands ?? []);
|
|
84
|
+
const include = (name) => !skip.has(name);
|
|
85
|
+
program
|
|
86
|
+
.name(opts.binName ?? "harn")
|
|
87
|
+
.description("Multi-agent coordination + harness adapters + portable CLI utilities.")
|
|
88
|
+
.version(readVersion());
|
|
89
|
+
registerTokensCommand(program, emit);
|
|
90
|
+
registerEmlCommand(program, emit);
|
|
91
|
+
registerEnvCommand(program, emit, opts.context);
|
|
92
|
+
registerPresenceCommand(program, emit);
|
|
93
|
+
registerConfigGetCommand(program, emit);
|
|
94
|
+
registerFileHistoryCommand(program, emit);
|
|
95
|
+
registerOutlineCommand(program, emit);
|
|
96
|
+
registerTocCommand(program, emit);
|
|
97
|
+
registerSectionCommand(program, emit);
|
|
98
|
+
registerCallersCommand(program, emit, opts.context);
|
|
99
|
+
registerEditBatchCommand(program, emit);
|
|
100
|
+
registerGrepCommand(program, emit, opts.context);
|
|
101
|
+
registerCookiesCommand(program, emit);
|
|
102
|
+
registerFetchCommand(program, emit, opts.context);
|
|
103
|
+
registerReadCommand(program, emit);
|
|
104
|
+
registerBrowseCommand(program, emit, opts.context);
|
|
105
|
+
registerBrowseAiCommand(program, emit);
|
|
106
|
+
registerSessionCommand(program, emit);
|
|
107
|
+
registerCompletionCommand(program, emit, opts.context);
|
|
108
|
+
registerContextCommand(program, emit, opts.context);
|
|
109
|
+
registerScratchCommand(program, emit);
|
|
110
|
+
registerTunnelCommand(program, emit, opts.context);
|
|
111
|
+
registerDocsCommand(program, emit, opts.context);
|
|
112
|
+
registerAgentsCommand(program, emit);
|
|
113
|
+
registerDoctorCommand(program, emit);
|
|
114
|
+
registerInitCommand(program, emit, opts.binName);
|
|
115
|
+
registerUninstallCommand(program, emit);
|
|
116
|
+
registerBackupCommand(program, emit);
|
|
117
|
+
registerSyncCommand(program, emit);
|
|
118
|
+
if (include("web"))
|
|
119
|
+
registerWebCommand(program, emit);
|
|
120
|
+
return program;
|
|
121
|
+
}
|
|
122
|
+
function readVersion() {
|
|
123
|
+
// Static for the empty scaffold. Will be replaced by a build-time substitution
|
|
124
|
+
// (or a JSON import) once we have any command shipping.
|
|
125
|
+
return "0.1.0";
|
|
126
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `harn agents`: on-demand queries against the multi-agent coord layer.
|
|
3
|
+
*
|
|
4
|
+
* harn agents whoami current agent's name + instance_id + claims
|
|
5
|
+
* harn agents list all active agents (default: fold transients)
|
|
6
|
+
* harn agents list --all include raw kind=transient rows
|
|
7
|
+
* harn agents list --stale include heartbeats older than the freshness window
|
|
8
|
+
* harn agents list --json JSON output (alias for --format json)
|
|
9
|
+
* harn agents status end-of-turn status box (name + age + files + peers)
|
|
10
|
+
* harn agents heal-events PIDMAP_HEAL telemetry (pid-map self-heal frequency)
|
|
11
|
+
* harn agents heal-events --since 24h --limit 20
|
|
12
|
+
* harn agents health one-screen coord-layer health rollup
|
|
13
|
+
* harn agents health --since 7d --json
|
|
14
|
+
*/
|
|
15
|
+
import type { Command } from "commander";
|
|
16
|
+
import type { EmitContext } from "../commander.js";
|
|
17
|
+
export declare function registerAgentsCommand(program: Command, emitParam: EmitContext): void;
|
|
18
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA+EnD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,GAAG,IAAI,CA6OpF"}
|