@prestyj/cli 4.3.210 → 4.3.237

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
@@ -0,0 +1,139 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { Text, renderToString } from "ink";
4
+ import { describe, expect, it } from "vitest";
5
+ import stripAnsi from "strip-ansi";
6
+ import { ChatControls, ChatLayout } from "./components/ChatLayout.js";
7
+ import { ChatLivePane } from "./components/ChatLivePane.js";
8
+ import { TerminalSizeProvider } from "./hooks/useTerminalSize.js";
9
+ import { renderTranscriptItem } from "./transcript/TranscriptRenderer.js";
10
+ import { loadTheme, ThemeContext } from "./theme/theme.js";
11
+ const COLUMNS = 80;
12
+ const ROWS = 24;
13
+ const CONTROLS_ROWS = 6;
14
+ const LIVE_ROWS = ROWS - CONTROLS_ROWS - 1;
15
+ const theme = loadTheme("dark");
16
+ function rawLines(value) {
17
+ return stripAnsi(value).replace(/\r/g, "\n").split("\n");
18
+ }
19
+ function trimTrailingEmptyLines(lines) {
20
+ const next = [...lines];
21
+ while (next.at(-1) === "")
22
+ next.pop();
23
+ return next;
24
+ }
25
+ function visibleLines(value) {
26
+ return trimTrailingEmptyLines(rawLines(value));
27
+ }
28
+ function countLineContaining(lines, needle) {
29
+ return lines.filter((line) => line.includes(needle)).length;
30
+ }
31
+ function SimulatedControls({ done }) {
32
+ return (_jsxs(ChatControls, { controlsRef: () => { }, children: [_jsx(Text, { children: done ? "SIM_DONE_STATUS" : "SIM_ACTIVITY_STATUS" }), _jsx(Text, { children: "SIM_INPUT_TOP" }), _jsx(Text, { children: "SIM_INPUT_BODY" }), _jsx(Text, { children: "SIM_INPUT_BOTTOM" }), _jsx(Text, { children: "SIM_FOOTER" }), _jsx(Text, { children: "SIM_ACTIVITY_BAR" })] }));
33
+ }
34
+ function SimulatedTui({ liveItems, streamingText = "", done, }) {
35
+ const renderItem = (item, index, items) => renderTranscriptItem({
36
+ item,
37
+ index,
38
+ items,
39
+ version: "sim",
40
+ currentModel: "sim-model",
41
+ currentProvider: "anthropic",
42
+ displayedCwd: "/tmp/sim-project",
43
+ columns: COLUMNS,
44
+ theme,
45
+ renderMarkdown: true,
46
+ measuredLiveAreaRows: LIVE_ROWS,
47
+ });
48
+ return (_jsx(ThemeContext.Provider, { value: theme, children: _jsx(TerminalSizeProvider, { children: _jsxs(ChatLayout, { columns: COLUMNS, children: [_jsx(ChatLivePane, { liveItems: liveItems, renderItem: renderItem, isRunning: !done, visibleStreamingText: streamingText, streamingThinking: "", thinkingMs: 0, reserveStreamingSpacing: false, renderMarkdown: true, measuredLiveAreaRows: LIVE_ROWS, assistantMarginTop: 0, streamingContinuation: false }), _jsx(SimulatedControls, { done: done })] }) }) }));
49
+ }
50
+ function renderSimulationFrame(props) {
51
+ const originalColumns = process.stdout.columns;
52
+ const originalRows = process.stdout.rows;
53
+ process.stdout.columns = COLUMNS;
54
+ process.stdout.rows = ROWS;
55
+ try {
56
+ return visibleLines(renderToString(_jsx(SimulatedTui, { ...props }), { columns: COLUMNS }));
57
+ }
58
+ finally {
59
+ process.stdout.columns = originalColumns;
60
+ process.stdout.rows = originalRows;
61
+ }
62
+ }
63
+ const longPrompt = Array.from({ length: 28 }, (_, index) => {
64
+ return `SIM_LONG_PROMPT_LINE_${String(index + 1).padStart(2, "0")}`;
65
+ }).join("\n");
66
+ const longAssistant = Array.from({ length: 40 }, (_, index) => {
67
+ return `SIM_ASSISTANT_LINE_${String(index + 1).padStart(2, "0")}`;
68
+ }).join("\n");
69
+ describe("TUI simulation", () => {
70
+ it("keeps compact transcript order and only clamps overflowing active output", () => {
71
+ const running = renderSimulationFrame({
72
+ liveItems: [{ kind: "assistant", id: "assistant-running", text: longAssistant }],
73
+ streamingText: "",
74
+ });
75
+ const done = renderSimulationFrame({ liveItems: [], done: true });
76
+ expect(running).toHaveLength(ROWS - 1);
77
+ expect(done).toHaveLength(CONTROLS_ROWS);
78
+ expect(countLineContaining(running, "SIM_ASSISTANT_LINE_")).toBeGreaterThan(0);
79
+ expect(done.some((line) => line.includes("EZ Coder"))).toBe(false);
80
+ expect(running.slice(-6)).toEqual([
81
+ "SIM_ACTIVITY_STATUS",
82
+ "SIM_INPUT_TOP",
83
+ "SIM_INPUT_BODY",
84
+ "SIM_INPUT_BOTTOM",
85
+ "SIM_FOOTER",
86
+ "SIM_ACTIVITY_BAR",
87
+ ]);
88
+ expect(done.slice(-6)).toEqual([
89
+ "SIM_DONE_STATUS",
90
+ "SIM_INPUT_TOP",
91
+ "SIM_INPUT_BODY",
92
+ "SIM_INPUT_BOTTOM",
93
+ "SIM_FOOTER",
94
+ "SIM_ACTIVITY_BAR",
95
+ ]);
96
+ });
97
+ it("bottom-clips large prompt/output blocks without duplicating visible chat rows", () => {
98
+ const frame = renderSimulationFrame({
99
+ liveItems: [
100
+ { kind: "user", id: "long-user", text: longPrompt },
101
+ { kind: "assistant", id: "long-assistant", text: longAssistant },
102
+ ],
103
+ streamingText: "SIM_STREAMING_TAIL",
104
+ });
105
+ expect(frame).toHaveLength(ROWS - 1);
106
+ expect(countLineContaining(frame, "SIM_LONG_PROMPT_LINE_01")).toBeLessThanOrEqual(1);
107
+ expect(countLineContaining(frame, "SIM_ASSISTANT_LINE_40")).toBeLessThanOrEqual(1);
108
+ expect(countLineContaining(frame, "SIM_STREAMING_TAIL")).toBeLessThanOrEqual(1);
109
+ expect(frame.slice(-2)).toEqual(["SIM_FOOTER", "SIM_ACTIVITY_BAR"]);
110
+ });
111
+ it("keeps message/tool spacing stable in the simulated live frame", () => {
112
+ const frame = renderSimulationFrame({
113
+ liveItems: [
114
+ { kind: "assistant", id: "assistant-intro", text: "I’ll inspect the renderer first." },
115
+ {
116
+ kind: "tool_group",
117
+ id: "tool-group",
118
+ tools: [
119
+ {
120
+ toolCallId: "read-1",
121
+ name: "read",
122
+ args: { file_path: "src/ui/App.tsx" },
123
+ status: "done",
124
+ result: "ok",
125
+ },
126
+ ],
127
+ },
128
+ { kind: "assistant", id: "assistant-next", text: "Now I’ll patch the layout." },
129
+ ],
130
+ });
131
+ const compact = frame.filter((line) => line.length > 0);
132
+ expect(compact).toContain(" ⏺ I’ll inspect the renderer first.");
133
+ // Tool rows now render in the pinned LiveToolPanel, not the transcript.
134
+ expect(compact.some((line) => line.includes("Read") && line.includes("App.tsx"))).toBe(false);
135
+ expect(compact).toContain(" ⏺ Now I’ll patch the layout.");
136
+ expect(countLineContaining(frame, "Now I’ll patch the layout.")).toBe(1);
137
+ });
138
+ });
139
+ //# sourceMappingURL=tui-simulation.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui-simulation.test.js","sourceRoot":"","sources":["../../src/ui/tui-simulation.test.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,MAAM,IAAI,GAAG,EAAE,CAAC;AAChB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,SAAS,GAAG,IAAI,GAAG,aAAa,GAAG,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEhC,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAwB;IACtD,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACxB,OAAO,IAAI,CA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-terminal-recorder.test.d.ts","sourceRoot":"","sources":["../../src/ui/tui-terminal-recorder.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,134 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import React from "react";
5
+ import { render } from "ink";
6
+ import { describe, expect, it } from "vitest";
7
+ import stripAnsi from "strip-ansi";
8
+ import { ChatControls, ChatLayout } from "./components/ChatLayout.js";
9
+ import { ChatLivePane } from "./components/ChatLivePane.js";
10
+ import { TerminalSizeProvider } from "./hooks/useTerminalSize.js";
11
+ import { renderTranscriptItem } from "./transcript/TranscriptRenderer.js";
12
+ import { loadTheme, ThemeContext } from "./theme/theme.js";
13
+ import { createTerminalHistoryPrinter } from "./terminal-history.js";
14
+ import { Text, useStdout } from "ink";
15
+ import { useEffect, useRef, useState } from "react";
16
+ import { useTranscriptHistory } from "./hooks/useTranscriptHistory.js";
17
+ import { ScreenRecorder, makeRecordingStdout } from "./testing/screen-recorder.js";
18
+ const COLUMNS = 80;
19
+ const ROWS = 24;
20
+ const CONTROLS_ROWS = 6;
21
+ const LIVE_ROWS = ROWS - CONTROLS_ROWS - 2;
22
+ const theme = loadTheme("dark");
23
+ const terminalContext = {
24
+ theme,
25
+ columns: COLUMNS,
26
+ version: "sim",
27
+ model: "sim-model",
28
+ provider: "anthropic",
29
+ cwd: "/tmp/sim-project",
30
+ };
31
+ function SimulatedControls({ label }) {
32
+ return (_jsxs(ChatControls, { controlsRef: () => { }, children: [_jsx(Text, { children: label }), _jsx(Text, { children: "SIM_INPUT_TOP" }), _jsx(Text, { children: "SIM_INPUT_BODY" }), _jsx(Text, { children: "SIM_INPUT_BOTTOM" }), _jsx(Text, { children: "SIM_FOOTER" }), _jsx(Text, { children: "SIM_ACTIVITY_BAR" })] }));
33
+ }
34
+ function SimulatedTui({ liveItems, streamingText = "", controlsLabel, }) {
35
+ const renderItem = (item, index, items) => renderTranscriptItem({
36
+ item,
37
+ index,
38
+ items,
39
+ version: "sim",
40
+ currentModel: "sim-model",
41
+ currentProvider: "anthropic",
42
+ displayedCwd: "/tmp/sim-project",
43
+ columns: COLUMNS,
44
+ theme,
45
+ renderMarkdown: true,
46
+ measuredLiveAreaRows: LIVE_ROWS,
47
+ });
48
+ return (_jsx(ThemeContext.Provider, { value: theme, children: _jsx(TerminalSizeProvider, { children: _jsxs(ChatLayout, { columns: COLUMNS, children: [_jsx(ChatLivePane, { liveItems: liveItems, renderItem: renderItem, isRunning: controlsLabel !== "SIM_DONE_STATUS", visibleStreamingText: streamingText, streamingThinking: "", thinkingMs: 0, reserveStreamingSpacing: false, renderMarkdown: true, measuredLiveAreaRows: LIVE_ROWS, assistantMarginTop: 0, streamingContinuation: false }), _jsx(SimulatedControls, { label: controlsLabel })] }) }) }));
49
+ }
50
+ function StatefulSimulatedTui({ initialLiveItems, streamingText = "", controlsLabel, flushItems, }) {
51
+ const { write: writeStdout } = useStdout();
52
+ const [history, setHistory] = useState([]);
53
+ const [liveItems, setLiveItems] = useState(initialLiveItems);
54
+ const flushedRef = useRef(false);
55
+ const { queueFlush } = useTranscriptHistory({
56
+ terminalHistoryPrinter: createTerminalHistoryPrinter(),
57
+ terminalHistoryContext: terminalContext,
58
+ writeStdout,
59
+ sessionPathRef: { current: undefined },
60
+ sessionManagerRef: { current: null },
61
+ history,
62
+ setHistory,
63
+ setLiveItems,
64
+ });
65
+ useEffect(() => {
66
+ if (!flushItems || flushedRef.current)
67
+ return;
68
+ flushedRef.current = true;
69
+ queueFlush(flushItems);
70
+ }, [flushItems, queueFlush]);
71
+ return (_jsx(SimulatedTui, { liveItems: liveItems, streamingText: streamingText, controlsLabel: controlsLabel }));
72
+ }
73
+ function makeStdout(recorder) {
74
+ return makeRecordingStdout(recorder);
75
+ }
76
+ function normalizedViewport(recorder) {
77
+ return recorder.viewportLines().map((line) => stripAnsi(line));
78
+ }
79
+ function formatFrame(label, lines) {
80
+ const body = lines
81
+ .map((line, index) => `${String(index + 1).padStart(2, "0")}│${line}`)
82
+ .join("\n");
83
+ return `\n=== ${label} ===\n${body}\n`;
84
+ }
85
+ function maybeWriteFrames(frames) {
86
+ if (process.env.GG_TUI_RECORD !== "1")
87
+ return;
88
+ const outPath = path.join(process.cwd(), ".ezcoder", "tui-terminal-recorder.txt");
89
+ fs.mkdirSync(path.dirname(outPath), { recursive: true });
90
+ fs.writeFileSync(outPath, frames.map((frame) => formatFrame(frame.label, frame.lines)).join("\n"));
91
+ }
92
+ const longAssistant = Array.from({ length: 40 }, (_, index) => {
93
+ return `SIM_ASSISTANT_LINE_${String(index + 1).padStart(2, "0")}`;
94
+ }).join("\n");
95
+ async function nextRender() {
96
+ await new Promise((resolve) => setTimeout(resolve, 45));
97
+ }
98
+ describe("TUI terminal recorder", () => {
99
+ it("keeps the final assistant response live on normal done instead of flush-scrolling under controls", async () => {
100
+ const recorder = new ScreenRecorder({ columns: COLUMNS, rows: ROWS });
101
+ const stdout = makeStdout(recorder);
102
+ const frames = [];
103
+ const capture = (label) => frames.push({ label, lines: normalizedViewport(recorder) });
104
+ const mounted = render(_jsx(StatefulSimulatedTui, { initialLiveItems: [{ kind: "assistant", id: "assistant-live", text: longAssistant }], controlsLabel: "SIM_ACTIVITY_STATUS" }), { stdout, columns: COLUMNS, rows: ROWS, patchConsole: false, maxFps: 1000 });
105
+ await nextRender();
106
+ capture("hook active assistant before flush");
107
+ mounted.rerender(_jsx(StatefulSimulatedTui, { initialLiveItems: [{ kind: "assistant", id: "assistant-live", text: longAssistant }], controlsLabel: "SIM_DONE_STATUS" }));
108
+ await nextRender();
109
+ await nextRender();
110
+ capture("hook done after flush");
111
+ const viewport = normalizedViewport(recorder);
112
+ mounted.unmount();
113
+ maybeWriteFrames(frames);
114
+ const activeFrame = frames.find((frame) => frame.label === "hook active assistant before flush")?.lines ?? [];
115
+ const doneFrame = frames.find((frame) => frame.label === "hook done after flush")?.lines ?? [];
116
+ const activeStatusSlot = activeFrame.findIndex((line) => line.includes("SIM_ACTIVITY_STATUS"));
117
+ const doneStatusSlot = doneFrame.findIndex((line) => line.includes("SIM_DONE_STATUS"));
118
+ expect(doneStatusSlot).toBe(activeStatusSlot);
119
+ expect(doneFrame.some((line) => line.includes("SIM_ASSISTANT_LINE_40"))).toBe(true);
120
+ const doneIndex = viewport.findIndex((line) => line.includes("SIM_DONE_STATUS"));
121
+ const footerIndex = viewport.findIndex((line) => line.includes("SIM_FOOTER"));
122
+ expect(doneIndex).toBeGreaterThanOrEqual(0);
123
+ expect(footerIndex).toBeGreaterThan(doneIndex);
124
+ expect(viewport.slice(doneIndex, footerIndex + 2)).toEqual([
125
+ "SIM_DONE_STATUS",
126
+ "SIM_INPUT_TOP",
127
+ "SIM_INPUT_BODY",
128
+ "SIM_INPUT_BOTTOM",
129
+ "SIM_FOOTER",
130
+ "SIM_ACTIVITY_BAR",
131
+ ]);
132
+ });
133
+ });
134
+ //# sourceMappingURL=tui-terminal-recorder.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui-terminal-recorder.test.js","sourceRoot":"","sources":["../../src/ui/tui-terminal-recorder.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE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in-flight assistant text can be flushed to terminal
7
+ * scrollback while streaming, keeping the trailing in-progress block live.
8
+ *
9
+ * Flushing progressively (instead of dumping the whole response at the end)
10
+ * keeps the live region small so it never has to scroll the full response into
11
+ * scrollback in one shot — that single large write is what makes the TUI
12
+ * "jump up" when the agent finishes.
13
+ *
14
+ * Splits ONLY at paragraph boundaries (blank lines) that sit OUTSIDE code
15
+ * fences, and never trims interior whitespace, so each flushed chunk is a
16
+ * self-contained set of Markdown blocks that renders identically whether shown
17
+ * alone in history or as part of the whole response. (An earlier version split
18
+ * mid-sentence and trimmed whitespace, which broke live/history parity.)
19
+ *
20
+ * Guarantees `flushedText + remainingText === text`.
21
+ */
22
+ export declare function splitAssistantStreamingText(text: string): AssistantStreamSplit;
23
+ //# sourceMappingURL=assistant-stream-split.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-stream-split.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/assistant-stream-split.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAe9E"}
@@ -0,0 +1,41 @@
1
+ function isInsideCodeFence(text) {
2
+ const fenceMatches = text.match(/^\s*(`{3,}|~{3,})/gm);
3
+ return (fenceMatches?.length ?? 0) % 2 === 1;
4
+ }
5
+ /**
6
+ * Decide how much of the in-flight assistant text can be flushed to terminal
7
+ * scrollback while streaming, keeping the trailing in-progress block live.
8
+ *
9
+ * Flushing progressively (instead of dumping the whole response at the end)
10
+ * keeps the live region small so it never has to scroll the full response into
11
+ * scrollback in one shot — that single large write is what makes the TUI
12
+ * "jump up" when the agent finishes.
13
+ *
14
+ * Splits ONLY at paragraph boundaries (blank lines) that sit OUTSIDE code
15
+ * fences, and never trims interior whitespace, so each flushed chunk is a
16
+ * self-contained set of Markdown blocks that renders identically whether shown
17
+ * alone in history or as part of the whole response. (An earlier version split
18
+ * mid-sentence and trimmed whitespace, which broke live/history parity.)
19
+ *
20
+ * Guarantees `flushedText + remainingText === text`.
21
+ */
22
+ export function splitAssistantStreamingText(text) {
23
+ const boundary = /\n[ \t]*\n/g;
24
+ let best = -1;
25
+ let match;
26
+ while ((match = boundary.exec(text)) !== null) {
27
+ const boundaryEnd = match.index + match[0].length;
28
+ // Keep the trailing block live until it too ends in a blank line.
29
+ if (boundaryEnd >= text.length)
30
+ break;
31
+ // Never split inside an open code fence — the chunk would render as broken
32
+ // Markdown (unterminated fence) in history.
33
+ if (isInsideCodeFence(text.slice(0, boundaryEnd)))
34
+ continue;
35
+ best = boundaryEnd;
36
+ }
37
+ if (best <= 0)
38
+ return { flushedText: "", remainingText: text };
39
+ return { flushedText: text.slice(0, best), remainingText: text.slice(best) };
40
+ }
41
+ //# sourceMappingURL=assistant-stream-split.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-stream-split.js","sourceRoot":"","sources":["../../../src/ui/utils/assistant-stream-split.ts"],"names":[],"mappings":"AAKA,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACvD,OAAO,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACtD,MAAM,QAAQ,GAAG,aAAa,CAAC;IAC/B,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;IACd,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAClD,kEAAkE;QAClE,IAAI,WAAW,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM;QACtC,2EAA2E;QAC3E,4CAA4C;QAC5C,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;YAAE,SAAS;QAC5D,IAAI,GAAG,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IAC/D,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=assistant-stream-split.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-stream-split.test.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/assistant-stream-split.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { splitAssistantStreamingText } from "./assistant-stream-split.js";
3
+ describe("splitAssistantStreamingText", () => {
4
+ it("keeps single-block text live (nothing to flush yet)", () => {
5
+ const cases = [
6
+ "Dr. Jones keeps a notebook full of odd theories and coffee stains.",
7
+ "1. Dr. Jones keeps a spare notebook.\n2. Dr. Jones believes every mystery deserves coffee.",
8
+ "- Dr. Jones once labeled an entire filing cabinet important.\n- Dr. Jones explains with metaphors.",
9
+ ];
10
+ for (const text of cases) {
11
+ expect(splitAssistantStreamingText(text)).toEqual({ flushedText: "", remainingText: text });
12
+ }
13
+ });
14
+ it("flushes completed paragraphs and keeps the trailing block live", () => {
15
+ const text = "Paragraph one.\n\nParagraph two.\n\nParagraph three in progress";
16
+ const { flushedText, remainingText } = splitAssistantStreamingText(text);
17
+ expect(flushedText).toBe("Paragraph one.\n\nParagraph two.\n\n");
18
+ expect(remainingText).toBe("Paragraph three in progress");
19
+ });
20
+ it("is lossless: flushedText + remainingText === text", () => {
21
+ const text = "A.\n\nB.\n\nC still going";
22
+ const { flushedText, remainingText } = splitAssistantStreamingText(text);
23
+ expect(flushedText + remainingText).toBe(text);
24
+ });
25
+ it("never splits at a blank line inside an open code fence", () => {
26
+ // The blank line between the two consts is inside an unterminated fence and
27
+ // must not be a split point; only the paragraph break before the fence is.
28
+ const text = "Here is code:\n\n```ts\nconst one = 1;\n\nconst two = 2;";
29
+ const { flushedText, remainingText } = splitAssistantStreamingText(text);
30
+ expect(flushedText).toBe("Here is code:\n\n");
31
+ expect(remainingText).toBe("```ts\nconst one = 1;\n\nconst two = 2;");
32
+ });
33
+ it("flushes past a closed code fence", () => {
34
+ const text = "Intro.\n\n```ts\nconst x = 1;\n```\n\nTrailing in progress";
35
+ const { flushedText, remainingText } = splitAssistantStreamingText(text);
36
+ expect(flushedText).toBe("Intro.\n\n```ts\nconst x = 1;\n```\n\n");
37
+ expect(remainingText).toBe("Trailing in progress");
38
+ });
39
+ });
40
+ //# sourceMappingURL=assistant-stream-split.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-stream-split.test.js","sourceRoot":"","sources":["../../../src/ui/utils/assistant-stream-split.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,KAAK,GAAG;YACZ,oEAAoE;YACpE,4FAA4F;YAC5F,oGAAoG;SACrG,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAA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a,EAAE,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;QACzE,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACnE,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Top-level entry point. Two-phase conversion:
8
+ *
9
+ * 1. Strip `$...$` / `$$...$$` math regions, applying math-mode conversions
10
+ * (including sub/superscripts) to the inner text. The heuristic for
11
+ * "this dollar pair is math" runs against the ORIGINAL input so that
12
+ * model-authored LaTeX is recognised before any tokens are rewritten.
13
+ *
14
+ * 2. Run prose-safe conversions over the remaining text, catching
15
+ * unwrapped LaTeX tokens (`\alpha`, `\to`, `\textbf{...}`) that the
16
+ * model emitted outside math delimiters.
17
+ *
18
+ * Short-circuits on input that has no LaTeX markers at all (`\` or `$`) so
19
+ * the hot rendering path stays cheap for ordinary prose.
20
+ */
21
+ export declare function convertLatexToUnicode(input: string): string;
22
+ //# sourceMappingURL=latex-to-unicode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latex-to-unicode.d.ts","sourceRoot":"","sources":["../../../src/ui/utils/latex-to-unicode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqiBH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY3D"}