agentplane 0.3.7 → 0.3.8

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 (625) hide show
  1. package/assets/AGENTS.md +11 -1
  2. package/assets/RUNNER.md +17 -0
  3. package/bin/agentplane.js +16 -7
  4. package/bin/framework-dev-contract.d.ts +6 -0
  5. package/bin/framework-dev-contract.js +13 -0
  6. package/bin/stale-dist-policy.js +6 -1
  7. package/dist/.build-manifest.json +694 -339
  8. package/dist/adapters/task-backend/task-backend-adapter.d.ts +3 -1
  9. package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
  10. package/dist/adapters/task-backend/task-backend-adapter.js +13 -0
  11. package/dist/backends/task-backend/local-backend-doc.d.ts +5 -0
  12. package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -0
  13. package/dist/backends/task-backend/local-backend-doc.js +98 -0
  14. package/dist/backends/task-backend/local-backend-read.d.ts +7 -0
  15. package/dist/backends/task-backend/local-backend-read.d.ts.map +1 -0
  16. package/dist/backends/task-backend/local-backend-read.js +186 -0
  17. package/dist/backends/task-backend/local-backend-state.d.ts +17 -0
  18. package/dist/backends/task-backend/local-backend-state.d.ts.map +1 -0
  19. package/dist/backends/task-backend/local-backend-state.js +50 -0
  20. package/dist/backends/task-backend/local-backend-write.d.ts +15 -0
  21. package/dist/backends/task-backend/local-backend-write.d.ts.map +1 -0
  22. package/dist/backends/task-backend/local-backend-write.js +254 -0
  23. package/dist/backends/task-backend/local-backend.d.ts +4 -2
  24. package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
  25. package/dist/backends/task-backend/local-backend.js +26 -403
  26. package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts +40 -0
  27. package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts.map +1 -0
  28. package/dist/backends/task-backend/redmine/backend-cache-doc.js +178 -0
  29. package/dist/backends/task-backend/redmine/backend-report.d.ts +10 -0
  30. package/dist/backends/task-backend/redmine/backend-report.d.ts.map +1 -0
  31. package/dist/backends/task-backend/redmine/backend-report.js +43 -0
  32. package/dist/backends/task-backend/redmine/backend-sync.d.ts +67 -0
  33. package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -0
  34. package/dist/backends/task-backend/redmine/backend-sync.js +367 -0
  35. package/dist/backends/task-backend/redmine/mapping.d.ts +2 -1
  36. package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
  37. package/dist/backends/task-backend/redmine/mapping.js +12 -2
  38. package/dist/backends/task-backend/redmine/parse.d.ts +2 -1
  39. package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -1
  40. package/dist/backends/task-backend/redmine/parse.js +5 -3
  41. package/dist/backends/task-backend/redmine/state.d.ts +2 -0
  42. package/dist/backends/task-backend/redmine/state.d.ts.map +1 -1
  43. package/dist/backends/task-backend/redmine/state.js +15 -1
  44. package/dist/backends/task-backend/redmine-backend.d.ts +5 -2
  45. package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
  46. package/dist/backends/task-backend/redmine-backend.js +88 -536
  47. package/dist/backends/task-backend/shared/constants.d.ts +2 -1
  48. package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
  49. package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
  50. package/dist/backends/task-backend/shared/doc.js +25 -39
  51. package/dist/backends/task-backend/shared/export.d.ts +2 -9
  52. package/dist/backends/task-backend/shared/export.d.ts.map +1 -1
  53. package/dist/backends/task-backend/shared/export.js +73 -8
  54. package/dist/backends/task-backend/shared/normalize.d.ts +5 -1
  55. package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -1
  56. package/dist/backends/task-backend/shared/normalize.js +166 -0
  57. package/dist/backends/task-backend/shared/record.d.ts +1 -1
  58. package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
  59. package/dist/backends/task-backend/shared/record.js +7 -2
  60. package/dist/backends/task-backend/shared/types.d.ts +38 -36
  61. package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
  62. package/dist/backends/task-backend/shared.d.ts +2 -2
  63. package/dist/backends/task-backend/shared.d.ts.map +1 -1
  64. package/dist/backends/task-backend/shared.js +1 -1
  65. package/dist/backends/task-backend.d.ts +1 -1
  66. package/dist/backends/task-backend.d.ts.map +1 -1
  67. package/dist/backends/task-backend.js +1 -1
  68. package/dist/backends/task-index.d.ts +2 -2
  69. package/dist/backends/task-index.d.ts.map +1 -1
  70. package/dist/backends/task-index.js +9 -6
  71. package/dist/cli/bootstrap-guide.d.ts +2 -2
  72. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  73. package/dist/cli/bootstrap-guide.js +10 -10
  74. package/dist/cli/command-guide.d.ts.map +1 -1
  75. package/dist/cli/command-guide.js +11 -9
  76. package/dist/cli/command-invocations.d.ts +4 -0
  77. package/dist/cli/command-invocations.d.ts.map +1 -0
  78. package/dist/cli/command-invocations.js +35 -0
  79. package/dist/cli/command-snippets.d.ts +12 -8
  80. package/dist/cli/command-snippets.d.ts.map +1 -1
  81. package/dist/cli/command-snippets.js +14 -8
  82. package/dist/cli/exit-codes.d.ts.map +1 -1
  83. package/dist/cli/exit-codes.js +1 -0
  84. package/dist/cli/group-command.d.ts +18 -0
  85. package/dist/cli/group-command.d.ts.map +1 -0
  86. package/dist/cli/group-command.js +45 -0
  87. package/dist/cli/output.d.ts +29 -0
  88. package/dist/cli/output.d.ts.map +1 -1
  89. package/dist/cli/output.js +76 -0
  90. package/dist/cli/prompts.d.ts.map +1 -1
  91. package/dist/cli/prompts.js +5 -1
  92. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  93. package/dist/cli/run-cli/command-catalog/core.js +38 -29
  94. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
  95. package/dist/cli/run-cli/command-catalog/lifecycle.js +9 -6
  96. package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
  97. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
  98. package/dist/cli/run-cli/command-catalog/project.js +8 -6
  99. package/dist/cli/run-cli/command-catalog/shared.d.ts +12 -3
  100. package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
  101. package/dist/cli/run-cli/command-catalog/shared.js +6 -3
  102. package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
  103. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
  104. package/dist/cli/run-cli/command-catalog/task.js +46 -11
  105. package/dist/cli/run-cli/command-catalog.d.ts +11 -1
  106. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  107. package/dist/cli/run-cli/command-catalog.js +29 -0
  108. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  109. package/dist/cli/run-cli/commands/config.js +52 -6
  110. package/dist/cli/run-cli/commands/core/agent-profiles.d.ts +34 -0
  111. package/dist/cli/run-cli/commands/core/agent-profiles.d.ts.map +1 -0
  112. package/dist/cli/run-cli/commands/core/agent-profiles.js +97 -0
  113. package/dist/cli/run-cli/commands/core/agents.d.ts +7 -0
  114. package/dist/cli/run-cli/commands/core/agents.d.ts.map +1 -0
  115. package/dist/cli/run-cli/commands/core/agents.js +97 -0
  116. package/dist/cli/run-cli/commands/core/preflight.d.ts +10 -0
  117. package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -0
  118. package/dist/cli/run-cli/commands/core/preflight.js +286 -0
  119. package/dist/cli/run-cli/commands/core/quickstart.d.ts +8 -0
  120. package/dist/cli/run-cli/commands/core/quickstart.d.ts.map +1 -0
  121. package/dist/cli/run-cli/commands/core/quickstart.js +43 -0
  122. package/dist/cli/run-cli/commands/core/role.d.ts +9 -0
  123. package/dist/cli/run-cli/commands/core/role.d.ts.map +1 -0
  124. package/dist/cli/run-cli/commands/core/role.js +128 -0
  125. package/dist/cli/run-cli/commands/core.d.ts +4 -24
  126. package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
  127. package/dist/cli/run-cli/commands/core.js +4 -630
  128. package/dist/cli/run-cli/error-guidance.js +10 -0
  129. package/dist/cli/run-cli/globals.d.ts +5 -2
  130. package/dist/cli/run-cli/globals.d.ts.map +1 -1
  131. package/dist/cli/run-cli/globals.js +82 -86
  132. package/dist/cli/run-cli.d.ts.map +1 -1
  133. package/dist/cli/run-cli.js +137 -100
  134. package/dist/cli/run-cli.test-helpers.d.ts +21 -0
  135. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  136. package/dist/cli/run-cli.test-helpers.js +88 -4
  137. package/dist/cli/spec/help.d.ts +10 -2
  138. package/dist/cli/spec/help.d.ts.map +1 -1
  139. package/dist/cli/spec/help.js +7 -5
  140. package/dist/cli/spec/registry.d.ts +27 -1
  141. package/dist/cli/spec/registry.d.ts.map +1 -1
  142. package/dist/cli/spec/registry.js +98 -25
  143. package/dist/commands/backend/sync.command.d.ts +3 -5
  144. package/dist/commands/backend/sync.command.d.ts.map +1 -1
  145. package/dist/commands/backend/sync.command.js +9 -12
  146. package/dist/commands/backend.d.ts.map +1 -1
  147. package/dist/commands/backend.js +8 -7
  148. package/dist/commands/branch/base.command.d.ts +2 -3
  149. package/dist/commands/branch/base.command.d.ts.map +1 -1
  150. package/dist/commands/branch/base.command.js +8 -12
  151. package/dist/commands/branch/base.d.ts.map +1 -1
  152. package/dist/commands/branch/base.js +11 -7
  153. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
  154. package/dist/commands/branch/cleanup-merged.js +9 -8
  155. package/dist/commands/branch/remove.d.ts.map +1 -1
  156. package/dist/commands/branch/remove.js +4 -3
  157. package/dist/commands/branch/status.d.ts.map +1 -1
  158. package/dist/commands/branch/status.js +4 -3
  159. package/dist/commands/branch/work-start.d.ts.map +1 -1
  160. package/dist/commands/branch/work-start.js +48 -5
  161. package/dist/commands/cleanup/merged.command.d.ts +2 -3
  162. package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
  163. package/dist/commands/cleanup/merged.command.js +8 -12
  164. package/dist/commands/docs/cli.command.js +2 -2
  165. package/dist/commands/doctor/runtime.js +1 -1
  166. package/dist/commands/doctor/workflow.d.ts.map +1 -1
  167. package/dist/commands/doctor/workflow.js +10 -1
  168. package/dist/commands/finish.spec.d.ts.map +1 -1
  169. package/dist/commands/finish.spec.js +7 -0
  170. package/dist/commands/guard/guard.command.d.ts +3 -3
  171. package/dist/commands/guard/guard.command.d.ts.map +1 -1
  172. package/dist/commands/guard/guard.command.js +9 -14
  173. package/dist/commands/guard/impl/commands.d.ts +2 -0
  174. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  175. package/dist/commands/guard/impl/commands.js +55 -7
  176. package/dist/commands/guard/impl/policy.d.ts +1 -0
  177. package/dist/commands/guard/impl/policy.d.ts.map +1 -1
  178. package/dist/commands/guard/impl/policy.js +9 -6
  179. package/dist/commands/hooks/hooks.command.d.ts +3 -3
  180. package/dist/commands/hooks/hooks.command.d.ts.map +1 -1
  181. package/dist/commands/hooks/hooks.command.js +9 -11
  182. package/dist/commands/pr/check.d.ts.map +1 -1
  183. package/dist/commands/pr/check.js +90 -18
  184. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
  185. package/dist/commands/pr/integrate/cmd.js +31 -3
  186. package/dist/commands/pr/integrate/internal/cleanup.d.ts +12 -0
  187. package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -0
  188. package/dist/commands/pr/integrate/internal/cleanup.js +46 -0
  189. package/dist/commands/pr/integrate/internal/finalize.d.ts +4 -0
  190. package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
  191. package/dist/commands/pr/integrate/internal/finalize.js +34 -40
  192. package/dist/commands/pr/integrate/internal/merge.d.ts +6 -0
  193. package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
  194. package/dist/commands/pr/integrate/internal/merge.js +92 -0
  195. package/dist/commands/pr/integrate/internal/prepare.d.ts +1 -0
  196. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
  197. package/dist/commands/pr/integrate/internal/prepare.js +1 -0
  198. package/dist/commands/pr/integrate/verify.d.ts.map +1 -1
  199. package/dist/commands/pr/integrate/verify.js +4 -3
  200. package/dist/commands/pr/note.d.ts.map +1 -1
  201. package/dist/commands/pr/note.js +3 -2
  202. package/dist/commands/pr/open.d.ts.map +1 -1
  203. package/dist/commands/pr/open.js +9 -12
  204. package/dist/commands/pr/pr.command.d.ts +3 -4
  205. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  206. package/dist/commands/pr/pr.command.js +6 -11
  207. package/dist/commands/pr/update.d.ts.map +1 -1
  208. package/dist/commands/pr/update.js +5 -10
  209. package/dist/commands/recipes/cache.command.d.ts +3 -4
  210. package/dist/commands/recipes/cache.command.d.ts.map +1 -1
  211. package/dist/commands/recipes/cache.command.js +8 -26
  212. package/dist/commands/recipes/impl/apply.d.ts +1 -1
  213. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  214. package/dist/commands/recipes/impl/apply.js +1 -1
  215. package/dist/commands/recipes/impl/commands/explain.js +1 -1
  216. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  217. package/dist/commands/recipes/impl/commands/install.js +1 -2
  218. package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
  219. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  220. package/dist/commands/recipes/impl/installed-recipes.js +1 -2
  221. package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
  222. package/dist/commands/recipes/impl/manifest.js +0 -10
  223. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +1 -1
  224. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
  225. package/dist/commands/recipes/impl/project-installed-recipes.js +1 -2
  226. package/dist/commands/recipes/impl/resolver.d.ts +1 -1
  227. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
  228. package/dist/commands/recipes/impl/resolver.js +26 -16
  229. package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
  230. package/dist/commands/recipes/impl/scenario.js +80 -0
  231. package/dist/commands/recipes/impl/types.d.ts +27 -13
  232. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  233. package/dist/commands/recipes/recipes.command.d.ts +3 -4
  234. package/dist/commands/recipes/recipes.command.d.ts.map +1 -1
  235. package/dist/commands/recipes/recipes.command.js +8 -34
  236. package/dist/commands/recipes.d.ts +4 -4
  237. package/dist/commands/recipes.d.ts.map +1 -1
  238. package/dist/commands/recipes.js +3 -3
  239. package/dist/commands/recipes.test-helpers.d.ts +17 -0
  240. package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
  241. package/dist/commands/recipes.test-helpers.js +56 -2
  242. package/dist/commands/release/apply.command.d.ts.map +1 -1
  243. package/dist/commands/release/apply.command.js +77 -56
  244. package/dist/commands/release/plan.command.d.ts.map +1 -1
  245. package/dist/commands/release/plan.command.js +7 -3
  246. package/dist/commands/release/release.command.d.ts +3 -3
  247. package/dist/commands/release/release.command.d.ts.map +1 -1
  248. package/dist/commands/release/release.command.js +9 -11
  249. package/dist/commands/release.test-helpers.d.ts +20 -0
  250. package/dist/commands/release.test-helpers.d.ts.map +1 -0
  251. package/dist/commands/release.test-helpers.js +37 -0
  252. package/dist/commands/runtime.command.d.ts +7 -7
  253. package/dist/commands/runtime.command.d.ts.map +1 -1
  254. package/dist/commands/runtime.command.js +29 -33
  255. package/dist/commands/scenario/execute.command.d.ts +8 -0
  256. package/dist/commands/scenario/execute.command.d.ts.map +1 -0
  257. package/dist/commands/scenario/execute.command.js +117 -0
  258. package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
  259. package/dist/commands/scenario/impl/commands.js +45 -32
  260. package/dist/commands/scenario/run.command.js +2 -2
  261. package/dist/commands/scenario/scenario.command.d.ts +3 -4
  262. package/dist/commands/scenario/scenario.command.d.ts.map +1 -1
  263. package/dist/commands/scenario/scenario.command.js +8 -26
  264. package/dist/commands/shared/git-context.d.ts +1 -0
  265. package/dist/commands/shared/git-context.d.ts.map +1 -1
  266. package/dist/commands/shared/git-context.js +4 -2
  267. package/dist/commands/shared/git-ops.d.ts +1 -0
  268. package/dist/commands/shared/git-ops.d.ts.map +1 -1
  269. package/dist/commands/shared/git-ops.js +13 -0
  270. package/dist/commands/shared/operator-pipeline.d.ts +10 -0
  271. package/dist/commands/shared/operator-pipeline.d.ts.map +1 -0
  272. package/dist/commands/shared/operator-pipeline.js +16 -0
  273. package/dist/commands/shared/pr-meta.d.ts +32 -12
  274. package/dist/commands/shared/pr-meta.d.ts.map +1 -1
  275. package/dist/commands/shared/pr-meta.js +49 -14
  276. package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
  277. package/dist/commands/shared/reconcile-check.js +28 -3
  278. package/dist/commands/shared/task-backend.d.ts +10 -6
  279. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  280. package/dist/commands/shared/task-backend.js +99 -25
  281. package/dist/commands/shared/task-handoff.d.ts +64 -0
  282. package/dist/commands/shared/task-handoff.d.ts.map +1 -0
  283. package/dist/commands/shared/task-handoff.js +151 -0
  284. package/dist/commands/shared/task-mutation.d.ts +36 -0
  285. package/dist/commands/shared/task-mutation.d.ts.map +1 -0
  286. package/dist/commands/shared/task-mutation.js +67 -0
  287. package/dist/commands/shared/task-store.d.ts +5 -1
  288. package/dist/commands/shared/task-store.d.ts.map +1 -1
  289. package/dist/commands/shared/task-store.js +72 -92
  290. package/dist/commands/task/add.d.ts.map +1 -1
  291. package/dist/commands/task/add.js +41 -39
  292. package/dist/commands/task/block.d.ts.map +1 -1
  293. package/dist/commands/task/block.js +31 -110
  294. package/dist/commands/task/close-duplicate.d.ts.map +1 -1
  295. package/dist/commands/task/close-duplicate.js +0 -7
  296. package/dist/commands/task/close-noop.d.ts.map +1 -1
  297. package/dist/commands/task/close-noop.js +0 -21
  298. package/dist/commands/task/close-shared.d.ts +0 -2
  299. package/dist/commands/task/close-shared.d.ts.map +1 -1
  300. package/dist/commands/task/close-shared.js +25 -55
  301. package/dist/commands/task/comment.d.ts.map +1 -1
  302. package/dist/commands/task/comment.js +48 -37
  303. package/dist/commands/task/derive.d.ts.map +1 -1
  304. package/dist/commands/task/derive.js +14 -7
  305. package/dist/commands/task/doc.command.d.ts.map +1 -1
  306. package/dist/commands/task/doc.command.js +7 -6
  307. package/dist/commands/task/doc.d.ts.map +1 -1
  308. package/dist/commands/task/doc.js +58 -62
  309. package/dist/commands/task/finish-shared.d.ts +60 -0
  310. package/dist/commands/task/finish-shared.d.ts.map +1 -0
  311. package/dist/commands/task/finish-shared.js +181 -0
  312. package/dist/commands/task/finish.d.ts +1 -0
  313. package/dist/commands/task/finish.d.ts.map +1 -1
  314. package/dist/commands/task/finish.js +79 -210
  315. package/dist/commands/task/handoff-record.command.d.ts +17 -0
  316. package/dist/commands/task/handoff-record.command.d.ts.map +1 -0
  317. package/dist/commands/task/handoff-record.command.js +140 -0
  318. package/dist/commands/task/handoff-show.command.d.ts +8 -0
  319. package/dist/commands/task/handoff-show.command.d.ts.map +1 -0
  320. package/dist/commands/task/handoff-show.command.js +77 -0
  321. package/dist/commands/task/handoff.command.d.ts +7 -0
  322. package/dist/commands/task/handoff.command.d.ts.map +1 -0
  323. package/dist/commands/task/handoff.command.js +21 -0
  324. package/dist/commands/task/handoff.shared.d.ts +39 -0
  325. package/dist/commands/task/handoff.shared.d.ts.map +1 -0
  326. package/dist/commands/task/handoff.shared.js +134 -0
  327. package/dist/commands/task/hosted-close.command.d.ts +9 -0
  328. package/dist/commands/task/hosted-close.command.d.ts.map +1 -0
  329. package/dist/commands/task/hosted-close.command.js +190 -0
  330. package/dist/commands/task/hosted-merge-sync.d.ts +40 -0
  331. package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -0
  332. package/dist/commands/task/hosted-merge-sync.js +277 -0
  333. package/dist/commands/task/list.d.ts.map +1 -1
  334. package/dist/commands/task/list.js +7 -24
  335. package/dist/commands/task/new.d.ts.map +1 -1
  336. package/dist/commands/task/new.js +26 -6
  337. package/dist/commands/task/next.d.ts.map +1 -1
  338. package/dist/commands/task/next.js +10 -28
  339. package/dist/commands/task/normalize.command.d.ts +1 -0
  340. package/dist/commands/task/normalize.command.d.ts.map +1 -1
  341. package/dist/commands/task/normalize.command.js +12 -0
  342. package/dist/commands/task/normalize.d.ts +1 -0
  343. package/dist/commands/task/normalize.d.ts.map +1 -1
  344. package/dist/commands/task/normalize.js +21 -9
  345. package/dist/commands/task/plan.command.d.ts +3 -4
  346. package/dist/commands/task/plan.command.d.ts.map +1 -1
  347. package/dist/commands/task/plan.command.js +6 -12
  348. package/dist/commands/task/plan.d.ts.map +1 -1
  349. package/dist/commands/task/plan.js +96 -103
  350. package/dist/commands/task/reclaim.command.d.ts +11 -0
  351. package/dist/commands/task/reclaim.command.d.ts.map +1 -0
  352. package/dist/commands/task/reclaim.command.js +102 -0
  353. package/dist/commands/task/resume-context.command.d.ts +9 -0
  354. package/dist/commands/task/resume-context.command.d.ts.map +1 -0
  355. package/dist/commands/task/resume-context.command.js +60 -0
  356. package/dist/commands/task/run-cancel.command.d.ts +6 -0
  357. package/dist/commands/task/run-cancel.command.d.ts.map +1 -0
  358. package/dist/commands/task/run-cancel.command.js +45 -0
  359. package/dist/commands/task/run-cancel.spec.d.ts +7 -0
  360. package/dist/commands/task/run-cancel.spec.d.ts.map +1 -0
  361. package/dist/commands/task/run-cancel.spec.js +20 -0
  362. package/dist/commands/task/run-resume.command.d.ts +6 -0
  363. package/dist/commands/task/run-resume.command.d.ts.map +1 -0
  364. package/dist/commands/task/run-resume.command.js +55 -0
  365. package/dist/commands/task/run-resume.spec.d.ts +7 -0
  366. package/dist/commands/task/run-resume.spec.d.ts.map +1 -0
  367. package/dist/commands/task/run-resume.spec.js +20 -0
  368. package/dist/commands/task/run-retry.command.d.ts +6 -0
  369. package/dist/commands/task/run-retry.command.d.ts.map +1 -0
  370. package/dist/commands/task/run-retry.command.js +56 -0
  371. package/dist/commands/task/run-retry.spec.d.ts +7 -0
  372. package/dist/commands/task/run-retry.spec.d.ts.map +1 -0
  373. package/dist/commands/task/run-retry.spec.js +20 -0
  374. package/dist/commands/task/run-show.command.d.ts +6 -0
  375. package/dist/commands/task/run-show.command.d.ts.map +1 -0
  376. package/dist/commands/task/run-show.command.js +133 -0
  377. package/dist/commands/task/run-show.spec.d.ts +8 -0
  378. package/dist/commands/task/run-show.spec.d.ts.map +1 -0
  379. package/dist/commands/task/run-show.spec.js +44 -0
  380. package/dist/commands/task/run-tail.command.d.ts +6 -0
  381. package/dist/commands/task/run-tail.command.d.ts.map +1 -0
  382. package/dist/commands/task/run-tail.command.js +26 -0
  383. package/dist/commands/task/run-tail.spec.d.ts +8 -0
  384. package/dist/commands/task/run-tail.spec.d.ts.map +1 -0
  385. package/dist/commands/task/run-tail.spec.js +51 -0
  386. package/dist/commands/task/run-trace.command.d.ts +6 -0
  387. package/dist/commands/task/run-trace.command.d.ts.map +1 -0
  388. package/dist/commands/task/run-trace.command.js +25 -0
  389. package/dist/commands/task/run-trace.spec.d.ts +7 -0
  390. package/dist/commands/task/run-trace.spec.d.ts.map +1 -0
  391. package/dist/commands/task/run-trace.spec.js +31 -0
  392. package/dist/commands/task/run.command.d.ts +6 -0
  393. package/dist/commands/task/run.command.d.ts.map +1 -0
  394. package/dist/commands/task/run.command.js +74 -0
  395. package/dist/commands/task/run.spec.d.ts +7 -0
  396. package/dist/commands/task/run.spec.d.ts.map +1 -0
  397. package/dist/commands/task/run.spec.js +26 -0
  398. package/dist/commands/task/scaffold.d.ts.map +1 -1
  399. package/dist/commands/task/scaffold.js +4 -2
  400. package/dist/commands/task/scrub.d.ts.map +1 -1
  401. package/dist/commands/task/scrub.js +27 -24
  402. package/dist/commands/task/search.d.ts.map +1 -1
  403. package/dist/commands/task/search.js +21 -31
  404. package/dist/commands/task/set-status.d.ts.map +1 -1
  405. package/dist/commands/task/set-status.js +36 -152
  406. package/dist/commands/task/shared/dependencies.d.ts +4 -4
  407. package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
  408. package/dist/commands/task/shared/dependencies.js +10 -2
  409. package/dist/commands/task/shared/docs.d.ts +6 -1
  410. package/dist/commands/task/shared/docs.d.ts.map +1 -1
  411. package/dist/commands/task/shared/docs.js +13 -0
  412. package/dist/commands/task/shared/listing.d.ts +16 -2
  413. package/dist/commands/task/shared/listing.d.ts.map +1 -1
  414. package/dist/commands/task/shared/listing.js +56 -0
  415. package/dist/commands/task/shared/transition-command.d.ts +15 -0
  416. package/dist/commands/task/shared/transition-command.d.ts.map +1 -0
  417. package/dist/commands/task/shared/transition-command.js +43 -0
  418. package/dist/commands/task/shared/transitions.d.ts +39 -0
  419. package/dist/commands/task/shared/transitions.d.ts.map +1 -1
  420. package/dist/commands/task/shared/transitions.js +62 -1
  421. package/dist/commands/task/shared/workflow-transition-service.d.ts +75 -0
  422. package/dist/commands/task/shared/workflow-transition-service.d.ts.map +1 -0
  423. package/dist/commands/task/shared/workflow-transition-service.js +226 -0
  424. package/dist/commands/task/shared.d.ts +5 -3
  425. package/dist/commands/task/shared.d.ts.map +1 -1
  426. package/dist/commands/task/shared.js +5 -3
  427. package/dist/commands/task/show.d.ts.map +1 -1
  428. package/dist/commands/task/show.js +37 -3
  429. package/dist/commands/task/start.d.ts.map +1 -1
  430. package/dist/commands/task/start.js +33 -119
  431. package/dist/commands/task/task.command.d.ts +3 -4
  432. package/dist/commands/task/task.command.d.ts.map +1 -1
  433. package/dist/commands/task/task.command.js +22 -37
  434. package/dist/commands/task/verify-record.d.ts.map +1 -1
  435. package/dist/commands/task/verify-record.js +16 -141
  436. package/dist/commands/task/verify.command.d.ts.map +1 -1
  437. package/dist/commands/task/verify.command.js +7 -6
  438. package/dist/commands/task.test-helpers.d.ts +13 -0
  439. package/dist/commands/task.test-helpers.d.ts.map +1 -0
  440. package/dist/commands/task.test-helpers.js +65 -0
  441. package/dist/commands/upgrade/materialize.d.ts +28 -0
  442. package/dist/commands/upgrade/materialize.d.ts.map +1 -0
  443. package/dist/commands/upgrade/materialize.js +154 -0
  444. package/dist/commands/upgrade/plan.d.ts +18 -0
  445. package/dist/commands/upgrade/plan.d.ts.map +1 -0
  446. package/dist/commands/upgrade/plan.js +219 -0
  447. package/dist/commands/upgrade/policy.d.ts +24 -0
  448. package/dist/commands/upgrade/policy.d.ts.map +1 -0
  449. package/dist/commands/upgrade/policy.js +182 -0
  450. package/dist/commands/upgrade/report.d.ts.map +1 -1
  451. package/dist/commands/upgrade/report.js +7 -5
  452. package/dist/commands/upgrade.d.ts.map +1 -1
  453. package/dist/commands/upgrade.js +154 -642
  454. package/dist/commands/workflow.command.d.ts +3 -4
  455. package/dist/commands/workflow.command.d.ts.map +1 -1
  456. package/dist/commands/workflow.command.js +8 -25
  457. package/dist/ports/task-backend-port.d.ts +3 -1
  458. package/dist/ports/task-backend-port.d.ts.map +1 -1
  459. package/dist/runner/adapters/codex.d.ts +9 -0
  460. package/dist/runner/adapters/codex.d.ts.map +1 -0
  461. package/dist/runner/adapters/codex.js +414 -0
  462. package/dist/runner/adapters/custom.d.ts +12 -0
  463. package/dist/runner/adapters/custom.d.ts.map +1 -0
  464. package/dist/runner/adapters/custom.js +512 -0
  465. package/dist/runner/adapters/index.d.ts +8 -0
  466. package/dist/runner/adapters/index.d.ts.map +1 -0
  467. package/dist/runner/adapters/index.js +15 -0
  468. package/dist/runner/adapters/recipe-run-profile.d.ts +8 -0
  469. package/dist/runner/adapters/recipe-run-profile.d.ts.map +1 -0
  470. package/dist/runner/adapters/recipe-run-profile.js +53 -0
  471. package/dist/runner/adapters/shared.d.ts +45 -0
  472. package/dist/runner/adapters/shared.d.ts.map +1 -0
  473. package/dist/runner/adapters/shared.js +58 -0
  474. package/dist/runner/artifacts.d.ts +31 -0
  475. package/dist/runner/artifacts.d.ts.map +1 -0
  476. package/dist/runner/artifacts.js +153 -0
  477. package/dist/runner/codex-approval-probe.d.ts +23 -0
  478. package/dist/runner/codex-approval-probe.d.ts.map +1 -0
  479. package/dist/runner/codex-approval-probe.js +55 -0
  480. package/dist/runner/codex-smoke.d.ts +11 -0
  481. package/dist/runner/codex-smoke.d.ts.map +1 -0
  482. package/dist/runner/codex-smoke.js +45 -0
  483. package/dist/runner/config.d.ts +6 -0
  484. package/dist/runner/config.d.ts.map +1 -0
  485. package/dist/runner/config.js +15 -0
  486. package/dist/runner/context/base-prompts.d.ts +10 -0
  487. package/dist/runner/context/base-prompts.d.ts.map +1 -0
  488. package/dist/runner/context/base-prompts.js +255 -0
  489. package/dist/runner/context/recipe-context.d.ts +17 -0
  490. package/dist/runner/context/recipe-context.d.ts.map +1 -0
  491. package/dist/runner/context/recipe-context.js +48 -0
  492. package/dist/runner/context/task-context.d.ts +24 -0
  493. package/dist/runner/context/task-context.d.ts.map +1 -0
  494. package/dist/runner/context/task-context.js +266 -0
  495. package/dist/runner/index.d.ts +12 -0
  496. package/dist/runner/index.d.ts.map +1 -0
  497. package/dist/runner/index.js +11 -0
  498. package/dist/runner/policy-decision.d.ts +12 -0
  499. package/dist/runner/policy-decision.d.ts.map +1 -0
  500. package/dist/runner/policy-decision.js +89 -0
  501. package/dist/runner/policy-display.d.ts +4 -0
  502. package/dist/runner/policy-display.d.ts.map +1 -0
  503. package/dist/runner/policy-display.js +41 -0
  504. package/dist/runner/process-supervision.d.ts +48 -0
  505. package/dist/runner/process-supervision.d.ts.map +1 -0
  506. package/dist/runner/process-supervision.js +490 -0
  507. package/dist/runner/result-manifest-policy.d.ts +9 -0
  508. package/dist/runner/result-manifest-policy.d.ts.map +1 -0
  509. package/dist/runner/result-manifest-policy.js +96 -0
  510. package/dist/runner/result-manifest.d.ts +30 -0
  511. package/dist/runner/result-manifest.d.ts.map +1 -0
  512. package/dist/runner/result-manifest.js +322 -0
  513. package/dist/runner/run-id.d.ts +2 -0
  514. package/dist/runner/run-id.d.ts.map +1 -0
  515. package/dist/runner/run-id.js +3 -0
  516. package/dist/runner/run-repository.d.ts +51 -0
  517. package/dist/runner/run-repository.d.ts.map +1 -0
  518. package/dist/runner/run-repository.js +222 -0
  519. package/dist/runner/task-run-paths.d.ts +19 -0
  520. package/dist/runner/task-run-paths.d.ts.map +1 -0
  521. package/dist/runner/task-run-paths.js +25 -0
  522. package/dist/runner/task-state.d.ts +9 -0
  523. package/dist/runner/task-state.d.ts.map +1 -0
  524. package/dist/runner/task-state.js +354 -0
  525. package/dist/runner/test-helpers.d.ts +30 -0
  526. package/dist/runner/test-helpers.d.ts.map +1 -0
  527. package/dist/runner/test-helpers.js +97 -0
  528. package/dist/runner/trace-artifacts.d.ts +14 -0
  529. package/dist/runner/trace-artifacts.d.ts.map +1 -0
  530. package/dist/runner/trace-artifacts.js +80 -0
  531. package/dist/runner/trace.d.ts +10 -0
  532. package/dist/runner/trace.d.ts.map +1 -0
  533. package/dist/runner/trace.js +37 -0
  534. package/dist/runner/types.d.ts +317 -0
  535. package/dist/runner/types.d.ts.map +1 -0
  536. package/dist/runner/types.js +3 -0
  537. package/dist/runner/usecases/scenario-materialize-task.d.ts +29 -0
  538. package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -0
  539. package/dist/runner/usecases/scenario-materialize-task.js +151 -0
  540. package/dist/runner/usecases/task-run-inspect.d.ts +41 -0
  541. package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -0
  542. package/dist/runner/usecases/task-run-inspect.js +74 -0
  543. package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts +10 -0
  544. package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts.map +1 -0
  545. package/dist/runner/usecases/task-run-lifecycle-cancel.js +172 -0
  546. package/dist/runner/usecases/task-run-lifecycle-replay.d.ts +18 -0
  547. package/dist/runner/usecases/task-run-lifecycle-replay.d.ts.map +1 -0
  548. package/dist/runner/usecases/task-run-lifecycle-replay.js +128 -0
  549. package/dist/runner/usecases/task-run-lifecycle-shared.d.ts +45 -0
  550. package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -0
  551. package/dist/runner/usecases/task-run-lifecycle-shared.js +172 -0
  552. package/dist/runner/usecases/task-run-lifecycle.d.ts +4 -0
  553. package/dist/runner/usecases/task-run-lifecycle.d.ts.map +1 -0
  554. package/dist/runner/usecases/task-run-lifecycle.js +2 -0
  555. package/dist/runner/usecases/task-run.d.ts +32 -0
  556. package/dist/runner/usecases/task-run.d.ts.map +1 -0
  557. package/dist/runner/usecases/task-run.js +278 -0
  558. package/dist/shared/agent-emoji.d.ts.map +1 -1
  559. package/dist/shared/agent-emoji.js +1 -0
  560. package/dist/shared/errors.d.ts +1 -1
  561. package/dist/shared/errors.d.ts.map +1 -1
  562. package/dist/shared/guards.d.ts.map +1 -1
  563. package/dist/shared/guards.js +1 -0
  564. package/dist/shared/repo-cli-version.d.ts.map +1 -1
  565. package/dist/shared/repo-cli-version.js +7 -5
  566. package/dist/shared/task-doc-conflicts.d.ts +12 -0
  567. package/dist/shared/task-doc-conflicts.d.ts.map +1 -0
  568. package/dist/shared/task-doc-conflicts.js +40 -0
  569. package/dist/shared/task-doc-state.d.ts +10 -0
  570. package/dist/shared/task-doc-state.d.ts.map +1 -0
  571. package/dist/shared/task-doc-state.js +15 -0
  572. package/dist/test-helpers/fs.d.ts +2 -0
  573. package/dist/test-helpers/fs.d.ts.map +1 -0
  574. package/dist/test-helpers/fs.js +9 -0
  575. package/dist/usecases/context/resolve-context.d.ts +2 -0
  576. package/dist/usecases/context/resolve-context.d.ts.map +1 -1
  577. package/dist/usecases/context/resolve-context.js +4 -1
  578. package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
  579. package/dist/usecases/task/task-list-usecase.js +2 -8
  580. package/dist/workflow-runtime/fix.d.ts +9 -1
  581. package/dist/workflow-runtime/fix.d.ts.map +1 -1
  582. package/dist/workflow-runtime/fix.js +9 -1
  583. package/package.json +3 -2
  584. package/dist/backends/task-backend.test-helpers.d.ts +0 -4
  585. package/dist/backends/task-backend.test-helpers.d.ts.map +0 -1
  586. package/dist/backends/task-backend.test-helpers.js +0 -33
  587. package/dist/cli/run-cli/catalog.d.ts +0 -7
  588. package/dist/cli/run-cli/catalog.d.ts.map +0 -1
  589. package/dist/cli/run-cli/catalog.js +0 -22
  590. package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +0 -3
  591. package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +0 -1
  592. package/dist/cli/run-cli.core.pr-flow.test-helpers.js +0 -41
  593. package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +0 -2
  594. package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +0 -1
  595. package/dist/cli/run-cli.core.tasks.test-helpers.js +0 -6
  596. package/dist/commands/block.command.d.ts +0 -4
  597. package/dist/commands/block.command.d.ts.map +0 -1
  598. package/dist/commands/block.command.js +0 -2
  599. package/dist/commands/doctor.command.d.ts +0 -3
  600. package/dist/commands/doctor.command.d.ts.map +0 -1
  601. package/dist/commands/doctor.command.js +0 -2
  602. package/dist/commands/finish.command.d.ts +0 -4
  603. package/dist/commands/finish.command.d.ts.map +0 -1
  604. package/dist/commands/finish.command.js +0 -2
  605. package/dist/commands/recipes/install.command.d.ts +0 -3
  606. package/dist/commands/recipes/install.command.d.ts.map +0 -1
  607. package/dist/commands/recipes/install.command.js +0 -2
  608. package/dist/commands/start.command.d.ts +0 -4
  609. package/dist/commands/start.command.d.ts.map +0 -1
  610. package/dist/commands/start.command.js +0 -2
  611. package/dist/commands/task/list.command.d.ts +0 -4
  612. package/dist/commands/task/list.command.d.ts.map +0 -1
  613. package/dist/commands/task/list.command.js +0 -2
  614. package/dist/commands/task/next.command.d.ts +0 -4
  615. package/dist/commands/task/next.command.d.ts.map +0 -1
  616. package/dist/commands/task/next.command.js +0 -2
  617. package/dist/commands/task/search.command.d.ts +0 -4
  618. package/dist/commands/task/search.command.d.ts.map +0 -1
  619. package/dist/commands/task/search.command.js +0 -2
  620. package/dist/commands/task/show.command.d.ts +0 -4
  621. package/dist/commands/task/show.command.d.ts.map +0 -1
  622. package/dist/commands/task/show.command.js +0 -2
  623. package/dist/commands/verify.command.d.ts +0 -4
  624. package/dist/commands/verify.command.d.ts.map +0 -1
  625. package/dist/commands/verify.command.js +0 -2
