@cluesmith/codev 3.2.4 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
- package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-JCbkpAcV.js} +33 -33
- package/dashboard-dist/assets/index-JCbkpAcV.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 +142 -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 +19 -0
- package/dist/agent-farm/commands/reset.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset.js +292 -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/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 +54 -0
- package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
- package/dist/agent-farm/lib/reconnect-backoff.js +47 -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 +218 -27
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- 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.map +1 -1
- package/dist/agent-farm/servers/overview.js +23 -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 +670 -105
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +163 -31
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +17 -2
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +104 -122
- 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.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +6 -21
- 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/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/github.js +1 -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/pty-manager.d.ts +2 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +16 -6
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +131 -0
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +232 -39
- 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 +91 -0
- package/dist/terminal/session-screen.d.ts.map +1 -0
- package/dist/terminal/session-screen.js +135 -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 +8 -6
- package/skeleton/.claude/skills/afx/SKILL.md +14 -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 +14 -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 +30 -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 +1 -2
- package/skeleton/protocols/pir/prompts/plan.md +0 -3
- package/skeleton/protocols/pir/prompts/review.md +1 -1
- 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 +259 -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 +77 -191
- package/skeleton/templates/AGENTS.md +2 -0
- package/skeleton/templates/CLAUDE.md +2 -0
- package/templates/tower.html +39 -2
- 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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interrupt command — send a bare ESC keystroke into a builder's PTY (Spec 1273).
|
|
3
|
+
*
|
|
4
|
+
* This is the only recovery that reaches a builder *mid-turn*. When a builder
|
|
5
|
+
* chains foreground waits inside one turn, every `afx send` — including the
|
|
6
|
+
* architect's order to stop — queues unread until the turn ends. ESC interrupts
|
|
7
|
+
* the running tool, ends the turn, and the queued messages then process.
|
|
8
|
+
*
|
|
9
|
+
* Verified in production (shannon workspace, 2026-07-27): a builder wedged for
|
|
10
|
+
* 45+ minutes on a wait for a file whose producer had already died resumed
|
|
11
|
+
* within two minutes of receiving ESC. Until now that recipe
|
|
12
|
+
* (`afx send <builder> --raw "$(printf '\x1b')"`) lived only in architect lore
|
|
13
|
+
* and had to be discovered under pressure.
|
|
14
|
+
*
|
|
15
|
+
* Addressing, workspace detection and sender identity are reused verbatim from
|
|
16
|
+
* `afx send` — there is exactly one address resolver.
|
|
17
|
+
*/
|
|
18
|
+
import type { InterruptOptions } from '../types.js';
|
|
19
|
+
export declare function interrupt(options: InterruptOptions): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=interrupt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupt.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/commands/interrupt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDxE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interrupt command — send a bare ESC keystroke into a builder's PTY (Spec 1273).
|
|
3
|
+
*
|
|
4
|
+
* This is the only recovery that reaches a builder *mid-turn*. When a builder
|
|
5
|
+
* chains foreground waits inside one turn, every `afx send` — including the
|
|
6
|
+
* architect's order to stop — queues unread until the turn ends. ESC interrupts
|
|
7
|
+
* the running tool, ends the turn, and the queued messages then process.
|
|
8
|
+
*
|
|
9
|
+
* Verified in production (shannon workspace, 2026-07-27): a builder wedged for
|
|
10
|
+
* 45+ minutes on a wait for a file whose producer had already died resumed
|
|
11
|
+
* within two minutes of receiving ESC. Until now that recipe
|
|
12
|
+
* (`afx send <builder> --raw "$(printf '\x1b')"`) lived only in architect lore
|
|
13
|
+
* and had to be discovered under pressure.
|
|
14
|
+
*
|
|
15
|
+
* Addressing, workspace detection and sender identity are reused verbatim from
|
|
16
|
+
* `afx send` — there is exactly one address resolver.
|
|
17
|
+
*/
|
|
18
|
+
import { logger, fatal } from '../utils/logger.js';
|
|
19
|
+
import { TowerClient } from '../lib/tower-client.js';
|
|
20
|
+
import { detectWorkspaceRoot, detectCurrentBuilderId } from './send.js';
|
|
21
|
+
export async function interrupt(options) {
|
|
22
|
+
const target = options.builder;
|
|
23
|
+
if (!target) {
|
|
24
|
+
fatal('Must specify a builder. Usage: afx interrupt <builder>');
|
|
25
|
+
}
|
|
26
|
+
logger.header('Sending Interrupt (ESC)');
|
|
27
|
+
const workspace = detectWorkspaceRoot() ?? undefined;
|
|
28
|
+
// Same identity rule as `afx send`: in a confirmed builder worktree an
|
|
29
|
+
// unverifiable canonical id aborts rather than sending as an unverified
|
|
30
|
+
// sender, which Tower would silently route to 'main' (issue #1094).
|
|
31
|
+
let from;
|
|
32
|
+
try {
|
|
33
|
+
from = detectCurrentBuilderId() ?? 'architect';
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
fatal(err instanceof Error ? err.message : String(err));
|
|
37
|
+
}
|
|
38
|
+
const client = new TowerClient();
|
|
39
|
+
if (!(await client.isRunning())) {
|
|
40
|
+
fatal('Tower is not running. Start it with: afx tower start');
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
// `message` carries the ESC byte so the route's non-empty validation is
|
|
44
|
+
// satisfied and both this command and the manual `--raw` recipe exercise the
|
|
45
|
+
// same byte. `escape` is what makes delivery immediate and unformatted.
|
|
46
|
+
const result = await client.sendMessage(target, '\x1b', {
|
|
47
|
+
from,
|
|
48
|
+
workspace,
|
|
49
|
+
fromWorkspace: workspace,
|
|
50
|
+
escape: true,
|
|
51
|
+
noEnter: options.noEnter,
|
|
52
|
+
});
|
|
53
|
+
if (!result.ok) {
|
|
54
|
+
throw new Error(result.error || 'Unknown error');
|
|
55
|
+
}
|
|
56
|
+
logger.success(`Interrupt (ESC) sent to ${result.resolvedTo ?? target}`);
|
|
57
|
+
if (!options.noEnter) {
|
|
58
|
+
logger.info('Enter followed the ESC — any messages queued during the turn should now process.');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
fatal(error instanceof Error ? error.message : String(error));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=interrupt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interrupt.js","sourceRoot":"","sources":["../../../src/agent-farm/commands/interrupt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAyB;IACvD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAE/B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAEzC,MAAM,SAAS,GAAG,mBAAmB,EAAE,IAAI,SAAS,CAAC;IAErD,uEAAuE;IACvE,wEAAwE;IACxE,oEAAoE;IACpE,IAAI,IAAY,CAAC;IACjB,IAA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|
|
2
|
+
* Tunable parameters for `afx reset` (Spec 1273).
|
|
3
|
+
*
|
|
4
|
+
* Every value here is overridable from the CLI. The defaults are grounded in
|
|
5
|
+
* the one verified manual reset (shannon workspace, 2026-07-27), not guessed.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Fixed name of the builder's working-state file, at the worktree root.
|
|
9
|
+
*
|
|
10
|
+
* The `.builder-` prefix is load-bearing: `afx cleanup` classifies untracked
|
|
11
|
+
* `.builder-*` files as scaffold rather than dirt, so a worktree carrying one is
|
|
12
|
+
* still considered clean. It is untracked, which is why `porch done`'s
|
|
13
|
+
* staged-file sweep cannot pick it up.
|
|
14
|
+
*
|
|
15
|
+
* The name is deliberately FIXED rather than nonce-suffixed. Freshness is proven
|
|
16
|
+
* by the nonce *inside* the file (R2), so encoding it in the filename would add
|
|
17
|
+
* nothing and would leave a new litter file after every reset.
|
|
18
|
+
*/
|
|
19
|
+
export declare const STATE_FILE_NAME = ".builder-state.md";
|
|
20
|
+
/** Long-form re-orientation written before the clear (R1). Same prefix rationale. */
|
|
21
|
+
export declare const REORIENT_FILE_NAME = ".builder-reorient.md";
|
|
22
|
+
/**
|
|
23
|
+
* Minimum size for a state file to count as substantive.
|
|
24
|
+
*
|
|
25
|
+
* The one verified example ran 203 lines (~8-10KB). A genuine cold-reader save
|
|
26
|
+
* is comfortably over 1KB; a three-line stub is 100-200 bytes. 1000 rejects
|
|
27
|
+
* stubs without false-rejecting a terse but real save.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DEFAULT_MIN_BYTES = 1000;
|
|
30
|
+
/** Gap between the two observations that must agree for the file to count as stable. */
|
|
31
|
+
export declare const DEFAULT_STABILITY_WINDOW_MS = 2000;
|
|
32
|
+
/** How often to stat the state file while waiting for it. */
|
|
33
|
+
export declare const DEFAULT_POLL_INTERVAL_MS = 2000;
|
|
34
|
+
/**
|
|
35
|
+
* How long to wait for the builder to produce the state file.
|
|
36
|
+
*
|
|
37
|
+
* A busy builder may take minutes to reach the request — the manual run was of
|
|
38
|
+
* this order. Expiry aborts WITHOUT clearing (R2).
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_RECEIPT_TIMEOUT_MS = 300000;
|
|
41
|
+
/**
|
|
42
|
+
* How long the terminal must produce no output before it counts as quiescent.
|
|
43
|
+
*
|
|
44
|
+
* An agent mid-turn emits continuously (spinner frames, streamed tokens), so a
|
|
45
|
+
* true silence of this length reliably indicates the turn ended.
|
|
46
|
+
*/
|
|
47
|
+
export declare const DEFAULT_QUIET_WINDOW_MS = 1500;
|
|
48
|
+
/** Bounded wait for quiescence before the single ESC escalation (R4). */
|
|
49
|
+
export declare const DEFAULT_QUIESCE_TIMEOUT_MS = 60000;
|
|
50
|
+
/** Bounded wait after the ESC escalation. Shorter — ESC should act immediately. */
|
|
51
|
+
export declare const DEFAULT_QUIESCE_POST_ESCALATION_TIMEOUT_MS = 30000;
|
|
52
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/agent-farm/commands/reset/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC,wFAAwF;AACxF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,SAAU,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,yEAAyE;AACzE,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD,mFAAmF;AACnF,eAAO,MAAM,0CAA0C,QAAS,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tunable parameters for `afx reset` (Spec 1273).
|
|
3
|
+
*
|
|
4
|
+
* Every value here is overridable from the CLI. The defaults are grounded in
|
|
5
|
+
* the one verified manual reset (shannon workspace, 2026-07-27), not guessed.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Fixed name of the builder's working-state file, at the worktree root.
|
|
9
|
+
*
|
|
10
|
+
* The `.builder-` prefix is load-bearing: `afx cleanup` classifies untracked
|
|
11
|
+
* `.builder-*` files as scaffold rather than dirt, so a worktree carrying one is
|
|
12
|
+
* still considered clean. It is untracked, which is why `porch done`'s
|
|
13
|
+
* staged-file sweep cannot pick it up.
|
|
14
|
+
*
|
|
15
|
+
* The name is deliberately FIXED rather than nonce-suffixed. Freshness is proven
|
|
16
|
+
* by the nonce *inside* the file (R2), so encoding it in the filename would add
|
|
17
|
+
* nothing and would leave a new litter file after every reset.
|
|
18
|
+
*/
|
|
19
|
+
export const STATE_FILE_NAME = '.builder-state.md';
|
|
20
|
+
/** Long-form re-orientation written before the clear (R1). Same prefix rationale. */
|
|
21
|
+
export const REORIENT_FILE_NAME = '.builder-reorient.md';
|
|
22
|
+
/**
|
|
23
|
+
* Minimum size for a state file to count as substantive.
|
|
24
|
+
*
|
|
25
|
+
* The one verified example ran 203 lines (~8-10KB). A genuine cold-reader save
|
|
26
|
+
* is comfortably over 1KB; a three-line stub is 100-200 bytes. 1000 rejects
|
|
27
|
+
* stubs without false-rejecting a terse but real save.
|
|
28
|
+
*/
|
|
29
|
+
export const DEFAULT_MIN_BYTES = 1000;
|
|
30
|
+
/** Gap between the two observations that must agree for the file to count as stable. */
|
|
31
|
+
export const DEFAULT_STABILITY_WINDOW_MS = 2000;
|
|
32
|
+
/** How often to stat the state file while waiting for it. */
|
|
33
|
+
export const DEFAULT_POLL_INTERVAL_MS = 2000;
|
|
34
|
+
/**
|
|
35
|
+
* How long to wait for the builder to produce the state file.
|
|
36
|
+
*
|
|
37
|
+
* A busy builder may take minutes to reach the request — the manual run was of
|
|
38
|
+
* this order. Expiry aborts WITHOUT clearing (R2).
|
|
39
|
+
*/
|
|
40
|
+
export const DEFAULT_RECEIPT_TIMEOUT_MS = 300_000;
|
|
41
|
+
/**
|
|
42
|
+
* How long the terminal must produce no output before it counts as quiescent.
|
|
43
|
+
*
|
|
44
|
+
* An agent mid-turn emits continuously (spinner frames, streamed tokens), so a
|
|
45
|
+
* true silence of this length reliably indicates the turn ended.
|
|
46
|
+
*/
|
|
47
|
+
export const DEFAULT_QUIET_WINDOW_MS = 1500;
|
|
48
|
+
/** Bounded wait for quiescence before the single ESC escalation (R4). */
|
|
49
|
+
export const DEFAULT_QUIESCE_TIMEOUT_MS = 60_000;
|
|
50
|
+
/** Bounded wait after the ESC escalation. Shorter — ESC should act immediately. */
|
|
51
|
+
export const DEFAULT_QUIESCE_POST_ESCALATION_TIMEOUT_MS = 30_000;
|
|
52
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/agent-farm/commands/reset/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAEnD,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC,wFAAwF;AACxF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,yEAAyE;AACzE,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD,mFAAmF;AACnF,MAAM,CAAC,MAAM,0CAA0C,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builder context resolution for `afx reset` (Spec 1273, phase 4).
|
|
3
|
+
*
|
|
4
|
+
* Invariant R3 requires a re-orientation carrying protocol, mode, worktree,
|
|
5
|
+
* branch, project identity and porch re-entry. The first draft of the plan
|
|
6
|
+
* assumed the builder registry held those facts. **It does not**, and the gap is
|
|
7
|
+
* silent rather than obvious:
|
|
8
|
+
*
|
|
9
|
+
* - `builders.protocol_name` is NULL for spec-type builders. `spawn.ts` never
|
|
10
|
+
* passes `protocolName` on that path (only the `protocol`-type spawn does),
|
|
11
|
+
* so every SPIR/ASPIR lane — precisely the long-running builders this feature
|
|
12
|
+
* exists for — has NULL there. Reading `db/schema.ts` shows the column and
|
|
13
|
+
* looks fine; the persistence path is where the truth is.
|
|
14
|
+
* - Mode is not persisted at all. `resolveMode` computes it at spawn from flags
|
|
15
|
+
* plus protocol defaults and discards it, so a spawn-time `--soft` cannot be
|
|
16
|
+
* recovered afterwards by recomputation.
|
|
17
|
+
* - Harness comes from workspace config, which can change while a builder runs,
|
|
18
|
+
* so config is not authoritative for a *running* builder.
|
|
19
|
+
*
|
|
20
|
+
* So this module reads the worktree, which holds all of it authoritatively:
|
|
21
|
+
* porch's `status.yaml` (protocol, phase), `.builder-prompt.txt` (the literal
|
|
22
|
+
* `## Mode:` line the builder was given), and `.builder-start.sh` (the launch
|
|
23
|
+
* line of the process actually running).
|
|
24
|
+
*
|
|
25
|
+
* Every chain ends in a **loud abort**, never a default. A guessed protocol or
|
|
26
|
+
* mode would produce a plausible-looking re-orientation that quietly reframes the
|
|
27
|
+
* builder — the exact drift R3 exists to prevent.
|
|
28
|
+
*/
|
|
29
|
+
import { type CustomHarnessConfig, type HarnessProvider } from '../../utils/harness.js';
|
|
30
|
+
/** Filesystem access needed for resolution. Injected so tests need no worktree. */
|
|
31
|
+
export interface ContextFsPort {
|
|
32
|
+
exists(path: string): boolean;
|
|
33
|
+
read(path: string): string | null;
|
|
34
|
+
/** Immediate subdirectory names, or null when the directory does not exist. */
|
|
35
|
+
listDirs(path: string): string[] | null;
|
|
36
|
+
}
|
|
37
|
+
export interface ResolvedBuilderContext {
|
|
38
|
+
builderId: string;
|
|
39
|
+
worktree: string;
|
|
40
|
+
branch: string;
|
|
41
|
+
protocol: string;
|
|
42
|
+
/** Where the protocol came from — surfaced in the report so it is auditable. */
|
|
43
|
+
protocolSource: 'status.yaml' | 'builder-id';
|
|
44
|
+
mode: 'strict' | 'soft';
|
|
45
|
+
modeSource: 'flag' | 'builder-prompt' | 'task-default';
|
|
46
|
+
harnessName: string;
|
|
47
|
+
harness: HarnessProvider;
|
|
48
|
+
/** Null for a non-porch lane; that is a branch, not a failure. */
|
|
49
|
+
porch: PorchContext | null;
|
|
50
|
+
/**
|
|
51
|
+
* Artifact identity, for phase 5's reconstruction of the spawn TemplateContext.
|
|
52
|
+
*
|
|
53
|
+
* Null on a non-porch lane, where there is no spec/plan naming convention to
|
|
54
|
+
* derive from. `specPath`/`planPath` are worktree-relative and are only set
|
|
55
|
+
* when the file actually exists — a pointer to a file that is not there would
|
|
56
|
+
* send a freshly-reset builder chasing a ghost.
|
|
57
|
+
*/
|
|
58
|
+
specName: string | null;
|
|
59
|
+
specPath: string | null;
|
|
60
|
+
planPath: string | null;
|
|
61
|
+
/** Issue number, from the registry row or the porch project id. */
|
|
62
|
+
issueNumber?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Ad-hoc task text, from the registry row (`builders.task_text`).
|
|
65
|
+
*
|
|
66
|
+
* Present only for `afx spawn --task` builders. Phase 5 needs it to tell that
|
|
67
|
+
* lane apart from the others: a task builder still gets a porch project keyed
|
|
68
|
+
* on its builder id, so `issueNumber` is populated for it too, and without
|
|
69
|
+
* this field the task lane is indistinguishable from an issue-driven one.
|
|
70
|
+
*/
|
|
71
|
+
taskText?: string;
|
|
72
|
+
/**
|
|
73
|
+
* True only for a BARE `afx spawn --task` builder (no `--protocol`).
|
|
74
|
+
*
|
|
75
|
+
* Established from positive evidence — task text present AND the prompt file
|
|
76
|
+
* carries no `## Mode:` heading — rather than inferred from the absence of a
|
|
77
|
+
* porch project. `initPorchInWorktree` is deliberately non-fatal, so a
|
|
78
|
+
* `--task --protocol X` builder whose porch init failed also has task text and
|
|
79
|
+
* no porch, and inferring from that would strip its real protocol template and
|
|
80
|
+
* hand it the raw task text instead.
|
|
81
|
+
*
|
|
82
|
+
* The prompt is built BEFORE porch init (`spawn.ts:545-548`), so a
|
|
83
|
+
* `--task --protocol` builder's prompt carries the rendered template — and its
|
|
84
|
+
* `## Mode:` line — regardless of whether porch init later succeeded.
|
|
85
|
+
*/
|
|
86
|
+
isBareTask: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface PorchContext {
|
|
89
|
+
projectId: string;
|
|
90
|
+
projectName: string;
|
|
91
|
+
/** The protocol porch is actually running for this project. */
|
|
92
|
+
protocol: string;
|
|
93
|
+
phase: string;
|
|
94
|
+
currentPlanPhase: string | null;
|
|
95
|
+
statusPath: string;
|
|
96
|
+
}
|
|
97
|
+
/** Thrown when a fact cannot be established. Never swallowed into a default. */
|
|
98
|
+
export declare class ContextResolutionError extends Error {
|
|
99
|
+
constructor(message: string);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Locate and parse THIS BUILDER's porch status file.
|
|
103
|
+
*
|
|
104
|
+
* Returns null when this builder has no porch project — a task or shell builder
|
|
105
|
+
* is a legitimate reset target, it simply gets no porch re-entry block.
|
|
106
|
+
*
|
|
107
|
+
* ## Why this takes an identity instead of picking the first parsable file
|
|
108
|
+
*
|
|
109
|
+
* The first implementation returned the first directory under `codev/projects`
|
|
110
|
+
* with a parsable `status.yaml`. That is correct only for a repo holding exactly
|
|
111
|
+
* one project directory. **This repo commits porch history to `main`**, so every
|
|
112
|
+
* worktree inherits every project ever run — 203 of them at the time of writing.
|
|
113
|
+
* The alphabetically-first is `0087-porch-timeout-termination-retries`, whose
|
|
114
|
+
* protocol is `spider`, so `afx reset` resolved protocol "spider" for *every*
|
|
115
|
+
* builder and died on `Protocol "spider" has no builder-prompt.md`. It failed
|
|
116
|
+
* loudly, which is why nothing was corrupted — but it failed for every lane.
|
|
117
|
+
*
|
|
118
|
+
* The fix is to select by identity, never by position: a directory qualifies
|
|
119
|
+
* only when it belongs to the builder being reset. No match returns null, which
|
|
120
|
+
* is the honest answer for a genuinely non-porch builder and is also safe for a
|
|
121
|
+
* porch one — a missing porch block is visible in the re-orientation, whereas
|
|
122
|
+
* *another project's* protocol is a confident lie.
|
|
123
|
+
*
|
|
124
|
+
* (This is the #1235 wrong-winner family: pick-the-first over a set that is
|
|
125
|
+
* assumed to be a singleton and is not.)
|
|
126
|
+
*
|
|
127
|
+
* Parsed with targeted line matching rather than a YAML dependency: this module
|
|
128
|
+
* needs four scalar fields, and the file is machine-written by porch.
|
|
129
|
+
*/
|
|
130
|
+
export interface PorchProjectIdentity {
|
|
131
|
+
/** Registry builder id, e.g. `aspir-1273`, `builder-task-re_v`. */
|
|
132
|
+
builderId: string;
|
|
133
|
+
/** Issue number when the lane has one. */
|
|
134
|
+
issueNumber?: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Project ids this builder could legitimately own, most specific first.
|
|
138
|
+
*
|
|
139
|
+
* Three forms, because porch names projects differently per lane:
|
|
140
|
+
* - the issue number, for issue-driven lanes;
|
|
141
|
+
* - the builder id itself — `spawn.ts` passes `builderId` as the porch project
|
|
142
|
+
* id on the `--task` path;
|
|
143
|
+
* - the builder id with its protocol prefix stripped (`aspir-1273` → `1273`),
|
|
144
|
+
* which is how spec-driven lanes are named.
|
|
145
|
+
*/
|
|
146
|
+
export declare function candidateProjectIds(identity: PorchProjectIdentity): string[];
|
|
147
|
+
export declare function readPorchContext(fs: ContextFsPort, worktree: string, identity: PorchProjectIdentity): PorchContext | null;
|
|
148
|
+
/**
|
|
149
|
+
* The protocol recorded in status.yaml, if there is one.
|
|
150
|
+
*
|
|
151
|
+
* Reads through `readPorchContext` rather than re-scanning the project dirs, so
|
|
152
|
+
* the two cannot disagree about which status.yaml is authoritative. Worktrees
|
|
153
|
+
* routinely hold MANY project directories here (porch history is committed to
|
|
154
|
+
* `main`), which is exactly why both go through one identity-aware selector.
|
|
155
|
+
*/
|
|
156
|
+
export declare function protocolFromStatus(fs: ContextFsPort, worktree: string, identity: PorchProjectIdentity): string | null;
|
|
157
|
+
/**
|
|
158
|
+
* Read the mode the builder was actually told it was running in.
|
|
159
|
+
*
|
|
160
|
+
* The spawn prompt renders a literal `## Mode: STRICT` heading, and `--resume`
|
|
161
|
+
* does not rewrite the prompt file, so this stays correct across resumes. It is
|
|
162
|
+
* a stronger source than recomputing `resolveMode`, which cannot recover a
|
|
163
|
+
* spawn-time `--soft` from protocol defaults.
|
|
164
|
+
*/
|
|
165
|
+
export declare function modeFromBuilderPrompt(fs: ContextFsPort, worktree: string): 'strict' | 'soft' | null;
|
|
166
|
+
/**
|
|
167
|
+
* Recover an issue number from a porch project id.
|
|
168
|
+
*
|
|
169
|
+
* Porch ids are not uniformly numeric. PIR and SPIR use the bare issue number;
|
|
170
|
+
* **BUGFIX deliberately uses `<prefix>-<N>`** (`spawn.ts:817`, "historical, kept
|
|
171
|
+
* untouched"). A strict `/^\d+$/` guard therefore threw away BUGFIX's issue
|
|
172
|
+
* identity whenever the registry row lacked one — and on BUGFIX the issue body
|
|
173
|
+
* IS the spec, so the re-orientation lost the requirements it was meant to carry.
|
|
174
|
+
*
|
|
175
|
+
* Accepts a bare number or a canonical `<word>-<number>`; rejects anything else,
|
|
176
|
+
* so an ad-hoc task id (`builder-task-abc`) still cannot masquerade as an issue.
|
|
177
|
+
*/
|
|
178
|
+
export declare function issueNumberFromPorchId(projectId?: string): string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* Identify the harness from the worktree's launch script.
|
|
181
|
+
*
|
|
182
|
+
* Per-builder ground truth: the script is what the running process was started
|
|
183
|
+
* with, so it stays right even if workspace config changed since the spawn.
|
|
184
|
+
*/
|
|
185
|
+
export declare function harnessFromLaunchScript(fs: ContextFsPort, worktree: string, customHarnesses?: Record<string, CustomHarnessConfig>): string | null;
|
|
186
|
+
/**
|
|
187
|
+
* Map a harness name to its provider, honouring project-defined custom harnesses.
|
|
188
|
+
*
|
|
189
|
+
* Custom harnesses resolve to a real provider rather than failing as
|
|
190
|
+
* "unrecognisable", so the refusal a project sees is the accurate one — *this
|
|
191
|
+
* harness cannot reset in-session* — instead of a misleading "unknown harness".
|
|
192
|
+
* `buildCustomHarnessProvider` does not set `supportsContextReset`, so custom
|
|
193
|
+
* harnesses are unsupported by default; letting one declare support would be a
|
|
194
|
+
* one-field addition to `CustomHarnessConfig`, deliberately out of scope here.
|
|
195
|
+
*/
|
|
196
|
+
export declare function harnessProviderFor(harnessName: string, customHarnesses?: Record<string, CustomHarnessConfig>): HarnessProvider | null;
|
|
197
|
+
/**
|
|
198
|
+
* Derive artifact identity from the porch project.
|
|
199
|
+
*
|
|
200
|
+
* Porch names its project dir `<id>-<title>`, and spec/plan files share that
|
|
201
|
+
* stem by convention (`codev/specs/<id>-<title>.md`). Paths are returned only
|
|
202
|
+
* when the file exists.
|
|
203
|
+
*/
|
|
204
|
+
export declare function artifactPaths(fs: ContextFsPort, worktree: string, porch: PorchContext | null): {
|
|
205
|
+
specName: string | null;
|
|
206
|
+
specPath: string | null;
|
|
207
|
+
planPath: string | null;
|
|
208
|
+
};
|
|
209
|
+
export interface ResolveContextOptions {
|
|
210
|
+
fs: ContextFsPort;
|
|
211
|
+
builderId: string;
|
|
212
|
+
worktree: string;
|
|
213
|
+
branch: string;
|
|
214
|
+
issueNumber?: string;
|
|
215
|
+
/** `builders.task_text`, for `--task` builders. Forwarded verbatim. */
|
|
216
|
+
taskText?: string;
|
|
217
|
+
/** `--mode` override; wins over the worktree, for when the prompt file is gone. */
|
|
218
|
+
modeOverride?: 'strict' | 'soft';
|
|
219
|
+
/** Project-defined harnesses from `.codev/config.json`, if any. */
|
|
220
|
+
customHarnesses?: Record<string, CustomHarnessConfig>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Resolve everything the re-orientation needs, or throw.
|
|
224
|
+
*
|
|
225
|
+
* Deliberately does NOT consult `builders.protocol_name`: it is NULL for
|
|
226
|
+
* spec-type builders, so a reader who "fixed" this to use the registry would
|
|
227
|
+
* break exactly the lanes the feature targets while the code looked more correct.
|
|
228
|
+
*/
|
|
229
|
+
export declare function resolveBuilderContext(options: ResolveContextOptions): ResolvedBuilderContext;
|
|
230
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/agent-farm/commands/reset/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAMhC,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;CACzC;AAMD,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,cAAc,EAAE,aAAa,GAAG,YAAY,CAAC;IAC7C,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,UAA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