agentplane 0.1.9 → 0.2.1

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 (645) hide show
  1. package/README.md +4 -4
  2. package/assets/AGENTS.md +281 -70
  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 -204
  72. package/dist/backends/task-backend.d.ts.map +1 -1
  73. package/dist/backends/task-backend.js +4 -1366
  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 +25 -8
  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 -2463
  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 -87
  236. package/dist/commands/guard/index.d.ts.map +1 -1
  237. package/dist/commands/guard/index.js +4 -481
  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 +36 -81
  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 -81
  397. package/dist/commands/recipes.d.ts.map +1 -1
  398. package/dist/commands/recipes.js +6 -1457
  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 +1 -6
  418. package/dist/commands/scenario.d.ts.map +1 -1
  419. package/dist/commands/scenario.js +1 -501
  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 +17 -5
  427. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  428. package/dist/commands/shared/task-backend.js +34 -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 +13 -9
  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 +10 -7
  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 +50 -17
  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 +14 -8
  564. package/dist/commands/task/shared.d.ts +5 -0
  565. package/dist/commands/task/shared.d.ts.map +1 -1
  566. package/dist/commands/task/shared.js +50 -0
  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 +48 -11
  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 +107 -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 +19 -2
  601. package/dist/commands/upgrade.d.ts.map +1 -1
  602. package/dist/commands/upgrade.js +281 -85
  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/write-if-changed.d.ts +3 -0
  637. package/dist/shared/write-if-changed.d.ts.map +1 -0
  638. package/dist/shared/write-if-changed.js +25 -0
  639. package/package.json +3 -3
  640. package/dist/cli/help.d.ts +0 -2
  641. package/dist/cli/help.d.ts.map +0 -1
  642. package/dist/cli/help.js +0 -127
  643. package/dist/commands/task/verify.d.ts +0 -2
  644. package/dist/commands/task/verify.d.ts.map +0 -1
  645. package/dist/commands/task/verify.js +0 -1
package/README.md CHANGED
@@ -28,8 +28,8 @@ Create your first task and run the workflow:
28
28
 
29
29
  ```bash
30
30
  agentplane task new --title "First task" --description "Describe the change" --priority med --owner ORCHESTRATOR --tag docs
31
- agentplane verify <task-id>
32
- agentplane finish <task-id>
31
+ agentplane verify <task-id> --ok --by ORCHESTRATOR --note "Verified"
32
+ agentplane finish <task-id> --author ORCHESTRATOR --body "Verified: done" --result "First task completed"
33
33
  ```
34
34
 
35
35
  Prefer `npx` instead of a global install?
@@ -90,8 +90,8 @@ agentplane quickstart
90
90
  agentplane config show
91
91
  agentplane task list
92
92
  agentplane task new --title "..." --description "..." --priority med --owner ORCHESTRATOR --tag docs
93
- agentplane verify <task-id>
94
- agentplane finish <task-id>
93
+ agentplane verify <task-id> --ok --by ORCHESTRATOR --note "Verified"
94
+ agentplane finish <task-id> --author ORCHESTRATOR --body "Verified: done" --result "Task completed"
95
95
  agentplane recipes list