@@ -1,5 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { loadConfig, resolveProject } from "@agentplaneorg/core";
3
+ import { createCliEmitter } from "../../cli/output.js";
3
4
  import { exitCodeForError } from "../../cli/exit-codes.js";
4
5
  import { usageError } from "../../cli/spec/errors.js";
5
6
  import { withDiagnosticContext } from "../../shared/diagnostics.js";
@@ -7,9 +8,11 @@ import { CliError } from "../../shared/errors.js";
7
8
  import { execFileAsync, gitEnv } from "../shared/git.js";
8
9
  import { GitContext } from "../shared/git-context.js";
9
10
  import { ensureNetworkApproved } from "../shared/network-approval.js";
11
+ import { runOperatorPipeline } from "../shared/operator-pipeline.js";
10
12
  import { cleanHookEnv, maybePersistExpectedCliVersion, maybeRefreshGeneratedReference, maybeUpdateBunLockfile, replaceAgentplanePackageMetadata, replacePackageVersionInFile, } from "./apply.mutation.js";
11
13
  import { ensureCleanTrackedTree, ensureNpmVersionsAvailable, ensureRemoteExists, ensureRemoteTagDoesNotExist, ensureTagDoesNotExist, fileExists, loadReleasePlan, readCoreDependencyVersion, readPackageVersion, runReleasePrepublishGate, validateReleaseNotes, } from "./apply.preflight.js";
