agentplane 0.3.12 → 0.3.14

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 (376) hide show
  1. package/assets/RUNNER.md +1 -1
  2. package/assets/agents/ORCHESTRATOR.json +1 -1
  3. package/assets/agents/SKILL_EXTRACTOR.json +31 -0
  4. package/assets/codex-plugin/assets/header.png +0 -0
  5. package/assets/codex-plugin/assets/icon.svg +1 -0
  6. package/assets/codex-plugin/assets/logo.svg +1 -0
  7. package/assets/codex-plugin/skills/agentplane/SKILL.md +35 -0
  8. package/assets/framework.manifest.json +7 -0
  9. package/assets/policy/governance.md +4 -2
  10. package/assets/policy/incidents.md +4 -19
  11. package/assets/policy/workflow.branch_pr.md +10 -5
  12. package/assets/policy/workflow.release.md +5 -2
  13. package/dist/.build-manifest.json +409 -219
  14. package/dist/cli/exit-codes.d.ts.map +1 -1
  15. package/dist/cli/exit-codes.js +1 -0
  16. package/dist/cli/output.d.ts +29 -0
  17. package/dist/cli/output.d.ts.map +1 -1
  18. package/dist/cli/output.js +33 -0
  19. package/dist/cli/reason-codes.d.ts +1 -1
  20. package/dist/cli/reason-codes.d.ts.map +1 -1
  21. package/dist/cli/reason-codes.js +12 -0
  22. package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
  23. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  24. package/dist/cli/run-cli/command-catalog/core.js +36 -78
  25. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
  26. package/dist/cli/run-cli/command-catalog/lifecycle.js +4 -12
  27. package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
  28. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
  29. package/dist/cli/run-cli/command-catalog/project.js +27 -31
  30. package/dist/cli/run-cli/command-catalog/shared.d.ts +9 -6
  31. package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
  32. package/dist/cli/run-cli/command-catalog/shared.js +23 -6
  33. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
  34. package/dist/cli/run-cli/command-catalog/task.js +6 -18
  35. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  36. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  37. package/dist/cli/run-cli/commands/codex.d.ts +14 -0
  38. package/dist/cli/run-cli/commands/codex.d.ts.map +1 -0
  39. package/dist/cli/run-cli/commands/codex.js +100 -0
  40. package/dist/cli/run-cli/commands/core.d.ts +1 -0
  41. package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
  42. package/dist/cli/run-cli/commands/core.js +1 -0
  43. package/dist/cli/run-cli/commands/init/recipes.d.ts +9 -1
  44. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -1
  45. package/dist/cli/run-cli/commands/init/recipes.js +33 -22
  46. package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
  47. package/dist/cli/run-cli/commands/init.js +26 -21
  48. package/dist/cli/run-cli/error-guidance.js +20 -0
  49. package/dist/cli/run-cli.js +1 -1
  50. package/dist/cli/run-cli.test-helpers.d.ts +1 -74
  51. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  52. package/dist/cli/run-cli.test-helpers.js +1 -766
  53. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
  54. package/dist/commands/branch/cleanup-merged.js +5 -9
  55. package/dist/commands/branch/work-start.command.d.ts.map +1 -1
  56. package/dist/commands/branch/work-start.command.js +1 -0
  57. package/dist/commands/codex/plugin-install.d.ts +26 -0
  58. package/dist/commands/codex/plugin-install.d.ts.map +1 -0
  59. package/dist/commands/codex/plugin-install.js +209 -0
  60. package/dist/commands/commit.spec.d.ts.map +1 -1
  61. package/dist/commands/commit.spec.js +2 -0
  62. package/dist/commands/doctor/branch-pr.d.ts +1 -1
  63. package/dist/commands/doctor/branch-pr.d.ts.map +1 -1
  64. package/dist/commands/doctor/branch-pr.js +5 -2
  65. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  66. package/dist/commands/guard/impl/commands.js +4 -1
  67. package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
  68. package/dist/commands/guard/impl/comment-commit.js +2 -1
  69. package/dist/commands/guard/impl/env.d.ts +6 -0
  70. package/dist/commands/guard/impl/env.d.ts.map +1 -1
  71. package/dist/commands/guard/impl/env.js +41 -0
  72. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
  73. package/dist/commands/pr/integrate/cmd.js +81 -5
  74. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
  75. package/dist/commands/pr/integrate/internal/prepare.js +38 -7
  76. package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
  77. package/dist/commands/pr/internal/auto-commit.js +13 -7
  78. package/dist/commands/pr/internal/sync-branch.d.ts +36 -0
  79. package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -0
  80. package/dist/commands/pr/internal/sync-branch.js +113 -0
  81. package/dist/commands/pr/internal/sync-github.d.ts +28 -0
  82. package/dist/commands/pr/internal/sync-github.d.ts.map +1 -0
  83. package/dist/commands/pr/internal/sync-github.js +178 -0
  84. package/dist/commands/pr/internal/sync-model.d.ts +36 -0
  85. package/dist/commands/pr/internal/sync-model.d.ts.map +1 -0
  86. package/dist/commands/pr/internal/sync-model.js +1 -0
  87. package/dist/commands/pr/internal/sync-open-step.d.ts +10 -0
  88. package/dist/commands/pr/internal/sync-open-step.d.ts.map +1 -0
  89. package/dist/commands/pr/internal/sync-open-step.js +128 -0
  90. package/dist/commands/pr/internal/sync-support.d.ts +7 -0
  91. package/dist/commands/pr/internal/sync-support.d.ts.map +1 -0
  92. package/dist/commands/pr/internal/sync-support.js +29 -0
  93. package/dist/commands/pr/internal/sync-update-step.d.ts +6 -0
  94. package/dist/commands/pr/internal/sync-update-step.d.ts.map +1 -0
  95. package/dist/commands/pr/internal/sync-update-step.js +68 -0
  96. package/dist/commands/pr/internal/sync.d.ts +2 -6
  97. package/dist/commands/pr/internal/sync.d.ts.map +1 -1
  98. package/dist/commands/pr/internal/sync.js +83 -525
  99. package/dist/commands/pr/open.d.ts.map +1 -1
  100. package/dist/commands/pr/open.js +62 -7
  101. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  102. package/dist/commands/pr/pr.command.js +7 -2
  103. package/dist/commands/recipes/active.command.d.ts +7 -0
  104. package/dist/commands/recipes/active.command.d.ts.map +1 -0
  105. package/dist/commands/recipes/active.command.js +12 -0
  106. package/dist/commands/recipes/add.command.d.ts +8 -0
  107. package/dist/commands/recipes/add.command.d.ts.map +1 -0
  108. package/dist/commands/recipes/add.command.js +33 -0
  109. package/dist/commands/recipes/detach.command.d.ts +7 -0
  110. package/dist/commands/recipes/detach.command.d.ts.map +1 -0
  111. package/dist/commands/recipes/detach.command.js +19 -0
  112. package/dist/commands/recipes/disable.command.d.ts +7 -0
  113. package/dist/commands/recipes/disable.command.d.ts.map +1 -0
  114. package/dist/commands/recipes/disable.command.js +10 -0
  115. package/dist/commands/recipes/enable.command.d.ts +7 -0
  116. package/dist/commands/recipes/enable.command.d.ts.map +1 -0
  117. package/dist/commands/recipes/enable.command.js +10 -0
  118. package/dist/commands/recipes/explain-active.command.d.ts +5 -0
  119. package/dist/commands/recipes/explain-active.command.d.ts.map +1 -0
  120. package/dist/commands/recipes/explain-active.command.js +11 -0
  121. package/dist/commands/recipes/explain.command.d.ts.map +1 -1
  122. package/dist/commands/recipes/explain.command.js +4 -2
  123. package/dist/commands/recipes/impl/apply.d.ts +1 -1
  124. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  125. package/dist/commands/recipes/impl/apply.js +34 -16
  126. package/dist/commands/recipes/impl/commands/active.d.ts +6 -0
  127. package/dist/commands/recipes/impl/commands/active.d.ts.map +1 -0
  128. package/dist/commands/recipes/impl/commands/active.js +47 -0
  129. package/dist/commands/recipes/impl/commands/add.d.ts +8 -0
  130. package/dist/commands/recipes/impl/commands/add.d.ts.map +1 -0
  131. package/dist/commands/recipes/impl/commands/add.js +105 -0
  132. package/dist/commands/recipes/impl/commands/detach.d.ts +6 -0
  133. package/dist/commands/recipes/impl/commands/detach.d.ts.map +1 -0
  134. package/dist/commands/recipes/impl/commands/detach.js +99 -0
  135. package/dist/commands/recipes/impl/commands/disable.d.ts +6 -0
  136. package/dist/commands/recipes/impl/commands/disable.d.ts.map +1 -0
  137. package/dist/commands/recipes/impl/commands/disable.js +23 -0
  138. package/dist/commands/recipes/impl/commands/enable.d.ts +6 -0
  139. package/dist/commands/recipes/impl/commands/enable.d.ts.map +1 -0
  140. package/dist/commands/recipes/impl/commands/enable.js +41 -0
  141. package/dist/commands/recipes/impl/commands/explain-active.d.ts +5 -0
  142. package/dist/commands/recipes/impl/commands/explain-active.d.ts.map +1 -0
  143. package/dist/commands/recipes/impl/commands/explain-active.js +20 -0
  144. package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
  145. package/dist/commands/recipes/impl/commands/explain.js +83 -36
  146. package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
  147. package/dist/commands/recipes/impl/commands/info.js +39 -22
  148. package/dist/commands/recipes/impl/commands/install.d.ts +1 -1
  149. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  150. package/dist/commands/recipes/impl/commands/install.js +35 -42
  151. package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
  152. package/dist/commands/recipes/impl/commands/list-remote.js +2 -3
  153. package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
  154. package/dist/commands/recipes/impl/commands/list.js +13 -12
  155. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
  156. package/dist/commands/recipes/impl/commands/remove.js +12 -2
  157. package/dist/commands/recipes/impl/commands/update.d.ts +7 -0
  158. package/dist/commands/recipes/impl/commands/update.d.ts.map +1 -0
  159. package/dist/commands/recipes/impl/commands/update.js +107 -0
  160. package/dist/commands/recipes/impl/commands.d.ts +7 -0
  161. package/dist/commands/recipes/impl/commands.d.ts.map +1 -1
  162. package/dist/commands/recipes/impl/commands.js +7 -0
  163. package/dist/commands/recipes/impl/constants.d.ts +1 -14
  164. package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
  165. package/dist/commands/recipes/impl/constants.js +1 -18
  166. package/dist/commands/recipes/impl/index.d.ts +1 -1
  167. package/dist/commands/recipes/impl/index.d.ts.map +1 -1
  168. package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
  169. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  170. package/dist/commands/recipes/impl/installed-recipes.js +1 -2
  171. package/dist/commands/recipes/impl/mutation-transaction.d.ts +7 -0
  172. package/dist/commands/recipes/impl/mutation-transaction.d.ts.map +1 -0
  173. package/dist/commands/recipes/impl/mutation-transaction.js +47 -0
  174. package/dist/commands/recipes/impl/overlay-project.d.ts +48 -0
  175. package/dist/commands/recipes/impl/overlay-project.d.ts.map +1 -0
  176. package/dist/commands/recipes/impl/overlay-project.js +320 -0
  177. package/dist/commands/recipes/impl/paths.d.ts +17 -2
  178. package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
  179. package/dist/commands/recipes/impl/paths.js +20 -5
  180. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +5 -4
  181. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
  182. package/dist/commands/recipes/impl/project-installed-recipes.js +34 -76
  183. package/dist/commands/recipes/impl/project-recipe-state.d.ts +18 -0
  184. package/dist/commands/recipes/impl/project-recipe-state.d.ts.map +1 -0
  185. package/dist/commands/recipes/impl/project-recipe-state.js +94 -0
  186. package/dist/commands/recipes/impl/project-registry.d.ts +24 -0
  187. package/dist/commands/recipes/impl/project-registry.d.ts.map +1 -0
  188. package/dist/commands/recipes/impl/project-registry.js +124 -0
  189. package/dist/commands/recipes/impl/resolver.d.ts +1 -1
  190. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
  191. package/dist/commands/recipes/impl/resolver.js +6 -4
  192. package/dist/commands/recipes/impl/types.d.ts +1 -240
  193. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  194. package/dist/commands/recipes/impl/version.d.ts +5 -0
  195. package/dist/commands/recipes/impl/version.d.ts.map +1 -0
  196. package/dist/commands/recipes/impl/version.js +9 -0
  197. package/dist/commands/recipes/info.command.js +2 -2
  198. package/dist/commands/recipes/install.spec.js +4 -4
  199. package/dist/commands/recipes/list.command.js +4 -4
  200. package/dist/commands/recipes/remove.command.js +2 -2
  201. package/dist/commands/recipes/update.command.d.ts +8 -0
  202. package/dist/commands/recipes/update.command.d.ts.map +1 -0
  203. package/dist/commands/recipes/update.command.js +35 -0
  204. package/dist/commands/recipes.d.ts +10 -6
  205. package/dist/commands/recipes.d.ts.map +1 -1
  206. package/dist/commands/recipes.js +8 -5
  207. package/dist/commands/recipes.test-helpers.d.ts +3 -3
  208. package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
  209. package/dist/commands/recipes.test-helpers.js +105 -15
  210. package/dist/commands/release/apply.command.d.ts +1 -1
  211. package/dist/commands/release/apply.command.d.ts.map +1 -1
  212. package/dist/commands/release/apply.command.js +15 -379
  213. package/dist/commands/release/apply.mutation.d.ts +1 -0
  214. package/dist/commands/release/apply.mutation.d.ts.map +1 -1
  215. package/dist/commands/release/apply.mutation.js +24 -1
  216. package/dist/commands/release/apply.pipeline.d.ts +22 -0
  217. package/dist/commands/release/apply.pipeline.d.ts.map +1 -0
  218. package/dist/commands/release/apply.pipeline.js +371 -0
  219. package/dist/commands/release/apply.preflight.d.ts +2 -0
  220. package/dist/commands/release/apply.preflight.d.ts.map +1 -1
  221. package/dist/commands/release/apply.preflight.js +13 -4
  222. package/dist/commands/release/apply.types.d.ts +27 -0
  223. package/dist/commands/release/apply.types.d.ts.map +1 -1
  224. package/dist/commands/release.test-helpers.d.ts +4 -0
  225. package/dist/commands/release.test-helpers.d.ts.map +1 -1
  226. package/dist/commands/release.test-helpers.js +7 -0
  227. package/dist/commands/scenario/execute.command.js +4 -4
  228. package/dist/commands/scenario/impl/commands.js +4 -4
  229. package/dist/commands/scenario/info.command.js +4 -4
  230. package/dist/commands/scenario/list.command.js +3 -3
  231. package/dist/commands/scenario/run.command.js +5 -5
  232. package/dist/commands/scenario/scenario.command.js +7 -7
  233. package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
  234. package/dist/commands/shared/reconcile-check.js +2 -2
  235. package/dist/commands/shared/task-backend.d.ts +6 -1
  236. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  237. package/dist/commands/shared/task-backend.js +34 -2
  238. package/dist/commands/shared/task-handoff.d.ts +2 -1
  239. package/dist/commands/shared/task-handoff.d.ts.map +1 -1
  240. package/dist/commands/shared/task-handoff.js +15 -0
  241. package/dist/commands/shared/task-mutation.d.ts.map +1 -1
  242. package/dist/commands/shared/task-mutation.js +4 -4
  243. package/dist/commands/shared/task-store/intents.d.ts +34 -0
  244. package/dist/commands/shared/task-store/intents.d.ts.map +1 -0
  245. package/dist/commands/shared/task-store/intents.js +265 -0
  246. package/dist/commands/shared/task-store/readme.d.ts +28 -0
  247. package/dist/commands/shared/task-store/readme.d.ts.map +1 -0
  248. package/dist/commands/shared/task-store/readme.js +125 -0
  249. package/dist/commands/shared/task-store/store.d.ts +26 -0
  250. package/dist/commands/shared/task-store/store.d.ts.map +1 -0
  251. package/dist/commands/shared/task-store/store.js +105 -0
  252. package/dist/commands/shared/task-store/types.d.ts +94 -0
  253. package/dist/commands/shared/task-store/types.d.ts.map +1 -0
  254. package/dist/commands/shared/task-store/types.js +1 -0
  255. package/dist/commands/shared/task-store.d.ts +3 -109
  256. package/dist/commands/shared/task-store.d.ts.map +1 -1
  257. package/dist/commands/shared/task-store.js +2 -493
  258. package/dist/commands/task/block.d.ts.map +1 -1
  259. package/dist/commands/task/block.js +7 -2
  260. package/dist/commands/task/comment.d.ts.map +1 -1
  261. package/dist/commands/task/comment.js +7 -2
  262. package/dist/commands/task/finish-shared.d.ts.map +1 -1
  263. package/dist/commands/task/finish-shared.js +3 -3
  264. package/dist/commands/task/finish.d.ts.map +1 -1
  265. package/dist/commands/task/finish.js +102 -15
  266. package/dist/commands/task/handoff-show.command.d.ts.map +1 -1
  267. package/dist/commands/task/handoff-show.command.js +24 -0
  268. package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
  269. package/dist/commands/task/hosted-merge-sync.js +9 -4
  270. package/dist/commands/task/list.run.d.ts.map +1 -1
  271. package/dist/commands/task/list.run.js +14 -4
  272. package/dist/commands/task/new.command.d.ts.map +1 -1
  273. package/dist/commands/task/new.command.js +16 -2
  274. package/dist/commands/task/new.js +2 -2
  275. package/dist/commands/task/show.d.ts.map +1 -1
  276. package/dist/commands/task/show.js +3 -3
  277. package/dist/commands/task/update.d.ts.map +1 -1
  278. package/dist/commands/task/update.js +11 -3
  279. package/dist/runner/adapters/codex.d.ts.map +1 -1
  280. package/dist/runner/adapters/codex.js +3 -33
  281. package/dist/runner/adapters/custom.d.ts.map +1 -1
  282. package/dist/runner/adapters/custom.js +3 -30
  283. package/dist/runner/adapters/runtime-shared.d.ts +14 -0
  284. package/dist/runner/adapters/runtime-shared.d.ts.map +1 -0
  285. package/dist/runner/adapters/runtime-shared.js +36 -0
  286. package/dist/runner/context/base-prompt-sources.d.ts +30 -0
  287. package/dist/runner/context/base-prompt-sources.d.ts.map +1 -0
  288. package/dist/runner/context/base-prompt-sources.js +144 -0
  289. package/dist/runner/context/base-prompts.d.ts +5 -23
  290. package/dist/runner/context/base-prompts.d.ts.map +1 -1
  291. package/dist/runner/context/base-prompts.js +10 -358
  292. package/dist/runner/context/overlay-prompt-blocks.d.ts +7 -0
  293. package/dist/runner/context/overlay-prompt-blocks.d.ts.map +1 -0
  294. package/dist/runner/context/overlay-prompt-blocks.js +72 -0
  295. package/dist/runner/context/prompt-block-shared.d.ts +54 -0
  296. package/dist/runner/context/prompt-block-shared.d.ts.map +1 -0
  297. package/dist/runner/context/prompt-block-shared.js +106 -0
  298. package/dist/runner/context/recipe-context.d.ts +2 -1
  299. package/dist/runner/context/recipe-context.d.ts.map +1 -1
  300. package/dist/runner/context/recipe-context.js +41 -8
  301. package/dist/runner/context/recipe-prompt-blocks.d.ts +6 -0
  302. package/dist/runner/context/recipe-prompt-blocks.d.ts.map +1 -0
  303. package/dist/runner/context/recipe-prompt-blocks.js +143 -0
  304. package/dist/runner/types.d.ts +4 -0
  305. package/dist/runner/types.d.ts.map +1 -1
  306. package/dist/runner/usecases/scenario-materialize-task.js +2 -2
  307. package/dist/runner/usecases/task-run-inspect.js +2 -2
  308. package/dist/runner/usecases/task-run-lifecycle-shared.js +2 -2
  309. package/dist/runner/usecases/task-run.d.ts.map +1 -1
  310. package/dist/runner/usecases/task-run.js +6 -3
  311. package/dist/runtime/behavior/resolve.d.ts +2 -1
  312. package/dist/runtime/behavior/resolve.d.ts.map +1 -1
  313. package/dist/runtime/behavior/resolve.js +25 -5
  314. package/dist/runtime/behavior/types.d.ts +1 -0
  315. package/dist/runtime/behavior/types.d.ts.map +1 -1
  316. package/dist/runtime/capabilities/recipe.d.ts +2 -1
  317. package/dist/runtime/capabilities/recipe.d.ts.map +1 -1
  318. package/dist/runtime/capabilities/recipe.js +88 -28
  319. package/dist/runtime/execution-context.d.ts +63 -0
  320. package/dist/runtime/execution-context.d.ts.map +1 -0
  321. package/dist/{usecases/context/resolve-context.js → runtime/execution-context.js} +23 -26
  322. package/dist/runtime/incidents/advice-strategy.d.ts +15 -0
  323. package/dist/runtime/incidents/advice-strategy.d.ts.map +1 -0
  324. package/dist/runtime/incidents/advice-strategy.js +54 -0
  325. package/dist/runtime/incidents/plan-strategy.d.ts +9 -0
  326. package/dist/runtime/incidents/plan-strategy.d.ts.map +1 -0
  327. package/dist/runtime/incidents/plan-strategy.js +205 -0
  328. package/dist/runtime/incidents/registry-strategy.d.ts +6 -0
  329. package/dist/runtime/incidents/registry-strategy.d.ts.map +1 -0
  330. package/dist/runtime/incidents/registry-strategy.js +280 -0
  331. package/dist/runtime/incidents/resolve.d.ts +3 -25
  332. package/dist/runtime/incidents/resolve.d.ts.map +1 -1
  333. package/dist/runtime/incidents/resolve.js +3 -683
  334. package/dist/runtime/incidents/shared.d.ts +34 -0
  335. package/dist/runtime/incidents/shared.d.ts.map +1 -0
  336. package/dist/runtime/incidents/shared.js +171 -0
  337. package/dist/shared/errors.d.ts +1 -1
  338. package/dist/shared/errors.d.ts.map +1 -1
  339. package/dist/shared/runtime-source.d.ts.map +1 -1
  340. package/dist/shared/runtime-source.js +8 -3
  341. package/dist/testing/cli-harness/recipe-archives.d.ts +28 -0
  342. package/dist/testing/cli-harness/recipe-archives.d.ts.map +1 -0
  343. package/dist/testing/cli-harness/recipe-archives.js +374 -0
  344. package/dist/testing/cli-harness/stdio.d.ts +26 -0
  345. package/dist/testing/cli-harness/stdio.d.ts.map +1 -0
  346. package/dist/testing/cli-harness/stdio.js +84 -0
  347. package/dist/testing/cli-harness.d.ts +25 -0
  348. package/dist/testing/cli-harness.d.ts.map +1 -0
  349. package/dist/testing/cli-harness.js +313 -0
  350. package/dist/testing/index.d.ts +2 -0
  351. package/dist/testing/index.d.ts.map +1 -0
  352. package/dist/testing/index.js +1 -0
  353. package/package.json +7 -3
  354. package/dist/cli/recipes-bundled.d.ts +0 -10
  355. package/dist/cli/recipes-bundled.d.ts.map +0 -1
  356. package/dist/cli/recipes-bundled.js +0 -36
  357. package/dist/commands/recipes/impl/manifest.d.ts +0 -4
  358. package/dist/commands/recipes/impl/manifest.d.ts.map +0 -1
  359. package/dist/commands/recipes/impl/manifest.js +0 -229
  360. package/dist/commands/recipes/impl/normalize.d.ts +0 -8
  361. package/dist/commands/recipes/impl/normalize.d.ts.map +0 -1
  362. package/dist/commands/recipes/impl/normalize.js +0 -54
  363. package/dist/commands/recipes/impl/scenario.d.ts +0 -16
  364. package/dist/commands/recipes/impl/scenario.d.ts.map +0 -1
  365. package/dist/commands/recipes/impl/scenario.js +0 -262
  366. package/dist/recipes/bundled-recipes.d.ts +0 -17
  367. package/dist/recipes/bundled-recipes.d.ts.map +0 -1
  368. package/dist/recipes/bundled-recipes.js +0 -15
  369. package/dist/usecases/context/resolve-context.d.ts +0 -68
  370. package/dist/usecases/context/resolve-context.d.ts.map +0 -1
  371. package/dist/usecases/task/task-list-usecase.d.ts +0 -9
  372. package/dist/usecases/task/task-list-usecase.d.ts.map +0 -1
  373. package/dist/usecases/task/task-list-usecase.js +0 -17
  374. package/dist/usecases/task/task-new-usecase.d.ts +0 -9
  375. package/dist/usecases/task/task-new-usecase.d.ts.map +0 -1
  376. package/dist/usecases/task/task-new-usecase.js +0 -17
