@cluesmith/codev 2.0.0-rc.7 → 2.0.0-rc.70

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.
Files changed (456) hide show
  1. package/bin/af.js +2 -2
  2. package/bin/consult.js +1 -1
  3. package/bin/porch.js +6 -35
  4. package/dashboard/dist/assets/index-C7FtNK6Y.css +32 -0
  5. package/dashboard/dist/assets/index-CDAINZKT.js +131 -0
  6. package/dashboard/dist/assets/index-CDAINZKT.js.map +1 -0
  7. package/dashboard/dist/index.html +14 -0
  8. package/dist/agent-farm/cli.d.ts.map +1 -1
  9. package/dist/agent-farm/cli.js +173 -118
  10. package/dist/agent-farm/cli.js.map +1 -1
  11. package/dist/agent-farm/commands/architect.d.ts +3 -3
  12. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  13. package/dist/agent-farm/commands/architect.js +20 -147
  14. package/dist/agent-farm/commands/architect.js.map +1 -1
  15. package/dist/agent-farm/commands/attach.d.ts +13 -0
  16. package/dist/agent-farm/commands/attach.d.ts.map +1 -0
  17. package/dist/agent-farm/commands/attach.js +144 -0
  18. package/dist/agent-farm/commands/attach.js.map +1 -0
  19. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  20. package/dist/agent-farm/commands/cleanup.js +35 -19
  21. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  22. package/dist/agent-farm/commands/consult.d.ts +3 -4
  23. package/dist/agent-farm/commands/consult.d.ts.map +1 -1
  24. package/dist/agent-farm/commands/consult.js +27 -37
  25. package/dist/agent-farm/commands/consult.js.map +1 -1
  26. package/dist/agent-farm/commands/index.d.ts +2 -2
  27. package/dist/agent-farm/commands/index.d.ts.map +1 -1
  28. package/dist/agent-farm/commands/index.js +2 -2
  29. package/dist/agent-farm/commands/index.js.map +1 -1
  30. package/dist/agent-farm/commands/open.d.ts +4 -2
  31. package/dist/agent-farm/commands/open.d.ts.map +1 -1
  32. package/dist/agent-farm/commands/open.js +33 -83
  33. package/dist/agent-farm/commands/open.js.map +1 -1
  34. package/dist/agent-farm/commands/send.d.ts +1 -1
  35. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  36. package/dist/agent-farm/commands/send.js +60 -79
  37. package/dist/agent-farm/commands/send.js.map +1 -1
  38. package/dist/agent-farm/commands/shell.d.ts +15 -0
  39. package/dist/agent-farm/commands/shell.d.ts.map +1 -0
  40. package/dist/agent-farm/commands/shell.js +50 -0
  41. package/dist/agent-farm/commands/shell.js.map +1 -0
  42. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  43. package/dist/agent-farm/commands/spawn.js +597 -281
  44. package/dist/agent-farm/commands/spawn.js.map +1 -1
  45. package/dist/agent-farm/commands/start.d.ts +10 -20
  46. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  47. package/dist/agent-farm/commands/start.js +45 -491
  48. package/dist/agent-farm/commands/start.js.map +1 -1
  49. package/dist/agent-farm/commands/status.d.ts +2 -0
  50. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  51. package/dist/agent-farm/commands/status.js +75 -24
  52. package/dist/agent-farm/commands/status.js.map +1 -1
  53. package/dist/agent-farm/commands/stop.d.ts +6 -0
  54. package/dist/agent-farm/commands/stop.d.ts.map +1 -1
  55. package/dist/agent-farm/commands/stop.js +49 -109
  56. package/dist/agent-farm/commands/stop.js.map +1 -1
  57. package/dist/agent-farm/commands/tower-cloud.d.ts +48 -0
  58. package/dist/agent-farm/commands/tower-cloud.d.ts.map +1 -0
  59. package/dist/agent-farm/commands/tower-cloud.js +334 -0
  60. package/dist/agent-farm/commands/tower-cloud.js.map +1 -0
  61. package/dist/agent-farm/commands/tower.d.ts +9 -0
  62. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  63. package/dist/agent-farm/commands/tower.js +59 -19
  64. package/dist/agent-farm/commands/tower.js.map +1 -1
  65. package/dist/agent-farm/db/index.d.ts +6 -2
  66. package/dist/agent-farm/db/index.d.ts.map +1 -1
  67. package/dist/agent-farm/db/index.js +246 -18
  68. package/dist/agent-farm/db/index.js.map +1 -1
  69. package/dist/agent-farm/db/migrate.d.ts +0 -4
  70. package/dist/agent-farm/db/migrate.d.ts.map +1 -1
  71. package/dist/agent-farm/db/migrate.js +6 -55
  72. package/dist/agent-farm/db/migrate.js.map +1 -1
  73. package/dist/agent-farm/db/schema.d.ts +3 -3
  74. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  75. package/dist/agent-farm/db/schema.js +25 -19
  76. package/dist/agent-farm/db/schema.js.map +1 -1
  77. package/dist/agent-farm/db/types.d.ts +3 -13
  78. package/dist/agent-farm/db/types.d.ts.map +1 -1
  79. package/dist/agent-farm/db/types.js +3 -11
  80. package/dist/agent-farm/db/types.js.map +1 -1
  81. package/dist/agent-farm/hq-connector.d.ts +2 -6
  82. package/dist/agent-farm/hq-connector.d.ts.map +1 -1
  83. package/dist/agent-farm/hq-connector.js +2 -17
  84. package/dist/agent-farm/hq-connector.js.map +1 -1
  85. package/dist/agent-farm/lib/cloud-config.d.ts +59 -0
  86. package/dist/agent-farm/lib/cloud-config.d.ts.map +1 -0
  87. package/dist/agent-farm/lib/cloud-config.js +143 -0
  88. package/dist/agent-farm/lib/cloud-config.js.map +1 -0
  89. package/dist/agent-farm/lib/tower-client.d.ts +163 -0
  90. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -0
  91. package/dist/agent-farm/lib/tower-client.js +233 -0
  92. package/dist/agent-farm/lib/tower-client.js.map +1 -0
  93. package/dist/agent-farm/lib/tunnel-client.d.ts +117 -0
  94. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -0
  95. package/dist/agent-farm/lib/tunnel-client.js +504 -0
  96. package/dist/agent-farm/lib/tunnel-client.js.map +1 -0
  97. package/dist/agent-farm/servers/tower-server.js +2650 -185
  98. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  99. package/dist/agent-farm/state.d.ts +6 -12
  100. package/dist/agent-farm/state.d.ts.map +1 -1
  101. package/dist/agent-farm/state.js +34 -49
  102. package/dist/agent-farm/state.js.map +1 -1
  103. package/dist/agent-farm/types.d.ts +49 -26
  104. package/dist/agent-farm/types.d.ts.map +1 -1
  105. package/dist/agent-farm/utils/config.d.ts +0 -5
  106. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  107. package/dist/agent-farm/utils/config.js +12 -44
  108. package/dist/agent-farm/utils/config.js.map +1 -1
  109. package/dist/agent-farm/utils/deps.d.ts.map +1 -1
  110. package/dist/agent-farm/utils/deps.js +0 -32
  111. package/dist/agent-farm/utils/deps.js.map +1 -1
  112. package/dist/agent-farm/utils/file-tabs.d.ts +27 -0
  113. package/dist/agent-farm/utils/file-tabs.d.ts.map +1 -0
  114. package/dist/agent-farm/utils/file-tabs.js +46 -0
  115. package/dist/agent-farm/utils/file-tabs.js.map +1 -0
  116. package/dist/agent-farm/utils/gate-status.d.ts +16 -0
  117. package/dist/agent-farm/utils/gate-status.d.ts.map +1 -0
  118. package/dist/agent-farm/utils/gate-status.js +79 -0
  119. package/dist/agent-farm/utils/gate-status.js.map +1 -0
  120. package/dist/agent-farm/utils/gate-watcher.d.ts +38 -0
  121. package/dist/agent-farm/utils/gate-watcher.d.ts.map +1 -0
  122. package/dist/agent-farm/utils/gate-watcher.js +122 -0
  123. package/dist/agent-farm/utils/gate-watcher.js.map +1 -0
  124. package/dist/agent-farm/utils/index.d.ts +0 -1
  125. package/dist/agent-farm/utils/index.d.ts.map +1 -1
  126. package/dist/agent-farm/utils/index.js +0 -1
  127. package/dist/agent-farm/utils/index.js.map +1 -1
  128. package/dist/agent-farm/utils/notifications.d.ts +30 -0
  129. package/dist/agent-farm/utils/notifications.d.ts.map +1 -0
  130. package/dist/agent-farm/utils/notifications.js +121 -0
  131. package/dist/agent-farm/utils/notifications.js.map +1 -0
  132. package/dist/agent-farm/utils/server-utils.d.ts +5 -5
  133. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  134. package/dist/agent-farm/utils/server-utils.js +5 -16
  135. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  136. package/dist/agent-farm/utils/session.d.ts +32 -0
  137. package/dist/agent-farm/utils/session.d.ts.map +1 -0
  138. package/dist/agent-farm/utils/session.js +57 -0
  139. package/dist/agent-farm/utils/session.js.map +1 -0
  140. package/dist/agent-farm/utils/shell.d.ts +9 -22
  141. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  142. package/dist/agent-farm/utils/shell.js +34 -34
  143. package/dist/agent-farm/utils/shell.js.map +1 -1
  144. package/dist/cli.d.ts.map +1 -1
  145. package/dist/cli.js +11 -54
  146. package/dist/cli.js.map +1 -1
  147. package/dist/commands/adopt.d.ts.map +1 -1
  148. package/dist/commands/adopt.js +49 -4
  149. package/dist/commands/adopt.js.map +1 -1
  150. package/dist/commands/consult/index.d.ts +13 -2
  151. package/dist/commands/consult/index.d.ts.map +1 -1
  152. package/dist/commands/consult/index.js +245 -29
  153. package/dist/commands/consult/index.js.map +1 -1
  154. package/dist/commands/doctor.d.ts.map +1 -1
  155. package/dist/commands/doctor.js +96 -79
  156. package/dist/commands/doctor.js.map +1 -1
  157. package/dist/commands/init.d.ts.map +1 -1
  158. package/dist/commands/init.js +41 -2
  159. package/dist/commands/init.js.map +1 -1
  160. package/dist/commands/porch/build-counter.d.ts +5 -0
  161. package/dist/commands/porch/build-counter.d.ts.map +1 -0
  162. package/dist/commands/porch/build-counter.js +5 -0
  163. package/dist/commands/porch/build-counter.js.map +1 -0
  164. package/dist/commands/porch/checks.d.ts +17 -29
  165. package/dist/commands/porch/checks.d.ts.map +1 -1
  166. package/dist/commands/porch/checks.js +96 -144
  167. package/dist/commands/porch/checks.js.map +1 -1
  168. package/dist/commands/porch/index.d.ts +25 -43
  169. package/dist/commands/porch/index.d.ts.map +1 -1
  170. package/dist/commands/porch/index.js +463 -1116
  171. package/dist/commands/porch/index.js.map +1 -1
  172. package/dist/commands/porch/next.d.ts +22 -0
  173. package/dist/commands/porch/next.d.ts.map +1 -0
  174. package/dist/commands/porch/next.js +571 -0
  175. package/dist/commands/porch/next.js.map +1 -0
  176. package/dist/commands/porch/plan.d.ts +70 -0
  177. package/dist/commands/porch/plan.d.ts.map +1 -0
  178. package/dist/commands/porch/plan.js +190 -0
  179. package/dist/commands/porch/plan.js.map +1 -0
  180. package/dist/commands/porch/prompts.d.ts +19 -0
  181. package/dist/commands/porch/prompts.d.ts.map +1 -0
  182. package/dist/commands/porch/prompts.js +277 -0
  183. package/dist/commands/porch/prompts.js.map +1 -0
  184. package/dist/commands/porch/protocol.d.ts +59 -0
  185. package/dist/commands/porch/protocol.d.ts.map +1 -0
  186. package/dist/commands/porch/protocol.js +294 -0
  187. package/dist/commands/porch/protocol.js.map +1 -0
  188. package/dist/commands/porch/state.d.ts +36 -107
  189. package/dist/commands/porch/state.d.ts.map +1 -1
  190. package/dist/commands/porch/state.js +120 -699
  191. package/dist/commands/porch/state.js.map +1 -1
  192. package/dist/commands/porch/types.d.ts +99 -164
  193. package/dist/commands/porch/types.d.ts.map +1 -1
  194. package/dist/commands/porch/types.js +2 -1
  195. package/dist/commands/porch/types.js.map +1 -1
  196. package/dist/commands/porch/verdict.d.ts +31 -0
  197. package/dist/commands/porch/verdict.d.ts.map +1 -0
  198. package/dist/commands/porch/verdict.js +59 -0
  199. package/dist/commands/porch/verdict.js.map +1 -0
  200. package/dist/commands/update.d.ts.map +1 -1
  201. package/dist/commands/update.js +31 -0
  202. package/dist/commands/update.js.map +1 -1
  203. package/dist/lib/scaffold.d.ts +37 -0
  204. package/dist/lib/scaffold.d.ts.map +1 -1
  205. package/dist/lib/scaffold.js +114 -0
  206. package/dist/lib/scaffold.js.map +1 -1
  207. package/dist/terminal/index.d.ts +8 -0
  208. package/dist/terminal/index.d.ts.map +1 -0
  209. package/dist/terminal/index.js +5 -0
  210. package/dist/terminal/index.js.map +1 -0
  211. package/dist/terminal/pty-manager.d.ts +69 -0
  212. package/dist/terminal/pty-manager.d.ts.map +1 -0
  213. package/dist/terminal/pty-manager.js +377 -0
  214. package/dist/terminal/pty-manager.js.map +1 -0
  215. package/dist/terminal/pty-session.d.ts +104 -0
  216. package/dist/terminal/pty-session.d.ts.map +1 -0
  217. package/dist/terminal/pty-session.js +327 -0
  218. package/dist/terminal/pty-session.js.map +1 -0
  219. package/dist/terminal/ring-buffer.d.ts +34 -0
  220. package/dist/terminal/ring-buffer.d.ts.map +1 -0
  221. package/dist/terminal/ring-buffer.js +94 -0
  222. package/dist/terminal/ring-buffer.js.map +1 -0
  223. package/dist/terminal/session-manager.d.ts +115 -0
  224. package/dist/terminal/session-manager.d.ts.map +1 -0
  225. package/dist/terminal/session-manager.js +582 -0
  226. package/dist/terminal/session-manager.js.map +1 -0
  227. package/dist/terminal/shepherd-client.d.ts +58 -0
  228. package/dist/terminal/shepherd-client.d.ts.map +1 -0
  229. package/dist/terminal/shepherd-client.js +212 -0
  230. package/dist/terminal/shepherd-client.js.map +1 -0
  231. package/dist/terminal/shepherd-main.d.ts +19 -0
  232. package/dist/terminal/shepherd-main.d.ts.map +1 -0
  233. package/dist/terminal/shepherd-main.js +153 -0
  234. package/dist/terminal/shepherd-main.js.map +1 -0
  235. package/dist/terminal/shepherd-process.d.ts +75 -0
  236. package/dist/terminal/shepherd-process.d.ts.map +1 -0
  237. package/dist/terminal/shepherd-process.js +279 -0
  238. package/dist/terminal/shepherd-process.js.map +1 -0
  239. package/dist/terminal/shepherd-protocol.d.ts +115 -0
  240. package/dist/terminal/shepherd-protocol.d.ts.map +1 -0
  241. package/dist/terminal/shepherd-protocol.js +214 -0
  242. package/dist/terminal/shepherd-protocol.js.map +1 -0
  243. package/dist/terminal/shepherd-replay-buffer.d.ts +38 -0
  244. package/dist/terminal/shepherd-replay-buffer.d.ts.map +1 -0
  245. package/dist/terminal/shepherd-replay-buffer.js +94 -0
  246. package/dist/terminal/shepherd-replay-buffer.js.map +1 -0
  247. package/dist/terminal/ws-protocol.d.ts +27 -0
  248. package/dist/terminal/ws-protocol.d.ts.map +1 -0
  249. package/dist/terminal/ws-protocol.js +44 -0
  250. package/dist/terminal/ws-protocol.js.map +1 -0
  251. package/package.json +19 -5
  252. package/skeleton/.claude/skills/af/SKILL.md +89 -0
  253. package/skeleton/.claude/skills/codev/SKILL.md +41 -0
  254. package/skeleton/.claude/skills/consult/SKILL.md +81 -0
  255. package/skeleton/.claude/skills/generate-image/SKILL.md +56 -0
  256. package/skeleton/DEPENDENCIES.md +4 -62
  257. package/skeleton/builders.md +1 -1
  258. package/skeleton/consult-types/impl-review.md +18 -9
  259. package/skeleton/consult-types/integration-review.md +1 -1
  260. package/skeleton/consult-types/plan-review.md +1 -1
  261. package/skeleton/consult-types/pr-ready.md +1 -1
  262. package/skeleton/consult-types/spec-review.md +1 -1
  263. package/skeleton/porch/prompts/defend.md +1 -1
  264. package/skeleton/porch/prompts/evaluate.md +2 -2
  265. package/skeleton/porch/prompts/implement.md +1 -1
  266. package/skeleton/porch/prompts/plan.md +1 -1
  267. package/skeleton/porch/prompts/review.md +4 -4
  268. package/skeleton/porch/prompts/specify.md +1 -1
  269. package/skeleton/porch/prompts/understand.md +2 -2
  270. package/skeleton/protocol-schema.json +282 -0
  271. package/skeleton/protocols/bugfix/builder-prompt.md +54 -0
  272. package/skeleton/protocols/bugfix/prompts/fix.md +77 -0
  273. package/skeleton/protocols/bugfix/prompts/investigate.md +77 -0
  274. package/skeleton/protocols/bugfix/prompts/pr.md +84 -0
  275. package/skeleton/protocols/bugfix/protocol.json +20 -33
  276. package/skeleton/protocols/experiment/builder-prompt.md +52 -0
  277. package/skeleton/protocols/experiment/protocol.json +101 -0
  278. package/skeleton/protocols/experiment/protocol.md +3 -3
  279. package/skeleton/protocols/experiment/templates/notes.md +1 -1
  280. package/skeleton/protocols/maintain/builder-prompt.md +46 -0
  281. package/skeleton/protocols/maintain/prompts/audit.md +111 -0
  282. package/skeleton/protocols/maintain/prompts/clean.md +91 -0
  283. package/skeleton/protocols/maintain/prompts/sync.md +113 -0
  284. package/skeleton/protocols/maintain/prompts/verify.md +110 -0
  285. package/skeleton/protocols/maintain/protocol.json +141 -0
  286. package/skeleton/protocols/maintain/protocol.md +17 -11
  287. package/skeleton/protocols/protocol-schema.json +54 -1
  288. package/skeleton/protocols/spir/builder-prompt.md +59 -0
  289. package/skeleton/protocols/spir/prompts/implement.md +208 -0
  290. package/skeleton/protocols/{spider → spir}/prompts/plan.md +6 -70
  291. package/skeleton/protocols/{spider → spir}/prompts/review.md +20 -39
  292. package/skeleton/protocols/{spider → spir}/prompts/specify.md +33 -61
  293. package/skeleton/protocols/spir/protocol.json +156 -0
  294. package/skeleton/protocols/{spider → spir}/protocol.md +35 -21
  295. package/skeleton/protocols/{spider → spir}/templates/plan.md +14 -0
  296. package/skeleton/protocols/spir/templates/review.md +89 -0
  297. package/skeleton/protocols/tick/builder-prompt.md +56 -0
  298. package/skeleton/protocols/tick/protocol.json +7 -2
  299. package/skeleton/protocols/tick/protocol.md +18 -18
  300. package/skeleton/protocols/tick/templates/review.md +1 -1
  301. package/skeleton/resources/commands/agent-farm.md +63 -46
  302. package/skeleton/resources/commands/codev.md +0 -2
  303. package/skeleton/resources/commands/overview.md +7 -17
  304. package/skeleton/resources/workflow-reference.md +4 -4
  305. package/skeleton/roles/architect.md +152 -315
  306. package/skeleton/roles/builder.md +110 -218
  307. package/skeleton/roles/consultant.md +6 -6
  308. package/skeleton/templates/AGENTS.md +2 -2
  309. package/skeleton/templates/CLAUDE.md +2 -2
  310. package/skeleton/templates/cheatsheet.md +7 -5
  311. package/skeleton/templates/projectlist.md +1 -1
  312. package/templates/dashboard/index.html +17 -43
  313. package/templates/dashboard/js/dialogs.js +7 -7
  314. package/templates/dashboard/js/files.js +2 -2
  315. package/templates/dashboard/js/main.js +4 -4
  316. package/templates/dashboard/js/projects.js +3 -3
  317. package/templates/dashboard/js/tabs.js +1 -1
  318. package/templates/dashboard/js/utils.js +22 -87
  319. package/templates/open.html +26 -0
  320. package/templates/tower.html +642 -36
  321. package/dist/agent-farm/commands/kickoff.d.ts +0 -20
  322. package/dist/agent-farm/commands/kickoff.d.ts.map +0 -1
  323. package/dist/agent-farm/commands/kickoff.js +0 -337
  324. package/dist/agent-farm/commands/kickoff.js.map +0 -1
  325. package/dist/agent-farm/commands/rename.d.ts +0 -13
  326. package/dist/agent-farm/commands/rename.d.ts.map +0 -1
  327. package/dist/agent-farm/commands/rename.js +0 -33
  328. package/dist/agent-farm/commands/rename.js.map +0 -1
  329. package/dist/agent-farm/commands/tutorial.d.ts +0 -10
  330. package/dist/agent-farm/commands/tutorial.d.ts.map +0 -1
  331. package/dist/agent-farm/commands/tutorial.js +0 -49
  332. package/dist/agent-farm/commands/tutorial.js.map +0 -1
  333. package/dist/agent-farm/commands/util.d.ts +0 -15
  334. package/dist/agent-farm/commands/util.d.ts.map +0 -1
  335. package/dist/agent-farm/commands/util.js +0 -108
  336. package/dist/agent-farm/commands/util.js.map +0 -1
  337. package/dist/agent-farm/servers/dashboard-server.d.ts +0 -7
  338. package/dist/agent-farm/servers/dashboard-server.d.ts.map +0 -1
  339. package/dist/agent-farm/servers/dashboard-server.js +0 -1872
  340. package/dist/agent-farm/servers/dashboard-server.js.map +0 -1
  341. package/dist/agent-farm/servers/open-server.d.ts +0 -7
  342. package/dist/agent-farm/servers/open-server.d.ts.map +0 -1
  343. package/dist/agent-farm/servers/open-server.js +0 -315
  344. package/dist/agent-farm/servers/open-server.js.map +0 -1
  345. package/dist/agent-farm/tutorial/index.d.ts +0 -8
  346. package/dist/agent-farm/tutorial/index.d.ts.map +0 -1
  347. package/dist/agent-farm/tutorial/index.js +0 -8
  348. package/dist/agent-farm/tutorial/index.js.map +0 -1
  349. package/dist/agent-farm/tutorial/prompts.d.ts +0 -57
  350. package/dist/agent-farm/tutorial/prompts.d.ts.map +0 -1
  351. package/dist/agent-farm/tutorial/prompts.js +0 -147
  352. package/dist/agent-farm/tutorial/prompts.js.map +0 -1
  353. package/dist/agent-farm/tutorial/runner.d.ts +0 -52
  354. package/dist/agent-farm/tutorial/runner.d.ts.map +0 -1
  355. package/dist/agent-farm/tutorial/runner.js +0 -204
  356. package/dist/agent-farm/tutorial/runner.js.map +0 -1
  357. package/dist/agent-farm/tutorial/state.d.ts +0 -26
  358. package/dist/agent-farm/tutorial/state.d.ts.map +0 -1
  359. package/dist/agent-farm/tutorial/state.js +0 -89
  360. package/dist/agent-farm/tutorial/state.js.map +0 -1
  361. package/dist/agent-farm/tutorial/steps/first-spec.d.ts +0 -7
  362. package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +0 -1
  363. package/dist/agent-farm/tutorial/steps/first-spec.js +0 -136
  364. package/dist/agent-farm/tutorial/steps/first-spec.js.map +0 -1
  365. package/dist/agent-farm/tutorial/steps/implementation.d.ts +0 -7
  366. package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +0 -1
  367. package/dist/agent-farm/tutorial/steps/implementation.js +0 -76
  368. package/dist/agent-farm/tutorial/steps/implementation.js.map +0 -1
  369. package/dist/agent-farm/tutorial/steps/index.d.ts +0 -10
  370. package/dist/agent-farm/tutorial/steps/index.d.ts.map +0 -1
  371. package/dist/agent-farm/tutorial/steps/index.js +0 -10
  372. package/dist/agent-farm/tutorial/steps/index.js.map +0 -1
  373. package/dist/agent-farm/tutorial/steps/planning.d.ts +0 -7
  374. package/dist/agent-farm/tutorial/steps/planning.d.ts.map +0 -1
  375. package/dist/agent-farm/tutorial/steps/planning.js +0 -143
  376. package/dist/agent-farm/tutorial/steps/planning.js.map +0 -1
  377. package/dist/agent-farm/tutorial/steps/review.d.ts +0 -7
  378. package/dist/agent-farm/tutorial/steps/review.d.ts.map +0 -1
  379. package/dist/agent-farm/tutorial/steps/review.js +0 -78
  380. package/dist/agent-farm/tutorial/steps/review.js.map +0 -1
  381. package/dist/agent-farm/tutorial/steps/setup.d.ts +0 -7
  382. package/dist/agent-farm/tutorial/steps/setup.d.ts.map +0 -1
  383. package/dist/agent-farm/tutorial/steps/setup.js +0 -126
  384. package/dist/agent-farm/tutorial/steps/setup.js.map +0 -1
  385. package/dist/agent-farm/tutorial/steps/welcome.d.ts +0 -7
  386. package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +0 -1
  387. package/dist/agent-farm/tutorial/steps/welcome.js +0 -50
  388. package/dist/agent-farm/tutorial/steps/welcome.js.map +0 -1
  389. package/dist/agent-farm/utils/orphan-handler.d.ts +0 -27
  390. package/dist/agent-farm/utils/orphan-handler.d.ts.map +0 -1
  391. package/dist/agent-farm/utils/orphan-handler.js +0 -149
  392. package/dist/agent-farm/utils/orphan-handler.js.map +0 -1
  393. package/dist/agent-farm/utils/port-registry.d.ts +0 -58
  394. package/dist/agent-farm/utils/port-registry.d.ts.map +0 -1
  395. package/dist/agent-farm/utils/port-registry.js +0 -166
  396. package/dist/agent-farm/utils/port-registry.js.map +0 -1
  397. package/dist/agent-farm/utils/terminal-ports.d.ts +0 -18
  398. package/dist/agent-farm/utils/terminal-ports.d.ts.map +0 -1
  399. package/dist/agent-farm/utils/terminal-ports.js +0 -35
  400. package/dist/agent-farm/utils/terminal-ports.js.map +0 -1
  401. package/dist/commands/pcheck/cache.d.ts +0 -48
  402. package/dist/commands/pcheck/cache.d.ts.map +0 -1
  403. package/dist/commands/pcheck/cache.js +0 -170
  404. package/dist/commands/pcheck/cache.js.map +0 -1
  405. package/dist/commands/pcheck/evaluator.d.ts +0 -15
  406. package/dist/commands/pcheck/evaluator.d.ts.map +0 -1
  407. package/dist/commands/pcheck/evaluator.js +0 -246
  408. package/dist/commands/pcheck/evaluator.js.map +0 -1
  409. package/dist/commands/pcheck/index.d.ts +0 -12
  410. package/dist/commands/pcheck/index.d.ts.map +0 -1
  411. package/dist/commands/pcheck/index.js +0 -249
  412. package/dist/commands/pcheck/index.js.map +0 -1
  413. package/dist/commands/pcheck/parser.d.ts +0 -39
  414. package/dist/commands/pcheck/parser.d.ts.map +0 -1
  415. package/dist/commands/pcheck/parser.js +0 -155
  416. package/dist/commands/pcheck/parser.js.map +0 -1
  417. package/dist/commands/pcheck/types.d.ts +0 -82
  418. package/dist/commands/pcheck/types.d.ts.map +0 -1
  419. package/dist/commands/pcheck/types.js +0 -5
  420. package/dist/commands/pcheck/types.js.map +0 -1
  421. package/dist/commands/porch/consultation.d.ts +0 -56
  422. package/dist/commands/porch/consultation.d.ts.map +0 -1
  423. package/dist/commands/porch/consultation.js +0 -330
  424. package/dist/commands/porch/consultation.js.map +0 -1
  425. package/dist/commands/porch/notifications.d.ts +0 -99
  426. package/dist/commands/porch/notifications.d.ts.map +0 -1
  427. package/dist/commands/porch/notifications.js +0 -223
  428. package/dist/commands/porch/notifications.js.map +0 -1
  429. package/dist/commands/porch/plan-parser.d.ts +0 -38
  430. package/dist/commands/porch/plan-parser.d.ts.map +0 -1
  431. package/dist/commands/porch/plan-parser.js +0 -166
  432. package/dist/commands/porch/plan-parser.js.map +0 -1
  433. package/dist/commands/porch/protocol-loader.d.ts +0 -46
  434. package/dist/commands/porch/protocol-loader.d.ts.map +0 -1
  435. package/dist/commands/porch/protocol-loader.js +0 -253
  436. package/dist/commands/porch/protocol-loader.js.map +0 -1
  437. package/dist/commands/porch/signal-parser.d.ts +0 -88
  438. package/dist/commands/porch/signal-parser.d.ts.map +0 -1
  439. package/dist/commands/porch/signal-parser.js +0 -148
  440. package/dist/commands/porch/signal-parser.js.map +0 -1
  441. package/dist/commands/tower.d.ts +0 -16
  442. package/dist/commands/tower.d.ts.map +0 -1
  443. package/dist/commands/tower.js +0 -21
  444. package/dist/commands/tower.js.map +0 -1
  445. package/skeleton/config.json +0 -7
  446. package/skeleton/porch/protocols/bugfix.json +0 -85
  447. package/skeleton/porch/protocols/spider.json +0 -135
  448. package/skeleton/porch/protocols/tick.json +0 -76
  449. package/skeleton/protocols/spider/prompts/defend.md +0 -215
  450. package/skeleton/protocols/spider/prompts/evaluate.md +0 -241
  451. package/skeleton/protocols/spider/prompts/implement.md +0 -149
  452. package/skeleton/protocols/spider/protocol.json +0 -210
  453. package/skeleton/protocols/spider/templates/review.md +0 -207
  454. package/templates/dashboard/css/activity.css +0 -151
  455. package/templates/dashboard/js/activity.js +0 -112
  456. /package/skeleton/protocols/{spider → spir}/templates/spec.md +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shepherd-replay-buffer.d.ts","sourceRoot":"","sources":["../../src/terminal/shepherd-replay-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,SAAS,CAAK;IAEtB;;;OAGG;gBACS,QAAQ,GAAE,MAAe;IAIrC;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA0CnC;;;OAGG;IACH,aAAa,IAAI,MAAM;IAMvB,sCAAsC;IACtC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,0CAA0C;IAC1C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,+BAA+B;IAC/B,KAAK,IAAI,IAAI;CAKd"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Standalone replay buffer for the shepherd process.
