reasonix 0.49.0 → 0.50.0

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 (326) hide show
  1. package/dashboard/dist/app.css +1 -0
  2. package/dashboard/dist/app.js +28 -30531
  3. package/dashboard/dist/app.js.map +1 -1
  4. package/dashboard/dist/assets/KaTeX_AMS-Regular.ttf +0 -0
  5. package/dashboard/dist/assets/KaTeX_AMS-Regular.woff +0 -0
  6. package/dashboard/dist/assets/KaTeX_AMS-Regular.woff2 +0 -0
  7. package/dashboard/dist/assets/KaTeX_Caligraphic-Bold.ttf +0 -0
  8. package/dashboard/dist/assets/KaTeX_Caligraphic-Bold.woff +0 -0
  9. package/dashboard/dist/assets/KaTeX_Caligraphic-Bold.woff2 +0 -0
  10. package/dashboard/dist/assets/KaTeX_Caligraphic-Regular.ttf +0 -0
  11. package/dashboard/dist/assets/KaTeX_Caligraphic-Regular.woff +0 -0
  12. package/dashboard/dist/assets/KaTeX_Caligraphic-Regular.woff2 +0 -0
  13. package/dashboard/dist/assets/KaTeX_Fraktur-Bold.ttf +0 -0
  14. package/dashboard/dist/assets/KaTeX_Fraktur-Bold.woff +0 -0
  15. package/dashboard/dist/assets/KaTeX_Fraktur-Bold.woff2 +0 -0
  16. package/dashboard/dist/assets/KaTeX_Fraktur-Regular.ttf +0 -0
  17. package/dashboard/dist/assets/KaTeX_Fraktur-Regular.woff +0 -0
  18. package/dashboard/dist/assets/KaTeX_Fraktur-Regular.woff2 +0 -0
  19. package/dashboard/dist/assets/KaTeX_Main-Bold.ttf +0 -0
  20. package/dashboard/dist/assets/KaTeX_Main-Bold.woff +0 -0
  21. package/dashboard/dist/assets/KaTeX_Main-Bold.woff2 +0 -0
  22. package/dashboard/dist/assets/KaTeX_Main-BoldItalic.ttf +0 -0
  23. package/dashboard/dist/assets/KaTeX_Main-BoldItalic.woff +0 -0
  24. package/dashboard/dist/assets/KaTeX_Main-BoldItalic.woff2 +0 -0
  25. package/dashboard/dist/assets/KaTeX_Main-Italic.ttf +0 -0
  26. package/dashboard/dist/assets/KaTeX_Main-Italic.woff +0 -0
  27. package/dashboard/dist/assets/KaTeX_Main-Italic.woff2 +0 -0
  28. package/dashboard/dist/assets/KaTeX_Main-Regular.ttf +0 -0
  29. package/dashboard/dist/assets/KaTeX_Main-Regular.woff +0 -0
  30. package/dashboard/dist/assets/KaTeX_Main-Regular.woff2 +0 -0
  31. package/dashboard/dist/assets/KaTeX_Math-BoldItalic.ttf +0 -0
  32. package/dashboard/dist/assets/KaTeX_Math-BoldItalic.woff +0 -0
  33. package/dashboard/dist/assets/KaTeX_Math-BoldItalic.woff2 +0 -0
  34. package/dashboard/dist/assets/KaTeX_Math-Italic.ttf +0 -0
  35. package/dashboard/dist/assets/KaTeX_Math-Italic.woff +0 -0
  36. package/dashboard/dist/assets/KaTeX_Math-Italic.woff2 +0 -0
  37. package/dashboard/dist/assets/KaTeX_SansSerif-Bold.ttf +0 -0
  38. package/dashboard/dist/assets/KaTeX_SansSerif-Bold.woff +0 -0
  39. package/dashboard/dist/assets/KaTeX_SansSerif-Bold.woff2 +0 -0
  40. package/dashboard/dist/assets/KaTeX_SansSerif-Italic.ttf +0 -0
  41. package/dashboard/dist/assets/KaTeX_SansSerif-Italic.woff +0 -0
  42. package/dashboard/dist/assets/KaTeX_SansSerif-Italic.woff2 +0 -0
  43. package/dashboard/dist/assets/KaTeX_SansSerif-Regular.ttf +0 -0
  44. package/dashboard/dist/assets/KaTeX_SansSerif-Regular.woff +0 -0
  45. package/dashboard/dist/assets/KaTeX_SansSerif-Regular.woff2 +0 -0
  46. package/dashboard/dist/assets/KaTeX_Script-Regular.ttf +0 -0
  47. package/dashboard/dist/assets/KaTeX_Script-Regular.woff +0 -0
  48. package/dashboard/dist/assets/KaTeX_Script-Regular.woff2 +0 -0
  49. package/dashboard/dist/assets/KaTeX_Size1-Regular.ttf +0 -0
  50. package/dashboard/dist/assets/KaTeX_Size1-Regular.woff +0 -0
  51. package/dashboard/dist/assets/KaTeX_Size1-Regular.woff2 +0 -0
  52. package/dashboard/dist/assets/KaTeX_Size2-Regular.ttf +0 -0
  53. package/dashboard/dist/assets/KaTeX_Size2-Regular.woff +0 -0
  54. package/dashboard/dist/assets/KaTeX_Size2-Regular.woff2 +0 -0
  55. package/dashboard/dist/assets/KaTeX_Size3-Regular.ttf +0 -0
  56. package/dashboard/dist/assets/KaTeX_Size3-Regular.woff +0 -0
  57. package/dashboard/dist/assets/KaTeX_Size4-Regular.ttf +0 -0
  58. package/dashboard/dist/assets/KaTeX_Size4-Regular.woff +0 -0
  59. package/dashboard/dist/assets/KaTeX_Size4-Regular.woff2 +0 -0
  60. package/dashboard/dist/assets/KaTeX_Typewriter-Regular.ttf +0 -0
  61. package/dashboard/dist/assets/KaTeX_Typewriter-Regular.woff +0 -0
  62. package/dashboard/dist/assets/KaTeX_Typewriter-Regular.woff2 +0 -0
  63. package/dashboard/dist/assets/geist-cyrillic-400-normal.woff +0 -0
  64. package/dashboard/dist/assets/geist-cyrillic-400-normal.woff2 +0 -0
  65. package/dashboard/dist/assets/geist-cyrillic-500-normal.woff +0 -0
  66. package/dashboard/dist/assets/geist-cyrillic-500-normal.woff2 +0 -0
  67. package/dashboard/dist/assets/geist-cyrillic-600-normal.woff +0 -0
  68. package/dashboard/dist/assets/geist-cyrillic-600-normal.woff2 +0 -0
  69. package/dashboard/dist/assets/geist-cyrillic-700-normal.woff +0 -0
  70. package/dashboard/dist/assets/geist-cyrillic-700-normal.woff2 +0 -0
  71. package/dashboard/dist/assets/geist-cyrillic-ext-500-normal.woff +0 -0
  72. package/dashboard/dist/assets/geist-cyrillic-ext-600-normal.woff +0 -0
  73. package/dashboard/dist/assets/geist-cyrillic-ext-700-normal.woff +0 -0
  74. package/dashboard/dist/assets/geist-latin-400-normal.woff +0 -0
  75. package/dashboard/dist/assets/geist-latin-400-normal.woff2 +0 -0
  76. package/dashboard/dist/assets/geist-latin-500-normal.woff +0 -0
  77. package/dashboard/dist/assets/geist-latin-500-normal.woff2 +0 -0
  78. package/dashboard/dist/assets/geist-latin-600-normal.woff +0 -0
  79. package/dashboard/dist/assets/geist-latin-600-normal.woff2 +0 -0
  80. package/dashboard/dist/assets/geist-latin-700-normal.woff +0 -0
  81. package/dashboard/dist/assets/geist-latin-700-normal.woff2 +0 -0
  82. package/dashboard/dist/assets/geist-latin-ext-400-normal.woff +0 -0
  83. package/dashboard/dist/assets/geist-latin-ext-400-normal.woff2 +0 -0
  84. package/dashboard/dist/assets/geist-latin-ext-500-normal.woff +0 -0
  85. package/dashboard/dist/assets/geist-latin-ext-500-normal.woff2 +0 -0
  86. package/dashboard/dist/assets/geist-latin-ext-600-normal.woff +0 -0
  87. package/dashboard/dist/assets/geist-latin-ext-600-normal.woff2 +0 -0
  88. package/dashboard/dist/assets/geist-latin-ext-700-normal.woff +0 -0
  89. package/dashboard/dist/assets/geist-latin-ext-700-normal.woff2 +0 -0
  90. package/dashboard/dist/assets/geist-mono-cyrillic-400-normal.woff +0 -0
  91. package/dashboard/dist/assets/geist-mono-cyrillic-400-normal.woff2 +0 -0
  92. package/dashboard/dist/assets/geist-mono-cyrillic-500-normal.woff +0 -0
  93. package/dashboard/dist/assets/geist-mono-cyrillic-500-normal.woff2 +0 -0
  94. package/dashboard/dist/assets/geist-mono-cyrillic-600-normal.woff +0 -0
  95. package/dashboard/dist/assets/geist-mono-cyrillic-600-normal.woff2 +0 -0
  96. package/dashboard/dist/assets/geist-mono-latin-400-normal.woff +0 -0
  97. package/dashboard/dist/assets/geist-mono-latin-400-normal.woff2 +0 -0
  98. package/dashboard/dist/assets/geist-mono-latin-500-normal.woff +0 -0
  99. package/dashboard/dist/assets/geist-mono-latin-500-normal.woff2 +0 -0
  100. package/dashboard/dist/assets/geist-mono-latin-600-normal.woff +0 -0
  101. package/dashboard/dist/assets/geist-mono-latin-600-normal.woff2 +0 -0
  102. package/dashboard/dist/assets/geist-mono-latin-ext-400-normal.woff +0 -0
  103. package/dashboard/dist/assets/geist-mono-latin-ext-400-normal.woff2 +0 -0
  104. package/dashboard/dist/assets/geist-mono-latin-ext-500-normal.woff +0 -0
  105. package/dashboard/dist/assets/geist-mono-latin-ext-500-normal.woff2 +0 -0
  106. package/dashboard/dist/assets/geist-mono-latin-ext-600-normal.woff +0 -0
  107. package/dashboard/dist/assets/geist-mono-latin-ext-600-normal.woff2 +0 -0
  108. package/dashboard/dist/assets/geist-mono-symbols2-400-normal.woff +0 -0
  109. package/dashboard/dist/assets/geist-mono-symbols2-500-normal.woff +0 -0
  110. package/dashboard/dist/assets/geist-mono-symbols2-600-normal.woff +0 -0
  111. package/dashboard/dist/assets/geist-mono-vietnamese-400-normal.woff +0 -0
  112. package/dashboard/dist/assets/geist-mono-vietnamese-500-normal.woff +0 -0
  113. package/dashboard/dist/assets/geist-mono-vietnamese-600-normal.woff +0 -0
  114. package/dashboard/dist/assets/geist-vietnamese-400-normal.woff +0 -0
  115. package/dashboard/dist/assets/geist-vietnamese-500-normal.woff +0 -0
  116. package/dashboard/dist/assets/geist-vietnamese-600-normal.woff +0 -0
  117. package/dashboard/dist/assets/geist-vietnamese-600-normal.woff2 +0 -0
  118. package/dashboard/dist/assets/geist-vietnamese-700-normal.woff +0 -0
  119. package/dashboard/dist/assets/inter-cyrillic-400-normal.woff +0 -0
  120. package/dashboard/dist/assets/inter-cyrillic-400-normal.woff2 +0 -0
  121. package/dashboard/dist/assets/inter-cyrillic-500-normal.woff +0 -0
  122. package/dashboard/dist/assets/inter-cyrillic-500-normal.woff2 +0 -0
  123. package/dashboard/dist/assets/inter-cyrillic-600-normal.woff +0 -0
  124. package/dashboard/dist/assets/inter-cyrillic-600-normal.woff2 +0 -0
  125. package/dashboard/dist/assets/inter-cyrillic-700-normal.woff +0 -0
  126. package/dashboard/dist/assets/inter-cyrillic-700-normal.woff2 +0 -0
  127. package/dashboard/dist/assets/inter-cyrillic-ext-400-normal.woff +0 -0
  128. package/dashboard/dist/assets/inter-cyrillic-ext-400-normal.woff2 +0 -0
  129. package/dashboard/dist/assets/inter-cyrillic-ext-500-normal.woff +0 -0
  130. package/dashboard/dist/assets/inter-cyrillic-ext-500-normal.woff2 +0 -0
  131. package/dashboard/dist/assets/inter-cyrillic-ext-600-normal.woff +0 -0
  132. package/dashboard/dist/assets/inter-cyrillic-ext-600-normal.woff2 +0 -0
  133. package/dashboard/dist/assets/inter-cyrillic-ext-700-normal.woff +0 -0
  134. package/dashboard/dist/assets/inter-cyrillic-ext-700-normal.woff2 +0 -0
  135. package/dashboard/dist/assets/inter-greek-400-normal.woff +0 -0
  136. package/dashboard/dist/assets/inter-greek-400-normal.woff2 +0 -0
  137. package/dashboard/dist/assets/inter-greek-500-normal.woff +0 -0
  138. package/dashboard/dist/assets/inter-greek-500-normal.woff2 +0 -0
  139. package/dashboard/dist/assets/inter-greek-600-normal.woff +0 -0
  140. package/dashboard/dist/assets/inter-greek-600-normal.woff2 +0 -0
  141. package/dashboard/dist/assets/inter-greek-700-normal.woff +0 -0
  142. package/dashboard/dist/assets/inter-greek-700-normal.woff2 +0 -0
  143. package/dashboard/dist/assets/inter-greek-ext-400-normal.woff +0 -0
  144. package/dashboard/dist/assets/inter-greek-ext-400-normal.woff2 +0 -0
  145. package/dashboard/dist/assets/inter-greek-ext-500-normal.woff +0 -0
  146. package/dashboard/dist/assets/inter-greek-ext-500-normal.woff2 +0 -0
  147. package/dashboard/dist/assets/inter-greek-ext-600-normal.woff +0 -0
  148. package/dashboard/dist/assets/inter-greek-ext-600-normal.woff2 +0 -0
  149. package/dashboard/dist/assets/inter-greek-ext-700-normal.woff +0 -0
  150. package/dashboard/dist/assets/inter-greek-ext-700-normal.woff2 +0 -0
  151. package/dashboard/dist/assets/inter-latin-400-normal.woff +0 -0
  152. package/dashboard/dist/assets/inter-latin-400-normal.woff2 +0 -0
  153. package/dashboard/dist/assets/inter-latin-500-normal.woff +0 -0
  154. package/dashboard/dist/assets/inter-latin-500-normal.woff2 +0 -0
  155. package/dashboard/dist/assets/inter-latin-600-normal.woff +0 -0
  156. package/dashboard/dist/assets/inter-latin-600-normal.woff2 +0 -0
  157. package/dashboard/dist/assets/inter-latin-700-normal.woff +0 -0
  158. package/dashboard/dist/assets/inter-latin-700-normal.woff2 +0 -0
  159. package/dashboard/dist/assets/inter-latin-ext-400-normal.woff +0 -0
  160. package/dashboard/dist/assets/inter-latin-ext-400-normal.woff2 +0 -0
  161. package/dashboard/dist/assets/inter-latin-ext-500-normal.woff +0 -0
  162. package/dashboard/dist/assets/inter-latin-ext-500-normal.woff2 +0 -0
  163. package/dashboard/dist/assets/inter-latin-ext-600-normal.woff +0 -0
  164. package/dashboard/dist/assets/inter-latin-ext-600-normal.woff2 +0 -0
  165. package/dashboard/dist/assets/inter-latin-ext-700-normal.woff +0 -0
  166. package/dashboard/dist/assets/inter-latin-ext-700-normal.woff2 +0 -0
  167. package/dashboard/dist/assets/inter-vietnamese-400-normal.woff +0 -0
  168. package/dashboard/dist/assets/inter-vietnamese-400-normal.woff2 +0 -0
  169. package/dashboard/dist/assets/inter-vietnamese-500-normal.woff +0 -0
  170. package/dashboard/dist/assets/inter-vietnamese-500-normal.woff2 +0 -0
  171. package/dashboard/dist/assets/inter-vietnamese-600-normal.woff +0 -0
  172. package/dashboard/dist/assets/inter-vietnamese-600-normal.woff2 +0 -0
  173. package/dashboard/dist/assets/inter-vietnamese-700-normal.woff +0 -0
  174. package/dashboard/dist/assets/inter-vietnamese-700-normal.woff2 +0 -0
  175. package/dashboard/dist/vendor-icons.js +102 -0
  176. package/dashboard/dist/vendor-icons.js.map +1 -0
  177. package/dashboard/dist/vendor-katex.css +1 -0
  178. package/dashboard/dist/vendor-katex.js +258 -0
  179. package/dashboard/dist/vendor-katex.js.map +1 -0
  180. package/dashboard/dist/vendor-markdown.js +36 -0
  181. package/dashboard/dist/vendor-markdown.js.map +1 -0
  182. package/dashboard/dist/vendor-prism.js +15 -0
  183. package/dashboard/dist/vendor-prism.js.map +1 -0
  184. package/dashboard/dist/vendor-react.js +50 -0
  185. package/dashboard/dist/vendor-react.js.map +1 -0
  186. package/dashboard/index.html +4 -3
  187. package/dist/cli/{acp-WFQIC6SO.js → acp-6B25WIFF.js} +48 -49
  188. package/dist/cli/acp-6B25WIFF.js.map +1 -0
  189. package/dist/cli/chat-7WASPB4O.js +50 -0
  190. package/dist/cli/{chunk-QF32ROX2.js → chunk-3KRRTLC5.js} +955 -788
  191. package/dist/cli/chunk-3KRRTLC5.js.map +1 -0
  192. package/dist/cli/{chunk-TEDWJKEI.js → chunk-3RNFYDDM.js} +11 -27
  193. package/dist/cli/chunk-3RNFYDDM.js.map +1 -0
  194. package/dist/cli/{chunk-ZWHSHFDP.js → chunk-6IUMTRFP.js} +35 -7
  195. package/dist/cli/chunk-6IUMTRFP.js.map +1 -0
  196. package/dist/cli/{chunk-GNS7BAT2.js → chunk-7WITYWKN.js} +2 -2
  197. package/dist/cli/{chunk-HIYTRCSW.js → chunk-7YPMTE3U.js} +65 -28
  198. package/dist/cli/chunk-7YPMTE3U.js.map +1 -0
  199. package/dist/cli/{chunk-DFX5ZH5L.js → chunk-AAHB2PFX.js} +2 -2
  200. package/dist/cli/{chunk-PB3MAFEI.js → chunk-AJIZ5KFK.js} +3 -3
  201. package/dist/cli/{chunk-U5XQDCK7.js → chunk-ALCOQP6R.js} +10 -9
  202. package/dist/cli/chunk-ALCOQP6R.js.map +1 -0
  203. package/dist/cli/{chunk-6OWJV3YW.js → chunk-CAGKEGNE.js} +1 -2
  204. package/dist/cli/{chunk-JNTMOX7G.js → chunk-ENFBF6HI.js} +15 -3
  205. package/dist/cli/chunk-ENFBF6HI.js.map +1 -0
  206. package/dist/cli/{chunk-J2IHQGPQ.js → chunk-EZ57UEZQ.js} +2 -2
  207. package/dist/cli/{chunk-QX5TWXRZ.js → chunk-FQSQFCBI.js} +41 -2
  208. package/dist/cli/chunk-FQSQFCBI.js.map +1 -0
  209. package/dist/cli/{chunk-ZAEJWKXB.js → chunk-GMSAB2TC.js} +2 -2
  210. package/dist/cli/{chunk-MQWO32ZD.js → chunk-GPUH2BNM.js} +123 -286
  211. package/dist/cli/chunk-GPUH2BNM.js.map +1 -0
  212. package/dist/cli/{chunk-7AST3QQ3.js → chunk-I4Q3QT4W.js} +2 -2
  213. package/dist/cli/{chunk-O5LIHAMP.js → chunk-I6FBSTTR.js} +3 -3
  214. package/dist/cli/{chunk-AWEULQG6.js → chunk-IBRTU5WO.js} +25 -15
  215. package/dist/cli/{chunk-AWEULQG6.js.map → chunk-IBRTU5WO.js.map} +1 -1
  216. package/dist/cli/{chunk-RRXUIPWG.js → chunk-IK6WWRIX.js} +1 -1
  217. package/dist/cli/chunk-IK6WWRIX.js.map +1 -0
  218. package/dist/cli/{chunk-WMTMMSXU.js → chunk-MXWPAPZW.js} +315 -233
  219. package/dist/cli/chunk-MXWPAPZW.js.map +1 -0
  220. package/dist/cli/{chunk-7JTKBJ2G.js → chunk-NLRC3DWQ.js} +3 -3
  221. package/dist/cli/{chunk-PXBQ6IZ7.js → chunk-OPGWCKKU.js} +2 -2
  222. package/dist/cli/{chunk-23ZPCIPR.js → chunk-OWA42BKS.js} +21 -20
  223. package/dist/cli/chunk-OWA42BKS.js.map +1 -0
  224. package/dist/cli/{chunk-YEF7C4XI.js → chunk-PYIZZAVQ.js} +102 -94
  225. package/dist/cli/chunk-PYIZZAVQ.js.map +1 -0
  226. package/dist/cli/{chunk-EQATK2L2.js → chunk-SVD4UPRQ.js} +4 -3
  227. package/dist/cli/chunk-SVD4UPRQ.js.map +1 -0
  228. package/dist/cli/{chunk-PEMG6CUB.js → chunk-TX652NBA.js} +2 -2
  229. package/dist/cli/{chunk-W46ZMNKO.js → chunk-VVMY4M7J.js} +21 -2
  230. package/dist/cli/chunk-VVMY4M7J.js.map +1 -0
  231. package/dist/cli/{chunk-TAIKVL35.js → chunk-WSBFVOCO.js} +2 -2
  232. package/dist/cli/{chunk-ASOLXV67.js → chunk-X2BQZQEE.js} +3 -3
  233. package/dist/cli/{chunk-E5WCLUIU.js → chunk-XJZWMU5P.js} +2 -2
  234. package/dist/cli/{chunk-MGTBP7GG.js → chunk-XWPZHWC2.js} +20 -7
  235. package/dist/cli/chunk-XWPZHWC2.js.map +1 -0
  236. package/dist/cli/{chunk-JGTX4RRQ.js → chunk-ZAXMJANP.js} +2 -2
  237. package/dist/cli/{code-R4IHI7SR.js → code-TBK2TASK.js} +49 -57
  238. package/dist/cli/code-TBK2TASK.js.map +1 -0
  239. package/dist/cli/{commands-DRHFCYMO.js → commands-NXTKSQTN.js} +4 -4
  240. package/dist/cli/{commit-AG5KB4YP.js → commit-IR5SPP7A.js} +7 -8
  241. package/dist/cli/commit-IR5SPP7A.js.map +1 -0
  242. package/dist/cli/config-XK5WQGTS.js +194 -0
  243. package/dist/cli/{desktop-JGL6GORA.js → desktop-5NTQBADL.js} +200 -113
  244. package/dist/cli/desktop-5NTQBADL.js.map +1 -0
  245. package/dist/cli/{diff-4Z7ETWZO.js → diff-JNYX5BSZ.js} +8 -8
  246. package/dist/cli/{doctor-VA3RHQLB.js → doctor-IKYLUFXX.js} +11 -11
  247. package/dist/cli/{events-VRYXOSKI.js → events-HSC57ONU.js} +12 -8
  248. package/dist/cli/{events-VRYXOSKI.js.map → events-HSC57ONU.js.map} +1 -1
  249. package/dist/cli/index.js +87 -84
  250. package/dist/cli/index.js.map +1 -1
  251. package/dist/cli/{mcp-LZO4HXFA.js → mcp-BDJJWOCD.js} +3 -3
  252. package/dist/cli/{mcp-browse-C3GXVMYZ.js → mcp-browse-NJRZDI6V.js} +8 -8
  253. package/dist/cli/{mcp-inspect-ZMYUNFDS.js → mcp-inspect-Y62NWZQL.js} +7 -6
  254. package/dist/cli/mcp-inspect-Y62NWZQL.js.map +1 -0
  255. package/dist/cli/{prompt-MC3U5KRP.js → prompt-UTOIFUQC.js} +5 -5
  256. package/dist/cli/{prune-sessions-OEPFH4N6.js → prune-sessions-UCUD4XAP.js} +4 -4
  257. package/dist/cli/{replay-4TP7ZUMZ.js → replay-VVIN64MN.js} +10 -19
  258. package/dist/cli/replay-VVIN64MN.js.map +1 -0
  259. package/dist/cli/{run-6MXQYBOE.js → run-76OBDZFB.js} +28 -25
  260. package/dist/cli/run-76OBDZFB.js.map +1 -0
  261. package/dist/cli/{server-Z3IMJNNI.js → server-SZZDKTH2.js} +404 -163
  262. package/dist/cli/server-SZZDKTH2.js.map +1 -0
  263. package/dist/cli/{sessions-NXQ5SAV7.js → sessions-FZTGRCM5.js} +18 -18
  264. package/dist/cli/{setup-LHZELI6I.js → setup-4UNENGOE.js} +14 -40
  265. package/dist/cli/setup-4UNENGOE.js.map +1 -0
  266. package/dist/cli/{stats-SUIJ3QWY.js → stats-F4NDOD7D.js} +6 -6
  267. package/dist/cli/stats-F4NDOD7D.js.map +1 -0
  268. package/dist/cli/version-LUVTWHLL.js +33 -0
  269. package/dist/index.d.ts +325 -299
  270. package/dist/index.js +438 -528
  271. package/dist/index.js.map +1 -1
  272. package/package.json +5 -3
  273. package/dist/cli/acp-WFQIC6SO.js.map +0 -1
  274. package/dist/cli/chat-D32JGNVH.js +0 -51
  275. package/dist/cli/chunk-23ZPCIPR.js.map +0 -1
  276. package/dist/cli/chunk-EQATK2L2.js.map +0 -1
  277. package/dist/cli/chunk-HIYTRCSW.js.map +0 -1
  278. package/dist/cli/chunk-JNTMOX7G.js.map +0 -1
  279. package/dist/cli/chunk-LGEKVMMV.js +0 -59
  280. package/dist/cli/chunk-LGEKVMMV.js.map +0 -1
  281. package/dist/cli/chunk-MGTBP7GG.js.map +0 -1
  282. package/dist/cli/chunk-MQWO32ZD.js.map +0 -1
  283. package/dist/cli/chunk-QF32ROX2.js.map +0 -1
  284. package/dist/cli/chunk-QX5TWXRZ.js.map +0 -1
  285. package/dist/cli/chunk-RRXUIPWG.js.map +0 -1
  286. package/dist/cli/chunk-TEDWJKEI.js.map +0 -1
  287. package/dist/cli/chunk-U5XQDCK7.js.map +0 -1
  288. package/dist/cli/chunk-W46ZMNKO.js.map +0 -1
  289. package/dist/cli/chunk-WMTMMSXU.js.map +0 -1
  290. package/dist/cli/chunk-YEF7C4XI.js.map +0 -1
  291. package/dist/cli/chunk-ZWHSHFDP.js.map +0 -1
  292. package/dist/cli/code-R4IHI7SR.js.map +0 -1
  293. package/dist/cli/commit-AG5KB4YP.js.map +0 -1
  294. package/dist/cli/desktop-JGL6GORA.js.map +0 -1
  295. package/dist/cli/mcp-inspect-ZMYUNFDS.js.map +0 -1
  296. package/dist/cli/replay-4TP7ZUMZ.js.map +0 -1
  297. package/dist/cli/run-6MXQYBOE.js.map +0 -1
  298. package/dist/cli/server-Z3IMJNNI.js.map +0 -1
  299. package/dist/cli/setup-LHZELI6I.js.map +0 -1
  300. package/dist/cli/version-BIFONEUB.js +0 -33
  301. /package/dist/cli/{chat-D32JGNVH.js.map → chat-7WASPB4O.js.map} +0 -0
  302. /package/dist/cli/{chunk-GNS7BAT2.js.map → chunk-7WITYWKN.js.map} +0 -0
  303. /package/dist/cli/{chunk-DFX5ZH5L.js.map → chunk-AAHB2PFX.js.map} +0 -0
  304. /package/dist/cli/{chunk-PB3MAFEI.js.map → chunk-AJIZ5KFK.js.map} +0 -0
  305. /package/dist/cli/{chunk-6OWJV3YW.js.map → chunk-CAGKEGNE.js.map} +0 -0
  306. /package/dist/cli/{chunk-J2IHQGPQ.js.map → chunk-EZ57UEZQ.js.map} +0 -0
  307. /package/dist/cli/{chunk-ZAEJWKXB.js.map → chunk-GMSAB2TC.js.map} +0 -0
  308. /package/dist/cli/{chunk-7AST3QQ3.js.map → chunk-I4Q3QT4W.js.map} +0 -0
  309. /package/dist/cli/{chunk-O5LIHAMP.js.map → chunk-I6FBSTTR.js.map} +0 -0
  310. /package/dist/cli/{chunk-7JTKBJ2G.js.map → chunk-NLRC3DWQ.js.map} +0 -0
  311. /package/dist/cli/{chunk-PXBQ6IZ7.js.map → chunk-OPGWCKKU.js.map} +0 -0
  312. /package/dist/cli/{chunk-PEMG6CUB.js.map → chunk-TX652NBA.js.map} +0 -0
  313. /package/dist/cli/{chunk-TAIKVL35.js.map → chunk-WSBFVOCO.js.map} +0 -0
  314. /package/dist/cli/{chunk-ASOLXV67.js.map → chunk-X2BQZQEE.js.map} +0 -0
  315. /package/dist/cli/{chunk-E5WCLUIU.js.map → chunk-XJZWMU5P.js.map} +0 -0
  316. /package/dist/cli/{chunk-JGTX4RRQ.js.map → chunk-ZAXMJANP.js.map} +0 -0
  317. /package/dist/cli/{commands-DRHFCYMO.js.map → commands-NXTKSQTN.js.map} +0 -0
  318. /package/dist/cli/{doctor-VA3RHQLB.js.map → config-XK5WQGTS.js.map} +0 -0
  319. /package/dist/cli/{diff-4Z7ETWZO.js.map → diff-JNYX5BSZ.js.map} +0 -0
  320. /package/dist/cli/{prompt-MC3U5KRP.js.map → doctor-IKYLUFXX.js.map} +0 -0
  321. /package/dist/cli/{mcp-LZO4HXFA.js.map → mcp-BDJJWOCD.js.map} +0 -0
  322. /package/dist/cli/{mcp-browse-C3GXVMYZ.js.map → mcp-browse-NJRZDI6V.js.map} +0 -0
  323. /package/dist/cli/{stats-SUIJ3QWY.js.map → prompt-UTOIFUQC.js.map} +0 -0
  324. /package/dist/cli/{prune-sessions-OEPFH4N6.js.map → prune-sessions-UCUD4XAP.js.map} +0 -0
  325. /package/dist/cli/{sessions-NXQ5SAV7.js.map → sessions-FZTGRCM5.js.map} +0 -0
  326. /package/dist/cli/{version-BIFONEUB.js.map → version-LUVTWHLL.js.map} +0 -0