@@ -1,21 +1,24 @@
1
1
  import { generateKeyPairSync, sign } from "node:crypto";
2
- import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
2
+ import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
5
  import { afterEach, beforeEach, vi } from "vitest";
6
- import { cmdRecipeCachePruneParsed, cmdRecipeExplainParsed, cmdRecipeInfoParsed, cmdRecipeInstall, cmdRecipeListParsed, cmdRecipeListRemoteParsed, cmdRecipeRemoveParsed, } from "./recipes.js";
6
+ import { cmdRecipeAddParsed, cmdRecipeCachePruneParsed, cmdRecipeDetachParsed, cmdRecipeExplainParsed, cmdRecipeInfoParsed, cmdRecipeInstall, cmdRecipeListParsed, cmdRecipeListRemoteParsed, cmdRecipeRemoveParsed, cmdRecipeUpdateParsed, hashRecipeTree, } from "./recipes.js";
7
7
  import { cmdScenarioInfoParsed, cmdScenarioListParsed, cmdScenarioRunParsed } from "./scenario.js";
8
8
  import { exitCodeForError } from "../cli/exit-codes.js";
9
9
  import { parseCommandArgv } from "../cli/spec/parse.js";
10
10
  import { captureStdIO, createRecipeArchive, mkGitRepoRoot, writeDefaultConfig, } from "../cli/run-cli.test-helpers.js";
