agentplane 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (660) hide show
  1. package/README.md +4 -4
  2. package/assets/AGENTS.md +294 -72
  3. package/assets/agents/CODER.json +1 -0
  4. package/assets/agents/INTEGRATOR.json +1 -0
  5. package/assets/agents/ORCHESTRATOR.json +1 -0
  6. package/assets/agents/PLANNER.json +1 -0
  7. package/assets/agents/TESTER.json +1 -0
  8. package/dist/backends/task-backend/load.d.ts +13 -0
  9. package/dist/backends/task-backend/load.d.ts.map +1 -0
  10. package/dist/backends/task-backend/load.js +58 -0
  11. package/dist/backends/task-backend/local-backend.d.ts +28 -0
  12. package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
  13. package/dist/backends/task-backend/local-backend.js +335 -0
  14. package/dist/backends/task-backend/redmine/client.d.ts +8 -0
  15. package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
  16. package/dist/backends/task-backend/redmine/client.js +60 -0
  17. package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
  18. package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
  19. package/dist/backends/task-backend/redmine/comments.js +54 -0
  20. package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
  21. package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
  22. package/dist/backends/task-backend/redmine/fields.js +38 -0
  23. package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
  24. package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
  25. package/dist/backends/task-backend/redmine/mapping.js +114 -0
  26. package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
  27. package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
  28. package/dist/backends/task-backend/redmine/parse.js +27 -0
  29. package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
  30. package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
  31. package/dist/backends/task-backend/redmine/remote.js +82 -0
  32. package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
  33. package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
  34. package/dist/backends/task-backend/redmine-backend.js +505 -0
  35. package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
  36. package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
  37. package/dist/backends/task-backend/shared/concurrency.js +21 -0
  38. package/dist/backends/task-backend/shared/constants.d.ts +4 -0
  39. package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
  40. package/dist/backends/task-backend/shared/constants.js +4 -0
  41. package/dist/backends/task-backend/shared/doc.d.ts +11 -0
  42. package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
  43. package/dist/backends/task-backend/shared/doc.js +78 -0
  44. package/dist/backends/task-backend/shared/errors.d.ts +10 -0
  45. package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
  46. package/dist/backends/task-backend/shared/errors.js +18 -0
  47. package/dist/backends/task-backend/shared/events.d.ts +3 -0
  48. package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
  49. package/dist/backends/task-backend/shared/events.js +29 -0
  50. package/dist/backends/task-backend/shared/export.d.ts +15 -0
  51. package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
  52. package/dist/backends/task-backend/shared/export.js +60 -0
  53. package/dist/backends/task-backend/shared/id.d.ts +13 -0
  54. package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
  55. package/dist/backends/task-backend/shared/id.js +17 -0
  56. package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
  57. package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
  58. package/dist/backends/task-backend/shared/normalize.js +54 -0
  59. package/dist/backends/task-backend/shared/record.d.ts +4 -0
  60. package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
  61. package/dist/backends/task-backend/shared/record.js +53 -0
  62. package/dist/backends/task-backend/shared/strings.d.ts +4 -0
  63. package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
  64. package/dist/backends/task-backend/shared/strings.js +21 -0
  65. package/dist/backends/task-backend/shared/types.d.ts +84 -0
  66. package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
  67. package/dist/backends/task-backend/shared/types.js +1 -0
  68. package/dist/backends/task-backend/shared.d.ts +11 -0
  69. package/dist/backends/task-backend/shared.d.ts.map +1 -0
  70. package/dist/backends/task-backend/shared.js +9 -0
  71. package/dist/backends/task-backend.d.ts +4 -192
  72. package/dist/backends/task-backend.d.ts.map +1 -1
  73. package/dist/backends/task-backend.js +4 -1329
  74. package/dist/backends/task-index.js +2 -2
  75. package/dist/cli/archive.d.ts +0 -2
  76. package/dist/cli/archive.d.ts.map +1 -1
  77. package/dist/cli/archive.js +1 -2
  78. package/dist/cli/command-guide.d.ts.map +1 -1
  79. package/dist/cli/command-guide.js +28 -12
  80. package/dist/cli/parse/lifecycle.d.ts +64 -0
  81. package/dist/cli/parse/lifecycle.d.ts.map +1 -0
  82. package/dist/cli/parse/lifecycle.js +280 -0
  83. package/dist/cli/run-cli/command-catalog.d.ts +16 -0
  84. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
  85. package/dist/cli/run-cli/command-catalog.js +204 -0
  86. package/dist/cli/run-cli/commands/config.d.ts +20 -0
  87. package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
  88. package/dist/cli/run-cli/commands/config.js +130 -0
  89. package/dist/cli/run-cli/commands/core.d.ts +14 -0
  90. package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
  91. package/dist/cli/run-cli/commands/core.js +144 -0
  92. package/dist/cli/run-cli/commands/ide.d.ts +13 -0
  93. package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
  94. package/dist/cli/run-cli/commands/ide.js +67 -0
  95. package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
  96. package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
  97. package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
  98. package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
  99. package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
  100. package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
  101. package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
  102. package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
  103. package/dist/cli/run-cli/commands/init/git.js +12 -0
  104. package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
  105. package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
  106. package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
  107. package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
  108. package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
  109. package/dist/cli/run-cli/commands/init/recipes.js +11 -0
  110. package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
  111. package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
  112. package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
  113. package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
  114. package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
  115. package/dist/cli/run-cli/commands/init/write-config.js +45 -0
  116. package/dist/cli/run-cli/commands/init.d.ts +21 -0
  117. package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
  118. package/dist/cli/run-cli/commands/init.js +332 -0
  119. package/dist/cli/run-cli/registry.run.d.ts +4 -0
  120. package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
  121. package/dist/cli/run-cli/registry.run.js +19 -0
  122. package/dist/cli/run-cli.d.ts.map +1 -1
  123. package/dist/cli/run-cli.js +182 -2408
  124. package/dist/cli/spec/docs-render.d.ts +3 -0
  125. package/dist/cli/spec/docs-render.d.ts.map +1 -0
  126. package/dist/cli/spec/docs-render.js +118 -0
  127. package/dist/cli/spec/errors.d.ts +9 -0
  128. package/dist/cli/spec/errors.d.ts.map +1 -0
  129. package/dist/cli/spec/errors.js +18 -0
  130. package/dist/cli/spec/help-render.d.ts +43 -0
  131. package/dist/cli/spec/help-render.d.ts.map +1 -0
  132. package/dist/cli/spec/help-render.js +185 -0
  133. package/dist/cli/spec/help.d.ts +10 -0
  134. package/dist/cli/spec/help.d.ts.map +1 -0
  135. package/dist/cli/spec/help.js +64 -0
  136. package/dist/cli/spec/parse.d.ts +8 -0
  137. package/dist/cli/spec/parse.d.ts.map +1 -0
  138. package/dist/cli/spec/parse.js +188 -0
  139. package/dist/cli/spec/registry.d.ts +12 -0
  140. package/dist/cli/spec/registry.d.ts.map +1 -0
  141. package/dist/cli/spec/registry.js +47 -0
  142. package/dist/cli/spec/spec.d.ts +76 -0
  143. package/dist/cli/spec/spec.d.ts.map +1 -0
  144. package/dist/cli/spec/spec.js +1 -0
  145. package/dist/cli/spec/suggest.d.ts +2 -0
  146. package/dist/cli/spec/suggest.d.ts.map +1 -0
  147. package/dist/cli/spec/suggest.js +45 -0
  148. package/dist/commands/backend/sync.command.d.ts +12 -0
  149. package/dist/commands/backend/sync.command.d.ts.map +1 -0
  150. package/dist/commands/backend/sync.command.js +79 -0
  151. package/dist/commands/backend.d.ts +21 -8
  152. package/dist/commands/backend.d.ts.map +1 -1
  153. package/dist/commands/backend.js +28 -165
  154. package/dist/commands/block.command.d.ts +19 -0
  155. package/dist/commands/block.command.d.ts.map +1 -0
  156. package/dist/commands/block.command.js +143 -0
  157. package/dist/commands/branch/base.command.d.ts +20 -0
  158. package/dist/commands/branch/base.command.d.ts.map +1 -0
  159. package/dist/commands/branch/base.command.js +110 -0
  160. package/dist/commands/branch/base.d.ts +19 -0
  161. package/dist/commands/branch/base.d.ts.map +1 -0
  162. package/dist/commands/branch/base.js +114 -0
  163. package/dist/commands/branch/cleanup-merged.d.ts +11 -0
  164. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
  165. package/dist/commands/branch/cleanup-merged.js +141 -0
  166. package/dist/commands/branch/index.d.ts +6 -59
  167. package/dist/commands/branch/index.d.ts.map +1 -1
  168. package/dist/commands/branch/index.js +6 -513
  169. package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
  170. package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
  171. package/dist/commands/branch/internal/archive-pr.js +17 -0
  172. package/dist/commands/branch/internal/work-validate.d.ts +3 -0
  173. package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
  174. package/dist/commands/branch/internal/work-validate.js +27 -0
  175. package/dist/commands/branch/remove.command.d.ts +10 -0
  176. package/dist/commands/branch/remove.command.d.ts.map +1 -0
  177. package/dist/commands/branch/remove.command.js +63 -0
  178. package/dist/commands/branch/remove.d.ts +9 -0
  179. package/dist/commands/branch/remove.d.ts.map +1 -0
  180. package/dist/commands/branch/remove.js +65 -0
  181. package/dist/commands/branch/status.command.d.ts +8 -0
  182. package/dist/commands/branch/status.command.d.ts.map +1 -0
  183. package/dist/commands/branch/status.command.js +36 -0
  184. package/dist/commands/branch/status.d.ts +7 -0
  185. package/dist/commands/branch/status.d.ts.map +1 -0
  186. package/dist/commands/branch/status.js +60 -0
  187. package/dist/commands/branch/work-start.command.d.ts +11 -0
  188. package/dist/commands/branch/work-start.command.d.ts.map +1 -0
  189. package/dist/commands/branch/work-start.command.js +80 -0
  190. package/dist/commands/branch/work-start.d.ts +11 -0
  191. package/dist/commands/branch/work-start.d.ts.map +1 -0
  192. package/dist/commands/branch/work-start.js +120 -0
  193. package/dist/commands/cleanup/merged.command.d.ts +17 -0
  194. package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
  195. package/dist/commands/cleanup/merged.command.js +75 -0
  196. package/dist/commands/commit.command.d.ts +6 -0
  197. package/dist/commands/commit.command.d.ts.map +1 -0
  198. package/dist/commands/commit.command.js +24 -0
  199. package/dist/commands/commit.spec.d.ts +18 -0
  200. package/dist/commands/commit.spec.d.ts.map +1 -0
  201. package/dist/commands/commit.spec.js +119 -0
  202. package/dist/commands/docs/cli.command.d.ts +9 -0
  203. package/dist/commands/docs/cli.command.d.ts.map +1 -0
  204. package/dist/commands/docs/cli.command.js +51 -0
  205. package/dist/commands/finish.command.d.ts +28 -0
  206. package/dist/commands/finish.command.d.ts.map +1 -0
  207. package/dist/commands/finish.command.js +237 -0
  208. package/dist/commands/guard/clean.command.d.ts +7 -0
  209. package/dist/commands/guard/clean.command.d.ts.map +1 -0
  210. package/dist/commands/guard/clean.command.js +14 -0
  211. package/dist/commands/guard/commit.command.d.ts +19 -0
  212. package/dist/commands/guard/commit.command.d.ts.map +1 -0
  213. package/dist/commands/guard/commit.command.js +132 -0
  214. package/dist/commands/guard/guard.command.d.ts +5 -0
  215. package/dist/commands/guard/guard.command.d.ts.map +1 -0
  216. package/dist/commands/guard/guard.command.js +21 -0
  217. package/dist/commands/guard/impl/allow.d.ts +18 -0
  218. package/dist/commands/guard/impl/allow.d.ts.map +1 -0
  219. package/dist/commands/guard/impl/allow.js +77 -0
  220. package/dist/commands/guard/impl/close-message.d.ts +16 -0
  221. package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
  222. package/dist/commands/guard/impl/close-message.js +156 -0
  223. package/dist/commands/guard/impl/commands.d.ts +32 -0
  224. package/dist/commands/guard/impl/commands.d.ts.map +1 -0
  225. package/dist/commands/guard/impl/commands.js +191 -0
  226. package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
  227. package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
  228. package/dist/commands/guard/impl/comment-commit.js +137 -0
  229. package/dist/commands/guard/impl/env.d.ts +10 -0
  230. package/dist/commands/guard/impl/env.d.ts.map +1 -0
  231. package/dist/commands/guard/impl/env.js +12 -0
  232. package/dist/commands/guard/impl/policy.d.ts +19 -0
  233. package/dist/commands/guard/impl/policy.d.ts.map +1 -0
  234. package/dist/commands/guard/impl/policy.js +46 -0
  235. package/dist/commands/guard/index.d.ts +4 -66
  236. package/dist/commands/guard/index.d.ts.map +1 -1
  237. package/dist/commands/guard/index.js +4 -367
  238. package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
  239. package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
  240. package/dist/commands/guard/suggest-allow.command.js +28 -0
  241. package/dist/commands/hooks/hooks.command.d.ts +5 -0
  242. package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
  243. package/dist/commands/hooks/hooks.command.js +18 -0
  244. package/dist/commands/hooks/index.d.ts.map +1 -1
  245. package/dist/commands/hooks/index.js +42 -77
  246. package/dist/commands/hooks/install.command.d.ts +7 -0
  247. package/dist/commands/hooks/install.command.d.ts.map +1 -0
  248. package/dist/commands/hooks/install.command.js +14 -0
  249. package/dist/commands/hooks/run.command.d.ts +9 -0
  250. package/dist/commands/hooks/run.command.d.ts.map +1 -0
  251. package/dist/commands/hooks/run.command.js +39 -0
  252. package/dist/commands/hooks/uninstall.command.d.ts +7 -0
  253. package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
  254. package/dist/commands/hooks/uninstall.command.js +16 -0
  255. package/dist/commands/integrate.command.d.ts +14 -0
  256. package/dist/commands/integrate.command.d.ts.map +1 -0
  257. package/dist/commands/integrate.command.js +61 -0
  258. package/dist/commands/pr/check.d.ts +8 -0
  259. package/dist/commands/pr/check.d.ts.map +1 -0
  260. package/dist/commands/pr/check.js +78 -0
  261. package/dist/commands/pr/index.d.ts +5 -45
  262. package/dist/commands/pr/index.d.ts.map +1 -1
  263. package/dist/commands/pr/index.js +5 -857
  264. package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
  265. package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
  266. package/dist/commands/pr/integrate/artifacts.js +45 -0
  267. package/dist/commands/pr/integrate/cmd.d.ts +14 -0
  268. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
  269. package/dist/commands/pr/integrate/cmd.js +150 -0
  270. package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
  271. package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
  272. package/dist/commands/pr/integrate/internal/finalize.js +86 -0
  273. package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
  274. package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
  275. package/dist/commands/pr/integrate/internal/merge.js +138 -0
  276. package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
  277. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
  278. package/dist/commands/pr/integrate/internal/prepare.js +142 -0
  279. package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
  280. package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
  281. package/dist/commands/pr/integrate/internal/worktree.js +51 -0
  282. package/dist/commands/pr/integrate/verify.d.ts +22 -0
  283. package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
  284. package/dist/commands/pr/integrate/verify.js +60 -0
  285. package/dist/commands/pr/integrate.d.ts +2 -0
  286. package/dist/commands/pr/integrate.d.ts.map +1 -0
  287. package/dist/commands/pr/integrate.js +1 -0
  288. package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
  289. package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
  290. package/dist/commands/pr/internal/pr-paths.js +38 -0
  291. package/dist/commands/pr/internal/review-template.d.ts +9 -0
  292. package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
  293. package/dist/commands/pr/internal/review-template.js +62 -0
  294. package/dist/commands/pr/note.d.ts +10 -0
  295. package/dist/commands/pr/note.d.ts.map +1 -0
  296. package/dist/commands/pr/note.js +50 -0
  297. package/dist/commands/pr/open.d.ts +10 -0
  298. package/dist/commands/pr/open.d.ts.map +1 -0
  299. package/dist/commands/pr/open.js +80 -0
  300. package/dist/commands/pr/pr.command.d.ts +33 -0
  301. package/dist/commands/pr/pr.command.d.ts.map +1 -0
  302. package/dist/commands/pr/pr.command.js +172 -0
  303. package/dist/commands/pr/update.d.ts +8 -0
  304. package/dist/commands/pr/update.d.ts.map +1 -0
  305. package/dist/commands/pr/update.js +103 -0
  306. package/dist/commands/ready.command.d.ts +8 -0
  307. package/dist/commands/ready.command.d.ts.map +1 -0
  308. package/dist/commands/ready.command.js +28 -0
  309. package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
  310. package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
  311. package/dist/commands/recipes/cache-prune.command.js +30 -0
  312. package/dist/commands/recipes/cache.command.d.ts +6 -0
  313. package/dist/commands/recipes/cache.command.d.ts.map +1 -0
  314. package/dist/commands/recipes/cache.command.js +37 -0
  315. package/dist/commands/recipes/explain.command.d.ts +7 -0
  316. package/dist/commands/recipes/explain.command.d.ts.map +1 -0
  317. package/dist/commands/recipes/explain.command.js +10 -0
  318. package/dist/commands/recipes/impl/apply.d.ts +16 -0
  319. package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
  320. package/dist/commands/recipes/impl/apply.js +97 -0
  321. package/dist/commands/recipes/impl/archive.d.ts +2 -0
  322. package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
  323. package/dist/commands/recipes/impl/archive.js +19 -0
  324. package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
  325. package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
  326. package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
  327. package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
  328. package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
  329. package/dist/commands/recipes/impl/commands/explain.js +88 -0
  330. package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
  331. package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
  332. package/dist/commands/recipes/impl/commands/info.js +58 -0
  333. package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
  334. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
  335. package/dist/commands/recipes/impl/commands/install.js +212 -0
  336. package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
  337. package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
  338. package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
  339. package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
  340. package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
  341. package/dist/commands/recipes/impl/commands/list.js +38 -0
  342. package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
  343. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
  344. package/dist/commands/recipes/impl/commands/remove.js +35 -0
  345. package/dist/commands/recipes/impl/commands.d.ts +8 -0
  346. package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
  347. package/dist/commands/recipes/impl/commands.js +7 -0
  348. package/dist/commands/recipes/impl/constants.d.ts +13 -0
  349. package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
  350. package/dist/commands/recipes/impl/constants.js +16 -0
  351. package/dist/commands/recipes/impl/format.d.ts +2 -0
  352. package/dist/commands/recipes/impl/format.d.ts.map +1 -0
  353. package/dist/commands/recipes/impl/format.js +9 -0
  354. package/dist/commands/recipes/impl/index.d.ts +12 -0
  355. package/dist/commands/recipes/impl/index.d.ts.map +1 -0
  356. package/dist/commands/recipes/impl/index.js +150 -0
  357. package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
  358. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
  359. package/dist/commands/recipes/impl/installed-recipes.js +58 -0
  360. package/dist/commands/recipes/impl/manifest.d.ts +4 -0
  361. package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
  362. package/dist/commands/recipes/impl/manifest.js +43 -0
  363. package/dist/commands/recipes/impl/normalize.d.ts +5 -0
  364. package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
  365. package/dist/commands/recipes/impl/normalize.js +50 -0
  366. package/dist/commands/recipes/impl/paths.d.ts +13 -0
  367. package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
  368. package/dist/commands/recipes/impl/paths.js +27 -0
  369. package/dist/commands/recipes/impl/project.d.ts +8 -0
  370. package/dist/commands/recipes/impl/project.d.ts.map +1 -0
  371. package/dist/commands/recipes/impl/project.js +23 -0
  372. package/dist/commands/recipes/impl/scenario.d.ts +16 -0
  373. package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
  374. package/dist/commands/recipes/impl/scenario.js +128 -0
  375. package/dist/commands/recipes/impl/types.d.ts +107 -0
  376. package/dist/commands/recipes/impl/types.d.ts.map +1 -0
  377. package/dist/commands/recipes/impl/types.js +1 -0
  378. package/dist/commands/recipes/info.command.d.ts +7 -0
  379. package/dist/commands/recipes/info.command.d.ts.map +1 -0
  380. package/dist/commands/recipes/info.command.js +10 -0
  381. package/dist/commands/recipes/install.command.d.ts +12 -0
  382. package/dist/commands/recipes/install.command.d.ts.map +1 -0
  383. package/dist/commands/recipes/install.command.js +161 -0
  384. package/dist/commands/recipes/list-remote.command.d.ts +6 -0
  385. package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
  386. package/dist/commands/recipes/list-remote.command.js +46 -0
  387. package/dist/commands/recipes/list.command.d.ts +6 -0
  388. package/dist/commands/recipes/list.command.d.ts.map +1 -0
  389. package/dist/commands/recipes/list.command.js +39 -0
  390. package/dist/commands/recipes/recipes.command.d.ts +6 -0
  391. package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
  392. package/dist/commands/recipes/recipes.command.js +45 -0
  393. package/dist/commands/recipes/remove.command.d.ts +7 -0
  394. package/dist/commands/recipes/remove.command.d.ts.map +1 -0
  395. package/dist/commands/recipes/remove.command.js +10 -0
  396. package/dist/commands/recipes.d.ts +7 -12
  397. package/dist/commands/recipes.d.ts.map +1 -1
  398. package/dist/commands/recipes.js +6 -1963
  399. package/dist/commands/scenario/impl/commands.d.ts +19 -0
  400. package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
  401. package/dist/commands/scenario/impl/commands.js +336 -0
  402. package/dist/commands/scenario/impl/report.d.ts +30 -0
  403. package/dist/commands/scenario/impl/report.d.ts.map +1 -0
  404. package/dist/commands/scenario/impl/report.js +99 -0
  405. package/dist/commands/scenario/info.command.d.ts +8 -0
  406. package/dist/commands/scenario/info.command.d.ts.map +1 -0
  407. package/dist/commands/scenario/info.command.js +27 -0
  408. package/dist/commands/scenario/list.command.d.ts +5 -0
  409. package/dist/commands/scenario/list.command.d.ts.map +1 -0
  410. package/dist/commands/scenario/list.command.js +9 -0
  411. package/dist/commands/scenario/run.command.d.ts +8 -0
  412. package/dist/commands/scenario/run.command.d.ts.map +1 -0
  413. package/dist/commands/scenario/run.command.js +27 -0
  414. package/dist/commands/scenario/scenario.command.d.ts +6 -0
  415. package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
  416. package/dist/commands/scenario/scenario.command.js +37 -0
  417. package/dist/commands/scenario.d.ts +2 -0
  418. package/dist/commands/scenario.d.ts.map +1 -0
  419. package/dist/commands/scenario.js +1 -0
  420. package/dist/commands/shared/git-context.d.ts +23 -0
  421. package/dist/commands/shared/git-context.d.ts.map +1 -0
  422. package/dist/commands/shared/git-context.js +140 -0
  423. package/dist/commands/shared/policy-deny.d.ts +3 -0
  424. package/dist/commands/shared/policy-deny.d.ts.map +1 -0
  425. package/dist/commands/shared/policy-deny.js +12 -0
  426. package/dist/commands/shared/task-backend.d.ts +31 -3
  427. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  428. package/dist/commands/shared/task-backend.js +42 -5
  429. package/dist/commands/shared/task-store.d.ts +16 -0
  430. package/dist/commands/shared/task-store.d.ts.map +1 -0
  431. package/dist/commands/shared/task-store.js +142 -0
  432. package/dist/commands/start.command.d.ts +19 -0
  433. package/dist/commands/start.command.d.ts.map +1 -0
  434. package/dist/commands/start.command.js +143 -0
  435. package/dist/commands/sync.command.d.ts +6 -0
  436. package/dist/commands/sync.command.d.ts.map +1 -0
  437. package/dist/commands/sync.command.js +57 -0
  438. package/dist/commands/task/add.command.d.ts +18 -0
  439. package/dist/commands/task/add.command.d.ts.map +1 -0
  440. package/dist/commands/task/add.command.js +157 -0
  441. package/dist/commands/task/add.d.ts +13 -3
  442. package/dist/commands/task/add.d.ts.map +1 -1
  443. package/dist/commands/task/add.js +21 -126
  444. package/dist/commands/task/block.d.ts +2 -2
  445. package/dist/commands/task/block.d.ts.map +1 -1
  446. package/dist/commands/task/block.js +31 -21
  447. package/dist/commands/task/comment.command.d.ts +10 -0
  448. package/dist/commands/task/comment.command.d.ts.map +1 -0
  449. package/dist/commands/task/comment.command.js +57 -0
  450. package/dist/commands/task/comment.d.ts +2 -0
  451. package/dist/commands/task/comment.d.ts.map +1 -1
  452. package/dist/commands/task/comment.js +19 -9
  453. package/dist/commands/task/derive.command.d.ts +13 -0
  454. package/dist/commands/task/derive.command.d.ts.map +1 -0
  455. package/dist/commands/task/derive.command.js +94 -0
  456. package/dist/commands/task/derive.d.ts +13 -0
  457. package/dist/commands/task/derive.d.ts.map +1 -0
  458. package/dist/commands/task/derive.js +71 -0
  459. package/dist/commands/task/doc-set.command.d.ts +12 -0
  460. package/dist/commands/task/doc-set.command.d.ts.map +1 -0
  461. package/dist/commands/task/doc-set.command.js +82 -0
  462. package/dist/commands/task/doc-show.command.d.ts +10 -0
  463. package/dist/commands/task/doc-show.command.d.ts.map +1 -0
  464. package/dist/commands/task/doc-show.command.js +54 -0
  465. package/dist/commands/task/doc.command.d.ts +7 -0
  466. package/dist/commands/task/doc.command.d.ts.map +1 -0
  467. package/dist/commands/task/doc.command.js +22 -0
  468. package/dist/commands/task/doc.d.ts +9 -6
  469. package/dist/commands/task/doc.d.ts.map +1 -1
  470. package/dist/commands/task/doc.js +61 -113
  471. package/dist/commands/task/export.command.d.ts +6 -0
  472. package/dist/commands/task/export.command.d.ts.map +1 -0
  473. package/dist/commands/task/export.command.js +17 -0
  474. package/dist/commands/task/export.d.ts +2 -0
  475. package/dist/commands/task/export.d.ts.map +1 -1
  476. package/dist/commands/task/export.js +7 -9
  477. package/dist/commands/task/finish.d.ts +5 -4
  478. package/dist/commands/task/finish.d.ts.map +1 -1
  479. package/dist/commands/task/finish.js +80 -37
  480. package/dist/commands/task/index.d.ts +14 -13
  481. package/dist/commands/task/index.d.ts.map +1 -1
  482. package/dist/commands/task/index.js +13 -13
  483. package/dist/commands/task/lint.command.d.ts +5 -0
  484. package/dist/commands/task/lint.command.d.ts.map +1 -0
  485. package/dist/commands/task/lint.command.js +11 -0
  486. package/dist/commands/task/list.command.d.ts +9 -0
  487. package/dist/commands/task/list.command.d.ts.map +1 -0
  488. package/dist/commands/task/list.command.js +68 -0
  489. package/dist/commands/task/list.d.ts +6 -2
  490. package/dist/commands/task/list.d.ts.map +1 -1
  491. package/dist/commands/task/list.js +12 -15
  492. package/dist/commands/task/migrate-doc.command.d.ts +9 -0
  493. package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
  494. package/dist/commands/task/migrate-doc.command.js +65 -0
  495. package/dist/commands/task/migrate-doc.d.ts +3 -3
  496. package/dist/commands/task/migrate-doc.d.ts.map +1 -1
  497. package/dist/commands/task/migrate-doc.js +40 -47
  498. package/dist/commands/task/migrate.command.d.ts +10 -0
  499. package/dist/commands/task/migrate.command.d.ts.map +1 -0
  500. package/dist/commands/task/migrate.command.js +50 -0
  501. package/dist/commands/task/migrate.d.ts +5 -1
  502. package/dist/commands/task/migrate.d.ts.map +1 -1
  503. package/dist/commands/task/migrate.js +10 -44
  504. package/dist/commands/task/new.command.d.ts +6 -0
  505. package/dist/commands/task/new.command.d.ts.map +1 -0
  506. package/dist/commands/task/new.command.js +13 -0
  507. package/dist/commands/task/new.d.ts +13 -4
  508. package/dist/commands/task/new.d.ts.map +1 -1
  509. package/dist/commands/task/new.js +30 -92
  510. package/dist/commands/task/new.spec.d.ts +4 -0
  511. package/dist/commands/task/new.spec.d.ts.map +1 -0
  512. package/dist/commands/task/new.spec.js +79 -0
  513. package/dist/commands/task/next.command.d.ts +9 -0
  514. package/dist/commands/task/next.command.d.ts.map +1 -0
  515. package/dist/commands/task/next.command.js +89 -0
  516. package/dist/commands/task/next.d.ts +4 -1
  517. package/dist/commands/task/next.d.ts.map +1 -1
  518. package/dist/commands/task/next.js +15 -16
  519. package/dist/commands/task/normalize.command.d.ts +9 -0
  520. package/dist/commands/task/normalize.command.d.ts.map +1 -0
  521. package/dist/commands/task/normalize.command.js +39 -0
  522. package/dist/commands/task/normalize.d.ts +4 -1
  523. package/dist/commands/task/normalize.d.ts.map +1 -1
  524. package/dist/commands/task/normalize.js +18 -31
  525. package/dist/commands/task/plan-approve.command.d.ts +10 -0
  526. package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
  527. package/dist/commands/task/plan-approve.command.js +54 -0
  528. package/dist/commands/task/plan-reject.command.d.ts +10 -0
  529. package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
  530. package/dist/commands/task/plan-reject.command.js +59 -0
  531. package/dist/commands/task/plan-set.command.d.ts +11 -0
  532. package/dist/commands/task/plan-set.command.d.ts.map +1 -0
  533. package/dist/commands/task/plan-set.command.js +76 -0
  534. package/dist/commands/task/plan.d.ts +23 -10
  535. package/dist/commands/task/plan.d.ts.map +1 -1
  536. package/dist/commands/task/plan.js +182 -177
  537. package/dist/commands/task/ready.d.ts +2 -0
  538. package/dist/commands/task/ready.d.ts.map +1 -1
  539. package/dist/commands/task/ready.js +4 -6
  540. package/dist/commands/task/scaffold.command.d.ts +12 -0
  541. package/dist/commands/task/scaffold.command.d.ts.map +1 -0
  542. package/dist/commands/task/scaffold.command.js +73 -0
  543. package/dist/commands/task/scaffold.d.ts +7 -3
  544. package/dist/commands/task/scaffold.d.ts.map +1 -1
  545. package/dist/commands/task/scaffold.js +57 -67
  546. package/dist/commands/task/scrub.command.d.ts +11 -0
  547. package/dist/commands/task/scrub.command.d.ts.map +1 -0
  548. package/dist/commands/task/scrub.command.js +72 -0
  549. package/dist/commands/task/scrub.d.ts +6 -3
  550. package/dist/commands/task/scrub.d.ts.map +1 -1
  551. package/dist/commands/task/scrub.js +12 -68
  552. package/dist/commands/task/search.command.d.ts +11 -0
  553. package/dist/commands/task/search.command.d.ts.map +1 -0
  554. package/dist/commands/task/search.command.js +101 -0
  555. package/dist/commands/task/search.d.ts +5 -1
  556. package/dist/commands/task/search.d.ts.map +1 -1
  557. package/dist/commands/task/search.js +14 -23
  558. package/dist/commands/task/set-status.command.d.ts +21 -0
  559. package/dist/commands/task/set-status.command.d.ts.map +1 -0
  560. package/dist/commands/task/set-status.command.js +171 -0
  561. package/dist/commands/task/set-status.d.ts +2 -0
  562. package/dist/commands/task/set-status.d.ts.map +1 -1
  563. package/dist/commands/task/set-status.js +32 -12
  564. package/dist/commands/task/shared.d.ts +8 -2
  565. package/dist/commands/task/shared.d.ts.map +1 -1
  566. package/dist/commands/task/shared.js +68 -28
  567. package/dist/commands/task/show.command.d.ts +8 -0
  568. package/dist/commands/task/show.command.d.ts.map +1 -0
  569. package/dist/commands/task/show.command.js +19 -0
  570. package/dist/commands/task/show.d.ts +2 -0
  571. package/dist/commands/task/show.d.ts.map +1 -1
  572. package/dist/commands/task/show.js +5 -7
  573. package/dist/commands/task/start.d.ts +2 -2
  574. package/dist/commands/task/start.d.ts.map +1 -1
  575. package/dist/commands/task/start.js +66 -23
  576. package/dist/commands/task/update.command.d.ts +18 -0
  577. package/dist/commands/task/update.command.d.ts.map +1 -0
  578. package/dist/commands/task/update.command.js +141 -0
  579. package/dist/commands/task/update.d.ts +13 -3
  580. package/dist/commands/task/update.d.ts.map +1 -1
  581. package/dist/commands/task/update.js +31 -122
  582. package/dist/commands/task/verify-ok.command.d.ts +13 -0
  583. package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
  584. package/dist/commands/task/verify-ok.command.js +83 -0
  585. package/dist/commands/task/verify-record.d.ts +30 -8
  586. package/dist/commands/task/verify-record.d.ts.map +1 -1
  587. package/dist/commands/task/verify-record.js +114 -117
  588. package/dist/commands/task/verify-rework.command.d.ts +13 -0
  589. package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
  590. package/dist/commands/task/verify-rework.command.js +83 -0
  591. package/dist/commands/task/verify-show.command.d.ts +9 -0
  592. package/dist/commands/task/verify-show.command.d.ts.map +1 -0
  593. package/dist/commands/task/verify-show.command.js +38 -0
  594. package/dist/commands/task/verify.command.d.ts +7 -0
  595. package/dist/commands/task/verify.command.d.ts.map +1 -0
  596. package/dist/commands/task/verify.command.js +20 -0
  597. package/dist/commands/upgrade.command.d.ts +6 -0
  598. package/dist/commands/upgrade.command.d.ts.map +1 -0
  599. package/dist/commands/upgrade.command.js +104 -0
  600. package/dist/commands/upgrade.d.ts +13 -2
  601. package/dist/commands/upgrade.d.ts.map +1 -1
  602. package/dist/commands/upgrade.js +12 -80
  603. package/dist/commands/verify.command.d.ts +16 -0
  604. package/dist/commands/verify.command.d.ts.map +1 -0
  605. package/dist/commands/verify.command.js +113 -0
  606. package/dist/commands/workflow.d.ts +4 -6
  607. package/dist/commands/workflow.d.ts.map +1 -1
  608. package/dist/commands/workflow.js +4 -7
  609. package/dist/meta/release.d.ts +2 -0
  610. package/dist/meta/release.d.ts.map +1 -0
  611. package/dist/meta/release.js +50 -0
  612. package/dist/policy/evaluate.d.ts +3 -0
  613. package/dist/policy/evaluate.d.ts.map +1 -0
  614. package/dist/policy/evaluate.js +27 -0
  615. package/dist/policy/result.d.ts +7 -0
  616. package/dist/policy/result.d.ts.map +1 -0
  617. package/dist/policy/result.js +21 -0
  618. package/dist/policy/rules/allowlist.d.ts +3 -0
  619. package/dist/policy/rules/allowlist.d.ts.map +1 -0
  620. package/dist/policy/rules/allowlist.js +30 -0
  621. package/dist/policy/rules/branch-pr-base.d.ts +3 -0
  622. package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
  623. package/dist/policy/rules/branch-pr-base.js +43 -0
  624. package/dist/policy/rules/clean-tree.d.ts +3 -0
  625. package/dist/policy/rules/clean-tree.d.ts.map +1 -0
  626. package/dist/policy/rules/clean-tree.js +19 -0
  627. package/dist/policy/rules/commit-subject.d.ts +3 -0
  628. package/dist/policy/rules/commit-subject.d.ts.map +1 -0
  629. package/dist/policy/rules/commit-subject.js +33 -0
  630. package/dist/policy/rules/protected-paths.d.ts +3 -0
  631. package/dist/policy/rules/protected-paths.d.ts.map +1 -0
  632. package/dist/policy/rules/protected-paths.js +53 -0
  633. package/dist/policy/types.d.ts +38 -0
  634. package/dist/policy/types.d.ts.map +1 -0
  635. package/dist/policy/types.js +1 -0
  636. package/dist/shared/git-log.d.ts +5 -0
  637. package/dist/shared/git-log.d.ts.map +1 -0
  638. package/dist/shared/git-log.js +14 -0
  639. package/dist/shared/git-path.d.ts +3 -0
  640. package/dist/shared/git-path.d.ts.map +1 -0
  641. package/dist/shared/git-path.js +30 -0
  642. package/dist/shared/guards.d.ts +2 -0
  643. package/dist/shared/guards.d.ts.map +1 -0
  644. package/dist/shared/guards.js +3 -0
  645. package/dist/shared/protected-paths.d.ts +12 -0
  646. package/dist/shared/protected-paths.d.ts.map +1 -0
  647. package/dist/shared/protected-paths.js +51 -0
  648. package/dist/shared/strings.d.ts +2 -0
  649. package/dist/shared/strings.d.ts.map +1 -0
  650. package/dist/shared/strings.js +14 -0
  651. package/dist/shared/write-if-changed.d.ts +3 -0
  652. package/dist/shared/write-if-changed.d.ts.map +1 -0
  653. package/dist/shared/write-if-changed.js +25 -0
  654. package/package.json +2 -2
  655. package/dist/cli/help.d.ts +0 -2
  656. package/dist/cli/help.d.ts.map +0 -1
  657. package/dist/cli/help.js +0 -127
  658. package/dist/commands/task/verify.d.ts +0 -2
  659. package/dist/commands/task/verify.d.ts.map +0 -1
  660. package/dist/commands/task/verify.js +0 -1