3
+ *
4
+ * Unlike RingBuffer (which stores lines), this stores raw byte chunks
5
+ * to preserve exact terminal output including escape sequences. It tracks
6
+ * the total bytes stored and evicts oldest chunks when the limit is exceeded.
7
+ *
8
+ * This module has NO dependencies beyond Node.js built-ins so the shepherd
9
+ * process doesn't need to pull in the full package dependency tree.
10
+ */
11
+ export class ShepherdReplayBuffer {
12
+ chunks = [];
13
+ totalBytes = 0;
14
+ maxLines;
15
+ lineCount = 0;
16
+ /**
17
+ * @param maxLines Maximum number of lines to retain. Lines are delimited
18
+ * by newline characters in the raw data stream.
19
+ */
20
+ constructor(maxLines = 10_000) {
21
+ this.maxLines = maxLines;
22
+ }
23
+ /**
24
+ * Append raw PTY output data to the buffer.
25
+ * Evicts oldest chunks if the line count exceeds maxLines.
26
+ */
27
+ append(data) {
28
+ const buf = typeof data === 'string' ? Buffer.from(data, 'utf-8') : data;
29
+ if (buf.length === 0)
30
+ return;
31
+ // Count newlines in this chunk
32
+ let newLines = 0;
33
+ for (let i = 0; i < buf.length; i++) {
34
+ if (buf[i] === 0x0a)
35
+ newLines++;
36
+ }
37
+ this.chunks.push(buf);
38
+ this.totalBytes += buf.length;
39
+ this.lineCount += newLines;
40
+ // Evict oldest chunks if we've exceeded the line limit
41
+ while (this.lineCount > this.maxLines && this.chunks.length > 1) {
42
+ const oldest = this.chunks[0];
43
+ let removedLines = 0;
44
+ for (let i = 0; i < oldest.length; i++) {
45
+ if (oldest[i] === 0x0a)
46
+ removedLines++;
47
+ }
48
+ this.chunks.shift();
49
+ this.totalBytes -= oldest.length;
50
+ this.lineCount -= removedLines;
51
+ }
52
+ // Handle edge case: single chunk exceeds line limit.
53
+ // Trim from the front to keep only the last maxLines lines.
54
+ if (this.lineCount > this.maxLines && this.chunks.length === 1) {
55
+ const chunk = this.chunks[0];
56
+ let linesToSkip = this.lineCount - this.maxLines;
57
+ let offset = 0;
58
+ while (linesToSkip > 0 && offset < chunk.length) {
59
+ if (chunk[offset] === 0x0a)
60
+ linesToSkip--;
61
+ offset++;
62
+ }
63
+ this.chunks[0] = chunk.subarray(offset);
64
+ this.totalBytes = this.chunks[0].length;
65
+ this.lineCount = this.maxLines;
66
+ }
67
+ }
68
+ /**
69
+ * Get all buffered data as a single concatenated Buffer.
70
+ * Used for the REPLAY frame on reconnection.
71
+ */
72
+ getReplayData() {
73
+ if (this.chunks.length === 0)
74
+ return Buffer.alloc(0);
75
+ if (this.chunks.length === 1)
76
+ return this.chunks[0];
77
+ return Buffer.concat(this.chunks);
78
+ }
79
+ /** Current number of bytes stored. */
80
+ get size() {
81
+ return this.totalBytes;
82
+ }
83
+ /** Approximate number of lines stored. */
84
+ get lines() {
85
+ return this.lineCount;
86
+ }
87
+ /** Clear all buffered data. */
88
+ clear() {
89
+ this.chunks = [];
90
+ this.totalBytes = 0;
91
+ this.lineCount = 0;
92
+ }
93
+ }
94
+ //# sour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M,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,sCAAsC;IACtC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,0CAA0C;IAC1C,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,+BAA+B;IAC/B,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * WebSocket frame encoding/decoding for terminal communication.
3
+ *
4
+ * Hybrid protocol:
5
+ * - 0x00 prefix: Control frame (remainder is UTF-8 JSON)
6
+ * - 0x01 prefix: Data frame (remainder is raw PTY bytes)
7
+ */
8
+ export declare const FRAME_CONTROL = 0;
9
+ export declare const FRAME_DATA = 1;
10
+ export interface ControlMessage {
11
+ type: 'resize' | 'ping' | 'pong' | 'pause' | 'resume' | 'error';
12
+ payload: Record<string, unknown>;
13
+ }
14
+ /** Encode a control message into a binary frame. */
15
+ export declare function encodeControl(msg: ControlMessage): Buffer;
16
+ /** Encode raw PTY data into a binary frame. */
17
+ export declare function encodeData(data: Buffer | string): Buffer;
18
+ export type DecodedFrame = {
19
+ type: 'control';
20
+ message: ControlMessage;
21
+ } | {
22
+ type: 'data';
23
+ data: Buffer;
24
+ };
25
+ /** Decode a received WebSocket frame. */
26
+ export declare function decodeFrame(frame: Buffer): DecodedFrame;
27
+ //# sourceMappingURL=ws-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-protocol.d.ts","sourceRoot":"","sources":["../../src/terminal/ws-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,aAAa,IAAO,CAAC;AAClC,eAAO,MAAM,UAAU,IAAO,CAAC;AAE/B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAChE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAOzD;AAED,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAMxD;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,yCAAyC;AACzC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAmBvD"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * WebSocket frame encoding/decoding for terminal communication.
3
+ *
4
+ * Hybrid protocol:
5
+ * - 0x00 prefix: Control frame (remainder is UTF-8 JSON)
6
+ * - 0x01 prefix: Data frame (remainder is raw PTY bytes)
7
+ */
8
+ export const FRAME_CONTROL = 0x00;
9
+ export const FRAME_DATA = 0x01;
10
+ /** Encode a control message into a binary frame. */
11
+ export function encodeControl(msg) {
12
+ const json = JSON.stringify(msg);
13
+ const jsonBuf = Buffer.from(json, 'utf-8');
14
+ const frame = Buffer.allocUnsafe(1 + jsonBuf.length);
15
+ frame[0] = FRAME_CONTROL;
16
+ jsonBuf.copy(frame, 1);
17
+ return frame;
18
+ }
19
+ /** Encode raw PTY data into a binary frame. */
20
+ export function encodeData(data) {
21
+ const dataBuf = typeof data === 'string' ? Buffer.from(data, 'utf-8') : data;
22
+ const frame = Buffer.allocUnsafe(1 + dataBuf.length);
23
+ frame[0] = FRAME_DATA;
24
+ dataBuf.copy(frame, 1);
25
+ return frame;
26
+ }
27
+ /** Decode a received WebSocket frame. */
28
+ export function decodeFrame(frame) {
29
+ if (frame.length === 0) {
30
+ throw new Error('Empty frame');
31
+ }
32
+ const prefix = frame[0];
33
+ const payload = frame.subarray(1);
34
+ if (prefix === FRAME_CONTROL) {
35
+ const json = payload.toString('utf-8');
36
+ const message = JSON.parse(json);
37
+ return { type: 'control', message };
38
+ }
39
+ if (prefix === FRAME_DATA) {
40
+ return { type: 'data', data: payload };
41
+ }
42
+ throw new Error(`Unknown frame prefix: 0x${prefix.toString(16)}`);
43
+ }
44
+ //# sourceMappingURL=ws-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-protocol.js","sourceRoot":"","sources":["../../src/terminal/ws-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAO/B,oDAAoD;AACpD,MAAM,UAAU,aAAa,CAAC,GAAmB;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,KAAK,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,UAAU,CAAC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2.0.0-rc.7",
3
+ "version": "2.0.0-rc.70",
4
4
  "description": "Codev CLI - AI-assisted software development framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,32 +14,46 @@
