@cluesmith/codev 3.2.4 → 3.3.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/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
- package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-D3XaKpZW.js} +46 -44
- package/dashboard-dist/assets/index-D3XaKpZW.js.map +1 -0
- package/dashboard-dist/index.html +2 -2
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +154 -0
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
- package/dist/agent-farm/commands/cleanup.js +16 -0
- package/dist/agent-farm/commands/cleanup.js.map +1 -1
- package/dist/agent-farm/commands/inbox.d.ts +42 -0
- package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
- package/dist/agent-farm/commands/inbox.js +129 -0
- package/dist/agent-farm/commands/inbox.js.map +1 -0
- package/dist/agent-farm/commands/interrupt.d.ts +20 -0
- package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
- package/dist/agent-farm/commands/interrupt.js +65 -0
- package/dist/agent-farm/commands/interrupt.js.map +1 -0
- package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
- package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/constants.js +52 -0
- package/dist/agent-farm/commands/reset/constants.js.map +1 -0
- package/dist/agent-farm/commands/reset/context.d.ts +230 -0
- package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/context.js +428 -0
- package/dist/agent-farm/commands/reset/context.js.map +1 -0
- package/dist/agent-farm/commands/reset/index.d.ts +192 -0
- package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/index.js +488 -0
- package/dist/agent-farm/commands/reset/index.js.map +1 -0
- package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
- package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/receipt.js +149 -0
- package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
- package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
- package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/reorient.js +313 -0
- package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
- package/dist/agent-farm/commands/reset.d.ts +34 -0
- package/dist/agent-farm/commands/reset.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset.js +309 -0
- package/dist/agent-farm/commands/reset.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +49 -8
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.d.ts +105 -6
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +289 -66
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +13 -1
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +80 -8
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +13 -0
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/db/index.d.ts +1 -1
- package/dist/agent-farm/db/index.d.ts.map +1 -1
- package/dist/agent-farm/db/index.js +80 -1
- package/dist/agent-farm/db/index.js.map +1 -1
- package/dist/agent-farm/db/mailbox.d.ts +222 -0
- package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
- package/dist/agent-farm/db/mailbox.js +304 -0
- package/dist/agent-farm/db/mailbox.js.map +1 -0
- package/dist/agent-farm/db/schema.d.ts +1 -1
- package/dist/agent-farm/db/schema.d.ts.map +1 -1
- package/dist/agent-farm/db/schema.js +35 -0
- package/dist/agent-farm/db/schema.js.map +1 -1
- package/dist/agent-farm/db/types.d.ts +45 -0
- package/dist/agent-farm/db/types.d.ts.map +1 -1
- package/dist/agent-farm/db/types.js.map +1 -1
- package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
- package/dist/agent-farm/lib/builder-lookup.js +2 -2
- package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
- package/dist/agent-farm/lib/reconnect-backoff.d.ts +64 -0
- package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
- package/dist/agent-farm/lib/reconnect-backoff.js +57 -0
- package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
- package/dist/agent-farm/lib/tower-client.d.ts +16 -6
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tower-client.js +37 -6
- package/dist/agent-farm/lib/tower-client.js.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.js +225 -30
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- package/dist/agent-farm/servers/canvas-relay.d.ts +60 -0
- package/dist/agent-farm/servers/canvas-relay.d.ts.map +1 -0
- package/dist/agent-farm/servers/canvas-relay.js +376 -0
- package/dist/agent-farm/servers/canvas-relay.js.map +1 -0
- package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
- package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
- package/dist/agent-farm/servers/cron-delivery.js +80 -0
- package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
- package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
- package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
- package/dist/agent-farm/servers/delayed-send.js +165 -0
- package/dist/agent-farm/servers/delayed-send.js.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.js +113 -0
- package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
- package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
- package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
- package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
- package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
- package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
- package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
- package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
- package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
- package/dist/agent-farm/servers/message-write.d.ts +53 -1
- package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
- package/dist/agent-farm/servers/message-write.js +63 -0
- package/dist/agent-farm/servers/message-write.js.map +1 -1
- package/dist/agent-farm/servers/overview.d.ts +19 -0
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +100 -4
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/render-gate.d.ts +141 -0
- package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
- package/dist/agent-farm/servers/render-gate.js +251 -0
- package/dist/agent-farm/servers/render-gate.js.map +1 -0
- package/dist/agent-farm/servers/session-submit.d.ts +90 -0
- package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
- package/dist/agent-farm/servers/session-submit.js +127 -0
- package/dist/agent-farm/servers/session-submit.js.map +1 -0
- package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
- package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-cron.js +58 -53
- package/dist/agent-farm/servers/tower-cron.js.map +1 -1
- package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +78 -16
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
- package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-messages.js +106 -1
- package/dist/agent-farm/servers/tower-messages.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +826 -145
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +188 -34
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +23 -2
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +134 -127
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +63 -4
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/servers/tower-types.d.ts +2 -1
- package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.d.ts +64 -1
- package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.js +168 -1
- package/dist/agent-farm/servers/tower-utils.js.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts +6 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +95 -57
- package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
- package/dist/agent-farm/servers/write-queue.d.ts +35 -0
- package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
- package/dist/agent-farm/servers/write-queue.js +56 -0
- package/dist/agent-farm/servers/write-queue.js.map +1 -0
- package/dist/agent-farm/types.d.ts +39 -0
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.d.ts +2 -2
- package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.js +3 -3
- package/dist/agent-farm/utils/agent-names.js.map +1 -1
- package/dist/agent-farm/utils/architect-name.d.ts +2 -2
- package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
- package/dist/agent-farm/utils/architect-name.js +3 -3
- package/dist/agent-farm/utils/architect-name.js.map +1 -1
- package/dist/agent-farm/utils/config.d.ts +13 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +33 -1
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/harness.d.ts +103 -7
- package/dist/agent-farm/utils/harness.d.ts.map +1 -1
- package/dist/agent-farm/utils/harness.js +126 -19
- package/dist/agent-farm/utils/harness.js.map +1 -1
- package/dist/agent-farm/utils/message-format.d.ts +8 -0
- package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
- package/dist/agent-farm/utils/message-format.js +20 -0
- package/dist/agent-farm/utils/message-format.js.map +1 -1
- package/dist/agent-farm/utils/server-utils.d.ts +80 -4
- package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
- package/dist/agent-farm/utils/server-utils.js +286 -5
- package/dist/agent-farm/utils/server-utils.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -32
- package/dist/cli.js.map +1 -1
- package/dist/commands/consult/cli-options.d.ts +34 -0
- package/dist/commands/consult/cli-options.d.ts.map +1 -0
- package/dist/commands/consult/cli-options.js +67 -0
- package/dist/commands/consult/cli-options.js.map +1 -0
- package/dist/commands/consult/index.d.ts +56 -2
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +272 -28
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/consult/metrics.d.ts +42 -0
- package/dist/commands/consult/metrics.d.ts.map +1 -1
- package/dist/commands/consult/metrics.js +129 -9
- package/dist/commands/consult/metrics.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +71 -19
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/porch/checks.d.ts +23 -0
- package/dist/commands/porch/checks.d.ts.map +1 -1
- package/dist/commands/porch/checks.js +60 -0
- package/dist/commands/porch/checks.js.map +1 -1
- package/dist/commands/porch/config.d.ts +20 -0
- package/dist/commands/porch/config.d.ts.map +1 -1
- package/dist/commands/porch/config.js +20 -0
- package/dist/commands/porch/config.js.map +1 -1
- package/dist/commands/porch/index.js +21 -28
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +2 -41
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/lib/config.d.ts +69 -3
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +67 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/consult-lanes.d.ts +149 -0
- package/dist/lib/consult-lanes.d.ts.map +1 -0
- package/dist/lib/consult-lanes.js +360 -0
- package/dist/lib/consult-lanes.js.map +1 -0
- package/dist/lib/forge-contracts.d.ts +9 -0
- package/dist/lib/forge-contracts.d.ts.map +1 -1
- package/dist/lib/forge-contracts.js.map +1 -1
- package/dist/lib/github.d.ts +15 -1
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +18 -1
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
- package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
- package/dist/lib/prompt-behavior-metrics.js +290 -0
- package/dist/lib/prompt-behavior-metrics.js.map +1 -0
- package/dist/lib/skeleton.d.ts +22 -1
- package/dist/lib/skeleton.d.ts.map +1 -1
- package/dist/lib/skeleton.js +120 -0
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/test-env.d.ts +74 -0
- package/dist/lib/test-env.d.ts.map +1 -0
- package/dist/lib/test-env.js +92 -0
- package/dist/lib/test-env.js.map +1 -0
- package/dist/terminal/attach-replay.d.ts +39 -0
- package/dist/terminal/attach-replay.d.ts.map +1 -0
- package/dist/terminal/attach-replay.js +76 -0
- package/dist/terminal/attach-replay.js.map +1 -0
- package/dist/terminal/pty-manager.d.ts +2 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +51 -23
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +201 -1
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +327 -46
- package/dist/terminal/pty-session.js.map +1 -1
- package/dist/terminal/ring-buffer.d.ts +39 -6
- package/dist/terminal/ring-buffer.d.ts.map +1 -1
- package/dist/terminal/ring-buffer.js +74 -6
- package/dist/terminal/ring-buffer.js.map +1 -1
- package/dist/terminal/session-manager.d.ts +53 -0
- package/dist/terminal/session-manager.d.ts.map +1 -1
- package/dist/terminal/session-manager.js +94 -9
- package/dist/terminal/session-manager.js.map +1 -1
- package/dist/terminal/session-screen.d.ts +116 -0
- package/dist/terminal/session-screen.d.ts.map +1 -0
- package/dist/terminal/session-screen.js +180 -0
- package/dist/terminal/session-screen.js.map +1 -0
- package/dist/terminal/shellper-main.js +2 -1
- package/dist/terminal/shellper-main.js.map +1 -1
- package/dist/terminal/shellper-process.d.ts +1 -1
- package/dist/terminal/shellper-process.d.ts.map +1 -1
- package/dist/terminal/shellper-process.js +17 -8
- package/dist/terminal/shellper-process.js.map +1 -1
- package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
- package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
- package/dist/terminal/shellper-replay-buffer.js +167 -31
- package/dist/terminal/shellper-replay-buffer.js.map +1 -1
- package/package.json +13 -8
- package/scripts/forge/gitea/pr-view.sh +4 -1
- package/scripts/forge/github/pr-view.sh +1 -1
- package/scripts/forge/gitlab/pr-view.sh +4 -1
- package/skeleton/.claude/skills/afx/SKILL.md +68 -1
- package/skeleton/.claude/skills/arch-init/SKILL.md +22 -9
- package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.claude/skills/codev/SKILL.md +31 -0
- package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/.codex/skills/afx/SKILL.md +68 -1
- package/skeleton/.codex/skills/arch-init/SKILL.md +22 -9
- package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.codex/skills/codev/SKILL.md +31 -0
- package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/protocols/air/builder-prompt.md +28 -47
- package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
- package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
- package/skeleton/protocols/air/prompts/implement.md +20 -73
- package/skeleton/protocols/air/prompts/pr.md +22 -54
- package/skeleton/protocols/air/protocol.md +40 -71
- package/skeleton/protocols/aspir/builder-prompt.md +29 -66
- package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
- package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
- package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
- package/skeleton/protocols/aspir/prompts/implement.md +27 -196
- package/skeleton/protocols/aspir/prompts/plan.md +21 -85
- package/skeleton/protocols/aspir/prompts/review.md +29 -228
- package/skeleton/protocols/aspir/prompts/specify.md +25 -111
- package/skeleton/protocols/aspir/protocol.json +10 -0
- package/skeleton/protocols/aspir/protocol.md +36 -82
- package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
- package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
- package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
- package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
- package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
- package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
- package/skeleton/protocols/bugfix/protocol.md +44 -50
- package/skeleton/protocols/experiment/builder-prompt.md +25 -58
- package/skeleton/protocols/experiment/protocol.md +22 -188
- package/skeleton/protocols/experiment/templates/notes.md +11 -71
- package/skeleton/protocols/maintain/builder-prompt.md +24 -45
- package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
- package/skeleton/protocols/maintain/protocol.md +32 -266
- package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
- package/skeleton/protocols/pir/builder-prompt.md +31 -64
- package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
- package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
- package/skeleton/protocols/pir/prompts/implement.md +2 -3
- package/skeleton/protocols/pir/prompts/plan.md +1 -4
- package/skeleton/protocols/pir/prompts/review.md +2 -2
- package/skeleton/protocols/pir/protocol.md +54 -177
- package/skeleton/protocols/research/builder-prompt.md +27 -58
- package/skeleton/protocols/research/protocol.md +28 -153
- package/skeleton/protocols/spike/builder-prompt.md +30 -48
- package/skeleton/protocols/spike/protocol.md +24 -107
- package/skeleton/protocols/spike/templates/findings.md +9 -39
- package/skeleton/protocols/spir/builder-prompt.md +33 -62
- package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
- package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
- package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
- package/skeleton/protocols/spir/prompts/implement.md +26 -195
- package/skeleton/protocols/spir/prompts/plan.md +20 -84
- package/skeleton/protocols/spir/prompts/review.md +28 -227
- package/skeleton/protocols/spir/prompts/specify.md +24 -110
- package/skeleton/protocols/spir/protocol.json +10 -0
- package/skeleton/protocols/spir/protocol.md +84 -633
- package/skeleton/protocols/spir/templates/plan.md +28 -147
- package/skeleton/protocols/spir/templates/review.md +21 -80
- package/skeleton/protocols/spir/templates/spec.md +24 -118
- package/skeleton/resources/commands/agent-farm.md +262 -0
- package/skeleton/resources/commands/consult.md +236 -8
- package/skeleton/resources/commands/overview.md +1 -0
- package/skeleton/roles/architect.md +67 -317
- package/skeleton/roles/builder.md +76 -191
- package/skeleton/templates/AGENTS.md +2 -0
- package/skeleton/templates/CLAUDE.md +2 -0
- package/templates/3d-viewer.html +32 -4
- package/templates/open.html +58 -12
- package/templates/tower.html +65 -9
- package/templates/vendor/three-3MFLoader.js +1478 -0
- package/templates/vendor/three-STLLoader.js +410 -0
- package/templates/vendor/three-TrackballControls.js +828 -0
- package/templates/vendor/three-fflate.module.js +2474 -0
- package/templates/vendor/three.module.js +53044 -0
- package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
- package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
- package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
- package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
- package/dist/agent-farm/servers/send-buffer.js +0 -116
- package/dist/agent-farm/servers/send-buffer.js.map +0 -1
- package/skeleton/porch/prompts/defend.md +0 -108
- package/skeleton/porch/prompts/diagnose.md +0 -70
- package/skeleton/porch/prompts/evaluate.md +0 -132
- package/skeleton/porch/prompts/fix.md +0 -59
- package/skeleton/porch/prompts/implement.md +0 -88
- package/skeleton/porch/prompts/plan.md +0 -74
- package/skeleton/porch/prompts/pr.md +0 -84
- package/skeleton/porch/prompts/review.md +0 -249
- package/skeleton/porch/prompts/specify.md +0 -53
- package/skeleton/porch/prompts/test.md +0 -63
- package/skeleton/protocols/aspir/templates/plan.md +0 -184
- package/skeleton/protocols/aspir/templates/review.md +0 -120
- package/skeleton/protocols/aspir/templates/spec.md +0 -154
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/config.ts"],"names":[],"mappings":"AAAA;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-1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent harness abstraction.
|
|
3
3
|
*
|
|
4
|
-
* Encapsulates how different agent CLI tools (Claude, Codex,
|
|
4
|
+
* Encapsulates how different agent CLI tools (Claude, Codex, etc.)
|
|
5
5
|
* handle role/system prompt injection. Built-in providers cover Claude, Codex,
|
|
6
|
-
* and
|
|
6
|
+
* and OpenCode. Custom providers can be defined in .codev/config.json.
|
|
7
|
+
*
|
|
8
|
+
* The built-in Gemini CLI harness was retired in Issue #1338 (Google ended
|
|
9
|
+
* consumer-tier Gemini CLI availability on 2026-06-18); selecting it now fails
|
|
10
|
+
* closed with a retirement message instead of resolving a provider. See
|
|
11
|
+
* RETIRED_HARNESSES below.
|
|
7
12
|
*
|
|
8
13
|
* Two integration patterns exist:
|
|
9
14
|
* - Node spawn() call sites: use buildRoleInjection() → returns args + env
|
|
@@ -29,6 +34,16 @@ export interface HarnessProvider {
|
|
|
29
34
|
fragment: string;
|
|
30
35
|
env: Record<string, string>;
|
|
31
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Whether this harness can clear its conversation context in-session, without
|
|
39
|
+
* restarting the process (Spec 1273 — `afx refresh`).
|
|
40
|
+
*
|
|
41
|
+
* Optional, and absence means "no": a harness that has not declared support
|
|
42
|
+
* must not be reset, and defaulting to unsupported is the safe direction. Only
|
|
43
|
+
* Claude declares it today (`/clear`), which is why `afx refresh` refuses other
|
|
44
|
+
* harnesses loudly rather than improvising a substitute mechanism.
|
|
45
|
+
*/
|
|
46
|
+
supportsContextReset?: boolean;
|
|
32
47
|
/**
|
|
33
48
|
* Optional: files to write in the worktree before launching the agent.
|
|
34
49
|
* Used by harnesses that rely on file-based configuration (e.g., OpenCode
|
|
@@ -59,6 +74,22 @@ export interface HarnessProvider {
|
|
|
59
74
|
newSessionArgs(sessionId: string): string[];
|
|
60
75
|
/** Args to RESUME an existing session by id (caller skips role injection). */
|
|
61
76
|
resumeArgs(sessionId: string): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Optional: script-fragment forms of newSessionArgs/resumeArgs for bash
|
|
79
|
+
* script generation (the builder launch loop — Issue #1233), mirroring the
|
|
80
|
+
* dual-form convention of buildRoleInjection/buildScriptRoleInjection and
|
|
81
|
+
* buildResume's args/scriptFragment pair.
|
|
82
|
+
*
|
|
83
|
+
* `idExpr` is a shell expression the caller has already quoted (e.g.
|
|
84
|
+
* `"$codev_session_id"`), NOT a literal id: the generated loop re-mints ids
|
|
85
|
+
* at runtime (clean-exit relaunch, unresumable-session degrade), so the
|
|
86
|
+
* fragment must reference the script's variable rather than bake a value.
|
|
87
|
+
*
|
|
88
|
+
* BOTH must be present for the session-aware loop; a harness providing
|
|
89
|
+
* neither keeps the historical prompt-replay restart loop.
|
|
90
|
+
*/
|
|
91
|
+
newSessionScriptFragment?(idExpr: string): string;
|
|
92
|
+
resumeScriptFragment?(idExpr: string): string;
|
|
62
93
|
/**
|
|
63
94
|
* Optional: verify that `sessionId` still has a resumable session on disk
|
|
64
95
|
* for `cwd` before the caller resumes it (Issue #1145). Returns false when
|
|
@@ -103,8 +134,69 @@ export interface CustomHarnessConfig {
|
|
|
103
134
|
}
|
|
104
135
|
export declare const CLAUDE_HARNESS: HarnessProvider;
|
|
105
136
|
export declare const CODEX_HARNESS: HarnessProvider;
|
|
106
|
-
export declare const GEMINI_HARNESS: HarnessProvider;
|
|
107
137
|
export declare const OPENCODE_HARNESS: HarnessProvider;
|
|
138
|
+
/**
|
|
139
|
+
* Exported for Spec 1273: `afx refresh` identifies a running builder's harness from
|
|
140
|
+
* its launch script and must check `supportsContextReset` before typing into the
|
|
141
|
+
* terminal. It needs the name→provider map, not just the workspace default.
|
|
142
|
+
*/
|
|
143
|
+
export declare const BUILTIN_HARNESSES: Record<string, HarnessProvider>;
|
|
144
|
+
/**
|
|
145
|
+
* The built-in provider for `name`, or `undefined` when `name` is not a built-in
|
|
146
|
+
* harness. Uses an own-property check — the same guard `isRetiredHarness` gives
|
|
147
|
+
* `RETIRED_HARNESSES` — so inherited Object members (`constructor`, `toString`,
|
|
148
|
+
* `hasOwnProperty`, `valueOf`, …) on a *user-controlled* name are never misread as
|
|
149
|
+
* a provider. A bare `BUILTIN_HARNESSES[name]` for `name = 'constructor'` returns
|
|
150
|
+
* `Object`'s constructor (a truthy function), which a `if (builtin) return builtin`
|
|
151
|
+
* check would then hand back as a bogus "provider" that TypeErrors at the first
|
|
152
|
+
* `buildRoleInjection` call. The name reaches here straight from config
|
|
153
|
+
* (`shell.builderHarness` / a builder launch script), so the key is untrusted.
|
|
154
|
+
*/
|
|
155
|
+
export declare function getBuiltinHarness(name: string): HarnessProvider | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Built-in harness names Codev no longer supports, each mapped to the
|
|
158
|
+
* explanation shown when a user still selects it.
|
|
159
|
+
*
|
|
160
|
+
* A retired name is intercepted on *every* `resolveHarness` exit — the explicit
|
|
161
|
+
* path and the command auto-detect path — so it fails loudly and closed rather
|
|
162
|
+
* than silently falling back to Claude (the Issue #929 mis-injection class) or
|
|
163
|
+
* returning `undefined` (a `BUILTIN_HARNESSES[name]` miss → downstream
|
|
164
|
+
* TypeError). See `resolveHarness` and Issue #1338.
|
|
165
|
+
*
|
|
166
|
+
* Escape hatch: a user who retains access to a retired CLI (e.g. an
|
|
167
|
+
* enterprise/API-key Gemini subscription) can still wire it as a *custom*
|
|
168
|
+
* harness in .codev/config.json — the retirement targets the built-in name,
|
|
169
|
+
* not a user's own definition.
|
|
170
|
+
*/
|
|
171
|
+
export declare const RETIRED_HARNESSES: Record<string, string>;
|
|
172
|
+
/**
|
|
173
|
+
* Whether `name` is a retired built-in harness. Uses an own-property check so
|
|
174
|
+
* inherited Object keys (`constructor`, `toString`, …) are never misread as
|
|
175
|
+
* retired.
|
|
176
|
+
*/
|
|
177
|
+
export declare function isRetiredHarness(name: string): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The retirement explanation for `name`, or `undefined` when `name` is not a
|
|
180
|
+
* retired harness.
|
|
181
|
+
*/
|
|
182
|
+
export declare function getRetirement(name: string): string | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Error thrown when a retired harness name is selected. A distinct type lets a
|
|
185
|
+
* caller scope a `catch` to the retirement — return a safe default, or abort a
|
|
186
|
+
* spawn before it creates state — and rethrow every other error unchanged. Used
|
|
187
|
+
* by the spawn pre-flight and the Tower-side `siblingRegistrationIsLive`
|
|
188
|
+
* predicate (Issue #1338). `harnessName` is the retired name that triggered it.
|
|
189
|
+
*/
|
|
190
|
+
export declare class RetiredHarnessError extends Error {
|
|
191
|
+
readonly harnessName: string;
|
|
192
|
+
constructor(harnessName: string, message: string);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Throw the consistent retirement error for retired harness `name`. Returns
|
|
196
|
+
* `never` so callers can use it as a resolver exit on any branch and keep one
|
|
197
|
+
* identical message regardless of which path selected the retired name.
|
|
198
|
+
*/
|
|
199
|
+
export declare function throwRetired(name: string): never;
|
|
108
200
|
/**
|
|
109
201
|
* Escape a string for safe inclusion inside single quotes in bash.
|
|
110
202
|
* Replaces ' with '\'' (end quote, escaped quote, start quote).
|
|
@@ -130,11 +222,15 @@ export declare function detectHarnessFromCommand(command: string): string | unde
|
|
|
130
222
|
* Resolve a harness name to a HarnessProvider.
|
|
131
223
|
*
|
|
132
224
|
* Resolution order:
|
|
133
|
-
* 1. Explicit harnessName → built-in
|
|
134
|
-
* 2.
|
|
135
|
-
*
|
|
225
|
+
* 1. Explicit harnessName → built-in provider, else custom provider
|
|
226
|
+
* 2. Retired name → throw the retirement error (fail closed). A same-named
|
|
227
|
+
* custom harness still wins for an *explicit* name (the escape hatch), but an
|
|
228
|
+
* auto-detected retired command is always retired — auto-detection never
|
|
229
|
+
* consults custom harnesses (Issue #1338).
|
|
230
|
+
* 3. Auto-detect from command string basename (if command provided)
|
|
231
|
+
* 4. Default to claude (backward compatible)
|
|
136
232
|
*
|
|
137
|
-
* Throws if harnessName is set but doesn't match any
|
|
233
|
+
* Throws if harnessName is retired, or is set but doesn't match any provider.
|
|
138
234
|
*/
|
|
139
235
|
export declare function resolveHarness(harnessName: string | undefined, customHarnesses?: Record<string, CustomHarnessConfig>, command?: string): HarnessProvider;
|
|
140
236
|
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/harness.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AASH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG;QAC7D,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC7B,CAAC;IAEF;;;;OAIG;IACH,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG;QACnE,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC7B,CAAC;IAEF;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;;OAQG;IACH,gBAAgB,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC;QACxF,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IAEH;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE;QACR,wFAAwF;QACxF,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5C,8EAA8E;QAC9E,UAAU,CAAC,S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;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUpD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE9D;AAED;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAChB,WAAW,EAAE,MAAM;gBAAnB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIjE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAEhD;AAkBD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D;AAMD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,mBAAmB,GAAG,eAAe,CAmBvF;AAMD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,mBAAmB,CAyC9F;AAMD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAa5E;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EACrD,OAAO,CAAC,EAAE,MAAM,GACf,eAAe,CA4CjB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent harness abstraction.
|
|
3
3
|
*
|
|
4
|
-
* Encapsulates how different agent CLI tools (Claude, Codex,
|
|
4
|
+
* Encapsulates how different agent CLI tools (Claude, Codex, etc.)
|
|
5
5
|
* handle role/system prompt injection. Built-in providers cover Claude, Codex,
|
|
6
|
-
* and
|
|
6
|
+
* and OpenCode. Custom providers can be defined in .codev/config.json.
|
|
7
|
+
*
|
|
8
|
+
* The built-in Gemini CLI harness was retired in Issue #1338 (Google ended
|
|
9
|
+
* consumer-tier Gemini CLI availability on 2026-06-18); selecting it now fails
|
|
10
|
+
* closed with a retirement message instead of resolving a provider. See
|
|
11
|
+
* RETIRED_HARNESSES below.
|
|
7
12
|
*
|
|
8
13
|
* Two integration patterns exist:
|
|
9
14
|
* - Node spawn() call sites: use buildRoleInjection() → returns args + env
|
|
@@ -17,6 +22,10 @@ import { buildWorktreeGuardFiles } from './worktree-write-guard.js';
|
|
|
17
22
|
// Built-in providers
|
|
18
23
|
// =============================================================================
|
|
19
24
|
export const CLAUDE_HARNESS = {
|
|
25
|
+
// Spec 1273: `/clear` empties the conversation while leaving the process — and
|
|
26
|
+
// therefore the --append-system-prompt role below — intact. That is what makes
|
|
27
|
+
// an in-session reset possible here and nowhere else today.
|
|
28
|
+
supportsContextReset: true,
|
|
20
29
|
buildRoleInjection: (content, _filePath) => ({
|
|
21
30
|
args: ['--append-system-prompt', content],
|
|
22
31
|
env: {},
|
|
@@ -43,6 +52,10 @@ export const CLAUDE_HARNESS = {
|
|
|
43
52
|
session: {
|
|
44
53
|
newSessionArgs: (sessionId) => ['--session-id', sessionId],
|
|
45
54
|
resumeArgs: (sessionId) => ['--resume', sessionId],
|
|
55
|
+
// Issue #1233: script-fragment forms for the builder crash-resume loop.
|
|
56
|
+
// `idExpr` arrives pre-quoted (a shell variable reference, not a literal).
|
|
57
|
+
newSessionScriptFragment: (idExpr) => `--session-id ${idExpr}`,
|
|
58
|
+
resumeScriptFragment: (idExpr) => `--resume ${idExpr}`,
|
|
46
59
|
// Issue #1145: a stored id is only resumed when its jsonl still exists
|
|
47
60
|
// under this cwd's project dir (stale ids degrade to a fresh spawn).
|
|
48
61
|
verifyOwnership: (sessionId, cwd, opts) => verifySessionOwnership(cwd, sessionId, opts),
|
|
@@ -58,16 +71,6 @@ export const CODEX_HARNESS = {
|
|
|
58
71
|
env: {},
|
|
59
72
|
}),
|
|
60
73
|
};
|
|
61
|
-
export const GEMINI_HARNESS = {
|
|
62
|
-
buildRoleInjection: (_content, filePath) => ({
|
|
63
|
-
args: [],
|
|
64
|
-
env: { GEMINI_SYSTEM_MD: filePath },
|
|
65
|
-
}),
|
|
66
|
-
buildScriptRoleInjection: (_content, filePath) => ({
|
|
67
|
-
fragment: '',
|
|
68
|
-
env: { GEMINI_SYSTEM_MD: filePath },
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
74
|
export const OPENCODE_HARNESS = {
|
|
72
75
|
buildRoleInjection: () => {
|
|
73
76
|
throw new Error('OpenCode is only supported as a builder shell, not as an architect shell. ' +
|
|
@@ -81,12 +84,98 @@ export const OPENCODE_HARNESS = {
|
|
|
81
84
|
content: JSON.stringify({ instructions: ['.builder-role.md'] }, null, 2) + '\n',
|
|
82
85
|
}]),
|
|
83
86
|
};
|
|
84
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Exported for Spec 1273: `afx refresh` identifies a running builder's harness from
|
|
89
|
+
* its launch script and must check `supportsContextReset` before typing into the
|
|
90
|
+
* terminal. It needs the name→provider map, not just the workspace default.
|
|
91
|
+
*/
|
|
92
|
+
export const BUILTIN_HARNESSES = {
|
|
85
93
|
claude: CLAUDE_HARNESS,
|
|
86
94
|
codex: CODEX_HARNESS,
|
|
87
|
-
gemini: GEMINI_HARNESS,
|
|
88
95
|
opencode: OPENCODE_HARNESS,
|
|
89
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* The built-in provider for `name`, or `undefined` when `name` is not a built-in
|
|
99
|
+
* harness. Uses an own-property check — the same guard `isRetiredHarness` gives
|
|
100
|
+
* `RETIRED_HARNESSES` — so inherited Object members (`constructor`, `toString`,
|
|
101
|
+
* `hasOwnProperty`, `valueOf`, …) on a *user-controlled* name are never misread as
|
|
102
|
+
* a provider. A bare `BUILTIN_HARNESSES[name]` for `name = 'constructor'` returns
|
|
103
|
+
* `Object`'s constructor (a truthy function), which a `if (builtin) return builtin`
|
|
104
|
+
* check would then hand back as a bogus "provider" that TypeErrors at the first
|
|
105
|
+
* `buildRoleInjection` call. The name reaches here straight from config
|
|
106
|
+
* (`shell.builderHarness` / a builder launch script), so the key is untrusted.
|
|
107
|
+
*/
|
|
108
|
+
export function getBuiltinHarness(name) {
|
|
109
|
+
return Object.prototype.hasOwnProperty.call(BUILTIN_HARNESSES, name)
|
|
110
|
+
? BUILTIN_HARNESSES[name]
|
|
111
|
+
: undefined;
|
|
112
|
+
}
|
|
113
|
+
// =============================================================================
|
|
114
|
+
// Retired harnesses
|
|
115
|
+
// =============================================================================
|
|
116
|
+
/**
|
|
117
|
+
* Built-in harness names Codev no longer supports, each mapped to the
|
|
118
|
+
* explanation shown when a user still selects it.
|
|
119
|
+
*
|
|
120
|
+
* A retired name is intercepted on *every* `resolveHarness` exit — the explicit
|
|
121
|
+
* path and the command auto-detect path — so it fails loudly and closed rather
|
|
122
|
+
* than silently falling back to Claude (the Issue #929 mis-injection class) or
|
|
123
|
+
* returning `undefined` (a `BUILTIN_HARNESSES[name]` miss → downstream
|
|
124
|
+
* TypeError). See `resolveHarness` and Issue #1338.
|
|
125
|
+
*
|
|
126
|
+
* Escape hatch: a user who retains access to a retired CLI (e.g. an
|
|
127
|
+
* enterprise/API-key Gemini subscription) can still wire it as a *custom*
|
|
128
|
+
* harness in .codev/config.json — the retirement targets the built-in name,
|
|
129
|
+
* not a user's own definition.
|
|
130
|
+
*/
|
|
131
|
+
export const RETIRED_HARNESSES = {
|
|
132
|
+
gemini: 'The built-in Gemini CLI harness is retired. Google ended Gemini CLI ' +
|
|
133
|
+
'availability for consumer accounts (free, Pro, and Ultra tiers) on ' +
|
|
134
|
+
'2026-06-18, so it no longer works for most users. Use a supported harness ' +
|
|
135
|
+
'instead: claude, codex, or opencode. If you still have Gemini CLI access ' +
|
|
136
|
+
'(a Standard/Enterprise subscription or API-key auth), define a custom ' +
|
|
137
|
+
'harness named "gemini" in .codev/config.json under the "harness" section ' +
|
|
138
|
+
'and select it explicitly with shell.builderHarness / shell.architectHarness ' +
|
|
139
|
+
'— a bare auto-detected "gemini" command stays retired. See issue #1338.',
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Whether `name` is a retired built-in harness. Uses an own-property check so
|
|
143
|
+
* inherited Object keys (`constructor`, `toString`, …) are never misread as
|
|
144
|
+
* retired.
|
|
145
|
+
*/
|
|
146
|
+
export function isRetiredHarness(name) {
|
|
147
|
+
return Object.prototype.hasOwnProperty.call(RETIRED_HARNESSES, name);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The retirement explanation for `name`, or `undefined` when `name` is not a
|
|
151
|
+
* retired harness.
|
|
152
|
+
*/
|
|
153
|
+
export function getRetirement(name) {
|
|
154
|
+
return isRetiredHarness(name) ? RETIRED_HARNESSES[name] : undefined;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Error thrown when a retired harness name is selected. A distinct type lets a
|
|
158
|
+
* caller scope a `catch` to the retirement — return a safe default, or abort a
|
|
159
|
+
* spawn before it creates state — and rethrow every other error unchanged. Used
|
|
160
|
+
* by the spawn pre-flight and the Tower-side `siblingRegistrationIsLive`
|
|
161
|
+
* predicate (Issue #1338). `harnessName` is the retired name that triggered it.
|
|
162
|
+
*/
|
|
163
|
+
export class RetiredHarnessError extends Error {
|
|
164
|
+
harnessName;
|
|
165
|
+
constructor(harnessName, message) {
|
|
166
|
+
super(message);
|
|
167
|
+
this.harnessName = harnessName;
|
|
168
|
+
this.name = 'RetiredHarnessError';
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Throw the consistent retirement error for retired harness `name`. Returns
|
|
173
|
+
* `never` so callers can use it as a resolver exit on any branch and keep one
|
|
174
|
+
* identical message regardless of which path selected the retired name.
|
|
175
|
+
*/
|
|
176
|
+
export function throwRetired(name) {
|
|
177
|
+
throw new RetiredHarnessError(name, getRetirement(name) ?? `The "${name}" harness is retired.`);
|
|
178
|
+
}
|
|
90
179
|
// =============================================================================
|
|
91
180
|
// Template expansion
|
|
92
181
|
// =============================================================================
|
|
@@ -201,21 +290,32 @@ export function detectHarnessFromCommand(command) {
|
|
|
201
290
|
* Resolve a harness name to a HarnessProvider.
|
|
202
291
|
*
|
|
203
292
|
* Resolution order:
|
|
204
|
-
* 1. Explicit harnessName → built-in
|
|
205
|
-
* 2.
|
|
206
|
-
*
|
|
293
|
+
* 1. Explicit harnessName → built-in provider, else custom provider
|
|
294
|
+
* 2. Retired name → throw the retirement error (fail closed). A same-named
|
|
295
|
+
* custom harness still wins for an *explicit* name (the escape hatch), but an
|
|
296
|
+
* auto-detected retired command is always retired — auto-detection never
|
|
297
|
+
* consults custom harnesses (Issue #1338).
|
|
298
|
+
* 3. Auto-detect from command string basename (if command provided)
|
|
299
|
+
* 4. Default to claude (backward compatible)
|
|
207
300
|
*
|
|
208
|
-
* Throws if harnessName is set but doesn't match any
|
|
301
|
+
* Throws if harnessName is retired, or is set but doesn't match any provider.
|
|
209
302
|
*/
|
|
210
303
|
export function resolveHarness(harnessName, customHarnesses, command) {
|
|
211
304
|
// Explicit harness name takes priority
|
|
212
305
|
if (harnessName) {
|
|
213
|
-
|
|
306
|
+
// Own-property lookup: `harnessName` is user-controlled, so a bare index could
|
|
307
|
+
// return an inherited Object member (`constructor`, …) as a bogus provider.
|
|
308
|
+
const builtin = getBuiltinHarness(harnessName);
|
|
214
309
|
if (builtin)
|
|
215
310
|
return builtin;
|
|
216
311
|
if (customHarnesses && harnessName in customHarnesses) {
|
|
217
312
|
return buildCustomHarnessProvider(customHarnesses[harnessName]);
|
|
218
313
|
}
|
|
314
|
+
// A retired name with no custom override fails closed with a clear message.
|
|
315
|
+
// Checked after the custom lookup so an explicit custom `gemini` (the
|
|
316
|
+
// escape hatch for retained enterprise/API-key access) still resolves.
|
|
317
|
+
if (isRetiredHarness(harnessName))
|
|
318
|
+
throwRetired(harnessName);
|
|
219
319
|
const knownNames = Object.keys(BUILTIN_HARNESSES);
|
|
220
320
|
const customNames = customHarnesses ? Object.keys(customHarnesses) : [];
|
|
221
321
|
const allNames = [...knownNames, ...customNames];
|
|
@@ -227,6 +327,13 @@ export function resolveHarness(harnessName, customHarnesses, command) {
|
|
|
227
327
|
if (command) {
|
|
228
328
|
const detected = detectHarnessFromCommand(command);
|
|
229
329
|
if (detected) {
|
|
330
|
+
// Intercept a retired detected name BEFORE the BUILTIN_HARNESSES lookup:
|
|
331
|
+
// it must never return undefined (removed registry entry) nor fall through
|
|
332
|
+
// to the Claude default below (the #929 silent-mismatch class). Auto-detect
|
|
333
|
+
// resolves the built-in namespace only, so a detected `gemini` is retired
|
|
334
|
+
// even when a custom `gemini` exists.
|
|
335
|
+
if (isRetiredHarness(detected))
|
|
336
|
+
throwRetired(detected);
|
|
230
337
|
return BUILTIN_HARNESSES[detected];
|
|
231
338
|
}
|
|
232
339
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/harness.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AA6HpE,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,+EAA+E;IAC/E,+EAA+E;IAC/E,4DAA4D;IAC5D,oBAAoB,EAAE,IAAI;IAC1B,kBAAkB,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,EAAE,CAAC,wBAAwB,EAAE,OAAO,CAAC;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C;YACb,yEAAyE;YACzE,2EAA2E;YAC3E,4EAA4E;YAC5E,0EAA0E;YAC1E,sCAAsC;YACtC,IAAI,gBAAgB,CAAC,QAAQ,CAAC;gBAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
* Wraps in a structured header/footer unless raw mode is requested.
|
|
10
10
|
*/
|
|
11
11
|
export declare function formatArchitectMessage(message: string, fileContent?: string, raw?: boolean): string;
|
|
12
|
+
/**
|
|
13
|
+
* Format a message the VS Code extension relays on a human's behalf (#1494) to
|
|
14
|
+
* the architect, e.g. the Approve-gate button. The distinct `[USER via VS Code]`
|
|
15
|
+
* header lets the architect tell a button relay apart from a peer-architect
|
|
16
|
+
* instruction or the user typing directly in the pane. Wraps in a structured
|
|
17
|
+
* header/footer unless raw mode is requested.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatUserViaVsCodeMessage(message: string, fileContent?: string, raw?: boolean): string;
|
|
12
20
|
/**
|
|
13
21
|
* Format a message from a builder to the architect.
|
|
14
22
|
* Wraps in a structured header/footer unless raw mode is requested.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-format.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/message-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,OAAe,GAAG,MAAM,CAc1G;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,OAAe,GAAG,MAAM,CAc3H"}
|
|
1
|
+
{"version":3,"file":"message-format.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/message-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,OAAe,GAAG,MAAM,CAc1G;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,OAAe,GAAG,MAAM,CAc9G;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,OAAe,GAAG,MAAM,CAc3H"}
|
|
@@ -21,6 +21,26 @@ export function formatArchitectMessage(message, fileContent, raw = false) {
|
|
|
21
21
|
${content}
|
|
22
22
|
###############################`;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Format a message the VS Code extension relays on a human's behalf (#1494) to
|
|
26
|
+
* the architect, e.g. the Approve-gate button. The distinct `[USER via VS Code]`
|
|
27
|
+
* header lets the architect tell a button relay apart from a peer-architect
|
|
28
|
+
* instruction or the user typing directly in the pane. Wraps in a structured
|
|
29
|
+
* header/footer unless raw mode is requested.
|
|
30
|
+
*/
|
|
31
|
+
export function formatUserViaVsCodeMessage(message, fileContent, raw = false) {
|
|
32
|
+
let content = message;
|
|
33
|
+
if (fileContent) {
|
|
34
|
+
content += '\n\nAttached content:\n```\n' + fileContent + '\n```';
|
|
35
|
+
}
|
|
36
|
+
if (raw) {
|
|
37
|
+
return content;
|
|
38
|
+
}
|
|
39
|
+
const timestamp = new Date().toISOString();
|
|
40
|
+
return `### [USER via VS Code | ${timestamp}] ###
|
|
41
|
+
${content}
|
|
42
|
+
###############################`;
|
|
43
|
+
}
|
|
24
44
|
/**
|
|
25
45
|
* Format a message from a builder to the architect.
|
|
26
46
|
* Wraps in a structured header/footer unless raw mode is requested.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-format.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/message-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe,EAAE,WAAoB,EAAE,MAAe,KAAK;IAChG,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI,8BAA8B,GAAG,WAAW,GAAG,OAAO,CAAC;IACpE,CAAC;IAED,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,gCAAgC,SAAS;EAChD,OAAO;gCACuB,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,OAAe,EAAE,WAAoB,EAAE,MAAe,KAAK;IACjH,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI,8BAA8B,GAAG,WAAW,GAAG,OAAO,CAAC;IACpE,CAAC;IAED,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,OAAO,gBAAgB,SAAS,cAAc,SAAS;EACvD,OAAO;gCACuB,CAAC;AACjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"message-format.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/message-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe,EAAE,WAAoB,EAAE,MAAe,KAAK;IAChG,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): P
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function parseJsonBody(req: http.IncomingMessage, maxSize?: number): Promise<Record<string, unknown>>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* The expected local key, cached after first read. Issues the key if missing
|
|
23
|
+
* (Tower is the owner). Returns null and stays fail-closed if the key cannot be
|
|
24
|
+
* read or created (e.g. an unwritable `~/.agent-farm`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function getExpectedKey(): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Reset the cached key. Test-only seam; also lets a future rotation path force
|
|
29
|
+
* a re-read. Not wired to any runtime rotation in this change.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resetExpectedKeyCache(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Constant-time key comparison. `timingSafeEqual` throws on unequal-length
|
|
34
|
+
* buffers, so length is checked first (a length mismatch is an immediate,
|
|
35
|
+
* non-secret reject).
|
|
36
|
+
*/
|
|
37
|
+
export declare function keysMatch(presented: string, expected: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Routes intentionally reachable without the key. Kept deliberately narrow:
|
|
40
|
+
* pre-auth liveness/version probes, the Tower launcher shell, and the React
|
|
41
|
+
* dashboard's static assets (the page loads keyless, then authenticates its
|
|
42
|
+
* own API/WebSocket calls with the key). Everything else requires the key.
|
|
43
|
+
*
|
|
44
|
+
* The privileged workspace `file` reader and every `api/` or `ws/` subpath are
|
|
45
|
+
* explicitly excluded so a static-asset carve-out never exposes a data route.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isPublicRoute(method: string, pathname: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* CORS origin allowlist (advisory Layer 3). Replaces the previous
|
|
50
|
+
* reflect-any-`https://` behavior. Allowed: loopback origins on any port
|
|
51
|
+
* (`http://localhost[:port]`, `http://127.0.0.1[:port]`) plus any origins an
|
|
52
|
+
* operator lists in `CODEV_TOWER_ALLOWED_ORIGINS` (comma-separated, exact
|
|
53
|
+
* match) for a tunnel/proxy deployment. Secure by default: no wildcard, no
|
|
54
|
+
* scheme-only reflection. CORS is defense-in-depth; the key check is the
|
|
55
|
+
* actual control.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isAllowedOrigin(origin: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Host allowlist (advisory GHSA-xvjp-7748-v88v). A DNS-rebinding guard for the
|
|
60
|
+
* key-bearing dashboard shell: the key is injected into the (public) shell, so a
|
|
61
|
+
* browser rebound to Tower's address would carry the attacker's hostname in
|
|
62
|
+
* `Host` and be rejected before the shell is served. Allowed: loopback hostnames
|
|
63
|
+
* and the hostnames of any `CODEV_TOWER_ALLOWED_ORIGINS` (the same var the CORS
|
|
64
|
+
* allowlist uses, so a tunnel/proxy deployment configures both).
|
|
65
|
+
*
|
|
66
|
+
* In BRIDGE_MODE the operator has deliberately exposed Tower on the network, so
|
|
67
|
+
* the allowlist ALSO accepts IP-literal Hosts — a LAN client reaches Tower by IP
|
|
68
|
+
* (`http://192.168.1.5:4100/`), while DNS rebinding requires a host *name*, which
|
|
69
|
+
* stays rejected even in bridge mode. Hostname-based LAN access uses the
|
|
70
|
+
* `CODEV_TOWER_ALLOWED_ORIGINS` escape hatch. The key (mandatory under bridge
|
|
71
|
+
* mode) remains the primary control and is checked separately for keyed routes;
|
|
72
|
+
* this relaxation never weakens it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function isAllowedHost(hostHeader: string | undefined): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Security: decide whether an HTTP request may proceed.
|
|
77
|
+
*
|
|
78
|
+
* Public-allowlisted routes pass keyless; every other route must present a
|
|
79
|
+
* `codev-tower-key` header that constant-time-matches the expected local key.
|
|
80
|
+
* Fails closed when the expected key is unavailable.
|
|
81
|
+
*
|
|
24
82
|
* @param req - HTTP incoming message
|
|
25
|
-
* @returns true
|
|
83
|
+
* @returns true if the request is authorized
|
|
84
|
+
*/
|
|
85
|
+
export declare function isRequestAllowed(req: http.IncomingMessage): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The subprotocol the server echoes back on a terminal WebSocket handshake:
|
|
88
|
+
* the non-secret marker if the client offered it, else none. NEVER echoes the
|
|
89
|
+
* `codev-key.<key>` token — echoing it would leak the key into a response
|
|
90
|
+
* header. Used as the `ws` server's `handleProtocols` (advisory
|
|
91
|
+
* GHSA-xvjp-7748-v88v). Exported so the echo contract is unit-testable.
|
|
92
|
+
*/
|
|
93
|
+
export declare function selectWsSubprotocol(offered: Set<string>): string | false;
|
|
94
|
+
/**
|
|
95
|
+
* Security: decide whether a WebSocket upgrade may proceed. Validated at the
|
|
96
|
+
* handshake (before any PTY attach), independent of the `Origin` header so a
|
|
97
|
+
* missing Origin can never degrade into an auth bypass. Fails closed when the
|
|
98
|
+
* expected key is unavailable.
|
|
99
|
+
*
|
|
100
|
+
* @param req - HTTP upgrade request
|
|
101
|
+
* @returns true if the upgrade is authorized
|
|
26
102
|
*/
|
|
27
|
-
export declare function
|
|
103
|
+
export declare function isWebSocketAllowed(req: http.IncomingMessage): boolean;
|
|
28
104
|
/**
|
|
29
105
|
* Validate a bind host value for server.listen().
|
|
30
106
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/server-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"server-utils.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/server-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAKvC;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,SAAc,GA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