96
96
  ```
97
97
 
package/assets/AGENTS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!--
2
- AGENTS_POLICY: prod-v1.0
2
+ AGENTS_POLICY: prod-v1.1
3
3
  repo_namespace: .agentplane
4
4
  default_initiator: ORCHESTRATOR
5
5
  -->
@@ -24,25 +24,44 @@ This policy is designed to be the single, authoritative instruction set the agen
24
24
 
25
25
  If two sources conflict, prefer the higher-priority source.
26
26
 
27
+ ## CLI invocation
28
+
29
+ All commands in this policy are written as `agentplane ...`.
30
+
31
+ - If you are working inside the agentplane repository checkout, prefer the **repo-local CLI entrypoint** over any system-installed binary.
32
+ - Otherwise (packaged install), `agentplane ...` refers to the available `agentplane` binary.
33
+
34
+ If the preferred entrypoint fails (missing deps/build), treat any bootstrap step (`bun install`, `npm install`, `bun run build`, etc.)
35
+ as **network and/or outside-repo** activity and request explicit approval before proceeding.
36
+
27
37
  ## Scope boundary
28
38
 
29
- - All operations must remain within the repository unless explicitly approved (see Network & Outside-Repo rules).
39
+ - All operations must remain within the repository unless explicitly approved (see Approval Gates + Overrides).
30
40
  - Do not read/write global user files (`~`, `/etc`, keychains, ssh keys, global git config) unless explicitly approved and necessary.
31
41
 
32
42
  ## Agent roles (authority boundaries)
33
43
 
34
- - **ORCHESTRATOR**: the only role allowed to initiate a run; owns plan + approval gates; may create exactly one top-level tracking task after plan approval.
44
+ - **ORCHESTRATOR**: the only role allowed to initiate a run; owns user-facing plan + approval gates; may create exactly one top-level tracking task after the user approves the overall plan.
35
45
  - **PLANNER**: the sole creator of downstream tasks; may reprioritize tasks; may adjust decomposition (within approved scope).
36
46
  - **CREATOR**: creates a new specialized agent definition only when required by the approved plan.
37
47
  - **INTEGRATOR**: the only role allowed to integrate/merge into base branch (for `branch_pr`), finish tasks on base, and run exports.
38
48
 
39
49
  No other role may assume another role’s authority.
40
50
 
41
- ## Truthfulness & safety
51
+ ## Definitions (remove ambiguity)
52
+
53
+ - **Read-only inspection**: commands that may read repo state but must not change tracked files or commit history.
54
+ Examples: `agentplane config show`, `agentplane task list`, `agentplane task show`, `git status`, `git diff`, `cat`, `grep`.
55
+ - **Mutating action**: anything that can change tracked files, task state, commits, branches, or outside-repo state.
56
+ Examples: `agentplane task new/update/doc set/plan set/start/finish/verify`, `git commit`, `git checkout`, `bun install`.
42
57
 
43
- - Never invent facts about repo state. Prefer inspection (`agentplane`, `git status`, `git diff`, `ripgrep`) over guessing.
44
- - Never modify `.agentplane/tasks.json` manually. It is an **export-only snapshot** generated via `agentplane task export` and should not be committed unless explicitly required.
45
- - Task status transitions, task docs, and commits must follow **agentplane** flows where available.
58
+ If unsure whether an action mutates state, treat it as mutating.
59
+
60
+ ## Truthfulness & safety (hard invariants)
61
+
62
+ - Never invent facts about repo state. Prefer inspection over guessing.
63
+ - Never modify `.agentplane/tasks.json` manually. It is an **export-only snapshot** generated via `agentplane task export`.
64
+ - Never expose raw internal chain-of-thought. Use structured artifacts instead (see OUTPUT CONTRACTS).
46
65
 
47
66
  ## Cleanliness & untracked files
48
67
 
@@ -51,63 +70,102 @@ No other role may assume another role’s authority.
51
70
  - “Clean” means: **no tracked changes** (`git status --short --untracked-files=no` is empty).
52
71
  - If untracked files interfere with verify/guardrails or fall inside the task scope paths, surface them as a risk and request approval before acting.
53
72
 
54
- ## Network & outside-repo approvals
73
+ ## Approval gates (network vs outside-repo)
74
+
75
+ ### Network
55
76
 
56
- When `.agentplane/config.json` sets `agents.approvals.require_network=true`:
77
+ If `.agentplane/config.json` sets `agents.approvals.require_network=true`:
57
78
 
58
- ### Network use (requires approval)
79
+ - Network use is prohibited until the user explicitly approves it (per run or per command batch).
59
80
 
60
- Includes (non-exhaustive):
81
+ Network use includes (non-exhaustive):
61
82
 
62
83
  - `pip`, `npm`, `bun install`, downloading binaries/models
63
84
  - `curl`, `wget`
64
85
  - `git fetch`, `git pull`
65
86
  - calling external HTTP APIs or remote services
66
87
 
67
- ### Outside-repo touching (requires approval)
88
+ ### Outside-repo
68
89
 
69
- Includes (non-exhaustive):
90
+ Outside-repo reading/writing is **always prohibited** unless the user explicitly approves it (regardless of `require_network`).
91
+
92
+ Outside-repo includes (non-exhaustive):
70
93
 
71
94
  - reading/writing outside the repo (`~`, `/etc`, global configs)
72
- - modifying keychains, ssh keys, credentials stores
95
+ - modifying keychains, ssh keys, credential stores
73
96
  - any tool that mutates outside-repo state
74
97
 
75
- If approval is required, pause and ask before proceeding.
76
-
77
98
  ---
78
99
 
79
100
  # NON-NEGOTIABLE PIPELINE
80
101
 
81
- 1. **Preflight** (ORCHESTRATOR, mandatory)
82
- 2. **Plan + decomposition**
83
- 3. **Explicit user approval**
84
- 4. **Create tracking task**
85
- 5. **Execute tasks under mode-specific workflow**
86
- 6. **Verify**
87
- 7. **Finish**
88
- 8. **Export (if enabled / required)**
102
+ 1. **Preflight** (ORCHESTRATOR, mandatory; read-only)
103
+ 2. **Plan + decomposition** (no execution; read-only)
104
+ 3. **Explicit user approval** (overall plan + any requested overrides)
105
+ 4. **Create tracking task** (one top-level task)
106
+ 5. **Create and plan downstream tasks** (PLANNER)
107
+ 6. **Execute tasks under mode-specific workflow**
108
+ 7. **Verify**
109
+ 8. **Finish**
110
+ 9. **Export** (if enabled / required)
111
+
112
+ No step may be skipped unless the user explicitly authorizes skipping it via the Override Protocol.
113
+
114
+ ---
115
+
116
+ # OUTPUT CONTRACTS (REASONING & EXPLAINABILITY)
117
+
118
+ ## Do not expose raw internal chain-of-thought
119
+
120
+ Agents MUST NOT output raw internal chain-of-thought (token-level reasoning, scratchwork, discarded branches).
121
+
122
+ ## Use structured, inspectable reasoning artifacts
123
+
124
+ Agents MUST express reasoning through explicit artifacts, as applicable:
125
+
126
+ - **Preflight Summary**
127
+ - **Plan**
128
+ - **Assumptions**
129
+ - **Decisions**
130
+ - **Trade-offs**
131
+ - **Verification criteria**
132
+ - **Inference trace** (brief, task-relevant links between inputs -> decisions -> outputs)
89
133
 
90
- No step may be skipped unless the user explicitly authorizes skipping it.
134
+ This is the required substitute for raw chain-of-thought.
91
135
 
92
136
  ---
93
137
 
94
138
  # MANDATORY PREFLIGHT (ORCHESTRATOR)
95
139
 
140
+ Preflight is **read-only inspection**. It is allowed before user approval.
141
+
96
142
  Before any planning or execution, ORCHESTRATOR must run:
97
143
 
98
144
  1. `agentplane config show`
99
145
  2. `agentplane quickstart` (CLI instructions)
100
146
  3. `agentplane task list`
101
147
  4. `git status --short --untracked-files=no`
148
+ 5. `git rev-parse --abbrev-ref HEAD`
149
+
150
+ Then report a **Preflight Summary** (do not dump full config or quickstart text).
151
+
152
+ ## Preflight Summary (required)
102
153
 
103
- Then report (in the response) only that the data was loaded:
154
+ You MUST explicitly state:
104
155
 
105
- - Config loaded
106
- - CLI instructions loaded
107
- - Task list loaded
108
- - Git status checked
156
+ - Config loaded: yes/no
157
+ - CLI instructions loaded: yes/no
158
+ - Task list loaded: yes/no
159
+ - Working tree clean (tracked-only): yes/no
160
+ - Current git branch: `<name>`
161
+ - `workflow_mode`: `direct` / `branch_pr` / unknown
162
+ - Approval gates (from config):
163
+ - `require_plan`: true/false/unknown
164
+ - `require_verify`: true/false/unknown
165
+ - `require_network`: true/false/unknown
166
+ - Outside-repo: not needed / needed (if needed, requires explicit user approval)
109
167
 
110
- Do not output the contents of the config or CLI instructions unless the user explicitly asks for them.
168
+ Do not output the full contents of config or quickstart unless the user explicitly asks.
111
169
 
112
170
  ---
113
171
 
@@ -115,7 +173,9 @@ Do not output the contents of the config or CLI instructions unless the user exp
115
173
 
116
174
  - Always begin work by engaging ORCHESTRATOR.
117
175
  - ORCHESTRATOR starts by producing a top-level plan + task decomposition.
118
- - **Do not execute or modify files before explicit user approval.**
176
+ - **Before explicit user approval, do not perform mutating actions.**
177
+ - Allowed: read-only inspection (including preflight).
178
+ - Prohibited: creating/updating tasks, editing files, starting/finishing tasks, commits, branching, verify runs that mutate task state, network use, outside-repo access.
119
179
 
120
180
  ---
121
181
 
@@ -123,55 +183,196 @@ Do not output the contents of the config or CLI instructions unless the user exp
123
183
 
124
184
  ## 1) Plan & decomposition (no execution)
125
185
 
126
- ORCHESTRATOR:
127
-
128
- - Produces an explicit plan (steps, risks, verify/rollback).
129
- - Decomposes into atomic tasks assignable to existing agents.
130
- - Flags whether network/outside-repo actions will be needed.
131
- - Requests explicit approval.
132
-
133
- ## 2) After approval (tracking task is mandatory)
186
+ ORCHESTRATOR MUST produce:
187
+
188
+ - **Scope**
189
+ - In-scope paths and artifacts
190
+ - Out-of-scope boundaries
191
+ - **Assumptions**
192
+ - Only if required; each assumption must be testable/confirmable
193
+ - **Steps**
194
+ - Ordered, executable steps
195
+ - **Decomposition**
196
+ - Atomic tasks assignable to existing agents
197
+ - **Approvals**
198
+ - Whether network and/or outside-repo actions will be needed
199
+ - Any requested overrides (see Override Protocol)
200
+ - **Verification criteria**
201
+ - What will be considered "done" + checks to run
202
+ - **Rollback plan**
203
+ - How to revert safely if verification fails
204
+ - **Drift triggers**
205
+ - Conditions that require re-approval (see DRIFT POLICY)
206
+
207
+ ## 2) After user approval (tracking task is mandatory)
134
208
 
135
209
  - ORCHESTRATOR creates exactly **one** top-level tracking task via agentplane.
136
210
  - PLANNER creates any additional tasks from the approved decomposition.
137
211
  - Task IDs are referenced in comments/notes for traceability.
138
212
 
139
- **No opt-out:** task tracking is mandatory for reproducibility and minimizing errors.
213
+ **Task tracking is mandatory** for any work that changes repo state. Exceptions require explicit user approval (Override Protocol).
140
214
 
141
215
  ---
142
216
 
143
- # RESPONSE & WRITING STYLE
217
+ # OVERRIDE PROTOCOL (USER-APPROVED EXCEPTIONS)
218
+
219
+ Overrides exist to let the user intentionally relax guardrails **in a controlled, logged way**.
220
+
221
+ ## Hard invariants (cannot be overridden)
222
+
223
+ - No fabricated repo facts.
224
+ - No raw chain-of-thought.
225
+ - No manual editing of `.agentplane/tasks.json` (exports are generated, not edited).
226
+
227
+ ## What can be overridden (with explicit user approval)
228
+
229
+ Common overridable guardrails:
144
230
 
145
- - Clarity beats pleasantries.
146
- - Keep plans short, structured, and executable.
147
- - Do not reveal internal chain-of-thought; provide concise rationale only.
148
- - Code/comments/commit messages/PR artifacts should be in English.
231
+ - **Network**: allow network access even when `require_network=true`.
232
+ - **Outside-repo**: allow reading/writing outside the repo (scoped).
233
+ - **Pipeline**: skip/relax steps (e.g., skip task tracking for analysis-only; skip exports).
234
+ - **Tooling**: allow direct `git` operations when no agentplane command exists (commit/push).
235
+ - **Force flags**: allow `--force` status transitions / dependency bypass.
236
+
237
+ ## Required format (to remove ambiguity)
238
+
239
+ When requesting an override, the agent MUST:
240
+
241
+ 1. State the exact override(s) requested (one line per override).
242
+ 2. State why it is necessary.
243
+ 3. State the exact commands/actions it enables.
244
+ 4. State the scope and expiration (this task only / this run only).
245
+
246
+ The user must respond explicitly approving (or rejecting) the override(s).
247
+
248
+ ## Logging (traceability requirement)
249
+
250
+ Any approved override MUST be recorded:
251
+
252
+ - In the top-level tracking task under `## Notes` → `### Approvals / Overrides`.
253
+ - And in the relevant task’s `## Notes` if the override affects execution of that task.
149
254
 