11
11
  import { CliError } from "../shared/errors.js";
12
12
  import { recipesCachePruneSpec } from "./recipes/cache-prune.command.js";
13
+ import { recipesAddSpec } from "./recipes/add.command.js";
13
14
  import { recipesExplainSpec } from "./recipes/explain.command.js";
14
15
  import { recipesInfoSpec } from "./recipes/info.command.js";
15
16
  import { recipesInstallSpec } from "./recipes/install.spec.js";
16
17
  import { recipesListRemoteSpec } from "./recipes/list-remote.command.js";
17
18
  import { recipesListSpec } from "./recipes/list.command.js";
19
+ import { recipesDetachSpec } from "./recipes/detach.command.js";
18
20
  import { recipesRemoveSpec } from "./recipes/remove.command.js";
21
+ import { recipesUpdateSpec } from "./recipes/update.command.js";
19
22
  import { scenarioInfoSpec } from "./scenario/info.command.js";
20
23
  import { scenarioListSpec } from "./scenario/list.command.js";
21
24
  import { scenarioRunSpec } from "./scenario/run.command.js";
@@ -73,16 +76,25 @@ export async function writeSignedIndex(indexPath, payload) {
73
76
  await writeFile(`${indexPath}.sig`, JSON.stringify(signature, null, 2), "utf8");
74
77
  }
