opencastle 1.3.1 → 1.4.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.
Files changed (486) hide show
  1. package/README.md +16 -10
  2. package/bin/cli.mjs +8 -9
  3. package/dist/cli/agent-roster.test.js +0 -48
  4. package/dist/cli/agent-roster.test.js.map +1 -1
  5. package/dist/cli/boundary.test.js +9 -7
  6. package/dist/cli/boundary.test.js.map +1 -1
  7. package/dist/cli/convoy/artifacts.d.ts +9 -2
  8. package/dist/cli/convoy/artifacts.d.ts.map +1 -1
  9. package/dist/cli/convoy/artifacts.js +13 -10
  10. package/dist/cli/convoy/artifacts.js.map +1 -1
  11. package/dist/cli/convoy/artifacts.test.js +4 -2
  12. package/dist/cli/convoy/artifacts.test.js.map +1 -1
  13. package/dist/cli/convoy/engine.d.ts +53 -23
  14. package/dist/cli/convoy/engine.d.ts.map +1 -1
  15. package/dist/cli/convoy/engine.git.test.d.ts +2 -0
  16. package/dist/cli/convoy/engine.git.test.d.ts.map +1 -0
  17. package/dist/cli/convoy/engine.git.test.js +435 -0
  18. package/dist/cli/convoy/engine.git.test.js.map +1 -0
  19. package/dist/cli/convoy/engine.js +1746 -2305
  20. package/dist/cli/convoy/engine.js.map +1 -1
  21. package/dist/cli/convoy/engine.test.js +698 -678
  22. package/dist/cli/convoy/engine.test.js.map +1 -1
  23. package/dist/cli/convoy/event-schemas.d.ts +2 -0
  24. package/dist/cli/convoy/event-schemas.d.ts.map +1 -1
  25. package/dist/cli/convoy/event-schemas.js +59 -57
  26. package/dist/cli/convoy/event-schemas.js.map +1 -1
  27. package/dist/cli/convoy/events.d.ts +4 -1
  28. package/dist/cli/convoy/events.d.ts.map +1 -1
  29. package/dist/cli/convoy/events.js +69 -84
  30. package/dist/cli/convoy/events.js.map +1 -1
  31. package/dist/cli/convoy/events.test.js +50 -9
  32. package/dist/cli/convoy/events.test.js.map +1 -1
  33. package/dist/cli/convoy/gates.d.ts +9 -4
  34. package/dist/cli/convoy/gates.d.ts.map +1 -1
  35. package/dist/cli/convoy/gates.js +29 -14
  36. package/dist/cli/convoy/gates.js.map +1 -1
  37. package/dist/cli/convoy/isolation.d.ts +32 -6
  38. package/dist/cli/convoy/isolation.d.ts.map +1 -1
  39. package/dist/cli/convoy/isolation.js +72 -34
  40. package/dist/cli/convoy/isolation.js.map +1 -1
  41. package/dist/cli/convoy/isolation.test.js +66 -42
  42. package/dist/cli/convoy/isolation.test.js.map +1 -1
  43. package/dist/cli/convoy/lock.d.ts.map +1 -1
  44. package/dist/cli/convoy/lock.js +25 -10
  45. package/dist/cli/convoy/lock.js.map +1 -1
  46. package/dist/cli/convoy/lock.test.js +12 -0
  47. package/dist/cli/convoy/lock.test.js.map +1 -1
  48. package/dist/cli/convoy/merge.d.ts +21 -4
  49. package/dist/cli/convoy/merge.d.ts.map +1 -1
  50. package/dist/cli/convoy/merge.js +69 -53
  51. package/dist/cli/convoy/merge.js.map +1 -1
  52. package/dist/cli/convoy/merge.test.js +23 -1
  53. package/dist/cli/convoy/merge.test.js.map +1 -1
  54. package/dist/cli/convoy/progress.d.ts +35 -0
  55. package/dist/cli/convoy/progress.d.ts.map +1 -0
  56. package/dist/cli/convoy/progress.js +103 -0
  57. package/dist/cli/convoy/progress.js.map +1 -0
  58. package/dist/cli/convoy/progress.test.d.ts +2 -0
  59. package/dist/cli/convoy/progress.test.d.ts.map +1 -0
  60. package/dist/cli/convoy/progress.test.js +53 -0
  61. package/dist/cli/convoy/progress.test.js.map +1 -0
  62. package/dist/cli/convoy/read-model.d.ts +468 -0
  63. package/dist/cli/convoy/read-model.d.ts.map +1 -0
  64. package/dist/cli/convoy/read-model.js +1132 -0
  65. package/dist/cli/convoy/read-model.js.map +1 -0
  66. package/dist/cli/convoy/read-model.test.d.ts +2 -0
  67. package/dist/cli/convoy/read-model.test.d.ts.map +1 -0
  68. package/dist/cli/convoy/read-model.test.js +609 -0
  69. package/dist/cli/convoy/read-model.test.js.map +1 -0
  70. package/dist/cli/convoy/redact.d.ts +34 -0
  71. package/dist/cli/convoy/redact.d.ts.map +1 -0
  72. package/dist/cli/convoy/redact.js +66 -0
  73. package/dist/cli/convoy/redact.js.map +1 -0
  74. package/dist/cli/convoy/redact.test.d.ts +2 -0
  75. package/dist/cli/convoy/redact.test.d.ts.map +1 -0
  76. package/dist/cli/convoy/redact.test.js +43 -0
  77. package/dist/cli/convoy/redact.test.js.map +1 -0
  78. package/dist/cli/convoy/reviewer.d.ts +65 -0
  79. package/dist/cli/convoy/reviewer.d.ts.map +1 -0
  80. package/dist/cli/convoy/reviewer.js +141 -0
  81. package/dist/cli/convoy/reviewer.js.map +1 -0
  82. package/dist/cli/convoy/reviewer.test.d.ts +2 -0
  83. package/dist/cli/convoy/reviewer.test.d.ts.map +1 -0
  84. package/dist/cli/convoy/reviewer.test.js +96 -0
  85. package/dist/cli/convoy/reviewer.test.js.map +1 -0
  86. package/dist/cli/convoy/schedule.d.ts +30 -0
  87. package/dist/cli/convoy/schedule.d.ts.map +1 -0
  88. package/dist/cli/convoy/schedule.js +111 -0
  89. package/dist/cli/convoy/schedule.js.map +1 -0
  90. package/dist/cli/convoy/schedule.test.d.ts +2 -0
  91. package/dist/cli/convoy/schedule.test.d.ts.map +1 -0
  92. package/dist/cli/convoy/schedule.test.js +45 -0
  93. package/dist/cli/convoy/schedule.test.js.map +1 -0
  94. package/dist/cli/convoy/spec-builder.d.ts +120 -30
  95. package/dist/cli/convoy/spec-builder.d.ts.map +1 -1
  96. package/dist/cli/convoy/spec-builder.js +438 -114
  97. package/dist/cli/convoy/spec-builder.js.map +1 -1
  98. package/dist/cli/convoy/spec-builder.test.js +419 -435
  99. package/dist/cli/convoy/spec-builder.test.js.map +1 -1
  100. package/dist/cli/convoy/spec-types.d.ts +46 -92
  101. package/dist/cli/convoy/spec-types.d.ts.map +1 -1
  102. package/dist/cli/convoy/store.d.ts +6 -1
  103. package/dist/cli/convoy/store.d.ts.map +1 -1
  104. package/dist/cli/convoy/store.js +111 -15
  105. package/dist/cli/convoy/store.js.map +1 -1
  106. package/dist/cli/convoy/store.test.js +59 -13
  107. package/dist/cli/convoy/store.test.js.map +1 -1
  108. package/dist/cli/convoy/types.d.ts +76 -113
  109. package/dist/cli/convoy/types.d.ts.map +1 -1
  110. package/dist/cli/convoy/types.js +6 -13
  111. package/dist/cli/convoy/types.js.map +1 -1
  112. package/dist/cli/convoy/worktree.d.ts +88 -3
  113. package/dist/cli/convoy/worktree.d.ts.map +1 -1
  114. package/dist/cli/convoy/worktree.js +282 -56
  115. package/dist/cli/convoy/worktree.js.map +1 -1
  116. package/dist/cli/convoy/worktree.test.js +132 -1
  117. package/dist/cli/convoy/worktree.test.js.map +1 -1
  118. package/dist/cli/convoy-args.test.js +9 -27
  119. package/dist/cli/convoy-args.test.js.map +1 -1
  120. package/dist/cli/convoy-cmd.d.ts +31 -6
  121. package/dist/cli/convoy-cmd.d.ts.map +1 -1
  122. package/dist/cli/convoy-cmd.js +150 -201
  123. package/dist/cli/convoy-cmd.js.map +1 -1
  124. package/dist/cli/convoy-cmd.test.d.ts +2 -0
  125. package/dist/cli/convoy-cmd.test.d.ts.map +1 -0
  126. package/dist/cli/convoy-cmd.test.js +144 -0
  127. package/dist/cli/convoy-cmd.test.js.map +1 -0
  128. package/dist/cli/dashboard.d.ts +24 -11
  129. package/dist/cli/dashboard.d.ts.map +1 -1
  130. package/dist/cli/dashboard.js +241 -303
  131. package/dist/cli/dashboard.js.map +1 -1
  132. package/dist/cli/dashboard.test.d.ts +2 -0
  133. package/dist/cli/dashboard.test.d.ts.map +1 -0
  134. package/dist/cli/dashboard.test.js +340 -0
  135. package/dist/cli/dashboard.test.js.map +1 -0
  136. package/dist/cli/dispatcher.test.js +35 -2
  137. package/dist/cli/dispatcher.test.js.map +1 -1
  138. package/dist/cli/docs-accuracy.test.js +3 -3
  139. package/dist/cli/docs-accuracy.test.js.map +1 -1
  140. package/dist/cli/log.d.ts +39 -0
  141. package/dist/cli/log.d.ts.map +1 -1
  142. package/dist/cli/log.js +267 -93
  143. package/dist/cli/log.js.map +1 -1
  144. package/dist/cli/log.test.d.ts +2 -0
  145. package/dist/cli/log.test.d.ts.map +1 -0
  146. package/dist/cli/log.test.js +208 -0
  147. package/dist/cli/log.test.js.map +1 -0
  148. package/dist/cli/nearest.d.ts +18 -0
  149. package/dist/cli/nearest.d.ts.map +1 -0
  150. package/dist/cli/nearest.js +38 -0
  151. package/dist/cli/nearest.js.map +1 -0
  152. package/dist/cli/nearest.test.d.ts +2 -0
  153. package/dist/cli/nearest.test.d.ts.map +1 -0
  154. package/dist/cli/nearest.test.js +24 -0
  155. package/dist/cli/nearest.test.js.map +1 -0
  156. package/dist/cli/pipeline.d.ts +61 -0
  157. package/dist/cli/pipeline.d.ts.map +1 -1
  158. package/dist/cli/pipeline.flow.test.d.ts +2 -0
  159. package/dist/cli/pipeline.flow.test.d.ts.map +1 -0
  160. package/dist/cli/pipeline.flow.test.js +524 -0
  161. package/dist/cli/pipeline.flow.test.js.map +1 -0
  162. package/dist/cli/pipeline.js +471 -690
  163. package/dist/cli/pipeline.js.map +1 -1
  164. package/dist/cli/plan.d.ts +82 -31
  165. package/dist/cli/plan.d.ts.map +1 -1
  166. package/dist/cli/plan.js +167 -507
  167. package/dist/cli/plan.js.map +1 -1
  168. package/dist/cli/plan.test.d.ts +2 -0
  169. package/dist/cli/plan.test.d.ts.map +1 -0
  170. package/dist/cli/plan.test.js +158 -0
  171. package/dist/cli/plan.test.js.map +1 -0
  172. package/dist/cli/run/adapters/agent-process.d.ts +82 -0
  173. package/dist/cli/run/adapters/agent-process.d.ts.map +1 -0
  174. package/dist/cli/run/adapters/agent-process.js +224 -0
  175. package/dist/cli/run/adapters/agent-process.js.map +1 -0
  176. package/dist/cli/run/adapters/agent-process.test.d.ts +2 -0
  177. package/dist/cli/run/adapters/agent-process.test.d.ts.map +1 -0
  178. package/dist/cli/run/adapters/agent-process.test.js +159 -0
  179. package/dist/cli/run/adapters/agent-process.test.js.map +1 -0
  180. package/dist/cli/run/adapters/claude.d.ts +53 -2
  181. package/dist/cli/run/adapters/claude.d.ts.map +1 -1
  182. package/dist/cli/run/adapters/claude.js +147 -171
  183. package/dist/cli/run/adapters/claude.js.map +1 -1
  184. package/dist/cli/run/adapters/claude.test.js +197 -254
  185. package/dist/cli/run/adapters/claude.test.js.map +1 -1
  186. package/dist/cli/run/adapters/codex.d.ts +25 -2
  187. package/dist/cli/run/adapters/codex.d.ts.map +1 -1
  188. package/dist/cli/run/adapters/codex.js +113 -81
  189. package/dist/cli/run/adapters/codex.js.map +1 -1
  190. package/dist/cli/run/adapters/codex.test.js +116 -95
  191. package/dist/cli/run/adapters/codex.test.js.map +1 -1
  192. package/dist/cli/run/adapters/copilot.d.ts +35 -1
  193. package/dist/cli/run/adapters/copilot.d.ts.map +1 -1
  194. package/dist/cli/run/adapters/copilot.js +104 -287
  195. package/dist/cli/run/adapters/copilot.js.map +1 -1
  196. package/dist/cli/run/adapters/copilot.test.js +122 -282
  197. package/dist/cli/run/adapters/copilot.test.js.map +1 -1
  198. package/dist/cli/run/adapters/cursor.d.ts +25 -7
  199. package/dist/cli/run/adapters/cursor.d.ts.map +1 -1
  200. package/dist/cli/run/adapters/cursor.js +103 -156
  201. package/dist/cli/run/adapters/cursor.js.map +1 -1
  202. package/dist/cli/run/adapters/cursor.test.js +106 -218
  203. package/dist/cli/run/adapters/cursor.test.js.map +1 -1
  204. package/dist/cli/run/adapters/index.d.ts +34 -5
  205. package/dist/cli/run/adapters/index.d.ts.map +1 -1
  206. package/dist/cli/run/adapters/index.js +147 -21
  207. package/dist/cli/run/adapters/index.js.map +1 -1
  208. package/dist/cli/run/adapters/index.test.d.ts +2 -0
  209. package/dist/cli/run/adapters/index.test.d.ts.map +1 -0
  210. package/dist/cli/run/adapters/index.test.js +129 -0
  211. package/dist/cli/run/adapters/index.test.js.map +1 -0
  212. package/dist/cli/run/adapters/opencode.d.ts +25 -9
  213. package/dist/cli/run/adapters/opencode.d.ts.map +1 -1
  214. package/dist/cli/run/adapters/opencode.js +136 -152
  215. package/dist/cli/run/adapters/opencode.js.map +1 -1
  216. package/dist/cli/run/adapters/opencode.test.js +99 -218
  217. package/dist/cli/run/adapters/opencode.test.js.map +1 -1
  218. package/dist/cli/run/adapters/permission-modes.d.ts +47 -4
  219. package/dist/cli/run/adapters/permission-modes.d.ts.map +1 -1
  220. package/dist/cli/run/adapters/permission-modes.js +113 -37
  221. package/dist/cli/run/adapters/permission-modes.js.map +1 -1
  222. package/dist/cli/run/adapters/permission-modes.test.js +55 -40
  223. package/dist/cli/run/adapters/permission-modes.test.js.map +1 -1
  224. package/dist/cli/run/adapters/stub-cli.test-helper.d.ts +22 -0
  225. package/dist/cli/run/adapters/stub-cli.test-helper.d.ts.map +1 -0
  226. package/dist/cli/run/adapters/stub-cli.test-helper.js +73 -0
  227. package/dist/cli/run/adapters/stub-cli.test-helper.js.map +1 -0
  228. package/dist/cli/run/platform.d.ts +52 -0
  229. package/dist/cli/run/platform.d.ts.map +1 -0
  230. package/dist/cli/run/platform.js +207 -0
  231. package/dist/cli/run/platform.js.map +1 -0
  232. package/dist/cli/run/platform.test.d.ts +2 -0
  233. package/dist/cli/run/platform.test.d.ts.map +1 -0
  234. package/dist/cli/run/platform.test.js +119 -0
  235. package/dist/cli/run/platform.test.js.map +1 -0
  236. package/dist/cli/run/schema.d.ts +6 -8
  237. package/dist/cli/run/schema.d.ts.map +1 -1
  238. package/dist/cli/run/schema.js +44 -68
  239. package/dist/cli/run/schema.js.map +1 -1
  240. package/dist/cli/run/schema.test.js +59 -279
  241. package/dist/cli/run/schema.test.js.map +1 -1
  242. package/dist/cli/run.d.ts +34 -56
  243. package/dist/cli/run.d.ts.map +1 -1
  244. package/dist/cli/run.js +379 -1132
  245. package/dist/cli/run.js.map +1 -1
  246. package/dist/cli/run.test.d.ts +2 -0
  247. package/dist/cli/run.test.d.ts.map +1 -0
  248. package/dist/cli/run.test.js +318 -0
  249. package/dist/cli/run.test.js.map +1 -0
  250. package/dist/cli/team-config.d.ts.map +1 -1
  251. package/dist/cli/team-config.js +2 -21
  252. package/dist/cli/team-config.js.map +1 -1
  253. package/dist/cli/tiers.test.js +4 -13
  254. package/dist/cli/tiers.test.js.map +1 -1
  255. package/package.json +3 -10
  256. package/src/cli/agent-roster.test.ts +0 -55
  257. package/src/cli/boundary.test.ts +9 -7
  258. package/src/cli/convoy/TELEMETRY.md +131 -125
  259. package/src/cli/convoy/artifacts.test.ts +4 -2
  260. package/src/cli/convoy/artifacts.ts +13 -12
  261. package/src/cli/convoy/engine.git.test.ts +462 -0
  262. package/src/cli/convoy/engine.test.ts +817 -850
  263. package/src/cli/convoy/engine.ts +1864 -2596
  264. package/src/cli/convoy/event-schemas.ts +63 -59
  265. package/src/cli/convoy/events.test.ts +58 -9
  266. package/src/cli/convoy/events.ts +69 -91
  267. package/src/cli/convoy/gates.ts +31 -12
  268. package/src/cli/convoy/isolation.test.ts +76 -43
  269. package/src/cli/convoy/isolation.ts +100 -38
  270. package/src/cli/convoy/lock.test.ts +16 -0
  271. package/src/cli/convoy/lock.ts +25 -8
  272. package/src/cli/convoy/merge.test.ts +25 -1
  273. package/src/cli/convoy/merge.ts +74 -61
  274. package/src/cli/convoy/progress.test.ts +59 -0
  275. package/src/cli/convoy/progress.ts +121 -0
  276. package/src/cli/convoy/read-model.test.ts +685 -0
  277. package/src/cli/convoy/read-model.ts +1469 -0
  278. package/src/cli/convoy/redact.test.ts +49 -0
  279. package/src/cli/convoy/redact.ts +73 -0
  280. package/src/cli/convoy/reviewer.test.ts +112 -0
  281. package/src/cli/convoy/reviewer.ts +196 -0
  282. package/src/cli/convoy/schedule.test.ts +56 -0
  283. package/src/cli/convoy/schedule.ts +109 -0
  284. package/src/cli/convoy/spec-builder.test.ts +460 -464
  285. package/src/cli/convoy/spec-builder.ts +460 -129
  286. package/src/cli/convoy/spec-types.ts +46 -108
  287. package/src/cli/convoy/store.test.ts +64 -13
  288. package/src/cli/convoy/store.ts +143 -33
  289. package/src/cli/convoy/types.ts +59 -71
  290. package/src/cli/convoy/worktree.test.ts +140 -1
  291. package/src/cli/convoy/worktree.ts +311 -61
  292. package/src/cli/convoy-args.test.ts +10 -30
  293. package/src/cli/convoy-cmd.test.ts +163 -0
  294. package/src/cli/convoy-cmd.ts +173 -216
  295. package/src/cli/dashboard/dashboard.css +2086 -0
  296. package/src/cli/dashboard/dashboard.js +1687 -0
  297. package/src/cli/dashboard/index.html +307 -0
  298. package/src/cli/dashboard.test.ts +382 -0
  299. package/src/cli/dashboard.ts +243 -339
  300. package/src/cli/dispatcher.test.ts +36 -2
  301. package/src/cli/docs-accuracy.test.ts +3 -3
  302. package/src/cli/log.test.ts +228 -0
  303. package/src/cli/log.ts +302 -83
  304. package/src/cli/nearest.test.ts +27 -0
  305. package/src/cli/nearest.ts +38 -0
  306. package/src/cli/pipeline.flow.test.ts +607 -0
  307. package/src/cli/pipeline.ts +544 -759
  308. package/src/cli/plan.test.ts +193 -0
  309. package/src/cli/plan.ts +209 -545
  310. package/src/cli/run/adapters/agent-process.test.ts +175 -0
  311. package/src/cli/run/adapters/agent-process.ts +252 -0
  312. package/src/cli/run/adapters/claude.test.ts +205 -260
  313. package/src/cli/run/adapters/claude.ts +151 -162
  314. package/src/cli/run/adapters/codex.test.ts +120 -100
  315. package/src/cli/run/adapters/codex.ts +115 -91
  316. package/src/cli/run/adapters/copilot.test.ts +135 -306
  317. package/src/cli/run/adapters/copilot.ts +105 -274
  318. package/src/cli/run/adapters/cursor.test.ts +111 -220
  319. package/src/cli/run/adapters/cursor.ts +105 -156
  320. package/src/cli/run/adapters/index.test.ts +148 -0
  321. package/src/cli/run/adapters/index.ts +168 -20
  322. package/src/cli/run/adapters/opencode.test.ts +106 -227
  323. package/src/cli/run/adapters/opencode.ts +139 -151
  324. package/src/cli/run/adapters/permission-modes.test.ts +63 -41
  325. package/src/cli/run/adapters/permission-modes.ts +118 -37
  326. package/src/cli/run/adapters/stub-cli.test-helper.ts +88 -0
  327. package/src/cli/run/platform.test.ts +128 -0
  328. package/src/cli/run/platform.ts +213 -0
  329. package/src/cli/run/schema.test.ts +62 -344
  330. package/src/cli/run/schema.ts +48 -78
  331. package/src/cli/run.test.ts +351 -0
  332. package/src/cli/run.ts +366 -1151
  333. package/src/cli/team-config.ts +2 -21
  334. package/src/cli/tiers.test.ts +4 -17
  335. package/src/orchestrator/agents/team-lead.agent.md +1 -1
  336. package/src/orchestrator/prompts/assess-complexity.prompt.md +43 -26
  337. package/src/orchestrator/prompts/brainstorm.prompt.md +1 -1
  338. package/src/orchestrator/prompts/bug-fix.prompt.md +2 -2
  339. package/src/orchestrator/prompts/fix-convoy.prompt.md +43 -29
  340. package/src/orchestrator/prompts/fix-prd.prompt.md +26 -22
  341. package/src/orchestrator/prompts/generate-convoy.prompt.md +139 -147
  342. package/src/orchestrator/prompts/generate-prd.prompt.md +75 -68
  343. package/src/orchestrator/prompts/implement-feature.prompt.md +2 -2
  344. package/src/orchestrator/prompts/validate-convoy.prompt.md +29 -28
  345. package/src/orchestrator/prompts/validate-prd.prompt.md +28 -21
  346. package/src/orchestrator/skills/agent-hooks/HOOKS-REFERENCE.md +3 -3
  347. package/src/orchestrator/skills/agent-hooks/SKILL.md +1 -1
  348. package/src/orchestrator/skills/fast-review/SKILL.md +3 -1
  349. package/src/orchestrator/skills/orchestration-protocols/SKILL.md +7 -8
  350. package/dist/cli/convoy/dag-analysis.d.ts +0 -39
  351. package/dist/cli/convoy/dag-analysis.d.ts.map +0 -1
  352. package/dist/cli/convoy/dag-analysis.js +0 -279
  353. package/dist/cli/convoy/dag-analysis.js.map +0 -1
  354. package/dist/cli/convoy/dag-analysis.test.d.ts +0 -2
  355. package/dist/cli/convoy/dag-analysis.test.d.ts.map +0 -1
  356. package/dist/cli/convoy/dag-analysis.test.js +0 -289
  357. package/dist/cli/convoy/dag-analysis.test.js.map +0 -1
  358. package/dist/cli/convoy/formula.d.ts +0 -19
  359. package/dist/cli/convoy/formula.d.ts.map +0 -1
  360. package/dist/cli/convoy/formula.js +0 -142
  361. package/dist/cli/convoy/formula.js.map +0 -1
  362. package/dist/cli/convoy/formula.test.d.ts +0 -2
  363. package/dist/cli/convoy/formula.test.d.ts.map +0 -1
  364. package/dist/cli/convoy/formula.test.js +0 -342
  365. package/dist/cli/convoy/formula.test.js.map +0 -1
  366. package/dist/cli/convoy/health.d.ts +0 -34
  367. package/dist/cli/convoy/health.d.ts.map +0 -1
  368. package/dist/cli/convoy/health.js +0 -123
  369. package/dist/cli/convoy/health.js.map +0 -1
  370. package/dist/cli/convoy/health.test.d.ts +0 -2
  371. package/dist/cli/convoy/health.test.d.ts.map +0 -1
  372. package/dist/cli/convoy/health.test.js +0 -448
  373. package/dist/cli/convoy/health.test.js.map +0 -1
  374. package/dist/cli/convoy/last-run.d.ts +0 -53
  375. package/dist/cli/convoy/last-run.d.ts.map +0 -1
  376. package/dist/cli/convoy/last-run.js +0 -54
  377. package/dist/cli/convoy/last-run.js.map +0 -1
  378. package/dist/cli/convoy/last-run.test.d.ts +0 -2
  379. package/dist/cli/convoy/last-run.test.d.ts.map +0 -1
  380. package/dist/cli/convoy/last-run.test.js +0 -110
  381. package/dist/cli/convoy/last-run.test.js.map +0 -1
  382. package/dist/cli/convoy/pipeline.d.ts +0 -41
  383. package/dist/cli/convoy/pipeline.d.ts.map +0 -1
  384. package/dist/cli/convoy/pipeline.js +0 -414
  385. package/dist/cli/convoy/pipeline.js.map +0 -1
  386. package/dist/cli/convoy/pipeline.test.d.ts +0 -2
  387. package/dist/cli/convoy/pipeline.test.d.ts.map +0 -1
  388. package/dist/cli/convoy/pipeline.test.js +0 -837
  389. package/dist/cli/convoy/pipeline.test.js.map +0 -1
  390. package/dist/cli/convoy/review-stages.d.ts +0 -9
  391. package/dist/cli/convoy/review-stages.d.ts.map +0 -1
  392. package/dist/cli/convoy/review-stages.js +0 -134
  393. package/dist/cli/convoy/review-stages.js.map +0 -1
  394. package/dist/cli/convoy/review-stages.test.d.ts +0 -2
  395. package/dist/cli/convoy/review-stages.test.d.ts.map +0 -1
  396. package/dist/cli/convoy/review-stages.test.js +0 -197
  397. package/dist/cli/convoy/review-stages.test.js.map +0 -1
  398. package/dist/cli/run/executor.d.ts +0 -15
  399. package/dist/cli/run/executor.d.ts.map +0 -1
  400. package/dist/cli/run/executor.js +0 -249
  401. package/dist/cli/run/executor.js.map +0 -1
  402. package/dist/cli/run/executor.test.d.ts +0 -2
  403. package/dist/cli/run/executor.test.d.ts.map +0 -1
  404. package/dist/cli/run/executor.test.js +0 -297
  405. package/dist/cli/run/executor.test.js.map +0 -1
  406. package/dist/cli/run/reporter.d.ts +0 -10
  407. package/dist/cli/run/reporter.d.ts.map +0 -1
  408. package/dist/cli/run/reporter.js +0 -142
  409. package/dist/cli/run/reporter.js.map +0 -1
  410. package/dist/cli/run-dry-run.test.d.ts +0 -2
  411. package/dist/cli/run-dry-run.test.d.ts.map +0 -1
  412. package/dist/cli/run-dry-run.test.js +0 -83
  413. package/dist/cli/run-dry-run.test.js.map +0 -1
  414. package/dist/cli/run-executor-flags.test.d.ts +0 -2
  415. package/dist/cli/run-executor-flags.test.d.ts.map +0 -1
  416. package/dist/cli/run-executor-flags.test.js +0 -31
  417. package/dist/cli/run-executor-flags.test.js.map +0 -1
  418. package/dist/cli/run-finish.test.d.ts +0 -2
  419. package/dist/cli/run-finish.test.d.ts.map +0 -1
  420. package/dist/cli/run-finish.test.js +0 -77
  421. package/dist/cli/run-finish.test.js.map +0 -1
  422. package/dist/cli/watch.d.ts +0 -15
  423. package/dist/cli/watch.d.ts.map +0 -1
  424. package/dist/cli/watch.js +0 -277
  425. package/dist/cli/watch.js.map +0 -1
  426. package/dist/dashboard/scripts/etl.d.ts +0 -10
  427. package/dist/dashboard/scripts/etl.d.ts.map +0 -1
  428. package/dist/dashboard/scripts/etl.js +0 -141
  429. package/dist/dashboard/scripts/etl.js.map +0 -1
  430. package/src/cli/convoy/dag-analysis.test.ts +0 -349
  431. package/src/cli/convoy/dag-analysis.ts +0 -367
  432. package/src/cli/convoy/formula.test.ts +0 -404
  433. package/src/cli/convoy/formula.ts +0 -174
  434. package/src/cli/convoy/health.test.ts +0 -519
  435. package/src/cli/convoy/health.ts +0 -189
  436. package/src/cli/convoy/last-run.test.ts +0 -130
  437. package/src/cli/convoy/last-run.ts +0 -87
  438. package/src/cli/convoy/pipeline.test.ts +0 -999
  439. package/src/cli/convoy/pipeline.ts +0 -492
  440. package/src/cli/convoy/review-stages.test.ts +0 -235
  441. package/src/cli/convoy/review-stages.ts +0 -166
  442. package/src/cli/run/executor.test.ts +0 -338
  443. package/src/cli/run/executor.ts +0 -292
  444. package/src/cli/run/reporter.ts +0 -160
  445. package/src/cli/run-dry-run.test.ts +0 -97
  446. package/src/cli/run-executor-flags.test.ts +0 -38
  447. package/src/cli/run-finish.test.ts +0 -91
  448. package/src/cli/watch.ts +0 -295
  449. package/src/dashboard/astro.config.mjs +0 -6
  450. package/src/dashboard/dist/_astro/index.CADNhRPS.css +0 -1
  451. package/src/dashboard/dist/data/.gitkeep +0 -0
  452. package/src/dashboard/dist/data/convoy-list.json +0 -1
  453. package/src/dashboard/dist/data/overall-stats.json +0 -29
  454. package/src/dashboard/dist/index.html +0 -1963
  455. package/src/dashboard/node_modules/.vite/deps/_metadata.json +0 -31
  456. package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js +0 -6776
  457. package/src/dashboard/node_modules/.vite/deps/astro___aria-query.js.map +0 -7
  458. package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js +0 -3754
  459. package/src/dashboard/node_modules/.vite/deps/astro___axobject-query.js.map +0 -7
  460. package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js +0 -99
  461. package/src/dashboard/node_modules/.vite/deps/astro___cssesc.js.map +0 -7
  462. package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js +0 -8
  463. package/src/dashboard/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +0 -7
  464. package/src/dashboard/node_modules/.vite/deps/package.json +0 -3
  465. package/src/dashboard/package-lock.json +0 -6
  466. package/src/dashboard/public/data/.gitkeep +0 -0
  467. package/src/dashboard/public/data/convoy-list.json +0 -1
  468. package/src/dashboard/public/data/overall-stats.json +0 -29
  469. package/src/dashboard/public/icon-192.png +0 -0
  470. package/src/dashboard/scripts/etl.test.ts +0 -166
  471. package/src/dashboard/scripts/etl.ts +0 -170
  472. package/src/dashboard/scripts/generate-demo-db.test.ts +0 -30
  473. package/src/dashboard/scripts/generate-demo-db.ts +0 -529
  474. package/src/dashboard/scripts/integration-test.ts +0 -504
  475. package/src/dashboard/scripts/verify-demo-data.sh +0 -51
  476. package/src/dashboard/seed-data/delegations.ndjson +0 -35
  477. package/src/dashboard/seed-data/events.ndjson +0 -104
  478. package/src/dashboard/seed-data/panels.ndjson +0 -13
  479. package/src/dashboard/seed-data/reviews.ndjson +0 -6
  480. package/src/dashboard/seed-data/sessions.ndjson +0 -50
  481. package/src/dashboard/src/env.d.ts +0 -1
  482. package/src/dashboard/src/layouts/Layout.astro +0 -25
  483. package/src/dashboard/src/pages/index.astro +0 -2313
  484. package/src/dashboard/src/styles/dashboard.css +0 -2943
  485. package/src/dashboard/tsconfig.json +0 -6
  486. /package/src/{dashboard/dist → cli/dashboard}/icon-192.png +0 -0