12
14
  import { pushReleaseRefs, writeReleaseApplyReport } from "./apply.reporting.js";
15
+ const output = createCliEmitter();
13
16
  async function resolveReleasePlanInputs(opts) {
14
17
  const { planDir, plan, minBullets } = await loadReleasePlan({
15
18
  gitRoot: opts.gitRoot,
@@ -118,7 +121,7 @@ async function applyReleaseMutation(opts) {
118
121
  await opts.git.stage(stagePaths);
119
122
  const staged = await opts.git.statusStagedPaths();
120
123
  if (staged.length === 0) {
121
- process.stdout.write("No changes to commit.\n");
124
+ output.line("No changes to commit.");
122
125
  return { releaseCommit };
123
126
  }
124
127
  const subject = `✨ release: ${opts.nextTag}`;
@@ -135,13 +138,13 @@ async function finalizeReleaseApply(opts) {
135
138
  cwd: opts.gitRoot,
136
139
  env: gitEnv(),
137
140
  });
138
- process.stdout.write(`Release tag created: ${opts.plan.nextTag}\n`);
141
+ output.line(`Release tag created: ${opts.plan.nextTag}`);
139
142
  if (opts.push) {
140
143
  await pushReleaseRefs(opts.gitRoot, opts.remote, opts.plan.nextTag);
141
- process.stdout.write(`Pushed: ${opts.remote} HEAD + ${opts.plan.nextTag}\n`);
144
+ output.line(`Pushed: ${opts.remote} HEAD + ${opts.plan.nextTag}`);
142
145
  }
143
146
  else {
144
- process.stdout.write(`Next: git push <remote> HEAD && git push <remote> ${opts.plan.nextTag}\n`);
147
+ output.line(`Next: git push <remote> HEAD && git push <remote> ${opts.plan.nextTag}`);
145
148
  }
146
149
  const reportPath = await writeReleaseApplyReport(opts.gitRoot, {
147
150
  applied_at: new Date().toISOString(),
@@ -161,7 +164,7 @@ async function finalizeReleaseApply(opts) {
161
164
  commit: opts.releaseCommit,
162
165
  push: { requested: opts.push, remote: opts.remote, performed: opts.push },
163
166
  });
164
- process.stdout.write(`Release report: ${path.relative(opts.gitRoot, reportPath)}\n`);
167
+ output.line(`Release report: ${path.relative(opts.gitRoot, reportPath)}`);
165
168
  return 0;
166
169
  }
167
170
  export const releaseApplySpec = {
@@ -250,58 +253,76 @@ export const runReleaseApply = async (ctx, flags) => {
250
253
  message: "Release publish is mandatory. Run `agentplane release apply --push --yes`.",
251
254
  });
252
255
  }
253
- const resolved = await resolveProject({ cwd: ctx.cwd, rootOverride: ctx.rootOverride ?? null });
254
- const gitRoot = resolved.gitRoot;
255
- const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
256
- gitRoot,
257
- planOverride: flags.plan,
258
- });
259
- if ((plan.bump === "minor" || plan.bump === "major") && flags.yes !== true) {
260
- throw usageError({
261
- spec: releaseApplySpec,
262
- command: "release apply",
263
- message: `Bump '${plan.bump}' requires explicit approval. Re-run with --yes.`,
264
- });
265
- }
266
- const corePkgPath = path.join(gitRoot, "packages", "core", "package.json");
267
- const agentplanePkgPath = path.join(gitRoot, "packages", "agentplane", "package.json");
268
- await ensureReleasePlanMatchesRepoState({
269
- gitRoot,
270
- plan,
271
- corePkgPath,
272
- agentplanePkgPath,
273
- });
274
- let npmVersionChecked = false;
275
- if (flags.push) {
276
- npmVersionChecked = await runPushPreflight({
277
- agentplaneDir: resolved.agentplaneDir,
278
- gitRoot,
256
+ return await runOperatorPipeline({
257
+ init: async () => {
258
+ const resolved = await resolveProject({
259
+ cwd: ctx.cwd,
260
+ rootOverride: ctx.rootOverride ?? null,
261
+ });
262
+ const gitRoot = resolved.gitRoot;
263
+ const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
264
+ gitRoot,
265
+ planOverride: flags.plan,
266
+ });
267
+ return {
268
+ resolved,
269
+ gitRoot,
270
+ planDir,
271
+ plan,
272
+ notesPath,
273
+ corePkgPath: path.join(gitRoot, "packages", "core", "package.json"),
274
+ agentplanePkgPath: path.join(gitRoot, "packages", "agentplane", "package.json"),
275
+ npmVersionChecked: false,
276
+ };
277
+ },
278
+ preflight: async (state) => {
279
+ if ((state.plan.bump === "minor" || state.plan.bump === "major") && flags.yes !== true) {
280
+ throw usageError({
281
+ spec: releaseApplySpec,
282
+ command: "release apply",
283
+ message: `Bump '${state.plan.bump}' requires explicit approval. Re-run with --yes.`,
284
+ });
285
+ }
286
+ await ensureReleasePlanMatchesRepoState({
287
+ gitRoot: state.gitRoot,
288
+ plan: state.plan,
289
+ corePkgPath: state.corePkgPath,
290
+ agentplanePkgPath: state.agentplanePkgPath,
291
+ });
292
+ if (flags.push) {
293
+ state.npmVersionChecked = await runPushPreflight({
294
+ agentplaneDir: state.resolved.agentplaneDir,
295
+ gitRoot: state.gitRoot,
296
+ remote: flags.remote,
297
+ nextTag: state.plan.nextTag,
298
+ nextVersion: state.plan.nextVersion,
299
+ yes: flags.yes,
300
+ });
301
+ }
302
+ },
303
+ execute: async (state) => {
304
+ const git = new GitContext({ gitRoot: state.gitRoot });
305
+ return await applyReleaseMutation({
306
+ agentplaneDir: state.resolved.agentplaneDir,
307
+ gitRoot: state.gitRoot,
308
+ git,
309
+ notesPath: state.notesPath,
310
+ corePkgPath: state.corePkgPath,
311
+ agentplanePkgPath: state.agentplanePkgPath,
312
+ nextTag: state.plan.nextTag,
313
+ nextVersion: state.plan.nextVersion,
314
+ });
315
+ },
316
+ finalize: async (state, mutation) => await finalizeReleaseApply({
317
+ gitRoot: state.gitRoot,
318
+ planDir: state.planDir,
319
+ notesPath: state.notesPath,
320
+ plan: state.plan,
321
+ npmVersionChecked: state.npmVersionChecked,
322
+ releaseCommit: mutation.releaseCommit,
323
+ push: flags.push,
279
324
  remote: flags.remote,
280
- nextTag: plan.nextTag,
281
- nextVersion: plan.nextVersion,
282
- yes: flags.yes,
283
- });
284
- }
285
- const git = new GitContext({ gitRoot });
286
- const { releaseCommit } = await applyReleaseMutation({
287
- agentplaneDir: resolved.agentplaneDir,
288
- gitRoot,
289
- git,
290
- notesPath,
291
- corePkgPath,
292
- agentplanePkgPath,
293
- nextTag: plan.nextTag,
294
- nextVersion: plan.nextVersion,
295
- });
296
- return await finalizeReleaseApply({
297
- gitRoot,
298
- planDir,
299
- notesPath,
300
- plan,
301
- npmVersionChecked,
302
- releaseCommit,
303
- push: flags.push,
304
- remote: flags.remote,
325
+ }),
305
326
  });