150
255
  ---
151
256
 
152
- # TASKS & DOCUMENTATION
257
+ # TASKS & DOCUMENTATION (TRACEABILITY)
258
+
259
+ ## Golden rule
260
+
261
+ If an agent changes repo state, that work must be traceable to a task ID and a filled task README.
153
262
 
154
- ## Required task doc sections (before finish)
263
+ ## Scaffold is mandatory
155
264
 
156
- Every task must have these sections in its README or task doc:
265
+ Immediately after creating a task, run:
266
+
267
+ - `agentplane task scaffold <task-id>`
268
+
269
+ This ensures all standard sections exist and are normalized.
270
+
271
+ ## Who fills the README
272
+
273
+ - ORCHESTRATOR/PLANNER may create tasks with a minimal description.
274
+ - The **agent that will execute the task** is responsible for filling the task README sections
275
+ (Plan + Verify Steps + Risks + Rollback + Notes) before starting work.
276
+
277
+ ## Required sections (before finish)
278
+
279
+ Required sections are config-driven (`.agentplane/config.json` → `tasks.doc.required_sections`).
280
+ At minimum, every task MUST have non-empty content for:
157
281
 
158
282
  - Summary
159
283
  - Scope
284
+ - Plan
160
285
  - Risks
161
- - Verify Steps
286
+ - Verification
162
287
  - Rollback Plan