@@ -0,0 +1,143 @@
1
+ import { usageError } from "../cli/spec/errors.js";
2
+ import { cmdBlock } from "./task/block.js";
3
+ function toStringList(v) {
4
+ if (typeof v === "string")
5
+ return [v];
6
+ if (Array.isArray(v))
7
+ return v.filter((x) => typeof x === "string");
8
+ return [];
9
+ }
10
+ export const blockSpec = {
11
+ id: ["block"],
12
+ group: "Lifecycle",
13
+ summary: "Transition a task to BLOCKED and record a structured Blocked comment.",
14
+ args: [
15
+ {
16
+ name: "task-id",
17
+ required: true,
18
+ valueHint: "<task-id>",
19
+ description: "Existing task id.",
20
+ },
21
+ ],
22
+ options: [
23
+ {
24
+ kind: "string",
25
+ name: "author",
26
+ valueHint: "<id>",
27
+ required: true,
28
+ description: "Comment author id (e.g. CODER).",
29
+ },
30
+ {
31
+ kind: "string",
32
+ name: "body",
33
+ valueHint: "<text>",
34
+ required: true,
35
+ description: "Structured comment body (must match the configured Blocked: prefix).",
36
+ },
37
+ {
38
+ kind: "boolean",
39
+ name: "commit-from-comment",
40
+ default: false,
41
+ description: "Create a status commit using the comment body.",
42
+ },
43
+ {
44
+ kind: "string",
45
+ name: "commit-emoji",
46
+ valueHint: "<emoji>",
47
+ description: "Override the status commit emoji (used with --commit-from-comment).",
48
+ },
49
+ {
50
+ kind: "string",
51
+ name: "commit-allow",
52
+ valueHint: "<path-prefix>",
53
+ repeatable: true,
54
+ description: "Repeatable. Allowlist path prefixes to stage for the status commit (used with --commit-from-comment).",
55
+ },
56
+ {
57
+ kind: "boolean",
58
+ name: "commit-auto-allow",
59
+ default: false,
60
+ description: "Auto-allow inferred allowlist paths if none are provided (used with --commit-from-comment).",
61
+ },
62
+ {
63
+ kind: "boolean",
64
+ name: "commit-allow-tasks",
65
+ default: true,
66
+ hidden: true,
67
+ description: "Deprecated. Tasks are always allowed for status commits.",
68
+ deprecated: "no-op",
69
+ },
70
+ {
71
+ kind: "boolean",
72
+ name: "commit-require-clean",
73
+ default: false,
74
+ description: "Require a clean working tree for the status commit (used with --commit-from-comment).",
75
+ },
76
+ {
77
+ kind: "boolean",
78
+ name: "confirm-status-commit",
79
+ default: false,
80
+ description: "Confirm status commit creation when status_commit_policy=confirm (used with --commit-from-comment).",
81
+ },
82
+ {
83
+ kind: "boolean",
84
+ name: "force",
85
+ default: false,
86
+ description: "Override status transition restrictions.",
87
+ },
88
+ { kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
89
+ ],
90
+ examples: [
91
+ {
92
+ cmd: 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: waiting for review"',
93
+ why: "Block work on a task.",
94
+ },
95
+ {
96
+ cmd: 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: waiting for review" --commit-from-comment --commit-allow packages/agentplane/src',
97
+ why: "Block work and create a status commit from the comment.",
98
+ },
99
+ ],
100
+ validateRaw: (raw) => {
101
+ const author = typeof raw.opts.author === "string" ? raw.opts.author.trim() : "";
102
+ const body = typeof raw.opts.body === "string" ? raw.opts.body.trim() : "";
103
+ if (!author)
104
+ throw usageError({ spec: blockSpec, message: "Invalid value for --author: empty." });
105
+ if (!body)
106
+ throw usageError({ spec: blockSpec, message: "Invalid value for --body: empty." });
107
+ },
108
+ parse: (raw) => ({
109
+ taskId: typeof raw.args["task-id"] === "string" ? raw.args["task-id"] : "",
110
+ author: raw.opts.author,
111
+ body: raw.opts.body,
112
+ commitFromComment: raw.opts["commit-from-comment"] === true,
113
+ commitEmoji: raw.opts["commit-emoji"],
114
+ commitAllow: toStringList(raw.opts["commit-allow"]),
115
+ commitAutoAllow: raw.opts["commit-auto-allow"] === true,
116
+ commitAllowTasks: raw.opts["commit-allow-tasks"] !== false,
117
+ commitRequireClean: raw.opts["commit-require-clean"] === true,
118
+ confirmStatusCommit: raw.opts["confirm-status-commit"] === true,
119
+ force: raw.opts.force === true,
120
+ quiet: raw.opts.quiet === true,
121
+ }),
122
+ };
123
+ export function makeRunBlockHandler(getCtx) {
124
+ return async (ctx, p) => {
125
+ return await cmdBlock({
126
+ ctx: await getCtx("block"),
127
+ cwd: ctx.cwd,
128
+ rootOverride: ctx.rootOverride,
129
+ taskId: p.taskId,
130
+ author: p.author,
131
+ body: p.body,
132
+ commitFromComment: p.commitFromComment,
133
+ commitEmoji: p.commitEmoji,
134
+ commitAllow: p.commitAllow,
135
+ commitAutoAllow: p.commitAutoAllow,
136
+ commitAllowTasks: p.commitAllowTasks,
137
+ commitRequireClean: p.commitRequireClean,
138
+ confirmStatusCommit: p.confirmStatusCommit,
139
+ force: p.force,
140
+ quiet: p.quiet,
141
+ });
142
+ };
143
+ }
@@ -0,0 +1,20 @@
1
+ import type { CommandHandler, CommandSpec } from "../../cli/spec/spec.js";
2
+ type BranchBaseGroupParsed = {
3
+ cmd: string[];
4
+ };
5
+ export declare const branchBaseSpec: CommandSpec<BranchBaseGroupParsed>;
6
+ export declare const branchBaseGetSpec: CommandSpec<Record<string, never>>;
7
+ export declare const branchBaseClearSpec: CommandSpec<Record<string, never>>;
8
+ export declare const branchBaseExplainSpec: CommandSpec<Record<string, never>>;
9
+ export type BranchBaseSetParsed = {
10
+ value: string | null;
11
+ useCurrent: boolean;
12
+ };
13
+ export declare const branchBaseSetSpec: CommandSpec<BranchBaseSetParsed>;
14
+ export declare const runBranchBase: CommandHandler<BranchBaseGroupParsed>;
15
+ export declare const runBranchBaseGet: CommandHandler<Record<string, never>>;
16
+ export declare const runBranchBaseClear: CommandHandler<Record<string, never>>;
17
+ export declare const runBranchBaseExplain: CommandHandler<Record<string, never>>;
18
+ export declare const runBranchBaseSet: CommandHandler<BranchBaseSetParsed>;
19
+ export {};
20
+ //# sourceMappingURL=base.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.command.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/base.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAW1E,KAAK,qBAAqB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/C,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,qBAAqB,CAa7D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAKhE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAKlE,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAKpE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,mBAAmB,CA4C9D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,qBAAqB,CAc/D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAElE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAEpE,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAEtE,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAAc,CAAC,mBAAmB,CAOhE,CAAC"}
@@ -0,0 +1,110 @@
1
+ import { usageError } from "../../cli/spec/errors.js";
2
+ import { suggestOne } from "../../cli/spec/suggest.js";
3
+ import { cmdBranchBaseClear, cmdBranchBaseExplain, cmdBranchBaseGet, cmdBranchBaseSet, } from "./index.js";
4
+ export const branchBaseSpec = {
5
+ id: ["branch", "base"],
6
+ group: "Branch",
7
+ summary: "Manage the pinned base branch used in branch_pr workflow.",
8
+ synopsis: ["agentplane branch base <get|set|clear|explain> [args] [options]"],
9
+ args: [{ name: "cmd", required: false, variadic: true, valueHint: "<cmd>" }],
10
+ examples: [
11
+ { cmd: "agentplane branch base get", why: "Print the pinned base branch." },
12
+ { cmd: "agentplane branch base set --current", why: "Pin the current branch as base." },
13
+ { cmd: "agentplane branch base clear", why: "Clear the pinned base branch." },
14
+ { cmd: "agentplane branch base explain", why: "Show current/pinned/effective base details." },
15
+ ],
16
+ parse: (raw) => ({ cmd: (raw.args.cmd ?? []) }),
17
+ };
18
+ export const branchBaseGetSpec = {
19
+ id: ["branch", "base", "get"],
20
+ group: "Branch",
21
+ summary: "Print the pinned base branch.",
22
+ parse: () => ({}),
23
+ };
24
+ export const branchBaseClearSpec = {
25
+ id: ["branch", "base", "clear"],
26
+ group: "Branch",
27
+ summary: "Clear the pinned base branch.",
28
+ parse: () => ({}),
29
+ };
30
+ export const branchBaseExplainSpec = {
31
+ id: ["branch", "base", "explain"],
32
+ group: "Branch",
33
+ summary: "Explain current, pinned, and effective base branch resolution.",
34
+ parse: () => ({}),
35
+ };
36
+ export const branchBaseSetSpec = {
37
+ id: ["branch", "base", "set"],
38
+ group: "Branch",
39
+ summary: "Pin a base branch by name, or pin the current branch.",
40
+ args: [
41
+ {
42
+ name: "name",
43
+ required: false,
44
+ valueHint: "<name>",
45
+ description: "Branch name to pin as base (conflicts with --current).",
46
+ },
47
+ ],
48
+ options: [
49
+ {
50
+ kind: "boolean",
51
+ name: "current",
52
+ description: "Pin the current branch as base (conflicts with <name>).",
53
+ default: false,
54
+ },
55
+ ],
56
+ examples: [
57
+ { cmd: "agentplane branch base set main", why: "Pin main as the base branch." },
58
+ { cmd: "agentplane branch base set --current", why: "Pin the current branch as base." },
59
+ ],
60
+ validateRaw: (raw) => {
61
+ const name = raw.args.name ? String(raw.args.name).trim() : "";
62
+ const useCurrent = raw.opts.current === true;
63
+ if (useCurrent && name) {
64
+ throw usageError({
65
+ spec: branchBaseSetSpec,
66
+ message: "Invalid usage: <name> conflicts with --current.",
67
+ });
68
+ }
69
+ if (!useCurrent && !name) {
70
+ throw usageError({
71
+ spec: branchBaseSetSpec,
72
+ message: "Missing required argument: <name> (or pass --current).",
73
+ });
74
+ }
75
+ },
76
+ parse: (raw) => ({
77
+ value: raw.args.name ? String(raw.args.name).trim() : null,
78
+ useCurrent: raw.opts.current === true,
79
+ }),
80
+ };
81
+ export const runBranchBase = (_ctx, p) => {
82
+ const input = p.cmd.join(" ");
83
+ const candidates = ["get", "set", "clear", "explain"];
84
+ const suggestion = suggestOne(input, candidates);
85
+ const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
86
+ const msg = p.cmd.length === 0 ? "Missing subcommand." : `Unknown subcommand: ${p.cmd[0]}.`;
87
+ return Promise.reject(usageError({
88
+ spec: branchBaseSpec,
89
+ command: "branch base",
90
+ message: `${msg}${suffix}`,
91
+ context: { command: "branch base" },
92
+ }));
93
+ };
94
+ export const runBranchBaseGet = async (ctx) => {
95
+ return await cmdBranchBaseGet({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
96
+ };
97
+ export const runBranchBaseClear = async (ctx) => {
98
+ return await cmdBranchBaseClear({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
99
+ };
100
+ export const runBranchBaseExplain = async (ctx) => {
101
+ return await cmdBranchBaseExplain({ cwd: ctx.cwd, rootOverride: ctx.rootOverride });
102
+ };
103
+ export const runBranchBaseSet = async (ctx, p) => {
104
+ return await cmdBranchBaseSet({
105
+ cwd: ctx.cwd,
106
+ rootOverride: ctx.rootOverride,
107
+ value: p.value ?? undefined,
108
+ useCurrent: p.useCurrent,
109
+ });
110
+ };
@@ -0,0 +1,19 @@
1
+ export declare function cmdBranchBaseGet(opts: {
2
+ cwd: string;
3
+ rootOverride?: string;
4
+ }): Promise<number>;
5
+ export declare function cmdBranchBaseSet(opts: {
6
+ cwd: string;
7
+ rootOverride?: string;
8
+ value?: string;
9
+ useCurrent?: boolean;
10
+ }): Promise<number>;
11
+ export declare function cmdBranchBaseClear(opts: {
12
+ cwd: string;
13
+ rootOverride?: string;
14
+ }): Promise<number>;
15
+ export declare function cmdBranchBaseExplain(opts: {
16
+ cwd: string;
17
+ rootOverride?: string;
18
+ }): Promise<number>;
19
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/base.ts"],"names":[],"mappings":"AAaA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ClB"}
@@ -0,0 +1,114 @@
1
+ import { clearPinnedBaseBranch, getPinnedBaseBranch, loadConfig, resolveBaseBranch, resolveProject, setPinnedBaseBranch, } from "@agentplaneorg/core";
2
+ import { mapCoreError } from "../../cli/error-map.js";
3
+ import { CliError } from "../../shared/errors.js";
4
+ import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
5
+ export async function cmdBranchBaseGet(opts) {
6
+ try {
7
+ const pinned = await getPinnedBaseBranch({
8
+ cwd: opts.cwd,
9
+ rootOverride: opts.rootOverride ?? null,
10
+ });
11
+ if (!pinned) {
12
+ throw new CliError({
13
+ exitCode: 2,
14
+ code: "E_USAGE",
15
+ message: "Base branch is not pinned (use `agentplane branch base set`).",
16
+ });
17
+ }
18
+ process.stdout.write(`${pinned}\n`);
19
+ return 0;
20
+ }
21
+ catch (err) {
22
+ if (err instanceof CliError)
23
+ throw err;
24
+ throw mapCoreError(err, { command: "branch base get", root: opts.rootOverride ?? null });
25
+ }
26
+ }
27
+ export async function cmdBranchBaseSet(opts) {
28
+ const trimmed = (opts.value ?? "").trim();
29
+ if (trimmed.length === 0 && !opts.useCurrent) {
30
+ throw new CliError({
31
+ exitCode: 2,
32
+ code: "E_USAGE",
33
+ message: "Missing base branch value (pass <name> or --current).",
34
+ });
35
+ }
36
+ try {
37
+ let nextValue = trimmed;
38
+ if (opts.useCurrent) {
39
+ const resolved = await resolveProject({
40
+ cwd: opts.cwd,
41
+ rootOverride: opts.rootOverride ?? null,
42
+ });
43
+ nextValue = await gitCurrentBranch(resolved.gitRoot);
44
+ }
45
+ const value = await setPinnedBaseBranch({
46
+ cwd: opts.cwd,
47
+ rootOverride: opts.rootOverride ?? null,
48
+ value: nextValue,
49
+ });
50
+ process.stdout.write(`${value}\n`);
51
+ return 0;
52
+ }
53
+ catch (err) {
54
+ throw mapCoreError(err, { command: "branch base set", root: opts.rootOverride ?? null });
55
+ }
56
+ }
57
+ export async function cmdBranchBaseClear(opts) {
58
+ try {
59
+ const cleared = await clearPinnedBaseBranch({
60
+ cwd: opts.cwd,
61
+ rootOverride: opts.rootOverride ?? null,
62
+ });
63
+ process.stdout.write(`${cleared ? "cleared" : "no-op"}\n`);
64
+ return 0;
65
+ }
66
+ catch (err) {
67
+ throw mapCoreError(err, { command: "branch base clear", root: opts.rootOverride ?? null });
68
+ }
69
+ }
70
+ export async function cmdBranchBaseExplain(opts) {
71
+ try {
72
+ const resolved = await resolveProject({
73
+ cwd: opts.cwd,
74
+ rootOverride: opts.rootOverride ?? null,
75
+ });
76
+ const loaded = await loadConfig(resolved.agentplaneDir);
77
+ let current = null;
78
+ try {
79
+ current = await gitCurrentBranch(resolved.gitRoot);
80
+ }
81
+ catch {
82
+ current = null;
83
+ }
84
+ const pinned = await getPinnedBaseBranch({
85
+ cwd: opts.cwd,
86
+ rootOverride: opts.rootOverride ?? null,
87
+ });
88
+ const effective = await resolveBaseBranch({
89
+ cwd: opts.cwd,
90
+ rootOverride: opts.rootOverride ?? null,
91
+ cliBaseOpt: null,
92
+ mode: loaded.config.workflow_mode,
93
+ });
94
+ const warnings = [];
95
+ if (pinned && !(await gitBranchExists(resolved.gitRoot, pinned))) {
96
+ warnings.push(`Pinned base branch not found: ${pinned}`);
97
+ }
98
+ if (effective && !(await gitBranchExists(resolved.gitRoot, effective))) {
99
+ warnings.push(`Effective base branch not found: ${effective}`);
100
+ }
101
+ process.stdout.write(`current_branch=${current ?? "-"}\n`);
102
+ process.stdout.write(`pinned_base=${pinned ?? "-"}\n`);
103
+ process.stdout.write(`effective_base=${effective ?? "-"}\n`);
104
+ if (warnings.length > 0) {
105
+ for (const warning of warnings) {
106
+ process.stdout.write(`warning=${warning}\n`);
107
+ }
108
+ }
109
+ return 0;
110
+ }
111
+ catch (err) {
112
+ throw mapCoreError(err, { command: "branch base explain", root: opts.rootOverride ?? null });
113
+ }
114
+ }
@@ -0,0 +1,11 @@
1
+ import { type CommandContext } from "../shared/task-backend.js";
2
+ export declare function cmdCleanupMerged(opts: {
3
+ ctx?: CommandContext;
4
+ cwd: string;
5
+ rootOverride?: string;
6
+ base?: string;
7
+ yes: boolean;
8
+ archive: boolean;
9
+ quiet: boolean;
10
+ }): Promise<number>;
11
+ //# sourceMappingURL=cleanup-merged.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup-merged.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/cleanup-merged.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIpF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0IlB"}
@@ -0,0 +1,141 @@
1
+ import path from "node:path";
2
+ import { resolveBaseBranch } from "@agentplaneorg/core";
3
+ import { mapBackendError } from "../../cli/error-map.js";
4
+ import { successMessage, unknownEntityMessage, workflowModeMessage } from "../../cli/output.js";
5
+ import { CliError } from "../../shared/errors.js";
6
+ import { ensureGitClean } from "../guard/index.js";
7
+ import { execFileAsync, gitEnv } from "../shared/git.js";
8
+ import { gitDiffNames } from "../shared/git-diff.js";
9
+ import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
10
+ import { findWorktreeForBranch, gitListTaskBranches, parseTaskIdFromBranch, } from "../shared/git-worktree.js";
11
+ import { isPathWithin, resolvePathFallback } from "../shared/path.js";
12
+ import { loadCommandContext } from "../shared/task-backend.js";
13
+ import { archivePrArtifacts } from "./internal/archive-pr.js";
14
+ export async function cmdCleanupMerged(opts) {
15
+ try {
16
+ const ctx = opts.ctx ??
17
+ (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
18
+ const resolved = ctx.resolvedProject;
19
+ const config = ctx.config;
20
+ if (config.workflow_mode !== "branch_pr") {
21
+ throw new CliError({
22
+ exitCode: 2,
23
+ code: "E_USAGE",
24
+ message: workflowModeMessage(config.workflow_mode, "branch_pr"),
25
+ });
26
+ }
27
+ await ensureGitClean({ cwd: opts.cwd, rootOverride: opts.rootOverride });
28
+ const baseBranch = await resolveBaseBranch({
29
+ cwd: opts.cwd,
30
+ rootOverride: opts.rootOverride ?? null,
31
+ cliBaseOpt: opts.base ?? null,
32
+ mode: config.workflow_mode,
33
+ });
34
+ if (!baseBranch) {
35
+ throw new CliError({
36
+ exitCode: 2,
37
+ code: "E_USAGE",
38
+ message: "Base branch could not be resolved (use `agentplane branch base set` or --base).",
39
+ });
40
+ }
41
+ if (!(await gitBranchExists(resolved.gitRoot, baseBranch))) {
42
+ throw new CliError({
43
+ exitCode: 5,
44
+ code: "E_GIT",
45
+ message: unknownEntityMessage("base branch", baseBranch),
46
+ });
47
+ }
48
+ const currentBranch = await gitCurrentBranch(resolved.gitRoot);
49
+ if (currentBranch !== baseBranch) {
50
+ throw new CliError({
51
+ exitCode: 5,
52
+ code: "E_GIT",
53
+ message: `cleanup merged must run on base branch ${baseBranch} (current: ${currentBranch})`,
54
+ });
55
+ }
56
+ const repoRoot = await resolvePathFallback(resolved.gitRoot);
57
+ const tasks = await ctx.taskBackend.listTasks();
58
+ const tasksById = new Map(tasks.map((task) => [task.id, task]));
59
+ const prefix = config.branch.task_prefix;
60
+ const branches = await gitListTaskBranches(resolved.gitRoot, prefix);
61
+ const candidates = [];
62
+ for (const branch of branches) {
63
+ if (branch === baseBranch)
64
+ continue;
65
+ const taskId = parseTaskIdFromBranch(prefix, branch);
66
+ if (!taskId)
67
+ continue;
68
+ const task = tasksById.get(taskId);
69
+ if (!task)
70
+ continue;
71
+ const status = String(task.status || "").toUpperCase();
72
+ if (status !== "DONE")
73
+ continue;
74
+ const diff = await gitDiffNames(resolved.gitRoot, baseBranch, branch);
75
+ if (diff.length > 0)
76
+ continue;
77
+ const worktreePath = await findWorktreeForBranch(resolved.gitRoot, branch);
78
+ candidates.push({ taskId, branch, worktreePath });
79
+ }
80
+ const sortedCandidates = candidates.toSorted((a, b) => a.taskId.localeCompare(b.taskId));
81
+ if (!opts.quiet) {
82
+ const archiveLabel = opts.archive ? " archive=on" : "";
83
+ process.stdout.write(`cleanup merged (base=${baseBranch}${archiveLabel})\n`);
84
+ if (sortedCandidates.length === 0) {
85
+ process.stdout.write("no candidates\n");
86
+ return 0;
87
+ }
88
+ for (const item of sortedCandidates) {
89
+ process.stdout.write(`- ${item.taskId}: branch=${item.branch} worktree=${item.worktreePath ?? "-"}\n`);
90
+ }
91
+ }
92
+ if (!opts.yes) {
93
+ if (!opts.quiet) {
94
+ process.stdout.write("Re-run with --yes to delete these branches/worktrees.\n");
95
+ }
96
+ return 0;
97
+ }
98
+ for (const item of sortedCandidates) {
99
+ const worktreePath = item.worktreePath ? await resolvePathFallback(item.worktreePath) : null;
100
+ if (worktreePath) {
101
+ if (!isPathWithin(repoRoot, worktreePath)) {
102
+ throw new CliError({
103
+ exitCode: 5,
104
+ code: "E_GIT",
105
+ message: `Refusing to remove worktree outside repo: ${worktreePath}`,
106
+ });
107
+ }
108
+ if (worktreePath === repoRoot) {
109
+ throw new CliError({
110
+ exitCode: 5,
111
+ code: "E_GIT",
112
+ message: "Refusing to remove the current worktree",
113
+ });
114
+ }
115
+ }
116
+ if (opts.archive) {
117
+ const taskDir = path.join(resolved.gitRoot, config.paths.workflow_dir, item.taskId);
118
+ await archivePrArtifacts(taskDir);
119
+ }
120
+ if (worktreePath) {
121
+ await execFileAsync("git", ["worktree", "remove", "--force", worktreePath], {
122
+ cwd: resolved.gitRoot,
123
+ env: gitEnv(),
124
+ });
125
+ }
126
+ await execFileAsync("git", ["branch", "-D", item.branch], {
127
+ cwd: resolved.gitRoot,
128
+ env: gitEnv(),
129
+ });
130
+ }
131
+ if (!opts.quiet) {
132
+ process.stdout.write(`${successMessage("cleanup merged", undefined, `deleted=${candidates.length}`)}\n`);
133
+ }
134
+ return 0;
135
+ }
136
+ catch (err) {
137
+ if (err instanceof CliError)
138
+ throw err;
139
+ throw mapBackendError(err, { command: "cleanup merged", root: opts.rootOverride ?? null });
140
+ }
141
+ }
@@ -1,60 +1,7 @@
1
- export { gitInitRepo, resolveInitBaseBranch, promptInitBaseBranch, ensureInitCommit, } from "../shared/git-ops.js";
2
- export declare const BRANCH_BASE_USAGE = "Usage: agentplane branch base get|set|clear|explain [<name>|--current]";
3
- export declare const BRANCH_BASE_USAGE_EXAMPLE = "agentplane branch base set --current";
4
- export declare const BRANCH_STATUS_USAGE = "Usage: agentplane branch status [--branch <name>] [--base <name>]";
5
- export declare const BRANCH_STATUS_USAGE_EXAMPLE = "agentplane branch status --base main";
6
- export declare const BRANCH_REMOVE_USAGE = "Usage: agentplane branch remove [--branch <name>] [--worktree <path>] [--force] [--quiet]";
7
- export declare const BRANCH_REMOVE_USAGE_EXAMPLE = "agentplane branch remove --branch task/20260203-F1Q8AB --worktree .agentplane/worktrees/task";
8
- export declare const WORK_START_USAGE = "Usage: agentplane work start <task-id> --agent <id> --slug <slug> [--worktree]";
9
- export declare const WORK_START_USAGE_EXAMPLE = "agentplane work start 202602030608-F1Q8AB --agent CODER --slug cli --worktree";
10
- export declare const CLEANUP_MERGED_USAGE = "Usage: agentplane cleanup merged [--base <name>] [--yes] [--archive] [--quiet]";
11
- export declare const CLEANUP_MERGED_USAGE_EXAMPLE = "agentplane cleanup merged --yes";
12
- export declare function cmdWorkStart(opts: {
13
- cwd: string;
14
- rootOverride?: string;
15
- taskId: string;
16
- agent: string;
17
- slug: string;
18
- worktree: boolean;
19
- }): Promise<number>;
20
- export declare function cmdCleanupMerged(opts: {
21
- cwd: string;
22
- rootOverride?: string;
23
- base?: string;
24
- yes: boolean;
25
- archive: boolean;
26
- quiet: boolean;
27
- }): Promise<number>;
28
- export declare function cmdBranchBaseGet(opts: {
29
- cwd: string;
30
- rootOverride?: string;
31
- }): Promise<number>;
32
- export declare function cmdBranchBaseSet(opts: {
33
- cwd: string;
34
- rootOverride?: string;
35
- value?: string;
36
- useCurrent?: boolean;
37
- }): Promise<number>;
38
- export declare function cmdBranchBaseClear(opts: {
39
- cwd: string;
40
- rootOverride?: string;
41
- }): Promise<number>;
42
- export declare function cmdBranchBaseExplain(opts: {
43
- cwd: string;
44
- rootOverride?: string;
45
- }): Promise<number>;
46
- export declare function cmdBranchStatus(opts: {
47
- cwd: string;
48
- rootOverride?: string;
49
- branch?: string;
50
- base?: string;
51
- }): Promise<number>;
52
- export declare function cmdBranchRemove(opts: {
53
- cwd: string;
54
- rootOverride?: string;
55
- branch?: string;
56
- worktree?: string;
57
- force: boolean;
58
- quiet: boolean;
59
- }): Promise<number>;
1
+ export { ensureInitCommit, gitInitRepo, promptInitBaseBranch, resolveInitBaseBranch, } from "../shared/git-ops.js";
2
+ export { cmdBranchBaseClear, cmdBranchBaseExplain, cmdBranchBaseGet, cmdBranchBaseSet, } from "./base.js";
3
+ export { cmdBranchRemove } from "./remove.js";
4
+ export { cmdBranchStatus } from "./status.js";
5
+ export { cmdCleanupMerged } from "./cleanup-merged.js";
6
+ export { cmdWorkStart } from "./work-start.js";
60
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/index.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,iBAAiB,2EAC4C,CAAC;AAC3E,eAAO,MAAM,yBAAyB,yCAAyC,CAAC;AAChF,eAAO,MAAM,mBAAmB,sEACqC,CAAC;AACtE,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAClF,eAAO,MAAM,mBAAmB,8FAC6D,CAAC;AAC9F,eAAO,MAAM,2BAA2B,iGACwD,CAAC;AACjG,eAAO,MAAM,gBAAgB,mFACqD,CAAC;AACnF,eAAO,MAAM,wBAAwB,kFAC4C,CAAC;AAClF,eAAO,MAAM,oBAAoB,mFACiD,CAAC;AACnF,eAAO,MAAM,4BAA4B,oCAAoC,CAAC;AAoD9E,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4GlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8IlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQlB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ClB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAmDlB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA4DlB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}