@prestyj/cli 4.3.210 → 4.3.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (889) hide show
  1. package/README.md +17 -9
  2. package/dist/cli/auth.d.ts +4 -0
  3. package/dist/cli/auth.d.ts.map +1 -0
  4. package/dist/cli/auth.js +344 -0
  5. package/dist/cli/auth.js.map +1 -0
  6. package/dist/cli/command-routing.d.ts +28 -0
  7. package/dist/cli/command-routing.d.ts.map +1 -0
  8. package/dist/cli/command-routing.js +53 -0
  9. package/dist/cli/command-routing.js.map +1 -0
  10. package/dist/cli/command-routing.test.d.ts +2 -0
  11. package/dist/cli/command-routing.test.d.ts.map +1 -0
  12. package/dist/cli/command-routing.test.js +60 -0
  13. package/dist/cli/command-routing.test.js.map +1 -0
  14. package/dist/cli/mcp.d.ts +2 -0
  15. package/dist/cli/mcp.d.ts.map +1 -0
  16. package/dist/cli/mcp.js +309 -0
  17. package/dist/cli/mcp.js.map +1 -0
  18. package/dist/cli/pixel.d.ts +27 -0
  19. package/dist/cli/pixel.d.ts.map +1 -0
  20. package/dist/cli/pixel.js +103 -0
  21. package/dist/cli/pixel.js.map +1 -0
  22. package/dist/cli/shared.d.ts +13 -0
  23. package/dist/cli/shared.d.ts.map +1 -0
  24. package/dist/cli/shared.js +82 -0
  25. package/dist/cli/shared.js.map +1 -0
  26. package/dist/cli.d.ts +4 -1
  27. package/dist/cli.d.ts.map +1 -1
  28. package/dist/cli.js +174 -732
  29. package/dist/cli.js.map +1 -1
  30. package/dist/config.d.ts +4 -1
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js +14 -1
  33. package/dist/config.js.map +1 -1
  34. package/dist/config.test.d.ts +2 -0
  35. package/dist/config.test.d.ts.map +1 -0
  36. package/dist/config.test.js +29 -0
  37. package/dist/config.test.js.map +1 -0
  38. package/dist/core/agent-session-compaction.test.d.ts +2 -0
  39. package/dist/core/agent-session-compaction.test.d.ts.map +1 -0
  40. package/dist/core/agent-session-compaction.test.js +114 -0
  41. package/dist/core/agent-session-compaction.test.js.map +1 -0
  42. package/dist/core/agent-session.d.ts +0 -23
  43. package/dist/core/agent-session.d.ts.map +1 -1
  44. package/dist/core/agent-session.js +6 -101
  45. package/dist/core/agent-session.js.map +1 -1
  46. package/dist/core/checkpoint-store.d.ts +93 -0
  47. package/dist/core/checkpoint-store.d.ts.map +1 -0
  48. package/dist/core/checkpoint-store.js +188 -0
  49. package/dist/core/checkpoint-store.js.map +1 -0
  50. package/dist/core/checkpoint-store.test.d.ts +2 -0
  51. package/dist/core/checkpoint-store.test.d.ts.map +1 -0
  52. package/dist/core/checkpoint-store.test.js +111 -0
  53. package/dist/core/checkpoint-store.test.js.map +1 -0
  54. package/dist/core/compaction/compactor.d.ts +4 -0
  55. package/dist/core/compaction/compactor.d.ts.map +1 -1
  56. package/dist/core/compaction/compactor.js +81 -28
  57. package/dist/core/compaction/compactor.js.map +1 -1
  58. package/dist/core/compaction/compactor.test.js +33 -9
  59. package/dist/core/compaction/compactor.test.js.map +1 -1
  60. package/dist/core/compaction/token-estimator.test.js +1 -1
  61. package/dist/core/continue-replay-inventory.test.d.ts +2 -0
  62. package/dist/core/continue-replay-inventory.test.d.ts.map +1 -0
  63. package/dist/core/continue-replay-inventory.test.js +42 -0
  64. package/dist/core/continue-replay-inventory.test.js.map +1 -0
  65. package/dist/core/goal-controller.d.ts +4 -0
  66. package/dist/core/goal-controller.d.ts.map +1 -1
  67. package/dist/core/goal-controller.js +223 -32
  68. package/dist/core/goal-controller.js.map +1 -1
  69. package/dist/core/goal-controller.test.js +387 -22
  70. package/dist/core/goal-controller.test.js.map +1 -1
  71. package/dist/core/goal-lifecycle-smoke.test.js +49 -8
  72. package/dist/core/goal-lifecycle-smoke.test.js.map +1 -1
  73. package/dist/core/goal-prerequisites.d.ts +23 -0
  74. package/dist/core/goal-prerequisites.d.ts.map +1 -0
  75. package/dist/core/goal-prerequisites.js +114 -0
  76. package/dist/core/goal-prerequisites.js.map +1 -0
  77. package/dist/core/goal-prerequisites.test.d.ts +2 -0
  78. package/dist/core/goal-prerequisites.test.d.ts.map +1 -0
  79. package/dist/core/goal-prerequisites.test.js +118 -0
  80. package/dist/core/goal-prerequisites.test.js.map +1 -0
  81. package/dist/core/goal-store.d.ts +12 -1
  82. package/dist/core/goal-store.d.ts.map +1 -1
  83. package/dist/core/goal-store.js +146 -40
  84. package/dist/core/goal-store.js.map +1 -1
  85. package/dist/core/goal-store.test.js +65 -8
  86. package/dist/core/goal-store.test.js.map +1 -1
  87. package/dist/core/goal-verifier.d.ts.map +1 -1
  88. package/dist/core/goal-verifier.js +4 -1
  89. package/dist/core/goal-verifier.js.map +1 -1
  90. package/dist/core/goal-verifier.test.js +43 -0
  91. package/dist/core/goal-verifier.test.js.map +1 -1
  92. package/dist/core/goal-worker.d.ts +2 -0
  93. package/dist/core/goal-worker.d.ts.map +1 -1
  94. package/dist/core/goal-worker.js +31 -7
  95. package/dist/core/goal-worker.js.map +1 -1
  96. package/dist/core/goal-worker.test.js +44 -0
  97. package/dist/core/goal-worker.test.js.map +1 -1
  98. package/dist/core/ideal-review.d.ts +20 -0
  99. package/dist/core/ideal-review.d.ts.map +1 -0
  100. package/dist/core/ideal-review.js +55 -0
  101. package/dist/core/ideal-review.js.map +1 -0
  102. package/dist/core/ideal-review.test.d.ts +2 -0
  103. package/dist/core/ideal-review.test.d.ts.map +1 -0
  104. package/dist/core/ideal-review.test.js +59 -0
  105. package/dist/core/ideal-review.test.js.map +1 -0
  106. package/dist/core/index.d.ts +1 -0
  107. package/dist/core/index.d.ts.map +1 -1
  108. package/dist/core/index.js +1 -0
  109. package/dist/core/index.js.map +1 -1
  110. package/dist/core/loop-breaker.d.ts +46 -0
  111. package/dist/core/loop-breaker.d.ts.map +1 -0
  112. package/dist/core/loop-breaker.js +79 -0
  113. package/dist/core/loop-breaker.js.map +1 -0
  114. package/dist/core/loop-breaker.test.d.ts +2 -0
  115. package/dist/core/loop-breaker.test.d.ts.map +1 -0
  116. package/dist/core/loop-breaker.test.js +110 -0
  117. package/dist/core/loop-breaker.test.js.map +1 -0
  118. package/dist/core/mcp/client.d.ts +20 -0
  119. package/dist/core/mcp/client.d.ts.map +1 -1
  120. package/dist/core/mcp/client.js +55 -11
  121. package/dist/core/mcp/client.js.map +1 -1
  122. package/dist/core/mcp/defaults.d.ts +7 -0
  123. package/dist/core/mcp/defaults.d.ts.map +1 -1
  124. package/dist/core/mcp/defaults.js +14 -0
  125. package/dist/core/mcp/defaults.js.map +1 -1
  126. package/dist/core/mcp/index.d.ts +6 -1
  127. package/dist/core/mcp/index.d.ts.map +1 -1
  128. package/dist/core/mcp/index.js +3 -1
  129. package/dist/core/mcp/index.js.map +1 -1
  130. package/dist/core/mcp/parse-add-command.d.ts +25 -0
  131. package/dist/core/mcp/parse-add-command.d.ts.map +1 -0
  132. package/dist/core/mcp/parse-add-command.js +220 -0
  133. package/dist/core/mcp/parse-add-command.js.map +1 -0
  134. package/dist/core/mcp/parse-add-command.test.d.ts +2 -0
  135. package/dist/core/mcp/parse-add-command.test.d.ts.map +1 -0
  136. package/dist/core/mcp/parse-add-command.test.js +75 -0
  137. package/dist/core/mcp/parse-add-command.test.js.map +1 -0
  138. package/dist/core/mcp/store.d.ts +80 -0
  139. package/dist/core/mcp/store.d.ts.map +1 -0
  140. package/dist/core/mcp/store.js +157 -0
  141. package/dist/core/mcp/store.js.map +1 -0
  142. package/dist/core/mcp/store.test.d.ts +2 -0
  143. package/dist/core/mcp/store.test.d.ts.map +1 -0
  144. package/dist/core/mcp/store.test.js +101 -0
  145. package/dist/core/mcp/store.test.js.map +1 -0
  146. package/dist/core/model-registry.d.ts +2 -2
  147. package/dist/core/model-registry.js +4 -4
  148. package/dist/core/model-registry.js.map +1 -1
  149. package/dist/core/model-registry.test.js +1 -1
  150. package/dist/core/model-registry.test.js.map +1 -1
  151. package/dist/core/prompt-commands.d.ts.map +1 -1
  152. package/dist/core/prompt-commands.js +64 -894
  153. package/dist/core/prompt-commands.js.map +1 -1
  154. package/dist/core/prompt-commands.test.js +49 -41
  155. package/dist/core/prompt-commands.test.js.map +1 -1
  156. package/dist/core/regrounding.d.ts +23 -0
  157. package/dist/core/regrounding.d.ts.map +1 -0
  158. package/dist/core/regrounding.js +21 -0
  159. package/dist/core/regrounding.js.map +1 -0
  160. package/dist/core/regrounding.test.d.ts +2 -0
  161. package/dist/core/regrounding.test.d.ts.map +1 -0
  162. package/dist/core/regrounding.test.js +38 -0
  163. package/dist/core/regrounding.test.js.map +1 -0
  164. package/dist/core/runtime-mode.d.ts +23 -0
  165. package/dist/core/runtime-mode.d.ts.map +1 -0
  166. package/dist/core/runtime-mode.js +30 -0
  167. package/dist/core/runtime-mode.js.map +1 -0
  168. package/dist/core/session-manager.d.ts +4 -0
  169. package/dist/core/session-manager.d.ts.map +1 -1
  170. package/dist/core/session-manager.js +20 -0
  171. package/dist/core/session-manager.js.map +1 -1
  172. package/dist/core/session-restore-display.test.d.ts +2 -0
  173. package/dist/core/session-restore-display.test.d.ts.map +1 -0
  174. package/dist/core/session-restore-display.test.js +78 -0
  175. package/dist/core/session-restore-display.test.js.map +1 -0
  176. package/dist/core/settings-manager.d.ts +4 -2
  177. package/dist/core/settings-manager.d.ts.map +1 -1
  178. package/dist/core/settings-manager.js +3 -6
  179. package/dist/core/settings-manager.js.map +1 -1
  180. package/dist/core/slash-commands.d.ts +0 -2
  181. package/dist/core/slash-commands.d.ts.map +1 -1
  182. package/dist/core/slash-commands.js +10 -15
  183. package/dist/core/slash-commands.js.map +1 -1
  184. package/dist/core/style-packs/index.js +1 -1
  185. package/dist/core/style-packs/index.js.map +1 -1
  186. package/dist/core/task-store.d.ts +26 -0
  187. package/dist/core/task-store.d.ts.map +1 -0
  188. package/dist/core/task-store.js +147 -0
  189. package/dist/core/task-store.js.map +1 -0
  190. package/dist/core/tasks-store.d.ts +24 -0
  191. package/dist/core/tasks-store.d.ts.map +1 -0
  192. package/dist/core/tasks-store.js +81 -0
  193. package/dist/core/tasks-store.js.map +1 -0
  194. package/dist/core/thinking-level.d.ts +5 -0
  195. package/dist/core/thinking-level.d.ts.map +1 -0
  196. package/dist/core/thinking-level.js +59 -0
  197. package/dist/core/thinking-level.js.map +1 -0
  198. package/dist/core/thinking-level.test.d.ts +2 -0
  199. package/dist/core/thinking-level.test.d.ts.map +1 -0
  200. package/dist/core/thinking-level.test.js +38 -0
  201. package/dist/core/thinking-level.test.js.map +1 -0
  202. package/dist/core/verify-commands.js +4 -4
  203. package/dist/core/verify-commands.js.map +1 -1
  204. package/dist/index.d.ts +1 -1
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +1 -1
  207. package/dist/index.js.map +1 -1
  208. package/dist/interactive.d.ts.map +1 -1
  209. package/dist/interactive.js +3 -1
  210. package/dist/interactive.js.map +1 -1
  211. package/dist/system-prompt.d.ts +5 -1
  212. package/dist/system-prompt.d.ts.map +1 -1
  213. package/dist/system-prompt.js +76 -48
  214. package/dist/system-prompt.js.map +1 -1
  215. package/dist/system-prompt.test.js +98 -46
  216. package/dist/system-prompt.test.js.map +1 -1
  217. package/dist/tools/bash.d.ts +6 -1
  218. package/dist/tools/bash.d.ts.map +1 -1
  219. package/dist/tools/bash.js +21 -3
  220. package/dist/tools/bash.js.map +1 -1
  221. package/dist/tools/checkpoint-hook.test.d.ts +2 -0
  222. package/dist/tools/checkpoint-hook.test.d.ts.map +1 -0
  223. package/dist/tools/checkpoint-hook.test.js +65 -0
  224. package/dist/tools/checkpoint-hook.test.js.map +1 -0
  225. package/dist/tools/edit-diff.d.ts +17 -4
  226. package/dist/tools/edit-diff.d.ts.map +1 -1
  227. package/dist/tools/edit-diff.js +78 -16
  228. package/dist/tools/edit-diff.js.map +1 -1
  229. package/dist/tools/edit-diff.test.js +31 -1
  230. package/dist/tools/edit-diff.test.js.map +1 -1
  231. package/dist/tools/edit-robustness.test.d.ts +2 -0
  232. package/dist/tools/edit-robustness.test.d.ts.map +1 -0
  233. package/dist/tools/edit-robustness.test.js +415 -0
  234. package/dist/tools/edit-robustness.test.js.map +1 -0
  235. package/dist/tools/edit.d.ts +8 -2
  236. package/dist/tools/edit.d.ts.map +1 -1
  237. package/dist/tools/edit.js +48 -20
  238. package/dist/tools/edit.js.map +1 -1
  239. package/dist/tools/edit.test.js +23 -22
  240. package/dist/tools/edit.test.js.map +1 -1
  241. package/dist/tools/enter-plan.d.ts +1 -3
  242. package/dist/tools/enter-plan.d.ts.map +1 -1
  243. package/dist/tools/enter-plan.js +9 -21
  244. package/dist/tools/enter-plan.js.map +1 -1
  245. package/dist/tools/exit-plan.d.ts.map +1 -1
  246. package/dist/tools/exit-plan.js +8 -9
  247. package/dist/tools/exit-plan.js.map +1 -1
  248. package/dist/tools/goal-mode.test.d.ts +2 -0
  249. package/dist/tools/goal-mode.test.d.ts.map +1 -0
  250. package/dist/tools/goal-mode.test.js +121 -0
  251. package/dist/tools/goal-mode.test.js.map +1 -0
  252. package/dist/tools/goals.d.ts +14 -2
  253. package/dist/tools/goals.d.ts.map +1 -1
  254. package/dist/tools/goals.js +257 -26
  255. package/dist/tools/goals.js.map +1 -1
  256. package/dist/tools/goals.test.js +365 -1
  257. package/dist/tools/goals.test.js.map +1 -1
  258. package/dist/tools/html-extract.d.ts +58 -0
  259. package/dist/tools/html-extract.d.ts.map +1 -0
  260. package/dist/tools/html-extract.js +130 -0
  261. package/dist/tools/html-extract.js.map +1 -0
  262. package/dist/tools/html-extract.test.d.ts +2 -0
  263. package/dist/tools/html-extract.test.d.ts.map +1 -0
  264. package/dist/tools/html-extract.test.js +60 -0
  265. package/dist/tools/html-extract.test.js.map +1 -0
  266. package/dist/tools/index.d.ts +15 -12
  267. package/dist/tools/index.d.ts.map +1 -1
  268. package/dist/tools/index.js +12 -8
  269. package/dist/tools/index.js.map +1 -1
  270. package/dist/tools/pdf-extract.d.ts +18 -0
  271. package/dist/tools/pdf-extract.d.ts.map +1 -0
  272. package/dist/tools/pdf-extract.js +43 -0
  273. package/dist/tools/pdf-extract.js.map +1 -0
  274. package/dist/tools/pdf-extract.test.d.ts +2 -0
  275. package/dist/tools/pdf-extract.test.d.ts.map +1 -0
  276. package/dist/tools/pdf-extract.test.js +15 -0
  277. package/dist/tools/pdf-extract.test.js.map +1 -0
  278. package/dist/tools/plan-mode.test.js +82 -243
  279. package/dist/tools/plan-mode.test.js.map +1 -1
  280. package/dist/tools/prompt-hints.d.ts.map +1 -1
  281. package/dist/tools/prompt-hints.js +6 -9
  282. package/dist/tools/prompt-hints.js.map +1 -1
  283. package/dist/tools/read-only-bash.d.ts +13 -0
  284. package/dist/tools/read-only-bash.d.ts.map +1 -0
  285. package/dist/tools/read-only-bash.js +155 -0
  286. package/dist/tools/read-only-bash.js.map +1 -0
  287. package/dist/tools/read-only-bash.test.d.ts +2 -0
  288. package/dist/tools/read-only-bash.test.d.ts.map +1 -0
  289. package/dist/tools/read-only-bash.test.js +47 -0
  290. package/dist/tools/read-only-bash.test.js.map +1 -0
  291. package/dist/tools/read.d.ts.map +1 -1
  292. package/dist/tools/read.js +14 -1
  293. package/dist/tools/read.js.map +1 -1
  294. package/dist/tools/read.test.js +4 -0
  295. package/dist/tools/read.test.js.map +1 -1
  296. package/dist/tools/screenshot.d.ts +25 -0
  297. package/dist/tools/screenshot.d.ts.map +1 -0
  298. package/dist/tools/screenshot.js +165 -0
  299. package/dist/tools/screenshot.js.map +1 -0
  300. package/dist/tools/screenshot.test.d.ts +2 -0
  301. package/dist/tools/screenshot.test.d.ts.map +1 -0
  302. package/dist/tools/screenshot.test.js +145 -0
  303. package/dist/tools/screenshot.test.js.map +1 -0
  304. package/dist/tools/subagent.d.ts +7 -2
  305. package/dist/tools/subagent.d.ts.map +1 -1
  306. package/dist/tools/subagent.js +31 -9
  307. package/dist/tools/subagent.js.map +1 -1
  308. package/dist/tools/tasks.d.ts.map +1 -1
  309. package/dist/tools/tasks.js +22 -58
  310. package/dist/tools/tasks.js.map +1 -1
  311. package/dist/tools/web-fetch.d.ts +16 -1
  312. package/dist/tools/web-fetch.d.ts.map +1 -1
  313. package/dist/tools/web-fetch.js +357 -45
  314. package/dist/tools/web-fetch.js.map +1 -1
  315. package/dist/tools/web-fetch.test.js +263 -2
  316. package/dist/tools/web-fetch.test.js.map +1 -1
  317. package/dist/tools/web-search.d.ts +14 -0
  318. package/dist/tools/web-search.d.ts.map +1 -1
  319. package/dist/tools/web-search.js +321 -35
  320. package/dist/tools/web-search.js.map +1 -1
  321. package/dist/tools/web-search.test.js +144 -1
  322. package/dist/tools/web-search.test.js.map +1 -1
  323. package/dist/tools/write.d.ts +8 -2
  324. package/dist/tools/write.d.ts.map +1 -1
  325. package/dist/tools/write.js +36 -9
  326. package/dist/tools/write.js.map +1 -1
  327. package/dist/tools/write.test.js +0 -16
  328. package/dist/tools/write.test.js.map +1 -1
  329. package/dist/ui/App.d.ts +52 -280
  330. package/dist/ui/App.d.ts.map +1 -1
  331. package/dist/ui/App.js +1608 -2235
  332. package/dist/ui/App.js.map +1 -1
  333. package/dist/ui/activity-phrases.d.ts.map +1 -1
  334. package/dist/ui/activity-phrases.js +0 -2
  335. package/dist/ui/activity-phrases.js.map +1 -1
  336. package/dist/ui/app-items.d.ts +276 -0
  337. package/dist/ui/app-items.d.ts.map +1 -0
  338. package/dist/ui/app-items.js +52 -0
  339. package/dist/ui/app-items.js.map +1 -0
  340. package/dist/ui/app-items.test.d.ts +2 -0
  341. package/dist/ui/app-items.test.d.ts.map +1 -0
  342. package/dist/ui/app-items.test.js +38 -0
  343. package/dist/ui/app-items.test.js.map +1 -0
  344. package/dist/ui/app-state-persistence.test.js +45 -160
  345. package/dist/ui/app-state-persistence.test.js.map +1 -1
  346. package/dist/ui/assistant-stream-flush-parity.test.d.ts +2 -0
  347. package/dist/ui/assistant-stream-flush-parity.test.d.ts.map +1 -0
  348. package/dist/ui/assistant-stream-flush-parity.test.js +85 -0
  349. package/dist/ui/assistant-stream-flush-parity.test.js.map +1 -0
  350. package/dist/ui/chat-layout-pinning.test.d.ts +2 -0
  351. package/dist/ui/chat-layout-pinning.test.d.ts.map +1 -0
  352. package/dist/ui/chat-layout-pinning.test.js +525 -0
  353. package/dist/ui/chat-layout-pinning.test.js.map +1 -0
  354. package/dist/ui/components/ActivityIndicator.d.ts +1 -2
  355. package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
  356. package/dist/ui/components/ActivityIndicator.js +63 -94
  357. package/dist/ui/components/ActivityIndicator.js.map +1 -1
  358. package/dist/ui/components/AnimationContext.d.ts.map +1 -1
  359. package/dist/ui/components/AnimationContext.js +3 -5
  360. package/dist/ui/components/AnimationContext.js.map +1 -1
  361. package/dist/ui/components/AssistantMessage.d.ts +6 -2
  362. package/dist/ui/components/AssistantMessage.d.ts.map +1 -1
  363. package/dist/ui/components/AssistantMessage.js +9 -4
  364. package/dist/ui/components/AssistantMessage.js.map +1 -1
  365. package/dist/ui/components/AssistantMessage.test.d.ts +2 -0
  366. package/dist/ui/components/AssistantMessage.test.d.ts.map +1 -0
  367. package/dist/ui/components/AssistantMessage.test.js +387 -0
  368. package/dist/ui/components/AssistantMessage.test.js.map +1 -0
  369. package/dist/ui/components/BackgroundTasksBar.d.ts +1 -3
  370. package/dist/ui/components/BackgroundTasksBar.d.ts.map +1 -1
  371. package/dist/ui/components/BackgroundTasksBar.js +8 -10
  372. package/dist/ui/components/BackgroundTasksBar.js.map +1 -1
  373. package/dist/ui/components/Banner.d.ts +1 -2
  374. package/dist/ui/components/Banner.d.ts.map +1 -1
  375. package/dist/ui/components/Banner.js +9 -4
  376. package/dist/ui/components/Banner.js.map +1 -1
  377. package/dist/ui/components/ChatFooterPane.d.ts +25 -0
  378. package/dist/ui/components/ChatFooterPane.d.ts.map +1 -0
  379. package/dist/ui/components/ChatFooterPane.js +15 -0
  380. package/dist/ui/components/ChatFooterPane.js.map +1 -0
  381. package/dist/ui/components/ChatInputStack.d.ts +36 -0
  382. package/dist/ui/components/ChatInputStack.d.ts.map +1 -0
  383. package/dist/ui/components/ChatInputStack.js +10 -0
  384. package/dist/ui/components/ChatInputStack.js.map +1 -0
  385. package/dist/ui/components/ChatLayout.d.ts +37 -0
  386. package/dist/ui/components/ChatLayout.d.ts.map +1 -0
  387. package/dist/ui/components/ChatLayout.js +21 -0
  388. package/dist/ui/components/ChatLayout.js.map +1 -0
  389. package/dist/ui/components/ChatLivePane.d.ts +18 -0
  390. package/dist/ui/components/ChatLivePane.d.ts.map +1 -0
  391. package/dist/ui/components/ChatLivePane.js +22 -0
  392. package/dist/ui/components/ChatLivePane.js.map +1 -0
  393. package/dist/ui/components/ChatScreen.d.ts +136 -0
  394. package/dist/ui/components/ChatScreen.d.ts.map +1 -0
  395. package/dist/ui/components/ChatScreen.js +16 -0
  396. package/dist/ui/components/ChatScreen.js.map +1 -0
  397. package/dist/ui/components/ChatStatusRow.d.ts +34 -0
  398. package/dist/ui/components/ChatStatusRow.d.ts.map +1 -0
  399. package/dist/ui/components/ChatStatusRow.js +11 -0
  400. package/dist/ui/components/ChatStatusRow.js.map +1 -0
  401. package/dist/ui/components/CompactionNotice.d.ts +4 -2
  402. package/dist/ui/components/CompactionNotice.d.ts.map +1 -1
  403. package/dist/ui/components/CompactionNotice.js +4 -4
  404. package/dist/ui/components/CompactionNotice.js.map +1 -1
  405. package/dist/ui/components/Footer.d.ts +27 -6
  406. package/dist/ui/components/Footer.d.ts.map +1 -1
  407. package/dist/ui/components/Footer.js +75 -30
  408. package/dist/ui/components/Footer.js.map +1 -1
  409. package/dist/ui/components/FooterStatusRow.d.ts +20 -0
  410. package/dist/ui/components/FooterStatusRow.d.ts.map +1 -0
  411. package/dist/ui/components/FooterStatusRow.js +10 -0
  412. package/dist/ui/components/FooterStatusRow.js.map +1 -0
  413. package/dist/ui/components/FullScreenOverlayRouter.d.ts +19 -0
  414. package/dist/ui/components/FullScreenOverlayRouter.d.ts.map +1 -0
  415. package/dist/ui/components/FullScreenOverlayRouter.js +18 -0
  416. package/dist/ui/components/FullScreenOverlayRouter.js.map +1 -0
  417. package/dist/ui/components/GoalOverlay.d.ts +28 -20
  418. package/dist/ui/components/GoalOverlay.d.ts.map +1 -1
  419. package/dist/ui/components/GoalOverlay.js +283 -253
  420. package/dist/ui/components/GoalOverlay.js.map +1 -1
  421. package/dist/ui/components/GoalStatusBar.d.ts.map +1 -1
  422. package/dist/ui/components/GoalStatusBar.js +2 -1
  423. package/dist/ui/components/GoalStatusBar.js.map +1 -1
  424. package/dist/ui/components/IdealHookMessage.d.ts +14 -0
  425. package/dist/ui/components/IdealHookMessage.d.ts.map +1 -0
  426. package/dist/ui/components/IdealHookMessage.js +26 -0
  427. package/dist/ui/components/IdealHookMessage.js.map +1 -0
  428. package/dist/ui/components/InputArea.d.ts +31 -6
  429. package/dist/ui/components/InputArea.d.ts.map +1 -1
  430. package/dist/ui/components/InputArea.js +208 -50
  431. package/dist/ui/components/InputArea.js.map +1 -1
  432. package/dist/ui/components/InputArea.test.js +11 -1
  433. package/dist/ui/components/InputArea.test.js.map +1 -1
  434. package/dist/ui/components/LiveToolPanel.d.ts +30 -0
  435. package/dist/ui/components/LiveToolPanel.d.ts.map +1 -0
  436. package/dist/ui/components/LiveToolPanel.js +66 -0
  437. package/dist/ui/components/LiveToolPanel.js.map +1 -0
  438. package/dist/ui/components/Markdown.d.ts +11 -11
  439. package/dist/ui/components/Markdown.d.ts.map +1 -1
  440. package/dist/ui/components/Markdown.js +28 -198
  441. package/dist/ui/components/Markdown.js.map +1 -1
  442. package/dist/ui/components/ModelSelector.d.ts.map +1 -1
  443. package/dist/ui/components/ModelSelector.js +18 -18
  444. package/dist/ui/components/ModelSelector.js.map +1 -1
  445. package/dist/ui/components/PlanModeLogo.d.ts +3 -0
  446. package/dist/ui/components/PlanModeLogo.d.ts.map +1 -0
  447. package/dist/ui/components/PlanModeLogo.js +49 -0
  448. package/dist/ui/components/PlanModeLogo.js.map +1 -0
  449. package/dist/ui/components/PlanOverlay.d.ts +7 -0
  450. package/dist/ui/components/PlanOverlay.d.ts.map +1 -1
  451. package/dist/ui/components/PlanOverlay.js +17 -3
  452. package/dist/ui/components/PlanOverlay.js.map +1 -1
  453. package/dist/ui/components/PlanOverlay.test.d.ts +2 -0
  454. package/dist/ui/components/PlanOverlay.test.d.ts.map +1 -0
  455. package/dist/ui/components/PlanOverlay.test.js +24 -0
  456. package/dist/ui/components/PlanOverlay.test.js.map +1 -0
  457. package/dist/ui/components/QueueIndicator.d.ts +9 -0
  458. package/dist/ui/components/QueueIndicator.d.ts.map +1 -0
  459. package/dist/ui/components/QueueIndicator.js +9 -0
  460. package/dist/ui/components/QueueIndicator.js.map +1 -0
  461. package/dist/ui/components/RewindOverlay.d.ts +18 -0
  462. package/dist/ui/components/RewindOverlay.d.ts.map +1 -0
  463. package/dist/ui/components/RewindOverlay.js +52 -0
  464. package/dist/ui/components/RewindOverlay.js.map +1 -0
  465. package/dist/ui/components/SelectList.d.ts.map +1 -1
  466. package/dist/ui/components/SelectList.js +5 -0
  467. package/dist/ui/components/SelectList.js.map +1 -1
  468. package/dist/ui/components/ServerToolExecution.d.ts +2 -0
  469. package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
  470. package/dist/ui/components/ServerToolExecution.js +7 -23
  471. package/dist/ui/components/ServerToolExecution.js.map +1 -1
  472. package/dist/ui/components/SessionSummary.d.ts +5 -0
  473. package/dist/ui/components/SessionSummary.d.ts.map +1 -0
  474. package/dist/ui/components/SessionSummary.js +32 -0
  475. package/dist/ui/components/SessionSummary.js.map +1 -0
  476. package/dist/ui/components/SlashCommandMenu.d.ts +4 -3
  477. package/dist/ui/components/SlashCommandMenu.d.ts.map +1 -1
  478. package/dist/ui/components/SlashCommandMenu.js +38 -26
  479. package/dist/ui/components/SlashCommandMenu.js.map +1 -1
  480. package/dist/ui/components/SlashStyledSelectList.d.ts +21 -0
  481. package/dist/ui/components/SlashStyledSelectList.d.ts.map +1 -0
  482. package/dist/ui/components/SlashStyledSelectList.js +71 -0
  483. package/dist/ui/components/SlashStyledSelectList.js.map +1 -0
  484. package/dist/ui/components/StreamingArea.d.ts +11 -2
  485. package/dist/ui/components/StreamingArea.d.ts.map +1 -1
  486. package/dist/ui/components/StreamingArea.js +20 -23
  487. package/dist/ui/components/StreamingArea.js.map +1 -1
  488. package/dist/ui/components/StreamingArea.test.d.ts +2 -0
  489. package/dist/ui/components/StreamingArea.test.d.ts.map +1 -0
  490. package/dist/ui/components/StreamingArea.test.js +18 -0
  491. package/dist/ui/components/StreamingArea.test.js.map +1 -0
  492. package/dist/ui/components/SubAgentPanel.d.ts +2 -1
  493. package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
  494. package/dist/ui/components/SubAgentPanel.js +4 -3
  495. package/dist/ui/components/SubAgentPanel.js.map +1 -1
  496. package/dist/ui/components/TaskOverlay.d.ts.map +1 -1
  497. package/dist/ui/components/TaskOverlay.js +53 -82
  498. package/dist/ui/components/TaskOverlay.js.map +1 -1
  499. package/dist/ui/components/TaskPickerMenu.d.ts +9 -0
  500. package/dist/ui/components/TaskPickerMenu.d.ts.map +1 -0
  501. package/dist/ui/components/TaskPickerMenu.js +33 -0
  502. package/dist/ui/components/TaskPickerMenu.js.map +1 -0
  503. package/dist/ui/components/ThemeSelector.js +2 -2
  504. package/dist/ui/components/ThemeSelector.js.map +1 -1
  505. package/dist/ui/components/ToolExecution.d.ts +2 -0
  506. package/dist/ui/components/ToolExecution.d.ts.map +1 -1
  507. package/dist/ui/components/ToolExecution.js +18 -52
  508. package/dist/ui/components/ToolExecution.js.map +1 -1
  509. package/dist/ui/components/ToolGroupExecution.d.ts +6 -2
  510. package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
  511. package/dist/ui/components/ToolGroupExecution.js +15 -147
  512. package/dist/ui/components/ToolGroupExecution.js.map +1 -1
  513. package/dist/ui/components/ToolUseLoader.d.ts +3 -1
  514. package/dist/ui/components/ToolUseLoader.d.ts.map +1 -1
  515. package/dist/ui/components/ToolUseLoader.js +2 -2
  516. package/dist/ui/components/ToolUseLoader.js.map +1 -1
  517. package/dist/ui/components/TranscriptViewport.d.ts +34 -0
  518. package/dist/ui/components/TranscriptViewport.d.ts.map +1 -0
  519. package/dist/ui/components/TranscriptViewport.js +45 -0
  520. package/dist/ui/components/TranscriptViewport.js.map +1 -0
  521. package/dist/ui/components/UserMessage.d.ts.map +1 -1
  522. package/dist/ui/components/UserMessage.js +15 -10
  523. package/dist/ui/components/UserMessage.js.map +1 -1
  524. package/dist/ui/components/UserMessage.test.d.ts +2 -0
  525. package/dist/ui/components/UserMessage.test.d.ts.map +1 -0
  526. package/dist/ui/components/UserMessage.test.js +39 -0
  527. package/dist/ui/components/UserMessage.test.js.map +1 -0
  528. package/dist/ui/components/index.d.ts +5 -0
  529. package/dist/ui/components/index.d.ts.map +1 -1
  530. package/dist/ui/components/index.js +5 -0
  531. package/dist/ui/components/index.js.map +1 -1
  532. package/dist/ui/duration-format.d.ts +2 -0
  533. package/dist/ui/duration-format.d.ts.map +1 -0
  534. package/dist/ui/duration-format.js +9 -0
  535. package/dist/ui/duration-format.js.map +1 -0
  536. package/dist/ui/duration-summary.d.ts +2 -0
  537. package/dist/ui/duration-summary.d.ts.map +1 -0
  538. package/dist/ui/duration-summary.js +66 -0
  539. package/dist/ui/duration-summary.js.map +1 -0
  540. package/dist/ui/error-item.d.ts +8 -0
  541. package/dist/ui/error-item.d.ts.map +1 -0
  542. package/dist/ui/error-item.js +32 -0
  543. package/dist/ui/error-item.js.map +1 -0
  544. package/dist/ui/footer-jump-regression.test.d.ts +2 -0
  545. package/dist/ui/footer-jump-regression.test.d.ts.map +1 -0
  546. package/dist/ui/footer-jump-regression.test.js +177 -0
  547. package/dist/ui/footer-jump-regression.test.js.map +1 -0
  548. package/dist/ui/footer-status-layout.test.js +22 -7
  549. package/dist/ui/footer-status-layout.test.js.map +1 -1
  550. package/dist/ui/goal-events.d.ts.map +1 -1
  551. package/dist/ui/goal-events.js +14 -6
  552. package/dist/ui/goal-events.js.map +1 -1
  553. package/dist/ui/goal-events.test.js +40 -2
  554. package/dist/ui/goal-events.test.js.map +1 -1
  555. package/dist/ui/goal-lifecycle-orchestration.test.d.ts +2 -0
  556. package/dist/ui/goal-lifecycle-orchestration.test.d.ts.map +1 -0
  557. package/dist/ui/goal-lifecycle-orchestration.test.js +512 -0
  558. package/dist/ui/goal-lifecycle-orchestration.test.js.map +1 -0
  559. package/dist/ui/goal-overlay.test.js +122 -44
  560. package/dist/ui/goal-overlay.test.js.map +1 -1
  561. package/dist/ui/goal-status-bar.test.js +29 -0
  562. package/dist/ui/goal-status-bar.test.js.map +1 -1
  563. package/dist/ui/goal-summary.d.ts +14 -0
  564. package/dist/ui/goal-summary.d.ts.map +1 -0
  565. package/dist/ui/goal-summary.js +194 -0
  566. package/dist/ui/goal-summary.js.map +1 -0
  567. package/dist/ui/hooks/useAgentLoop.d.ts +25 -4
  568. package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
  569. package/dist/ui/hooks/useAgentLoop.js +197 -22
  570. package/dist/ui/hooks/useAgentLoop.js.map +1 -1
  571. package/dist/ui/hooks/useAgentLoop.test.d.ts +2 -0
  572. package/dist/ui/hooks/useAgentLoop.test.d.ts.map +1 -0
  573. package/dist/ui/hooks/useAgentLoop.test.js +8 -0
  574. package/dist/ui/hooks/useAgentLoop.test.js.map +1 -0
  575. package/dist/ui/hooks/useChatLayoutMeasurements.d.ts +45 -0
  576. package/dist/ui/hooks/useChatLayoutMeasurements.d.ts.map +1 -0
  577. package/dist/ui/hooks/useChatLayoutMeasurements.js +97 -0
  578. package/dist/ui/hooks/useChatLayoutMeasurements.js.map +1 -0
  579. package/dist/ui/hooks/useContextCompaction.d.ts +41 -0
  580. package/dist/ui/hooks/useContextCompaction.d.ts.map +1 -0
  581. package/dist/ui/hooks/useContextCompaction.js +149 -0
  582. package/dist/ui/hooks/useContextCompaction.js.map +1 -0
  583. package/dist/ui/hooks/useModeState.d.ts +56 -0
  584. package/dist/ui/hooks/useModeState.d.ts.map +1 -0
  585. package/dist/ui/hooks/useModeState.js +65 -0
  586. package/dist/ui/hooks/useModeState.js.map +1 -0
  587. package/dist/ui/hooks/usePixelFixFlow.d.ts +57 -0
  588. package/dist/ui/hooks/usePixelFixFlow.d.ts.map +1 -0
  589. package/dist/ui/hooks/usePixelFixFlow.js +102 -0
  590. package/dist/ui/hooks/usePixelFixFlow.js.map +1 -0
  591. package/dist/ui/hooks/useSessionPersistence.d.ts +34 -0
  592. package/dist/ui/hooks/useSessionPersistence.d.ts.map +1 -0
  593. package/dist/ui/hooks/useSessionPersistence.js +67 -0
  594. package/dist/ui/hooks/useSessionPersistence.js.map +1 -0
  595. package/dist/ui/hooks/useTaskPickerController.d.ts +19 -0
  596. package/dist/ui/hooks/useTaskPickerController.d.ts.map +1 -0
  597. package/dist/ui/hooks/useTaskPickerController.js +41 -0
  598. package/dist/ui/hooks/useTaskPickerController.js.map +1 -0
  599. package/dist/ui/hooks/useTerminalSize.d.ts +13 -10
  600. package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
  601. package/dist/ui/hooks/useTerminalSize.js +21 -16
  602. package/dist/ui/hooks/useTerminalSize.js.map +1 -1
  603. package/dist/ui/hooks/useTranscriptHistory.d.ts +48 -0
  604. package/dist/ui/hooks/useTranscriptHistory.d.ts.map +1 -0
  605. package/dist/ui/hooks/useTranscriptHistory.js +113 -0
  606. package/dist/ui/hooks/useTranscriptHistory.js.map +1 -0
  607. package/dist/ui/hooks/useTranscriptHistory.test.d.ts +2 -0
  608. package/dist/ui/hooks/useTranscriptHistory.test.d.ts.map +1 -0
  609. package/dist/ui/hooks/useTranscriptHistory.test.js +61 -0
  610. package/dist/ui/hooks/useTranscriptHistory.test.js.map +1 -0
  611. package/dist/ui/hooks/useTranscriptScroll.d.ts +30 -0
  612. package/dist/ui/hooks/useTranscriptScroll.d.ts.map +1 -0
  613. package/dist/ui/hooks/useTranscriptScroll.js +44 -0
  614. package/dist/ui/hooks/useTranscriptScroll.js.map +1 -0
  615. package/dist/ui/hooks/useTranscriptScroll.test.d.ts +2 -0
  616. package/dist/ui/hooks/useTranscriptScroll.test.d.ts.map +1 -0
  617. package/dist/ui/hooks/useTranscriptScroll.test.js +119 -0
  618. package/dist/ui/hooks/useTranscriptScroll.test.js.map +1 -0
  619. package/dist/ui/item-helpers.d.ts +26 -0
  620. package/dist/ui/item-helpers.d.ts.map +1 -0
  621. package/dist/ui/item-helpers.js +114 -0
  622. package/dist/ui/item-helpers.js.map +1 -0
  623. package/dist/ui/layout-decisions.d.ts +81 -0
  624. package/dist/ui/layout-decisions.d.ts.map +1 -0
  625. package/dist/ui/layout-decisions.js +89 -0
  626. package/dist/ui/layout-decisions.js.map +1 -0
  627. package/dist/ui/live-area-clamp.test.d.ts +2 -0
  628. package/dist/ui/live-area-clamp.test.d.ts.map +1 -0
  629. package/dist/ui/live-area-clamp.test.js +88 -0
  630. package/dist/ui/live-area-clamp.test.js.map +1 -0
  631. package/dist/ui/live-area-height.d.ts +35 -0
  632. package/dist/ui/live-area-height.d.ts.map +1 -0
  633. package/dist/ui/live-area-height.js +80 -0
  634. package/dist/ui/live-area-height.js.map +1 -0
  635. package/dist/ui/live-area-height.test.d.ts +2 -0
  636. package/dist/ui/live-area-height.test.d.ts.map +1 -0
  637. package/dist/ui/live-area-height.test.js +67 -0
  638. package/dist/ui/live-area-height.test.js.map +1 -0
  639. package/dist/ui/live-frame-height.test.d.ts +2 -0
  640. package/dist/ui/live-frame-height.test.d.ts.map +1 -0
  641. package/dist/ui/live-frame-height.test.js +116 -0
  642. package/dist/ui/live-frame-height.test.js.map +1 -0
  643. package/dist/ui/live-item-flush.d.ts +2 -2
  644. package/dist/ui/live-item-flush.d.ts.map +1 -1
  645. package/dist/ui/live-item-flush.js +8 -4
  646. package/dist/ui/live-item-flush.js.map +1 -1
  647. package/dist/ui/login.js +1 -1
  648. package/dist/ui/long-prompt-regression-harness.test.d.ts +2 -0
  649. package/dist/ui/long-prompt-regression-harness.test.d.ts.map +1 -0
  650. package/dist/ui/long-prompt-regression-harness.test.js +195 -0
  651. package/dist/ui/long-prompt-regression-harness.test.js.map +1 -0
  652. package/dist/ui/mcp.d.ts +62 -0
  653. package/dist/ui/mcp.d.ts.map +1 -0
  654. package/dist/ui/mcp.js +306 -0
  655. package/dist/ui/mcp.js.map +1 -0
  656. package/dist/ui/plan-overlay.test.js +7 -29
  657. package/dist/ui/plan-overlay.test.js.map +1 -1
  658. package/dist/ui/prompt-routing.d.ts +11 -0
  659. package/dist/ui/prompt-routing.d.ts.map +1 -0
  660. package/dist/ui/prompt-routing.js +61 -0
  661. package/dist/ui/prompt-routing.js.map +1 -0
  662. package/dist/ui/queued-message.test.d.ts +2 -0
  663. package/dist/ui/queued-message.test.d.ts.map +1 -0
  664. package/dist/ui/queued-message.test.js +162 -0
  665. package/dist/ui/queued-message.test.js.map +1 -0
  666. package/dist/ui/render.d.ts +38 -42
  667. package/dist/ui/render.d.ts.map +1 -1
  668. package/dist/ui/render.js +128 -42
  669. package/dist/ui/render.js.map +1 -1
  670. package/dist/ui/render.test.d.ts +2 -0
  671. package/dist/ui/render.test.d.ts.map +1 -0
  672. package/dist/ui/render.test.js +16 -0
  673. package/dist/ui/render.test.js.map +1 -0
  674. package/dist/ui/scroll-stabilization.test.js +1 -7
  675. package/dist/ui/scroll-stabilization.test.js.map +1 -1
  676. package/dist/ui/session-summary.d.ts +63 -0
  677. package/dist/ui/session-summary.d.ts.map +1 -0
  678. package/dist/ui/session-summary.js +81 -0
  679. package/dist/ui/session-summary.js.map +1 -0
  680. package/dist/ui/slash-command-images.test.js +12 -11
  681. package/dist/ui/slash-command-images.test.js.map +1 -1
  682. package/dist/ui/stores/transcript-scroll-store.d.ts +27 -0
  683. package/dist/ui/stores/transcript-scroll-store.d.ts.map +1 -0
  684. package/dist/ui/stores/transcript-scroll-store.js +73 -0
  685. package/dist/ui/stores/transcript-scroll-store.js.map +1 -0
  686. package/dist/ui/stores/transcript-scroll-store.test.d.ts +2 -0
  687. package/dist/ui/stores/transcript-scroll-store.test.d.ts.map +1 -0
  688. package/dist/ui/stores/transcript-scroll-store.test.js +73 -0
  689. package/dist/ui/stores/transcript-scroll-store.test.js.map +1 -0
  690. package/dist/ui/streaming-flush-bounce.test.d.ts +2 -0
  691. package/dist/ui/streaming-flush-bounce.test.d.ts.map +1 -0
  692. package/dist/ui/streaming-flush-bounce.test.js +156 -0
  693. package/dist/ui/streaming-flush-bounce.test.js.map +1 -0
  694. package/dist/ui/submit-prompt-command.d.ts +49 -0
  695. package/dist/ui/submit-prompt-command.d.ts.map +1 -0
  696. package/dist/ui/submit-prompt-command.js +107 -0
  697. package/dist/ui/submit-prompt-command.js.map +1 -0
  698. package/dist/ui/submit-slash-commands.d.ts +12 -0
  699. package/dist/ui/submit-slash-commands.d.ts.map +1 -0
  700. package/dist/ui/submit-slash-commands.js +32 -0
  701. package/dist/ui/submit-slash-commands.js.map +1 -0
  702. package/dist/ui/terminal-history-format.d.ts +43 -0
  703. package/dist/ui/terminal-history-format.d.ts.map +1 -0
  704. package/dist/ui/terminal-history-format.js +133 -0
  705. package/dist/ui/terminal-history-format.js.map +1 -0
  706. package/dist/ui/terminal-history-retry-dedup.test.d.ts +2 -0
  707. package/dist/ui/terminal-history-retry-dedup.test.d.ts.map +1 -0
  708. package/dist/ui/terminal-history-retry-dedup.test.js +61 -0
  709. package/dist/ui/terminal-history-retry-dedup.test.js.map +1 -0
  710. package/dist/ui/terminal-history-spacing.d.ts +2 -0
  711. package/dist/ui/terminal-history-spacing.d.ts.map +1 -0
  712. package/dist/ui/terminal-history-spacing.js +2 -0
  713. package/dist/ui/terminal-history-spacing.js.map +1 -0
  714. package/dist/ui/terminal-history-status-renderers.d.ts +15 -0
  715. package/dist/ui/terminal-history-status-renderers.d.ts.map +1 -0
  716. package/dist/ui/terminal-history-status-renderers.js +99 -0
  717. package/dist/ui/terminal-history-status-renderers.js.map +1 -0
  718. package/dist/ui/terminal-history.d.ts +26 -0
  719. package/dist/ui/terminal-history.d.ts.map +1 -0
  720. package/dist/ui/terminal-history.js +916 -0
  721. package/dist/ui/terminal-history.js.map +1 -0
  722. package/dist/ui/terminal-history.test.d.ts +2 -0
  723. package/dist/ui/terminal-history.test.d.ts.map +1 -0
  724. package/dist/ui/terminal-history.test.js +550 -0
  725. package/dist/ui/terminal-history.test.js.map +1 -0
  726. package/dist/ui/testing/screen-recorder.d.ts +29 -0
  727. package/dist/ui/testing/screen-recorder.d.ts.map +1 -0
  728. package/dist/ui/testing/screen-recorder.js +179 -0
  729. package/dist/ui/testing/screen-recorder.js.map +1 -0
  730. package/dist/ui/thinking-level-cycle.test.d.ts +2 -0
  731. package/dist/ui/thinking-level-cycle.test.d.ts.map +1 -0
  732. package/dist/ui/thinking-level-cycle.test.js +45 -0
  733. package/dist/ui/thinking-level-cycle.test.js.map +1 -0
  734. package/dist/ui/thinking-level.d.ts +2 -0
  735. package/dist/ui/thinking-level.d.ts.map +1 -0
  736. package/dist/ui/thinking-level.js +2 -0
  737. package/dist/ui/thinking-level.js.map +1 -0
  738. package/dist/ui/tool-group-summary.d.ts +24 -0
  739. package/dist/ui/tool-group-summary.d.ts.map +1 -0
  740. package/dist/ui/tool-group-summary.js +233 -0
  741. package/dist/ui/tool-group-summary.js.map +1 -0
  742. package/dist/ui/tool-group-summary.test.d.ts +2 -0
  743. package/dist/ui/tool-group-summary.test.d.ts.map +1 -0
  744. package/dist/ui/tool-group-summary.test.js +79 -0
  745. package/dist/ui/tool-group-summary.test.js.map +1 -0
  746. package/dist/ui/tool-line-summary.d.ts +29 -0
  747. package/dist/ui/tool-line-summary.d.ts.map +1 -0
  748. package/dist/ui/tool-line-summary.js +153 -0
  749. package/dist/ui/tool-line-summary.js.map +1 -0
  750. package/dist/ui/transcript/MiscRows.d.ts +26 -0
  751. package/dist/ui/transcript/MiscRows.d.ts.map +1 -0
  752. package/dist/ui/transcript/MiscRows.js +68 -0
  753. package/dist/ui/transcript/MiscRows.js.map +1 -0
  754. package/dist/ui/transcript/StatusRow.d.ts +14 -0
  755. package/dist/ui/transcript/StatusRow.d.ts.map +1 -0
  756. package/dist/ui/transcript/StatusRow.js +14 -0
  757. package/dist/ui/transcript/StatusRow.js.map +1 -0
  758. package/dist/ui/transcript/ToolRows.d.ts +20 -0
  759. package/dist/ui/transcript/ToolRows.d.ts.map +1 -0
  760. package/dist/ui/transcript/ToolRows.js +25 -0
  761. package/dist/ui/transcript/ToolRows.js.map +1 -0
  762. package/dist/ui/transcript/TranscriptItemFrame.d.ts +8 -0
  763. package/dist/ui/transcript/TranscriptItemFrame.d.ts.map +1 -0
  764. package/dist/ui/transcript/TranscriptItemFrame.js +9 -0
  765. package/dist/ui/transcript/TranscriptItemFrame.js.map +1 -0
  766. package/dist/ui/transcript/TranscriptRenderer.d.ts +22 -0
  767. package/dist/ui/transcript/TranscriptRenderer.d.ts.map +1 -0
  768. package/dist/ui/transcript/TranscriptRenderer.js +111 -0
  769. package/dist/ui/transcript/TranscriptRenderer.js.map +1 -0
  770. package/dist/ui/transcript/presentation.d.ts +61 -0
  771. package/dist/ui/transcript/presentation.d.ts.map +1 -0
  772. package/dist/ui/transcript/presentation.js +86 -0
  773. package/dist/ui/transcript/presentation.js.map +1 -0
  774. package/dist/ui/transcript/spacing.d.ts +56 -0
  775. package/dist/ui/transcript/spacing.d.ts.map +1 -0
  776. package/dist/ui/transcript/spacing.js +129 -0
  777. package/dist/ui/transcript/spacing.js.map +1 -0
  778. package/dist/ui/transcript/spacing.test.d.ts +2 -0
  779. package/dist/ui/transcript/spacing.test.d.ts.map +1 -0
  780. package/dist/ui/transcript/spacing.test.js +193 -0
  781. package/dist/ui/transcript/spacing.test.js.map +1 -0
  782. package/dist/ui/transcript/tool-presentation.d.ts +12 -0
  783. package/dist/ui/transcript/tool-presentation.d.ts.map +1 -0
  784. package/dist/ui/transcript/tool-presentation.js +55 -0
  785. package/dist/ui/transcript/tool-presentation.js.map +1 -0
  786. package/dist/ui/transcript/transcript-lines.d.ts +32 -0
  787. package/dist/ui/transcript/transcript-lines.d.ts.map +1 -0
  788. package/dist/ui/transcript/transcript-lines.js +86 -0
  789. package/dist/ui/transcript/transcript-lines.js.map +1 -0
  790. package/dist/ui/transcript/transcript-lines.test.d.ts +2 -0
  791. package/dist/ui/transcript/transcript-lines.test.d.ts.map +1 -0
  792. package/dist/ui/transcript/transcript-lines.test.js +76 -0
  793. package/dist/ui/transcript/transcript-lines.test.js.map +1 -0
  794. package/dist/ui/transcript-viewport-pinning.test.d.ts +2 -0
  795. package/dist/ui/transcript-viewport-pinning.test.d.ts.map +1 -0
  796. package/dist/ui/transcript-viewport-pinning.test.js +148 -0
  797. package/dist/ui/transcript-viewport-pinning.test.js.map +1 -0
  798. package/dist/ui/tui-history-parity.test.d.ts +2 -0
  799. package/dist/ui/tui-history-parity.test.d.ts.map +1 -0
  800. package/dist/ui/tui-history-parity.test.js +381 -0
  801. package/dist/ui/tui-history-parity.test.js.map +1 -0
  802. package/dist/ui/tui-simulation.test.d.ts +2 -0
  803. package/dist/ui/tui-simulation.test.d.ts.map +1 -0
  804. package/dist/ui/tui-simulation.test.js +139 -0
  805. package/dist/ui/tui-simulation.test.js.map +1 -0
  806. package/dist/ui/tui-terminal-recorder.test.d.ts +2 -0
  807. package/dist/ui/tui-terminal-recorder.test.d.ts.map +1 -0
  808. package/dist/ui/tui-terminal-recorder.test.js +134 -0
  809. package/dist/ui/tui-terminal-recorder.test.js.map +1 -0
  810. package/dist/ui/utils/assistant-stream-split.d.ts +23 -0
  811. package/dist/ui/utils/assistant-stream-split.d.ts.map +1 -0
  812. package/dist/ui/utils/assistant-stream-split.js +41 -0
  813. package/dist/ui/utils/assistant-stream-split.js.map +1 -0
  814. package/dist/ui/utils/assistant-stream-split.test.d.ts +2 -0
  815. package/dist/ui/utils/assistant-stream-split.test.d.ts.map +1 -0
  816. package/dist/ui/utils/assistant-stream-split.test.js +40 -0
  817. package/dist/ui/utils/assistant-stream-split.test.js.map +1 -0
  818. package/dist/ui/utils/latex-to-unicode.d.ts +22 -0
  819. package/dist/ui/utils/latex-to-unicode.d.ts.map +1 -0
  820. package/dist/ui/utils/latex-to-unicode.js +538 -0
  821. package/dist/ui/utils/latex-to-unicode.js.map +1 -0
  822. package/dist/ui/utils/markdown-renderer.d.ts +20 -0
  823. package/dist/ui/utils/markdown-renderer.d.ts.map +1 -0
  824. package/dist/ui/utils/markdown-renderer.js +327 -0
  825. package/dist/ui/utils/markdown-renderer.js.map +1 -0
  826. package/dist/ui/utils/markdown-table.d.ts +9 -0
  827. package/dist/ui/utils/markdown-table.d.ts.map +1 -0
  828. package/dist/ui/utils/markdown-table.js +95 -0
  829. package/dist/ui/utils/markdown-table.js.map +1 -0
  830. package/dist/ui/utils/terminal-graphics.d.ts +16 -0
  831. package/dist/ui/utils/terminal-graphics.d.ts.map +1 -0
  832. package/dist/ui/utils/terminal-graphics.js +68 -0
  833. package/dist/ui/utils/terminal-graphics.js.map +1 -0
  834. package/dist/ui/utils/terminal-graphics.test.d.ts +2 -0
  835. package/dist/ui/utils/terminal-graphics.test.d.ts.map +1 -0
  836. package/dist/ui/utils/terminal-graphics.test.js +61 -0
  837. package/dist/ui/utils/terminal-graphics.test.js.map +1 -0
  838. package/dist/ui/utils/terminal-input.d.ts +3 -0
  839. package/dist/ui/utils/terminal-input.d.ts.map +1 -0
  840. package/dist/ui/utils/terminal-input.js +28 -0
  841. package/dist/ui/utils/terminal-input.js.map +1 -0
  842. package/dist/ui/utils/terminal-input.test.d.ts +2 -0
  843. package/dist/ui/utils/terminal-input.test.d.ts.map +1 -0
  844. package/dist/ui/utils/terminal-input.test.js +15 -0
  845. package/dist/ui/utils/terminal-input.test.js.map +1 -0
  846. package/dist/ui/utils/text-utils.d.ts +8 -0
  847. package/dist/ui/utils/text-utils.d.ts.map +1 -0
  848. package/dist/ui/utils/text-utils.js +16 -0
  849. package/dist/ui/utils/text-utils.js.map +1 -0
  850. package/dist/ui/utils/token-to-ansi.js +19 -9
  851. package/dist/ui/utils/token-to-ansi.js.map +1 -1
  852. package/dist/ui/utils/user-message-display.d.ts +7 -0
  853. package/dist/ui/utils/user-message-display.d.ts.map +1 -0
  854. package/dist/ui/utils/user-message-display.js +26 -0
  855. package/dist/ui/utils/user-message-display.js.map +1 -0
  856. package/dist/utils/format.js +7 -9
  857. package/dist/utils/format.js.map +1 -1
  858. package/dist/utils/image.d.ts +9 -0
  859. package/dist/utils/image.d.ts.map +1 -1
  860. package/dist/utils/image.js +25 -0
  861. package/dist/utils/image.js.map +1 -1
  862. package/dist/utils/plan-steps.d.ts.map +1 -1
  863. package/dist/utils/plan-steps.js +5 -1
  864. package/dist/utils/plan-steps.js.map +1 -1
  865. package/dist/utils/plan-steps.test.d.ts +2 -0
  866. package/dist/utils/plan-steps.test.d.ts.map +1 -0
  867. package/dist/utils/plan-steps.test.js +16 -0
  868. package/dist/utils/plan-steps.test.js.map +1 -0
  869. package/package.json +50 -10
  870. package/dist/core/repomap-context.d.ts +0 -11
  871. package/dist/core/repomap-context.d.ts.map +0 -1
  872. package/dist/core/repomap-context.js +0 -68
  873. package/dist/core/repomap-context.js.map +0 -1
  874. package/dist/core/repomap-context.test.d.ts +0 -2
  875. package/dist/core/repomap-context.test.d.ts.map +0 -1
  876. package/dist/core/repomap-context.test.js +0 -47
  877. package/dist/core/repomap-context.test.js.map +0 -1
  878. package/dist/core/repomap.d.ts +0 -74
  879. package/dist/core/repomap.d.ts.map +0 -1
  880. package/dist/core/repomap.js +0 -906
  881. package/dist/core/repomap.js.map +0 -1
  882. package/dist/core/repomap.test.d.ts +0 -2
  883. package/dist/core/repomap.test.d.ts.map +0 -1
  884. package/dist/core/repomap.test.js +0 -494
  885. package/dist/core/repomap.test.js.map +0 -1
  886. package/dist/ui/components/EyesOverlay.d.ts +0 -10
  887. package/dist/ui/components/EyesOverlay.d.ts.map +0 -1
  888. package/dist/ui/components/EyesOverlay.js +0 -220
  889. package/dist/ui/components/EyesOverlay.js.map +0 -1
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,41 +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
- // Task-mode ref true while a task-pane task (manual "work on it" or
540
- // run-all) is driving the agent. `enter_plan` checks this and refuses,
541
- // since task-pane runs are unattended and `exit_plan` would stall waiting
542
- // for human approval that never arrives.
543
- const taskRunningRef = { current: false };
544
- const onEnterPlanRef = {
545
- current: () => { },
546
- };
547
- const onExitPlanRef = {
548
- current: () => Promise.resolve("cancelled"),
549
- };
550
- const repoMapChangedFilesRef = { current: new Set() };
551
- const repoMapReadFilesRef = { current: new Set() };
552
- const toRepoMapPath = (root, filePath) => path.relative(root, filePath).split(path.sep).join("/");
553
- const markRepoMapRead = (root, filePath) => {
554
- repoMapReadFilesRef.current.add(toRepoMapPath(root, filePath));
555
- };
556
- const markRepoMapDirty = (root, filePath) => {
557
- const relativePath = toRepoMapPath(root, filePath);
558
- repoMapChangedFilesRef.current.add(relativePath);
559
- repoMapReadFilesRef.current.add(relativePath);
560
- };
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();
561
431
  const { tools, processManager } = createTools(cwd, {
562
432
  agents,
563
433
  skills,
564
434
  provider,
565
435
  model,
566
436
  planModeRef,
567
- taskRunningRef,
568
- onEnterPlan: (reason) => onEnterPlanRef.current(reason),
569
- onExitPlan: (planPath) => onExitPlanRef.current(planPath),
570
- onFileRead: (filePath) => markRepoMapRead(cwd, filePath),
571
- 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."),
572
441
  });
