@alwith/module-chat 0.6.24 → 0.6.25

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 (463) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/client.d.ts +25 -9
  3. package/dist/agent/client.js +1 -1
  4. package/dist/agent/custom-model-effort.js +1 -1
  5. package/dist/agent/fork-title.js +1 -1
  6. package/dist/agent/image-request.js +1 -1
  7. package/dist/agent/image-tools.js +1 -1
  8. package/dist/agent/input-config.js +1 -1
  9. package/dist/agent/input-modes/chat.js +1 -1
  10. package/dist/agent/input-modes/execution-meta.js +1 -1
  11. package/dist/agent/input-modes/image-context.js +1 -1
  12. package/dist/agent/input-modes/image.js +1 -1
  13. package/dist/agent/input-modes/index.js +1 -1
  14. package/dist/agent/project-path.js +1 -1
  15. package/dist/agent/request-error.js +1 -1
  16. package/dist/agent/session-list-refresh.js +1 -1
  17. package/dist/app-reference.js +1 -1
  18. package/dist/application-tools.d.ts +4 -1
  19. package/dist/application-tools.js +1 -1
  20. package/dist/approval/choice-elicitation-form.js +1 -1
  21. package/dist/approval/choice-schema.js +1 -1
  22. package/dist/approval/permission-options.js +1 -1
  23. package/dist/approval/permission-view.js +1 -1
  24. package/dist/approval/schema-elicitation-form.js +1 -1
  25. package/dist/approval/url-elicitation-card.js +1 -1
  26. package/dist/chunk-0a7vp0ph.js +2 -0
  27. package/dist/{chunk-n0q8e6sq.js → chunk-0bv3tw1m.js} +2 -2
  28. package/dist/{chunk-vkj5fznh.js → chunk-0j5z842s.js} +3 -3
  29. package/dist/{chunk-zzqbe5r0.js → chunk-0jj029k8.js} +2 -2
  30. package/dist/{chunk-9ts08sma.js → chunk-0s2zcz5f.js} +2 -2
  31. package/dist/{chunk-7v7wc7k5.js → chunk-113maskf.js} +2 -2
  32. package/dist/{chunk-73541c5k.js → chunk-18xfysvb.js} +2 -2
  33. package/dist/{chunk-8h4e3654.js → chunk-1d29gnb2.js} +2 -2
  34. package/dist/{chunk-ck2ax5f6.js → chunk-1gr60c40.js} +2 -2
  35. package/dist/{chunk-m6080rsp.js → chunk-27gr882d.js} +2 -2
  36. package/dist/{chunk-3z5zyra7.js → chunk-2kbp0pbe.js} +2 -2
  37. package/dist/{chunk-csbv8m51.js → chunk-2rbaebnr.js} +3 -3
  38. package/dist/{chunk-3zae491f.js → chunk-2w4kyd2a.js} +4 -4
  39. package/dist/chunk-2wfgbxet.js +3 -0
  40. package/dist/{chunk-mtn6vdf8.js → chunk-2x5m7g33.js} +2 -2
  41. package/dist/chunk-3q2zdv9e.js +2 -0
  42. package/dist/{chunk-dxsjz3re.js → chunk-3q8vw3wb.js} +2 -2
  43. package/dist/{chunk-50eym2q3.js → chunk-3qy743j9.js} +3 -3
  44. package/dist/{chunk-jg4c3zg4.js → chunk-3tvq6xr2.js} +2 -2
  45. package/dist/{chunk-ww3f6z4x.js → chunk-3zsqg6wr.js} +3 -3
  46. package/dist/{chunk-q4nx04sy.js → chunk-44r55va6.js} +2 -2
  47. package/dist/chunk-4cr144a7.js +2 -0
  48. package/dist/{chunk-gpcsb4tg.js → chunk-4e622bdk.js} +3 -3
  49. package/dist/{chunk-geh3wyxw.js → chunk-4gftpery.js} +2 -2
  50. package/dist/{chunk-mc40zb3c.js → chunk-4t0f01ec.js} +2 -2
  51. package/dist/{chunk-542c9tpr.js → chunk-4vayk46h.js} +2 -2
  52. package/dist/{chunk-nhstvqjy.js → chunk-51x80v4h.js} +2 -2
  53. package/dist/{chunk-ymgc4317.js → chunk-52wrk1mh.js} +2 -2
  54. package/dist/{chunk-tyka859b.js → chunk-5c42mfat.js} +2 -2
  55. package/dist/{chunk-1pb43y89.js → chunk-5m2ydb9j.js} +2 -2
  56. package/dist/chunk-621eg04b.js +2 -0
  57. package/dist/{chunk-5xe89qwh.js → chunk-64apxzn7.js} +2 -2
  58. package/dist/chunk-6bbtfd0j.js +2 -0
  59. package/dist/{chunk-1e83qr49.js → chunk-6f06hbsk.js} +2 -2
  60. package/dist/{chunk-rzxnxj25.js → chunk-6p4gk1zy.js} +2 -2
  61. package/dist/{chunk-b61qhh61.js → chunk-6qxd4jg9.js} +2 -2
  62. package/dist/{chunk-pr36m3qx.js → chunk-6z3fgkkp.js} +2 -2
  63. package/dist/{chunk-2sc2z6g5.js → chunk-7jk8s061.js} +2 -2
  64. package/dist/{chunk-x4enakra.js → chunk-7m83dwzq.js} +1 -1
  65. package/dist/{chunk-r7paw6ba.js → chunk-7tw7rn0m.js} +2 -2
  66. package/dist/{chunk-2fx3qhyb.js → chunk-809b75k1.js} +2 -2
  67. package/dist/{chunk-gec6q1jb.js → chunk-84p483n0.js} +2 -2
  68. package/dist/{chunk-kk9dbwd1.js → chunk-84zzf0ys.js} +2 -2
  69. package/dist/{chunk-8ew2e3y7.js → chunk-88ysxbdh.js} +2 -2
  70. package/dist/{chunk-0ne2mz2q.js → chunk-89j37t04.js} +3 -3
  71. package/dist/{chunk-5kje89r8.js → chunk-8f5w2tnp.js} +2 -2
  72. package/dist/chunk-8qszap2n.js +2 -0
  73. package/dist/{chunk-mfn37eme.js → chunk-91kpcajz.js} +2 -2
  74. package/dist/chunk-952vsa4r.js +4 -0
  75. package/dist/chunk-9w1vcmbd.js +2 -0
  76. package/dist/chunk-a6ns5agq.js +2 -0
  77. package/dist/{chunk-qv23mh24.js → chunk-ad53zbdb.js} +2 -2
  78. package/dist/chunk-an3nh155.js +2 -0
  79. package/dist/{chunk-v3dq3hx2.js → chunk-ar1bwfn3.js} +2 -2
  80. package/dist/{chunk-6cjjwry2.js → chunk-arm9x6kc.js} +2 -2
  81. package/dist/chunk-ax7c2kam.js +2 -0
  82. package/dist/{chunk-w4bye56s.js → chunk-b6sfe0k7.js} +2 -2
  83. package/dist/{chunk-d6ke5e80.js → chunk-bcdmjgab.js} +2 -2
  84. package/dist/{chunk-vsh9vh4s.js → chunk-beccgzp9.js} +2 -2
  85. package/dist/{chunk-x621s275.js → chunk-bf7sgpzq.js} +2 -2
  86. package/dist/{chunk-81hv0s07.js → chunk-bgnxw313.js} +2 -2
  87. package/dist/{chunk-rff6c87z.js → chunk-brv52tgj.js} +2 -2
  88. package/dist/chunk-bve6cykn.js +2 -0
  89. package/dist/{chunk-s2k0g1hc.js → chunk-bw1m6407.js} +2 -2
  90. package/dist/{chunk-3a5sn0v8.js → chunk-bw3bpr6m.js} +2 -2
  91. package/dist/chunk-byvw0vam.js +2 -0
  92. package/dist/chunk-c06k7g9n.js +2 -0
  93. package/dist/{chunk-wf7kfk3p.js → chunk-c13rnm7b.js} +2 -2
  94. package/dist/chunk-c2ez86jz.js +2 -0
  95. package/dist/{chunk-h8r785ne.js → chunk-c2r7xpjf.js} +2 -2
  96. package/dist/{chunk-7a70nd7e.js → chunk-cf85zhvf.js} +2 -2
  97. package/dist/{chunk-8mzbkjhk.js → chunk-cq3j51m2.js} +2 -2
  98. package/dist/{chunk-a6ysp1fp.js → chunk-d06382wz.js} +2 -2
  99. package/dist/{chunk-p811gdar.js → chunk-d0nrbf80.js} +2 -2
  100. package/dist/{chunk-vx6shb4g.js → chunk-d0s10qy5.js} +2 -2
  101. package/dist/{chunk-1rwkdezk.js → chunk-dba0ttve.js} +2 -2
  102. package/dist/{chunk-ffs5nkt0.js → chunk-dheg4bs2.js} +2 -2
  103. package/dist/chunk-dnrcx75n.js +2 -0
  104. package/dist/{chunk-g751pxzk.js → chunk-dr5swvaa.js} +2 -2
  105. package/dist/{chunk-zz582m73.js → chunk-dxwbgg69.js} +2 -2
  106. package/dist/{chunk-gak8579e.js → chunk-e00dz09f.js} +2 -2
  107. package/dist/{chunk-mbsmb8jn.js → chunk-e13mpwt8.js} +2 -2
  108. package/dist/chunk-e1fzfaqj.js +2 -0
  109. package/dist/{chunk-zwyd2bhy.js → chunk-e3bpr3yx.js} +2 -2
  110. package/dist/{chunk-bfb8bpwc.js → chunk-e8p4wkbg.js} +2 -2
  111. package/dist/{chunk-qxssxzws.js → chunk-ee7a5gft.js} +2 -2
  112. package/dist/{chunk-q7ka46hb.js → chunk-er7ewrf2.js} +3 -3
  113. package/dist/{chunk-stc4ctrx.js → chunk-ert67qk1.js} +2 -2
  114. package/dist/{chunk-nh56sb8e.js → chunk-etvdqkvb.js} +2 -2
  115. package/dist/{chunk-t686zwxk.js → chunk-f54k9xxv.js} +2 -2
  116. package/dist/{chunk-gkyvgjyx.js → chunk-f7d0hs1y.js} +2 -2
  117. package/dist/{chunk-rb4p3h5b.js → chunk-ftsnryz8.js} +2 -2
  118. package/dist/{chunk-0xshzqb6.js → chunk-fwghjmd1.js} +2 -2
  119. package/dist/{chunk-z8sheg2r.js → chunk-fyxetwxv.js} +2 -2
  120. package/dist/{chunk-7wpcdwan.js → chunk-g4qwh2sx.js} +2 -2
  121. package/dist/{chunk-5d138vq3.js → chunk-gdtpwbqn.js} +1 -1
  122. package/dist/{chunk-js3nhatr.js → chunk-gpv1dc5y.js} +2 -2
  123. package/dist/{chunk-dypeezvv.js → chunk-gttw4rmx.js} +3 -3
  124. package/dist/{chunk-ym6jphs4.js → chunk-gxb9n7g7.js} +3 -3
  125. package/dist/chunk-gxx5yh45.js +2 -0
  126. package/dist/{chunk-4h9ee02f.js → chunk-h5mdgrq6.js} +2 -2
  127. package/dist/{chunk-6tvq472s.js → chunk-h82jte5p.js} +2 -2
  128. package/dist/{chunk-bdrcreqs.js → chunk-ha9n1k24.js} +2 -2
  129. package/dist/{chunk-qghq84r4.js → chunk-hmy4snze.js} +2 -2
  130. package/dist/{chunk-zm6b6zyr.js → chunk-hyhp5ytm.js} +2 -2
  131. package/dist/{chunk-4ntxjy8v.js → chunk-j1frpcqd.js} +2 -2
  132. package/dist/{chunk-whzs7yxf.js → chunk-j2k2mc13.js} +2 -2
  133. package/dist/chunk-j5dqww4h.js +2 -0
  134. package/dist/{chunk-nypr6qtz.js → chunk-ja7x2gvb.js} +3 -3
  135. package/dist/{chunk-q01vmp9m.js → chunk-jgqt7k0h.js} +2 -2
  136. package/dist/{chunk-jw1c8r97.js → chunk-jn8b4qrh.js} +2 -2
  137. package/dist/{chunk-jcyv1q0x.js → chunk-jp4xjks0.js} +2 -2
  138. package/dist/chunk-jv327stj.js +2 -0
  139. package/dist/{chunk-zsrjzx7g.js → chunk-jy0jrht0.js} +2 -2
  140. package/dist/{chunk-5pmr5dby.js → chunk-jzbg0cx9.js} +2 -2
  141. package/dist/chunk-k2nbrerw.js +2 -0
  142. package/dist/{chunk-kj3a1k2q.js → chunk-k5nd3vyq.js} +2 -2
  143. package/dist/{chunk-s05ftq29.js → chunk-k7z0pgrt.js} +2 -2
  144. package/dist/chunk-kbax1frf.js +2 -0
  145. package/dist/{chunk-xdcp8tj9.js → chunk-khs8cfkd.js} +2 -2
  146. package/dist/{chunk-t3m57q06.js → chunk-knxes674.js} +2 -2
  147. package/dist/{chunk-79ayc6qy.js → chunk-kvc3ghat.js} +2 -2
  148. package/dist/{chunk-wyxa2tfm.js → chunk-m0r0v983.js} +5 -5
  149. package/dist/chunk-m799f2x5.js +2 -0
  150. package/dist/{chunk-7wd0kfqr.js → chunk-ma7thf1j.js} +2 -2
  151. package/dist/{chunk-hcat58sr.js → chunk-masqfje4.js} +2 -2
  152. package/dist/{chunk-qvw0kyse.js → chunk-mc21sg7m.js} +2 -2
  153. package/dist/{chunk-bane0xc8.js → chunk-mvnze5ts.js} +2 -2
  154. package/dist/{chunk-6vdayg6w.js → chunk-myjsfbp6.js} +2 -2
  155. package/dist/chunk-n32wra9r.js +2 -0
  156. package/dist/{chunk-9hjfc08t.js → chunk-n6erf29r.js} +2 -2
  157. package/dist/{chunk-d5gt1x0n.js → chunk-n7y094nf.js} +2 -2
  158. package/dist/{chunk-7s3f142h.js → chunk-na6b1fpn.js} +2 -2
  159. package/dist/{chunk-6r5nzsw8.js → chunk-ncgwbdmj.js} +2 -2
  160. package/dist/{chunk-8v53bkyr.js → chunk-ne4b53kn.js} +2 -2
  161. package/dist/chunk-nfwa8qkt.js +2 -0
  162. package/dist/{chunk-jydhbkm8.js → chunk-npkk2gzs.js} +2 -2
  163. package/dist/{chunk-heqa4swe.js → chunk-nqt9gyz9.js} +2 -2
  164. package/dist/{chunk-sjqhtpzr.js → chunk-nrpgmawz.js} +2 -2
  165. package/dist/{chunk-76smt4zv.js → chunk-nwyem2d7.js} +3 -3
  166. package/dist/{chunk-m9ttf96p.js → chunk-p3gawvqr.js} +2 -2
  167. package/dist/{chunk-e04g26qm.js → chunk-pqz2471h.js} +2 -2
  168. package/dist/{chunk-2cc8d35c.js → chunk-pw22g3k1.js} +2 -2
  169. package/dist/{chunk-j3g21ext.js → chunk-pxr5snwm.js} +2 -2
  170. package/dist/chunk-q1kb5z75.js +2 -0
  171. package/dist/{chunk-tsdb5jnj.js → chunk-q7jm6srr.js} +2 -2
  172. package/dist/chunk-q9b2wsdg.js +2 -0
  173. package/dist/{chunk-84eye2j0.js → chunk-r940xwxq.js} +2 -2
  174. package/dist/chunk-rd9cgt8p.js +2 -0
  175. package/dist/{chunk-f9z37ptq.js → chunk-rragk2vb.js} +2 -2
  176. package/dist/chunk-rv3k0kfr.js +2 -0
  177. package/dist/{chunk-11vn501z.js → chunk-ry7bxdb6.js} +2 -2
  178. package/dist/chunk-s1nfyggb.js +2 -0
  179. package/dist/chunk-sjb5stzq.js +2 -0
  180. package/dist/{chunk-76c0cx40.js → chunk-sjm9p42x.js} +2 -2
  181. package/dist/chunk-sn3sk1j0.js +2 -0
  182. package/dist/{chunk-h0k80cxs.js → chunk-snrbgnwn.js} +1 -1
  183. package/dist/{chunk-3qwtda21.js → chunk-sqkdenb0.js} +3 -3
  184. package/dist/{chunk-bh0h7fz7.js → chunk-stse5bdv.js} +2 -2
  185. package/dist/chunk-stv8pr4v.js +2 -0
  186. package/dist/{chunk-m8tt5bf9.js → chunk-swqbbw8q.js} +2 -2
  187. package/dist/{chunk-xk0dt0es.js → chunk-sxz82jq3.js} +2 -2
  188. package/dist/chunk-tc80kegm.js +2 -0
  189. package/dist/{chunk-znagg8v9.js → chunk-tcg99k9e.js} +2 -2
  190. package/dist/{chunk-4fmn1kk4.js → chunk-tcp7c2s0.js} +3 -3
  191. package/dist/{chunk-wz6765xb.js → chunk-vev9q4t4.js} +3 -3
  192. package/dist/{chunk-rqa21qrv.js → chunk-vfszr27e.js} +2 -2
  193. package/dist/{chunk-4r0ffb0s.js → chunk-vhxavb92.js} +2 -2
  194. package/dist/{chunk-6w8p1hwb.js → chunk-vnwt4f99.js} +2 -2
  195. package/dist/{chunk-e5m9kg1w.js → chunk-vyzq2pbd.js} +2 -2
  196. package/dist/chunk-w5q2ygsa.js +2 -0
  197. package/dist/{chunk-xadfbbwt.js → chunk-w63mha8c.js} +2 -2
  198. package/dist/{chunk-mdercwm8.js → chunk-wk26bzjj.js} +3 -3
  199. package/dist/{chunk-tctdn4kk.js → chunk-wm6zdp7w.js} +2 -2
  200. package/dist/{chunk-whb8ttdy.js → chunk-wpacvdsv.js} +2 -2
  201. package/dist/chunk-x1aw1r1v.js +2 -0
  202. package/dist/{chunk-az3g3a94.js → chunk-x2wcwpw3.js} +2 -2
  203. package/dist/{chunk-kbfe7gqw.js → chunk-x49qjrbk.js} +2 -2
  204. package/dist/{chunk-v581r9vt.js → chunk-x8rfc6wc.js} +3 -3
  205. package/dist/{chunk-et2pdaz7.js → chunk-xpfy5g6z.js} +2 -2
  206. package/dist/{chunk-e641842r.js → chunk-xqb4thy8.js} +2 -2
  207. package/dist/{chunk-tknyjndw.js → chunk-xvg3d2z6.js} +3 -3
  208. package/dist/{chunk-79pvfyd0.js → chunk-xx7t8r87.js} +2 -2
  209. package/dist/{chunk-2qs1ss40.js → chunk-y3mx5sf0.js} +2 -2
  210. package/dist/{chunk-bcnh0z8e.js → chunk-yj42tq3z.js} +2 -2
  211. package/dist/chunk-yn6a84c7.js +2 -0
  212. package/dist/{chunk-wsyfhh7y.js → chunk-yq4wz4n8.js} +2 -2
  213. package/dist/{chunk-pnh5t6pc.js → chunk-yryg27yy.js} +2 -2
  214. package/dist/{chunk-n9jaz2pd.js → chunk-ytdhstqx.js} +2 -2
  215. package/dist/{chunk-fe83mqnb.js → chunk-z107z7dt.js} +2 -2
  216. package/dist/{chunk-859359n0.js → chunk-z6x70w62.js} +2 -2
  217. package/dist/{chunk-qdyyvd2w.js → chunk-z76as4dt.js} +2 -2
  218. package/dist/chunk-zft4afb8.js +2 -0
  219. package/dist/{chunk-w2xjhfm2.js → chunk-zgqrv879.js} +3 -3
  220. package/dist/{chunk-cer4dxas.js → chunk-zj7kjjdj.js} +2 -2
  221. package/dist/chunk-zq26pxze.js +2 -0
  222. package/dist/{chunk-vbbndjfd.js → chunk-zv3bm3np.js} +2 -2
  223. package/dist/{chunk-mgmv8kap.js → chunk-zxfx7psd.js} +2 -2
  224. package/dist/{chunk-dp1nnwk2.js → chunk-zxkpemh4.js} +2 -2
  225. package/dist/{chunk-wwj743gm.js → chunk-zyn0ys4m.js} +2 -2
  226. package/dist/client.d.ts +1 -2
  227. package/dist/client.js +1 -1
  228. package/dist/codex/activity-group.js +1 -1
  229. package/dist/codex/artifact-links.js +1 -1
  230. package/dist/codex/assistant-message.js +1 -1
  231. package/dist/codex/async-question-card.js +1 -1
  232. package/dist/codex/edited-files-card.js +1 -1
  233. package/dist/codex/image-view-activity.js +1 -1
  234. package/dist/codex/markdown-renderer.js +1 -1
  235. package/dist/codex/navigation-audio.js +1 -1
  236. package/dist/codex/navigation-preview.js +1 -1
  237. package/dist/codex/navigation-rail.js +1 -1
  238. package/dist/codex/patch-view.js +1 -1
  239. package/dist/codex/plan.js +1 -1
  240. package/dist/codex/timeline-virtualizer.js +1 -1
  241. package/dist/codex/turn-activity.js +1 -1
  242. package/dist/codex/user-message.js +1 -1
  243. package/dist/codex/virtualized-turn-list.js +1 -1
  244. package/dist/collections/collection-emoji.js +1 -1
  245. package/dist/collections/collection-menu.js +1 -1
  246. package/dist/collections/collection-panel.js +1 -1
  247. package/dist/collections/collections.js +1 -1
  248. package/dist/collections/host.js +1 -1
  249. package/dist/collections/locales.js +1 -1
  250. package/dist/collections/model.js +1 -1
  251. package/dist/collections/store.js +1 -1
  252. package/dist/composer/completion-filter.js +1 -1
  253. package/dist/composer/completion-menu.js +1 -1
  254. package/dist/composer/completion-trigger.js +1 -1
  255. package/dist/composer/effort-slider.js +1 -1
  256. package/dist/composer/inline-document.js +1 -1
  257. package/dist/composer/inline-dom.js +1 -1
  258. package/dist/composer/menu-radio.js +1 -1
  259. package/dist/composer/model-select.js +1 -1
  260. package/dist/composer/permission-mode-select.js +1 -1
  261. package/dist/composer/prompt-input-attachments.js +1 -1
  262. package/dist/composer/prompt-input-clipboard.js +1 -1
  263. package/dist/composer/prompt-input-context.js +1 -1
  264. package/dist/composer/prompt-input-inline.js +1 -1
  265. package/dist/composer/prompt-input-textarea.js +1 -1
  266. package/dist/composer/prompt-input.js +1 -1
  267. package/dist/conversation/action-card.js +1 -1
  268. package/dist/conversation/composer/app-mentions.js +1 -1
  269. package/dist/conversation/composer/apps-menu.js +1 -1
  270. package/dist/conversation/composer/composer-menu.js +1 -1
  271. package/dist/conversation/composer/composer.js +1 -1
  272. package/dist/conversation/composer/config-options.js +1 -1
  273. package/dist/conversation/composer/context.js +1 -1
  274. package/dist/conversation/composer/drafts.js +1 -1
  275. package/dist/conversation/composer/file-items.js +1 -1
  276. package/dist/conversation/composer/long-text.js +1 -1
  277. package/dist/conversation/composer/mention-chips.js +1 -1
  278. package/dist/conversation/composer/mention-uri.js +1 -1
  279. package/dist/conversation/composer/model-menu.js +1 -1
  280. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  281. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  282. package/dist/conversation/composer/prediction.js +1 -1
  283. package/dist/conversation/composer/prompt-history.js +1 -1
  284. package/dist/conversation/composer/slash-command-button.js +1 -1
  285. package/dist/conversation/composer/submit-button.js +1 -1
  286. package/dist/conversation/composer/usage-meter.js +1 -1
  287. package/dist/conversation/connection-notice.js +1 -1
  288. package/dist/conversation/context.js +1 -1
  289. package/dist/conversation/conversation-body.js +1 -1
  290. package/dist/conversation/conversation-search.js +1 -1
  291. package/dist/conversation/conversation-view.js +1 -1
  292. package/dist/conversation/conversation.js +1 -1
  293. package/dist/conversation/diff-modal.js +1 -1
  294. package/dist/conversation/draft-project-picker.js +1 -1
  295. package/dist/conversation/session-actions.js +1 -1
  296. package/dist/conversation/subagent-sessions.js +1 -1
  297. package/dist/conversation/subagent-tasks.js +1 -1
  298. package/dist/desktop/desktop-composer.js +1 -1
  299. package/dist/desktop/desktop.js +1 -1
  300. package/dist/desktop/draft-model-select.js +1 -1
  301. package/dist/desktop/load-image.js +1 -1
  302. package/dist/desktop/model-catalog.js +1 -1
  303. package/dist/desktop/model-recovery.js +1 -1
  304. package/dist/desktop/model-settings-action.js +1 -1
  305. package/dist/desktop/native-file-drop.js +1 -1
  306. package/dist/generated/commands.js +1 -1
  307. package/dist/image-lightbox.js +1 -1
  308. package/dist/image-preview-dialog.js +1 -1
  309. package/dist/image.js +1 -1
  310. package/dist/lib/app-reference.js +1 -1
  311. package/dist/lib/application-metadata.js +1 -1
  312. package/dist/lib/chat-path.js +1 -1
  313. package/dist/lib/code-highlighter.js +1 -1
  314. package/dist/lib/file-url.js +1 -1
  315. package/dist/lib/fuzzy.js +1 -1
  316. package/dist/lib/group-blocks.js +1 -1
  317. package/dist/lib/image-encode.js +1 -1
  318. package/dist/lib/limits.js +1 -1
  319. package/dist/lib/markdown-parser.js +1 -1
  320. package/dist/lib/markdown-rules.js +1 -1
  321. package/dist/lib/model-name.js +1 -1
  322. package/dist/lib/prepare-prompt-files.js +1 -1
  323. package/dist/lib/reference-presentation.js +1 -1
  324. package/dist/lib/stream-style.js +1 -1
  325. package/dist/lib/streaming-markdown.js +1 -1
  326. package/dist/lib/tool-artifacts.js +1 -1
  327. package/dist/locales.js +1 -1
  328. package/dist/mermaid/diagram.js +1 -1
  329. package/dist/mermaid/export.js +1 -1
  330. package/dist/mermaid/index.js +1 -1
  331. package/dist/mermaid/preview.js +1 -1
  332. package/dist/oauth/claude-login.js +1 -1
  333. package/dist/oauth.js +1 -1
  334. package/dist/plugins/catalog-header.js +1 -1
  335. package/dist/plugins/catalog-skeleton.js +1 -1
  336. package/dist/plugins/host.js +1 -1
  337. package/dist/plugins/new-chat-directory.js +1 -1
  338. package/dist/plugins/panel-item.js +1 -1
  339. package/dist/plugins/plugin-detail-page.js +1 -1
  340. package/dist/plugins/plugin-icon.js +1 -1
  341. package/dist/plugins/plugin-icons.js +1 -1
  342. package/dist/plugins/plugins-page.js +1 -1
  343. package/dist/plugins/plugins.js +1 -1
  344. package/dist/plugins/read-skill-document.js +1 -1
  345. package/dist/plugins/skill-document.js +1 -1
  346. package/dist/plugins/skills-tab.js +1 -1
  347. package/dist/plugins/store.js +1 -1
  348. package/dist/plugins/toolbox-layout.js +1 -1
  349. package/dist/reference-projection.js +1 -1
  350. package/dist/search/chat-search.js +1 -1
  351. package/dist/search/codex-source-matches.js +1 -1
  352. package/dist/search/dom-matches.js +1 -1
  353. package/dist/search/find-bar.js +1 -1
  354. package/dist/search/literal-matches.js +1 -1
  355. package/dist/session-list/account-menu.js +1 -1
  356. package/dist/session-list/activity-list.js +1 -1
  357. package/dist/session-list/archived-sessions.js +1 -1
  358. package/dist/session-list/help-menu.js +1 -1
  359. package/dist/session-list/highlight.js +1 -1
  360. package/dist/session-list/host.js +1 -1
  361. package/dist/session-list/hover-info-card.js +1 -1
  362. package/dist/session-list/locales.js +1 -1
  363. package/dist/session-list/navigation-controls.js +1 -1
  364. package/dist/session-list/navigation-header.js +1 -1
  365. package/dist/session-list/navigation-store.js +1 -1
  366. package/dist/session-list/navigation-tabs.js +1 -1
  367. package/dist/session-list/navigation.js +1 -1
  368. package/dist/session-list/platform.js +1 -1
  369. package/dist/session-list/row-stop-button.js +1 -1
  370. package/dist/session-list/session-groups.js +1 -1
  371. package/dist/session-list/session-info-card.js +1 -1
  372. package/dist/session-list/session-list.js +1 -1
  373. package/dist/session-list/session-row.js +1 -1
  374. package/dist/session-list/session-state-dot.js +1 -1
  375. package/dist/session-list/session-state-menu.js +1 -1
  376. package/dist/session-list/shortcut-hint.js +1 -1
  377. package/dist/session-list/shortcut.js +1 -1
  378. package/dist/session-list/sidebar-overlay.js +1 -1
  379. package/dist/session-list/trailing-swap.js +1 -1
  380. package/dist/session-list/use-activity-notification.js +1 -1
  381. package/dist/session-list/use-activity-preview.js +1 -1
  382. package/dist/session-list/use-cmd-held.js +1 -1
  383. package/dist/session-list/use-project-sessions.js +1 -1
  384. package/dist/session-list/virtual-session-rows.js +1 -1
  385. package/dist/session-timeline/activity-group.js +1 -1
  386. package/dist/session-timeline/activity-projection.js +1 -1
  387. package/dist/session-timeline/assistant-content.js +1 -1
  388. package/dist/session-timeline/assistant-image-references.js +1 -1
  389. package/dist/session-timeline/assistant-turn.js +1 -1
  390. package/dist/session-timeline/async-questions.js +1 -1
  391. package/dist/session-timeline/edited-files-card.js +1 -1
  392. package/dist/session-timeline/history-timeline.js +1 -1
  393. package/dist/session-timeline/host.js +1 -1
  394. package/dist/session-timeline/image-generation-progress.js +1 -1
  395. package/dist/session-timeline/navigation-rail.js +1 -1
  396. package/dist/session-timeline/plan.js +1 -1
  397. package/dist/session-timeline/question-reply.js +1 -1
  398. package/dist/session-timeline/resource-content.js +1 -1
  399. package/dist/session-timeline/session-timeline.js +1 -1
  400. package/dist/session-timeline/timeline-registry.js +1 -1
  401. package/dist/session-timeline/turn-activity.js +1 -1
  402. package/dist/session-timeline/turn-error.js +1 -1
  403. package/dist/session-timeline/turn-retry.js +1 -1
  404. package/dist/session-timeline/turn-time.js +1 -1
  405. package/dist/session-timeline/turns.js +1 -1
  406. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  407. package/dist/session-timeline/user-message.js +1 -1
  408. package/dist/settings/codex-account-card.js +1 -1
  409. package/dist/settings/login-card.js +1 -1
  410. package/dist/settings/model-alias-settings.js +1 -1
  411. package/dist/settings/model-aliases.js +1 -1
  412. package/dist/settings/provider-logos.js +1 -1
  413. package/dist/settings/provider-section.js +1 -1
  414. package/dist/settings/providers-port.js +1 -1
  415. package/dist/settings/providers.js +1 -1
  416. package/dist/settings/settings-bridge.js +1 -1
  417. package/dist/settings/settings.js +1 -1
  418. package/native/win32-x64/alwith_native_chat.dll +0 -0
  419. package/native/win32-x64/artifact.json +1 -1
  420. package/package.json +1 -1
  421. package/dist/agent/application-client.d.ts +0 -30
  422. package/dist/agent/application-client.js +0 -1
  423. package/dist/chunk-0myf2ak0.js +0 -2
  424. package/dist/chunk-1smyy9mt.js +0 -2
  425. package/dist/chunk-2q1xxs3t.js +0 -2
  426. package/dist/chunk-36ttr22w.js +0 -2
  427. package/dist/chunk-3mm1d99e.js +0 -2
  428. package/dist/chunk-4gxpna3p.js +0 -2
  429. package/dist/chunk-5ryfm4ka.js +0 -4
  430. package/dist/chunk-7cab9zy0.js +0 -2
  431. package/dist/chunk-7xvrsw7x.js +0 -2
  432. package/dist/chunk-a8r3mggj.js +0 -2
  433. package/dist/chunk-a9grdyep.js +0 -3
  434. package/dist/chunk-ayt0bzr9.js +0 -2
  435. package/dist/chunk-b42vv8f2.js +0 -2
  436. package/dist/chunk-bgav9cq2.js +0 -2
  437. package/dist/chunk-bshgrwe9.js +0 -2
  438. package/dist/chunk-bsnmj69j.js +0 -2
  439. package/dist/chunk-capkej8s.js +0 -2
  440. package/dist/chunk-cq7bbgcg.js +0 -2
  441. package/dist/chunk-d29xbf16.js +0 -2
  442. package/dist/chunk-dpfjxym1.js +0 -2
  443. package/dist/chunk-eqbp85f3.js +0 -2
  444. package/dist/chunk-fn68kh69.js +0 -2
  445. package/dist/chunk-j2cdjycf.js +0 -2
  446. package/dist/chunk-jjgwfpmp.js +0 -2
  447. package/dist/chunk-mcrd86tx.js +0 -2
  448. package/dist/chunk-nbaxn7jx.js +0 -2
  449. package/dist/chunk-nvgnan7w.js +0 -2
  450. package/dist/chunk-p1tcxky2.js +0 -2
  451. package/dist/chunk-p8cm3xw1.js +0 -2
  452. package/dist/chunk-q73jne25.js +0 -2
  453. package/dist/chunk-qm2jq2bq.js +0 -2
  454. package/dist/chunk-qwet39v5.js +0 -2
  455. package/dist/chunk-r3hsjwjn.js +0 -2
  456. package/dist/chunk-rg8kj085.js +0 -2
  457. package/dist/chunk-s3j71dbh.js +0 -2
  458. package/dist/chunk-sdv06e2k.js +0 -2
  459. package/dist/chunk-sgbn37kz.js +0 -2
  460. package/dist/chunk-tfj6v7y4.js +0 -2
  461. package/dist/chunk-xk306vq1.js +0 -2
  462. package/dist/chunk-ymk7ampx.js +0 -2
  463. package/dist/chunk-zpqj0ka8.js +0 -2
