agentplane 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (663) hide show
  1. package/assets/AGENTS.md +11 -1
  2. package/assets/RUNNER.md +17 -0
  3. package/bin/agentplane.js +16 -7
  4. package/bin/framework-dev-contract.d.ts +6 -0
  5. package/bin/framework-dev-contract.js +13 -0
  6. package/bin/stale-dist-policy.js +6 -1
  7. package/dist/.build-manifest.json +724 -359
  8. package/dist/adapters/task-backend/task-backend-adapter.d.ts +4 -2
  9. package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
  10. package/dist/adapters/task-backend/task-backend-adapter.js +15 -2
  11. package/dist/backends/task-backend/local-backend-doc.d.ts +5 -0
  12. package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -0
  13. package/dist/backends/task-backend/local-backend-doc.js +98 -0
  14. package/dist/backends/task-backend/local-backend-read.d.ts +7 -0
  15. package/dist/backends/task-backend/local-backend-read.d.ts.map +1 -0
  16. package/dist/backends/task-backend/local-backend-read.js +186 -0
  17. package/dist/backends/task-backend/local-backend-state.d.ts +17 -0
  18. package/dist/backends/task-backend/local-backend-state.d.ts.map +1 -0
  19. package/dist/backends/task-backend/local-backend-state.js +50 -0
  20. package/dist/backends/task-backend/local-backend-write.d.ts +15 -0
  21. package/dist/backends/task-backend/local-backend-write.d.ts.map +1 -0
  22. package/dist/backends/task-backend/local-backend-write.js +254 -0
  23. package/dist/backends/task-backend/local-backend.d.ts +10 -6
  24. package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
  25. package/dist/backends/task-backend/local-backend.js +32 -337
  26. package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts +40 -0
  27. package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts.map +1 -0
  28. package/dist/backends/task-backend/redmine/backend-cache-doc.js +178 -0
  29. package/dist/backends/task-backend/redmine/backend-report.d.ts +10 -0
  30. package/dist/backends/task-backend/redmine/backend-report.d.ts.map +1 -0
  31. package/dist/backends/task-backend/redmine/backend-report.js +43 -0
  32. package/dist/backends/task-backend/redmine/backend-sync.d.ts +67 -0
  33. package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -0
  34. package/dist/backends/task-backend/redmine/backend-sync.js +367 -0
  35. package/dist/backends/task-backend/redmine/env.d.ts +1 -1
  36. package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
  37. package/dist/backends/task-backend/redmine/env.js +3 -0
  38. package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
  39. package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
  40. package/dist/backends/task-backend/redmine/inspect.js +75 -0
  41. package/dist/backends/task-backend/redmine/mapping.d.ts +2 -1
  42. package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
  43. package/dist/backends/task-backend/redmine/mapping.js +32 -3
  44. package/dist/backends/task-backend/redmine/parse.d.ts +2 -1
  45. package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -1
  46. package/dist/backends/task-backend/redmine/parse.js +5 -3
  47. package/dist/backends/task-backend/redmine/state.d.ts +19 -0
  48. package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
  49. package/dist/backends/task-backend/redmine/state.js +109 -0
  50. package/dist/backends/task-backend/redmine-backend.d.ts +14 -17
  51. package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
  52. package/dist/backends/task-backend/redmine-backend.js +121 -379
  53. package/dist/backends/task-backend/shared/constants.d.ts +2 -1
  54. package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
  55. package/dist/backends/task-backend/shared/constants.js +1 -1
  56. package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
  57. package/dist/backends/task-backend/shared/doc.js +25 -39
  58. package/dist/backends/task-backend/shared/export.d.ts +2 -9
  59. package/dist/backends/task-backend/shared/export.d.ts.map +1 -1
  60. package/dist/backends/task-backend/shared/export.js +73 -8
  61. package/dist/backends/task-backend/shared/normalize.d.ts +5 -1
  62. package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -1
  63. package/dist/backends/task-backend/shared/normalize.js +166 -0
  64. package/dist/backends/task-backend/shared/record.d.ts +1 -1
  65. package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
  66. package/dist/backends/task-backend/shared/record.js +27 -3
  67. package/dist/backends/task-backend/shared/types.d.ts +76 -36
  68. package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
  69. package/dist/backends/task-backend/shared.d.ts +2 -2
  70. package/dist/backends/task-backend/shared.d.ts.map +1 -1
  71. package/dist/backends/task-backend/shared.js +1 -1
  72. package/dist/backends/task-backend.d.ts +1 -1
  73. package/dist/backends/task-backend.d.ts.map +1 -1
  74. package/dist/backends/task-backend.js +1 -1
  75. package/dist/backends/task-index.d.ts +2 -2
  76. package/dist/backends/task-index.d.ts.map +1 -1
  77. package/dist/backends/task-index.js +9 -5
  78. package/dist/cli/bootstrap-guide.d.ts +2 -2
  79. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  80. package/dist/cli/bootstrap-guide.js +10 -10
  81. package/dist/cli/command-guide.d.ts.map +1 -1
  82. package/dist/cli/command-guide.js +11 -9
  83. package/dist/cli/command-invocations.d.ts +4 -0
  84. package/dist/cli/command-invocations.d.ts.map +1 -0
  85. package/dist/cli/command-invocations.js +35 -0
  86. package/dist/cli/command-snippets.d.ts +12 -8
  87. package/dist/cli/command-snippets.d.ts.map +1 -1
  88. package/dist/cli/command-snippets.js +14 -8
  89. package/dist/cli/exit-codes.d.ts.map +1 -1
  90. package/dist/cli/exit-codes.js +1 -0
  91. package/dist/cli/group-command.d.ts +18 -0
  92. package/dist/cli/group-command.d.ts.map +1 -0
  93. package/dist/cli/group-command.js +45 -0
  94. package/dist/cli/output.d.ts +29 -0
  95. package/dist/cli/output.d.ts.map +1 -1
  96. package/dist/cli/output.js +76 -0
  97. package/dist/cli/prompts.d.ts.map +1 -1
  98. package/dist/cli/prompts.js +5 -1
  99. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  100. package/dist/cli/run-cli/command-catalog/core.js +38 -29
  101. package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
  102. package/dist/cli/run-cli/command-catalog/lifecycle.js +9 -6
  103. package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
  104. package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
  105. package/dist/cli/run-cli/command-catalog/project.js +11 -7
  106. package/dist/cli/run-cli/command-catalog/shared.d.ts +12 -3
  107. package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
  108. package/dist/cli/run-cli/command-catalog/shared.js +6 -3
  109. package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
  110. package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
  111. package/dist/cli/run-cli/command-catalog/task.js +46 -11
  112. package/dist/cli/run-cli/command-catalog.d.ts +11 -1
  113. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  114. package/dist/cli/run-cli/command-catalog.js +29 -0
  115. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  116. package/dist/cli/run-cli/commands/config.js +52 -6
  117. package/dist/cli/run-cli/commands/core/agent-profiles.d.ts +34 -0
  118. package/dist/cli/run-cli/commands/core/agent-profiles.d.ts.map +1 -0
  119. package/dist/cli/run-cli/commands/core/agent-profiles.js +97 -0
  120. package/dist/cli/run-cli/commands/core/agents.d.ts +7 -0
  121. package/dist/cli/run-cli/commands/core/agents.d.ts.map +1 -0
  122. package/dist/cli/run-cli/commands/core/agents.js +97 -0
  123. package/dist/cli/run-cli/commands/core/preflight.d.ts +10 -0
  124. package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -0
  125. package/dist/cli/run-cli/commands/core/preflight.js +286 -0
  126. package/dist/cli/run-cli/commands/core/quickstart.d.ts +8 -0
  127. package/dist/cli/run-cli/commands/core/quickstart.d.ts.map +1 -0
  128. package/dist/cli/run-cli/commands/core/quickstart.js +43 -0
  129. package/dist/cli/run-cli/commands/core/role.d.ts +9 -0
  130. package/dist/cli/run-cli/commands/core/role.d.ts.map +1 -0
  131. package/dist/cli/run-cli/commands/core/role.js +128 -0
  132. package/dist/cli/run-cli/commands/core.d.ts +4 -24
  133. package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
  134. package/dist/cli/run-cli/commands/core.js +4 -630
  135. package/dist/cli/run-cli/commands/init/write-env.d.ts.map +1 -1
  136. package/dist/cli/run-cli/commands/init/write-env.js +12 -0
  137. package/dist/cli/run-cli/error-guidance.js +10 -0
  138. package/dist/cli/run-cli/globals.d.ts +5 -2
  139. package/dist/cli/run-cli/globals.d.ts.map +1 -1
  140. package/dist/cli/run-cli/globals.js +82 -86
  141. package/dist/cli/run-cli.d.ts.map +1 -1
  142. package/dist/cli/run-cli.js +137 -100
  143. package/dist/cli/run-cli.test-helpers.d.ts +21 -0
  144. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  145. package/dist/cli/run-cli.test-helpers.js +90 -4
  146. package/dist/cli/spec/help.d.ts +10 -2
  147. package/dist/cli/spec/help.d.ts.map +1 -1
  148. package/dist/cli/spec/help.js +7 -5
  149. package/dist/cli/spec/registry.d.ts +27 -1
  150. package/dist/cli/spec/registry.d.ts.map +1 -1
  151. package/dist/cli/spec/registry.js +98 -25
  152. package/dist/commands/backend/sync.command.d.ts +8 -6
  153. package/dist/commands/backend/sync.command.d.ts.map +1 -1
  154. package/dist/commands/backend/sync.command.js +75 -14
  155. package/dist/commands/backend.d.ts +22 -0
  156. package/dist/commands/backend.d.ts.map +1 -1
  157. package/dist/commands/backend.js +111 -1
  158. package/dist/commands/branch/base.command.d.ts +2 -3
  159. package/dist/commands/branch/base.command.d.ts.map +1 -1
  160. package/dist/commands/branch/base.command.js +8 -12
  161. package/dist/commands/branch/base.d.ts.map +1 -1
  162. package/dist/commands/branch/base.js +11 -7
  163. package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
  164. package/dist/commands/branch/cleanup-merged.js +9 -8
  165. package/dist/commands/branch/remove.d.ts.map +1 -1
  166. package/dist/commands/branch/remove.js +4 -3
  167. package/dist/commands/branch/status.d.ts.map +1 -1
  168. package/dist/commands/branch/status.js +4 -3
  169. package/dist/commands/branch/work-start.d.ts.map +1 -1
  170. package/dist/commands/branch/work-start.js +48 -5
  171. package/dist/commands/cleanup/merged.command.d.ts +2 -3
  172. package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
  173. package/dist/commands/cleanup/merged.command.js +8 -12
  174. package/dist/commands/commit.spec.d.ts.map +1 -1
  175. package/dist/commands/commit.spec.js +30 -6
  176. package/dist/commands/docs/cli.command.js +2 -2
  177. package/dist/commands/doctor/runtime.js +1 -1
  178. package/dist/commands/doctor/workflow.d.ts.map +1 -1
  179. package/dist/commands/doctor/workflow.js +10 -1
  180. package/dist/commands/doctor/workspace.d.ts +8 -0
  181. package/dist/commands/doctor/workspace.d.ts.map +1 -1
  182. package/dist/commands/doctor/workspace.js +127 -3
  183. package/dist/commands/finish.spec.d.ts.map +1 -1
  184. package/dist/commands/finish.spec.js +7 -0
  185. package/dist/commands/guard/commit.command.d.ts.map +1 -1
  186. package/dist/commands/guard/commit.command.js +30 -6
  187. package/dist/commands/guard/guard.command.d.ts +3 -3
  188. package/dist/commands/guard/guard.command.d.ts.map +1 -1
  189. package/dist/commands/guard/guard.command.js +9 -14
  190. package/dist/commands/guard/impl/allow.d.ts +4 -0
  191. package/dist/commands/guard/impl/allow.d.ts.map +1 -1
  192. package/dist/commands/guard/impl/allow.js +14 -3
  193. package/dist/commands/guard/impl/commands.d.ts +2 -0
  194. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  195. package/dist/commands/guard/impl/commands.js +66 -9
  196. package/dist/commands/guard/impl/policy.d.ts +1 -0
  197. package/dist/commands/guard/impl/policy.d.ts.map +1 -1
  198. package/dist/commands/guard/impl/policy.js +9 -6
  199. package/dist/commands/hooks/hooks.command.d.ts +3 -3
  200. package/dist/commands/hooks/hooks.command.d.ts.map +1 -1
  201. package/dist/commands/hooks/hooks.command.js +9 -11
  202. package/dist/commands/pr/check.d.ts.map +1 -1
  203. package/dist/commands/pr/check.js +90 -18
  204. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
  205. package/dist/commands/pr/integrate/cmd.js +31 -3
  206. package/dist/commands/pr/integrate/internal/cleanup.d.ts +12 -0
  207. package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -0
  208. package/dist/commands/pr/integrate/internal/cleanup.js +46 -0
  209. package/dist/commands/pr/integrate/internal/finalize.d.ts +4 -0
  210. package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
  211. package/dist/commands/pr/integrate/internal/finalize.js +34 -40
  212. package/dist/commands/pr/integrate/internal/merge.d.ts +6 -0
  213. package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
  214. package/dist/commands/pr/integrate/internal/merge.js +92 -0
  215. package/dist/commands/pr/integrate/internal/prepare.d.ts +1 -0
  216. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
  217. package/dist/commands/pr/integrate/internal/prepare.js +1 -0
  218. package/dist/commands/pr/integrate/verify.d.ts.map +1 -1
  219. package/dist/commands/pr/integrate/verify.js +4 -3
  220. package/dist/commands/pr/note.d.ts.map +1 -1
  221. package/dist/commands/pr/note.js +3 -2
  222. package/dist/commands/pr/open.d.ts.map +1 -1
  223. package/dist/commands/pr/open.js +9 -12
  224. package/dist/commands/pr/pr.command.d.ts +3 -4
  225. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  226. package/dist/commands/pr/pr.command.js +6 -11
  227. package/dist/commands/pr/update.d.ts.map +1 -1
  228. package/dist/commands/pr/update.js +5 -10
  229. package/dist/commands/recipes/cache.command.d.ts +3 -4
  230. package/dist/commands/recipes/cache.command.d.ts.map +1 -1
  231. package/dist/commands/recipes/cache.command.js +8 -26
  232. package/dist/commands/recipes/impl/apply.d.ts +1 -1
  233. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  234. package/dist/commands/recipes/impl/apply.js +1 -1
  235. package/dist/commands/recipes/impl/commands/explain.js +1 -1
  236. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  237. package/dist/commands/recipes/impl/commands/install.js +1 -2
  238. package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
  239. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  240. package/dist/commands/recipes/impl/installed-recipes.js +1 -2
  241. package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
  242. package/dist/commands/recipes/impl/manifest.js +0 -10
  243. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +1 -1
  244. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
  245. package/dist/commands/recipes/impl/project-installed-recipes.js +1 -2
  246. package/dist/commands/recipes/impl/resolver.d.ts +1 -1
  247. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
  248. package/dist/commands/recipes/impl/resolver.js +26 -16
  249. package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
  250. package/dist/commands/recipes/impl/scenario.js +80 -0
  251. package/dist/commands/recipes/impl/types.d.ts +27 -13
  252. package/dist/commands/recipes/impl/types.d.ts.map +1 -1
  253. package/dist/commands/recipes/recipes.command.d.ts +3 -4
  254. package/dist/commands/recipes/recipes.command.d.ts.map +1 -1
  255. package/dist/commands/recipes/recipes.command.js +8 -34
  256. package/dist/commands/recipes.d.ts +4 -4
  257. package/dist/commands/recipes.d.ts.map +1 -1
  258. package/dist/commands/recipes.js +3 -3
  259. package/dist/commands/recipes.test-helpers.d.ts +17 -0
  260. package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
  261. package/dist/commands/recipes.test-helpers.js +56 -2
  262. package/dist/commands/release/apply.command.d.ts.map +1 -1
  263. package/dist/commands/release/apply.command.js +77 -56
  264. package/dist/commands/release/plan.command.d.ts.map +1 -1
  265. package/dist/commands/release/plan.command.js +7 -3
  266. package/dist/commands/release/release.command.d.ts +3 -3
  267. package/dist/commands/release/release.command.d.ts.map +1 -1
  268. package/dist/commands/release/release.command.js +9 -11
  269. package/dist/commands/release.test-helpers.d.ts +20 -0
  270. package/dist/commands/release.test-helpers.d.ts.map +1 -0
  271. package/dist/commands/release.test-helpers.js +37 -0
  272. package/dist/commands/runtime.command.d.ts +7 -7
  273. package/dist/commands/runtime.command.d.ts.map +1 -1
  274. package/dist/commands/runtime.command.js +29 -33
  275. package/dist/commands/scenario/execute.command.d.ts +8 -0
  276. package/dist/commands/scenario/execute.command.d.ts.map +1 -0
  277. package/dist/commands/scenario/execute.command.js +117 -0
  278. package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
  279. package/dist/commands/scenario/impl/commands.js +45 -32
  280. package/dist/commands/scenario/run.command.js +2 -2
  281. package/dist/commands/scenario/scenario.command.d.ts +3 -4
  282. package/dist/commands/scenario/scenario.command.d.ts.map +1 -1
  283. package/dist/commands/scenario/scenario.command.js +8 -26
  284. package/dist/commands/shared/git-context.d.ts +1 -0
  285. package/dist/commands/shared/git-context.d.ts.map +1 -1
  286. package/dist/commands/shared/git-context.js +4 -2
  287. package/dist/commands/shared/git-ops.d.ts +1 -0
  288. package/dist/commands/shared/git-ops.d.ts.map +1 -1
  289. package/dist/commands/shared/git-ops.js +13 -0
  290. package/dist/commands/shared/operator-pipeline.d.ts +10 -0
  291. package/dist/commands/shared/operator-pipeline.d.ts.map +1 -0
  292. package/dist/commands/shared/operator-pipeline.js +16 -0
  293. package/dist/commands/shared/pr-meta.d.ts +32 -12
  294. package/dist/commands/shared/pr-meta.d.ts.map +1 -1
  295. package/dist/commands/shared/pr-meta.js +49 -14
  296. package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
  297. package/dist/commands/shared/reconcile-check.js +28 -3
  298. package/dist/commands/shared/task-backend.d.ts +11 -7
  299. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  300. package/dist/commands/shared/task-backend.js +107 -24
  301. package/dist/commands/shared/task-handoff.d.ts +64 -0
  302. package/dist/commands/shared/task-handoff.d.ts.map +1 -0
  303. package/dist/commands/shared/task-handoff.js +151 -0
  304. package/dist/commands/shared/task-mutation.d.ts +36 -0
  305. package/dist/commands/shared/task-mutation.d.ts.map +1 -0
  306. package/dist/commands/shared/task-mutation.js +67 -0
  307. package/dist/commands/shared/task-store.d.ts +65 -2
  308. package/dist/commands/shared/task-store.d.ts.map +1 -1
  309. package/dist/commands/shared/task-store.js +309 -91
  310. package/dist/commands/task/add.d.ts.map +1 -1
  311. package/dist/commands/task/add.js +41 -39
  312. package/dist/commands/task/block.d.ts.map +1 -1
  313. package/dist/commands/task/block.js +31 -89
  314. package/dist/commands/task/close-duplicate.d.ts.map +1 -1
  315. package/dist/commands/task/close-duplicate.js +0 -7
  316. package/dist/commands/task/close-noop.d.ts.map +1 -1
  317. package/dist/commands/task/close-noop.js +0 -21
  318. package/dist/commands/task/close-shared.d.ts +0 -2
  319. package/dist/commands/task/close-shared.d.ts.map +1 -1
  320. package/dist/commands/task/close-shared.js +24 -57
  321. package/dist/commands/task/comment.d.ts.map +1 -1
  322. package/dist/commands/task/comment.js +48 -42
  323. package/dist/commands/task/derive.command.d.ts +1 -0
  324. package/dist/commands/task/derive.command.d.ts.map +1 -1
  325. package/dist/commands/task/derive.command.js +15 -2
  326. package/dist/commands/task/derive.d.ts +1 -0
  327. package/dist/commands/task/derive.d.ts.map +1 -1
  328. package/dist/commands/task/derive.js +37 -7
  329. package/dist/commands/task/doc.command.d.ts.map +1 -1
  330. package/dist/commands/task/doc.command.js +7 -6
  331. package/dist/commands/task/doc.d.ts.map +1 -1
  332. package/dist/commands/task/doc.js +68 -61
  333. package/dist/commands/task/finish-shared.d.ts +60 -0
  334. package/dist/commands/task/finish-shared.d.ts.map +1 -0
  335. package/dist/commands/task/finish-shared.js +181 -0
  336. package/dist/commands/task/finish.d.ts +1 -0
  337. package/dist/commands/task/finish.d.ts.map +1 -1
  338. package/dist/commands/task/finish.js +73 -204
  339. package/dist/commands/task/handoff-record.command.d.ts +17 -0
  340. package/dist/commands/task/handoff-record.command.d.ts.map +1 -0
  341. package/dist/commands/task/handoff-record.command.js +140 -0
  342. package/dist/commands/task/handoff-show.command.d.ts +8 -0
  343. package/dist/commands/task/handoff-show.command.d.ts.map +1 -0
  344. package/dist/commands/task/handoff-show.command.js +77 -0
  345. package/dist/commands/task/handoff.command.d.ts +7 -0
  346. package/dist/commands/task/handoff.command.d.ts.map +1 -0
  347. package/dist/commands/task/handoff.command.js +21 -0
  348. package/dist/commands/task/handoff.shared.d.ts +39 -0
  349. package/dist/commands/task/handoff.shared.d.ts.map +1 -0
  350. package/dist/commands/task/handoff.shared.js +134 -0
  351. package/dist/commands/task/hosted-close.command.d.ts +9 -0
  352. package/dist/commands/task/hosted-close.command.d.ts.map +1 -0
  353. package/dist/commands/task/hosted-close.command.js +190 -0
  354. package/dist/commands/task/hosted-merge-sync.d.ts +40 -0
  355. package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -0
  356. package/dist/commands/task/hosted-merge-sync.js +277 -0
  357. package/dist/commands/task/list.d.ts.map +1 -1
  358. package/dist/commands/task/list.js +7 -24
  359. package/dist/commands/task/migrate-doc.d.ts +15 -0
  360. package/dist/commands/task/migrate-doc.d.ts.map +1 -1
  361. package/dist/commands/task/migrate-doc.js +126 -35
  362. package/dist/commands/task/new.d.ts.map +1 -1
  363. package/dist/commands/task/new.js +26 -4
  364. package/dist/commands/task/next.d.ts.map +1 -1
  365. package/dist/commands/task/next.js +10 -28
  366. package/dist/commands/task/normalize.command.d.ts +1 -0
  367. package/dist/commands/task/normalize.command.d.ts.map +1 -1
  368. package/dist/commands/task/normalize.command.js +12 -0
  369. package/dist/commands/task/normalize.d.ts +1 -0
  370. package/dist/commands/task/normalize.d.ts.map +1 -1
  371. package/dist/commands/task/normalize.js +21 -9
  372. package/dist/commands/task/plan.command.d.ts +3 -4
  373. package/dist/commands/task/plan.command.d.ts.map +1 -1
  374. package/dist/commands/task/plan.command.js +6 -12
  375. package/dist/commands/task/plan.d.ts.map +1 -1
  376. package/dist/commands/task/plan.js +118 -125
  377. package/dist/commands/task/reclaim.command.d.ts +11 -0
  378. package/dist/commands/task/reclaim.command.d.ts.map +1 -0
  379. package/dist/commands/task/reclaim.command.js +102 -0
  380. package/dist/commands/task/resume-context.command.d.ts +9 -0
  381. package/dist/commands/task/resume-context.command.d.ts.map +1 -0
  382. package/dist/commands/task/resume-context.command.js +60 -0
  383. package/dist/commands/task/run-cancel.command.d.ts +6 -0
  384. package/dist/commands/task/run-cancel.command.d.ts.map +1 -0
  385. package/dist/commands/task/run-cancel.command.js +45 -0
  386. package/dist/commands/task/run-cancel.spec.d.ts +7 -0
  387. package/dist/commands/task/run-cancel.spec.d.ts.map +1 -0
  388. package/dist/commands/task/run-cancel.spec.js +20 -0
  389. package/dist/commands/task/run-resume.command.d.ts +6 -0
  390. package/dist/commands/task/run-resume.command.d.ts.map +1 -0
  391. package/dist/commands/task/run-resume.command.js +55 -0
  392. package/dist/commands/task/run-resume.spec.d.ts +7 -0
  393. package/dist/commands/task/run-resume.spec.d.ts.map +1 -0
  394. package/dist/commands/task/run-resume.spec.js +20 -0
  395. package/dist/commands/task/run-retry.command.d.ts +6 -0
  396. package/dist/commands/task/run-retry.command.d.ts.map +1 -0
  397. package/dist/commands/task/run-retry.command.js +56 -0
  398. package/dist/commands/task/run-retry.spec.d.ts +7 -0
  399. package/dist/commands/task/run-retry.spec.d.ts.map +1 -0
  400. package/dist/commands/task/run-retry.spec.js +20 -0
  401. package/dist/commands/task/run-show.command.d.ts +6 -0
  402. package/dist/commands/task/run-show.command.d.ts.map +1 -0
  403. package/dist/commands/task/run-show.command.js +133 -0
  404. package/dist/commands/task/run-show.spec.d.ts +8 -0
  405. package/dist/commands/task/run-show.spec.d.ts.map +1 -0
  406. package/dist/commands/task/run-show.spec.js +44 -0
  407. package/dist/commands/task/run-tail.command.d.ts +6 -0
  408. package/dist/commands/task/run-tail.command.d.ts.map +1 -0
  409. package/dist/commands/task/run-tail.command.js +26 -0
  410. package/dist/commands/task/run-tail.spec.d.ts +8 -0
  411. package/dist/commands/task/run-tail.spec.d.ts.map +1 -0
  412. package/dist/commands/task/run-tail.spec.js +51 -0
  413. package/dist/commands/task/run-trace.command.d.ts +6 -0
  414. package/dist/commands/task/run-trace.command.d.ts.map +1 -0
  415. package/dist/commands/task/run-trace.command.js +25 -0
  416. package/dist/commands/task/run-trace.spec.d.ts +7 -0
  417. package/dist/commands/task/run-trace.spec.d.ts.map +1 -0
  418. package/dist/commands/task/run-trace.spec.js +31 -0
  419. package/dist/commands/task/run.command.d.ts +6 -0
  420. package/dist/commands/task/run.command.d.ts.map +1 -0
  421. package/dist/commands/task/run.command.js +74 -0
  422. package/dist/commands/task/run.spec.d.ts +7 -0
  423. package/dist/commands/task/run.spec.d.ts.map +1 -0
  424. package/dist/commands/task/run.spec.js +26 -0
  425. package/dist/commands/task/scaffold.d.ts.map +1 -1
  426. package/dist/commands/task/scaffold.js +4 -2
  427. package/dist/commands/task/scrub.d.ts.map +1 -1
  428. package/dist/commands/task/scrub.js +27 -24
  429. package/dist/commands/task/search.d.ts.map +1 -1
  430. package/dist/commands/task/search.js +21 -31
  431. package/dist/commands/task/set-status.d.ts.map +1 -1
  432. package/dist/commands/task/set-status.js +38 -111
  433. package/dist/commands/task/shared/dependencies.d.ts +5 -4
  434. package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
  435. package/dist/commands/task/shared/dependencies.js +20 -2
  436. package/dist/commands/task/shared/docs.d.ts +6 -1
  437. package/dist/commands/task/shared/docs.d.ts.map +1 -1
  438. package/dist/commands/task/shared/docs.js +14 -1
  439. package/dist/commands/task/shared/listing.d.ts +16 -2
  440. package/dist/commands/task/shared/listing.d.ts.map +1 -1
  441. package/dist/commands/task/shared/listing.js +56 -0
  442. package/dist/commands/task/shared/transition-command.d.ts +15 -0
  443. package/dist/commands/task/shared/transition-command.d.ts.map +1 -0
  444. package/dist/commands/task/shared/transition-command.js +43 -0
  445. package/dist/commands/task/shared/transitions.d.ts +56 -0
  446. package/dist/commands/task/shared/transitions.d.ts.map +1 -1
  447. package/dist/commands/task/shared/transitions.js +82 -8
  448. package/dist/commands/task/shared/workflow-transition-service.d.ts +75 -0
  449. package/dist/commands/task/shared/workflow-transition-service.d.ts.map +1 -0
  450. package/dist/commands/task/shared/workflow-transition-service.js +226 -0
  451. package/dist/commands/task/shared.d.ts +6 -4
  452. package/dist/commands/task/shared.d.ts.map +1 -1
  453. package/dist/commands/task/shared.js +6 -4
  454. package/dist/commands/task/show.d.ts.map +1 -1
  455. package/dist/commands/task/show.js +37 -3
  456. package/dist/commands/task/start.d.ts.map +1 -1
  457. package/dist/commands/task/start.js +32 -113
  458. package/dist/commands/task/task.command.d.ts +3 -4
  459. package/dist/commands/task/task.command.d.ts.map +1 -1
  460. package/dist/commands/task/task.command.js +22 -37
  461. package/dist/commands/task/verify-record.d.ts.map +1 -1
  462. package/dist/commands/task/verify-record.js +21 -146
  463. package/dist/commands/task/verify.command.d.ts.map +1 -1
  464. package/dist/commands/task/verify.command.js +7 -6
  465. package/dist/commands/task.test-helpers.d.ts +13 -0
  466. package/dist/commands/task.test-helpers.d.ts.map +1 -0
  467. package/dist/commands/task.test-helpers.js +65 -0
  468. package/dist/commands/upgrade/apply.d.ts +2 -0
  469. package/dist/commands/upgrade/apply.d.ts.map +1 -1
  470. package/dist/commands/upgrade/apply.js +33 -1
  471. package/dist/commands/upgrade/materialize.d.ts +28 -0
  472. package/dist/commands/upgrade/materialize.d.ts.map +1 -0
  473. package/dist/commands/upgrade/materialize.js +154 -0
  474. package/dist/commands/upgrade/plan.d.ts +18 -0
  475. package/dist/commands/upgrade/plan.d.ts.map +1 -0
  476. package/dist/commands/upgrade/plan.js +219 -0
  477. package/dist/commands/upgrade/policy.d.ts +24 -0
  478. package/dist/commands/upgrade/policy.d.ts.map +1 -0
  479. package/dist/commands/upgrade/policy.js +182 -0
  480. package/dist/commands/upgrade/report.d.ts.map +1 -1
  481. package/dist/commands/upgrade/report.js +7 -5
  482. package/dist/commands/upgrade.command.d.ts.map +1 -1
  483. package/dist/commands/upgrade.command.js +25 -0
  484. package/dist/commands/upgrade.d.ts +1 -0
  485. package/dist/commands/upgrade.d.ts.map +1 -1
  486. package/dist/commands/upgrade.js +164 -618
  487. package/dist/commands/workflow.command.d.ts +3 -4
  488. package/dist/commands/workflow.command.d.ts.map +1 -1
  489. package/dist/commands/workflow.command.js +8 -25
  490. package/dist/policy/rules/allowlist.d.ts.map +1 -1
  491. package/dist/policy/rules/allowlist.js +12 -9
  492. package/dist/ports/task-backend-port.d.ts +4 -2
  493. package/dist/ports/task-backend-port.d.ts.map +1 -1
  494. package/dist/runner/adapters/codex.d.ts +9 -0
  495. package/dist/runner/adapters/codex.d.ts.map +1 -0
  496. package/dist/runner/adapters/codex.js +414 -0
  497. package/dist/runner/adapters/custom.d.ts +12 -0
  498. package/dist/runner/adapters/custom.d.ts.map +1 -0
  499. package/dist/runner/adapters/custom.js +512 -0
  500. package/dist/runner/adapters/index.d.ts +8 -0
  501. package/dist/runner/adapters/index.d.ts.map +1 -0
  502. package/dist/runner/adapters/index.js +15 -0
  503. package/dist/runner/adapters/recipe-run-profile.d.ts +8 -0
  504. package/dist/runner/adapters/recipe-run-profile.d.ts.map +1 -0
  505. package/dist/runner/adapters/recipe-run-profile.js +53 -0
  506. package/dist/runner/adapters/shared.d.ts +45 -0
  507. package/dist/runner/adapters/shared.d.ts.map +1 -0
  508. package/dist/runner/adapters/shared.js +58 -0
  509. package/dist/runner/artifacts.d.ts +31 -0
  510. package/dist/runner/artifacts.d.ts.map +1 -0
  511. package/dist/runner/artifacts.js +153 -0
  512. package/dist/runner/codex-approval-probe.d.ts +23 -0
  513. package/dist/runner/codex-approval-probe.d.ts.map +1 -0
  514. package/dist/runner/codex-approval-probe.js +55 -0
  515. package/dist/runner/codex-smoke.d.ts +11 -0
  516. package/dist/runner/codex-smoke.d.ts.map +1 -0
  517. package/dist/runner/codex-smoke.js +45 -0
  518. package/dist/runner/config.d.ts +6 -0
  519. package/dist/runner/config.d.ts.map +1 -0
  520. package/dist/runner/config.js +15 -0
  521. package/dist/runner/context/base-prompts.d.ts +10 -0
  522. package/dist/runner/context/base-prompts.d.ts.map +1 -0
  523. package/dist/runner/context/base-prompts.js +255 -0
  524. package/dist/runner/context/recipe-context.d.ts +17 -0
  525. package/dist/runner/context/recipe-context.d.ts.map +1 -0
  526. package/dist/runner/context/recipe-context.js +48 -0
  527. package/dist/runner/context/task-context.d.ts +24 -0
  528. package/dist/runner/context/task-context.d.ts.map +1 -0
  529. package/dist/runner/context/task-context.js +266 -0
  530. package/dist/runner/index.d.ts +12 -0
  531. package/dist/runner/index.d.ts.map +1 -0
  532. package/dist/runner/index.js +11 -0
  533. package/dist/runner/policy-decision.d.ts +12 -0
  534. package/dist/runner/policy-decision.d.ts.map +1 -0
  535. package/dist/runner/policy-decision.js +89 -0
  536. package/dist/runner/policy-display.d.ts +4 -0
  537. package/dist/runner/policy-display.d.ts.map +1 -0
  538. package/dist/runner/policy-display.js +41 -0
  539. package/dist/runner/process-supervision.d.ts +48 -0
  540. package/dist/runner/process-supervision.d.ts.map +1 -0
  541. package/dist/runner/process-supervision.js +490 -0
  542. package/dist/runner/result-manifest-policy.d.ts +9 -0
  543. package/dist/runner/result-manifest-policy.d.ts.map +1 -0
  544. package/dist/runner/result-manifest-policy.js +96 -0
  545. package/dist/runner/result-manifest.d.ts +30 -0
  546. package/dist/runner/result-manifest.d.ts.map +1 -0
  547. package/dist/runner/result-manifest.js +322 -0
  548. package/dist/runner/run-id.d.ts +2 -0
  549. package/dist/runner/run-id.d.ts.map +1 -0
  550. package/dist/runner/run-id.js +3 -0
  551. package/dist/runner/run-repository.d.ts +51 -0
  552. package/dist/runner/run-repository.d.ts.map +1 -0
  553. package/dist/runner/run-repository.js +222 -0
  554. package/dist/runner/task-run-paths.d.ts +19 -0
  555. package/dist/runner/task-run-paths.d.ts.map +1 -0
  556. package/dist/runner/task-run-paths.js +25 -0
  557. package/dist/runner/task-state.d.ts +9 -0
  558. package/dist/runner/task-state.d.ts.map +1 -0
  559. package/dist/runner/task-state.js +354 -0
  560. package/dist/runner/test-helpers.d.ts +30 -0
  561. package/dist/runner/test-helpers.d.ts.map +1 -0
  562. package/dist/runner/test-helpers.js +97 -0
  563. package/dist/runner/trace-artifacts.d.ts +14 -0
  564. package/dist/runner/trace-artifacts.d.ts.map +1 -0
  565. package/dist/runner/trace-artifacts.js +80 -0
  566. package/dist/runner/trace.d.ts +10 -0
  567. package/dist/runner/trace.d.ts.map +1 -0
  568. package/dist/runner/trace.js +37 -0
  569. package/dist/runner/types.d.ts +317 -0
  570. package/dist/runner/types.d.ts.map +1 -0
  571. package/dist/runner/types.js +3 -0
  572. package/dist/runner/usecases/scenario-materialize-task.d.ts +29 -0
  573. package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -0
  574. package/dist/runner/usecases/scenario-materialize-task.js +151 -0
  575. package/dist/runner/usecases/task-run-inspect.d.ts +41 -0
  576. package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -0
  577. package/dist/runner/usecases/task-run-inspect.js +74 -0
  578. package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts +10 -0
  579. package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts.map +1 -0
  580. package/dist/runner/usecases/task-run-lifecycle-cancel.js +172 -0
  581. package/dist/runner/usecases/task-run-lifecycle-replay.d.ts +18 -0
  582. package/dist/runner/usecases/task-run-lifecycle-replay.d.ts.map +1 -0
  583. package/dist/runner/usecases/task-run-lifecycle-replay.js +128 -0
  584. package/dist/runner/usecases/task-run-lifecycle-shared.d.ts +45 -0
  585. package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -0
  586. package/dist/runner/usecases/task-run-lifecycle-shared.js +172 -0
  587. package/dist/runner/usecases/task-run-lifecycle.d.ts +4 -0
  588. package/dist/runner/usecases/task-run-lifecycle.d.ts.map +1 -0
  589. package/dist/runner/usecases/task-run-lifecycle.js +2 -0
  590. package/dist/runner/usecases/task-run.d.ts +32 -0
  591. package/dist/runner/usecases/task-run.d.ts.map +1 -0
  592. package/dist/runner/usecases/task-run.js +278 -0
  593. package/dist/shared/agent-emoji.d.ts.map +1 -1
  594. package/dist/shared/agent-emoji.js +1 -0
  595. package/dist/shared/errors.d.ts +1 -1
  596. package/dist/shared/errors.d.ts.map +1 -1
  597. package/dist/shared/guards.d.ts.map +1 -1
  598. package/dist/shared/guards.js +1 -0
  599. package/dist/shared/protected-paths.d.ts +10 -0
  600. package/dist/shared/protected-paths.d.ts.map +1 -1
  601. package/dist/shared/protected-paths.js +33 -0
  602. package/dist/shared/repo-cli-version.d.ts.map +1 -1
  603. package/dist/shared/repo-cli-version.js +7 -5
  604. package/dist/shared/task-doc-conflicts.d.ts +12 -0
  605. package/dist/shared/task-doc-conflicts.d.ts.map +1 -0
  606. package/dist/shared/task-doc-conflicts.js +40 -0
  607. package/dist/shared/task-doc-state.d.ts +10 -0
  608. package/dist/shared/task-doc-state.d.ts.map +1 -0
  609. package/dist/shared/task-doc-state.js +15 -0
  610. package/dist/test-helpers/fs.d.ts +2 -0
  611. package/dist/test-helpers/fs.d.ts.map +1 -0
  612. package/dist/test-helpers/fs.js +9 -0
  613. package/dist/usecases/context/resolve-context.d.ts +2 -0
  614. package/dist/usecases/context/resolve-context.d.ts.map +1 -1
  615. package/dist/usecases/context/resolve-context.js +4 -1
  616. package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
  617. package/dist/usecases/task/task-list-usecase.js +2 -8
  618. package/dist/workflow-runtime/fix.d.ts +9 -1
  619. package/dist/workflow-runtime/fix.d.ts.map +1 -1
  620. package/dist/workflow-runtime/fix.js +9 -1
  621. package/package.json +3 -2
  622. package/dist/backends/task-backend.test-helpers.d.ts +0 -4
  623. package/dist/backends/task-backend.test-helpers.d.ts.map +0 -1
  624. package/dist/backends/task-backend.test-helpers.js +0 -33
  625. package/dist/cli/run-cli/catalog.d.ts +0 -7
  626. package/dist/cli/run-cli/catalog.d.ts.map +0 -1
  627. package/dist/cli/run-cli/catalog.js +0 -22
  628. package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +0 -3
  629. package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +0 -1
  630. package/dist/cli/run-cli.core.pr-flow.test-helpers.js +0 -41
  631. package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +0 -2
  632. package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +0 -1
  633. package/dist/cli/run-cli.core.tasks.test-helpers.js +0 -6
  634. package/dist/commands/block.command.d.ts +0 -4
  635. package/dist/commands/block.command.d.ts.map +0 -1
  636. package/dist/commands/block.command.js +0 -2
  637. package/dist/commands/doctor.command.d.ts +0 -3
  638. package/dist/commands/doctor.command.d.ts.map +0 -1
  639. package/dist/commands/doctor.command.js +0 -2
  640. package/dist/commands/finish.command.d.ts +0 -4
  641. package/dist/commands/finish.command.d.ts.map +0 -1
  642. package/dist/commands/finish.command.js +0 -2
  643. package/dist/commands/recipes/install.command.d.ts +0 -3
  644. package/dist/commands/recipes/install.command.d.ts.map +0 -1
  645. package/dist/commands/recipes/install.command.js +0 -2
  646. package/dist/commands/start.command.d.ts +0 -4
  647. package/dist/commands/start.command.d.ts.map +0 -1
  648. package/dist/commands/start.command.js +0 -2
  649. package/dist/commands/task/list.command.d.ts +0 -4
  650. package/dist/commands/task/list.command.d.ts.map +0 -1
  651. package/dist/commands/task/list.command.js +0 -2
  652. package/dist/commands/task/next.command.d.ts +0 -4
  653. package/dist/commands/task/next.command.d.ts.map +0 -1
  654. package/dist/commands/task/next.command.js +0 -2
  655. package/dist/commands/task/search.command.d.ts +0 -4
  656. package/dist/commands/task/search.command.d.ts.map +0 -1
  657. package/dist/commands/task/search.command.js +0 -2
  658. package/dist/commands/task/show.command.d.ts +0 -4
  659. package/dist/commands/task/show.command.d.ts.map +0 -1
  660. package/dist/commands/task/show.command.js +0 -2
  661. package/dist/commands/verify.command.d.ts +0 -4
  662. package/dist/commands/verify.command.d.ts.map +0 -1
  663. package/dist/commands/verify.command.js +0 -2