573
442
  // Rebuilds the cwd-bound tools for a different project root. Used by the
574
443
  // pixel-fix flow so the agent operates in the error's project, not in
@@ -580,25 +449,26 @@ async function runInkTUI(opts) {
580
449
  provider,
581
450
  model,
582
451
  planModeRef,
583
- taskRunningRef,
584
- onEnterPlan: (reason) => onEnterPlanRef.current(reason),
585
- onExitPlan: (planPath) => onExitPlanRef.current(planPath),
586
- onFileRead: (filePath) => markRepoMapRead(newCwd, filePath),
587
- 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."),
588
456
  });
589
457
  return rebuilt;
590
458
  };
591
- // 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".
592
461
  const mcpManager = new MCPClientManager();
593
- try {
594
- const providerApiKey = provider === "glm" ? credentialsByProvider["glm"]?.accessToken : undefined;
595
- const mcpTools = await mcpManager.connectAll(getMCPServers(provider, providerApiKey));
596
- tools.push(...mcpTools);
597
- }
598
- catch (err) {
599
- log("WARN", "mcp", `MCP initialization failed: ${err instanceof Error ? err.message : String(err)}`);
600
- }
601
- 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);
602
472
  // Kill all background processes on exit (synchronous — catches all exit paths)
603
473
  process.on("exit", () => {
604
474
  processManager.shutdownAll();
@@ -609,10 +479,15 @@ async function runInkTUI(opts) {
609
479
  // Session management — create or reuse session file
610
480
  const sessionManager = new SessionManager(paths.sessionsDir);
611
481
  let sessionPath;
482
+ let sessionId;
612
483
  let initialHistory;
613
484
  // Determine which session to resume (explicit path or most recent)
614
- const resumePath = opts.resumeSessionPath ??
615
- (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);
616
491
  if (resumePath) {
617
492
  try {
618
493
  const loaded = await sessionManager.load(resumePath);
@@ -620,6 +495,7 @@ async function runInkTUI(opts) {
620
495
  if (loadedMessages.length > 0) {
621
496
  messages.push(...loadedMessages);
622
497
  sessionPath = resumePath;
498
+ sessionId = loaded.header.id;
623
499
  log("INFO", "session", `Restored session`, {
624
500
  path: resumePath,
625
501
  messageCount: String(loadedMessages.length),
@@ -653,6 +529,7 @@ async function runInkTUI(opts) {
653
529
  messages: compacted.messages,
654
530
  });
655
531
  sessionPath = compactedSession.path;
532
+ sessionId = compactedSession.id;
656
533
  messages.length = 0;
657
534
  messages.push(...compacted.messages);
658
535
  log("INFO", "session", `Auto-compaction complete`, {
@@ -666,7 +543,11 @@ async function runInkTUI(opts) {
666
543
  }
667
544
  }
668
545
  const restoredMessages = getRestoredMessagesForDisplay(messages);
669
- initialHistory = messagesToHistoryItems(restoredMessages);
546
+ const restoredDisplayItems = sessionManager.getDisplayItems(loaded.entries, loaded.header.leafId);
547
+ initialHistory =
548
+ restoredDisplayItems.length > 0
549
+ ? restoredDisplayItems
550
+ : messagesToHistoryItems(restoredMessages);
670
551
  initialHistory.push({
671
552
  kind: "info",
672
553
  text: formatRestoreInfoText(loadedMessages.length, restoredMessages.length),
@@ -682,22 +563,12 @@ async function runInkTUI(opts) {
682
563
  if (!sessionPath) {
683
564
  const session = await sessionManager.create(cwd, provider, model);
684
565
  sessionPath = session.path;
566
+ sessionId = session.id;
685
567
  log("INFO", "session", `New session created`, { path: sessionPath });
686
568
  }
687
- // Eyes startup banner surface open journal signals from past sessions so the
688
- // user isn't relying on reading agent prose to know improvements are pending.
689
- if (isEyesActive(cwd)) {
690
- const openCount = journalCount({ status: "open" }, cwd);
691
- if (openCount > 0) {
692
- const s = openCount === 1 ? "" : "s";
693
- if (!initialHistory)
694
- initialHistory = [];
695
- initialHistory.push({
696
- kind: "info",
697
- text: `👁 Eyes: ${openCount} open improvement signal${s} from recent sessions. Run /eyes-improve to triage.`,
698
- id: "eyes-banner",
699
- });
700
- }
569
+ // Now that the session id is finalized, back /rewind with a checkpoint store.
570
+ if (sessionId) {
571
+ checkpointRef.current = new CheckpointStore({ sessionId, cwd });
701
572
  }
702
573
  await renderApp({
703
574
  provider,
@@ -718,357 +589,23 @@ async function runInkTUI(opts) {
718
589
  initialHistory,
719
590
  sessionsDir: paths.sessionsDir,
720
591
  sessionPath,
592
+ sessionId,
721
593
  processManager,
722
594
  settingsFile: paths.settingsFile,
723
595
  mcpManager,
724
596
  authStorage,
725
597
  planModeRef,
726
- taskRunningRef,
727
- onEnterPlanRef,
728
- onExitPlanRef,
598
+ goalModeRef,
729
599
  skills,
600
+ checkpointStore: checkpointRef.current ?? undefined,
730
601
  initialOverlay: opts.initialOverlay,
602
+ idealReviewEnabled: opts.idealReviewEnabled,
731
603
  rebuildToolsForCwd,
732
- repoMapChangedFilesRef,
733
- repoMapReadFilesRef,
604
+ connectInitialMcpTools,
605
+ planCallbacks: planToolCallbacks,
734
606
  });
735
607
  closeLogger();
736
608
  }
737
- // ── Login ──────────────────────────────────────────────────
738
- async function runLogin() {
739
- requireInteractiveTTY();
740
- clearVisibleScreen();
741
- const paths = await ensureAppDirs();
742
- initLogger(paths.logFile, { version: CLI_VERSION });
743
- log("INFO", "auth", "Login flow started");
744
- const authStorage = new AuthStorage();
745
- await authStorage.load();
746
- // Phase 1: Ink-based provider selector
747
- const provider = await renderLoginSelector(CLI_VERSION);
748
- if (!provider) {
749
- console.log(chalk.hex("#6b7280")("Login cancelled."));
750
- return;
751
- }
752
- console.log(chalk.hex("#60a5fa").bold("\nLogging in to ") +
753
- chalk.hex("#a78bfa")(displayName(provider)) +
754
- chalk.hex("#60a5fa").bold("...\n"));
755
- // Phase 2: OAuth flow (readline needed for Anthropic code paste)
756
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
757
- try {
758
- const callbacks = {
759
- onOpenUrl: (url) => {
760
- console.log(chalk.hex("#60a5fa").bold("Opening browser..."));
761
- openBrowser(url);
762
- console.log(chalk.hex("#6b7280")("\nIf the browser didn't open, visit:\n") +
763
- chalk.hex("#6b7280")(url) +
764
- "\n");
765
- },
766
- onPromptCode: async (message) => {
767
- return rl.question(message + " ");
768
- },
769
- onStatus: (message) => {
770
- console.log(chalk.hex("#6b7280")(message));
771
- },
772
- };
773
- let creds;
774
- if (provider === "glm" ||
775
- provider === "moonshot" ||
776
- provider === "xiaomi" ||
777
- provider === "minimax" ||
778
- provider === "deepseek" ||
779
- provider === "openrouter") {
780
- const keyLabel = provider === "glm"
781
- ? "Z.AI"
782
- : provider === "xiaomi"
783
- ? "Xiaomi MiMo"
784
- : provider === "minimax"
785
- ? "MiniMax"
786
- : provider === "deepseek"
787
- ? "DeepSeek"
788
- : provider === "openrouter"
789
- ? "OpenRouter"
790
- : "Moonshot";
791
- const apiKey = await rl.question(chalk.hex("#60a5fa")(`Paste your ${keyLabel} API key: `));
792
- if (!apiKey.trim()) {
793
- console.log(chalk.hex("#ef4444")("No API key provided. Login cancelled."));
794
- return;
795
- }
796
- creds = {
797
- accessToken: apiKey.trim(),
798
- refreshToken: "",
799
- expiresAt: Date.now() + 365 * 24 * 60 * 60 * 1000 * 100, // ~100 years
800
- ...(provider === "xiaomi" ? { baseUrl: "https://token-plan-sgp.xiaomimimo.com/v1" } : {}),
801
- };
802
- }
803
- else {
804
- creds =
805
- provider === "anthropic"
806
- ? await loginAnthropic(callbacks)
807
- : provider === "gemini"
808
- ? await loginGemini(callbacks)
809
- : await loginOpenAI(callbacks);
810
- }
811
- await authStorage.setCredentials(provider, creds);
812
- log("INFO", "auth", `Login succeeded for ${displayName(provider)}`);
813
- console.log(chalk.hex("#4ade80")(`\n✓ Logged in to ${displayName(provider)} successfully!`));
814
- }
815
- finally {
816
- rl.close();
817
- closeLogger();
818
- }
819
- }
820
- // ── Doctor ─────────────────────────────────────────────────
821
- async function runDoctor() {
822
- clearVisibleScreen();
823
- const os = await import("node:os");
824
- const fsP = await import("node:fs/promises");
825
- const dim = chalk.hex("#6b7280");
826
- const primary = chalk.hex("#60a5fa");
827
- const accent = chalk.hex("#a78bfa");
828
- const good = chalk.hex("#4ade80");
829
- const warn = chalk.hex("#fbbf24");
830
- const bad = chalk.hex("#ef4444");
831
- // ── Banner ──────────────────────────────────────────────────
832
- const LOGO = LOGO_LINES;
833
- const GAP = " ";
834
- console.log();
835
- console.log(` ${gradientLine(LOGO[0])}${GAP}` +
836
- primary.bold("EZ Coder") +
837
- dim(` v${CLI_VERSION}`) +
838
- dim(" · By ") +
839
- chalk.white.bold("Nolan Grout"));
840
- console.log(` ${gradientLine(LOGO[1])}${GAP}` + accent("Doctor"));
841
- console.log(` ${gradientLine(LOGO[2])}${GAP}` + dim("Diagnose & Fix"));
842
- console.log();
843
- const home = os.homedir();
844
- const ggDir = path.join(home, ".ezcoder");
845
- const authFile = path.join(ggDir, "auth.json");
846
- const lockFile = authFile + ".lock";
847
- const myUid = process.getuid();
848
- let fixed = 0;
849
- // ── Environment ─────────────────────────────────────────────
850
- console.log(accent(" Environment\n"));
851
- console.log(dim(` Home: ${home}`));
852
- console.log(dim(` $HOME: ${process.env.HOME ?? "(not set)"}`));
853
- console.log(dim(` Node.js: ${process.version}`));
854
- console.log(dim(` Platform: ${process.platform} ${process.arch}`));
855
- console.log(dim(` UID: ${myUid} EUID: ${process.geteuid()}`));
856
- if (process.env.HOME && process.env.HOME !== home) {
857
- console.log(warn("\n ⚠ $HOME differs from os.homedir() — this can cause auth mismatches"));
858
- }
859
- if (myUid !== process.geteuid()) {
860
- console.log(warn(" ⚠ uid ≠ euid — running with elevated privileges (sudo?)"));
861
- console.log(dim(" Running ezcoder with sudo can cause ownership issues."));
862
- console.log(dim(" Use without sudo, or fix after: sudo chown -R $(whoami) ~/.gg"));
863
- }
864
- console.log();
865
- // ── Config Directory ────────────────────────────────────────
866
- console.log(accent(" Config Directory\n"));
867
- try {
868
- const stat = await fsP.stat(ggDir);
869
- const mode = stat.mode & 0o777;
870
- console.log(dim(` Path: ${ggDir}`));
871
- console.log(dim(` Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
872
- // Fix ownership
873
- if (stat.uid !== myUid) {
874
- console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
875
- try {
876
- await fsP.chown(ggDir, myUid, process.getgid());
877
- console.log(good(" ✓ Fixed directory ownership"));
878
- fixed++;
879
- }
880
- catch {
881
- console.log(bad(` ✗ Cannot fix — try: sudo chown -R $(whoami) ${ggDir}`));
882
- }
883
- }
884
- // Fix permissions (should be 0o700)
885
- if (mode !== 0o700) {
886
- try {
887
- await fsP.chmod(ggDir, 0o700);
888
- console.log(good(" ✓ Fixed directory permissions → 0o700"));
889
- fixed++;
890
- }
891
- catch {
892
- console.log(bad(` ✗ Cannot fix — try: chmod 700 ${ggDir}`));
893
- }
894
- }
895
- }
896
- catch {
897
- console.log(warn(` ${ggDir} missing — creating...`));
898
- try {
899
- await fsP.mkdir(ggDir, { recursive: true, mode: 0o700 });
900
- console.log(good(` ✓ Created ${ggDir}`));
901
- fixed++;
902
- }
903
- catch (mkErr) {
904
- console.log(bad(` ✗ Cannot create: ${mkErr instanceof Error ? mkErr.message : String(mkErr)}`));
905
- console.log();
906
- return;
907
- }
908
- }
909
- console.log();
910
- // ── Lock File ───────────────────────────────────────────────
911
- try {
912
- const lockStat = await fsP.stat(lockFile);
913
- const ageMs = Date.now() - lockStat.mtimeMs;
914
- console.log(accent(" Lock File\n"));
915
- console.log(warn(` ⚠ Stale lock found (age: ${Math.round(ageMs / 1000)}s)`));
916
- await fsP.unlink(lockFile);
917
- console.log(good(" ✓ Removed"));
918
- fixed++;
919
- console.log();
920
- }
921
- catch {
922
- // No lock file — good, skip section entirely
923
- }
924
- // ── Auth File ───────────────────────────────────────────────
925
- console.log(accent(" Auth File\n"));
926
- let authData = null;
927
- let authNeedsRewrite = false;
928
- try {
929
- const stat = await fsP.stat(authFile);
930
- const mode = stat.mode & 0o777;
931
- console.log(dim(` Path: ${authFile}`));
932
- console.log(dim(` Size: ${stat.size} bytes Mode: 0o${mode.toString(8)} UID: ${stat.uid}`));
933
- // Fix ownership
934
- if (stat.uid !== myUid) {
935
- console.log(warn(` ⚠ Owned by uid ${stat.uid}, expected ${myUid}`));
936
- try {
937
- await fsP.chown(authFile, myUid, process.getgid());
938
- console.log(good(" ✓ Fixed file ownership"));
939
- fixed++;
940
- }
941
- catch {
942
- console.log(bad(` ✗ Cannot fix — try: sudo chown $(whoami) ${authFile}`));
943
- }
944
- }
945
- // Fix permissions (should be 0o600)
946
- if (mode !== 0o600) {
947
- try {
948
- await fsP.chmod(authFile, 0o600);
949
- console.log(good(" ✓ Fixed file permissions → 0o600"));
950
- fixed++;
951
- }
952
- catch {
953
- console.log(bad(` ✗ Cannot fix — try: chmod 600 ${authFile}`));
954
- }
955
- }
956
- // Try to read and parse
957
- try {
958
- const content = await fsP.readFile(authFile, "utf-8");
959
- try {
960
- authData = JSON.parse(content);
961
- }
962
- catch {
963
- console.log(bad(" ✗ Invalid JSON — backing up and resetting"));
964
- const backupName = `auth.json.corrupt.${Date.now()}`;
965
- await fsP.copyFile(authFile, path.join(ggDir, backupName));
966
- await fsP.writeFile(authFile, "{}", { encoding: "utf-8", mode: 0o600 });
967
- console.log(good(` ✓ Corrupt file backed up as ${backupName}`));
968
- console.log(dim(' Run "ezcoder login" to re-authenticate'));
969
- authData = {};
970
- fixed++;
971
- }
972
- }
973
- catch (readErr) {
974
- const code = readErr.code;
975
- if (code === "EACCES") {
976
- console.log(bad(" ✗ Permission denied reading auth.json"));
977
- console.log(dim(` Try: sudo chown $(whoami) ${authFile} && chmod 600 ${authFile}`));
978
- }
979
- else {
980
- console.log(bad(` ✗ Read error: ${readErr instanceof Error ? readErr.message : String(readErr)}`));
981
- }
982
- }
983
- }
984
- catch {
985
- console.log(dim(` Path: ${authFile}`));
986
- console.log(warn(' Not found — run "ezcoder login" to authenticate'));
987
- }
988
- console.log();
989
- // ── Credentials ─────────────────────────────────────────────
990
- if (authData && Object.keys(authData).length > 0) {
991
- console.log(accent(" Credentials\n"));
992
- for (const p of Object.keys(authData)) {
993
- const cred = authData[p];
994
- if (!cred || typeof cred !== "object") {
995
- console.log(bad(` ✗ ${p}: invalid entry — removing`));
996
- delete authData[p];
997
- authNeedsRewrite = true;
998
- fixed++;
999
- continue;
1000
- }
1001
- if (!cred.accessToken || typeof cred.accessToken !== "string") {
1002
- console.log(bad(` ✗ ${p}: missing accessToken — removing`));
1003
- delete authData[p];
1004
- authNeedsRewrite = true;
1005
- fixed++;
1006
- continue;
1007
- }
1008
- const token = String(cred.accessToken);
1009
- const masked = token.slice(0, 8) + "..." + token.slice(-4);
1010
- const expires = typeof cred.expiresAt === "number" ? new Date(cred.expiresAt).toISOString() : "unknown";
1011
- const expired = typeof cred.expiresAt === "number" && Date.now() > cred.expiresAt;
1012
- if (expired) {
1013
- console.log(warn(` ⚠ ${p}: ${masked} expired ${expires}`));
1014
- }
1015
- else {
1016
- console.log(good(` ✓ ${p}: ${masked} expires ${expires}`));
1017
- }
1018
- }
1019
- if (authNeedsRewrite) {
1020
- try {
1021
- await fsP.writeFile(authFile, JSON.stringify(authData, null, 2), {
1022
- encoding: "utf-8",
1023
- mode: 0o600,
1024
- });
1025
- console.log(good(" ✓ Cleaned up auth.json"));
1026
- }
1027
- catch {
1028
- console.log(bad(" ✗ Failed to write cleaned auth.json"));
1029
- }
1030
- }
1031
- console.log();
1032
- }
1033
- // ── Temp Files ──────────────────────────────────────────────
1034
- try {
1035
- const entries = await fsP.readdir(ggDir);
1036
- const tmpFiles = entries.filter((e) => e.startsWith("auth.json.") && e.endsWith(".tmp"));
1037
- if (tmpFiles.length > 0) {
1038
- console.log(accent(" Temp Files\n"));
1039
- console.log(warn(` ⚠ ${tmpFiles.length} orphaned temp file(s) from interrupted writes`));
1040
- for (const tmp of tmpFiles) {
1041
- await fsP.unlink(path.join(ggDir, tmp)).catch(() => { });
1042
- }
1043
- console.log(good(` ✓ Removed ${tmpFiles.length} file(s)`));
1044
- fixed++;
1045
- console.log();
1046
- }
1047
- }
1048
- catch {
1049
- // Can't read directory — already flagged above
1050
- }
1051
- // ── Summary ─────────────────────────────────────────────────
1052
- if (fixed > 0) {
1053
- console.log(good(` ✓ Fixed ${fixed} issue${fixed > 1 ? "s" : ""}.`));
1054
- }
1055
- else {
1056
- console.log(good(" ✓ Everything looks good."));
1057
- }
1058
- console.log();
1059
- }
1060
- // ── Logout ─────────────────────────────────────────────────
1061
- async function runLogout() {
1062
- const paths = await ensureAppDirs();
1063
- initLogger(paths.logFile, { version: CLI_VERSION });
1064
- log("INFO", "auth", "Logout requested");
1065
- const authStorage = new AuthStorage();
1066
- await authStorage.load();
1067
- await authStorage.clearAll();
1068
- log("INFO", "auth", "Logout succeeded");
1069
- closeLogger();
1070
- console.log(chalk.green("Logged out successfully."));
1071
- }
1072
609
  // ── Sessions ──────────────────────────────────────────────
1073
610
  async function runSessions() {
1074
611
  requireInteractiveTTY();
@@ -1098,11 +635,11 @@ async function runSessions() {
1098
635
  return "MiniMax-M2.7";
1099
636
  if (p === "deepseek")
1100
637
  return "deepseek-v4-pro";
1101
- return "claude-opus-4-7";
638
+ return "claude-opus-4-8";
1102
639
  }
1103
640
  const model = saved2.model ?? getDefault(provider);
1104
641
  const thinkingLevel = saved2.thinkingEnabled
1105
- ? getMaxThinkingLevel(model)
642
+ ? (saved2.thinkingLevel ?? getMaxThinkingLevel(model))
1106
643
  : undefined;
1107
644
  closeLogger();
1108
645
  await runInkTUI({
@@ -1110,6 +647,7 @@ async function runSessions() {
1110
647
  model,
1111
648
  cwd,
1112
649
  thinkingLevel,
650
+ idealReviewEnabled: saved2.idealReviewEnabled,
1113
651
  resumeSessionPath: selectedPath,
1114
652
  theme: saved2.theme,
1115
653
  });
@@ -1287,7 +825,7 @@ async function runServe() {
1287
825
  const preferredProvider = serveValues.provider ?? saved3.provider ?? "anthropic";
1288
826
  const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, serveValues.model ?? saved3.model);
1289
827
  const thinkingLevel = saved3.thinkingEnabled
1290
- ? getMaxThinkingLevel(model)
828
+ ? (saved3.thinkingLevel ?? getMaxThinkingLevel(model))
1291
829
  : undefined;
1292
830
  initLogger(paths.logFile, {
1293
831
  version: CLI_VERSION,
@@ -1330,32 +868,16 @@ async function runAgentHomeLogin() {
1330
868
  log("INFO", "agent-home", "Agent Home login started");
1331
869
  const existing = await loadAgentHomeConfig();
1332
870
  // Banner
1333
- const LOGO = [
1334
- " \u2584\u2580\u2580\u2580 \u2584\u2580\u2580\u2580",
1335
- " \u2588 \u2580\u2588 \u2588 \u2580\u2588",
1336
- " \u2580\u2584\u2584\u2580 \u2580\u2584\u2584\u2580",
1337
- ];
1338
- function gradientTextLocal(text) {
1339
- let colorIdx = 0;
1340
- return text
1341
- .split("")
1342
- .map((ch) => {
1343
- if (ch === " ")
1344
- return ch;
1345
- const color = GRADIENT[colorIdx++ % GRADIENT.length];
1346
- return chalk.hex(color)(ch);
1347
- })
1348
- .join("");
1349
- }
871
+ const LOGO = LOGO_LINES;
1350
872
  const GAP = " ";
1351
873
  console.log();
1352
- console.log(` ${gradientTextLocal(LOGO[0])}${GAP}` +
874
+ console.log(` ${gradientLine(LOGO[0])}${GAP}` +
1353
875
  chalk.hex("#60a5fa").bold("EZ Coder") +
1354
876
  chalk.hex("#6b7280")(` v${CLI_VERSION}`) +
1355
877
  chalk.hex("#6b7280")(" \u00b7 By ") +
1356
878
  chalk.white.bold("Nolan Grout"));
1357
- console.log(` ${gradientTextLocal(LOGO[1])}${GAP}` + chalk.hex("#a78bfa")("Agent Home Setup"));
1358
- 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"));
1359
881
  console.log();
1360
882
  if (existing) {
1361
883
  console.log(chalk.hex("#6b7280")(" Current config:\n") +
@@ -1419,7 +941,7 @@ async function runAgentHome() {
1419
941
  const preferredProvider = ahValues.provider ?? saved4.provider ?? "anthropic";
1420
942
  const { provider, model } = await resolveActiveProvider(authStorage, preferredProvider, ahValues.model ?? saved4.model);
1421
943
  const thinkingLevel = saved4.thinkingEnabled
1422
- ? getMaxThinkingLevel(model)
944
+ ? (saved4.thinkingLevel ?? getMaxThinkingLevel(model))
1423
945
  : undefined;
1424
946
  initLogger(paths.logFile, {
1425
947
  version: CLI_VERSION,
@@ -1437,105 +959,6 @@ async function runAgentHome() {
1437
959
  });
1438
960
  }
1439
961
  // ── Pixel ──────────────────────────────────────────────────
1440
- async function runPixel() {
1441
- const sub = process.argv[3];
1442
- const rest = process.argv.slice(4);
1443
- if (sub === "install") {
1444
- const { runPixelInstall } = await import("./core/pixel.js");
1445
- const opts = parsePixelInstallArgs(rest);
1446
- await runPixelInstall(opts);
1447
- return;
1448
- }
1449
- if (sub === "fix") {
1450
- const errorId = rest[0];
1451
- if (!errorId) {
1452
- process.stderr.write("Usage: ezcoder pixel fix <error_id>\n");
1453
- process.exit(1);
1454
- }
1455
- const { fixError } = await import("./core/pixel-fix.js");
1456
- const result = await fixError(errorId);
1457
- if (result.outcome === "awaiting_review") {
1458
- console.log(chalk.hex("#4ade80")(`✓ ${result.reason}`));
1459
- }
1460
- else {
1461
- console.log(chalk.hex("#ef4444")(`✗ ${result.reason}`));
1462
- process.exit(1);
1463
- }
1464
- return;
1465
- }
1466
- if (sub === "run") {
1467
- const { runQueue } = await import("./core/pixel-fix.js");
1468
- const result = await runQueue();
1469
- console.log(chalk.bold(`${result.fixed} fixed · ${result.failed} failed · ${result.total} total`));
1470
- if (result.failed > 0)
1471
- process.exit(1);
1472
- return;
1473
- }
1474
- if (sub === "--help" || sub === "-h") {
1475
- printPixelHelp();
1476
- return;
1477
- }
1478
- if (sub === "list") {
1479
- const { listAllErrors } = await import("./core/pixel.js");
1480
- await listAllErrors();
1481
- return;
1482
- }
1483
- if (sub) {
1484
- process.stderr.write(`Unknown pixel subcommand: ${sub}\n`);
1485
- printPixelHelp();
1486
- process.exit(1);
1487
- }
1488
- // No subcommand → launch the Ink TUI with the pixel overlay open. The fix
1489
- // flow runs through the same agent loop as a Task, streaming live in the
1490
- // chat instead of spawning a subprocess.
1491
- // Non-TTY (CI, piped) → fall back to text list.
1492
- if (!process.stdin.isTTY) {
1493
- const { listAllErrors } = await import("./core/pixel.js");
1494
- await listAllErrors();
1495
- return;
1496
- }
1497
- const saved = loadSavedSettings();
1498
- const provider = saved.provider ?? "anthropic";
1499
- const model = saved.model ?? defaultModelFor(provider);
1500
- await runInkTUI({
1501
- provider,
1502
- model,
1503
- cwd: process.cwd(),
1504
- thinkingLevel: saved.thinkingEnabled ? "medium" : undefined,
1505
- theme: saved.theme,
1506
- initialOverlay: "pixel",
1507
- });
1508
- }
1509
- function defaultModelFor(p) {
1510
- return getDefaultModel(p).id;
1511
- }
1512
- function parsePixelInstallArgs(args) {
1513
- const out = { skipPackageInstall: false };
1514
- for (let i = 0; i < args.length; i++) {
1515
- const a = args[i];
1516
- if (a === "--ingest-url")
1517
- out.ingestUrl = args[++i];
1518
- else if (a === "--name")
1519
- out.name = args[++i];
1520
- else if (a === "--skip-install")
1521
- out.skipPackageInstall = true;
1522
- }
1523
- return out;
1524
- }
1525
- function printPixelHelp() {
1526
- console.log(`ezcoder pixel — error tracking + auto-fix queue
1527
-
1528
- Usage:
1529
- ezcoder pixel List open errors across every registered project
1530
- ezcoder pixel install Register the current project and wire up the SDK
1531
- ezcoder pixel fix <error_id> Fix one specific error end-to-end
1532
- ezcoder pixel run Auto-fix every open error across all projects
1533
-
1534
- ezcoder pixel install --name <name> Override the project name
1535
- ezcoder pixel install --ingest-url <url> Use a custom backend URL
1536
- ezcoder pixel install --skip-install Don't run the package manager
1537
- `);
1538
- }
1539
962
  // ── Helpers ────────────────────────────────────────────────
1540
963
  /**
1541
964
  * Pick the provider/model to start with. If the preferred provider isn't
@@ -1579,25 +1002,6 @@ async function resolveActiveProvider(authStorage, preferred, savedModel) {
1579
1002
  const provider = loggedInProviders[0];
1580
1003
  return { provider, model: getDefaultModel(provider).id, loggedInProviders };
1581
1004
  }
1582
- function displayName(provider) {
1583
- if (provider === "anthropic")
1584
- return "Anthropic";
1585
- if (provider === "xiaomi")
1586
- return "Xiaomi (MiMo)";
1587
- if (provider === "gemini")
1588
- return "Gemini";
1589
- if (provider === "glm")
1590
- return "Z.AI (GLM)";
1591
- if (provider === "moonshot")
1592
- return "Moonshot";
1593
- if (provider === "minimax")
1594
- return "MiniMax";
1595
- if (provider === "deepseek")
1596
- return "DeepSeek";
1597
- if (provider === "openrouter")
1598
- return "OpenRouter";
1599
- return "OpenAI";
1600
- }
1601
1005
  function extractText(content) {
1602
1006
  if (typeof content === "string")
1603
1007
  return content;
@@ -1606,9 +1010,45 @@ function extractText(content) {
1606
1010
  .map((b) => b.text)
1607
1011
  .join("\n");
1608
1012
  }
1609
- 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) {
1610
1026
  const items = [];
1611
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
+ };
1612
1052
  // Index tool results by toolCallId for pairing with tool calls
1613
1053
  const toolResults = new Map();
1614
1054
  for (const msg of msgs) {
@@ -1632,14 +1072,19 @@ function messagesToHistoryItems(msgs) {
1632
1072
  roleCounts[msg.role] = (roleCounts[msg.role] ?? 0) + 1;
1633
1073
  if (msg.role === "user") {
1634
1074
  const text = extractText(msg.content);
1635
- if (text)
1636
- 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
+ });
1637
1082
  }
1638
1083
  else if (msg.role === "assistant") {
1639
1084
  const content = msg.content;
1640
1085
  if (typeof content === "string") {
1641
1086
  if (content)
1642
- items.push({ kind: "assistant", text: content, id: `restore-${id++}` });
1087
+ pushRestoredAssistantText(content);
1643
1088
  continue;
1644
1089
  }
1645
1090
  for (const block of content) {
@@ -1662,7 +1107,7 @@ function messagesToHistoryItems(msgs) {
1662
1107
  let textBuf = "";
1663
1108
  const flushText = () => {
1664
1109
  if (textBuf) {
1665
- items.push({ kind: "assistant", text: textBuf, id: `restore-${id++}` });
1110
+ pushRestoredAssistantText(textBuf);
1666
1111
  textBuf = "";
1667
1112
  }
1668
1113
  };
@@ -1716,11 +1161,8 @@ function messagesToHistoryItems(msgs) {
1716
1161
  });
1717
1162
  return items;
1718
1163
  }
1719
- function openBrowser(url) {
1720
- const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
1721
- execFile(cmd, [url], () => {
1722
- // Ignore errors — user can copy URL manually
1723
- });
1164
+ if (process.argv[1] &&
1165
+ fileURLToPath(import.meta.url) === fs.realpathSync(path.resolve(process.argv[1]))) {
1166
+ main();
1724
1167
  }
1725
- main();
1726
1168
  //# sourceMappingURL=cli.js.map