163
288
 
289
+ **Policy addition for maximum traceability:**
290
+
291
+ - `Context` and `Notes` MUST be filled for all non-trivial tasks (anything beyond a typo/doc tweak).
292
+ - `Verify Steps` MUST be filled for tasks that require verify (default tags: `code`, `backend`, `frontend`) and for `spike`.
293
+
294
+ ## Section content contract (practical)
295
+
296
+ Use `agentplane task doc set` / `agentplane task plan set` (no manual README edits).
297
+
298
+ ### Summary
299
+
300
+ - What is being changed (one paragraph).
301
+ - What success looks like.
302
+
303
+ ### Context
304
+
305
+ - Why the change is needed.
306
+ - Constraints, assumptions, related tasks/PRs/issues.
307
+
308
+ ### Scope
309
+
310
+ - In-scope paths/files/components.
311
+ - Explicit out-of-scope items.
312
+
313
+ ### Plan
314
+
315
+ - Ordered steps with implementation checkpoints.
316
+ - Any migration steps and rollback checkpoints.
317
+
318
+ ### Risks
319
+
320
+ - Key risks + mitigations.
321
+ - Any potential breaking changes.
322
+
323
+ ### Verify Steps
324
+
325
+ - Explicit commands and expected outcomes (pass criteria).
326
+ - Prefer reproducible checks (`bun run test`, `bun run typecheck`, `bun run lint`, `agentplane verify <task-id>`, etc.).
327
+ - If verification is manual, state the manual checklist and acceptance criteria.
328
+
329
+ ### Rollback Plan
330
+
331
+ - How to revert safely (commands or steps).
332
+
333
+ ### Notes (use structured subheadings)
334
+
335
+ Use `## Notes` to log:
336
+
337
+ - `### Approvals / Overrides` (if any)
338
+ - `### Decisions` (trade-offs, why X not Y)
339
+ - `### Implementation Notes` (what changed, file list, key diffs)
340
+ - `### Evidence / Links` (commit hashes, PR links, logs if needed)
341
+
342
+ ## Plan approval per task (when required)
343
+
344
+ If config sets `agents.approvals.require_plan=true`:
345
+
346
+ - The implementer fills `## Plan` (use `agentplane task plan set <task-id> ...`) and `## Verify Steps`.
347
+ - ORCHESTRATOR approves with `agentplane task plan approve <task-id> --by ORCHESTRATOR [--note "..."]`.
348
+ - No one may `agentplane start <task-id>` until the plan is approved (unless explicitly overridden by user).
349
+
350
+ ## Two-stage verification (Verify Steps -> Verification)
351
+
352
+ - `## Verify Steps` is the **ex-ante verification contract**: instructions and pass criteria addressed to the verifier.
353
+ - `## Verification` is the **ex-post verification log**: append-only entries written by `agentplane verify ...`.
354
+ - Do not hand-edit `## Verification` entries. Treat them as audit records.
355
+ - For tasks with verify-required tags (default: `code`, `backend`, `frontend`) and for `spike`, `agentplane task plan approve`
356
+ will block until `## Verify Steps` is filled (the placeholder `<!-- TODO: FILL VERIFY STEPS -->` is treated as empty).
357
+ - Use `agentplane task verify-show <task-id>` to print the current `## Verify Steps` to stdout.
358
+
359
+ ## Spike -> implementation convention
360
+
361
+ - A spike task is identified by tag `spike` (schema-free).
362
+ - A spike must define clear exit criteria in `## Verify Steps` and must capture outcomes in `## Notes` (Findings/Decision/Next Steps).
363
+ - `agentplane task derive <spike-id> ...` creates an implementation task that depends on the spike via `depends_on: [<spike-id>]`.
364
+
164
365
  ## Updating task docs