14
14
  "dist",
15
15
  "bin",
16
16
  "skeleton",
17
- "templates"
17
+ "templates",
18
+ "dashboard/dist"
18
19
  ],
19
20
  "scripts": {
20
- "build": "tsc && npm run copy-skeleton",
21
+ "clean": "rm -rf dist",
22
+ "build": "npm run clean && tsc && npm run build:dashboard && npm run copy-skeleton",
23
+ "build:dashboard": "cd dashboard && npm install && npm run build",
24
+ "dev:dashboard": "cd dashboard && npm run dev",
21
25
  "copy-skeleton": "rm -rf skeleton && cp -r ../../codev-skeleton skeleton",
22
26
  "dev": "tsx src/cli.ts",
23
27
  "start": "node dist/cli.js",
24
28
  "test": "vitest",
29
+ "test:e2e": "npm run build && vitest run --config vitest.e2e.config.ts",
30
+ "test:e2e:watch": "vitest --config vitest.e2e.config.ts",
31
+ "test:e2e:playwright": "npx playwright test",
32
+ "test:e2e:cli": "npm run build && vitest run --config vitest.cli.config.ts",
33
+ "postinstall": "node -e \"try{require('fs').chmodSync(require('path').join(require.resolve('node-pty'),'..','..','prebuilds',process.platform+'-'+process.arch,'spawn-helper'),0o755)}catch{}\"",
25
34
  "prepublishOnly": "npm run build"
26
35
  },
