@prestyj/cli 4.3.209 → 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 -724
  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 -1
  242. package/dist/tools/enter-plan.d.ts.map +1 -1
  243. package/dist/tools/enter-plan.js +8 -11
  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 +16 -4
  267. package/dist/tools/index.d.ts.map +1 -1
  268. package/dist/tools/index.js +11 -7
  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 -221
  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 +32 -11
  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 -272
  330. package/dist/ui/App.d.ts.map +1 -1
  331. package/dist/ui/App.js +1606 -2199
  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 -34
  667. package/dist/ui/render.d.ts.map +1 -1
  668. package/dist/ui/render.js +128 -41
  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
package/dist/cli.js CHANGED
@@ -41,18 +41,17 @@ import { PerformanceObserver, performance } from "node:perf_hooks";
41
41
  }
42
42
  }).observe({ entryTypes: allTypes });
43
43
  }
44
+ import { fileURLToPath } from "node:url";
44
45
  import { parseArgs } from "node:util";
45
46
  import fs from "node:fs";
46
47
  import readline from "node:readline/promises";
47
- import { execFile, spawnSync } from "node:child_process";
48
- import { createRequire } from "node:module";
49
48
  import { renderApp } from "./ui/render.js";
50
49
  import { runJsonMode } from "./modes/json-mode.js";
51
50
  import { runRpcMode } from "./modes/rpc-mode.js";
52
51
  import { runServeMode } from "./modes/serve-mode.js";
53
52
  import { runAgentHomeMode } from "./modes/agent-home-mode.js";
54
- import { renderLoginSelector } from "./ui/login.js";
55
53
  import { renderSessionSelector } from "./ui/sessions.js";
54
+ import { segmentDisplayText, stripDoneMarkers } from "./utils/plan-steps.js";
56
55
  import { formatUserError } from "./utils/error-handler.js";
57
56
  import { AuthStorage } from "./core/auth-storage.js";
58
57
  import { SessionManager } from "./core/session-manager.js";
@@ -61,59 +60,31 @@ import { initLogger, log, closeLogger } from "./core/logger.js";
61
60
  import { setStreamDiagnostic } from "@prestyj/agent";
62
61
  import { setProviderDiagnostic } from "@prestyj/ai";
63
62
  import { buildSystemPrompt } from "./system-prompt.js";
64
- import { isEyesActive, journalCount } from "@prestyj/eyes";
63
+ import { PROMPT_COMMANDS } from "./core/prompt-commands.js";
65
64
  import { createTools } from "./tools/index.js";
65
+ import { CheckpointStore } from "./core/checkpoint-store.js";
66
66
  import { shouldCompact, compact } from "./core/compaction/compactor.js";
67
67
  import { createCompactedSessionCheckpoint, formatRestoreInfoText, getRestoredMessagesForDisplay, } from "./core/session-compaction.js";
68
68
  import { setEstimatorModel } from "./core/compaction/token-estimator.js";
69
69
  import { getContextWindow, getDefaultModel, getMaxThinkingLevel, getModel, } from "./core/model-registry.js";
70
- import { MCPClientManager, getMCPServers } from "./core/mcp/index.js";
70
+ import { MCPClientManager, getAllMcpServers } from "./core/mcp/index.js";
71
+ import { runPixel } from "./cli/pixel.js";
72
+ import { runLogin, runLogout, runDoctor } from "./cli/auth.js";
73
+ import { runMcp } from "./cli/mcp.js";
74
+ import { CLI_VERSION, LOGO_LINES, clearVisibleScreen, displayName, gradientLine, requireInteractiveTTY, } from "./cli/shared.js";
71
75
  import { discoverAgents } from "./core/agents.js";
72
76
  import { discoverSkills } from "./core/skills.js";
73
77
  import path from "node:path";
74
- import { loginAnthropic } from "./core/oauth/anthropic.js";
75
- import { loginOpenAI } from "./core/oauth/openai.js";
76
- import { loginGemini } from "./core/oauth/gemini.js";
77
78
  import chalk from "chalk";
78
79
  import { checkAndAutoUpdate } from "./core/auto-update.js";
