@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
@@ -1,5 +1,11 @@
1
1
  import { applyFilters, computeOverview } from "../../../core/overview.js";
2
+ import { header } from "../dashboard/cards.js";
2
3
  import { emptyState, noMatchLine } from "../dashboard/empty-state.js";
4
+ import { currentFleet, featureRunView, filterLanes, groupCounts, groupRows, isGrouped } from "../../../core/fleet-view/group.js";
5
+ import { renderMetricsPanel } from "../dashboard/metrics-panel.js";
6
+ import { fitBodyToRows, noMatchBody, renderFilterLine, renderTabFrame, tabEmptyBody } from "../dashboard/tab-frame.js";
7
+ import { layoutMode, tabLayout } from "../dashboard/layout.js";
8
+ import { applyListFilter } from "./list-filter.js";
3
9
  import { renderQualityView } from "../dashboard/quality-view.js";
4
10
  import { renderHelp } from "../dashboard/help-overlay.js";
5
11
  import { liveIndicator } from "../dashboard/live-indicator.js";
@@ -9,6 +15,7 @@ import { DETAIL_MAX_TASKS, maxScroll, renderStoryDetail } from "../dashboard/sto
9
15
  import { TOKENS } from "../dashboard/tokens.js";
10
16
  import { worktreeItems } from "../dashboard/worktrees-panel.js";
11
17
  import { paintToken } from "../theme.js";
18
+ import { tabForKey } from "./tabs.js";
12
19
  const PANELS = 4;
13
20
  const STATUS_CYCLE = [undefined, "draft", "ready", "in-progress", "blocked", "done", "deferred"];
14
21
  const NO_CURSORS = [0, 0, 0, 0];