165
366
 
166
367
  - Workflow/task artifacts (task READMEs, PR artifacts, task exports) must be updated via `agentplane` commands, not manual edits.
167
- - Task README updates must be done via `agentplane task doc set ...`
168
- - Manual edits to `.agentplane/tasks/<task-id>/README.md` are prohibited.
368
+ - Task README updates must be done via `agentplane task doc set ...` / `agentplane task plan set ...`.
369
+ - Manual edits to `.agentplane/tasks/<task-id>/README.md` are prohibited (unless the user explicitly overrides this, and you still re-normalize via `task doc set`).
169
370
 
170
371
  ---
171
372
 
172
373
  # COMMIT WORKFLOW
173
374
 
174
- - Commits and pushes must go through `agentplane` commands (no direct `git commit`/`git push`). If a push is needed but no `agentplane` command exists, ask for guidance.
375
+ - Commits and pushes must go through `agentplane` commands (no direct `git commit`/`git push`) unless explicitly overridden.
175
376
 
176
377
  ## Commit message semantics (canonical)
177
378
 
@@ -210,7 +411,7 @@ Recommended action/status emojis:
210
411
  - `⛔` blocked / BLOCKED
211
412
  - `✅` finish / DONE
212
413
 
213
- Agents must not reinterpret `-m` as body-only or comment-only”. `-m` is a commit message.
414
+ Agents must not reinterpret `-m` as "body-only" or "comment-only". `-m` is a commit message.
214
415
 