79
- const _require = createRequire(import.meta.url);
80
- const CLI_VERSION = _require("../package.json").version;
81
- // ── Logo + gradient (mirrors Banner.tsx) ────────────────────────────
82
- const LOGO_LINES = [
83
- " \u2584\u2580\u2580\u2580 \u2584\u2580\u2580\u2580",
84
- " \u2588 \u2580\u2588 \u2588 \u2580\u2588",
85
- " \u2580\u2584\u2584\u2580 \u2580\u2584\u2584\u2580",
86
- ];
87
- const GRADIENT = [
88
- "#60a5fa",
89
- "#6da1f9",
90
- "#7a9df7",
91
- "#8799f5",
92
- "#9495f3",
93
- "#a18ff1",
94
- "#a78bfa",
95
- "#a18ff1",
96
- "#9495f3",
97
- "#8799f5",
98
- "#7a9df7",
99
- "#6da1f9",
100
- ];
101
- function gradientLine(text) {
102
- let result = "";
103
- let colorIdx = 0;
104
- for (const ch of text) {
105
- if (ch === " ") {
106
- result += ch;
107
- }
108
- else {
109
- result += chalk.hex(GRADIENT[colorIdx % GRADIENT.length])(ch);
110
- colorIdx++;
111
- }
112
- }
113
- return result;
114
- }
115
- function clearVisibleScreen() {
116
- process.stdout.write("\x1b[2J\x1b[H");
80
+ import { routeCliCommandInput } from "./cli/command-routing.js";
81
+ const THINKING_LEVELS = new Set(["low", "medium", "high", "xhigh", "max"]);
82
+ export function parseThinkingLevel(value) {
83
+ if (value === undefined)
84
+ return undefined;
85
+ if (THINKING_LEVELS.has(value))
86
+ return value;
87
+ throw new Error(`Invalid --thinking value "${value}". Expected low, medium, high, xhigh, or max.`);
117
88
  }
118
89
  function printHelp() {
119
90
  // Clear the visible viewport for a clean look without erasing scrollback.
@@ -149,6 +120,7 @@ function printHelp() {
149
120
  ["telegram", "Configure Telegram bot integration"],
150
121
  ["agent-home-login", "Configure Agent Home relay connection"],
151
122
  ["agent-home", "Connect to Agent Home as a remote agent"],
123
+ ["mcp", "Add and manage MCP servers"],
152
124
  ];
153
125
  for (const [name, desc] of cmds) {
154
126
  console.log(` ${accent(name.padEnd(20))} ${dim(desc)}`);
@@ -166,6 +138,8 @@ function printHelp() {
166
138
  ["--model <name>", "Model to use (e.g. claude-sonnet-4-6, gpt-5.5)"],
167
139
  ["--max-turns <n>", "Maximum agent turns per prompt"],
168
140
  ["--system-prompt <text>", "Override the system prompt"],
141
+ ["--thinking <level>", "Enable thinking level (low, medium, high, xhigh, max)"],
142
+ ["--resume <id>", "Resume a session by id"],
169
143
  ["--json", "JSON output mode (for sub-agents)"],
170
144
  ["--rpc", "JSON-RPC mode (for IDE integrations)"],
171
145
  ];
@@ -178,8 +152,6 @@ function printHelp() {
178
152
  const slashCmds = [
179
153
  ["/help", "Show available slash commands"],
180
154
  ["/model", "Switch AI model"],
181
- ["/goal", "Create a programmatic goal loop"],
182
- ["/goals", "Open the goal pane"],
183
155
  ["/compact", "Compact conversation context"],
184
156
  ["/session", "Switch or create sessions"],
185
157
  ["/new", "Start a new session"],
@@ -193,10 +165,7 @@ function printHelp() {
193
165
  // Keyboard shortcuts
194
166
  console.log(primary("Keyboard shortcuts:"));
195
167
  const shortcuts = [
196
- ["Ctrl+T", "Toggle task overlay"],
197
- ["Ctrl+G", "Toggle goal overlay"],
198
168
  ["Ctrl+S", "Toggle skills overlay"],
199
- ["Ctrl+P", "Toggle plan mode"],
200
169
  ["Shift+Tab", "Toggle thinking"],
201
170
  ["Shift+Enter", "New line in input"],
202
171
  ];
@@ -205,126 +174,49 @@ function printHelp() {
205
174
  }
206
175
  console.log();
207
176
  }
177
+ function createCliSubcommandHandlers() {
178
+ const runWithStandardErrorHandling = (operation, logStack = false) => {
179
+ operation().catch((err) => {
180
+ log("ERROR", "fatal", err instanceof Error ? (logStack ? (err.stack ?? err.message) : err.message) : String(err));
181
+ closeLogger();
182
+ process.stderr.write(formatUserError(err) + "\n");
183
+ process.exit(1);
184
+ });
185
+ };
186
+ return {
187
+ pixel: () => runWithStandardErrorHandling(() => runPixel({ runInkTUI }), true),
188
+ mcp: () => runWithStandardErrorHandling(runMcp),
189
+ login: () => runWithStandardErrorHandling(runLogin),
190
+ logout: () => runWithStandardErrorHandling(runLogout),
191
+ sessions: () => runWithStandardErrorHandling(runSessions),
192
+ telegram: () => runWithStandardErrorHandling(runTelegramSetup),
193
+ serve: () => runWithStandardErrorHandling(runServe),
194
+ doctor: () => {
195
+ runDoctor().catch((err) => {
196
+ process.stderr.write(formatUserError(err) + "\n");
197
+ process.exit(1);
198
+ });
199
+ },
200
+ "agent-home-login": () => runWithStandardErrorHandling(runAgentHomeLogin),
201
+ "agent-home": () => runWithStandardErrorHandling(runAgentHome),
202
+ };
203
+ }
208
204
  function main() {
209
205
  // Silent auto-update check (throttled, non-blocking on failure)
210
206
  const updateMessage = checkAndAutoUpdate(CLI_VERSION);
211
207
  if (updateMessage) {
212
208
  console.error(chalk.bold.hex("#4ade80")(`✨ ${updateMessage}`));
213
209
  }
214
- // Intercept --help / -h before anything else so it works with subcommands
215
- // (e.g. `ezcoder login --help` or `ezcoder --help`)
216
- if (process.argv.includes("--help") || process.argv.includes("-h")) {
217
- printHelp();
218
- process.exit(0);
219
- }
220
- // Handle subcommands before parseArgs
221
- const subcommand = process.argv[2];
222
- // Passthrough to @prestyj/eyes CLI. Agents call this from bash as
223
- // `ezcoder eyes log rough "..."` etc. — `ezcoder` is guaranteed on PATH
224
- // (user launched it), so this avoids depending on nested bin visibility in
225
- // global npm/pnpm installs.
226
- if (subcommand === "eyes") {
227
- let cliPath;
228
- try {
229
- cliPath = _require.resolve("@prestyj/eyes/cli");
230
- }
231
- catch {
232
- process.stderr.write("ezcoder-eyes package not installed\n");
233
- process.exit(1);
234
- }
235
- const r = spawnSync(process.execPath, [cliPath, ...process.argv.slice(3)], {
236
- stdio: "inherit",
237
- });
238
- process.exit(r.status ?? 0);
239
- }
240
- if (subcommand === "pixel") {
241
- runPixel().catch((err) => {
242
- // Log the full stack — `pixel install` failures are usually bugs in our
243
- // own AST/wiring code, and the stack is the only useful diagnostic.
244
- log("ERROR", "fatal", err instanceof Error ? (err.stack ?? err.message) : String(err));
245
- closeLogger();
246
- process.stderr.write(formatUserError(err) + "\n");
247
- process.exit(1);
248
- });
249
- return;
250
- }
251
- if (subcommand === "login") {
252
- runLogin().catch((err) => {
253
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
254
- closeLogger();
255
- process.stderr.write(formatUserError(err) + "\n");
256
- process.exit(1);
257
- });
258
- return;
259
- }
260
- if (subcommand === "logout") {
261
- runLogout().catch((err) => {
262
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
263
- closeLogger();
264
- process.stderr.write(formatUserError(err) + "\n");
265
- process.exit(1);
266
- });
267
- return;
268
- }
269
- if (subcommand === "sessions") {
270
- process.argv.splice(2, 1);
271
- runSessions().catch((err) => {
272
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
273
- closeLogger();
274
- process.stderr.write(formatUserError(err) + "\n");
275
- process.exit(1);
276
- });
277
- return;
278
- }
279
- if (subcommand === "telegram") {
280
- runTelegramSetup().catch((err) => {
281
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
282
- closeLogger();
283
- process.stderr.write(formatUserError(err) + "\n");
284
- process.exit(1);
285
- });
286
- return;
287
- }
288
- if (subcommand === "serve") {
289
- process.argv.splice(2, 1);
290
- runServe().catch((err) => {
291
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
292
- closeLogger();
293
- process.stderr.write(formatUserError(err) + "\n");
294
- process.exit(1);
295
- });
296
- return;
297
- }
298
- if (subcommand === "doctor") {
299
- runDoctor().catch((err) => {
300
- process.stderr.write(formatUserError(err) + "\n");
301
- process.exit(1);
302
- });
303
- return;
304
- }
305
- if (subcommand === "agent-home-login") {
306
- runAgentHomeLogin().catch((err) => {
307
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
308
- closeLogger();
309
- process.stderr.write(formatUserError(err) + "\n");
310
- process.exit(1);
311
- });
312
- return;
313
- }
314
- if (subcommand === "agent-home") {
315
- process.argv.splice(2, 1);
316
- runAgentHome().catch((err) => {
317
- log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
318
- closeLogger();
319
- process.stderr.write(formatUserError(err) + "\n");
320
- process.exit(1);
321
- });
210
+ const commandRoute = routeCliCommandInput({
211
+ argv: process.argv,
212
+ printHelp,
213
+ exit: process.exit,
214
+ handlers: createCliSubcommandHandlers(),
215
+ });
216
+ if (commandRoute.kind === "handled") {
322
217
  return;
323
218
  }
324
- if (subcommand === "continue") {
325
- // Remove "continue" so parseArgs handles remaining flags
326
- process.argv.splice(2, 1);
327
- }
219
+ const subcommand = commandRoute.kind === "continue" ? "continue" : commandRoute.subcommand;
328
220
  const { values, positionals } = parseArgs({
329
221
  options: {
330
222
  help: { type: "boolean", short: "h" },
@@ -336,6 +228,8 @@ function main() {
336
228
  "max-turns": { type: "string" },
337
229
  "system-prompt": { type: "string" },
338
230
  "prompt-cache-key": { type: "string" },
231
+ thinking: { type: "string" },
232
+ resume: { type: "string" },
339
233
  },
340
234
  allowPositionals: true,
341
235
  strict: true,
@@ -352,10 +246,11 @@ function main() {
352
246
  if (values.json) {
353
247
  const message = positionals[0] ?? "";
354
248
  const jsonProvider = (values.provider ?? "anthropic");
355
- const jsonModel = values.model ?? "claude-opus-4-7";
249
+ const jsonModel = values.model ?? "claude-opus-4-8";
356
250
  const maxTurns = values["max-turns"] ? parseInt(values["max-turns"], 10) : undefined;
357
251
  const systemPrompt = values["system-prompt"];
358
252
  const promptCacheKey = values["prompt-cache-key"];
253
+ const thinkingLevel = parseThinkingLevel(values.thinking);
359
254
  const cwd = process.cwd();
360
255
  runJsonMode({
361
256
  message,
@@ -365,6 +260,7 @@ function main() {
365
260
  systemPrompt,
366
261
  maxTurns,
367
262
  promptCacheKey,
263
+ thinkingLevel,
368
264
  }).catch((err) => {
369
265
  process.stderr.write(formatUserError(err) + "\n");
370
266
  process.exit(1);
@@ -374,7 +270,7 @@ function main() {
374
270
  // RPC mode — headless JSON-over-stdio for IDE integrations
375
271
  if (values.rpc) {
376
272
  const rpcProvider = (values.provider ?? "anthropic");
377
- const rpcModel = values.model ?? "claude-opus-4-7";
273
+ const rpcModel = values.model ?? "claude-opus-4-8";
378
274
  const systemPrompt = values["system-prompt"];
379
275
  const cwd = process.cwd();
380
276
  runRpcMode({
@@ -407,11 +303,11 @@ function main() {
407
303
  return "deepseek-v4-pro";
408
304
  if (p === "openrouter")
409
305
  return "qwen/qwen3.6-plus";
410
- return "claude-opus-4-7";
306
+ return "claude-opus-4-8";
411
307
  }
412
308
  const model = saved.model ?? getHardcodedDefault(provider);
413
309
  const thinkingLevel = saved.thinkingEnabled
414
- ? getMaxThinkingLevel(model)
310
+ ? (saved.thinkingLevel ?? getMaxThinkingLevel(model))
415
311
  : undefined;
416
312
  // Interactive mode (Ink TUI)
417
313
  const cwd = process.cwd();
@@ -421,7 +317,9 @@ function main() {
421
317
  model,
422
318
  cwd,
423
319
  thinkingLevel,
320
+ idealReviewEnabled: saved.idealReviewEnabled,
424
321
  continueRecent,
322
+ resumeSessionPath: values.resume,
425
323
  theme: savedTheme,
426
324
  }).catch((err) => {
427
325
  log("ERROR", "fatal", err instanceof Error ? err.message : String(err));
@@ -431,18 +329,6 @@ function main() {
431
329
  });
432
330
  }
433
331
  // ── Ink TUI ───────────────────────────────────────────────
434
- /**
435
- * Bail with a friendly message if stdin isn't a TTY. Ink's raw-mode crash is
436
- * cryptic; this catches the common case (piped stdin, API shells, CI).
437
- */
438
- function requireInteractiveTTY() {
439
- if (process.stdin.isTTY)
440
- return;
441
- process.stderr.write(chalk.red("ezcoder needs an interactive terminal — your stdin isn't a TTY.\n") +
442
- chalk.hex("#6b7280")("Run ezcoder directly in your terminal (not piped or through an API shell). " +
443
- 'For headless use try "ezcoder --json \'<prompt>\'" or "ezcoder --rpc".\n'));
444
- process.exit(1);
445
- }
446
332
  async function runInkTUI(opts) {
447
333
  requireInteractiveTTY();
448
334
  const { cwd } = opts;
@@ -534,35 +420,24 @@ async function runInkTUI(opts) {
534
420
  globalSkillsDir: paths.skillsDir,
535
421
  projectDir: cwd,
536
422
  });
537
- // Plan mode refs — shared between tools and UI
423
+ // Runtime mode refs — shared between tools and UI
538
424
  const planModeRef = { current: false };
539
- const onEnterPlanRef = {
540
- current: () => { },
541
- };
542
- const onExitPlanRef = {
543
- current: () => Promise.resolve("cancelled"),
544
- };
545
- const repoMapChangedFilesRef = { current: new Set() };
546
- const repoMapReadFilesRef = { current: new Set() };
547
- const toRepoMapPath = (root, filePath) => path.relative(root, filePath).split(path.sep).join("/");
548
- const markRepoMapRead = (root, filePath) => {
549
- repoMapReadFilesRef.current.add(toRepoMapPath(root, filePath));
550
- };
551
- const markRepoMapDirty = (root, filePath) => {
552
- const relativePath = toRepoMapPath(root, filePath);
553
- repoMapChangedFilesRef.current.add(relativePath);
554
- repoMapReadFilesRef.current.add(relativePath);
555
- };
425
+ const goalModeRef = { current: "off" };
426
+ const planToolCallbacks = {};
427
+ // Holder so the (cwd-bound) tools can snapshot pre-mutation file state for
428
+ // /rewind. The store is created once the session id is known (below).
429
+ const checkpointRef = { current: null };
430
+ const onPreFileMutation = (filePath) => checkpointRef.current?.recordPreMutation(filePath) ?? Promise.resolve();
556
431
  const { tools, processManager } = createTools(cwd, {
557
432
  agents,
558
433
  skills,
559
434
  provider,
560
435
  model,
561
436
  planModeRef,
562
- onEnterPlan: (reason) => onEnterPlanRef.current(reason),
563
- onExitPlan: (planPath) => onExitPlanRef.current(planPath),
564
- onFileRead: (filePath) => markRepoMapRead(cwd, filePath),
565
- onFileMutated: (filePath) => markRepoMapDirty(cwd, filePath),
437
+ goalModeRef,
438
+ onPreFileMutation,
439
+ onEnterPlan: (reason) => planToolCallbacks.onEnterPlan?.(reason),
440
+ onExitPlan: (planPath) => planToolCallbacks.onExitPlan?.(planPath) ?? Promise.resolve("Plan review is unavailable."),
566
441
  });
567
442
  // Rebuilds the cwd-bound tools for a different project root. Used by the
568
443
  // pixel-fix flow so the agent operates in the error's project, not in
@@ -574,24 +449,26 @@ async function runInkTUI(opts) {
574
449
  provider,
575
450
  model,
576
451
  planModeRef,
577
- onEnterPlan: (reason) => onEnterPlanRef.current(reason),
578
- onExitPlan: (planPath) => onExitPlanRef.current(planPath),
579
- onFileRead: (filePath) => markRepoMapRead(newCwd, filePath),
580
- onFileMutated: (filePath) => markRepoMapDirty(newCwd, filePath),
452
+ goalModeRef,
453
+ onPreFileMutation,
454
+ onEnterPlan: (reason) => planToolCallbacks.onEnterPlan?.(reason),
455
+ onExitPlan: (planPath) => planToolCallbacks.onExitPlan?.(planPath) ?? Promise.resolve("Plan review is unavailable."),
581
456
  });
582
457
  return rebuilt;
583
458
  };
584
- // Connect MCP servers
459
+ // MCP startup can involve `npx` installing/booting servers. Do it after the
460
+ // TUI paints so a slow network or npm cache never looks like "nothing happens".
585
461
  const mcpManager = new MCPClientManager();
586
- try {
587
- const providerApiKey = provider === "glm" ? credentialsByProvider["glm"]?.accessToken : undefined;
588
- const mcpTools = await mcpManager.connectAll(getMCPServers(provider, providerApiKey));
589
- tools.push(...mcpTools);
590
- }
591
- catch (err) {
592
- log("WARN", "mcp", `MCP initialization failed: ${err instanceof Error ? err.message : String(err)}`);
593
- }
594
- const systemPrompt = await buildSystemPrompt(cwd, skills, false, undefined, tools.map((tool) => tool.name));
462
+ let initialMcpConnectPromise;
463
+ const connectInitialMcpTools = async () => {
464
+ initialMcpConnectPromise ??= (async () => {
465
+ const providerApiKey = provider === "glm" ? credentialsByProvider["glm"]?.accessToken : undefined;
466
+ const servers = await getAllMcpServers(provider, providerApiKey, cwd);
467
+ return mcpManager.connectAll(servers);
468
+ })();
469
+ return initialMcpConnectPromise;
470
+ };
471
+ const systemPrompt = await buildSystemPrompt(cwd, skills, planModeRef.current, undefined, tools.map((tool) => tool.name), undefined, provider, goalModeRef.current);
595
472
  // Kill all background processes on exit (synchronous — catches all exit paths)
596
473
  process.on("exit", () => {
597
474
  processManager.shutdownAll();
@@ -602,10 +479,15 @@ async function runInkTUI(opts) {
602
479
  // Session management — create or reuse session file
603
480
  const sessionManager = new SessionManager(paths.sessionsDir);
604
481
  let sessionPath;
482
+ let sessionId;
605
483
  let initialHistory;
606
484
  // Determine which session to resume (explicit path or most recent)
607
- const resumePath = opts.resumeSessionPath ??
608
- (opts.continueRecent ? await sessionManager.getMostRecent(cwd) : null);
485
+ const explicitResumePath = opts.resumeSessionPath
486
+ ? opts.resumeSessionPath.includes("/")
487
+ ? opts.resumeSessionPath
488
+ : await sessionManager.findById(cwd, opts.resumeSessionPath)
489
+ : null;
490
+ const resumePath = explicitResumePath ?? (opts.continueRecent ? await sessionManager.getMostRecent(cwd) : null);
609
491
  if (resumePath) {
610
492
  try {
611
493
  const loaded = await sessionManager.load(resumePath);
@@ -613,6 +495,7 @@ async function runInkTUI(opts) {
613
495
  if (loadedMessages.length > 0) {
614
496
  messages.push(...loadedMessages);
615
497
  sessionPath = resumePath;
498
+ sessionId = loaded.header.id;
616
499
  log("INFO", "session", `Restored session`, {
617
500
  path: resumePath,
618
501
  messageCount: String(loadedMessages.length),
@@ -646,6 +529,7 @@ async function runInkTUI(opts) {
646
529
  messages: compacted.messages,
647
530
  });
648
531
  sessionPath = compactedSession.path;
532
+ sessionId = compactedSession.id;
649
533
  messages.length = 0;
650
534
  messages.push(...compacted.messages);
651
535
  log("INFO", "session", `Auto-compaction complete`, {
@@ -659,7 +543,11 @@ async function runInkTUI(opts) {
659
543
  }
660
544
  }
661
545
  const restoredMessages = getRestoredMessagesForDisplay(messages);
662
- initialHistory = messagesToHistoryItems(restoredMessages);
546
+ const restoredDisplayItems = sessionManager.getDisplayItems(loaded.entries, loaded.header.leafId);
547
+ initialHistory =
548
+ restoredDisplayItems.length > 0
549
+ ? restoredDisplayItems
550
+ : messagesToHistoryItems(restoredMessages);
663
551
  initialHistory.push({
664
552
  kind: "info",
665
553
  text: formatRestoreInfoText(loadedMessages.length, restoredMessages.length),
@@ -675,22 +563,12 @@ async function runInkTUI(opts) {
675
563
  if (!sessionPath) {
676
564
  const session = await sessionManager.create(cwd, provider, model);
677
565
  sessionPath = session.path;
566
+ sessionId = session.id;
678
567
  log("INFO", "session", `New session created`, { path: sessionPath });
679
568
  }
680
- // Eyes startup banner surface open journal signals from past sessions so the
681
- // user isn't relying on reading agent prose to know improvements are pending.
682
- if (isEyesActive(cwd)) {
683
- const openCount = journalCount({ status: "open" }, cwd);
684
- if (openCount > 0) {
685
- const s = openCount === 1 ? "" : "s";
686
- if (!initialHistory)
687
- initialHistory = [];
688
- initialHistory.push({
689
- kind: "info",
690
- text: `👁 Eyes: ${openCount} open improvement signal${s} from recent sessions. Run /eyes-improve to triage.`,
691
- id: "eyes-banner",
692
- });
693
- }
569
+ // Now that the session id is finalized, back /rewind with a checkpoint store.
570
+ if (sessionId) {
571
+ checkpointRef.current = new CheckpointStore({ sessionId, cwd });
694
572
  }
695
573
  await renderApp({
696
574
  provider,
@@ -711,356 +589,23 @@ async function runInkTUI(opts) {
711
589
  initialHistory,
712
590
  sessionsDir: paths.sessionsDir,
713
591
  sessionPath,
592
+ sessionId,
714
593
  processManager,
715
594
  settingsFile: paths.settingsFile,
716
595
  mcpManager,
717
596
  authStorage,
718
597
  planModeRef,
719
- onEnterPlanRef,
720
- onExitPlanRef,
598
+ goalModeRef,
721
599
  skills,
600
+ checkpointStore: checkpointRef.current ?? undefined,
722
601
  initialOverlay: opts.initialOverlay,
602
+ idealReviewEnabled: opts.idealReviewEnabled,
723
603
  rebuildToolsForCwd,
724
- repoMapChangedFilesRef,
725
- repoMapReadFilesRef,
604
+ connectInitialMcpTools,
605
+ planCallbacks: planToolCallbacks,
726
606
  });
727
607
  closeLogger();
728
608
  }
729
- // ── Login ──────────────────────────────────────────────────
730
- async function runLogin() {
731
- requireInteractiveTTY();
732
- clearVisibleScreen();
733
- const paths = await ensureAppDirs();
734
- initLogger(paths.logFile, { version: CLI_VERSION });
735
- log("INFO", "auth", "Login flow started");
736
- const authStorage = new AuthStorage();
737
- await authStorage.load();
738
- // Phase 1: Ink-based provider selector
739
- const provider = await renderLoginSelector(CLI_VERSION);
740
- if (!provider) {
741
- console.log(chalk.hex("#6b7280")("Login cancelled."));
742
- return;
743
- }
744
- console.log(chalk.hex("#60a5fa").bold("\nLogging in to ") +
745
- chalk.hex("#a78bfa")(displayName(provider)) +
746
- chalk.hex("#60a5fa").bold("...\n"));
747
- // Phase 2: OAuth flow (readline needed for Anthropic code paste)
748
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
749
- try {
750
- const callbacks = {
751
- onOpenUrl: (url) => {
752
- console.log(chalk.hex("#60a5fa").bold("Opening browser..."));
753
- openBrowser(url);
754
- console.log(chalk.hex("#6b7280")("\nIf the browser didn't open, visit:\n") +
755
- chalk.hex("#6b7280")(url) +
756
- "\n");
757
- },
758
- onPromptCode: async (message) => {
759
- return rl.question(message + " ");
760
- },
761
- onStatus: (message) => {
762
- console.log(chalk.hex("#6b7280")(message));
763
- },
764
- };
765
- let creds;
766
- if (provider === "glm" ||
767
- provider === "moonshot" ||
768
- provider === "xiaomi" ||
769
- provider === "minimax" ||
770
- provider === "deepseek" ||
771
- provider === "openrouter") {
772
- const keyLabel = provider === "glm"
773
- ? "Z.AI"
774
- : provider === "xiaomi"
775
- ? "Xiaomi MiMo"
776
- : provider === "minimax"
777
- ? "MiniMax"
778
- : provider === "deepseek"
779
- ? "DeepSeek"
780
- : provider === "openrouter"
781
- ? "OpenRouter"
782
- : "Moonshot";
783
- const apiKey = await rl.question(chalk.hex("#60a5fa")(`Paste your ${keyLabel} API key: `));
784
- if (!apiKey.trim()) {
785
- console.log(chalk.hex("#ef4444")("No API key provided. Login cancelled."));
786
- return;
787
- }
788
- creds = {
789
- accessToken: apiKey.trim(),
790
- refreshToken: "",
791
- expiresAt: Date.now() + 365 * 24 * 60 * 60 * 1000 * 100, // ~100 years
792
- ...(provider === "xiaomi" ? { baseUrl: "https://token-plan-sgp.xiaomimimo.com/v1" } : {}),
793
- };
794
- }
795
- else {
796
- creds =
797
- provider === "anthropic"
798
- ? await loginAnthropic(callbacks)
799
- : provider === "gemini"
800
- ? await loginGemini(callbacks)
801
- : await loginOpenAI(callbacks);
802
- }
803
- await authStorage.setCredentials(provider, creds);
804
- log("INFO", "auth", `Login succeeded for ${displayName(provider)}`);
805
- console.log(chalk.hex("#4ade80")(`\n✓ Logged in to ${displayName(provider)} successfully!`));
806
- }
807
- finally {
808
- rl.close();
809
- closeLogger();
810
- }
811
- }
812
- // ── Doctor ─────────────────────────────────────────────────
813
- async function runDoctor() {
814
- clearVisibleScreen();
815
- const os = await import("node:os");
816
- const fsP = await import("node:fs/promises");
817
- const dim = chalk.hex("#6b7280");
818
- const primary = chalk.hex("#60a5fa");
819
- const accent = chalk.hex("#a78bfa");
820
- const good = chalk.hex("#4ade80");
821
- const warn = chalk.hex("#fbbf24");
822
- const bad = chalk.hex("#ef4444");
823
- // ── Banner ──────────────────────────────────────────────────
824
- const LOGO = LOGO_LINES;
825
- const GAP = " ";
826
- console.log();
827
- console.log(` ${gradientLine(LOGO[0])}${GAP}` +
828
- primary.bold("EZ Coder") +
829
- dim(` v${CLI_VERSION}`) +
830
- dim(" · By ") +
831
- chalk.white.bold("Nolan Grout"));
832
- console.log(` ${gradientLine(LOGO[1])}${GAP}` + accent("Doctor"));
833
- console.log(` ${gradientLine(LOGO[2])}${GAP}` + dim("Diagnose & Fix"));
834
- console.log();
835
- const home = os.homedir();
836
- const ggDir = path.join(home, ".ezcoder");
837
- const authFile = path.join(ggDir, "auth.json");
838
- const lockFile = authFile + ".lock";
839
- const myUid = process.getuid();
840
- let fixed = 0;
841
- // ── Environment ─────────────────────────────────────────────
842
- console.log(accent(" Environment\n"));
843
- console.log(dim(` Home: ${home}`));
844
- console.log(dim(` $HOME: ${process.env.HOME ?? "(not set)"}`));
845
- console.log(dim(` Node.js: ${process.version}`));
846
- console.log(dim(` Platform: ${process.platform} ${process.arch}`));
847
- console.log(dim(` UID: ${myUid} EUID: ${process.geteuid()}`));
848
- if (process.env.HOME && process.env.HOME !== home) {
849
- console.log(warn("\n ⚠ $HOME differs from os.homedir() — this can cause auth mismatches"));
850
- }
851
- if (myUid !== process.geteuid()) {
852
- console.log(warn(" ⚠ uid ≠ euid — running with elevated privileges (sudo?)"));
853
- console.log(dim(" Running ezcoder with sudo can cause ownership issues."));
854
- console.log(dim(" Use without sudo, or fix after: sudo chown -R $(whoami) ~/.gg"));
855
- }
856
- console.log();
857
- // ── Config Directory ────────────────────────────────────────
858
- console.log(accent(" Config Directory\n"));
859
- try {
860
- const stat = await fsP.stat(ggDir);
861
- const mode = stat.mode & 0o777;
862
- console.log(dim(` Path: ${ggDir}`));
863
- console.log(dim(` Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
864
- // Fix ownership
865
- if (stat.uid !== myUid) {
866
- console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
867
- try {
868
- await fsP.chown(ggDir, myUid, process.getgid());
869
- console.log(good(" ✓ Fixed directory ownership"));
870
- fixed++;
871
- }
872
- catch {
873
- console.log(bad(` ✗ Cannot fix — try: sudo chown -R $(whoami) ${ggDir}`));
874
- }
875
- }
876
- // Fix permissions (should be 0o700)
877
- if (mode !== 0o700) {
878
- try {
879
- await fsP.chmod(ggDir, 0o700);
880
- console.log(good(" ✓ Fixed directory permissions → 0o700"));
881
- fixed++;
882
- }
883
- catch {
884
- console.log(bad(` ✗ Cannot fix — try: chmod 700 ${ggDir}`));
885
- }
886
- }
887
- }
888
- catch {
889
- console.log(warn(` ${ggDir} missing — creating...`));
890
- try {
891
- await fsP.mkdir(ggDir, { recursive: true, mode: 0o700 });
892
- console.log(good(` ✓ Created ${ggDir}`));
893
- fixed++;
894
- }
895
- catch (mkErr) {
896
- console.log(bad(` ✗ Cannot create: ${mkErr instanceof Error ? mkErr.message : String(mkErr)}`));
897
- console.log();
898
- return;
899
- }
900
- }
901
- console.log();
902
- // ── Lock File ───────────────────────────────────────────────
903
- try {
904
- const lockStat = await fsP.stat(lockFile);
905
- const ageMs = Date.now() - lockStat.mtimeMs;
906
- console.log(accent(" Lock File\n"));
907
- console.log(warn(` ⚠ Stale lock found (age: ${Math.round(ageMs / 1000)}s)`));
908
- await fsP.unlink(lockFile);
909
- console.log(good(" ✓ Removed"));
910
- fixed++;
911
- console.log();
912
- }
913
- catch {
914
- // No lock file — good, skip section entirely
915
- }
916
- // ── Auth File ───────────────────────────────────────────────
917
- console.log(accent(" Auth File\n"));
918
- let authData = null;
919
- let authNeedsRewrite = false;
920
- try {
921
- const stat = await fsP.stat(authFile);
922
- const mode = stat.mode & 0o777;
923
- console.log(dim(` Path: ${authFile}`));
924
- console.log(dim(` Size: ${stat.size} bytes Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
925
- // Fix ownership
926
- if (stat.uid !== myUid) {
927
- console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
928
- try {
929
- await fsP.chown(authFile, myUid, process.getgid());
930
- console.log(good(" ✓ Fixed file ownership"));
931
- fixed++;
932
- }
933
- catch {
934
- console.log(bad(` ✗ Cannot fix — try: sudo chown $(whoami) ${authFile}`));
935
- }
936
- }
937
- // Fix permissions (should be 0o600)
938
- if (mode !== 0o600) {
939
- try {
940
- await fsP.chmod(authFile, 0o600);
941
- console.log(good(" ✓ Fixed file permissions → 0o600"));
942
- fixed++;
943
- }
944
- catch {
945
- console.log(bad(` ✗ Cannot fix — try: chmod 600 ${authFile}`));
946
- }
947
- }
948
- // Try to read and parse
949
- try {
950
- const content = await fsP.readFile(authFile, "utf-8");
951
- try {
952
- authData = JSON.parse(content);
953
- }
954
- catch {
955
- console.log(bad(" ✗ Invalid JSON — backing up and resetting"));
956
- const backupName = `auth.json.corrupt.${Date.now()}`;
957
- await fsP.copyFile(authFile, path.join(ggDir, backupName));
958
- await fsP.writeFile(authFile, "{}", { encoding: "utf-8", mode: 0o600 });
959
- console.log(good(` ✓ Corrupt file backed up as ${backupName}`));
960
- console.log(dim(' Run "ezcoder login" to re-authenticate'));
961
- authData = {};
962
- fixed++;
963
- }
964
- }
965
- catch (readErr) {
966
- const code = readErr.code;
967
- if (code === "EACCES") {
968
- console.log(bad(" ✗ Permission denied reading auth.json"));
969
- console.log(dim(` Try: sudo chown $(whoami) ${authFile} && chmod 600 ${authFile}`));
970
- }
971
- else {
972
- console.log(bad(` ✗ Read error: ${readErr instanceof Error ? readErr.message : String(readErr)}`));
973
- }
974
- }
975
- }
976
- catch {
977
- console.log(dim(` Path: ${authFile}`));
978
- console.log(warn(' Not found — run "ezcoder login" to authenticate'));
979
- }
980
- console.log();
981
- // ── Credentials ─────────────────────────────────────────────
982
- if (authData && Object.keys(authData).length > 0) {
983
- console.log(accent(" Credentials\n"));
984
- for (const p of Object.keys(authData)) {
985
- const cred = authData[p];
986
- if (!cred || typeof cred !== "object") {
987
- console.log(bad(` ✗ ${p}: invalid entry — removing`));
988
- delete authData[p];
989
- authNeedsRewrite = true;
990
- fixed++;
991
- continue;
992
- }
993
- if (!cred.accessToken || typeof cred.accessToken !== "string") {
994
- console.log(bad(` ✗ ${p}: missing accessToken — removing`));
995
- delete authData[p];
996
- authNeedsRewrite = true;
997
- fixed++;
998
- continue;
999
- }
1000
- const token = String(cred.accessToken);
1001
- const masked = token.slice(0, 8) + "..." + token.slice(-4);
1002
- const expires = typeof cred.expiresAt === "number" ? new Date(cred.expiresAt).toISOString() : "unknown";
1003
- const expired = typeof cred.expiresAt === "number" && Date.now() > cred.expiresAt;
1004
- if (expired) {
1005
- console.log(warn(` ⚠ ${p}: ${masked} expired ${expires}`));
1006
- }
1007
- else {
1008
- console.log(good(` ✓ ${p}: ${masked} expires ${expires}`));
1009
- }
1010
- }
1011
- if (authNeedsRewrite) {
1012
- try {
1013
- await fsP.writeFile(authFile, JSON.stringify(authData, null, 2), {
1014
- encoding: "utf-8",
1015
- mode: 0o600,
1016
- });
1017
- console.log(good(" ✓ Cleaned up auth.json"));
1018
- }
1019
- catch {
1020
- console.log(bad(" ✗ Failed to write cleaned auth.json"));
1021
- }
1022
- }
1023
- console.log();
1024
- }
1025
- // ── Temp Files ──────────────────────────────────────────────
1026
- try {
1027
- const entries = await fsP.readdir(ggDir);
1028
- const tmpFiles = entries.filter((e) => e.startsWith("auth.json.") && e.endsWith(".tmp"));
1029
- if (tmpFiles.length > 0) {
1030
- console.log(accent(" Temp Files\n"));
1031
- console.log(warn(` ⚠ ${tmpFiles.length} orphaned temp file(s) from interrupted writes`));
1032
- for (const tmp of tmpFiles) {
1033
- await fsP.unlink(path.join(ggDir, tmp)).catch(() => { });
1034
- }
1035
- console.log(good(` ✓ Removed ${tmpFiles.length} file(s)`));
1036
- fixed++;
1037
- console.log();
1038
- }
1039
- }
1040
- catch {
1041
- // Can't read directory — already flagged above
1042
- }
1043
- // ── Summary ─────────────────────────────────────────────────
1044
- if (fixed > 0) {
1045
- console.log(good(` ✓ Fixed ${fixed} issue${fixed > 1 ? "s" : ""}.`));
1046
- }
1047
- else {
1048
- console.log(good(" ✓ Everything looks good."));
1049
- }
1050
- console.log();
1051
- }
1052
- // ── Logout ─────────────────────────────────────────────────
1053
- async function runLogout() {
1054
- const paths = await ensureAppDirs();
1055
- initLogger(paths.logFile, { version: CLI_VERSION });
1056
- log("INFO", "auth", "Logout requested");
1057
- const authStorage = new AuthStorage();
1058
- await authStorage.load();
1059
- await authStorage.clearAll();
1060
- log("INFO", "auth", "Logout succeeded");
1061
- closeLogger();
1062
- console.log(chalk.green("Logged out successfully."));
1063
- }
1064
609
  // ── Sessions ──────────────────────────────────────────────
1065
610
  async function runSessions() {
1066
611
  requireInteractiveTTY();
@@ -1090,11 +635,11 @@ async function runSessions() {
1090
635
  return "MiniMax-M2.7";
1091
636
  if (p === "deepseek")
1092
637
  return "deepseek-v4-pro";
1093
- return "claude-opus-4-7";
638
+ return "claude-opus-4-8";
1094
639
  }
1095
640
  const model = saved2.model ?? getDefault(provider);
1096
641
  const thinkingLevel = saved2.thinkingEnabled
1097
- ? getMaxThinkingLevel(model)
642
+ ? (saved2.thinkingLevel ?? getMaxThinkingLevel(model))
1098
643
  : undefined;
1099
644
  closeLogger();
1100
645
  await runInkTUI({
@@ -1102,6 +647,7 @@ async function runSessions() {
1102
647
  model,
1103
648
  cwd,
1104
649
  thinkingLevel,
650
+ idealReviewEnabled: saved2.idealReviewEnabled,
1105
651
  resumeSessionPath: selectedPath,
1106
652
  theme: saved2.theme,
1107
653
  });
@@ -1279,7 +825,7 @@ async function runServe() {
1279
825
  const preferredProvider = serveValues.provider ?? saved3.provider ?? "anthropic";
1280
826
  const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, serveValues.model ?? saved3.model);
1281
827
  const thinkingLevel = saved3.thinkingEnabled
1282
- ? getMaxThinkingLevel(model)
828
+ ? (saved3.thinkingLevel ?? getMaxThinkingLevel(model))
1283
829
  : undefined;
1284
830
  initLogger(paths.logFile, {
1285
831
  version: CLI_VERSION,
@@ -1322,32 +868,16 @@ async function runAgentHomeLogin() {
1322
868
  log("INFO", "agent-home", "Agent Home login started");
1323
869
  const existing = await loadAgentHomeConfig();
1324
870
  // Banner
1325
- const LOGO = [
1326
- " \u2584\u2580\u2580\u2580 \u2584\u2580\u2580\u2580",
1327
- " \u2588 \u2580\u2588 \u2588 \u2580\u2588",
1328
- " \u2580\u2584\u2584\u2580 \u2580\u2584\u2584\u2580",
1329
- ];
1330
- function gradientTextLocal(text) {
1331
- let colorIdx = 0;
1332
- return text
1333
- .split("")
1334
- .map((ch) => {
1335
- if (ch === " ")
1336
- return ch;
1337
- const color = GRADIENT[colorIdx++ % GRADIENT.length];
1338
- return chalk.hex(color)(ch);
1339
- })
1340
- .join("");
1341
- }
871
+ const LOGO = LOGO_LINES;
1342
872
  const GAP = " ";
1343
873
  console.log();
1344
- console.log(` ${gradientTextLocal(LOGO[0])}${GAP}` +
874
+ console.log(` ${gradientLine(LOGO[0])}${GAP}` +
1345
875
  chalk.hex("#60a5fa").bold("EZ Coder") +
1346
876
  chalk.hex("#6b7280")(` v${CLI_VERSION}`) +
1347
877
  chalk.hex("#6b7280")(" \u00b7 By ") +
1348
878
  chalk.white.bold("Nolan Grout"));
1349
- console.log(` ${gradientTextLocal(LOGO[1])}${GAP}` + chalk.hex("#a78bfa")("Agent Home Setup"));
1350
- console.log(` ${gradientTextLocal(LOGO[2])}${GAP}` + chalk.hex("#6b7280")("Remote Control via iOS"));
879
+ console.log(` ${gradientLine(LOGO[1])}${GAP}` + chalk.hex("#a78bfa")("Agent Home Setup"));
880
+ console.log(` ${gradientLine(LOGO[2])}${GAP}` + chalk.hex("#6b7280")("Remote Control via iOS"));
1351
881
  console.log();
1352
882
  if (existing) {
1353
883
  console.log(chalk.hex("#6b7280")(" Current config:\n") +
@@ -1411,7 +941,7 @@ async function runAgentHome() {
1411
941
  const preferredProvider = ahValues.provider ?? saved4.provider ?? "anthropic";
1412
942
  const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, ahValues.model ?? saved4.model);
1413
943
  const thinkingLevel = saved4.thinkingEnabled
1414
- ? getMaxThinkingLevel(model)
944
+ ? (saved4.thinkingLevel ?? getMaxThinkingLevel(model))
1415
945
  : undefined;
1416
946
  initLogger(paths.logFile, {
1417
947
  version: CLI_VERSION,
@@ -1429,105 +959,6 @@ async function runAgentHome() {
1429
959
  });
1430
960
  }
1431
961
  // ── Pixel ──────────────────────────────────────────────────
1432
- async function runPixel() {
1433
- const sub = process.argv[3];
1434
- const rest = process.argv.slice(4);
1435
- if (sub === "install") {
1436
- const { runPixelInstall } = await import("./core/pixel.js");
1437
- const opts = parsePixelInstallArgs(rest);
1438
- await runPixelInstall(opts);
1439
- return;
1440
- }
1441
- if (sub === "fix") {
1442
- const errorId = rest[0];
1443
- if (!errorId) {
1444
- process.stderr.write("Usage: ezcoder pixel fix <error_id>\n");
1445
- process.exit(1);
1446
- }
1447
- const { fixError } = await import("./core/pixel-fix.js");
1448
- const result = await fixError(errorId);
1449
- if (result.outcome === "awaiting_review") {
1450
- console.log(chalk.hex("#4ade80")(`✓ ${result.reason}`));
1451
- }
1452
- else {
1453
- console.log(chalk.hex("#ef4444")(`✗ ${result.reason}`));
1454
- process.exit(1);
1455
- }
1456
- return;
1457
- }
1458
- if (sub === "run") {
1459
- const { runQueue } = await import("./core/pixel-fix.js");
1460
- const result = await runQueue();
1461
- console.log(chalk.bold(`${result.fixed} fixed · ${result.failed} failed · ${result.total} total`));
1462
- if (result.failed > 0)
1463
- process.exit(1);
1464
- return;
1465
- }
1466
- if (sub === "--help" || sub === "-h") {
1467
- printPixelHelp();
1468
- return;
1469
- }
1470
- if (sub === "list") {
1471
- const { listAllErrors } = await import("./core/pixel.js");
1472
- await listAllErrors();
1473
- return;
1474
- }
1475
- if (sub) {
1476
- process.stderr.write(`Unknown pixel subcommand: ${sub}\n`);
1477
- printPixelHelp();
1478
- process.exit(1);
1479
- }
1480
- // No subcommand → launch the Ink TUI with the pixel overlay open. The fix
1481
- // flow runs through the same agent loop as a Task, streaming live in the
1482
- // chat instead of spawning a subprocess.
1483
- // Non-TTY (CI, piped) → fall back to text list.
1484
- if (!process.stdin.isTTY) {
1485
- const { listAllErrors } = await import("./core/pixel.js");
1486
- await listAllErrors();
1487
- return;
1488
- }
1489
- const saved = loadSavedSettings();
1490
- const provider = saved.provider ?? "anthropic";
1491
- const model = saved.model ?? defaultModelFor(provider);
1492
- await runInkTUI({
1493
- provider,
1494
- model,
1495
- cwd: process.cwd(),
1496
- thinkingLevel: saved.thinkingEnabled ? "medium" : undefined,
1497
- theme: saved.theme,
1498
- initialOverlay: "pixel",
1499
- });
1500
- }
1501
- function defaultModelFor(p) {
1502
- return getDefaultModel(p).id;
1503
- }
1504
- function parsePixelInstallArgs(args) {
1505
- const out = { skipPackageInstall: false };
1506
- for (let i = 0; i < args.length; i++) {
1507
- const a = args[i];
1508
- if (a === "--ingest-url")
1509
- out.ingestUrl = args[++i];
1510
- else if (a === "--name")
1511
- out.name = args[++i];
1512
- else if (a === "--skip-install")
1513
- out.skipPackageInstall = true;
1514
- }
1515
- return out;
1516
- }
1517
- function printPixelHelp() {
1518
- console.log(`ezcoder pixel — error tracking + auto-fix queue
1519
-
1520
- Usage:
1521
- ezcoder pixel List open errors across every registered project
1522
- ezcoder pixel install Register the current project and wire up the SDK
1523
- ezcoder pixel fix <error_id> Fix one specific error end-to-end
1524
- ezcoder pixel run Auto-fix every open error across all projects
1525
-
1526
- ezcoder pixel install --name <name> Override the project name
1527
- ezcoder pixel install --ingest-url <url> Use a custom backend URL
1528
- ezcoder pixel install --skip-install Don't run the package manager
1529
- `);
1530
- }
1531
962
  // ── Helpers ────────────────────────────────────────────────
1532
963
  /**
1533
964
  * Pick the provider/model to start with. If the preferred provider isn't
@@ -1571,25 +1002,6 @@ async function resolveActiveProvider(authStorage, preferred, savedModel) {
1571
1002
  const provider = loggedInProviders[0];
1572
1003
  return { provider, model: getDefaultModel(provider).id, loggedInProviders };
1573
1004
  }
1574
- function displayName(provider) {
1575
- if (provider === "anthropic")
1576
- return "Anthropic";
1577
- if (provider === "xiaomi")
1578
- return "Xiaomi (MiMo)";
1579
- if (provider === "gemini")
1580
- return "Gemini";
1581
- if (provider === "glm")
1582
- return "Z.AI (GLM)";
1583
- if (provider === "moonshot")
1584
- return "Moonshot";
1585
- if (provider === "minimax")
1586
- return "MiniMax";
1587
- if (provider === "deepseek")
1588
- return "DeepSeek";
1589
- if (provider === "openrouter")
1590
- return "OpenRouter";
1591
- return "OpenAI";
1592
- }
1593
1005
  function extractText(content) {
1594
1006
  if (typeof content === "string")
1595
1007
  return content;
@@ -1598,9 +1010,45 @@ function extractText(content) {
1598
1010
  .map((b) => b.text)
1599
1011
  .join("\n");
1600
1012
  }
1601
- function messagesToHistoryItems(msgs) {
1013
+ function restoredPromptCommandDisplayText(text) {
1014
+ for (const command of PROMPT_COMMANDS) {
1015
+ if (text === command.prompt)
1016
+ return `/${command.name}`;
1017
+ const prefix = `${command.prompt}\n\n## User Instructions\n\n`;
1018
+ if (text.startsWith(prefix)) {
1019
+ const args = text.slice(prefix.length).trim();
1020
+ return args ? `/${command.name} ${args}` : `/${command.name}`;
1021
+ }
1022
+ }
1023
+ return null;
1024
+ }
1025
+ export function messagesToHistoryItems(msgs) {
1602
1026
  const items = [];
1603
1027
  let id = 0;
1028
+ const pushRestoredAssistantText = (text) => {
1029
+ const segments = segmentDisplayText(text, []);
1030
+ if (segments.length === 0) {
1031
+ const stripped = stripDoneMarkers(text);
1032
+ if (stripped)
1033
+ items.push({ kind: "assistant", text: stripped, id: `restore-${id++}` });
1034
+ return;
1035
+ }
1036
+ for (const segment of segments) {
1037
+ if (segment.kind === "text") {
1038
+ const stripped = stripDoneMarkers(segment.text).trimStart();
1039
+ if (stripped)
1040
+ items.push({ kind: "assistant", text: stripped, id: `restore-${id++}` });
1041
+ }
1042
+ else {
1043
+ items.push({
1044
+ kind: "step_done",
1045
+ stepNum: segment.stepNum,
1046
+ description: segment.description,
1047
+ id: `restore-${id++}`,
1048
+ });
1049
+ }
1050
+ }
1051
+ };
1604
1052
  // Index tool results by toolCallId for pairing with tool calls
1605
1053
  const toolResults = new Map();
1606
1054
  for (const msg of msgs) {
@@ -1624,14 +1072,19 @@ function messagesToHistoryItems(msgs) {
1624
1072
  roleCounts[msg.role] = (roleCounts[msg.role] ?? 0) + 1;
1625
1073
  if (msg.role === "user") {
1626
1074
  const text = extractText(msg.content);
1627
- if (text)
1628
- items.push({ kind: "user", text, id: `restore-${id++}` });
1075
+ if (!text)
1076
+ continue;
1077
+ items.push({
1078
+ kind: "user",
1079
+ text: restoredPromptCommandDisplayText(text) ?? text,
1080
+ id: `restore-${id++}`,
1081
+ });
1629
1082
  }
1630
1083
  else if (msg.role === "assistant") {
1631
1084
  const content = msg.content;
1632
1085
  if (typeof content === "string") {
1633
1086
  if (content)
1634
- items.push({ kind: "assistant", text: content, id: `restore-${id++}` });
1087
+ pushRestoredAssistantText(content);
1635
1088
  continue;
1636
1089
  }
1637
1090
  for (const block of content) {
@@ -1654,7 +1107,7 @@ function messagesToHistoryItems(msgs) {
1654
1107
  let textBuf = "";
1655
1108
  const flushText = () => {
1656
1109
  if (textBuf) {
1657
- items.push({ kind: "assistant", text: textBuf, id: `restore-${id++}` });
1110
+ pushRestoredAssistantText(textBuf);
1658
1111
  textBuf = "";
1659
1112
  }
1660
1113
  };
@@ -1708,11 +1161,8 @@ function messagesToHistoryItems(msgs) {
1708
1161
  });
1709
1162
  return items;
1710
1163
  }
1711
- function openBrowser(url) {
1712
- const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
1713
- execFile(cmd, [url], () => {
1714
- // Ignore errors — user can copy URL manually
1715
- });
1164
+ if (process.argv[1] &&
1165
+ fileURLToPath(import.meta.url) === fs.realpathSync(path.resolve(process.argv[1]))) {
1166
+ main();
1716
1167
  }
1717
- main();
1718
1168
  //# sourceMappingURL=cli.js.map