@caspian2026/agent-sdk 0.0.2

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 (371) hide show
  1. package/dist/chunk-018smjq7.js +26 -0
  2. package/dist/chunk-055q0a2m.js +146 -0
  3. package/dist/chunk-07069jq1.js +30 -0
  4. package/dist/chunk-0731m51q.js +8 -0
  5. package/dist/chunk-0awwmrwr.js +46 -0
  6. package/dist/chunk-0htx82k2.js +64 -0
  7. package/dist/chunk-0jmt5sx1.js +104 -0
  8. package/dist/chunk-0kj8bq80.js +252 -0
  9. package/dist/chunk-0kxcq8h9.js +86 -0
  10. package/dist/chunk-0paqc2yw.js +15 -0
  11. package/dist/chunk-0vkfrmqm.js +690 -0
  12. package/dist/chunk-0xjaqda8.js +1124 -0
  13. package/dist/chunk-10qhq6f8.js +458 -0
  14. package/dist/chunk-15m49c67.js +121 -0
  15. package/dist/chunk-15sfg4bs.js +65 -0
  16. package/dist/chunk-162ewhvy.js +869 -0
  17. package/dist/chunk-177s15bv.js +120 -0
  18. package/dist/chunk-19e603rv.js +284 -0
  19. package/dist/chunk-1ax1znzj.js +537 -0
  20. package/dist/chunk-1c4j7qn2.js +319 -0
  21. package/dist/chunk-1gx78081.js +66 -0
  22. package/dist/chunk-1h2famwb.js +49 -0
  23. package/dist/chunk-1nk93fqz.js +357 -0
  24. package/dist/chunk-1xct96nd.js +2520 -0
  25. package/dist/chunk-1xvcvdef.js +90 -0
  26. package/dist/chunk-1yrcnrs7.js +261 -0
  27. package/dist/chunk-21bcvwr7.js +660 -0
  28. package/dist/chunk-2352ts05.js +667 -0
  29. package/dist/chunk-23jzrwsw.js +43 -0
  30. package/dist/chunk-26hg7303.js +62 -0
  31. package/dist/chunk-2f21meep.js +122 -0
  32. package/dist/chunk-2fwze72g.js +24 -0
  33. package/dist/chunk-2gzv8nrw.js +205 -0
  34. package/dist/chunk-2h05vtpv.js +83 -0
  35. package/dist/chunk-2h0y6m16.js +465 -0
  36. package/dist/chunk-2n7bbxm6.js +168 -0
  37. package/dist/chunk-2nv3d0he.js +108 -0
  38. package/dist/chunk-2vqrdwx9.js +1811 -0
  39. package/dist/chunk-3389cj3w.js +120 -0
  40. package/dist/chunk-35sgv3er.js +231 -0
  41. package/dist/chunk-3c25bcsw.js +17 -0
  42. package/dist/chunk-3e20cj49.js +443 -0
  43. package/dist/chunk-3mr5ryx4.js +122 -0
  44. package/dist/chunk-3nk79af8.js +8 -0
  45. package/dist/chunk-3qbdzsvm.js +120 -0
  46. package/dist/chunk-3yprydpw.js +213 -0
  47. package/dist/chunk-430yrtmk.js +492 -0
  48. package/dist/chunk-46hd1gyd.js +140 -0
  49. package/dist/chunk-46hdszda.js +63 -0
  50. package/dist/chunk-46n7byh8.js +102 -0
  51. package/dist/chunk-4cp6193g.js +9076 -0
  52. package/dist/chunk-4dn3n459.js +409 -0
  53. package/dist/chunk-4hv90qcz.js +8 -0
  54. package/dist/chunk-4jm600zv.js +13 -0
  55. package/dist/chunk-4nspekjp.js +69 -0
  56. package/dist/chunk-505mxxa9.js +19 -0
  57. package/dist/chunk-50bay5qy.js +224 -0
  58. package/dist/chunk-537qfvn5.js +345 -0
  59. package/dist/chunk-55raexh7.js +14358 -0
  60. package/dist/chunk-572vjq78.js +56 -0
  61. package/dist/chunk-5apfzkpy.js +87 -0
  62. package/dist/chunk-5ccdsxgy.js +74 -0
  63. package/dist/chunk-5dmhsqap.js +32 -0
  64. package/dist/chunk-5fs6nkjr.js +98 -0
  65. package/dist/chunk-5nchekqe.js +87 -0
  66. package/dist/chunk-5pp28k2r.js +120 -0
  67. package/dist/chunk-5rt4b8q9.js +116 -0
  68. package/dist/chunk-5rv9c8yd.js +1072 -0
  69. package/dist/chunk-5z28bqne.js +6748 -0
  70. package/dist/chunk-64c1avct.js +13 -0
  71. package/dist/chunk-66zry909.js +11 -0
  72. package/dist/chunk-682qgta2.js +102 -0
  73. package/dist/chunk-68ffk5qa.js +14 -0
  74. package/dist/chunk-68w91pzt.js +79 -0
  75. package/dist/chunk-69fgaak0.js +654 -0
  76. package/dist/chunk-69n11zng.js +436 -0
  77. package/dist/chunk-6dj5t602.js +341 -0
  78. package/dist/chunk-6gh20s05.js +146 -0
  79. package/dist/chunk-6maej1hh.js +502 -0
  80. package/dist/chunk-6nsd9606.js +790 -0
  81. package/dist/chunk-6p4cyhb3.js +16 -0
  82. package/dist/chunk-6t4a9cgj.js +877 -0
  83. package/dist/chunk-6t8yqfks.js +227 -0
  84. package/dist/chunk-6vthy0fj.js +213 -0
  85. package/dist/chunk-70cw4cg9.js +1026 -0
  86. package/dist/chunk-70eey1nh.js +164 -0
  87. package/dist/chunk-76j2e9vy.js +68 -0
  88. package/dist/chunk-7acgdm7x.js +93 -0
  89. package/dist/chunk-7aw745vx.js +40175 -0
  90. package/dist/chunk-7gvwg1v9.js +122 -0
  91. package/dist/chunk-7h2ybnf3.js +636 -0
  92. package/dist/chunk-7kcm5hn2.js +155 -0
  93. package/dist/chunk-7m2hp89m.js +73 -0
  94. package/dist/chunk-7mqab3z7.js +31 -0
  95. package/dist/chunk-7sgtxrsc.js +1059 -0
  96. package/dist/chunk-7wm5s02e.js +216 -0
  97. package/dist/chunk-7xyswgjh.js +8 -0
  98. package/dist/chunk-7yxvpj5j.js +1452 -0
  99. package/dist/chunk-80a8vabn.js +93 -0
  100. package/dist/chunk-83e71kz6.js +180 -0
  101. package/dist/chunk-83hfzbx3.js +10 -0
  102. package/dist/chunk-8g5pe1gr.js +37 -0
  103. package/dist/chunk-8g747a8x.js +26 -0
  104. package/dist/chunk-8hj8ms5q.js +111 -0
  105. package/dist/chunk-8mkwsdk1.js +61 -0
  106. package/dist/chunk-8n42zyfx.js +40 -0
  107. package/dist/chunk-8qhxyqj9.js +1155 -0
  108. package/dist/chunk-8y30k9pz.js +38 -0
  109. package/dist/chunk-960ze3jj.js +124 -0
  110. package/dist/chunk-97wgdsab.js +35 -0
  111. package/dist/chunk-9grztvcg.js +93 -0
  112. package/dist/chunk-9x5zgy22.js +12 -0
  113. package/dist/chunk-a8792r1c.js +620 -0
  114. package/dist/chunk-ahr1r7c6.js +4275 -0
  115. package/dist/chunk-ase86y73.js +15 -0
  116. package/dist/chunk-b0kf00ff.js +637 -0
  117. package/dist/chunk-b0qptb1k.js +640 -0
  118. package/dist/chunk-b1kcd3ss.js +27 -0
  119. package/dist/chunk-b2fd462a.js +54 -0
  120. package/dist/chunk-bdrjvs5k.js +157 -0
  121. package/dist/chunk-beg7bdyz.js +90 -0
  122. package/dist/chunk-bg4x9ex0.js +21 -0
  123. package/dist/chunk-bktfq0ns.js +95 -0
  124. package/dist/chunk-bmbq6nt1.js +145 -0
  125. package/dist/chunk-bvf2z3g6.js +1003 -0
  126. package/dist/chunk-bxcfz5gy.js +56 -0
  127. package/dist/chunk-c11swzas.js +5368 -0
  128. package/dist/chunk-c37j5zxe.js +57 -0
  129. package/dist/chunk-c5mz5vw2.js +117 -0
  130. package/dist/chunk-c6sjhj89.js +1284 -0
  131. package/dist/chunk-c7jwbe76.js +29030 -0
  132. package/dist/chunk-cc2tg4q8.js +311 -0
  133. package/dist/chunk-cdhmrbj4.js +6353 -0
  134. package/dist/chunk-cdz5yb0r.js +57 -0
  135. package/dist/chunk-cfv996bs.js +22 -0
  136. package/dist/chunk-cgfdkzhb.js +12 -0
  137. package/dist/chunk-chakj069.js +310 -0
  138. package/dist/chunk-chsyvavm.js +3435 -0
  139. package/dist/chunk-cnsj3vq2.js +35 -0
  140. package/dist/chunk-ctdg0qxh.js +1386 -0
  141. package/dist/chunk-cxq7gc42.js +386 -0
  142. package/dist/chunk-d1pyf9as.js +8586 -0
  143. package/dist/chunk-d4kwjqjy.js +308 -0
  144. package/dist/chunk-d4mdda98.js +94 -0
  145. package/dist/chunk-d7886r6a.js +13870 -0
  146. package/dist/chunk-d7f1pzkq.js +95 -0
  147. package/dist/chunk-ddsjkqs4.js +39 -0
  148. package/dist/chunk-dm3n2qgd.js +24 -0
  149. package/dist/chunk-e2mv8ts8.js +115 -0
  150. package/dist/chunk-e4bhfc6d.js +2720 -0
  151. package/dist/chunk-e4p1jbs4.js +58 -0
  152. package/dist/chunk-e7h4qxgw.js +21 -0
  153. package/dist/chunk-e8p3fy6v.js +202 -0
  154. package/dist/chunk-e97mp86b.js +111 -0
  155. package/dist/chunk-ebqwkhyf.js +145 -0
  156. package/dist/chunk-eenq3avg.js +69 -0
  157. package/dist/chunk-efgjfast.js +61 -0
  158. package/dist/chunk-ehtwnxpg.js +1591 -0
  159. package/dist/chunk-en8wkxh7.js +173 -0
  160. package/dist/chunk-enkdxqas.js +33 -0
  161. package/dist/chunk-eqp1rfft.js +17 -0
  162. package/dist/chunk-ercvcek8.js +266 -0
  163. package/dist/chunk-etgh9xvt.js +369 -0
  164. package/dist/chunk-ev3qkf76.js +106 -0
  165. package/dist/chunk-evp5pb9x.js +3567 -0
  166. package/dist/chunk-ewadzrm8.js +103 -0
  167. package/dist/chunk-exah13mz.js +94 -0
  168. package/dist/chunk-f0rzvqmq.js +87 -0
  169. package/dist/chunk-f1m9pect.js +258 -0
  170. package/dist/chunk-fajg8x36.js +8158 -0
  171. package/dist/chunk-fbv4apne.js +51 -0
  172. package/dist/chunk-fbvw6wq9.js +116 -0
  173. package/dist/chunk-feyzykye.js +10 -0
  174. package/dist/chunk-fn1vvj8k.js +894 -0
  175. package/dist/chunk-fshfxw2q.js +183 -0
  176. package/dist/chunk-fyc5fepv.js +10 -0
  177. package/dist/chunk-g9f19ttm.js +15 -0
  178. package/dist/chunk-gcpfxk0c.js +644 -0
  179. package/dist/chunk-gdg6411p.js +106 -0
  180. package/dist/chunk-gkyzz8er.js +849 -0
  181. package/dist/chunk-gxahdggv.js +71 -0
  182. package/dist/chunk-h6fsks9j.js +220 -0
  183. package/dist/chunk-h9n54swm.js +27 -0
  184. package/dist/chunk-hakdhagh.js +16606 -0
  185. package/dist/chunk-hchy0hq6.js +159 -0
  186. package/dist/chunk-hh3k5s1s.js +180 -0
  187. package/dist/chunk-hqqkj5pg.js +202 -0
  188. package/dist/chunk-htpehq9t.js +251 -0
  189. package/dist/chunk-hwfknpxv.js +39 -0
  190. package/dist/chunk-hwn8vetn.js +394 -0
  191. package/dist/chunk-hx3j6n92.js +178 -0
  192. package/dist/chunk-hyb749hd.js +194 -0
  193. package/dist/chunk-hzgnejb1.js +90 -0
  194. package/dist/chunk-hzknr99c.js +477 -0
  195. package/dist/chunk-j3zhb8vv.js +152 -0
  196. package/dist/chunk-j5bth84e.js +97 -0
  197. package/dist/chunk-j64ga6ta.js +8035 -0
  198. package/dist/chunk-jaaxk89e.js +113 -0
  199. package/dist/chunk-jd32zbps.js +15 -0
  200. package/dist/chunk-jfja8q7w.js +91 -0
  201. package/dist/chunk-jgjqa49s.js +27 -0
  202. package/dist/chunk-jgpmpgx6.js +19 -0
  203. package/dist/chunk-jgwd85hp.js +91 -0
  204. package/dist/chunk-jk69qtzx.js +277 -0
  205. package/dist/chunk-jr1xm1dd.js +147 -0
  206. package/dist/chunk-jss0azv7.js +2337 -0
  207. package/dist/chunk-jxpmkae9.js +108 -0
  208. package/dist/chunk-jy9rxxqe.js +102 -0
  209. package/dist/chunk-jyw3np47.js +264 -0
  210. package/dist/chunk-jzthz1bx.js +15 -0
  211. package/dist/chunk-k0p9w03v.js +4957 -0
  212. package/dist/chunk-k2rybwww.js +92 -0
  213. package/dist/chunk-k3939ggz.js +168 -0
  214. package/dist/chunk-k591cwbg.js +345 -0
  215. package/dist/chunk-k5ez1h65.js +108 -0
  216. package/dist/chunk-k8vp0atq.js +2331 -0
  217. package/dist/chunk-kajf3jgq.js +694 -0
  218. package/dist/chunk-kbm69rtz.js +276 -0
  219. package/dist/chunk-kjh11txh.js +419 -0
  220. package/dist/chunk-kqggbte3.js +326 -0
  221. package/dist/chunk-kr6qfwq0.js +95 -0
  222. package/dist/chunk-kvfg8eeg.js +150 -0
  223. package/dist/chunk-kwekc97v.js +18 -0
  224. package/dist/chunk-m1cehfta.js +861 -0
  225. package/dist/chunk-m87bhhqv.js +61 -0
  226. package/dist/chunk-mg7pbk0r.js +151 -0
  227. package/dist/chunk-mpbfkp8j.js +418 -0
  228. package/dist/chunk-mpk1sjyk.js +117 -0
  229. package/dist/chunk-msecaxyj.js +74 -0
  230. package/dist/chunk-mswx2nma.js +103 -0
  231. package/dist/chunk-mw1kpeg9.js +6895 -0
  232. package/dist/chunk-mxr2s6d1.js +89 -0
  233. package/dist/chunk-my40g5hp.js +560 -0
  234. package/dist/chunk-n0kmh4ra.js +338 -0
  235. package/dist/chunk-n18q5yqs.js +397 -0
  236. package/dist/chunk-n7pnyq43.js +131 -0
  237. package/dist/chunk-naybw0p0.js +32 -0
  238. package/dist/chunk-nb6abcch.js +83 -0
  239. package/dist/chunk-ne5r3k03.js +350 -0
  240. package/dist/chunk-nebezy1d.js +997 -0
  241. package/dist/chunk-netzwgv1.js +154 -0
  242. package/dist/chunk-nhapyawz.js +32994 -0
  243. package/dist/chunk-npnvheft.js +156 -0
  244. package/dist/chunk-nrtksr2p.js +51 -0
  245. package/dist/chunk-nw9t5pq9.js +132 -0
  246. package/dist/chunk-nxgsnh2y.js +735 -0
  247. package/dist/chunk-p11xp4xp.js +266 -0
  248. package/dist/chunk-p1hwrf72.js +74 -0
  249. package/dist/chunk-p1zj9mg9.js +567 -0
  250. package/dist/chunk-p39a677r.js +115 -0
  251. package/dist/chunk-p7vkh4wx.js +15 -0
  252. package/dist/chunk-p8na2wwp.js +14 -0
  253. package/dist/chunk-pcb7fbyg.js +259 -0
  254. package/dist/chunk-pckwmrzd.js +409 -0
  255. package/dist/chunk-ped973jn.js +111 -0
  256. package/dist/chunk-phd1qfpc.js +5971 -0
  257. package/dist/chunk-pkkngdv0.js +524 -0
  258. package/dist/chunk-ppwjyveh.js +8 -0
  259. package/dist/chunk-pqvr8jq7.js +324 -0
  260. package/dist/chunk-prcah3ys.js +106 -0
  261. package/dist/chunk-ps49ymvj.js +43 -0
  262. package/dist/chunk-pwwa7s62.js +11 -0
  263. package/dist/chunk-pxdzy0jh.js +134 -0
  264. package/dist/chunk-q3jr5t07.js +62 -0
  265. package/dist/chunk-q6cfkntd.js +675 -0
  266. package/dist/chunk-q6m26rc8.js +88 -0
  267. package/dist/chunk-q6xs51jj.js +332 -0
  268. package/dist/chunk-q7jnesv8.js +74 -0
  269. package/dist/chunk-q7zpf4r2.js +440 -0
  270. package/dist/chunk-q8c88vjm.js +24 -0
  271. package/dist/chunk-qajrkk97.js +298 -0
  272. package/dist/chunk-qatfdxvd.js +34 -0
  273. package/dist/chunk-qb6k2afy.js +153 -0
  274. package/dist/chunk-qfk94vcn.js +329 -0
  275. package/dist/chunk-qj2e1apf.js +471 -0
  276. package/dist/chunk-qj2mk79w.js +111 -0
  277. package/dist/chunk-qk7dfae6.js +267 -0
  278. package/dist/chunk-qnfx3qtx.js +617 -0
  279. package/dist/chunk-qp2qdcda.js +100 -0
  280. package/dist/chunk-qq0phwn8.js +458 -0
  281. package/dist/chunk-qwqjesx7.js +258 -0
  282. package/dist/chunk-qygmcg7w.js +60 -0
  283. package/dist/chunk-qz2x630m.js +49145 -0
  284. package/dist/chunk-qzj4e8fn.js +357 -0
  285. package/dist/chunk-ratvcbmn.js +255 -0
  286. package/dist/chunk-rkg741k3.js +37 -0
  287. package/dist/chunk-rn0v1hk8.js +34 -0
  288. package/dist/chunk-rsq0h0rz.js +91 -0
  289. package/dist/chunk-rvnb2gn6.js +1053 -0
  290. package/dist/chunk-rx278zpa.js +75 -0
  291. package/dist/chunk-s3hsqf80.js +473 -0
  292. package/dist/chunk-s4cb0bcb.js +655 -0
  293. package/dist/chunk-s8kj6ajy.js +32 -0
  294. package/dist/chunk-sd36yzx8.js +954 -0
  295. package/dist/chunk-sfcpjh4r.js +98 -0
  296. package/dist/chunk-spybh2dy.js +175 -0
  297. package/dist/chunk-sw9ax3ym.js +92 -0
  298. package/dist/chunk-szj5wvdy.js +28 -0
  299. package/dist/chunk-t29a6zb5.js +45 -0
  300. package/dist/chunk-t9p85zff.js +24 -0
  301. package/dist/chunk-tc1aazk4.js +131 -0
  302. package/dist/chunk-tdbz9gbm.js +1030 -0
  303. package/dist/chunk-tjcfpk38.js +208 -0
  304. package/dist/chunk-tp2jxmcx.js +8427 -0
  305. package/dist/chunk-tqmtkm0k.js +92 -0
  306. package/dist/chunk-tvgvt220.js +22820 -0
  307. package/dist/chunk-v0qraze5.js +291 -0
  308. package/dist/chunk-v1kzp02e.js +785 -0
  309. package/dist/chunk-v78fj8by.js +145 -0
  310. package/dist/chunk-v8g3kad0.js +101 -0
  311. package/dist/chunk-v9smspw2.js +4301 -0
  312. package/dist/chunk-vawgyev5.js +157 -0
  313. package/dist/chunk-vb3x3cxe.js +375 -0
  314. package/dist/chunk-vf612n57.js +472 -0
  315. package/dist/chunk-vjn8mbcw.js +198 -0
  316. package/dist/chunk-vmbfv1y5.js +295 -0
  317. package/dist/chunk-vrf54kmt.js +321 -0
  318. package/dist/chunk-vyjeh50y.js +2149 -0
  319. package/dist/chunk-vzgkedm9.js +159745 -0
  320. package/dist/chunk-w004kfw0.js +245 -0
  321. package/dist/chunk-w0yhbmxn.js +132 -0
  322. package/dist/chunk-w4yn8cq7.js +123 -0
  323. package/dist/chunk-waqwgprq.js +1164 -0
  324. package/dist/chunk-wayfjcwt.js +447 -0
  325. package/dist/chunk-wby6yd4m.js +91 -0
  326. package/dist/chunk-wha6v7za.js +705 -0
  327. package/dist/chunk-wjcq2vkf.js +641 -0
  328. package/dist/chunk-wtjt9qyk.js +2670 -0
  329. package/dist/chunk-x2pvw7xw.js +42 -0
  330. package/dist/chunk-x6r4v44b.js +8 -0
  331. package/dist/chunk-x8d2ehd7.js +19 -0
  332. package/dist/chunk-xd6kmmb1.js +95 -0
  333. package/dist/chunk-xp61y5ba.js +125 -0
  334. package/dist/chunk-xv3era3s.js +8 -0
  335. package/dist/chunk-xxw9a0bq.js +58 -0
  336. package/dist/chunk-xzhaa7gd.js +112 -0
  337. package/dist/chunk-y1784krc.js +19 -0
  338. package/dist/chunk-y4ca9kqz.js +3830 -0
  339. package/dist/chunk-yff68ex1.js +113 -0
  340. package/dist/chunk-yg4vgpxs.js +436 -0
  341. package/dist/chunk-yk62vxj2.js +2964 -0
  342. package/dist/chunk-ym5r3jnk.js +2007 -0
  343. package/dist/chunk-ysanv95x.js +225 -0
  344. package/dist/chunk-yvtzznds.js +63 -0
  345. package/dist/chunk-yyex5gsf.js +269 -0
  346. package/dist/chunk-yyf72f78.js +456 -0
  347. package/dist/chunk-z19sd3bt.js +1648 -0
  348. package/dist/chunk-z2dp53wn.js +17 -0
  349. package/dist/chunk-z9n0183s.js +39 -0
  350. package/dist/chunk-zb8f6h5g.js +9174 -0
  351. package/dist/chunk-zctfbr1v.js +594 -0
  352. package/dist/chunk-zesnmkg3.js +2840 -0
  353. package/dist/chunk-zf47r1b7.js +94 -0
  354. package/dist/chunk-zghtdbat.js +253 -0
  355. package/dist/chunk-zpmwvd09.js +275 -0
  356. package/dist/chunk-zqncgyf6.js +127 -0
  357. package/dist/chunk-zr6mz36s.js +281 -0
  358. package/dist/chunk-zshzdw1n.js +141 -0
  359. package/dist/chunk-zx5kw7z4.js +40 -0
  360. package/dist/chunk-zzm33q8x.js +8 -0
  361. package/dist/cli.js +91 -0
  362. package/dist/download-ripgrep.js +24821 -0
  363. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  364. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  365. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  366. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  367. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  368. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  369. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  370. package/package.json +122 -0
  371. package/scripts/postinstall.cjs +319 -0
