@cluesmith/codev 2.0.0-rc.9 → 2.0.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/bin/af.js +2 -2
- package/bin/consult.js +1 -1
- package/dashboard/dist/assets/index-4n9zpWLY.css +32 -0
- package/dashboard/dist/assets/index-b38SaXk5.js +136 -0
- package/dashboard/dist/assets/index-b38SaXk5.js.map +1 -0
- package/dashboard/dist/index.html +14 -0
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +179 -104
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/architect.d.ts +3 -3
- package/dist/agent-farm/commands/architect.d.ts.map +1 -1
- package/dist/agent-farm/commands/architect.js +20 -147
- package/dist/agent-farm/commands/architect.js.map +1 -1
- package/dist/agent-farm/commands/attach.d.ts +13 -0
- package/dist/agent-farm/commands/attach.d.ts.map +1 -0
- package/dist/agent-farm/commands/attach.js +144 -0
- package/dist/agent-farm/commands/attach.js.map +1 -0
- package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
- package/dist/agent-farm/commands/cleanup.js +35 -19
- package/dist/agent-farm/commands/cleanup.js.map +1 -1
- package/dist/agent-farm/commands/consult.d.ts +3 -4
- package/dist/agent-farm/commands/consult.d.ts.map +1 -1
- package/dist/agent-farm/commands/consult.js +27 -37
- package/dist/agent-farm/commands/consult.js.map +1 -1
- package/dist/agent-farm/commands/index.d.ts +2 -2
- package/dist/agent-farm/commands/index.d.ts.map +1 -1
- package/dist/agent-farm/commands/index.js +2 -2
- package/dist/agent-farm/commands/index.js.map +1 -1
- package/dist/agent-farm/commands/open.d.ts +4 -2
- package/dist/agent-farm/commands/open.d.ts.map +1 -1
- package/dist/agent-farm/commands/open.js +33 -83
- package/dist/agent-farm/commands/open.js.map +1 -1
- package/dist/agent-farm/commands/send.d.ts +1 -1
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +70 -79
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/shell.d.ts +15 -0
- package/dist/agent-farm/commands/shell.d.ts.map +1 -0
- package/dist/agent-farm/commands/shell.js +50 -0
- package/dist/agent-farm/commands/shell.js.map +1 -0
- package/dist/agent-farm/commands/spawn-roles.d.ts +80 -0
- package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -0
- package/dist/agent-farm/commands/spawn-roles.js +278 -0
- package/dist/agent-farm/commands/spawn-roles.js.map +1 -0
- package/dist/agent-farm/commands/spawn-worktree.d.ts +96 -0
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -0
- package/dist/agent-farm/commands/spawn-worktree.js +305 -0
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -0
- package/dist/agent-farm/commands/spawn.d.ts +5 -1
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +241 -561
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/start.d.ts +10 -20
- package/dist/agent-farm/commands/start.d.ts.map +1 -1
- package/dist/agent-farm/commands/start.js +45 -449
- package/dist/agent-farm/commands/start.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts +2 -0
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +75 -24
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/stop.d.ts +6 -0
- package/dist/agent-farm/commands/stop.d.ts.map +1 -1
- package/dist/agent-farm/commands/stop.js +49 -109
- package/dist/agent-farm/commands/stop.js.map +1 -1
- package/dist/agent-farm/commands/tower-cloud.d.ts +48 -0
- package/dist/agent-farm/commands/tower-cloud.d.ts.map +1 -0
- package/dist/agent-farm/commands/tower-cloud.js +293 -0
- package/dist/agent-farm/commands/tower-cloud.js.map +1 -0
- package/dist/agent-farm/commands/tower.d.ts +9 -0
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +59 -19
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/db/index.d.ts +6 -2
- package/dist/agent-farm/db/index.d.ts.map +1 -1
- package/dist/agent-farm/db/index.js +301 -19
- package/dist/agent-farm/db/index.js.map +1 -1
- package/dist/agent-farm/db/migrate.d.ts +0 -4
- package/dist/agent-farm/db/migrate.d.ts.map +1 -1
- package/dist/agent-farm/db/migrate.js +6 -55
- package/dist/agent-farm/db/migrate.js.map +1 -1
- package/dist/agent-farm/db/schema.d.ts +3 -3
- package/dist/agent-farm/db/schema.d.ts.map +1 -1
- package/dist/agent-farm/db/schema.js +25 -19
- package/dist/agent-farm/db/schema.js.map +1 -1
- package/dist/agent-farm/db/types.d.ts +3 -13
- package/dist/agent-farm/db/types.d.ts.map +1 -1
- package/dist/agent-farm/db/types.js +3 -11
- package/dist/agent-farm/db/types.js.map +1 -1
- package/dist/agent-farm/hq-connector.d.ts +2 -6
- package/dist/agent-farm/hq-connector.d.ts.map +1 -1
- package/dist/agent-farm/hq-connector.js +2 -17
- package/dist/agent-farm/hq-connector.js.map +1 -1
- package/dist/agent-farm/lib/cloud-config.d.ts +59 -0
- package/dist/agent-farm/lib/cloud-config.d.ts.map +1 -0
- package/dist/agent-farm/lib/cloud-config.js +143 -0
- package/dist/agent-farm/lib/cloud-config.js.map +1 -0
- package/dist/agent-farm/lib/device-name.d.ts +25 -0
- package/dist/agent-farm/lib/device-name.d.ts.map +1 -0
- package/dist/agent-farm/lib/device-name.js +46 -0
- package/dist/agent-farm/lib/device-name.js.map +1 -0
- package/dist/agent-farm/lib/nonce-store.d.ts +28 -0
- package/dist/agent-farm/lib/nonce-store.d.ts.map +1 -0
- package/dist/agent-farm/lib/nonce-store.js +60 -0
- package/dist/agent-farm/lib/nonce-store.js.map +1 -0
- package/dist/agent-farm/lib/token-exchange.d.ts +18 -0
- package/dist/agent-farm/lib/token-exchange.d.ts.map +1 -0
- package/dist/agent-farm/lib/token-exchange.js +48 -0
- package/dist/agent-farm/lib/token-exchange.js.map +1 -0
- package/dist/agent-farm/lib/tower-client.d.ts +163 -0
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -0
- package/dist/agent-farm/lib/tower-client.js +233 -0
- package/dist/agent-farm/lib/tower-client.js.map +1 -0
- package/dist/agent-farm/lib/tunnel-client.d.ts +117 -0
- package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -0
- package/dist/agent-farm/lib/tunnel-client.js +504 -0
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -0
- package/dist/agent-farm/servers/tower-instances.d.ts +82 -0
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-instances.js +454 -0
- package/dist/agent-farm/servers/tower-instances.js.map +1 -0
- package/dist/agent-farm/servers/tower-routes.d.ts +34 -0
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-routes.js +1445 -0
- package/dist/agent-farm/servers/tower-routes.js.map +1 -0
- package/dist/agent-farm/servers/tower-server.d.ts +5 -2
- package/dist/agent-farm/servers/tower-server.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +157 -475
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +119 -0
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-terminals.js +629 -0
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -0
- package/dist/agent-farm/servers/tower-tunnel.d.ts +34 -0
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-tunnel.js +480 -0
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -0
- package/dist/agent-farm/servers/tower-types.d.ts +86 -0
- package/dist/agent-farm/servers/tower-types.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-types.js +6 -0
- package/dist/agent-farm/servers/tower-types.js.map +1 -0
- package/dist/agent-farm/servers/tower-utils.d.ts +58 -0
- package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-utils.js +182 -0
- package/dist/agent-farm/servers/tower-utils.js.map +1 -0
- package/dist/agent-farm/servers/tower-websocket.d.ts +25 -0
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-websocket.js +171 -0
- package/dist/agent-farm/servers/tower-websocket.js.map +1 -0
- package/dist/agent-farm/state.d.ts +6 -2
- package/dist/agent-farm/state.d.ts.map +1 -1
- package/dist/agent-farm/state.js +34 -25
- package/dist/agent-farm/state.js.map +1 -1
- package/dist/agent-farm/types.d.ts +49 -26
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.d.ts +0 -5
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +12 -44
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/deps.d.ts.map +1 -1
- package/dist/agent-farm/utils/deps.js +0 -32
- package/dist/agent-farm/utils/deps.js.map +1 -1
- package/dist/agent-farm/utils/file-tabs.d.ts +27 -0
- package/dist/agent-farm/utils/file-tabs.d.ts.map +1 -0
- package/dist/agent-farm/utils/file-tabs.js +46 -0
- package/dist/agent-farm/utils/file-tabs.js.map +1 -0
- package/dist/agent-farm/utils/gate-status.d.ts +16 -0
- package/dist/agent-farm/utils/gate-status.d.ts.map +1 -0
- package/dist/agent-farm/utils/gate-status.js +79 -0
- package/dist/agent-farm/utils/gate-status.js.map +1 -0
- package/dist/agent-farm/utils/gate-watcher.d.ts +38 -0
- package/dist/agent-farm/utils/gate-watcher.d.ts.map +1 -0
- package/dist/agent-farm/utils/gate-watcher.js +122 -0
- package/dist/agent-farm/utils/gate-watcher.js.map +1 -0
- package/dist/agent-farm/utils/index.d.ts +0 -1
- package/dist/agent-farm/utils/index.d.ts.map +1 -1
- package/dist/agent-farm/utils/index.js +0 -1
- package/dist/agent-farm/utils/index.js.map +1 -1
- package/dist/agent-farm/utils/notifications.d.ts +30 -0
- package/dist/agent-farm/utils/notifications.d.ts.map +1 -0
- package/dist/agent-farm/utils/notifications.js +121 -0
- package/dist/agent-farm/utils/notifications.js.map +1 -0
- package/dist/agent-farm/utils/server-utils.d.ts +5 -5
- package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
- package/dist/agent-farm/utils/server-utils.js +5 -16
- package/dist/agent-farm/utils/server-utils.js.map +1 -1
- package/dist/agent-farm/utils/session.d.ts +32 -0
- package/dist/agent-farm/utils/session.d.ts.map +1 -0
- package/dist/agent-farm/utils/session.js +57 -0
- package/dist/agent-farm/utils/session.js.map +1 -0
- package/dist/agent-farm/utils/shell.d.ts +9 -22
- package/dist/agent-farm/utils/shell.d.ts.map +1 -1
- package/dist/agent-farm/utils/shell.js +34 -34
- package/dist/agent-farm/utils/shell.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -37
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +33 -4
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/consult/index.d.ts +13 -2
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +244 -29
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +96 -79
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +36 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/porch/build-counter.d.ts +5 -0
- package/dist/commands/porch/build-counter.d.ts.map +1 -0
- package/dist/commands/porch/build-counter.js +5 -0
- package/dist/commands/porch/build-counter.js.map +1 -0
- package/dist/commands/porch/checks.d.ts +3 -2
- package/dist/commands/porch/checks.d.ts.map +1 -1
- package/dist/commands/porch/checks.js +8 -2
- package/dist/commands/porch/checks.js.map +1 -1
- package/dist/commands/porch/index.d.ts +4 -0
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +109 -70
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts +22 -0
- package/dist/commands/porch/next.d.ts.map +1 -0
- package/dist/commands/porch/next.js +571 -0
- package/dist/commands/porch/next.js.map +1 -0
- package/dist/commands/porch/plan.d.ts +11 -1
- package/dist/commands/porch/plan.d.ts.map +1 -1
- package/dist/commands/porch/plan.js +33 -5
- package/dist/commands/porch/plan.js.map +1 -1
- package/dist/commands/porch/prompts.d.ts.map +1 -1
- package/dist/commands/porch/prompts.js +44 -26
- package/dist/commands/porch/prompts.js.map +1 -1
- package/dist/commands/porch/protocol.d.ts +6 -4
- package/dist/commands/porch/protocol.d.ts.map +1 -1
- package/dist/commands/porch/protocol.js +59 -15
- package/dist/commands/porch/protocol.js.map +1 -1
- package/dist/commands/porch/state.d.ts +29 -2
- package/dist/commands/porch/state.d.ts.map +1 -1
- package/dist/commands/porch/state.js +71 -3
- package/dist/commands/porch/state.js.map +1 -1
- package/dist/commands/porch/types.d.ts +45 -2
- package/dist/commands/porch/types.d.ts.map +1 -1
- package/dist/commands/porch/verdict.d.ts +31 -0
- package/dist/commands/porch/verdict.d.ts.map +1 -0
- package/dist/commands/porch/verdict.js +59 -0
- package/dist/commands/porch/verdict.js.map +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +18 -6
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/scaffold.d.ts +13 -0
- package/dist/lib/scaffold.d.ts.map +1 -1
- package/dist/lib/scaffold.js +36 -0
- package/dist/lib/scaffold.js.map +1 -1
- package/dist/terminal/index.d.ts +8 -0
- package/dist/terminal/index.d.ts.map +1 -0
- package/dist/terminal/index.js +5 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/terminal/pty-manager.d.ts +69 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -0
- package/dist/terminal/pty-manager.js +377 -0
- package/dist/terminal/pty-manager.js.map +1 -0
- package/dist/terminal/pty-session.d.ts +104 -0
- package/dist/terminal/pty-session.d.ts.map +1 -0
- package/dist/terminal/pty-session.js +327 -0
- package/dist/terminal/pty-session.js.map +1 -0
- package/dist/terminal/ring-buffer.d.ts +34 -0
- package/dist/terminal/ring-buffer.d.ts.map +1 -0
- package/dist/terminal/ring-buffer.js +94 -0
- package/dist/terminal/ring-buffer.js.map +1 -0
- package/dist/terminal/session-manager.d.ts +115 -0
- package/dist/terminal/session-manager.d.ts.map +1 -0
- package/dist/terminal/session-manager.js +582 -0
- package/dist/terminal/session-manager.js.map +1 -0
- package/dist/terminal/shellper-client.d.ts +66 -0
- package/dist/terminal/shellper-client.d.ts.map +1 -0
- package/dist/terminal/shellper-client.js +234 -0
- package/dist/terminal/shellper-client.js.map +1 -0
- package/dist/terminal/shellper-main.d.ts +19 -0
- package/dist/terminal/shellper-main.d.ts.map +1 -0
- package/dist/terminal/shellper-main.js +153 -0
- package/dist/terminal/shellper-main.js.map +1 -0
- package/dist/terminal/shellper-process.d.ts +75 -0
- package/dist/terminal/shellper-process.d.ts.map +1 -0
- package/dist/terminal/shellper-process.js +279 -0
- package/dist/terminal/shellper-process.js.map +1 -0
- package/dist/terminal/shellper-protocol.d.ts +115 -0
- package/dist/terminal/shellper-protocol.d.ts.map +1 -0
- package/dist/terminal/shellper-protocol.js +214 -0
- package/dist/terminal/shellper-protocol.js.map +1 -0
- package/dist/terminal/shellper-replay-buffer.d.ts +38 -0
- package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -0
- package/dist/terminal/shellper-replay-buffer.js +94 -0
- package/dist/terminal/shellper-replay-buffer.js.map +1 -0
- package/dist/terminal/ws-protocol.d.ts +27 -0
- package/dist/terminal/ws-protocol.d.ts.map +1 -0
- package/dist/terminal/ws-protocol.js +44 -0
- package/dist/terminal/ws-protocol.js.map +1 -0
- package/package.json +17 -5
- package/skeleton/.claude/skills/af/SKILL.md +89 -0
- package/skeleton/.claude/skills/codev/SKILL.md +41 -0
- package/skeleton/.claude/skills/consult/SKILL.md +81 -0
- package/skeleton/.claude/skills/generate-image/SKILL.md +56 -0
- package/skeleton/DEPENDENCIES.md +4 -62
- package/skeleton/builders.md +1 -1
- package/skeleton/consult-types/impl-review.md +18 -9
- package/skeleton/consult-types/integration-review.md +1 -1
- package/skeleton/consult-types/plan-review.md +1 -1
- package/skeleton/consult-types/pr-ready.md +1 -1
- package/skeleton/consult-types/spec-review.md +1 -1
- package/skeleton/porch/prompts/defend.md +1 -1
- package/skeleton/porch/prompts/evaluate.md +2 -2
- package/skeleton/porch/prompts/implement.md +1 -1
- package/skeleton/porch/prompts/plan.md +1 -1
- package/skeleton/porch/prompts/review.md +4 -4
- package/skeleton/porch/prompts/specify.md +1 -1
- package/skeleton/porch/prompts/understand.md +2 -2
- package/skeleton/protocol-schema.json +282 -0
- package/skeleton/protocols/bugfix/builder-prompt.md +60 -0
- package/skeleton/protocols/bugfix/prompts/fix.md +77 -0
- package/skeleton/protocols/bugfix/prompts/investigate.md +77 -0
- package/skeleton/protocols/bugfix/prompts/pr.md +84 -0
- package/skeleton/protocols/bugfix/protocol.json +20 -33
- package/skeleton/protocols/experiment/builder-prompt.md +52 -0
- package/skeleton/protocols/experiment/protocol.json +101 -0
- package/skeleton/protocols/experiment/protocol.md +3 -3
- package/skeleton/protocols/experiment/templates/notes.md +1 -1
- package/skeleton/protocols/maintain/builder-prompt.md +46 -0
- package/skeleton/protocols/maintain/prompts/audit.md +111 -0
- package/skeleton/protocols/maintain/prompts/clean.md +91 -0
- package/skeleton/protocols/maintain/prompts/sync.md +113 -0
- package/skeleton/protocols/maintain/prompts/verify.md +110 -0
- package/skeleton/protocols/maintain/protocol.json +141 -0
- package/skeleton/protocols/maintain/protocol.md +17 -11
- package/skeleton/protocols/protocol-schema.json +54 -1
- package/skeleton/protocols/spir/builder-prompt.md +66 -0
- package/skeleton/protocols/spir/prompts/implement.md +208 -0
- package/skeleton/protocols/{spider → spir}/prompts/plan.md +6 -70
- package/skeleton/protocols/{spider → spir}/prompts/review.md +20 -39
- package/skeleton/protocols/{spider → spir}/prompts/specify.md +24 -59
- package/skeleton/protocols/{spider → spir}/protocol.json +30 -10
- package/skeleton/protocols/{spider → spir}/protocol.md +35 -21
- package/skeleton/protocols/spir/templates/review.md +89 -0
- package/skeleton/protocols/tick/builder-prompt.md +56 -0
- package/skeleton/protocols/tick/protocol.json +7 -2
- package/skeleton/protocols/tick/protocol.md +18 -18
- package/skeleton/protocols/tick/templates/review.md +1 -1
- package/skeleton/resources/commands/agent-farm.md +63 -46
- package/skeleton/resources/commands/codev.md +0 -2
- package/skeleton/resources/commands/overview.md +7 -17
- package/skeleton/resources/workflow-reference.md +4 -4
- package/skeleton/roles/architect.md +151 -306
- package/skeleton/roles/builder.md +115 -332
- package/skeleton/roles/consultant.md +6 -6
- package/skeleton/templates/AGENTS.md +2 -2
- package/skeleton/templates/CLAUDE.md +2 -2
- package/skeleton/templates/cheatsheet.md +7 -5
- package/skeleton/templates/projectlist.md +1 -1
- package/templates/dashboard/index.html +17 -16
- package/templates/dashboard/js/dialogs.js +7 -7
- package/templates/dashboard/js/files.js +2 -2
- package/templates/dashboard/js/main.js +4 -4
- package/templates/dashboard/js/projects.js +3 -3
- package/templates/dashboard/js/tabs.js +1 -1
- package/templates/dashboard/js/utils.js +22 -1
- package/templates/open.html +26 -0
- package/templates/tower.html +731 -91
- package/dist/agent-farm/commands/kickoff.d.ts +0 -20
- package/dist/agent-farm/commands/kickoff.d.ts.map +0 -1
- package/dist/agent-farm/commands/kickoff.js +0 -273
- package/dist/agent-farm/commands/kickoff.js.map +0 -1
- package/dist/agent-farm/commands/rename.d.ts +0 -13
- package/dist/agent-farm/commands/rename.d.ts.map +0 -1
- package/dist/agent-farm/commands/rename.js +0 -33
- package/dist/agent-farm/commands/rename.js.map +0 -1
- package/dist/agent-farm/commands/tutorial.d.ts +0 -10
- package/dist/agent-farm/commands/tutorial.d.ts.map +0 -1
- package/dist/agent-farm/commands/tutorial.js +0 -49
- package/dist/agent-farm/commands/tutorial.js.map +0 -1
- package/dist/agent-farm/commands/util.d.ts +0 -15
- package/dist/agent-farm/commands/util.d.ts.map +0 -1
- package/dist/agent-farm/commands/util.js +0 -108
- package/dist/agent-farm/commands/util.js.map +0 -1
- package/dist/agent-farm/servers/dashboard-server.d.ts +0 -7
- package/dist/agent-farm/servers/dashboard-server.d.ts.map +0 -1
- package/dist/agent-farm/servers/dashboard-server.js +0 -1858
- package/dist/agent-farm/servers/dashboard-server.js.map +0 -1
- package/dist/agent-farm/servers/open-server.d.ts +0 -7
- package/dist/agent-farm/servers/open-server.d.ts.map +0 -1
- package/dist/agent-farm/servers/open-server.js +0 -315
- package/dist/agent-farm/servers/open-server.js.map +0 -1
- package/dist/agent-farm/tutorial/index.d.ts +0 -8
- package/dist/agent-farm/tutorial/index.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/index.js +0 -8
- package/dist/agent-farm/tutorial/index.js.map +0 -1
- package/dist/agent-farm/tutorial/prompts.d.ts +0 -57
- package/dist/agent-farm/tutorial/prompts.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/prompts.js +0 -147
- package/dist/agent-farm/tutorial/prompts.js.map +0 -1
- package/dist/agent-farm/tutorial/runner.d.ts +0 -52
- package/dist/agent-farm/tutorial/runner.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/runner.js +0 -204
- package/dist/agent-farm/tutorial/runner.js.map +0 -1
- package/dist/agent-farm/tutorial/state.d.ts +0 -26
- package/dist/agent-farm/tutorial/state.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/state.js +0 -89
- package/dist/agent-farm/tutorial/state.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/first-spec.d.ts +0 -7
- package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/first-spec.js +0 -136
- package/dist/agent-farm/tutorial/steps/first-spec.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/implementation.d.ts +0 -7
- package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/implementation.js +0 -76
- package/dist/agent-farm/tutorial/steps/implementation.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/index.d.ts +0 -10
- package/dist/agent-farm/tutorial/steps/index.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/index.js +0 -10
- package/dist/agent-farm/tutorial/steps/index.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/planning.d.ts +0 -7
- package/dist/agent-farm/tutorial/steps/planning.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/planning.js +0 -143
- package/dist/agent-farm/tutorial/steps/planning.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/review.d.ts +0 -7
- package/dist/agent-farm/tutorial/steps/review.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/review.js +0 -78
- package/dist/agent-farm/tutorial/steps/review.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/setup.d.ts +0 -7
- package/dist/agent-farm/tutorial/steps/setup.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/setup.js +0 -126
- package/dist/agent-farm/tutorial/steps/setup.js.map +0 -1
- package/dist/agent-farm/tutorial/steps/welcome.d.ts +0 -7
- package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +0 -1
- package/dist/agent-farm/tutorial/steps/welcome.js +0 -50
- package/dist/agent-farm/tutorial/steps/welcome.js.map +0 -1
- package/dist/agent-farm/utils/orphan-handler.d.ts +0 -27
- package/dist/agent-farm/utils/orphan-handler.d.ts.map +0 -1
- package/dist/agent-farm/utils/orphan-handler.js +0 -149
- package/dist/agent-farm/utils/orphan-handler.js.map +0 -1
- package/dist/agent-farm/utils/port-registry.d.ts +0 -58
- package/dist/agent-farm/utils/port-registry.d.ts.map +0 -1
- package/dist/agent-farm/utils/port-registry.js +0 -166
- package/dist/agent-farm/utils/port-registry.js.map +0 -1
- package/dist/agent-farm/utils/terminal-ports.d.ts +0 -18
- package/dist/agent-farm/utils/terminal-ports.d.ts.map +0 -1
- package/dist/agent-farm/utils/terminal-ports.js +0 -35
- package/dist/agent-farm/utils/terminal-ports.js.map +0 -1
- package/dist/commands/pcheck/cache.d.ts +0 -48
- package/dist/commands/pcheck/cache.d.ts.map +0 -1
- package/dist/commands/pcheck/cache.js +0 -170
- package/dist/commands/pcheck/cache.js.map +0 -1
- package/dist/commands/pcheck/evaluator.d.ts +0 -15
- package/dist/commands/pcheck/evaluator.d.ts.map +0 -1
- package/dist/commands/pcheck/evaluator.js +0 -246
- package/dist/commands/pcheck/evaluator.js.map +0 -1
- package/dist/commands/pcheck/index.d.ts +0 -12
- package/dist/commands/pcheck/index.d.ts.map +0 -1
- package/dist/commands/pcheck/index.js +0 -249
- package/dist/commands/pcheck/index.js.map +0 -1
- package/dist/commands/pcheck/parser.d.ts +0 -39
- package/dist/commands/pcheck/parser.d.ts.map +0 -1
- package/dist/commands/pcheck/parser.js +0 -155
- package/dist/commands/pcheck/parser.js.map +0 -1
- package/dist/commands/pcheck/types.d.ts +0 -82
- package/dist/commands/pcheck/types.d.ts.map +0 -1
- package/dist/commands/pcheck/types.js +0 -5
- package/dist/commands/pcheck/types.js.map +0 -1
- package/dist/commands/porch/claude.d.ts +0 -29
- package/dist/commands/porch/claude.d.ts.map +0 -1
- package/dist/commands/porch/claude.js +0 -79
- package/dist/commands/porch/claude.js.map +0 -1
- package/dist/commands/porch/consultation.d.ts +0 -56
- package/dist/commands/porch/consultation.d.ts.map +0 -1
- package/dist/commands/porch/consultation.js +0 -330
- package/dist/commands/porch/consultation.js.map +0 -1
- package/dist/commands/porch/notifications.d.ts +0 -99
- package/dist/commands/porch/notifications.d.ts.map +0 -1
- package/dist/commands/porch/notifications.js +0 -223
- package/dist/commands/porch/notifications.js.map +0 -1
- package/dist/commands/porch/plan-parser.d.ts +0 -38
- package/dist/commands/porch/plan-parser.d.ts.map +0 -1
- package/dist/commands/porch/plan-parser.js +0 -166
- package/dist/commands/porch/plan-parser.js.map +0 -1
- package/dist/commands/porch/protocol-loader.d.ts +0 -46
- package/dist/commands/porch/protocol-loader.d.ts.map +0 -1
- package/dist/commands/porch/protocol-loader.js +0 -262
- package/dist/commands/porch/protocol-loader.js.map +0 -1
- package/dist/commands/porch/repl.d.ts +0 -33
- package/dist/commands/porch/repl.d.ts.map +0 -1
- package/dist/commands/porch/repl.js +0 -206
- package/dist/commands/porch/repl.js.map +0 -1
- package/dist/commands/porch/run.d.ts +0 -15
- package/dist/commands/porch/run.d.ts.map +0 -1
- package/dist/commands/porch/run.js +0 -551
- package/dist/commands/porch/run.js.map +0 -1
- package/dist/commands/porch/signal-parser.d.ts +0 -102
- package/dist/commands/porch/signal-parser.d.ts.map +0 -1
- package/dist/commands/porch/signal-parser.js +0 -199
- package/dist/commands/porch/signal-parser.js.map +0 -1
- package/dist/commands/porch/signals.d.ts +0 -35
- package/dist/commands/porch/signals.d.ts.map +0 -1
- package/dist/commands/porch/signals.js +0 -76
- package/dist/commands/porch/signals.js.map +0 -1
- package/dist/commands/porch2/checks.d.ts +0 -29
- package/dist/commands/porch2/checks.d.ts.map +0 -1
- package/dist/commands/porch2/checks.js +0 -141
- package/dist/commands/porch2/checks.js.map +0 -1
- package/dist/commands/porch2/index.d.ts +0 -38
- package/dist/commands/porch2/index.d.ts.map +0 -1
- package/dist/commands/porch2/index.js +0 -483
- package/dist/commands/porch2/index.js.map +0 -1
- package/dist/commands/porch2/plan.d.ts +0 -70
- package/dist/commands/porch2/plan.d.ts.map +0 -1
- package/dist/commands/porch2/plan.js +0 -227
- package/dist/commands/porch2/plan.js.map +0 -1
- package/dist/commands/porch2/protocol.d.ts +0 -37
- package/dist/commands/porch2/protocol.d.ts.map +0 -1
- package/dist/commands/porch2/protocol.js +0 -183
- package/dist/commands/porch2/protocol.js.map +0 -1
- package/dist/commands/porch2/state.d.ts +0 -35
- package/dist/commands/porch2/state.d.ts.map +0 -1
- package/dist/commands/porch2/state.js +0 -124
- package/dist/commands/porch2/state.js.map +0 -1
- package/dist/commands/porch2/types.d.ts +0 -79
- package/dist/commands/porch2/types.d.ts.map +0 -1
- package/dist/commands/porch2/types.js +0 -8
- package/dist/commands/porch2/types.js.map +0 -1
- package/dist/commands/tower.d.ts +0 -16
- package/dist/commands/tower.d.ts.map +0 -1
- package/dist/commands/tower.js +0 -21
- package/dist/commands/tower.js.map +0 -1
- package/skeleton/config.json +0 -7
- package/skeleton/protocols/spider/prompts/defend.md +0 -215
- package/skeleton/protocols/spider/prompts/evaluate.md +0 -241
- package/skeleton/protocols/spider/prompts/implement.md +0 -149
- package/skeleton/protocols/spider/templates/review.md +0 -207
- /package/skeleton/protocols/{spider → spir}/templates/plan.md +0 -0
- /package/skeleton/protocols/{spider → spir}/templates/spec.md +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git worktree management, session creation, and pre-spawn utilities.
|
|
3
|
+
* Spec 0105: Tower Server Decomposition — Phase 7
|
|
4
|
+
*
|
|
5
|
+
* Handles worktree creation, dependency checking, porch initialization,
|
|
6
|
+
* bugfix collision detection, GitHub issue fetching, pre-spawn hooks,
|
|
7
|
+
* and terminal session creation via the Tower REST API.
|
|
8
|
+
*/
|
|
9
|
+
import { resolve } from 'node:path';
|
|
10
|
+
import { existsSync, writeFileSync, chmodSync, symlinkSync } from 'node:fs';
|
|
11
|
+
import { logger, fatal } from '../utils/logger.js';
|
|
12
|
+
import { run, commandExists } from '../utils/shell.js';
|
|
13
|
+
// Tower port — the single HTTP server since Spec 0090
|
|
14
|
+
export const DEFAULT_TOWER_PORT = 4100;
|
|
15
|
+
// =============================================================================
|
|
16
|
+
// Dependency Checks
|
|
17
|
+
// =============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Check for required dependencies
|
|
20
|
+
*/
|
|
21
|
+
export async function checkDependencies() {
|
|
22
|
+
if (!(await commandExists('git'))) {
|
|
23
|
+
fatal('git not found');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// Git Worktree Management
|
|
28
|
+
// =============================================================================
|
|
29
|
+
/**
|
|
30
|
+
* Create git branch and worktree
|
|
31
|
+
*/
|
|
32
|
+
export async function createWorktree(config, branchName, worktreePath) {
|
|
33
|
+
logger.info('Creating branch...');
|
|
34
|
+
try {
|
|
35
|
+
await run(`git branch ${branchName}`, { cwd: config.projectRoot });
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
// Branch might already exist, that's OK
|
|
39
|
+
logger.debug(`Branch creation: ${error}`);
|
|
40
|
+
}
|
|
41
|
+
logger.info('Creating worktree...');
|
|
42
|
+
try {
|
|
43
|
+
await run(`git worktree add "${worktreePath}" ${branchName}`, { cwd: config.projectRoot });
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
fatal(`Failed to create worktree: ${error}`);
|
|
47
|
+
}
|
|
48
|
+
// Symlink .env from project root into worktree (if it exists)
|
|
49
|
+
const rootEnvPath = resolve(config.projectRoot, '.env');
|
|
50
|
+
const worktreeEnvPath = resolve(worktreePath, '.env');
|
|
51
|
+
if (existsSync(rootEnvPath) && !existsSync(worktreeEnvPath)) {
|
|
52
|
+
try {
|
|
53
|
+
symlinkSync(rootEnvPath, worktreeEnvPath);
|
|
54
|
+
logger.info('Linked .env from project root');
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
logger.debug(`Failed to symlink .env: ${error}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Pre-initialize porch in a worktree so the builder doesn't need to self-correct.
|
|
63
|
+
* Non-fatal: logs a warning on failure since the builder can still init manually.
|
|
64
|
+
*/
|
|
65
|
+
export async function initPorchInWorktree(worktreePath, protocol, projectId, projectName) {
|
|
66
|
+
logger.info('Initializing porch...');
|
|
67
|
+
try {
|
|
68
|
+
// Sanitize inputs to prevent shell injection (defense-in-depth;
|
|
69
|
+
// callers already use slugified names, but be safe)
|
|
70
|
+
const safeName = projectName.replace(/[^a-z0-9_-]/gi, '-');
|
|
71
|
+
const safeProto = protocol.replace(/[^a-z0-9_-]/gi, '');
|
|
72
|
+
const safeId = projectId.replace(/[^a-z0-9_-]/gi, '');
|
|
73
|
+
await run(`porch init ${safeProto} ${safeId} "${safeName}"`, { cwd: worktreePath });
|
|
74
|
+
logger.info(`Porch initialized: ${projectId}`);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
logger.warn(`Warning: Failed to initialize porch (builder can init manually): ${error}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Generate a slug from an issue title (max 30 chars, lowercase, alphanumeric + hyphens)
|
|
82
|
+
*/
|
|
83
|
+
export function slugify(title) {
|
|
84
|
+
return title
|
|
85
|
+
.toLowerCase()
|
|
86
|
+
.replace(/[^a-z0-9]+/g, '-') // Replace non-alphanumeric with hyphens
|
|
87
|
+
.replace(/-+/g, '-') // Collapse multiple hyphens
|
|
88
|
+
.replace(/^-|-$/g, '') // Trim leading/trailing hyphens
|
|
89
|
+
.slice(0, 30); // Max 30 chars
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Fetch a GitHub issue via gh CLI
|
|
93
|
+
*/
|
|
94
|
+
export async function fetchGitHubIssue(issueNumber) {
|
|
95
|
+
try {
|
|
96
|
+
const result = await run(`gh issue view ${issueNumber} --json title,body,state,comments`);
|
|
97
|
+
return JSON.parse(result.stdout);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
fatal(`Failed to fetch issue #${issueNumber}. Ensure 'gh' CLI is installed and authenticated.`);
|
|
101
|
+
throw error; // TypeScript doesn't know fatal() never returns
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// =============================================================================
|
|
105
|
+
// Bugfix Collision Detection
|
|
106
|
+
// =============================================================================
|
|
107
|
+
/**
|
|
108
|
+
* Check for collision conditions before spawning bugfix
|
|
109
|
+
*/
|
|
110
|
+
export async function checkBugfixCollisions(issueNumber, worktreePath, issue, force) {
|
|
111
|
+
// 1. Check if worktree already exists
|
|
112
|
+
if (existsSync(worktreePath)) {
|
|
113
|
+
fatal(`Worktree already exists at ${worktreePath}\nRun: af cleanup --issue ${issueNumber}`);
|
|
114
|
+
}
|
|
115
|
+
// 2. Check for recent "On it" comments (< 24h old)
|
|
116
|
+
const onItComments = issue.comments.filter((c) => c.body.toLowerCase().includes('on it'));
|
|
117
|
+
if (onItComments.length > 0) {
|
|
118
|
+
const lastComment = onItComments[onItComments.length - 1];
|
|
119
|
+
const age = Date.now() - new Date(lastComment.createdAt).getTime();
|
|
120
|
+
const hoursAgo = Math.round(age / (1000 * 60 * 60));
|
|
121
|
+
if (hoursAgo < 24) {
|
|
122
|
+
if (!force) {
|
|
123
|
+
fatal(`Issue #${issueNumber} has "On it" comment from ${hoursAgo}h ago (by @${lastComment.author.login}).\nSomeone may already be working on this. Use --force to override.`);
|
|
124
|
+
}
|
|
125
|
+
logger.warn(`Warning: "On it" comment from ${hoursAgo}h ago - proceeding with --force`);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
logger.warn(`Warning: Stale "On it" comment (${hoursAgo}h ago). Proceeding.`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// 3. Check for open PRs referencing this issue
|
|
132
|
+
try {
|
|
133
|
+
const prResult = await run(`gh pr list --search "in:body #${issueNumber}" --json number,title --limit 5`);
|
|
134
|
+
const openPRs = JSON.parse(prResult.stdout);
|
|
135
|
+
if (openPRs.length > 0) {
|
|
136
|
+
if (!force) {
|
|
137
|
+
const prList = openPRs.map((pr) => ` - PR #${pr.number}: ${pr.title}`).join('\n');
|
|
138
|
+
fatal(`Found ${openPRs.length} open PR(s) referencing issue #${issueNumber}:\n${prList}\nUse --force to proceed anyway.`);
|
|
139
|
+
}
|
|
140
|
+
logger.warn(`Warning: Found ${openPRs.length} open PR(s) referencing issue - proceeding with --force`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// Non-fatal: continue if PR check fails
|
|
145
|
+
}
|
|
146
|
+
// 4. Warn if issue is already closed
|
|
147
|
+
if (issue.state === 'CLOSED') {
|
|
148
|
+
logger.warn(`Warning: Issue #${issueNumber} is already closed`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// =============================================================================
|
|
152
|
+
// Pre-Spawn Hooks
|
|
153
|
+
// =============================================================================
|
|
154
|
+
/**
|
|
155
|
+
* Execute pre-spawn hooks defined in protocol.json
|
|
156
|
+
* Hooks are data-driven but reuse existing implementation logic
|
|
157
|
+
*/
|
|
158
|
+
export async function executePreSpawnHooks(protocol, context) {
|
|
159
|
+
if (!protocol?.hooks?.['pre-spawn'])
|
|
160
|
+
return;
|
|
161
|
+
const hooks = protocol.hooks['pre-spawn'];
|
|
162
|
+
// collision-check: reuses existing checkBugfixCollisions() logic
|
|
163
|
+
if (hooks['collision-check'] && context.issueNumber && context.issue && context.worktreePath) {
|
|
164
|
+
await checkBugfixCollisions(context.issueNumber, context.worktreePath, context.issue, !!context.force);
|
|
165
|
+
}
|
|
166
|
+
// comment-on-issue: posts comment to GitHub issue
|
|
167
|
+
if (hooks['comment-on-issue'] && context.issueNumber && !context.noComment) {
|
|
168
|
+
const message = hooks['comment-on-issue'];
|
|
169
|
+
logger.info('Commenting on issue...');
|
|
170
|
+
try {
|
|
171
|
+
await run(`gh issue comment ${context.issueNumber} --body "${message}"`);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
logger.warn('Warning: Failed to comment on issue (continuing anyway)');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// =============================================================================
|
|
179
|
+
// Resume Validation
|
|
180
|
+
// =============================================================================
|
|
181
|
+
/**
|
|
182
|
+
* Validate that a worktree exists and is valid for resuming
|
|
183
|
+
*/
|
|
184
|
+
export function validateResumeWorktree(worktreePath) {
|
|
185
|
+
if (!existsSync(worktreePath)) {
|
|
186
|
+
fatal(`Cannot resume: worktree does not exist at ${worktreePath}`);
|
|
187
|
+
}
|
|
188
|
+
if (!existsSync(resolve(worktreePath, '.git'))) {
|
|
189
|
+
fatal(`Cannot resume: ${worktreePath} is not a valid git worktree`);
|
|
190
|
+
}
|
|
191
|
+
logger.info('Resuming existing worktree (skipping creation)');
|
|
192
|
+
}
|
|
193
|
+
// =============================================================================
|
|
194
|
+
// Terminal Session Creation
|
|
195
|
+
// =============================================================================
|
|
196
|
+
/**
|
|
197
|
+
* Create a terminal session via the Tower REST API.
|
|
198
|
+
* The Tower server must be running (port 4100).
|
|
199
|
+
*/
|
|
200
|
+
export async function createPtySession(config, command, args, cwd, registration) {
|
|
201
|
+
const body = { command, args, cwd, cols: 200, rows: 50, persistent: true };
|
|
202
|
+
if (registration) {
|
|
203
|
+
body.projectPath = registration.projectPath;
|
|
204
|
+
body.type = registration.type;
|
|
205
|
+
body.roleId = registration.roleId;
|
|
206
|
+
}
|
|
207
|
+
const response = await fetch(`http://localhost:${DEFAULT_TOWER_PORT}/api/terminals`, {
|
|
208
|
+
method: 'POST',
|
|
209
|
+
headers: { 'Content-Type': 'application/json' },
|
|
210
|
+
body: JSON.stringify(body),
|
|
211
|
+
});
|
|
212
|
+
if (!response.ok) {
|
|
213
|
+
const text = await response.text();
|
|
214
|
+
throw new Error(`Failed to create PTY session: ${response.status} ${text}`);
|
|
215
|
+
}
|
|
216
|
+
const result = await response.json();
|
|
217
|
+
return { terminalId: result.id };
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Start a terminal session for a builder
|
|
221
|
+
*/
|
|
222
|
+
export async function startBuilderSession(config, builderId, worktreePath, baseCmd, prompt, roleContent, roleSource) {
|
|
223
|
+
logger.info('Creating terminal session...');
|
|
224
|
+
// Write initial prompt to a file for reference
|
|
225
|
+
const promptFile = resolve(worktreePath, '.builder-prompt.txt');
|
|
226
|
+
writeFileSync(promptFile, prompt);
|
|
227
|
+
// Build the start script with role if provided
|
|
228
|
+
const scriptPath = resolve(worktreePath, '.builder-start.sh');
|
|
229
|
+
let scriptContent;
|
|
230
|
+
if (roleContent) {
|
|
231
|
+
// Write role to a file and use $(cat) to avoid shell escaping issues
|
|
232
|
+
const roleFile = resolve(worktreePath, '.builder-role.md');
|
|
233
|
+
// Inject the actual dashboard port into the role prompt
|
|
234
|
+
const roleWithPort = roleContent.replace(/\{PORT\}/g, String(DEFAULT_TOWER_PORT));
|
|
235
|
+
writeFileSync(roleFile, roleWithPort);
|
|
236
|
+
logger.info(`Loaded role (${roleSource})`);
|
|
237
|
+
scriptContent = `#!/bin/bash
|
|
238
|
+
cd "${worktreePath}"
|
|
239
|
+
while true; do
|
|
240
|
+
${baseCmd} --append-system-prompt "$(cat '${roleFile}')" "$(cat '${promptFile}')"
|
|
241
|
+
echo ""
|
|
242
|
+
echo "Claude exited. Restarting in 2 seconds... (Ctrl+C to quit)"
|
|
243
|
+
sleep 2
|
|
244
|
+
done
|
|
245
|
+
`;
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
scriptContent = `#!/bin/bash
|
|
249
|
+
cd "${worktreePath}"
|
|
250
|
+
while true; do
|
|
251
|
+
${baseCmd} "$(cat '${promptFile}')"
|
|
252
|
+
echo ""
|
|
253
|
+
echo "Claude exited. Restarting in 2 seconds... (Ctrl+C to quit)"
|
|
254
|
+
sleep 2
|
|
255
|
+
done
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
258
|
+
writeFileSync(scriptPath, scriptContent);
|
|
259
|
+
chmodSync(scriptPath, '755');
|
|
260
|
+
// Create PTY session via Tower REST API (shellper for persistence)
|
|
261
|
+
logger.info('Creating PTY terminal session...');
|
|
262
|
+
const { terminalId } = await createPtySession(config, '/bin/bash', [scriptPath], worktreePath, { projectPath: config.projectRoot, type: 'builder', roleId: builderId });
|
|
263
|
+
logger.info(`Terminal session created: ${terminalId}`);
|
|
264
|
+
return { terminalId };
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Start a shell session (no worktree, just node-pty)
|
|
268
|
+
*/
|
|
269
|
+
export async function startShellSession(config, shellId, baseCmd) {
|
|
270
|
+
// Create PTY session via REST API
|
|
271
|
+
logger.info('Creating PTY terminal session for shell...');
|
|
272
|
+
const { terminalId } = await createPtySession(config, '/bin/bash', ['-c', baseCmd], config.projectRoot, { projectPath: config.projectRoot, type: 'shell', roleId: shellId });
|
|
273
|
+
logger.info(`Shell terminal session created: ${terminalId}`);
|
|
274
|
+
return { terminalId };
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Build a launch script for worktree mode (no initial prompt)
|
|
278
|
+
*/
|
|
279
|
+
export function buildWorktreeLaunchScript(worktreePath, baseCmd, role) {
|
|
280
|
+
if (role) {
|
|
281
|
+
const roleFile = resolve(worktreePath, '.builder-role.md');
|
|
282
|
+
const roleWithPort = role.content.replace(/\{PORT\}/g, String(DEFAULT_TOWER_PORT));
|
|
283
|
+
writeFileSync(roleFile, roleWithPort);
|
|
284
|
+
logger.info(`Loaded role (${role.source})`);
|
|
285
|
+
return `#!/bin/bash
|
|
286
|
+
cd "${worktreePath}"
|
|
287
|
+
while true; do
|
|
288
|
+
${baseCmd} --append-system-prompt "$(cat '${roleFile}')"
|
|
289
|
+
echo ""
|
|
290
|
+
echo "Claude exited. Restarting in 2 seconds... (Ctrl+C to quit)"
|
|
291
|
+
sleep 2
|
|
292
|
+
done
|
|
293
|
+
`;
|
|
294
|
+
}
|
|
295
|
+
return `#!/bin/bash
|
|
296
|
+
cd "${worktreePath}"
|
|
297
|
+
while true; do
|
|
298
|
+
${baseCmd}
|
|
299
|
+
echo ""
|
|
300
|
+
echo "Claude exited. Restarting in 2 seconds... (Ctrl+C to quit)"
|
|
301
|
+
sleep 2
|
|
302
|
+
done
|
|
303
|
+
`;
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=spawn-worktree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-worktree.js","sourceRoot":"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B,CACvC,YAAoB,EACpB,OAAe,EACf,IAAgD;IAEhD,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;QAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACnF,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5C,OAAO;MACL,YAAY;;IAEd,OAAO,mCAAmC,QAAQ;;;;;CAKrD,CAAC;IACA,CAAC;IACD,OAAO;MACH,YAAY;;IAEd,OAAO;;;;;CAKV,CAAC;AACF,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Spawn command
|
|
2
|
+
* Spawn command — orchestrator module.
|
|
3
|
+
* Spec 0105: Tower Server Decomposition — Phase 7
|
|
3
4
|
*
|
|
4
5
|
* Modes:
|
|
5
6
|
* - spec: --project/-p Spawn for a spec file (existing behavior)
|
|
6
7
|
* - task: --task Spawn with an ad-hoc task description
|
|
7
8
|
* - protocol: --protocol Spawn to run a protocol (cleanup, experiment, etc.)
|
|
8
9
|
* - shell: --shell Bare Claude session (no prompt, no worktree)
|
|
10
|
+
*
|
|
11
|
+
* Role/prompt logic extracted to spawn-roles.ts.
|
|
12
|
+
* Worktree/git logic extracted to spawn-worktree.ts.
|
|
9
13
|
*/
|
|
10
14
|
import type { SpawnOptions } from '../types.js';
|
|
11
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/commands/spawn.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/commands/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAgC,MAAM,aAAa,CAAC;AAyf9E;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ChE"}
|