@@ -7,6 +7,38 @@ import {
7
7
  import {
8
8
  loadOverlay
9
9
  } from "./chunk-JMBMLOBP.js";
10
+ import {
11
+ SLASH_COMMANDS,
12
+ SLASH_GROUP_ORDER,
13
+ archivePlanState,
14
+ clearPlanState,
15
+ countAdvancedCommands,
16
+ createCheckpoint,
17
+ deleteCheckpoint,
18
+ detectSlashArgContext,
19
+ findCheckpoint,
20
+ fmtAgo,
21
+ listCheckpoints,
22
+ listPlanArchives,
23
+ loadPlanState,
24
+ orderSlashCommandsByGroup,
25
+ parseSlash,
26
+ relativeTime,
27
+ resolveSlashAlias,
28
+ restoreCheckpoint,
29
+ savePlanState,
30
+ suggestSlashCommands
31
+ } from "./chunk-3RNFYDDM.js";
32
+ import {
33
+ eventLogPath,
34
+ openEventSink
35
+ } from "./chunk-XJZWMU5P.js";
36
+ import {
37
+ fetchSmitheryDetail,
38
+ loadMorePages,
39
+ openRegistry,
40
+ specStringFor
41
+ } from "./chunk-XJXDHAES.js";
10
42
  import {
11
43
  QQChannel,
12
44
  createMcpRuntime,
@@ -14,20 +46,20 @@ import {
14
46
  formatQQModeLabel,
15
47
  formatQQSetupPrompt,
16
48
  formatQQSetupWaiting
17
- } from "./chunk-U5XQDCK7.js";
49
+ } from "./chunk-ALCOQP6R.js";
18
50
  import {
19
51
  Eventizer,
20
52
  autoResolveVerdict,
21
53
  registerSkillTools,
22
54
  shouldAutoResolveCheckpoint
23
- } from "./chunk-MGTBP7GG.js";
55
+ } from "./chunk-XWPZHWC2.js";
24
56
  import {
25
57
  formatMcpLifecycleEvent,
26
58
  formatMcpSlowToast
27
- } from "./chunk-GNS7BAT2.js";
59
+ } from "./chunk-7WITYWKN.js";
28
60
  import {
29
61
  buildTransportFromSpec
30
- } from "./chunk-EQATK2L2.js";
62
+ } from "./chunk-SVD4UPRQ.js";
31
63
  import {
32
64
  dumpStartupProfile,
33
65
  markPhase,
@@ -59,24 +91,41 @@ import {
59
91
  toWholeFileEditBlock,
60
92
  walkFilesStream,
61
93
  webFetch
62
- } from "./chunk-MQWO32ZD.js";
94
+ } from "./chunk-GPUH2BNM.js";
63
95
  import {
64
96
  openTranscriptFile,
65
97
  recordFromLoopEvent,
66
98
  writeRecord
67
- } from "./chunk-7JTKBJ2G.js";
99
+ } from "./chunk-NLRC3DWQ.js";
68
100
  import {
69
101
  McpClient
70
- } from "./chunk-HIYTRCSW.js";
102
+ } from "./chunk-7YPMTE3U.js";
103
+ import {
104
+ BUILTIN_ALLOWLIST,
105
+ derivePrefix,
106
+ formatCommandResult,
107
+ isCompactionSummary,
108
+ pauseGate,
109
+ runCommand,
110
+ stripCompactionMarker,
111
+ toApprovalPrompt
112
+ } from "./chunk-6IUMTRFP.js";
71
113
  import {
72
114
  MemoryStore,
73
115
  effectivePriority
74
- } from "./chunk-O5LIHAMP.js";
116
+ } from "./chunk-I6FBSTTR.js";
117
+ import {
118
+ PROJECT_MEMORY_FILE,
119
+ SkillStore,
120
+ memoryEnabled,
121
+ readProjectMemory,
122
+ resolveProjectMemoryWritePath
123
+ } from "./chunk-ENFBF6HI.js";
75
124
  import {
76
125
  KeystrokeProvider,
77
126
  SingleSelect,
78
127
  useKeystroke
79
- } from "./chunk-W46ZMNKO.js";
128
+ } from "./chunk-VVMY4M7J.js";
80
129
  import {
81
130
  COLOR,
82
131
  GLYPH,
@@ -84,7 +133,7 @@ import {
84
133
  ThemeProvider,
85
134
  useColor,
86
135
  useThemeTokens
87
- } from "./chunk-PXBQ6IZ7.js";
136
+ } from "./chunk-OPGWCKKU.js";
88
137
  import {
89
138
  Box_default,
90
139
  Static,
@@ -97,78 +146,12 @@ import {
97
146
  use_stdin_default,
98
147
  use_stdout_default
99
148
  } from "./chunk-7X4JJOO7.js";
100
- import {
101
- PRESETS,
102
- PRESET_DESCRIPTIONS,
103
- resolvePreset
104
- } from "./chunk-LGEKVMMV.js";
105
149
  import {
106
150
  runDoctorChecks
107
- } from "./chunk-23ZPCIPR.js";
151
+ } from "./chunk-OWA42BKS.js";
108
152
  import {
109
153
  countTokensBounded
110
- } from "./chunk-6OWJV3YW.js";
111
- import {
112
- DeepSeekClient,
113
- pickPrimaryBalance
114
- } from "./chunk-J2IHQGPQ.js";
115
- import {
116
- loadDotenv
117
- } from "./chunk-2UQP6H6T.js";
118
- import {
119
- renderDashboard
120
- } from "./chunk-ASOLXV67.js";
121
- import {
122
- MANUAL_UPDATE_COMMANDS,
123
- planUpdate
124
- } from "./chunk-SZ5XES2N.js";
125
- import {
126
- SLASH_COMMANDS,
127
- SLASH_GROUP_ORDER,
128
- archivePlanState,
129
- clearPlanState,
130
- countAdvancedCommands,
131
- createCheckpoint,
132
- deleteCheckpoint,
133
- detectSlashArgContext,
134
- findCheckpoint,
135
- fmtAgo,
136
- listCheckpoints,
137
- listPlanArchives,
138
- loadPlanState,
139
- orderSlashCommandsByGroup,
140
- parseSlash,
141
- relativeTime,
142
- resolveSlashAlias,
143
- restoreCheckpoint,
144
- savePlanState,
145
- suggestSlashCommands
146
- } from "./chunk-TEDWJKEI.js";
147
- import {
148
- eventLogPath,
149
- openEventSink
150
- } from "./chunk-E5WCLUIU.js";
151
- import {
152
- fetchSmitheryDetail,
153
- loadMorePages,
154
- openRegistry,
155
- specStringFor
156
- } from "./chunk-XJXDHAES.js";
157
- import {
158
- BUILTIN_ALLOWLIST,
159
- derivePrefix,
160
- formatCommandResult,
161
- pauseGate,
162
- runCommand,
163
- toApprovalPrompt
164
- } from "./chunk-ZWHSHFDP.js";
165
- import {
166
- PROJECT_MEMORY_FILE,
167
- SkillStore,
168
- memoryEnabled,
169
- readProjectMemory,
170
- resolveProjectMemoryWritePath
171
- } from "./chunk-JNTMOX7G.js";
154
+ } from "./chunk-CAGKEGNE.js";
172
155
  import {
173
156
  HOOK_EVENTS,
174
157
  formatHookOutcomeMessage,
@@ -176,7 +159,7 @@ import {
176
159
  loadHooks,
177
160
  projectSettingsPath,
178
161
  runHooks
179
- } from "./chunk-PB3MAFEI.js";
162
+ } from "./chunk-AJIZ5KFK.js";
180
163
  import {
181
164
  deleteSession,
182
165
  detectGitBranch,
@@ -193,18 +176,28 @@ import {
193
176
  sessionPath,
194
177
  sessionsDir,
195
178
  timestampSuffix
196
- } from "./chunk-RRXUIPWG.js";
179
+ } from "./chunk-IK6WWRIX.js";
180
+ import {
181
+ DeepSeekClient,
182
+ pickPrimaryBalance
183
+ } from "./chunk-EZ57UEZQ.js";
184
+ import {
185
+ loadDotenv
186
+ } from "./chunk-2UQP6H6T.js";
187
+ import {
188
+ renderDashboard
189
+ } from "./chunk-X2BQZQEE.js";
197
190
  import {
198
191
  aggregateUsage,
199
192
  appendUsage,
200
193
  defaultUsageLogPath,
201
194
  readUsageLog
202
- } from "./chunk-ZAEJWKXB.js";
195
+ } from "./chunk-GMSAB2TC.js";
203
196
  import {
204
197
  DEEPSEEK_CONTEXT_TOKENS,
205
198
  DEFAULT_CONTEXT_TOKENS,
206
199
  pricingFor
207
- } from "./chunk-QX5TWXRZ.js";
200
+ } from "./chunk-FQSQFCBI.js";
208
201
  import {
209
202
  getLanguage,
210
203
  getSupportedLanguages,
@@ -213,27 +206,31 @@ import {
213
206
  setLanguage,
214
207
  t,
215
208
  tObj
216
- } from "./chunk-YEF7C4XI.js";
209
+ } from "./chunk-PYIZZAVQ.js";
217
210
  import {
218
211
  CARD,
219
212
  FG,
213
+ REASONING_EFFORT_VALUES,
220
214
  SURFACE,
221
215
  TONE,
222
216
  TONE_ACTIVE,
223
217
  addProjectShellAllowed,
224
218
  addSkillPath,
225
219
  balanceColor,
220
+ bridgeEndpointEnv,
221
+ clearDashboardToken,
226
222
  clearProjectShellAllowed,
227
223
  defaultConfigPath,
228
224
  editModeHintShown,
229
225
  formatBalance,
230
226
  formatCost,
231
227
  isPlausibleKey,
228
+ isReasoningEffort,
232
229
  isThemeName,
233
230
  listThemeNames,
234
231
  loadApiKey,
235
- loadBaseUrl,
236
232
  loadEditMode,
233
+ loadEndpoint,
237
234
  loadEngineeringLifecycleMode,
238
235
  loadExaApiKey,
239
236
  loadMetasoApiKey,
@@ -262,14 +259,19 @@ import {
262
259
  resolveThemePreference,
263
260
  saveApiKey,
264
261
  saveEditMode,
265
- savePreset,
262
+ saveModel,
266
263
  saveQQConfig,
264
+ saveReasoningEffort,
267
265
  saveTheme,
268
266
  searchEnabled,
269
267
  webSearchEndpoint,
270
268
  webSearchEngine,
271
269
  writeConfig
272
- } from "./chunk-WMTMMSXU.js";
270
+ } from "./chunk-MXWPAPZW.js";
271
+ import {
272
+ MANUAL_UPDATE_COMMANDS,
273
+ planUpdate
274
+ } from "./chunk-SZ5XES2N.js";
273
275
  import {
274
276
  VERSION,
275
277
  compareVersions,
@@ -44325,7 +44327,7 @@ var import_react93 = __toESM(require_react(), 1);
44325
44327
 
44326
44328
  // src/cli/ui/App.tsx
44327
44329
  import { statSync as statSync2 } from "fs";
44328
- import { relative as relative2, resolve as resolve3 } from "path";
44330
+ import { resolve as resolve4 } from "path";
44329
44331
  var import_react90 = __toESM(require_react(), 1);
44330
44332
 
44331
44333
  // src/code/lifecycle-policy.ts
@@ -44466,7 +44468,7 @@ function isCommandPosition(tokens, index) {
44466
44468
  }
44467
44469
  function isPackageMutation(token) {
44468
44470
  const normalized = token?.toLowerCase();
44469
- return normalized === "install" || normalized === "add" || normalized === "remove" || normalized === "update";
44471
+ return normalized === "install" || normalized === "i" || normalized === "add" || normalized === "remove" || normalized === "uninstall" || normalized === "un" || normalized === "update" || normalized === "upgrade" || normalized === "up";
44470
44472
  }
44471
44473
  function isHighRiskGitCommand(args) {
44472
44474
  const subcommandIndex = args.findIndex((arg) => arg && !arg.startsWith("-"));
@@ -44484,7 +44486,7 @@ function isHighRiskGitCommand(args) {
44484
44486
  return !positional.every(looksLikePathCheckout);
44485
44487
  }
44486
44488
  function looksLikePathCheckout(arg) {
44487
- return arg.includes("/") || arg.includes("\\") || arg.includes(".");
44489
+ return arg.includes("\\") || arg.includes(".");
44488
44490
  }
44489
44491
 
44490
44492
  // src/code/lifecycle.ts
@@ -44865,8 +44867,8 @@ function useQQChannel({
44865
44867
  }
44866
44868
  let resolveSetup = null;
44867
44869
  let rejectSetup = null;
44868
- const promise = new Promise((resolve4, reject) => {
44869
- resolveSetup = resolve4;
44870
+ const promise = new Promise((resolve5, reject) => {
44871
+ resolveSetup = resolve5;
44870
44872
  rejectSetup = reject;
44871
44873
  });
44872
44874
  const step = appId ? "appSecret" : "appId";
@@ -45320,12 +45322,7 @@ ${optionsList}${p.allowCustom ? "\n\n(You can also reply with custom text.)" : "
45320
45322
  "auto",
45321
45323
  "flash",
45322
45324
  "pro",
45323
- ...models && models.length > 0 ? models : [
45324
- "deepseek-v4-flash",
45325
- "deepseek-v4-pro",
45326
- "deepseek-chat",
45327
- "deepseek-reasoner"
45328
- ]
45325
+ ...models && models.length > 0 ? models : ["deepseek-v4-flash", "deepseek-v4-pro"]
45329
45326
  ],
45330
45327
  []
45331
45328
  );
@@ -45705,14 +45702,14 @@ async function openInExternalEditor(initial) {
45705
45702
  }
45706
45703
  }
45707
45704
  function spawnEditor(editor, path) {
45708
- return new Promise((resolve4, reject) => {
45705
+ return new Promise((resolve5, reject) => {
45709
45706
  const child = spawn(`${editor} "${path}"`, {
45710
45707
  shell: true,
45711
45708
  stdio: "inherit"
45712
45709
  });
45713
45710
  child.on("error", reject);
45714
45711
  child.on("exit", (code) => {
45715
- if (code === 0 || code === null) resolve4();
45712
+ if (code === 0 || code === null) resolve5();
45716
45713
  else reject(new Error(String(code)));
45717
45714
  });
45718
45715
  });
@@ -46494,7 +46491,8 @@ function PromptInput({
46494
46491
  onCursorChange,
46495
46492
  rowsAfter = 0,
46496
46493
  mode: mode2,
46497
- model: model2
46494
+ model: model2,
46495
+ isHistoryMode
46498
46496
  }) {
46499
46497
  const [cursor, setCursor] = (0, import_react8.useState)(value.length);
46500
46498
  (0, import_react8.useEffect)(() => {
@@ -46601,7 +46599,7 @@ function PromptInput({
46601
46599
  const { line: cursorLine, col: cursorCol } = lineAndColumn(value, cursor);
46602
46600
  const renderItems = collapseLinesForDisplay(lines, cursorLine);
46603
46601
  const showHugeBufferHints = lines.length > 20;
46604
- return /* @__PURE__ */ import_react8.default.createElement(Box_default, { flexDirection: "row" }, /* @__PURE__ */ import_react8.default.createElement(Box_default, { width: 1, backgroundColor: "#0153e5" }), /* @__PURE__ */ import_react8.default.createElement(Box_default, { flexDirection: "column", flexGrow: 1, paddingX: 1, backgroundColor: "#1e1e1e" }, /* @__PURE__ */ import_react8.default.createElement(Box_default, { height: 1 }), (() => {
46602
+ return /* @__PURE__ */ import_react8.default.createElement(Box_default, { flexDirection: "row" }, /* @__PURE__ */ import_react8.default.createElement(Box_default, { width: 1, backgroundColor: TONE.brand }), /* @__PURE__ */ import_react8.default.createElement(Box_default, { flexDirection: "column", flexGrow: 1, paddingX: 1, backgroundColor: SURFACE.bgInput }, /* @__PURE__ */ import_react8.default.createElement(Box_default, { height: 1 }), (() => {
46605
46603
  const rows = [];
46606
46604
  let firstRowEmitted = false;
46607
46605
  for (let renderIdx = 0; renderIdx < renderItems.length; renderIdx++) {
@@ -46717,7 +46715,7 @@ function PromptInput({
46717
46715
  }
46718
46716
  }
46719
46717
  return rows;
46720
- })(), showHugeBufferHints && inputActive ? /* @__PURE__ */ import_react8.default.createElement(Box_default, null, /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, ` [${lines.length} lines \xB7 PgUp/PgDn jump \xB7 Ctrl+U clear \xB7 Ctrl+W del word]`)) : null, /* @__PURE__ */ import_react8.default.createElement(Box_default, { height: 1 }), mode2 || model2 ? /* @__PURE__ */ import_react8.default.createElement(Box_default, null, /* @__PURE__ */ import_react8.default.createElement(Text, { color: "#0153e5" }, mode2 || ""), mode2 && model2 ? /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, " \xB7 ") : null, model2 ? /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, model2) : null) : null, /* @__PURE__ */ import_react8.default.createElement(Box_default, { height: 1 }), inputFrozen ? /* @__PURE__ */ import_react8.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, " esc to stop")) : null, steerBusy ? /* @__PURE__ */ import_react8.default.createElement(Box_default, { marginTop: 1, flexDirection: "row" }, /* @__PURE__ */ import_react8.default.createElement(Text, { color: TONE.accent }, " \u23CE "), /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, t("composer.steerHint")), /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, " \xB7 "), /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, "esc to stop")) : null));
46718
+ })(), showHugeBufferHints && inputActive ? /* @__PURE__ */ import_react8.default.createElement(Box_default, null, /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, ` [${lines.length} lines \xB7 PgUp/PgDn jump \xB7 Ctrl+U clear \xB7 Ctrl+W del word]`)) : null, /* @__PURE__ */ import_react8.default.createElement(Box_default, { height: 1 }), mode2 || model2 || isHistoryMode ? /* @__PURE__ */ import_react8.default.createElement(Box_default, null, isHistoryMode ? /* @__PURE__ */ import_react8.default.createElement(Text, { color: TONE.accent }, " \u2191 history") : null, /* @__PURE__ */ import_react8.default.createElement(Text, { color: TONE.brand }, mode2 || ""), mode2 && model2 ? /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, " \xB7 ") : null, model2 ? /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, model2) : null) : null, /* @__PURE__ */ import_react8.default.createElement(Box_default, { height: 1 }), inputFrozen ? /* @__PURE__ */ import_react8.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, " esc to stop")) : null, steerBusy ? /* @__PURE__ */ import_react8.default.createElement(Box_default, { marginTop: 1, flexDirection: "row" }, /* @__PURE__ */ import_react8.default.createElement(Text, { color: TONE.accent }, " \u23CE "), /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, t("composer.steerHint")), /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, " \xB7 "), /* @__PURE__ */ import_react8.default.createElement(Text, { color: FG.faint }, "esc to stop")) : null));
46721
46719
  }