75
78
  export function resolveProjectRecipeDir(projectDir, recipeId) {
76
- return path.join(projectDir, ".agentplane", "recipes", recipeId);
79
+ return path.join(projectDir, ".agentplane", "recipes", "packages", recipeId);
80
+ }
81
+ export function resolveProjectRecipesRegistryPath(projectDir) {
82
+ return path.join(projectDir, ".agentplane", "recipes", "registry.json");
77
83
  }
78
84
  function readStringFixtureValue(record, key, fallback) {
79
85
  const value = record[key];
80
86
  return typeof value === "string" ? value : fallback;
81
87
  }
82
88
  export async function writeInstalledRecipes(projectDir, recipes) {
83
- const recipesDir = path.join(projectDir, ".agentplane", "recipes");
89
+ const recipesHome = requireRecipesTempHome();
90
+ const recipesDir = path.join(recipesHome, "recipes-store");
84
91
  await rm(recipesDir, { recursive: true, force: true });
85
92
  await mkdir(recipesDir, { recursive: true });
93
+ const vendoredRecipesDir = path.join(projectDir, ".agentplane", "recipes", "packages");
94
+ await rm(vendoredRecipesDir, { recursive: true, force: true });
95
+ await mkdir(vendoredRecipesDir, { recursive: true });
96
+ const cachedEntries = [];
97
+ const registryEntries = [];
86
98
  for (const entry of recipes) {
87
99
  const record = entry;
88
100
  const manifest = record.manifest;
@@ -95,18 +107,20 @@ export async function writeInstalledRecipes(projectDir, recipes) {
95
107
  : Array.isArray(manifest.tags)
96
108
  ? manifest.tags
97
109
  : [];
98
- const recipeDir = resolveProjectRecipeDir(projectDir, recipeId);
110
+ const recipeDir = path.join(recipesDir, recipeId, recipeVersion);
99
111
  await mkdir(recipeDir, { recursive: true });
100
112
  await writeFile(path.join(recipeDir, "manifest.json"), JSON.stringify(manifest, null, 2), "utf8");
101
- await writeFile(path.join(recipeDir, ".install.json"), JSON.stringify({
102
- schema_version: 1,
113
+ const vendoredRecipeDir = resolveProjectRecipeDir(projectDir, recipeId);
114
+ await mkdir(vendoredRecipeDir, { recursive: true });
115
+ await writeFile(path.join(vendoredRecipeDir, "manifest.json"), JSON.stringify(manifest, null, 2), "utf8");
116
+ cachedEntries.push({
103
117
  id: recipeId,
104
118
  version: recipeVersion,
105
119
  source,
106
120
  installed_at: installedAt,
107
121
  tags,
108
- install_mode: "project-local",
109
- }, null, 2), "utf8");
122
+ manifest,
123
+ });
110
124
  const scenarios = Array.isArray(manifest.scenarios)
111
125
  ? manifest.scenarios.filter((scenario) => !!scenario && typeof scenario === "object")
112
126
  : [];
@@ -124,8 +138,10 @@ export async function writeInstalledRecipes(projectDir, recipes) {
124
138
  ? scenario.required_inputs.filter((entry) => typeof entry === "string")
125
139
  : [];
126
140
  const scenarioPath = path.join(recipeDir, scenarioFile);
141
+ const vendoredScenarioPath = path.join(vendoredRecipeDir, scenarioFile);
127
142
  await mkdir(path.dirname(scenarioPath), { recursive: true });
128
- await writeFile(scenarioPath, JSON.stringify({
143
+ await mkdir(path.dirname(vendoredScenarioPath), { recursive: true });
144
+ const scenarioPayload = JSON.stringify({
129
145
  schema_version: "1",
130
146
  id: scenarioId,
131
147
  summary: scenarioSummary,
@@ -138,9 +154,44 @@ export async function writeInstalledRecipes(projectDir, recipes) {
138
154
  inputs: scenarioInputs.map((name) => ({ name, type: "string" })),
139
155
  outputs: scenarioOutputs.map((name) => ({ name, type: "string" })),
140
156
  steps: [],
141
- }, null, 2), "utf8");
157
+ }, null, 2);
158
+ await writeFile(scenarioPath, scenarioPayload, "utf8");
159
+ await writeFile(vendoredScenarioPath, scenarioPayload, "utf8");
160
+ }
161
+ const tools = Array.isArray(manifest.tools)
162
+ ? manifest.tools.filter((tool) => !!tool && typeof tool === "object")
163
+ : [];
164
+ for (const tool of tools) {
165
+ const entrypoint = readStringFixtureValue(tool, "entrypoint", "").trim();
166
+ if (!entrypoint)
167
+ continue;
168
+ const toolSource = "console.log('ok');\n";
169
+ const toolPath = path.join(recipeDir, entrypoint);
170
+ const vendoredToolPath = path.join(vendoredRecipeDir, entrypoint);
171
+ await mkdir(path.dirname(toolPath), { recursive: true });
172
+ await mkdir(path.dirname(vendoredToolPath), { recursive: true });
173
+ await writeFile(toolPath, toolSource, "utf8");
174
+ await writeFile(vendoredToolPath, toolSource, "utf8");
142
175
  }
176
+ registryEntries.push({
177
+ id: recipeId,
178
+ version: recipeVersion,
179
+ path: `packages/${recipeId}`,
180
+ active: false,
181
+ materialization: "copy",
182
+ source_ref: source,
183
+ source_sha256: await hashRecipeTree(recipeDir),
184
+ vendored_sha256: await hashRecipeTree(vendoredRecipeDir),
185
+ installed_at: installedAt,
186
+ tags,
187
+ });
143
188
  }
189
+ await writeInstalledRecipesRegistry(cachedEntries);
190
+ await writeFile(resolveProjectRecipesRegistryPath(projectDir), JSON.stringify({
191
+ schema_version: 1,
192
+ updated_at: "2026-02-05T00:00:00Z",
193
+ recipes: registryEntries,
194
+ }, null, 2), "utf8");
144
195
  }
145
196
  export async function writeInstalledRecipesRegistry(recipes) {
146
197
  const recipesHome = requireRecipesTempHome();
@@ -155,8 +206,7 @@ export function skillEntry(overrides) {
155
206
  return {
156
207
  id: "RECIPE_SKILL",
157
208
  summary: "Recipe skill",
158
- kind: "agent-skill",
159
- file: "skills/recipe.json",
209
+ file: "skills/recipe.md",
160
210
  ...overrides,
161
211
  };
162
212
  }
@@ -177,7 +227,7 @@ export function agentEntry(overrides) {
177
227
  summary: "Recipe agent",
178
228
  skills: ["RECIPE_SKILL"],
179
229
  tools: ["RECIPE_TOOL"],
180
- file: "agents/recipe.json",
230
+ file: "agents/recipe.md",
181
231
  ...overrides,
182
232
  };
183
233
  }
@@ -247,6 +297,20 @@ export async function installRecipe(opts) {
247
297
  command: "install",
248
298
  args: ["--path", archivePath],
249
299
  });
300
+ if (opts.vendor ?? true) {
301
+ const recipesHome = process.env.AGENTPLANE_HOME?.trim() ?? requireRecipesTempHome();
302
+ const installed = JSON.parse(await readFile(path.join(recipesHome, "recipes.json"), "utf8"));
303
+ const latest = installed.recipes?.at(-1);
304
+ if (!latest)
305
+ throw new Error("cached recipe registry unexpectedly empty after install");
306
+ await runRecipesTest({
307
+ cwd: opts.projectDir,
308
+ command: "add",
309
+ args: opts.mode
310
+ ? [`${latest.id}@${latest.version}`, "--mode", opts.mode]
311
+ : [`${latest.id}@${latest.version}`],
312
+ });
313
+ }
250
314
  }