@@ -52,11 +52,11 @@ describe('positionalWords', () => {
52
52
  expect(positionalWords(['--json'])).toEqual([]);
53
53
  });
54
54
  it('treats a value that looks like a word as a value, not a task word', () => {
55
- expect(positionalWords(['--permission-mode', 'plan', 'do', 'work'])).toEqual(['do', 'work']);
55
+ expect(positionalWords(['--concurrency', '3', 'do', 'work'])).toEqual(['do', 'work']);
56
56
  });
57
57
  });
58
58
  describe('the task the planner is given', () => {
59
- /** What the dispatcher passes to `pipeline` as `--text`. */
59
+ /** What the dispatcher hands the planner as the task. */
60
60
  const taskText = (args) => positionalWords(args).join(' ');
61
61
  it('reassembles an unquoted request in order', () => {
62
62
  expect(taskText(['add', 'rate', 'limiting', 'to', 'the', 'API'])).toBe('add rate limiting to the API');
@@ -71,27 +71,6 @@ describe('the task the planner is given', () => {
71
71
  expect(taskText(['refactor', '--verbose', 'the', 'auth', 'module'])).toBe(want);
72
72
  });
73
73
  });
74
- describe('status words stay a status query', () => {
75
- /** The dispatcher's rule: a status word alone, with no other words after it. */
76
- const STATUS_WORDS = ['status', 'state', 'info', 'ls', 'list'];
77
- const isStatusQuery = (args) => {
78
- const words = positionalWords(args);
79
- return words.length === 1 && STATUS_WORDS.includes(words[0]);
80
- };
81
- it('treats a bare status word as a status query', () => {
82
- for (const w of STATUS_WORDS)
83
- expect(isStatusQuery([w])).toBe(true);
84
- });
85
- it('still does so when flags accompany it', () => {
86
- expect(isStatusQuery(['status', '--json'])).toBe(true);
87
- });
88
- it('treats a status word that opens a sentence as a task', () => {
89
- // "status" alone means "where do things stand"; "status page for the admin"
90
- // is a feature, and planning it must not be hijacked.
91
- expect(isStatusQuery(['status', 'page', 'for', 'the', 'admin'])).toBe(false);
92
- expect(isStatusQuery(['list', 'all', 'users', 'in', 'the', 'dashboard'])).toBe(false);
93
- });
94
- });
95
74
  describe('splitTaskFlags', () => {
96
75
  it('forwards a flag the planner reads, with its value', () => {
97
76
  // The defect: --adapter was dropped, and the run used the auto-detected
@@ -115,14 +94,17 @@ describe('splitTaskFlags', () => {
115
94
  it('reports a misspelled flag rather than running without it', () => {
116
95
  expect(splitTaskFlags(['add', 'caching', '--adaptr', 'codex']).unknown).toEqual(['--adaptr']);
117
96
  });
118
- it('does not mistake an unknown flag value for another unknown flag', () => {
119
- expect(splitTaskFlags(['x', '--report-dir', 'out']).unknown).toEqual(['--report-dir']);
97
+ it('reports a removed flag rather than forwarding it', () => {
98
+ expect(splitTaskFlags(['x', '--skip-validation']).unknown).toEqual(['--skip-validation']);
99
+ });
100
+ it('does not mistake a flag value for another unknown flag', () => {
101
+ expect(splitTaskFlags(['x', '--prd', 'out', '--nope']).unknown).toEqual(['--prd', '--nope']);
120
102
  });
121
103
  it('forwards several flags at once, keeping order', () => {
122
104
  const { forward, unknown } = splitTaskFlags([
123
- 'build', 'it', '--verbose', '--adapter', 'codex', '--skip-validation',
105
+ 'build', 'it', '--verbose', '--adapter', 'codex', '--yes', '-c', '2',
124
106
  ]);
125
- expect(forward).toEqual(['--verbose', '--adapter', 'codex', '--skip-validation']);
107
+ expect(forward).toEqual(['--verbose', '--adapter', 'codex', '--yes', '-c', '2']);
126
108
  expect(unknown).toEqual([]);
127
109
  });
128
110
  it('finds nothing to forward or refuse in a bare task', () => {
@@ -1 +1 @@
1
- {"version":3,"file":"convoy-args.test.js","sourceRoot":"","sources":["../../src/cli/convoy-args.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEjE,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC/E,KAAK;YACL,MAAM;YACN,UAAU;YACV,IAAI;YACJ,KAAK;YACL,KAAK;SACN,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,CAAC,eAAe,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAC/E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,eAAe,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,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AO,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;QAChF,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IAClF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -4,12 +4,8 @@ import type { CliContext } from './types.js';
4
4
  *
5
5
  * A shell splits an unquoted task into one argument per word, and this command
6
6
  * used to read only the first of them: `opencastle convoy add rate limiting to
7
- * the API` planned a feature called "add". No error — it went on to spend a full
8
- * PRD round-trip on the wrong request, and the quoted form that works is the
9
- * only one our own "Start one:" hint shows.
10
- *
11
- * Flag values come out with their flag, so `--adapter codex` cannot contribute
12
- * the word "codex" to a task description.
7
+ * the API` planned a feature called "add". Flag values come out with their
8
+ * flag, so `--adapter codex` cannot add the word "codex" to a task.
13
9
  */
14
10
  export declare function positionalWords(args: string[]): string[];
15
11
  /**
@@ -24,5 +20,34 @@ export declare function splitTaskFlags(args: string[]): {
24
20
  forward: string[];
25
21
  unknown: string[];
26
22
  };
23
+ export interface LastRun {
24
+ id: string;
25
+ name: string;
26
+ status: string;
27
+ branch: string | null;
28
+ created_at: string;
29
+ /** A process is working on it now. */
30
+ alive: boolean;
31
+ total: number;
32
+ done: number;
33
+ /** Every failed status: failed, gate-failed, timed-out, review-blocked, disputed, hook-failed. */
34
+ failed: number;
35
+ running: number;
36
+ skipped: number;
37
+ pending: number;
38
+ /** The one command to run next. */
39
+ next: string;
40
+ /** An older run with work left, when this one has none: what `resume` would continue. */
41
+ older_unfinished: {
42
+ id: string;
43
+ name: string;
44
+ } | null;
45
+ }
46
+ /**
47
+ * The last run, from the read model: the database is opened read-only, never
48
+ * migrated, and closed again. The status screen used to open the read-write
49
+ * store, which migrated an older project's database just to look at it.
50
+ */
51
+ export declare function readLastRun(projectRoot: string): LastRun | null;
27
52
  export default function convoy(ctx: CliContext): Promise<void>;
28
53
  //# sourceMappingURL=convoy-cmd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"convoy-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/convoy-cmd.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AA+F5C;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWxD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAgBvF;AAiHD,wBAA8B,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAiGnE"}
1
+ {"version":3,"file":"convoy-cmd.d.ts","sourceRoot":"","sources":["../../src/cli/convoy-cmd.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAyD5C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWxD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAgBvF;AAMD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,yFAAyF;IACzF,gBAAgB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACtD;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CA2B/D;AAgED,wBAA8B,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAoFnE"}
@@ -1,43 +1,40 @@
1
- import { resolve } from 'node:path';
2
- import { existsSync } from 'node:fs';
3
- import { createConvoyStore } from './convoy/store.js';
4
- import { selectLastRun } from './convoy/last-run.js';
1
+ import { findProjectRoot, readRun, readRuns } from './convoy/read-model.js';
2
+ import { nearest } from './nearest.js';
5
3
  import { c } from './prompt.js';
6
4
  /**
7
5
  * The experimental `convoy` namespace.
8
6
  *
9
- * Convoy execution used to occupy four top-level commands (start, plan,
10
- * validate, run) plus a 20-flag arg parser inside `run` that bundled status
11
- * reporting, resume, retry, and three DLQ verbs. All of that is state the tool
12
- * can read for itself, so the surface here is: name a task to start one, or run
13
- * it bare to see where the last one stands and what to do about it.
7
+ * Name a task to plan and run it, run a spec you wrote, continue what is not
8
+ * done, or watch it live. Run it bare to see where the last run stands and the
9
+ * one thing to do next. Everything else that used to live here — a status
10
+ * flag, retry and dead-letter verbs, watch mode, formulas — is state the tool
11
+ * can read for itself, so it is gone.
14
12
  */
15
13
  const CONVOY_HELP = `
16
14
  opencastle convoy [task] [options]
17
15
 
18
- Experimental: run multi-step work through the convoy engine.
16
+ Experimental: plan multi-step work and run it with agents in parallel.
19
17
 
20
18
  Usage:
21
- opencastle convoy Show the last run and what to do next
22
- opencastle convoy "<task>" Plan and execute a task
23
- opencastle convoy plan --prd <path> Resume from a PRD written earlier
24
- opencastle convoy resume Continue the last interrupted run
25
- opencastle convoy retry Re-run the failed tasks of the last run
26
- opencastle convoy dashboard Open the run viewer
27
- opencastle convoy run -f <spec> Execute a spec you wrote by hand
19
+ opencastle convoy The last run and the one next step
20
+ opencastle convoy "<task>" Plan it, show the plan, ask, then run it
21
+ opencastle convoy run <spec.yml> Run a spec you wrote
22
+ opencastle convoy resume Continue whatever is not done
23
+ opencastle convoy dashboard The Observability dashboard, live
24
+ opencastle convoy plan --prd <file> Plan again from a PRD you edited
28
25
 
29
26
  Options:
30
- --dry-run With a task: print the first planning prompt and stop.
31
- With run: show the execution plan
32
- --verbose Stream agent output
33
- --adapter, -a <name> Agent runtime to plan and run with
34
- --skip-validation Skip PRD and spec validation passes
35
- --json Machine-readable status
36
- --help, -h Show this help
27
+ --yes, -y With a task: run the plan without asking
28
+ --dry-run With a task: plan and write the spec, but do not run it.
29
+ With run or resume: show what would run
30
+ --adapter, -a <name> Agent runtime (default: the one opencastle init set up)
31
+ --concurrency, -c <n> Tasks at once
32
+ --verbose Stream agent output
33
+ --json With no task: the last run, as JSON
34
+ --help, -h Show this help
37
35
 
38
- run and plan take their own options — try: opencastle convoy run --help
39
-
40
- This namespace is experimental and may change or be removed.
36
+ Every subcommand has its own --help. This namespace is experimental and may
37
+ change.
41
38
  `;
42
39
  /**
43
40
  * Flags that take a separate value token.
@@ -49,60 +46,18 @@ const CONVOY_HELP = `
49
46
  * `bin/cli.mjs` has already split any `--flag=value` form before this runs, so
50
47
  * only the space form reaches here.
51
48
  */
52
- const FLAGS_WITH_VALUES = new Set([
53
- '--adapter',
54
- '-a',
55
- '--file',
56
- '-f',
57
- '--prd',
58
- '--complexity',
59
- '--output-prd',
60
- '--output-spec',
61
- '--concurrency',
62
- '-c',
63
- '--permission-mode',
64
- '--report-dir',
65
- '--formula',
66
- '--set',
67
- '--watch-config',
68
- '--convoy',
69
- '--resolution',
70
- ]);
71
- /**
72
- * Flags the planner reads, forwarded from the task path.
73
- *
74
- * `opencastle convoy "add rate limiting" --adapter codex` used to run on the
75
- * auto-detected adapter and say nothing: the task path kept an allowlist of two
76
- * flags and silently discarded everything else. A flag that is accepted and
77
- * ignored is the defect `bin/cli.mjs` refuses unknown options to prevent, and
78
- * its comment exempts `convoy` on the grounds that this file validates its own
79
- * input — which, on this path, it did not.
80
- *
81
- * `--text` is not here because the task itself supplies it, and `--prd` is not
82
- * because `SUBCOMMAND_FLAGS` sends it to `convoy plan` with a pointer.
83
- */
84
- const TASK_FLAGS = new Set([
85
- '--adapter',
86
- '-a',
87
- '--verbose',
88
- '--dry-run',
89
- '--dryRun',
90
- '--skip-validation',
91
- '--complexity',
92
- '--output-prd',
93
- '--output-spec',
94
- ]);
49
+ const FLAGS_WITH_VALUES = new Set(['--adapter', '-a', '--concurrency', '-c', '--file', '-f', '--prd']);
50
+ /** Flags the planner reads, forwarded from the task path. */
51
+ const TASK_FLAGS = new Set(['--yes', '-y', '--dry-run', '--adapter', '-a', '--concurrency', '-c', '--verbose']);
52
+ /** What a mistyped word is checked against. `retry` still works, but is not suggested. */
53
+ const SUBCOMMANDS = ['run', 'resume', 'dashboard', 'plan'];
95
54
  /**
96
55
  * The words of the task, with the flags and their values taken out.
97
56
  *
98
57
  * A shell splits an unquoted task into one argument per word, and this command
99
58
  * used to read only the first of them: `opencastle convoy add rate limiting to
100
- * the API` planned a feature called "add". No error — it went on to spend a full
101
- * PRD round-trip on the wrong request, and the quoted form that works is the
102
- * only one our own "Start one:" hint shows.
103
- *
104
- * Flag values come out with their flag, so `--adapter codex` cannot contribute
105
- * the word "codex" to a task description.
59
+ * the API` planned a feature called "add". Flag values come out with their
60
+ * flag, so `--adapter codex` cannot add the word "codex" to a task.
106
61
  */
107
62
  export function positionalWords(args) {
108
63
  const out = [];
@@ -145,180 +100,174 @@ export function splitTaskFlags(args) {
145
100
  }
146
101
  return { forward, unknown };
147
102
  }
148
- /** Delegate to an existing command module, passing through remaining args. */
149
- async function delegate(mod, ctx, args) {
150
- const loaded = (await import(`./${mod}.js`));
151
- await loaded.default({ ...ctx, args });
103
+ // ── Status ────────────────────────────────────────────────────────────────────
104
+ const FAILED_STATUSES = new Set(['failed', 'gate-failed', 'timed-out', 'review-blocked', 'disputed', 'hook-failed']);
105
+ function unfinished(run) {
106
+ return run.status !== 'done' || run.tasks_done < run.tasks_total;
152
107
  }
153
108
  /**
154
- * The same run `opencastle convoy resume` would continue.
155
- *
156
- * Read through `selectLastRun` rather than `getLatestConvoy`, which is what this
157
- * used to call. The two answers differed whenever a project had run a pipeline:
158
- * this screen named the newest convoy and advised `resume`, and `resume` then
159
- * reopened the pipeline instead. Advice that names a different run than the
160
- * command acts on is worse than no advice.
109
+ * The last run, from the read model: the database is opened read-only, never
110
+ * migrated, and closed again. The status screen used to open the read-write
111
+ * store, which migrated an older project's database just to look at it.
161
112
  */
162
- function readLastRun(projectRoot) {
163
- const dbPath = resolve(projectRoot, '.opencastle', 'convoy.db');
164
- if (!existsSync(dbPath))
165
- return null;
166
- let store;
167
- try {
168
- store = createConvoyStore(dbPath);
169
- }
170
- catch {
171
- return null;
172
- }
173
- try {
174
- const last = selectLastRun(store);
175
- if (!last)
176
- return null;
177
- // A pipeline's progress is the progress of every convoy in it, so the counts
178
- // come from all of them rather than from a single spec's task list.
179
- const convoyIds = last.kind === 'pipeline'
180
- ? store.getConvoysByPipeline(last.record.id).map((c) => c.id)
181
- : [last.record.id];
182
- const tasks = convoyIds.flatMap((id) => store.getTasksByConvoy(id));
183
- return {
184
- id: last.record.id,
185
- name: last.record.name,
186
- status: last.record.status,
187
- kind: last.kind,
188
- total: tasks.length,
189
- done: tasks.filter((t) => t.status === 'done').length,
190
- failed: tasks.filter((t) => t.status === 'failed' || t.status === 'gate-failed').length,
191
- pending: tasks.filter((t) => t.status === 'pending' || t.status === 'assigned').length,
192
- };
193
- }
194
- catch {
113
+ export function readLastRun(projectRoot) {
114
+ const runs = readRuns(projectRoot, 200);
115
+ if (runs.length === 0)
195
116
  return null;
196
- }
197
- finally {
198
- try {
199
- store.close();
200
- }
201
- catch { /* already closed */ }
202
- }
117
+ const last = runs[0];
118
+ const tasks = readRun(projectRoot, last.id)?.tasks ?? [];
119
+ const count = (pick) => tasks.filter((t) => pick(t.status)).length;
120
+ const done = count((s) => s === 'done');
121
+ // Not done is not done: skipped and running tasks count against "finished"
122
+ // as much as failed ones do, and the run's own status is not trusted to say so.
123
+ const notDone = last.status !== 'done' || done < tasks.length;
124
+ const older = notDone ? undefined : runs.slice(1).find(unfinished);
125
+ return {
126
+ id: last.id,
127
+ name: last.name,
128
+ status: last.status,
129
+ branch: last.branch,
130
+ created_at: last.created_at,
131
+ alive: last.alive,
132
+ total: tasks.length,
133
+ done,
134
+ failed: count((s) => FAILED_STATUSES.has(s)),
135
+ running: count((s) => s === 'running' || s === 'assigned'),
136
+ skipped: count((s) => s === 'skipped'),
137
+ pending: count((s) => s === 'pending'),
138
+ next: last.alive ? 'opencastle convoy dashboard' : notDone ? 'opencastle convoy resume' : 'opencastle convoy "<task>"',
139
+ older_unfinished: older ? { id: older.id, name: older.name } : null,
140
+ };
203
141
  }
204
- /** Bare `convoy`: report the last run and offer the verb that fits its state. */
142
+ /** Bare `convoy`: report the last run and the one verb that fits its state. */
205
143
  function renderStatus(last, json) {
206
144
  if (json) {
207
145
  console.log(JSON.stringify(last, null, 2));
208
146
  return;
209
147
  }
148
+ console.log(`\n 🚚 ${c.bold('Convoy')} ${c.dim('(experimental)')}\n`);
210
149
  if (!last) {
211
- console.log(`\n 🚚 ${c.bold('Convoy')} ${c.dim('(experimental)')}\n`);
212
150
  console.log(' No runs yet.\n');
213
151
  console.log(` ${c.bold('Start one:')} ${c.cyan('opencastle convoy "add rate limiting to the API"')}\n`);
214
152
  return;
215
153
  }
216
- const mark = last.status === 'done' ? c.green('✓') : last.status === 'running' ? c.cyan('▶') : c.yellow('!');
217
- console.log(`\n 🚚 ${c.bold('Convoy')} ${c.dim('(experimental)')}\n`);
218
- console.log(` ${mark} ${c.bold(last.name)} ${c.dim(`— ${last.status}`)}` +
219
- (last.kind === 'pipeline' ? c.dim(' (pipeline)') : ''));
220
- console.log(` ${last.done}/${last.total} done` +
221
- (last.failed ? c.yellow(`, ${last.failed} failed`) : '') +
222
- (last.pending ? c.dim(`, ${last.pending} pending`) : ''));
154
+ const resumable = last.next === 'opencastle convoy resume';
155
+ const mark = last.alive ? c.cyan('▶') : resumable ? c.yellow('!') : c.green('✓');
156
+ const state = last.alive ? 'running now' : last.status;
157
+ console.log(` ${mark} ${c.bold(last.name)} ${c.dim(`— ${state}`)}`);
158
+ const parts = [`${last.done}/${last.total} done`];
159
+ if (last.failed)
160
+ parts.push(c.yellow(`${last.failed} failed`));
161
+ if (last.skipped)
162
+ parts.push(c.yellow(`${last.skipped} skipped`));
163
+ if (last.running)
164
+ parts.push(`${last.running} running`);
165
+ if (last.pending)
166
+ parts.push(c.dim(`${last.pending} pending`));
167
+ console.log(` ${parts.join(', ')}`);
168
+ if (last.branch)
169
+ console.log(` ${c.dim('Branch')} ${last.branch}`);
223
170
  console.log('');
224
- // `retry` reopens the failed tasks of a single convoy. A pipeline is a chain
225
- // of them, and `resume` is what carries the chain on past a failed link — so
226
- // advising `retry` here named a verb that would have run one link in isolation.
227
- if (last.failed > 0 && last.kind === 'convoy') {
228
- console.log(` ${c.bold('Next:')} ${c.cyan('opencastle convoy retry')}`);
229
- console.log(` ${c.dim('re-runs only the failed tasks')}`);
230
- }
231
- else if (last.failed > 0 || last.pending > 0 || last.status === 'running') {
232
- console.log(` ${c.bold('Next:')} ${c.cyan('opencastle convoy resume')}`);
233
- console.log(` ${c.dim('continues from the last checkpoint')}`);
234
- }
235
- else {
236
- console.log(` ${c.dim('Nothing outstanding. Start another with')} ${c.cyan('opencastle convoy "<task>"')}`);
171
+ const why = last.alive
172
+ ? 'watch it live'
173
+ : resumable
174
+ ? 'runs what is not done — failed, interrupted and skipped tasks — and keeps the rest'
175
+ : 'every task is done; start another';
176
+ console.log(` ${c.bold('Next:')} ${c.cyan(last.next)}`);
177
+ console.log(` ${c.dim(why)}`);
178
+ if (last.older_unfinished) {
179
+ console.log(` ${c.dim(`An earlier run, ${last.older_unfinished.name}, has work left; opencastle convoy resume continues it.`)}`);
237
180
  }
238
181
  console.log('');
239
182
  }
183
+ // ── Dispatch ──────────────────────────────────────────────────────────────────
184
+ /** Hand the arguments to another command module. */
185
+ async function delegate(mod, ctx, args) {
186
+ const loaded = (await import(`./${mod}.js`));
187
+ await loaded.default({ ...ctx, args });
188
+ }
189
+ function refuse(message, hint) {
190
+ console.error(` ${c.red('✗')} ${message}`);
191
+ if (hint)
192
+ console.error(` ${c.dim(hint)}`);
193
+ process.exit(1);
194
+ }
195
+ /** An unknown flag, named with what replaced it when it is one we removed, or the nearest one we have. */
196
+ async function unknownFlag(flag, candidates) {
197
+ const { REMOVED_FLAGS } = await import('./run.js');
198
+ if (flag in REMOVED_FLAGS)
199
+ return `${flag} was removed. ${REMOVED_FLAGS[flag]}.`;
200
+ const near = nearest(flag, candidates);
201
+ return `Unknown option ${flag}.${near ? ` Did you mean ${near}?` : ''}`;
202
+ }
240
203
  export default async function convoy(ctx) {
241
204
  const { args } = ctx;
242
205
  const [sub, ...rest] = args;
243
- // `convoy --help` is ours; `convoy plan --help` belongs to the subcommand, which
244
- // is where its flags are actually documented.
245
- const wantsHelp = args.includes('--help') || args.includes('-h');
246
- if (wantsHelp && (sub === undefined || sub === '--help' || sub === '-h')) {
247
- console.log(CONVOY_HELP);
248
- return;
249
- }
250
- const positionals = positionalWords(args);
251
206
  switch (sub) {
252
- case undefined:
253
- renderStatus(readLastRun(process.cwd()), false);
207
+ case 'run':
208
+ await delegate('run', ctx, rest);
254
209
  return;
255
210
  case 'resume':
256
- await delegate('run', ctx, ['--resume', ...rest]);
257
- return;
258
- case 'retry':
259
- await delegate('run', ctx, ['--retry-failed', ...rest]);
211
+ // `retry` is what this was called before resume did everything it did.
212
+ case 'retry': {
213
+ const { resume } = await import('./run.js');
214
+ await resume({ ...ctx, args: rest });
260
215
  return;
216
+ }
261
217
  case 'dashboard':
262
218
  await delegate('dashboard', ctx, rest);
263
219
  return;
264
- case 'run':
265
- // Explicit spec execution, for a .convoy.yml written by hand or by the planner.
266
- await delegate('run', ctx, rest);
267
- return;
268
220
  case 'plan':
269
- // The planner writes a PRD before it writes a spec, and tells you where. Without
270
- // this there was no command that would take that PRD back — the advice dead-ended.
221
+ // The only way to plan again from a PRD someone edited.
271
222
  await delegate('pipeline', ctx, rest);
272
223
  return;
273
224
  default:
274
225
  break;
275
226
  }
276
- // A bare flag set with no subcommand is a status query — but only for flags
277
- // this level actually reads. `--file` and `--prd` belong to `run` and `plan`,
278
- // and falling into the status screen meant `convoy --file spec.yml` printed
279
- // "No runs yet" and exited without reading the file, or looking for it: the
280
- // value was never touched, so a path that did not exist produced no error. Our
281
- // own shipped instructions named that form.
227
+ // `convoy --help` is ours; `convoy run --help` belongs to the subcommand.
228
+ if (args.includes('--help') || args.includes('-h')) {
229
+ console.log(CONVOY_HELP);
230
+ return;
231
+ }
232
+ // A flag that belongs to a subcommand used at this level would otherwise
233
+ // be read as part of a task, or dropped.
282
234
  const SUBCOMMAND_FLAGS = new Map([
283
235
  ['--file', 'run'],
284
236
  ['-f', 'run'],
285
237
  ['--prd', 'plan'],
286
- ['--resume', 'resume'],
287
- ['--retry-failed', 'retry'],
288
238
  ]);
289
239
  const misplaced = args.find((a) => SUBCOMMAND_FLAGS.has(a));
290
240
  if (misplaced) {
291
241
  const owner = SUBCOMMAND_FLAGS.get(misplaced);
292
- console.error(` ${c.red('✗')} ${misplaced} belongs to \`opencastle convoy ${owner}\`.`);
293
- console.error(` ${c.dim('Try:')} opencastle convoy ${owner} ${args.slice(args.indexOf(misplaced)).join(' ')}`);
294
- process.exit(1);
242
+ refuse(`${misplaced} belongs to \`opencastle convoy ${owner}\`.`, `Try: opencastle convoy ${owner} ${args.slice(args.indexOf(misplaced)).join(' ')}`);
295
243
  }
296
- if (sub.startsWith('--')) {
297
- renderStatus(readLastRun(process.cwd()), args.includes('--json'));
244
+ const words = positionalWords(args);
245
+ if (words.length === 0) {
246
+ // Flags alone: the status screen, which reads only --json.
247
+ const stray = args.find((a) => a.startsWith('-') && a !== '--json');
248
+ if (stray) {
249
+ refuse(TASK_FLAGS.has(stray) ? `${stray} goes with a task: opencastle convoy "<task>" ${stray}` : await unknownFlag(stray, ['--json', ...TASK_FLAGS]), 'Run "opencastle convoy --help" for usage.');
250
+ }
251
+ renderStatus(readLastRun(findProjectRoot(process.cwd()) ?? process.cwd()), args.includes('--json'));
298
252
  return;
299
253
  }
300
- // Words that plainly mean "tell me where things stand" are a status query, not
301
- // a feature request. `convoy status` used to spend 95 seconds generating a PRD
302
- // for a feature called "status" — and it is the obvious thing to type, since
303
- // the bare command prints a status report.
304
- if (['status', 'state', 'info', 'ls', 'list'].includes(sub) && positionals.length === 1) {
305
- renderStatus(readLastRun(process.cwd()), args.includes('--json'));
306
- return;
254
+ // A single word is not something a planner can act on, and is far more
255
+ // often a mistyped subcommand: `convoy resum` used to start a planning
256
+ // session for a feature called "resum". Planning costs real sessions, so
257
+ // the word is checked before any start.
258
+ if (words.length === 1 && !words[0].includes(' ')) {
259
+ const near = nearest(words[0], SUBCOMMANDS);
260
+ refuse(near ? `Unknown subcommand "${words[0]}". Did you mean opencastle convoy ${near}?` : `"${words[0]}" is one word; describe the task in a few.`, near
261
+ ? 'To plan a task, describe it in a few words: opencastle convoy "add rate limiting to the API"'
262
+ : 'For example: opencastle convoy "add rate limiting to the API". For the last run: opencastle convoy');
307
263
  }
308
- // Anything else is a task description: plan it, then execute. `pipeline` takes
309
- // it as a flag value, so name it — passing it positionally made the one command
310
- // this tool prints under "Start one:" fail with "Unknown option".
311
- //
312
- // Every word, not just the first. An unquoted task arrives as one argument per
313
- // word, and taking `sub` alone silently planned the first of them.
264
+ // Everything else is a task: plan it, show the plan, ask, run. Every word,
265
+ // not just the first: an unquoted task arrives as one argument per word.
314
266
  const { forward, unknown } = splitTaskFlags(args);
315
267
  if (unknown.length > 0) {
316
- const accepted = [...TASK_FLAGS].sort().join(' ');
317
- console.error(` ${c.red('✗')} Unknown option for a convoy task: ${unknown[0]}`);
318
- console.error(` ${c.dim('Accepts:')} ${accepted} --help`);
319
- console.error(` ${c.dim('For run or plan options:')} opencastle convoy run --help`);
320
- process.exit(1);
268
+ refuse(await unknownFlag(unknown[0], [...TASK_FLAGS]), `A task accepts: ${[...TASK_FLAGS].join(' ')} --help`);
321
269
  }
322
- await delegate('pipeline', ctx, ['--text', positionals.join(' '), ...forward]);
270
+ const { planTask } = await import('./pipeline.js');
271
+ await planTask({ ...ctx, args: forward }, words.join(' '));
323
272
  }
324
273
  //# sourceMappingURL=convoy-cmd.js.map