46722
46720
  function splitLineByPastes(line) {
46723
46721
  const out = [];
@@ -46921,7 +46919,7 @@ function charCellsForText(ch) {
46921
46919
  }
46922
46920
  function renderSegment(seg, key, _inverse) {
46923
46921
  if (seg.kind === "text") {
46924
- return /* @__PURE__ */ import_react8.default.createElement(Text, { key: `s-${key}` }, seg.text);
46922
+ return /* @__PURE__ */ import_react8.default.createElement(Text, { key: `s-${key}`, color: FG.body }, seg.text);
46925
46923
  }
46926
46924
  return /* @__PURE__ */ import_react8.default.createElement(Text, { key: `s-${key}`, backgroundColor: SURFACE.bgElev, color: FG.body }, seg.label);
46927
46925
  }
@@ -46962,7 +46960,8 @@ var SHORTCUT_GROUPS = [
46962
46960
  { keys: "Ctrl+U", descKey: "shortcutsHelp.descCtrlU" },
46963
46961
  { keys: "Ctrl+W", descKey: "shortcutsHelp.descCtrlW" },
46964
46962
  { keys: "Ctrl+P", descKey: "shortcutsHelp.descCtrlP" },
46965
- { keys: "Ctrl+X", descKey: "shortcutsHelp.descCtrlX" }
46963
+ { keys: "Ctrl+X", descKey: "shortcutsHelp.descCtrlX" },
46964
+ { keys: "Alt+S", descKey: "shortcutsHelp.descAltS" }
46966
46965
  ]
46967
46966
  },
46968
46967
  {
@@ -46980,7 +46979,7 @@ var SHORTCUT_GROUPS = [
46980
46979
  { keys: "/new", descKey: "shortcutsHelp.descNewSession" },
46981
46980
  { keys: "/sessions", descKey: "shortcutsHelp.descListSessions" },
46982
46981
  { keys: "/model", descKey: "shortcutsHelp.descSwitchModel" },
46983
- { keys: "/preset", descKey: "shortcutsHelp.descSwitchPreset" },
46982
+ { keys: "/effort", descKey: "shortcutsHelp.descSwitchEffort" },
46984
46983
  { keys: "/theme", descKey: "shortcutsHelp.descSwitchTheme" }
46985
46984
  ]
46986
46985
  },
