@prestyj/cli 4.3.210 → 4.3.238

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 (889) hide show
  1. package/README.md +17 -9
  2. package/dist/cli/auth.d.ts +4 -0
  3. package/dist/cli/auth.d.ts.map +1 -0
  4. package/dist/cli/auth.js +344 -0
  5. package/dist/cli/auth.js.map +1 -0
  6. package/dist/cli/command-routing.d.ts +28 -0
  7. package/dist/cli/command-routing.d.ts.map +1 -0
  8. package/dist/cli/command-routing.js +53 -0
  9. package/dist/cli/command-routing.js.map +1 -0
  10. package/dist/cli/command-routing.test.d.ts +2 -0
  11. package/dist/cli/command-routing.test.d.ts.map +1 -0
  12. package/dist/cli/command-routing.test.js +60 -0
  13. package/dist/cli/command-routing.test.js.map +1 -0
  14. package/dist/cli/mcp.d.ts +2 -0
  15. package/dist/cli/mcp.d.ts.map +1 -0
  16. package/dist/cli/mcp.js +309 -0
  17. package/dist/cli/mcp.js.map +1 -0
  18. package/dist/cli/pixel.d.ts +27 -0
  19. package/dist/cli/pixel.d.ts.map +1 -0
  20. package/dist/cli/pixel.js +103 -0
  21. package/dist/cli/pixel.js.map +1 -0
  22. package/dist/cli/shared.d.ts +13 -0
  23. package/dist/cli/shared.d.ts.map +1 -0
  24. package/dist/cli/shared.js +82 -0
  25. package/dist/cli/shared.js.map +1 -0
  26. package/dist/cli.d.ts +4 -1
  27. package/dist/cli.d.ts.map +1 -1
  28. package/dist/cli.js +174 -732
  29. package/dist/cli.js.map +1 -1
  30. package/dist/config.d.ts +4 -1
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js +14 -1
  33. package/dist/config.js.map +1 -1
  34. package/dist/config.test.d.ts +2 -0
  35. package/dist/config.test.d.ts.map +1 -0
  36. package/dist/config.test.js +29 -0
  37. package/dist/config.test.js.map +1 -0
  38. package/dist/core/agent-session-compaction.test.d.ts +2 -0
  39. package/dist/core/agent-session-compaction.test.d.ts.map +1 -0
  40. package/dist/core/agent-session-compaction.test.js +114 -0
  41. package/dist/core/agent-session-compaction.test.js.map +1 -0
  42. package/dist/core/agent-session.d.ts +0 -23
  43. package/dist/core/agent-session.d.ts.map +1 -1
  44. package/dist/core/agent-session.js +6 -101
  45. package/dist/core/agent-session.js.map +1 -1
  46. package/dist/core/checkpoint-store.d.ts +93 -0
  47. package/dist/core/checkpoint-store.d.ts.map +1 -0
  48. package/dist/core/checkpoint-store.js +188 -0
  49. package/dist/core/checkpoint-store.js.map +1 -0
  50. package/dist/core/checkpoint-store.test.d.ts +2 -0
  51. package/dist/core/checkpoint-store.test.d.ts.map +1 -0
  52. package/dist/core/checkpoint-store.test.js +111 -0
  53. package/dist/core/checkpoint-store.test.js.map +1 -0
  54. package/dist/core/compaction/compactor.d.ts +4 -0
  55. package/dist/core/compaction/compactor.d.ts.map +1 -1
  56. package/dist/core/compaction/compactor.js +81 -28
  57. package/dist/core/compaction/compactor.js.map +1 -1
  58. package/dist/core/compaction/compactor.test.js +33 -9
  59. package/dist/core/compaction/compactor.test.js.map +1 -1
  60. package/dist/core/compaction/token-estimator.test.js +1 -1
  61. package/dist/core/continue-replay-inventory.test.d.ts +2 -0
  62. package/dist/core/continue-replay-inventory.test.d.ts.map +1 -0
  63. package/dist/core/continue-replay-inventory.test.js +42 -0
  64. package/dist/core/continue-replay-inventory.test.js.map +1 -0
  65. package/dist/core/goal-controller.d.ts +4 -0
  66. package/dist/core/goal-controller.d.ts.map +1 -1
  67. package/dist/core/goal-controller.js +223 -32
  68. package/dist/core/goal-controller.js.map +1 -1
  69. package/dist/core/goal-controller.test.js +387 -22
  70. package/dist/core/goal-controller.test.js.map +1 -1
  71. package/dist/core/goal-lifecycle-smoke.test.js +49 -8
  72. package/dist/core/goal-lifecycle-smoke.test.js.map +1 -1
  73. package/dist/core/goal-prerequisites.d.ts +23 -0
  74. package/dist/core/goal-prerequisites.d.ts.map +1 -0
  75. package/dist/core/goal-prerequisites.js +114 -0
  76. package/dist/core/goal-prerequisites.js.map +1 -0
  77. package/dist/core/goal-prerequisites.test.d.ts +2 -0
  78. package/dist/core/goal-prerequisites.test.d.ts.map +1 -0
  79. package/dist/core/goal-prerequisites.test.js +118 -0
  80. package/dist/core/goal-prerequisites.test.js.map +1 -0
  81. package/dist/core/goal-store.d.ts +12 -1
  82. package/dist/core/goal-store.d.ts.map +1 -1
  83. package/dist/core/goal-store.js +146 -40
  84. package/dist/core/goal-store.js.map +1 -1
  85. package/dist/core/goal-store.test.js +65 -8
  86. package/dist/core/goal-store.test.js.map +1 -1
  87. package/dist/core/goal-verifier.d.ts.map +1 -1
  88. package/dist/core/goal-verifier.js +4 -1
  89. package/dist/core/goal-verifier.js.map +1 -1
  90. package/dist/core/goal-verifier.test.js +43 -0
  91. package/dist/core/goal-verifier.test.js.map +1 -1
  92. package/dist/core/goal-worker.d.ts +2 -0
  93. package/dist/core/goal-worker.d.ts.map +1 -1
  94. package/dist/core/goal-worker.js +31 -7
  95. package/dist/core/goal-worker.js.map +1 -1
  96. package/dist/core/goal-worker.test.js +44 -0
  97. package/dist/core/goal-worker.test.js.map +1 -1
  98. package/dist/core/ideal-review.d.ts +20 -0
  99. package/dist/core/ideal-review.d.ts.map +1 -0
  100. package/dist/core/ideal-review.js +55 -0
  101. package/dist/core/ideal-review.js.map +1 -0
  102. package/dist/core/ideal-review.test.d.ts +2 -0
  103. package/dist/core/ideal-review.test.d.ts.map +1 -0
  104. package/dist/core/ideal-review.test.js +59 -0
  105. package/dist/core/ideal-review.test.js.map +1 -0
  106. package/dist/core/index.d.ts +1 -0
  107. package/dist/core/index.d.ts.map +1 -1
  108. package/dist/core/index.js +1 -0
  109. package/dist/core/index.js.map +1 -1
  110. package/dist/core/loop-breaker.d.ts +46 -0
  111. package/dist/core/loop-breaker.d.ts.map +1 -0
  112. package/dist/core/loop-breaker.js +79 -0
  113. package/dist/core/loop-breaker.js.map +1 -0
  114. package/dist/core/loop-breaker.test.d.ts +2 -0
  115. package/dist/core/loop-breaker.test.d.ts.map +1 -0
  116. package/dist/core/loop-breaker.test.js +110 -0
  117. package/dist/core/loop-breaker.test.js.map +1 -0
  118. package/dist/core/mcp/client.d.ts +20 -0
  119. package/dist/core/mcp/client.d.ts.map +1 -1
  120. package/dist/core/mcp/client.js +55 -11
  121. package/dist/core/mcp/client.js.map +1 -1
  122. package/dist/core/mcp/defaults.d.ts +7 -0
  123. package/dist/core/mcp/defaults.d.ts.map +1 -1
  124. package/dist/core/mcp/defaults.js +14 -0
  125. package/dist/core/mcp/defaults.js.map +1 -1
  126. package/dist/core/mcp/index.d.ts +6 -1
  127. package/dist/core/mcp/index.d.ts.map +1 -1
  128. package/dist/core/mcp/index.js +3 -1
  129. package/dist/core/mcp/index.js.map +1 -1
  130. package/dist/core/mcp/parse-add-command.d.ts +25 -0
  131. package/dist/core/mcp/parse-add-command.d.ts.map +1 -0
  132. package/dist/core/mcp/parse-add-command.js +220 -0
  133. package/dist/core/mcp/parse-add-command.js.map +1 -0
  134. package/dist/core/mcp/parse-add-command.test.d.ts +2 -0
  135. package/dist/core/mcp/parse-add-command.test.d.ts.map +1 -0
  136. package/dist/core/mcp/parse-add-command.test.js +75 -0
  137. package/dist/core/mcp/parse-add-command.test.js.map +1 -0
  138. package/dist/core/mcp/store.d.ts +80 -0
  139. package/dist/core/mcp/store.d.ts.map +1 -0
  140. package/dist/core/mcp/store.js +157 -0
  141. package/dist/core/mcp/store.js.map +1 -0
  142. package/dist/core/mcp/store.test.d.ts +2 -0
  143. package/dist/core/mcp/store.test.d.ts.map +1 -0
  144. package/dist/core/mcp/store.test.js +101 -0
  145. package/dist/core/mcp/store.test.js.map +1 -0
  146. package/dist/core/model-registry.d.ts +2 -2
  147. package/dist/core/model-registry.js +4 -4
  148. package/dist/core/model-registry.js.map +1 -1
  149. package/dist/core/model-registry.test.js +1 -1
  150. package/dist/core/model-registry.test.js.map +1 -1
  151. package/dist/core/prompt-commands.d.ts.map +1 -1
  152. package/dist/core/prompt-commands.js +64 -894
  153. package/dist/core/prompt-commands.js.map +1 -1
  154. package/dist/core/prompt-commands.test.js +49 -41
  155. package/dist/core/prompt-commands.test.js.map +1 -1
  156. package/dist/core/regrounding.d.ts +23 -0
  157. package/dist/core/regrounding.d.ts.map +1 -0
  158. package/dist/core/regrounding.js +21 -0
  159. package/dist/core/regrounding.js.map +1 -0
  160. package/dist/core/regrounding.test.d.ts +2 -0
  161. package/dist/core/regrounding.test.d.ts.map +1 -0
  162. package/dist/core/regrounding.test.js +38 -0
  163. package/dist/core/regrounding.test.js.map +1 -0
  164. package/dist/core/runtime-mode.d.ts +23 -0
  165. package/dist/core/runtime-mode.d.ts.map +1 -0
  166. package/dist/core/runtime-mode.js +30 -0
  167. package/dist/core/runtime-mode.js.map +1 -0
  168. package/dist/core/session-manager.d.ts +4 -0
  169. package/dist/core/session-manager.d.ts.map +1 -1
  170. package/dist/core/session-manager.js +20 -0
  171. package/dist/core/session-manager.js.map +1 -1
  172. package/dist/core/session-restore-display.test.d.ts +2 -0
  173. package/dist/core/session-restore-display.test.d.ts.map +1 -0
  174. package/dist/core/session-restore-display.test.js +78 -0
  175. package/dist/core/session-restore-display.test.js.map +1 -0
  176. package/dist/core/settings-manager.d.ts +4 -2
  177. package/dist/core/settings-manager.d.ts.map +1 -1
  178. package/dist/core/settings-manager.js +3 -6
  179. package/dist/core/settings-manager.js.map +1 -1
  180. package/dist/core/slash-commands.d.ts +0 -2
  181. package/dist/core/slash-commands.d.ts.map +1 -1
  182. package/dist/core/slash-commands.js +10 -15
  183. package/dist/core/slash-commands.js.map +1 -1
  184. package/dist/core/style-packs/index.js +1 -1
  185. package/dist/core/style-packs/index.js.map +1 -1
  186. package/dist/core/task-store.d.ts +26 -0
  187. package/dist/core/task-store.d.ts.map +1 -0
  188. package/dist/core/task-store.js +147 -0
  189. package/dist/core/task-store.js.map +1 -0
  190. package/dist/core/tasks-store.d.ts +24 -0
  191. package/dist/core/tasks-store.d.ts.map +1 -0
  192. package/dist/core/tasks-store.js +81 -0
  193. package/dist/core/tasks-store.js.map +1 -0
  194. package/dist/core/thinking-level.d.ts +5 -0
  195. package/dist/core/thinking-level.d.ts.map +1 -0
  196. package/dist/core/thinking-level.js +59 -0
  197. package/dist/core/thinking-level.js.map +1 -0
  198. package/dist/core/thinking-level.test.d.ts +2 -0
  199. package/dist/core/thinking-level.test.d.ts.map +1 -0
  200. package/dist/core/thinking-level.test.js +38 -0
  201. package/dist/core/thinking-level.test.js.map +1 -0
  202. package/dist/core/verify-commands.js +4 -4
  203. package/dist/core/verify-commands.js.map +1 -1
  204. package/dist/index.d.ts +1 -1
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +1 -1
  207. package/dist/index.js.map +1 -1
  208. package/dist/interactive.d.ts.map +1 -1
  209. package/dist/interactive.js +3 -1
  210. package/dist/interactive.js.map +1 -1
  211. package/dist/system-prompt.d.ts +5 -1
  212. package/dist/system-prompt.d.ts.map +1 -1
  213. package/dist/system-prompt.js +76 -48
  214. package/dist/system-prompt.js.map +1 -1
  215. package/dist/system-prompt.test.js +98 -46
  216. package/dist/system-prompt.test.js.map +1 -1
  217. package/dist/tools/bash.d.ts +6 -1
  218. package/dist/tools/bash.d.ts.map +1 -1
  219. package/dist/tools/bash.js +21 -3
  220. package/dist/tools/bash.js.map +1 -1
  221. package/dist/tools/checkpoint-hook.test.d.ts +2 -0
  222. package/dist/tools/checkpoint-hook.test.d.ts.map +1 -0
  223. package/dist/tools/checkpoint-hook.test.js +65 -0
  224. package/dist/tools/checkpoint-hook.test.js.map +1 -0
  225. package/dist/tools/edit-diff.d.ts +17 -4
  226. package/dist/tools/edit-diff.d.ts.map +1 -1
  227. package/dist/tools/edit-diff.js +78 -16
  228. package/dist/tools/edit-diff.js.map +1 -1
  229. package/dist/tools/edit-diff.test.js +31 -1
  230. package/dist/tools/edit-diff.test.js.map +1 -1
  231. package/dist/tools/edit-robustness.test.d.ts +2 -0
  232. package/dist/tools/edit-robustness.test.d.ts.map +1 -0
  233. package/dist/tools/edit-robustness.test.js +415 -0
  234. package/dist/tools/edit-robustness.test.js.map +1 -0
  235. package/dist/tools/edit.d.ts +8 -2
  236. package/dist/tools/edit.d.ts.map +1 -1
  237. package/dist/tools/edit.js +48 -20
  238. package/dist/tools/edit.js.map +1 -1
  239. package/dist/tools/edit.test.js +23 -22
  240. package/dist/tools/edit.test.js.map +1 -1
  241. package/dist/tools/enter-plan.d.ts +1 -3
  242. package/dist/tools/enter-plan.d.ts.map +1 -1
  243. package/dist/tools/enter-plan.js +9 -21
  244. package/dist/tools/enter-plan.js.map +1 -1
  245. package/dist/tools/exit-plan.d.ts.map +1 -1
  246. package/dist/tools/exit-plan.js +8 -9
  247. package/dist/tools/exit-plan.js.map +1 -1
  248. package/dist/tools/goal-mode.test.d.ts +2 -0
  249. package/dist/tools/goal-mode.test.d.ts.map +1 -0
  250. package/dist/tools/goal-mode.test.js +121 -0
  251. package/dist/tools/goal-mode.test.js.map +1 -0
  252. package/dist/tools/goals.d.ts +14 -2
  253. package/dist/tools/goals.d.ts.map +1 -1
  254. package/dist/tools/goals.js +257 -26
  255. package/dist/tools/goals.js.map +1 -1
  256. package/dist/tools/goals.test.js +365 -1
  257. package/dist/tools/goals.test.js.map +1 -1
  258. package/dist/tools/html-extract.d.ts +58 -0
  259. package/dist/tools/html-extract.d.ts.map +1 -0
  260. package/dist/tools/html-extract.js +130 -0
  261. package/dist/tools/html-extract.js.map +1 -0
  262. package/dist/tools/html-extract.test.d.ts +2 -0
  263. package/dist/tools/html-extract.test.d.ts.map +1 -0
  264. package/dist/tools/html-extract.test.js +60 -0
  265. package/dist/tools/html-extract.test.js.map +1 -0
  266. package/dist/tools/index.d.ts +15 -12
  267. package/dist/tools/index.d.ts.map +1 -1
  268. package/dist/tools/index.js +12 -8
  269. package/dist/tools/index.js.map +1 -1
  270. package/dist/tools/pdf-extract.d.ts +18 -0
  271. package/dist/tools/pdf-extract.d.ts.map +1 -0
  272. package/dist/tools/pdf-extract.js +43 -0
  273. package/dist/tools/pdf-extract.js.map +1 -0
  274. package/dist/tools/pdf-extract.test.d.ts +2 -0
  275. package/dist/tools/pdf-extract.test.d.ts.map +1 -0
  276. package/dist/tools/pdf-extract.test.js +15 -0
  277. package/dist/tools/pdf-extract.test.js.map +1 -0
  278. package/dist/tools/plan-mode.test.js +82 -243
  279. package/dist/tools/plan-mode.test.js.map +1 -1
  280. package/dist/tools/prompt-hints.d.ts.map +1 -1
  281. package/dist/tools/prompt-hints.js +6 -9
  282. package/dist/tools/prompt-hints.js.map +1 -1
  283. package/dist/tools/read-only-bash.d.ts +13 -0
  284. package/dist/tools/read-only-bash.d.ts.map +1 -0
  285. package/dist/tools/read-only-bash.js +155 -0
  286. package/dist/tools/read-only-bash.js.map +1 -0
  287. package/dist/tools/read-only-bash.test.d.ts +2 -0
  288. package/dist/tools/read-only-bash.test.d.ts.map +1 -0
  289. package/dist/tools/read-only-bash.test.js +47 -0
  290. package/dist/tools/read-only-bash.test.js.map +1 -0
  291. package/dist/tools/read.d.ts.map +1 -1
  292. package/dist/tools/read.js +14 -1
  293. package/dist/tools/read.js.map +1 -1
  294. package/dist/tools/read.test.js +4 -0
  295. package/dist/tools/read.test.js.map +1 -1
  296. package/dist/tools/screenshot.d.ts +25 -0
  297. package/dist/tools/screenshot.d.ts.map +1 -0
  298. package/dist/tools/screenshot.js +165 -0
  299. package/dist/tools/screenshot.js.map +1 -0
  300. package/dist/tools/screenshot.test.d.ts +2 -0
  301. package/dist/tools/screenshot.test.d.ts.map +1 -0
  302. package/dist/tools/screenshot.test.js +145 -0
  303. package/dist/tools/screenshot.test.js.map +1 -0
  304. package/dist/tools/subagent.d.ts +7 -2
  305. package/dist/tools/subagent.d.ts.map +1 -1
  306. package/dist/tools/subagent.js +31 -9
  307. package/dist/tools/subagent.js.map +1 -1
  308. package/dist/tools/tasks.d.ts.map +1 -1
  309. package/dist/tools/tasks.js +22 -58
  310. package/dist/tools/tasks.js.map +1 -1
  311. package/dist/tools/web-fetch.d.ts +16 -1
  312. package/dist/tools/web-fetch.d.ts.map +1 -1
  313. package/dist/tools/web-fetch.js +357 -45
  314. package/dist/tools/web-fetch.js.map +1 -1
  315. package/dist/tools/web-fetch.test.js +263 -2
  316. package/dist/tools/web-fetch.test.js.map +1 -1
  317. package/dist/tools/web-search.d.ts +14 -0
  318. package/dist/tools/web-search.d.ts.map +1 -1
  319. package/dist/tools/web-search.js +321 -35
  320. package/dist/tools/web-search.js.map +1 -1
  321. package/dist/tools/web-search.test.js +144 -1
  322. package/dist/tools/web-search.test.js.map +1 -1
  323. package/dist/tools/write.d.ts +8 -2
  324. package/dist/tools/write.d.ts.map +1 -1
  325. package/dist/tools/write.js +36 -9
  326. package/dist/tools/write.js.map +1 -1
  327. package/dist/tools/write.test.js +0 -16
  328. package/dist/tools/write.test.js.map +1 -1
  329. package/dist/ui/App.d.ts +52 -280
  330. package/dist/ui/App.d.ts.map +1 -1
  331. package/dist/ui/App.js +1608 -2235
  332. package/dist/ui/App.js.map +1 -1
  333. package/dist/ui/activity-phrases.d.ts.map +1 -1
  334. package/dist/ui/activity-phrases.js +0 -2
  335. package/dist/ui/activity-phrases.js.map +1 -1
  336. package/dist/ui/app-items.d.ts +276 -0
  337. package/dist/ui/app-items.d.ts.map +1 -0
  338. package/dist/ui/app-items.js +52 -0
  339. package/dist/ui/app-items.js.map +1 -0
  340. package/dist/ui/app-items.test.d.ts +2 -0
  341. package/dist/ui/app-items.test.d.ts.map +1 -0
  342. package/dist/ui/app-items.test.js +38 -0
  343. package/dist/ui/app-items.test.js.map +1 -0
  344. package/dist/ui/app-state-persistence.test.js +45 -160
  345. package/dist/ui/app-state-persistence.test.js.map +1 -1
  346. package/dist/ui/assistant-stream-flush-parity.test.d.ts +2 -0
  347. package/dist/ui/assistant-stream-flush-parity.test.d.ts.map +1 -0
  348. package/dist/ui/assistant-stream-flush-parity.test.js +85 -0
  349. package/dist/ui/assistant-stream-flush-parity.test.js.map +1 -0
  350. package/dist/ui/chat-layout-pinning.test.d.ts +2 -0
  351. package/dist/ui/chat-layout-pinning.test.d.ts.map +1 -0
  352. package/dist/ui/chat-layout-pinning.test.js +525 -0
  353. package/dist/ui/chat-layout-pinning.test.js.map +1 -0
  354. package/dist/ui/components/ActivityIndicator.d.ts +1 -2
  355. package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
  356. package/dist/ui/components/ActivityIndicator.js +63 -94
  357. package/dist/ui/components/ActivityIndicator.js.map +1 -1
  358. package/dist/ui/components/AnimationContext.d.ts.map +1 -1
  359. package/dist/ui/components/AnimationContext.js +3 -5
  360. package/dist/ui/components/AnimationContext.js.map +1 -1
  361. package/dist/ui/components/AssistantMessage.d.ts +6 -2
  362. package/dist/ui/components/AssistantMessage.d.ts.map +1 -1
  363. package/dist/ui/components/AssistantMessage.js +9 -4
  364. package/dist/ui/components/AssistantMessage.js.map +1 -1
  365. package/dist/ui/components/AssistantMessage.test.d.ts +2 -0
  366. package/dist/ui/components/AssistantMessage.test.d.ts.map +1 -0
  367. package/dist/ui/components/AssistantMessage.test.js +387 -0
  368. package/dist/ui/components/AssistantMessage.test.js.map +1 -0
  369. package/dist/ui/components/BackgroundTasksBar.d.ts +1 -3
  370. package/dist/ui/components/BackgroundTasksBar.d.ts.map +1 -1
  371. package/dist/ui/components/BackgroundTasksBar.js +8 -10
  372. package/dist/ui/components/BackgroundTasksBar.js.map +1 -1
  373. package/dist/ui/components/Banner.d.ts +1 -2
  374. package/dist/ui/components/Banner.d.ts.map +1 -1
  375. package/dist/ui/components/Banner.js +9 -4
  376. package/dist/ui/components/Banner.js.map +1 -1
  377. package/dist/ui/components/ChatFooterPane.d.ts +25 -0
  378. package/dist/ui/components/ChatFooterPane.d.ts.map +1 -0
  379. package/dist/ui/components/ChatFooterPane.js +15 -0
  380. package/dist/ui/components/ChatFooterPane.js.map +1 -0
  381. package/dist/ui/components/ChatInputStack.d.ts +36 -0
  382. package/dist/ui/components/ChatInputStack.d.ts.map +1 -0
  383. package/dist/ui/components/ChatInputStack.js +10 -0
  384. package/dist/ui/components/ChatInputStack.js.map +1 -0
  385. package/dist/ui/components/ChatLayout.d.ts +37 -0
  386. package/dist/ui/components/ChatLayout.d.ts.map +1 -0
  387. package/dist/ui/components/ChatLayout.js +21 -0
  388. package/dist/ui/components/ChatLayout.js.map +1 -0
  389. package/dist/ui/components/ChatLivePane.d.ts +18 -0
  390. package/dist/ui/components/ChatLivePane.d.ts.map +1 -0
  391. package/dist/ui/components/ChatLivePane.js +22 -0
  392. package/dist/ui/components/ChatLivePane.js.map +1 -0
  393. package/dist/ui/components/ChatScreen.d.ts +136 -0
  394. package/dist/ui/components/ChatScreen.d.ts.map +1 -0
  395. package/dist/ui/components/ChatScreen.js +16 -0
  396. package/dist/ui/components/ChatScreen.js.map +1 -0
  397. package/dist/ui/components/ChatStatusRow.d.ts +34 -0
  398. package/dist/ui/components/ChatStatusRow.d.ts.map +1 -0
  399. package/dist/ui/components/ChatStatusRow.js +11 -0
  400. package/dist/ui/components/ChatStatusRow.js.map +1 -0
  401. package/dist/ui/components/CompactionNotice.d.ts +4 -2
  402. package/dist/ui/components/CompactionNotice.d.ts.map +1 -1
  403. package/dist/ui/components/CompactionNotice.js +4 -4
  404. package/dist/ui/components/CompactionNotice.js.map +1 -1
  405. package/dist/ui/components/Footer.d.ts +27 -6
  406. package/dist/ui/components/Footer.d.ts.map +1 -1
  407. package/dist/ui/components/Footer.js +75 -30
  408. package/dist/ui/components/Footer.js.map +1 -1
  409. package/dist/ui/components/FooterStatusRow.d.ts +20 -0
  410. package/dist/ui/components/FooterStatusRow.d.ts.map +1 -0
  411. package/dist/ui/components/FooterStatusRow.js +10 -0
  412. package/dist/ui/components/FooterStatusRow.js.map +1 -0
  413. package/dist/ui/components/FullScreenOverlayRouter.d.ts +19 -0
  414. package/dist/ui/components/FullScreenOverlayRouter.d.ts.map +1 -0
  415. package/dist/ui/components/FullScreenOverlayRouter.js +18 -0
  416. package/dist/ui/components/FullScreenOverlayRouter.js.map +1 -0
  417. package/dist/ui/components/GoalOverlay.d.ts +28 -20
  418. package/dist/ui/components/GoalOverlay.d.ts.map +1 -1
  419. package/dist/ui/components/GoalOverlay.js +283 -253
  420. package/dist/ui/components/GoalOverlay.js.map +1 -1
  421. package/dist/ui/components/GoalStatusBar.d.ts.map +1 -1
  422. package/dist/ui/components/GoalStatusBar.js +2 -1
  423. package/dist/ui/components/GoalStatusBar.js.map +1 -1
  424. package/dist/ui/components/IdealHookMessage.d.ts +14 -0
  425. package/dist/ui/components/IdealHookMessage.d.ts.map +1 -0
  426. package/dist/ui/components/IdealHookMessage.js +26 -0
  427. package/dist/ui/components/IdealHookMessage.js.map +1 -0
  428. package/dist/ui/components/InputArea.d.ts +31 -6
  429. package/dist/ui/components/InputArea.d.ts.map +1 -1
  430. package/dist/ui/components/InputArea.js +208 -50
  431. package/dist/ui/components/InputArea.js.map +1 -1
  432. package/dist/ui/components/InputArea.test.js +11 -1
  433. package/dist/ui/components/InputArea.test.js.map +1 -1
  434. package/dist/ui/components/LiveToolPanel.d.ts +30 -0
  435. package/dist/ui/components/LiveToolPanel.d.ts.map +1 -0
  436. package/dist/ui/components/LiveToolPanel.js +66 -0
  437. package/dist/ui/components/LiveToolPanel.js.map +1 -0
  438. package/dist/ui/components/Markdown.d.ts +11 -11
  439. package/dist/ui/components/Markdown.d.ts.map +1 -1
  440. package/dist/ui/components/Markdown.js +28 -198
  441. package/dist/ui/components/Markdown.js.map +1 -1
  442. package/dist/ui/components/ModelSelector.d.ts.map +1 -1
  443. package/dist/ui/components/ModelSelector.js +18 -18
  444. package/dist/ui/components/ModelSelector.js.map +1 -1
  445. package/dist/ui/components/PlanModeLogo.d.ts +3 -0
  446. package/dist/ui/components/PlanModeLogo.d.ts.map +1 -0
  447. package/dist/ui/components/PlanModeLogo.js +49 -0
  448. package/dist/ui/components/PlanModeLogo.js.map +1 -0
  449. package/dist/ui/components/PlanOverlay.d.ts +7 -0
  450. package/dist/ui/components/PlanOverlay.d.ts.map +1 -1
  451. package/dist/ui/components/PlanOverlay.js +17 -3
  452. package/dist/ui/components/PlanOverlay.js.map +1 -1
  453. package/dist/ui/components/PlanOverlay.test.d.ts +2 -0
  454. package/dist/ui/components/PlanOverlay.test.d.ts.map +1 -0
  455. package/dist/ui/components/PlanOverlay.test.js +24 -0
  456. package/dist/ui/components/PlanOverlay.test.js.map +1 -0
  457. package/dist/ui/components/QueueIndicator.d.ts +9 -0
  458. package/dist/ui/components/QueueIndicator.d.ts.map +1 -0
  459. package/dist/ui/components/QueueIndicator.js +9 -0
  460. package/dist/ui/components/QueueIndicator.js.map +1 -0
  461. package/dist/ui/components/RewindOverlay.d.ts +18 -0
  462. package/dist/ui/components/RewindOverlay.d.ts.map +1 -0
  463. package/dist/ui/components/RewindOverlay.js +52 -0
  464. package/dist/ui/components/RewindOverlay.js.map +1 -0
  465. package/dist/ui/components/SelectList.d.ts.map +1 -1
  466. package/dist/ui/components/SelectList.js +5 -0
  467. package/dist/ui/components/SelectList.js.map +1 -1
  468. package/dist/ui/components/ServerToolExecution.d.ts +2 -0
  469. package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
  470. package/dist/ui/components/ServerToolExecution.js +7 -23
  471. package/dist/ui/components/ServerToolExecution.js.map +1 -1
  472. package/dist/ui/components/SessionSummary.d.ts +5 -0
  473. package/dist/ui/components/SessionSummary.d.ts.map +1 -0
  474. package/dist/ui/components/SessionSummary.js +32 -0
  475. package/dist/ui/components/SessionSummary.js.map +1 -0
  476. package/dist/ui/components/SlashCommandMenu.d.ts +4 -3
  477. package/dist/ui/components/SlashCommandMenu.d.ts.map +1 -1
  478. package/dist/ui/components/SlashCommandMenu.js +38 -26
  479. package/dist/ui/components/SlashCommandMenu.js.map +1 -1
  480. package/dist/ui/components/SlashStyledSelectList.d.ts +21 -0
  481. package/dist/ui/components/SlashStyledSelectList.d.ts.map +1 -0
  482. package/dist/ui/components/SlashStyledSelectList.js +71 -0
  483. package/dist/ui/components/SlashStyledSelectList.js.map +1 -0
  484. package/dist/ui/components/StreamingArea.d.ts +11 -2
  485. package/dist/ui/components/StreamingArea.d.ts.map +1 -1
  486. package/dist/ui/components/StreamingArea.js +20 -23
  487. package/dist/ui/components/StreamingArea.js.map +1 -1
  488. package/dist/ui/components/StreamingArea.test.d.ts +2 -0
  489. package/dist/ui/components/StreamingArea.test.d.ts.map +1 -0
  490. package/dist/ui/components/StreamingArea.test.js +18 -0
  491. package/dist/ui/components/StreamingArea.test.js.map +1 -0
  492. package/dist/ui/components/SubAgentPanel.d.ts +2 -1
  493. package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
  494. package/dist/ui/components/SubAgentPanel.js +4 -3
  495. package/dist/ui/components/SubAgentPanel.js.map +1 -1
  496. package/dist/ui/components/TaskOverlay.d.ts.map +1 -1
  497. package/dist/ui/components/TaskOverlay.js +53 -82
  498. package/dist/ui/components/TaskOverlay.js.map +1 -1
  499. package/dist/ui/components/TaskPickerMenu.d.ts +9 -0
  500. package/dist/ui/components/TaskPickerMenu.d.ts.map +1 -0
  501. package/dist/ui/components/TaskPickerMenu.js +33 -0
  502. package/dist/ui/components/TaskPickerMenu.js.map +1 -0
  503. package/dist/ui/components/ThemeSelector.js +2 -2
  504. package/dist/ui/components/ThemeSelector.js.map +1 -1
  505. package/dist/ui/components/ToolExecution.d.ts +2 -0
  506. package/dist/ui/components/ToolExecution.d.ts.map +1 -1
  507. package/dist/ui/components/ToolExecution.js +18 -52
  508. package/dist/ui/components/ToolExecution.js.map +1 -1
  509. package/dist/ui/components/ToolGroupExecution.d.ts +6 -2
  510. package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
  511. package/dist/ui/components/ToolGroupExecution.js +15 -147
  512. package/dist/ui/components/ToolGroupExecution.js.map +1 -1
  513. package/dist/ui/components/ToolUseLoader.d.ts +3 -1
  514. package/dist/ui/components/ToolUseLoader.d.ts.map +1 -1
  515. package/dist/ui/components/ToolUseLoader.js +2 -2
  516. package/dist/ui/components/ToolUseLoader.js.map +1 -1
  517. package/dist/ui/components/TranscriptViewport.d.ts +34 -0
  518. package/dist/ui/components/TranscriptViewport.d.ts.map +1 -0
  519. package/dist/ui/components/TranscriptViewport.js +45 -0
  520. package/dist/ui/components/TranscriptViewport.js.map +1 -0
  521. package/dist/ui/components/UserMessage.d.ts.map +1 -1
  522. package/dist/ui/components/UserMessage.js +15 -10
  523. package/dist/ui/components/UserMessage.js.map +1 -1
  524. package/dist/ui/components/UserMessage.test.d.ts +2 -0
  525. package/dist/ui/components/UserMessage.test.d.ts.map +1 -0
  526. package/dist/ui/components/UserMessage.test.js +39 -0
  527. package/dist/ui/components/UserMessage.test.js.map +1 -0
  528. package/dist/ui/components/index.d.ts +5 -0
  529. package/dist/ui/components/index.d.ts.map +1 -1
  530. package/dist/ui/components/index.js +5 -0
  531. package/dist/ui/components/index.js.map +1 -1
  532. package/dist/ui/duration-format.d.ts +2 -0
  533. package/dist/ui/duration-format.d.ts.map +1 -0
  534. package/dist/ui/duration-format.js +9 -0
  535. package/dist/ui/duration-format.js.map +1 -0
  536. package/dist/ui/duration-summary.d.ts +2 -0
  537. package/dist/ui/duration-summary.d.ts.map +1 -0
  538. package/dist/ui/duration-summary.js +66 -0
  539. package/dist/ui/duration-summary.js.map +1 -0
  540. package/dist/ui/error-item.d.ts +8 -0
  541. package/dist/ui/error-item.d.ts.map +1 -0
  542. package/dist/ui/error-item.js +32 -0
  543. package/dist/ui/error-item.js.map +1 -0
  544. package/dist/ui/footer-jump-regression.test.d.ts +2 -0
  545. package/dist/ui/footer-jump-regression.test.d.ts.map +1 -0
  546. package/dist/ui/footer-jump-regression.test.js +177 -0
  547. package/dist/ui/footer-jump-regression.test.js.map +1 -0
  548. package/dist/ui/footer-status-layout.test.js +22 -7
  549. package/dist/ui/footer-status-layout.test.js.map +1 -1
  550. package/dist/ui/goal-events.d.ts.map +1 -1
  551. package/dist/ui/goal-events.js +14 -6
  552. package/dist/ui/goal-events.js.map +1 -1
  553. package/dist/ui/goal-events.test.js +40 -2
  554. package/dist/ui/goal-events.test.js.map +1 -1
  555. package/dist/ui/goal-lifecycle-orchestration.test.d.ts +2 -0
  556. package/dist/ui/goal-lifecycle-orchestration.test.d.ts.map +1 -0
  557. package/dist/ui/goal-lifecycle-orchestration.test.js +512 -0
  558. package/dist/ui/goal-lifecycle-orchestration.test.js.map +1 -0
  559. package/dist/ui/goal-overlay.test.js +122 -44
  560. package/dist/ui/goal-overlay.test.js.map +1 -1
  561. package/dist/ui/goal-status-bar.test.js +29 -0
  562. package/dist/ui/goal-status-bar.test.js.map +1 -1
  563. package/dist/ui/goal-summary.d.ts +14 -0
  564. package/dist/ui/goal-summary.d.ts.map +1 -0
  565. package/dist/ui/goal-summary.js +194 -0
  566. package/dist/ui/goal-summary.js.map +1 -0
  567. package/dist/ui/hooks/useAgentLoop.d.ts +25 -4
  568. package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
  569. package/dist/ui/hooks/useAgentLoop.js +197 -22
  570. package/dist/ui/hooks/useAgentLoop.js.map +1 -1
  571. package/dist/ui/hooks/useAgentLoop.test.d.ts +2 -0
  572. package/dist/ui/hooks/useAgentLoop.test.d.ts.map +1 -0
  573. package/dist/ui/hooks/useAgentLoop.test.js +8 -0
  574. package/dist/ui/hooks/useAgentLoop.test.js.map +1 -0
  575. package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +45 -0
  576. package/dist/ui/hooks/useChatLayoutMeasurements.d.ts.map +1 -0
  577. package/dist/ui/hooks/useChatLayoutMeasurements.js +97 -0
  578. package/dist/ui/hooks/useChatLayoutMeasurements.js.map +1 -0
  579. package/dist/ui/hooks/useContextCompaction.d.ts +41 -0
  580. package/dist/ui/hooks/useContextCompaction.d.ts.map +1 -0
  581. package/dist/ui/hooks/useContextCompaction.js +149 -0
  582. package/dist/ui/hooks/useContextCompaction.js.map +1 -0
  583. package/dist/ui/hooks/useModeState.d.ts +56 -0
  584. package/dist/ui/hooks/useModeState.d.ts.map +1 -0
  585. package/dist/ui/hooks/useModeState.js +65 -0
  586. package/dist/ui/hooks/useModeState.js.map +1 -0
  587. package/dist/ui/hooks/usePixelFixFlow.d.ts +57 -0
  588. package/dist/ui/hooks/usePixelFixFlow.d.ts.map +1 -0
  589. package/dist/ui/hooks/usePixelFixFlow.js +102 -0
  590. package/dist/ui/hooks/usePixelFixFlow.js.map +1 -0
  591. package/dist/ui/hooks/useSessionPersistence.d.ts +34 -0
  592. package/dist/ui/hooks/useSessionPersistence.d.ts.map +1 -0
  593. package/dist/ui/hooks/useSessionPersistence.js +67 -0
  594. package/dist/ui/hooks/useSessionPersistence.js.map +1 -0
  595. package/dist/ui/hooks/useTaskPickerController.d.ts +19 -0
  596. package/dist/ui/hooks/useTaskPickerController.d.ts.map +1 -0
  597. package/dist/ui/hooks/useTaskPickerController.js +41 -0
  598. package/dist/ui/hooks/useTaskPickerController.js.map +1 -0
  599. package/dist/ui/hooks/useTerminalSize.d.ts +13 -10
  600. package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
  601. package/dist/ui/hooks/useTerminalSize.js +21 -16
  602. package/dist/ui/hooks/useTerminalSize.js.map +1 -1
  603. package/dist/ui/hooks/useTranscriptHistory.d.ts +48 -0
  604. package/dist/ui/hooks/useTranscriptHistory.d.ts.map +1 -0
  605. package/dist/ui/hooks/useTranscriptHistory.js +113 -0
  606. package/dist/ui/hooks/useTranscriptHistory.js.map +1 -0
  607. package/dist/ui/hooks/useTranscriptHistory.test.d.ts +2 -0
  608. package/dist/ui/hooks/useTranscriptHistory.test.d.ts.map +1 -0
  609. package/dist/ui/hooks/useTranscriptHistory.test.js +61 -0
  610. package/dist/ui/hooks/useTranscriptHistory.test.js.map +1 -0
  611. package/dist/ui/hooks/useTranscriptScroll.d.ts +30 -0
  612. package/dist/ui/hooks/useTranscriptScroll.d.ts.map +1 -0
  613. package/dist/ui/hooks/useTranscriptScroll.js +44 -0
  614. package/dist/ui/hooks/useTranscriptScroll.js.map +1 -0
  615. package/dist/ui/hooks/useTranscriptScroll.test.d.ts +2 -0
  616. package/dist/ui/hooks/useTranscriptScroll.test.d.ts.map +1 -0
  617. package/dist/ui/hooks/useTranscriptScroll.test.js +119 -0
  618. package/dist/ui/hooks/useTranscriptScroll.test.js.map +1 -0
  619. package/dist/ui/item-helpers.d.ts +26 -0
  620. package/dist/ui/item-helpers.d.ts.map +1 -0
  621. package/dist/ui/item-helpers.js +114 -0
  622. package/dist/ui/item-helpers.js.map +1 -0
  623. package/dist/ui/layout-decisions.d.ts +81 -0
  624. package/dist/ui/layout-decisions.d.ts.map +1 -0
  625. package/dist/ui/layout-decisions.js +89 -0
  626. package/dist/ui/layout-decisions.js.map +1 -0
  627. package/dist/ui/live-area-clamp.test.d.ts +2 -0
  628. package/dist/ui/live-area-clamp.test.d.ts.map +1 -0
  629. package/dist/ui/live-area-clamp.test.js +88 -0
  630. package/dist/ui/live-area-clamp.test.js.map +1 -0
  631. package/dist/ui/live-area-height.d.ts +35 -0
  632. package/dist/ui/live-area-height.d.ts.map +1 -0
  633. package/dist/ui/live-area-height.js +80 -0
  634. package/dist/ui/live-area-height.js.map +1 -0
  635. package/dist/ui/live-area-height.test.d.ts +2 -0
  636. package/dist/ui/live-area-height.test.d.ts.map +1 -0
  637. package/dist/ui/live-area-height.test.js +67 -0
  638. package/dist/ui/live-area-height.test.js.map +1 -0
  639. package/dist/ui/live-frame-height.test.d.ts +2 -0
  640. package/dist/ui/live-frame-height.test.d.ts.map +1 -0
  641. package/dist/ui/live-frame-height.test.js +116 -0
  642. package/dist/ui/live-frame-height.test.js.map +1 -0
  643. package/dist/ui/live-item-flush.d.ts +2 -2
  644. package/dist/ui/live-item-flush.d.ts.map +1 -1
  645. package/dist/ui/live-item-flush.js +8 -4
  646. package/dist/ui/live-item-flush.js.map +1 -1
  647. package/dist/ui/login.js +1 -1
  648. package/dist/ui/long-prompt-regression-harness.test.d.ts +2 -0
  649. package/dist/ui/long-prompt-regression-harness.test.d.ts.map +1 -0
  650. package/dist/ui/long-prompt-regression-harness.test.js +195 -0
  651. package/dist/ui/long-prompt-regression-harness.test.js.map +1 -0
  652. package/dist/ui/mcp.d.ts +62 -0
  653. package/dist/ui/mcp.d.ts.map +1 -0
  654. package/dist/ui/mcp.js +306 -0
  655. package/dist/ui/mcp.js.map +1 -0
  656. package/dist/ui/plan-overlay.test.js +7 -29
  657. package/dist/ui/plan-overlay.test.js.map +1 -1
  658. package/dist/ui/prompt-routing.d.ts +11 -0
  659. package/dist/ui/prompt-routing.d.ts.map +1 -0
  660. package/dist/ui/prompt-routing.js +61 -0
  661. package/dist/ui/prompt-routing.js.map +1 -0
  662. package/dist/ui/queued-message.test.d.ts +2 -0
  663. package/dist/ui/queued-message.test.d.ts.map +1 -0
  664. package/dist/ui/queued-message.test.js +162 -0
  665. package/dist/ui/queued-message.test.js.map +1 -0
  666. package/dist/ui/render.d.ts +38 -42
  667. package/dist/ui/render.d.ts.map +1 -1
  668. package/dist/ui/render.js +128 -42
  669. package/dist/ui/render.js.map +1 -1
  670. package/dist/ui/render.test.d.ts +2 -0
  671. package/dist/ui/render.test.d.ts.map +1 -0
  672. package/dist/ui/render.test.js +16 -0
  673. package/dist/ui/render.test.js.map +1 -0
  674. package/dist/ui/scroll-stabilization.test.js +1 -7
  675. package/dist/ui/scroll-stabilization.test.js.map +1 -1
  676. package/dist/ui/session-summary.d.ts +63 -0
  677. package/dist/ui/session-summary.d.ts.map +1 -0
  678. package/dist/ui/session-summary.js +81 -0
  679. package/dist/ui/session-summary.js.map +1 -0
  680. package/dist/ui/slash-command-images.test.js +12 -11
  681. package/dist/ui/slash-command-images.test.js.map +1 -1
  682. package/dist/ui/stores/transcript-scroll-store.d.ts +27 -0
  683. package/dist/ui/stores/transcript-scroll-store.d.ts.map +1 -0
  684. package/dist/ui/stores/transcript-scroll-store.js +73 -0
  685. package/dist/ui/stores/transcript-scroll-store.js.map +1 -0
  686. package/dist/ui/stores/transcript-scroll-store.test.d.ts +2 -0
  687. package/dist/ui/stores/transcript-scroll-store.test.d.ts.map +1 -0
  688. package/dist/ui/stores/transcript-scroll-store.test.js +73 -0
  689. package/dist/ui/stores/transcript-scroll-store.test.js.map +1 -0
  690. package/dist/ui/streaming-flush-bounce.test.d.ts +2 -0
  691. package/dist/ui/streaming-flush-bounce.test.d.ts.map +1 -0
  692. package/dist/ui/streaming-flush-bounce.test.js +156 -0
  693. package/dist/ui/streaming-flush-bounce.test.js.map +1 -0
  694. package/dist/ui/submit-prompt-command.d.ts +49 -0
  695. package/dist/ui/submit-prompt-command.d.ts.map +1 -0
  696. package/dist/ui/submit-prompt-command.js +107 -0
  697. package/dist/ui/submit-prompt-command.js.map +1 -0
  698. package/dist/ui/submit-slash-commands.d.ts +12 -0
  699. package/dist/ui/submit-slash-commands.d.ts.map +1 -0
  700. package/dist/ui/submit-slash-commands.js +32 -0
  701. package/dist/ui/submit-slash-commands.js.map +1 -0
  702. package/dist/ui/terminal-history-format.d.ts +43 -0
  703. package/dist/ui/terminal-history-format.d.ts.map +1 -0
  704. package/dist/ui/terminal-history-format.js +133 -0
  705. package/dist/ui/terminal-history-format.js.map +1 -0
  706. package/dist/ui/terminal-history-retry-dedup.test.d.ts +2 -0
  707. package/dist/ui/terminal-history-retry-dedup.test.d.ts.map +1 -0
  708. package/dist/ui/terminal-history-retry-dedup.test.js +61 -0
  709. package/dist/ui/terminal-history-retry-dedup.test.js.map +1 -0
  710. package/dist/ui/terminal-history-spacing.d.ts +2 -0
  711. package/dist/ui/terminal-history-spacing.d.ts.map +1 -0
  712. package/dist/ui/terminal-history-spacing.js +2 -0
  713. package/dist/ui/terminal-history-spacing.js.map +1 -0
  714. package/dist/ui/terminal-history-status-renderers.d.ts +15 -0
  715. package/dist/ui/terminal-history-status-renderers.d.ts.map +1 -0
  716. package/dist/ui/terminal-history-status-renderers.js +99 -0
  717. package/dist/ui/terminal-history-status-renderers.js.map +1 -0
  718. package/dist/ui/terminal-history.d.ts +26 -0
  719. package/dist/ui/terminal-history.d.ts.map +1 -0
  720. package/dist/ui/terminal-history.js +916 -0
  721. package/dist/ui/terminal-history.js.map +1 -0
  722. package/dist/ui/terminal-history.test.d.ts +2 -0
  723. package/dist/ui/terminal-history.test.d.ts.map +1 -0
  724. package/dist/ui/terminal-history.test.js +550 -0
  725. package/dist/ui/terminal-history.test.js.map +1 -0
  726. package/dist/ui/testing/screen-recorder.d.ts +29 -0
  727. package/dist/ui/testing/screen-recorder.d.ts.map +1 -0
  728. package/dist/ui/testing/screen-recorder.js +179 -0
  729. package/dist/ui/testing/screen-recorder.js.map +1 -0
  730. package/dist/ui/thinking-level-cycle.test.d.ts +2 -0
  731. package/dist/ui/thinking-level-cycle.test.d.ts.map +1 -0
  732. package/dist/ui/thinking-level-cycle.test.js +45 -0
  733. package/dist/ui/thinking-level-cycle.test.js.map +1 -0
  734. package/dist/ui/thinking-level.d.ts +2 -0
  735. package/dist/ui/thinking-level.d.ts.map +1 -0
  736. package/dist/ui/thinking-level.js +2 -0
  737. package/dist/ui/thinking-level.js.map +1 -0
  738. package/dist/ui/tool-group-summary.d.ts +24 -0
  739. package/dist/ui/tool-group-summary.d.ts.map +1 -0
  740. package/dist/ui/tool-group-summary.js +233 -0
  741. package/dist/ui/tool-group-summary.js.map +1 -0
  742. package/dist/ui/tool-group-summary.test.d.ts +2 -0
  743. package/dist/ui/tool-group-summary.test.d.ts.map +1 -0
  744. package/dist/ui/tool-group-summary.test.js +79 -0
  745. package/dist/ui/tool-group-summary.test.js.map +1 -0
  746. package/dist/ui/tool-line-summary.d.ts +29 -0
  747. package/dist/ui/tool-line-summary.d.ts.map +1 -0
  748. package/dist/ui/tool-line-summary.js +153 -0
  749. package/dist/ui/tool-line-summary.js.map +1 -0
  750. package/dist/ui/transcript/MiscRows.d.ts +26 -0
  751. package/dist/ui/transcript/MiscRows.d.ts.map +1 -0
  752. package/dist/ui/transcript/MiscRows.js +68 -0
  753. package/dist/ui/transcript/MiscRows.js.map +1 -0
  754. package/dist/ui/transcript/StatusRow.d.ts +14 -0
  755. package/dist/ui/transcript/StatusRow.d.ts.map +1 -0
  756. package/dist/ui/transcript/StatusRow.js +14 -0
  757. package/dist/ui/transcript/StatusRow.js.map +1 -0
  758. package/dist/ui/transcript/ToolRows.d.ts +20 -0
  759. package/dist/ui/transcript/ToolRows.d.ts.map +1 -0
  760. package/dist/ui/transcript/ToolRows.js +25 -0
  761. package/dist/ui/transcript/ToolRows.js.map +1 -0
  762. package/dist/ui/transcript/TranscriptItemFrame.d.ts +8 -0
  763. package/dist/ui/transcript/TranscriptItemFrame.d.ts.map +1 -0
  764. package/dist/ui/transcript/TranscriptItemFrame.js +9 -0
  765. package/dist/ui/transcript/TranscriptItemFrame.js.map +1 -0
  766. package/dist/ui/transcript/TranscriptRenderer.d.ts +22 -0
  767. package/dist/ui/transcript/TranscriptRenderer.d.ts.map +1 -0
  768. package/dist/ui/transcript/TranscriptRenderer.js +111 -0
  769. package/dist/ui/transcript/TranscriptRenderer.js.map +1 -0
  770. package/dist/ui/transcript/presentation.d.ts +61 -0
  771. package/dist/ui/transcript/presentation.d.ts.map +1 -0
  772. package/dist/ui/transcript/presentation.js +86 -0
  773. package/dist/ui/transcript/presentation.js.map +1 -0
  774. package/dist/ui/transcript/spacing.d.ts +56 -0
  775. package/dist/ui/transcript/spacing.d.ts.map +1 -0
  776. package/dist/ui/transcript/spacing.js +129 -0
  777. package/dist/ui/transcript/spacing.js.map +1 -0
  778. package/dist/ui/transcript/spacing.test.d.ts +2 -0
  779. package/dist/ui/transcript/spacing.test.d.ts.map +1 -0
  780. package/dist/ui/transcript/spacing.test.js +193 -0
  781. package/dist/ui/transcript/spacing.test.js.map +1 -0
  782. package/dist/ui/transcript/tool-presentation.d.ts +12 -0
  783. package/dist/ui/transcript/tool-presentation.d.ts.map +1 -0
  784. package/dist/ui/transcript/tool-presentation.js +55 -0
  785. package/dist/ui/transcript/tool-presentation.js.map +1 -0
  786. package/dist/ui/transcript/transcript-lines.d.ts +32 -0
  787. package/dist/ui/transcript/transcript-lines.d.ts.map +1 -0
  788. package/dist/ui/transcript/transcript-lines.js +86 -0
  789. package/dist/ui/transcript/transcript-lines.js.map +1 -0
  790. package/dist/ui/transcript/transcript-lines.test.d.ts +2 -0
  791. package/dist/ui/transcript/transcript-lines.test.d.ts.map +1 -0
  792. package/dist/ui/transcript/transcript-lines.test.js +76 -0
  793. package/dist/ui/transcript/transcript-lines.test.js.map +1 -0
  794. package/dist/ui/transcript-viewport-pinning.test.d.ts +2 -0
  795. package/dist/ui/transcript-viewport-pinning.test.d.ts.map +1 -0
  796. package/dist/ui/transcript-viewport-pinning.test.js +148 -0
  797. package/dist/ui/transcript-viewport-pinning.test.js.map +1 -0
  798. package/dist/ui/tui-history-parity.test.d.ts +2 -0
  799. package/dist/ui/tui-history-parity.test.d.ts.map +1 -0
  800. package/dist/ui/tui-history-parity.test.js +381 -0
  801. package/dist/ui/tui-history-parity.test.js.map +1 -0
  802. package/dist/ui/tui-simulation.test.d.ts +2 -0
  803. package/dist/ui/tui-simulation.test.d.ts.map +1 -0
  804. package/dist/ui/tui-simulation.test.js +139 -0
  805. package/dist/ui/tui-simulation.test.js.map +1 -0
  806. package/dist/ui/tui-terminal-recorder.test.d.ts +2 -0
  807. package/dist/ui/tui-terminal-recorder.test.d.ts.map +1 -0
  808. package/dist/ui/tui-terminal-recorder.test.js +134 -0
  809. package/dist/ui/tui-terminal-recorder.test.js.map +1 -0
  810. package/dist/ui/utils/assistant-stream-split.d.ts +23 -0
  811. package/dist/ui/utils/assistant-stream-split.d.ts.map +1 -0
  812. package/dist/ui/utils/assistant-stream-split.js +41 -0
  813. package/dist/ui/utils/assistant-stream-split.js.map +1 -0
  814. package/dist/ui/utils/assistant-stream-split.test.d.ts +2 -0
  815. package/dist/ui/utils/assistant-stream-split.test.d.ts.map +1 -0
  816. package/dist/ui/utils/assistant-stream-split.test.js +40 -0
  817. package/dist/ui/utils/assistant-stream-split.test.js.map +1 -0
  818. package/dist/ui/utils/latex-to-unicode.d.ts +22 -0
  819. package/dist/ui/utils/latex-to-unicode.d.ts.map +1 -0
  820. package/dist/ui/utils/latex-to-unicode.js +538 -0
  821. package/dist/ui/utils/latex-to-unicode.js.map +1 -0
  822. package/dist/ui/utils/markdown-renderer.d.ts +20 -0
  823. package/dist/ui/utils/markdown-renderer.d.ts.map +1 -0
  824. package/dist/ui/utils/markdown-renderer.js +327 -0
  825. package/dist/ui/utils/markdown-renderer.js.map +1 -0
  826. package/dist/ui/utils/markdown-table.d.ts +9 -0
  827. package/dist/ui/utils/markdown-table.d.ts.map +1 -0
  828. package/dist/ui/utils/markdown-table.js +95 -0
  829. package/dist/ui/utils/markdown-table.js.map +1 -0
  830. package/dist/ui/utils/terminal-graphics.d.ts +16 -0
  831. package/dist/ui/utils/terminal-graphics.d.ts.map +1 -0
  832. package/dist/ui/utils/terminal-graphics.js +68 -0
  833. package/dist/ui/utils/terminal-graphics.js.map +1 -0
  834. package/dist/ui/utils/terminal-graphics.test.d.ts +2 -0
  835. package/dist/ui/utils/terminal-graphics.test.d.ts.map +1 -0
  836. package/dist/ui/utils/terminal-graphics.test.js +61 -0
  837. package/dist/ui/utils/terminal-graphics.test.js.map +1 -0
  838. package/dist/ui/utils/terminal-input.d.ts +3 -0
  839. package/dist/ui/utils/terminal-input.d.ts.map +1 -0
  840. package/dist/ui/utils/terminal-input.js +28 -0
  841. package/dist/ui/utils/terminal-input.js.map +1 -0
  842. package/dist/ui/utils/terminal-input.test.d.ts +2 -0
  843. package/dist/ui/utils/terminal-input.test.d.ts.map +1 -0
  844. package/dist/ui/utils/terminal-input.test.js +15 -0
  845. package/dist/ui/utils/terminal-input.test.js.map +1 -0
  846. package/dist/ui/utils/text-utils.d.ts +8 -0
  847. package/dist/ui/utils/text-utils.d.ts.map +1 -0
  848. package/dist/ui/utils/text-utils.js +16 -0
  849. package/dist/ui/utils/text-utils.js.map +1 -0
  850. package/dist/ui/utils/token-to-ansi.js +19 -9
  851. package/dist/ui/utils/token-to-ansi.js.map +1 -1
  852. package/dist/ui/utils/user-message-display.d.ts +7 -0
  853. package/dist/ui/utils/user-message-display.d.ts.map +1 -0
  854. package/dist/ui/utils/user-message-display.js +26 -0
  855. package/dist/ui/utils/user-message-display.js.map +1 -0
  856. package/dist/utils/format.js +7 -9
  857. package/dist/utils/format.js.map +1 -1
  858. package/dist/utils/image.d.ts +9 -0
  859. package/dist/utils/image.d.ts.map +1 -1
  860. package/dist/utils/image.js +25 -0
  861. package/dist/utils/image.js.map +1 -1
  862. package/dist/utils/plan-steps.d.ts.map +1 -1
  863. package/dist/utils/plan-steps.js +5 -1
  864. package/dist/utils/plan-steps.js.map +1 -1
  865. package/dist/utils/plan-steps.test.d.ts +2 -0
  866. package/dist/utils/plan-steps.test.d.ts.map +1 -0
  867. package/dist/utils/plan-steps.test.js +16 -0
  868. package/dist/utils/plan-steps.test.js.map +1 -0
  869. package/package.json +50 -10
  870. package/dist/core/repomap-context.d.ts +0 -11
  871. package/dist/core/repomap-context.d.ts.map +0 -1
  872. package/dist/core/repomap-context.js +0 -68
  873. package/dist/core/repomap-context.js.map +0 -1
  874. package/dist/core/repomap-context.test.d.ts +0 -2
  875. package/dist/core/repomap-context.test.d.ts.map +0 -1
  876. package/dist/core/repomap-context.test.js +0 -47
  877. package/dist/core/repomap-context.test.js.map +0 -1
  878. package/dist/core/repomap.d.ts +0 -74
  879. package/dist/core/repomap.d.ts.map +0 -1
  880. package/dist/core/repomap.js +0 -906
  881. package/dist/core/repomap.js.map +0 -1
  882. package/dist/core/repomap.test.d.ts +0 -2
  883. package/dist/core/repomap.test.d.ts.map +0 -1
  884. package/dist/core/repomap.test.js +0 -494
  885. package/dist/core/repomap.test.js.map +0 -1
  886. package/dist/ui/components/EyesOverlay.d.ts +0 -10
  887. package/dist/ui/components/EyesOverlay.d.ts.map +0 -1
  888. package/dist/ui/components/EyesOverlay.js +0 -220
  889. package/dist/ui/components/EyesOverlay.js.map +0 -1
