@ambystech/ambykit 1.5.0 → 2.0.0-rc.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 (441) hide show
  1. package/CHANGELOG.md +190 -1
  2. package/README.md +12 -7
  3. package/dist/cli/add.js +9 -0
  4. package/dist/cli/add.js.map +1 -1
  5. package/dist/cli/analyze.js +25 -4
  6. package/dist/cli/analyze.js.map +1 -1
  7. package/dist/cli/base-command.d.ts +8 -0
  8. package/dist/cli/base-command.js +30 -0
  9. package/dist/cli/base-command.js.map +1 -1
  10. package/dist/cli/check.d.ts +2 -0
  11. package/dist/cli/check.js +38 -4
  12. package/dist/cli/check.js.map +1 -1
  13. package/dist/cli/dashboard.d.ts +5 -2
  14. package/dist/cli/dashboard.js +95 -24
  15. package/dist/cli/dashboard.js.map +1 -1
  16. package/dist/cli/edit.d.ts +17 -0
  17. package/dist/cli/edit.js +71 -0
  18. package/dist/cli/edit.js.map +1 -0
  19. package/dist/cli/fleet.d.ts +2 -0
  20. package/dist/cli/fleet.js +23 -1
  21. package/dist/cli/fleet.js.map +1 -1
  22. package/dist/cli/index.d.ts +1 -5
  23. package/dist/cli/index.js +21 -109
  24. package/dist/cli/index.js.map +1 -1
  25. package/dist/cli/init.js +9 -0
  26. package/dist/cli/init.js.map +1 -1
  27. package/dist/cli/lane.d.ts +38 -3
  28. package/dist/cli/lane.js +124 -108
  29. package/dist/cli/lane.js.map +1 -1
  30. package/dist/cli/main.d.ts +6 -0
  31. package/dist/cli/main.js +111 -0
  32. package/dist/cli/main.js.map +1 -0
  33. package/dist/cli/mcp.d.ts +2 -0
  34. package/dist/cli/mcp.js +4 -0
  35. package/dist/cli/mcp.js.map +1 -1
  36. package/dist/cli/migrate.d.ts +17 -0
  37. package/dist/cli/migrate.js +67 -0
  38. package/dist/cli/migrate.js.map +1 -0
  39. package/dist/cli/node-guard.d.ts +4 -0
  40. package/dist/cli/node-guard.js +12 -0
  41. package/dist/cli/node-guard.js.map +1 -0
  42. package/dist/cli/run-budget.d.ts +25 -0
  43. package/dist/cli/run-budget.js +112 -0
  44. package/dist/cli/run-budget.js.map +1 -0
  45. package/dist/cli/run-control.d.ts +40 -0
  46. package/dist/cli/run-control.js +161 -0
  47. package/dist/cli/run-control.js.map +1 -0
  48. package/dist/cli/run-files.d.ts +96 -0
  49. package/dist/cli/run-files.js +120 -0
  50. package/dist/cli/run-files.js.map +1 -0
  51. package/dist/cli/run-fleet-control.d.ts +16 -0
  52. package/dist/cli/run-fleet-control.js +23 -0
  53. package/dist/cli/run-fleet-control.js.map +1 -0
  54. package/dist/cli/run-fleet-loop.d.ts +77 -0
  55. package/dist/cli/run-fleet-loop.js +156 -0
  56. package/dist/cli/run-fleet-loop.js.map +1 -0
  57. package/dist/cli/run-fleet-merge.d.ts +22 -0
  58. package/dist/cli/run-fleet-merge.js +69 -0
  59. package/dist/cli/run-fleet-merge.js.map +1 -0
  60. package/dist/cli/run-fleet-prepare.d.ts +35 -0
  61. package/dist/cli/run-fleet-prepare.js +58 -0
  62. package/dist/cli/run-fleet-prepare.js.map +1 -0
  63. package/dist/cli/run-fleet.d.ts +28 -0
  64. package/dist/cli/run-fleet.js +382 -0
  65. package/dist/cli/run-fleet.js.map +1 -0
  66. package/dist/cli/run-gates.d.ts +25 -0
  67. package/dist/cli/run-gates.js +45 -0
  68. package/dist/cli/run-gates.js.map +1 -0
  69. package/dist/cli/run-launch.d.ts +17 -0
  70. package/dist/cli/run-launch.js +106 -0
  71. package/dist/cli/run-launch.js.map +1 -0
  72. package/dist/cli/run-loop.d.ts +39 -0
  73. package/dist/cli/run-loop.js +197 -0
  74. package/dist/cli/run-loop.js.map +1 -0
  75. package/dist/cli/run-merger.d.ts +18 -0
  76. package/dist/cli/run-merger.js +126 -0
  77. package/dist/cli/run-merger.js.map +1 -0
  78. package/dist/cli/run-phase-check.d.ts +32 -0
  79. package/dist/cli/run-phase-check.js +173 -0
  80. package/dist/cli/run-phase-check.js.map +1 -0
  81. package/dist/cli/run-plan.d.ts +28 -0
  82. package/dist/cli/run-plan.js +62 -0
  83. package/dist/cli/run-plan.js.map +1 -0
  84. package/dist/cli/run-process.d.ts +45 -0
  85. package/dist/cli/run-process.js +111 -0
  86. package/dist/cli/run-process.js.map +1 -0
  87. package/dist/cli/run-protocol-prompts.d.ts +17 -0
  88. package/dist/cli/run-protocol-prompts.js +63 -0
  89. package/dist/cli/run-protocol-prompts.js.map +1 -0
  90. package/dist/cli/run-protocol.d.ts +17 -0
  91. package/dist/cli/run-protocol.js +128 -0
  92. package/dist/cli/run-protocol.js.map +1 -0
  93. package/dist/cli/run-script.d.ts +11 -0
  94. package/dist/cli/run-script.js +67 -0
  95. package/dist/cli/run-script.js.map +1 -0
  96. package/dist/cli/run-session.d.ts +93 -0
  97. package/dist/cli/run-session.js +21 -0
  98. package/dist/cli/run-session.js.map +1 -0
  99. package/dist/cli/run-stages.d.ts +11 -0
  100. package/dist/cli/run-stages.js +34 -0
  101. package/dist/cli/run-stages.js.map +1 -0
  102. package/dist/cli/run-supervisor.d.ts +20 -0
  103. package/dist/cli/run-supervisor.js +167 -0
  104. package/dist/cli/run-supervisor.js.map +1 -0
  105. package/dist/cli/run.d.ts +81 -0
  106. package/dist/cli/run.js +437 -0
  107. package/dist/cli/run.js.map +1 -0
  108. package/dist/cli/sync.js +10 -5
  109. package/dist/cli/sync.js.map +1 -1
  110. package/dist/cli/ui/dashboard/empty-state.d.ts +5 -0
  111. package/dist/cli/ui/dashboard/empty-state.js +7 -0
  112. package/dist/cli/ui/dashboard/empty-state.js.map +1 -1
  113. package/dist/cli/ui/dashboard/filter-line.d.ts +13 -0
  114. package/dist/cli/ui/dashboard/filter-line.js +20 -0
  115. package/dist/cli/ui/dashboard/filter-line.js.map +1 -0
  116. package/dist/cli/ui/dashboard/fleet-tab.d.ts +25 -0
  117. package/dist/cli/ui/dashboard/fleet-tab.js +91 -0
  118. package/dist/cli/ui/dashboard/fleet-tab.js.map +1 -0
  119. package/dist/cli/ui/dashboard/fleet-tokens.d.ts +404 -0
  120. package/dist/cli/ui/dashboard/fleet-tokens.js +405 -0
  121. package/dist/cli/ui/dashboard/fleet-tokens.js.map +1 -0
  122. package/dist/cli/ui/dashboard/fleet-view.d.ts +51 -0
  123. package/dist/cli/ui/dashboard/fleet-view.js +211 -0
  124. package/dist/cli/ui/dashboard/fleet-view.js.map +1 -0
  125. package/dist/cli/ui/dashboard/help-overlay.d.ts +3 -1
  126. package/dist/cli/ui/dashboard/help-overlay.js +36 -3
  127. package/dist/cli/ui/dashboard/help-overlay.js.map +1 -1
  128. package/dist/cli/ui/dashboard/layout.d.ts +15 -0
  129. package/dist/cli/ui/dashboard/layout.js +22 -0
  130. package/dist/cli/ui/dashboard/layout.js.map +1 -1
  131. package/dist/cli/ui/dashboard/metrics-panel.d.ts +15 -0
  132. package/dist/cli/ui/dashboard/metrics-panel.js +143 -0
  133. package/dist/cli/ui/dashboard/metrics-panel.js.map +1 -0
  134. package/dist/cli/ui/dashboard/tab-bar.d.ts +14 -0
  135. package/dist/cli/ui/dashboard/tab-bar.js +37 -0
  136. package/dist/cli/ui/dashboard/tab-bar.js.map +1 -0
  137. package/dist/cli/ui/dashboard/tab-frame.d.ts +43 -0
  138. package/dist/cli/ui/dashboard/tab-frame.js +68 -0
  139. package/dist/cli/ui/dashboard/tab-frame.js.map +1 -0
  140. package/dist/cli/ui/dashboard/tab-tokens.d.ts +569 -0
  141. package/dist/cli/ui/dashboard/tab-tokens.js +570 -0
  142. package/dist/cli/ui/dashboard/tab-tokens.js.map +1 -0
  143. package/dist/cli/ui/icons.d.ts +22 -0
  144. package/dist/cli/ui/icons.js +17 -0
  145. package/dist/cli/ui/icons.js.map +1 -0
  146. package/dist/cli/ui/interactive/fleet-actions.d.ts +24 -0
  147. package/dist/cli/ui/interactive/fleet-actions.js +30 -0
  148. package/dist/cli/ui/interactive/fleet-actions.js.map +1 -0
  149. package/dist/cli/ui/interactive/fleet.d.ts +54 -0
  150. package/dist/cli/ui/interactive/fleet.js +98 -0
  151. package/dist/cli/ui/interactive/fleet.js.map +1 -0
  152. package/dist/cli/ui/interactive/fullscreen.js +38 -10
  153. package/dist/cli/ui/interactive/fullscreen.js.map +1 -1
  154. package/dist/cli/ui/interactive/list-filter.d.ts +25 -0
  155. package/dist/cli/ui/interactive/list-filter.js +38 -0
  156. package/dist/cli/ui/interactive/list-filter.js.map +1 -0
  157. package/dist/cli/ui/interactive/live.d.ts +8 -0
  158. package/dist/cli/ui/interactive/live.js +13 -0
  159. package/dist/cli/ui/interactive/live.js.map +1 -1
  160. package/dist/cli/ui/interactive/overview.d.ts +52 -3
  161. package/dist/cli/ui/interactive/overview.js +354 -15
  162. package/dist/cli/ui/interactive/overview.js.map +1 -1
  163. package/dist/cli/ui/interactive/tabs.d.ts +15 -0
  164. package/dist/cli/ui/interactive/tabs.js +27 -0
  165. package/dist/cli/ui/interactive/tabs.js.map +1 -0
  166. package/dist/cli/ui/tool-options.d.ts +5 -1
  167. package/dist/cli/ui/tool-options.js +9 -3
  168. package/dist/cli/ui/tool-options.js.map +1 -1
  169. package/dist/cli/update.js +13 -2
  170. package/dist/cli/update.js.map +1 -1
  171. package/dist/core/analyze.d.ts +11 -0
  172. package/dist/core/analyze.js +33 -3
  173. package/dist/core/analyze.js.map +1 -1
  174. package/dist/core/burndown.d.ts +1 -1
  175. package/dist/core/burndown.js +2 -2
  176. package/dist/core/burndown.js.map +1 -1
  177. package/dist/core/checkouts.js +3 -2
  178. package/dist/core/checkouts.js.map +1 -1
  179. package/dist/core/config-schema.d.ts +45 -0
  180. package/dist/core/config-schema.js +63 -0
  181. package/dist/core/config-schema.js.map +1 -0
  182. package/dist/core/config.d.ts +6 -0
  183. package/dist/core/config.js +16 -0
  184. package/dist/core/config.js.map +1 -1
  185. package/dist/core/dashboard.js +3 -2
  186. package/dist/core/dashboard.js.map +1 -1
  187. package/dist/core/decisions.d.ts +12 -1
  188. package/dist/core/decisions.js +7 -2
  189. package/dist/core/decisions.js.map +1 -1
  190. package/dist/core/deprecation.d.ts +15 -0
  191. package/dist/core/deprecation.js +27 -0
  192. package/dist/core/deprecation.js.map +1 -0
  193. package/dist/core/features.js +11 -5
  194. package/dist/core/features.js.map +1 -1
  195. package/dist/core/fleet/fleet-text.d.ts +2 -0
  196. package/dist/core/fleet/fleet-text.js +41 -0
  197. package/dist/core/fleet/fleet-text.js.map +1 -0
  198. package/dist/core/fleet/fleet-view.d.ts +35 -0
  199. package/dist/core/fleet/fleet-view.js +43 -0
  200. package/dist/core/fleet/fleet-view.js.map +1 -0
  201. package/dist/core/fleet/fleets.d.ts +18 -0
  202. package/dist/core/fleet/fleets.js +64 -0
  203. package/dist/core/fleet/fleets.js.map +1 -0
  204. package/dist/core/fleet/flow-input.js +3 -4
  205. package/dist/core/fleet/flow-input.js.map +1 -1
  206. package/dist/core/fleet/index.d.ts +3 -0
  207. package/dist/core/fleet/index.js +3 -0
  208. package/dist/core/fleet/index.js.map +1 -1
  209. package/dist/core/fleet/runs.d.ts +18 -2
  210. package/dist/core/fleet/runs.js +67 -16
  211. package/dist/core/fleet/runs.js.map +1 -1
  212. package/dist/core/fleet-plan/budget.d.ts +18 -0
  213. package/dist/core/fleet-plan/budget.js +13 -0
  214. package/dist/core/fleet-plan/budget.js.map +1 -0
  215. package/dist/core/fleet-plan/contain.d.ts +10 -0
  216. package/dist/core/fleet-plan/contain.js +37 -0
  217. package/dist/core/fleet-plan/contain.js.map +1 -0
  218. package/dist/core/fleet-plan/format.d.ts +4 -0
  219. package/dist/core/fleet-plan/format.js +52 -0
  220. package/dist/core/fleet-plan/format.js.map +1 -0
  221. package/dist/core/fleet-plan/index.d.ts +7 -0
  222. package/dist/core/fleet-plan/index.js +8 -0
  223. package/dist/core/fleet-plan/index.js.map +1 -0
  224. package/dist/core/fleet-plan/order.d.ts +30 -0
  225. package/dist/core/fleet-plan/order.js +96 -0
  226. package/dist/core/fleet-plan/order.js.map +1 -0
  227. package/dist/core/fleet-plan/ownership.d.ts +12 -0
  228. package/dist/core/fleet-plan/ownership.js +36 -0
  229. package/dist/core/fleet-plan/ownership.js.map +1 -0
  230. package/dist/core/fleet-plan/plan.d.ts +23 -0
  231. package/dist/core/fleet-plan/plan.js +40 -0
  232. package/dist/core/fleet-plan/plan.js.map +1 -0
  233. package/dist/core/fleet-plan/read.d.ts +19 -0
  234. package/dist/core/fleet-plan/read.js +35 -0
  235. package/dist/core/fleet-plan/read.js.map +1 -0
  236. package/dist/core/fleet-plan/schedule.d.ts +15 -0
  237. package/dist/core/fleet-plan/schedule.js +27 -0
  238. package/dist/core/fleet-plan/schedule.js.map +1 -0
  239. package/dist/core/fleet-plan/select.d.ts +20 -0
  240. package/dist/core/fleet-plan/select.js +64 -0
  241. package/dist/core/fleet-plan/select.js.map +1 -0
  242. package/dist/core/fleet-plan/types.d.ts +123 -0
  243. package/dist/core/fleet-plan/types.js +2 -0
  244. package/dist/core/fleet-plan/types.js.map +1 -0
  245. package/dist/core/fleet-view/derive.d.ts +14 -0
  246. package/dist/core/fleet-view/derive.js +54 -0
  247. package/dist/core/fleet-view/derive.js.map +1 -0
  248. package/dist/core/fleet-view/group.d.ts +51 -0
  249. package/dist/core/fleet-view/group.js +73 -0
  250. package/dist/core/fleet-view/group.js.map +1 -0
  251. package/dist/core/fleet-view/json.d.ts +37 -0
  252. package/dist/core/fleet-view/json.js +25 -0
  253. package/dist/core/fleet-view/json.js.map +1 -0
  254. package/dist/core/fleet-view/read.d.ts +8 -0
  255. package/dist/core/fleet-view/read.js +44 -0
  256. package/dist/core/fleet-view/read.js.map +1 -0
  257. package/dist/core/fleet-view/types.d.ts +52 -0
  258. package/dist/core/fleet-view/types.js +2 -0
  259. package/dist/core/fleet-view/types.js.map +1 -0
  260. package/dist/core/graph-format.d.ts +2 -0
  261. package/dist/core/graph-format.js +4 -3
  262. package/dist/core/graph-format.js.map +1 -1
  263. package/dist/core/graph-types.d.ts +4 -0
  264. package/dist/core/graph.js +38 -1
  265. package/dist/core/graph.js.map +1 -1
  266. package/dist/core/index.d.ts +1 -0
  267. package/dist/core/index.js +1 -0
  268. package/dist/core/index.js.map +1 -1
  269. package/dist/core/lane-merge.d.ts +29 -0
  270. package/dist/core/lane-merge.js +105 -0
  271. package/dist/core/lane-merge.js.map +1 -0
  272. package/dist/core/lanes.d.ts +53 -0
  273. package/dist/core/lanes.js +131 -0
  274. package/dist/core/lanes.js.map +1 -1
  275. package/dist/core/legacy.d.ts +2 -1
  276. package/dist/core/legacy.js +7 -2
  277. package/dist/core/legacy.js.map +1 -1
  278. package/dist/core/markers.d.ts +7 -0
  279. package/dist/core/markers.js +3 -2
  280. package/dist/core/markers.js.map +1 -1
  281. package/dist/core/metrics/cycle.d.ts +3 -0
  282. package/dist/core/metrics/cycle.js +47 -0
  283. package/dist/core/metrics/cycle.js.map +1 -0
  284. package/dist/core/metrics/gap.d.ts +9 -0
  285. package/dist/core/metrics/gap.js +35 -0
  286. package/dist/core/metrics/gap.js.map +1 -0
  287. package/dist/core/metrics/index.d.ts +21 -0
  288. package/dist/core/metrics/index.js +67 -0
  289. package/dist/core/metrics/index.js.map +1 -0
  290. package/dist/core/metrics/model.d.ts +23 -0
  291. package/dist/core/metrics/model.js +46 -0
  292. package/dist/core/metrics/model.js.map +1 -0
  293. package/dist/core/metrics/revisions.d.ts +22 -0
  294. package/dist/core/metrics/revisions.js +88 -0
  295. package/dist/core/metrics/revisions.js.map +1 -0
  296. package/dist/core/metrics/types.d.ts +74 -0
  297. package/dist/core/metrics/types.js +3 -0
  298. package/dist/core/metrics/types.js.map +1 -0
  299. package/dist/core/migrate/convert-spec.d.ts +19 -0
  300. package/dist/core/migrate/convert-spec.js +99 -0
  301. package/dist/core/migrate/convert-spec.js.map +1 -0
  302. package/dist/core/migrate/convert-tasks.d.ts +16 -0
  303. package/dist/core/migrate/convert-tasks.js +121 -0
  304. package/dist/core/migrate/convert-tasks.js.map +1 -0
  305. package/dist/core/migrate/run.d.ts +36 -0
  306. package/dist/core/migrate/run.js +178 -0
  307. package/dist/core/migrate/run.js.map +1 -0
  308. package/dist/core/migrate/safety.d.ts +33 -0
  309. package/dist/core/migrate/safety.js +199 -0
  310. package/dist/core/migrate/safety.js.map +1 -0
  311. package/dist/core/migrate/summary.d.ts +36 -0
  312. package/dist/core/migrate/summary.js +140 -0
  313. package/dist/core/migrate/summary.js.map +1 -0
  314. package/dist/core/moved-targets.d.ts +73 -8
  315. package/dist/core/moved-targets.js +79 -1
  316. package/dist/core/moved-targets.js.map +1 -1
  317. package/dist/core/overview-types.d.ts +7 -0
  318. package/dist/core/overview-types.js.map +1 -1
  319. package/dist/core/overview.js +4 -0
  320. package/dist/core/overview.js.map +1 -1
  321. package/dist/core/query.js +3 -2
  322. package/dist/core/query.js.map +1 -1
  323. package/dist/core/run-gate-actions.d.ts +51 -0
  324. package/dist/core/run-gate-actions.js +105 -0
  325. package/dist/core/run-gate-actions.js.map +1 -0
  326. package/dist/core/run-launch-plan.d.ts +53 -0
  327. package/dist/core/run-launch-plan.js +32 -0
  328. package/dist/core/run-launch-plan.js.map +1 -0
  329. package/dist/core/run-prompt.d.ts +89 -0
  330. package/dist/core/run-prompt.js +73 -0
  331. package/dist/core/run-prompt.js.map +1 -0
  332. package/dist/core/run-result.d.ts +42 -0
  333. package/dist/core/run-result.js +163 -0
  334. package/dist/core/run-result.js.map +1 -0
  335. package/dist/core/run-review.d.ts +50 -0
  336. package/dist/core/run-review.js +20 -0
  337. package/dist/core/run-review.js.map +1 -0
  338. package/dist/core/run-schedule.d.ts +23 -0
  339. package/dist/core/run-schedule.js +40 -0
  340. package/dist/core/run-schedule.js.map +1 -0
  341. package/dist/core/run-stability.d.ts +23 -0
  342. package/dist/core/run-stability.js +38 -0
  343. package/dist/core/run-stability.js.map +1 -0
  344. package/dist/core/run-supervise.d.ts +71 -0
  345. package/dist/core/run-supervise.js +61 -0
  346. package/dist/core/run-supervise.js.map +1 -0
  347. package/dist/core/runners.d.ts +114 -0
  348. package/dist/core/runners.js +146 -0
  349. package/dist/core/runners.js.map +1 -0
  350. package/dist/core/sibling-reads.d.ts +41 -0
  351. package/dist/core/sibling-reads.js +100 -0
  352. package/dist/core/sibling-reads.js.map +1 -0
  353. package/dist/core/spec-format/blocks.d.ts +19 -0
  354. package/dist/core/spec-format/blocks.js +58 -0
  355. package/dist/core/spec-format/blocks.js.map +1 -0
  356. package/dist/core/spec-format/detect.d.ts +14 -0
  357. package/dist/core/spec-format/detect.js +30 -0
  358. package/dist/core/spec-format/detect.js.map +1 -0
  359. package/dist/core/spec-format/dispatch.d.ts +13 -0
  360. package/dist/core/spec-format/dispatch.js +64 -0
  361. package/dist/core/spec-format/dispatch.js.map +1 -0
  362. package/dist/core/spec-format/frontmatter.d.ts +18 -0
  363. package/dist/core/spec-format/frontmatter.js +37 -0
  364. package/dist/core/spec-format/frontmatter.js.map +1 -0
  365. package/dist/core/spec-format/legacy.d.ts +40 -0
  366. package/dist/core/spec-format/legacy.js +91 -0
  367. package/dist/core/spec-format/legacy.js.map +1 -0
  368. package/dist/core/spec-format/meta.d.ts +3 -0
  369. package/dist/core/spec-format/meta.js +24 -0
  370. package/dist/core/spec-format/meta.js.map +1 -0
  371. package/dist/core/spec-format/model.d.ts +50 -0
  372. package/dist/core/spec-format/model.js +9 -0
  373. package/dist/core/spec-format/model.js.map +1 -0
  374. package/dist/core/spec-format/read-spec.d.ts +4 -0
  375. package/dist/core/spec-format/read-spec.js +102 -0
  376. package/dist/core/spec-format/read-spec.js.map +1 -0
  377. package/dist/core/spec-format/read-tasks.d.ts +2 -0
  378. package/dist/core/spec-format/read-tasks.js +146 -0
  379. package/dist/core/spec-format/read-tasks.js.map +1 -0
  380. package/dist/core/spec-format/write.d.ts +23 -0
  381. package/dist/core/spec-format/write.js +382 -0
  382. package/dist/core/spec-format/write.js.map +1 -0
  383. package/dist/core/subagents.js +0 -2
  384. package/dist/core/subagents.js.map +1 -1
  385. package/dist/core/tasks-edit.d.ts +4 -1
  386. package/dist/core/tasks-edit.js +19 -6
  387. package/dist/core/tasks-edit.js.map +1 -1
  388. package/dist/core/types.d.ts +21 -0
  389. package/dist/emitters/index.d.ts +0 -4
  390. package/dist/emitters/index.js +0 -10
  391. package/dist/emitters/index.js.map +1 -1
  392. package/dist/index.d.ts +2 -2
  393. package/dist/index.js +2 -2
  394. package/dist/index.js.map +1 -1
  395. package/dist/plugins/api.d.ts +14 -8
  396. package/dist/plugins/api.js +9 -8
  397. package/dist/plugins/api.js.map +1 -1
  398. package/dist/plugins/index.d.ts +3 -2
  399. package/dist/plugins/index.js +3 -2
  400. package/dist/plugins/index.js.map +1 -1
  401. package/dist/plugins/loader.d.ts +8 -0
  402. package/dist/plugins/loader.js +36 -6
  403. package/dist/plugins/loader.js.map +1 -1
  404. package/dist/plugins/report.d.ts +1 -1
  405. package/dist/plugins/report.js +3 -4
  406. package/dist/plugins/report.js.map +1 -1
  407. package/dist/plugins/session.d.ts +1 -0
  408. package/dist/plugins/session.js +1 -1
  409. package/dist/plugins/session.js.map +1 -1
  410. package/dist/testkit/index.d.ts +1 -1
  411. package/docs/architecture.md +16 -1
  412. package/docs/artifacts/decision-record.md +15 -0
  413. package/docs/artifacts/spec.md +35 -6
  414. package/docs/artifacts/tasks.md +67 -16
  415. package/docs/cli-reference.md +274 -5
  416. package/docs/contributing.md +6 -0
  417. package/docs/migration.md +191 -0
  418. package/docs/plugin-api.md +21 -13
  419. package/docs/plugin-split.md +5 -3
  420. package/docs/plugin-trust.md +2 -2
  421. package/docs/plugins-release.md +105 -0
  422. package/docs/release.md +103 -0
  423. package/docs/stability.md +152 -0
  424. package/docs/tool-compatibility.md +41 -3
  425. package/docs/workflow.md +10 -6
  426. package/package.json +4 -2
  427. package/src/agents/worker.md +2 -1
  428. package/src/prompts/converge.md +2 -2
  429. package/src/prompts/implement.md +13 -11
  430. package/src/prompts/revise.md +5 -2
  431. package/src/prompts/run.md +7 -4
  432. package/src/prompts/specify.md +5 -3
  433. package/src/prompts/tasks.md +9 -8
  434. package/src/templates/spec.md +10 -4
  435. package/src/templates/tasks.md +35 -13
  436. package/dist/emitters/antigravity-cli.d.ts +0 -15
  437. package/dist/emitters/antigravity-cli.js +0 -20
  438. package/dist/emitters/antigravity-cli.js.map +0 -1
  439. package/dist/emitters/antigravity.d.ts +0 -20
  440. package/dist/emitters/antigravity.js +0 -24
  441. package/dist/emitters/antigravity.js.map +0 -1