@@ -0,0 +1,4275 @@
1
+ // @bun
2
+ import {
3
+ calculateLayoutDimensions,
4
+ calculateOptimalLeftWidth,
5
+ formatModelAndBilling,
6
+ formatWelcomeMessage,
7
+ getLayoutMode,
8
+ getLogoDisplayData,
9
+ getRecentActivitySync,
10
+ getRecentReleaseNotesSync,
11
+ init_logoV2Utils,
12
+ truncatePath
13
+ } from "./chunk-35sgv3er.js";
14
+ import {
15
+ init_systemTheme,
16
+ resolveThemeSetting
17
+ } from "./chunk-cnsj3vq2.js";
18
+ import {
19
+ checkForReleaseNotesSync,
20
+ init_releaseNotes
21
+ } from "./chunk-ysanv95x.js";
22
+ import {
23
+ OverageCreditUpsell,
24
+ createOverageCreditFeed,
25
+ incrementOverageCreditUpsellSeenCount,
26
+ init_OverageCreditUpsell,
27
+ useShowOverageCreditUpsell
28
+ } from "./chunk-055q0a2m.js";
29
+ import {
30
+ AGENT_DESCRIPTIONS_THRESHOLD,
31
+ getAgentDescriptionsTotalTokens,
32
+ init_statusNoticeHelpers
33
+ } from "./chunk-q8c88vjm.js";
34
+ import {
35
+ PromptInputFooterSuggestions_default,
36
+ init_PromptInputFooterSuggestions
37
+ } from "./chunk-mg7pbk0r.js";
38
+ import {
39
+ ModalContext,
40
+ init_modalContext
41
+ } from "./chunk-t9p85zff.js";
42
+ import {
43
+ init_useMainLoopModel,
44
+ useMainLoopModel
45
+ } from "./chunk-8y30k9pz.js";
46
+ import {
47
+ AssistantThinkingMessage,
48
+ BACKGROUND_BASH_SUMMARY_PREFIX,
49
+ EMPTY_STRING_SET,
50
+ INTERRUPT_MESSAGE,
51
+ INTERRUPT_MESSAGE_FOR_TOOL_USE,
52
+ InVirtualListContext,
53
+ MAX_MEMORY_CHARACTER_COUNT,
54
+ Message,
55
+ MessageActionsSelectedContext,
56
+ OffscreenFreeze,
57
+ SandboxManager,
58
+ StreamingMarkdown,
59
+ buildMessageLookups,
60
+ collapseReadSearchGroups,
61
+ createAssistantMessage,
62
+ deriveUUID,
63
+ extractTag,
64
+ findToolByName,
65
+ getDisplayMessageFromCollapsed,
66
+ getDumpPromptsPath,
67
+ getEffortSuffix,
68
+ getLargeMemoryFiles,
69
+ getMemoryFiles,
70
+ getMessagesAfterCompactBoundary,
71
+ getProgressMessagesFromLookup,
72
+ getSiblingToolUseIDsFromLookup,
73
+ getTerminalIdeType,
74
+ getToolSearchOrReadInfo,
75
+ getToolUseID,
76
+ getToolUseIDs,
77
+ getToolUseIdsFromCollapsedGroup,
78
+ hasAnyToolInProgress,
79
+ hasThinkingContent,
80
+ hasUnresolvedHooksFromLookup,
81
+ hueToRgb,
82
+ init_AppState,
83
+ init_AssistantThinkingMessage,
84
+ init_LocalShellTask,
85
+ init_Markdown,
86
+ init_Message,
87
+ init_OffscreenFreeze,
88
+ init_ThemedText,
89
+ init_Tool,
90
+ init_advisor,
91
+ init_claudemd,
92
+ init_collapseReadSearch,
93
+ init_dumpPrompts,
94
+ init_effort,
95
+ init_fullscreen,
96
+ init_ide,
97
+ init_jetbrains,
98
+ init_messageActions,
99
+ init_messages1 as init_messages,
100
+ init_sandbox_adapter,
101
+ init_useShortcutDisplay,
102
+ init_useTerminalSize,
103
+ init_utils1 as init_utils,
104
+ isAdvisorBlock,
105
+ isFullscreenEnvEnabled,
106
+ isJetBrainsPluginInstalledCachedSync,
107
+ isNavigableMessage,
108
+ isNotEmptyMessage,
109
+ isSupportedJetBrainsTerminal,
110
+ normalizeMessages,
111
+ reorderMessagesInUI,
112
+ shouldShowUserMessage,
113
+ stripSystemReminders,
114
+ toIDEDisplayName,
115
+ toRGBColor,
116
+ toolCallOf,
117
+ useAppState,
118
+ useShortcutDisplay
119
+ } from "./chunk-vzgkedm9.js";
120
+ import {
121
+ checkCachedPassesEligibility,
122
+ formatCreditAmount,
123
+ getCachedReferrerReward,
124
+ getCachedRemainingPasses,
125
+ init_referral
126
+ } from "./chunk-kbm69rtz.js";
127
+ import {
128
+ getSteps,
129
+ incrementProjectOnboardingSeenCount,
130
+ init_projectOnboardingState,
131
+ shouldShowProjectOnboarding
132
+ } from "./chunk-nxgsnh2y.js";
133
+ import {
134
+ init_browser,
135
+ openBrowser,
136
+ openPath
137
+ } from "./chunk-m87bhhqv.js";
138
+ import {
139
+ BLACK_CIRCLE,
140
+ TEARDROP_ASTERISK,
141
+ UP_ARROW,
142
+ exports_prompt,
143
+ getAnthropicApiKeyWithSource,
144
+ getApiKeyFromConfigOrMacOSKeychain,
145
+ getAuthTokenSource,
146
+ getDisplayPath,
147
+ getDynamicConfig_CACHED_MAY_BE_STALE,
148
+ getGlobalConfig,
149
+ getInitialSettings,
150
+ init_auth,
151
+ init_config,
152
+ init_figures as init_figures2,
153
+ init_file,
154
+ init_growthbook,
155
+ init_model,
156
+ init_prompt1 as init_prompt,
157
+ init_settings1 as init_settings,
158
+ init_stringUtils,
159
+ isClaudeAISubscriber,
160
+ isOpus1mMergeEnabled,
161
+ plural,
162
+ renderModelSetting,
163
+ saveGlobalConfig
164
+ } from "./chunk-tp2jxmcx.js";
165
+ import {
166
+ init_sleep,
167
+ sleep
168
+ } from "./chunk-8g5pe1gr.js";
169
+ import {
170
+ env,
171
+ init_env
172
+ } from "./chunk-s3hsqf80.js";
173
+ import {
174
+ formatNumber,
175
+ formatRelativeTimeAgo,
176
+ getStartupPerfLogPath,
177
+ init_format,
178
+ init_startupProfiler,
179
+ isDetailedProfilingEnabled,
180
+ truncate
181
+ } from "./chunk-yyf72f78.js";
182
+ import {
183
+ Divider,
184
+ ScrollBox_default,
185
+ TextHoverColorContext,
186
+ ThemedBox_default,
187
+ ThemedText,
188
+ color,
189
+ init_source,
190
+ init_src,
191
+ instances_default,
192
+ source_default,
193
+ stringWidth,
194
+ useAnimationFrame,
195
+ useTerminalNotification,
196
+ useTerminalSize
197
+ } from "./chunk-c7jwbe76.js";
198
+ import {
199
+ require_jsx_dev_runtime,
200
+ require_react
201
+ } from "./chunk-7sgtxrsc.js";
202
+ import {
203
+ init_analytics,
204
+ logEvent
205
+ } from "./chunk-x8d2ehd7.js";
206
+ import {
207
+ STATUS_TAG,
208
+ SUMMARY_TAG,
209
+ TASK_NOTIFICATION_TAG,
210
+ init_xml
211
+ } from "./chunk-1nk93fqz.js";
212
+ import {
213
+ getCwd,
214
+ init_cwd
215
+ } from "./chunk-s8kj6ajy.js";
216
+ import {
217
+ figures_default,
218
+ init_figures
219
+ } from "./chunk-qajrkk97.js";
220
+ import {
221
+ getDebugLogPath,
222
+ init_debug,
223
+ isDebugMode,
224
+ isDebugToStdErr,
225
+ logForDebugging
226
+ } from "./chunk-phd1qfpc.js";
227
+ import {
228
+ init_envUtils,
229
+ isEnvTruthy
230
+ } from "./chunk-jaaxk89e.js";
231
+ import {
232
+ getIsRemoteMode,
233
+ init_state
234
+ } from "./chunk-k8vp0atq.js";
235
+ import {
236
+ __esm,
237
+ __toCommonJS,
238
+ __toESM
239
+ } from "./chunk-qp2qdcda.js";
240
+
241
+ // src/context/promptOverlayContext.tsx
242
+ function PromptOverlayProvider({
243
+ children
244
+ }) {
245
+ const [data, setData] = import_react.useState(null);
246
+ const [dialog, setDialog] = import_react.useState(null);
247
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SetContext.Provider, {
248
+ value: setData,
249
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SetDialogContext.Provider, {
250
+ value: setDialog,
251
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DataContext.Provider, {
252
+ value: data,
253
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DialogContext.Provider, {
254
+ value: dialog,
255
+ children
256
+ }, undefined, false, undefined, this)
257
+ }, undefined, false, undefined, this)
258
+ }, undefined, false, undefined, this)
259
+ }, undefined, false, undefined, this);
260
+ }
261
+ function usePromptOverlay() {
262
+ return import_react.useContext(DataContext);
263
+ }
264
+ function usePromptOverlayDialog() {
265
+ return import_react.useContext(DialogContext);
266
+ }
267
+ function useSetPromptOverlay(data) {
268
+ const set = import_react.useContext(SetContext);
269
+ import_react.useEffect(() => {
270
+ if (!set)
271
+ return;
272
+ set(data);
273
+ return () => set(null);
274
+ }, [set, data]);
275
+ }
276
+ function useSetPromptOverlayDialog(node) {
277
+ const set = import_react.useContext(SetDialogContext);
278
+ import_react.useEffect(() => {
279
+ if (!set)
280
+ return;
281
+ set(node);
282
+ return () => set(null);
283
+ }, [set, node]);
284
+ }
285
+ var import_react, jsx_dev_runtime, DataContext, SetContext, DialogContext, SetDialogContext;
286
+ var init_promptOverlayContext = __esm(() => {
287
+ import_react = __toESM(require_react(), 1);
288
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
289
+ DataContext = import_react.createContext(null);
290
+ SetContext = import_react.createContext(null);
291
+ DialogContext = import_react.createContext(null);
292
+ SetDialogContext = import_react.createContext(null);
293
+ });
294
+
295
+ // src/components/messages/nullRenderingAttachments.ts
296
+ function isNullRenderingAttachment(msg) {
297
+ return msg.type === "attachment" && NULL_RENDERING_ATTACHMENT_TYPES.has(msg.attachment.type);
298
+ }
299
+ var NULL_RENDERING_TYPES, NULL_RENDERING_ATTACHMENT_TYPES;
300
+ var init_nullRenderingAttachments = __esm(() => {
301
+ NULL_RENDERING_TYPES = [
302
+ "hook_success",
303
+ "hook_additional_context",
304
+ "hook_cancelled",
305
+ "command_permissions",
306
+ "agent_mention",
307
+ "budget_usd",
308
+ "critical_system_reminder",
309
+ "edited_image_file",
310
+ "edited_text_file",
311
+ "opened_file_in_ide",
312
+ "output_style",
313
+ "plan_mode",
314
+ "plan_mode_exit",
315
+ "plan_mode_reentry",
316
+ "structured_output",
317
+ "team_context",
318
+ "todo_reminder",
319
+ "context_efficiency",
320
+ "deferred_tools_delta",
321
+ "mcp_instructions_delta",
322
+ "companion_intro",
323
+ "token_usage",
324
+ "ultrathink_effort",
325
+ "max_turns_reached",
326
+ "task_reminder",
327
+ "auto_mode",
328
+ "auto_mode_exit",
329
+ "output_token_usage",
330
+ "verify_plan_reminder",
331
+ "current_session_memory",
332
+ "compaction_reminder",
333
+ "date_change"
334
+ ];
335
+ NULL_RENDERING_ATTACHMENT_TYPES = new Set(NULL_RENDERING_TYPES);
336
+ });
337
+
338
+ // src/components/FullscreenLayout.tsx
339
+ import { fileURLToPath } from "url";
340
+ function useUnseenDivider(messageCount) {
341
+ const [dividerIndex, setDividerIndex] = import_react2.useState(null);
342
+ const countRef = import_react2.useRef(messageCount);
343
+ countRef.current = messageCount;
344
+ const dividerYRef = import_react2.useRef(null);
345
+ const onRepin = import_react2.useCallback(() => {
346
+ setDividerIndex(null);
347
+ }, []);
348
+ const onScrollAway = import_react2.useCallback((handle) => {
349
+ const max = Math.max(0, handle.getScrollHeight() - handle.getViewportHeight());
350
+ if (handle.getScrollTop() + handle.getPendingDelta() >= max)
351
+ return;
352
+ if (dividerYRef.current === null) {
353
+ dividerYRef.current = handle.getScrollHeight();
354
+ setDividerIndex(countRef.current);
355
+ }
356
+ }, []);
357
+ const jumpToNew = import_react2.useCallback((handle) => {
358
+ if (!handle)
359
+ return;
360
+ handle.scrollToBottom();
361
+ }, []);
362
+ import_react2.useEffect(() => {
363
+ if (dividerIndex === null) {
364
+ dividerYRef.current = null;
365
+ } else if (messageCount < dividerIndex) {
366
+ dividerYRef.current = null;
367
+ setDividerIndex(null);
368
+ }
369
+ }, [messageCount, dividerIndex]);
370
+ const shiftDivider = import_react2.useCallback((indexDelta, heightDelta) => {
371
+ setDividerIndex((idx) => idx === null ? null : idx + indexDelta);
372
+ if (dividerYRef.current !== null) {
373
+ dividerYRef.current += heightDelta;
374
+ }
375
+ }, []);
376
+ return {
377
+ dividerIndex,
378
+ dividerYRef,
379
+ onScrollAway,
380
+ onRepin,
381
+ jumpToNew,
382
+ shiftDivider
383
+ };
384
+ }
385
+ function countUnseenAssistantTurns(messages, dividerIndex) {
386
+ let count = 0;
387
+ let prevWasAssistant = false;
388
+ for (let i = dividerIndex;i < messages.length; i++) {
389
+ const m = messages[i];
390
+ if (m.type === "progress")
391
+ continue;
392
+ if (m.type === "assistant" && !assistantHasVisibleText(m))
393
+ continue;
394
+ const isAssistant = m.type === "assistant";
395
+ if (isAssistant && !prevWasAssistant)
396
+ count++;
397
+ prevWasAssistant = isAssistant;
398
+ }
399
+ return count;
400
+ }
401
+ function assistantHasVisibleText(m) {
402
+ if (m.type !== "assistant")
403
+ return false;
404
+ if (!Array.isArray(m.message.content))
405
+ return false;
406
+ for (const b of m.message.content) {
407
+ if (typeof b !== "string" && b.type === "text" && b.text.trim() !== "")
408
+ return true;
409
+ }
410
+ return false;
411
+ }
412
+ function computeUnseenDivider(messages, dividerIndex) {
413
+ if (dividerIndex === null)
414
+ return;
415
+ let anchorIdx = dividerIndex;
416
+ while (anchorIdx < messages.length && (messages[anchorIdx]?.type === "progress" || isNullRenderingAttachment(messages[anchorIdx]))) {
417
+ anchorIdx++;
418
+ }
419
+ const uuid = messages[anchorIdx]?.uuid;
420
+ if (!uuid)
421
+ return;
422
+ const count = countUnseenAssistantTurns(messages, dividerIndex);
423
+ return { firstUnseenUuid: uuid, count: Math.max(1, count) };
424
+ }
425
+ function FullscreenLayout({
426
+ scrollable,
427
+ bottom,
428
+ overlay,
429
+ bottomFloat,
430
+ modal,
431
+ modalScrollRef,
432
+ scrollRef,
433
+ dividerYRef,
434
+ hidePill = false,
435
+ hideSticky = false,
436
+ newMessageCount = 0,
437
+ onPillClick
438
+ }) {
439
+ const { rows: terminalRows, columns } = useTerminalSize();
440
+ const [stickyPrompt, setStickyPrompt] = import_react2.useState(null);
441
+ const chromeCtx = import_react2.useMemo(() => ({ setStickyPrompt }), []);
442
+ const subscribe = import_react2.useCallback((listener) => scrollRef?.current?.subscribe(listener) ?? (() => {}), [scrollRef]);
443
+ const pillVisible = import_react2.useSyncExternalStore(subscribe, () => {
444
+ const s = scrollRef?.current;
445
+ const dividerY = dividerYRef?.current;
446
+ if (!s || dividerY == null)
447
+ return false;
448
+ return s.getScrollTop() + s.getPendingDelta() + s.getViewportHeight() < dividerY;
449
+ });
450
+ import_react2.useLayoutEffect(() => {
451
+ if (!isFullscreenEnvEnabled())
452
+ return;
453
+ const ink = instances_default.get(process.stdout);
454
+ if (!ink)
455
+ return;
456
+ ink.onHyperlinkClick = (url) => {
457
+ if (url.startsWith("file:")) {
458
+ try {
459
+ openPath(fileURLToPath(url));
460
+ } catch {}
461
+ } else {
462
+ openBrowser(url);
463
+ }
464
+ };
465
+ return () => {
466
+ ink.onHyperlinkClick = undefined;
467
+ };
468
+ }, []);
469
+ if (isFullscreenEnvEnabled()) {
470
+ const sticky = hideSticky ? null : stickyPrompt;
471
+ const headerPrompt = sticky != null && sticky !== "clicked" && overlay == null ? sticky : null;
472
+ const padCollapsed = sticky != null && overlay == null;
473
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PromptOverlayProvider, {
474
+ children: [
475
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
476
+ flexGrow: 1,
477
+ flexDirection: "column",
478
+ overflow: "hidden",
479
+ children: [
480
+ headerPrompt && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(StickyPromptHeader, {
481
+ text: headerPrompt.text,
482
+ onClick: headerPrompt.scrollTo
483
+ }, undefined, false, undefined, this),
484
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ScrollBox_default, {
485
+ ref: scrollRef,
486
+ flexGrow: 1,
487
+ flexDirection: "column",
488
+ paddingTop: padCollapsed ? 0 : 1,
489
+ stickyScroll: true,
490
+ children: [
491
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ScrollChromeContext, {
492
+ value: chromeCtx,
493
+ children: scrollable
494
+ }, undefined, false, undefined, this),
495
+ overlay
496
+ ]
497
+ }, undefined, true, undefined, this),
498
+ !hidePill && pillVisible && overlay == null && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(NewMessagesPill, {
499
+ count: newMessageCount,
500
+ onClick: onPillClick
501
+ }, undefined, false, undefined, this),
502
+ bottomFloat != null && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
503
+ position: "absolute",
504
+ bottom: 0,
505
+ right: 0,
506
+ opaque: true,
507
+ children: bottomFloat
508
+ }, undefined, false, undefined, this)
509
+ ]
510
+ }, undefined, true, undefined, this),
511
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
512
+ flexDirection: "column",
513
+ flexShrink: 0,
514
+ width: "100%",
515
+ maxHeight: "50%",
516
+ children: [
517
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(SuggestionsOverlay, {}, undefined, false, undefined, this),
518
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(DialogOverlay, {}, undefined, false, undefined, this),
519
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
520
+ flexDirection: "column",
521
+ width: "100%",
522
+ flexGrow: 1,
523
+ overflowY: "hidden",
524
+ children: bottom
525
+ }, undefined, false, undefined, this)
526
+ ]
527
+ }, undefined, true, undefined, this),
528
+ modal != null && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ModalContext, {
529
+ value: {
530
+ rows: terminalRows - MODAL_TRANSCRIPT_PEEK - 1,
531
+ columns: columns - 4,
532
+ scrollRef: modalScrollRef ?? null
533
+ },
534
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
535
+ position: "absolute",
536
+ bottom: 0,
537
+ left: 0,
538
+ right: 0,
539
+ maxHeight: terminalRows - MODAL_TRANSCRIPT_PEEK,
540
+ flexDirection: "column",
541
+ overflow: "hidden",
542
+ opaque: true,
543
+ children: [
544
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
545
+ flexShrink: 0,
546
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
547
+ color: "permission",
548
+ children: "\u2594".repeat(columns)
549
+ }, undefined, false, undefined, this)
550
+ }, undefined, false, undefined, this),
551
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
552
+ flexDirection: "column",
553
+ paddingX: 2,
554
+ flexShrink: 0,
555
+ overflow: "hidden",
556
+ children: modal
557
+ }, undefined, false, undefined, this)
558
+ ]
559
+ }, undefined, true, undefined, this)
560
+ }, undefined, false, undefined, this)
561
+ ]
562
+ }, undefined, true, undefined, this);
563
+ }
564
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
565
+ children: [
566
+ scrollable,
567
+ bottom,
568
+ overlay,
569
+ modal
570
+ ]
571
+ }, undefined, true, undefined, this);
572
+ }
573
+ function NewMessagesPill({
574
+ count,
575
+ onClick
576
+ }) {
577
+ const [hover, setHover] = import_react2.useState(false);
578
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
579
+ position: "absolute",
580
+ bottom: 0,
581
+ left: 0,
582
+ right: 0,
583
+ justifyContent: "center",
584
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
585
+ onClick,
586
+ onMouseEnter: () => setHover(true),
587
+ onMouseLeave: () => setHover(false),
588
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
589
+ backgroundColor: hover ? "userMessageBackgroundHover" : "userMessageBackground",
590
+ dimColor: true,
591
+ children: [
592
+ " ",
593
+ count > 0 ? `${count} new ${plural(count, "message")}` : "Jump to bottom",
594
+ " ",
595
+ figures_default.arrowDown,
596
+ " "
597
+ ]
598
+ }, undefined, true, undefined, this)
599
+ }, undefined, false, undefined, this)
600
+ }, undefined, false, undefined, this);
601
+ }
602
+ function StickyPromptHeader({
603
+ text,
604
+ onClick
605
+ }) {
606
+ const [hover, setHover] = import_react2.useState(false);
607
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
608
+ flexShrink: 0,
609
+ width: "100%",
610
+ height: 1,
611
+ paddingRight: 1,
612
+ backgroundColor: hover ? "userMessageBackgroundHover" : "userMessageBackground",
613
+ onClick,
614
+ onMouseEnter: () => setHover(true),
615
+ onMouseLeave: () => setHover(false),
616
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
617
+ color: "subtle",
618
+ wrap: "truncate-end",
619
+ children: [
620
+ figures_default.pointer,
621
+ " ",
622
+ text
623
+ ]
624
+ }, undefined, true, undefined, this)
625
+ }, undefined, false, undefined, this);
626
+ }
627
+ function SuggestionsOverlay() {
628
+ const data = usePromptOverlay();
629
+ if (!data || data.suggestions.length === 0)
630
+ return null;
631
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
632
+ position: "absolute",
633
+ bottom: "100%",
634
+ left: 0,
635
+ right: 0,
636
+ paddingX: 2,
637
+ paddingTop: 1,
638
+ flexDirection: "column",
639
+ opaque: true,
640
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PromptInputFooterSuggestions_default, {
641
+ suggestions: data.suggestions,
642
+ selectedSuggestion: data.selectedSuggestion,
643
+ maxColumnWidth: data.maxColumnWidth,
644
+ overlay: true
645
+ }, undefined, false, undefined, this)
646
+ }, undefined, false, undefined, this);
647
+ }
648
+ function DialogOverlay() {
649
+ const node = usePromptOverlayDialog();
650
+ if (!node)
651
+ return null;
652
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
653
+ position: "absolute",
654
+ bottom: "100%",
655
+ left: 0,
656
+ right: 0,
657
+ opaque: true,
658
+ children: node
659
+ }, undefined, false, undefined, this);
660
+ }
661
+ var import_react2, jsx_dev_runtime2, MODAL_TRANSCRIPT_PEEK = 2, ScrollChromeContext;
662
+ var init_FullscreenLayout = __esm(() => {
663
+ init_figures();
664
+ init_modalContext();
665
+ init_promptOverlayContext();
666
+ init_useTerminalSize();
667
+ init_src();
668
+ init_browser();
669
+ init_fullscreen();
670
+ init_stringUtils();
671
+ init_nullRenderingAttachments();
672
+ init_PromptInputFooterSuggestions();
673
+ import_react2 = __toESM(require_react(), 1);
674
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
675
+ ScrollChromeContext = import_react2.createContext({ setStickyPrompt: () => {} });
676
+ });
677
+
678
+ // src/utils/set.ts
679
+ function every(a, b) {
680
+ for (const item of a) {
681
+ if (!b.has(item)) {
682
+ return false;
683
+ }
684
+ }
685
+ return true;
686
+ }
687
+ var init_set = () => {};
688
+
689
+ // src/utils/collapseBackgroundBashNotifications.ts
690
+ function isCompletedBackgroundBash(msg) {
691
+ if (msg.type !== "user")
692
+ return false;
693
+ const content0 = Array.isArray(msg.message.content) ? msg.message.content[0] : undefined;
694
+ if (!content0 || typeof content0 === "string" || content0?.type !== "text")
695
+ return false;
696
+ if (!content0.text.includes(`<${TASK_NOTIFICATION_TAG}`))
697
+ return false;
698
+ if (extractTag(content0.text, STATUS_TAG) !== "completed")
699
+ return false;
700
+ return extractTag(content0.text, SUMMARY_TAG)?.startsWith(BACKGROUND_BASH_SUMMARY_PREFIX) ?? false;
701
+ }
702
+ function collapseBackgroundBashNotifications(messages, verbose) {
703
+ if (!isFullscreenEnvEnabled())
704
+ return messages;
705
+ if (verbose)
706
+ return messages;
707
+ const result = [];
708
+ let i = 0;
709
+ while (i < messages.length) {
710
+ const msg = messages[i];
711
+ if (isCompletedBackgroundBash(msg)) {
712
+ let count = 0;
713
+ while (i < messages.length && isCompletedBackgroundBash(messages[i])) {
714
+ count++;
715
+ i++;
716
+ }
717
+ if (count === 1) {
718
+ result.push(msg);
719
+ } else {
720
+ result.push({
721
+ ...msg,
722
+ message: {
723
+ role: "user",
724
+ content: [
725
+ {
726
+ type: "text",
727
+ text: `<${TASK_NOTIFICATION_TAG}><${STATUS_TAG}>completed</${STATUS_TAG}><${SUMMARY_TAG}>${count} background commands completed</${SUMMARY_TAG}></${TASK_NOTIFICATION_TAG}>`
728
+ }
729
+ ]
730
+ }
731
+ });
732
+ }
733
+ } else {
734
+ result.push(msg);
735
+ i++;
736
+ }
737
+ }
738
+ return result;
739
+ }
740
+ var init_collapseBackgroundBashNotifications = __esm(() => {
741
+ init_xml();
742
+ init_LocalShellTask();
743
+ init_fullscreen();
744
+ init_messages();
745
+ });
746
+
747
+ // src/utils/collapseHookSummaries.ts
748
+ function isLabeledHookSummary(msg) {
749
+ return msg.type === "system" && msg.subtype === "stop_hook_summary" && msg.hookLabel !== undefined;
750
+ }
751
+ function collapseHookSummaries(messages) {
752
+ const result = [];
753
+ let i = 0;
754
+ while (i < messages.length) {
755
+ const msg = messages[i];
756
+ if (isLabeledHookSummary(msg)) {
757
+ const label = msg.hookLabel;
758
+ const group = [];
759
+ while (i < messages.length) {
760
+ const next = messages[i];
761
+ if (!isLabeledHookSummary(next) || next.hookLabel !== label)
762
+ break;
763
+ group.push(next);
764
+ i++;
765
+ }
766
+ if (group.length === 1) {
767
+ result.push(msg);
768
+ } else {
769
+ result.push({
770
+ ...msg,
771
+ hookCount: group.reduce((sum, m) => sum + m.hookCount, 0),
772
+ hookInfos: group.flatMap((m) => m.hookInfos),
773
+ hookErrors: group.flatMap((m) => m.hookErrors),
774
+ preventedContinuation: group.some((m) => m.preventedContinuation),
775
+ hasOutput: group.some((m) => m.hasOutput),
776
+ totalDurationMs: Math.max(...group.map((m) => m.totalDurationMs ?? 0))
777
+ });
778
+ }
779
+ } else {
780
+ result.push(msg);
781
+ i++;
782
+ }
783
+ }
784
+ return result;
785
+ }
786
+ var init_collapseHookSummaries = () => {};
787
+
788
+ // src/utils/collapseTeammateShutdowns.ts
789
+ function isTeammateShutdownAttachment(msg) {
790
+ return msg.type === "attachment" && msg.attachment.type === "task_status" && msg.attachment.taskType === "in_process_teammate" && msg.attachment.status === "completed";
791
+ }
792
+ function collapseTeammateShutdowns(messages) {
793
+ const result = [];
794
+ let i = 0;
795
+ while (i < messages.length) {
796
+ const msg = messages[i];
797
+ if (isTeammateShutdownAttachment(msg)) {
798
+ let count = 0;
799
+ while (i < messages.length && isTeammateShutdownAttachment(messages[i])) {
800
+ count++;
801
+ i++;
802
+ }
803
+ if (count === 1) {
804
+ result.push(msg);
805
+ } else {
806
+ result.push({
807
+ type: "attachment",
808
+ uuid: msg.uuid,
809
+ timestamp: msg.timestamp,
810
+ attachment: {
811
+ type: "teammate_shutdown_batch",
812
+ count
813
+ }
814
+ });
815
+ }
816
+ } else {
817
+ result.push(msg);
818
+ i++;
819
+ }
820
+ }
821
+ return result;
822
+ }
823
+ var init_collapseTeammateShutdowns = () => {};
824
+
825
+ // src/utils/groupToolUses.ts
826
+ function getToolsWithGrouping(tools) {
827
+ let cached = GROUPING_CACHE.get(tools);
828
+ if (!cached) {
829
+ cached = new Set(tools.filter((t) => t.renderGroupedToolUse).map((t) => t.name));
830
+ GROUPING_CACHE.set(tools, cached);
831
+ }
832
+ return cached;
833
+ }
834
+ function getToolUseInfo(msg) {
835
+ if (msg.type === "assistant" && msg.message?.content && Array.isArray(msg.message.content) && msg.message.content[0]?.type === "tool_use") {
836
+ const content = msg.message.content[0];
837
+ return {
838
+ messageId: msg.message.id,
839
+ toolUseId: content.id,
840
+ toolName: content.name
841
+ };
842
+ }
843
+ return null;
844
+ }
845
+ function applyGrouping(messages, tools, verbose = false) {
846
+ if (verbose) {
847
+ return {
848
+ messages
849
+ };
850
+ }
851
+ const toolsWithGrouping = getToolsWithGrouping(tools);
852
+ const groups = new Map;
853
+ for (const msg of messages) {
854
+ const info = getToolUseInfo(msg);
855
+ if (info && toolsWithGrouping.has(info.toolName)) {
856
+ const key = `${info.messageId}:${info.toolName}`;
857
+ const group = groups.get(key) ?? [];
858
+ group.push(msg);
859
+ groups.set(key, group);
860
+ }
861
+ }
862
+ const validGroups = new Map;
863
+ const groupedToolUseIds = new Set;
864
+ for (const [key, group] of groups) {
865
+ if (group.length >= 2) {
866
+ validGroups.set(key, group);
867
+ for (const msg of group) {
868
+ const info = getToolUseInfo(msg);
869
+ if (info) {
870
+ groupedToolUseIds.add(info.toolUseId);
871
+ }
872
+ }
873
+ }
874
+ }
875
+ const resultsByToolUseId = new Map;
876
+ for (const msg of messages) {
877
+ if (msg.type === "user" && msg.message?.content && Array.isArray(msg.message.content)) {
878
+ for (const content of msg.message.content) {
879
+ if (content.type === "tool_result" && groupedToolUseIds.has(content.tool_use_id)) {
880
+ resultsByToolUseId.set(content.tool_use_id, msg);
881
+ }
882
+ }
883
+ }
884
+ }
885
+ const result = [];
886
+ const emittedGroups = new Set;
887
+ for (const msg of messages) {
888
+ const info = getToolUseInfo(msg);
889
+ if (info) {
890
+ const key = `${info.messageId}:${info.toolName}`;
891
+ const group = validGroups.get(key);
892
+ if (group) {
893
+ if (!emittedGroups.has(key)) {
894
+ emittedGroups.add(key);
895
+ const firstMsg = group[0];
896
+ const results = [];
897
+ for (const assistantMsg of group) {
898
+ const toolUseId = assistantMsg.message.content[0].id;
899
+ const resultMsg = resultsByToolUseId.get(toolUseId);
900
+ if (resultMsg) {
901
+ results.push(resultMsg);
902
+ }
903
+ }
904
+ const groupedMessage = {
905
+ type: "grouped_tool_use",
906
+ toolName: info.toolName,
907
+ messages: group,
908
+ results,
909
+ displayMessage: firstMsg,
910
+ uuid: `grouped-${firstMsg.uuid}`,
911
+ timestamp: firstMsg.timestamp,
912
+ messageId: info.messageId
913
+ };
914
+ result.push(groupedMessage);
915
+ }
916
+ continue;
917
+ }
918
+ }
919
+ if (msg.type === "user" && msg.message?.content && Array.isArray(msg.message.content)) {
920
+ const toolResults = msg.message.content.filter((c) => c.type === "tool_result");
921
+ if (toolResults.length > 0) {
922
+ const allGrouped = toolResults.every((tr) => groupedToolUseIds.has(tr.tool_use_id));
923
+ if (allGrouped) {
924
+ continue;
925
+ }
926
+ }
927
+ }
928
+ result.push(msg);
929
+ }
930
+ return { messages: result };
931
+ }
932
+ var GROUPING_CACHE;
933
+ var init_groupToolUses = __esm(() => {
934
+ GROUPING_CACHE = new WeakMap;
935
+ });
936
+
937
+ // src/utils/transcriptSearch.ts
938
+ function renderableSearchText(msg) {
939
+ const cached = searchTextCache.get(msg);
940
+ if (cached !== undefined)
941
+ return cached;
942
+ const result = computeSearchText(msg).toLowerCase();
943
+ searchTextCache.set(msg, result);
944
+ return result;
945
+ }
946
+ function computeSearchText(msg) {
947
+ let raw = "";
948
+ switch (msg.type) {
949
+ case "user": {
950
+ const c = msg.message.content;
951
+ if (typeof c === "string") {
952
+ raw = RENDERED_AS_SENTINEL.has(c) ? "" : c;
953
+ } else {
954
+ const parts = [];
955
+ for (const b of c) {
956
+ if (b.type === "text") {
957
+ if (!RENDERED_AS_SENTINEL.has(b.text))
958
+ parts.push(b.text);
959
+ } else if (b.type === "tool_result") {
960
+ parts.push(toolResultSearchText(msg.toolUseResult));
961
+ }
962
+ }
963
+ raw = parts.join(`
964
+ `);
965
+ }
966
+ break;
967
+ }
968
+ case "assistant": {
969
+ const c = msg.message.content;
970
+ if (Array.isArray(c)) {
971
+ raw = c.flatMap((b) => {
972
+ if (b.type === "text")
973
+ return [b.text];
974
+ if (b.type === "tool_use")
975
+ return [toolUseSearchText(b.input)];
976
+ return [];
977
+ }).join(`
978
+ `);
979
+ }
980
+ break;
981
+ }
982
+ case "attachment": {
983
+ if (msg.attachment.type === "relevant_memories") {
984
+ raw = msg.attachment.memories.map((m) => m.content).join(`
985
+ `);
986
+ } else if (msg.attachment.type === "queued_command" && msg.attachment.commandMode !== "task-notification" && !msg.attachment.isMeta) {
987
+ const p = msg.attachment.prompt;
988
+ raw = typeof p === "string" ? p : p.flatMap((b) => b.type === "text" ? [b.text] : []).join(`
989
+ `);
990
+ }
991
+ break;
992
+ }
993
+ case "collapsed_read_search": {
994
+ if (msg.relevantMemories) {
995
+ raw = msg.relevantMemories.map((m) => m.content).join(`
996
+ `);
997
+ }
998
+ break;
999
+ }
1000
+ default:
1001
+ break;
1002
+ }
1003
+ let t = raw;
1004
+ let open = t.indexOf("<system-reminder>");
1005
+ while (open >= 0) {
1006
+ const close = t.indexOf(SYSTEM_REMINDER_CLOSE, open);
1007
+ if (close < 0)
1008
+ break;
1009
+ t = t.slice(0, open) + t.slice(close + SYSTEM_REMINDER_CLOSE.length);
1010
+ open = t.indexOf("<system-reminder>");
1011
+ }
1012
+ return t;
1013
+ }
1014
+ function toolUseSearchText(input) {
1015
+ if (!input || typeof input !== "object")
1016
+ return "";
1017
+ const o = input;
1018
+ const parts = [];
1019
+ for (const k of [
1020
+ "command",
1021
+ "pattern",
1022
+ "file_path",
1023
+ "path",
1024
+ "prompt",
1025
+ "description",
1026
+ "query",
1027
+ "url",
1028
+ "skill"
1029
+ ]) {
1030
+ const v = o[k];
1031
+ if (typeof v === "string")
1032
+ parts.push(v);
1033
+ }
1034
+ for (const k of ["args", "files"]) {
1035
+ const v = o[k];
1036
+ if (Array.isArray(v) && v.every((x) => typeof x === "string")) {
1037
+ parts.push(v.join(" "));
1038
+ }
1039
+ }
1040
+ return parts.join(`
1041
+ `);
1042
+ }
1043
+ function toolResultSearchText(r) {
1044
+ if (!r || typeof r !== "object")
1045
+ return typeof r === "string" ? r : "";
1046
+ const o = r;
1047
+ if (typeof o.stdout === "string") {
1048
+ const err = typeof o.stderr === "string" ? o.stderr : "";
1049
+ return o.stdout + (err ? `
1050
+ ` + err : "");
1051
+ }
1052
+ if (o.file && typeof o.file === "object" && typeof o.file.content === "string") {
1053
+ return o.file.content;
1054
+ }
1055
+ const parts = [];
1056
+ for (const k of ["content", "output", "result", "text", "message"]) {
1057
+ const v = o[k];
1058
+ if (typeof v === "string")
1059
+ parts.push(v);
1060
+ }
1061
+ for (const k of ["filenames", "lines", "results"]) {
1062
+ const v = o[k];
1063
+ if (Array.isArray(v) && v.every((x) => typeof x === "string")) {
1064
+ parts.push(v.join(`
1065
+ `));
1066
+ }
1067
+ }
1068
+ return parts.join(`
1069
+ `);
1070
+ }
1071
+ var SYSTEM_REMINDER_CLOSE = "</system-reminder>", RENDERED_AS_SENTINEL, searchTextCache;
1072
+ var init_transcriptSearch = __esm(() => {
1073
+ init_messages();
1074
+ RENDERED_AS_SENTINEL = new Set([
1075
+ INTERRUPT_MESSAGE,
1076
+ INTERRUPT_MESSAGE_FOR_TOOL_USE
1077
+ ]);
1078
+ searchTextCache = new WeakMap;
1079
+ });
1080
+
1081
+ // src/components/LogoV2/Clawd.tsx
1082
+ function Clawd({ pose = "default" } = {}) {
1083
+ if (env.terminal === "Apple_Terminal") {
1084
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(AppleTerminalClawd, {
1085
+ pose
1086
+ }, undefined, false, undefined, this);
1087
+ }
1088
+ const p = POSES[pose];
1089
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1090
+ flexDirection: "column",
1091
+ children: [
1092
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1093
+ children: [
1094
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1095
+ color: "clawd_body",
1096
+ children: p.r1L
1097
+ }, undefined, false, undefined, this),
1098
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1099
+ color: "clawd_body",
1100
+ backgroundColor: "clawd_background",
1101
+ children: p.r1E
1102
+ }, undefined, false, undefined, this),
1103
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1104
+ color: "clawd_body",
1105
+ children: p.r1R
1106
+ }, undefined, false, undefined, this)
1107
+ ]
1108
+ }, undefined, true, undefined, this),
1109
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1110
+ children: [
1111
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1112
+ color: "clawd_body",
1113
+ children: p.r2L
1114
+ }, undefined, false, undefined, this),
1115
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1116
+ color: "clawd_body",
1117
+ backgroundColor: "clawd_background",
1118
+ children: "\u2588\u2588\u2588\u2588\u2588"
1119
+ }, undefined, false, undefined, this),
1120
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1121
+ color: "clawd_body",
1122
+ children: p.r2R
1123
+ }, undefined, false, undefined, this)
1124
+ ]
1125
+ }, undefined, true, undefined, this),
1126
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1127
+ color: "clawd_body",
1128
+ children: [
1129
+ " ",
1130
+ "\u2598\u2598 \u259D\u259D",
1131
+ " "
1132
+ ]
1133
+ }, undefined, true, undefined, this)
1134
+ ]
1135
+ }, undefined, true, undefined, this);
1136
+ }
1137
+ function AppleTerminalClawd({ pose }) {
1138
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1139
+ flexDirection: "column",
1140
+ alignItems: "center",
1141
+ children: [
1142
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1143
+ children: [
1144
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1145
+ color: "clawd_body",
1146
+ children: "\u2597"
1147
+ }, undefined, false, undefined, this),
1148
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1149
+ color: "clawd_background",
1150
+ backgroundColor: "clawd_body",
1151
+ children: APPLE_EYES[pose]
1152
+ }, undefined, false, undefined, this),
1153
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1154
+ color: "clawd_body",
1155
+ children: "\u2596"
1156
+ }, undefined, false, undefined, this)
1157
+ ]
1158
+ }, undefined, true, undefined, this),
1159
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1160
+ backgroundColor: "clawd_body",
1161
+ children: " ".repeat(7)
1162
+ }, undefined, false, undefined, this),
1163
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1164
+ color: "clawd_body",
1165
+ children: "\u2598\u2598 \u259D\u259D"
1166
+ }, undefined, false, undefined, this)
1167
+ ]
1168
+ }, undefined, true, undefined, this);
1169
+ }
1170
+ var jsx_dev_runtime3, POSES, APPLE_EYES;
1171
+ var init_Clawd = __esm(() => {
1172
+ init_src();
1173
+ init_env();
1174
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
1175
+ POSES = {
1176
+ default: { r1L: " \u2590", r1E: "\u259B\u2588\u2588\u2588\u259C", r1R: "\u258C", r2L: "\u259D\u259C", r2R: "\u259B\u2598" },
1177
+ "look-left": { r1L: " \u2590", r1E: "\u259F\u2588\u2588\u2588\u259F", r1R: "\u258C", r2L: "\u259D\u259C", r2R: "\u259B\u2598" },
1178
+ "look-right": { r1L: " \u2590", r1E: "\u2599\u2588\u2588\u2588\u2599", r1R: "\u258C", r2L: "\u259D\u259C", r2R: "\u259B\u2598" },
1179
+ "arms-up": { r1L: "\u2597\u259F", r1E: "\u259B\u2588\u2588\u2588\u259C", r1R: "\u2599\u2596", r2L: " \u259C", r2R: "\u259B " }
1180
+ };
1181
+ APPLE_EYES = {
1182
+ default: " \u2597 \u2596 ",
1183
+ "look-left": " \u2598 \u2598 ",
1184
+ "look-right": " \u259D \u259D ",
1185
+ "arms-up": " \u2597 \u2596 "
1186
+ };
1187
+ });
1188
+
1189
+ // src/components/LogoV2/Feed.tsx
1190
+ function calculateFeedWidth(config) {
1191
+ const { title, lines, footer, emptyMessage, customContent } = config;
1192
+ let maxWidth = stringWidth(title);
1193
+ if (customContent !== undefined) {
1194
+ maxWidth = Math.max(maxWidth, customContent.width);
1195
+ } else if (lines.length === 0 && emptyMessage) {
1196
+ maxWidth = Math.max(maxWidth, stringWidth(emptyMessage));
1197
+ } else {
1198
+ const gap = " ";
1199
+ const maxTimestampWidth = Math.max(0, ...lines.map((line) => line.timestamp ? stringWidth(line.timestamp) : 0));
1200
+ for (const line of lines) {
1201
+ const timestampWidth = maxTimestampWidth > 0 ? maxTimestampWidth : 0;
1202
+ const lineWidth = stringWidth(line.text) + (timestampWidth > 0 ? timestampWidth + gap.length : 0);
1203
+ maxWidth = Math.max(maxWidth, lineWidth);
1204
+ }
1205
+ }
1206
+ if (footer) {
1207
+ maxWidth = Math.max(maxWidth, stringWidth(footer));
1208
+ }
1209
+ return maxWidth;
1210
+ }
1211
+ function Feed({ config, actualWidth }) {
1212
+ const { title, lines, footer, emptyMessage, customContent } = config;
1213
+ const gap = " ";
1214
+ const maxTimestampWidth = Math.max(0, ...lines.map((line) => line.timestamp ? stringWidth(line.timestamp) : 0));
1215
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
1216
+ flexDirection: "column",
1217
+ width: actualWidth,
1218
+ children: [
1219
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1220
+ bold: true,
1221
+ color: "claude",
1222
+ children: title
1223
+ }, undefined, false, undefined, this),
1224
+ customContent ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
1225
+ children: [
1226
+ customContent.content,
1227
+ footer && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1228
+ dimColor: true,
1229
+ italic: true,
1230
+ children: truncate(footer, actualWidth)
1231
+ }, undefined, false, undefined, this)
1232
+ ]
1233
+ }, undefined, true, undefined, this) : lines.length === 0 && emptyMessage ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1234
+ dimColor: true,
1235
+ children: truncate(emptyMessage, actualWidth)
1236
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
1237
+ children: [
1238
+ lines.map((line, index) => {
1239
+ const textWidth = Math.max(10, actualWidth - (maxTimestampWidth > 0 ? maxTimestampWidth + gap.length : 0));
1240
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1241
+ children: [
1242
+ maxTimestampWidth > 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
1243
+ children: [
1244
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1245
+ dimColor: true,
1246
+ children: (line.timestamp || "").padEnd(maxTimestampWidth)
1247
+ }, undefined, false, undefined, this),
1248
+ gap
1249
+ ]
1250
+ }, undefined, true, undefined, this),
1251
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1252
+ children: truncate(line.text, textWidth)
1253
+ }, undefined, false, undefined, this)
1254
+ ]
1255
+ }, index, true, undefined, this);
1256
+ }),
1257
+ footer && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1258
+ dimColor: true,
1259
+ italic: true,
1260
+ children: truncate(footer, actualWidth)
1261
+ }, undefined, false, undefined, this)
1262
+ ]
1263
+ }, undefined, true, undefined, this)
1264
+ ]
1265
+ }, undefined, true, undefined, this);
1266
+ }
1267
+ var jsx_dev_runtime4;
1268
+ var init_Feed = __esm(() => {
1269
+ init_src();
1270
+ init_format();
1271
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
1272
+ });
1273
+
1274
+ // src/components/LogoV2/FeedColumn.tsx
1275
+ function FeedColumn({
1276
+ feeds,
1277
+ maxWidth
1278
+ }) {
1279
+ const feedWidths = feeds.map((feed) => calculateFeedWidth(feed));
1280
+ const maxOfAllFeeds = Math.max(...feedWidths);
1281
+ const actualWidth = Math.min(maxOfAllFeeds, maxWidth);
1282
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1283
+ flexDirection: "column",
1284
+ children: feeds.map((feed, index) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(React3.Fragment, {
1285
+ children: [
1286
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Feed, {
1287
+ config: feed,
1288
+ actualWidth
1289
+ }, undefined, false, undefined, this),
1290
+ index < feeds.length - 1 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Divider, {
1291
+ color: "claude",
1292
+ width: actualWidth
1293
+ }, undefined, false, undefined, this)
1294
+ ]
1295
+ }, index, true, undefined, this))
1296
+ }, undefined, false, undefined, this);
1297
+ }
1298
+ var React3, jsx_dev_runtime5;
1299
+ var init_FeedColumn = __esm(() => {
1300
+ init_src();
1301
+ init_src();
1302
+ init_Feed();
1303
+ React3 = __toESM(require_react(), 1);
1304
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1305
+ });
1306
+
1307
+ // src/components/LogoV2/feedConfigs.tsx
1308
+ import { homedir } from "os";
1309
+ function createRecentActivityFeed(activities) {
1310
+ const lines = activities.map((log) => {
1311
+ const time = formatRelativeTimeAgo(log.modified);
1312
+ const description = log.summary && log.summary !== "No prompt" ? log.summary : log.firstPrompt;
1313
+ return {
1314
+ text: description || "",
1315
+ timestamp: time
1316
+ };
1317
+ });
1318
+ return {
1319
+ title: "Recent activity",
1320
+ lines,
1321
+ footer: lines.length > 0 ? "/resume for more" : undefined,
1322
+ emptyMessage: "No recent activity"
1323
+ };
1324
+ }
1325
+ function createWhatsNewFeed(releaseNotes) {
1326
+ const lines = releaseNotes.map((note) => {
1327
+ if (process.env.USER_TYPE === "ant") {
1328
+ const match = note.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);
1329
+ if (match) {
1330
+ return {
1331
+ timestamp: match[1],
1332
+ text: match[2] || ""
1333
+ };
1334
+ }
1335
+ }
1336
+ return {
1337
+ text: note
1338
+ };
1339
+ });
1340
+ const emptyMessage = process.env.USER_TYPE === "ant" ? "Unable to fetch latest claude-cli-internal commits" : "Check the Claude Code changelog for updates";
1341
+ return {
1342
+ title: process.env.USER_TYPE === "ant" ? "What's new [ANT-ONLY: Latest CC commits]" : "What's new",
1343
+ lines,
1344
+ footer: lines.length > 0 ? "/release-notes for more" : undefined,
1345
+ emptyMessage
1346
+ };
1347
+ }
1348
+ function createProjectOnboardingFeed(steps) {
1349
+ const enabledSteps = steps.filter(({ isEnabled }) => isEnabled).sort((a, b) => Number(a.isComplete) - Number(b.isComplete));
1350
+ const lines = enabledSteps.map(({ text, isComplete }) => {
1351
+ const checkmark = isComplete ? `${figures_default.tick} ` : "";
1352
+ return {
1353
+ text: `${checkmark}${text}`
1354
+ };
1355
+ });
1356
+ const warningText = getCwd() === homedir() ? "Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead." : undefined;
1357
+ if (warningText) {
1358
+ lines.push({
1359
+ text: warningText
1360
+ });
1361
+ }
1362
+ return {
1363
+ title: "Tips for getting started",
1364
+ lines
1365
+ };
1366
+ }
1367
+ function createGuestPassesFeed() {
1368
+ const reward = getCachedReferrerReward();
1369
+ const subtitle = reward ? `Share Claude Code and earn ${formatCreditAmount(reward)} of extra usage` : "Share Claude Code with friends";
1370
+ return {
1371
+ title: "3 guest passes",
1372
+ lines: [],
1373
+ customContent: {
1374
+ content: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
1375
+ children: [
1376
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1377
+ marginY: 1,
1378
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1379
+ color: "claude",
1380
+ children: "[\u273B] [\u273B] [\u273B]"
1381
+ }, undefined, false, undefined, this)
1382
+ }, undefined, false, undefined, this),
1383
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1384
+ dimColor: true,
1385
+ children: subtitle
1386
+ }, undefined, false, undefined, this)
1387
+ ]
1388
+ }, undefined, true, undefined, this),
1389
+ width: 48
1390
+ },
1391
+ footer: "/passes"
1392
+ };
1393
+ }
1394
+ var jsx_dev_runtime6;
1395
+ var init_feedConfigs = __esm(() => {
1396
+ init_figures();
1397
+ init_src();
1398
+ init_referral();
1399
+ init_cwd();
1400
+ init_format();
1401
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1402
+ });
1403
+
1404
+ // src/components/LogoV2/AnimatedClawd.tsx
1405
+ function hold(pose, offset, frames) {
1406
+ return Array.from({ length: frames }, () => ({ pose, offset }));
1407
+ }
1408
+ function AnimatedClawd() {
1409
+ const { pose, bounceOffset, onClick } = useClawdAnimation();
1410
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1411
+ height: CLAWD_HEIGHT,
1412
+ flexDirection: "column",
1413
+ onClick,
1414
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1415
+ marginTop: bounceOffset,
1416
+ flexShrink: 0,
1417
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Clawd, {
1418
+ pose
1419
+ }, undefined, false, undefined, this)
1420
+ }, undefined, false, undefined, this)
1421
+ }, undefined, false, undefined, this);
1422
+ }
1423
+ function useClawdAnimation() {
1424
+ const [reducedMotion] = import_react3.useState(() => getInitialSettings().prefersReducedMotion ?? false);
1425
+ const [frameIndex, setFrameIndex] = import_react3.useState(-1);
1426
+ const sequenceRef = import_react3.useRef(JUMP_WAVE);
1427
+ const onClick = () => {
1428
+ if (reducedMotion || frameIndex !== -1)
1429
+ return;
1430
+ sequenceRef.current = CLICK_ANIMATIONS[Math.floor(Math.random() * CLICK_ANIMATIONS.length)];
1431
+ setFrameIndex(0);
1432
+ };
1433
+ import_react3.useEffect(() => {
1434
+ if (frameIndex === -1)
1435
+ return;
1436
+ if (frameIndex >= sequenceRef.current.length) {
1437
+ setFrameIndex(-1);
1438
+ return;
1439
+ }
1440
+ const timer = setTimeout(setFrameIndex, FRAME_MS, incrementFrame);
1441
+ return () => clearTimeout(timer);
1442
+ }, [frameIndex]);
1443
+ const seq = sequenceRef.current;
1444
+ const current = frameIndex >= 0 && frameIndex < seq.length ? seq[frameIndex] : IDLE;
1445
+ return { pose: current.pose, bounceOffset: current.offset, onClick };
1446
+ }
1447
+ var import_react3, jsx_dev_runtime7, JUMP_WAVE, LOOK_AROUND, CLICK_ANIMATIONS, IDLE, FRAME_MS = 60, incrementFrame = (i) => i + 1, CLAWD_HEIGHT = 3;
1448
+ var init_AnimatedClawd = __esm(() => {
1449
+ init_src();
1450
+ init_settings();
1451
+ init_Clawd();
1452
+ import_react3 = __toESM(require_react(), 1);
1453
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1454
+ JUMP_WAVE = [
1455
+ ...hold("default", 1, 2),
1456
+ ...hold("arms-up", 0, 3),
1457
+ ...hold("default", 0, 1),
1458
+ ...hold("default", 1, 2),
1459
+ ...hold("arms-up", 0, 3),
1460
+ ...hold("default", 0, 1)
1461
+ ];
1462
+ LOOK_AROUND = [
1463
+ ...hold("look-right", 0, 5),
1464
+ ...hold("look-left", 0, 5),
1465
+ ...hold("default", 0, 1)
1466
+ ];
1467
+ CLICK_ANIMATIONS = [JUMP_WAVE, LOOK_AROUND];
1468
+ IDLE = { pose: "default", offset: 0 };
1469
+ });
1470
+
1471
+ // src/components/LogoV2/GuestPassesUpsell.tsx
1472
+ function resetIfPassesRefreshed() {
1473
+ const remaining = getCachedRemainingPasses();
1474
+ if (remaining == null || remaining <= 0)
1475
+ return;
1476
+ const config = getGlobalConfig();
1477
+ const lastSeen = config.passesLastSeenRemaining ?? 0;
1478
+ if (remaining > lastSeen) {
1479
+ saveGlobalConfig((prev) => ({
1480
+ ...prev,
1481
+ passesUpsellSeenCount: 0,
1482
+ hasVisitedPasses: false,
1483
+ passesLastSeenRemaining: remaining
1484
+ }));
1485
+ }
1486
+ }
1487
+ function shouldShowGuestPassesUpsell() {
1488
+ const { eligible, hasCache } = checkCachedPassesEligibility();
1489
+ if (!eligible || !hasCache)
1490
+ return false;
1491
+ resetIfPassesRefreshed();
1492
+ const config = getGlobalConfig();
1493
+ if ((config.passesUpsellSeenCount ?? 0) >= 3)
1494
+ return false;
1495
+ if (config.hasVisitedPasses)
1496
+ return false;
1497
+ return true;
1498
+ }
1499
+ function useShowGuestPassesUpsell() {
1500
+ const [show] = import_react4.useState(() => shouldShowGuestPassesUpsell());
1501
+ return show;
1502
+ }
1503
+ function incrementGuestPassesSeenCount() {
1504
+ let newCount = 0;
1505
+ saveGlobalConfig((prev) => {
1506
+ newCount = (prev.passesUpsellSeenCount ?? 0) + 1;
1507
+ return {
1508
+ ...prev,
1509
+ passesUpsellSeenCount: newCount
1510
+ };
1511
+ });
1512
+ logEvent("tengu_guest_passes_upsell_shown", {
1513
+ seen_count: newCount
1514
+ });
1515
+ }
1516
+ function GuestPassesUpsell() {
1517
+ const reward = getCachedReferrerReward();
1518
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1519
+ dimColor: true,
1520
+ children: [
1521
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1522
+ color: "claude",
1523
+ children: "[\u273B]"
1524
+ }, undefined, false, undefined, this),
1525
+ " ",
1526
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1527
+ color: "claude",
1528
+ children: "[\u273B]"
1529
+ }, undefined, false, undefined, this),
1530
+ " ",
1531
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1532
+ color: "claude",
1533
+ children: "[\u273B]"
1534
+ }, undefined, false, undefined, this),
1535
+ " \xB7",
1536
+ " ",
1537
+ reward ? `Share Claude Code and earn ${formatCreditAmount(reward)} of extra usage \xB7 /passes` : "3 guest passes at /passes"
1538
+ ]
1539
+ }, undefined, true, undefined, this);
1540
+ }
1541
+ var import_react4, jsx_dev_runtime8;
1542
+ var init_GuestPassesUpsell = __esm(() => {
1543
+ init_src();
1544
+ init_analytics();
1545
+ init_referral();
1546
+ init_config();
1547
+ import_react4 = __toESM(require_react(), 1);
1548
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1549
+ });
1550
+
1551
+ // src/components/LogoV2/CondensedLogo.tsx
1552
+ function CondensedLogo() {
1553
+ const { columns } = useTerminalSize();
1554
+ const agent = useAppState((s) => s.agent);
1555
+ const effortValue = useAppState((s) => s.effortValue);
1556
+ const model = useMainLoopModel();
1557
+ const modelDisplayName = renderModelSetting(model);
1558
+ const { version, cwd, billingType, agentName: agentNameFromSettings } = getLogoDisplayData();
1559
+ const agentName = agent ?? agentNameFromSettings;
1560
+ const showGuestPassesUpsell = useShowGuestPassesUpsell();
1561
+ const showOverageCreditUpsell = useShowOverageCreditUpsell();
1562
+ import_react5.useEffect(() => {
1563
+ if (showGuestPassesUpsell) {
1564
+ incrementGuestPassesSeenCount();
1565
+ }
1566
+ }, [showGuestPassesUpsell]);
1567
+ import_react5.useEffect(() => {
1568
+ if (showOverageCreditUpsell && !showGuestPassesUpsell) {
1569
+ incrementOverageCreditUpsellSeenCount();
1570
+ }
1571
+ }, [showOverageCreditUpsell, showGuestPassesUpsell]);
1572
+ const textWidth = Math.max(columns - 15, 20);
1573
+ const versionPrefix = "Claude Code v";
1574
+ const truncatedVersion = truncate(version, Math.max(textWidth - versionPrefix.length, 6));
1575
+ const effortSuffix = getEffortSuffix(model, effortValue);
1576
+ const { shouldSplit, truncatedModel, truncatedBilling } = formatModelAndBilling(modelDisplayName + effortSuffix, billingType, textWidth);
1577
+ const separator = " \xB7 ";
1578
+ const atPrefix = "@";
1579
+ const cwdAvailableWidth = agentName ? textWidth - atPrefix.length - stringWidth(agentName) - separator.length : textWidth;
1580
+ const truncatedCwd = truncatePath(cwd, Math.max(cwdAvailableWidth, 10));
1581
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(OffscreenFreeze, {
1582
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1583
+ flexDirection: "row",
1584
+ gap: 2,
1585
+ alignItems: "center",
1586
+ children: [
1587
+ isFullscreenEnvEnabled() ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(AnimatedClawd, {}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Clawd, {}, undefined, false, undefined, this),
1588
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1589
+ flexDirection: "column",
1590
+ children: [
1591
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1592
+ children: [
1593
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1594
+ bold: true,
1595
+ children: "Claude Code"
1596
+ }, undefined, false, undefined, this),
1597
+ " ",
1598
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1599
+ dimColor: true,
1600
+ children: [
1601
+ "v",
1602
+ truncatedVersion
1603
+ ]
1604
+ }, undefined, true, undefined, this)
1605
+ ]
1606
+ }, undefined, true, undefined, this),
1607
+ shouldSplit ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
1608
+ children: [
1609
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1610
+ dimColor: true,
1611
+ children: truncatedModel
1612
+ }, undefined, false, undefined, this),
1613
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1614
+ dimColor: true,
1615
+ children: truncatedBilling
1616
+ }, undefined, false, undefined, this)
1617
+ ]
1618
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1619
+ dimColor: true,
1620
+ children: [
1621
+ truncatedModel,
1622
+ " \xB7 ",
1623
+ truncatedBilling
1624
+ ]
1625
+ }, undefined, true, undefined, this),
1626
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1627
+ dimColor: true,
1628
+ children: agentName ? `@${agentName} \xB7 ${truncatedCwd}` : truncatedCwd
1629
+ }, undefined, false, undefined, this),
1630
+ showGuestPassesUpsell && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(GuestPassesUpsell, {}, undefined, false, undefined, this),
1631
+ !showGuestPassesUpsell && showOverageCreditUpsell && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(OverageCreditUpsell, {
1632
+ maxWidth: textWidth,
1633
+ twoLine: true
1634
+ }, undefined, false, undefined, this)
1635
+ ]
1636
+ }, undefined, true, undefined, this)
1637
+ ]
1638
+ }, undefined, true, undefined, this)
1639
+ }, undefined, false, undefined, this);
1640
+ }
1641
+ var import_react5, jsx_dev_runtime9;
1642
+ var init_CondensedLogo = __esm(() => {
1643
+ init_useMainLoopModel();
1644
+ init_useTerminalSize();
1645
+ init_src();
1646
+ init_AppState();
1647
+ init_effort();
1648
+ init_format();
1649
+ init_fullscreen();
1650
+ init_logoV2Utils();
1651
+ init_model();
1652
+ init_OffscreenFreeze();
1653
+ init_AnimatedClawd();
1654
+ init_Clawd();
1655
+ init_GuestPassesUpsell();
1656
+ init_OverageCreditUpsell();
1657
+ import_react5 = __toESM(require_react(), 1);
1658
+ jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
1659
+ });
1660
+
1661
+ // src/components/LogoV2/EmergencyTip.tsx
1662
+ function EmergencyTip() {
1663
+ const tip = import_react6.useMemo(getTipOfFeed, []);
1664
+ const lastShownTip = import_react6.useMemo(() => getGlobalConfig().lastShownEmergencyTip, []);
1665
+ const shouldShow = tip.tip && tip.tip !== lastShownTip;
1666
+ import_react6.useEffect(() => {
1667
+ if (shouldShow) {
1668
+ saveGlobalConfig((current) => {
1669
+ if (current.lastShownEmergencyTip === tip.tip)
1670
+ return current;
1671
+ return { ...current, lastShownEmergencyTip: tip.tip };
1672
+ });
1673
+ }
1674
+ }, [shouldShow, tip.tip]);
1675
+ if (!shouldShow) {
1676
+ return null;
1677
+ }
1678
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1679
+ paddingLeft: 2,
1680
+ flexDirection: "column",
1681
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1682
+ ...tip.color === "warning" ? { color: "warning" } : tip.color === "error" ? { color: "error" } : { dimColor: true },
1683
+ children: tip.tip
1684
+ }, undefined, false, undefined, this)
1685
+ }, undefined, false, undefined, this);
1686
+ }
1687
+ function getTipOfFeed() {
1688
+ return getDynamicConfig_CACHED_MAY_BE_STALE(CONFIG_NAME, DEFAULT_TIP);
1689
+ }
1690
+ var import_react6, jsx_dev_runtime10, CONFIG_NAME = "tengu-top-of-feed-tip", DEFAULT_TIP;
1691
+ var init_EmergencyTip = __esm(() => {
1692
+ init_src();
1693
+ init_growthbook();
1694
+ init_config();
1695
+ import_react6 = __toESM(require_react(), 1);
1696
+ jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
1697
+ DEFAULT_TIP = { tip: "", color: "dim" };
1698
+ });
1699
+
1700
+ // src/components/LogoV2/VoiceModeNotice.tsx
1701
+ function VoiceModeNotice() {
1702
+ return null;
1703
+ }
1704
+ var init_VoiceModeNotice = () => {};
1705
+
1706
+ // src/components/LogoV2/AnimatedAsterisk.tsx
1707
+ function AnimatedAsterisk({
1708
+ char = TEARDROP_ASTERISK
1709
+ }) {
1710
+ const [reducedMotion] = import_react7.useState(() => getInitialSettings().prefersReducedMotion ?? false);
1711
+ const [done, setDone] = import_react7.useState(reducedMotion);
1712
+ const startTimeRef = import_react7.useRef(null);
1713
+ const [ref, time] = useAnimationFrame(done ? null : 50);
1714
+ import_react7.useEffect(() => {
1715
+ if (done)
1716
+ return;
1717
+ const t = setTimeout(setDone, TOTAL_ANIMATION_MS, true);
1718
+ return () => clearTimeout(t);
1719
+ }, [done]);
1720
+ if (done) {
1721
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1722
+ ref,
1723
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1724
+ color: SETTLED_GREY,
1725
+ children: char
1726
+ }, undefined, false, undefined, this)
1727
+ }, undefined, false, undefined, this);
1728
+ }
1729
+ if (startTimeRef.current === null) {
1730
+ startTimeRef.current = time;
1731
+ }
1732
+ const elapsed = time - startTimeRef.current;
1733
+ const hue = elapsed / SWEEP_DURATION_MS * 360 % 360;
1734
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1735
+ ref,
1736
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1737
+ color: toRGBColor(hueToRgb(hue)),
1738
+ children: char
1739
+ }, undefined, false, undefined, this)
1740
+ }, undefined, false, undefined, this);
1741
+ }
1742
+ var import_react7, jsx_dev_runtime11, SWEEP_DURATION_MS = 1500, SWEEP_COUNT = 2, TOTAL_ANIMATION_MS, SETTLED_GREY;
1743
+ var init_AnimatedAsterisk = __esm(() => {
1744
+ init_figures2();
1745
+ init_src();
1746
+ init_settings();
1747
+ init_utils();
1748
+ import_react7 = __toESM(require_react(), 1);
1749
+ jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
1750
+ TOTAL_ANIMATION_MS = SWEEP_DURATION_MS * SWEEP_COUNT;
1751
+ SETTLED_GREY = toRGBColor({ r: 153, g: 153, b: 153 });
1752
+ });
1753
+
1754
+ // src/components/LogoV2/Opus1mMergeNotice.tsx
1755
+ function shouldShowOpus1mMergeNotice() {
1756
+ return isOpus1mMergeEnabled() && (getGlobalConfig().opus1mMergeNoticeSeenCount ?? 0) < MAX_SHOW_COUNT;
1757
+ }
1758
+ function Opus1mMergeNotice() {
1759
+ const [show] = import_react8.useState(shouldShowOpus1mMergeNotice);
1760
+ import_react8.useEffect(() => {
1761
+ if (!show)
1762
+ return;
1763
+ const newCount = (getGlobalConfig().opus1mMergeNoticeSeenCount ?? 0) + 1;
1764
+ saveGlobalConfig((prev) => {
1765
+ if ((prev.opus1mMergeNoticeSeenCount ?? 0) >= newCount)
1766
+ return prev;
1767
+ return { ...prev, opus1mMergeNoticeSeenCount: newCount };
1768
+ });
1769
+ }, [show]);
1770
+ if (!show)
1771
+ return null;
1772
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1773
+ paddingLeft: 2,
1774
+ children: [
1775
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(AnimatedAsterisk, {
1776
+ char: UP_ARROW
1777
+ }, undefined, false, undefined, this),
1778
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1779
+ dimColor: true,
1780
+ children: [
1781
+ " ",
1782
+ "Opus now defaults to 1M context \xB7 5x more room, same pricing"
1783
+ ]
1784
+ }, undefined, true, undefined, this)
1785
+ ]
1786
+ }, undefined, true, undefined, this);
1787
+ }
1788
+ var import_react8, jsx_dev_runtime12, MAX_SHOW_COUNT = 6;
1789
+ var init_Opus1mMergeNotice = __esm(() => {
1790
+ init_figures2();
1791
+ init_src();
1792
+ init_config();
1793
+ init_model();
1794
+ init_AnimatedAsterisk();
1795
+ import_react8 = __toESM(require_react(), 1);
1796
+ jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
1797
+ });
1798
+
1799
+ // src/components/LogoV2/GateOverridesWarning.tsx
1800
+ function GateOverridesWarning() {
1801
+ return null;
1802
+ }
1803
+ var init_GateOverridesWarning = () => {};
1804
+
1805
+ // src/components/LogoV2/ExperimentEnrollmentNotice.tsx
1806
+ function ExperimentEnrollmentNotice() {
1807
+ return null;
1808
+ }
1809
+ var init_ExperimentEnrollmentNotice = () => {};
1810
+
1811
+ // src/components/LogoV2/LogoV2.tsx
1812
+ function LogoV2() {
1813
+ const activities = getRecentActivitySync();
1814
+ const username = getGlobalConfig().oauthAccount?.displayName ?? "";
1815
+ const { columns } = useTerminalSize();
1816
+ const showOnboarding = shouldShowProjectOnboarding();
1817
+ const showSandboxStatus = SandboxManager.isSandboxingEnabled();
1818
+ const showGuestPassesUpsell = useShowGuestPassesUpsell();
1819
+ const showOverageCreditUpsell = useShowOverageCreditUpsell();
1820
+ const agent = useAppState((s) => s.agent);
1821
+ const effortValue = useAppState((s) => s.effortValue);
1822
+ const config = getGlobalConfig();
1823
+ let changelog;
1824
+ try {
1825
+ changelog = getRecentReleaseNotesSync(3);
1826
+ } catch {
1827
+ changelog = [];
1828
+ }
1829
+ const [announcement] = import_react9.useState(() => {
1830
+ const announcements = getInitialSettings().companyAnnouncements;
1831
+ if (!announcements || announcements.length === 0)
1832
+ return;
1833
+ return config.numStartups === 1 ? announcements[0] : announcements[Math.floor(Math.random() * announcements.length)];
1834
+ });
1835
+ const { hasReleaseNotes } = checkForReleaseNotesSync(config.lastReleaseNotesSeen);
1836
+ import_react9.useEffect(() => {
1837
+ const currentConfig = getGlobalConfig();
1838
+ if (currentConfig.lastReleaseNotesSeen === "2.1.888") {
1839
+ return;
1840
+ }
1841
+ saveGlobalConfig((current) => {
1842
+ if (current.lastReleaseNotesSeen === "2.1.888")
1843
+ return current;
1844
+ return { ...current, lastReleaseNotesSeen: "2.1.888" };
1845
+ });
1846
+ if (showOnboarding) {
1847
+ incrementProjectOnboardingSeenCount();
1848
+ }
1849
+ }, [config, showOnboarding]);
1850
+ const isCondensedMode = !hasReleaseNotes && !showOnboarding && !isEnvTruthy(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);
1851
+ import_react9.useEffect(() => {
1852
+ if (showGuestPassesUpsell && !showOnboarding && !isCondensedMode) {
1853
+ incrementGuestPassesSeenCount();
1854
+ }
1855
+ }, [showGuestPassesUpsell, showOnboarding, isCondensedMode]);
1856
+ import_react9.useEffect(() => {
1857
+ if (showOverageCreditUpsell && !showOnboarding && !showGuestPassesUpsell && !isCondensedMode) {
1858
+ incrementOverageCreditUpsellSeenCount();
1859
+ }
1860
+ }, [
1861
+ showOverageCreditUpsell,
1862
+ showOnboarding,
1863
+ showGuestPassesUpsell,
1864
+ isCondensedMode
1865
+ ]);
1866
+ const model = useMainLoopModel();
1867
+ const fullModelDisplayName = renderModelSetting(model);
1868
+ const {
1869
+ version,
1870
+ cwd,
1871
+ billingType,
1872
+ agentName: agentNameFromSettings
1873
+ } = getLogoDisplayData();
1874
+ const agentName = agent ?? agentNameFromSettings;
1875
+ const effortSuffix = getEffortSuffix(model, effortValue);
1876
+ const modelDisplayName = truncate(fullModelDisplayName + effortSuffix, LEFT_PANEL_MAX_WIDTH - 20);
1877
+ if (!hasReleaseNotes && !showOnboarding && !isEnvTruthy(process.env.CLAUDE_CODE_FORCE_FULL_LOGO)) {
1878
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
1879
+ children: [
1880
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(CondensedLogo, {}, undefined, false, undefined, this),
1881
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(VoiceModeNotice, {}, undefined, false, undefined, this),
1882
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Opus1mMergeNotice, {}, undefined, false, undefined, this),
1883
+ ChannelsNoticeModule && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ChannelsNoticeModule.ChannelsNotice, {}, undefined, false, undefined, this),
1884
+ isDebugMode() && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1885
+ paddingLeft: 2,
1886
+ flexDirection: "column",
1887
+ children: [
1888
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1889
+ color: "warning",
1890
+ children: "Debug mode enabled"
1891
+ }, undefined, false, undefined, this),
1892
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1893
+ dimColor: true,
1894
+ children: [
1895
+ "Logging to: ",
1896
+ isDebugToStdErr() ? "stderr" : getDebugLogPath()
1897
+ ]
1898
+ }, undefined, true, undefined, this)
1899
+ ]
1900
+ }, undefined, true, undefined, this),
1901
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(EmergencyTip, {}, undefined, false, undefined, this),
1902
+ process.env.CLAUDE_CODE_TMUX_SESSION && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1903
+ paddingLeft: 2,
1904
+ flexDirection: "column",
1905
+ children: [
1906
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1907
+ dimColor: true,
1908
+ children: [
1909
+ "tmux session: ",
1910
+ process.env.CLAUDE_CODE_TMUX_SESSION
1911
+ ]
1912
+ }, undefined, true, undefined, this),
1913
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1914
+ dimColor: true,
1915
+ children: process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS ? `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})` : `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`
1916
+ }, undefined, false, undefined, this)
1917
+ ]
1918
+ }, undefined, true, undefined, this),
1919
+ announcement && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1920
+ paddingLeft: 2,
1921
+ flexDirection: "column",
1922
+ children: [
1923
+ !process.env.IS_DEMO && config.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1924
+ dimColor: true,
1925
+ children: [
1926
+ "Message from ",
1927
+ config.oauthAccount.organizationName,
1928
+ ":"
1929
+ ]
1930
+ }, undefined, true, undefined, this),
1931
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1932
+ children: announcement
1933
+ }, undefined, false, undefined, this)
1934
+ ]
1935
+ }, undefined, true, undefined, this),
1936
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1937
+ paddingLeft: 2,
1938
+ flexDirection: "column",
1939
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1940
+ dimColor: true,
1941
+ children: "Use /issue to report model behavior issues"
1942
+ }, undefined, false, undefined, this)
1943
+ }, undefined, false, undefined, this),
1944
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1945
+ paddingLeft: 2,
1946
+ flexDirection: "column",
1947
+ children: [
1948
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1949
+ color: "warning",
1950
+ children: "[ANT-ONLY] Logs:"
1951
+ }, undefined, false, undefined, this),
1952
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1953
+ dimColor: true,
1954
+ children: [
1955
+ "API calls: ",
1956
+ getDisplayPath(getDumpPromptsPath())
1957
+ ]
1958
+ }, undefined, true, undefined, this),
1959
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1960
+ dimColor: true,
1961
+ children: [
1962
+ "Debug logs: ",
1963
+ getDisplayPath(getDebugLogPath())
1964
+ ]
1965
+ }, undefined, true, undefined, this),
1966
+ isDetailedProfilingEnabled() && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1967
+ dimColor: true,
1968
+ children: [
1969
+ "Startup Perf: ",
1970
+ getDisplayPath(getStartupPerfLogPath())
1971
+ ]
1972
+ }, undefined, true, undefined, this)
1973
+ ]
1974
+ }, undefined, true, undefined, this),
1975
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(GateOverridesWarning, {}, undefined, false, undefined, this),
1976
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExperimentEnrollmentNotice, {}, undefined, false, undefined, this)
1977
+ ]
1978
+ }, undefined, true, undefined, this);
1979
+ }
1980
+ const layoutMode = getLayoutMode(columns);
1981
+ const userTheme = resolveThemeSetting(getGlobalConfig().theme);
1982
+ const borderTitle = ` ${color("claude", userTheme)("Claude Code")} ${color("inactive", userTheme)(`v${version}`)} `;
1983
+ const compactBorderTitle = color("claude", userTheme)(" Claude Code ");
1984
+ if (layoutMode === "compact") {
1985
+ const layoutWidth = 4;
1986
+ let welcomeMessage2 = formatWelcomeMessage(username);
1987
+ if (stringWidth(welcomeMessage2) > columns - layoutWidth) {
1988
+ welcomeMessage2 = formatWelcomeMessage(null);
1989
+ }
1990
+ const separator = " \xB7 ";
1991
+ const atPrefix = "@";
1992
+ const cwdAvailableWidth2 = agentName ? columns - layoutWidth - atPrefix.length - stringWidth(agentName) - separator.length : columns - layoutWidth;
1993
+ const truncatedCwd2 = truncatePath(cwd, Math.max(cwdAvailableWidth2, 10));
1994
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
1995
+ children: [
1996
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(OffscreenFreeze, {
1997
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1998
+ flexDirection: "column",
1999
+ borderStyle: "round",
2000
+ borderColor: "claude",
2001
+ borderText: {
2002
+ content: compactBorderTitle,
2003
+ position: "top",
2004
+ align: "start",
2005
+ offset: 1
2006
+ },
2007
+ paddingX: 1,
2008
+ paddingY: 1,
2009
+ alignItems: "center",
2010
+ width: columns,
2011
+ children: [
2012
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2013
+ bold: true,
2014
+ children: welcomeMessage2
2015
+ }, undefined, false, undefined, this),
2016
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2017
+ marginY: 1,
2018
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Clawd, {}, undefined, false, undefined, this)
2019
+ }, undefined, false, undefined, this),
2020
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2021
+ dimColor: true,
2022
+ children: modelDisplayName
2023
+ }, undefined, false, undefined, this),
2024
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2025
+ dimColor: true,
2026
+ children: billingType
2027
+ }, undefined, false, undefined, this),
2028
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2029
+ dimColor: true,
2030
+ children: agentName ? `@${agentName} \xB7 ${truncatedCwd2}` : truncatedCwd2
2031
+ }, undefined, false, undefined, this)
2032
+ ]
2033
+ }, undefined, true, undefined, this)
2034
+ }, undefined, false, undefined, this),
2035
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(VoiceModeNotice, {}, undefined, false, undefined, this),
2036
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Opus1mMergeNotice, {}, undefined, false, undefined, this),
2037
+ ChannelsNoticeModule && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ChannelsNoticeModule.ChannelsNotice, {}, undefined, false, undefined, this),
2038
+ showSandboxStatus && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2039
+ marginTop: 1,
2040
+ flexDirection: "column",
2041
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2042
+ color: "warning",
2043
+ children: "Your bash commands will be sandboxed. Disable with /sandbox."
2044
+ }, undefined, false, undefined, this)
2045
+ }, undefined, false, undefined, this),
2046
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(GateOverridesWarning, {}, undefined, false, undefined, this),
2047
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExperimentEnrollmentNotice, {}, undefined, false, undefined, this)
2048
+ ]
2049
+ }, undefined, true, undefined, this);
2050
+ }
2051
+ const welcomeMessage = formatWelcomeMessage(username);
2052
+ const modelLine = !process.env.IS_DEMO && config.oauthAccount?.organizationName ? `${modelDisplayName} \xB7 ${billingType} \xB7 ${config.oauthAccount.organizationName}` : `${modelDisplayName} \xB7 ${billingType}`;
2053
+ const cwdSeparator = " \xB7 ";
2054
+ const cwdAtPrefix = "@";
2055
+ const cwdAvailableWidth = agentName ? LEFT_PANEL_MAX_WIDTH - cwdAtPrefix.length - stringWidth(agentName) - cwdSeparator.length : LEFT_PANEL_MAX_WIDTH;
2056
+ const truncatedCwd = truncatePath(cwd, Math.max(cwdAvailableWidth, 10));
2057
+ const cwdLine = agentName ? `@${agentName} \xB7 ${truncatedCwd}` : truncatedCwd;
2058
+ const optimalLeftWidth = calculateOptimalLeftWidth(welcomeMessage, cwdLine, modelLine);
2059
+ const { leftWidth, rightWidth } = calculateLayoutDimensions(columns, layoutMode, optimalLeftWidth);
2060
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
2061
+ children: [
2062
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(OffscreenFreeze, {
2063
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2064
+ flexDirection: "column",
2065
+ borderStyle: "round",
2066
+ borderColor: "claude",
2067
+ borderText: {
2068
+ content: borderTitle,
2069
+ position: "top",
2070
+ align: "start",
2071
+ offset: 3
2072
+ },
2073
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2074
+ flexDirection: layoutMode === "horizontal" ? "row" : "column",
2075
+ paddingX: 1,
2076
+ gap: 1,
2077
+ children: [
2078
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2079
+ flexDirection: "column",
2080
+ width: leftWidth,
2081
+ justifyContent: "space-between",
2082
+ alignItems: "center",
2083
+ minHeight: 9,
2084
+ children: [
2085
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2086
+ marginTop: 1,
2087
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2088
+ bold: true,
2089
+ children: welcomeMessage
2090
+ }, undefined, false, undefined, this)
2091
+ }, undefined, false, undefined, this),
2092
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Clawd, {}, undefined, false, undefined, this),
2093
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2094
+ flexDirection: "column",
2095
+ alignItems: "center",
2096
+ children: [
2097
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2098
+ dimColor: true,
2099
+ children: modelLine
2100
+ }, undefined, false, undefined, this),
2101
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2102
+ dimColor: true,
2103
+ children: cwdLine
2104
+ }, undefined, false, undefined, this)
2105
+ ]
2106
+ }, undefined, true, undefined, this)
2107
+ ]
2108
+ }, undefined, true, undefined, this),
2109
+ layoutMode === "horizontal" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2110
+ height: "100%",
2111
+ borderStyle: "single",
2112
+ borderColor: "claude",
2113
+ borderDimColor: true,
2114
+ borderTop: false,
2115
+ borderBottom: false,
2116
+ borderLeft: false
2117
+ }, undefined, false, undefined, this),
2118
+ layoutMode === "horizontal" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FeedColumn, {
2119
+ feeds: showOnboarding ? [
2120
+ createProjectOnboardingFeed(getSteps()),
2121
+ createRecentActivityFeed(activities)
2122
+ ] : showGuestPassesUpsell ? [
2123
+ createRecentActivityFeed(activities),
2124
+ createGuestPassesFeed()
2125
+ ] : showOverageCreditUpsell ? [
2126
+ createRecentActivityFeed(activities),
2127
+ createOverageCreditFeed()
2128
+ ] : [
2129
+ createRecentActivityFeed(activities),
2130
+ createWhatsNewFeed(changelog)
2131
+ ],
2132
+ maxWidth: rightWidth
2133
+ }, undefined, false, undefined, this)
2134
+ ]
2135
+ }, undefined, true, undefined, this)
2136
+ }, undefined, false, undefined, this)
2137
+ }, undefined, false, undefined, this),
2138
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(VoiceModeNotice, {}, undefined, false, undefined, this),
2139
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Opus1mMergeNotice, {}, undefined, false, undefined, this),
2140
+ ChannelsNoticeModule && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ChannelsNoticeModule.ChannelsNotice, {}, undefined, false, undefined, this),
2141
+ isDebugMode() && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2142
+ paddingLeft: 2,
2143
+ flexDirection: "column",
2144
+ children: [
2145
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2146
+ color: "warning",
2147
+ children: "Debug mode enabled"
2148
+ }, undefined, false, undefined, this),
2149
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2150
+ dimColor: true,
2151
+ children: [
2152
+ "Logging to: ",
2153
+ isDebugToStdErr() ? "stderr" : getDebugLogPath()
2154
+ ]
2155
+ }, undefined, true, undefined, this)
2156
+ ]
2157
+ }, undefined, true, undefined, this),
2158
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(EmergencyTip, {}, undefined, false, undefined, this),
2159
+ process.env.CLAUDE_CODE_TMUX_SESSION && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2160
+ paddingLeft: 2,
2161
+ flexDirection: "column",
2162
+ children: [
2163
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2164
+ dimColor: true,
2165
+ children: [
2166
+ "tmux session: ",
2167
+ process.env.CLAUDE_CODE_TMUX_SESSION
2168
+ ]
2169
+ }, undefined, true, undefined, this),
2170
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2171
+ dimColor: true,
2172
+ children: process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS ? `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})` : `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`
2173
+ }, undefined, false, undefined, this)
2174
+ ]
2175
+ }, undefined, true, undefined, this),
2176
+ announcement && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2177
+ paddingLeft: 2,
2178
+ flexDirection: "column",
2179
+ children: [
2180
+ !process.env.IS_DEMO && config.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2181
+ dimColor: true,
2182
+ children: [
2183
+ "Message from ",
2184
+ config.oauthAccount.organizationName,
2185
+ ":"
2186
+ ]
2187
+ }, undefined, true, undefined, this),
2188
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2189
+ children: announcement
2190
+ }, undefined, false, undefined, this)
2191
+ ]
2192
+ }, undefined, true, undefined, this),
2193
+ showSandboxStatus && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2194
+ paddingLeft: 2,
2195
+ flexDirection: "column",
2196
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2197
+ color: "warning",
2198
+ children: "Your bash commands will be sandboxed. Disable with /sandbox."
2199
+ }, undefined, false, undefined, this)
2200
+ }, undefined, false, undefined, this),
2201
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2202
+ paddingLeft: 2,
2203
+ flexDirection: "column",
2204
+ children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2205
+ dimColor: true,
2206
+ children: "Use /issue to report model behavior issues"
2207
+ }, undefined, false, undefined, this)
2208
+ }, undefined, false, undefined, this),
2209
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
2210
+ paddingLeft: 2,
2211
+ flexDirection: "column",
2212
+ children: [
2213
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2214
+ color: "warning",
2215
+ children: "[ANT-ONLY] Logs:"
2216
+ }, undefined, false, undefined, this),
2217
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2218
+ dimColor: true,
2219
+ children: [
2220
+ "API calls: ",
2221
+ getDisplayPath(getDumpPromptsPath())
2222
+ ]
2223
+ }, undefined, true, undefined, this),
2224
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2225
+ dimColor: true,
2226
+ children: [
2227
+ "Debug logs: ",
2228
+ getDisplayPath(getDebugLogPath())
2229
+ ]
2230
+ }, undefined, true, undefined, this),
2231
+ isDetailedProfilingEnabled() && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
2232
+ dimColor: true,
2233
+ children: [
2234
+ "Startup Perf: ",
2235
+ getDisplayPath(getStartupPerfLogPath())
2236
+ ]
2237
+ }, undefined, true, undefined, this)
2238
+ ]
2239
+ }, undefined, true, undefined, this),
2240
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(GateOverridesWarning, {}, undefined, false, undefined, this),
2241
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExperimentEnrollmentNotice, {}, undefined, false, undefined, this)
2242
+ ]
2243
+ }, undefined, true, undefined, this);
2244
+ }
2245
+ var import_react9, jsx_dev_runtime13, ChannelsNoticeModule = null, LEFT_PANEL_MAX_WIDTH = 50;
2246
+ var init_LogoV2 = __esm(() => {
2247
+ init_src();
2248
+ init_useTerminalSize();
2249
+ init_logoV2Utils();
2250
+ init_format();
2251
+ init_file();
2252
+ init_Clawd();
2253
+ init_FeedColumn();
2254
+ init_feedConfigs();
2255
+ init_config();
2256
+ init_systemTheme();
2257
+ init_settings();
2258
+ init_debug();
2259
+ init_projectOnboardingState();
2260
+ init_CondensedLogo();
2261
+ init_OffscreenFreeze();
2262
+ init_releaseNotes();
2263
+ init_dumpPrompts();
2264
+ init_envUtils();
2265
+ init_startupProfiler();
2266
+ init_EmergencyTip();
2267
+ init_VoiceModeNotice();
2268
+ init_Opus1mMergeNotice();
2269
+ init_GateOverridesWarning();
2270
+ init_ExperimentEnrollmentNotice();
2271
+ init_sandbox_adapter();
2272
+ init_GuestPassesUpsell();
2273
+ init_OverageCreditUpsell();
2274
+ init_AppState();
2275
+ init_effort();
2276
+ init_useMainLoopModel();
2277
+ init_model();
2278
+ import_react9 = __toESM(require_react(), 1);
2279
+ jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
2280
+ });
2281
+
2282
+ // src/components/MessageModel.tsx
2283
+ function MessageModel({
2284
+ message,
2285
+ isTranscriptMode
2286
+ }) {
2287
+ const shouldShowModel = isTranscriptMode && message.type === "assistant" && message.message.model && message.message.content.some((c) => c.type === "text");
2288
+ if (!shouldShowModel) {
2289
+ return null;
2290
+ }
2291
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ThemedBox_default, {
2292
+ minWidth: stringWidth(message.message.model) + 8,
2293
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ThemedText, {
2294
+ dimColor: true,
2295
+ children: message.message.model
2296
+ }, undefined, false, undefined, this)
2297
+ }, undefined, false, undefined, this);
2298
+ }
2299
+ var jsx_dev_runtime14;
2300
+ var init_MessageModel = __esm(() => {
2301
+ init_src();
2302
+ jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
2303
+ });
2304
+
2305
+ // src/components/MessageTimestamp.tsx
2306
+ function MessageTimestamp({
2307
+ message,
2308
+ isTranscriptMode
2309
+ }) {
2310
+ const shouldShowTimestamp = isTranscriptMode && message.timestamp && message.type === "assistant" && message.message.content.some((c) => c.type === "text");
2311
+ if (!shouldShowTimestamp) {
2312
+ return null;
2313
+ }
2314
+ const formattedTimestamp = new Date(message.timestamp).toLocaleTimeString("en-US", {
2315
+ hour: "2-digit",
2316
+ minute: "2-digit",
2317
+ hour12: true
2318
+ });
2319
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2320
+ minWidth: stringWidth(formattedTimestamp),
2321
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2322
+ dimColor: true,
2323
+ children: formattedTimestamp
2324
+ }, undefined, false, undefined, this)
2325
+ }, undefined, false, undefined, this);
2326
+ }
2327
+ var jsx_dev_runtime15;
2328
+ var init_MessageTimestamp = __esm(() => {
2329
+ init_src();
2330
+ jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
2331
+ });
2332
+
2333
+ // src/components/MessageRow.tsx
2334
+ function hasContentAfterIndex(messages, index, tools, streamingToolUseIDs) {
2335
+ for (let i = index + 1;i < messages.length; i++) {
2336
+ const msg = messages[i];
2337
+ if (msg?.type === "assistant") {
2338
+ const content = msg.message.content[0];
2339
+ if (content?.type === "thinking" || content?.type === "redacted_thinking") {
2340
+ continue;
2341
+ }
2342
+ if (content?.type === "tool_use") {
2343
+ if (getToolSearchOrReadInfo(content.name, content.input, tools).isCollapsible) {
2344
+ continue;
2345
+ }
2346
+ if (streamingToolUseIDs.has(content.id)) {
2347
+ continue;
2348
+ }
2349
+ }
2350
+ return true;
2351
+ }
2352
+ if (msg?.type === "system" || msg?.type === "attachment") {
2353
+ continue;
2354
+ }
2355
+ if (msg?.type === "user") {
2356
+ const content = msg.message.content[0];
2357
+ if (content?.type === "tool_result") {
2358
+ continue;
2359
+ }
2360
+ }
2361
+ if (msg?.type === "grouped_tool_use") {
2362
+ const firstInput = msg.messages[0]?.message.content[0]?.input;
2363
+ if (getToolSearchOrReadInfo(msg.toolName, firstInput, tools).isCollapsible) {
2364
+ continue;
2365
+ }
2366
+ }
2367
+ return true;
2368
+ }
2369
+ return false;
2370
+ }
2371
+ function MessageRowImpl({
2372
+ message: msg,
2373
+ isUserContinuation,
2374
+ hasContentAfter,
2375
+ tools,
2376
+ commands,
2377
+ verbose,
2378
+ inProgressToolUseIDs,
2379
+ streamingToolUseIDs,
2380
+ screen,
2381
+ canAnimate,
2382
+ onOpenRateLimitOptions,
2383
+ lastThinkingBlockId,
2384
+ latestBashOutputUUID,
2385
+ columns,
2386
+ isLoading,
2387
+ lookups
2388
+ }) {
2389
+ const isTranscriptMode = screen === "transcript";
2390
+ const isGrouped = msg.type === "grouped_tool_use";
2391
+ const isCollapsed = msg.type === "collapsed_read_search";
2392
+ const isActiveCollapsedGroup = isCollapsed && (hasAnyToolInProgress(msg, inProgressToolUseIDs) || isLoading && !hasContentAfter);
2393
+ const displayMsg = isGrouped ? msg.displayMessage : isCollapsed ? getDisplayMessageFromCollapsed(msg) : msg;
2394
+ const progressMessagesForMessage = isGrouped || isCollapsed ? [] : getProgressMessagesFromLookup(msg, lookups);
2395
+ const siblingToolUseIDs = isGrouped || isCollapsed ? EMPTY_STRING_SET : getSiblingToolUseIDsFromLookup(msg, lookups);
2396
+ const isStatic = shouldRenderStatically(msg, streamingToolUseIDs, inProgressToolUseIDs, siblingToolUseIDs, screen, lookups);
2397
+ let shouldAnimate = false;
2398
+ if (canAnimate) {
2399
+ if (isGrouped) {
2400
+ shouldAnimate = msg.messages.some((m) => {
2401
+ const content = m.message.content[0];
2402
+ return content?.type === "tool_use" && inProgressToolUseIDs.has(content.id);
2403
+ });
2404
+ } else if (isCollapsed) {
2405
+ shouldAnimate = hasAnyToolInProgress(msg, inProgressToolUseIDs);
2406
+ } else {
2407
+ const toolUseID = getToolUseID(msg);
2408
+ shouldAnimate = !toolUseID || inProgressToolUseIDs.has(toolUseID);
2409
+ }
2410
+ }
2411
+ const hasMetadata = isTranscriptMode && displayMsg.type === "assistant" && displayMsg.message.content.some((c) => c.type === "text") && (displayMsg.timestamp || displayMsg.message.model);
2412
+ const messageEl = /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Message, {
2413
+ message: msg,
2414
+ lookups,
2415
+ addMargin: !hasMetadata,
2416
+ containerWidth: hasMetadata ? undefined : columns,
2417
+ tools,
2418
+ commands,
2419
+ verbose,
2420
+ inProgressToolUseIDs,
2421
+ progressMessagesForMessage,
2422
+ shouldAnimate,
2423
+ shouldShowDot: true,
2424
+ isTranscriptMode,
2425
+ isStatic,
2426
+ onOpenRateLimitOptions,
2427
+ isActiveCollapsedGroup,
2428
+ isUserContinuation,
2429
+ lastThinkingBlockId,
2430
+ latestBashOutputUUID
2431
+ }, undefined, false, undefined, this);
2432
+ if (!hasMetadata) {
2433
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(OffscreenFreeze, {
2434
+ children: messageEl
2435
+ }, undefined, false, undefined, this);
2436
+ }
2437
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(OffscreenFreeze, {
2438
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ThemedBox_default, {
2439
+ width: columns,
2440
+ flexDirection: "column",
2441
+ children: [
2442
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ThemedBox_default, {
2443
+ flexDirection: "row",
2444
+ justifyContent: "flex-end",
2445
+ gap: 1,
2446
+ marginTop: 1,
2447
+ children: [
2448
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(MessageTimestamp, {
2449
+ message: displayMsg,
2450
+ isTranscriptMode
2451
+ }, undefined, false, undefined, this),
2452
+ /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(MessageModel, {
2453
+ message: displayMsg,
2454
+ isTranscriptMode
2455
+ }, undefined, false, undefined, this)
2456
+ ]
2457
+ }, undefined, true, undefined, this),
2458
+ messageEl
2459
+ ]
2460
+ }, undefined, true, undefined, this)
2461
+ }, undefined, false, undefined, this);
2462
+ }
2463
+ function isMessageStreaming(msg, streamingToolUseIDs) {
2464
+ if (msg.type === "grouped_tool_use") {
2465
+ return msg.messages.some((m) => {
2466
+ const content = m.message.content[0];
2467
+ return content?.type === "tool_use" && streamingToolUseIDs.has(content.id);
2468
+ });
2469
+ }
2470
+ if (msg.type === "collapsed_read_search") {
2471
+ const toolIds = getToolUseIdsFromCollapsedGroup(msg);
2472
+ return toolIds.some((id) => streamingToolUseIDs.has(id));
2473
+ }
2474
+ const toolUseID = getToolUseID(msg);
2475
+ return !!toolUseID && streamingToolUseIDs.has(toolUseID);
2476
+ }
2477
+ function allToolsResolved(msg, resolvedToolUseIDs) {
2478
+ if (msg.type === "grouped_tool_use") {
2479
+ return msg.messages.every((m) => {
2480
+ const content = m.message.content[0];
2481
+ return content?.type === "tool_use" && resolvedToolUseIDs.has(content.id);
2482
+ });
2483
+ }
2484
+ if (msg.type === "collapsed_read_search") {
2485
+ const toolIds = getToolUseIdsFromCollapsedGroup(msg);
2486
+ return toolIds.every((id) => resolvedToolUseIDs.has(id));
2487
+ }
2488
+ if (msg.type === "assistant") {
2489
+ const block = msg.message.content[0];
2490
+ if (block?.type === "server_tool_use") {
2491
+ return resolvedToolUseIDs.has(block.id);
2492
+ }
2493
+ }
2494
+ const toolUseID = getToolUseID(msg);
2495
+ return !toolUseID || resolvedToolUseIDs.has(toolUseID);
2496
+ }
2497
+ function areMessageRowPropsEqual(prev, next) {
2498
+ if (prev.message !== next.message)
2499
+ return false;
2500
+ if (prev.screen !== next.screen)
2501
+ return false;
2502
+ if (prev.verbose !== next.verbose)
2503
+ return false;
2504
+ if (prev.message.type === "collapsed_read_search" && next.screen !== "transcript") {
2505
+ return false;
2506
+ }
2507
+ if (prev.columns !== next.columns)
2508
+ return false;
2509
+ const prevIsLatestBash = prev.latestBashOutputUUID === prev.message.uuid;
2510
+ const nextIsLatestBash = next.latestBashOutputUUID === next.message.uuid;
2511
+ if (prevIsLatestBash !== nextIsLatestBash)
2512
+ return false;
2513
+ if (prev.lastThinkingBlockId !== next.lastThinkingBlockId && hasThinkingContent(next.message)) {
2514
+ return false;
2515
+ }
2516
+ const isStreaming = isMessageStreaming(prev.message, prev.streamingToolUseIDs);
2517
+ const isResolved = allToolsResolved(prev.message, prev.lookups.resolvedToolUseIDs);
2518
+ if (isStreaming || !isResolved)
2519
+ return false;
2520
+ return true;
2521
+ }
2522
+ var React4, jsx_dev_runtime16, MessageRow;
2523
+ var init_MessageRow = __esm(() => {
2524
+ init_src();
2525
+ init_collapseReadSearch();
2526
+ init_messages();
2527
+ init_Message();
2528
+ init_MessageModel();
2529
+ init_Messages();
2530
+ init_MessageTimestamp();
2531
+ init_OffscreenFreeze();
2532
+ React4 = __toESM(require_react(), 1);
2533
+ jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
2534
+ MessageRow = React4.memo(MessageRowImpl, areMessageRowPropsEqual);
2535
+ });
2536
+
2537
+ // src/utils/statusNoticeDefinitions.tsx
2538
+ import { relative } from "path";
2539
+ function getActiveNotices(context) {
2540
+ return statusNoticeDefinitions.filter((notice) => notice.isActive(context));
2541
+ }
2542
+ var jsx_dev_runtime17, largeMemoryFilesNotice, claudeAiSubscriberExternalTokenNotice, apiKeyConflictNotice, bothAuthMethodsNotice, largeAgentDescriptionsNotice, jetbrainsPluginNotice, statusNoticeDefinitions;
2543
+ var init_statusNoticeDefinitions = __esm(() => {
2544
+ init_src();
2545
+ init_claudemd();
2546
+ init_figures();
2547
+ init_cwd();
2548
+ init_format();
2549
+ init_auth();
2550
+ init_statusNoticeHelpers();
2551
+ init_ide();
2552
+ init_jetbrains();
2553
+ jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
2554
+ largeMemoryFilesNotice = {
2555
+ id: "large-memory-files",
2556
+ type: "warning",
2557
+ isActive: (ctx) => getLargeMemoryFiles(ctx.memoryFiles).length > 0,
2558
+ render: (ctx) => {
2559
+ const largeMemoryFiles = getLargeMemoryFiles(ctx.memoryFiles);
2560
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(jsx_dev_runtime17.Fragment, {
2561
+ children: largeMemoryFiles.map((file) => {
2562
+ const displayPath = file.path.startsWith(getCwd()) ? relative(getCwd(), file.path) : file.path;
2563
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2564
+ flexDirection: "row",
2565
+ children: [
2566
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2567
+ color: "warning",
2568
+ children: figures_default.warning
2569
+ }, undefined, false, undefined, this),
2570
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2571
+ color: "warning",
2572
+ children: [
2573
+ "Large ",
2574
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2575
+ bold: true,
2576
+ children: displayPath
2577
+ }, undefined, false, undefined, this),
2578
+ " will impact performance (",
2579
+ formatNumber(file.content.length),
2580
+ " chars >",
2581
+ " ",
2582
+ formatNumber(MAX_MEMORY_CHARACTER_COUNT),
2583
+ ")",
2584
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2585
+ dimColor: true,
2586
+ children: " \xB7 /memory to edit"
2587
+ }, undefined, false, undefined, this)
2588
+ ]
2589
+ }, undefined, true, undefined, this)
2590
+ ]
2591
+ }, file.path, true, undefined, this);
2592
+ })
2593
+ }, undefined, false, undefined, this);
2594
+ }
2595
+ };
2596
+ claudeAiSubscriberExternalTokenNotice = {
2597
+ id: "claude-ai-external-token",
2598
+ type: "warning",
2599
+ isActive: () => {
2600
+ const authTokenInfo = getAuthTokenSource();
2601
+ return isClaudeAISubscriber() && (authTokenInfo.source === "ANTHROPIC_AUTH_TOKEN" || authTokenInfo.source === "apiKeyHelper");
2602
+ },
2603
+ render: () => {
2604
+ const authTokenInfo = getAuthTokenSource();
2605
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2606
+ flexDirection: "row",
2607
+ marginTop: 1,
2608
+ children: [
2609
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2610
+ color: "warning",
2611
+ children: figures_default.warning
2612
+ }, undefined, false, undefined, this),
2613
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2614
+ color: "warning",
2615
+ children: [
2616
+ "Auth conflict: Using ",
2617
+ authTokenInfo.source,
2618
+ " instead of Claude account subscription token. Either unset ",
2619
+ authTokenInfo.source,
2620
+ ", or run `claude /logout`."
2621
+ ]
2622
+ }, undefined, true, undefined, this)
2623
+ ]
2624
+ }, undefined, true, undefined, this);
2625
+ }
2626
+ };
2627
+ apiKeyConflictNotice = {
2628
+ id: "api-key-conflict",
2629
+ type: "warning",
2630
+ isActive: () => {
2631
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2632
+ skipRetrievingKeyFromApiKeyHelper: true
2633
+ });
2634
+ return !!getApiKeyFromConfigOrMacOSKeychain() && (apiKeySource === "ANTHROPIC_API_KEY" || apiKeySource === "apiKeyHelper");
2635
+ },
2636
+ render: () => {
2637
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2638
+ skipRetrievingKeyFromApiKeyHelper: true
2639
+ });
2640
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2641
+ flexDirection: "row",
2642
+ marginTop: 1,
2643
+ children: [
2644
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2645
+ color: "warning",
2646
+ children: figures_default.warning
2647
+ }, undefined, false, undefined, this),
2648
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2649
+ color: "warning",
2650
+ children: [
2651
+ "Auth conflict: Using ",
2652
+ apiKeySource,
2653
+ " instead of Anthropic Console key. Either unset ",
2654
+ apiKeySource,
2655
+ ", or run `claude /logout`."
2656
+ ]
2657
+ }, undefined, true, undefined, this)
2658
+ ]
2659
+ }, undefined, true, undefined, this);
2660
+ }
2661
+ };
2662
+ bothAuthMethodsNotice = {
2663
+ id: "both-auth-methods",
2664
+ type: "warning",
2665
+ isActive: () => {
2666
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2667
+ skipRetrievingKeyFromApiKeyHelper: true
2668
+ });
2669
+ const authTokenInfo = getAuthTokenSource();
2670
+ return apiKeySource !== "none" && authTokenInfo.source !== "none" && !(apiKeySource === "apiKeyHelper" && authTokenInfo.source === "apiKeyHelper");
2671
+ },
2672
+ render: () => {
2673
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2674
+ skipRetrievingKeyFromApiKeyHelper: true
2675
+ });
2676
+ const authTokenInfo = getAuthTokenSource();
2677
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2678
+ flexDirection: "column",
2679
+ marginTop: 1,
2680
+ children: [
2681
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2682
+ flexDirection: "row",
2683
+ children: [
2684
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2685
+ color: "warning",
2686
+ children: figures_default.warning
2687
+ }, undefined, false, undefined, this),
2688
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2689
+ color: "warning",
2690
+ children: [
2691
+ "Auth conflict: Both a token (",
2692
+ authTokenInfo.source,
2693
+ ") and an API key (",
2694
+ apiKeySource,
2695
+ ") are set. This may lead to unexpected behavior."
2696
+ ]
2697
+ }, undefined, true, undefined, this)
2698
+ ]
2699
+ }, undefined, true, undefined, this),
2700
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2701
+ flexDirection: "column",
2702
+ marginLeft: 3,
2703
+ children: [
2704
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2705
+ color: "warning",
2706
+ children: [
2707
+ "\xB7 Trying to use",
2708
+ " ",
2709
+ authTokenInfo.source === "claude.ai" ? "claude.ai" : authTokenInfo.source,
2710
+ "?",
2711
+ " ",
2712
+ apiKeySource === "ANTHROPIC_API_KEY" ? 'Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.' : apiKeySource === "apiKeyHelper" ? "Unset the apiKeyHelper setting." : "claude /logout"
2713
+ ]
2714
+ }, undefined, true, undefined, this),
2715
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2716
+ color: "warning",
2717
+ children: [
2718
+ "\xB7 Trying to use ",
2719
+ apiKeySource,
2720
+ "?",
2721
+ " ",
2722
+ authTokenInfo.source === "claude.ai" ? "claude /logout to sign out of claude.ai." : `Unset the ${authTokenInfo.source} environment variable.`
2723
+ ]
2724
+ }, undefined, true, undefined, this)
2725
+ ]
2726
+ }, undefined, true, undefined, this)
2727
+ ]
2728
+ }, undefined, true, undefined, this);
2729
+ }
2730
+ };
2731
+ largeAgentDescriptionsNotice = {
2732
+ id: "large-agent-descriptions",
2733
+ type: "warning",
2734
+ isActive: (context) => {
2735
+ const totalTokens = getAgentDescriptionsTotalTokens(context.agentDefinitions);
2736
+ return totalTokens > AGENT_DESCRIPTIONS_THRESHOLD;
2737
+ },
2738
+ render: (context) => {
2739
+ const totalTokens = getAgentDescriptionsTotalTokens(context.agentDefinitions);
2740
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2741
+ flexDirection: "row",
2742
+ children: [
2743
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2744
+ color: "warning",
2745
+ children: figures_default.warning
2746
+ }, undefined, false, undefined, this),
2747
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2748
+ color: "warning",
2749
+ children: [
2750
+ "Large cumulative agent descriptions will impact performance (~",
2751
+ formatNumber(totalTokens),
2752
+ " tokens >",
2753
+ " ",
2754
+ formatNumber(AGENT_DESCRIPTIONS_THRESHOLD),
2755
+ ")",
2756
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2757
+ dimColor: true,
2758
+ children: " \xB7 /agents to manage"
2759
+ }, undefined, false, undefined, this)
2760
+ ]
2761
+ }, undefined, true, undefined, this)
2762
+ ]
2763
+ }, undefined, true, undefined, this);
2764
+ }
2765
+ };
2766
+ jetbrainsPluginNotice = {
2767
+ id: "jetbrains-plugin-install",
2768
+ type: "info",
2769
+ isActive: (context) => {
2770
+ if (!isSupportedJetBrainsTerminal()) {
2771
+ return false;
2772
+ }
2773
+ const shouldAutoInstall = context.config.autoInstallIdeExtension ?? true;
2774
+ if (!shouldAutoInstall) {
2775
+ return false;
2776
+ }
2777
+ const ideType = getTerminalIdeType();
2778
+ return ideType !== null && !isJetBrainsPluginInstalledCachedSync(ideType);
2779
+ },
2780
+ render: () => {
2781
+ const ideType = getTerminalIdeType();
2782
+ const ideName = toIDEDisplayName(ideType);
2783
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2784
+ flexDirection: "row",
2785
+ gap: 1,
2786
+ marginLeft: 1,
2787
+ children: [
2788
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2789
+ color: "ide",
2790
+ children: figures_default.arrowUp
2791
+ }, undefined, false, undefined, this),
2792
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2793
+ children: [
2794
+ "Install the ",
2795
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2796
+ color: "ide",
2797
+ children: ideName
2798
+ }, undefined, false, undefined, this),
2799
+ " plugin from the JetBrains Marketplace:",
2800
+ " ",
2801
+ /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2802
+ bold: true,
2803
+ children: "https://docs.claude.com/s/claude-code-jetbrains"
2804
+ }, undefined, false, undefined, this)
2805
+ ]
2806
+ }, undefined, true, undefined, this)
2807
+ ]
2808
+ }, undefined, true, undefined, this);
2809
+ }
2810
+ };
2811
+ statusNoticeDefinitions = [
2812
+ largeMemoryFilesNotice,
2813
+ largeAgentDescriptionsNotice,
2814
+ claudeAiSubscriberExternalTokenNotice,
2815
+ apiKeyConflictNotice,
2816
+ bothAuthMethodsNotice,
2817
+ jetbrainsPluginNotice
2818
+ ];
2819
+ });
2820
+
2821
+ // src/components/StatusNotices.tsx
2822
+ function StatusNotices({
2823
+ agentDefinitions
2824
+ } = {}) {
2825
+ const context = {
2826
+ config: getGlobalConfig(),
2827
+ agentDefinitions,
2828
+ memoryFiles: import_react10.use(getMemoryFiles())
2829
+ };
2830
+ const activeNotices = getActiveNotices(context);
2831
+ if (activeNotices.length === 0) {
2832
+ return null;
2833
+ }
2834
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(ThemedBox_default, {
2835
+ flexDirection: "column",
2836
+ paddingLeft: 1,
2837
+ children: activeNotices.map((notice) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(React5.Fragment, {
2838
+ children: notice.render(context)
2839
+ }, notice.id, false, undefined, this))
2840
+ }, undefined, false, undefined, this);
2841
+ }
2842
+ var React5, import_react10, jsx_dev_runtime18;
2843
+ var init_StatusNotices = __esm(() => {
2844
+ init_src();
2845
+ init_claudemd();
2846
+ init_config();
2847
+ init_statusNoticeDefinitions();
2848
+ React5 = __toESM(require_react(), 1);
2849
+ import_react10 = __toESM(require_react(), 1);
2850
+ jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
2851
+ });
2852
+
2853
+ // src/hooks/useVirtualScroll.ts
2854
+ function useVirtualScroll(scrollRef, itemKeys, columns) {
2855
+ const heightCache = import_react11.useRef(new Map);
2856
+ const offsetVersionRef = import_react11.useRef(0);
2857
+ const lastScrollTopRef = import_react11.useRef(0);
2858
+ const offsetsRef = import_react11.useRef({
2859
+ arr: new Float64Array(0),
2860
+ version: -1,
2861
+ n: -1
2862
+ });
2863
+ const itemRefs = import_react11.useRef(new Map);
2864
+ const refCache = import_react11.useRef(new Map);
2865
+ const prevColumns = import_react11.useRef(columns);
2866
+ const skipMeasurementRef = import_react11.useRef(false);
2867
+ const prevRangeRef = import_react11.useRef(null);
2868
+ const freezeRendersRef = import_react11.useRef(0);
2869
+ if (prevColumns.current !== columns) {
2870
+ const ratio = prevColumns.current / columns;
2871
+ prevColumns.current = columns;
2872
+ for (const [k, h] of heightCache.current) {
2873
+ heightCache.current.set(k, Math.max(1, Math.round(h * ratio)));
2874
+ }
2875
+ offsetVersionRef.current++;
2876
+ skipMeasurementRef.current = true;
2877
+ freezeRendersRef.current = 2;
2878
+ }
2879
+ const frozenRange = freezeRendersRef.current > 0 ? prevRangeRef.current : null;
2880
+ const listOriginRef = import_react11.useRef(0);
2881
+ const spacerRef = import_react11.useRef(null);
2882
+ const subscribe = import_react11.useCallback((listener) => scrollRef.current?.subscribe(listener) ?? NOOP_UNSUB, [scrollRef]);
2883
+ import_react11.useSyncExternalStore(subscribe, () => {
2884
+ const s = scrollRef.current;
2885
+ if (!s)
2886
+ return NaN;
2887
+ const target = s.getScrollTop() + s.getPendingDelta();
2888
+ const bin = Math.floor(target / SCROLL_QUANTUM);
2889
+ return s.isSticky() ? ~bin : bin;
2890
+ });
2891
+ const scrollTop = scrollRef.current?.getScrollTop() ?? -1;
2892
+ const pendingDelta = scrollRef.current?.getPendingDelta() ?? 0;
2893
+ const viewportH = scrollRef.current?.getViewportHeight() ?? 0;
2894
+ const isSticky = scrollRef.current?.isSticky() ?? true;
2895
+ import_react11.useMemo(() => {
2896
+ const live = new Set(itemKeys);
2897
+ let dirty = false;
2898
+ for (const k of heightCache.current.keys()) {
2899
+ if (!live.has(k)) {
2900
+ heightCache.current.delete(k);
2901
+ dirty = true;
2902
+ }
2903
+ }
2904
+ for (const k of refCache.current.keys()) {
2905
+ if (!live.has(k))
2906
+ refCache.current.delete(k);
2907
+ }
2908
+ if (dirty)
2909
+ offsetVersionRef.current++;
2910
+ }, [itemKeys]);
2911
+ const n = itemKeys.length;
2912
+ if (offsetsRef.current.version !== offsetVersionRef.current || offsetsRef.current.n !== n) {
2913
+ const arr = offsetsRef.current.arr.length >= n + 1 ? offsetsRef.current.arr : new Float64Array(n + 1);
2914
+ arr[0] = 0;
2915
+ for (let i = 0;i < n; i++) {
2916
+ arr[i + 1] = arr[i] + (heightCache.current.get(itemKeys[i]) ?? DEFAULT_ESTIMATE);
2917
+ }
2918
+ offsetsRef.current = { arr, version: offsetVersionRef.current, n };
2919
+ }
2920
+ const offsets = offsetsRef.current.arr;
2921
+ const totalHeight = offsets[n];
2922
+ let start;
2923
+ let end;
2924
+ if (frozenRange) {
2925
+ [start, end] = frozenRange;
2926
+ start = Math.min(start, n);
2927
+ end = Math.min(end, n);
2928
+ } else if (viewportH === 0 || scrollTop < 0) {
2929
+ start = Math.max(0, n - COLD_START_COUNT);
2930
+ end = n;
2931
+ } else {
2932
+ if (isSticky) {
2933
+ const budget = viewportH + OVERSCAN_ROWS;
2934
+ start = n;
2935
+ while (start > 0 && totalHeight - offsets[start - 1] < budget) {
2936
+ start--;
2937
+ }
2938
+ end = n;
2939
+ } else {
2940
+ const listOrigin2 = listOriginRef.current;
2941
+ const MAX_SPAN_ROWS = viewportH * 3;
2942
+ const rawLo = Math.min(scrollTop, scrollTop + pendingDelta);
2943
+ const rawHi = Math.max(scrollTop, scrollTop + pendingDelta);
2944
+ const span = rawHi - rawLo;
2945
+ const clampedLo = span > MAX_SPAN_ROWS ? pendingDelta < 0 ? rawHi - MAX_SPAN_ROWS : rawLo : rawLo;
2946
+ const clampedHi = clampedLo + Math.min(span, MAX_SPAN_ROWS);
2947
+ const effLo = Math.max(0, clampedLo - listOrigin2);
2948
+ const effHi = clampedHi - listOrigin2;
2949
+ const lo = effLo - OVERSCAN_ROWS;
2950
+ {
2951
+ let l = 0;
2952
+ let r = n;
2953
+ while (l < r) {
2954
+ const m = l + r >> 1;
2955
+ if (offsets[m + 1] <= lo)
2956
+ l = m + 1;
2957
+ else
2958
+ r = m;
2959
+ }
2960
+ start = l;
2961
+ }
2962
+ {
2963
+ const p = prevRangeRef.current;
2964
+ if (p && p[0] < start) {
2965
+ for (let i = p[0];i < Math.min(start, p[1]); i++) {
2966
+ const k = itemKeys[i];
2967
+ if (itemRefs.current.has(k) && !heightCache.current.has(k)) {
2968
+ start = i;
2969
+ break;
2970
+ }
2971
+ }
2972
+ }
2973
+ }
2974
+ const needed2 = viewportH + 2 * OVERSCAN_ROWS;
2975
+ const maxEnd = Math.min(n, start + MAX_MOUNTED_ITEMS);
2976
+ let coverage2 = 0;
2977
+ end = start;
2978
+ while (end < maxEnd && (coverage2 < needed2 || offsets[end] < effHi + viewportH + OVERSCAN_ROWS)) {
2979
+ coverage2 += heightCache.current.get(itemKeys[end]) ?? PESSIMISTIC_HEIGHT;
2980
+ end++;
2981
+ }
2982
+ }
2983
+ const needed = viewportH + 2 * OVERSCAN_ROWS;
2984
+ const minStart = Math.max(0, end - MAX_MOUNTED_ITEMS);
2985
+ let coverage = 0;
2986
+ for (let i = start;i < end; i++) {
2987
+ coverage += heightCache.current.get(itemKeys[i]) ?? PESSIMISTIC_HEIGHT;
2988
+ }
2989
+ while (start > minStart && coverage < needed) {
2990
+ start--;
2991
+ coverage += heightCache.current.get(itemKeys[start]) ?? PESSIMISTIC_HEIGHT;
2992
+ }
2993
+ const prev = prevRangeRef.current;
2994
+ const scrollVelocity = Math.abs(scrollTop - lastScrollTopRef.current) + Math.abs(pendingDelta);
2995
+ if (prev && scrollVelocity > viewportH * 2) {
2996
+ const [pS, pE] = prev;
2997
+ if (start < pS - SLIDE_STEP)
2998
+ start = pS - SLIDE_STEP;
2999
+ if (end > pE + SLIDE_STEP)
3000
+ end = pE + SLIDE_STEP;
3001
+ if (start > end)
3002
+ end = Math.min(start + SLIDE_STEP, n);
3003
+ }
3004
+ lastScrollTopRef.current = scrollTop;
3005
+ }
3006
+ if (freezeRendersRef.current > 0) {
3007
+ freezeRendersRef.current--;
3008
+ } else {
3009
+ prevRangeRef.current = [start, end];
3010
+ }
3011
+ const dStart = import_react11.useDeferredValue(start);
3012
+ const dEnd = import_react11.useDeferredValue(end);
3013
+ let effStart = start < dStart ? dStart : start;
3014
+ let effEnd = end > dEnd ? dEnd : end;
3015
+ if (effStart > effEnd || isSticky) {
3016
+ effStart = start;
3017
+ effEnd = end;
3018
+ }
3019
+ if (pendingDelta > 0) {
3020
+ effEnd = end;
3021
+ }
3022
+ if (effEnd - effStart > MAX_MOUNTED_ITEMS) {
3023
+ const mid = (offsets[effStart] + offsets[effEnd]) / 2;
3024
+ if (scrollTop - listOriginRef.current < mid) {
3025
+ effEnd = effStart + MAX_MOUNTED_ITEMS;
3026
+ } else {
3027
+ effStart = effEnd - MAX_MOUNTED_ITEMS;
3028
+ }
3029
+ }
3030
+ const listOrigin = listOriginRef.current;
3031
+ const effTopSpacer = offsets[effStart];
3032
+ const clampMin = effStart === 0 ? 0 : effTopSpacer + listOrigin;
3033
+ const clampMax = effEnd === n ? Infinity : Math.max(effTopSpacer, offsets[effEnd] - viewportH) + listOrigin;
3034
+ import_react11.useLayoutEffect(() => {
3035
+ if (isSticky) {
3036
+ scrollRef.current?.setClampBounds(undefined, undefined);
3037
+ } else {
3038
+ scrollRef.current?.setClampBounds(clampMin, clampMax);
3039
+ }
3040
+ });
3041
+ import_react11.useLayoutEffect(() => {
3042
+ const spacerYoga = spacerRef.current?.yogaNode;
3043
+ if (spacerYoga && spacerYoga.getComputedWidth() > 0) {
3044
+ listOriginRef.current = spacerYoga.getComputedTop();
3045
+ }
3046
+ if (skipMeasurementRef.current) {
3047
+ skipMeasurementRef.current = false;
3048
+ return;
3049
+ }
3050
+ let anyChanged = false;
3051
+ for (const [key, el] of itemRefs.current) {
3052
+ const yoga = el.yogaNode;
3053
+ if (!yoga)
3054
+ continue;
3055
+ const h = yoga.getComputedHeight();
3056
+ const prev = heightCache.current.get(key);
3057
+ if (h > 0) {
3058
+ if (prev !== h) {
3059
+ heightCache.current.set(key, h);
3060
+ anyChanged = true;
3061
+ }
3062
+ } else if (yoga.getComputedWidth() > 0 && prev !== 0) {
3063
+ heightCache.current.set(key, 0);
3064
+ anyChanged = true;
3065
+ }
3066
+ }
3067
+ if (anyChanged)
3068
+ offsetVersionRef.current++;
3069
+ });
3070
+ const measureRef = import_react11.useCallback((key) => {
3071
+ let fn = refCache.current.get(key);
3072
+ if (!fn) {
3073
+ fn = (el) => {
3074
+ if (el) {
3075
+ itemRefs.current.set(key, el);
3076
+ } else {
3077
+ const yoga = itemRefs.current.get(key)?.yogaNode;
3078
+ if (yoga && !skipMeasurementRef.current) {
3079
+ const h = yoga.getComputedHeight();
3080
+ if ((h > 0 || yoga.getComputedWidth() > 0) && heightCache.current.get(key) !== h) {
3081
+ heightCache.current.set(key, h);
3082
+ offsetVersionRef.current++;
3083
+ }
3084
+ }
3085
+ itemRefs.current.delete(key);
3086
+ }
3087
+ };
3088
+ refCache.current.set(key, fn);
3089
+ }
3090
+ return fn;
3091
+ }, []);
3092
+ const getItemTop = import_react11.useCallback((index) => {
3093
+ const yoga = itemRefs.current.get(itemKeys[index])?.yogaNode;
3094
+ if (!yoga || yoga.getComputedWidth() === 0)
3095
+ return -1;
3096
+ return yoga.getComputedTop();
3097
+ }, [itemKeys]);
3098
+ const getItemElement = import_react11.useCallback((index) => itemRefs.current.get(itemKeys[index]) ?? null, [itemKeys]);
3099
+ const getItemHeight = import_react11.useCallback((index) => heightCache.current.get(itemKeys[index]), [itemKeys]);
3100
+ const scrollToIndex = import_react11.useCallback((i) => {
3101
+ const o = offsetsRef.current;
3102
+ if (i < 0 || i >= o.n)
3103
+ return;
3104
+ scrollRef.current?.scrollTo(o.arr[i] + listOriginRef.current);
3105
+ }, [scrollRef]);
3106
+ const effBottomSpacer = totalHeight - offsets[effEnd];
3107
+ return {
3108
+ range: [effStart, effEnd],
3109
+ topSpacer: effTopSpacer,
3110
+ bottomSpacer: effBottomSpacer,
3111
+ measureRef,
3112
+ spacerRef,
3113
+ offsets,
3114
+ getItemTop,
3115
+ getItemElement,
3116
+ getItemHeight,
3117
+ scrollToIndex
3118
+ };
3119
+ }
3120
+ var import_react11, DEFAULT_ESTIMATE = 3, OVERSCAN_ROWS = 80, COLD_START_COUNT = 30, SCROLL_QUANTUM, PESSIMISTIC_HEIGHT = 1, MAX_MOUNTED_ITEMS = 300, SLIDE_STEP = 25, NOOP_UNSUB = () => {};
3121
+ var init_useVirtualScroll = __esm(() => {
3122
+ import_react11 = __toESM(require_react(), 1);
3123
+ SCROLL_QUANTUM = OVERSCAN_ROWS >> 1;
3124
+ });
3125
+
3126
+ // src/components/VirtualMessageList.tsx
3127
+ function defaultExtractSearchText(msg) {
3128
+ const cached = fallbackLowerCache.get(msg);
3129
+ if (cached !== undefined)
3130
+ return cached;
3131
+ const lowered = renderableSearchText(msg);
3132
+ fallbackLowerCache.set(msg, lowered);
3133
+ return lowered;
3134
+ }
3135
+ function stickyPromptText(msg) {
3136
+ const cached = promptTextCache.get(msg);
3137
+ if (cached !== undefined)
3138
+ return cached;
3139
+ const result = computeStickyPromptText(msg);
3140
+ promptTextCache.set(msg, result);
3141
+ return result;
3142
+ }
3143
+ function computeStickyPromptText(msg) {
3144
+ let raw = null;
3145
+ if (msg.type === "user") {
3146
+ if (msg.isMeta || msg.isVisibleInTranscriptOnly)
3147
+ return null;
3148
+ const block = msg.message.content[0];
3149
+ if (block?.type !== "text")
3150
+ return null;
3151
+ raw = block.text;
3152
+ } else if (msg.type === "attachment" && msg.attachment.type === "queued_command" && msg.attachment.commandMode !== "task-notification" && !msg.attachment.isMeta) {
3153
+ const p = msg.attachment.prompt;
3154
+ raw = typeof p === "string" ? p : p.flatMap((b) => b.type === "text" ? [b.text] : []).join(`
3155
+ `);
3156
+ }
3157
+ if (raw === null)
3158
+ return null;
3159
+ const t = stripSystemReminders(raw);
3160
+ if (t.startsWith("<") || t === "")
3161
+ return null;
3162
+ return t;
3163
+ }
3164
+ function VirtualItem({
3165
+ itemKey: k,
3166
+ msg,
3167
+ idx,
3168
+ measureRef,
3169
+ expanded,
3170
+ hovered,
3171
+ clickable,
3172
+ onClickK,
3173
+ onEnterK,
3174
+ onLeaveK,
3175
+ renderItem
3176
+ }) {
3177
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
3178
+ ref: measureRef(k),
3179
+ flexDirection: "column",
3180
+ backgroundColor: expanded ? "userMessageBackgroundHover" : undefined,
3181
+ paddingBottom: expanded ? 1 : undefined,
3182
+ onClick: clickable ? (e) => onClickK(msg, e.cellIsBlank) : undefined,
3183
+ onMouseEnter: clickable ? () => onEnterK(k) : undefined,
3184
+ onMouseLeave: clickable ? () => onLeaveK(k) : undefined,
3185
+ children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(TextHoverColorContext.Provider, {
3186
+ value: hovered && !expanded ? "text" : undefined,
3187
+ children: renderItem(msg, idx)
3188
+ }, undefined, false, undefined, this)
3189
+ }, undefined, false, undefined, this);
3190
+ }
3191
+ function VirtualMessageList({
3192
+ messages,
3193
+ scrollRef,
3194
+ columns,
3195
+ itemKey,
3196
+ renderItem,
3197
+ onItemClick,
3198
+ isItemClickable,
3199
+ isItemExpanded,
3200
+ extractSearchText = defaultExtractSearchText,
3201
+ trackStickyPrompt,
3202
+ selectedIndex,
3203
+ cursorNavRef,
3204
+ setCursor,
3205
+ jumpRef,
3206
+ onSearchMatchesChange,
3207
+ scanElement,
3208
+ setPositions
3209
+ }) {
3210
+ const keysRef = import_react12.useRef([]);
3211
+ const prevMessagesRef = import_react12.useRef(messages);
3212
+ const prevItemKeyRef = import_react12.useRef(itemKey);
3213
+ if (prevItemKeyRef.current !== itemKey || messages.length < keysRef.current.length || messages[0] !== prevMessagesRef.current[0]) {
3214
+ keysRef.current = messages.map((m) => itemKey(m));
3215
+ } else {
3216
+ for (let i = keysRef.current.length;i < messages.length; i++) {
3217
+ keysRef.current.push(itemKey(messages[i]));
3218
+ }
3219
+ }
3220
+ prevMessagesRef.current = messages;
3221
+ prevItemKeyRef.current = itemKey;
3222
+ const keys = keysRef.current;
3223
+ const {
3224
+ range,
3225
+ topSpacer,
3226
+ bottomSpacer,
3227
+ measureRef,
3228
+ spacerRef,
3229
+ offsets,
3230
+ getItemTop,
3231
+ getItemElement,
3232
+ getItemHeight,
3233
+ scrollToIndex
3234
+ } = useVirtualScroll(scrollRef, keys, columns);
3235
+ const [start, end] = range;
3236
+ const isVisible = import_react12.useCallback((i) => {
3237
+ const h = getItemHeight(i);
3238
+ if (h === 0)
3239
+ return false;
3240
+ return isNavigableMessage(messages[i]);
3241
+ }, [getItemHeight, messages]);
3242
+ import_react12.useImperativeHandle(cursorNavRef, () => {
3243
+ const select = (m) => setCursor?.({
3244
+ uuid: m.uuid,
3245
+ msgType: m.type,
3246
+ expanded: false,
3247
+ toolName: toolCallOf(m)?.name
3248
+ });
3249
+ const selIdx = selectedIndex ?? -1;
3250
+ const scan = (from, dir, pred = isVisible) => {
3251
+ for (let i = from;i >= 0 && i < messages.length; i += dir) {
3252
+ if (pred(i)) {
3253
+ select(messages[i]);
3254
+ return true;
3255
+ }
3256
+ }
3257
+ return false;
3258
+ };
3259
+ const isUser = (i) => isVisible(i) && messages[i].type === "user";
3260
+ return {
3261
+ enterCursor: () => scan(messages.length - 1, -1, isUser),
3262
+ navigatePrev: () => scan(selIdx - 1, -1),
3263
+ navigateNext: () => {
3264
+ if (scan(selIdx + 1, 1))
3265
+ return;
3266
+ scrollRef.current?.scrollToBottom();
3267
+ setCursor?.(null);
3268
+ },
3269
+ navigatePrevUser: () => scan(selIdx - 1, -1, isUser),
3270
+ navigateNextUser: () => scan(selIdx + 1, 1, isUser),
3271
+ navigateTop: () => scan(0, 1),
3272
+ navigateBottom: () => scan(messages.length - 1, -1),
3273
+ getSelected: () => selIdx >= 0 ? messages[selIdx] ?? null : null
3274
+ };
3275
+ }, [messages, selectedIndex, setCursor, isVisible]);
3276
+ const jumpState = import_react12.useRef({
3277
+ offsets,
3278
+ start,
3279
+ getItemElement,
3280
+ getItemTop,
3281
+ messages,
3282
+ scrollToIndex
3283
+ });
3284
+ jumpState.current = {
3285
+ offsets,
3286
+ start,
3287
+ getItemElement,
3288
+ getItemTop,
3289
+ messages,
3290
+ scrollToIndex
3291
+ };
3292
+ import_react12.useEffect(() => {
3293
+ if (selectedIndex === undefined)
3294
+ return;
3295
+ const s = jumpState.current;
3296
+ const el = s.getItemElement(selectedIndex);
3297
+ if (el) {
3298
+ scrollRef.current?.scrollToElement(el, 1);
3299
+ } else {
3300
+ s.scrollToIndex(selectedIndex);
3301
+ }
3302
+ }, [selectedIndex, scrollRef]);
3303
+ const scanRequestRef = import_react12.useRef(null);
3304
+ const elementPositions = import_react12.useRef({ msgIdx: -1, positions: [] });
3305
+ const startPtrRef = import_react12.useRef(-1);
3306
+ const phantomBurstRef = import_react12.useRef(0);
3307
+ const pendingStepRef = import_react12.useRef(0);
3308
+ const stepRef = import_react12.useRef(() => {});
3309
+ const highlightRef = import_react12.useRef(() => {});
3310
+ const searchState = import_react12.useRef({
3311
+ matches: [],
3312
+ ptr: 0,
3313
+ screenOrd: 0,
3314
+ prefixSum: []
3315
+ });
3316
+ const searchAnchor = import_react12.useRef(-1);
3317
+ const indexWarmed = import_react12.useRef(false);
3318
+ function targetFor(i) {
3319
+ const top = jumpState.current.getItemTop(i);
3320
+ return Math.max(0, top - HEADROOM);
3321
+ }
3322
+ function highlight(ord) {
3323
+ const s = scrollRef.current;
3324
+ const { msgIdx, positions } = elementPositions.current;
3325
+ if (!s || positions.length === 0 || msgIdx < 0) {
3326
+ setPositions?.(null);
3327
+ return;
3328
+ }
3329
+ const idx = Math.max(0, Math.min(ord, positions.length - 1));
3330
+ const p = positions[idx];
3331
+ const top = jumpState.current.getItemTop(msgIdx);
3332
+ const vpTop = s.getViewportTop();
3333
+ let lo = top - s.getScrollTop();
3334
+ const vp = s.getViewportHeight();
3335
+ let screenRow = vpTop + lo + p.row;
3336
+ if (screenRow < vpTop || screenRow >= vpTop + vp) {
3337
+ s.scrollTo(Math.max(0, top + p.row - HEADROOM));
3338
+ lo = top - s.getScrollTop();
3339
+ screenRow = vpTop + lo + p.row;
3340
+ }
3341
+ setPositions?.({ positions, rowOffset: vpTop + lo, currentIdx: idx });
3342
+ const st = searchState.current;
3343
+ const total = st.prefixSum.at(-1) ?? 0;
3344
+ const current = (st.prefixSum[st.ptr] ?? 0) + idx + 1;
3345
+ onSearchMatchesChange?.(total, current);
3346
+ logForDebugging(`highlight(i=${msgIdx}, ord=${idx}/${positions.length}): ` + `pos={row:${p.row},col:${p.col}} lo=${lo} screenRow=${screenRow} ` + `badge=${current}/${total}`);
3347
+ }
3348
+ highlightRef.current = highlight;
3349
+ const [seekGen, setSeekGen] = import_react12.useState(0);
3350
+ const bumpSeek = import_react12.useCallback(() => setSeekGen((g) => g + 1), []);
3351
+ import_react12.useEffect(() => {
3352
+ const req = scanRequestRef.current;
3353
+ if (!req)
3354
+ return;
3355
+ const { idx, wantLast, tries } = req;
3356
+ const s = scrollRef.current;
3357
+ if (!s)
3358
+ return;
3359
+ const { getItemElement: getItemElement2, getItemTop: getItemTop2, scrollToIndex: scrollToIndex2 } = jumpState.current;
3360
+ const el = getItemElement2(idx);
3361
+ const h = el?.yogaNode?.getComputedHeight() ?? 0;
3362
+ if (!el || h === 0) {
3363
+ if (tries > 1) {
3364
+ scanRequestRef.current = null;
3365
+ logForDebugging(`seek(i=${idx}): no mount after scrollToIndex, skip`);
3366
+ stepRef.current(wantLast ? -1 : 1);
3367
+ return;
3368
+ }
3369
+ scanRequestRef.current = { idx, wantLast, tries: tries + 1 };
3370
+ scrollToIndex2(idx);
3371
+ bumpSeek();
3372
+ return;
3373
+ }
3374
+ scanRequestRef.current = null;
3375
+ s.scrollTo(Math.max(0, getItemTop2(idx) - HEADROOM));
3376
+ const positions = scanElement?.(el) ?? [];
3377
+ elementPositions.current = { msgIdx: idx, positions };
3378
+ logForDebugging(`seek(i=${idx} t=${tries}): ${positions.length} positions`);
3379
+ if (positions.length === 0) {
3380
+ if (++phantomBurstRef.current > 20) {
3381
+ phantomBurstRef.current = 0;
3382
+ return;
3383
+ }
3384
+ stepRef.current(wantLast ? -1 : 1);
3385
+ return;
3386
+ }
3387
+ phantomBurstRef.current = 0;
3388
+ const ord = wantLast ? positions.length - 1 : 0;
3389
+ searchState.current.screenOrd = ord;
3390
+ startPtrRef.current = -1;
3391
+ highlightRef.current(ord);
3392
+ const pending = pendingStepRef.current;
3393
+ if (pending) {
3394
+ pendingStepRef.current = 0;
3395
+ stepRef.current(pending);
3396
+ }
3397
+ }, [seekGen]);
3398
+ function jump(i, wantLast) {
3399
+ const s = scrollRef.current;
3400
+ if (!s)
3401
+ return;
3402
+ const js = jumpState.current;
3403
+ const { getItemElement: getItemElement2, scrollToIndex: scrollToIndex2 } = js;
3404
+ if (i < 0 || i >= js.messages.length)
3405
+ return;
3406
+ setPositions?.(null);
3407
+ elementPositions.current = { msgIdx: -1, positions: [] };
3408
+ scanRequestRef.current = { idx: i, wantLast, tries: 0 };
3409
+ const el = getItemElement2(i);
3410
+ const h = el?.yogaNode?.getComputedHeight() ?? 0;
3411
+ if (el && h > 0) {
3412
+ s.scrollTo(targetFor(i));
3413
+ } else {
3414
+ scrollToIndex2(i);
3415
+ }
3416
+ bumpSeek();
3417
+ }
3418
+ function step(delta) {
3419
+ const st = searchState.current;
3420
+ const { matches, prefixSum } = st;
3421
+ const total = prefixSum.at(-1) ?? 0;
3422
+ if (matches.length === 0)
3423
+ return;
3424
+ if (scanRequestRef.current) {
3425
+ pendingStepRef.current = delta;
3426
+ return;
3427
+ }
3428
+ if (startPtrRef.current < 0)
3429
+ startPtrRef.current = st.ptr;
3430
+ const { positions } = elementPositions.current;
3431
+ const newOrd = st.screenOrd + delta;
3432
+ if (newOrd >= 0 && newOrd < positions.length) {
3433
+ st.screenOrd = newOrd;
3434
+ highlight(newOrd);
3435
+ startPtrRef.current = -1;
3436
+ return;
3437
+ }
3438
+ const ptr = (st.ptr + delta + matches.length) % matches.length;
3439
+ if (ptr === startPtrRef.current) {
3440
+ setPositions?.(null);
3441
+ startPtrRef.current = -1;
3442
+ logForDebugging(`step: wraparound at ptr=${ptr}, all ${matches.length} msgs phantoms`);
3443
+ return;
3444
+ }
3445
+ st.ptr = ptr;
3446
+ st.screenOrd = 0;
3447
+ jump(matches[ptr], delta < 0);
3448
+ const placeholder = delta < 0 ? prefixSum[ptr + 1] ?? total : prefixSum[ptr] + 1;
3449
+ onSearchMatchesChange?.(total, placeholder);
3450
+ }
3451
+ stepRef.current = step;
3452
+ import_react12.useImperativeHandle(jumpRef, () => ({
3453
+ jumpToIndex: (i) => {
3454
+ const s = scrollRef.current;
3455
+ if (s)
3456
+ s.scrollTo(targetFor(i));
3457
+ },
3458
+ setSearchQuery: (q) => {
3459
+ scanRequestRef.current = null;
3460
+ elementPositions.current = { msgIdx: -1, positions: [] };
3461
+ startPtrRef.current = -1;
3462
+ setPositions?.(null);
3463
+ const lq = q.toLowerCase();
3464
+ const matches = [];
3465
+ const prefixSum = [0];
3466
+ if (lq) {
3467
+ const msgs = jumpState.current.messages;
3468
+ for (let i = 0;i < msgs.length; i++) {
3469
+ const text = extractSearchText(msgs[i]);
3470
+ let pos = text.indexOf(lq);
3471
+ let cnt = 0;
3472
+ while (pos >= 0) {
3473
+ cnt++;
3474
+ pos = text.indexOf(lq, pos + lq.length);
3475
+ }
3476
+ if (cnt > 0) {
3477
+ matches.push(i);
3478
+ prefixSum.push(prefixSum.at(-1) + cnt);
3479
+ }
3480
+ }
3481
+ }
3482
+ const total = prefixSum.at(-1);
3483
+ let ptr = 0;
3484
+ const s = scrollRef.current;
3485
+ const { offsets: offsets2, start: start2, getItemTop: getItemTop2 } = jumpState.current;
3486
+ const firstTop = getItemTop2(start2);
3487
+ const origin = firstTop >= 0 ? firstTop - offsets2[start2] : 0;
3488
+ if (matches.length > 0 && s) {
3489
+ const curTop = searchAnchor.current >= 0 ? searchAnchor.current : s.getScrollTop();
3490
+ let best = Infinity;
3491
+ for (let k = 0;k < matches.length; k++) {
3492
+ const d = Math.abs(origin + offsets2[matches[k]] - curTop);
3493
+ if (d <= best) {
3494
+ best = d;
3495
+ ptr = k;
3496
+ }
3497
+ }
3498
+ logForDebugging(`setSearchQuery('${q}'): ${matches.length} msgs \xB7 ptr=${ptr} ` + `msgIdx=${matches[ptr]} curTop=${curTop} origin=${origin}`);
3499
+ }
3500
+ searchState.current = { matches, ptr, screenOrd: 0, prefixSum };
3501
+ if (matches.length > 0) {
3502
+ jump(matches[ptr], true);
3503
+ } else if (searchAnchor.current >= 0 && s) {
3504
+ s.scrollTo(searchAnchor.current);
3505
+ }
3506
+ onSearchMatchesChange?.(total, matches.length > 0 ? prefixSum[ptr + 1] ?? total : 0);
3507
+ },
3508
+ nextMatch: () => step(1),
3509
+ prevMatch: () => step(-1),
3510
+ setAnchor: () => {
3511
+ const s = scrollRef.current;
3512
+ if (s)
3513
+ searchAnchor.current = s.getScrollTop();
3514
+ },
3515
+ disarmSearch: () => {
3516
+ setPositions?.(null);
3517
+ scanRequestRef.current = null;
3518
+ elementPositions.current = { msgIdx: -1, positions: [] };
3519
+ startPtrRef.current = -1;
3520
+ },
3521
+ warmSearchIndex: async () => {
3522
+ if (indexWarmed.current)
3523
+ return 0;
3524
+ const msgs = jumpState.current.messages;
3525
+ const CHUNK = 500;
3526
+ let workMs = 0;
3527
+ const wallStart = performance.now();
3528
+ for (let i = 0;i < msgs.length; i += CHUNK) {
3529
+ await sleep(0);
3530
+ const t0 = performance.now();
3531
+ const end2 = Math.min(i + CHUNK, msgs.length);
3532
+ for (let j = i;j < end2; j++) {
3533
+ extractSearchText(msgs[j]);
3534
+ }
3535
+ workMs += performance.now() - t0;
3536
+ }
3537
+ const wallMs = Math.round(performance.now() - wallStart);
3538
+ logForDebugging(`warmSearchIndex: ${msgs.length} msgs \xB7 work=${Math.round(workMs)}ms wall=${wallMs}ms chunks=${Math.ceil(msgs.length / CHUNK)}`);
3539
+ indexWarmed.current = true;
3540
+ return Math.round(workMs);
3541
+ }
3542
+ }), [scrollRef]);
3543
+ const [hoveredKey, setHoveredKey] = import_react12.useState(null);
3544
+ const handlersRef = import_react12.useRef({ onItemClick, setHoveredKey });
3545
+ handlersRef.current = { onItemClick, setHoveredKey };
3546
+ const onClickK = import_react12.useCallback((msg, cellIsBlank) => {
3547
+ const h = handlersRef.current;
3548
+ if (!cellIsBlank && h.onItemClick)
3549
+ h.onItemClick(msg);
3550
+ }, []);
3551
+ const onEnterK = import_react12.useCallback((k) => {
3552
+ handlersRef.current.setHoveredKey(k);
3553
+ }, []);
3554
+ const onLeaveK = import_react12.useCallback((k) => {
3555
+ handlersRef.current.setHoveredKey((prev) => prev === k ? null : prev);
3556
+ }, []);
3557
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
3558
+ children: [
3559
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
3560
+ ref: spacerRef,
3561
+ height: topSpacer,
3562
+ flexShrink: 0
3563
+ }, undefined, false, undefined, this),
3564
+ messages.slice(start, end).map((msg, i) => {
3565
+ const idx = start + i;
3566
+ const k = keys[idx];
3567
+ const clickable = !!onItemClick && (isItemClickable?.(msg) ?? true);
3568
+ const hovered = clickable && hoveredKey === k;
3569
+ const expanded = isItemExpanded?.(msg);
3570
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(VirtualItem, {
3571
+ itemKey: k,
3572
+ msg,
3573
+ idx,
3574
+ measureRef,
3575
+ expanded,
3576
+ hovered,
3577
+ clickable,
3578
+ onClickK,
3579
+ onEnterK,
3580
+ onLeaveK,
3581
+ renderItem
3582
+ }, k, false, undefined, this);
3583
+ }),
3584
+ bottomSpacer > 0 && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
3585
+ height: bottomSpacer,
3586
+ flexShrink: 0
3587
+ }, undefined, false, undefined, this),
3588
+ trackStickyPrompt && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(StickyTracker, {
3589
+ messages,
3590
+ start,
3591
+ end,
3592
+ offsets,
3593
+ getItemTop,
3594
+ getItemElement,
3595
+ scrollRef
3596
+ }, undefined, false, undefined, this)
3597
+ ]
3598
+ }, undefined, true, undefined, this);
3599
+ }
3600
+ function StickyTracker({
3601
+ messages,
3602
+ start,
3603
+ end,
3604
+ offsets,
3605
+ getItemTop,
3606
+ getItemElement,
3607
+ scrollRef
3608
+ }) {
3609
+ const { setStickyPrompt } = import_react12.useContext(ScrollChromeContext);
3610
+ const subscribe = import_react12.useCallback((listener) => scrollRef.current?.subscribe(listener) ?? NOOP_UNSUB2, [scrollRef]);
3611
+ import_react12.useSyncExternalStore(subscribe, () => {
3612
+ const s = scrollRef.current;
3613
+ if (!s)
3614
+ return NaN;
3615
+ const t = s.getScrollTop() + s.getPendingDelta();
3616
+ return s.isSticky() ? -1 - t : t;
3617
+ });
3618
+ const isSticky = scrollRef.current?.isSticky() ?? true;
3619
+ const target = Math.max(0, (scrollRef.current?.getScrollTop() ?? 0) + (scrollRef.current?.getPendingDelta() ?? 0));
3620
+ let firstVisible = start;
3621
+ let firstVisibleTop = -1;
3622
+ for (let i = end - 1;i >= start; i--) {
3623
+ const top = getItemTop(i);
3624
+ if (top >= 0) {
3625
+ if (top < target)
3626
+ break;
3627
+ firstVisibleTop = top;
3628
+ }
3629
+ firstVisible = i;
3630
+ }
3631
+ let idx = -1;
3632
+ let text = null;
3633
+ if (firstVisible > 0 && !isSticky) {
3634
+ for (let i = firstVisible - 1;i >= 0; i--) {
3635
+ const t = stickyPromptText(messages[i]);
3636
+ if (t === null)
3637
+ continue;
3638
+ const top = getItemTop(i);
3639
+ if (top >= 0 && top + 1 >= target)
3640
+ continue;
3641
+ idx = i;
3642
+ text = t;
3643
+ break;
3644
+ }
3645
+ }
3646
+ const baseOffset = firstVisibleTop >= 0 ? firstVisibleTop - offsets[firstVisible] : 0;
3647
+ const estimate = idx >= 0 ? Math.max(0, baseOffset + offsets[idx]) : -1;
3648
+ const pending = import_react12.useRef({ idx: -1, tries: 0 });
3649
+ const suppress = import_react12.useRef("none");
3650
+ const lastIdx = import_react12.useRef(-1);
3651
+ import_react12.useEffect(() => {
3652
+ if (pending.current.idx >= 0)
3653
+ return;
3654
+ if (suppress.current === "armed") {
3655
+ suppress.current = "force";
3656
+ return;
3657
+ }
3658
+ const force = suppress.current === "force";
3659
+ suppress.current = "none";
3660
+ if (!force && lastIdx.current === idx)
3661
+ return;
3662
+ lastIdx.current = idx;
3663
+ if (text === null) {
3664
+ setStickyPrompt(null);
3665
+ return;
3666
+ }
3667
+ const trimmed = text.trimStart();
3668
+ const paraEnd = trimmed.search(/\n\s*\n/);
3669
+ const collapsed = (paraEnd >= 0 ? trimmed.slice(0, paraEnd) : trimmed).slice(0, STICKY_TEXT_CAP).replace(/\s+/g, " ").trim();
3670
+ if (collapsed === "") {
3671
+ setStickyPrompt(null);
3672
+ return;
3673
+ }
3674
+ const capturedIdx = idx;
3675
+ const capturedEstimate = estimate;
3676
+ setStickyPrompt({
3677
+ text: collapsed,
3678
+ scrollTo: () => {
3679
+ setStickyPrompt("clicked");
3680
+ suppress.current = "armed";
3681
+ const el = getItemElement(capturedIdx);
3682
+ if (el) {
3683
+ scrollRef.current?.scrollToElement(el, 1);
3684
+ } else {
3685
+ scrollRef.current?.scrollTo(capturedEstimate);
3686
+ pending.current = { idx: capturedIdx, tries: 0 };
3687
+ }
3688
+ }
3689
+ });
3690
+ });
3691
+ import_react12.useEffect(() => {
3692
+ if (pending.current.idx < 0)
3693
+ return;
3694
+ const el = getItemElement(pending.current.idx);
3695
+ if (el) {
3696
+ scrollRef.current?.scrollToElement(el, 1);
3697
+ pending.current = { idx: -1, tries: 0 };
3698
+ } else if (++pending.current.tries > 5) {
3699
+ pending.current = { idx: -1, tries: 0 };
3700
+ }
3701
+ });
3702
+ return null;
3703
+ }
3704
+ var import_react12, jsx_dev_runtime19, HEADROOM = 3, fallbackLowerCache, STICKY_TEXT_CAP = 500, promptTextCache, NOOP_UNSUB2 = () => {};
3705
+ var init_VirtualMessageList = __esm(() => {
3706
+ init_useVirtualScroll();
3707
+ init_src();
3708
+ init_ThemedText();
3709
+ init_FullscreenLayout();
3710
+ init_debug();
3711
+ init_sleep();
3712
+ init_transcriptSearch();
3713
+ init_messageActions();
3714
+ import_react12 = __toESM(require_react(), 1);
3715
+ jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
3716
+ fallbackLowerCache = new WeakMap;
3717
+ promptTextCache = new WeakMap;
3718
+ });
3719
+
3720
+ // src/components/Messages.tsx
3721
+ function filterForBriefTool(messages, briefToolNames) {
3722
+ const nameSet = new Set(briefToolNames);
3723
+ const briefToolUseIDs = new Set;
3724
+ return messages.filter((msg) => {
3725
+ if (msg.type === "system")
3726
+ return msg.subtype !== "api_metrics";
3727
+ const block = msg.message?.content[0];
3728
+ if (msg.type === "assistant") {
3729
+ if (msg.isApiErrorMessage)
3730
+ return true;
3731
+ if (block?.type === "tool_use" && block.name && nameSet.has(block.name)) {
3732
+ if ("id" in block) {
3733
+ briefToolUseIDs.add(block.id);
3734
+ }
3735
+ return true;
3736
+ }
3737
+ return false;
3738
+ }
3739
+ if (msg.type === "user") {
3740
+ if (block?.type === "tool_result") {
3741
+ return block.tool_use_id !== undefined && briefToolUseIDs.has(block.tool_use_id);
3742
+ }
3743
+ return !msg.isMeta;
3744
+ }
3745
+ if (msg.type === "attachment") {
3746
+ const att = msg.attachment;
3747
+ return att?.type === "queued_command" && att.commandMode === "prompt" && !att.isMeta && att.origin === undefined;
3748
+ }
3749
+ return false;
3750
+ });
3751
+ }
3752
+ function dropTextInBriefTurns(messages, briefToolNames) {
3753
+ const nameSet = new Set(briefToolNames);
3754
+ const turnsWithBrief = new Set;
3755
+ const textIndexToTurn = [];
3756
+ let turn = 0;
3757
+ for (let i = 0;i < messages.length; i++) {
3758
+ const msg = messages[i];
3759
+ const block = msg.message?.content[0];
3760
+ if (msg.type === "user" && block?.type !== "tool_result" && !msg.isMeta) {
3761
+ turn++;
3762
+ continue;
3763
+ }
3764
+ if (msg.type === "assistant") {
3765
+ if (block?.type === "text") {
3766
+ textIndexToTurn[i] = turn;
3767
+ } else if (block?.type === "tool_use" && block.name && nameSet.has(block.name)) {
3768
+ turnsWithBrief.add(turn);
3769
+ }
3770
+ }
3771
+ }
3772
+ if (turnsWithBrief.size === 0)
3773
+ return messages;
3774
+ return messages.filter((_, i) => {
3775
+ const t = textIndexToTurn[i];
3776
+ return t === undefined || !turnsWithBrief.has(t);
3777
+ });
3778
+ }
3779
+ function computeSliceStart(collapsed, anchorRef, cap = MAX_MESSAGES_WITHOUT_VIRTUALIZATION, step = MESSAGE_CAP_STEP) {
3780
+ const anchor = anchorRef.current;
3781
+ const anchorIdx = anchor ? collapsed.findIndex((m) => m.uuid === anchor.uuid) : -1;
3782
+ let start = anchorIdx >= 0 ? anchorIdx : anchor ? Math.min(anchor.idx, Math.max(0, collapsed.length - cap)) : 0;
3783
+ if (collapsed.length - start > cap + step) {
3784
+ start = collapsed.length - cap;
3785
+ }
3786
+ const msgAtStart = collapsed[start];
3787
+ if (msgAtStart && (anchor?.uuid !== msgAtStart.uuid || anchor.idx !== start)) {
3788
+ anchorRef.current = { uuid: msgAtStart.uuid, idx: start };
3789
+ } else if (!msgAtStart && anchor) {
3790
+ anchorRef.current = null;
3791
+ }
3792
+ return start;
3793
+ }
3794
+ function expandKey(msg) {
3795
+ return (msg.type === "assistant" || msg.type === "user" ? getToolUseID(msg) : null) ?? msg.uuid;
3796
+ }
3797
+ function setsEqual(a, b) {
3798
+ if (a.size !== b.size)
3799
+ return false;
3800
+ for (const item of a) {
3801
+ if (!b.has(item))
3802
+ return false;
3803
+ }
3804
+ return true;
3805
+ }
3806
+ function shouldRenderStatically(message, streamingToolUseIDs, inProgressToolUseIDs, siblingToolUseIDs, screen, lookups) {
3807
+ if (screen === "transcript") {
3808
+ return true;
3809
+ }
3810
+ switch (message.type) {
3811
+ case "attachment":
3812
+ case "user":
3813
+ case "assistant": {
3814
+ if (message.type === "assistant") {
3815
+ const block = message.message.content[0];
3816
+ if (block?.type === "server_tool_use") {
3817
+ return lookups.resolvedToolUseIDs.has(block.id);
3818
+ }
3819
+ }
3820
+ const toolUseID = getToolUseID(message);
3821
+ if (!toolUseID) {
3822
+ return true;
3823
+ }
3824
+ if (streamingToolUseIDs.has(toolUseID)) {
3825
+ return false;
3826
+ }
3827
+ if (inProgressToolUseIDs.has(toolUseID)) {
3828
+ return false;
3829
+ }
3830
+ if (hasUnresolvedHooksFromLookup(toolUseID, "PostToolUse", lookups)) {
3831
+ return false;
3832
+ }
3833
+ return every(siblingToolUseIDs, lookups.resolvedToolUseIDs);
3834
+ }
3835
+ case "system": {
3836
+ return message.subtype !== "api_error";
3837
+ }
3838
+ case "grouped_tool_use": {
3839
+ const allResolved = message.messages.every((msg) => {
3840
+ const content = msg.message.content[0];
3841
+ return content?.type === "tool_use" && lookups.resolvedToolUseIDs.has(content.id);
3842
+ });
3843
+ return allResolved;
3844
+ }
3845
+ case "collapsed_read_search": {
3846
+ return false;
3847
+ }
3848
+ }
3849
+ }
3850
+ var React6, import_react13, jsx_dev_runtime20, LogoHeader, proactiveModule = null, BRIEF_TOOL_NAME, SEND_USER_FILE_TOOL_NAME = null, MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE = 30, MAX_MESSAGES_WITHOUT_VIRTUALIZATION = 200, MESSAGE_CAP_STEP = 50, MessagesImpl = ({
3851
+ messages,
3852
+ tools,
3853
+ commands,
3854
+ verbose,
3855
+ toolJSX,
3856
+ toolUseConfirmQueue,
3857
+ inProgressToolUseIDs,
3858
+ isMessageSelectorVisible,
3859
+ conversationId,
3860
+ screen,
3861
+ streamingToolUses,
3862
+ showAllInTranscript = false,
3863
+ agentDefinitions,
3864
+ onOpenRateLimitOptions,
3865
+ hideLogo = false,
3866
+ isLoading,
3867
+ hidePastThinking = false,
3868
+ streamingThinking,
3869
+ streamingText,
3870
+ isBriefOnly = false,
3871
+ unseenDivider,
3872
+ scrollRef,
3873
+ trackStickyPrompt,
3874
+ jumpRef,
3875
+ onSearchMatchesChange,
3876
+ scanElement,
3877
+ setPositions,
3878
+ disableRenderCap = false,
3879
+ cursor = null,
3880
+ setCursor,
3881
+ cursorNavRef,
3882
+ renderRange
3883
+ }) => {
3884
+ const { columns } = useTerminalSize();
3885
+ const toggleShowAllShortcut = useShortcutDisplay("transcript:toggleShowAll", "Transcript", "Ctrl+E");
3886
+ const normalizedMessages = import_react13.useMemo(() => normalizeMessages(messages).filter(isNotEmptyMessage), [messages]);
3887
+ const isStreamingThinkingVisible = import_react13.useMemo(() => {
3888
+ if (!streamingThinking)
3889
+ return false;
3890
+ if (streamingThinking.isStreaming)
3891
+ return true;
3892
+ if (streamingThinking.streamingEndedAt) {
3893
+ return Date.now() - streamingThinking.streamingEndedAt < 30000;
3894
+ }
3895
+ return false;
3896
+ }, [streamingThinking]);
3897
+ const lastThinkingBlockId = import_react13.useMemo(() => {
3898
+ if (!hidePastThinking)
3899
+ return null;
3900
+ if (isStreamingThinkingVisible)
3901
+ return "streaming";
3902
+ for (let i = normalizedMessages.length - 1;i >= 0; i--) {
3903
+ const msg = normalizedMessages[i];
3904
+ if (msg?.type === "assistant") {
3905
+ const content = msg.message.content;
3906
+ for (let j = content.length - 1;j >= 0; j--) {
3907
+ if (content[j]?.type === "thinking") {
3908
+ return `${msg.uuid}:${j}`;
3909
+ }
3910
+ }
3911
+ } else if (msg?.type === "user") {
3912
+ const hasToolResult = msg.message.content.some((block) => block.type === "tool_result");
3913
+ if (!hasToolResult) {
3914
+ return "no-thinking";
3915
+ }
3916
+ }
3917
+ }
3918
+ return null;
3919
+ }, [normalizedMessages, hidePastThinking, isStreamingThinkingVisible]);
3920
+ const latestBashOutputUUID = import_react13.useMemo(() => {
3921
+ for (let i = normalizedMessages.length - 1;i >= 0; i--) {
3922
+ const msg = normalizedMessages[i];
3923
+ if (msg?.type === "user") {
3924
+ const content = msg.message.content;
3925
+ for (const block of content) {
3926
+ if (block.type === "text") {
3927
+ const text = block.text;
3928
+ if (text.startsWith("<bash-stdout") || text.startsWith("<bash-stderr")) {
3929
+ return msg.uuid;
3930
+ }
3931
+ }
3932
+ }
3933
+ }
3934
+ }
3935
+ return null;
3936
+ }, [normalizedMessages]);
3937
+ const normalizedToolUseIDs = import_react13.useMemo(() => getToolUseIDs(normalizedMessages), [normalizedMessages]);
3938
+ const streamingToolUsesWithoutInProgress = import_react13.useMemo(() => streamingToolUses.filter((stu) => !inProgressToolUseIDs.has(stu.contentBlock.id) && !normalizedToolUseIDs.has(stu.contentBlock.id)), [streamingToolUses, inProgressToolUseIDs, normalizedToolUseIDs]);
3939
+ const syntheticStreamingToolUseMessages = import_react13.useMemo(() => streamingToolUsesWithoutInProgress.flatMap((streamingToolUse) => {
3940
+ const msg = createAssistantMessage({
3941
+ content: [streamingToolUse.contentBlock]
3942
+ });
3943
+ msg.uuid = deriveUUID(streamingToolUse.contentBlock.id, 0);
3944
+ return normalizeMessages([msg]);
3945
+ }), [streamingToolUsesWithoutInProgress]);
3946
+ const isTranscriptMode = screen === "transcript";
3947
+ const disableVirtualScroll = import_react13.useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL), []);
3948
+ const virtualScrollRuntimeGate = scrollRef != null && !disableVirtualScroll;
3949
+ const shouldTruncate = isTranscriptMode && !showAllInTranscript && !virtualScrollRuntimeGate;
3950
+ const sliceAnchorRef = import_react13.useRef(null);
3951
+ const { collapsed, lookups, hasTruncatedMessages, hiddenMessageCount } = import_react13.useMemo(() => {
3952
+ const compactAwareMessages = verbose || isFullscreenEnvEnabled() ? normalizedMessages : getMessagesAfterCompactBoundary(normalizedMessages, {
3953
+ includeSnipped: true
3954
+ });
3955
+ const messagesToShowNotTruncated = reorderMessagesInUI(compactAwareMessages.filter((msg) => msg.type !== "progress").filter((msg) => !isNullRenderingAttachment(msg)).filter((_) => shouldShowUserMessage(_, isTranscriptMode)), syntheticStreamingToolUseMessages);
3956
+ const briefToolNames = [BRIEF_TOOL_NAME, SEND_USER_FILE_TOOL_NAME].filter((n) => n !== null);
3957
+ const dropTextToolNames = [BRIEF_TOOL_NAME].filter((n) => n !== null);
3958
+ const briefFiltered = briefToolNames.length > 0 && !isTranscriptMode ? isBriefOnly ? filterForBriefTool(messagesToShowNotTruncated, briefToolNames) : dropTextToolNames.length > 0 ? dropTextInBriefTurns(messagesToShowNotTruncated, dropTextToolNames) : messagesToShowNotTruncated : messagesToShowNotTruncated;
3959
+ const messagesToShow = shouldTruncate ? briefFiltered.slice(-MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE) : briefFiltered;
3960
+ const hasTruncatedMessages2 = shouldTruncate && briefFiltered.length > MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE;
3961
+ const { messages: groupedMessages } = applyGrouping(messagesToShow, tools, verbose);
3962
+ const collapsed2 = collapseBackgroundBashNotifications(collapseHookSummaries(collapseTeammateShutdowns(collapseReadSearchGroups(groupedMessages, tools))), verbose);
3963
+ const lookups2 = buildMessageLookups(normalizedMessages, messagesToShow);
3964
+ const hiddenMessageCount2 = messagesToShowNotTruncated.length - MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE;
3965
+ return {
3966
+ collapsed: collapsed2,
3967
+ lookups: lookups2,
3968
+ hasTruncatedMessages: hasTruncatedMessages2,
3969
+ hiddenMessageCount: hiddenMessageCount2
3970
+ };
3971
+ }, [
3972
+ verbose,
3973
+ normalizedMessages,
3974
+ isTranscriptMode,
3975
+ syntheticStreamingToolUseMessages,
3976
+ shouldTruncate,
3977
+ tools,
3978
+ isBriefOnly
3979
+ ]);
3980
+ const renderableMessages = import_react13.useMemo(() => {
3981
+ const capApplies = !virtualScrollRuntimeGate && !disableRenderCap;
3982
+ const sliceStart = capApplies ? computeSliceStart(collapsed, sliceAnchorRef) : 0;
3983
+ return renderRange ? collapsed.slice(renderRange[0], renderRange[1]) : sliceStart > 0 ? collapsed.slice(sliceStart) : collapsed;
3984
+ }, [collapsed, renderRange, virtualScrollRuntimeGate, disableRenderCap]);
3985
+ const streamingToolUseIDs = import_react13.useMemo(() => new Set(streamingToolUses.map((_) => _.contentBlock.id)), [streamingToolUses]);
3986
+ const dividerBeforeIndex = import_react13.useMemo(() => {
3987
+ if (!unseenDivider)
3988
+ return -1;
3989
+ const prefix = unseenDivider.firstUnseenUuid.slice(0, 24);
3990
+ return renderableMessages.findIndex((m) => m.uuid.slice(0, 24) === prefix);
3991
+ }, [unseenDivider, renderableMessages]);
3992
+ const selectedIdx = import_react13.useMemo(() => {
3993
+ if (!cursor)
3994
+ return -1;
3995
+ return renderableMessages.findIndex((m) => m.uuid === cursor.uuid);
3996
+ }, [cursor, renderableMessages]);
3997
+ const [expandedKeys, setExpandedKeys] = import_react13.useState(() => new Set);
3998
+ const onItemClick = import_react13.useCallback((msg) => {
3999
+ const k = expandKey(msg);
4000
+ setExpandedKeys((prev) => {
4001
+ const next = new Set(prev);
4002
+ if (next.has(k))
4003
+ next.delete(k);
4004
+ else
4005
+ next.add(k);
4006
+ return next;
4007
+ });
4008
+ }, []);
4009
+ const isItemExpanded = import_react13.useCallback((msg) => expandedKeys.size > 0 && expandedKeys.has(expandKey(msg)), [expandedKeys]);
4010
+ const lookupsRef = import_react13.useRef(lookups);
4011
+ lookupsRef.current = lookups;
4012
+ const isItemClickable = import_react13.useCallback((msg) => {
4013
+ if (msg.type === "collapsed_read_search")
4014
+ return true;
4015
+ if (msg.type === "assistant") {
4016
+ const b2 = msg.message.content[0];
4017
+ return b2 != null && isAdvisorBlock(b2) && b2.type === "advisor_tool_result" && b2.content.type === "advisor_result";
4018
+ }
4019
+ if (msg.type !== "user")
4020
+ return false;
4021
+ const b = msg.message.content[0];
4022
+ if (b?.type !== "tool_result" || b.is_error || !msg.toolUseResult)
4023
+ return false;
4024
+ const name = lookupsRef.current.toolUseByToolUseID.get(b.tool_use_id)?.name;
4025
+ const tool = name ? findToolByName(tools, name) : undefined;
4026
+ return tool?.isResultTruncated?.(msg.toolUseResult) ?? false;
4027
+ }, [tools]);
4028
+ const canAnimate = (!toolJSX || !!toolJSX.shouldContinueAnimation) && !toolUseConfirmQueue.length && !isMessageSelectorVisible;
4029
+ const hasToolsInProgress = inProgressToolUseIDs.size > 0;
4030
+ const { progress } = useTerminalNotification();
4031
+ const prevProgressState = import_react13.useRef(null);
4032
+ const progressEnabled = getGlobalConfig().terminalProgressBarEnabled && !getIsRemoteMode() && !(proactiveModule?.isProactiveActive() ?? false);
4033
+ import_react13.useEffect(() => {
4034
+ const state = progressEnabled ? hasToolsInProgress ? "indeterminate" : "completed" : null;
4035
+ if (prevProgressState.current === state)
4036
+ return;
4037
+ prevProgressState.current = state;
4038
+ progress(state);
4039
+ }, [progress, progressEnabled, hasToolsInProgress]);
4040
+ import_react13.useEffect(() => {
4041
+ return () => progress(null);
4042
+ }, [progress]);
4043
+ const messageKey = import_react13.useCallback((msg) => `${msg.uuid}-${conversationId}`, [conversationId]);
4044
+ const renderMessageRow = (msg, index) => {
4045
+ const prevType = index > 0 ? renderableMessages[index - 1]?.type : undefined;
4046
+ const isUserContinuation = msg.type === "user" && prevType === "user";
4047
+ const hasContentAfter = msg.type === "collapsed_read_search" && (!!streamingText || hasContentAfterIndex(renderableMessages, index, tools, streamingToolUseIDs));
4048
+ const k = messageKey(msg);
4049
+ const row = /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(MessageRow, {
4050
+ message: msg,
4051
+ isUserContinuation,
4052
+ hasContentAfter,
4053
+ tools,
4054
+ commands,
4055
+ verbose: verbose || isItemExpanded(msg) || cursor?.expanded === true && index === selectedIdx,
4056
+ inProgressToolUseIDs,
4057
+ streamingToolUseIDs,
4058
+ screen,
4059
+ canAnimate,
4060
+ onOpenRateLimitOptions,
4061
+ lastThinkingBlockId,
4062
+ latestBashOutputUUID,
4063
+ columns,
4064
+ isLoading,
4065
+ lookups
4066
+ }, k, false, undefined, this);
4067
+ const wrapped = /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(MessageActionsSelectedContext.Provider, {
4068
+ value: index === selectedIdx,
4069
+ children: row
4070
+ }, k, false, undefined, this);
4071
+ if (unseenDivider && index === dividerBeforeIndex) {
4072
+ return [
4073
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4074
+ marginTop: 1,
4075
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Divider, {
4076
+ title: `${unseenDivider.count} new ${plural(unseenDivider.count, "message")}`,
4077
+ width: columns,
4078
+ color: "inactive"
4079
+ }, undefined, false, undefined, this)
4080
+ }, "unseen-divider", false, undefined, this),
4081
+ wrapped
4082
+ ];
4083
+ }
4084
+ return wrapped;
4085
+ };
4086
+ const searchTextCache2 = import_react13.useRef(new WeakMap);
4087
+ const extractSearchText = import_react13.useCallback((msg) => {
4088
+ const cached = searchTextCache2.current.get(msg);
4089
+ if (cached !== undefined)
4090
+ return cached;
4091
+ let text = renderableSearchText(msg);
4092
+ if (msg.type === "user" && msg.toolUseResult && Array.isArray(msg.message.content)) {
4093
+ const tr = msg.message.content.find((b) => b.type === "tool_result");
4094
+ if (tr && "tool_use_id" in tr) {
4095
+ const tu = lookups.toolUseByToolUseID.get(tr.tool_use_id);
4096
+ const tool = tu && findToolByName(tools, tu.name);
4097
+ const extracted = tool?.extractSearchText?.(msg.toolUseResult);
4098
+ if (extracted !== undefined)
4099
+ text = extracted;
4100
+ }
4101
+ }
4102
+ const lowered = text.toLowerCase();
4103
+ searchTextCache2.current.set(msg, lowered);
4104
+ return lowered;
4105
+ }, [tools, lookups]);
4106
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
4107
+ children: [
4108
+ !hideLogo && !(renderRange && renderRange[0] > 0) && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(LogoHeader, {
4109
+ agentDefinitions
4110
+ }, undefined, false, undefined, this),
4111
+ hasTruncatedMessages && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Divider, {
4112
+ title: `${toggleShowAllShortcut} to show ${source_default.bold(hiddenMessageCount)} previous messages`,
4113
+ width: columns
4114
+ }, undefined, false, undefined, this),
4115
+ isTranscriptMode && showAllInTranscript && hiddenMessageCount > 0 && !disableRenderCap && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Divider, {
4116
+ title: `${toggleShowAllShortcut} to hide ${source_default.bold(hiddenMessageCount)} previous messages`,
4117
+ width: columns
4118
+ }, undefined, false, undefined, this),
4119
+ virtualScrollRuntimeGate ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(InVirtualListContext.Provider, {
4120
+ value: true,
4121
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(VirtualMessageList, {
4122
+ messages: renderableMessages,
4123
+ scrollRef,
4124
+ columns,
4125
+ itemKey: messageKey,
4126
+ renderItem: renderMessageRow,
4127
+ onItemClick,
4128
+ isItemClickable,
4129
+ isItemExpanded,
4130
+ trackStickyPrompt,
4131
+ selectedIndex: selectedIdx >= 0 ? selectedIdx : undefined,
4132
+ cursorNavRef,
4133
+ setCursor,
4134
+ jumpRef,
4135
+ onSearchMatchesChange,
4136
+ scanElement,
4137
+ setPositions,
4138
+ extractSearchText
4139
+ }, undefined, false, undefined, this)
4140
+ }, undefined, false, undefined, this) : renderableMessages.flatMap(renderMessageRow),
4141
+ streamingText && !isBriefOnly && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4142
+ alignItems: "flex-start",
4143
+ flexDirection: "row",
4144
+ marginTop: 1,
4145
+ width: "100%",
4146
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4147
+ flexDirection: "row",
4148
+ children: [
4149
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4150
+ minWidth: 2,
4151
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedText, {
4152
+ color: "text",
4153
+ children: BLACK_CIRCLE
4154
+ }, undefined, false, undefined, this)
4155
+ }, undefined, false, undefined, this),
4156
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4157
+ flexDirection: "column",
4158
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StreamingMarkdown, {
4159
+ children: streamingText
4160
+ }, undefined, false, undefined, this)
4161
+ }, undefined, false, undefined, this)
4162
+ ]
4163
+ }, undefined, true, undefined, this)
4164
+ }, undefined, false, undefined, this),
4165
+ isStreamingThinkingVisible && streamingThinking && !isBriefOnly && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4166
+ marginTop: 1,
4167
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(AssistantThinkingMessage, {
4168
+ param: {
4169
+ type: "thinking",
4170
+ thinking: streamingThinking.thinking
4171
+ },
4172
+ addMargin: false,
4173
+ isTranscriptMode: true,
4174
+ verbose,
4175
+ hideInTranscript: false
4176
+ }, undefined, false, undefined, this)
4177
+ }, undefined, false, undefined, this)
4178
+ ]
4179
+ }, undefined, true, undefined, this);
4180
+ }, Messages;
4181
+ var init_Messages = __esm(() => {
4182
+ init_source();
4183
+ init_set();
4184
+ init_state();
4185
+ init_figures2();
4186
+ init_useTerminalSize();
4187
+ init_src();
4188
+ init_src();
4189
+ init_useShortcutDisplay();
4190
+ init_Tool();
4191
+ init_advisor();
4192
+ init_collapseBackgroundBashNotifications();
4193
+ init_collapseHookSummaries();
4194
+ init_collapseReadSearch();
4195
+ init_collapseTeammateShutdowns();
4196
+ init_config();
4197
+ init_envUtils();
4198
+ init_fullscreen();
4199
+ init_groupToolUses();
4200
+ init_messages();
4201
+ init_stringUtils();
4202
+ init_transcriptSearch();
4203
+ init_src();
4204
+ init_LogoV2();
4205
+ init_Markdown();
4206
+ init_MessageRow();
4207
+ init_messageActions();
4208
+ init_AssistantThinkingMessage();
4209
+ init_nullRenderingAttachments();
4210
+ init_OffscreenFreeze();
4211
+ init_StatusNotices();
4212
+ init_VirtualMessageList();
4213
+ React6 = __toESM(require_react(), 1);
4214
+ import_react13 = __toESM(require_react(), 1);
4215
+ jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
4216
+ LogoHeader = React6.memo(function LogoHeader2({
4217
+ agentDefinitions
4218
+ }) {
4219
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(OffscreenFreeze, {
4220
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
4221
+ flexDirection: "column",
4222
+ gap: 1,
4223
+ children: [
4224
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(LogoV2, {}, undefined, false, undefined, this),
4225
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(React6.Suspense, {
4226
+ fallback: null,
4227
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(StatusNotices, {
4228
+ agentDefinitions
4229
+ }, undefined, false, undefined, this)
4230
+ }, undefined, false, undefined, this)
4231
+ ]
4232
+ }, undefined, true, undefined, this)
4233
+ }, undefined, false, undefined, this);
4234
+ });
4235
+ BRIEF_TOOL_NAME = (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_TOOL_NAME;
4236
+ Messages = React6.memo(MessagesImpl, (prev, next) => {
4237
+ const keys = Object.keys(prev);
4238
+ for (const key of keys) {
4239
+ if (key === "onOpenRateLimitOptions" || key === "scrollRef" || key === "trackStickyPrompt" || key === "setCursor" || key === "cursorNavRef" || key === "jumpRef" || key === "onSearchMatchesChange" || key === "scanElement" || key === "setPositions")
4240
+ continue;
4241
+ if (prev[key] !== next[key]) {
4242
+ if (key === "streamingToolUses") {
4243
+ const p = prev.streamingToolUses;
4244
+ const n = next.streamingToolUses;
4245
+ if (p.length === n.length && p.every((item, i) => item.contentBlock === n[i]?.contentBlock)) {
4246
+ continue;
4247
+ }
4248
+ }
4249
+ if (key === "inProgressToolUseIDs") {
4250
+ if (setsEqual(prev.inProgressToolUseIDs, next.inProgressToolUseIDs)) {
4251
+ continue;
4252
+ }
4253
+ }
4254
+ if (key === "unseenDivider") {
4255
+ const p = prev.unseenDivider;
4256
+ const n = next.unseenDivider;
4257
+ if (p?.firstUnseenUuid === n?.firstUnseenUuid && p?.count === n?.count) {
4258
+ continue;
4259
+ }
4260
+ }
4261
+ if (key === "tools") {
4262
+ const p = prev.tools;
4263
+ const n = next.tools;
4264
+ if (p.length === n.length && p.every((tool, i) => tool.name === n[i]?.name)) {
4265
+ continue;
4266
+ }
4267
+ }
4268
+ return false;
4269
+ }
4270
+ }
4271
+ return true;
4272
+ });
4273
+ });
4274
+
4275
+ export { useSetPromptOverlay, useSetPromptOverlayDialog, init_promptOverlayContext, useUnseenDivider, computeUnseenDivider, FullscreenLayout, init_FullscreenLayout, Messages, init_Messages };