215
416
  ## Allowlist staging (guardrails)
216
417
 
@@ -228,16 +429,19 @@ Always follow `workflow_mode` from `.agentplane/config.json`.
228
429
  Rules:
229
430
 
230
431
  - Do all work in the current checkout.
231
- - Do not create task branches/worktrees (agentplane should reject them).
432
+ - Task branches are allowed in `direct` (single working directory). Note: `agentplane work start <task-id> --agent <ROLE> --slug <slug>` will create/checkout `task/<task-id>/<slug>` in-place.
433
+ - Do not use worktrees in `direct`. `agentplane work start ... --worktree` is `branch_pr`-only.
434
+ - If you only need artifacts/docs without switching branches, prefer `agentplane task scaffold <task-id>`.
232
435
 
233
436
  Recommended cadence:
234
437
 
235
- 1. `start` task (status comment; no commit by default)
236
- 2. Implement changes
237
- 3. Run verify commands / `agentplane verify`
238
- 4. Commit via agentplane with tight allowlist
239
- 5. `finish` with `--commit <git-rev>` and a Verified body
240
- 6. `task export` (if required)
438
+ 1. Ensure task plan is approved (if required)
439
+ 2. `start` task (status comment; no commit by default)
440
+ 3. Implement changes
441
+ 4. Run verify commands / `agentplane verify`
442
+ 5. Commit via agentplane with tight allowlist
443
+ 6. `finish` with `--commit <git-rev>` and a Verified body
444
+ 7. `task export` (if required)
241
445
 
242
446
  ## B) branch_pr mode (parallel work)
243
447
 
@@ -273,16 +477,23 @@ Exports:
273
477
 
274
478
  ---
275
479
 
276
- # RECOMMENDED CONFIG PATCH (optional but strongly advised)
480
+ # DRIFT POLICY (WHEN TO RE-APPROVE)
481
+
482
+ Re-approval is required if any of the following becomes true:
277
483
 
278
- To minimize accidental status-commits and keep commits intentional, apply this JSON Merge Patch to `.agentplane/config.json`:
484
+ - Scope expands beyond the approved in-scope paths/artifacts.
485
+ - New tasks are needed that were not in the approved decomposition.
486
+ - Any network or outside-repo access becomes necessary (and was not approved).
487
+ - Verification criteria change materially.
488
+ - Plan changes materially for an in-flight task (update plan -> plan approval returns to pending).
489
+ - Guardrails require `--force` to proceed.
490
+ - Verification fails and remediation would change scope or risk profile.
279
491
 
280
- {
281
- "status_commit_policy": "confirm",
282
- "finish_auto_status_commit": false
283
- }
492
+ When drift is detected: stop, summarize the drift, propose an updated plan, and ask for explicit approval.
493
+
494
+ ---
284
495
 
285
- Notes:
496
+ # CONFIG CHANGES
286
497
 
287
- - `status_commit_policy="confirm"` ensures comment-driven/status commits require explicit confirmation.
288
- - `finish_auto_status_commit=false` prevents `finish` from creating implicit commits when you only want to record status.
498
+ - Do not modify `.agentplane/config.json` unless the user explicitly requests it or the approved plan includes it.
499
+ - Any config changes must be captured in task docs (`## Notes` `### Decisions` / `### Risks`) and verified.
@@ -21,6 +21,7 @@
21
21
  "Confirm task context and readiness before editing; keep diffs minimal and task-scoped.",