@@ -0,0 +1,50 @@
1
+ import { type VerdictResult } from "./fleet/run-flow.js";
2
+ /**
3
+ * The review loop's state machine (feature 028, FR-018, SC-009). Pure: it takes where a lane is in the loop and
4
+ * what the last reviewer wrote, and says what happens next. The verdict contract is spec 019's
5
+ * (`verdicts/<lane>.<role>.<round>.json`, parsed by `parseVerdict`); the round limit is `fleet.roundLimit`.
6
+ * Order is QA first, then the architect; a failure from either goes back to the same lane's worker as finding
7
+ * IDs only, and after `limit` failed rounds the loop stops and asks a person.
8
+ */
9
+ export type Reviewer = "qa" | "architect";
10
+ export type ReviewStep =
11
+ /** The reviewer has not run this round: launch it. */
12
+ {
13
+ kind: "launch";
14
+ role: Reviewer;
15
+ round: number;
16
+ }
17
+ /** QA passed: the architect reviews next. */
18
+ | {
19
+ kind: "advance";
20
+ to: "architect";
21
+ }
22
+ /** Both passed: the lane may merge. */
23
+ | {
24
+ kind: "pass";
25
+ }
26
+ /** A failure under the limit: the worker fixes exactly these findings, then the next round starts at QA. */
27
+ | {
28
+ kind: "fix";
29
+ findings: string[];
30
+ failedRounds: number;
31
+ }
32
+ /** The loop ends here and a person decides. */
33
+ | {
34
+ kind: "escalate";
35
+ reason: string;
36
+ findings: string[];
37
+ failedRounds: number;
38
+ };
39
+ export interface ReviewInput {
40
+ stage: Reviewer;
41
+ round: number;
42
+ /** Rounds of this lane that already ended in a failure. */
43
+ failedRounds: number;
44
+ limit: number;
45
+ /** The reviewer's process for this round has finished. */
46
+ reviewerDone: boolean;
47
+ /** The parsed verdict file; `null` = no file. Ignored until `reviewerDone`. */
48
+ verdict: VerdictResult | null;
49
+ }
50
+ export declare function reviewStep(input: ReviewInput): ReviewStep;
@@ -0,0 +1,20 @@
1
+ import { nextRoundAction } from "./fleet/run-flow.js";
2
+ export function reviewStep(input) {
3
+ if (!input.reviewerDone)
4
+ return { kind: "launch", role: input.stage, round: input.round };
5
+ if (input.verdict === null) {
6
+ return { kind: "escalate", reason: `the ${input.stage} reviewer wrote no verdict for round ${input.round}`, findings: [], failedRounds: input.failedRounds };
7
+ }
8
+ if (!input.verdict.ok) {
9
+ return { kind: "escalate", reason: `the ${input.stage} verdict for round ${input.round} is invalid: ${input.verdict.error}`, findings: [], failedRounds: input.failedRounds };
10
+ }
11
+ if (input.verdict.verdict.verdict === "pass")
12
+ return input.stage === "qa" ? { kind: "advance", to: "architect" } : { kind: "pass" };
13
+ const failed = input.failedRounds + 1;
14
+ const ids = input.verdict.failingIds;
15
+ if (nextRoundAction(failed, input.limit) === "escalate") {
16
+ return { kind: "escalate", reason: `still failing after ${failed} review round${failed === 1 ? "" : "s"} (limit ${input.limit})`, findings: ids, failedRounds: failed };
17
+ }
18
+ return { kind: "fix", findings: ids, failedRounds: failed };
19
+ }
20
+ //# sourceMappingURL=run-review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-review.js","sourceRoot":"","sources":["../../src/core/run-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsB,MAAM,qBAAqB,CAAC;AAoC1E,MAAM,UAAU,UAAU,CAAC,KAAkB;IAC3C,IAAI,CAAC,KAAK,CAAC,YAAY;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAC1F,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,KAAK,CAAC,KAAK,wCAAwC,KAAK,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,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 028, FR-005). Pure: the total cap and the per-type cap come from
4
+ * `fleet.concurrency`; order is the queue's order, which is stable (phase, then lane index). A lane in `held`
5
+ * waits (an unfinished cross-story dependency, or a gate), and a lane whose assistant is at its per-type cap
6
+ * is skipped without blocking later lanes of another type.
7
+ */
8
+ export interface QueuedLane {
9
+ lane: string;
10
+ assistant: string;
11
+ }
12
+ export declare function nextToStart(queue: QueuedLane[], running: QueuedLane[], caps: {
13
+ total: number;
14
+ perType: number;
15
+ }, held?: ReadonlySet<string>): QueuedLane[];
16
+ /**
17
+ * Lanes held because a story they build has an unmet blocker in another feature (spec 023's graph). Within a
18
+ * feature the phase order already sequences work, so only cross-feature blockers hold a lane here.
19
+ */
20
+ export declare function heldByDependencies(graph: DependencyGraph, feature: string, lanes: {
21
+ lane: string;
22
+ stories: string[];
23
+ }[]): Set<string>;
@@ -0,0 +1,40 @@
1
+ import { blockersOf } from "./graph-paths.js";
2
+ export function nextToStart(queue, running, caps, held = new Set()) {
3
+ const perType = new Map();
4
+ for (const r of running)
5
+ perType.set(r.assistant, (perType.get(r.assistant) ?? 0) + 1);
6
+ let total = running.length;
7
+ const start = [];
8
+ for (const q of queue) {
9
+ if (total >= caps.total)
10
+ break;
11
+ if (held.has(q.lane))
12
+ continue;
13
+ const n = perType.get(q.assistant) ?? 0;
14
+ if (n >= caps.perType)
15
+ continue;
16
+ start.push(q);
17
+ perType.set(q.assistant, n + 1);
18
+ total += 1;
19
+ }
20
+ return start;
21
+ }
22
+ /**
23
+ * Lanes held because a story they build has an unmet blocker in another feature (spec 023's graph). Within a
24
+ * feature the phase order already sequences work, so only cross-feature blockers hold a lane here.
25
+ */
26
+ export function heldByDependencies(graph, feature, lanes) {
27
+ const held = new Set();
28
+ for (const l of lanes) {
29
+ for (const story of l.stories) {
30
+ const key = `${feature}:${story}`;
31
+ const crossFeature = blockersOf(graph, key).some((b) => !b.key.startsWith(`${feature}:`));
32
+ if (crossFeature) {
33
+ held.add(l.lane);
34
+ break;
35
+ }
36
+ }
37
+ }
38
+ return held;
39
+ }
40
+ //# sourceMappingURL=run-schedule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-schedule.js","sourceRoot":"","sources":["../../src/core/run-schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAa9C,MAAM,UAAU,WAAW,CACzB,KAAmB,EACnB,OAAqB,EACrB,IAAwC,EACxC,IAAI,GAAwB,IAAI,GAAG,EAAE;IAErC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACvF,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3B,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK;YAAE,MAAM;QAC/B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,SAAS;QAC/B,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;YAAE,SAAS;QAChC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAsB,EACtB,OAAe,EACf,KAA4C;IAE5C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,KAAK,EAAE,CAAC;YAClC,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC;YAC1F,IAAI,YAAY,EAAE,CAAC;gBACjB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBACjB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * One place that says whether `ambykit run` is experimental or stable (feature 033, FR-006). Every label, banner and `experimental`
3
+ * JSON flag reads this constant; nothing else spells "(experimental)". It becomes `"stable"` only after one fleet has built two
4
+ * dependent features of this repository with a verified runner and the record exists (`specs/033-stable-run-and-plugin-api/dogfood.md`).
5
+ * A test refuses `"stable"` without that record, so the label cannot over-promise (Principle 6).
6
+ */
7
+ export type RunStability = "experimental" | "stable";
8
+ /** Stable from 2.0: the dogfood is recorded and passed (033 T071, fleet-2 built 039 → 040) and the owner flipped it (T072). */
9
+ export declare const RUN_STABILITY: RunStability;
10
+ export declare function isExperimental(stability?: RunStability): boolean;
11
+ /** `(experimental)` while experimental, an empty string once stable, so `${label}` can be dropped into a sentence. */
12
+ export declare function stabilityLabel(stability?: RunStability): string;
13
+ /** `text` with the label appended (`Run plan (experimental)`), or just `text` when stable. */
14
+ export declare function withStability(text: string, stability?: RunStability): string;
15
+ /**
16
+ * Feature 033 (FR-006): what `dogfood.md` must record before `RUN_STABILITY` may be `"stable"`. The dogfood is one fleet that built two
17
+ * dependent features of this repository with a verified runner (031 T094). Each line is `- **Label:** value`; the result must be `passed`.
18
+ * Returns what is missing, so a test can say exactly what to record.
19
+ */
20
+ export declare const DOGFOOD_FIELDS: readonly ["Fleet run id", "Runner", "Versions", "Features", "Result"];
21
+ export declare function dogfoodProblems(text: string | undefined): string[];
22
+ /** Why `stability` may not be `"stable"` yet: empty while experimental, or when the dogfood is recorded and passed. */
23
+ export declare function stabilityProblems(stability: RunStability, dogfoodText: string | undefined): string[];
@@ -0,0 +1,38 @@
1
+ /** Stable from 2.0: the dogfood is recorded and passed (033 T071, fleet-2 built 039 → 040) and the owner flipped it (T072). */
2
+ export const RUN_STABILITY = "stable";
3
+ export function isExperimental(stability = RUN_STABILITY) {
4
+ return stability === "experimental";
5
+ }
6
+ /** `(experimental)` while experimental, an empty string once stable, so `${label}` can be dropped into a sentence. */
7
+ export function stabilityLabel(stability = RUN_STABILITY) {
8
+ return isExperimental(stability) ? "(experimental)" : "";
9
+ }
10
+ /** `text` with the label appended (`Run plan (experimental)`), or just `text` when stable. */
11
+ export function withStability(text, stability = RUN_STABILITY) {
12
+ const label = stabilityLabel(stability);
13
+ return label === "" ? text : `${text} ${label}`;
14
+ }
15
+ /**
16
+ * Feature 033 (FR-006): what `dogfood.md` must record before `RUN_STABILITY` may be `"stable"`. The dogfood is one fleet that built two
17
+ * dependent features of this repository with a verified runner (031 T094). Each line is `- **Label:** value`; the result must be `passed`.
18
+ * Returns what is missing, so a test can say exactly what to record.
19
+ */
20
+ export const DOGFOOD_FIELDS = ["Fleet run id", "Runner", "Versions", "Features", "Result"];
21
+ export function dogfoodProblems(text) {
22
+ if (text === undefined)
23
+ return ["specs/033-stable-run-and-plugin-api/dogfood.md does not exist"];
24
+ const problems = [];
25
+ for (const field of DOGFOOD_FIELDS) {
26
+ const m = new RegExp("^\\s*[-*]\\s*\\*\\*" + field + ":\\*\\*[ \\t]*(.*)$", "mi").exec(text);
27
+ if (!m || m[1].trim() === "")
28
+ problems.push(`dogfood.md records no '${field}'`);
29
+ else if (field === "Result" && !/^passed\b/i.test(m[1].trim()))
30
+ problems.push(`dogfood.md records the result '${m[1].trim()}', not 'passed'`);
31
+ }
32
+ return problems;
33
+ }
34
+ /** Why `stability` may not be `"stable"` yet: empty while experimental, or when the dogfood is recorded and passed. */
35
+ export function stabilityProblems(stability, dogfoodText) {
36
+ return stability === "stable" ? dogfoodProblems(dogfoodText) : [];
37
+ }
38
+ //# sourceMappingURL=run-stability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-stability.js","sourceRoot":"","sources":["../../src/core/run-stability.ts"],"names":[],"mappings":"AAQA,+HAA+H;AAC/H,MAAM,CAAC,MAAM,aAAa,GAAG,QAAwB,CAAC;AAEtD,MAAM,UAAU,cAAc,CAAC,SAAS,GAAiB,aAAa;IACpE,OAAO,SAAS,KAAK,cAAc,CAAC;AACtC,CAAC;AAED,sHAAsH;AACtH,MAAM,UAAU,cAAc,CAAC,SAAS,GAAiB,aAAa;IACpE,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,SAAS,GAAiB,aAAa;IACjF,MAAM,KAAK,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AAEpG,MAAM,UAAU,eAAe,CAAC,IAAwB;IACtD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,+DAA+D,CAAC,CAAC;IACjG,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,qBAAqB,GAAG,KAAK,GAAG,qBAAqB,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7F,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,KAAK,EAAE;YAAE,QAAQ,CAAC,IAAI,CAAC,0BAA0B,KAAK,GAAG,CAAC,CAAC;aAC5E,IAAI,KAAK,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAClJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,uHAAuH;AACvH,MAAM,UAAU,iBAAiB,CAAC,SAAuB,EAAE,WAA+B;IACxF,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpE,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Pure supervision rules (feature 028, FR-008..FR-010, FR-013, FR-014). Each takes a snapshot and returns a
3
+ * decision; none touches a process, a file or the clock. *Whether a lane is stalled* is spec 025's
4
+ * `laneStatus` (waiting, blocked, paused and done lanes are exempt there); 028 only decides what to do about it.
5
+ */
6
+ export type RestartDecision = "none" | "restart" | "pause";
7
+ /** A stalled lane restarts until `limit` restarts are used; the next stall pauses it for a person (FR-009). */
8
+ export declare function restartDecision(input: {
9
+ stalled: boolean;
10
+ restarts: number;
11
+ limit: number;
12
+ }): RestartDecision;
13
+ /** A person's approval to move a lane to another assistant, recorded in `run.json` `approvals[]`. */
14
+ export interface ReassignApproval {
15
+ kind: "reassign";
16
+ lane: string;
17
+ to: string;
18
+ at: string;
19
+ }
20
+ export type ReassignDecision = {
21
+ allowed: true;
22
+ } | {
23
+ allowed: false;
24
+ reason: string;
25
+ };
26
+ /** FR-009: a lane moves to a different assistant only with that person's approval; never on its own. */
27
+ export declare function reassignGate(approvals: unknown[], lane: string, to: string): ReassignDecision;
28
+ export interface Budgets {
29
+ /** Minutes the run may take. Always enforced. */
30
+ wallClockMinutes: number;
31
+ /** Task events (check-offs plus restarts and fix rounds) the run may use. Always enforced. */
32
+ maxTasks: number;
33
+ /** Tokens, enforced only where every runner in the run reports usage. */
34
+ maxTokens?: number;
35
+ }
36
+ export declare const DEFAULT_WALL_CLOCK_MINUTES = 120;
37
+ /** Defaults: 120 minutes, and twice the open tasks of the prepared lanes (room for rework). Config, then flags. */
38
+ export declare function resolveBudgets(input: {
39
+ openTasks: number;
40
+ config?: Record<string, number>;
41
+ flags?: Partial<Budgets>;
42
+ }): Budgets;
43
+ export interface BudgetSnapshot {
44
+ elapsedMs: number;
45
+ tasksUsed: number;
46
+ tokensUsed?: number;
47
+ /** True when every runner of the run reports usage. */
48
+ reportsUsage: boolean;
49
+ }
50
+ export interface BudgetDecision {
51
+ exceeded: boolean;
52
+ /** Why the run must stop; recorded in the run state. */
53
+ reason?: string;
54
+ /** Budgets that are set but cannot be enforced, stated at start and when exceeded (FR-013). */
55
+ unenforced: string[];
56
+ }
57
+ export declare function budgetDecision(budgets: Budgets, snap: BudgetSnapshot): BudgetDecision;
58
+ /** After a stop or budget directive: terminate a lane that has not reported for the stop grace (FR-014). */
59
+ export declare function mustTerminate(input: {
60
+ stopRequestedAt: number;
61
+ lastReportAt: number | null;
62
+ now: number;
63
+ graceMinutes: number;
64
+ }): boolean;
65
+ /** A verified runner that exits non-zero within this many seconds of starting is a command/version mismatch. */
66
+ export declare const FAST_FAILURE_SECONDS = 15;
67
+ /** True when a lane's process died at once with an error: the runner's recorded command no longer works. */
68
+ export declare function isImmediateFailure(input: {
69
+ code: number | null;
70
+ ranMs: number;
71
+ }): boolean;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Pure supervision rules (feature 028, FR-008..FR-010, FR-013, FR-014). Each takes a snapshot and returns a
3
+ * decision; none touches a process, a file or the clock. *Whether a lane is stalled* is spec 025's
4
+ * `laneStatus` (waiting, blocked, paused and done lanes are exempt there); 028 only decides what to do about it.
5
+ */
6
+ /** A stalled lane restarts until `limit` restarts are used; the next stall pauses it for a person (FR-009). */
7
+ export function restartDecision(input) {
8
+ if (!input.stalled)
9
+ return "none";
10
+ return input.restarts < input.limit ? "restart" : "pause";
11
+ }
12
+ /** FR-009: a lane moves to a different assistant only with that person's approval; never on its own. */
13
+ export function reassignGate(approvals, lane, to) {
14
+ const ok = approvals.some((a) => {
15
+ const r = a;
16
+ return !!r && r.kind === "reassign" && r.lane === lane && r.to === to;
17
+ });
18
+ return ok ? { allowed: true } : { allowed: false, reason: `moving ${lane} to ${to} needs a person's approval; none is recorded` };
19
+ }
20
+ export const DEFAULT_WALL_CLOCK_MINUTES = 120;
21
+ /** Defaults: 120 minutes, and twice the open tasks of the prepared lanes (room for rework). Config, then flags. */
22
+ export function resolveBudgets(input) {
23
+ const c = input.config ?? {};
24
+ const f = input.flags ?? {};
25
+ const out = {
26
+ wallClockMinutes: f.wallClockMinutes ?? c["wallClockMinutes"] ?? DEFAULT_WALL_CLOCK_MINUTES,
27
+ maxTasks: f.maxTasks ?? c["maxTasks"] ?? Math.max(1, input.openTasks * 2),
28
+ };
29
+ const tokens = f.maxTokens ?? c["maxTokens"];
30
+ if (tokens !== undefined)
31
+ out.maxTokens = tokens;
32
+ return out;
33
+ }
34
+ export function budgetDecision(budgets, snap) {
35
+ const unenforced = [];
36
+ if (budgets.maxTokens !== undefined && !snap.reportsUsage)
37
+ unenforced.push("token ceiling not enforceable for this runner (it does not report usage)");
38
+ if (snap.elapsedMs > budgets.wallClockMinutes * 60_000) {
39
+ return { exceeded: true, reason: `wall-clock budget of ${budgets.wallClockMinutes} minutes exceeded`, unenforced };
40
+ }
41
+ if (snap.tasksUsed > budgets.maxTasks) {
42
+ return { exceeded: true, reason: `task budget of ${budgets.maxTasks} exceeded (${snap.tasksUsed} used)`, unenforced };
43
+ }
44
+ if (budgets.maxTokens !== undefined && snap.reportsUsage && (snap.tokensUsed ?? 0) > budgets.maxTokens) {
45
+ return { exceeded: true, reason: `token ceiling of ${budgets.maxTokens} exceeded (${snap.tokensUsed} used)`, unenforced };
46
+ }
47
+ return { exceeded: false, unenforced };
48
+ }
49
+ /** After a stop or budget directive: terminate a lane that has not reported for the stop grace (FR-014). */
50
+ export function mustTerminate(input) {
51
+ const last = Math.max(input.stopRequestedAt, input.lastReportAt ?? 0);
52
+ return input.now - last > input.graceMinutes * 60_000;
53
+ }
54
+ // --- immediate failure (US-3 AC3) ---------------------------------------------------------
55
+ /** A verified runner that exits non-zero within this many seconds of starting is a command/version mismatch. */
56
+ export const FAST_FAILURE_SECONDS = 15;
57
+ /** True when a lane's process died at once with an error: the runner's recorded command no longer works. */
58
+ export function isImmediateFailure(input) {
59
+ return input.code !== 0 && input.ranMs < FAST_FAILURE_SECONDS * 1000;
60
+ }
61
+ //# sourceMappingURL=run-supervise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-supervise.js","sourceRoot":"","sources":["../../src/core/run-supervise.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,+GAA+G;AAC/G,MAAM,UAAU,eAAe,CAAC,KAA4D;IAC1F,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC;IAClC,OAAO,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5D,CAAC;AAYD,wGAAwG;AACxG,MAAM,UAAU,YAAY,CAAC,SAAoB,EAAE,IAAY,EAAE,EAAU;IACzE,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI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4GAA4G;AAC5G,MAAM,UAAU,kBAAkB,CAAC,KAA6C;IAC9E,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,oBAAoB,GAAG,IAAI,CAAC;AACvE,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Headless runner registry (feature 028, FR-006, FR-007). A runner is *data*: the command that runs one
3
+ * assistant non-interactively, how its exit reads and whether it reports token usage. Every entry starts
4
+ * `verified: false`; a runner becomes runnable only after its command has run a real lane task on a live
5
+ * install (T044, T045), and the matrix in `docs/tool-compatibility.md` carries the same rows (a doc-sync test
6
+ * keeps them equal). `runnable()` is the single chokepoint before any process is spawned (SC-006, Principle 4).
7
+ */
8
+ import { type RunnerResult } from "./run-result.js";
9
+ export interface RunnerJob {
10
+ /** The full prompt text (IDs, `@` references, ownership). */
11
+ prompt: string;
12
+ /** The same prompt as a file under the run directory, for runners that take a file reference. */
13
+ promptFile: string;
14
+ model?: string;
15
+ /** Shell commands the job may run besides `ambykit` (`fleet.allowedCommands`); absent = the defaults. */
16
+ allowedCommands?: readonly string[];
17
+ /** Directories outside the job's working directory it must write to (a reviewer's verdict file in the run directory). */
18
+ addDirs?: readonly string[];
19
+ }
20
+ export interface RunnerCommand {
21
+ exe: string;
22
+ args: string[];
23
+ /** Text written to the process's stdin; absent when the prompt is passed another way. */
24
+ stdin?: string;
25
+ }
26
+ export interface RunnerSpec {
27
+ /** Matches the assistant's id in `config.tools`. */
28
+ id: string;
29
+ label: string;
30
+ executable: string;
31
+ invoke(job: RunnerJob): RunnerCommand;
32
+ /** How the process's exit is read, in words (recorded in the matrix). */
33
+ exit: string;
34
+ /** Whether the process reports token usage, so a token ceiling can be enforced. */
35
+ reportsUsage: boolean;
36
+ /**
37
+ * Reads the process's captured stdout once it exits: usage and the signs of a failed turn. Absent for a runner whose
38
+ * output is not read (its exit code and the task list decide, as in 1.6); `undefined` from it means the same.
39
+ */
40
+ readResult?: (stdout: string) => RunnerResult | undefined;
41
+ verified: boolean;
42
+ /** The CLI version the command was verified against; present only when `verified`. */
43
+ verifiedVersion?: string;
44
+ /**
45
+ * Feature 033 (FR-004, C-3): the operating systems the live check was recorded on. A verified runner is runnable only
46
+ * there. Absent on a runner written for 1.6, which carried no platform list (no platform restriction is applied).
47
+ */
48
+ verifiedOn?: NodeJS.Platform[];
49
+ /** Feature 033: the assistant versions the record covers, as a semver range; a detected version outside it is unverified. */
50
+ verifiedRange?: string;
51
+ /** What is still to confirm on a live install. */
52
+ toVerify: string;
53
+ }
54
+ /**
55
+ * The Claude Code command (live check on Windows, claude 2.1.332): plain `claude -p` exits 0 having done nothing, because
56
+ * every edit and shell command needs an approval nobody can give headless. `acceptEdits` allows file edits; the allowed
57
+ * tools add only `ambykit` itself (the lane's status reports), on both shell tools Claude Code may pick (Bash, and
58
+ * PowerShell on Windows); everything else stays denied. `--output-format json` ends the run with one JSON result that
59
+ * carries usage, `is_error`, `subtype` and `permission_denials` (read by `src/core/run-result.ts`).
60
+ */
61
+ export declare const DEFAULT_ALLOWED_COMMANDS: readonly string[];
62
+ /**
63
+ * The `--allowedTools` value: `ambykit` plus each allowed command, as a prefix rule on both shell tools. One
64
+ * comma-separated argument, so the multi-value flag cannot absorb the arguments after it.
65
+ */
66
+ export declare function claudeAllowedTools(commands?: readonly string[]): string;
67
+ /** The 1.6-to-2.0 value with no extra commands, kept for callers that need only the status reports. */
68
+ export declare const CLAUDE_ALLOWED_TOOLS: string;
69
+ export declare const RUNNERS: RunnerSpec[];
70
+ /**
71
+ * The Codex command (033 T064, live check on Windows, codex-cli 0.174.0). Plain `codex exec -` exits 0 having done nothing: its
72
+ * default sandbox is read-only and every write or command asks for an approval nobody can give headless. `workspace-write`
73
+ * lets the lane write inside its directory (plus each `--add-dir`, and the temp folders) and nowhere else; `approval_policy=
74
+ * "never"` returns a refused command to the model instead of waiting. On Windows the `elevated` sandbox (a common saved
75
+ * setting) waited headless with no event for over ten minutes, so the restricted-token `unelevated` sandbox is used; it
76
+ * denied a write outside the lane in the check. The key is read only on Windows, so passing it everywhere keeps one command
77
+ * (and one row in the matrix). There is no per-command allow list: `fleet.allowedCommands` is named in the prompt, and the
78
+ * sandbox is what is enforced. `--json` ends the turn with `turn.completed` (usage) or `turn.failed`.
79
+ */
80
+ export declare function codexArgs(job: RunnerJob): string[];
81
+ export declare function runnerFor(id: string): RunnerSpec | undefined;
82
+ export type Runnable = {
83
+ ok: true;
84
+ runner: RunnerSpec;
85
+ } | {
86
+ ok: false;
87
+ reason: string;
88
+ };
89
+ /** Where a runner would run: the operating system (default: this one) and, when known, the assistant's version. */
90
+ export interface RunnerEnv {
91
+ platform?: NodeJS.Platform;
92
+ version?: string;
93
+ }
94
+ /**
95
+ * FR-006: only a verified runner is runnable; the reason says exactly why a refused one is not. Feature 033 (FR-004, FR-005):
96
+ * a verified runner is also refused on a platform its record does not list, and for a known version outside its recorded range,
97
+ * and the reason names which. The second argument is the registry (tests) or the environment; a version is checked only when given.
98
+ */
99
+ export declare function runnable(id: string, registryOrEnv?: RunnerSpec[] | RunnerEnv, env?: RunnerEnv): Runnable;
100
+ export interface RunnerListing {
101
+ id: string;
102
+ label: string;
103
+ verified: boolean;
104
+ verifiedVersion?: string;
105
+ /** Feature 033: where and for which versions the live check was recorded. */
106
+ verifiedOn?: NodeJS.Platform[];
107
+ verifiedRange?: string;
108
+ reportsUsage: boolean;
109
+ runnable: boolean;
110
+ /** Present when not runnable. */
111
+ reason?: string;
112
+ }
113
+ /** FR-007: the runners with their capabilities, for `ambykit run --runners`. */
114
+ export declare function listRunners(registry?: RunnerSpec[], env?: RunnerEnv): RunnerListing[];
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Headless runner registry (feature 028, FR-006, FR-007). A runner is *data*: the command that runs one
3
+ * assistant non-interactively, how its exit reads and whether it reports token usage. Every entry starts
4
+ * `verified: false`; a runner becomes runnable only after its command has run a real lane task on a live
5
+ * install (T044, T045), and the matrix in `docs/tool-compatibility.md` carries the same rows (a doc-sync test
6
+ * keeps them equal). `runnable()` is the single chokepoint before any process is spawned (SC-006, Principle 4).
7
+ */
8
+ import { satisfies } from "../plugins/semver.js";
9
+ import { parseClaudeResult, parseCodexResult } from "./run-result.js";
10
+ /**
11
+ * The Claude Code command (live check on Windows, claude 2.1.332): plain `claude -p` exits 0 having done nothing, because
12
+ * every edit and shell command needs an approval nobody can give headless. `acceptEdits` allows file edits; the allowed
13
+ * tools add only `ambykit` itself (the lane's status reports), on both shell tools Claude Code may pick (Bash, and
14
+ * PowerShell on Windows); everything else stays denied. `--output-format json` ends the run with one JSON result that
15
+ * carries usage, `is_error`, `subtype` and `permission_denials` (read by `src/core/run-result.ts`).
16
+ */
17
+ export const DEFAULT_ALLOWED_COMMANDS = ["npm test", "npx vitest", "npm run typecheck"];
18
+ /**
19
+ * The `--allowedTools` value: `ambykit` plus each allowed command, as a prefix rule on both shell tools. One
20
+ * comma-separated argument, so the multi-value flag cannot absorb the arguments after it.
21
+ */
22
+ export function claudeAllowedTools(commands = DEFAULT_ALLOWED_COMMANDS) {
23
+ const all = ["ambykit", ...commands.map((c) => c.trim()).filter((c) => c.length > 0 && c !== "ambykit")];
24
+ return all.flatMap((c) => [`Bash(${c}:*)`, `PowerShell(${c}:*)`]).join(",");
25
+ }
26
+ /** The 1.6-to-2.0 value with no extra commands, kept for callers that need only the status reports. */
27
+ export const CLAUDE_ALLOWED_TOOLS = claudeAllowedTools([]);
28
+ export const RUNNERS = [
29
+ {
30
+ id: "claude",
31
+ label: "Claude Code",
32
+ executable: "claude",
33
+ invoke: (job) => ({
34
+ exe: "claude",
35
+ args: [
36
+ "-p",
37
+ "--permission-mode",
38
+ "acceptEdits",
39
+ "--allowedTools",
40
+ claudeAllowedTools(job.allowedCommands),
41
+ "--output-format",
42
+ "json",
43
+ ...(job.addDirs ?? []).flatMap((d) => ["--add-dir", d]),
44
+ ...(job.model ? ["--model", job.model] : []),
45
+ ],
46
+ stdin: job.prompt,
47
+ }),
48
+ exit: "0 = finished its turn; non-zero, an error result or refused tools with tasks left open = failed",
49
+ reportsUsage: true,
50
+ readResult: parseClaudeResult,
51
+ // 033 T063: live check on Windows, signed off by the owner 2026-11-25 (specs/033-stable-run-and-plugin-api/verification/claude-windows.md).
52
+ verified: true,
53
+ verifiedVersion: "2.1.332",
54
+ verifiedOn: ["win32"],
55
+ verifiedRange: ">=2.1.332 <3.0.0",
56
+ toVerify: "the permission flags let a lane edit its files and run `ambykit activity` (Bash and PowerShell), the JSON result's usage and failure fields, a failed turn's exit code",
57
+ },
58
+ {
59
+ id: "codex",
60
+ label: "Codex",
61
+ executable: "codex",
62
+ invoke: (job) => ({ exe: "codex", args: codexArgs(job), stdin: job.prompt }),
63
+ exit: "0 = finished its turn; non-zero or a `turn.failed` event = failed",
64
+ reportsUsage: true,
65
+ readResult: parseCodexResult,
66
+ // 033 T064: live check on Windows (specs/033-stable-run-and-plugin-api/verification/codex-windows.md). Not verified: the only
67
+ // Windows sandbox that runs headless (`unelevated`) blocks child processes, so a lane cannot run `npm test`, `npx vitest` or
68
+ // `node --test`, and QA fails every phase whose Verify line runs tests (owner decision 2026-12-05).
69
+ verified: false,
70
+ toVerify: "a Windows sandbox mode that runs headless and lets a lane start child processes (test runners), on the command and result reading recorded in verification/codex-windows.md",
71
+ },
72
+ ];
73
+ /**
74
+ * The Codex command (033 T064, live check on Windows, codex-cli 0.174.0). Plain `codex exec -` exits 0 having done nothing: its
75
+ * default sandbox is read-only and every write or command asks for an approval nobody can give headless. `workspace-write`
76
+ * lets the lane write inside its directory (plus each `--add-dir`, and the temp folders) and nowhere else; `approval_policy=
77
+ * "never"` returns a refused command to the model instead of waiting. On Windows the `elevated` sandbox (a common saved
78
+ * setting) waited headless with no event for over ten minutes, so the restricted-token `unelevated` sandbox is used; it
79
+ * denied a write outside the lane in the check. The key is read only on Windows, so passing it everywhere keeps one command
80
+ * (and one row in the matrix). There is no per-command allow list: `fleet.allowedCommands` is named in the prompt, and the
81
+ * sandbox is what is enforced. `--json` ends the turn with `turn.completed` (usage) or `turn.failed`.
82
+ */
83
+ export function codexArgs(job) {
84
+ return [
85
+ "exec",
86
+ "--sandbox",
87
+ "workspace-write",
88
+ "-c",
89
+ 'approval_policy="never"',
90
+ "-c",
91
+ 'windows.sandbox="unelevated"',
92
+ "--json",
93
+ ...(job.addDirs ?? []).flatMap((d) => ["--add-dir", d]),
94
+ ...(job.model ? ["--model", job.model] : []),
95
+ "-",
96
+ ];
97
+ }
98
+ export function runnerFor(id) {
99
+ return RUNNERS.find((r) => r.id === id);
100
+ }
101
+ /**
102
+ * FR-006: only a verified runner is runnable; the reason says exactly why a refused one is not. Feature 033 (FR-004, FR-005):
103
+ * a verified runner is also refused on a platform its record does not list, and for a known version outside its recorded range,
104
+ * and the reason names which. The second argument is the registry (tests) or the environment; a version is checked only when given.
105
+ */
106
+ export function runnable(id, registryOrEnv, env) {
107
+ const registry = Array.isArray(registryOrEnv) ? registryOrEnv : RUNNERS;
108
+ const where = (Array.isArray(registryOrEnv) ? env : registryOrEnv) ?? {};
109
+ const platform = where.platform ?? process.platform;
110
+ const runner = registry.find((r) => r.id === id);
111
+ if (!runner) {
112
+ const ok = registry.filter((r) => r.verified).map((r) => r.id);
113
+ return { ok: false, reason: `no headless runner is recorded for '${id}'; runnable assistants: ${ok.join(", ") || "none yet"}` };
114
+ }
115
+ if (!runner.verified) {
116
+ return { ok: false, reason: `the ${runner.label} runner is not verified yet (to confirm on a live install: ${runner.toVerify}); see docs/tool-compatibility.md` };
117
+ }
118
+ if (runner.verifiedOn && !runner.verifiedOn.includes(platform)) {
119
+ return { ok: false, reason: `the ${runner.label} runner is unverified on this platform (${platform}); it was verified on ${runner.verifiedOn.join(", ")}` };
120
+ }
121
+ if (runner.verifiedRange && where.version !== undefined) {
122
+ const inRange = satisfies(where.version, runner.verifiedRange);
123
+ if (!inRange.supported || !inRange.satisfied) {
124
+ return { ok: false, reason: `the ${runner.label} runner is unverified for version ${where.version}; it was verified for ${runner.verifiedRange}` };
125
+ }
126
+ }
127
+ return { ok: true, runner };
128
+ }
129
+ /** FR-007: the runners with their capabilities, for `ambykit run --runners`. */
130
+ export function listRunners(registry = RUNNERS, env = {}) {
131
+ return registry.map((r) => {
132
+ const can = runnable(r.id, registry, env);
133
+ return {
134
+ id: r.id,
135
+ label: r.label,
136
+ verified: r.verified,
137
+ ...(r.verifiedVersion ? { verifiedVersion: r.verifiedVersion } : {}),
138
+ ...(r.verifiedOn ? { verifiedOn: r.verifiedOn } : {}),
139
+ ...(r.verifiedRange ? { verifiedRange: r.verifiedRange } : {}),
140
+ reportsUsage: r.reportsUsage,
141
+ runnable: can.ok,
142
+ ...(can.ok ? {} : { reason: can.reason }),
143
+ };
144
+ });
145
+ }
146
+ //# sourceMappingURL=runners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runners.js","sourceRoot":"","sources":["../../src/core/runners.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAqB,MAAM,iBAAiB,CAAC;AAkDzF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CAAC,UAAU,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;AAE3G;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAQ,GAAsB,wBAAwB;IACvF,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;IACzG,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC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