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
@@ -3,6 +3,8 @@ import { mapBackendError } from "../../cli/error-map.js";
3
3
  import { exitCodeForError } from "../../cli/exit-codes.js";
4
4
  import { createCliEmitter } from "../../cli/output.js";
5
5
  import { CliError } from "../../shared/errors.js";
6
+ import { execFileAsync, gitEnv } from "../shared/git.js";
7
+ import { gitBranchUpstream, gitCurrentBranch } from "../shared/git-ops.js";
6
8
  import { loadCommandContext } from "../shared/task-backend.js";
7
9
  import { maybeAutoCommitTaskPrArtifacts } from "./internal/auto-commit.js";
8
10
  import { syncPrArtifacts } from "./internal/sync.js";
@@ -16,6 +18,41 @@ function prOpenOutcomeDetails(meta, openOutcome) {
16
18
  }
17
19
  return "local PR artifacts synced; remote PR creation staged";
18
20
  }
21
+ async function pushTaskBranchUpstreamIfConfigured(opts) {
22
+ const upstream = await gitBranchUpstream(opts.gitRoot, opts.branch);
23
+ const trimmed = upstream?.trim() ?? "";
24
+ if (!trimmed) {
25
+ const currentBranch = await gitCurrentBranch(opts.gitRoot).catch(() => "");
26
+ if (currentBranch.trim() !== opts.branch.trim())
27
+ return false;
28
+ try {
29
+ await execFileAsync("git", ["remote", "get-url", "origin"], {
30
+ cwd: opts.gitRoot,
31
+ env: gitEnv(),
32
+ });
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ await execFileAsync("git", ["push", "--no-verify", "-u", "origin", `HEAD:${opts.branch}`], {
38
+ cwd: opts.gitRoot,
39
+ env: gitEnv(),
40
+ });
41
+ return true;
42
+ }
43
+ const slashIndex = trimmed.indexOf("/");
44
+ if (slashIndex <= 0 || slashIndex === trimmed.length - 1)
45
+ return false;
46
+ const remote = trimmed.slice(0, slashIndex);
47
+ const upstreamBranch = trimmed.slice(slashIndex + 1);
48
+ if (!remote || !upstreamBranch)
49
+ return false;
50
+ await execFileAsync("git", ["push", "--no-verify", remote, `HEAD:${upstreamBranch}`], {
51
+ cwd: opts.gitRoot,
52
+ env: gitEnv(),
53
+ });
54
+ return true;
55
+ }
19
56
  export async function cmdPrOpen(opts) {
20
57
  try {
21
58
  const output = createCliEmitter();
@@ -27,25 +64,43 @@ export async function cmdPrOpen(opts) {
27
64
  message: "Invalid value for --author.",
28
65
  });
29
66
  }
30
- const { meta, prDir, resolved, openOutcome } = await syncPrArtifacts({
31
- ctx: opts.ctx,
67
+ const commandCtx = opts.ctx ??
68
+ (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
69
+ const initialSync = await syncPrArtifacts({
70
+ ctx: commandCtx,
32
71
  cwd: opts.cwd,
33
72
  rootOverride: opts.rootOverride,
34
73
  taskId: opts.taskId,
35
74
  mode: "open",
36
75
  author,
37
76
  branch: opts.branch,
38
- remoteMode: opts.syncOnly ? "sync-only" : "auto",
77
+ remoteMode: "sync-only",
39
78
  });
40
- const commandCtx = opts.ctx ??
41
- (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
42
- if (meta.branch) {
79
+ if (initialSync.meta.branch) {
43
80
  await maybeAutoCommitTaskPrArtifacts({
44
81
  ctx: commandCtx,
45
82
  taskId: opts.taskId,
46
- branch: meta.branch,
83
+ branch: initialSync.meta.branch,
84
+ });
85
+ }
86
+ if (!opts.syncOnly && initialSync.meta.branch) {
87
+ await pushTaskBranchUpstreamIfConfigured({
88
+ gitRoot: commandCtx.resolvedProject.gitRoot,
89
+ branch: initialSync.meta.branch,
47
90
  });
48
91
  }
92
+ const { meta, prDir, resolved, openOutcome } = opts.syncOnly
93
+ ? initialSync
94
+ : await syncPrArtifacts({
95
+ ctx: commandCtx,
96
+ cwd: opts.cwd,
97
+ rootOverride: opts.rootOverride,
98
+ taskId: opts.taskId,
99
+ mode: "open",
100
+ author,
101
+ branch: opts.branch,
102
+ remoteMode: "auto",
103
+ });
49
104
  output.success("pr open", path.relative(resolved.gitRoot, prDir), prOpenOutcomeDetails(meta, openOutcome ?? null));
50
105
  return 0;
51
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pr.command.d.ts","sourceRoot":"","sources":["../../../src/commands/pr/pr.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAWhE,KAAK,aAAa,GAAG,kBAAkB,CAAC;AAExC,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,aAAa,CA8B7C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAuChD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,cAAc,CAOpD,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAOlD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,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Ac,CAAC,IACtE,KAAK,UAAU,EAAE,GAAG,aAAa,KAAG,OAAO,CAAC,MAAM,CAAC,CAQlE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAUjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACtE,KAAK,UAAU,EAAE,GAAG,aAAa,KAAG,OAAO,CAAC,MAAM,CAAC,CAWlE;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAChF,KAAK,UAAU,EAAE,GAAG,uBAAuB,KAAG,OAAO,CAAC,MAAM,CAAC,CAS5E"}
@@ -34,7 +34,7 @@ export const prSpec = {
34
34
  export const prOpenSpec = {
35
35
  id: ["pr", "open"],
36
36
  group: "PR",
37
- summary: "Create PR artifacts for a task.",
37
+ summary: "Create PR artifacts for a task and, unless --sync-only is set, publish/link the remote GitHub PR.",
38
38
  args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
39
39
  options: [
40
40
  {
@@ -57,7 +57,12 @@ export const prOpenSpec = {
57
57
  description: "Only write local PR artifacts; do not create a remote GitHub PR.",
58
58
  },
59
59
  ],
60
- examples: [{ cmd: "agentplane pr open 202602030608-F1Q8AB --author CODER", why: "Open." }],
60
+ examples: [
61
+ {
62
+ cmd: "agentplane pr open 202602030608-F1Q8AB --author CODER",
63
+ why: "Sync local artifacts, publish the task branch to origin if needed, and create/link the GitHub PR.",
64
+ },
65
+ ],
61
66
  validateRaw: (raw) => {
62
67
  const author = typeof raw.opts.author === "string" ? raw.opts.author.trim() : "";
63
68
  if (!author) {
@@ -0,0 +1,7 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type RecipesActiveParsed = {
3
+ full: boolean;
4
+ };
5
+ export declare const recipesActiveSpec: CommandSpec<RecipesActiveParsed>;
6
+ export declare const runRecipesActive: CommandHandler<RecipesActiveParsed>;
7
+ //# sourceMappingURL=active.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/active.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAS9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CAC2B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { cmdRecipeActiveParsed } from "../recipes.js";
2
+ export const recipesActiveSpec = {
3
+ id: ["recipes", "active"],
4
+ group: "Recipes",
5
+ summary: "List active project overlays.",
6
+ options: [
7
+ { kind: "boolean", name: "full", default: false, description: "Print full JSON payload." },
8
+ ],
9
+ examples: [{ cmd: "agentplane recipes active", why: "Show overlays active for the project." }],
10
+ parse: (raw) => ({ full: raw.opts.full === true }),
11
+ };
12
+ export const runRecipesActive = (ctx, parsed) => cmdRecipeActiveParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, full: parsed.full });
@@ -0,0 +1,8 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type RecipesAddParsed = {
3
+ recipeRef: string;
4
+ mode?: "copy" | "link";
5
+ };
6
+ export declare const recipesAddSpec: CommandSpec<RecipesAddParsed>;
7
+ export declare const runRecipesAdd: CommandHandler<RecipesAddParsed>;
8
+ //# sourceMappingURL=add.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/add.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAyBxD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,gBAAgB,CAMvD,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { cmdRecipeAddParsed } from "../recipes.js";
2
+ export const recipesAddSpec = {
3
+ id: ["recipes", "add"],
4
+ group: "Recipes",
5
+ summary: "Vendor a cached recipe into the current project.",
6
+ args: [{ name: "recipe", required: true, valueHint: "<id|id@version>" }],
7
+ options: [
8
+ {
9
+ kind: "string",
10
+ name: "mode",
11
+ valueHint: "<copy|link>",
12
+ choices: ["copy", "link"],
13
+ description: "Materialization mode for the project-local package.",
14
+ },
15
+ ],
16
+ examples: [
17
+ { cmd: "agentplane recipes add tdd", why: "Vendor the latest cached recipe into the project." },
18
+ {
19
+ cmd: "agentplane recipes add tdd@1.2.0 --mode link",
20
+ why: "Link a cached recipe into the project for local recipe development.",
21
+ },
22
+ ],
23
+ parse: (raw) => ({
24
+ recipeRef: String(raw.args.recipe ?? "").trim(),
25
+ mode: raw.opts.mode === "copy" || raw.opts.mode === "link" ? raw.opts.mode : undefined,
26
+ }),
27
+ };
28
+ export const runRecipesAdd = (ctx, parsed) => cmdRecipeAddParsed({
29
+ cwd: ctx.cwd,
30
+ rootOverride: ctx.rootOverride,
31
+ recipeRef: parsed.recipeRef,
32
+ mode: parsed.mode,
33
+ });
@@ -0,0 +1,7 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type RecipesDetachParsed = {
3
+ id: string;
4
+ };
5
+ export declare const recipesDetachSpec: CommandSpec<RecipesDetachParsed>;
6
+ export declare const runRecipesDetach: CommandHandler<RecipesDetachParsed>;
7
+ //# sourceMappingURL=detach.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detach.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/detach.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAY9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CAK7D,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { cmdRecipeDetachParsed } from "../recipes.js";
2
+ export const recipesDetachSpec = {
3
+ id: ["recipes", "detach"],
4
+ group: "Recipes",
5
+ summary: "Convert a linked vendored recipe into a project-local copy.",
6
+ args: [{ name: "id", required: true, valueHint: "<id>" }],
7
+ examples: [
8
+ {
9
+ cmd: "agentplane recipes detach tdd",
10
+ why: "Freeze a linked recipe into a portable project copy before sharing the repo.",
11
+ },
12
+ ],
13
+ parse: (raw) => ({ id: String(raw.args.id ?? "").trim() }),
14
+ };
15
+ export const runRecipesDetach = (ctx, parsed) => cmdRecipeDetachParsed({
16
+ cwd: ctx.cwd,
17
+ rootOverride: ctx.rootOverride,
18
+ id: parsed.id,
19
+ });
@@ -0,0 +1,7 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type RecipesDisableParsed = {
3
+ id: string;
4
+ };
5
+ export declare const recipesDisableSpec: CommandSpec<RecipesDisableParsed>;
6
+ export declare const runRecipesDisable: CommandHandler<RecipesDisableParsed>;
7
+ //# sourceMappingURL=disable.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/disable.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAOhE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CACsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { cmdRecipeDisableParsed } from "../recipes.js";
2
+ export const recipesDisableSpec = {
3
+ id: ["recipes", "disable"],
4
+ group: "Recipes",
5
+ summary: "Disable an active project overlay for the current project.",
6
+ args: [{ name: "id", required: true, valueHint: "<recipe-id>" }],
7
+ examples: [{ cmd: "agentplane recipes disable tdd", why: "Deactivate an overlay." }],
8
+ parse: (raw) => ({ id: String(raw.args.id ?? "").trim() }),
9
+ };
10
+ export const runRecipesDisable = (ctx, parsed) => cmdRecipeDisableParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, id: parsed.id });
@@ -0,0 +1,7 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type RecipesEnableParsed = {
3
+ id: string;
4
+ };
5
+ export declare const recipesEnableSpec: CommandSpec<RecipesEnableParsed>;
6
+ export declare const runRecipesEnable: CommandHandler<RecipesEnableParsed>;
7
+ //# sourceMappingURL=enable.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enable.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/enable.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CAO9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CACuB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { cmdRecipeEnableParsed } from "../recipes.js";
2
+ export const recipesEnableSpec = {
3
+ id: ["recipes", "enable"],
4
+ group: "Recipes",
5
+ summary: "Enable an installed project overlay for the current project.",
6
+ args: [{ name: "id", required: true, valueHint: "<recipe-id>" }],
7
+ examples: [{ cmd: "agentplane recipes enable tdd", why: "Activate an installed overlay." }],
8
+ parse: (raw) => ({ id: String(raw.args.id ?? "").trim() }),
9
+ };
10
+ export const runRecipesEnable = (ctx, parsed) => cmdRecipeEnableParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, id: parsed.id });
@@ -0,0 +1,5 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ export type RecipesExplainActiveParsed = Record<string, never>;
3
+ export declare const recipesExplainActiveSpec: CommandSpec<RecipesExplainActiveParsed>;
4
+ export declare const runRecipesExplainActive: CommandHandler<RecipesExplainActiveParsed>;
5
+ //# sourceMappingURL=explain-active.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explain-active.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/explain-active.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/D,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,0BAA0B,CAQ5E,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,0BAA0B,CACC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { cmdRecipeExplainActiveParsed } from "../recipes.js";
2
+ export const recipesExplainActiveSpec = {
3
+ id: ["recipes", "explain-active"],
4
+ group: "Recipes",
5
+ summary: "Print the compiled active overlay bundle.",
6
+ examples: [
7
+ { cmd: "agentplane recipes explain-active", why: "Inspect compiled overlay runtime data." },
8
+ ],
9
+ parse: () => ({}),
10
+ };
11
+ export const runRecipesExplainActive = (ctx) => cmdRecipeExplainActiveParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
@@ -1 +1 @@
1
- {"version":3,"file":"explain.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/explain.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAOhE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CACiB,CAAC"}
1
+ {"version":3,"file":"explain.command.d.ts","sourceRoot":"","sources":["../../../src/commands/recipes/explain.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E,MAAM,MAAM,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAShE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,oBAAoB,CACiB,CAAC"}
@@ -2,9 +2,11 @@ import { cmdRecipeExplainParsed } from "../recipes.js";
2
2
  export const recipesExplainSpec = {
3
3
  id: ["recipes", "explain"],
4
4
  group: "Recipes",
5
- summary: "Show detailed info for an installed recipe.",
5
+ summary: "Show detailed info for a vendored recipe.",
6
6
  args: [{ name: "id", required: true, valueHint: "<id>" }],
7
- examples: [{ cmd: "agentplane recipes explain viewer", why: "Show detailed recipe info." }],
7
+ examples: [
8
+ { cmd: "agentplane recipes explain viewer", why: "Show detailed project-local recipe info." },
9
+ ],
8
10
  parse: (raw) => ({ id: String(raw.args.id ?? "") }),
9
11
  };
10
12
  export const runRecipesExplain = (ctx, p) => cmdRecipeExplainParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, id: p.id });
@@ -1,4 +1,4 @@
1
- import type { RecipeConflictMode, RecipeManifest } from "./types.js";
1
+ import { type RecipeConflictMode, type RecipeManifest } from "@agentplaneorg/recipes";
2
2
  export declare function moveRecipeDir(opts: {
3
3
  from: string;
4
4
  to: string;
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF;AAkBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDhB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/commands/recipes/impl/apply.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAWhC,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAarF;AAyBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmChB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,kBAAkB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
@@ -1,5 +1,6 @@
1
- import { cp, mkdir, readFile, readdir, rename, rm } from "node:fs/promises";
1
+ import { cp, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
+ import { normalizeAgentId, readScenarioDefinition, } from "@agentplaneorg/recipes";
3
4
  import { exitCodeForError } from "../../../cli/exit-codes.js";
4
5
  import { fileExists, getPathKind } from "../../../cli/fs-utils.js";
5
6
  import { invalidFieldMessage, missingFileMessage } from "../../../cli/output.js";
@@ -7,8 +8,6 @@ import { CliError } from "../../../shared/errors.js";
7
8
  import { isRecord } from "../../../shared/guards.js";
8
9
  import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
9
10
  import { RECIPES_SCENARIOS_DIR_NAME, RECIPES_SCENARIOS_INDEX_NAME } from "./constants.js";
10
- import { readScenarioDefinition } from "./scenario.js";
11
- import { normalizeAgentId } from "./normalize.js";
12
11
  export async function moveRecipeDir(opts) {
13
12
  await mkdir(path.dirname(opts.to), { recursive: true });
14
13
  try {
@@ -24,22 +23,29 @@ export async function moveRecipeDir(opts) {
24
23
  throw err;
25
24
  }
26
25
  }
27
- async function readRecipeJsonObject(recipeDir, relativePath, label) {
26
+ function isMarkdownAssetPath(relativePath) {
27
+ const normalized = relativePath.trim().toLowerCase();
28
+ return normalized.endsWith(".md") || normalized.endsWith(".markdown");
29
+ }
30
+ async function readRecipeMarkdownAsset(recipeDir, relativePath, label) {
28
31
  const sourcePath = path.join(recipeDir, relativePath);
29
32
  if (!(await fileExists(sourcePath))) {
30
33
  throw new Error(missingFileMessage(label, relativePath));
31
34
  }
32
- const raw = JSON.parse(await readFile(sourcePath, "utf8"));
33
- if (!isRecord(raw)) {
34
- throw new Error(invalidFieldMessage(label, "JSON object", relativePath));
35
+ if (!isMarkdownAssetPath(relativePath)) {
36
+ throw new Error(invalidFieldMessage(label, "markdown file (*.md)", relativePath));
37
+ }
38
+ const raw = await readFile(sourcePath, "utf8");
39
+ if (!raw.trim()) {
40
+ throw new Error(invalidFieldMessage(label, "non-empty markdown document", relativePath));
35
41
  }
36
42
  }
37
43
  export async function validateRecipeAssets(opts) {
38
44
  for (const skill of opts.manifest.skills ?? []) {
39
- await readRecipeJsonObject(opts.recipeDir, skill.file, "recipe skill file");
45
+ await readRecipeMarkdownAsset(opts.recipeDir, skill.file, "recipe skill file");
40
46
  }
41
47
  for (const agent of opts.manifest.agents ?? []) {
42
- await readRecipeJsonObject(opts.recipeDir, agent.file, "recipe agent file");
48
+ await readRecipeMarkdownAsset(opts.recipeDir, agent.file, "recipe agent file");
43
49
  }
44
50
  for (const tool of opts.manifest.tools ?? []) {
45
51
  const entrypointPath = path.join(opts.recipeDir, tool.entrypoint);
@@ -47,6 +53,12 @@ export async function validateRecipeAssets(opts) {
47
53
  throw new Error(missingFileMessage("recipe tool entrypoint", tool.entrypoint));
48
54
  }
49
55
  }
56
+ for (const prompt of opts.manifest.prompts ?? []) {
57
+ const sourcePath = path.join(opts.recipeDir, prompt.file);
58
+ if (!(await fileExists(sourcePath))) {
59
+ throw new Error(missingFileMessage("overlay prompt file", prompt.file));
60
+ }
61
+ }
50
62
  for (const scenario of opts.manifest.scenarios ?? []) {
51
63
  const sourcePath = path.join(opts.recipeDir, scenario.file);
52
64
  if (!(await fileExists(sourcePath))) {
@@ -75,13 +87,16 @@ export async function applyRecipeAgents(opts) {
75
87
  if (!(await fileExists(sourcePath))) {
76
88
  throw new Error(missingFileMessage("recipe agent file", rawFile));
77
89
  }
78
- const rawAgent = JSON.parse(await readFile(sourcePath, "utf8"));
79
- if (!isRecord(rawAgent)) {
80
- throw new Error(invalidFieldMessage("recipe agent file", "JSON object", rawFile));
90
+ if (!isMarkdownAssetPath(rawFile)) {
91
+ throw new Error(invalidFieldMessage("recipe agent file", "markdown file (*.md)", rawFile));
92
+ }
93
+ const rawAgent = await readFile(sourcePath, "utf8");
94
+ if (!rawAgent.trim()) {
95
+ throw new Error(invalidFieldMessage("recipe agent file", "non-empty markdown document", rawFile));
81
96
  }
82
97
  const baseId = `${opts.manifest.id}__${agentId}`;
83
98
  let targetId = baseId;
84
- let targetPath = path.join(agentsDir, `${targetId}.json`);
99
+ let targetPath = path.join(agentsDir, `${targetId}.md`);
85
100
  if (await getPathKind(targetPath)) {
86
101
  if (opts.onConflict === "fail") {
87
102
  throw new CliError({
@@ -94,13 +109,16 @@ export async function applyRecipeAgents(opts) {
94
109
  let counter = 1;
95
110
  while (await getPathKind(targetPath)) {
96
111
  targetId = `${baseId}__${counter}`;
97
- targetPath = path.join(agentsDir, `${targetId}.json`);
112
+ targetPath = path.join(agentsDir, `${targetId}.md`);
98
113
  counter += 1;
99
114
  }
100
115
  }
101
116
  }
102
- rawAgent.id = targetId;
103
- await writeJsonStableIfChanged(targetPath, rawAgent);
117
+ const namespacedHeader = `# Agent: ${targetId}\n\n`;
118
+ const content = rawAgent.startsWith("# Agent:")
119
+ ? rawAgent
120
+ : `${namespacedHeader}${rawAgent.trimStart()}`;
121
+ await writeFile(targetPath, content, "utf8");
104
122
  }
105
123
  }
106
124
  export async function applyRecipeScenarios(opts) {
@@ -0,0 +1,6 @@
1
+ export declare function cmdRecipeActiveParsed(opts: {
2
+ cwd: string;
3
+ rootOverride?: string;
4
+ full: boolean;
5
+ }): Promise<number>;
6
+ //# sourceMappingURL=active.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/active.ts"],"names":[],"mappings":"AAWA,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAqClB"}
@@ -0,0 +1,47 @@
1
+ import { resolveProject } from "@agentplaneorg/core";
2
+ import { mapCoreError } from "../../../../cli/error-map.js";
3
+ import { createCliEmitter, emptyStateMessage } from "../../../../cli/output.js";
4
+ import { CliError } from "../../../../shared/errors.js";
5
+ import { readActiveRecipeIds } from "../overlay-project.js";
6
+ import { readProjectInstalledRecipes } from "../project-installed-recipes.js";
7
+ const output = createCliEmitter();
8
+ export async function cmdRecipeActiveParsed(opts) {
9
+ try {
10
+ const project = await resolveProject({
11
+ cwd: opts.cwd,
12
+ rootOverride: opts.rootOverride ?? null,
13
+ });
14
+ const [activeIds, installed] = await Promise.all([
15
+ readActiveRecipeIds(project),
16
+ readProjectInstalledRecipes(project),
17
+ ]);
18
+ const active = activeIds
19
+ .map((id) => installed.recipes.find((entry) => entry.id === id))
20
+ .filter(Boolean);
21
+ if (active.length === 0) {
22
+ output.line(emptyStateMessage("active overlays"));
23
+ return 0;
24
+ }
25
+ if (opts.full) {
26
+ output.json({
27
+ schema_version: 1,
28
+ active: active.map((entry) => ({
29
+ id: entry.id,
30
+ version: entry.version,
31
+ kind: entry.manifest.kind,
32
+ summary: entry.manifest.summary,
33
+ })),
34
+ });
35
+ return 0;
36
+ }
37
+ for (const entry of active) {
38
+ output.line(`${entry.id}@${entry.version} [${entry.manifest.kind}]`);
39
+ }
40
+ return 0;
41
+ }
42
+ catch (err) {
43
+ if (err instanceof CliError)
44
+ throw err;
45
+ throw mapCoreError(err, { command: "recipes active", root: opts.rootOverride ?? null });
46
+ }
47
+ }
@@ -0,0 +1,8 @@
1
+ export declare function cmdRecipeAddParsed(opts: {
2
+ cwd: string;
3
+ rootOverride?: string;
4
+ recipeRef: string;
5
+ mode?: "copy" | "link";
6
+ activate?: boolean;
7
+ }): Promise<number>;
8
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../../src/commands/recipes/impl/commands/add.ts"],"names":[],"mappings":"AAuCA,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmFlB"}