251
315
  finally {
252
316
  io.restore();
@@ -271,7 +335,7 @@ export async function createInstalledRecipeProject(opts = {}) {
271
335
  };
272
336
  }
273
337
  export function resolveInstalledScenarioPath(projectDir, recipeId, scenarioFile = path.join("scenarios", "recipe-scenario.json")) {
274
- return path.join(projectDir, ".agentplane", "recipes", recipeId, scenarioFile);
338
+ return path.join(projectDir, ".agentplane", "recipes", "packages", recipeId, scenarioFile);
275
339
  }
276
340
  export async function runRecipesTest(opts) {
277
341
  if (!opts.command) {
@@ -318,6 +382,15 @@ export async function runRecipesTest(opts) {
318
382
  const parsed = parseCommandArgv(recipesInstallSpec, opts.args).parsed;
319
383
  return await cmdRecipeInstall({ cwd: opts.cwd, rootOverride: opts.rootOverride, ...parsed });
320
384
  }
385
+ case "add": {
386
+ const parsed = parseCommandArgv(recipesAddSpec, opts.args).parsed;
387
+ return await cmdRecipeAddParsed({
388
+ cwd: opts.cwd,
389
+ rootOverride: opts.rootOverride,
390
+ recipeRef: parsed.recipeRef,
391
+ mode: parsed.mode,
392
+ });
393
+ }
321
394
  case "remove": {
322
395
  const parsed = parseCommandArgv(recipesRemoveSpec, opts.args).parsed;
323
396
  return await cmdRecipeRemoveParsed({
@@ -326,6 +399,23 @@ export async function runRecipesTest(opts) {
326
399
  id: parsed.id,
327
400
  });
328
401
  }
402
+ case "update": {
403
+ const parsed = parseCommandArgv(recipesUpdateSpec, opts.args).parsed;
404
+ return await cmdRecipeUpdateParsed({
405
+ cwd: opts.cwd,
406
+ rootOverride: opts.rootOverride,
407
+ id: parsed.id,
408
+ force: parsed.force,
409
+ });
410
+ }
411
+ case "detach": {
412
+ const parsed = parseCommandArgv(recipesDetachSpec, opts.args).parsed;
413
+ return await cmdRecipeDetachParsed({
414
+ cwd: opts.cwd,
415
+ rootOverride: opts.rootOverride,
416
+ id: parsed.id,
417
+ });
418
+ }
329
419
  case "cache": {
330
420
  const [sub, ...tail] = opts.args;
331
421
  if (sub !== "prune") {
@@ -4,5 +4,5 @@ export declare const releaseApplySpec: CommandSpec<ReleaseApplyParsed>;
4
4
  export declare const releaseCandidateSpec: CommandSpec<ReleaseApplyParsed>;
5
5
  export declare const runReleaseApply: CommandHandler<ReleaseApplyParsed>;
6
6
  export declare const runReleaseCandidate: CommandHandler<ReleaseApplyParsed>;
7
- export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.reporting.js";
7
+ export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.pipeline.js";
8
8
  //# sourceMappingURL=apply.command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAoC1E,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,kBAAkB,CAAC;AA8c1B,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CA0E5D,CAAC;AAgCF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,kBAAkB,CAuChE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAwF9D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,kBAAkB,CAwFlE,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"apply.command.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.command.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1E,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,kBAAkB,CAAC;AAgM9E,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CA0E5D,CAAC;AAgCF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,kBAAkB,CAuChE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAQ9D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,kBAAkB,CAQlE,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,114 +1,10 @@
1
- import path from "node:path";
2
- import { extractTaskSuffix, loadConfig, resolveBaseBranch, resolveProject, } from "@agentplaneorg/core";
3
- import { createCliEmitter } from "../../cli/output.js";
1
+ import { loadConfig, resolveBaseBranch } from "@agentplaneorg/core";
4
2
  import { exitCodeForError } from "../../cli/exit-codes.js";
5
3
  import { usageError } from "../../cli/spec/errors.js";
6
4
  import { withDiagnosticContext } from "../../shared/diagnostics.js";
7
5
  import { CliError } from "../../shared/errors.js";
8
- import { execFileAsync, gitEnv } from "../shared/git.js";
9
- import { GitContext } from "../shared/git-context.js";
10
6
  import { gitCurrentBranch } from "../shared/git-ops.js";
11
- import { parseTaskIdFromBranch } from "../shared/git-worktree.js";
12
- import { ensureActionApproved } from "../shared/approval-requirements.js";
13
- import { ensureNetworkApproved } from "../shared/network-approval.js";
14
- import { runOperatorPipeline } from "../shared/operator-pipeline.js";
15
- import { cleanHookEnv, maybePersistExpectedCliVersion, maybeRefreshGeneratedReference, maybeUpdateBunLockfile, replaceAgentplanePackageMetadata, replacePackageVersionInFile, } from "./apply.mutation.js";
16
- import { ensureCleanTrackedTree, ensureNpmVersionsAvailable, ensureRemoteExists, ensureRemoteTagDoesNotExist, ensureTagDoesNotExist, fileExists, loadReleasePlan, readCoreDependencyVersion, readPackageVersion, runReleasePrepublishGate, validateReleaseNotes, } from "./apply.preflight.js";
17
- import { pushReleaseCandidateBranch, pushReleaseRefs, writeReleaseApplyReport, } from "./apply.reporting.js";
18
- const output = createCliEmitter();
19
- async function resolveReleasePlanInputs(opts) {
20
- const { planDir, plan, minBullets } = await loadReleasePlan({
21
- gitRoot: opts.gitRoot,
22
- planOverride: opts.planOverride,
23
- });
24
- if (!/^v\d+\.\d+\.\d+$/u.test(plan.nextTag)) {
25
- throw new CliError({
26
- exitCode: exitCodeForError("E_VALIDATION"),
27
- code: "E_VALIDATION",
28
- message: `Invalid nextTag in version.json (expected vX.Y.Z): ${plan.nextTag}`,
29
- });
30
- }
31
- const notesPath = path.join(opts.gitRoot, "docs", "releases", `${plan.nextTag}.md`);
32
- if (!(await fileExists(notesPath))) {
33
- throw new CliError({
34
- exitCode: exitCodeForError("E_IO"),
35
- code: "E_IO",
36
- message: `Missing release notes: ${path.relative(opts.gitRoot, notesPath)}\n` +
37
- "Write this file using a DOCS agent before applying the release.",
38
- });
39
- }
40
- await validateReleaseNotes(notesPath, minBullets);
41
- return { planDir, plan, notesPath, minBullets };
42
- }
43
- async function ensureReleasePlanMatchesRepoState(opts) {
44
- const [coreVersion, agentplaneVersion, coreDependencyVersion] = await Promise.all([
45
- readPackageVersion(opts.corePkgPath),
46
- readPackageVersion(opts.agentplanePkgPath),
47
- readCoreDependencyVersion(opts.agentplanePkgPath),
48
- ]);
49
- if (coreVersion !== agentplaneVersion) {
50
- throw new CliError({
51
- exitCode: exitCodeForError("E_VALIDATION"),
52
- code: "E_VALIDATION",
53
- message: `Package versions must match before applying a release. ` +
54
- `packages/core=${coreVersion} packages/agentplane=${agentplaneVersion}`,
55
- });
56
- }
57
- if (coreDependencyVersion !== coreVersion) {
58
- throw new CliError({
59
- exitCode: exitCodeForError("E_VALIDATION"),
60
- code: "E_VALIDATION",
61
- message: "Release dependency parity check failed before apply. " +
62
- `packages/agentplane dependency @agentplaneorg/core=${coreDependencyVersion} ` +
63
- `must match packages/core version ${coreVersion}.`,
64
- });
65
- }
66
- await ensureCleanTrackedTree(opts.gitRoot);
67
- await ensureTagDoesNotExist(opts.gitRoot, opts.plan.nextTag);
68
- if (coreVersion !== opts.plan.prevVersion) {
69
- throw new CliError({
70
- exitCode: exitCodeForError("E_VALIDATION"),
71
- code: "E_VALIDATION",
72
- message: `Current version does not match the release-plan baseline. ` +
73
- `current=${coreVersion} expected_prev=${opts.plan.prevVersion} expected_next=${opts.plan.nextVersion}\n` +
74
- "Re-run `agentplane release plan` to generate a fresh plan for this repo state.",
75
- context: withDiagnosticContext({ command: "release apply" }, {
76
- state: "the repository version no longer matches the prepared release-plan baseline",
77
- likelyCause: "package versions changed after the plan was generated, so continuing would apply the release over a partially drifted local state",
78
- nextAction: {
79
- command: "agentplane release plan",
80
- reason: "generate a fresh release plan from the current repository state before applying the release",
81
- reasonCode: "release_plan_drifted",
82
- },
83
- }),
84
- });
85
- }
86
- }
87
- async function runPushPreflight(opts) {
88
- const loaded = await loadConfig(opts.agentplaneDir);
89
- const pushReason = opts.route.kind === "release_candidate"
90
- ? `${opts.commandLabel} will push current branch ${opts.route.current_branch} to ${opts.remote} as a release candidate for ${opts.nextTag}; final publication remains gated on merge to ${opts.route.base_branch}`
91
- : `${opts.commandLabel} will push HEAD and ${opts.nextTag} to ${opts.remote}`;
92
- await ensureNetworkApproved({
93
- action: opts.route.kind === "release_candidate" ? "release_candidate" : "release_apply",
94
- config: loaded.config,
95
- yes: opts.yes,
96
- reason: `${opts.commandLabel} validates npm version availability and pushes over network`,
97
- interactive: Boolean(process.stdin.isTTY),
98
- });
99
- await ensureActionApproved({
100
- action: "git_push",
101
- config: loaded.config,
102
- yes: opts.yes,
103
- reason: pushReason,
104
- interactive: Boolean(process.stdin.isTTY),
105
- });
106
- await ensureRemoteExists(opts.gitRoot, opts.remote);
107
- await ensureRemoteTagDoesNotExist(opts.gitRoot, opts.remote, opts.nextTag);
108
- await ensureNpmVersionsAvailable(opts.gitRoot, opts.nextVersion);
109
- await runReleasePrepublishGate(opts.gitRoot);
110
- return true;
111
- }
7
+ import { runReleaseCommandPipeline } from "./apply.pipeline.js";
112
8
  async function resolveDirectReleaseRoute(opts) {
113
9
  const loaded = await loadConfig(opts.agentplaneDir);
114
10
  const workflowMode = loaded.config.workflow_mode;
@@ -243,112 +139,6 @@ async function resolveReleaseCandidateRoute(opts) {
243
139
  base_branch: baseBranch,
244
140
  };
245
141
  }
246
- async function applyReleaseMutation(opts) {
247
- let releaseCommit = null;
248
- await Promise.all([
249
- replacePackageVersionInFile(opts.corePkgPath, opts.nextVersion),
250
- replaceAgentplanePackageMetadata(opts.agentplanePkgPath, opts.nextVersion),
251
- ]);
252
- const expectedCliVersionPersisted = await maybePersistExpectedCliVersion(opts.agentplaneDir, opts.nextVersion);
253
- await maybeUpdateBunLockfile(opts.gitRoot, fileExists);
254
- const generatedReferenceExists = await maybeRefreshGeneratedReference(opts.gitRoot, fileExists);
255
- const stagePaths = [
256
- "packages/core/package.json",
257
- "packages/agentplane/package.json",
258
- path.relative(opts.gitRoot, opts.notesPath),
259
- ];
260
- if (expectedCliVersionPersisted) {
261
- stagePaths.push(".agentplane/config.json");
262
- }
263
- if (generatedReferenceExists) {
264
- stagePaths.push("docs/reference/generated-reference.mdx");
265
- }
266
- if (await fileExists(path.join(opts.gitRoot, "bun.lock"))) {
267
- stagePaths.push("bun.lock");
268
- }
269
- await opts.git.stage(stagePaths);
270
- const staged = await opts.git.statusStagedPaths();
271
- if (staged.length === 0) {
272
- output.line("No changes to commit.");
273
- return { releaseCommit };
274
- }
275
- const taskId = opts.route.kind === "release_candidate"
276
- ? parseTaskIdFromBranch(opts.taskBranchPrefix, opts.route.current_branch)
277
- : null;
278
- const subject = taskId
279
- ? `✨ ${extractTaskSuffix(taskId)} release: publish ${opts.nextTag}`
280
- : `✨ release: publish ${opts.nextTag}`;
281
- await opts.git.commit({ message: subject, env: cleanHookEnv() });
282
- const { stdout: headHash } = await execFileAsync("git", ["rev-parse", "HEAD"], {
283
- cwd: opts.gitRoot,
284
- env: gitEnv(),
285
- });
286
- releaseCommit = { hash: String(headHash ?? "").trim(), subject };
287
- return { releaseCommit };
288
- }
289
- async function finalizeReleaseApply(opts) {
290
- const tagCreated = opts.route.kind === "direct_release";
291
- const pushedRefs = [];
292
- if (tagCreated) {
293
- await execFileAsync("git", ["tag", opts.plan.nextTag], {
294
- cwd: opts.gitRoot,
295
- env: gitEnv(),
296
- });
297
- output.line(`Release tag created: ${opts.plan.nextTag}`);
298
- }
299
- else {
300
- output.line(`Release candidate prepared on ${opts.route.current_branch}; skipped local tag creation for ${opts.plan.nextTag} because final publication is deferred until merge to ${opts.route.base_branch}.`);
301
- }
302
- if (opts.push) {
303
- if (opts.route.kind === "release_candidate") {
304
- await pushReleaseCandidateBranch(opts.gitRoot, opts.remote);
305
- pushedRefs.push("HEAD");
306
- output.line(`Pushed: ${opts.remote} ${opts.route.current_branch} (release candidate branch only; no tag pushed)`);
307
- }
308
- else {
309
- await pushReleaseRefs(opts.gitRoot, opts.remote, opts.plan.nextTag);
310
- pushedRefs.push("HEAD", opts.plan.nextTag);
311
- output.line(`Pushed: ${opts.remote} HEAD + ${opts.plan.nextTag}`);
312
- }
313
- }
314
- else if (opts.route.kind === "release_candidate") {
315
- output.line(`Next: git push <remote> HEAD # merge ${opts.route.current_branch} into ${opts.route.base_branch} before publishing ${opts.plan.nextTag}`);
316
- }
317
- else {
318
- output.line(`Next: git push <remote> HEAD && git push <remote> ${opts.plan.nextTag}`);
319
- }
320
- const reportPath = await writeReleaseApplyReport(opts.gitRoot, {
321
- applied_at: new Date().toISOString(),
322
- plan_dir: path.relative(opts.gitRoot, opts.planDir),
323
- notes_path: path.relative(opts.gitRoot, opts.notesPath),
324
- prev_version: opts.plan.prevVersion,
325
- next_version: opts.plan.nextVersion,
326
- prev_tag: opts.plan.prevTag,
327
- next_tag: opts.plan.nextTag,
328
- bump: opts.plan.bump,
329
- checks: {
330
- clean_tracked_tree: true,
331
- tag_absent: true,
332
- notes_validated: true,
333
- npm_version_available_checked: opts.npmVersionChecked,
334
- },
335
- commit: opts.releaseCommit,
336
- route: opts.route,
337
- tag: {
338
- name: opts.plan.nextTag,
339
- created: tagCreated,
340
- pushed: tagCreated && opts.push,
341
- },
342
- push: {
343
- requested: opts.push,
344
- remote: opts.remote,
345
- performed: pushedRefs.length > 0,
346
- refs: pushedRefs,
347
- },
348
- });
349
- output.line(`Release report: ${path.relative(opts.gitRoot, reportPath)}`);
350
- return 0;
351
- }
352
142
  export const releaseApplySpec = {
353
143
  id: ["release", "apply"],
354
144
  group: "Release",
@@ -485,175 +275,21 @@ export const releaseCandidateSpec = {
485
275
  ],
486
276
  };
487
277
  export const runReleaseApply = async (ctx, flags) => {
488
- return await runOperatorPipeline({
489
- init: async () => {
490
- const resolved = await resolveProject({
491
- cwd: ctx.cwd,
492
- rootOverride: ctx.rootOverride ?? null,
493
- });
494
- const gitRoot = resolved.gitRoot;
495
- const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
496
- gitRoot,
497
- planOverride: flags.plan,
498
- });
499
- const loaded = await loadConfig(resolved.agentplaneDir);
500
- return {
501
- resolved,
502
- gitRoot,
503
- planDir,
504
- plan,
505
- notesPath,
506
- taskBranchPrefix: loaded.config.branch.task_prefix,
507
- route: await resolveDirectReleaseRoute({
508
- cwd: ctx.cwd,
509
- rootOverride: ctx.rootOverride ?? null,
510
- gitRoot,
511
- agentplaneDir: resolved.agentplaneDir,
512
- }),
513
- corePkgPath: path.join(gitRoot, "packages", "core", "package.json"),
514
- agentplanePkgPath: path.join(gitRoot, "packages", "agentplane", "package.json"),
515
- npmVersionChecked: false,
516
- };
517
- },
518
- preflight: async (state) => {
519
- if ((state.plan.bump === "minor" || state.plan.bump === "major") && flags.yes !== true) {
520
- throw usageError({
521
- spec: releaseApplySpec,
522
- command: "release apply",
523
- message: `Bump '${state.plan.bump}' requires explicit approval. Re-run with --yes.`,
524
- });
525
- }
526
- await ensureReleasePlanMatchesRepoState({
527
- gitRoot: state.gitRoot,
528
- plan: state.plan,
529
- corePkgPath: state.corePkgPath,
530
- agentplanePkgPath: state.agentplanePkgPath,
531
- });
532
- if (flags.push) {
533
- state.npmVersionChecked = await runPushPreflight({
534
- agentplaneDir: state.resolved.agentplaneDir,
535
- gitRoot: state.gitRoot,
536
- remote: flags.remote,
537
- nextTag: state.plan.nextTag,
538
- nextVersion: state.plan.nextVersion,
539
- route: state.route,
540
- yes: flags.yes,
541
- commandLabel: "release apply --push",
542
- });
543
- }
544
- },
545
- execute: async (state) => {
546
- const git = new GitContext({ gitRoot: state.gitRoot });
547
- return await applyReleaseMutation({
548
- agentplaneDir: state.resolved.agentplaneDir,
549
- gitRoot: state.gitRoot,
550
- git,
551
- notesPath: state.notesPath,
552
- corePkgPath: state.corePkgPath,
553
- agentplanePkgPath: state.agentplanePkgPath,
554
- nextTag: state.plan.nextTag,
555
- nextVersion: state.plan.nextVersion,
556
- route: state.route,
557
- taskBranchPrefix: state.taskBranchPrefix,
558
- });
559
- },
560
- finalize: async (state, mutation) => await finalizeReleaseApply({
561
- gitRoot: state.gitRoot,
562
- planDir: state.planDir,
563
- notesPath: state.notesPath,
564
- plan: state.plan,
565
- npmVersionChecked: state.npmVersionChecked,
566
- releaseCommit: mutation.releaseCommit,
567
- route: state.route,
568
- push: flags.push,
569
- remote: flags.remote,
570
- }),
278
+ return await runReleaseCommandPipeline({
279
+ ctx,
280
+ flags,
281
+ spec: releaseApplySpec,
282
+ commandLabel: "release apply",
283
+ routeResolver: resolveDirectReleaseRoute,
571
284
  });
572
285
  };
573
286
  export const runReleaseCandidate = async (ctx, flags) => {
574
- return await runOperatorPipeline({
575
- init: async () => {
576
- const resolved = await resolveProject({
577
- cwd: ctx.cwd,
578
- rootOverride: ctx.rootOverride ?? null,
579
- });
580
- const gitRoot = resolved.gitRoot;
581
- const { planDir, plan, notesPath } = await resolveReleasePlanInputs({
582
- gitRoot,
583
- planOverride: flags.plan,
584
- });
585
- const loaded = await loadConfig(resolved.agentplaneDir);
586
- return {
587
- resolved,
588
- gitRoot,
589
- planDir,
590
- plan,
591
- notesPath,
592
- taskBranchPrefix: loaded.config.branch.task_prefix,
593
- route: await resolveReleaseCandidateRoute({
594
- cwd: ctx.cwd,
595
- rootOverride: ctx.rootOverride ?? null,
596
- gitRoot,
597
- agentplaneDir: resolved.agentplaneDir,
598
- }),
599
- corePkgPath: path.join(gitRoot, "packages", "core", "package.json"),
600
- agentplanePkgPath: path.join(gitRoot, "packages", "agentplane", "package.json"),
601
- npmVersionChecked: false,
602
- };
603
- },
604
- preflight: async (state) => {
605
- if ((state.plan.bump === "minor" || state.plan.bump === "major") && flags.yes !== true) {
606
- throw usageError({
607
- spec: releaseCandidateSpec,
608
- command: "release candidate",
609
- message: `Bump '${state.plan.bump}' requires explicit approval. Re-run with --yes.`,
610
- });
611
- }
612
- await ensureReleasePlanMatchesRepoState({
613
- gitRoot: state.gitRoot,
614
- plan: state.plan,
615
- corePkgPath: state.corePkgPath,
616
- agentplanePkgPath: state.agentplanePkgPath,
617
- });
618
- if (flags.push) {
619
- state.npmVersionChecked = await runPushPreflight({
620
- agentplaneDir: state.resolved.agentplaneDir,
621
- gitRoot: state.gitRoot,
622
- remote: flags.remote,
623
- nextTag: state.plan.nextTag,
624
- nextVersion: state.plan.nextVersion,
625
- route: state.route,
626
- yes: flags.yes,
627
- commandLabel: "release candidate --push",
628
- });
629
- }
630
- },
631
- execute: async (state) => {
632
- const git = new GitContext({ gitRoot: state.gitRoot });
633
- return await applyReleaseMutation({
634
- agentplaneDir: state.resolved.agentplaneDir,
635
- gitRoot: state.gitRoot,
636
- git,
637
- notesPath: state.notesPath,
638
- corePkgPath: state.corePkgPath,
639
- agentplanePkgPath: state.agentplanePkgPath,
640
- nextTag: state.plan.nextTag,
641
- nextVersion: state.plan.nextVersion,
642
- route: state.route,
643
- taskBranchPrefix: state.taskBranchPrefix,
644
- });
645
- },
646
- finalize: async (state, mutation) => await finalizeReleaseApply({
647
- gitRoot: state.gitRoot,
648
- planDir: state.planDir,
649
- notesPath: state.notesPath,
650
- plan: state.plan,
651
- npmVersionChecked: state.npmVersionChecked,
652
- releaseCommit: mutation.releaseCommit,
653
- route: state.route,
654
- push: flags.push,
655
- remote: flags.remote,
656
- }),
287
+ return await runReleaseCommandPipeline({
288
+ ctx,
289
+ flags,
290
+ spec: releaseCandidateSpec,
291
+ commandLabel: "release candidate",
292
+ routeResolver: resolveReleaseCandidateRoute,
657
293
  });
658
294
  };
659
- export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.reporting.js";
295
+ export { pushReleaseCandidateBranch, pushReleaseRefs } from "./apply.pipeline.js";
@@ -1,5 +1,6 @@
1
1
  export declare function replacePackageVersionInFile(pkgJsonPath: string, nextVersion: string): Promise<void>;
2
2
  export declare function replaceAgentplanePackageMetadata(pkgJsonPath: string, nextVersion: string): Promise<void>;
3
+ export declare function replacePackageDependencyVersion(pkgJsonPath: string, dependencyName: string, nextVersion: string): Promise<void>;
3
4
  export declare function maybeUpdateBunLockfile(gitRoot: string, fileExists: (p: string) => Promise<boolean>): Promise<void>;
4
5
  export declare function maybeRefreshGeneratedReference(gitRoot: string, fileExists: (p: string) => Promise<boolean>): Promise<boolean>;
5
6
  export declare function maybePersistExpectedCliVersion(agentplaneDir: string, nextVersion: string): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED,wBAAsB,8BAA8B,CAClD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAAC,UAAU,CAOhD"}
1
+ {"version":3,"file":"apply.mutation.d.ts","sourceRoot":"","sources":["../../../src/commands/release/apply.mutation.ts"],"names":[],"mappings":"AASA,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED,wBAAsB,8BAA8B,CAClD,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,wBAAgB,YAAY,IAAI,MAAM,CAAC,UAAU,CAOhD"}