22
22
  "Document edits with before/after snippets and cite the exact files touched.",
23
23
  "Run necessary commands (tests/linters/formatters) and summarize key output lines only.",
24
+ "When writing verification notes (and any other approval/verification notes that include timestamps), use an ISO 8601 UTC timestamp with time, e.g. 2026-02-07T16:20:02.717Z; avoid date-only values like 2026-02-07.",
24
25
  "Prefer declared verify commands; record ad-hoc results via PR notes or request PLANNER to update verify lists.",
25
26
  "Coordinate handoffs to TESTER/REVIEWER/DOCS with task ID, changed files, and expected behavior.",
26
27
  "Avoid task closure in branch_pr; keep commits task-scoped and update status via agentplane."
@@ -21,6 +21,7 @@
21
21
  "Operate from the repo root on the pinned base branch; run pr check -> integrate -> finish via agentplane.",
22
22
  "Use configured base branch and task branch prefix when referencing branches; check config if uncertain.",
23
23
  "Ensure verify commands are run/recorded; update PR artifacts and task README as needed.",
24
+ "When writing verification notes (and any other approval/verification notes that include timestamps), use an ISO 8601 UTC timestamp with time, e.g. 2026-02-07T16:20:02.717Z; avoid date-only values like 2026-02-07.",
24
25
  "When closing multiple tasks, use batch finish so the same commit metadata and verification note apply.",
25
26
  "Check `closure_commit_requires_approval` in .agentplane/config.json; ask for user approval before the final closure commit when true, otherwise proceed without confirmation. Optionally clean task branches/worktrees after closure."
26
27
  ]
@@ -15,6 +15,7 @@
15
15
  "workflow": [
16
16
  "Follow shared workflow rules in AGENTS.md and `agentplane quickstart` / `agentplane role <ROLE>` output.",
17
17
  "Before planning or execution, load .agentplane/config.json and `agentplane quickstart` / `agentplane role <ROLE>` output; do not output their contents, only report that they were loaded.",
18
+ "When writing plan approval notes (and any other approval/verification notes), use an ISO 8601 UTC timestamp with time, e.g. 2026-02-07T16:20:02.717Z; avoid date-only values like 2026-02-07.",
18
19
  "Use `agentplane config show|set` for config changes (workflow_mode, branch/task settings); avoid manual edits.",
19
20
  "Convert the first user message into a top-level plan; do not create tasks until the user approves it.",
20
21
  "Restate the user goal and constraints, then draft a numbered top-level plan with agent assignments and expected outcomes.",
@@ -18,6 +18,7 @@
18
18
  "workflow": [
19
19
  "Follow shared workflow rules in AGENTS.md and `agentplane quickstart` / `agentplane role <ROLE>` output.",
20
20
  "Review the backlog before changes to avoid duplicates or conflicts.",
21
+ "When writing plan approval notes, use an ISO 8601 UTC timestamp with time, e.g. 2026-02-07T16:20:02.717Z; avoid date-only values like 2026-02-07.",
21
22
  "For each top-level user request, after the user approves task creation, create exactly one top-level task via agentplane unless the user explicitly opts out; reference plan items or downstream task IDs in its description or comments.",
22
23
  "Decompose goals into atomic tasks with a single owner; set depends_on explicitly (use [] for none).",
23
24
  "Assign each task to an existing agent ID or schedule CREATOR if no suitable agent exists.",
@@ -22,6 +22,7 @@
22
22
  "Add the smallest set of high-value tests (happy path + edge/regression).",
23
23
  "Keep tests deterministic and fast; avoid network calls and time-based flakiness.",
24
24
  "Run targeted tests first and summarize only the key output lines.",
25
+ "When writing verification notes (and any other approval/verification notes that include timestamps), use an ISO 8601 UTC timestamp with time, e.g. 2026-02-07T16:20:02.717Z; avoid date-only values like 2026-02-07.",
25
26
  "If test infrastructure is missing, document the blocker and request a PLANNER task."
26
27
  ]
27
28
  }