306
327
  };
307
328
  export { pushReleaseRefs } from "./apply.reporting.js";
@@ -1 +1 @@
1
- {"version":3,"file":"plan.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/plan.command.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAM1E,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AA4IjD,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CA4E1D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,iBAAiB,CAqE5D,CAAC"}
1
+ {"version":3,"file":"plan.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/plan.command.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAO1E,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AA4IjD,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,iBAAiB,CA4E1D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,iBAAiB,CAqE5D,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { mkdir, readFile, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { resolveProject } from "@agentplaneorg/core";
4
+ import { createCliEmitter } from "../../cli/output.js";
4
5
  import { usageError } from "../../cli/spec/errors.js";
5
6
  import { exitCodeForError } from "../../cli/exit-codes.js";
6
7
  import { CliError } from "../../shared/errors.js";
7
8
  import { execFileAsync, gitEnv } from "../shared/git.js";
9
+ const output = createCliEmitter();
8
10
  function parseSemver(version) {
9
11
  const m = /^(\d+)\.(\d+)\.(\d+)$/u.exec(version.trim());
10
12
  if (!m)
@@ -229,8 +231,10 @@ export const runReleasePlan = async (ctx, flags) => {
229
231
  await writeFile(path.join(baseDir, "changes.json"), JSON.stringify(changes, null, 2) + "\n", "utf8");
230
232
  await writeFile(path.join(baseDir, "changes.md"), changesMarkdown(changes), "utf8");
231
233
  await writeFile(path.join(baseDir, "instructions.md"), releaseInstructions({ nextTag, prevTag, bump: flags.bump, minBullets }), "utf8");
232
- process.stdout.write(`Release plan written: ${path.relative(gitRoot, baseDir)}\n`);
233
- process.stdout.write(`Next tag: ${nextTag}\n`);
234
- process.stdout.write(`Hint: Create a DOCS task to write docs/releases/${nextTag}.md based on this plan.\n`);
234
+ output.lines([
235
+ `Release plan written: ${path.relative(gitRoot, baseDir)}`,
236
+ `Next tag: ${nextTag}`,
237
+ `Hint: Create a DOCS task to write docs/releases/${nextTag}.md based on this plan.`,
238
+ ]);
235
239
  return 0;
236
240
  };
@@ -1,5 +1,5 @@
1
1
  import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
- export type ReleaseGroupParsed = Record<string, never>;
3
- export declare const releaseSpec: CommandSpec<ReleaseGroupParsed>;
4
- export declare const runRelease: CommandHandler<ReleaseGroupParsed>;
2
+ import { type GroupCommandParsed } from "../../cli/group-command.js";
3
+ export declare const releaseSpec: CommandSpec<GroupCommandParsed>;
4
+ export declare const runRelease: CommandHandler<GroupCommandParsed>;
5
5
  //# sourceMappingURL=release.command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"release.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/release.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvD,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAYvD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAGzD,CAAC"}
1
+ {"version":3,"file":"release.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/release.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAOvD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAMzD,CAAC"}
@@ -1,18 +1,16 @@
1
- import { usageError } from "../../cli/spec/errors.js";
1
+ import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../../cli/group-command.js";
2
2
  export const releaseSpec = {
3
3
  id: ["release"],
4
4
  group: "Release",
5
5
  summary: "Prepare a release (agent-assisted notes + version bump workflow).",
6
6
  synopsis: ["agentplane release <command> [args] [options]"],
7
- validateRaw: (raw) => {
8
- if (raw.extra.length > 0) {
9
- throw usageError({ spec: releaseSpec, message: `Unknown subcommand: ${raw.extra[0]}` });
10
- }
11
- throw usageError({ spec: releaseSpec, message: "Missing subcommand." });
12
- },
13
- parse: () => ({}),
7
+ args: [{ name: "cmd", required: false, variadic: true, valueHint: "<command>" }],
8
+ parse: (raw) => parseGroupCommand(raw),
14
9
  };
15
- export const runRelease = () => {
16
- // Unreachable (validateRaw always throws).
17
- return Promise.resolve(2);
10
+ export const runRelease = async (_ctx, p) => {
11
+ throwGroupCommandUsage({
12
+ spec: releaseSpec,
13
+ cmd: p.cmd,
14
+ subcommands: await loadDirectSubcommandNames(["release"]),
15
+ });
18
16
  };
@@ -0,0 +1,20 @@
1
+ export declare function writePackageJson(root: string, relDir: string, data: Record<string, unknown>): Promise<void>;
2
+ export declare function writeReleaseNotes(root: string, version: string, body?: string): Promise<void>;
3
+ export declare function seedReleaseWorkspace(root: string, opts?: {
4
+ coreVersion?: string;
5
+ cliVersion?: string;
6
+ dependencyVersion?: string;
7
+ writeNotes?: boolean;
8
+ notesVersion?: string;
9
+ notesBody?: string;
10
+ }): Promise<void>;
11
+ export declare function initReleaseWorkspace(opts?: {
12
+ prefix?: string;
13
+ coreVersion?: string;
14
+ cliVersion?: string;
15
+ dependencyVersion?: string;
16
+ writeNotes?: boolean;
17
+ notesVersion?: string;
18
+ notesBody?: string;
19
+ }): Promise<string>;
20
+ //# sourceMappingURL=release.test-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.test-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/release.test-helpers.ts"],"names":[],"mappings":"AAIA,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,SAAc,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,GAAE;IACJ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,MAAM,CAAC,CAIjB"}
@@ -0,0 +1,37 @@
1
+ import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
2
+ import { tmpdir } from "node:os";
3
+ import path from "node:path";
4
+ export async function writePackageJson(root, relDir, data) {
5
+ const dir = path.join(root, relDir);
6
+ await mkdir(dir, { recursive: true });
7
+ await writeFile(path.join(dir, "package.json"), `${JSON.stringify(data, null, 2)}\n`, "utf8");
8
+ }
9
+ export async function writeReleaseNotes(root, version, body = "# Notes\n") {
10
+ const releasesDir = path.join(root, "docs", "releases");
11
+ await mkdir(releasesDir, { recursive: true });
12
+ await writeFile(path.join(releasesDir, `v${version}.md`), body, "utf8");
13
+ }
14
+ export async function seedReleaseWorkspace(root, opts = {}) {
15
+ const coreVersion = opts.coreVersion ?? "1.2.3";
16
+ const cliVersion = opts.cliVersion ?? coreVersion;
17
+ const dependencyVersion = opts.dependencyVersion ?? coreVersion;
18
+ await writePackageJson(root, "packages/core", {
19
+ name: "@agentplaneorg/core",
20
+ version: coreVersion,
21
+ });
22
+ await writePackageJson(root, "packages/agentplane", {
23
+ name: "agentplane",
24
+ version: cliVersion,
25
+ dependencies: {
26
+ "@agentplaneorg/core": dependencyVersion,
27
+ },
28
+ });
29
+ if (opts.writeNotes) {
30
+ await writeReleaseNotes(root, opts.notesVersion ?? cliVersion, opts.notesBody);
31
+ }
32
+ }
33
+ export async function initReleaseWorkspace(opts = {}) {
34
+ const root = await mkdtemp(path.join(tmpdir(), opts.prefix ?? "agentplane-release-"));
35
+ await seedReleaseWorkspace(root, opts);
36
+ return root;
37
+ }
@@ -1,11 +1,14 @@
1
1
  import type { CommandHandler, CommandSpec } from "../cli/spec/spec.js";
2
+ import { type GroupCommandParsed } from "../cli/group-command.js";
2
3
  import { type RepoCliVersionExpectation } from "../shared/repo-cli-version.js";
3
4
  import { type RuntimeSourceInfo } from "../shared/runtime-source.js";
4
5
  export type FrameworkDevWorkflow = {
5
6
  available: boolean;
6
- rebuildCommands: string[];
7
+ bootstrapCommand: string;
8
+ manualRepairCommands: string[];
9
+ repoLocalVerifyCommand: string;
7
10
  reinstallScript: string;
8
- verifyCommand: string;
11
+ globalVerifyCommand: string;
9
12
  forceGlobalExample: string;
10
13
  recommendation: string | null;
11
14
  };
@@ -13,16 +16,13 @@ export type RuntimeExplainPayload = RuntimeSourceInfo & {
13
16
  frameworkDev: FrameworkDevWorkflow;
14
17
  repoCliExpectation: RepoCliVersionExpectation;
15
18
  };
16
- export type RuntimeGroupParsed = {
17
- cmd: string[];
18
- };
19
19
  export type RuntimeExplainParsed = {
20
20
  json: boolean;
21
21
  };
22
- export declare const runtimeSpec: CommandSpec<RuntimeGroupParsed>;
22
+ export declare const runtimeSpec: CommandSpec<GroupCommandParsed>;
23
23
  export declare const runtimeExplainSpec: CommandSpec<RuntimeExplainParsed>;
24
24
  export declare function buildFrameworkDevWorkflow(report: RuntimeSourceInfo): FrameworkDevWorkflow;
25
25
  export declare function renderRuntimeExplainText(report: RuntimeSourceInfo, repoCliExpectation: RepoCliVersionExpectation): string;
26
- export declare const runRuntime: CommandHandler<RuntimeGroupParsed>;
26
+ export declare const runRuntime: CommandHandler<GroupCommandParsed>;
27
27
  export declare const runRuntimeExplain: CommandHandler<RuntimeExplainParsed>;
28
28
  //# sourceMappingURL=runtime.command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.command.d.ts","sourceRoot":"","sources":["../../src/commands/runtime.command.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,YAAY,EAAE,oBAAoB,CAAC;IACnC,kBAAkB,EAAE,yBAAyB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AACnD,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAQvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAoBhE,CAAC;AAMF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,oBAAoB,CAsCzF;AAgBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,kBAAkB,EAAE,yBAAyB,GAC5C,MAAM,CA2CR;AAyBD,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAazD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CAkBlE,CAAC"}
1
+ {"version":3,"file":"runtime.command.d.ts","sourceRoot":"","sources":["../../src/commands/runtime.command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,+BAA+B,CAAC;AASvC,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAIrC,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,YAAY,EAAE,oBAAoB,CAAC;IACnC,kBAAkB,EAAE,yBAAyB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAErD,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAQvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAoBhE,CAAC;AAMF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,oBAAoB,CAkCzF;AAgBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,kBAAkB,EAAE,yBAAyB,GAC5C,MAAM,CA+CR;AAyBD,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,kBAAkB,CAQzD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CAkBlE,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import { loadConfig, resolveProject } from "@agentplaneorg/core";
2
- import { usageError } from "../cli/spec/errors.js";
3
- import { suggestOne } from "../cli/spec/suggest.js";
2
+ import { createCliEmitter } from "../cli/output.js";
3
+ import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../cli/group-command.js";
4
4
  import { evaluateRepoCliVersionExpectation, } from "../shared/repo-cli-version.js";
5
+ import { FRAMEWORK_DEV_BOOTSTRAP_COMMAND, FRAMEWORK_DEV_FORCE_GLOBAL_EXAMPLE, FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND, FRAMEWORK_DEV_MANUAL_REPAIR_COMMANDS, FRAMEWORK_DEV_REINSTALL_SCRIPT, FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND, } from "../../bin/framework-dev-contract.js";
5
6
  import { describeRuntimeMode, resolveRuntimeSourceInfo, } from "../shared/runtime-source.js";
7
+ const output = createCliEmitter();
6
8
  export const runtimeSpec = {
7
9
  id: ["runtime"],
8
10
  group: "Diagnostics",
@@ -10,7 +12,7 @@ export const runtimeSpec = {
10
12
  synopsis: ["agentplane runtime <explain> [options]"],
11
13
  args: [{ name: "cmd", required: false, variadic: true, valueHint: "<cmd>" }],
12
14
  examples: [{ cmd: "agentplane runtime explain", why: "Show active runtime details." }],
13
- parse: (raw) => ({ cmd: (raw.args.cmd ?? []) }),
15
+ parse: (raw) => parseGroupCommand(raw),
14
16
  };
15
17
  export const runtimeExplainSpec = {
16
18
  id: ["runtime", "explain"],
@@ -38,36 +40,33 @@ function renderPath(value) {
38
40
  }
39
41
  export function buildFrameworkDevWorkflow(report) {
40
42
  const available = report.framework.inFrameworkCheckout;
41
- const reinstallScript = "scripts/reinstall-global-agentplane.sh";
42
- const rebuildCommands = [
43
- "bun run --filter=@agentplaneorg/core build",
44
- "bun run --filter=agentplane build",
45
- ];
46
- const verifyCommand = "agentplane runtime explain";
47
- const forceGlobalExample = "AGENTPLANE_USE_GLOBAL_IN_FRAMEWORK=1 agentplane <command>";
48
43
  if (!available) {
49
44
  return {
50
45
  available,
51
- rebuildCommands,
52
- reinstallScript,
53
- verifyCommand,
54
- forceGlobalExample,
46
+ bootstrapCommand: FRAMEWORK_DEV_BOOTSTRAP_COMMAND,
47
+ manualRepairCommands: [...FRAMEWORK_DEV_MANUAL_REPAIR_COMMANDS],
48
+ repoLocalVerifyCommand: FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND,
49
+ reinstallScript: FRAMEWORK_DEV_REINSTALL_SCRIPT,
50
+ globalVerifyCommand: FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND,
51
+ forceGlobalExample: FRAMEWORK_DEV_FORCE_GLOBAL_EXAMPLE,
55
52
  recommendation: null,
56
53
  };
57
54
  }
58
55
  const recommendation = report.mode === "repo-local" || report.mode === "repo-local-handoff"
59
- ? "Rebuild local packages after source changes; use the reinstall helper only when you need the global PATH command updated from this checkout."
56
+ ? "Run the framework bootstrap after fresh clones or dependency drift; use the reinstall helper only when the global PATH command itself should resolve this checkout."
60
57
  : report.mode === "global-in-framework"
61
- ? "Reinstall or update the global agentplane CLI from this checkout so the wrapper can hand off to the repo-local binary."
58
+ ? "Bootstrap the framework checkout first so the installed wrapper can hand off cleanly to the repo-local runtime."
62
59
  : report.mode === "global-forced-in-framework"
63
60
  ? "Unset AGENTPLANE_USE_GLOBAL_IN_FRAMEWORK=1 unless you intentionally need the global installed CLI inside the framework checkout."
64
- : "Use runtime explain after rebuild/reinstall to confirm which binary and package roots are active.";
61
+ : "Use the framework bootstrap command first, then verify the repo-local runtime and global wrapper explicitly.";
65
62
  return {
66
63
  available,
67
- rebuildCommands,
68
- reinstallScript,
69
- verifyCommand,
70
- forceGlobalExample,
64
+ bootstrapCommand: FRAMEWORK_DEV_BOOTSTRAP_COMMAND,
65
+ manualRepairCommands: [...FRAMEWORK_DEV_MANUAL_REPAIR_COMMANDS],
66
+ repoLocalVerifyCommand: FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND,
67
+ reinstallScript: FRAMEWORK_DEV_REINSTALL_SCRIPT,
68
+ globalVerifyCommand: FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND,
69
+ forceGlobalExample: FRAMEWORK_DEV_FORCE_GLOBAL_EXAMPLE,
71
70
  recommendation,
72
71
  };
73
72
  }
@@ -110,7 +109,7 @@ export function renderRuntimeExplainText(report, repoCliExpectation) {
110
109
  lines.push(`Handoff from: ${report.handoffFromBinaryPath}`);
111
110
  }
112
111
  if (frameworkDev.available) {
113
- lines.push("", "Framework dev workflow:", "1. Rebuild local packages after source changes:", ...frameworkDev.rebuildCommands.map((command) => ` - ${command}`), "2. If the global PATH install should resolve this checkout:", ` - ${frameworkDev.reinstallScript}`, "3. Re-verify the active runtime:", ` - ${frameworkDev.verifyCommand}`, "4. Optional: force the global installed CLI inside this checkout:", ` - ${frameworkDev.forceGlobalExample}`);
112
+ lines.push("", "Framework dev workflow:", "1. Canonical bootstrap:", ` - ${frameworkDev.bootstrapCommand}`, "2. Manual fallback:", ...frameworkDev.manualRepairCommands.map((command) => ` - ${command}`), "3. Verify the repo-local runtime directly:", ` - ${frameworkDev.repoLocalVerifyCommand}`, "4. If the global PATH install should resolve this checkout:", ` - ${frameworkDev.reinstallScript}`, "5. Re-verify the global wrapper:", ` - ${frameworkDev.globalVerifyCommand}`, "6. Optional: force the global installed CLI inside this checkout:", ` - ${frameworkDev.forceGlobalExample}`);
114
113
  if (frameworkDev.recommendation) {
115
114
  lines.push(`Recommendation: ${frameworkDev.recommendation}`);
116
115
  }
@@ -136,17 +135,14 @@ async function resolveRepoCliExpectation(opts) {
136
135
  };
137
136
  }
138
137
  }
139
- export const runRuntime = (_ctx, p) => {
140
- const input = p.cmd.join(" ");
141
- const suggestion = suggestOne(input, ["explain"]);
142
- const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
143
- const msg = p.cmd.length === 0 ? "Missing subcommand." : `Unknown subcommand: ${p.cmd[0]}.`;
144
- return Promise.reject(usageError({
138
+ export const runRuntime = async (_ctx, p) => {
139
+ throwGroupCommandUsage({
145
140
  spec: runtimeSpec,
141
+ cmd: p.cmd,
142
+ subcommands: await loadDirectSubcommandNames(["runtime"]),
146
143
  command: "runtime",
147
- message: `${msg}${suffix}`,
148
- context: { command: "runtime" },
149
- }));
144
+ contextCommand: "runtime",
145
+ });
150
146
  };
151
147
  export const runRuntimeExplain = (ctx, p) => {
152
148
  const report = resolveRuntimeSourceInfo({
@@ -160,10 +156,10 @@ export const runRuntimeExplain = (ctx, p) => {
160
156
  }).then((repoCliExpectation) => {
161
157
  const payload = { ...buildRuntimeExplainPayload(report), repoCliExpectation };
162
158
  if (p.json) {
163
- process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
159
+ output.json(payload);
164
160
  return 0;
165
161
  }
166
- process.stdout.write(`${renderRuntimeExplainText(report, repoCliExpectation)}\n`);
162
+ output.line(renderRuntimeExplainText(report, repoCliExpectation));
167
163
  return 0;
168
164
  });
169
165
  };
@@ -0,0 +1,8 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type ScenarioExecuteParsed = {
3
+ recipeId: string;
4
+ scenarioId: string;
5
+ };
6
+ export declare const scenarioExecuteSpec: CommandSpec<ScenarioExecuteParsed>;
7
+ export declare const runScenarioExecute: CommandHandler<ScenarioExecuteParsed>;
8
+ //# sourceMappingURL=execute.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.command.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/execute.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAa1E,MAAM,MAAM,qBAAqB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAG7E,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,qBAAqB,CAyBlE,CAAC;AAgBF,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,qBAAqB,CAuEpE,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { usageError } from "../../cli/spec/errors.js";
2
+ import { exitCodeForError } from "../../cli/exit-codes.js";
3
+ import { mapBackendError } from "../../cli/error-map.js";
4
+ import { createCliEmitter } from "../../cli/output.js";
5
+ import { loadCommandContext } from "../shared/task-backend.js";
6
+ import { executeTaskRunnerExecution } from "../../runner/usecases/task-run.js";
7
+ import { materializeRecipeScenarioTask } from "../../runner/usecases/scenario-materialize-task.js";
8
+ import { cmdTaskPlanApprove } from "../task/plan.js";
9
+ import { cmdTaskStartReady } from "../task/start-ready.js";
10
+ import { CliError } from "../../shared/errors.js";
11
+ const output = createCliEmitter();
12
+ export const scenarioExecuteSpec = {
13
+ id: ["scenario", "execute"],
14
+ group: "Scenario",
15
+ summary: "Materialize a recipe-backed task and execute it through the shared runner flow.",
16
+ description: "Resolves a recipe scenario, materializes a task from its explicit task_template, and executes the shared runner with recipe context bundled alongside the created task.",
17
+ args: [{ name: "id", required: true, valueHint: "<recipe:scenario>" }],
18
+ examples: [
19
+ {
20
+ cmd: "agentplane scenario execute viewer:demo",
21
+ why: "Create a task from the scenario template and execute it through the configured runner.",
22
+ },
23
+ ],
24
+ parse: (raw) => {
25
+ const id = String(raw.args.id ?? "");
26
+ const [recipeId, scenarioId] = id.split(":", 2);
27
+ if (!recipeId || !scenarioId) {
28
+ throw usageError({
29
+ spec: scenarioExecuteSpec,
30
+ command: "scenario execute",
31
+ message: `Invalid scenario id: ${id} (expected: <recipe:scenario>)`,
32
+ });
33
+ }
34
+ return { recipeId, scenarioId };
35
+ },
36
+ };
37
+ function renderScenarioExecuteStartBody(parsed, taskId) {
38
+ return (`Start: execute recipe scenario ${parsed.recipeId}:${parsed.scenarioId} through the shared runner ` +
39
+ `using materialized task ${taskId} and its explicit task_template.`);
40
+ }
41
+ function renderScenarioExecutePlanApprovalNote(parsed) {
42
+ return (`Materialized from recipe scenario ${parsed.recipeId}:${parsed.scenarioId} ` +
43
+ "for immediate shared-runner execution.");
44
+ }
45
+ export const runScenarioExecute = async (ctx, parsed) => {
46
+ try {
47
+ const commandCtx = await loadCommandContext({
48
+ cwd: ctx.cwd,
49
+ rootOverride: ctx.rootOverride ?? null,
50
+ });
51
+ const materialized = await materializeRecipeScenarioTask({
52
+ ctx: commandCtx,
53
+ cwd: ctx.cwd,
54
+ rootOverride: ctx.rootOverride ?? null,
55
+ recipe_id: parsed.recipeId,
56
+ scenario_id: parsed.scenarioId,
57
+ });
58
+ await cmdTaskPlanApprove({
59
+ ctx: commandCtx,
60
+ cwd: ctx.cwd,
61
+ rootOverride: ctx.rootOverride ?? undefined,
62
+ taskId: materialized.task_id,
63
+ by: "ORCHESTRATOR",
64
+ note: renderScenarioExecutePlanApprovalNote(parsed),
65
+ });
66
+ await cmdTaskStartReady({
67
+ ctx: commandCtx,
68
+ cwd: ctx.cwd,
69
+ rootOverride: ctx.rootOverride ?? undefined,
70
+ taskId: materialized.task_id,
71
+ author: materialized.task.owner,
72
+ body: renderScenarioExecuteStartBody(parsed, materialized.task_id),
73
+ force: false,
74
+ yes: false,
75
+ quiet: true,
76
+ });
77
+ const executed = await executeTaskRunnerExecution({
78
+ ctx: commandCtx,
79
+ cwd: ctx.cwd,
80
+ rootOverride: ctx.rootOverride ?? null,
81
+ task_id: materialized.task_id,
82
+ run_id: materialized.run_id,
83
+ recipe: materialized.recipe_context,
84
+ target: {
85
+ kind: "recipe_scenario",
86
+ recipe_id: parsed.recipeId,
87
+ scenario_id: parsed.scenarioId,
88
+ task_id: materialized.task_id,
89
+ },
90
+ });
91
+ output.info(`scenario executed: ${parsed.recipeId}:${parsed.scenarioId}`);
92
+ output.line(`task_id: ${materialized.task_id}`);
93
+ output.line(`run_id: ${executed.invocation.run_id}`);
94
+ output.line(`state: ${executed.bundle.execution.artifact_paths.state_path}`);
95
+ output.line(`events: ${executed.bundle.execution.artifact_paths.events_path}`);
96
+ output.line(`status: ${executed.result.status}`);
97
+ output.line(`runner_exit_code: ${executed.result.exit_code ?? "null"}`);
98
+ if (executed.result.stdout_summary) {
99
+ output.line(`stdout: ${executed.result.stdout_summary}`);
100
+ }
101
+ if (executed.result.stderr_summary) {
102
+ output.line(`stderr: ${executed.result.stderr_summary}`, "stderr");
103
+ }
104
+ return executed.result.status === "success"
105
+ ? 0
106
+ : (executed.result.exit_code ?? exitCodeForError("E_RUNTIME"));
107
+ }
108
+ catch (err) {
109
+ if (err instanceof CliError)
110
+ throw err;
111
+ throw mapBackendError(err, {
112
+ command: scenarioExecuteSpec.id.join(" "),
113
+ recipe_id: parsed.recipeId,
114
+ scenario_id: parsed.scenarioId,
115
+ });
116
+ }
117
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAkB3E,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAmKF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,GACb,oBAAoB,CAQtB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA2ChE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;CACvD,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/commands/scenario/impl/commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAkB3E,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AA2KF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,GACb,oBAAoB,CAQtB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA2ChE;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;CACvD,GAAG,OAAO,CAAC,MAAM,CAAC,CAuClB"}