@@ -1,2 +1,2 @@
1
- import{It}from"./chunk-6cjjwry2.js";import{ot}from"./chunk-qdyyvd2w.js";import{l}from"./chunk-6283nzqs.js";import{g}from"./chunk-xk0dt0es.js";import{z}from"./chunk-5kje89r8.js";import{e}from"./chunk-bshgrwe9.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as j,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function po({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:h,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:v,host:N}=e(),{t:d}=N,G=g(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[X,U]=M(x);if(X!==x)U(x),C(null);let[F,H]=M([]),[O,T]=M("loading");j(()=>{if(!a||c||!v.installedApps)return;let t=!0;return T("loading"),H([]),v.installedApps().then(({apps:s})=>{if(!t)return;H(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,v,N]);let K=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=ot(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=It(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>G.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>h({id:t.id,name:t.runtimeName||t.id})})),status:O==="loading"?d("composer.appsLoading"):O==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(v.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(j(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)K(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>K(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function ji({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=g(),E=S(null),h=S(!1);return I(oe,{children:[o(z,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{h.current=i.open},onClick:()=>{if(r)k(!h.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(po,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
- export{po,ji};
1
+ import{St}from"./chunk-arm9x6kc.js";import{it}from"./chunk-z76as4dt.js";import{l}from"./chunk-6283nzqs.js";import{g}from"./chunk-sxz82jq3.js";import{j}from"./chunk-8f5w2tnp.js";import{e}from"./chunk-n32wra9r.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as z,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function io({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:h,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:v,host:N}=e(),{t:d}=N,G=g(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[X,U]=M(x);if(X!==x)U(x),C(null);let[F,H]=M([]),[O,T]=M("loading");z(()=>{if(!a||c||!v.installedApps)return;let t=!0;return T("loading"),H([]),v.installedApps().then(({apps:s})=>{if(!t)return;H(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,v,N]);let K=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=it(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=St(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>G.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>h({id:t.id,name:t.runtimeName||t.id})})),status:O==="loading"?d("composer.appsLoading"):O==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(v.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(z(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)K(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>K(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function Li({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=g(),E=S(null),h=S(!1);return I(oe,{children:[o(j,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{h.current=i.open},onClick:()=>{if(r)k(!h.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(io,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
+ export{io,Li};
@@ -1,2 +1,2 @@
1
- import{Dt}from"./chunk-ym6jphs4.js";import{d,Qe}from"./chunk-mcrd86tx.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function di(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function ke({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Qe(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Qe(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Qe(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:di(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
- export{di,ke};
1
+ import{Dt}from"./chunk-gxb9n7g7.js";import{d,Ze}from"./chunk-j5dqww4h.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function Yo(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function Se({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ze(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ze(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Ze(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:Yo(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
+ export{Yo,Se};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-f9z37ptq.js";import{kn,e,b}from"./chunk-bshgrwe9.js";import{Ne}from"./chunk-5ryfm4ka.js";import{Gt}from"./chunk-gkyvgjyx.js";import{$t}from"./chunk-73541c5k.js";import{zt,Vt}from"./chunk-q7ka46hb.js";import{jt}from"./chunk-v3dq3hx2.js";import{LockIcon as k,UnplugIcon as O}from"lucide-react";import{useMemo as S,useRef as M}from"react";import{Alert as x,AlertDescription as C,AlertTitle as N}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as P,EmptyDescription as z,EmptyHeader as B,EmptyTitle as I}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function Ss({host:t,client:c,...s}){let m=S(()=>t.openDiff?t:{...t,openDiff:zt},[t]);return i(kn,{host:m,client:c,children:[r(L,{...s}),!t.openDiff&&r(Vt,{})]})}function L({session:t,header:c,overlay:s,timeline:m,composer:w,readOnlyActions:D,recovery:g,welcome:E,children:R,rootRef:l,search:T=!0}){let{host:d,client:A}=e(),p=M(null),H=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),y=()=>b(d,A.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:H,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[T&&!u&&r($t,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(x,{children:[r(O,{}),r(N,{children:n("conversation.stopped")}),r(C,{children:r(h,{size:"sm",variant:"outline",onClick:y,children:n("conversation.reconnect")})})]})}),u?E??r(P,{className:"flex-1",children:i(B,{children:[r(I,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(z,{children:n("conversation.welcomeDescription")})]})}):r(Gt,{session:t,timeline:m}),r(jt,{sessionId:t.id}),g??(t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(k,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(N,{children:n("conversation.readOnlyTitle")}),r(C,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(h,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),D]})]})}):w??r(Ne,{session:t}))]}),R]})}
2
- export{Ss};
1
+ import{o}from"./chunk-rragk2vb.js";import{Vn,e,C}from"./chunk-n32wra9r.js";import{Oe}from"./chunk-952vsa4r.js";import{dn}from"./chunk-f7d0hs1y.js";import{an}from"./chunk-18xfysvb.js";import{ln,cn}from"./chunk-er7ewrf2.js";import{sn}from"./chunk-ar1bwfn3.js";import{LockIcon as k,UnplugIcon as O}from"lucide-react";import{useMemo as S,useRef as M}from"react";import{Alert as x,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as P,EmptyDescription as z,EmptyHeader as B,EmptyTitle as I}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function ra({host:t,client:c,...s}){let m=S(()=>t.openDiff?t:{...t,openDiff:ln},[t]);return i(Vn,{host:m,client:c,children:[r(L,{...s}),!t.openDiff&&r(cn,{})]})}function L({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,recovery:E,welcome:R,children:T,rootRef:l,search:A=!0}){let{host:d,client:b}=e(),p=M(null),H=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),y=()=>C(d,b.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:H,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&r(an,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(x,{children:[r(O,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:y,children:n("conversation.reconnect")})})]})}),u?R??r(P,{className:"flex-1",children:i(B,{children:[r(I,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(z,{children:n("conversation.welcomeDescription")})]})}):r(dn,{session:t,timeline:m}),r(sn,{sessionId:t.id}),E??(t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(k,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Oe,{session:t}))]}),T]})}
2
+ export{ra};
@@ -1,2 +1,2 @@
1
- import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function ro(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function bi(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...ro(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
- export{ro,bi};
1
+ import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Lo(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Dr(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Lo(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
+ export{Lo,Dr};
@@ -1,2 +1,2 @@
1
- import{g}from"./chunk-xk0dt0es.js";import{e}from"./chunk-bshgrwe9.js";import{u}from"./chunk-jydhbkm8.js";import{isTauri as B}from"@tauri-apps/api/core";import{getCurrentWebview as L}from"@tauri-apps/api/webview";import{useEffect as T,useLayoutEffect as M,useRef as q}from"react";import{flushSync as w}from"react-dom";var z=33554432,F=new WeakMap;function R(i){return i.split(/[/\\]/).findLast((f)=>f!=="")??i}var vn={sourcePath:(i)=>F.get(i),uniqueFiles(i,f){let h=new Set(f.map((m)=>m.sourcePath));return i.filter((m)=>{let d=F.get(m);if(d===void 0)return!0;if(h.has(d))return!1;return h.add(d),!0})}};function yn({sessionId:i,enabled:f,onMention:h,onBusyChange:m}){let d=g(),{host:A}=e(),a=q({sessionId:i,attachments:d,enabled:f,onMention:h,onBusyChange:m,host:A});return M(()=>{a.current={sessionId:i,attachments:d,enabled:f,onMention:h,onBusyChange:m,host:A}}),T(()=>{if(!B())return;let l=!1,x,C=Promise.resolve(),b=0,y=()=>!l&&a.current.sessionId===i&&a.current.enabled,P=(n)=>{let{host:o}=a.current;if(o.reportError)o.reportError(n);else console.error(n)},D=()=>P(Error(a.current.host.t("composer.dropUnavailable")));a.current.onBusyChange(!1);let k=(n)=>{b++,w(()=>a.current.onBusyChange(!0)),C=C.then(async()=>{try{let o=new Set(a.current.attachments.files.map((t)=>t.sourcePath));for(let t of new Set(await n())){let s=typeof t==="string"?t:t.name;if(!y())return;try{if(typeof t!=="string"&&t.type.startsWith("image/")){w(()=>a.current.attachments.add([t]));continue}if(typeof t!=="string"&&t.size>z)throw Error("Pasted file exceeds the 32 MiB limit");let p=typeof t==="string"?t:await u.writePastedFile({name:t.name,data:[...new Uint8Array(await t.arrayBuffer())]});if(!y())return;let c=await u.readDroppedFile({path:p});if(!y())return;if(c.image===null)w(()=>a.current.onMention(c.path));else if(!o.has(c.path)){let E=Uint8Array.from(atob(c.image.data),(v)=>v.charCodeAt(0)),r=new File([E],c.name,{type:c.image.mimeType});F.set(r,c.path),o.add(c.path),w(()=>a.current.attachments.add([r]))}}catch(p){if(!l)P(Object.assign(Error(a.current.host.t("composer.dropFailed",{name:R(s)})),{description:p instanceof Error?p.message:String(p)}))}}}finally{if(b--,!l)w(()=>a.current.onBusyChange(b>0))}}).catch((o)=>{if(!l)P(o)})},W=L().onDragDropEvent((n)=>{if(l||n.payload.type!=="drop")return;let{paths:o,position:t}=n.payload,s=document.elementFromPoint(t.x/window.devicePixelRatio,t.y/window.devicePixelRatio);if(!s?.closest("[data-chat-drop-zone]")||s.closest('[role="dialog"]'))return;if(!y()){D();return}k(()=>Promise.resolve(o))}),S=(n)=>{let o=n.target;if(!(o instanceof Element)||!o.matches("[data-chat-input]"))return;if(!o.closest("[data-chat-drop-zone]")||o.closest('[role="dialog"]'))return;let t=n.clipboardData;if(!t)return;let s=[...t.files??[]],p=[...t.items??[]];if(!(t.types.includes("Files")&&!s.length&&!p.some((r)=>r.type.startsWith("image/")))&&!s.some((r)=>!r.type.startsWith("image/"))&&!p.some((r)=>r.kind==="file"&&!r.type.startsWith("image/"))&&!["text/uri-list","x-special/gnome-copied-files"].some((r)=>t.types.includes(r)&&/^file:\/\//m.test(t.getData(r))))return;if(n.preventDefault(),n.stopPropagation(),!y()){D();return}let E=u.clipboardFilePaths().then((r)=>({value:r}),(r)=>({error:r}));k(async()=>{let r=await E;if("error"in r)throw r.error;let v=r.value;if(v.length)return v;if(s.length)return s;throw Error("The clipboard contains no readable local files")})};return document.addEventListener("paste",S,!0),W.then((n)=>{if(l)n();else x=n}).catch((n)=>{if(!l)P(n)}),()=>{l=!0,document.removeEventListener("paste",S,!0),x?.()}},[i]),null}
2
- export{vn,yn};
1
+ import{g}from"./chunk-sxz82jq3.js";import{e}from"./chunk-n32wra9r.js";import{p}from"./chunk-npkk2gzs.js";import{isTauri as B}from"@tauri-apps/api/core";import{getCurrentWebview as L}from"@tauri-apps/api/webview";import{useEffect as T,useLayoutEffect as M,useRef as q}from"react";import{flushSync as w}from"react-dom";var z=33554432,F=new WeakMap;function R(i){return i.split(/[/\\]/).findLast((f)=>f!=="")??i}var kn={sourcePath:(i)=>F.get(i),uniqueFiles(i,f){let h=new Set(f.map((m)=>m.sourcePath));return i.filter((m)=>{let d=F.get(m);if(d===void 0)return!0;if(h.has(d))return!1;return h.add(d),!0})}};function Sn({sessionId:i,enabled:f,onMention:h,onBusyChange:m}){let d=g(),{host:A}=e(),a=q({sessionId:i,attachments:d,enabled:f,onMention:h,onBusyChange:m,host:A});return M(()=>{a.current={sessionId:i,attachments:d,enabled:f,onMention:h,onBusyChange:m,host:A}}),T(()=>{if(!B())return;let u=!1,x,C=Promise.resolve(),b=0,y=()=>!u&&a.current.sessionId===i&&a.current.enabled,P=(n)=>{let{host:o}=a.current;if(o.reportError)o.reportError(n);else console.error(n)},D=()=>P(Error(a.current.host.t("composer.dropUnavailable")));a.current.onBusyChange(!1);let k=(n)=>{b++,w(()=>a.current.onBusyChange(!0)),C=C.then(async()=>{try{let o=new Set(a.current.attachments.files.map((t)=>t.sourcePath));for(let t of new Set(await n())){let s=typeof t==="string"?t:t.name;if(!y())return;try{if(typeof t!=="string"&&t.type.startsWith("image/")){w(()=>a.current.attachments.add([t]));continue}if(typeof t!=="string"&&t.size>z)throw Error("Pasted file exceeds the 32 MiB limit");let l=typeof t==="string"?t:await p.writePastedFile({name:t.name,data:[...new Uint8Array(await t.arrayBuffer())]});if(!y())return;let c=await p.readDroppedFile({path:l});if(!y())return;if(c.image===null)w(()=>a.current.onMention(c.path));else if(!o.has(c.path)){let E=Uint8Array.from(atob(c.image.data),(v)=>v.charCodeAt(0)),r=new File([E],c.name,{type:c.image.mimeType});F.set(r,c.path),o.add(c.path),w(()=>a.current.attachments.add([r]))}}catch(l){if(!u)P(Object.assign(Error(a.current.host.t("composer.dropFailed",{name:R(s)})),{description:l instanceof Error?l.message:String(l)}))}}}finally{if(b--,!u)w(()=>a.current.onBusyChange(b>0))}}).catch((o)=>{if(!u)P(o)})},W=L().onDragDropEvent((n)=>{if(u||n.payload.type!=="drop")return;let{paths:o,position:t}=n.payload,s=document.elementFromPoint(t.x/window.devicePixelRatio,t.y/window.devicePixelRatio);if(!s?.closest("[data-chat-drop-zone]")||s.closest('[role="dialog"]'))return;if(!y()){D();return}k(()=>Promise.resolve(o))}),S=(n)=>{let o=n.target;if(!(o instanceof Element)||!o.matches("[data-chat-input]"))return;if(!o.closest("[data-chat-drop-zone]")||o.closest('[role="dialog"]'))return;let t=n.clipboardData;if(!t)return;let s=[...t.files??[]],l=[...t.items??[]];if(!(t.types.includes("Files")&&!s.length&&!l.some((r)=>r.type.startsWith("image/")))&&!s.some((r)=>!r.type.startsWith("image/"))&&!l.some((r)=>r.kind==="file"&&!r.type.startsWith("image/"))&&!["text/uri-list","x-special/gnome-copied-files"].some((r)=>t.types.includes(r)&&/^file:\/\//m.test(t.getData(r))))return;if(n.preventDefault(),n.stopPropagation(),!y()){D();return}let E=p.clipboardFilePaths().then((r)=>({value:r}),(r)=>({error:r}));k(async()=>{let r=await E;if("error"in r)throw r.error;let v=r.value;if(v.length)return v;if(s.length)return s;throw Error("The clipboard contains no readable local files")})};return document.addEventListener("paste",S,!0),W.then((n)=>{if(u)n();else x=n}).catch((n)=>{if(!u)P(n)}),()=>{u=!0,document.removeEventListener("paste",S,!0),x?.()}},[i]),null}
2
+ export{kn,Sn};
@@ -1,2 +1,2 @@
1
- function Ae(e){if(e.startsWith("\\\\?\\UNC\\"))e="\\\\"+e.slice(8);else if(e.startsWith("\\\\?\\"))e=e.slice(4);if(/^[a-z]:[\\/]/i.test(e))e="/"+e.replaceAll("\\","/");else if(e.startsWith("\\\\"))e=e.replaceAll("\\","/");if(!e.startsWith("/"))throw Error("File URLs require an absolute path");let i=encodeURI(e).replaceAll(/[?#]/g,encodeURIComponent);return e.startsWith("//")?`file:${i}`:`file://${i}`}
2
- export{Ae};
1
+ function He(e){if(e.startsWith("\\\\?\\UNC\\"))e="\\\\"+e.slice(8);else if(e.startsWith("\\\\?\\"))e=e.slice(4);if(/^[a-z]:[\\/]/i.test(e))e="/"+e.replaceAll("\\","/");else if(e.startsWith("\\\\"))e=e.replaceAll("\\","/");if(!e.startsWith("/"))throw Error("File URLs require an absolute path");let i=encodeURI(e).replaceAll(/[?#]/g,encodeURIComponent);return e.startsWith("//")?`file:${i}`:`file://${i}`}
2
+ export{He};
@@ -0,0 +1,2 @@
1
+ import{p}from"./chunk-npkk2gzs.js";async function da(a){let e=await p.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
+ export{da};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function xe(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Go(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{xe,Go};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Ce(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ko(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{Ce,Ko};
@@ -1,2 +1,2 @@
1
- import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function ps({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
- export{ps};
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function ss({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
+ export{ss};
@@ -1,2 +1,2 @@
1
- var G="collection-default";function oe(o,e){return o.id==="collection-default"?e("collection.defaultFavorites"):o.name}function Xe(){return{collections:{["collection-default"]:{id:"collection-default",name:"",nameIsCustom:!1,collapsed:!1,sessionIds:[]}},order:["collection-default"],sessionMeta:{}}}function on(o,e){let i={...o.collections},l=(s,n)=>{if(!i[s])throw Error(`Collection missing: ${s}`);i[s]={...i[s],...n}},r=(s,n)=>l(s,{sessionIds:i[s].sessionIds.filter((d)=>d!==n)}),t=(s,n)=>{let d=i[s];if(!d)throw Error(`Collection missing: ${s}`);for(let c of o.order)if(c!==s&&i[c].sessionIds.includes(n))r(c,n);if(!d.sessionIds.includes(n))l(s,{sessionIds:[...d.sessionIds,n],collapsed:!1})};switch(e.type){case"create":{if(!e.name.trim())throw Error("Collection name is empty");if(i[e.id]={id:e.id,name:e.name.trim(),...e.emoji===void 0?{}:{emoji:e.emoji},collapsed:!1,sessionIds:[]},e.sessionId!==void 0){if(e.sourceCollectionId!==void 0)r(e.sourceCollectionId,e.sessionId);t(e.id,e.sessionId)}return{...o,collections:i,order:[...o.order,e.id]}}case"rename":if(e.id==="collection-default")throw Error("Default collection cannot be renamed");if(!e.name.trim())throw Error("Collection name is empty");l(e.id,{name:e.name.trim(),nameIsCustom:!0,...e.emoji===void 0?{}:{emoji:e.emoji}});break;case"collapse":l(e.id,{collapsed:e.collapsed});break;case"emoji":l(e.id,{emoji:e.emoji});break;case"clear":l(e.id,{sessionIds:[]});break;case"delete":if(e.id==="collection-default")throw Error("Default collection cannot be deleted");return delete i[e.id],{...o,collections:i,order:o.order.filter((s)=>s!==e.id)};case"add":t(e.collectionId,e.sessionId);break;case"materialize":return t(e.collectionId,e.sessionId),{...o,collections:i,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],cwd:e.cwd}}};case"move":{r(e.sourceCollectionId,e.sessionId),t(e.collectionId,e.sessionId);let n=i[e.collectionId].sessionIds.filter((d)=>d!==e.sessionId);n.splice(e.index??n.length,0,e.sessionId),l(e.collectionId,{sessionIds:n,collapsed:!1});break}case"reorder":{if(e.id==="collection-default")throw Error("Default collection cannot be reordered");let s=o.order.filter((n)=>n!==e.id);return s.splice(e.index,0,e.id),{...o,order:s}}case"forget":{for(let n of o.order)r(n,e.sessionId);let s={...o.sessionMeta};return delete s[e.sessionId],{...o,collections:i,sessionMeta:s}}case"remove":for(let s of e.collectionId===void 0?o.order:[e.collectionId])r(s,e.sessionId);break;case"favorite":if(o.order.some((s)=>i[s].sessionIds.includes(e.sessionId)))for(let s of o.order)r(s,e.sessionId);else t("collection-default",e.sessionId);break;case"meta":{let s=o.sessionMeta[e.sessionId],n={...s};if(e.meta.cwd!==void 0)n.cwd=e.meta.cwd;if(e.meta.title!==void 0&&!s?.titleOverride)n.title=e.meta.title;if(s?.cwd===n.cwd&&s?.title===n.title)return o;return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:n}}}case"renameSession":{let s=e.title.trim();return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],title:s||void 0,titleOverride:s.length>0}}}}}return{...o,collections:i}}function Gs(o,e=Xe()){let i={collections:{...e.collections},order:[...e.order],sessionMeta:{...e.sessionMeta}};for(let l of o){for(let[r,t]of Object.entries(l.sessionMeta??{})){let s=i.sessionMeta[r];i.sessionMeta[r]=s?.titleOverride?{...t,...s}:{...s,...t}}for(let r of l.order){if(r==="collection-default")continue;let t=l.collections[r];if(!t)throw Error(`Persisted collection missing: ${r}`);let s=i.collections[r];if(i.collections[r]={...t,...e.collections[r],sessionIds:[...new Set([...s?.sessionIds??[],...t.sessionIds??[]])]},!i.order.includes(r))i.order.push(r)}}return i}
2
- export{G,oe,Xe,on,Gs};
1
+ var V="collection-default";function re(o,e){return o.id==="collection-default"?e("collection.defaultFavorites"):o.name}function Xe(){return{collections:{["collection-default"]:{id:"collection-default",name:"",nameIsCustom:!1,collapsed:!1,sessionIds:[]}},order:["collection-default"],sessionMeta:{}}}function nn(o,e){let i={...o.collections},l=(s,n)=>{if(!i[s])throw Error(`Collection missing: ${s}`);i[s]={...i[s],...n}},r=(s,n)=>l(s,{sessionIds:i[s].sessionIds.filter((d)=>d!==n)}),t=(s,n)=>{let d=i[s];if(!d)throw Error(`Collection missing: ${s}`);for(let c of o.order)if(c!==s&&i[c].sessionIds.includes(n))r(c,n);if(!d.sessionIds.includes(n))l(s,{sessionIds:[...d.sessionIds,n],collapsed:!1})};switch(e.type){case"create":{if(!e.name.trim())throw Error("Collection name is empty");if(i[e.id]={id:e.id,name:e.name.trim(),...e.emoji===void 0?{}:{emoji:e.emoji},collapsed:!1,sessionIds:[]},e.sessionId!==void 0){if(e.sourceCollectionId!==void 0)r(e.sourceCollectionId,e.sessionId);t(e.id,e.sessionId)}return{...o,collections:i,order:[...o.order,e.id]}}case"rename":if(e.id==="collection-default")throw Error("Default collection cannot be renamed");if(!e.name.trim())throw Error("Collection name is empty");l(e.id,{name:e.name.trim(),nameIsCustom:!0,...e.emoji===void 0?{}:{emoji:e.emoji}});break;case"collapse":l(e.id,{collapsed:e.collapsed});break;case"emoji":l(e.id,{emoji:e.emoji});break;case"clear":l(e.id,{sessionIds:[]});break;case"delete":if(e.id==="collection-default")throw Error("Default collection cannot be deleted");return delete i[e.id],{...o,collections:i,order:o.order.filter((s)=>s!==e.id)};case"add":t(e.collectionId,e.sessionId);break;case"materialize":return t(e.collectionId,e.sessionId),{...o,collections:i,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],cwd:e.cwd}}};case"move":{r(e.sourceCollectionId,e.sessionId),t(e.collectionId,e.sessionId);let n=i[e.collectionId].sessionIds.filter((d)=>d!==e.sessionId);n.splice(e.index??n.length,0,e.sessionId),l(e.collectionId,{sessionIds:n,collapsed:!1});break}case"reorder":{if(e.id==="collection-default")throw Error("Default collection cannot be reordered");let s=o.order.filter((n)=>n!==e.id);return s.splice(e.index,0,e.id),{...o,order:s}}case"forget":{for(let n of o.order)r(n,e.sessionId);let s={...o.sessionMeta};return delete s[e.sessionId],{...o,collections:i,sessionMeta:s}}case"remove":for(let s of e.collectionId===void 0?o.order:[e.collectionId])r(s,e.sessionId);break;case"favorite":if(o.order.some((s)=>i[s].sessionIds.includes(e.sessionId)))for(let s of o.order)r(s,e.sessionId);else t("collection-default",e.sessionId);break;case"meta":{let s=o.sessionMeta[e.sessionId],n={...s};if(e.meta.cwd!==void 0)n.cwd=e.meta.cwd;if(e.meta.title!==void 0&&!s?.titleOverride)n.title=e.meta.title;if(s?.cwd===n.cwd&&s?.title===n.title)return o;return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:n}}}case"renameSession":{let s=e.title.trim();return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],title:s||void 0,titleOverride:s.length>0}}}}}return{...o,collections:i}}function ea(o,e=Xe()){let i={collections:{...e.collections},order:[...e.order],sessionMeta:{...e.sessionMeta}};for(let l of o){for(let[r,t]of Object.entries(l.sessionMeta??{})){let s=i.sessionMeta[r];i.sessionMeta[r]=s?.titleOverride?{...t,...s}:{...s,...t}}for(let r of l.order){if(r==="collection-default")continue;let t=l.collections[r];if(!t)throw Error(`Persisted collection missing: ${r}`);let s=i.collections[r];if(i.collections[r]={...t,...e.collections[r],sessionIds:[...new Set([...s?.sessionIds??[],...t.sessionIds??[]])]},!i.order.includes(r))i.order.push(r)}}return i}
2
+ export{V,re,Xe,nn,ea};
@@ -1,2 +1,2 @@
1
- import{Un}from"./chunk-2sc2z6g5.js";function _o(t){let n=t?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let l=decodeURIComponent(n[1]),e=Un.models.find((o)=>o.slug===l);return e?{value:e.default_reasoning_level,hidden:e.supported_reasoning_levels.length===0}:null}
2
- export{_o};
1
+ import{Hn}from"./chunk-7jk8s061.js";function ao(t){let n=t?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let l=decodeURIComponent(n[1]),e=Hn.models.find((o)=>o.slug===l);return e?{value:e.default_reasoning_level,hidden:e.supported_reasoning_levels.length===0}:null}
2
+ export{ao};
@@ -0,0 +1,2 @@
1
+ import{xt}from"./chunk-etvdqkvb.js";var qi={persistConfig:!1,nativeTools:{},applicationContext:()=>xt(null),parseConfig(t){if(Object.keys(t).length)throw Error("Chat input config must be empty");return{}},routePrompt(t){return t.native()}};
2
+ export{qi};
@@ -1,2 +1,2 @@
1
- import{L}from"./chunk-q4nx04sy.js";import{s,h}from"./chunk-n9jaz2pd.js";import{v,f}from"./chunk-a8r3mggj.js";import{GlobeIcon as G,LogOutIcon as R}from"lucide-react";import{useRef as k,useState as c}from"react";import{Avatar as T,AvatarFallback as B,AvatarImage as E}from"@nyssance/shadcn/vega/components/ui/avatar";import{DropdownMenu as H,DropdownMenuContent as U,DropdownMenuGroup as d,DropdownMenuItem as F,DropdownMenuLabel as j,DropdownMenuRadioGroup as z,DropdownMenuRadioItem as V,DropdownMenuSeparator as l,DropdownMenuSub as W,DropdownMenuSubContent as _,DropdownMenuSubTrigger as q,DropdownMenuTrigger as J}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as n}from"react/jsx-runtime";function da(e){return o(d,{...e})}function ua(e){return o(l,{...e})}function Rr({className:e,...r}){return o(F,{className:["h-[var(--navigation-row-height,30px)] py-0 [&_svg]:text-muted-foreground",e].filter(Boolean).join(" "),...r})}function pa({languages:e,value:r,onChange:i}){let a=s();return n(W,{children:[n(q,{className:"h-[var(--navigation-row-height,30px)] py-0",children:[o(G,{className:"text-muted-foreground"}),a.t("sessionList.language")]}),o(_,{children:o(z,{value:r,onValueChange:(t)=>void h(a,Promise.resolve(i(t))),children:e.map((t)=>o(V,{value:t.code,children:t.label},t.code))})})]})}function ma({user:e,children:r,onSignOut:i,busy:a=!1}){let t=s(),{t:N}=t,[g,C]=c(!1),[S,m]=c(!1),M=k(null),[w,O]=c({width:0,offset:0}),P=(x)=>{if(x){let p=M.current,u=p?.closest("[data-sidebar-footer-row]");if(!p||!u)throw Error("AccountMenu must sit in a [data-sidebar-footer-row] row");let y=u.getBoundingClientRect(),A=p.getBoundingClientRect(),I=getComputedStyle(u).direction==="rtl";O({width:u.clientWidth,offset:I?y.right-A.right:A.left-y.left})}C(x)};L(g);let b=a||S,D=n(T,{className:"size-[18px] after:border-0",children:[o(E,{src:e.avatar??void 0,alt:""}),o(B,{className:"bg-primary text-primary-foreground text-xs",children:[...e.name].slice(0,2).join("").toLocaleUpperCase()})]});return n(H,{open:g,onOpenChange:P,children:[n(J,{ref:M,render:o(f,{disabled:b,className:"text-muted-foreground hover:bg-foreground/8 data-popup-open:bg-foreground/5 font-normal"}),children:[o(v,{children:D}),o("span",{className:"min-w-0 truncate",children:e.name})]}),n(U,{side:"top",align:"start",alignOffset:-w.offset,sideOffset:8,style:{width:w.width},children:[n(d,{children:[n(j,{className:"text-popover-foreground flex items-center gap-2 px-2 py-2 text-sm font-medium",children:[o(v,{children:D}),n("span",{className:"min-w-0 flex-1",children:[o("span",{className:"block truncate",children:e.name}),o("span",{className:"text-muted-foreground mt-0.5 block truncate text-xs font-normal",children:e.email})]})]}),o(l,{})]}),r,r!=null&&o(l,{}),o(d,{children:n(Rr,{disabled:b,onClick:()=>{m(!0),h(t,i()).finally(()=>m(!1))},children:[o(R,{}),N("sessionList.signOut")]})})]})]})}
2
- export{da,ua,Rr,pa,ma};
1
+ import{E}from"./chunk-44r55va6.js";import{s,h}from"./chunk-ytdhstqx.js";import{v,f}from"./chunk-c2ez86jz.js";import{GlobeIcon as I,LogOutIcon as G}from"lucide-react";import{useRef as R,useState as c}from"react";import{Avatar as k,AvatarFallback as T,AvatarImage as B}from"@nyssance/shadcn/vega/components/ui/avatar";import{DropdownMenu as H,DropdownMenuContent as U,DropdownMenuGroup as d,DropdownMenuItem as F,DropdownMenuLabel as j,DropdownMenuRadioGroup as z,DropdownMenuRadioItem as V,DropdownMenuSeparator as l,DropdownMenuSub as W,DropdownMenuSubContent as _,DropdownMenuSubTrigger as q,DropdownMenuTrigger as J}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as n}from"react/jsx-runtime";function Ns(e){return o(d,{...e})}function As(e){return o(l,{...e})}function ti({className:e,...r}){return o(F,{className:["h-[var(--navigation-row-height,30px)] py-0 [&_svg]:text-muted-foreground",e].filter(Boolean).join(" "),...r})}function Es({languages:e,value:r,onChange:i}){let a=s();return n(W,{children:[n(q,{className:"h-[var(--navigation-row-height,30px)] py-0",children:[o(I,{className:"text-muted-foreground"}),a.t("sessionList.language")]}),o(_,{children:o(z,{value:r,onValueChange:(t)=>void h(a,Promise.resolve(i(t))),children:e.map((t)=>o(V,{value:t.code,children:t.label},t.code))})})]})}function Rs({user:e,children:r,onSignOut:i,busy:a=!1}){let t=s(),{t:N}=t,[g,C]=c(!1),[L,m]=c(!1),M=R(null),[w,S]=c({width:0,offset:0}),O=(x)=>{if(x){let p=M.current,u=p?.closest("[data-sidebar-footer-row]");if(!p||!u)throw Error("AccountMenu must sit in a [data-sidebar-footer-row] row");let y=u.getBoundingClientRect(),A=p.getBoundingClientRect(),P=getComputedStyle(u).direction==="rtl";S({width:u.clientWidth,offset:P?y.right-A.right:A.left-y.left})}C(x)};E(g);let b=a||L,D=n(k,{className:"size-[18px] after:border-0",children:[o(B,{src:e.avatar??void 0,alt:""}),o(T,{className:"bg-primary text-primary-foreground text-xs",children:[...e.name].slice(0,2).join("").toLocaleUpperCase()})]});return n(H,{open:g,onOpenChange:O,children:[n(J,{ref:M,render:o(f,{disabled:b,className:"text-muted-foreground hover:bg-foreground/8 data-popup-open:bg-foreground/5 font-normal"}),children:[o(v,{children:D}),o("span",{className:"min-w-0 truncate",children:e.name})]}),n(U,{side:"top",align:"start",alignOffset:-w.offset,sideOffset:8,style:{width:w.width},children:[n(d,{children:[n(j,{className:"text-popover-foreground flex items-center gap-2 px-2 py-2 text-sm font-medium",children:[o(v,{children:D}),n("span",{className:"min-w-0 flex-1",children:[o("span",{className:"block truncate",children:e.name}),o("span",{className:"text-muted-foreground mt-0.5 block truncate text-xs font-normal",children:e.email})]})]}),o(l,{})]}),r,r!=null&&o(l,{}),o(d,{children:n(ti,{disabled:b,onClick:()=>{m(!0),h(t,i()).finally(()=>m(!1))},children:[o(G,{}),N("sessionList.signOut")]})})]})]})}
2
+ export{Ns,As,ti,Es,Rs};
@@ -1,2 +1,2 @@
1
- import{y}from"./chunk-f9z37ptq.js";import{e}from"./chunk-bshgrwe9.js";import{me,S}from"./chunk-h8r785ne.js";import{Ee}from"./chunk-7xvrsw7x.js";import{wn}from"./chunk-p1tcxky2.js";import{useRef as E,useState as c}from"react";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as s,jsxs as b}from"react/jsx-runtime";function xn({client:l,session:i,providers:w,catalog:P}){let{host:n}=e(),m=(o)=>n.reportError?n.reportError(o):console.error(o),a=Ee(w,m),[p,u]=c(!1),d=E(!1),[f,v]=c(null),g=y(l.store,(o)=>o.connection==="ready"),x=p||!g||i.restoring,[r,M]=c(null),C=y(l.store,(o)=>o.nativeModels),h=r!==null&&(C.some((o)=>o.id===r)||a!==null&&me(a).some((o)=>o.models.some((t)=>S(o.id,t.id)===r)));async function k(o){if(d.current||!g||i.restoring)return;d.current=!0,M(o),v(null),u(!0);try{await l.resumeModel(i.id,o)}catch(t){v(t instanceof Error?t.message:String(t)),m(t)}finally{d.current=!1,u(!1)}}return b("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 px-4 py-3 text-sm","aria-busy":p,"data-model-recovery":!0,children:[b("div",{className:"min-w-0 flex-1 basis-full",children:[s("p",{children:n.t("provider.managed.reselect")}),f&&s("p",{role:"alert",className:"text-destructive break-words",children:f})]}),s("fieldset",{disabled:x,children:s(wn,{snapshot:a,model:r,onChange:M,nativeModels:C,catalog:P})}),s(B,{size:"sm",disabled:x||!h,onClick:()=>{if(r!==null)k(r)},children:n.t("provider.managed.resume")})]})}
2
- export{xn};
1
+ import{y}from"./chunk-rragk2vb.js";import{e}from"./chunk-n32wra9r.js";import{he,S}from"./chunk-c2r7xpjf.js";import{Ue}from"./chunk-m799f2x5.js";import{Tn}from"./chunk-3q2zdv9e.js";import{useRef as E,useState as c}from"react";import{Button as B}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as s,jsxs as b}from"react/jsx-runtime";function _n({client:l,session:i,providers:w,catalog:P}){let{host:n}=e(),m=(o)=>n.reportError?n.reportError(o):console.error(o),a=Ue(w,m),[p,u]=c(!1),d=E(!1),[f,v]=c(null),g=y(l.store,(o)=>o.connection==="ready"),x=p||!g||i.restoring,[r,M]=c(null),C=y(l.store,(o)=>o.nativeModels),h=r!==null&&(C.some((o)=>o.id===r)||a!==null&&he(a).some((o)=>o.models.some((t)=>S(o.id,t.id)===r)));async function k(o){if(d.current||!g||i.restoring)return;d.current=!0,M(o),v(null),u(!0);try{await l.resumeModel(i.id,o)}catch(t){v(t instanceof Error?t.message:String(t)),m(t)}finally{d.current=!1,u(!1)}}return b("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 px-4 py-3 text-sm","aria-busy":p,"data-model-recovery":!0,children:[b("div",{className:"min-w-0 flex-1 basis-full",children:[s("p",{children:n.t("provider.managed.reselect")}),f&&s("p",{role:"alert",className:"text-destructive break-words",children:f})]}),s("fieldset",{disabled:x,children:s(Tn,{snapshot:a,model:r,onChange:M,nativeModels:C,catalog:P})}),s(B,{size:"sm",disabled:x||!h,onClick:()=>{if(r!==null)k(r)},children:n.t("provider.managed.resume")})]})}
2
+ export{_n};
@@ -1,2 +1,2 @@
1
- import{bs,at,Jo,Cs,ws,ks}from"./chunk-xadfbbwt.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var xs=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>bs({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=at({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Jo({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=at({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=ks({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=at({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Cs({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=ws({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=at({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Jo({anchorKey:e,layout:i,previousRange:M}))??at({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
2
- export{xs};
1
+ import{Cr,rt,Po,wr,kr,Sr}from"./chunk-w63mha8c.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var br=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>Cr({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=rt({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Po({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=rt({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Sr({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=rt({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=wr({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=kr({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=rt({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Po({anchorKey:e,layout:i,previousRange:M}))??rt({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
2
+ export{br};
@@ -1,3 +1,3 @@
1
- import{Qr,Lt}from"./chunk-dypeezvv.js";import{t,y}from"./chunk-f9z37ptq.js";import{createStore as d}from"@alwith/api/client";import{Dialog as f,DialogContent as p,DialogDescription as m,DialogHeader as u,DialogTitle as h}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function zt(e){c.setState({request:{path:e.path,patch:Yo(e.patch,e.path)}})}function Yo(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
2
- `,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function Vt(){let{t:e,theme:a}=t(),n=y(c,(o)=>o.request),s=n===null?null:Qr(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(Lt,{patch:n.patch,theme:a})})]})})}
3
- export{zt,Yo,Vt};
1
+ import{Ii,vt}from"./chunk-gttw4rmx.js";import{t,y}from"./chunk-rragk2vb.js";import{createStore as d}from"@alwith/api/client";import{Dialog as f,DialogContent as p,DialogDescription as m,DialogHeader as u,DialogTitle as h}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function ln(e){c.setState({request:{path:e.path,patch:Ci(e.patch,e.path)}})}function Ci(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
2
+ `,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function cn(){let{t:e,theme:a}=t(),n=y(c,(o)=>o.request),s=n===null?null:Ii(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(vt,{patch:n.patch,theme:a})})]})})}
3
+ export{ln,Ci,cn};
@@ -1,2 +1,2 @@
1
- import{D}from"./chunk-50eym2q3.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function Ea(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function Mi(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=D(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(D(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function Ni(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Ea(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(so),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function so(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function de(t){return A(t.content)}function ft(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function ao(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Ai(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function Ei(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function Ri(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!Ei(t,e[n-1],o))break;n--}return e[n]?.key}function Li(t,e,n){let o=n,s=n;while(o>0&&Ei(t,e[o-1],e[o]))o--;while(s+1<e.length&&Ei(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
- export{Ea,Mi,Ni,so,de,ft,ao,Ai,Ei,Ri,Li};
1
+ import{F}from"./chunk-3qy743j9.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function za(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function as(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=F(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(F(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function ls(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!za(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(zo),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function zo(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function xe(t){return A(t.content)}function Ht(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Vo(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function cs(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function ds(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function us(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!ds(t,e[n-1],o))break;n--}return e[n]?.key}function ps(t,e,n){let o=n,s=n;while(o>0&&ds(t,e[o-1],e[o]))o--;while(s+1<e.length&&ds(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
+ export{za,as,ls,zo,xe,Ht,Vo,cs,ds,us,ps};
@@ -1,4 +1,4 @@
1
- function _t(e,t){if(e!==null&&e!=="generate"&&e!=="edit")throw Error("Invalid image intent");return{"alwith.imageIntent":e===null?"The current message uses ordinary chat input. For image generation or editing, use the native image generation tool, never the application generate_image tool. Do not apply application image-model settings or earlier application image-workflow instructions. Image generation is not implied by the input mode; follow the user's request.":[e==="edit"?"The current message requests an image edit. Use the application generate_image tool and the supplied source and reference attachments. Follow the specific editing instructions in the user message.":"The user selected image input for the current message. Treat descriptions as requests to generate or edit images using the application generate_image tool. Use attached images as references when relevant. Answer questions about previous results normally; do not generate another image unless requested.","Use only the application's selected image model for this image conversation. Do not substitute a native image generation tool.",t].filter(Boolean).join(`
1
+ function xt(e,t){if(e!==null&&e!=="generate"&&e!=="edit")throw Error("Invalid image intent");return{"alwith.imageIntent":e===null?"The current message uses ordinary chat input. For image generation or editing, use the native image generation tool, never the application generate_image tool. Do not apply application image-model settings or earlier application image-workflow instructions. Image generation is not implied by the input mode; follow the user's request.":[e==="edit"?"The current message requests an image edit. Use the application generate_image tool and the supplied source and reference attachments. Follow the specific editing instructions in the user message.":"The user selected image input for the current message. Treat descriptions as requests to generate or edit images using the application generate_image tool. Use attached images as references when relevant. Answer questions about previous results normally; do not generate another image unless requested.","Use only the application's selected image model for this image conversation. Do not substitute a native image generation tool.",t].filter(Boolean).join(`
2
2
 
3
3
  `)}}
4
- export{_t};
4
+ export{xt};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-f9z37ptq.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function Ia(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function xi({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=Ia(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
2
- export{Ia,xi};
1
+ import{t}from"./chunk-rragk2vb.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function Ea(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function Ir({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=Ea(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
2
+ export{Ea,Ir};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-f9z37ptq.js";import{mt}from"./chunk-cer4dxas.js";import{e,b}from"./chunk-bshgrwe9.js";import{Qn}from"./chunk-eqbp85f3.js";import{Loader2Icon as v}from"lucide-react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as c,EmptyDescription as l,EmptyHeader as d,EmptyTitle as f}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function Gt({session:t,timeline:s}){let{host:m,client:a}=e(),{t:n}=m,u=o((h)=>h.historyPages[t.id]?.cursor!=null),y=Qn(t,s?.turnWork),E=()=>b(m,a.open(t.id,t.cwd)),p=r(mt,{...s,session:t,client:a,host:m,turnWork:y});if(t.restoring)return t.items.length===0?i("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[r(v,{className:"size-4 animate-spin","aria-hidden":"true"}),n("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return i(c,{className:"flex-1",children:[i(d,{children:[r(f,{children:n("conversation.reopen")}),r(l,{children:n("conversation.detached")})]}),r(x,{onClick:E,children:n("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!u)return r(c,{className:"flex-1",children:i(d,{children:[r(f,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(l,{className:"truncate font-mono",children:t.cwd})]})});return p}
2
- export{Gt};
1
+ import{o}from"./chunk-rragk2vb.js";import{At}from"./chunk-zj7kjjdj.js";import{e,C}from"./chunk-n32wra9r.js";import{no}from"./chunk-0a7vp0ph.js";import{Loader2Icon as v}from"lucide-react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as c,EmptyDescription as l,EmptyHeader as d,EmptyTitle as f}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function dn({session:t,timeline:s}){let{host:m,client:a}=e(),{t:n}=m,u=o((h)=>h.historyPages[t.id]?.cursor!=null),y=no(t,s?.turnWork),E=()=>C(m,a.open(t.id,t.cwd)),p=r(At,{...s,session:t,client:a,host:m,turnWork:y});if(t.restoring)return t.items.length===0?i("div",{className:"text-muted-foreground flex flex-1 items-center justify-center gap-2 text-sm",children:[r(v,{className:"size-4 animate-spin","aria-hidden":"true"}),n("conversation.restoring")]}):p;if(!t.attached&&t.items.length===0)return i(c,{className:"flex-1",children:[i(d,{children:[r(f,{children:n("conversation.reopen")}),r(l,{children:n("conversation.detached")})]}),r(x,{onClick:E,children:n("conversation.reopen")})]});if(t.items.length===0&&t.state==="idle"&&!u)return r(c,{className:"flex-1",children:i(d,{children:[r(f,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(l,{className:"truncate font-mono",children:t.cwd})]})});return p}
2
+ export{dn};
@@ -1,2 +1,2 @@
1
- var a=(e)=>String(e).padStart(2,"0");function gt(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
- export{gt};
1
+ var a=(e)=>String(e).padStart(2,"0");function Lt(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
+ export{Lt};
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";function Xt({title:t,badge:a,children:i}){return e("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[e("div",{className:"flex min-h-9 items-center gap-2",children:[r("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:t}),a]}),i]})}
2
- export{Xt};
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";function Gt({title:t,badge:a,children:i}){return e("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[e("div",{className:"flex min-h-9 items-center gap-2",children:[r("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:t}),a]}),i]})}
2
+ export{Gt};
@@ -1,2 +1,2 @@
1
- import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var Ur={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},Br={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function V({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=Ur[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",Br.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
- export{Ur,Br,V};
1
+ import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var mi={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},gi={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function z({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=mi[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",gi.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
+ export{mi,gi,z};
@@ -1,2 +1,2 @@
1
- import{L}from"./chunk-q4nx04sy.js";import{s}from"./chunk-n9jaz2pd.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function ga({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return L(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
2
- export{ga};
1
+ import{E}from"./chunk-44r55va6.js";import{s}from"./chunk-ytdhstqx.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function js({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return E(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
2
+ export{js};
@@ -1 +1 @@
1
- import{ze}from"./chunk-sgbn37kz.js";import{H}from"./chunk-8hygfx41.js";import{cn as n}from"cn";import{Item as i,ItemActions as q,ItemContent as K,ItemDescription as ce,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function _e({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(ze,"data-[active=true]:font-medium",e),...r})}function tn({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(H,{children:t})})}export{q,K,ce,W,Z,_e,tn};
1
+ import{Le}from"./chunk-stv8pr4v.js";import{H}from"./chunk-8hygfx41.js";import{cn as n}from"cn";import{Item as i,ItemActions as q,ItemContent as K,ItemDescription as ce,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function ke({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(Le,"data-[active=true]:font-medium",e),...r})}function Vt({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(H,{children:t})})}export{q,K,ce,W,Z,ke,Vt};
@@ -1,2 +1,2 @@
1
- import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function Oi(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
2
- export{Oi};
1
+ import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function Hr(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
2
+ export{Hr};
@@ -1,3 +1,3 @@
1
- import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function Qr(e){let t=0,i=0;for(let o of e.split(`
2
- `)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function Lt({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
3
- export{Qr,Lt};
1
+ import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function Ii(e){let t=0,i=0;for(let o of e.split(`
2
+ `)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function vt({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
3
+ export{Ii,vt};
@@ -1,7 +1,7 @@
1
- import{rs}from"./chunk-vsh9vh4s.js";import{be}from"./chunk-x4enakra.js";import{Go}from"./chunk-g751pxzk.js";import{w}from"./chunk-0myf2ak0.js";import{Wo,Bt}from"./chunk-zsrjzx7g.js";import{ae,Qo}from"./chunk-f9z37ptq.js";import{Ho}from"./chunk-h0k80cxs.js";import{ts,ns}from"./chunk-4r0ffb0s.js";import{Jr}from"./chunk-6r5nzsw8.js";import{Oo,Xr}from"./chunk-zm6b6zyr.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as C}from"entities";import le from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as xe,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as b,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ce}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function v(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var Te=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,ve=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ye=/\uE200[^\uE201]*$/,Ce=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
1
+ import{ys}from"./chunk-beccgzp9.js";import{be}from"./chunk-7m83dwzq.js";import{Ko}from"./chunk-dr5swvaa.js";import{w}from"./chunk-q1kb5z75.js";import{Bo,Ot}from"./chunk-jy0jrht0.js";import{ae,qo}from"./chunk-rragk2vb.js";import{Ho}from"./chunk-snrbgnwn.js";import{Wr,Zr}from"./chunk-vhxavb92.js";import{qr}from"./chunk-ncgwbdmj.js";import{Oo,Kr}from"./chunk-hyhp5ytm.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as C}from"entities";import le from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as xe,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as b,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ce}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function v(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var Te=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,ve=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ye=/\uE200[^\uE201]*$/,Ce=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
2
2
  `)?`${e}\`\`\``:`${e}
3
3
  \`\`\``}function _(e,n){if(!e.includes(n)||Ne(e,n)%2===0)return e;let t=Le(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
4
4
  `)||ne(r))return e;return`${e}${n}`}function $e(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function te(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Pe(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=te(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let l=d.toLowerCase();if(l.length>Ce&&!Me.has(l))return!1}return!0}function Se(e){let{path:n}=te(e);if($e(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ae(e){let n=e.match(H);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Pe(t)||Se(t)?e.replace(H,"$1"):`${e})`}function Fe(e){let n=e.replace(ye,"");if(n.length===0||n.includes("`")&&ne(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Ie(n))return{isCodeFenceOpen:!0,markdown:Re(n)};if(n.includes("!["))n=n.replace(ve,(t,r)=>r);if(n.includes("]("))n=Ae(n);return n=_(n,"**"),n=_(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function He(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function O(e){return He(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function re(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))re(t.tokens);if(!O(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!O(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
5
- `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=Wo(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=v(),r=Qo();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(ns,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=v(),o=ae();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=v(),i=b(null),[c,d]=h(null),[l,p]=h(null),[E,x]=h(!1);if(k(()=>{let f=Jr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let T=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{x(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),x(!0),window.setTimeout(()=>x(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...T===null?{children:e}:{dangerouslySetInnerHTML:{__html:T}}})})]})}function De({code:e,language:n}){let t=v(),r=J(Y),o=Qo();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Ho,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=b(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return v().preview?a(ce,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=v(),t=ae(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Bt(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=b(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ce,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=b(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");le.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
- `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,Te)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function se(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=se(r),s=t.get(o)??0;return t.set(o,s+1),ie(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!Go(r))return null;return a(Ve,{src:r,alt:C(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function ie(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(ts))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(rs,{text:C(t.text),children:q(C(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=w(o);if(s!==null)return a(be,{app:{id:s,name:C(t.text).replace(/^\$/,"")}},n);return Go(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function y(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?C(n.text):n.tokens.map(y).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(y).join("");case"list":return e.items.map(y).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(y).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},ie(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=se(I),A=f.get(R)??0;f.set(R,A+1);let F=y(I),de={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,de})},[n]),s=o.map((u)=>u.visibleText).join(""),i=b({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],x=c.generation+(d?0:1),T={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:x};if(r&&s.length>l)T.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=T}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:T.runs,generation:x},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=b(null),[o,s]=h(()=>Oo(n,t)),i=b(o!==null),[c,d]=h(null);if(k(()=>{let l=Xr((p)=>{if(!i.current)i.current=!0,s(p);else xe(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Dt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
5
+ `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=Bo(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=v(),r=qo();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(Zr,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=v(),o=ae();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=v(),i=b(null),[c,d]=h(null),[l,p]=h(null),[E,x]=h(!1);if(k(()=>{let f=qr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let T=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{x(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),x(!0),window.setTimeout(()=>x(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...T===null?{children:e}:{dangerouslySetInnerHTML:{__html:T}}})})]})}function De({code:e,language:n}){let t=v(),r=J(Y),o=qo();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Ho,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=b(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return v().preview?a(ce,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=v(),t=ae(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Ot(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=b(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ce,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=b(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");le.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
+ `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,Te)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function se(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=se(r),s=t.get(o)??0;return t.set(o,s+1),ie(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!Ko(r))return null;return a(Ve,{src:r,alt:C(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function ie(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(Wr))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(ys,{text:C(t.text),children:q(C(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=w(o);if(s!==null)return a(be,{app:{id:s,name:C(t.text).replace(/^\$/,"")}},n);return Ko(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function y(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?C(n.text):n.tokens.map(y).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(y).join("");case"list":return e.items.map(y).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(y).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},ie(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=se(I),A=f.get(R)??0;f.set(R,A+1);let F=y(I),de={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,de})},[n]),s=o.map((u)=>u.visibleText).join(""),i=b({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],x=c.generation+(d?0:1),T={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:x};if(r&&s.length>l)T.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=T}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:T.runs,generation:x},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=b(null),[o,s]=h(()=>Oo(n,t)),i=b(o!==null),[c,d]=h(null);if(k(()=>{let l=Kr((p)=>{if(!i.current)i.current=!0,s(p);else xe(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Dt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
7
7
  export{Dt};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-rragk2vb.js";import{e}from"./chunk-n32wra9r.js";import{x,ee}from"./chunk-w5q2ygsa.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=x(a.configOptions,"model");return t===void 0?void 0:ee(t)}function nt(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=x(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||N+k+g+w,R=N+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(N)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],v=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:nt(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var vn=W(_);
2
+ export{nt,vn};