@@ -0,0 +1,13 @@
1
+ import { type AgentplaneConfig, type ResolvedProject } from "@agentplaneorg/core";
2
+ import { type TaskBackend } from "./shared.js";
3
+ export declare function loadTaskBackend(opts: {
4
+ cwd: string;
5
+ rootOverride?: string | null;
6
+ }): Promise<{
7
+ backend: TaskBackend;
8
+ backendId: string;
9
+ resolved: ResolvedProject;
10
+ config: AgentplaneConfig;
11
+ backendConfigPath: string;
12
+ }>;
13
+ //# sourceMappingURL=load.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/load.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AA0C7D,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAuBD"}
@@ -0,0 +1,58 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { loadConfig, resolveProject, } from "@agentplaneorg/core";
4
+ import { loadDotEnv } from "../../shared/env.js";
5
+ import { isRecord } from "../../shared/guards.js";
6
+ import { LocalBackend } from "./local-backend.js";
7
+ import { RedmineBackend } from "./redmine-backend.js";
8
+ import { toStringSafe } from "./shared.js";
9
+ async function loadBackendConfig(configPath) {
10
+ try {
11
+ const raw = JSON.parse(await readFile(configPath, "utf8"));
12
+ return isRecord(raw) ? raw : null;
13
+ }
14
+ catch (err) {
15
+ const code = err?.code;
16
+ if (code === "ENOENT")
17
+ return null;
18
+ throw err;
19
+ }
20
+ }
21
+ function resolveMaybeRelative(root, input) {
22
+ if (!input)
23
+ return null;
24
+ const raw = toStringSafe(input).trim();
25
+ if (!raw)
26
+ return null;
27
+ return path.isAbsolute(raw) ? raw : path.join(root, raw);
28
+ }
29
+ function normalizeBackendConfig(raw) {
30
+ if (!isRecord(raw)) {
31
+ return { id: "local", version: 1, settings: {} };
32
+ }
33
+ const id = toStringSafe(raw.id).trim() || "local";
34
+ const version = typeof raw.version === "number" ? raw.version : 1;
35
+ const settings = isRecord(raw.settings) ? raw.settings : {};
36
+ return { id, version, settings };
37
+ }
38
+ export async function loadTaskBackend(opts) {
39
+ const resolved = await resolveProject({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null });
40
+ const loaded = await loadConfig(resolved.agentplaneDir);
41
+ const backendConfigPath = path.join(resolved.gitRoot, loaded.config.tasks_backend.config_path);
42
+ const backendConfig = await loadBackendConfig(backendConfigPath);
43
+ const normalized = normalizeBackendConfig(backendConfig);
44
+ const backendId = normalized.id;
45
+ const settings = normalized.settings;
46
+ if (backendId === "redmine") {
47
+ await loadDotEnv(resolved.gitRoot);
48
+ const cacheDirRaw = resolveMaybeRelative(resolved.gitRoot, settings.cache_dir);
49
+ const cacheDir = cacheDirRaw ?? path.join(resolved.gitRoot, loaded.config.paths.workflow_dir);
50
+ const cache = cacheDir ? new LocalBackend({ dir: cacheDir }) : null;
51
+ const redmine = new RedmineBackend(settings, { cache });
52
+ return { backend: redmine, backendId, resolved, config: loaded.config, backendConfigPath };
53
+ }
54
+ const localDir = resolveMaybeRelative(resolved.gitRoot, settings.dir) ??
55
+ path.join(resolved.gitRoot, loaded.config.paths.workflow_dir);
56
+ const local = new LocalBackend({ dir: localDir });
57
+ return { backend: local, backendId: "local", resolved, config: loaded.config, backendConfigPath };
58
+ }
@@ -0,0 +1,28 @@
1
+ import { type TaskBackend, type TaskData } from "./shared.js";
2
+ export declare class LocalBackend implements TaskBackend {
3
+ id: string;
4
+ root: string;
5
+ updatedBy: string;
6
+ constructor(settings?: {
7
+ dir?: string;
8
+ updatedBy?: string;
9
+ });
10
+ generateTaskId(opts: {
11
+ length: number;
12
+ attempts: number;
13
+ }): Promise<string>;
14
+ listTasks(): Promise<TaskData[]>;
15
+ getTask(taskId: string): Promise<TaskData | null>;
16
+ getTasks(taskIds: string[]): Promise<(TaskData | null)[]>;
17
+ getTaskDoc(taskId: string): Promise<string>;
18
+ writeTask(task: TaskData): Promise<void>;
19
+ setTaskDoc(taskId: string, doc: string, updatedBy?: string): Promise<void>;
20
+ touchTaskDocMetadata(taskId: string, updatedBy?: string): Promise<void>;
21
+ writeTasks(tasks: TaskData[]): Promise<void>;
22
+ normalizeTasks(): Promise<{
23
+ scanned: number;
24
+ changed: number;
25
+ }>;
26
+ exportTasksJson(outputPath: string): Promise<void>;
27
+ }
28
+ //# sourceMappingURL=local-backend.d.ts.map