27
36
  "dependencies": {
37
+ "@anthropic-ai/claude-agent-sdk": "^0.2.41",
28
38
  "@google/genai": "^1.0.0",
29
39
  "better-sqlite3": "^12.5.0",
30
40
  "chalk": "^5.3.0",
31
41
  "commander": "^12.1.0",
32
42
  "glob": "^11.0.0",
33
- "http-proxy": "^1.18.1",
43
+ "js-yaml": "^4.1.0",
44
+ "node-pty": "^1.1.0",
34
45
  "open": "^10.1.0",
35
46
  "tree-kill": "^1.2.2",
36
47
  "ws": "^8.18.0"
37
48
  },
38
49
  "devDependencies": {
50
+ "@playwright/test": "^1.58.0",
39
51
  "@types/better-sqlite3": "^7.6.13",
40
- "@types/http-proxy": "^1.17.17",
52
+ "@types/js-yaml": "^4.0.9",
41
53
  "@types/node": "^22.10.1",
42
54
  "@types/ws": "^8.18.1",
55
+ "@vitest/coverage-v8": "^4.0.18",
56
+ "playwright": "^1.58.0",
43
57
  "tsx": "^4.19.2",
44
58
  "typescript": "^5.7.2",
45
59
  "vitest": "^4.0.15"
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: af
3
+ description: Agent Farm CLI quick reference. Use when running af commands to check correct syntax, subcommands, and flags. Prevents guessing at command names.
4
+ disable-model-invocation: false
5
+ ---
6
+
7
+ # Agent Farm Quick Reference
8
+
9
+ ## Tower (Dashboard Server)
10
+
11
+ ```bash
12
+ af tower start # Start Tower on port 4100
13
+ af tower stop # Stop Tower
14
+ af tower log # Tail Tower logs
15
+ af tower status # Check if Tower is running
16
+ ```
17
+
18
+ There is NO `af tower restart` — use `af tower stop && af tower start`.
19
+
20
+ ## Dashboard
21
+
22
+ ```bash
23
+ af dash start # Start architect dashboard for current project
24
+ af dash stop # Stop dashboard for current project
25
+ af dash open # Open dashboard in browser
26
+ ```
27
+
28
+ ## Builder Management
29
+
30
+ ```bash
31
+ af spawn -p 0003 # Spawn builder for spec (strict mode, default)
32
+ af spawn --soft -p 0003 # Spawn builder (soft mode)
33
+ af spawn --issue 42 # Spawn builder for a bugfix
34
+ af spawn -p 0003 --resume # Resume builder in existing worktree
35
+ af status # Check all builder status
36
+ af cleanup --project 0003 # Clean up builder worktree (safe)
37
+ af cleanup --project 0003 -f # Force cleanup
38
+ ```
39
+
40
+ ### Resuming Builders
41
+
42
+ When a builder's Claude process dies but the worktree and porch state survive,
43
+ use `--resume` to restart it without recreating the worktree:
44
+
45
+ ```bash
46
+ af spawn -p 0003 --resume
47
+ ```
48
+
49
+ This reuses the existing `.builders/0003` worktree, creates a fresh terminal
50
+ session registered with the Tower (so it appears in the dashboard), and lets
51
+ porch pick up from whatever phase the builder was in. Works with all spawn
52
+ modes: `-p`, `--issue`, `--task`, `--protocol`, `--worktree`.
53
+
54
+ ## Utility
55
+
56
+ ```bash
57
+ af util # Open utility shell
58
+ af open file.ts # Open file in annotation viewer
59
+ af ports list # List port allocations
60
+ af send <builder> "msg" # Send message to a builder
61
+ ```
62
+
63
+ ## Configuration
64
+
65
+ Edit `af-config.json` at project root to customize shell commands.
66
+
67
+ ```json
68
+ {
69
+ "shell": {
70
+ "architect": "claude",
71
+ "builder": "claude",
72
+ "shell": "bash"
73
+ }
74
+ }
75
+ ```
76
+
77
+ ## Pre-Spawn Checklist
78
+
79
+ **Before `af spawn`, commit all local changes.** Builders work in git worktrees
80
+ branched from HEAD — uncommitted files (specs, plans, codev updates) are invisible
81
+ to the builder. The spawn command will refuse if the worktree is dirty (override
82
+ with `--force`).
83
+
84
+ ## Common Mistakes
85
+
86
+ - **Spawning with uncommitted changes** — builder won't see specs, plans, or codev updates
87
+ - There is NO `codev tower` command — Tower is managed via `af tower`
88
+ - There is NO `restart` subcommand — stop then start
89
+ - There is NO `af start` for Tower — use `af tower start` or `af dash start`
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: codev
3
+ description: Codev project management CLI quick reference. Use when running codev commands to check correct syntax for init, adopt, update, and doctor.
4
+ disable-model-invocation: false
5
+ ---
6
+
7
+ # codev - Project Management CLI
8
+
9
+ ## Commands
10
+
11
+ ```bash
12
+ codev init [name] # Create a new codev project
13
+ codev init my-app -y # Non-interactive with defaults
14
+ codev adopt # Add codev to existing project (run from project root)
15
+ codev adopt -y # Skip conflict prompts
16
+ codev update # Update protocols, roles, skills from installed package
17
+ codev update --dry-run # Preview changes without applying
18
+ codev update --force # Force overwrite all framework files
19
+ codev doctor # Check system dependencies
20
+ ```
21
+
22
+ ## What Each Command Does
23
+
24
+ ### codev init
25
+ Creates a new project directory with codev structure: specs/, plans/, reviews/, protocols, CLAUDE.md, AGENTS.md, .claude/skills/, af-config.json, .gitignore.
26
+
27
+ ### codev adopt
28
+ Adds codev to the **current directory**. Detects existing CLAUDE.md/AGENTS.md and creates `.codev-new` versions for merge if conflicts exist. Spawns Claude to merge automatically.
29
+
30
+ ### codev update
31
+ Updates framework files (protocols, roles, skills) from the installed `@cluesmith/codev` package. **Never touches user data** (specs, plans, reviews). If you've customized a framework file, creates a `.codev-new` version for manual merge.
32
+
33
+ ### codev doctor
34
+ Checks that all required dependencies are installed: Node.js (>=18), git (>=2.5), gh (authenticated), and at least one AI CLI (Claude, Gemini, or Codex).
35
+
36
+ ## Common Mistakes
37
+
38
+ - There is NO `codev tower` command — Tower is managed via `af tower start` / `af tower stop`
39
+ - `codev init` creates a **new directory** — use `codev adopt` for existing projects
40
+ - `codev update` only updates framework files — it will never overwrite your specs/plans/reviews
41
+ - Always run `codev adopt` and `codev update` from the **project root directory**
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: consult
3
+ description: AI consultation CLI quick reference. Use when running consult commands to check syntax for PR reviews, spec reviews, plan reviews, and general queries across Gemini, Codex, and Claude.
4
+ disable-model-invocation: false
5
+ ---
6
+
7
+ # consult - AI Consultation CLI
8
+
9
+ ## Synopsis
10
+
11
+ ```bash
12
+ consult -m <model> <subcommand> [args] [options]
13
+ ```
14
+
15
+ The `-m` / `--model` flag is **always required**.
16
+
17
+ ## Models
18
+
19
+ | Model | Alias | Speed | Approach |
20
+ |-------|-------|-------|----------|
21
+ | `gemini` | `pro` | ~120-150s | Pure text analysis, fast |
22
+ | `codex` | `gpt` | ~200-250s | Shell command exploration, thorough |
23
+ | `claude` | `opus` | ~60-120s | Balanced tool use |
24
+
25
+ ## Subcommands
26
+
27
+ ```bash
28
+ consult -m gemini pr 42 # Review a pull request
29
+ consult -m codex spec 42 # Review a specification
30
+ consult -m gemini plan 42 # Review an implementation plan
31
+ consult -m claude general "query" # General question (quoted string)
32
+ ```
33
+
34
+ ## Options
35
+
36
+ ```bash
37
+ -n, --dry-run # Show command without running
38
+ -t, --type <type> # Review type (spec-review, plan-review, impl-review, pr-ready, integration-review)
39
+ -r, --role <role> # Custom role from codev/roles/ (without .md extension)
40
+ ```
41
+
42
+ ## Review Types (--type)
43
+
44
+ | Type | Stage | Use Case |
45
+ |------|-------|----------|
46
+ | `spec-review` | conceived | Review spec completeness |
47
+ | `plan-review` | specified | Review implementation plan |
48
+ | `impl-review` | implementing | Review code implementation |
49
+ | `pr-ready` | implemented | Final check before PR |
50
+ | `integration-review` | committed | Architect's integration review |
51
+
52
+ Review type prompts live in `codev/consult-types/` and can be customized.
53
+
54
+ ## Parallel Consultation (3-Way / cmap)
55
+
56
+ Run all three models in parallel for thorough reviews:
57
+
58
+ ```bash
59
+ consult -m gemini spec 42 &
60
+ consult -m codex spec 42 &
61
+ consult -m claude spec 42 &
62
+ wait
63
+ ```
64
+
65
+ Or from Claude Code, use **cmap** pattern: three parallel background Bash calls.
66
+
67
+ ## Custom Roles
68
+
69
+ ```bash
70
+ consult -m gemini --role security-reviewer pr 42
71
+ consult -m codex --role architect general "Review this design"
72
+ ```
73
+
74
+ Roles are markdown files in `codev/roles/`. Create your own by adding `.md` files there.
75
+
76
+ ## Common Mistakes
77
+
78
+ - The `-m` flag is **required** — `consult pr 42` will fail without it
79
+ - PR numbers are GitHub PR numbers, not spec numbers
80
+ - Spec/plan numbers match the `0042` prefix in filenames (pass just `42`, not `0042`)
81
+ - General queries must be **quoted**: `consult -m gemini general "your question here"`
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: generate-image
3
+ description: AI image generation CLI using Gemini. Use when generating images, checking syntax for resolution, aspect ratio, and reference image options.
4
+ disable-model-invocation: false
5
+ ---
6
+
7
+ # generate-image - AI Image Generation
8
+
9
+ Uses Google Gemini (gemini-3-pro-image-preview) to generate images from text prompts.
10
+
11
+ ## Synopsis
12
+
13
+ ```bash
14
+ codev generate-image "<prompt>" [options]
15
+ ```
16
+
17
+ ## Options
18
+
19
+ ```bash
20
+ -o, --output <file> # Output file path (default: output.png)
21
+ -r, --resolution <res> # Resolution: 1K, 2K, 4K (default: 1K)
22
+ -a, --aspect <ratio> # Aspect ratio (default: 1:1)
23
+ --ref <image> # Reference image (repeatable, max 14)
24
+ ```
25
+
26
+ ## Aspect Ratios
27
+
28
+ `1:1` | `16:9` | `9:16` | `3:4` | `4:3` | `3:2` | `2:3`
29
+
30
+ ## Examples
31
+
32
+ ```bash
33
+ # Basic generation
34
+ codev generate-image "A sunset over mountains"
35
+
36
+ # High-res widescreen
37
+ codev generate-image "A futuristic city" -r 4K -a 16:9 -o city.png
38
+
39
+ # With reference images (style transfer)
40
+ codev generate-image "Same style but with cats" --ref style.png --ref layout.png
41
+
42
+ # Prompt from file
43
+ codev generate-image prompt.txt -o result.png
44
+ ```
45
+
46
+ ## Prerequisites
47
+
48
+ Requires `GEMINI_API_KEY` or `GOOGLE_API_KEY` environment variable.
49
+ Get a key at https://aistudio.google.com/apikey
50
+
51
+ ## Common Mistakes
52
+
53
+ - Prompt must be **quoted** if it contains spaces
54
+ - Prompt can also be a `.txt` file path (auto-detected by extension)
55
+ - Reference images must exist on disk — max 14 images
56
+ - Output defaults to `output.png` in current directory — use `-o` to change
@@ -37,49 +37,6 @@ sudo apt install -y nodejs
37
37
  node --version # Should show v18.x or higher
38
38
  ```
39
39
 
40
- ### tmux
41
-
42
- | Requirement | Value |
43
- |-------------|-------|
44
- | Minimum Version | 3.0 |
45
- | Purpose | Terminal multiplexer for managing builder sessions |
46
-
47
- **Installation:**
48
-
49
- ```bash
50
- # macOS
51
- brew install tmux
52
-
53
- # Ubuntu/Debian
54
- sudo apt install tmux
55
-
56
- # Verify
57
- tmux -V # Should show tmux 3.x or higher
58
- ```
59
-
60
- ### ttyd
61
-
62
- | Requirement | Value |
63
- |-------------|-------|
64
- | Minimum Version | 1.7.0 |
65
- | Purpose | Web-based terminal for dashboard access |
66
-
67
- **Installation:**
68
-
69
- ```bash
70
- # macOS
71
- brew install ttyd
72
-
73
- # Ubuntu/Debian (build from source)
74
- sudo apt install build-essential cmake git libjson-c-dev libwebsockets-dev
75
- git clone https://github.com/tsl0922/ttyd.git
76
- cd ttyd && mkdir build && cd build
77
- cmake .. && make && sudo make install
78
-
79
- # Verify
80
- ttyd --version # Should show 1.7.x or higher
81
- ```
82
-
83
40
  ### git
84
41
 
85
42
  | Requirement | Value |
@@ -192,8 +149,6 @@ codex --version
192
149
  | Dependency | Minimum Version | Required? |
193
150
  |------------|-----------------|-----------|
194
151
  | Node.js | 18.0.0 | Yes |
195
- | tmux | 3.0 | Yes |
196
- | ttyd | 1.7.0 | Yes |
197
152
  | git | 2.5.0 | Yes |
198
153
  | gh | latest | Yes |
199
154
  | Claude Code | latest | At least one AI CLI |
@@ -210,7 +165,7 @@ All dependencies are available via Homebrew:
210
165
 
211
166
  ```bash
212
167
  # Install all core dependencies at once
213
- brew install node tmux ttyd gh
168
+ brew install node gh
214
169
 
215
170
  # Git is included with Xcode command line tools
216
171
  xcode-select --install
@@ -218,15 +173,13 @@ xcode-select --install
218
173
 
219
174
  ### Ubuntu/Debian
220
175
 
221
- Most dependencies are available via apt, except ttyd which must be built from source:
176
+ Most dependencies are available via apt:
222
177
 
223
178
  ```bash
224
179
  # Core dependencies
225
- sudo apt install nodejs npm tmux git
180
+ sudo apt install nodejs npm git
226
181
 
227
182
  # gh requires adding GitHub's apt repository (see above)
228
-
229
- # ttyd must be built from source (see above)
230
183
  ```
231
184
 
232
185
  ### Windows
@@ -256,18 +209,7 @@ echo $PATH
256
209
  export PATH="$PATH:$(npm config get prefix)/bin"
257
210
  ```
258
211
 
259
- ### tmux version too old
260
-
261
- Ubuntu LTS versions often have older tmux. Install from source or use a PPA:
262
-
263
- ```bash
264
- # Add tmux PPA for newer versions
265
- sudo add-apt-repository ppa:pi-rho/dev
266
- sudo apt update
267
- sudo apt install tmux
268
- ```
269
-
270
- ### ttyd connection issues
212
+ ### Terminal connection issues
271
213
 
272
214
  Ensure no firewall is blocking the ports (default: 4200-4299):
273
215
 
@@ -4,7 +4,7 @@ Track active builder agents here. Update manually or via `architect status`.
4
4
 
5
5
  ## Status Values
6
6
 
7
- - **spawning**: Worktree being created, ttyd starting
7
+ - **spawning**: Worktree being created, terminal starting
8
8
  - **implementing**: Builder is working
9
9
  - **blocked**: Builder waiting for architect input
10
10
  - **pr-ready**: Builder has created a PR