@@ -47246,6 +47245,70 @@ function Countdown({
47246
47245
  // src/cli/ui/state/provider.tsx
47247
47246
  var import_react14 = __toESM(require_react(), 1);
47248
47247
 
47248
+ // src/cli/ui/tool-summary.ts
47249
+ var SHELL_TOOL_NAMES = /* @__PURE__ */ new Set(["run_command", "run_background"]);
47250
+ var FAILURE_LINE_PATTERN = /(AssertionError|Error:|FAIL|FAILED|expected|actual|✗)/;
47251
+ var FAILURE_SCAN_LINES = 200;
47252
+ var FAILURE_PINNED_LINES = 3;
47253
+ function isShellTool(toolName) {
47254
+ return SHELL_TOOL_NAMES.has(toolName);
47255
+ }
47256
+ function extractToolExitCode(toolName, output) {
47257
+ if (!isShellTool(toolName)) return void 0;
47258
+ const match = output.match(/(?:^|\r?\n)\[exit (-?\d+)\](?=\r?\n|$)/);
47259
+ if (!match?.[1]) return void 0;
47260
+ return Number.parseInt(match[1], 10);
47261
+ }
47262
+ function selectToolPreviewLines(input) {
47263
+ const lines = input.output.length > 0 ? input.output.split("\n") : [];
47264
+ if (input.verbose || lines.length <= input.tailLines) {
47265
+ return {
47266
+ rows: lines.map((text2, index) => ({ kind: "line", index, text: text2 })),
47267
+ hidden: 0,
47268
+ truncated: false
47269
+ };
47270
+ }
47271
+ const indexes = /* @__PURE__ */ new Set();
47272
+ const failedShell = isShellTool(input.toolName) && input.exitCode !== void 0 && input.exitCode !== 0;
47273
+ if (failedShell) {
47274
+ const scanLimit = Math.min(lines.length, input.maxScanLines ?? FAILURE_SCAN_LINES);
47275
+ const pinnedLimit = input.maxPinnedLines ?? FAILURE_PINNED_LINES;
47276
+ let pinned = 0;
47277
+ for (let i = 0; i < scanLimit && pinned < pinnedLimit; i++) {
47278
+ if (FAILURE_LINE_PATTERN.test(lines[i] ?? "")) {
47279
+ indexes.add(i);
47280
+ pinned++;
47281
+ }
47282
+ }
47283
+ }
47284
+ const tailStart = Math.max(0, lines.length - input.tailLines);
47285
+ for (let i = tailStart; i < lines.length; i++) {
47286
+ indexes.add(i);
47287
+ }
47288
+ return buildPreviewRows(lines, indexes);
47289
+ }
47290
+ function buildPreviewRows(lines, indexes) {
47291
+ const rows = [];
47292
+ let hidden = 0;
47293
+ let previous = -1;
47294
+ const sorted = [...indexes].filter((i) => i >= 0 && i < lines.length).sort((a, b) => a - b);
47295
+ for (const index of sorted) {
47296
+ const gap = index - previous - 1;
47297
+ if (gap > 0) {
47298
+ rows.push({ kind: "hidden", count: gap });
47299
+ hidden += gap;
47300
+ }
47301
+ rows.push({ kind: "line", index, text: lines[index] ?? "" });
47302
+ previous = index;
47303
+ }
47304
+ const trailing = lines.length - previous - 1;
47305
+ if (trailing > 0) {
47306
+ rows.push({ kind: "hidden", count: trailing });
47307
+ hidden += trailing;
47308
+ }
47309
+ return { rows, hidden, truncated: hidden > 0 };
47310
+ }
47311
+
47249
47312
  // src/cli/ui/state/reducer.ts
47250
47313
  function reduce(state2, event) {
47251
47314
  switch (event.type) {
@@ -47287,17 +47350,19 @@ function reduce(state2, event) {
47287
47350
  case "tool.chunk":
47288
47351
  return mutateCard(state2, event.id, "tool", (c) => ({ ...c, output: c.output + event.text }));
47289
47352
  case "tool.end": {
47290
- const finalOutput = event.output ?? "";
47291
- const rejected = isPlanModeRejection(finalOutput);
47292
- return mutateCard(state2, event.id, "tool", (c) => ({
47293
- ...c,
47294
- done: true,
47295
- output: event.output ?? c.output,
47296
- exitCode: event.exitCode,
47297
- elapsedMs: event.elapsedMs,
47298
- ...event.aborted ? { aborted: true } : {},
47299
- ...rejected ? { rejected: true } : {}
47300
- }));
47353
+ return mutateCard(state2, event.id, "tool", (c) => {
47354
+ const finalOutput = event.output ?? c.output;
47355
+ const rejected = isPlanModeRejection(finalOutput);
47356
+ return {
47357
+ ...c,
47358
+ done: true,
47359
+ output: finalOutput,
47360
+ exitCode: event.exitCode ?? extractToolExitCode(c.name, finalOutput),
47361
+ elapsedMs: event.elapsedMs,
47362
+ ...event.aborted ? { aborted: true } : {},
47363
+ ...rejected ? { rejected: true } : {}
47364
+ };
47365
+ });
47301
47366
  }
47302
47367
  case "tool.retry":
47303
47368
  return mutateCard(state2, event.id, "tool", (c) => ({
@@ -47343,8 +47408,8 @@ function reduce(state2, event) {
47343
47408
  return { ...state2, status: { ...state2.status, ...event.patch } };
47344
47409
  case "session.model.change":
47345
47410
  return state2.session.model === event.model ? state2 : { ...state2, session: { ...state2.session, model: event.model } };
47346
- case "session.preset.change":
47347
- return state2.status.preset === event.preset ? state2 : { ...state2, status: { ...state2.status, preset: event.preset } };
47411
+ case "session.effort.change":
47412
+ return state2.status.reasoningEffort === event.reasoningEffort ? state2 : { ...state2, status: { ...state2.status, reasoningEffort: event.reasoningEffort } };
47348
47413
  case "mcp.loading": {
47349
47414
  const current = state2.status.mcpLoading;
47350
47415
  if (event.total <= 0) {
@@ -47389,8 +47454,8 @@ function reduce(state2, event) {
47389
47454
  return { ...state2, toasts: [...state2.toasts, makeToast(event)] };
47390
47455
  case "toast.hide":
47391
47456
  return { ...state2, toasts: state2.toasts.filter((t2) => t2.id !== event.id) };
47392
- case "live.show":
47393
- return appendCard(state2, {
47457
+ case "live.show": {
47458
+ const card = {
47394
47459
  kind: "live",
47395
47460
  id: event.id,
47396
47461
  ts: event.ts,
@@ -47398,7 +47463,10 @@ function reduce(state2, event) {
47398
47463
  tone: event.tone,
47399
47464
  text: event.text,
47400
47465
  meta: event.meta
47401
- });
47466
+ };
47467
+ const replaced = mutateCard(state2, event.id, "live", () => card);
47468
+ return replaced === state2 ? appendCard(state2, card) : replaced;
47469
+ }
47402
47470
  case "tip.show":
47403
47471
  return appendCard(state2, {
47404
47472
  kind: "tip",
@@ -47440,7 +47508,7 @@ function reduce(state2, event) {
47440
47508
  id: event.id,
47441
47509
  ts: Date.now(),
47442
47510
  title: event.title,
47443
- steps: event.steps,
47511
+ steps: event.variant === "active" ? advanceActivePlanSteps(event.steps) : event.steps,
47444
47512
  variant: event.variant
47445
47513
  });
47446
47514
  case "plan.drop": {
@@ -47468,7 +47536,7 @@ function reduce(state2, event) {
47468
47536
  });
47469
47537
  if (!stepChanged) return c;
47470
47538
  changed = true;
47471
- return { ...c, steps: next };
47539
+ return { ...c, steps: c.variant === "active" ? advanceActivePlanSteps(next) : next };
47472
47540
  });
47473
47541
  return changed ? { ...state2, cards } : state2;
47474
47542
  }
@@ -47603,6 +47671,17 @@ function nextId(prefix) {
47603
47671
  function makeUserCard(text2) {
47604
47672
  return { kind: "user", id: nextId("user"), ts: Date.now(), text: text2 };
47605
47673
  }
47674
+ function isSettledPlanStatus(status2) {
47675
+ return status2 === "done" || status2 === "failed" || status2 === "blocked" || status2 === "skipped";
47676
+ }
47677
+ function advanceActivePlanSteps(steps) {
47678
+ const runningIndex = steps.findIndex((s) => !isSettledPlanStatus(s.status));
47679
+ return steps.map((s, i) => {
47680
+ if (isSettledPlanStatus(s.status)) return s;
47681
+ const status2 = i === runningIndex ? "running" : "queued";
47682
+ return s.status === status2 ? s : { ...s, status: status2 };
47683
+ });
47684
+ }
47606
47685
  function makeReasoningCard(id, model2) {
47607
47686
  return {
47608
47687
  kind: "reasoning",
@@ -47956,6 +48035,7 @@ var ComposerArea = import_react16.default.memo(
47956
48035
  onHistoryNext,
47957
48036
  onOpenExternalEditor,
47958
48037
  onCursorChange,
48038
+ isHistoryMode,
47959
48039
  slashMatches,
47960
48040
  slashSelected,
47961
48041
  slashGroupMode,
@@ -47998,7 +48078,8 @@ var ComposerArea = import_react16.default.memo(
47998
48078
  onCursorChange,
47999
48079
  rowsAfter: 1 + (activeLoop ? 1 : 0) + (jobs2 ? 1 : 0),
48000
48080
  mode: mode2,
48001
- model: model2
48081
+ model: model2,
48082
+ isHistoryMode
48002
48083
  }
48003
48084
  ), activeLoop ? /* @__PURE__ */ import_react16.default.createElement(LoopStatusRow, { loop: activeLoop }) : null, /* @__PURE__ */ import_react16.default.createElement(StatusRow, { statusBar }));
48004
48085
  return inputArea;
@@ -48204,6 +48285,60 @@ function DenyContextInput({
48204
48285
 
48205
48286
  // src/cli/ui/SplitDiff.tsx
48206
48287
  var import_react18 = __toESM(require_react(), 1);
48288
+
48289
+ // src/cli/ui/text-width.ts
48290
+ var segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
48291
+ function graphemes(s) {
48292
+ return Array.from(segmenter.segment(s), (seg) => seg.segment);
48293
+ }
48294
+ function graphemeWidth(g) {
48295
+ if (g.length === 0) return 0;
48296
+ const w = stringWidth(g);
48297
+ if (w <= 0) return 0;
48298
+ if (w >= 2) return 2;
48299
+ return 1;
48300
+ }
48301
+ function padToCells(text2, cells) {
48302
+ const w = stringWidth(text2);
48303
+ if (w >= cells) return text2;
48304
+ return text2 + " ".repeat(cells - w);
48305
+ }
48306
+ function clipToCells(s, maxCells) {
48307
+ if (maxCells <= 0) return "";
48308
+ if (stringWidth(s) <= maxCells) return s;
48309
+ const cap = maxCells - 1;
48310
+ let out = "";
48311
+ let cells = 0;
48312
+ for (const g of graphemes(s)) {
48313
+ const w = graphemeWidth(g);
48314
+ if (cells + w > cap) break;
48315
+ out += g;
48316
+ cells += w;
48317
+ }
48318
+ return `${out}\u2026`;
48319
+ }
48320
+ function wrapToCells(s, maxCells) {
48321
+ if (maxCells <= 0) return [];
48322
+ if (s.length === 0) return [""];
48323
+ const out = [];
48324
+ let cur = "";
48325
+ let cells = 0;
48326
+ for (const g of graphemes(s)) {
48327
+ const w = graphemeWidth(g);
48328
+ if (cells + w > maxCells) {
48329
+ out.push(cur);
48330
+ cur = g;
48331
+ cells = w;
48332
+ } else {
48333
+ cur += g;
48334
+ cells += w;
48335
+ }
48336
+ }
48337
+ if (cur.length > 0 || out.length === 0) out.push(cur);
48338
+ return out;
48339
+ }
48340
+
48341
+ // src/cli/ui/SplitDiff.tsx
48207
48342
  function SplitDiff({ rows, totalCols }) {
48208
48343
  const { stdout } = use_stdout_default();
48209
48344
  const cols = totalCols ?? stdout?.columns ?? 80;
@@ -48226,8 +48361,7 @@ function Cell({
48226
48361
  const numStr = side.num !== null ? String(side.num).padStart(numPad) : " ".repeat(numPad);
48227
48362
  const sign = side.kind === "del" ? "-" : side.kind === "add" ? "+" : side.kind === "pad" ? " " : " ";
48228
48363
  const raw = side.text;
48229
- const truncated = raw.length > inner ? `${raw.slice(0, inner - 1)}\u2026` : raw;
48230
- const padded = truncated.padEnd(inner);
48364
+ const padded = padToCells(clipToCells(raw, inner), inner);
48231
48365
  if (side.kind === "del") {
48232
48366
  return /* @__PURE__ */ import_react18.default.createElement(Text, { color: "#fbc8c8", backgroundColor: "#2a1212" }, `${numStr} ${sign} ${padded}`);
48233
48367
  }
@@ -48962,11 +49096,13 @@ async function reconnectMcpServer(args) {
48962
49096
  ms: Date.now() - t0
48963
49097
  };
48964
49098
  }
49099
+ const workspaceDir = args.host.client.workspaceRootDir;
48965
49100
  const transport = buildTransportFromSpec(parsed, {
48966
49101
  env: args.env,
48967
- headers: args.headers
49102
+ headers: args.headers,
49103
+ cwd: workspaceDir
48968
49104
  });
48969
- const next = new McpClient({ transport });
49105
+ const next = new McpClient({ transport, workspaceDir });
48970
49106
  try {
48971
49107
  await next.initialize();
48972
49108
  const listed = await next.listTools();
@@ -49497,22 +49633,22 @@ function TabPill({ label, count, active: active2 }) {
49497
49633
  // src/cli/ui/ModelPicker.tsx
49498
49634
  var import_react34 = __toESM(require_react(), 1);
49499
49635
  var PAGE_MARGIN3 = 8;
49500
- var PRESET_NAMES = ["auto", "flash", "pro"];
49501
49636
  function ModelPicker({
49502
49637
  models,
49503
49638
  current,
49504
49639
  currentEffort,
49505
- currentAutoEscalate,
49506
49640
  onChoose,
49507
49641
  onRefresh
49508
49642
  }) {
49509
49643
  const modelList = (models && models.length > 0 ? models : FALLBACK_MODELS).slice();
49510
49644
  if (!modelList.includes(current)) modelList.unshift(current);
49511
- const presetRows = PRESET_NAMES.map((name) => ({ kind: "preset", name }));
49645
+ const effortRows = REASONING_EFFORT_VALUES.map((effort2) => ({
49646
+ kind: "effort",
49647
+ effort: effort2
49648
+ }));
49512
49649
  const modelRows = modelList.map((id) => ({ kind: "model", id }));
49513
- const rows = [...presetRows, ...modelRows];
49514
- const activePreset = detectActivePreset(current, currentEffort, currentAutoEscalate);
49515
- const initialIndex = activePreset ? PRESET_NAMES.indexOf(activePreset) : presetRows.length + Math.max(0, modelList.indexOf(current));
49650
+ const rows = [...effortRows, ...modelRows];
49651
+ const initialIndex = effortRows.length + Math.max(0, modelList.indexOf(current));
49516
49652
  const [focus, setFocus] = (0, import_react34.useState)(initialIndex);
49517
49653
  const { stdout } = use_stdout_default();
49518
49654
  const termRows = stdout?.rows ?? 40;
@@ -49524,7 +49660,7 @@ function ModelPicker({
49524
49660
  if (ev.return) {
49525
49661
  const target = rows[focus];
49526
49662
  if (!target) return;
49527
- if (target.kind === "preset") return onChoose({ kind: "preset", name: target.name });
49663
+ if (target.kind === "effort") return onChoose({ kind: "effort", effort: target.effort });
49528
49664
  return onChoose({ kind: "select", id: target.id });
49529
49665
  }
49530
49666
  if (!ev.input) return;
@@ -49547,14 +49683,14 @@ function ModelPicker({
49547
49683
  const focused = idx === focus;
49548
49684
  const showHeader = row2.kind !== lastSection;
49549
49685
  lastSection = row2.kind;
49550
- const header = showHeader ? /* @__PURE__ */ import_react34.default.createElement(Box_default, { key: `hdr-${row2.kind}`, marginTop: idx === 0 ? 0 : 1 }, /* @__PURE__ */ import_react34.default.createElement(Text, { color: FG.meta }, row2.kind === "preset" ? t("modelPicker.presetsHeader") : t("modelPicker.modelsHeader"))) : null;
49551
- const body = row2.kind === "preset" ? /* @__PURE__ */ import_react34.default.createElement(
49552
- PresetRow,
49686
+ const header = showHeader ? /* @__PURE__ */ import_react34.default.createElement(Box_default, { key: `hdr-${row2.kind}`, marginTop: idx === 0 ? 0 : 1 }, /* @__PURE__ */ import_react34.default.createElement(Text, { color: FG.meta }, row2.kind === "effort" ? t("modelPicker.effortHeader") : t("modelPicker.modelsHeader"))) : null;
49687
+ const body = row2.kind === "effort" ? /* @__PURE__ */ import_react34.default.createElement(
49688
+ EffortRow,
49553
49689
  {
49554
- key: `p-${row2.name}`,
49555
- name: row2.name,
49690
+ key: `e-${row2.effort}`,
49691
+ effort: row2.effort,
49556
49692
  focused,
49557
- active: activePreset === row2.name
49693
+ active: row2.effort === currentEffort
49558
49694
  }
49559
49695
  ) : /* @__PURE__ */ import_react34.default.createElement(
49560
49696
  ModelRow,
@@ -49562,19 +49698,18 @@ function ModelPicker({
49562
49698
  key: `m-${row2.id}`,
49563
49699
  id: row2.id,
49564
49700
  focused,
49565
- active: !activePreset && row2.id === current
49701
+ active: row2.id === current
49566
49702
  }
49567
49703
  );
49568
49704
  return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, { key: `row-${idx}` }, header, body);
49569
49705
  }), hiddenBelow > 0 ? /* @__PURE__ */ import_react34.default.createElement(Box_default, null, /* @__PURE__ */ import_react34.default.createElement(Text, { color: FG.faint }, t("cardLabels.more", { count: hiddenBelow }))) : null, /* @__PURE__ */ import_react34.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react34.default.createElement(Text, { color: FG.faint }, t("modelPicker.pickerFooter"))));
49570
49706
  }
49571
- function PresetRow({
49572
- name,
49707
+ function EffortRow({
49708
+ effort: effort2,
49573
49709
  focused,
49574
49710
  active: active2
49575
49711
  }) {
49576
- const desc = PRESET_DESCRIPTIONS[name];
49577
- return /* @__PURE__ */ import_react34.default.createElement(Box_default, null, /* @__PURE__ */ import_react34.default.createElement(Text, { color: focused ? TONE.brand : FG.faint }, focused ? " \u25B8 " : " "), /* @__PURE__ */ import_react34.default.createElement(Text, { bold: focused, color: focused ? FG.strong : FG.sub }, name.padEnd(8)), /* @__PURE__ */ import_react34.default.createElement(Text, { color: focused ? FG.body : FG.meta }, desc.headline.padEnd(28)), /* @__PURE__ */ import_react34.default.createElement(Text, { color: FG.meta }, ` ${desc.cost}`), active2 ? /* @__PURE__ */ import_react34.default.createElement(Text, { color: TONE.brand }, t("modelPicker.currentLabel")) : null);
49712
+ return /* @__PURE__ */ import_react34.default.createElement(Box_default, null, /* @__PURE__ */ import_react34.default.createElement(Text, { color: focused ? TONE.brand : FG.faint }, focused ? " \u25B8 " : " "), /* @__PURE__ */ import_react34.default.createElement(Text, { bold: focused, color: focused ? FG.strong : FG.sub }, effort2.padEnd(8)), /* @__PURE__ */ import_react34.default.createElement(Text, { color: FG.meta }, t(`modelPicker.effortDesc.${effort2}`)), active2 ? /* @__PURE__ */ import_react34.default.createElement(Text, { color: TONE.brand }, t("modelPicker.currentLabel")) : null);
49578
49713
  }
49579
49714
  function ModelRow({
49580
49715
  id,
@@ -49584,21 +49719,7 @@ function ModelRow({
49584
49719
  const badge = modelBadgeFor(id);
49585
49720
  return /* @__PURE__ */ import_react34.default.createElement(Box_default, null, /* @__PURE__ */ import_react34.default.createElement(Text, { color: focused ? TONE.brand : FG.faint }, focused ? " \u25B8 " : " "), /* @__PURE__ */ import_react34.default.createElement(Text, { bold: focused, color: focused ? FG.strong : FG.sub }, id.padEnd(24)), /* @__PURE__ */ import_react34.default.createElement(Text, null, " "), /* @__PURE__ */ import_react34.default.createElement(Pill2, { label: badge.label, ...PILL_MODEL[badge.kind], bold: false }), active2 ? /* @__PURE__ */ import_react34.default.createElement(Text, { color: TONE.brand }, t("modelPicker.currentLabel")) : null);
49586
49721
  }
49587
- function detectActivePreset(model2, effort, autoEscalate) {
49588
- for (const name of PRESET_NAMES) {
49589
- const p = PRESETS[name];
49590
- if (p.model === model2 && p.reasoningEffort === effort && p.autoEscalate === autoEscalate) {
49591
- return name;
49592
- }
49593
- }
49594
- return null;
49595
- }
49596
- var FALLBACK_MODELS = [
49597
- "deepseek-v4-flash",
49598
- "deepseek-v4-pro",
49599
- "deepseek-chat",
49600
- "deepseek-reasoner"
49601
- ];
49722
+ var FALLBACK_MODELS = ["deepseek-v4-flash", "deepseek-v4-pro"];
49602
49723
 
49603
49724
  // src/cli/ui/PathConfirm.tsx
49604
49725
  var import_react35 = __toESM(require_react(), 1);
@@ -53238,6 +53359,68 @@ function formatUndoRows(results) {
53238
53359
  });
53239
53360
  }
53240
53361
 
53362
+ // src/cli/ui/edit-tool-gate.ts
53363
+ import { relative, resolve as resolve2 } from "path";
53364
+ function isReviewGatedEditTool(name) {
53365
+ return name === "edit_file" || name === "write_file" || name === "multi_edit";
53366
+ }
53367
+ function resolveEditRelPath(rawPath, rootForEdit) {
53368
+ if (typeof rawPath !== "string" || rawPath.length === 0) return null;
53369
+ const absRoot = resolve2(rootForEdit);
53370
+ if (looksLikeAbsoluteSystemPath(rawPath)) {
53371
+ const abs = resolve2(rawPath);
53372
+ if (!pathIsUnder(abs, absRoot)) return null;
53373
+ const rel = relative(absRoot, abs);
53374
+ return rel || null;
53375
+ }
53376
+ let stripped = rawPath;
53377
+ while (stripped.startsWith("/") || stripped.startsWith("\\")) {
53378
+ stripped = stripped.slice(1);
53379
+ }
53380
+ return stripped || null;
53381
+ }
53382
+ function buildEditToolBlocks(name, args, rootForEdit) {
53383
+ if (!isReviewGatedEditTool(name)) return null;
53384
+ if (name === "multi_edit") {
53385
+ const edits = args.edits;
53386
+ if (!Array.isArray(edits) || edits.length === 0) return null;
53387
+ const blocks = [];
53388
+ for (const item of edits) {
53389
+ if (!item || typeof item !== "object") return null;
53390
+ const edit2 = item;
53391
+ const relPath2 = resolveEditRelPath(edit2.path, rootForEdit);
53392
+ if (!relPath2 || typeof edit2.search !== "string" || typeof edit2.replace !== "string") {
53393
+ return null;
53394
+ }
53395
+ if (edit2.search.length === 0) return null;
53396
+ blocks.push({
53397
+ path: relPath2,
53398
+ search: edit2.search,
53399
+ replace: edit2.replace,
53400
+ offset: 0
53401
+ });
53402
+ }
53403
+ return blocks;
53404
+ }
53405
+ const relPath = resolveEditRelPath(args.path, rootForEdit);
53406
+ if (!relPath) return null;
53407
+ if (name === "edit_file") {
53408
+ const search = typeof args.search === "string" ? args.search : "";
53409
+ const replace = typeof args.replace === "string" ? args.replace : "";
53410
+ if (!search) return null;
53411
+ return [{ path: relPath, search, replace, offset: 0 }];
53412
+ }
53413
+ const content = typeof args.content === "string" ? args.content : "";
53414
+ return [toWholeFileEditBlock(relPath, content, rootForEdit)];
53415
+ }
53416
+ function shouldApplyEditToolImmediately(editMode, turnEditPolicy) {
53417
+ return editMode === "auto" || editMode === "yolo" || turnEditPolicy === "apply-all";
53418
+ }
53419
+ function formatQueuedReviewToolResult(blockCount) {
53420
+ const noun = blockCount === 1 ? "edit" : "edits";
53421
+ return `Queued ${blockCount} ${noun} for review. No files were changed. Ask the user to run /apply to accept them or /discard to reject them.`;
53422
+ }
53423
+
53241
53424
  // src/cli/ui/effects/loop-to-dashboard.ts
53242
53425
  function loopEventToDashboard(ev, ctx) {
53243
53426
  const id = `${ctx.assistantId}-${ev.role}-${Date.now()}`;
@@ -53251,18 +53434,23 @@ function loopEventToDashboard(ev, ctx) {
53251
53434
  };
53252
53435
  case "tool_start":
53253
53436
  if (!ev.toolName) return null;
53254
- return { kind: "tool_start", id, toolName: ev.toolName, args: ev.toolArgs };
53437
+ return {
53438
+ kind: "tool_start",
53439
+ id: ev.callId ?? id,
53440
+ toolName: ev.toolName,
53441
+ args: ev.toolArgs
53442
+ };
53255
53443
  case "tool":
53256
53444
  if (!ev.toolName) return null;
53257
53445
  return {
53258
53446
  kind: "tool",
53259
- id,
53447
+ id: ev.callId ?? id,
53260
53448
  toolName: ev.toolName,
53261
53449
  content: ev.content,
53262
53450
  args: ev.toolArgs
53263
53451
  };
53264
53452
  case "warning":
53265
- return { kind: "warning", id, text: ev.content };
53453
+ return { kind: "warning", id, text: ev.content, severity: ev.severity };
53266
53454
  case "error":
53267
53455
  return { kind: "error", id, text: ev.content };
53268
53456
  case "status":
@@ -53395,12 +53583,23 @@ function handleAssistantFinal(ev, ctx) {
53395
53583
  ctx.flush();
53396
53584
  ctx.translator.reasoningDone(ctx.streamRef.reasoning);
53397
53585
  ctx.translator.streamingDone();
53398
- ctx.broadcastDashboardEvent({
53586
+ const finalEvent = {
53399
53587
  kind: "assistant_final",
53400
53588
  id: ctx.assistantId,
53401
53589
  text: ev.content || ctx.streamRef.text,
53402
53590
  reasoning: ctx.streamRef.reasoning || void 0
53403
- });
53591
+ };
53592
+ if (ev.stats?.usage) {
53593
+ finalEvent.usage = {
53594
+ prompt_tokens: ev.stats.usage.promptTokens,
53595
+ completion_tokens: ev.stats.usage.completionTokens,
53596
+ total_tokens: ev.stats.usage.totalTokens,
53597
+ prompt_cache_hit_tokens: ev.stats.usage.promptCacheHitTokens,
53598
+ prompt_cache_miss_tokens: ev.stats.usage.promptCacheMissTokens
53599
+ };
53600
+ finalEvent.costUsd = ev.stats.cost;
53601
+ }
53602
+ ctx.broadcastDashboardEvent(finalEvent);
53404
53603
  ctx.setSummary(ctx.getSessionSummary());
53405
53604
  if (ev.stats?.usage) {
53406
53605
  appendUsage({
@@ -53480,7 +53679,6 @@ function handleErrorEvent(ev, ctx) {
53480
53679
  }
53481
53680
  function handleWarningEvent(ev, ctx) {
53482
53681
  ctx.log.pushWarning(t("common.warning"), ev.content);
53483
- if (ev.content?.startsWith("\u21E7 ")) ctx.setTurnOnPro(true);
53484
53682
  }
53485
53683
 
53486
53684
  // src/cli/ui/lifecycle-observability.ts
@@ -53625,15 +53823,15 @@ function useCodeMode(opts) {
53625
53823
  const { codeMode, pendingEdits, currentRootDir, session, syncPendingCount, recordEdit } = opts;
53626
53824
  const codeApply = (0, import_react49.useCallback)(
53627
53825
  (indices) => {
53628
- if (!codeMode) return "not in code mode";
53826
+ if (!codeMode) return t("app.editHistoryNoCodeMode");
53629
53827
  const blocks = pendingEdits.current;
53630
53828
  if (blocks.length === 0) {
53631
- return "nothing pending \u2014 the model hasn't proposed edits since the last /apply or /discard.";
53829
+ return t("app.noPendingEdits");
53632
53830
  }
53633
53831
  const useSubset = indices !== void 0 && indices.length > 0;
53634
53832
  const { selected, remaining } = useSubset ? partitionEdits(blocks, indices) : { selected: blocks, remaining: [] };
53635
53833
  if (selected.length === 0) {
53636
- return "\u25B8 no edits matched those indices \u2014 nothing applied. Use /apply with no args to commit them all.";
53834
+ return t("app.noMatchedApply");
53637
53835
  }
53638
53836
  const snaps = snapshotBeforeEdits(selected, currentRootDir);
53639
53837
  const results = applyEditBlocks(selected, currentRootDir);
@@ -53644,7 +53842,7 @@ function useCodeMode(opts) {
53644
53842
  else savePendingEdits(session ?? null, remaining);
53645
53843
  syncPendingCount();
53646
53844
  const tail = remaining.length > 0 ? `
53647
- \u25B8 ${remaining.length} edit block(s) still pending \u2014 /apply or /discard to clear them.` : "";
53845
+ ${t("app.blocksStillPending", { count: remaining.length })}` : "";
53648
53846
  return formatEditResults(results) + tail;
53649
53847
  },
53650
53848
  [codeMode, currentRootDir, session, syncPendingCount, recordEdit, pendingEdits]
@@ -53652,18 +53850,18 @@ function useCodeMode(opts) {
53652
53850
  const codeDiscard = (0, import_react49.useCallback)(
53653
53851
  (indices) => {
53654
53852
  const blocks = pendingEdits.current;
53655
- if (blocks.length === 0) return "nothing pending to discard.";
53853
+ if (blocks.length === 0) return t("app.noPendingDiscard");
53656
53854
  const useSubset = indices !== void 0 && indices.length > 0;
53657
53855
  const { selected, remaining } = useSubset ? partitionEdits(blocks, indices) : { selected: blocks, remaining: [] };
53658
53856
  if (selected.length === 0) {
53659
- return "\u25B8 no edits matched those indices \u2014 nothing discarded.";
53857
+ return t("app.noMatchedDiscard");
53660
53858
  }
53661
53859
  pendingEdits.current = remaining;
53662
53860
  if (remaining.length === 0) clearPendingEdits(session ?? null);
53663
53861
  else savePendingEdits(session ?? null, remaining);
53664
53862
  syncPendingCount();
53665
- const tail = remaining.length > 0 ? ` (${remaining.length} block(s) still pending)` : ". Nothing was written to disk.";
53666
- return `\u25B8 discarded ${selected.length} pending edit block(s)${tail}`;
53863
+ const tail = remaining.length > 0 ? ` (${t("app.blocksStillPending", { count: remaining.length })})` : t("app.nothingWritten");
53864
+ return t("app.discardedCount", { count: selected.length }) + tail;
53667
53865
  },
53668
53866
  [session, syncPendingCount, pendingEdits]
53669
53867
  );
@@ -53732,16 +53930,19 @@ var HISTORY_MAX = 100;
53732
53930
  function useInputRecall(setInput) {
53733
53931
  const [history2, setHistory] = (0, import_react52.useState)([]);
53734
53932
  const historyCursor = (0, import_react52.useRef)(-1);
53933
+ const [isHistoryMode, setIsHistoryMode] = (0, import_react52.useState)(false);
53735
53934
  const recallPrev = (0, import_react52.useCallback)(() => {
53736
53935
  if (history2.length === 0) return;
53737
53936
  const nextCursor = Math.min(historyCursor.current + 1, history2.length - 1);
53738
53937
  historyCursor.current = nextCursor;
53938
+ setIsHistoryMode(nextCursor >= 0);
53739
53939
  setInput(history2[history2.length - 1 - nextCursor] ?? "");
53740
53940
  }, [setInput, history2]);
53741
53941
  const recallNext = (0, import_react52.useCallback)(() => {
53742
53942
  if (historyCursor.current < 0) return;
53743
53943
  const nextCursor = historyCursor.current - 1;
53744
53944
  historyCursor.current = nextCursor;
53945
+ setIsHistoryMode(nextCursor >= 0);
53745
53946
  setInput(nextCursor < 0 ? "" : history2[history2.length - 1 - nextCursor] ?? "");
53746
53947
  }, [setInput, history2]);
53747
53948
  const pushHistory = (0, import_react52.useCallback)((text2) => {
@@ -53753,8 +53954,9 @@ function useInputRecall(setInput) {
53753
53954
  }, []);
53754
53955
  const resetCursor = (0, import_react52.useCallback)(() => {
53755
53956
  historyCursor.current = -1;
53957
+ setIsHistoryMode(false);
53756
53958
  }, []);
53757
- return { recallPrev, recallNext, pushHistory, resetCursor, history: history2 };
53959
+ return { recallPrev, recallNext, pushHistory, resetCursor, history: history2, isHistoryMode };
53758
53960
  }
53759
53961
 
53760
53962
  // src/cli/ui/hooks/useLanguageReload.ts
@@ -53852,28 +54054,17 @@ function useLoopMode(opts) {
53852
54054
  };
53853
54055
  }
53854
54056
 
53855
- // src/cli/ui/hooks/usePresetMode.ts
53856
- var import_react55 = __toESM(require_react(), 1);
53857
- function usePresetMode(model2, initialPreset) {
53858
- const [preset2, setPreset] = (0, import_react55.useState)(
53859
- () => initialPreset ?? (model2 === "deepseek-v4-pro" ? "pro" : "auto")
53860
- );
53861
- const [proArmed, setProArmed] = (0, import_react55.useState)(false);
53862
- const [turnOnPro, setTurnOnPro] = (0, import_react55.useState)(false);
53863
- return { preset: preset2, setPreset, proArmed, setProArmed, turnOnPro, setTurnOnPro };
53864
- }
53865
-
53866
54057
  // src/cli/ui/hooks/useQuit.ts
53867
- var import_react56 = __toESM(require_react(), 1);
54058
+ var import_react55 = __toESM(require_react(), 1);
53868
54059
  function useQuit(transcriptRef) {
53869
- const quitProcess = (0, import_react56.useCallback)(() => {
54060
+ const quitProcess = (0, import_react55.useCallback)(() => {
53870
54061
  transcriptRef.current?.end();
53871
54062
  void (async () => {
53872
54063
  await stopAndSaveCpuProfile();
53873
54064
  process.exit(0);
53874
54065
  })();
53875
54066
  }, [transcriptRef]);
53876
- (0, import_react56.useEffect)(() => {
54067
+ (0, import_react55.useEffect)(() => {
53877
54068
  process.on("SIGINT", quitProcess);
53878
54069
  return () => {
53879
54070
  process.off("SIGINT", quitProcess);
@@ -53883,7 +54074,7 @@ function useQuit(transcriptRef) {
53883
54074
  }
53884
54075
 
53885
54076
  // src/cli/ui/hooks/useScrollback.ts
53886
- var import_react57 = __toESM(require_react(), 1);
54077
+ var import_react56 = __toESM(require_react(), 1);
53887
54078
  var seq = 0;
53888
54079
  function nextId2(prefix) {
53889
54080
  seq += 1;
@@ -53896,7 +54087,7 @@ function formatTok(n) {
53896
54087
  }
53897
54088
  function useScrollback() {
53898
54089
  const dispatch = useDispatch();
53899
- return (0, import_react57.useMemo)(
54090
+ return (0, import_react56.useMemo)(
53900
54091
  () => ({
53901
54092
  pushUser(text2) {
53902
54093
  const id = nextId2("u");
@@ -53930,8 +54121,7 @@ ${stack}` : message
53930
54121
  });
53931
54122
  return id;
53932
54123
  },
53933
- pushInfo(text2, tone = "info") {
53934
- const id = nextId2("info");
54124
+ pushInfo(text2, tone = "info", id = nextId2("info")) {
53935
54125
  dispatch({
53936
54126
  type: "live.show",
53937
54127
  id,
@@ -54110,12 +54300,12 @@ ${stack}` : message
54110
54300
  }
54111
54301
 
54112
54302
  // src/cli/ui/hooks/useToolProgressDisplay.ts
54113
- var import_react58 = __toESM(require_react(), 1);
54303
+ var import_react57 = __toESM(require_react(), 1);
54114
54304
  function useToolProgressDisplay(progressSink) {
54115
- const [ongoingTool, setOngoingTool] = (0, import_react58.useState)(null);
54116
- const [toolProgress, setToolProgress] = (0, import_react58.useState)(null);
54117
- const [statusLine, setStatusLine] = (0, import_react58.useState)(null);
54118
- (0, import_react58.useEffect)(() => {
54305
+ const [ongoingTool, setOngoingTool] = (0, import_react57.useState)(null);
54306
+ const [toolProgress, setToolProgress] = (0, import_react57.useState)(null);
54307
+ const [statusLine, setStatusLine] = (0, import_react57.useState)(null);
54308
+ (0, import_react57.useEffect)(() => {
54119
54309
  if (!progressSink) return;
54120
54310
  progressSink.current = (info) => {
54121
54311
  setToolProgress({
@@ -54128,7 +54318,7 @@ function useToolProgressDisplay(progressSink) {
54128
54318
  if (progressSink.current) progressSink.current = null;
54129
54319
  };
54130
54320
  }, [progressSink]);
54131
- const clear = (0, import_react58.useCallback)(() => {
54321
+ const clear = (0, import_react57.useCallback)(() => {
54132
54322
  setOngoingTool(null);
54133
54323
  setToolProgress(null);
54134
54324
  setStatusLine(null);
@@ -54145,9 +54335,9 @@ function useToolProgressDisplay(progressSink) {
54145
54335
  }
54146
54336
 
54147
54337
  // src/cli/ui/hooks/useTranscriptWriter.ts
54148
- var import_react59 = __toESM(require_react(), 1);
54338
+ var import_react58 = __toESM(require_react(), 1);
54149
54339
  function useTranscriptWriter(transcriptRef, model2, prefixHash) {
54150
- return (0, import_react59.useCallback)(
54340
+ return (0, import_react58.useCallback)(
54151
54341
  (ev) => {
54152
54342
  const stream = transcriptRef.current;
54153
54343
  if (!stream) return;
@@ -54158,19 +54348,19 @@ function useTranscriptWriter(transcriptRef, model2, prefixHash) {
54158
54348
  }
54159
54349
 
54160
54350
  // src/cli/ui/hooks/useWorkspaceRoot.ts
54161
- var import_react60 = __toESM(require_react(), 1);
54351
+ var import_react59 = __toESM(require_react(), 1);
54162
54352
  function useWorkspaceRoot(launchRoot) {
54163
- const [currentRootDir, setCurrentRootDir] = (0, import_react60.useState)(() => launchRoot ?? process.cwd());
54164
- const currentRootDirRef = (0, import_react60.useRef)(currentRootDir);
54165
- (0, import_react60.useEffect)(() => {
54353
+ const [currentRootDir, setCurrentRootDir] = (0, import_react59.useState)(() => launchRoot ?? process.cwd());
54354
+ const currentRootDirRef = (0, import_react59.useRef)(currentRootDir);
54355
+ (0, import_react59.useEffect)(() => {
54166
54356
  currentRootDirRef.current = currentRootDir;
54167
54357
  }, [currentRootDir]);
54168
54358
  return { currentRootDir, setCurrentRootDir, currentRootDirRef };
54169
54359
  }
54170
54360
 
54171
54361
  // src/cli/ui/layout/LiveExpandContext.ts
54172
- var import_react61 = __toESM(require_react(), 1);
54173
- var LiveExpandContext = (0, import_react61.createContext)(false);
54362
+ var import_react60 = __toESM(require_react(), 1);
54363
+ var LiveExpandContext = (0, import_react60.createContext)(false);
54174
54364
 
54175
54365
  // src/cli/ui/layout/StaticCardStream.tsx
54176
54366
  var import_react84 = __toESM(require_react(), 1);
@@ -54178,6 +54368,24 @@ var import_react84 = __toESM(require_react(), 1);
54178
54368
  // src/cli/ui/cards/CardRenderer.tsx
54179
54369
  var import_react83 = __toESM(require_react(), 1);
54180
54370
 
54371
+ // src/cli/ui/cards/CompactionCard.tsx
54372
+ var import_react61 = __toESM(require_react(), 1);
54373
+ var PREVIEW_LINES = 3;
54374
+ function CompactionCard({ card }) {
54375
+ const lines = card.summary.split("\n");
54376
+ const previewLines = lines.slice(0, PREVIEW_LINES);
54377
+ const hiddenCount = Math.max(0, lines.length - PREVIEW_LINES);
54378
+ return /* @__PURE__ */ import_react61.default.createElement(Card, { tone: TONE.info }, /* @__PURE__ */ import_react61.default.createElement(
54379
+ CardHeader,
54380
+ {
54381
+ glyph: "\u2261",
54382
+ tone: TONE.info,
54383
+ title: "compacted history",
54384
+ meta: [`${card.summary.length.toLocaleString()} chars \xB7 ${lines.length} lines`]
54385
+ }
54386
+ ), previewLines.map((line, i) => /* @__PURE__ */ import_react61.default.createElement(Text, { key: `${card.id}:p:${i}`, color: FG.sub }, line || " ")), hiddenCount > 0 ? /* @__PURE__ */ import_react61.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react61.default.createElement(Text, { color: FG.sub, dimColor: true }, "\u2026 ", hiddenCount, " more line", hiddenCount === 1 ? "" : "s", " (full summary in session log)")) : null);
54387
+ }
54388
+
54181
54389
  // src/cli/ui/cards/CtxCard.tsx
54182
54390
  var import_react62 = __toESM(require_react(), 1);
54183
54391
  var BAR_CELLS = 32;
@@ -54406,53 +54614,6 @@ function CursorBlock() {
54406
54614
  var import_react69 = __toESM(require_react(), 1);
54407
54615
  var VerboseContext = (0, import_react69.createContext)(false);
54408
54616
 
54409
- // src/cli/ui/text-width.ts
54410
- var segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
54411
- function graphemes(s) {
54412
- return Array.from(segmenter.segment(s), (seg) => seg.segment);
54413
- }
54414
- function graphemeWidth(g) {
54415
- if (g.length === 0) return 0;
54416
- const w = stringWidth(g);
54417
- if (w <= 0) return 0;
54418
- if (w >= 2) return 2;
54419
- return 1;
54420
- }
54421
- function clipToCells(s, maxCells) {
54422
- if (maxCells <= 0) return "";
54423
- if (stringWidth(s) <= maxCells) return s;
54424
- const cap = maxCells - 1;
54425
- let out = "";
54426
- let cells = 0;
54427
- for (const g of graphemes(s)) {
54428
- const w = graphemeWidth(g);
54429
- if (cells + w > cap) break;
54430
- out += g;
54431
- cells += w;
54432
- }
54433
- return `${out}\u2026`;
54434
- }
54435
- function wrapToCells(s, maxCells) {
54436
- if (maxCells <= 0) return [];
54437
- if (s.length === 0) return [""];
54438
- const out = [];
54439
- let cur = "";
54440
- let cells = 0;
54441
- for (const g of graphemes(s)) {
54442
- const w = graphemeWidth(g);
54443
- if (cells + w > maxCells) {
54444
- out.push(cur);
54445
- cur = g;
54446
- cells = w;
54447
- } else {
54448
- cur += g;
54449
- cells += w;
54450
- }
54451
- }
54452
- if (cur.length > 0 || out.length === 0) out.push(cur);
54453
- return out;
54454
- }
54455
-
54456
54617
  // src/cli/ui/cards/useIncrementalWrap.ts
54457
54618
  var import_react70 = __toESM(require_react(), 1);
54458
54619
  function wrapAll(text2, lineCells) {
@@ -54792,11 +54953,6 @@ function highlightCode(source, lang) {
54792
54953
  function Blockquote({ token }) {
54793
54954
  return /* @__PURE__ */ import_react73.default.createElement(Box_default, { flexDirection: "column" }, (token.tokens ?? []).map((child, i) => /* @__PURE__ */ import_react73.default.createElement(Box_default, { key: `${i}-${child.type}`, flexDirection: "row" }, /* @__PURE__ */ import_react73.default.createElement(Text, { color: TONE.brand }, " \u258E "), /* @__PURE__ */ import_react73.default.createElement(Box_default, { flexDirection: "column", flexGrow: 1 }, child.type === "paragraph" ? /* @__PURE__ */ import_react73.default.createElement(Text, { italic: true, color: FG.sub }, /* @__PURE__ */ import_react73.default.createElement(Inline, { tokens: child.tokens ?? [] })) : /* @__PURE__ */ import_react73.default.createElement(BlockToken, { token: child })))));
54794
54955
  }
54795
- function padToCells(text2, cells) {
54796
- const w = stringWidth(text2);
54797
- if (w >= cells) return text2;
54798
- return text2 + " ".repeat(cells - w);
54799
- }
54800
54956
  function HorizontalRule() {
54801
54957
  const width = useWidth();
54802
54958
  const rule = "\u2500".repeat(Math.max(width, 1));
@@ -55300,16 +55456,20 @@ function ToolCard({ card }) {
55300
55456
  [card.name, card.output]
55301
55457
  );
55302
55458
  const verbose = import_react79.default.useContext(VerboseContext);
55303
- const allLines = card.output.length > 0 ? card.output.split("\n") : [];
55304
55459
  const tail = tailLinesFor(card.name);
55305
- const truncated = !verbose && allLines.length > tail;
55306
- const visible = truncated ? allLines.slice(-tail) : allLines;
55307
- const hidden = truncated ? allLines.length - visible.length : 0;
55460
+ const preview = selectToolPreviewLines({
55461
+ toolName: card.name,
55462
+ output: card.output,
55463
+ exitCode: card.exitCode,
55464
+ tailLines: tail,
55465
+ verbose
55466
+ });
55467
+ const firstHiddenRow = preview.rows.findIndex((row2) => row2.kind === "hidden");
55308
55468
  const isInflight = useIsInflight(card.id);
55309
55469
  const status2 = toolStatus(card, isInflight);
55310
55470
  const headColor = headerColorFor(status2);
55311
55471
  const errColor = card.exitCode && card.exitCode !== 0 ? TONE.err : FG.sub;
55312
- const showBody = !card.rejected && (subagentMarkdown !== null || visible.length > 0);
55472
+ const showBody = !card.rejected && (subagentMarkdown !== null || preview.rows.length > 0);
55313
55473
  const meta = [];
55314
55474
  if (card.retry) {
55315
55475
  meta.push({ text: `\u21BB ${card.retry.attempt}/${card.retry.max}`, color: TONE.warn });
@@ -55328,17 +55488,30 @@ function ToolCard({ card }) {
55328
55488
  meta: meta.length > 0 ? meta : void 0,
55329
55489
  right: status2 === "running" ? /* @__PURE__ */ import_react79.default.createElement(Spinner, { kind: "braille", color: TONE_ACTIVE.brand, bold: true }) : void 0
55330
55490
  }
55331
- ), showBody && (subagentMarkdown !== null ? /* @__PURE__ */ import_react79.default.createElement(Markdown, { text: subagentMarkdown, width: lineCells }) : /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, hidden > 0 ? /* @__PURE__ */ import_react79.default.createElement(Text, { color: FG.faint }, t(hidden === 1 ? "cardLabels.earlierLine" : "cardLabels.earlierLines", {
55332
- count: hidden
55333
- })) : null, visible.map((line, i) => /* @__PURE__ */ import_react79.default.createElement(
55334
- Text,
55335
- {
55336
- key: `${card.id}:${hidden + i}`,
55337
- color: errColor,
55338
- dimColor: !card.exitCode || card.exitCode === 0
55339
- },
55340
- clipToCells(line, lineCells) || " "
55341
- )))));
55491
+ ), showBody && (subagentMarkdown !== null ? /* @__PURE__ */ import_react79.default.createElement(Markdown, { text: subagentMarkdown, width: lineCells }) : /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, preview.rows.map(
55492
+ (row2, i) => row2.kind === "hidden" ? /* @__PURE__ */ import_react79.default.createElement(Text, { key: `${card.id}:hidden:${i}`, color: FG.faint }, t(
55493
+ hiddenRowLabelKey({
55494
+ count: row2.count,
55495
+ includeShortcut: i === firstHiddenRow
55496
+ }),
55497
+ { count: row2.count }
55498
+ )) : /* @__PURE__ */ import_react79.default.createElement(
55499
+ Text,
55500
+ {
55501
+ key: `${card.id}:line:${row2.index}`,
55502
+ color: errColor,
55503
+ dimColor: !card.exitCode || card.exitCode === 0
55504
+ },
55505
+ clipToCells(row2.text, lineCells) || " "
55506
+ )
55507
+ ))));
55508
+ }
55509
+ function hiddenRowLabelKey({
55510
+ count,
55511
+ includeShortcut
55512
+ }) {
55513
+ if (includeShortcut) return count === 1 ? "cardLabels.earlierLine" : "cardLabels.earlierLines";
55514
+ return count === 1 ? "cardLabels.hiddenLine" : "cardLabels.hiddenLines";
55342
55515
  }
55343
55516
  function unwrapSubagentMarkdown(name, output) {
55344
55517
  if (name !== "spawn_subagent") return null;
@@ -55480,7 +55653,7 @@ function formatRelativeTime(ts, now = Date.now()) {
55480
55653
 
55481
55654
  // src/cli/ui/cards/UserCard.tsx
55482
55655
  function UserCard({ card }) {
55483
- return /* @__PURE__ */ import_react81.default.createElement(Box_default, { flexDirection: "row" }, /* @__PURE__ */ import_react81.default.createElement(Box_default, { width: 1, backgroundColor: CARD.user.color, flexShrink: 0 }), /* @__PURE__ */ import_react81.default.createElement(Box_default, { flexDirection: "column", flexGrow: 1, paddingLeft: 1, backgroundColor: "#1e1e1e" }, /* @__PURE__ */ import_react81.default.createElement(
55656
+ return /* @__PURE__ */ import_react81.default.createElement(Box_default, { flexDirection: "row" }, /* @__PURE__ */ import_react81.default.createElement(Box_default, { width: 1, backgroundColor: CARD.user.color, flexShrink: 0 }), /* @__PURE__ */ import_react81.default.createElement(Box_default, { flexDirection: "column", flexGrow: 1, paddingLeft: 1, backgroundColor: SURFACE.bgInput }, /* @__PURE__ */ import_react81.default.createElement(
55484
55657
  CardHeader,
55485
55658
  {
55486
55659
  glyph: CARD.user.glyph,
@@ -55548,6 +55721,8 @@ function renderCard(card) {
55548
55721
  return /* @__PURE__ */ import_react83.default.createElement(CtxCard, { card });
55549
55722
  case "doctor":
55550
55723
  return /* @__PURE__ */ import_react83.default.createElement(DoctorCard, { card });
55724
+ case "compaction":
55725
+ return /* @__PURE__ */ import_react83.default.createElement(CompactionCard, { card });
55551
55726
  default:
55552
55727
  return /* @__PURE__ */ import_react83.default.createElement(FallbackCard, { card });
55553
55728
  }
@@ -55557,18 +55732,33 @@ function FallbackCard({ card }) {
55557
55732
  }
55558
55733
 
55559
55734
  // src/cli/ui/layout/StaticCardStream.tsx
55560
- function StaticCardStream({
55735
+ function StaticCardStreamInner({
55561
55736
  suppressLive = false
55562
55737
  }) {
55563
55738
  const cards = useAgentState((s) => s.cards);
55564
- const { settled, live } = (0, import_react84.useMemo)(() => partition(cards), [cards]);
55565
- const visibleLive = suppressLive && live.length > 0 ? live.slice(0, -1) : live;
55566
- return /* @__PURE__ */ import_react84.default.createElement(import_react84.default.Fragment, null, /* @__PURE__ */ import_react84.default.createElement(Static, { items: settled }, (card) => /* @__PURE__ */ import_react84.default.createElement(Box_default, { key: card.id, flexDirection: "column", flexShrink: 0 }, /* @__PURE__ */ import_react84.default.createElement(CardRenderer, { card }))), /* @__PURE__ */ import_react84.default.createElement(Box_default, { flexDirection: "column", flexShrink: 0 }, visibleLive.map((card) => /* @__PURE__ */ import_react84.default.createElement(Box_default, { key: card.id, flexDirection: "column", flexShrink: 0 }, /* @__PURE__ */ import_react84.default.createElement(CardRenderer, { card })))));
55739
+ const { staticItems, dynamicItems, hasUnsettledDynamic } = (0, import_react84.useMemo)(
55740
+ () => partition(cards),
55741
+ [cards]
55742
+ );
55743
+ const visibleDynamic = suppressLive && hasUnsettledDynamic && dynamicItems.length > 0 ? dynamicItems.slice(0, -1) : dynamicItems;
55744
+ return /* @__PURE__ */ import_react84.default.createElement(import_react84.default.Fragment, null, /* @__PURE__ */ import_react84.default.createElement(Static, { items: staticItems }, (card) => /* @__PURE__ */ import_react84.default.createElement(Box_default, { key: card.id, flexDirection: "column", flexShrink: 0 }, /* @__PURE__ */ import_react84.default.createElement(CardRenderer, { card }))), /* @__PURE__ */ import_react84.default.createElement(Box_default, { flexDirection: "column", flexShrink: 0 }, visibleDynamic.map((card) => /* @__PURE__ */ import_react84.default.createElement(Box_default, { key: card.id, flexDirection: "column", flexShrink: 0 }, /* @__PURE__ */ import_react84.default.createElement(CardRenderer, { card })))));
55567
55745
  }
55746
+ var StaticCardStream = import_react84.default.memo(StaticCardStreamInner);
55747
+ StaticCardStream.displayName = "StaticCardStream";
55568
55748
  function partition(cards) {
55569
- const firstUnsettled = cards.findIndex((c) => !isFullySettled(c));
55570
- if (firstUnsettled === -1) return { settled: [...cards], live: [] };
55571
- return { settled: cards.slice(0, firstUnsettled), live: cards.slice(firstUnsettled) };
55749
+ const firstDynamic = cards.findIndex((c) => !isFullySettled(c) || isVerboseSensitive(c));
55750
+ if (firstDynamic === -1) {
55751
+ return { staticItems: [...cards], dynamicItems: [], hasUnsettledDynamic: false };
55752
+ }
55753
+ const dynamicItems = cards.slice(firstDynamic);
55754
+ return {
55755
+ staticItems: cards.slice(0, firstDynamic),
55756
+ dynamicItems,
55757
+ hasUnsettledDynamic: dynamicItems.some((c) => !isFullySettled(c))
55758
+ };
55759
+ }
55760
+ function isVerboseSensitive(card) {
55761
+ return card.kind === "reasoning" || card.kind === "tool";
55572
55762
  }
55573
55763
  function isFullySettled(card) {
55574
55764
  switch (card.kind) {
@@ -56036,11 +56226,6 @@ var help = () => {
56036
56226
  t("handlers.basic.helpUrlCache"),
56037
56227
  t("handlers.basic.helpUrlPunct"),
56038
56228
  "",
56039
- t("handlers.basic.helpPresetsTitle"),
56040
- t("handlers.basic.helpPresetAuto"),
56041
- t("handlers.basic.helpPresetFlash"),
56042
- t("handlers.basic.helpPresetPro"),
56043
- "",
56044
56229
  t("handlers.basic.helpSessionsTitle"),
56045
56230
  t("handlers.basic.helpSessionCustom"),
56046
56231
  t("handlers.basic.helpSessionNone")
@@ -56112,6 +56297,29 @@ var handlers2 = {
56112
56297
  about
56113
56298
  };
56114
56299
 
56300
+ // src/cli/ui/clipboard.ts
56301
+ import { mkdtempSync as mkdtempSync2, writeFileSync as writeFileSync4 } from "fs";
56302
+ import { tmpdir as tmpdir2 } from "os";
56303
+ import { join as join5 } from "path";
56304
+ var OSC_52_LIMIT = 75e3;
56305
+ function writeClipboard(text2) {
56306
+ const dir = mkdtempSync2(join5(tmpdir2(), "reasonix-clip-"));
56307
+ const filePath = join5(dir, "clip.txt");
56308
+ let osc52 = false;
56309
+ if (text2.length <= OSC_52_LIMIT) {
56310
+ const b64 = Buffer.from(text2, "utf8").toString("base64");
56311
+ process.stdout.write(`\x1B]52;c;${b64}\x1B\\`);
56312
+ osc52 = true;
56313
+ }
56314
+ let writtenPath = null;
56315
+ try {
56316
+ writeFileSync4(filePath, text2, "utf8");
56317
+ writtenPath = filePath;
56318
+ } catch {
56319
+ }
56320
+ return { osc52, filePath: writtenPath, size: text2.length };
56321
+ }
56322
+
56115
56323
  // src/cli/ui/slash/handlers/dashboard.ts
56116
56324
  var dashboard = (args, _loop, ctx) => {
56117
56325
  if (!ctx.startDashboard || !ctx.getDashboardUrl) {
@@ -56127,6 +56335,38 @@ var dashboard = (args, _loop, ctx) => {
56127
56335
  ctx.stopDashboard();
56128
56336
  return { info: t("handlers.dashboard.stopping") };
56129
56337
  }
56338
+ if (sub === "copy") {
56339
+ const url = ctx.getDashboardUrl();
56340
+ if (!url) return { info: t("handlers.dashboard.notRunning") };
56341
+ writeClipboard(url);
56342
+ return { info: t("handlers.dashboard.copied", { url }) };
56343
+ }
56344
+ if (sub === "reset-token") {
56345
+ if (!ctx.stopDashboard) {
56346
+ return { info: t("handlers.dashboard.stopNoCallback") };
56347
+ }
56348
+ clearDashboardToken();
56349
+ (async () => {
56350
+ try {
56351
+ await ctx.stopDashboard?.();
56352
+ } catch {
56353
+ }
56354
+ try {
56355
+ const url = await ctx.startDashboard();
56356
+ ctx.postInfo?.(
56357
+ [
56358
+ t("handlers.dashboard.tokenReset"),
56359
+ ` ${url}`,
56360
+ "",
56361
+ t("handlers.dashboard.readyHint")
56362
+ ].join("\n")
56363
+ );
56364
+ } catch (err) {
56365
+ ctx.postInfo?.(t("handlers.dashboard.failed", { reason: err.message }));
56366
+ }
56367
+ })();
56368
+ return { info: t("handlers.dashboard.tokenResetting") };
56369
+ }
56130
56370
  const existing = ctx.getDashboardUrl();
56131
56371
  if (existing) {
56132
56372
  return {
@@ -56947,26 +57187,17 @@ var memory = (args, _loop, ctx) => {
56947
57187
  var handlers9 = { memory };
56948
57188
 
56949
57189
  // src/cli/ui/slash/handlers/model.ts
56950
- function inferPresetFromModel(id) {
56951
- if (id === "deepseek-v4-pro") return "pro";
56952
- if (id === "deepseek-v4-flash") return "flash";
56953
- return null;
56954
- }
56955
57190
  var model = (args, loop2, ctx) => {
56956
57191
  const id = args[0];
56957
57192
  const known = ctx.models ?? null;
56958
57193
  if (!id) {
56959
57194
  return { openModelPicker: true };
56960
57195
  }
56961
- loop2.configure({ model: id, autoEscalate: false });
57196
+ loop2.configure({ model: id });
56962
57197
  ctx.dispatch?.({ type: "session.model.change", model: id });
56963
- const inferred = inferPresetFromModel(id);
56964
- ctx.dispatch?.({ type: "session.preset.change", preset: inferred });
56965
- if (inferred) {
56966
- try {
56967
- savePreset(inferred);
56968
- } catch {
56969
- }
57198
+ try {
57199
+ saveModel(id);
57200
+ } catch {
56970
57201
  }
56971
57202
  if (known && known.length > 0 && !known.includes(id)) {
56972
57203
  return {
@@ -56975,57 +57206,28 @@ var model = (args, loop2, ctx) => {
56975
57206
  }
56976
57207
  return { info: t("handlers.model.modelSet", { id }) };
56977
57208
  };
56978
- var preset = (args, loop2, ctx) => {
56979
- const name = (args[0] ?? "").toLowerCase();
56980
- const apply2 = (presetName, p) => {
56981
- loop2.configure({
56982
- model: p.model,
56983
- autoEscalate: p.autoEscalate,
56984
- reasoningEffort: p.reasoningEffort
56985
- });
56986
- ctx.dispatch?.({ type: "session.model.change", model: p.model });
56987
- ctx.dispatch?.({ type: "session.preset.change", preset: presetName });
56988
- try {
56989
- savePreset(presetName);
56990
- } catch {
56991
- }
56992
- };
56993
- if (name === "auto") {
56994
- apply2("auto", PRESETS.auto);
56995
- return { info: t("handlers.model.presetAuto") };
56996
- }
56997
- if (name === "flash") {
56998
- apply2("flash", PRESETS.flash);
56999
- return { info: t("handlers.model.presetFlash") };
57209
+ var effort = (args, loop2) => {
57210
+ const raw = (args[0] ?? "").toLowerCase();
57211
+ if (raw === "") {
57212
+ return {
57213
+ info: t("handlers.model.effortStatus", {
57214
+ current: loop2.reasoningEffort,
57215
+ list: REASONING_EFFORT_VALUES.join(" | ")
57216
+ })
57217
+ };
57000
57218
  }
57001
- if (name === "pro") {
57002
- apply2("pro", PRESETS.pro);
57003
- return { info: t("handlers.model.presetPro") };
57219
+ if (!isReasoningEffort(raw)) {
57220
+ return {
57221
+ info: t("handlers.model.effortUsage", { list: REASONING_EFFORT_VALUES.join(" | ") })
57222
+ };
57004
57223
  }
57005
- if (name === "") {
57006
- return { openModelPicker: true };
57224
+ const next = raw;
57225
+ loop2.configure({ reasoningEffort: next });
57226
+ try {
57227
+ saveReasoningEffort(next);
57228
+ } catch {
57007
57229
  }
57008
- return { info: t("handlers.model.presetUsage") };
57009
- };
57010
- var ESCALATION_MODEL_ID = "deepseek-v4-pro";
57011
- var pro = (args, loop2, ctx) => {
57012
- const arg = (args[0] ?? "").toLowerCase();
57013
- if (arg === "off" || arg === "cancel" || arg === "disarm") {
57014
- if (!loop2.proArmed) {
57015
- return { info: t("handlers.model.proNothingArmed") };
57016
- }
57017
- if (ctx.disarmPro) ctx.disarmPro();
57018
- else loop2.disarmPro();
57019
- return { info: t("handlers.model.proDisarmed") };
57020
- }
57021
- if (arg && arg !== "on" && arg !== "arm") {
57022
- return { info: t("handlers.model.proUsage") };
57023
- }
57024
- if (ctx.armPro) ctx.armPro();
57025
- else loop2.armProForNextTurn();
57026
- return {
57027
- info: t("handlers.model.proArmed", { model: ESCALATION_MODEL_ID })
57028
- };
57230
+ return { info: t("handlers.model.effortSet", { effort: next }) };
57029
57231
  };
57030
57232
  var budget = (args, loop2) => {
57031
57233
  const arg = args[0]?.trim() ?? "";
@@ -57071,37 +57273,13 @@ var budget = (args, loop2) => {
57071
57273
  };
57072
57274
  var handlers10 = {
57073
57275
  model,
57074
- preset,
57075
- pro,
57276
+ effort,
57076
57277
  budget
57077
57278
  };
57078
57279
 
57079
57280
  // src/cli/ui/slash/handlers/observability.ts
57080
57281
  import { release } from "os";
57081
57282
 
57082
- // src/cli/ui/clipboard.ts
57083
- import { mkdtempSync as mkdtempSync2, writeFileSync as writeFileSync4 } from "fs";
57084
- import { tmpdir as tmpdir2 } from "os";
57085
- import { join as join6 } from "path";
57086
- var OSC_52_LIMIT = 75e3;
57087
- function writeClipboard(text2) {
57088
- const dir = mkdtempSync2(join6(tmpdir2(), "reasonix-clip-"));
57089
- const filePath = join6(dir, "clip.txt");
57090
- let osc52 = false;
57091
- if (text2.length <= OSC_52_LIMIT) {
57092
- const b64 = Buffer.from(text2, "utf8").toString("base64");
57093
- process.stdout.write(`\x1B]52;c;${b64}\x1B\\`);
57094
- osc52 = true;
57095
- }
57096
- let writtenPath = null;
57097
- try {
57098
- writeFileSync4(filePath, text2, "utf8");
57099
- writtenPath = filePath;
57100
- } catch {
57101
- }
57102
- return { osc52, filePath: writtenPath, size: text2.length };
57103
- }
57104
-
57105
57283
  // src/cli/ui/ctx-breakdown.tsx
57106
57284
  var import_react85 = __toESM(require_react(), 1);
57107
57285
  function computeCtxBreakdown(loop2) {
@@ -57180,8 +57358,8 @@ function formatVersion(installed, latest) {
57180
57358
  if (cmp > 0) return installed;
57181
57359
  return `${installed} (latest: ${latest})`;
57182
57360
  }
57183
- function formatModel(model2, effort) {
57184
- return effort ? `${model2} \xB7 effort=${effort}` : model2;
57361
+ function formatModel(model2, effort2) {
57362
+ return effort2 ? `${model2} \xB7 effort=${effort2}` : model2;
57185
57363
  }
57186
57364
  function formatMode(editMode, planMode) {
57187
57365
  const parts = [];
@@ -58240,7 +58418,16 @@ function hydrateCardsFromMessages(messages) {
58240
58418
  }
58241
58419
  const text2 = typeof m.content === "string" ? m.content : "";
58242
58420
  if (text2) {
58243
- cards.push({ kind: "streaming", id: id("streaming"), ts, text: text2, done: true });
58421
+ if (isCompactionSummary(text2)) {
58422
+ cards.push({
58423
+ kind: "compaction",
58424
+ id: id("compaction"),
58425
+ ts,
58426
+ summary: stripCompactionMarker(text2)
58427
+ });
58428
+ } else {
58429
+ cards.push({ kind: "streaming", id: id("streaming"), ts, text: text2, done: true });
58430
+ }
58244
58431
  }
58245
58432
  if (m.tool_calls?.length) {
58246
58433
  for (const tc of m.tool_calls) {
@@ -58271,6 +58458,8 @@ function hydrateCardsFromMessages(messages) {
58271
58458
  const text2 = typeof m.content === "string" ? m.content : "";
58272
58459
  if (card) {
58273
58460
  card.output = text2;
58461
+ const exitCode = extractToolExitCode(card.name, text2);
58462
+ if (exitCode !== void 0) card.exitCode = exitCode;
58274
58463
  card.done = true;
58275
58464
  }
58276
58465
  }
@@ -58309,7 +58498,7 @@ function handleTurnInterrupt(key, {
58309
58498
 
58310
58499
  // src/cli/ui/useCompletionPickers.ts
58311
58500
  var import_react86 = __toESM(require_react(), 1);
58312
- import { isAbsolute, parse, relative, resolve as resolve2 } from "path";
58501
+ import { isAbsolute, parse, relative as relative2, resolve as resolve3 } from "path";
58313
58502
  var SEARCH_DEBOUNCE_MS = 80;
58314
58503
  var SEARCH_FLUSH_MS = 50;
58315
58504
  var SEARCH_RESULT_CAP = 200;
@@ -58534,8 +58723,8 @@ function usePathCandidates(rootDir, partial, isActive) {
58534
58723
  relPartial = partial.slice(root.length).replace(/\\/g, "/");
58535
58724
  insertIsAbsolute = true;
58536
58725
  } else {
58537
- const resolved = resolve2(rootDir, partial);
58538
- const relToRoot = relative(rootDir, resolved);
58726
+ const resolved = resolve3(rootDir, partial);
58727
+ const relToRoot = relative2(rootDir, resolved);
58539
58728
  if (relToRoot.startsWith("..") || isAbsolute(relToRoot)) {
58540
58729
  const root = parse(resolved).root;
58541
58730
  listRoot = root;
@@ -59153,10 +59342,13 @@ function useSubagent({
59153
59342
  }
59154
59343
 
59155
59344
  // src/cli/ui/App.tsx
59345
+ var STASH_HINT_CARD_ID = "composer-stash-hint";
59156
59346
  function isBusyPromptCommand(text2) {
59157
59347
  const trimmed = text2.trimStart();
59158
59348
  return trimmed.startsWith("/") || trimmed.startsWith("#") || detectBangCommand(trimmed) !== null;
59159
59349
  }
59350
+ var persistentDashboardHandle = null;
59351
+ var persistentEventSubscribers = /* @__PURE__ */ new Set();
59160
59352
  var FLUSH_INTERVAL_MS = (() => {
59161
59353
  const raw = process.env.REASONIX_FLUSH_MS;
59162
59354
  const fallback = isLegacyWindowsConsole() ? 150 : 50;
@@ -59216,8 +59408,7 @@ function App(props) {
59216
59408
  }
59217
59409
  function AppInner({
59218
59410
  model: model2,
59219
- preset: initialPreset,
59220
- autoEscalate,
59411
+ reasoningEffort: initialReasoningEffort,
59221
59412
  system,
59222
59413
  rebuildSystem,
59223
59414
  transcript,
@@ -59252,7 +59443,7 @@ function AppInner({
59252
59443
  const isStreaming = useAgentState((s) => s.cards.some((c) => c.kind === "streaming" && !c.done));
59253
59444
  const cardCount = useAgentState((s) => s.cards.length);
59254
59445
  const sessionModel = useAgentState((s) => s.session.model);
59255
- const sessionPreset = useAgentState((s) => s.status.preset);
59446
+ const sessionEffort = useAgentState((s) => s.status.reasoningEffort);
59256
59447
  const ctxTokens = useAgentState((s) => s.status.promptTokens);
59257
59448
  const ctxCap = useAgentState(
59258
59449
  (s) => s.status.promptCap ?? DEEPSEEK_CONTEXT_TOKENS[s.session.model] ?? DEFAULT_CONTEXT_TOKENS
@@ -59260,10 +59451,6 @@ function AppInner({
59260
59451
  const sessionCostUsd = useAgentState((s) => s.status.sessionCost);
59261
59452
  const lastTurnCostUsd = useAgentState((s) => s.status.cost);
59262
59453
  const cacheHitRatio = useAgentState((s) => s.status.cacheHit);
59263
- const presetForDisplay = useAgentState((s) => {
59264
- const p = s.status.preset;
59265
- return p === "auto" || p === "flash" || p === "pro" ? p : void 0;
59266
- });
59267
59454
  const sessionInputTokens = useAgentState((s) => s.status.sessionInputTokens);
59268
59455
  const sessionOutputTokens = useAgentState((s) => s.status.sessionOutputTokens);
59269
59456
  const lastTurnMs = useAgentState((s) => s.status.lastTurnMs);
@@ -59295,6 +59482,7 @@ function AppInner({
59295
59482
  const liveMcpServersRef = (0, import_react90.useRef)(liveMcpServers);
59296
59483
  liveMcpServersRef.current = liveMcpServers;
59297
59484
  const abortedThisTurn = (0, import_react90.useRef)(false);
59485
+ const stashRef = (0, import_react90.useRef)("");
59298
59486
  (0, import_react90.useEffect)(() => {
59299
59487
  busyRef.current = busy;
59300
59488
  }, [busy]);
@@ -59340,9 +59528,13 @@ function AppInner({
59340
59528
  editModeRef,
59341
59529
  modeFlash
59342
59530
  } = useEditGate(!!codeMode);
59343
- const { preset: preset2, setPreset, proArmed, setProArmed, turnOnPro, setTurnOnPro } = usePresetMode(
59344
- model2,
59345
- initialPreset
59531
+ const setEditModeLive = (0, import_react90.useCallback)(
59532
+ (mode2) => {
59533
+ editModeRef.current = mode2;
59534
+ setEditMode(mode2);
59535
+ if (codeMode) saveEditMode(mode2);
59536
+ },
59537
+ [codeMode, editModeRef, setEditMode]
59346
59538
  );
59347
59539
  const engineeringLifecycleBaseModeRef = (0, import_react90.useRef)(
59348
59540
  loadEngineeringLifecycleMode()
@@ -59394,7 +59586,8 @@ function AppInner({
59394
59586
  recallNext,
59395
59587
  pushHistory,
59396
59588
  resetCursor,
59397
- history: promptHistory
59589
+ history: promptHistory,
59590
+ isHistoryMode
59398
59591
  } = useInputRecall(setInput);
59399
59592
  const { setRawMode, isRawModeSupported } = use_stdin_default();
59400
59593
  const handleOpenExternalEditor = (0, import_react90.useCallback)(async () => {
@@ -59418,7 +59611,7 @@ function AppInner({
59418
59611
  const submittingRef = (0, import_react90.useRef)(false);
59419
59612
  const dashboardRef = (0, import_react90.useRef)(null);
59420
59613
  const dashboardStartingRef = (0, import_react90.useRef)(null);
59421
- const eventSubscribersRef = (0, import_react90.useRef)(/* @__PURE__ */ new Set());
59614
+ const eventSubscribersRef = (0, import_react90.useRef)(persistentEventSubscribers);
59422
59615
  const activePickerResolverRef = (0, import_react90.useRef)(null);
59423
59616
  const activePickerSnapshotRef = (0, import_react90.useRef)(null);
59424
59617
  const activeViewerResolverRef = (0, import_react90.useRef)(null);
@@ -59480,7 +59673,8 @@ function AppInner({
59480
59673
  const loopRef = (0, import_react90.useRef)(null);
59481
59674
  const loop2 = (0, import_react90.useMemo)(() => {
59482
59675
  if (loopRef.current) return loopRef.current;
59483
- const client = new DeepSeekClient({ baseUrl: loadBaseUrl() });
59676
+ const ep = loadEndpoint();
59677
+ const client = new DeepSeekClient({ apiKey: ep.apiKey, baseUrl: ep.baseUrl });
59484
59678
  if (tools && !tools.has("run_skill")) {
59485
59679
  registerSkillTools(tools, {
59486
59680
  projectRoot: codeMode?.rootDir,
@@ -59519,11 +59713,7 @@ function AppInner({
59519
59713
  session,
59520
59714
  hooks: hookList,
59521
59715
  hookCwd: currentRootDir,
59522
- // Restore the user's last-chosen effort cap. Without this a
59523
- // `/effort high` silently reverted to `max` on relaunch —the
59524
- // loop's constructor default wins over persisted state.
59525
- reasoningEffort: loadReasoningEffort(),
59526
- autoEscalate,
59716
+ reasoningEffort: initialReasoningEffort ?? loadReasoningEffort(),
59527
59717
  rebuildSystem
59528
59718
  });
59529
59719
  loopRef.current = l;
@@ -59570,7 +59760,7 @@ function AppInner({
59570
59760
  const switchWorkspaceRoot = (0, import_react90.useCallback)(
59571
59761
  (newPath) => {
59572
59762
  if (!codeMode?.reregisterTools) return { ok: false, info: t("handlers.edits.cwdCodeOnly") };
59573
- const resolved = resolve3(newPath);
59763
+ const resolved = resolve4(newPath);
59574
59764
  let stat;
59575
59765
  try {
59576
59766
  stat = statSync2(resolved);
@@ -59651,8 +59841,10 @@ function AppInner({
59651
59841
  loop2.hooks = hookList;
59652
59842
  }, [loop2, hookList]);
59653
59843
  (0, import_react90.useEffect)(() => {
59654
- const canonical = initialPreset ?? (loop2.model === "deepseek-v4-pro" ? "pro" : loop2.model === "deepseek-v4-flash" ? loop2.autoEscalate ? "auto" : "flash" : null);
59655
- agentStore.dispatch({ type: "session.preset.change", preset: canonical });
59844
+ agentStore.dispatch({
59845
+ type: "session.effort.change",
59846
+ reasoningEffort: loop2.reasoningEffort
59847
+ });
59656
59848
  }, []);
59657
59849
  const mcpBridgeStartedRef = (0, import_react90.useRef)(false);
59658
59850
  const pendingMcpAbortersRef = (0, import_react90.useRef)(/* @__PURE__ */ new Set());
@@ -60127,7 +60319,7 @@ ${t("mcpLifecycle.failedSetupHint")}`
60127
60319
  if (codeMode && key.shift && key.tab && !pendingShell && !pendingPath && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && !walkthroughActive && !pendingChoice && !stagedChoiceCustom && !pendingRevision) {
60128
60320
  const cur = editModeRef.current;
60129
60321
  const next = cur === "review" ? "auto" : cur === "auto" ? "yolo" : "review";
60130
- setEditMode(next);
60322
+ setEditModeLive(next);
60131
60323
  const message = next === "yolo" ? t("app.editModeYolo") : next === "auto" ? t("app.editModeAuto") : t("app.editModeReview");
60132
60324
  log.pushInfo(message);
60133
60325
  return;
@@ -60147,6 +60339,21 @@ ${t("mcpLifecycle.failedSetupHint")}`
60147
60339
  }
60148
60340
  if (busy) return;
60149
60341
  if (pendingShell || pendingPath) return;
60342
+ if (key.meta && key.input === "s" && !pendingPlan && !pendingReviseEditor && !pendingSessionsPicker && !pendingCheckpointPicker && !pendingMcpHub && !stagedInput && !pendingEditReview && !walkthroughActive && !pendingChoice && !stagedChoiceCustom && !pendingRevision) {
60343
+ if (stashRef.current) {
60344
+ const recalled = stashRef.current;
60345
+ stashRef.current = input;
60346
+ setInput(recalled);
60347
+ log.pushInfo(t("composer.stashRecall"), "info", STASH_HINT_CARD_ID);
60348
+ } else if (input.length > 0) {
60349
+ stashRef.current = input;
60350
+ setInput("");
60351
+ log.pushInfo(t("composer.stashSaved"), "info", STASH_HINT_CARD_ID);
60352
+ } else {
60353
+ log.pushInfo(t("composer.stashNothing"), "info", STASH_HINT_CARD_ID);
60354
+ }
60355
+ return;
60356
+ }
60150
60357
  if (atState && atState.entries.length > 0) {
60151
60358
  if (key.tab) {
60152
60359
  const entries = atState.entries;
@@ -60187,48 +60394,31 @@ ${t("mcpLifecycle.failedSetupHint")}`
60187
60394
  (0, import_react90.useEffect)(() => {
60188
60395
  if (!tools || !codeMode) return;
60189
60396
  tools.setToolInterceptor(async (name, args) => {
60190
- if (name !== "edit_file" && name !== "write_file") return null;
60191
- const rawPath = typeof args.path === "string" ? args.path : "";
60192
- if (!rawPath) return null;
60397
+ if (!isReviewGatedEditTool(name)) return null;
60193
60398
  const rootForEdit = currentRootDirRef.current;
60194
- const absRoot = resolve3(rootForEdit);
60195
- let relPath;
60196
- if (looksLikeAbsoluteSystemPath(rawPath)) {
60197
- const abs = resolve3(rawPath);
60198
- if (!pathIsUnder(abs, absRoot)) return null;
60199
- const rel = relative2(absRoot, abs);
60200
- if (!rel) return null;
60201
- relPath = rel;
60202
- } else {
60203
- let stripped = rawPath;
60204
- while (stripped.startsWith("/") || stripped.startsWith("\\")) {
60205
- stripped = stripped.slice(1);
60206
- }
60207
- if (!stripped) return null;
60208
- relPath = stripped;
60209
- }
60210
- let block2;
60211
- if (name === "edit_file") {
60212
- const search = typeof args.search === "string" ? args.search : "";
60213
- const replace = typeof args.replace === "string" ? args.replace : "";
60214
- if (!search) return null;
60215
- block2 = { path: relPath, search, replace, offset: 0 };
60216
- } else {
60217
- const content = typeof args.content === "string" ? args.content : "";
60218
- block2 = toWholeFileEditBlock(relPath, content, rootForEdit);
60219
- }
60399
+ const blocks = buildEditToolBlocks(name, args, rootForEdit);
60400
+ if (!blocks || blocks.length === 0) return null;
60220
60401
  const applyNow = () => {
60221
- const snaps = snapshotBeforeEdits([block2], rootForEdit);
60222
- const results = applyEditBlocks([block2], rootForEdit);
60402
+ const snaps = snapshotBeforeEdits(blocks, rootForEdit);
60403
+ const results = applyEditBlocks(blocks, rootForEdit);
60223
60404
  const good = results.some((r) => r.status === "applied" || r.status === "created");
60224
60405
  if (good) {
60225
- recordEdit("auto", [block2], results, snaps);
60406
+ recordEdit("auto", blocks, results, snaps);
60226
60407
  armUndoBanner(results);
60227
60408
  }
60228
60409
  return formatEditResults(results);
60229
60410
  };
60230
- if (editModeRef.current === "auto" || editModeRef.current === "yolo") return applyNow();
60231
- if (turnEditPolicyRef.current === "apply-all") return applyNow();
60411
+ if (shouldApplyEditToolImmediately(editModeRef.current, turnEditPolicyRef.current)) {
60412
+ return applyNow();
60413
+ }
60414
+ if (name === "multi_edit") {
60415
+ pendingEdits.current = [...pendingEdits.current, ...blocks];
60416
+ savePendingEdits(session ?? null, pendingEdits.current);
60417
+ syncPendingCount();
60418
+ log.pushInfo(formatPendingPreview(pendingEdits.current));
60419
+ return formatQueuedReviewToolResult(blocks.length);
60420
+ }
60421
+ const block2 = blocks[0];
60232
60422
  const { choice, denyContext } = await new Promise((resolveChoice) => {
60233
60423
  editReviewResolveRef.current = resolveChoice;
60234
60424
  setPendingEditReview(block2);
@@ -60246,7 +60436,7 @@ ${t("mcpLifecycle.failedSetupHint")}`
60246
60436
  return applyNow();
60247
60437
  }
60248
60438
  if (choice === "flip-to-auto") {
60249
- setEditMode("auto");
60439
+ setEditModeLive("auto");
60250
60440
  log.pushInfo(t("app.flippedAutoSession"));
60251
60441
  return applyNow();
60252
60442
  }
@@ -60305,262 +60495,270 @@ ${t("mcpLifecycle.failedSetupHint")}`
60305
60495
  const startDashboard = (0, import_react90.useCallback)(async () => {
60306
60496
  if (dashboardRef.current) return dashboardRef.current.url;
60307
60497
  if (dashboardStartingRef.current) return dashboardStartingRef.current;
60308
- const startup = (async () => {
60309
- const { startDashboardServer } = await import("./server-Z3IMJNNI.js");
60310
- const handle = await startDashboardServer(
60311
- {
60312
- mode: "attached",
60313
- configPath: defaultConfigPath(),
60314
- usageLogPath: defaultUsageLogPath(),
60315
- loop: loop2,
60316
- tools,
60317
- getMcpServers: () => liveMcpServersRef.current,
60318
- getMcpFailures: () => mcpRuntime?.failures() ?? [],
60319
- getCurrentCwd: () => codeMode ? currentRootDirRef.current : void 0,
60320
- getEditMode: () => codeMode ? editModeRef.current : void 0,
60321
- getPlanMode: () => planModeRef.current,
60322
- getPendingEditCount: () => pendingEdits.current.length,
60323
- getLatestVersion: () => latestVersionRef.current,
60324
- getSessionName: () => session ?? null,
60325
- setEditMode: (m) => {
60326
- setEditMode(m);
60327
- editModeRef.current = m;
60328
- saveEditMode(m);
60329
- return m;
60330
- },
60331
- setPlanMode: (on, source) => {
60332
- if (codeMode) togglePlanMode(on, source);
60333
- },
60334
- applyPresetLive: (name) => {
60335
- const settings = resolvePreset(name);
60336
- loop2.configure({
60337
- model: settings.model,
60338
- autoEscalate: settings.autoEscalate,
60339
- reasoningEffort: settings.reasoningEffort
60340
- });
60341
- agentStore.dispatch({ type: "session.model.change", model: settings.model });
60342
- const canonical = settings.model === "deepseek-v4-pro" ? "pro" : settings.autoEscalate ? "auto" : "flash";
60343
- setPreset(canonical);
60344
- agentStore.dispatch({ type: "session.preset.change", preset: canonical });
60345
- try {
60346
- savePreset(canonical);
60347
- } catch {
60498
+ const buildCtx = () => {
60499
+ const ctx = {
60500
+ mode: "attached",
60501
+ configPath: defaultConfigPath(),
60502
+ usageLogPath: defaultUsageLogPath(),
60503
+ loop: loop2,
60504
+ tools,
60505
+ getMcpServers: () => liveMcpServersRef.current,
60506
+ getMcpFailures: () => mcpRuntime?.failures() ?? [],
60507
+ getCurrentCwd: () => codeMode ? currentRootDirRef.current : void 0,
60508
+ getEditMode: () => codeMode ? editModeRef.current : void 0,
60509
+ getPlanMode: () => planModeRef.current,
60510
+ getPendingEditCount: () => pendingEdits.current.length,
60511
+ getLatestVersion: () => latestVersionRef.current,
60512
+ getSessionName: () => session ?? null,
60513
+ setEditMode: (m) => {
60514
+ setEditModeLive(m);
60515
+ return m;
60516
+ },
60517
+ setPlanMode: (on, source) => {
60518
+ if (codeMode) togglePlanMode(on, source);
60519
+ },
60520
+ applyEffortLive: (effort2) => {
60521
+ loop2.configure({ reasoningEffort: effort2 });
60522
+ agentStore.dispatch({ type: "session.effort.change", reasoningEffort: effort2 });
60523
+ },
60524
+ applyModelLive: (model3) => {
60525
+ loop2.configure({ model: model3 });
60526
+ agentStore.dispatch({ type: "session.model.change", model: model3 });
60527
+ },
60528
+ getModels: () => modelsRef.current,
60529
+ setBudgetUsdLive: (usd) => {
60530
+ loop2.setBudget(usd);
60531
+ },
60532
+ getLoopRunStatus: () => getLoopStatus(),
60533
+ startAutoLoop: (intervalMs, prompt) => startLoop(intervalMs, prompt),
60534
+ stopAutoLoop: () => stopLoop(),
60535
+ // ---------- Chat bridge ----------
60536
+ getMessages: () => cardsToDashboardMessages(agentStore.getState().cards),
60537
+ subscribeEvents: (handler) => {
60538
+ eventSubscribersRef.current.add(handler);
60539
+ return () => {
60540
+ eventSubscribersRef.current.delete(handler);
60541
+ };
60542
+ },
60543
+ submitPrompt: (text2) => {
60544
+ if (busyRef.current) {
60545
+ if (isBusyPromptCommand(text2)) {
60546
+ return {
60547
+ accepted: false,
60548
+ reason: "commands are disabled while steering a busy turn"
60549
+ };
60348
60550
  }
60349
- },
60350
- applyEffortLive: (effort) => {
60351
- loop2.configure({ reasoningEffort: effort });
60352
- },
60353
- applyModelLive: (model3) => {
60354
- loop2.configure({ model: model3 });
60355
- agentStore.dispatch({ type: "session.model.change", model: model3 });
60356
- },
60357
- getModels: () => modelsRef.current,
60358
- setProNextLive: (armed) => {
60359
- if (armed) loop2.armProForNextTurn();
60360
- else loop2.disarmPro();
60361
- },
60362
- setBudgetUsdLive: (usd) => {
60363
- loop2.setBudget(usd);
60364
- },
60365
- getLoopRunStatus: () => getLoopStatus(),
60366
- startAutoLoop: (intervalMs, prompt) => startLoop(intervalMs, prompt),
60367
- stopAutoLoop: () => stopLoop(),
60368
- // ---------- Chat bridge ----------
60369
- getMessages: () => cardsToDashboardMessages(agentStore.getState().cards),
60370
- subscribeEvents: (handler) => {
60371
- eventSubscribersRef.current.add(handler);
60372
- return () => {
60373
- eventSubscribersRef.current.delete(handler);
60374
- };
60375
- },
60376
- submitPrompt: (text2) => {
60377
- if (busyRef.current) {
60378
- if (isBusyPromptCommand(text2)) {
60379
- return {
60380
- accepted: false,
60381
- reason: "commands are disabled while steering a busy turn"
60382
- };
60551
+ loop2.steer(text2);
60552
+ return { accepted: true, reason: "steered" };
60553
+ }
60554
+ const fn = handleSubmitRef.current;
60555
+ if (!fn) return { accepted: false, reason: "TUI not ready" };
60556
+ fn(text2).catch(() => void 0);
60557
+ return { accepted: true };
60558
+ },
60559
+ abortTurn: () => {
60560
+ if (submittingRef.current) loop2.abort();
60561
+ },
60562
+ isBusy: () => busyRef.current,
60563
+ getStats: () => {
60564
+ const s = loop2.stats.summary();
60565
+ const ctxCap2 = DEEPSEEK_CONTEXT_TOKENS[loop2.model] ?? DEFAULT_CONTEXT_TOKENS;
60566
+ return {
60567
+ turns: s.turns,
60568
+ totalCostUsd: s.totalCostUsd,
60569
+ lastTurnCostUsd: s.lastTurnCostUsd,
60570
+ totalInputCostUsd: s.totalInputCostUsd,
60571
+ totalOutputCostUsd: s.totalOutputCostUsd,
60572
+ cacheHitRatio: s.cacheHitRatio,
60573
+ lastPromptTokens: s.lastPromptTokens,
60574
+ contextCapTokens: ctxCap2,
60575
+ // useSessionInfo's Balance is a flat { currency, total }; the
60576
+ // dashboard wire shape is the richer DeepSeek BalanceInfo
60577
+ // array (granted / topped_up split). Convert as a single-
60578
+ // entry array so the SPA always reads `balance[0]` shape.
60579
+ balance: balanceRef.current ? [
60580
+ {
60581
+ currency: balanceRef.current.currency,
60582
+ total_balance: String(balanceRef.current.total)
60383
60583
  }
60384
- loop2.steer(text2);
60385
- return { accepted: true, reason: "steered" };
60386
- }
60387
- const fn = handleSubmitRef.current;
60388
- if (!fn) return { accepted: false, reason: "TUI not ready" };
60389
- fn(text2).catch(() => void 0);
60390
- return { accepted: true };
60391
- },
60392
- abortTurn: () => {
60393
- if (submittingRef.current) loop2.abort();
60394
- },
60395
- isBusy: () => busyRef.current,
60396
- getStats: () => {
60397
- const s = loop2.stats.summary();
60398
- const ctxCap2 = DEEPSEEK_CONTEXT_TOKENS[loop2.model] ?? DEFAULT_CONTEXT_TOKENS;
60584
+ ] : null
60585
+ };
60586
+ },
60587
+ // ---------- Modal mirroring ----------
60588
+ getActiveModal: () => {
60589
+ const ps = pendingShell;
60590
+ if (ps) {
60399
60591
  return {
60400
- turns: s.turns,
60401
- totalCostUsd: s.totalCostUsd,
60402
- lastTurnCostUsd: s.lastTurnCostUsd,
60403
- totalInputCostUsd: s.totalInputCostUsd,
60404
- totalOutputCostUsd: s.totalOutputCostUsd,
60405
- cacheHitRatio: s.cacheHitRatio,
60406
- lastPromptTokens: s.lastPromptTokens,
60407
- contextCapTokens: ctxCap2,
60408
- // useSessionInfo's Balance is a flat { currency, total }; the
60409
- // dashboard wire shape is the richer DeepSeek BalanceInfo
60410
- // array (granted / topped_up split). Convert as a single-
60411
- // entry array so the SPA always reads `balance[0]` shape.
60412
- balance: balanceRef.current ? [
60413
- {
60414
- currency: balanceRef.current.currency,
60415
- total_balance: String(balanceRef.current.total)
60416
- }
60417
- ] : null
60592
+ kind: "shell",
60593
+ command: ps.command,
60594
+ allowPrefix: derivePrefix(ps.command),
60595
+ shellKind: ps.kind
60418
60596
  };
60419
- },
60420
- // ---------- Modal mirroring ----------
60421
- getActiveModal: () => {
60422
- const ps = pendingShell;
60423
- if (ps) {
60424
- return {
60425
- kind: "shell",
60426
- command: ps.command,
60427
- allowPrefix: derivePrefix(ps.command),
60428
- shellKind: ps.kind
60429
- };
60430
- }
60431
- const pp = pendingPath;
60432
- if (pp) {
60433
- return {
60434
- kind: "path",
60435
- path: pp.path,
60436
- intent: pp.intent,
60437
- toolName: pp.toolName,
60438
- sandboxRoot: pp.sandboxRoot,
60439
- allowPrefix: pp.allowPrefix
60440
- };
60441
- }
60442
- const pc = pendingChoice;
60443
- if (pc) {
60444
- return {
60445
- kind: "choice",
60446
- question: pc.question,
60447
- options: pc.options,
60448
- allowCustom: pc.allowCustom
60449
- };
60450
- }
60451
- if (pendingPlanRef.current) {
60452
- return { kind: "plan", body: pendingPlanRef.current };
60453
- }
60454
- const er = pendingEditReview;
60455
- if (er) {
60456
- return {
60457
- kind: "edit-review",
60458
- path: er.path,
60459
- search: er.search ?? "",
60460
- replace: er.replace ?? "",
60461
- preview: (er.search || er.replace || "").split("\n").slice(0, 12).join("\n"),
60462
- total: pendingEdits.current.length,
60463
- remaining: pendingEdits.current.length
60464
- };
60465
- }
60466
- if (pendingRevision) {
60467
- return {
60468
- kind: "revision",
60469
- reason: pendingRevision.reason,
60470
- remainingSteps: pendingRevision.remainingSteps.map((s) => ({
60471
- id: s.id,
60472
- title: s.title,
60473
- action: s.action,
60474
- ...s.risk ? { risk: s.risk } : {}
60475
- })),
60476
- ...pendingRevision.summary ? { summary: pendingRevision.summary } : {}
60477
- };
60478
- }
60479
- if (pendingCheckpoint) {
60480
- return {
60481
- kind: "checkpoint",
60482
- stepId: pendingCheckpoint.stepId,
60483
- ...pendingCheckpoint.title ? { title: pendingCheckpoint.title } : {},
60484
- completed: pendingCheckpoint.completed,
60485
- total: pendingCheckpoint.total
60486
- };
60487
- }
60488
- const picker = activePickerSnapshotRef.current;
60489
- if (picker) {
60490
- return { kind: "picker", ...picker };
60491
- }
60492
- const viewer = activeViewerSnapshotRef.current;
60493
- if (viewer) {
60494
- return { kind: "viewer", ...viewer };
60495
- }
60496
- return null;
60497
- },
60498
- resolveShellConfirm: (choice) => {
60499
- const fn = handleShellConfirmRef.current;
60500
- if (fn) Promise.resolve(fn(choice)).catch(() => void 0);
60501
- },
60502
- resolvePathConfirm: (choice) => {
60503
- const fn = handlePathConfirmRef.current;
60504
- if (fn) Promise.resolve(fn(choice)).catch(() => void 0);
60505
- },
60506
- resolveChoiceConfirm: (choice) => {
60507
- const fn = handleChoiceConfirmRef.current;
60508
- if (fn) fn(choice).catch(() => void 0);
60509
- },
60510
- resolvePlanConfirm: (choice, text2) => {
60511
- if (choice === "cancel") {
60512
- handlePlanConfirmRef.current("cancel").catch(() => void 0);
60513
- return;
60514
- }
60515
- const plan2 = pendingPlanRef.current ?? "";
60516
- handleStagedInputSubmitRef.current(text2 ?? "", { plan: plan2, mode: choice }).catch(() => void 0);
60517
- },
60518
- resolveEditReview: (choice) => {
60519
- const resolve4 = editReviewResolveRef.current;
60520
- if (resolve4) {
60521
- editReviewResolveRef.current = null;
60522
- setPendingEditReview(null);
60523
- resolve4({ choice, denyContext: void 0 });
60524
- }
60525
- },
60526
- resolveCheckpointConfirm: (choice, text2) => {
60527
- if (choice === "revise" && typeof text2 === "string") {
60528
- const snap = pendingCheckpoint;
60529
- setPendingCheckpoint(null);
60530
- if (!snap) return;
60531
- Promise.resolve(handleCheckpointReviseSubmitRef.current(text2, snap)).catch(
60532
- () => void 0
60533
- );
60534
- return;
60535
- }
60536
- Promise.resolve(handleCheckpointConfirmRef.current(choice)).catch(() => void 0);
60537
- },
60538
- resolveReviseConfirm: (choice) => {
60539
- Promise.resolve(handleReviseConfirmRef.current(choice)).catch(() => void 0);
60540
- },
60541
- resolvePicker: (resolution) => {
60542
- const fn = activePickerResolverRef.current;
60543
- if (fn) Promise.resolve(fn(resolution)).catch(() => void 0);
60544
- },
60545
- resolveViewer: () => {
60546
- const fn = activeViewerResolverRef.current;
60547
- if (fn) Promise.resolve(fn()).catch(() => void 0);
60548
- },
60549
- // ---------- v0.14 mutation surface ----------
60550
- reloadHooks: () => reloadHooks(codeMode ? currentRootDirRef.current : void 0),
60551
- addToolToPrefix: (spec) => loop2.prefix.addTool(spec),
60552
- reloadMcp: mcpRuntime ? async () => {
60553
- const r = await mcpRuntime.reloadFromConfig(loop2);
60554
- setLiveMcpServers(r.summaries);
60555
- return r.summaries.length;
60556
- } : void 0,
60557
- switchSession: onSwitchSession ? (name) => {
60558
- onSwitchSession(name);
60559
- return { ok: true };
60560
- } : void 0
60597
+ }
60598
+ const pp = pendingPath;
60599
+ if (pp) {
60600
+ return {
60601
+ kind: "path",
60602
+ path: pp.path,
60603
+ intent: pp.intent,
60604
+ toolName: pp.toolName,
60605
+ sandboxRoot: pp.sandboxRoot,
60606
+ allowPrefix: pp.allowPrefix
60607
+ };
60608
+ }
60609
+ const pc = pendingChoice;
60610
+ if (pc) {
60611
+ return {
60612
+ kind: "choice",
60613
+ question: pc.question,
60614
+ options: pc.options,
60615
+ allowCustom: pc.allowCustom
60616
+ };
60617
+ }
60618
+ if (pendingPlanRef.current) {
60619
+ return { kind: "plan", body: pendingPlanRef.current };
60620
+ }
60621
+ const er = pendingEditReview;
60622
+ if (er) {
60623
+ return {
60624
+ kind: "edit-review",
60625
+ path: er.path,
60626
+ search: er.search ?? "",
60627
+ replace: er.replace ?? "",
60628
+ preview: (er.search || er.replace || "").split("\n").slice(0, 12).join("\n"),
60629
+ total: pendingEdits.current.length,
60630
+ remaining: pendingEdits.current.length
60631
+ };
60632
+ }
60633
+ if (pendingRevision) {
60634
+ return {
60635
+ kind: "revision",
60636
+ reason: pendingRevision.reason,
60637
+ remainingSteps: pendingRevision.remainingSteps.map((s) => ({
60638
+ id: s.id,
60639
+ title: s.title,
60640
+ action: s.action,
60641
+ ...s.risk ? { risk: s.risk } : {}
60642
+ })),
60643
+ ...pendingRevision.summary ? { summary: pendingRevision.summary } : {}
60644
+ };
60645
+ }
60646
+ if (pendingCheckpoint) {
60647
+ return {
60648
+ kind: "checkpoint",
60649
+ stepId: pendingCheckpoint.stepId,
60650
+ ...pendingCheckpoint.title ? { title: pendingCheckpoint.title } : {},
60651
+ completed: pendingCheckpoint.completed,
60652
+ total: pendingCheckpoint.total
60653
+ };
60654
+ }
60655
+ const picker = activePickerSnapshotRef.current;
60656
+ if (picker) {
60657
+ return { kind: "picker", ...picker };
60658
+ }
60659
+ const viewer = activeViewerSnapshotRef.current;
60660
+ if (viewer) {
60661
+ return { kind: "viewer", ...viewer };
60662
+ }
60663
+ return null;
60561
60664
  },
60562
- { port: dashboardPort, host: dashboardHost, token: dashboardToken }
60563
- );
60665
+ resolveShellConfirm: (choice) => {
60666
+ const fn = handleShellConfirmRef.current;
60667
+ if (fn) Promise.resolve(fn(choice)).catch(() => void 0);
60668
+ },
60669
+ resolvePathConfirm: (choice) => {
60670
+ const fn = handlePathConfirmRef.current;
60671
+ if (fn) Promise.resolve(fn(choice)).catch(() => void 0);
60672
+ },
60673
+ resolveChoiceConfirm: (choice) => {
60674
+ const fn = handleChoiceConfirmRef.current;
60675
+ if (fn) fn(choice).catch(() => void 0);
60676
+ },
60677
+ resolvePlanConfirm: (choice, text2) => {
60678
+ if (choice === "cancel") {
60679
+ handlePlanConfirmRef.current("cancel").catch(() => void 0);
60680
+ return;
60681
+ }
60682
+ const plan2 = pendingPlanRef.current ?? "";
60683
+ handleStagedInputSubmitRef.current(text2 ?? "", { plan: plan2, mode: choice }).catch(() => void 0);
60684
+ },
60685
+ resolveEditReview: (choice) => {
60686
+ const resolve5 = editReviewResolveRef.current;
60687
+ if (resolve5) {
60688
+ editReviewResolveRef.current = null;
60689
+ setPendingEditReview(null);
60690
+ resolve5({ choice, denyContext: void 0 });
60691
+ }
60692
+ },
60693
+ resolveCheckpointConfirm: (choice, text2) => {
60694
+ if (choice === "revise" && typeof text2 === "string") {
60695
+ const snap = pendingCheckpoint;
60696
+ setPendingCheckpoint(null);
60697
+ if (!snap) return;
60698
+ Promise.resolve(handleCheckpointReviseSubmitRef.current(text2, snap)).catch(
60699
+ () => void 0
60700
+ );
60701
+ return;
60702
+ }
60703
+ Promise.resolve(handleCheckpointConfirmRef.current(choice)).catch(() => void 0);
60704
+ },
60705
+ resolveReviseConfirm: (choice) => {
60706
+ Promise.resolve(handleReviseConfirmRef.current(choice)).catch(() => void 0);
60707
+ },
60708
+ resolvePicker: (resolution) => {
60709
+ const fn = activePickerResolverRef.current;
60710
+ if (fn) Promise.resolve(fn(resolution)).catch(() => void 0);
60711
+ },
60712
+ resolveViewer: () => {
60713
+ const fn = activeViewerResolverRef.current;
60714
+ if (fn) Promise.resolve(fn()).catch(() => void 0);
60715
+ },
60716
+ // ---------- v0.14 mutation surface ----------
60717
+ reloadHooks: () => reloadHooks(codeMode ? currentRootDirRef.current : void 0),
60718
+ addToolToPrefix: (spec) => loop2.prefix.addTool(spec),
60719
+ reloadMcp: mcpRuntime ? async () => {
60720
+ const r = await mcpRuntime.reloadFromConfig(loop2);
60721
+ setLiveMcpServers(r.summaries);
60722
+ return r.summaries.length;
60723
+ } : void 0,
60724
+ switchSession: onSwitchSession ? (name) => {
60725
+ onSwitchSession(name);
60726
+ return { ok: true };
60727
+ } : void 0
60728
+ };
60729
+ return ctx;
60730
+ };
60731
+ if (persistentDashboardHandle) {
60732
+ persistentDashboardHandle.updateContext(buildCtx());
60733
+ dashboardRef.current = persistentDashboardHandle;
60734
+ setDashboardUrlState(persistentDashboardHandle.url);
60735
+ return persistentDashboardHandle.url;
60736
+ }
60737
+ const startup = (async () => {
60738
+ const { startDashboardServer } = await import("./server-SZZDKTH2.js");
60739
+ const { saveDashboardPort } = await import("./config-XK5WQGTS.js");
60740
+ const tryStart = (port) => startDashboardServer(buildCtx(), {
60741
+ port,
60742
+ host: dashboardHost,
60743
+ token: dashboardToken
60744
+ });
60745
+ let handle;
60746
+ try {
60747
+ handle = await tryStart(dashboardPort);
60748
+ } catch (err) {
60749
+ const code = err?.code;
60750
+ if (dashboardPort && (code === "EADDRINUSE" || code === "EACCES")) {
60751
+ process.stderr.write(
60752
+ `\u25B2 dashboard port ${dashboardPort} taken (${code}) \u2014 falling back to ephemeral
60753
+ `
60754
+ );
60755
+ handle = await tryStart(void 0);
60756
+ } else {
60757
+ throw err;
60758
+ }
60759
+ }
60760
+ saveDashboardPort(handle.port);
60761
+ persistentDashboardHandle = handle;
60564
60762
  dashboardRef.current = handle;
60565
60763
  setDashboardUrlState(handle.url);
60566
60764
  return handle.url;
@@ -60590,19 +60788,19 @@ ${t("mcpLifecycle.failedSetupHint")}`
60590
60788
  stopLoop,
60591
60789
  pendingEdits,
60592
60790
  editModeRef,
60593
- setEditMode,
60791
+ setEditModeLive,
60594
60792
  currentRootDirRef,
60595
60793
  reloadHooks,
60596
- setPreset,
60597
60794
  onSwitchSession,
60598
60795
  dashboardPort,
60599
60796
  dashboardHost,
60600
60797
  dashboardToken
60601
60798
  ]);
60602
60799
  const stopDashboard = (0, import_react90.useCallback)(async () => {
60603
- const h = dashboardRef.current;
60800
+ const h = dashboardRef.current ?? persistentDashboardHandle;
60604
60801
  if (!h) return;
60605
60802
  dashboardRef.current = null;
60803
+ persistentDashboardHandle = null;
60606
60804
  setDashboardUrlState(null);
60607
60805
  try {
60608
60806
  await h.close();
@@ -60611,27 +60809,32 @@ ${t("mcpLifecycle.failedSetupHint")}`
60611
60809
  log.pushInfo(t("app.dashboardStopped"));
60612
60810
  }, [log]);
60613
60811
  const getDashboardUrl = (0, import_react90.useCallback)(() => {
60614
- return dashboardRef.current?.url ?? null;
60615
- }, []);
60812
+ const baseUrl = dashboardRef.current?.url ?? null;
60813
+ if (!baseUrl || !session) return baseUrl;
60814
+ try {
60815
+ const url = new URL(baseUrl);
60816
+ url.searchParams.set("session", session);
60817
+ return url.toString();
60818
+ } catch {
60819
+ return baseUrl;
60820
+ }
60821
+ }, [session]);
60616
60822
  (0, import_react90.useEffect)(() => {
60617
60823
  if (noDashboard) return;
60618
60824
  if (dashboardRef.current) return;
60619
60825
  startDashboard().then((url) => {
60620
60826
  if (!url) return;
60621
- log.pushInfo(`/dashboard \u2192 ${url}`);
60622
- if (openDashboard) openUrl(url);
60827
+ const sessionUrl = getDashboardUrl() ?? url;
60828
+ log.pushInfo(`/dashboard \u2192 ${sessionUrl}`);
60829
+ if (openDashboard) openUrl(sessionUrl);
60623
60830
  }).catch((err) => {
60624
60831
  const reason = err instanceof Error ? err.message : String(err);
60625
60832
  log.pushInfo(t("ui.dashboardAutoStartFailed", { reason }));
60626
60833
  });
60627
- }, [noDashboard, openDashboard, startDashboard, log]);
60834
+ }, [noDashboard, openDashboard, startDashboard, log, getDashboardUrl]);
60628
60835
  (0, import_react90.useEffect)(() => {
60629
60836
  return () => {
60630
- const h = dashboardRef.current;
60631
- if (h) {
60632
- dashboardRef.current = null;
60633
- h.close().catch(() => void 0);
60634
- }
60837
+ dashboardRef.current = null;
60635
60838
  };
60636
60839
  }, []);
60637
60840
  const handleWalkChoice = (0, import_react90.useCallback)(
@@ -60645,8 +60848,7 @@ ${t("mcpLifecycle.failedSetupHint")}`
60645
60848
  setWalkthroughActive(false);
60646
60849
  return;
60647
60850
  } else if (choice === "flip-to-auto") {
60648
- setEditMode("auto");
60649
- saveEditMode("auto");
60851
+ setEditModeLive("auto");
60650
60852
  log.pushInfo(codeApply([1]));
60651
60853
  log.pushInfo(t("app.flippedAutoWalk"));
60652
60854
  setWalkthroughActive(false);
@@ -60654,7 +60856,7 @@ ${t("mcpLifecycle.failedSetupHint")}`
60654
60856
  }
60655
60857
  if (pendingEdits.current.length === 0) setWalkthroughActive(false);
60656
60858
  },
60657
- [codeApply, codeDiscard, log, pendingEdits, setEditMode]
60859
+ [codeApply, codeDiscard, log, pendingEdits, setEditModeLive]
60658
60860
  );
60659
60861
  const pendingGateIdRef = (0, import_react90.useRef)(null);
60660
60862
  const handleShellConfirmRef = (0, import_react90.useRef)(() => void 0);
@@ -60671,36 +60873,25 @@ ${t("mcpLifecycle.failedSetupHint")}`
60671
60873
  const handleChoiceResolveRef = (0, import_react90.useRef)(() => void 0);
60672
60874
  const handleQQModelPick = (0, import_react90.useCallback)(
60673
60875
  (target) => {
60674
- if (target === "auto" || target === "flash" || target === "pro") {
60675
- const preset3 = PRESETS[target];
60676
- loop2.configure({
60677
- model: preset3.model,
60678
- autoEscalate: preset3.autoEscalate,
60679
- reasoningEffort: preset3.reasoningEffort
60680
- });
60681
- agentStore.dispatch({ type: "session.model.change", model: preset3.model });
60682
- setPreset(target);
60683
- agentStore.dispatch({ type: "session.preset.change", preset: target });
60876
+ if (isReasoningEffort(target)) {
60877
+ const effort2 = target;
60878
+ loop2.configure({ reasoningEffort: effort2 });
60879
+ agentStore.dispatch({ type: "session.effort.change", reasoningEffort: effort2 });
60684
60880
  try {
60685
- savePreset(target);
60881
+ saveReasoningEffort(effort2);
60686
60882
  } catch {
60687
60883
  }
60688
- return `preset: ${target} / ${preset3.model}`;
60884
+ return `effort: ${effort2}`;
60689
60885
  }
60690
- loop2.configure({ model: target, autoEscalate: false });
60886
+ loop2.configure({ model: target });
60691
60887
  agentStore.dispatch({ type: "session.model.change", model: target });
60692
- const inferred = target === "deepseek-v4-pro" ? "pro" : target === "deepseek-v4-flash" ? "flash" : null;
60693
- setPreset(inferred ?? "flash");
60694
- agentStore.dispatch({ type: "session.preset.change", preset: inferred });
60695
- if (inferred) {
60696
- try {
60697
- savePreset(inferred);
60698
- } catch {
60699
- }
60888
+ try {
60889
+ saveModel(target);
60890
+ } catch {
60700
60891
  }
60701
60892
  return `model: ${target}`;
60702
60893
  },
60703
- [agentStore, loop2, setPreset]
60894
+ [agentStore, loop2]
60704
60895
  );
60705
60896
  const handleQQThemePick = (0, import_react90.useCallback)(
60706
60897
  (target) => {
@@ -60901,20 +61092,12 @@ ${answer}`, "brand");
60901
61092
  planMode,
60902
61093
  setPlanMode: codeMode ? togglePlanMode : void 0,
60903
61094
  editMode: codeMode ? editMode : void 0,
60904
- setEditMode: codeMode ? setEditMode : void 0,
61095
+ setEditMode: codeMode ? setEditModeLive : void 0,
60905
61096
  touchedFiles: codeMode ? () => {
60906
61097
  const set = new Set(touchedPaths());
60907
61098
  for (const b of pendingEdits.current) set.add(b.path);
60908
61099
  return [...set];
60909
61100
  } : void 0,
60910
- armPro: () => {
60911
- loop2.armProForNextTurn();
60912
- setProArmed(true);
60913
- },
60914
- disarmPro: () => {
60915
- loop2.disarmPro();
60916
- setProArmed(false);
60917
- },
60918
61101
  startLoop,
60919
61102
  stopLoop,
60920
61103
  getLoopStatus,
@@ -61120,15 +61303,9 @@ ${answer}`, "brand");
61120
61303
  abortedThisTurn.current = false;
61121
61304
  if (codeMode) sealCurrentEntry();
61122
61305
  turnEditPolicyRef.current = "ask";
61123
- if (proArmed) {
61124
- setProArmed(false);
61125
- setTurnOnPro(true);
61126
- } else {
61127
- setTurnOnPro(false);
61128
- }
61129
61306
  const flush = () => {
61130
61307
  if (!contentBuf.current && !reasoningBuf.current && !toolCallBuildBuf.current) return;
61131
- translator.flushBuffers(reasoningBuf.current, contentBuf.current, loop2.currentCallModel);
61308
+ translator.flushBuffers(reasoningBuf.current, contentBuf.current, loop2.model);
61132
61309
  streamRef.text += contentBuf.current;
61133
61310
  streamRef.reasoning += reasoningBuf.current;
61134
61311
  if (toolCallBuildBuf.current) {
@@ -61301,7 +61478,7 @@ ${answer}`, "brand");
61301
61478
  translator
61302
61479
  });
61303
61480
  } else if (ev.role === "warning") {
61304
- handleWarningEvent(ev, { log, setTurnOnPro });
61481
+ handleWarningEvent(ev, { log });
61305
61482
  }
61306
61483
  }
61307
61484
  flush();
@@ -61346,7 +61523,6 @@ ${answer}`, "brand");
61346
61523
  setBusy(false);
61347
61524
  submittingRef.current = false;
61348
61525
  qq.clearTurnReply();
61349
- setTurnOnPro(false);
61350
61526
  refreshBalance();
61351
61527
  }
61352
61528
  },
@@ -61384,7 +61560,7 @@ ${answer}`, "brand");
61384
61560
  sealCurrentEntry,
61385
61561
  editMode,
61386
61562
  editModeRef,
61387
- setEditMode,
61563
+ setEditModeLive,
61388
61564
  pendingEdits,
61389
61565
  syncPendingCount,
61390
61566
  reloadHooks,
@@ -61395,9 +61571,6 @@ ${answer}`, "brand");
61395
61571
  refreshBalance,
61396
61572
  refreshLatestVersion,
61397
61573
  refreshModels,
61398
- proArmed,
61399
- setProArmed,
61400
- setTurnOnPro,
61401
61574
  persistPlanState,
61402
61575
  stdout,
61403
61576
  stopLoop,
@@ -62178,46 +62351,30 @@ ${answer}`, "brand");
62178
62351
  models,
62179
62352
  current: loop2.model,
62180
62353
  currentEffort: loop2.reasoningEffort,
62181
- currentAutoEscalate: loop2.autoEscalate,
62182
62354
  onRefresh: refreshModels,
62183
62355
  onChoose: (outcome) => {
62184
62356
  setPendingModelPicker(false);
62185
62357
  if (outcome.kind === "select") {
62186
- loop2.configure({ model: outcome.id, autoEscalate: false });
62358
+ loop2.configure({ model: outcome.id });
62187
62359
  agentStore.dispatch({ type: "session.model.change", model: outcome.id });
62188
- const inferred = outcome.id === "deepseek-v4-pro" ? "pro" : outcome.id === "deepseek-v4-flash" ? "flash" : null;
62189
- setPreset(inferred ?? "flash");
62190
- agentStore.dispatch({
62191
- type: "session.preset.change",
62192
- preset: inferred
62193
- });
62194
- if (inferred) {
62195
- try {
62196
- savePreset(inferred);
62197
- } catch {
62198
- }
62360
+ try {
62361
+ saveModel(outcome.id);
62362
+ } catch {
62199
62363
  }
62200
62364
  log.pushInfo(`model: ${outcome.id}`);
62201
62365
  return;
62202
62366
  }
62203
- if (outcome.kind === "preset") {
62204
- const p = PRESETS[outcome.name];
62205
- loop2.configure({
62206
- model: p.model,
62207
- autoEscalate: p.autoEscalate,
62208
- reasoningEffort: p.reasoningEffort
62209
- });
62210
- agentStore.dispatch({ type: "session.model.change", model: p.model });
62211
- setPreset(outcome.name);
62367
+ if (outcome.kind === "effort") {
62368
+ loop2.configure({ reasoningEffort: outcome.effort });
62212
62369
  agentStore.dispatch({
62213
- type: "session.preset.change",
62214
- preset: outcome.name
62370
+ type: "session.effort.change",
62371
+ reasoningEffort: outcome.effort
62215
62372
  });
62216
62373
  try {
62217
- savePreset(outcome.name);
62374
+ saveReasoningEffort(outcome.effort);
62218
62375
  } catch {
62219
62376
  }
62220
- log.pushInfo(`preset: ${outcome.name} - ${p.model}`);
62377
+ log.pushInfo(`effort: ${outcome.effort}`);
62221
62378
  }
62222
62379
  }
62223
62380
  }
@@ -62305,10 +62462,10 @@ ${answer}`, "brand");
62305
62462
  {
62306
62463
  block: pendingEditReview,
62307
62464
  onChoose: (choice, denyContext) => {
62308
- const resolve4 = editReviewResolveRef.current;
62309
- if (resolve4) {
62465
+ const resolve5 = editReviewResolveRef.current;
62466
+ if (resolve5) {
62310
62467
  editReviewResolveRef.current = null;
62311
- resolve4({ choice, denyContext });
62468
+ resolve5({ choice, denyContext });
62312
62469
  }
62313
62470
  }
62314
62471
  }
@@ -62332,7 +62489,7 @@ ${answer}`, "brand");
62332
62489
  statusBar,
62333
62490
  showShortcuts: pendingShortcuts,
62334
62491
  mode: editMode === "yolo" ? t("statsPanel.modeYolo") : editMode === "auto" ? t("statsPanel.modeAuto") : editMode === "review" ? t("statsPanel.modeReview") : editMode,
62335
- model: (sessionPreset ? `${sessionPreset.charAt(0).toUpperCase() + sessionPreset.slice(1)} \xB7 ` : "") + (sessionModel === "deepseek-v4-pro" ? "Deepseek v4 pro" : sessionModel === "deepseek-v4-flash" ? "Deepseek v4 flash" : sessionModel),
62492
+ model: `${sessionModel} \xB7 ${sessionEffort ?? loop2.reasoningEffort}`,
62336
62493
  input,
62337
62494
  setInput,
62338
62495
  busy,
@@ -62342,6 +62499,7 @@ ${answer}`, "brand");
62342
62499
  onHistoryNext: handleHistoryNext,
62343
62500
  onOpenExternalEditor: handleOpenExternalEditor,
62344
62501
  onCursorChange: setComposerCursor,
62502
+ isHistoryMode,
62345
62503
  slashMatches,
62346
62504
  slashSelected,
62347
62505
  slashGroupMode,
@@ -62452,7 +62610,7 @@ async function drainTtyResponses(timeoutMs = 50) {
62452
62610
  return;
62453
62611
  }
62454
62612
  stdin.resume();
62455
- await new Promise((resolve4) => {
62613
+ await new Promise((resolve5) => {
62456
62614
  const onData = (_chunk) => {
62457
62615
  };
62458
62616
  stdin.on("data", onData);
@@ -62465,7 +62623,7 @@ async function drainTtyResponses(timeoutMs = 50) {
62465
62623
  } catch {
62466
62624
  }
62467
62625
  }
62468
- resolve4();
62626
+ resolve5();
62469
62627
  }, timeoutMs);
62470
62628
  timer.unref();
62471
62629
  });
@@ -62478,7 +62636,7 @@ function readMode() {
62478
62636
  if (raw === "alternate-scroll") return "alternate-scroll";
62479
62637
  return "off";
62480
62638
  }
62481
- var RESET_ALL = "\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1007l\x1B[?1015l";
62639
+ var RESET_ALL = "\x1B[?9l\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1005l\x1B[?1006l\x1B[?1007l\x1B[?1015l";
62482
62640
  var SEQUENCES = {
62483
62641
  "alternate-scroll": { enable: "\x1B[?1007h", disable: "\x1B[?1007l" },
62484
62642
  sgr: { enable: "\x1B[?1000h\x1B[?1006h", disable: "\x1B[?1006l\x1B[?1000l" },
@@ -62571,13 +62729,13 @@ function Root({
62571
62729
  Setup,
62572
62730
  {
62573
62731
  onReady: (k) => {
62574
- process.env.DEEPSEEK_API_KEY = k;
62732
+ bridgeEndpointEnv();
62575
62733
  setKey(k);
62576
62734
  }
62577
62735
  }
62578
62736
  ));
62579
62737
  }
62580
- process.env.DEEPSEEK_API_KEY = key;
62738
+ bridgeEndpointEnv();
62581
62739
  if (pickerOpen) {
62582
62740
  return /* @__PURE__ */ import_react93.default.createElement(KeystrokeProvider, null, /* @__PURE__ */ import_react93.default.createElement(
62583
62741
  SessionPicker,
@@ -62620,8 +62778,7 @@ function Root({
62620
62778
  {
62621
62779
  key: activeSession ?? "__new__",
62622
62780
  model: appProps.model,
62623
- preset: appProps.preset,
62624
- autoEscalate: appProps.autoEscalate,
62781
+ reasoningEffort: appProps.reasoningEffort,
62625
62782
  system: appProps.system,
62626
62783
  rebuildSystem: appProps.rebuildSystem,
62627
62784
  transcript: appProps.transcript,
@@ -62657,10 +62814,20 @@ async function chatCommand(opts) {
62657
62814
  if (requestedSpecs.length > 0 && !tools) {
62658
62815
  tools = new ToolRegistry({ rateLimit: loadToolRateLimit() });
62659
62816
  }
62817
+ const launchWorkspace = opts.codeMode?.rootDir ?? process.cwd();
62818
+ let activeWorkspace = launchWorkspace;
62819
+ const codeMode = opts.codeMode ? {
62820
+ ...opts.codeMode,
62821
+ onRootChange: (newRoot) => {
62822
+ activeWorkspace = newRoot;
62823
+ opts.codeMode?.onRootChange?.(newRoot);
62824
+ }
62825
+ } : void 0;
62660
62826
  const runtime = createMcpRuntime({
62661
62827
  getTools: () => tools,
62662
62828
  getMcpPrefix: () => opts.mcpPrefix,
62663
62829
  getRequestedCount: () => requestedSpecs.length,
62830
+ getWorkspaceDir: () => activeWorkspace,
62664
62831
  progressSink
62665
62832
  });
62666
62833
  const mcpSpecs = [...requestedSpecs];
@@ -62687,7 +62854,6 @@ async function chatCommand(opts) {
62687
62854
  opts.forceNew,
62688
62855
  opts.forceResume
62689
62856
  );
62690
- const launchWorkspace = opts.codeMode?.rootDir ?? process.cwd();
62691
62857
  const showPicker = !opts.session && !opts.forceResume && listSessionsForWorkspace(launchWorkspace).length > 0;
62692
62858
  markPhase("ink_render_call");
62693
62859
  const qqSubmitRef = { current: null };
@@ -62735,6 +62901,7 @@ async function chatCommand(opts) {
62735
62901
  startupInfoHints,
62736
62902
  showPicker,
62737
62903
  ...opts,
62904
+ codeMode,
62738
62905
  session: resolvedSession,
62739
62906
  qqChannel,
62740
62907
  qqSubmitRef,
@@ -62756,4 +62923,4 @@ async function chatCommand(opts) {
62756
62923
  export {
62757
62924
  chatCommand
62758
62925
  };
62759
- //# sourceMappingURL=chunk-QF32ROX2.js.map
62926
+ //# sourceMappingURL=chunk-3KRRTLC5.js.map