@@ -0,0 +1,172 @@
1
+ import path from "node:path";
2
+ import { loadCommandContext } from "../../commands/shared/task-backend.js";
3
+ import { CliError } from "../../shared/errors.js";
4
+ import { createRunnerAdapter } from "../adapters/index.js";
5
+ import { runnerAdapterCancelledResult } from "../adapters/shared.js";
6
+ import { evolveRunnerRunState } from "../artifacts.js";
7
+ import { isProcessAlive, readObservedProcessIdentity } from "../process-supervision.js";
8
+ import { assertRunnerBundleMatchesTask, RunnerRunRepository } from "../run-repository.js";
9
+ import { assertRunnerTaskExecutable, } from "./task-run.js";
10
+ function normalizeTaskStatus(task) {
11
+ return String(task.status || "TODO")
12
+ .trim()
13
+ .toUpperCase();
14
+ }
15
+ function assertCurrentTaskDoing(taskId, task) {
16
+ if (!task) {
17
+ throw new CliError({
18
+ exitCode: 4,
19
+ code: "E_IO",
20
+ message: `Task not found: ${taskId}`,
21
+ });
22
+ }
23
+ const status = normalizeTaskStatus(task);
24
+ if (status === "DOING")
25
+ return;
26
+ throw new CliError({
27
+ exitCode: 2,
28
+ code: "E_USAGE",
29
+ message: `${taskId}: runner lifecycle commands require task status DOING ` +
30
+ `(current=${JSON.stringify(status)}; use \`agentplane task start-ready ${taskId} --author <ROLE> --body "Start: ..."\` first).`,
31
+ });
32
+ }
33
+ export function assertExecuteMode(bundle, action) {
34
+ if (bundle.execution.mode === "execute")
35
+ return;
36
+ throw new CliError({
37
+ exitCode: 2,
38
+ code: "E_USAGE",
39
+ message: `runner ${action} requires an execute-mode run ` +
40
+ `(current=${JSON.stringify(bundle.execution.mode)}; dry-run artifacts cannot be ${action}d).`,
41
+ });
42
+ }
43
+ export function readRunningPid(state) {
44
+ return typeof state.supervision?.pid === "number" ? state.supervision.pid : null;
45
+ }
46
+ function normalizeCommandFingerprint(command) {
47
+ const firstToken = command?.trim().split(/\s+/u)[0] ?? "";
48
+ return firstToken ? path.basename(firstToken) : null;
49
+ }
50
+ function commandMatchesFingerprint(expected, observedCommand) {
51
+ const expectedFingerprint = normalizeCommandFingerprint(expected);
52
+ if (!expectedFingerprint || !observedCommand)
53
+ return false;
54
+ return observedCommand.includes(expectedFingerprint);
55
+ }
56
+ function startedAtMatches(expected, observed) {
57
+ const expectedMs = expected ? Date.parse(expected) : Number.NaN;
58
+ const observedMs = observed ? Date.parse(observed) : Number.NaN;
59
+ if (Number.isNaN(expectedMs) || Number.isNaN(observedMs))
60
+ return false;
61
+ return Math.abs(expectedMs - observedMs) <= 5000;
62
+ }
63
+ export async function assertMatchingProcessIdentity(opts) {
64
+ const observed = await readObservedProcessIdentity(opts.pid);
65
+ if (!observed) {
66
+ if (!isProcessAlive(opts.pid))
67
+ return;
68
+ throw new CliError({
69
+ exitCode: 8,
70
+ code: "E_RUNTIME",
71
+ message: `runner cancel refused because process identity could not be confirmed for ` +
72
+ `${opts.task_id}:${opts.run_id} pid=${opts.pid}.`,
73
+ context: {
74
+ task_id: opts.task_id,
75
+ run_id: opts.run_id,
76
+ pid: opts.pid,
77
+ expected_command: opts.state.supervision?.command ?? null,
78
+ expected_started_at: opts.state.supervision?.started_at ?? null,
79
+ },
80
+ });
81
+ }
82
+ const commandMatches = commandMatchesFingerprint(opts.state.supervision?.command, observed.command);
83
+ const startMatches = startedAtMatches(opts.state.supervision?.started_at, observed.started_at);
84
+ if (commandMatches && startMatches)
85
+ return;
86
+ throw new CliError({
87
+ exitCode: 8,
88
+ code: "E_RUNTIME",
89
+ message: `runner cancel refused because the live process no longer matches persisted supervision ` +
90
+ `metadata for ${opts.task_id}:${opts.run_id} pid=${opts.pid}.`,
91
+ context: {
92
+ task_id: opts.task_id,
93
+ run_id: opts.run_id,
94
+ pid: opts.pid,
95
+ expected_command: opts.state.supervision?.command ?? null,
96
+ observed_command: observed.command,
97
+ expected_started_at: opts.state.supervision?.started_at ?? null,
98
+ observed_started_at: observed.started_at,
99
+ },
100
+ });
101
+ }
102
+ export function signalProcess(pid, signal) {
103
+ try {
104
+ process.kill(pid, signal);
105
+ return true;
106
+ }
107
+ catch (err) {
108
+ const code = err?.code;
109
+ if (code === "ESRCH")
110
+ return false;
111
+ throw err;
112
+ }
113
+ }
114
+ export function buildSyntheticCancelledState(opts) {
115
+ const priorSupervision = opts.state.supervision;
116
+ const started_at = opts.state.result?.started_at ??
117
+ priorSupervision?.started_at ??
118
+ opts.state.updated_at ??
119
+ opts.updated_at;
120
+ const result = runnerAdapterCancelledResult({
121
+ reason: `Runner cancellation state synthesized after requested ${opts.signal}; ` +
122
+ "observed process exit metadata was unavailable.",
123
+ started_at,
124
+ ended_at: opts.updated_at,
125
+ output_paths: [opts.state.bundle_path, opts.state.bootstrap_path].filter((value) => typeof value === "string" && value.trim().length > 0),
126
+ });
127
+ return evolveRunnerRunState({
128
+ state: opts.state,
129
+ status: "cancelled",
130
+ result,
131
+ updated_at: opts.updated_at,
132
+ supervision: {
133
+ ...priorSupervision,
134
+ heartbeat_at: opts.updated_at,
135
+ cancel_requested_at: priorSupervision?.cancel_requested_at ?? opts.updated_at,
136
+ cancel_signal: priorSupervision?.cancel_signal ?? opts.signal,
137
+ exit_signal: priorSupervision?.exit_signal ?? null,
138
+ },
139
+ });
140
+ }
141
+ export async function loadExistingRunnerExecution(opts) {
142
+ const ctx = opts.ctx ??
143
+ (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
144
+ if (opts.require_task_doing !== false) {
145
+ assertCurrentTaskDoing(opts.task_id, await ctx.taskBackend.getTask(opts.task_id));
146
+ }
147
+ const repository = RunnerRunRepository.forTaskRun({
148
+ git_root: ctx.resolvedProject.gitRoot,
149
+ workflow_dir: ctx.config.paths.workflow_dir,
150
+ task_id: opts.task_id,
151
+ run_id: opts.run_id,
152
+ });
153
+ const record = await repository.readRecord();
154
+ if (!record) {
155
+ throw new CliError({
156
+ exitCode: 4,
157
+ code: "E_IO",
158
+ message: `Runner artifacts not found for ${opts.task_id}:${opts.run_id}`,
159
+ });
160
+ }
161
+ assertRunnerBundleMatchesTask(record.bundle, opts.task_id, opts.run_id);
162
+ assertRunnerTaskExecutable(record.bundle);
163
+ const adapter = createRunnerAdapter(ctx.config);
164
+ const invocation = await adapter.prepare(record.bundle);
165
+ return {
166
+ ctx,
167
+ bundle: record.bundle,
168
+ invocation,
169
+ state: record.state,
170
+ repository,
171
+ };
172
+ }
@@ -0,0 +1,4 @@
1
+ export { cancelTaskRunnerExecution } from "./task-run-lifecycle-cancel.js";
2
+ export { resumeTaskRunnerExecution, retryTaskRunnerExecution, } from "./task-run-lifecycle-replay.js";
3
+ export type { CancelledTaskRunnerExecution, ResumedTaskRunnerExecution, RetriedTaskRunnerExecution, } from "./task-run-lifecycle-shared.js";
4
+ //# sourceMappingURL=task-run-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-run-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/runner/usecases/task-run-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { cancelTaskRunnerExecution } from "./task-run-lifecycle-cancel.js";
2
+ export { resumeTaskRunnerExecution, retryTaskRunnerExecution, } from "./task-run-lifecycle-replay.js";
@@ -0,0 +1,32 @@
1
+ import { type CommandContext } from "../../commands/shared/task-backend.js";
2
+ import { type RunnerContextBundle, type RunnerExecutionContract, type RunnerInvocation, type RunnerRecipeContext, type RunnerResult, type RunnerRunState, type RunnerTarget } from "../types.js";
3
+ export type PreparedTaskRunnerExecution = {
4
+ bundle: RunnerContextBundle;
5
+ invocation: RunnerInvocation;
6
+ state: RunnerRunState;
7
+ };
8
+ export type ExecutedTaskRunnerExecution = PreparedTaskRunnerExecution & {
9
+ result: RunnerResult;
10
+ };
11
+ export declare function assertRunnerTaskExecutable(bundle: RunnerContextBundle): void;
12
+ export declare function renderTaskRunnerBootstrap(bundle: RunnerContextBundle, invocation?: RunnerInvocation): string;
13
+ export declare function prepareTaskRunnerExecution(opts: {
14
+ ctx?: CommandContext;
15
+ cwd: string;
16
+ rootOverride?: string | null;
17
+ task_id: string;
18
+ mode: RunnerExecutionContract["mode"];
19
+ run_id?: string;
20
+ recipe?: RunnerRecipeContext;
21
+ target?: RunnerTarget;
22
+ }): Promise<PreparedTaskRunnerExecution>;
23
+ export declare function executeTaskRunnerExecution(opts: {
24
+ ctx?: CommandContext;
25
+ cwd: string;
26
+ rootOverride?: string | null;
27
+ task_id: string;
28
+ run_id?: string;
29
+ recipe?: RunnerRecipeContext;
30
+ target?: RunnerTarget;
31
+ }): Promise<ExecutedTaskRunnerExecution>;
32
+ //# sourceMappingURL=task-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-run.d.ts","sourceRoot":"","sources":["../../../src/runner/usecases/task-run.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAgBhG,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,GAAG;IACtE,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAiGF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAc5E;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,UAAU,CAAC,EAAE,gBAAgB,GAC5B,MAAM,CAiCR;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAmFvC;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAgDvC"}
@@ -0,0 +1,278 @@
1
+ import { exitCodeForError } from "../../cli/exit-codes.js";
2
+ import { loadCommandContext } from "../../commands/shared/task-backend.js";
3
+ import { CliError } from "../../shared/errors.js";
4
+ import { evolveRunnerRunState } from "../artifacts.js";
5
+ import { createRunnerAdapter } from "../adapters/index.js";
6
+ import { readRecipeRunProfile } from "../adapters/recipe-run-profile.js";
7
+ import { collectRunnerBasePrompts } from "../context/base-prompts.js";
8
+ import { assembleRunnerTaskContext } from "../context/task-context.js";
9
+ import { applyRunnerPolicyRefusal, buildRunnerPolicyDecision } from "../policy-decision.js";
10
+ import { createRunnerRunId } from "../run-id.js";
11
+ import { persistRunnerOutcomeToTask } from "../task-state.js";
12
+ import { RunnerRunRepository } from "../run-repository.js";
13
+ import { resolveTaskRunnerPaths } from "../task-run-paths.js";
14
+ import { resolveRunnerTimeoutPolicy, resolveRunnerTracePolicy } from "../config.js";
15
+ import { normalizeRecipeArtifactPrefixes } from "../result-manifest-policy.js";
16
+ import { RUNNER_API_VERSION, RUNNER_BUNDLE_SCHEMA_VERSION, } from "../types.js";
17
+ class RunnerPreparationCliError extends CliError {
18
+ bundle;
19
+ state;
20
+ constructor(opts) {
21
+ super({
22
+ exitCode: opts.cause.exitCode,
23
+ code: opts.cause.code,
24
+ message: opts.cause.message,
25
+ context: opts.cause.context,
26
+ });
27
+ this.bundle = opts.bundle;
28
+ this.state = opts.state;
29
+ }
30
+ }
31
+ function isEnforcedCapabilityLevel(level) {
32
+ return level === "native" || level === "wrapper";
33
+ }
34
+ function assertRunnerPolicyCompatibility(bundle) {
35
+ const profile = readRecipeRunProfile(bundle.recipe);
36
+ if (!profile)
37
+ return;
38
+ const adapterId = bundle.execution.adapter_id;
39
+ const capabilities = bundle.execution.adapter_capabilities;
40
+ if (profile.sandbox) {
41
+ const sandboxCapability = capabilities?.fields.sandbox;
42
+ if (isEnforcedCapabilityLevel(sandboxCapability?.level) &&
43
+ sandboxCapability?.supported_values &&
44
+ !sandboxCapability.supported_values.includes(profile.sandbox)) {
45
+ throw new CliError({
46
+ exitCode: exitCodeForError("E_RUNTIME"),
47
+ code: "E_RUNTIME",
48
+ message: `Runner adapter ${JSON.stringify(adapterId)} does not support recipe sandbox ` +
49
+ `${JSON.stringify(profile.sandbox)}; supported values: ${sandboxCapability.supported_values.join(", ")}.`,
50
+ context: {
51
+ adapter_id: adapterId,
52
+ policy_field: "sandbox",
53
+ declared_value: profile.sandbox,
54
+ capability: sandboxCapability,
55
+ },
56
+ });
57
+ }
58
+ }
59
+ if (profile.writes_artifacts_to && profile.writes_artifacts_to.length > 0) {
60
+ normalizeRecipeArtifactPrefixes(profile.writes_artifacts_to);
61
+ }
62
+ }
63
+ async function writeRunnerRefusalArtifacts(opts) {
64
+ const repository = RunnerRunRepository.fromBundle(opts.bundle);
65
+ const prepared = await repository.writePrepared({
66
+ bundle: opts.bundle,
67
+ bootstrap_markdown: renderTaskRunnerBootstrap(opts.bundle),
68
+ });
69
+ const result = {
70
+ status: "failed",
71
+ exit_code: opts.error.exitCode ?? exitCodeForError("E_RUNTIME"),
72
+ started_at: prepared.created_at,
73
+ ended_at: prepared.created_at,
74
+ summary: opts.error.message,
75
+ stderr_summary: opts.error.message,
76
+ };
77
+ const refused = evolveRunnerRunState({
78
+ state: prepared,
79
+ status: "failed",
80
+ result,
81
+ updated_at: prepared.created_at,
82
+ });
83
+ await repository.writeState(refused);
84
+ await repository.appendEvent({
85
+ at: prepared.created_at,
86
+ type: "runner_refused",
87
+ message: `runner refused before adapter prepare: ${opts.error.message}`,
88
+ data: opts.error.context
89
+ ? {
90
+ code: opts.error.code,
91
+ exit_code: opts.error.exitCode,
92
+ ...opts.error.context,
93
+ }
94
+ : {
95
+ code: opts.error.code,
96
+ exit_code: opts.error.exitCode,
97
+ },
98
+ });
99
+ return refused;
100
+ }
101
+ export function assertRunnerTaskExecutable(bundle) {
102
+ const task = bundle.task;
103
+ if (!task)
104
+ return;
105
+ const status = String(task.data.status || "TODO")
106
+ .trim()
107
+ .toUpperCase();
108
+ if (status === "DOING")
109
+ return;
110
+ throw new CliError({
111
+ exitCode: 2,
112
+ code: "E_USAGE",
113
+ message: `${task.task_id}: runner execution requires task status DOING ` +
114
+ `(current=${JSON.stringify(status)}; use \`agentplane task start-ready ${task.task_id} --author <ROLE> --body "Start: ..."\` first).`,
115
+ });
116
+ }
117
+ export function renderTaskRunnerBootstrap(bundle, invocation) {
118
+ const targetLabel = bundle.target.kind === "task"
119
+ ? `task ${bundle.target.task_id}`
120
+ : `recipe scenario ${bundle.target.recipe_id}:${bundle.target.scenario_id}`;
121
+ return [
122
+ "# agentplane runner bootstrap",
123
+ "",
124
+ "This invocation is already inside an approved runner execution.",
125
+ "- Do not run repository startup commands such as `agentplane config show`, `agentplane quickstart`, `agentplane task list`, `git status`, or `git rev-parse` unless the bundle explicitly requires them as task work.",
126
+ "- Do not create, approve, start, verify, finish, block, or rerun tasks unless the bundle explicitly requires task metadata edits.",
127
+ "- Do not recursively invoke runner entrypoints such as `agentplane task run` or `agentplane scenario execute` from inside this run.",
128
+ "- Open bundle.json immediately, execute the requested work directly, and stop when the requested outcome is satisfied.",
129
+ "",
130
+ `- target: ${targetLabel}`,
131
+ `- adapter: ${bundle.execution.adapter_id}`,
132
+ `- mode: ${bundle.execution.mode}`,
133
+ `- run_id: ${bundle.execution.run_id}`,
134
+ `- bundle_path: ${bundle.execution.artifact_paths.bundle_path}`,
135
+ `- result_path: ${bundle.execution.artifact_paths.result_path}`,
136
+ `- bootstrap_path: ${bundle.execution.artifact_paths.bootstrap_path}`,
137
+ "",
138
+ "Use bundle.json as the complete runner input. Do not reconstruct prompts from CLI argv.",
139
+ "Execute-mode runs must write a valid JSON result manifest to result_path before exiting.",
140
+ "Minimal manifest example:",
141
+ '{"schema_version":1,"status":"success","summary":"Completed.","capabilities_used":["runner.exec"]}',
142
+ "",
143
+ "Prepared invocation:",
144
+ "",
145
+ invocation
146
+ ? `- argv: ${invocation.argv.join(" ")}`
147
+ : "- argv: <not prepared; preflight refused>",
148
+ ].join("\n");
149
+ }
150
+ export async function prepareTaskRunnerExecution(opts) {
151
+ const ctx = opts.ctx ??
152
+ (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
153
+ const taskEnvelope = await assembleRunnerTaskContext({
154
+ ctx,
155
+ cwd: opts.cwd,
156
+ rootOverride: opts.rootOverride ?? null,
157
+ task_id: opts.task_id,
158
+ });
159
+ const base_prompts = await collectRunnerBasePrompts({
160
+ git_root: taskEnvelope.repository.git_root,
161
+ owner_id: taskEnvelope.task.data.owner,
162
+ agents_dir: ctx.config.paths.agents_dir,
163
+ recipe: opts.recipe,
164
+ });
165
+ const adapter = createRunnerAdapter(ctx.config);
166
+ const configured_adapter_id = adapter.id === "custom" ? "custom" : "codex";
167
+ const run_id = opts.run_id ?? createRunnerRunId();
168
+ const artifact_paths = resolveTaskRunnerPaths({
169
+ git_root: taskEnvelope.repository.git_root,
170
+ workflow_dir: taskEnvelope.repository.workflow_dir,
171
+ task_id: opts.task_id,
172
+ run_id,
173
+ });
174
+ const bundle = {
175
+ schema_version: RUNNER_BUNDLE_SCHEMA_VERSION,
176
+ runner_api_version: RUNNER_API_VERSION,
177
+ target: opts.target ?? { kind: "task", task_id: opts.task_id },
178
+ base_prompts,
179
+ repository: taskEnvelope.repository,
180
+ task: taskEnvelope.task,
181
+ recipe: opts.recipe,
182
+ execution: {
183
+ adapter_id: configured_adapter_id,
184
+ mode: opts.mode,
185
+ run_id,
186
+ artifact_paths,
187
+ trace_policy: resolveRunnerTracePolicy(ctx.config),
188
+ timeout_policy: resolveRunnerTimeoutPolicy(ctx.config),
189
+ approvals: {
190
+ require_plan: ctx.config.agents?.approvals.require_plan,
191
+ require_verify: ctx.config.agents?.approvals.require_verify,
192
+ require_network: ctx.config.agents?.approvals.require_network,
193
+ },
194
+ },
195
+ };
196
+ bundle.execution.adapter_capabilities = adapter.describeCapabilities(bundle);
197
+ bundle.execution.policy_decision = buildRunnerPolicyDecision({
198
+ adapter_id: bundle.execution.adapter_id,
199
+ capabilities: bundle.execution.adapter_capabilities,
200
+ recipe: bundle.recipe,
201
+ });
202
+ assertRunnerTaskExecutable(bundle);
203
+ try {
204
+ assertRunnerPolicyCompatibility(bundle);
205
+ }
206
+ catch (err) {
207
+ if (err instanceof CliError) {
208
+ bundle.execution.policy_decision = applyRunnerPolicyRefusal({
209
+ decision: bundle.execution.policy_decision ??
210
+ buildRunnerPolicyDecision({
211
+ adapter_id: bundle.execution.adapter_id,
212
+ capabilities: bundle.execution.adapter_capabilities,
213
+ recipe: bundle.recipe,
214
+ }),
215
+ error: err,
216
+ });
217
+ const state = await writeRunnerRefusalArtifacts({ bundle, error: err });
218
+ throw new RunnerPreparationCliError({ cause: err, bundle, state });
219
+ }
220
+ throw err;
221
+ }
222
+ const invocation = await adapter.prepare(bundle);
223
+ const repository = RunnerRunRepository.fromBundle(bundle);
224
+ const state = await repository.writePrepared({
225
+ bundle,
226
+ bootstrap_markdown: renderTaskRunnerBootstrap(bundle, invocation),
227
+ invocation,
228
+ });
229
+ return { bundle, invocation, state };
230
+ }
231
+ export async function executeTaskRunnerExecution(opts) {
232
+ const ctx = opts.ctx ??
233
+ (await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
234
+ let prepared;
235
+ try {
236
+ prepared = await prepareTaskRunnerExecution({
237
+ ctx,
238
+ cwd: opts.cwd,
239
+ rootOverride: opts.rootOverride ?? null,
240
+ task_id: opts.task_id,
241
+ mode: "execute",
242
+ run_id: opts.run_id,
243
+ recipe: opts.recipe,
244
+ target: opts.target,
245
+ });
246
+ }
247
+ catch (err) {
248
+ if (err instanceof RunnerPreparationCliError) {
249
+ await persistRunnerOutcomeToTask({
250
+ ctx,
251
+ task_id: opts.task_id,
252
+ bundle: err.bundle,
253
+ state: err.state,
254
+ });
255
+ }
256
+ throw err;
257
+ }
258
+ const adapter = createRunnerAdapter(ctx.config);
259
+ const result = await adapter.execute(prepared.invocation);
260
+ const repository = RunnerRunRepository.fromInvocation(prepared.invocation);
261
+ const state = (await repository.readState()) ??
262
+ evolveRunnerRunState({
263
+ state: prepared.state,
264
+ status: result.status,
265
+ result,
266
+ updated_at: result.ended_at,
267
+ });
268
+ await persistRunnerOutcomeToTask({
269
+ ctx,
270
+ task_id: opts.task_id,
271
+ bundle: prepared.bundle,
272
+ state,
273
+ });
274
+ return {
275
+ ...prepared,
276
+ result,
277
+ };
278
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"agent-emoji.d.ts","sourceRoot":"","sources":["../../src/shared/agent-emoji.ts"],"names":[],"mappings":"AAkCA,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB"}
1
+ {"version":3,"file":"agent-emoji.d.ts","sourceRoot":"","sources":["../../src/shared/agent-emoji.ts"],"names":[],"mappings":"AAmCA,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB"}
@@ -28,6 +28,7 @@ function fallbackEmojiForAgentId(agentId) {
28
28
  const idx = stableHash32(agentId) % FALLBACK_EMOJIS.length;
29
29
  return FALLBACK_EMOJIS[idx] ?? "🧩";
30
30
  }
31
+ // Prefer an explicit agent-level commit_emoji before falling back to deterministic defaults.
31
32
  export async function resolveCommitEmojiForAgent(opts) {
32
33
  const agentId = opts.agentId.trim();
33
34
  if (!agentId)
@@ -1,4 +1,4 @@
1
- export type ErrorCode = "E_USAGE" | "E_VALIDATION" | "E_IO" | "E_GIT" | "E_BACKEND" | "E_NETWORK" | "E_INTERNAL";
1
+ export type ErrorCode = "E_USAGE" | "E_VALIDATION" | "E_IO" | "E_GIT" | "E_BACKEND" | "E_NETWORK" | "E_RUNTIME" | "E_INTERNAL";
2
2
  export declare class CliError extends Error {
3
3
  readonly exitCode: number;
4
4
  readonly code: ErrorCode;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,cAAc,GACd,MAAM,GACN,OAAO,GACP,WAAW,GACX,WAAW,GACX,YAAY,CAAC;AAEjB,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAEtC,IAAI,EAAE;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,SAAS,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC;CAMF;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAiBnF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,cAAc,GACd,MAAM,GACN,OAAO,GACP,WAAW,GACX,WAAW,GACX,WAAW,GACX,YAAY,CAAC;AAEjB,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAEtC,IAAI,EAAE;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,SAAS,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC;CAMF;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAiBnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/shared/guards.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/shared/guards.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
@@ -1,3 +1,4 @@
1
+ // Narrow unknown values to plain object-like records.
1
2
  export function isRecord(value) {
2
3
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
3
4
  }
@@ -9,6 +9,16 @@ export declare function taskArtifactPrefixes(opts: {
9
9
  workflowDir?: string;
10
10
  taskId?: string;
11
11
  }): string[];
12
+ export declare function protectedPathAllowPrefixes(opts: {
13
+ tasksPath: string;
14
+ workflowDir?: string;
15
+ taskId?: string;
16
+ allowTasks?: boolean;
17
+ allowPolicy?: boolean;
18
+ allowConfig?: boolean;
19
+ allowHooks?: boolean;
20
+ allowCI?: boolean;
21
+ }): string[];
12
22
  export declare function getProtectedPathOverride(kind: ProtectedPathKind): ProtectedPathOverride;
13
23
  export declare function protectedPathKindForFile(opts: {
14
24
  filePath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"protected-paths.d.ts","sourceRoot":"","sources":["../../src/shared/protected-paths.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;AAE/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAYF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,EAAE,CAOX;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,qBAAqB,CAkBvF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,iBAAiB,GAAG,IAAI,CAsC3B"}
1
+ {"version":3,"file":"protected-paths.d.ts","sourceRoot":"","sources":["../../src/shared/protected-paths.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;AAE/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAYF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,EAAE,CAOX;AAYD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,EAAE,CAkBX;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,qBAAqB,CAkBvF;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,iBAAiB,GAAG,IAAI,CAsC3B"}
@@ -16,6 +16,39 @@ export function taskArtifactPrefixes(opts) {
16
16
  out.add(workflowPrefix);
17
17
  return [...out].toSorted((a, b) => a.localeCompare(b));
18
18
  }
19
+ const POLICY_PATH_PREFIXES = [
20
+ "AGENTS.md",
21
+ "CLAUDE.md",
22
+ "packages/agentplane/assets/AGENTS.md",
23
+ ".agentplane/agents",
24
+ ];
25
+ const CONFIG_PATH_PREFIXES = [".agentplane/config.json", ".agentplane/backends"];
26
+ const HOOK_PATH_PREFIXES = ["lefthook.yml"];
27
+ const CI_PATH_PREFIXES = [".github/workflows", ".github/actions"];
28
+ export function protectedPathAllowPrefixes(opts) {
29
+ const out = new Set();
30
+ if (opts.allowTasks) {
31
+ for (const prefix of taskArtifactPrefixes(opts))
32
+ out.add(prefix);
33
+ }
34
+ if (opts.allowPolicy) {
35
+ for (const prefix of POLICY_PATH_PREFIXES)
36
+ out.add(prefix);
37
+ }
38
+ if (opts.allowConfig) {
39
+ for (const prefix of CONFIG_PATH_PREFIXES)
40
+ out.add(prefix);
41
+ }
42
+ if (opts.allowHooks) {
43
+ for (const prefix of HOOK_PATH_PREFIXES)
44
+ out.add(prefix);
45
+ }
46
+ if (opts.allowCI) {
47
+ for (const prefix of CI_PATH_PREFIXES)
48
+ out.add(prefix);
49
+ }
50
+ return [...out].toSorted((a, b) => a.localeCompare(b));
51
+ }
19
52
  export function getProtectedPathOverride(kind) {
20
53
  switch (kind) {
21
54
  case "tasks": {
@@ -1 +1 @@
1
- {"version":3,"file":"repo-cli-version.d.ts","sourceRoot":"","sources":["../../src/shared/repo-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,WAAW,GACX,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAKjF;AA8BD,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GACzB,yBAAyB,CAuC3B"}
1
+ {"version":3,"file":"repo-cli-version.d.ts","sourceRoot":"","sources":["../../src/shared/repo-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQ5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,WAAW,GACX,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAKjF;AA+BD,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GACzB,yBAAyB,CAuC3B"}
@@ -1,3 +1,4 @@
1
+ import { FRAMEWORK_DEV_BOOTSTRAP_COMMAND, FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND, FRAMEWORK_DEV_REINSTALL_SCRIPT, FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND, } from "../../bin/framework-dev-contract.js";
1
2
  import { compareVersions } from "./version-compare.js";
2
3
  export function getRepoExpectedCliVersion(config) {
3
4
  const raw = config.framework.cli.expected_version;
@@ -9,22 +10,23 @@ export function getRepoExpectedCliVersion(config) {
9
10
  function buildRecovery(runtime, expectedVersion) {
10
11
  switch (runtime.mode) {
11
12
  case "global-installed": {
12
- return `Run: npm i -g agentplane@${expectedVersion}. Then verify: agentplane runtime explain`;
13
+ return `Run: npm i -g agentplane@${expectedVersion}. Then verify: ${FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND}`;
13
14
  }
14
15
  case "global-in-framework":
15
16
  case "global-forced-in-framework": {
16
17
  const prefix = runtime.mode === "global-forced-in-framework"
17
18
  ? "Unset AGENTPLANE_USE_GLOBAL_IN_FRAMEWORK=1 if forced global mode is not intentional. "
18
19
  : "";
19
- return (`${prefix}Run: scripts/reinstall-global-agentplane.sh. ` +
20
- "Fallback: node packages/agentplane/bin/agentplane.js runtime explain. " +
21
- "Then verify: agentplane runtime explain");
20
+ return (`${prefix}Run: ${FRAMEWORK_DEV_BOOTSTRAP_COMMAND}. ` +
21
+ `If the global PATH command should resolve this checkout, then run: ${FRAMEWORK_DEV_REINSTALL_SCRIPT}. ` +
22
+ `Repo-local verify: ${FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND}. ` +
23
+ `Then verify: ${FRAMEWORK_DEV_GLOBAL_VERIFY_COMMAND}`);
22
24
  }
23
25
  case "repo-local":
24
26
  case "repo-local-handoff": {
25
27
  return (`Sync this framework checkout to agentplane ${expectedVersion} or lower ` +
26
28
  "framework.cli.expected_version if the repository intentionally targets an older CLI. " +
27
- "Then verify: agentplane runtime explain");
29
+ `Then verify: ${FRAMEWORK_DEV_REPO_LOCAL_VERIFY_COMMAND}`);
28
30
  }
29
31
  }
30
32
  }
@@ -0,0 +1,12 @@
1
+ export declare function assertExpectedTaskDoc(opts: {
2
+ taskId: string;
3
+ currentDoc: string;
4
+ expectedDoc: string | null | undefined;
5
+ }): void;
6
+ export declare function assertExpectedTaskSection(opts: {
7
+ taskId: string;
8
+ currentDoc: string;
9
+ section: string;
10
+ expectedText: string | null | undefined;
11
+ }): void;
12
+ //# sourceMappingURL=task-doc-conflicts.d.ts.map