@@ -1,9 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useRef, useState } from "react";
3
- import { Box, Text, useInput } from "ink";
3
+ import { Box, Static, Text, useInput, useStdout } from "ink";
4
4
  import { basename } from "node:path";
5
5
  import { formatGoalPrerequisiteInstruction, goalHasBlockingPrerequisites, isBlockingGoalPrerequisite, loadGoalRuns, saveGoalRuns, summarizeGoalCountsFromRuns, } from "../../core/goal-store.js";
6
6
  import { useTerminalSize } from "../hooks/useTerminalSize.js";
7
+ import { buildGoalFinalSummarySections } from "../goal-summary.js";
8
+ import { Markdown } from "./Markdown.js";
7
9
  import { useTheme } from "../theme/theme.js";
8
10
  const GOAL_LOGO = [" ▄▀▀▀ ▄▀▀▀", " █ ▀█ █ ▀█", " ▀▄▄▀ ▀▄▄▀"];
9
11
  const GRADIENT = [
@@ -21,6 +23,7 @@ const GOAL_ACTIVE = "#fbbf24";
21
23
  const GAP = " ";
22
24
  const LOGO_WIDTH = 9;
23
25
  const SIDE_BY_SIDE_MIN = LOGO_WIDTH + GAP.length + 20;
26
+ const PREFIX_WIDTH = 2;
24
27
  export function clampGoalSelectedIndex(index, length) {
25
28
  if (length <= 0)
26
29
  return 0;
@@ -110,40 +113,6 @@ export function getGoalScrollOffsetForSelection({ selectedIndex, currentOffset,
110
113
  return clampGoalScrollOffset(selected - rows + 1, itemCount, rows);
111
114
  return offset;
112
115
  }
113
- export function getGoalDetailRowCount(run) {
114
- let count = 2;
115
- count += 1 + Math.max(1, run.successCriteria.length);
116
- if (run.prerequisites.length > 0) {
117
- count += 1;
118
- for (const prerequisite of run.prerequisites) {
119
- count += 1;
120
- if (isBlockingGoalPrerequisite(prerequisite) || prerequisite.evidence)
121
- count += 1;
122
- }
123
- }
124
- count += 1;
125
- if (run.tasks.length === 0) {
126
- count += 1;
127
- }
128
- else {
129
- for (const task of run.tasks) {
130
- count += 1;
131
- if (task.lastSummary)
132
- count += 1;
133
- }
134
- }
135
- if (run.harness.length > 0)
136
- count += 1 + run.harness.length;
137
- if (run.evidencePlan.length > 0)
138
- count += 1 + run.evidencePlan.length;
139
- if (run.verifier)
140
- count += 2;
141
- if (run.blockers.length > 0)
142
- count += 1 + run.blockers.length;
143
- if (run.evidence.length > 0)
144
- count += 1 + Math.min(5, run.evidence.length);
145
- return count;
146
- }
147
116
  export function getGoalCardExtraRowCount(run) {
148
117
  let count = 0;
149
118
  if (goalHasBlockingPrerequisites(run))
@@ -224,44 +193,17 @@ export function getGoalListWindow({ runs, selectedIndex, viewportRows, }) {
224
193
  rowsUsed: fixedRows + indicatorRows + cardRows,
225
194
  };
226
195
  }
227
- export function getGoalExpandedDetailViewportRows({ viewportRows, cardExtraRows, }) {
228
- const rows = Number.isFinite(viewportRows) ? Math.max(1, Math.floor(viewportRows)) : 8;
229
- const selectedCardRows = 1 + Math.max(0, Math.floor(cardExtraRows));
230
- const fixedRows = 1 + // Goals heading
231
- selectedCardRows +
232
- 2 + // selected card border
233
- 1 + // detail top margin
234
- 1; // selected card bottom margin
235
- return Math.max(1, rows - fixedRows);
236
- }
237
- export function clampGoalDetailScrollOffset(offset, detailRowCount, viewportRows) {
238
- const visibleRows = Math.max(1, Math.floor(viewportRows));
239
- const scrolledBodyRows = Math.max(1, visibleRows - 1);
240
- const maxOffset = Math.max(0, detailRowCount - scrolledBodyRows);
241
- if (!Number.isFinite(offset))
242
- return 0;
243
- return Math.min(Math.max(0, Math.floor(offset)), maxOffset);
244
- }
245
- export function getGoalDetailScrollWindow({ detailRowCount, scrollOffset, viewportRows, }) {
246
- const rows = Math.max(1, Math.floor(viewportRows));
247
- const start = clampGoalDetailScrollOffset(scrollOffset, detailRowCount, rows);
248
- const topIndicatorRows = start > 0 && rows > 2 ? 1 : 0;
249
- let bodyRows = Math.max(1, rows - topIndicatorRows);
250
- let hiddenAfter = Math.max(0, detailRowCount - start - bodyRows);
251
- if (hiddenAfter > 0 && bodyRows > 1) {
252
- bodyRows -= 1;
253
- hiddenAfter = Math.max(0, detailRowCount - start - bodyRows);
254
- }
255
- return {
256
- start,
257
- end: Math.min(detailRowCount, start + bodyRows),
258
- hiddenBefore: start,
259
- hiddenAfter,
260
- };
261
- }
262
196
  export function sortGoalRunsForOverlay(runs) {
263
197
  return [...runs].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
264
198
  }
199
+ export function getGoalAutoExpandedState({ autoExpandNewest, loaded, runs, alreadyExpanded, }) {
200
+ if (!autoExpandNewest || !loaded || runs.length === 0 || alreadyExpanded)
201
+ return null;
202
+ const newestRun = runs[0];
203
+ if (!newestRun)
204
+ return null;
205
+ return { selectedIndex: 0, expandedRunId: newestRun.id };
206
+ }
265
207
  export function shouldPersistGoalOverlayRuns(previousRuns, nextRuns) {
266
208
  if (nextRuns.length > 0)
267
209
  return true;
@@ -323,41 +265,6 @@ function verifierSummaryColor(run, fallbackColor) {
323
265
  return "magenta";
324
266
  return fallbackColor;
325
267
  }
326
- function taskStatusColor(status) {
327
- switch (status) {
328
- case "done":
329
- return "green";
330
- case "failed":
331
- return "red";
332
- case "blocked":
333
- return "yellow";
334
- case "running":
335
- case "verifying":
336
- return "cyan";
337
- case "pending":
338
- return "blue";
339
- }
340
- }
341
- function prerequisiteStatusColor(status) {
342
- switch (status) {
343
- case "met":
344
- return "green";
345
- case "missing":
346
- return "yellow";
347
- case "unknown":
348
- return "cyan";
349
- }
350
- }
351
- function evidencePlanStatusColor(status) {
352
- switch (status) {
353
- case "ready":
354
- return "green";
355
- case "blocked":
356
- return "yellow";
357
- case "planned":
358
- return "cyan";
359
- }
360
- }
361
268
  function verifierStatusColor(status) {
362
269
  switch (status) {
363
270
  case "pass":
@@ -368,139 +275,229 @@ function verifierStatusColor(status) {
368
275
  return "yellow";
369
276
  }
370
277
  }
371
- function evidenceKindColor(kind) {
372
- switch (kind) {
373
- case "command":
374
- return "cyan";
375
- case "file":
376
- return "blue";
377
- case "log":
378
- return "yellow";
379
- case "screenshot":
380
- return "magenta";
381
- case "summary":
382
- return "green";
383
- }
384
- }
385
- export function getGoalDetailTaskHeading(run) {
386
- return run.prerequisites.length > 0 ? "2. Worker tasks" : "Worker tasks";
387
- }
388
- export function getGoalUserPrerequisiteHeading(run) {
389
- return run.prerequisites.length > 0 ? "1. User prerequisites" : null;
390
- }
391
- export function formatGoalTaskDetailSummary(summary) {
392
- const firstLine = summary
393
- .split("\n")
394
- .map((line) => line.trim())
395
- .find((line) => line.length > 0);
396
- if (!firstLine)
397
- return "";
398
- return firstLine.length > 180 ? `${firstLine.slice(0, 177)}…` : firstLine;
399
- }
400
- function truncateGoalDetailText(text, maxLength = 220) {
401
- const collapsed = text.replace(/\s+/g, " ").trim();
402
- return collapsed.length > maxLength ? `${collapsed.slice(0, maxLength - 1)}…` : collapsed;
403
- }
404
- function GoalHeader({ cwd, runs, agentRunning, }) {
405
- const theme = useTheme();
406
- const { columns } = useTerminalSize();
407
- const displayPath = formatDisplayPath(cwd);
408
- const counts = summarizeGoalCountsFromRuns(runs);
409
- if (columns < SIDE_BY_SIDE_MIN) {
410
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, width: columns, children: [_jsx(GoalGradientText, { text: GOAL_LOGO[0] }), _jsx(GoalGradientText, { text: GOAL_LOGO[1] }), _jsx(GoalGradientText, { text: GOAL_LOGO[2] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: GOAL_SUCCESS, bold: true, children: "Goal Pane" }), agentRunning && _jsx(Text, { color: GOAL_ACTIVE, children: " (agent running)" }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", basename(cwd)] })] }), _jsx(Text, { color: theme.textDim, wrap: "truncate", children: displayPath }), _jsxs(Text, { children: [_jsxs(Text, { color: GOAL_SUCCESS, children: [counts.passed, " passed"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.running, " active"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: theme.text, children: [counts.pending, " pending"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.blocked, " blocked"] })] })] }));
411
- }
412
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, width: columns, children: [_jsxs(Box, { children: [_jsx(GoalGradientText, { text: GOAL_LOGO[0] }), _jsx(Text, { children: GAP }), _jsx(Text, { color: GOAL_SUCCESS, bold: true, children: "Goal Pane" }), agentRunning && _jsx(Text, { color: GOAL_ACTIVE, children: " (agent running)" })] }), _jsxs(Box, { children: [_jsx(GoalGradientText, { text: GOAL_LOGO[1] }), _jsx(Text, { children: GAP }), _jsx(Text, { color: theme.textDim, wrap: "truncate", children: displayPath })] }), _jsxs(Box, { children: [_jsx(GoalGradientText, { text: GOAL_LOGO[2] }), _jsx(Text, { children: GAP }), _jsxs(Text, { children: [_jsxs(Text, { color: GOAL_SUCCESS, children: [counts.passed, " passed"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.running, " active"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: theme.text, children: [counts.pending, " pending"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.blocked, " blocked"] })] })] })] }));
413
- }
414
- function StatusChip({ label, color }) {
415
- return (_jsxs(Text, { color: color, bold: true, children: ["\u25D6 ", label, " \u25D7"] }));
416
- }
417
- function GoalDetail({ run, maxRows, scrollOffset, }) {
418
- const theme = useTheme();
419
- const rows = [
420
- _jsxs(Text, { children: [_jsx(Text, { color: theme.primary, bold: true, children: "Goal" }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: statusColor(run.status) || theme.secondary, children: getGoalReadinessText(run) }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", formatGoalProgressText(run)] })] }, "goal-heading"),
421
- _jsx(Text, { color: theme.text, children: truncateGoalDetailText(run.goal || run.title) }, "goal-text"),
422
- _jsx(Text, { color: theme.primary, bold: true, children: "Success criteria" }, "success-heading"),
278
+ function normalizeGoalPlanText(text) {
279
+ return text.replace(/\s+/g, " ").trim();
280
+ }
281
+ function markdownListItem(text) {
282
+ const normalized = normalizeGoalPlanText(text);
283
+ return `- ${normalized || "not recorded"}`;
284
+ }
285
+ function markdownCode(value) {
286
+ return `\`${value.replace(/`/g, "\\`")}\``;
287
+ }
288
+ function appendGoalMetadataLine(lines, label, value) {
289
+ if (!value)
290
+ return;
291
+ lines.push(` - ${label}: ${value}`);
292
+ }
293
+ export function formatGoalPlanMarkdown(run) {
294
+ const lines = [
295
+ `# ${run.title}`,
296
+ "",
297
+ `**Status:** ${run.status}`,
298
+ `**Readiness:** ${getGoalReadinessText(run)}`,
299
+ `**Progress:** ${formatGoalProgressText(run)}`,
300
+ `**Verifier:** ${formatGoalVerifierSummary(run)}`,
301
+ `**Goal ID:** ${run.id}`,
302
+ `**Project:** ${run.projectPath}`,
303
+ `**Updated:** ${run.updatedAt}`,
304
+ "",
305
+ "## Goal",
306
+ "",
307
+ run.goal || run.title,
308
+ "",
309
+ "## Success criteria",
310
+ "",
423
311
  ];
424
312
  if (run.successCriteria.length === 0) {
425
- rows.push(_jsx(Text, { color: theme.textDim, children: "- none recorded" }, "success-none"));
313
+ lines.push("- none recorded");
426
314
  }
427
315
  else {
428
- for (const [index, criterion] of run.successCriteria.entries()) {
429
- rows.push(_jsxs(Text, { children: [_jsx(Text, { color: "green", children: "\u2713 " }), _jsx(Text, { color: theme.text, children: truncateGoalDetailText(criterion) })] }, `success-${index}`));
316
+ lines.push(...run.successCriteria.map(markdownListItem));
317
+ }
318
+ const finalSummarySections = buildGoalFinalSummarySections(run);
319
+ if (finalSummarySections.length > 0) {
320
+ lines.push("", "## Final summary", "");
321
+ for (const section of finalSummarySections) {
322
+ lines.push(`### ${section.title}`, "", ...section.lines.map(markdownListItem), "");
430
323
  }
431
324
  }
432
- if (run.prerequisites.length > 0) {
433
- rows.push(_jsx(Text, { color: theme.primary, bold: true, children: getGoalUserPrerequisiteHeading(run) }, "prereq-heading"));
325
+ lines.push("", "## User prerequisites", "");
326
+ if (run.prerequisites.length === 0) {
327
+ lines.push("- none recorded");
328
+ }
329
+ else {
434
330
  for (const prerequisite of run.prerequisites) {
435
- rows.push(_jsxs(Text, { children: [_jsxs(Text, { color: prerequisiteStatusColor(prerequisite.status), children: ["\u25CF ", prerequisite.status] }), _jsxs(Text, { color: theme.text, bold: isBlockingGoalPrerequisite(prerequisite), children: [" ", prerequisite.label] }), isBlockingGoalPrerequisite(prerequisite) ? (_jsx(Text, { color: theme.warning, children: " \u00B7 user action required" })) : null] }, `prereq-${prerequisite.id}`));
331
+ lines.push(`- **${prerequisite.status}** ${prerequisite.label}`);
332
+ appendGoalMetadataLine(lines, "ID", markdownCode(prerequisite.id));
333
+ appendGoalMetadataLine(lines, "Check", prerequisite.checkCommand ? markdownCode(prerequisite.checkCommand) : undefined);
334
+ appendGoalMetadataLine(lines, "Instructions", prerequisite.instructions);
335
+ appendGoalMetadataLine(lines, "Evidence", prerequisite.evidence);
436
336
  if (isBlockingGoalPrerequisite(prerequisite)) {
437
- rows.push(_jsxs(Text, { color: theme.textDim, wrap: "truncate", children: ["\u2514\u2500 ", formatGoalPrerequisiteInstruction(prerequisite)] }, `prereq-${prerequisite.id}-instruction`));
438
- }
439
- else if (prerequisite.evidence) {
440
- rows.push(_jsxs(Text, { color: theme.textDim, wrap: "truncate", children: ["\u2514\u2500 ", prerequisite.evidence] }, `prereq-${prerequisite.id}-evidence`));
337
+ appendGoalMetadataLine(lines, "User action required", formatGoalPrerequisiteInstruction(prerequisite));
441
338
  }
442
339
  }
443
340
  }
444
- rows.push(_jsx(Text, { color: theme.primary, bold: true, children: getGoalDetailTaskHeading(run) }, "task-heading"));
341
+ lines.push("", "## Worker tasks", "");
445
342
  if (run.tasks.length === 0) {
446
- rows.push(_jsx(Text, { color: theme.textDim, children: goalHasBlockingPrerequisites(run)
447
- ? " Waiting for prerequisites before workers can start."
448
- : " No worker tasks yet — run the goal to generate focused work." }, "no-tasks"));
343
+ lines.push(goalHasBlockingPrerequisites(run)
344
+ ? "- Waiting for prerequisites before workers can start."
345
+ : "- No worker tasks yet — run the goal to generate focused work.");
449
346
  }
450
347
  else {
451
348
  for (const task of run.tasks) {
452
- rows.push(_jsxs(Text, { children: [_jsxs(Text, { color: taskStatusColor(task.status), children: ["\u25CF ", task.status] }), _jsxs(Text, { color: theme.text, children: [" ", task.title] }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 try ", task.attempts] }), task.workerId ? _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", task.workerId] }) : null] }, `task-${task.id}`));
453
- if (task.lastSummary) {
454
- rows.push(_jsxs(Text, { color: theme.textDim, wrap: "truncate", children: ["\u2514\u2500 ", formatGoalTaskDetailSummary(task.lastSummary)] }, `task-${task.id}-summary`));
349
+ lines.push(`- **${task.status}** ${task.title}`);
350
+ appendGoalMetadataLine(lines, "ID", markdownCode(task.id));
351
+ appendGoalMetadataLine(lines, "Attempts", String(task.attempts));
352
+ appendGoalMetadataLine(lines, "Worker", task.workerId ? markdownCode(task.workerId) : undefined);
353
+ appendGoalMetadataLine(lines, "Prompt", task.prompt);
354
+ if (task.verification) {
355
+ appendGoalMetadataLine(lines, "Verification", task.verification.status);
356
+ appendGoalMetadataLine(lines, "Verification summary", task.verification.summary);
357
+ appendGoalMetadataLine(lines, "Verification command", task.verification.command ? markdownCode(task.verification.command) : undefined);
358
+ appendGoalMetadataLine(lines, "Verification output", task.verification.outputPath);
455
359
  }
360
+ appendGoalMetadataLine(lines, "Last summary", task.lastSummary);
456
361
  }
457
362
  }
458
- if (run.harness.length > 0) {
459
- rows.push(_jsx(Text, { color: theme.primary, bold: true, children: "Harness" }, "harness-heading"));
363
+ lines.push("", "## Harness", "");
364
+ if (run.harness.length === 0) {
365
+ lines.push("- none recorded");
366
+ }
367
+ else {
460
368
  for (const item of run.harness) {
461
- rows.push(_jsxs(Text, { children: [_jsx(Text, { color: "cyan", children: "\u25E6 " }), _jsx(Text, { color: theme.text, children: item.label }), item.command ? _jsxs(Text, { color: theme.secondary, children: [" \u00B7 ", item.command] }) : null, !item.command && item.path ? _jsxs(Text, { color: theme.secondary, children: [" \u00B7 ", item.path] }) : null] }, `harness-${item.id}`));
369
+ lines.push(`- ${item.label}`);
370
+ appendGoalMetadataLine(lines, "ID", markdownCode(item.id));
371
+ appendGoalMetadataLine(lines, "Command", item.command ? markdownCode(item.command) : undefined);
372
+ appendGoalMetadataLine(lines, "Path", item.path ? markdownCode(item.path) : undefined);
373
+ appendGoalMetadataLine(lines, "Description", item.description);
462
374
  }
463
375
  }
464
- if (run.evidencePlan.length > 0) {
465
- rows.push(_jsx(Text, { color: theme.primary, bold: true, children: "Evidence plan" }, "evidence-plan-heading"));
376
+ lines.push("", "## Evidence plan", "");
377
+ if (run.evidencePlan.length === 0) {
378
+ lines.push("- none recorded");
379
+ }
380
+ else {
466
381
  for (const item of run.evidencePlan) {
467
- rows.push(_jsxs(Text, { children: [_jsxs(Text, { color: evidencePlanStatusColor(item.status), children: ["\u25CF ", item.status] }), _jsxs(Text, { color: theme.text, children: [" \u00B7 ", item.label] }), item.command ? _jsxs(Text, { color: theme.secondary, children: [" \u00B7 ", item.command] }) : null, !item.command && item.path ? _jsxs(Text, { color: theme.secondary, children: [" \u00B7 ", item.path] }) : null] }, `evidence-plan-${item.id}`));
382
+ lines.push(`- **${item.status}** ${item.label} (${item.mechanism})`);
383
+ appendGoalMetadataLine(lines, "ID", markdownCode(item.id));
384
+ appendGoalMetadataLine(lines, "Description", item.description);
385
+ appendGoalMetadataLine(lines, "Command", item.command ? markdownCode(item.command) : undefined);
386
+ appendGoalMetadataLine(lines, "Path", item.path ? markdownCode(item.path) : undefined);
387
+ appendGoalMetadataLine(lines, "Instructions", item.instructions);
388
+ appendGoalMetadataLine(lines, "Evidence", item.evidence);
468
389
  }
469
390
  }
470
- if (run.verifier) {
471
- rows.push(_jsx(Text, { color: theme.primary, bold: true, children: "Verifier" }, "verifier-heading"), _jsxs(Text, { wrap: "truncate", children: [run.verifier.lastResult ? (_jsxs(Text, { color: verifierStatusColor(run.verifier.lastResult.status), children: ["\u25CF ", formatGoalVerifierSummary(run)] })) : (_jsxs(Text, { color: run.verifier.command ? "cyan" : theme.textDim, children: ["\u25CF ", formatGoalVerifierSummary(run)] })), run.verifier.command ? (_jsxs(Text, { color: theme.secondary, children: [" \u00B7 ", run.verifier.command] })) : null] }, "verifier-summary"));
391
+ lines.push("", "## Verifier", "");
392
+ if (!run.verifier) {
393
+ lines.push("- none recorded");
472
394
  }
473
- if (run.blockers.length > 0) {
474
- rows.push(_jsx(Text, { color: theme.warning, bold: true, children: "Blockers" }, "blockers-heading"));
475
- for (const [index, blocker] of run.blockers.entries()) {
476
- rows.push(_jsxs(Text, { color: theme.warning, children: ["- ", truncateGoalDetailText(blocker)] }, `blocker-${index}`));
395
+ else {
396
+ lines.push(markdownListItem(run.verifier.description));
397
+ appendGoalMetadataLine(lines, "Command", run.verifier.command ? markdownCode(run.verifier.command) : undefined);
398
+ if (run.verifier.lastResult) {
399
+ appendGoalMetadataLine(lines, "Last result", run.verifier.lastResult.status);
400
+ appendGoalMetadataLine(lines, "Summary", run.verifier.lastResult.summary);
401
+ appendGoalMetadataLine(lines, "Exit code", run.verifier.lastResult.exitCode?.toString());
402
+ appendGoalMetadataLine(lines, "Output", run.verifier.lastResult.outputPath);
403
+ appendGoalMetadataLine(lines, "Checked at", run.verifier.lastResult.checkedAt);
477
404
  }
478
405
  }
479
- if (run.evidence.length > 0) {
480
- rows.push(_jsx(Text, { color: theme.primary, bold: true, children: "Recent evidence" }, "evidence-heading"));
481
- for (const item of run.evidence.slice(-5)) {
482
- rows.push(_jsxs(Text, { children: [_jsxs(Text, { color: evidenceKindColor(item.kind), children: ["[", item.kind, "]"] }), _jsxs(Text, { color: theme.text, children: [" ", item.label] }), item.path ? _jsxs(Text, { color: theme.secondary, children: [" \u00B7 ", item.path] }) : null] }, `evidence-${item.id}`));
406
+ lines.push("", "## Final audit", "");
407
+ if (!run.completionAudit) {
408
+ lines.push("- none recorded");
409
+ }
410
+ else {
411
+ lines.push(`- **${run.completionAudit.status}** ${run.completionAudit.summary}`);
412
+ appendGoalMetadataLine(lines, "Checked at", run.completionAudit.checkedAt);
413
+ appendGoalMetadataLine(lines, "Verifier checked at", run.completionAudit.verifierCheckedAt);
414
+ appendGoalMetadataLine(lines, "Output", run.completionAudit.outputPath);
415
+ }
416
+ lines.push("", "## Evidence", "");
417
+ if (run.evidence.length === 0) {
418
+ lines.push("- none recorded");
419
+ }
420
+ else {
421
+ for (const item of run.evidence) {
422
+ lines.push(`- **${item.kind}** ${item.label}`);
423
+ appendGoalMetadataLine(lines, "ID", markdownCode(item.id));
424
+ appendGoalMetadataLine(lines, "Path", item.path ? markdownCode(item.path) : undefined);
425
+ appendGoalMetadataLine(lines, "Content", item.content);
426
+ appendGoalMetadataLine(lines, "Created", item.createdAt);
483
427
  }
484
428
  }
485
- const window = getGoalDetailScrollWindow({
486
- detailRowCount: rows.length,
487
- scrollOffset,
488
- viewportRows: maxRows,
489
- });
490
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, paddingLeft: 2, height: maxRows, overflowY: "hidden", children: [window.hiddenBefore > 0 ? (_jsxs(Text, { color: theme.secondary, children: ["\u2191 ", window.hiddenBefore, " detail row(s) above \u00B7 PgUp"] })) : null, rows.slice(window.start, window.end), window.hiddenAfter > 0 ? (_jsxs(Text, { color: theme.secondary, children: ["\u2193 ", window.hiddenAfter, " more detail row(s) \u00B7 PgDn"] })) : null] }));
429
+ lines.push("", "## Blockers", "");
430
+ if (run.blockers.length === 0) {
431
+ lines.push("- none recorded");
432
+ }
433
+ else {
434
+ lines.push(...run.blockers.map(markdownListItem));
435
+ }
436
+ return lines
437
+ .join("\n")
438
+ .replace(/\n{3,}/g, "\n\n")
439
+ .trim();
491
440
  }
492
- export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal, agentRunning, }) {
441
+ function GoalHeader({ cwd, runs, agentRunning, }) {
442
+ const theme = useTheme();
443
+ const { columns } = useTerminalSize();
444
+ const displayPath = formatDisplayPath(cwd);
445
+ const counts = summarizeGoalCountsFromRuns(runs);
446
+ if (columns < SIDE_BY_SIDE_MIN) {
447
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, width: columns, children: [_jsx(GoalGradientText, { text: GOAL_LOGO[0] }), _jsx(GoalGradientText, { text: GOAL_LOGO[1] }), _jsx(GoalGradientText, { text: GOAL_LOGO[2] }), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { color: GOAL_SUCCESS, bold: true, children: "Goal Pane" }), agentRunning && _jsx(Text, { color: GOAL_ACTIVE, children: " (agent running)" }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", basename(cwd)] })] }), _jsx(Text, { color: theme.textDim, wrap: "truncate", children: displayPath }), _jsxs(Text, { children: [_jsxs(Text, { color: GOAL_SUCCESS, children: [counts.passed, " passed"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.running, " active"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: theme.text, children: [counts.pending, " pending"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.blocked, " blocked"] })] })] }));
448
+ }
449
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, width: columns, children: [_jsxs(Box, { children: [_jsx(GoalGradientText, { text: GOAL_LOGO[0] }), _jsx(Text, { children: GAP }), _jsx(Text, { color: GOAL_SUCCESS, bold: true, children: "Goal Pane" }), agentRunning && _jsx(Text, { color: GOAL_ACTIVE, children: " (agent running)" })] }), _jsxs(Box, { children: [_jsx(GoalGradientText, { text: GOAL_LOGO[1] }), _jsx(Text, { children: GAP }), _jsx(Text, { color: theme.textDim, wrap: "truncate", children: displayPath })] }), _jsxs(Box, { children: [_jsx(GoalGradientText, { text: GOAL_LOGO[2] }), _jsx(Text, { children: GAP }), _jsxs(Text, { children: [_jsxs(Text, { color: GOAL_SUCCESS, children: [counts.passed, " passed"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.running, " active"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: theme.text, children: [counts.pending, " pending"] }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsxs(Text, { color: GOAL_ACTIVE, children: [counts.blocked, " blocked"] })] })] })] }));
450
+ }
451
+ function StatusChip({ label, color }) {
452
+ return (_jsxs(Text, { color: color, bold: true, children: ["\u25D6 ", label, " \u25D7"] }));
453
+ }
454
+ export function createGoalReviewSnapshot({ run, markdownWidth, }) {
455
+ const safeMarkdownWidth = Number.isFinite(markdownWidth)
456
+ ? Math.max(40, Math.floor(markdownWidth))
457
+ : 80;
458
+ return {
459
+ id: `${run.id}:${run.updatedAt}:${safeMarkdownWidth}`,
460
+ run,
461
+ content: formatGoalPlanMarkdown(run),
462
+ markdownWidth: safeMarkdownWidth,
463
+ };
464
+ }
465
+ export function getGoalExpandedDetailViewModel({ run, markdownWidth, }) {
466
+ return createGoalReviewSnapshot({ run, markdownWidth });
467
+ }
468
+ function GoalReviewDocument({ snapshot }) {
469
+ const theme = useTheme();
470
+ return (_jsxs(Box, { flexDirection: "column", paddingRight: 1, children: [_jsx(GoalHeader, { cwd: snapshot.run.projectPath, runs: [snapshot.run], agentRunning: false }), _jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { color: GOAL_SUCCESS, bold: true, children: ["◆ ", snapshot.run.title] }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", snapshot.run.status] })] }), _jsxs(Box, { flexDirection: "row", marginTop: 1, paddingRight: 1, children: [_jsx(Box, { width: PREFIX_WIDTH, flexShrink: 0, children: _jsx(Text, { color: GOAL_SUCCESS, children: "◇ " }) }), _jsx(Box, { flexDirection: "column", flexGrow: 1, width: snapshot.markdownWidth, children: _jsx(Markdown, { width: snapshot.markdownWidth, children: snapshot.content }) })] }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { color: theme.textDim, children: "Mouse-wheel scroll this terminal output to review the full Goal plan." }) })] }));
471
+ }
472
+ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal, onRefineGoal, agentRunning, autoExpandNewest, }) {
493
473
  const theme = useTheme();
494
474
  const [runs, setRuns] = useState([]);
495
475
  const [selectedIndex, setSelectedIndex] = useState(0);
496
476
  const [loaded, setLoaded] = useState(false);
497
477
  const [expandedRunId, setExpandedRunId] = useState(null);
478
+ const [reviewSnapshot, setReviewSnapshot] = useState(null);
498
479
  const [mode, setMode] = useState("normal");
480
+ const [refineFeedback, setRefineFeedback] = useState("");
499
481
  const [status, setStatus] = useState("");
500
- const [detailScrollOffset, setDetailScrollOffset] = useState(0);
482
+ const autoExpandedRef = useRef(false);
501
483
  const statusTimer = useRef(null);
502
484
  const saveTimer = useRef(null);
503
485
  const lastPersistedRunsRef = useRef([]);
486
+ const { stdout } = useStdout();
487
+ const { rows, columns } = useTerminalSize();
488
+ const markdownWidth = Math.max(40, columns - PREFIX_WIDTH);
489
+ function expandGoal(run) {
490
+ setExpandedRunId(run.id);
491
+ setReviewSnapshot(createGoalReviewSnapshot({ run, markdownWidth }));
492
+ }
493
+ function collapseGoal() {
494
+ stdout?.write("\x1b[2J\x1b[3J\x1b[H");
495
+ setExpandedRunId(null);
496
+ setReviewSnapshot(null);
497
+ setMode("normal");
498
+ setRefineFeedback("");
499
+ autoExpandedRef.current = true;
500
+ }
504
501
  const showStatus = useCallback((message) => {
505
502
  setStatus(message);
506
503
  if (statusTimer.current)
@@ -537,7 +534,27 @@ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal
537
534
  }, [cwd]);
538
535
  useEffect(() => {
539
536
  setSelectedIndex((index) => clampGoalSelectedIndex(index, runs.length));
540
- }, [runs.length]);
537
+ if (expandedRunId && !runs.some((run) => run.id === expandedRunId)) {
538
+ setExpandedRunId(null);
539
+ setReviewSnapshot(null);
540
+ }
541
+ }, [expandedRunId, runs]);
542
+ useEffect(() => {
543
+ const nextState = getGoalAutoExpandedState({
544
+ autoExpandNewest,
545
+ loaded,
546
+ runs,
547
+ alreadyExpanded: autoExpandedRef.current,
548
+ });
549
+ if (!nextState)
550
+ return;
551
+ const run = runs[nextState.selectedIndex];
552
+ if (!run)
553
+ return;
554
+ autoExpandedRef.current = true;
555
+ setSelectedIndex(nextState.selectedIndex);
556
+ expandGoal(run);
557
+ }, [autoExpandNewest, loaded, runs, markdownWidth]);
541
558
  useEffect(() => {
542
559
  if (!loaded)
543
560
  return;
@@ -552,39 +569,42 @@ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal
552
569
  void saveGoalRuns(cwd, runs);
553
570
  }, 100);
554
571
  }, [cwd, loaded, runs]);
555
- const { rows } = useTerminalSize();
556
572
  const viewportRows = getGoalOverlayViewportRows(rows);
557
573
  const selectedRun = runs[selectedIndex];
558
- const expandedRun = selectedRun && selectedRun.id === expandedRunId ? selectedRun : null;
559
- const selectedCardExtraRows = selectedRun ? getGoalCardExtraRowCount(selectedRun) : 0;
560
- const expandedCardExtraRows = expandedRun ? selectedCardExtraRows : 0;
561
- const detailViewportRows = expandedRun
562
- ? getGoalExpandedDetailViewportRows({
563
- viewportRows,
564
- cardExtraRows: expandedCardExtraRows,
565
- })
566
- : 0;
567
- const listWindow = expandedRun
568
- ? null
569
- : getGoalListWindow({
570
- runs,
571
- selectedIndex,
572
- viewportRows,
573
- });
574
- const scrollOffset = expandedRun ? selectedIndex : (listWindow?.start ?? 0);
575
- const visibleRuns = expandedRun
576
- ? [expandedRun]
577
- : runs.slice(listWindow?.start ?? 0, listWindow?.end ?? 0);
578
- const hiddenBefore = expandedRun ? 0 : (listWindow?.hiddenBefore ?? 0);
579
- const hiddenAfter = expandedRun ? 0 : (listWindow?.hiddenAfter ?? 0);
580
- const detailRowCount = expandedRun ? getGoalDetailRowCount(expandedRun) : 0;
581
- useEffect(() => {
582
- setDetailScrollOffset(0);
583
- }, [expandedRunId]);
584
- useEffect(() => {
585
- setDetailScrollOffset((offset) => clampGoalDetailScrollOffset(offset, detailRowCount, detailViewportRows));
586
- }, [detailRowCount, detailViewportRows]);
574
+ const expandedRun = runs.find((run) => run.id === expandedRunId) ?? reviewSnapshot?.run ?? null;
575
+ const listWindow = getGoalListWindow({
576
+ runs,
577
+ selectedIndex,
578
+ viewportRows,
579
+ });
580
+ const scrollOffset = listWindow.start;
581
+ const visibleRuns = runs.slice(listWindow.start, listWindow.end);
582
+ const hiddenBefore = listWindow.hiddenBefore;
583
+ const hiddenAfter = listWindow.hiddenAfter;
587
584
  useInput((input, key) => {
585
+ if (mode === "refine") {
586
+ if (key.return) {
587
+ if (expandedRun) {
588
+ onRefineGoal?.(expandedRun, refineFeedback || "Please refine this Goal setup.");
589
+ }
590
+ setMode("normal");
591
+ setRefineFeedback("");
592
+ return;
593
+ }
594
+ if (key.escape) {
595
+ setMode("normal");
596
+ setRefineFeedback("");
597
+ return;
598
+ }
599
+ if (key.backspace || key.delete) {
600
+ setRefineFeedback((previous) => previous.slice(0, -1));
601
+ return;
602
+ }
603
+ if (input && !key.ctrl && !key.meta) {
604
+ setRefineFeedback((previous) => previous + input);
605
+ }
606
+ return;
607
+ }
588
608
  if (mode === "confirmDelete") {
589
609
  if (key.escape || input === "n") {
590
610
  setMode("normal");
@@ -594,39 +614,36 @@ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal
594
614
  if (input === "y" && selectedRun) {
595
615
  setRuns((previousRuns) => previousRuns.filter((run) => run.id !== selectedRun.id));
596
616
  setExpandedRunId(null);
617
+ setReviewSnapshot(null);
597
618
  setMode("normal");
598
619
  showStatus("Goal archived");
599
620
  }
600
621
  return;
601
622
  }
602
623
  if (key.escape) {
603
- onClose();
604
- return;
605
- }
606
- if (expandedRun && (key.pageUp || input === "[")) {
607
- setDetailScrollOffset((offset) => clampGoalDetailScrollOffset(offset - Math.max(1, detailViewportRows - 1), detailRowCount, detailViewportRows));
608
- return;
609
- }
610
- if (expandedRun && (key.pageDown || input === "]")) {
611
- setDetailScrollOffset((offset) => clampGoalDetailScrollOffset(offset + Math.max(1, detailViewportRows - 1), detailRowCount, detailViewportRows));
624
+ if (expandedRun) {
625
+ collapseGoal();
626
+ }
627
+ else {
628
+ onClose();
629
+ }
612
630
  return;
613
631
  }
614
- if (expandedRun && key.home) {
615
- setDetailScrollOffset(0);
632
+ if (expandedRun && input === "a") {
633
+ onRunGoal(expandedRun);
616
634
  return;
617
635
  }
618
- if (expandedRun && key.end) {
619
- setDetailScrollOffset(clampGoalDetailScrollOffset(detailRowCount, detailRowCount, detailViewportRows));
636
+ if (expandedRun && input === "r") {
637
+ setMode("refine");
638
+ setRefineFeedback("");
620
639
  return;
621
640
  }
622
- if (expandedRun && (key.upArrow || input === "k")) {
623
- setDetailScrollOffset((offset) => clampGoalDetailScrollOffset(offset - 1, detailRowCount, detailViewportRows));
641
+ if (expandedRun && (input === "q" || key.return)) {
642
+ collapseGoal();
624
643
  return;
625
644
  }
626
- if (expandedRun && (key.downArrow || input === "j")) {
627
- setDetailScrollOffset((offset) => clampGoalDetailScrollOffset(offset + 1, detailRowCount, detailViewportRows));
645
+ if (expandedRun)
628
646
  return;
629
- }
630
647
  if (key.upArrow || input === "k") {
631
648
  setSelectedIndex((index) => clampGoalSelectedIndex(index - 1, runs.length));
632
649
  return;
@@ -636,13 +653,23 @@ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal
636
653
  return;
637
654
  }
638
655
  if ((key.return || input === "d") && selectedRun) {
639
- setExpandedRunId((current) => (current === selectedRun.id ? null : selectedRun.id));
656
+ expandGoal(selectedRun);
640
657
  return;
641
658
  }
642
- if (input === "r" && selectedRun) {
659
+ if (input === "a" && selectedRun) {
643
660
  onRunGoal(selectedRun);
644
661
  return;
645
662
  }
663
+ if (input === "r" && selectedRun) {
664
+ if (expandedRun) {
665
+ setMode("refine");
666
+ setRefineFeedback("");
667
+ }
668
+ else {
669
+ expandGoal(selectedRun);
670
+ }
671
+ return;
672
+ }
646
673
  if (input === "v" && selectedRun) {
647
674
  onVerifyGoal(selectedRun);
648
675
  return;
@@ -656,11 +683,14 @@ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal
656
683
  showStatus("Archive goal? y/n");
657
684
  }
658
685
  });
686
+ if (expandedRun && reviewSnapshot) {
687
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: [reviewSnapshot], style: { width: "100%" }, children: (snapshot) => _jsx(GoalReviewDocument, { snapshot: snapshot }, snapshot.id) }, reviewSnapshot.id), _jsx(Box, { marginTop: 1, children: mode === "confirmDelete" ? (_jsx(Text, { color: theme.warning, children: "Confirm archive selected goal: y/n" })) : mode === "refine" ? (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.primary, children: "Feedback (Enter to submit, Esc to cancel):" }), _jsxs(Text, { color: theme.text, children: ["> ", refineFeedback, "▍"] })] })) : (_jsxs(Text, { color: theme.textDim, children: [_jsx(Text, { color: theme.success, children: "a" }), " approve/run · ", _jsx(Text, { color: theme.error, children: "r" }), " refine · ", _jsx(Text, { color: theme.primary, children: "q" }), " back · ", _jsx(Text, { color: theme.primary, children: "ESC" }), " close"] })) }), status ? (_jsx(Box, { children: _jsx(Text, { color: theme.secondary, children: status }) })) : null] }));
688
+ }
659
689
  return (_jsxs(Box, { flexDirection: "column", height: rows, overflow: "hidden", children: [_jsx(GoalHeader, { cwd: cwd, runs: runs, agentRunning: agentRunning }), agentRunning ? (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: theme.textDim, children: "Agent is running; Goal pane stays available without resetting chat." }) })) : null, !loaded ? (_jsx(Box, { borderStyle: "round", borderColor: theme.textDim, paddingX: 1, children: _jsx(Text, { color: theme.textDim, children: "Loading goals\u2026" }) })) : runs.length === 0 ? (_jsxs(Box, { flexDirection: "column", marginTop: 1, borderStyle: "round", borderColor: theme.primary, paddingX: 1, paddingY: 1, children: [_jsx(Text, { color: theme.primary, bold: true, children: "Start a durable Goal run" }), _jsx(Text, { color: theme.textDim, children: "No goals yet. Ask the agent to start a durable Goal." }), _jsx(Text, { color: theme.textDim, children: "Prerequisites, worker tasks, evidence, and verifier results will appear in this pane." })] })) : (_jsxs(Box, { flexDirection: "column", height: viewportRows, overflowY: "hidden", children: [_jsx(Text, { color: theme.textDim, bold: true, children: "Goals" }), hiddenBefore > 0 ? (_jsxs(Text, { color: theme.textDim, children: ["\u2191 ", hiddenBefore, " earlier goal", hiddenBefore === 1 ? "" : "s"] })) : null, visibleRuns.map((run, visibleIndex) => {
660
690
  const index = scrollOffset + visibleIndex;
661
691
  const selected = index === selectedIndex;
662
692
  const blocked = goalHasBlockingPrerequisites(run);
663
- return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, borderStyle: expandedRun?.id === run.id ? "round" : undefined, borderColor: expandedRun?.id === run.id ? theme.primary : undefined, paddingX: expandedRun?.id === run.id ? 1 : 0, children: [_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: selected ? theme.primary : theme.textDim, children: selected ? "❯ " : " " }), _jsx(StatusChip, { label: run.status, color: getGoalCardStatusColor({
693
+ return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: selected ? theme.primary : theme.textDim, children: selected ? "❯ " : " " }), _jsx(StatusChip, { label: run.status, color: getGoalCardStatusColor({
664
694
  status: run.status,
665
695
  selected,
666
696
  primaryColor: theme.primary,
@@ -669,7 +699,7 @@ export function GoalOverlay({ cwd, onClose, onRunGoal, onVerifyGoal, onPauseGoal
669
699
  selected,
670
700
  primaryColor: theme.primary,
671
701
  textColor: theme.text,
672
- }), bold: selected, children: [" ", run.title] }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", run.id.slice(0, 8)] })] }), expandedRun?.id === run.id ? null : (_jsxs(_Fragment, { children: [_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: theme.textDim, children: selected ? " " : " " }), _jsx(Text, { color: statusColor(run.status) || theme.secondary, children: getGoalReadinessText(run) }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: theme.text, children: formatGoalProgressText(run) }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: verifierSummaryColor(run, theme.textDim), children: formatGoalVerifierSummary(run) })] }), _jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: theme.textDim, children: selected ? " " : " " }), _jsx(Text, { color: goalHasBlockingPrerequisites(run) ? theme.warning : GOAL_SUCCESS, children: formatGoalPrerequisiteSummary(run) }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: run.tasks.length > 0 ? GOAL_SUCCESS : theme.text, children: formatGoalTaskSummary(run) })] })] })), blocked ? (_jsxs(Text, { color: theme.warning, wrap: "truncate", children: [selected ? " " : " ", "\u26A0 prerequisite needed before workers continue"] })) : run.status === "running" || run.status === "verifying" ? (_jsxs(Text, { color: GOAL_ACTIVE, wrap: "truncate", children: [selected ? " " : " ", "\u25CF active \u2014 watching worker/verifier progress"] })) : null, run.blockers.length > 0 ? (_jsxs(Text, { color: theme.warning, wrap: "truncate", children: [selected ? " " : " ", "blocker: ", run.blockers[0]] })) : null, expandedRun?.id === run.id ? (_jsx(GoalDetail, { run: run, maxRows: detailViewportRows, scrollOffset: detailScrollOffset })) : null] }, run.id));
673
- }), hiddenAfter > 0 ? (_jsxs(Text, { color: theme.textDim, children: ["\u2193 ", hiddenAfter, " later goal", hiddenAfter === 1 ? "" : "s"] })) : null] })), _jsx(Box, { marginTop: 1, children: mode === "confirmDelete" ? (_jsx(Text, { color: theme.warning, children: "Confirm archive selected goal: y/n" })) : (_jsxs(Text, { color: theme.textDim, children: [_jsx(Text, { color: theme.primary, children: "\u2191\u2193/jk" }), expandedRun ? " scroll detail · " : " select · ", _jsx(Text, { color: theme.primary, children: "Enter/d" }), expandedRun ? " close detail · " : " detail · ", expandedRun ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: theme.primary, children: "PgUp/PgDn" }), " page detail · "] })) : null, _jsx(Text, { color: theme.primary, children: "r" }), " run · ", _jsx(Text, { color: theme.primary, children: "v" }), " verify · ", _jsx(Text, { color: theme.primary, children: "p" }), " pause · ", _jsx(Text, { color: theme.primary, children: "x" }), " archive · ", _jsx(Text, { color: theme.primary, children: "Esc" }), " close"] })) }), status ? (_jsx(Box, { children: _jsx(Text, { color: theme.secondary, children: status }) })) : null] }));
702
+ }), bold: selected, children: [" ", run.title] }), _jsxs(Text, { color: theme.textDim, children: [" \u00B7 ", run.id.slice(0, 8)] })] }), _jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: theme.textDim, children: selected ? " " : " " }), _jsx(Text, { color: statusColor(run.status) || theme.secondary, children: getGoalReadinessText(run) }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: theme.text, children: formatGoalProgressText(run) }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: verifierSummaryColor(run, theme.textDim), children: formatGoalVerifierSummary(run) })] }), _jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: theme.textDim, children: selected ? " " : " " }), _jsx(Text, { color: goalHasBlockingPrerequisites(run) ? theme.warning : GOAL_SUCCESS, children: formatGoalPrerequisiteSummary(run) }), _jsx(Text, { color: theme.textDim, children: " \u00B7 " }), _jsx(Text, { color: run.tasks.length > 0 ? GOAL_SUCCESS : theme.text, children: formatGoalTaskSummary(run) })] }), blocked ? (_jsxs(Text, { color: theme.warning, wrap: "truncate", children: [selected ? " " : " ", "\u26A0 prerequisite needed before workers continue"] })) : run.status === "running" || run.status === "verifying" ? (_jsxs(Text, { color: GOAL_ACTIVE, wrap: "truncate", children: [selected ? " " : " ", "\u25CF active \u2014 watching worker/verifier progress"] })) : null, run.blockers.length > 0 ? (_jsxs(Text, { color: theme.warning, wrap: "truncate", children: [selected ? " " : " ", "blocker: ", run.blockers[0]] })) : null] }, run.id));
703
+ }), hiddenAfter > 0 ? (_jsxs(Text, { color: theme.textDim, children: ["\u2193 ", hiddenAfter, " later goal", hiddenAfter === 1 ? "" : "s"] })) : null] })), _jsx(Box, { marginTop: 1, children: mode === "confirmDelete" ? (_jsx(Text, { color: theme.warning, children: "Confirm archive selected goal: y/n" })) : mode === "refine" ? (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: theme.primary, children: "Feedback (Enter to submit, Esc to cancel):" }), _jsxs(Text, { color: theme.text, children: ["> ", refineFeedback, "▍"] })] })) : (_jsxs(Text, { color: theme.textDim, children: [_jsx(Text, { color: theme.primary, children: "\u2191\u2193/jk" }), " select · ", _jsx(Text, { color: theme.primary, children: "Enter/d" }), " detail · ", _jsx(Text, { color: theme.primary, children: "a" }), " run · ", _jsx(Text, { color: theme.primary, children: "v" }), " verify · ", _jsx(Text, { color: theme.primary, children: "p" }), " pause · ", _jsx(Text, { color: theme.primary, children: "x" }), " archive · ", _jsx(Text, { color: theme.primary, children: "Esc" }), " close"] })) }), status ? (_jsx(Box, { children: _jsx(Text, { color: theme.secondary, children: status }) })) : null] }));
674
704
  }
675
705
  //# sourceMappingURL=GoalOverlay.js.map