@@ -22,6 +29,8 @@ export function initOverviewTui(filters = {}) {
22
29
  feature: null,
23
30
  story: null,
24
31
  graph: null,
32
+ fleet: null,
33
+ fleetGroup: null,
25
34
  help: false,
26
35
  quality: false,
27
36
  burndownReady: false,
@@ -136,8 +145,17 @@ export function applyData(state, prev, next) {
136
145
  changed: changedFeatures(prev.features, next.features),
137
146
  changedTasks: checkedTasks(prev.features, next.features),
138
147
  };
148
+ if (state.view === "fleet" && state.fleet && next.fleetView) {
149
+ const entry = next.tabs ? currentFleet(next.fleets) : null;
150
+ if (state.fleetGroup && isGrouped(entry)) {
151
+ const n = groupRows(entry, state.fleetGroup.collapsed, groupFilterOf(state)).length;
152
+ return { ...out, fleetGroup: { ...state.fleetGroup, cursor: Math.max(0, Math.min(state.fleetGroup.cursor, n - 1)) } };
153
+ }
154
+ const view = visibleFleet(next, state);
155
+ return { ...out, fleet: next.fleetView.clamp(view, state.fleet, next.fleetView.windowRows(next.rows ?? 24, view)) };
156
+ }
139
157
  if (state.view === "graph" && state.graph) {
140
- const n = next.graphView?.build(next.features).rows.length ?? 0;
158
+ const n = next.graphView ? graphModelFor(next, state).rows.length : 0;
141
159
  return { ...out, graph: { cursor: Math.max(0, Math.min(state.graph.cursor, n - 1)) } };
142
160
  }
143
161
  if (state.view !== "feature" || !state.feature)
@@ -158,19 +176,50 @@ export function reduceOverviewTui(data, state, key) {
158
176
  return { ...state, help: false }; // any key closes help and is not passed on
159
177
  if (state.input !== null)
160
178
  return reduceInput(state, key);
179
+ // An open Fleet confirmation owns the next key (even `?`), so a stray key can only cancel it (029 FR-008).
180
+ if (state.view === "fleet" && state.fleet?.confirm)
181
+ return reduceFleetView(data, state, key);
182
+ // Feature 032 (FR-004): `1`-`4`, `]` and `[` switch tabs from any screen; anything else is not a tab key.
183
+ const target = key.ctrl ? null : tabForKey(tabOf(state), key);
184
+ if (target)
185
+ return selectTab(data, state, target);
186
+ // Tab mode (feature 032): the quality tab is a tab like the others (help, the shared filter, esc to go back); a key that
187
+ // means nothing here changes nothing (FR-004). Without tab mode the quality view keeps its 024 behaviour: any key leaves it.
188
+ if (data.tabs && state.quality) {
189
+ if (key.name === "q")
190
+ return { ...state, done: true };
191
+ if (key.sequence === "?")
192
+ return { ...state, help: true };
193
+ const shared = reduceSharedFilter(state, key);
194
+ if (shared)
195
+ return shared;
196
+ return key.name === "escape" ? { ...state, quality: false } : state;
197
+ }
161
198
  if (state.quality)
162
199
  return key.name === "q" ? { ...state, done: true } : { ...state, quality: false };
163
200
  if (key.sequence === "?")
164
201
  return { ...state, help: true };
202
+ if (data.tabs && (state.view === "fleet" || state.view === "graph")) {
203
+ const shared = reduceSharedFilter(state, key);
204
+ if (shared)
205
+ return shared;
206
+ }
207
+ if (state.view === "fleet")
208
+ return reduceFleetView(data, state, key);
165
209
  if (state.view === "feature")
166
210
  return reduceFeature(data, state, key);
167
211
  if (state.view === "graph")
168
212
  return reduceGraph(data, state, key);
213
+ // `/` opens a free-text search over feature names and numbers (feature 032, US-3); `f` keeps the exact feature filter.
214
+ if (key.sequence === "/")
215
+ return { ...state, input: state.filters.search ?? "", searching: true };
169
216
  switch (key.name) {
170
217
  case "q":
171
218
  return { ...state, done: true };
172
219
  case "g":
173
220
  return data.graphView ? { ...state, view: "graph", graph: { cursor: 0 } } : state;
221
+ case "l":
222
+ return data.fleetView ? { ...state, view: "fleet", ...enterFleet(data) } : state;
174
223
  case "tab": {
175
224
  const step = key.shift ? PANELS - 1 : 1;
176
225
  return { ...state, focus: ((state.focus + step) % PANELS) };
@@ -188,11 +237,11 @@ export function reduceOverviewTui(data, state, key) {
188
237
  case "enter":
189
238
  return openSelected(data, state);
190
239
  case "escape":
191
- return state.filters.feature || state.filters.status ? { ...state, filters: {}, cursors: NO_CURSORS } : state;
240
+ return state.filters.feature || state.filters.status || state.filters.search ? { ...state, filters: {}, cursors: NO_CURSORS } : state;
192
241
  case "c":
193
242
  return { ...state, quality: true };
194
243
  case "f":
195
- return { ...state, input: state.filters.feature ?? "" };
244
+ return { ...state, input: state.filters.feature ?? "", searching: false };
196
245
  case "s": {
197
246
  const i = STATUS_CYCLE.indexOf(state.filters.status);
198
247
  const status = STATUS_CYCLE[(i + 1) % STATUS_CYCLE.length];
@@ -202,12 +251,79 @@ export function reduceOverviewTui(data, state, key) {
202
251
  return state;
203
252
  }
204
253
  }
254
+ /** The tab a state is on: the feature view and story detail belong to the overview tab. */
255
+ export function tabOf(state) {
256
+ if (state.quality)
257
+ return "quality";
258
+ if (state.view === "fleet")
259
+ return "fleet";
260
+ if (state.view === "graph")
261
+ return "graph";
262
+ return "overview";
263
+ }
264
+ /** Switch to `tab`. A tab whose view is not available (no graph or fleet view injected) leaves the state unchanged. */
265
+ function selectTab(data, state, tab) {
266
+ const here = tabOf(state);
267
+ // Pressing the overview key from the feature view goes back up to the overview; any other same-tab key is a no-op.
268
+ if (tab === here && !(tab === "overview" && state.view !== "overview"))
269
+ return state;
270
+ const cleared = { ...state, view: "overview", feature: null, story: null, graph: null, fleet: null, fleetGroup: null, quality: false };
271
+ switch (tab) {
272
+ case "overview":
273
+ return cleared;
274
+ case "fleet":
275
+ return data.fleetView ? { ...cleared, view: "fleet", ...enterFleet(data) } : state;
276
+ case "graph":
277
+ return data.graphView ? { ...cleared, view: "graph", graph: { cursor: 0 } } : state;
278
+ case "quality":
279
+ return { ...cleared, quality: true };
280
+ }
281
+ }
282
+ /** Entering the Fleet tab: 029's slice, plus the group cursor when a fleet of two or more features is shown (tab mode). */
283
+ function enterFleet(data) {
284
+ return { fleet: data.fleetView.init(), fleetGroup: data.tabs && isGrouped(currentFleet(data.fleets)) ? { cursor: 0, collapsed: [] } : null };
285
+ }
286
+ /** The shared filter as a text-and-state filter over lanes (feature 032, US-3). */
287
+ function groupFilterOf(state) {
288
+ return { query: state.filters.search ?? state.filters.feature ?? "", ...(state.filters.status !== undefined ? { state: state.filters.status } : {}) };
289
+ }
290
+ /** The current run as the Fleet view shows it in tab mode: its lanes narrowed by the shared filter. */
291
+ function visibleFleet(data, state) {
292
+ const view = data.fleet ?? null;
293
+ if (!view || !data.tabs)
294
+ return view;
295
+ return { ...view, lanes: filterLanes(view.lanes, groupFilterOf(state)) };
296
+ }
297
+ /** The dependency graph narrowed by the shared filter: text over the story id and title, and the status as buildable/blocked. */
298
+ function graphModelFor(data, state) {
299
+ const model = data.graphView.build(data.features);
300
+ if (!data.tabs)
301
+ return model;
302
+ const f = groupFilterOf(state);
303
+ const status = f.state === undefined ? undefined : { blocked: "blocked", ready: "buildable" }[f.state] ?? "";
304
+ const rows = applyListFilter(model.rows.map((r) => ({ ...r, state: r.state })), { query: f.query, ...(status !== undefined ? { state: status } : {}) });
305
+ return { ...model, rows };
306
+ }
307
+ /** `/`, `s` and `esc` on a tab other than the overview: the same shared filter (feature 032, US-3). Null when not a filter key. */
308
+ function reduceSharedFilter(state, key) {
309
+ const reset = { cursors: NO_CURSORS, graph: state.graph ? { cursor: 0 } : state.graph, fleetGroup: state.fleetGroup ? { ...state.fleetGroup, cursor: 0 } : null, fleet: state.fleet ? { ...state.fleet, cursor: 0, scroll: 0 } : state.fleet };
310
+ if (key.sequence === "/")
311
+ return { ...state, input: state.filters.search ?? "", searching: true };
312
+ if (key.name === "s") {
313
+ const i = STATUS_CYCLE.indexOf(state.filters.status);
314
+ return { ...state, filters: { ...state.filters, status: STATUS_CYCLE[(i + 1) % STATUS_CYCLE.length] }, ...reset };
315
+ }
316
+ if (key.name === "escape" && (state.filters.feature || state.filters.status || state.filters.search))
317
+ return { ...state, filters: {}, ...reset };
318
+ return null;
319
+ }
205
320
  function reduceInput(state, key) {
206
321
  const text = state.input ?? "";
207
322
  if (key.name === "escape")
208
- return { ...state, input: null };
323
+ return { ...state, input: null, searching: false };
209
324
  if (key.name === "return" || key.name === "enter") {
210
- return { ...state, input: null, filters: { ...state.filters, feature: text || undefined }, cursors: NO_CURSORS };
325
+ const filters = state.searching ? { ...state.filters, search: text || undefined } : { ...state.filters, feature: text || undefined };
326
+ return { ...state, input: null, searching: false, filters, cursors: NO_CURSORS };
211
327
  }
212
328
  if (key.name === "backspace")
213
329
  return { ...state, input: text.slice(0, -1) };
@@ -217,11 +333,73 @@ function reduceInput(state, key) {
217
333
  return state;
218
334
  }
219
335
  /** Graph view (feature 023): `↑↓` move over the open stories, `⏎` jumps to the story's feature, `esc` returns. */
336
+ /** Feature 029: the Fleet view's keys. The slice records an intended action; the command performs it (like `r`). */
337
+ function reduceFleetView(data, state, key) {
338
+ const api = data.fleetView;
339
+ if (!api || !state.fleet)
340
+ return { ...state, view: "overview", fleet: null, fleetGroup: null };
341
+ const entry = data.tabs ? currentFleet(data.fleets) : null;
342
+ if (state.fleetGroup && isGrouped(entry))
343
+ return reduceFleetGroup(data, state, key, api, entry);
344
+ const view = visibleFleet(data, state);
345
+ const rows = api.windowRows(data.rows ?? 24, view);
346
+ const next = api.reduce(view, state.fleet, key, rows);
347
+ if (next.quit)
348
+ return { ...state, done: true };
349
+ if (next.back)
350
+ return { ...state, view: "overview", fleet: null, fleetGroup: null };
351
+ return { ...state, fleet: next };
352
+ }
353
+ /** The 029 view of the feature under the grouped cursor (null on a feature that has not started, or outside the group). */
354
+ export function selectedFleetView(data, state) {
355
+ const entry = data.tabs ? currentFleet(data.fleets) : null;
356
+ if (!state.fleetGroup || !isGrouped(entry))
357
+ return data.fleet ?? null;
358
+ const rows = groupRows(entry, state.fleetGroup.collapsed, groupFilterOf(state));
359
+ const row = rows[Math.min(state.fleetGroup.cursor, Math.max(0, rows.length - 1))];
360
+ return row ? featureRunView(row.feature, data.fleet?.now ?? state.now) : null;
361
+ }
362
+ /**
363
+ * The grouped Fleet tab's keys (feature 032, FR-018): `↑↓` move over feature and lane rows, `←`/`→` collapse and expand a
364
+ * feature, and every directive or approve key goes to 029's reducer for the feature under the cursor, so its confirm
365
+ * dialog and rules are the same ones (a lane action needs a lane row; `P U X a` work on the feature's run).
366
+ */
367
+ function reduceFleetGroup(data, state, key, api, entry) {
368
+ const group = state.fleetGroup;
369
+ const filter = groupFilterOf(state);
370
+ const rows = groupRows(entry, group.collapsed, filter);
371
+ const cursor = Math.min(group.cursor, Math.max(0, rows.length - 1));
372
+ const row = rows[cursor];
373
+ if (!state.fleet.confirm) {
374
+ if ((key.name === "up" || key.name === "down") && rows.length > 0) {
375
+ const step = key.name === "up" ? rows.length - 1 : 1;
376
+ return { ...state, fleetGroup: { ...group, cursor: (cursor + step) % rows.length }, fleet: { ...state.fleet, notice: null } };
377
+ }
378
+ if ((key.name === "left" || key.name === "right") && row) {
379
+ const name = row.feature.feature;
380
+ const collapsed = key.name === "left" ? (group.collapsed.includes(name) ? group.collapsed : [...group.collapsed, name]) : group.collapsed.filter((c) => c !== name);
381
+ const at = groupRows(entry, collapsed, filter).findIndex((r) => r.kind === "feature" && r.feature.feature === name);
382
+ return { ...state, fleetGroup: { collapsed, cursor: at >= 0 ? at : cursor } };
383
+ }
384
+ // A lane action needs a lane row: on a feature header say so instead of acting on its first lane.
385
+ if (row?.kind === "feature" && (key.sequence === "p" || key.sequence === "u" || key.sequence === "x")) {
386
+ return { ...state, fleet: { ...state.fleet, notice: "Select a lane to pause, continue or stop it; P, U and X act on the whole run." } };
387
+ }
388
+ }
389
+ const view = row ? featureRunView(row.feature, data.fleet?.now ?? state.now) : null;
390
+ const inner = { ...state.fleet, cursor: row?.kind === "lane" ? row.index : 0 };
391
+ const next = api.reduce(view, inner, key, data.rows ?? 24);
392
+ if (next.quit)
393
+ return { ...state, done: true };
394
+ if (next.back)
395
+ return { ...state, view: "overview", fleet: null, fleetGroup: null };
396
+ return { ...state, fleet: next };
397
+ }
220
398
  function reduceGraph(data, state, key) {
221
399
  if (key.name === "q")
222
400
  return { ...state, done: true };
223
401
  const toOverview = { ...state, view: "overview", graph: null };
224
- const model = data.graphView?.build(data.features);
402
+ const model = data.graphView ? graphModelFor(data, state) : undefined;
225
403
  if (!model)
226
404
  return toOverview;
227
405
  if (key.name === "escape" || key.name === "backspace" || key.name === "left")
@@ -288,28 +466,111 @@ function keyHints(caps, pairs) {
288
466
  return pairs.map(([key, label]) => `${paintToken(caps, k["key-fg"], key)} ${paintToken(caps, k["label-fg"], label)}`).join(" ");
289
467
  }
290
468
  function filterNote(filters) {
291
- const parts = [filters.feature ? `feature=${filters.feature}` : "", filters.status ? `status=${filters.status}` : ""].filter(Boolean);
469
+ const parts = [filters.feature ? `feature=${filters.feature}` : "", filters.search ? `search=${filters.search}` : "", filters.status ? `status=${filters.status}` : ""].filter(Boolean);
292
470
  return parts.length ? ` [${parts.join(" ")}]` : "";
293
471
  }
294
472
  const FILTER_FIELD = 36;
295
473
  /** FilterInput (ui.md US-4): ` filter ( 017▏ ) ⏎ apply esc cancel` in the hint row. */
296
- function filterInput(caps, value) {
474
+ function filterInput(caps, value, label = "filter") {
297
475
  const t = LIVE_TOKENS.component.input;
298
476
  const caret = caps.unicode ? t.caret.u : t.caret.a;
299
477
  const shown = value.length > FILTER_FIELD - 2 ? value.slice(-(FILTER_FIELD - 2)) : value;
300
478
  const field = paintToken(caps, t.fg, shown) + paintToken(caps, t["frame-fg"], caret) + " ".repeat(Math.max(0, FILTER_FIELD - 1 - shown.length));
301
479
  const frame = (s) => paintToken(caps, t["frame-fg"], s);
302
- return ` ${paintToken(caps, t["label-fg"], "filter")} ${frame("(")} ${field}${frame(")")} ${keyHints(caps, [[caps.unicode ? "⏎" : "enter", "apply"], ["esc", "cancel"]])}`;
480
+ return ` ${paintToken(caps, t["label-fg"], label)} ${frame("(")} ${field}${frame(")")} ${keyHints(caps, [[caps.unicode ? "⏎" : "enter", "apply"], ["esc", "cancel"]])}`;
303
481
  }
304
482
  function metaOf(caps, data, state) {
305
483
  return { ...data.meta, interactive: true, ...(state.live ? { live: liveIndicator(caps, state.live, state.now) } : {}) };
306
484
  }
307
485
  /** EmptyState for the interactive overview: no specs at all, or a filter that matches nothing. */
308
486
  function emptyLines(caps, data, filters) {
487
+ if (data.tabs) {
488
+ return data.features.length === 0 ? tabEmptyBody(caps, "overview") : noMatchBody(caps, [filters.feature, filters.search, filters.status].filter(Boolean).join(" "));
489
+ }
309
490
  if (data.features.length === 0) {
310
491
  return emptyState(caps, "No feature specs yet.", { before: "Run ", command: "/amby.specify", after: " to create one." }, caps.columns);
311
492
  }
312
- return ["", noMatchLine(caps, [filters.feature, filters.status].filter(Boolean).join(" "))];
493
+ return ["", noMatchLine(caps, [filters.feature, filters.search, filters.status].filter(Boolean).join(" "))];
494
+ }
495
+ /** Which tabs have something to read first (ui.md "Tab bar"): a stalled or blocked lane, graph problems, findings. */
496
+ function tabBadges(data) {
497
+ const badges = {};
498
+ const attention = (v) => !!v && (v.run.needsDecision || v.lanes.some((l) => l.stalled || l.state === "blocked"));
499
+ const entry = currentFleet(data.fleets);
500
+ const fleetFlag = attention(data.fleet) || !!entry?.features.some((f) => f.state === "paused" || f.run?.needsDecision || f.lanes.some((l) => l.stalled || l.state === "blocked"));
501
+ if (fleetFlag)
502
+ badges.fleet = "attention";
503
+ if (data.graphView && data.graphView.build(data.features).problems > 0)
504
+ badges.graph = "warn";
505
+ const o = overviewOf(data, {});
506
+ if (o.attention.length > 0 || data.features.some((f) => (f.coverage?.uncovered.length ?? 0) > 0))
507
+ badges.quality = "warn";
508
+ return badges;
509
+ }
510
+ /** Items shown and the unfiltered total on a tab, for the filter line's "n of N match". */
511
+ function tabCounts(data, state, tab) {
512
+ switch (tab) {
513
+ case "fleet": {
514
+ const entry = currentFleet(data.fleets);
515
+ if (state.fleetGroup && isGrouped(entry))
516
+ return groupCounts(entry, groupFilterOf(state));
517
+ return { shown: visibleFleet(data, state)?.lanes.length ?? 0, total: data.fleet?.lanes.length ?? 0 };
518
+ }
519
+ case "graph":
520
+ return data.graphView ? { shown: graphModelFor(data, state).rows.length, total: data.graphView.build(data.features).rows.length } : { shown: 0, total: 0 };
521
+ case "quality":
522
+ return { shown: applyFilters(data.features, state.filters).length, total: data.features.length };
523
+ default:
524
+ return { shown: overviewOf(data, state.filters).features.length, total: data.features.length };
525
+ }
526
+ }
527
+ /**
528
+ * The tabbed frame (feature 032, US-1/US-3): the tab bar, the shared filter line and the screen body, with the key row
529
+ * leading with the tab keys (or shortened to "1-4 tab, ? help, q quit" on a narrow terminal). While typing, the filter
530
+ * line shows the text and the key row says how to apply or cancel.
531
+ */
532
+ function tabFramed(caps, data, state, rendered) {
533
+ const at = rendered.lastIndexOf("\n\n");
534
+ const body = at >= 0 ? rendered.slice(0, at) : rendered;
535
+ const hints = at >= 0 ? rendered.slice(at + 2) : "";
536
+ const tab = tabOf(state);
537
+ const f = state.filters;
538
+ const typing = state.input !== null;
539
+ const counts = tabCounts(data, state, tab);
540
+ const filterLine = renderFilterLine(caps, {
541
+ text: typing ? state.input : (f.search ?? f.feature ?? ""),
542
+ label: typing ? (state.searching ? "/" : "feature") : f.search || !f.feature ? "/" : "feature",
543
+ typing,
544
+ ...(f.status !== undefined ? { state: f.status } : {}),
545
+ ...counts,
546
+ });
547
+ const footer = typing
548
+ ? keyHints(caps, [[caps.unicode ? "⏎" : "enter", "apply"], ["esc", "cancel"]])
549
+ : tabLayout(caps) === "narrow"
550
+ ? keyHints(caps, [["1-4", "tab"], ["?", "help"], ["q", "quit"]])
551
+ : `${keyHints(caps, [["1-4", "tab"], ["] [", "next/prev"]])} ${hints}`;
552
+ // Never draw more rows than the terminal has (flicker fix): the tab bar, the filter line and the footer stay, the body is
553
+ // windowed around the cursor when it is too tall. Without a terminal height (tests, one-shot) nothing is cut.
554
+ const { top, rest } = pageHeader(caps, data, state, tab, body);
555
+ const fixed = top.length + 1 + (filterLine ? 1 : 0) + 1 + footer.split("\n").length;
556
+ const fitted = data.rows === undefined ? rest : fitBodyToRows(caps, rest.split("\n"), data.rows - fixed).join("\n");
557
+ const frame = renderTabFrame(caps, { active: tab, badges: tabBadges(data), filterLine, body: fitted });
558
+ return `${top.length ? `${top.join("\n")}\n` : ""}${frame}\n\n${footer}`;
559
+ }
560
+ /**
561
+ * The page header above the tab bar on every tab (032 ui.md decision 4: the tab bar sits directly under the header). The
562
+ * overview, feature and story screens draw their own header (title and rule), which is lifted above the tab bar; fleet,
563
+ * graph and quality get the same header with the tab's name in the crumb. Plain layout keeps its one-line header in the body.
564
+ */
565
+ function pageHeader(caps, data, state, tab, body) {
566
+ if (layoutMode(caps) === "plain")
567
+ return { top: [], rest: body };
568
+ const meta = metaOf(caps, data, state);
569
+ const lines = body.split("\n");
570
+ const rule = header(caps, meta, caps.columns)[1];
571
+ if (lines.length >= 2 && lines[1] === rule)
572
+ return { top: lines.slice(0, 2), rest: lines.slice(2).join("\n") };
573
+ return { top: header(caps, { ...meta, crumb: [...meta.crumb, tab] }, caps.columns), rest: body };
313
574
  }
314
575
  function renderScreen(caps, data, state) {
315
576
  const u = caps.unicode;
@@ -318,6 +579,15 @@ function renderScreen(caps, data, state) {
318
579
  const noticeMax = LIVE_TOKENS.limit["notice-max"];
319
580
  const presence = data.presence ? { presence: data.presence } : {};
320
581
  const nav = state.story;
582
+ if (data.tabs && state.quality) {
583
+ // Feature 032: the quality tab is the 024 view plus the FLOW panel (cycle time per phase, converge gap trend).
584
+ const o = overviewOf(data, state.filters);
585
+ const features = applyFilters(data.features, state.filters);
586
+ const empty = !data.features.some((f) => f.coverage) && o.attention.length === 0;
587
+ const base = empty ? tabEmptyBody(caps, "quality").join("\n") : renderQualityView(caps, features, o.attention);
588
+ const body = [base, "", ...renderMetricsPanel(caps, data.metricsState)].join("\n");
589
+ return { frame: `${body}\n\n${keyHints(caps, [["esc", "back"], ["/", "search"], ["s", "state"], ["?", "help"], ["q", "quit"]])}`, screen: "quality" };
590
+ }
321
591
  if (state.view === "feature" && state.feature && nav) {
322
592
  const filters = { ...state.filters, feature: state.feature };
323
593
  const feature = applyFilters(data.features, filters)[0];
@@ -352,9 +622,72 @@ function renderScreen(caps, data, state) {
352
622
  return { frame: `${body}\n\n${hints}`, screen: "feature" };
353
623
  }
354
624
  }
625
+ if (state.view === "fleet" && data.fleetView && state.fleet) {
626
+ const api = data.fleetView;
627
+ const lane = u ? "↑↓" : "up/down";
628
+ const entry = data.tabs ? currentFleet(data.fleets) : null;
629
+ if (data.tabs && state.fleetGroup && isGrouped(entry) && data.fleetTab) {
630
+ // Feature 032 (FR-018): lanes grouped by feature across features, with 029 rows, confirm and directive rules inside.
631
+ const rows = groupRows(entry, state.fleetGroup.collapsed, groupFilterOf(state));
632
+ const body = rows.length === 0
633
+ ? noMatchBody(caps, groupFilterOf(state).query).join("\n")
634
+ : data.fleetTab.render(caps, {
635
+ entry,
636
+ rows,
637
+ cursor: Math.min(state.fleetGroup.cursor, rows.length - 1),
638
+ inner: state.fleet,
639
+ selected: selectedFleetView(data, state),
640
+ ...(state.live ? { live: state.live } : {}),
641
+ now: state.now,
642
+ window: api.windowRows(data.rows ?? 24, null),
643
+ });
644
+ const hints = keyHints(caps, [
645
+ ["esc", "back"],
646
+ [lane, "item"],
647
+ [u ? "← →" : "left/right", "collapse"],
648
+ ["p", "pause"],
649
+ ["u", "continue"],
650
+ ["x", "stop"],
651
+ [u ? "⇧" : "shift", "whole run"],
652
+ ["a", "approve"],
653
+ ["?", "help"],
654
+ ["q", "quit"],
655
+ ]);
656
+ return { frame: `${body}\n\n${hints}`, screen: "fleet" };
657
+ }
658
+ const run = visibleFleet(data, state);
659
+ const body = data.tabs && !data.fleet
660
+ ? tabEmptyBody(caps, "fleet").join("\n")
661
+ : data.tabs && run && run.lanes.length === 0 && (data.fleet?.lanes.length ?? 0) > 0
662
+ ? noMatchBody(caps, groupFilterOf(state).query).join("\n")
663
+ : api.render(caps, {
664
+ view: run,
665
+ state: state.fleet,
666
+ ...(state.live ? { live: state.live } : {}),
667
+ now: state.now,
668
+ rows: data.rows ?? 24,
669
+ });
670
+ const hints = keyHints(caps, [
671
+ ["esc", "back"],
672
+ [lane, "lane"],
673
+ ["p", "pause"],
674
+ ["u", "continue"],
675
+ ["x", "stop"],
676
+ [u ? "⇧" : "shift", "whole run"],
677
+ ...(api.hasGates(run) ? [["a", "approve"]] : []),
678
+ ["?", "help"],
679
+ ["q", "quit"],
680
+ ]);
681
+ return { frame: `${body}\n\n${hints}`, screen: "fleet" };
682
+ }
355
683
  if (state.view === "graph" && data.graphView) {
356
- const model = data.graphView.build(data.features);
357
- const body = data.graphView.render(caps, model, state.graph?.cursor ?? 0);
684
+ const model = graphModelFor(data, state);
685
+ const everything = data.tabs ? data.graphView.build(data.features) : model;
686
+ const body = data.tabs && everything.rows.length === 0 && everything.doneCount === 0
687
+ ? tabEmptyBody(caps, "graph").join("\n")
688
+ : data.tabs && model.rows.length === 0 && everything.rows.length > 0
689
+ ? noMatchBody(caps, groupFilterOf(state).query).join("\n")
690
+ : data.graphView.render(caps, model, state.graph?.cursor ?? 0);
358
691
  const hints = keyHints(caps, [["esc", "back"], [move, "move"], [enter, "open feature"], ["?", "help"], ["q", "quit"]]);
359
692
  return { frame: `${body}\n\n${hints}`, screen: "graph" };
360
693
  }
@@ -369,8 +702,8 @@ function renderScreen(caps, data, state) {
369
702
  noticeMax,
370
703
  ...presence,
371
704
  });
372
- const footer = state.input !== null
373
- ? filterInput(caps, state.input)
705
+ const footer = state.input !== null && !data.tabs
706
+ ? filterInput(caps, state.input, state.searching ? "search" : "filter")
374
707
  : keyHints(caps, [
375
708
  ["tab", "panel"],
376
709
  [move, "move"],
@@ -378,14 +711,20 @@ function renderScreen(caps, data, state) {
378
711
  ["f", "filter"],
379
712
  ["s", "status"],
380
713
  ...(data.graphView ? [["g", "graph"]] : []),
714
+ ...(data.fleetView ? [["l", "fleet"]] : []),
381
715
  ["c", "quality"],
382
716
  ["?", "help"],
383
717
  ["q", "quit"],
384
- ]) + filterNote(state.filters);
718
+ ]) + (data.tabs ? "" : filterNote(state.filters));
385
719
  return { frame: `${body}\n\n${footer}`, screen: "overview" };
386
720
  }
387
721
  /** Render the current frame, with the help overlay on top when it is open. */
388
722
  export function renderOverviewTui(caps, data, state) {
723
+ if (data.tabs) {
724
+ const { frame, screen } = renderScreen(caps, data, state);
725
+ const framed = tabFramed(caps, data, state, frame);
726
+ return state.help ? renderHelp(caps, framed, screen, data.issues.map((i) => `${i.file}: ${i.reason}`)) : framed;
727
+ }
389
728
  if (state.quality && state.view === "overview") {
390
729
  const o = overviewOf(data, state.filters);
391
730
  const hints = keyHints(caps, [["any key", "back"], ["q", "quit"]]);