@alwith/module-chat 0.6.22 → 0.6.24

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 (493) hide show
  1. package/README.md +1 -1
  2. package/dist/activity-host.js +1 -1
  3. package/dist/agent/application-client.js +1 -1
  4. package/dist/agent/client.js +1 -1
  5. package/dist/agent/custom-model-effort.js +1 -1
  6. package/dist/agent/fork-title.js +1 -1
  7. package/dist/agent/image-request.js +1 -1
  8. package/dist/agent/image-tools.js +1 -1
  9. package/dist/agent/input-config.js +1 -1
  10. package/dist/agent/input-modes/chat.js +1 -1
  11. package/dist/agent/input-modes/execution-meta.js +1 -1
  12. package/dist/agent/input-modes/image-context.js +1 -1
  13. package/dist/agent/input-modes/image.js +1 -1
  14. package/dist/agent/input-modes/index.js +1 -1
  15. package/dist/agent/project-path.js +1 -1
  16. package/dist/agent/request-error.js +1 -1
  17. package/dist/agent/session-list-refresh.js +1 -1
  18. package/dist/app-reference.js +1 -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-0myf2ak0.js +2 -0
  27. package/dist/{chunk-9ys14ex1.js → chunk-0ne2mz2q.js} +3 -3
  28. package/dist/{chunk-5r5dc363.js → chunk-0xshzqb6.js} +2 -2
  29. package/dist/{chunk-2b7fjev1.js → chunk-11vn501z.js} +2 -2
  30. package/dist/{chunk-vtw1zmyd.js → chunk-1e83qr49.js} +2 -2
  31. package/dist/{chunk-6j2q7qvk.js → chunk-1pb43y89.js} +2 -2
  32. package/dist/{chunk-nrk4aa7a.js → chunk-1rwkdezk.js} +2 -2
  33. package/dist/chunk-1smyy9mt.js +2 -0
  34. package/dist/{chunk-t3enrsnt.js → chunk-26w51q10.js} +2 -2
  35. package/dist/{chunk-rcfjwyt4.js → chunk-2cc8d35c.js} +1 -1
  36. package/dist/{chunk-qbt8ahwr.js → chunk-2fx3qhyb.js} +2 -2
  37. package/dist/chunk-2q1xxs3t.js +2 -0
  38. package/dist/{chunk-tp7329ny.js → chunk-2qs1ss40.js} +2 -2
  39. package/dist/{chunk-127rz9fe.js → chunk-2sc2z6g5.js} +2 -2
  40. package/dist/chunk-36ttr22w.js +2 -0
  41. package/dist/{chunk-fdmtynmq.js → chunk-3a5sn0v8.js} +2 -2
  42. package/dist/chunk-3mm1d99e.js +2 -0
  43. package/dist/chunk-3qwtda21.js +3 -0
  44. package/dist/{chunk-jv117dry.js → chunk-3z5zyra7.js} +2 -2
  45. package/dist/{chunk-cc8cg69z.js → chunk-3zae491f.js} +4 -4
  46. package/dist/{chunk-xnj05nc3.js → chunk-4fmn1kk4.js} +3 -3
  47. package/dist/chunk-4gxpna3p.js +2 -0
  48. package/dist/{chunk-fgec4g5x.js → chunk-4h9ee02f.js} +2 -2
  49. package/dist/{chunk-71fhan3p.js → chunk-4ntxjy8v.js} +2 -2
  50. package/dist/{chunk-ehp3p3t5.js → chunk-4r0ffb0s.js} +2 -2
  51. package/dist/{chunk-7ekex790.js → chunk-50eym2q3.js} +3 -3
  52. package/dist/{chunk-05eftctr.js → chunk-542c9tpr.js} +2 -2
  53. package/dist/chunk-5d138vq3.js +1 -0
  54. package/dist/{chunk-gzf6kzm0.js → chunk-5kje89r8.js} +2 -2
  55. package/dist/{chunk-00vd1yaz.js → chunk-5pmr5dby.js} +2 -2
  56. package/dist/chunk-5ryfm4ka.js +4 -0
  57. package/dist/{chunk-7n1v87h0.js → chunk-5xe89qwh.js} +2 -2
  58. package/dist/{chunk-2w0grrzz.js → chunk-6cjjwry2.js} +2 -2
  59. package/dist/{chunk-b1yfr8gv.js → chunk-6r5nzsw8.js} +2 -2
  60. package/dist/{chunk-cbx30sf1.js → chunk-6tvq472s.js} +2 -2
  61. package/dist/{chunk-dav36sjv.js → chunk-6vdayg6w.js} +2 -2
  62. package/dist/{chunk-y3e10q18.js → chunk-6w8p1hwb.js} +2 -2
  63. package/dist/{chunk-shk5mmmw.js → chunk-73541c5k.js} +2 -2
  64. package/dist/{chunk-xde2hdrb.js → chunk-76c0cx40.js} +2 -2
  65. package/dist/{chunk-adnpp676.js → chunk-76smt4zv.js} +3 -3
  66. package/dist/{chunk-96wvztgv.js → chunk-79ayc6qy.js} +2 -2
  67. package/dist/{chunk-xj2qfepx.js → chunk-79pvfyd0.js} +2 -2
  68. package/dist/{chunk-6hgcxkwd.js → chunk-7a70nd7e.js} +2 -2
  69. package/dist/chunk-7cab9zy0.js +2 -0
  70. package/dist/chunk-7s3f142h.js +2 -0
  71. package/dist/{chunk-xdmjwqgf.js → chunk-7v7wc7k5.js} +2 -2
  72. package/dist/{chunk-eraepgrh.js → chunk-7wd0kfqr.js} +2 -2
  73. package/dist/{chunk-3rew4bcf.js → chunk-7wpcdwan.js} +2 -2
  74. package/dist/chunk-7xvrsw7x.js +2 -0
  75. package/dist/{chunk-6cks2gn2.js → chunk-81hv0s07.js} +2 -2
  76. package/dist/{chunk-03mdvw7w.js → chunk-84eye2j0.js} +2 -2
  77. package/dist/{chunk-wjazfhrm.js → chunk-859359n0.js} +2 -2
  78. package/dist/{chunk-mptke00a.js → chunk-8ew2e3y7.js} +2 -2
  79. package/dist/{chunk-dgh0750h.js → chunk-8h4e3654.js} +2 -2
  80. package/dist/{chunk-mfs0b15q.js → chunk-8hygfx41.js} +2 -2
  81. package/dist/{chunk-2gp33sx4.js → chunk-8mzbkjhk.js} +2 -2
  82. package/dist/{chunk-vkfz61d6.js → chunk-8v53bkyr.js} +2 -2
  83. package/dist/{chunk-0k6zg9s1.js → chunk-9hjfc08t.js} +2 -2
  84. package/dist/{chunk-xvmmndhs.js → chunk-9ts08sma.js} +2 -2
  85. package/dist/chunk-a6ysp1fp.js +2 -0
  86. package/dist/chunk-a8r3mggj.js +2 -0
  87. package/dist/{chunk-tz1redf7.js → chunk-a9grdyep.js} +3 -3
  88. package/dist/chunk-ayt0bzr9.js +2 -0
  89. package/dist/{chunk-8jqaahna.js → chunk-az3g3a94.js} +2 -2
  90. package/dist/chunk-b42vv8f2.js +2 -0
  91. package/dist/chunk-b61qhh61.js +2 -0
  92. package/dist/{chunk-f7bn0nd2.js → chunk-bane0xc8.js} +2 -2
  93. package/dist/{chunk-pvdm1v6g.js → chunk-bcnh0z8e.js} +2 -2
  94. package/dist/{chunk-yk72yvcd.js → chunk-bdrcreqs.js} +2 -2
  95. package/dist/chunk-bfb8bpwc.js +2 -0
  96. package/dist/chunk-bgav9cq2.js +2 -0
  97. package/dist/chunk-bh0h7fz7.js +2 -0
  98. package/dist/chunk-bshgrwe9.js +2 -0
  99. package/dist/chunk-bsnmj69j.js +2 -0
  100. package/dist/chunk-capkej8s.js +2 -0
  101. package/dist/chunk-cer4dxas.js +2 -0
  102. package/dist/{chunk-pkkw0fxs.js → chunk-ck2ax5f6.js} +2 -2
  103. package/dist/chunk-cq7bbgcg.js +2 -0
  104. package/dist/{chunk-2wdvcx76.js → chunk-csbv8m51.js} +3 -3
  105. package/dist/chunk-d29xbf16.js +2 -0
  106. package/dist/chunk-d5gt1x0n.js +2 -0
  107. package/dist/{chunk-m0rznqwx.js → chunk-d6ke5e80.js} +2 -2
  108. package/dist/chunk-dp1nnwk2.js +2 -0
  109. package/dist/chunk-dpfjxym1.js +2 -0
  110. package/dist/{chunk-kawq8f1z.js → chunk-dxsjz3re.js} +2 -2
  111. package/dist/{chunk-z0z3xfn3.js → chunk-dypeezvv.js} +3 -3
  112. package/dist/{chunk-nase48et.js → chunk-e04g26qm.js} +2 -2
  113. package/dist/{chunk-322m8vk4.js → chunk-e5m9kg1w.js} +2 -2
  114. package/dist/{chunk-vvpagkya.js → chunk-e641842r.js} +2 -2
  115. package/dist/chunk-eqbp85f3.js +2 -0
  116. package/dist/{chunk-s5fk9ywy.js → chunk-et2pdaz7.js} +2 -2
  117. package/dist/chunk-f9z37ptq.js +2 -0
  118. package/dist/{chunk-nbch7nw2.js → chunk-fe83mqnb.js} +2 -2
  119. package/dist/{chunk-g98m1se7.js → chunk-ffs5nkt0.js} +2 -2
  120. package/dist/chunk-fn68kh69.js +2 -0
  121. package/dist/{chunk-bbwxqt7p.js → chunk-g751pxzk.js} +2 -2
  122. package/dist/{chunk-zr6xrady.js → chunk-gak8579e.js} +2 -2
  123. package/dist/{chunk-xmr3vcp8.js → chunk-gec6q1jb.js} +2 -2
  124. package/dist/{chunk-6cxa2jrx.js → chunk-geh3wyxw.js} +2 -2
  125. package/dist/chunk-gkyvgjyx.js +2 -0
  126. package/dist/chunk-gpcsb4tg.js +3 -0
  127. package/dist/{chunk-j8jn2p7q.js → chunk-h0k80cxs.js} +1 -1
  128. package/dist/{chunk-1dkd8jt0.js → chunk-h8r785ne.js} +2 -2
  129. package/dist/{chunk-m08yer2f.js → chunk-hcat58sr.js} +2 -2
  130. package/dist/{chunk-ws4qt1sc.js → chunk-heqa4swe.js} +2 -2
  131. package/dist/chunk-j2cdjycf.js +2 -0
  132. package/dist/{chunk-k025mmnv.js → chunk-j3g21ext.js} +2 -2
  133. package/dist/{chunk-z90zckkv.js → chunk-jcyv1q0x.js} +2 -2
  134. package/dist/chunk-jjgwfpmp.js +2 -0
  135. package/dist/{chunk-29jan02g.js → chunk-js3nhatr.js} +2 -2
  136. package/dist/{chunk-pphkxw72.js → chunk-jw1c8r97.js} +2 -2
  137. package/dist/{chunk-pae53dz2.js → chunk-jydhbkm8.js} +2 -2
  138. package/dist/{chunk-0y8pnj16.js → chunk-kbfe7gqw.js} +2 -2
  139. package/dist/{chunk-k86843av.js → chunk-kj3a1k2q.js} +2 -2
  140. package/dist/{chunk-nefts0rn.js → chunk-kk9dbwd1.js} +2 -2
  141. package/dist/{chunk-ywwfzgm6.js → chunk-m6080rsp.js} +2 -2
  142. package/dist/{chunk-vxkkzs4m.js → chunk-m8tt5bf9.js} +2 -2
  143. package/dist/{chunk-e8dzp9xe.js → chunk-m9ttf96p.js} +2 -2
  144. package/dist/{chunk-zsbsypka.js → chunk-mbsmb8jn.js} +2 -2
  145. package/dist/{chunk-76r5v06g.js → chunk-mc40zb3c.js} +2 -2
  146. package/dist/chunk-mcrd86tx.js +2 -0
  147. package/dist/{chunk-r9vjpafx.js → chunk-mdercwm8.js} +3 -3
  148. package/dist/{chunk-9q5a0kwf.js → chunk-mfn37eme.js} +2 -2
  149. package/dist/{chunk-hb22jn2e.js → chunk-mgmv8kap.js} +2 -2
  150. package/dist/{chunk-2q20937h.js → chunk-mtn6vdf8.js} +2 -2
  151. package/dist/{chunk-09w80wgb.js → chunk-n0q8e6sq.js} +2 -2
  152. package/dist/chunk-n9jaz2pd.js +2 -0
  153. package/dist/{chunk-pwsqw3mx.js → chunk-nbaxn7jx.js} +2 -2
  154. package/dist/{chunk-q6f0e289.js → chunk-nh56sb8e.js} +2 -2
  155. package/dist/{chunk-m9s9etss.js → chunk-nhstvqjy.js} +2 -2
  156. package/dist/chunk-nvgnan7w.js +2 -0
  157. package/dist/{chunk-6qh7fvgs.js → chunk-nypr6qtz.js} +3 -3
  158. package/dist/chunk-p1tcxky2.js +2 -0
  159. package/dist/chunk-p811gdar.js +2 -0
  160. package/dist/chunk-p8cm3xw1.js +2 -0
  161. package/dist/{chunk-hhnxwgz5.js → chunk-pnh5t6pc.js} +2 -2
  162. package/dist/{chunk-nm8245ze.js → chunk-pr36m3qx.js} +2 -2
  163. package/dist/chunk-pxv38ttf.js +2 -0
  164. package/dist/{chunk-7narmchf.js → chunk-q01vmp9m.js} +2 -2
  165. package/dist/{chunk-p521krn5.js → chunk-q4nx04sy.js} +2 -2
  166. package/dist/chunk-q73jne25.js +2 -0
  167. package/dist/{chunk-4cnm37fs.js → chunk-q7ka46hb.js} +3 -3
  168. package/dist/{chunk-jwsgt0d9.js → chunk-qdyyvd2w.js} +2 -2
  169. package/dist/{chunk-xtn9bw6a.js → chunk-qghq84r4.js} +2 -2
  170. package/dist/{chunk-d4edqxgc.js → chunk-qk1yqepm.js} +2 -2
  171. package/dist/chunk-qm2jq2bq.js +2 -0
  172. package/dist/{chunk-dps8nnde.js → chunk-qv23mh24.js} +2 -2
  173. package/dist/{chunk-kj3re492.js → chunk-qvw0kyse.js} +2 -2
  174. package/dist/chunk-qwet39v5.js +2 -0
  175. package/dist/{chunk-v77kjbkb.js → chunk-qxssxzws.js} +2 -2
  176. package/dist/chunk-r3hsjwjn.js +2 -0
  177. package/dist/{chunk-bm1x011j.js → chunk-r7paw6ba.js} +2 -2
  178. package/dist/{chunk-jzqvhnq5.js → chunk-rb4p3h5b.js} +2 -2
  179. package/dist/{chunk-w308wr7v.js → chunk-rff6c87z.js} +2 -2
  180. package/dist/chunk-rg8kj085.js +2 -0
  181. package/dist/{chunk-cxd1bwe7.js → chunk-rqa21qrv.js} +2 -2
  182. package/dist/{chunk-ckdkm4n7.js → chunk-rzxnxj25.js} +2 -2
  183. package/dist/chunk-s05ftq29.js +2 -0
  184. package/dist/chunk-s2k0g1hc.js +2 -0
  185. package/dist/chunk-s3j71dbh.js +2 -0
  186. package/dist/chunk-sdv06e2k.js +2 -0
  187. package/dist/{chunk-nxnzrbrc.js → chunk-sgbn37kz.js} +2 -2
  188. package/dist/{chunk-d7kcgxa2.js → chunk-sjqhtpzr.js} +2 -2
  189. package/dist/{chunk-zq7p8m7g.js → chunk-stc4ctrx.js} +2 -2
  190. package/dist/{chunk-nvv8aheh.js → chunk-t3m57q06.js} +2 -2
  191. package/dist/{chunk-b17rwepe.js → chunk-t686zwxk.js} +2 -2
  192. package/dist/{chunk-q16yvbsg.js → chunk-tctdn4kk.js} +2 -2
  193. package/dist/chunk-tfj6v7y4.js +2 -0
  194. package/dist/chunk-tknyjndw.js +7 -0
  195. package/dist/chunk-tsdb5jnj.js +2 -0
  196. package/dist/{chunk-69eysg08.js → chunk-tyka859b.js} +2 -2
  197. package/dist/chunk-v3dq3hx2.js +2 -0
  198. package/dist/{chunk-wsz4dh6m.js → chunk-v581r9vt.js} +3 -3
  199. package/dist/{chunk-ggad6492.js → chunk-vbbndjfd.js} +2 -2
  200. package/dist/chunk-vkj5fznh.js +4 -0
  201. package/dist/{chunk-mvebg1n7.js → chunk-vsh9vh4s.js} +2 -2
  202. package/dist/{chunk-acprqt2h.js → chunk-vx6shb4g.js} +2 -2
  203. package/dist/{chunk-8x33007g.js → chunk-w2xjhfm2.js} +3 -3
  204. package/dist/{chunk-ygjcmhng.js → chunk-w4bye56s.js} +2 -2
  205. package/dist/{chunk-10ar0368.js → chunk-wf7kfk3p.js} +2 -2
  206. package/dist/{chunk-2a6bv4xm.js → chunk-whb8ttdy.js} +2 -2
  207. package/dist/{chunk-37p8zdb1.js → chunk-whzs7yxf.js} +2 -2
  208. package/dist/{chunk-r67qt2tt.js → chunk-wsyfhh7y.js} +2 -2
  209. package/dist/chunk-ww3f6z4x.js +3 -0
  210. package/dist/{chunk-v3dp0ay9.js → chunk-wwj743gm.js} +2 -2
  211. package/dist/{chunk-mch9hd8q.js → chunk-wyxa2tfm.js} +5 -5
  212. package/dist/{chunk-9bk8tg2w.js → chunk-wz6765xb.js} +3 -3
  213. package/dist/{chunk-egw95b1p.js → chunk-x4enakra.js} +2 -2
  214. package/dist/{chunk-7e9s642q.js → chunk-x621s275.js} +2 -2
  215. package/dist/{chunk-484wg46e.js → chunk-xadfbbwt.js} +2 -2
  216. package/dist/{chunk-gjdeaqy2.js → chunk-xdcp8tj9.js} +2 -2
  217. package/dist/{chunk-atdygnc5.js → chunk-xk0dt0es.js} +2 -2
  218. package/dist/chunk-xk306vq1.js +2 -0
  219. package/dist/{chunk-dq7zxw47.js → chunk-ym6jphs4.js} +4 -4
  220. package/dist/{chunk-x785yg93.js → chunk-ymgc4317.js} +2 -2
  221. package/dist/{chunk-csw1rzrc.js → chunk-ymk7ampx.js} +2 -2
  222. package/dist/{chunk-nvh0e8y1.js → chunk-z8sheg2r.js} +2 -2
  223. package/dist/{chunk-8ysh4mx1.js → chunk-zm6b6zyr.js} +2 -2
  224. package/dist/chunk-znagg8v9.js +2 -0
  225. package/dist/chunk-zpqj0ka8.js +2 -0
  226. package/dist/{chunk-2y13vckf.js → chunk-zsrjzx7g.js} +2 -2
  227. package/dist/{chunk-ky2p8zyg.js → chunk-zwyd2bhy.js} +2 -2
  228. package/dist/{chunk-rr2cjfcz.js → chunk-zz582m73.js} +2 -2
  229. package/dist/{chunk-x6cfmt4y.js → chunk-zzqbe5r0.js} +2 -2
  230. package/dist/client.js +1 -1
  231. package/dist/codex/activity-group.js +1 -1
  232. package/dist/codex/artifact-links.js +1 -1
  233. package/dist/codex/assistant-message.js +1 -1
  234. package/dist/codex/async-question-card.js +1 -1
  235. package/dist/codex/disclosure-state.js +1 -1
  236. package/dist/codex/edited-files-card.js +1 -1
  237. package/dist/codex/image-view-activity.js +1 -1
  238. package/dist/codex/markdown-renderer.js +1 -1
  239. package/dist/codex/navigation-audio.js +1 -1
  240. package/dist/codex/navigation-preview.js +1 -1
  241. package/dist/codex/navigation-rail.js +1 -1
  242. package/dist/codex/patch-view.js +1 -1
  243. package/dist/codex/plan.js +1 -1
  244. package/dist/codex/timeline-virtualizer.js +1 -1
  245. package/dist/codex/turn-activity.js +1 -1
  246. package/dist/codex/user-message.js +1 -1
  247. package/dist/codex/virtualized-turn-list.js +1 -1
  248. package/dist/collections/collection-emoji.js +1 -1
  249. package/dist/collections/collection-menu.js +1 -1
  250. package/dist/collections/collection-panel.js +1 -1
  251. package/dist/collections/collections.js +1 -1
  252. package/dist/collections/host.js +1 -1
  253. package/dist/collections/locales.js +1 -1
  254. package/dist/collections/model.js +1 -1
  255. package/dist/collections/store.js +1 -1
  256. package/dist/composer/completion-filter.js +1 -1
  257. package/dist/composer/completion-menu.js +1 -1
  258. package/dist/composer/completion-trigger.js +1 -1
  259. package/dist/composer/effort-slider.js +1 -1
  260. package/dist/composer/inline-document.js +1 -1
  261. package/dist/composer/inline-dom.js +1 -1
  262. package/dist/composer/model-select.js +1 -1
  263. package/dist/composer/permission-mode-select.js +1 -1
  264. package/dist/composer/prompt-input-attachments.js +1 -1
  265. package/dist/composer/prompt-input-clipboard.js +1 -1
  266. package/dist/composer/prompt-input-context.js +1 -1
  267. package/dist/composer/prompt-input-inline.js +1 -1
  268. package/dist/composer/prompt-input-textarea.js +1 -1
  269. package/dist/composer/prompt-input.js +1 -1
  270. package/dist/conversation/action-card.js +1 -1
  271. package/dist/conversation/composer/app-mentions.js +1 -1
  272. package/dist/conversation/composer/apps-menu.js +1 -1
  273. package/dist/conversation/composer/composer-menu.js +1 -1
  274. package/dist/conversation/composer/composer.js +1 -1
  275. package/dist/conversation/composer/config-options.js +1 -1
  276. package/dist/conversation/composer/context.js +1 -1
  277. package/dist/conversation/composer/drafts.js +1 -1
  278. package/dist/conversation/composer/file-items.js +1 -1
  279. package/dist/conversation/composer/long-text.js +1 -1
  280. package/dist/conversation/composer/mention-chips.js +1 -1
  281. package/dist/conversation/composer/mention-uri.js +1 -1
  282. package/dist/conversation/composer/model-menu.js +1 -1
  283. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  284. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  285. package/dist/conversation/composer/prediction.js +1 -1
  286. package/dist/conversation/composer/prompt-history.js +1 -1
  287. package/dist/conversation/composer/slash-command-button.js +1 -1
  288. package/dist/conversation/composer/submit-button.js +1 -1
  289. package/dist/conversation/composer/usage-meter.js +1 -1
  290. package/dist/conversation/connection-notice.js +1 -1
  291. package/dist/conversation/context.js +1 -1
  292. package/dist/conversation/conversation-body.js +1 -1
  293. package/dist/conversation/conversation-search.js +1 -1
  294. package/dist/conversation/conversation-view.js +1 -1
  295. package/dist/conversation/conversation.js +1 -1
  296. package/dist/conversation/diff-modal.js +1 -1
  297. package/dist/conversation/draft-project-picker.js +1 -1
  298. package/dist/conversation/session-actions.js +1 -1
  299. package/dist/conversation/subagent-sessions.js +1 -1
  300. package/dist/conversation/subagent-tasks.js +1 -1
  301. package/dist/desktop/desktop-composer.js +1 -1
  302. package/dist/desktop/desktop.js +1 -1
  303. package/dist/desktop/draft-model-select.js +1 -1
  304. package/dist/desktop/load-image.js +1 -1
  305. package/dist/desktop/model-catalog.js +1 -1
  306. package/dist/desktop/model-recovery.js +1 -1
  307. package/dist/desktop/model-settings-action.js +1 -1
  308. package/dist/desktop/native-file-drop.js +1 -1
  309. package/dist/generated/commands.js +1 -1
  310. package/dist/image-lightbox.js +1 -1
  311. package/dist/image-preview-dialog.js +1 -1
  312. package/dist/image.js +1 -1
  313. package/dist/lib/app-reference.js +1 -1
  314. package/dist/lib/application-metadata.js +1 -1
  315. package/dist/lib/chat-path.js +1 -1
  316. package/dist/lib/code-highlighter.js +1 -1
  317. package/dist/lib/file-url.js +1 -1
  318. package/dist/lib/fuzzy.js +1 -1
  319. package/dist/lib/group-blocks.js +1 -1
  320. package/dist/lib/image-encode.js +1 -1
  321. package/dist/lib/limits.js +1 -1
  322. package/dist/lib/markdown-parser.js +1 -1
  323. package/dist/lib/markdown-rules.js +1 -1
  324. package/dist/lib/model-name.js +1 -1
  325. package/dist/lib/pointer-centered-zoom.js +1 -1
  326. package/dist/lib/prepare-prompt-files.js +1 -1
  327. package/dist/lib/reference-presentation.js +1 -1
  328. package/dist/lib/stream-style.js +1 -1
  329. package/dist/lib/streaming-markdown.js +1 -1
  330. package/dist/lib/tool-artifacts.js +1 -1
  331. package/dist/locales.js +1 -1
  332. package/dist/mermaid/diagram.js +1 -1
  333. package/dist/mermaid/export.js +1 -1
  334. package/dist/mermaid/index.js +1 -1
  335. package/dist/mermaid/preview.js +1 -1
  336. package/dist/oauth/claude-login.js +1 -1
  337. package/dist/oauth.js +1 -1
  338. package/dist/plugins/catalog-header.js +1 -1
  339. package/dist/plugins/catalog-skeleton.js +1 -1
  340. package/dist/plugins/host.d.ts +1 -1
  341. package/dist/plugins/host.js +1 -1
  342. package/dist/plugins/new-chat-directory.js +1 -1
  343. package/dist/plugins/pane.js +1 -1
  344. package/dist/plugins/panel-item.js +1 -1
  345. package/dist/plugins/plugin-detail-page.js +1 -1
  346. package/dist/plugins/plugin-icon.js +1 -1
  347. package/dist/plugins/plugin-icons.js +1 -1
  348. package/dist/plugins/plugins-page.js +1 -1
  349. package/dist/plugins/plugins.js +1 -1
  350. package/dist/plugins/read-skill-document.js +1 -1
  351. package/dist/plugins/skill-document.js +1 -1
  352. package/dist/plugins/skills-tab.js +1 -1
  353. package/dist/plugins/store.d.ts +1 -1
  354. package/dist/plugins/store.js +1 -1
  355. package/dist/plugins/toolbox-layout.js +1 -1
  356. package/dist/reference-projection.js +1 -1
  357. package/dist/search/chat-search.js +1 -1
  358. package/dist/search/codex-source-matches.js +1 -1
  359. package/dist/search/dom-matches.js +1 -1
  360. package/dist/search/find-bar.js +1 -1
  361. package/dist/search/literal-matches.js +1 -1
  362. package/dist/session-list/account-menu.js +1 -1
  363. package/dist/session-list/activity-list.js +1 -1
  364. package/dist/session-list/archived-sessions.js +1 -1
  365. package/dist/session-list/help-menu.js +1 -1
  366. package/dist/session-list/highlight.js +1 -1
  367. package/dist/session-list/host.js +1 -1
  368. package/dist/session-list/hover-info-card.js +1 -1
  369. package/dist/session-list/locales.js +1 -1
  370. package/dist/session-list/navigation-controls.js +1 -1
  371. package/dist/session-list/navigation-header.js +1 -1
  372. package/dist/session-list/navigation-store.js +1 -1
  373. package/dist/session-list/navigation-tabs.js +1 -1
  374. package/dist/session-list/navigation.js +1 -1
  375. package/dist/session-list/overflow-marquee.js +1 -1
  376. package/dist/session-list/platform.js +1 -1
  377. package/dist/session-list/row-stop-button.js +1 -1
  378. package/dist/session-list/session-groups.js +1 -1
  379. package/dist/session-list/session-info-card.js +1 -1
  380. package/dist/session-list/session-list.js +1 -1
  381. package/dist/session-list/session-row.js +1 -1
  382. package/dist/session-list/session-state-dot.js +1 -1
  383. package/dist/session-list/session-state-menu.js +1 -1
  384. package/dist/session-list/shortcut-hint.js +1 -1
  385. package/dist/session-list/shortcut.js +1 -1
  386. package/dist/session-list/sidebar-overlay.js +1 -1
  387. package/dist/session-list/trailing-swap.js +1 -1
  388. package/dist/session-list/use-activity-notification.js +1 -1
  389. package/dist/session-list/use-activity-preview.js +1 -1
  390. package/dist/session-list/use-cmd-held.js +1 -1
  391. package/dist/session-list/use-project-sessions.js +1 -1
  392. package/dist/session-list/virtual-session-rows.js +1 -1
  393. package/dist/session-timeline/activity-group.js +1 -1
  394. package/dist/session-timeline/activity-projection.js +1 -1
  395. package/dist/session-timeline/assistant-content.js +1 -1
  396. package/dist/session-timeline/assistant-image-references.js +1 -1
  397. package/dist/session-timeline/assistant-turn.js +1 -1
  398. package/dist/session-timeline/async-questions.js +1 -1
  399. package/dist/session-timeline/edited-files-card.js +1 -1
  400. package/dist/session-timeline/history-timeline.js +1 -1
  401. package/dist/session-timeline/host.js +1 -1
  402. package/dist/session-timeline/image-generation-progress.js +1 -1
  403. package/dist/session-timeline/navigation-rail.js +1 -1
  404. package/dist/session-timeline/plan.js +1 -1
  405. package/dist/session-timeline/question-reply.js +1 -1
  406. package/dist/session-timeline/resource-content.js +1 -1
  407. package/dist/session-timeline/session-timeline.js +1 -1
  408. package/dist/session-timeline/timeline-registry.js +1 -1
  409. package/dist/session-timeline/turn-activity.js +1 -1
  410. package/dist/session-timeline/turn-error.js +1 -1
  411. package/dist/session-timeline/turn-retry.js +1 -1
  412. package/dist/session-timeline/turn-time.js +1 -1
  413. package/dist/session-timeline/turns.js +1 -1
  414. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  415. package/dist/session-timeline/user-message.js +1 -1
  416. package/dist/settings/codex-account-card.js +1 -1
  417. package/dist/settings/login-card.js +1 -1
  418. package/dist/settings/model-alias-settings.js +1 -1
  419. package/dist/settings/model-aliases.js +1 -1
  420. package/dist/settings/provider-logos.js +1 -1
  421. package/dist/settings/provider-section.js +1 -1
  422. package/dist/settings/providers-port.js +1 -1
  423. package/dist/settings/providers.js +1 -1
  424. package/dist/settings/settings-bridge.js +1 -1
  425. package/dist/settings/settings.js +1 -1
  426. package/native/darwin-arm64/artifact.json +1 -1
  427. package/native/darwin-arm64/libalwith_native_chat.dylib +0 -0
  428. package/native/win32-x64/alwith_native_chat.dll +0 -0
  429. package/native/win32-x64/artifact.json +1 -1
  430. package/package.json +2 -7
  431. package/dist/chunk-04778wzq.js +0 -2
  432. package/dist/chunk-0ppwk6y9.js +0 -2
  433. package/dist/chunk-0yngh0w6.js +0 -2
  434. package/dist/chunk-1fnfd1yv.js +0 -2
  435. package/dist/chunk-1jd0p7b8.js +0 -2
  436. package/dist/chunk-2jkv90n6.js +0 -2
  437. package/dist/chunk-3c9se1ha.js +0 -2
  438. package/dist/chunk-3zr6f9nd.js +0 -4
  439. package/dist/chunk-43s8pmw9.js +0 -2
  440. package/dist/chunk-4r8pqg1h.js +0 -2
  441. package/dist/chunk-52y91amb.js +0 -2
  442. package/dist/chunk-5s0k93vr.js +0 -3
  443. package/dist/chunk-6aj4cgfs.js +0 -2
  444. package/dist/chunk-723kazw5.js +0 -2
  445. package/dist/chunk-79qh74jn.js +0 -2
  446. package/dist/chunk-7kxa1krk.js +0 -2
  447. package/dist/chunk-7xszqjre.js +0 -2
  448. package/dist/chunk-8at6403h.js +0 -2
  449. package/dist/chunk-8zrmp6dw.js +0 -3
  450. package/dist/chunk-90mq5g5a.js +0 -1
  451. package/dist/chunk-aazp5pw2.js +0 -2
  452. package/dist/chunk-b5afm26d.js +0 -2
  453. package/dist/chunk-bbpjhe4e.js +0 -2
  454. package/dist/chunk-br1vyrce.js +0 -2
  455. package/dist/chunk-fdqfbhwd.js +0 -2
  456. package/dist/chunk-fjr7n326.js +0 -2
  457. package/dist/chunk-fwk2ayca.js +0 -2
  458. package/dist/chunk-g9vjpmrq.js +0 -2
  459. package/dist/chunk-gh1jdr70.js +0 -2
  460. package/dist/chunk-j420zak2.js +0 -2
  461. package/dist/chunk-mz8tjgre.js +0 -2
  462. package/dist/chunk-n2gm013f.js +0 -2
  463. package/dist/chunk-na5pcj57.js +0 -2
  464. package/dist/chunk-q2v4hre7.js +0 -2
  465. package/dist/chunk-qhes5k0g.js +0 -2
  466. package/dist/chunk-qhj8374f.js +0 -2
  467. package/dist/chunk-rnxbtzg9.js +0 -2
  468. package/dist/chunk-rpzv6g89.js +0 -2
  469. package/dist/chunk-rqck9w0f.js +0 -2
  470. package/dist/chunk-rv3gpjgk.js +0 -2
  471. package/dist/chunk-sm16wn9x.js +0 -2
  472. package/dist/chunk-swq34ay7.js +0 -2
  473. package/dist/chunk-t12xpbtp.js +0 -3
  474. package/dist/chunk-t4vfpx6a.js +0 -2
  475. package/dist/chunk-t6z3khr5.js +0 -2
  476. package/dist/chunk-tac30kkh.js +0 -2
  477. package/dist/chunk-tdw5wrey.js +0 -2
  478. package/dist/chunk-thxz5zm6.js +0 -2
  479. package/dist/chunk-tvfmbabv.js +0 -2
  480. package/dist/chunk-twrdy8cb.js +0 -2
  481. package/dist/chunk-tzr6phth.js +0 -2
  482. package/dist/chunk-v066qn38.js +0 -2
  483. package/dist/chunk-v2m44e5f.js +0 -2
  484. package/dist/chunk-x5cv0bfc.js +0 -4
  485. package/dist/chunk-xdrwsxqy.js +0 -2
  486. package/dist/chunk-xx0hs7b3.js +0 -2
  487. package/dist/chunk-yaxe4yd4.js +0 -2
  488. package/dist/chunk-yey8qz6h.js +0 -2
  489. package/dist/chunk-yfnnrm9g.js +0 -7
  490. package/dist/chunk-yqjmqa0t.js +0 -2
  491. package/dist/chunk-zfsbhwe1.js +0 -2
  492. package/dist/import.d.ts +0 -1
  493. package/dist/import.js +0 -1
@@ -1,2 +1,2 @@
1
- import{ar}from"./chunk-rr2cjfcz.js";import{CheckIcon as M,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function v(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function N({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[u,m]=f(!1),[l,b]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=()=>{if(r.scrollHeight===0){m(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");m(r.scrollHeight>A*x+1)};d();let t=new ResizeObserver(d);return t.observe(r),()=>t.disconnect()},[]),k(()=>{if(!u||l)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=new Map,t=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let y=g.target;if(!d.has(y))continue;v(y,g.isIntersecting&&g.intersectionRatio>=1,d.get(y))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let i of d.keys()){if(r.contains(i))continue;t?.unobserve(i),d.delete(i)}for(let i of r.querySelectorAll(L)){if(d.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");d.set(i,g),v(i,t===null&&R(i,r),g),t?.observe(i)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{t?.disconnect(),C.disconnect();for(let[i,g]of d)v(i,!0,g)}},[u,l]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:u&&!l?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),u&&!l&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),u&&p("button",{type:"button","aria-expanded":l,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:l?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:l?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function ko({text:n,label:o,host:s}){let[a,c]=f(!1),[u,m]=f(null),l=async()=>{c(!1),m(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(b){m(String(b)),s?.onCopyError?.(b)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:u??o,onClick:()=>void l(),children:a?e(M,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(ar,{src:c,alt:"",onClose:()=>a(!1)})]})}function sr({message:n,text:o,textParts:s,applicationReferences:a,mentions:c,images:u,messageTime:m,host:l,bubbleStyle:b}){let{t:r,openImage:d}=l;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[c.length>0&&e("div",{className:"codex-user-mentions",children:c.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),u.length>0&&e("div",{className:"codex-user-images",children:u.map((t)=>e(S,{image:t,openImage:d},`${t.mimeType}:${t.data}`))}),(o.length>0||a)&&e(h,{children:p("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:b,children:[a,s?s.map((t,x)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(N,{text:t.text,host:l}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},x)):e(N,{text:o,host:l})]})}),p("div",{className:"codex-user-actions",children:[e(ko,{text:o,label:r("actions.copy"),host:l}),m&&e("span",{className:"codex-user-time",title:m.full,children:m.short})]})]})})}
2
- export{ko,sr};
1
+ import{ps}from"./chunk-zz582m73.js";import{CheckIcon as M,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function v(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function N({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[u,m]=f(!1),[l,b]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=()=>{if(r.scrollHeight===0){m(!1);return}let x=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(x))throw Error("Codex user message line height is invalid");m(r.scrollHeight>A*x+1)};d();let t=new ResizeObserver(d);return t.observe(r),()=>t.disconnect()},[]),k(()=>{if(!u||l)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let d=new Map,t=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let y=g.target;if(!d.has(y))continue;v(y,g.isIntersecting&&g.intersectionRatio>=1,d.get(y))}},{root:r,rootMargin:"0px",threshold:1}),x=()=>{for(let i of d.keys()){if(r.contains(i))continue;t?.unobserve(i),d.delete(i)}for(let i of r.querySelectorAll(L)){if(d.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");d.set(i,g),v(i,t===null&&R(i,r),g),t?.observe(i)}};x();let C=new MutationObserver(x);return C.observe(r,{childList:!0,subtree:!0}),()=>{t?.disconnect(),C.disconnect();for(let[i,g]of d)v(i,!0,g)}},[u,l]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:u&&!l?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),u&&!l&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),u&&p("button",{type:"button","aria-expanded":l,className:"codex-user-message-collapse-trigger",onClick:()=>{b((r)=>!r)},children:[e("span",{children:l?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:l?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function qo({text:n,label:o,host:s}){let[a,c]=f(!1),[u,m]=f(null),l=async()=>{c(!1),m(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(b){m(String(b)),s?.onCopyError?.(b)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:u??o,onClick:()=>void l(),children:a?e(M,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(ps,{src:c,alt:"",onClose:()=>a(!1)})]})}function us({message:n,text:o,textParts:s,applicationReferences:a,mentions:c,images:u,messageTime:m,host:l,bubbleStyle:b}){let{t:r,openImage:d}=l;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[c.length>0&&e("div",{className:"codex-user-mentions",children:c.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),u.length>0&&e("div",{className:"codex-user-images",children:u.map((t)=>e(S,{image:t,openImage:d},`${t.mimeType}:${t.data}`))}),(o.length>0||a)&&e(h,{children:p("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:b,children:[a,s?s.map((t,x)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(N,{text:t.text,host:l}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},x)):e(N,{text:o,host:l})]})}),p("div",{className:"codex-user-actions",children:[e(qo,{text:o,label:r("actions.copy"),host:l}),m&&e("span",{className:"codex-user-time",title:m.full,children:m.short})]})]})})}
2
+ export{qo,us};
@@ -1,2 +1,2 @@
1
- import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function ge({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
- export{ge};
1
+ import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function Ce({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
+ export{Ce};
@@ -1,2 +1,2 @@
1
- import{Nt}from"./chunk-t3enrsnt.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function Zr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Nt({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
- export{Zr};
1
+ import{Ft}from"./chunk-26w51q10.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function xr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Ft({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
+ export{xr};
@@ -1,2 +1,2 @@
1
- import{Bn}from"./chunk-127rz9fe.js";function go(t){let n=t?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let l=decodeURIComponent(n[1]),e=Bn.models.find((o)=>o.slug===l);return e?{value:e.default_reasoning_level,hidden:e.supported_reasoning_levels.length===0}:null}
2
- export{go};
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,2 +1,2 @@
1
- import{V}from"./chunk-nvh0e8y1.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function da({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(V,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(V,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
2
- export{da};
1
+ import{V}from"./chunk-z8sheg2r.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function ya({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(V,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(V,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
2
+ export{ya};
@@ -0,0 +1,2 @@
1
+ import{nn}from"./chunk-s05ftq29.js";import{createContext as l,useContext as a,useEffect as p,useSyncExternalStore as u}from"react";import{jsx as o}from"react/jsx-runtime";var g=l(null),P=l(null),r=new WeakMap;function We(e){let t=r.get(e);if(!t)t=nn(e),r.set(e,t);return t}function Ds({host:e,client:t,children:n}){let s=We(t);return s.bindHost(e),p(()=>s.bindHost(e),[s,e]),o(g,{value:e,children:o(P,{value:t,children:n})})}function d(){let e=a(g);if(e===null)throw Error("Plugins host is missing");return e}function Ze(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function ut(e){let t=Ze();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=We(Ze());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Qe(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{We,Ds,d,Ze,ut,i,Qe};
@@ -1,5 +1,5 @@
1
- import{b,Vr}from"./chunk-52y91amb.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Oi(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
1
+ import{w,is}from"./chunk-0myf2ak0.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Ui(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
2
2
  `):n.value.slice(n.selectionEnd).includes(`
3
3
  `))return;if(!e){if(!s||n.value!==""||y)return;let u=o.items.flatMap((a)=>{if(a.kind!=="user")return[];let f=a.content.filter(v).map((l)=>l.text).join(`
4
- `),p=a.content.filter(g).flatMap((l)=>{let d=b(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:Vr(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
- export{Oi};
4
+ `),p=a.content.filter(g).flatMap((l)=>{let d=w(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:is(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
+ export{Ui};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-xdrwsxqy.js";import{codexTurnError as R}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as C}from"lucide-react";import{useEffect as k,useRef as i,useState as s}from"react";import{Button as I}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as m}from"react/jsx-runtime";function to({children:u}){return m("div",{className:"codex-error-message",role:"alert",children:[n(C,{"aria-hidden":"true"}),n("div",{className:"min-w-0 flex-1",children:u})]})}function no({error:u,retry:e}){let{t:f,turnErrorAction:T}=t(),c=R(u),[l]=s(()=>e?.delaySeconds==null?null:Date.now()+e.delaySeconds*1000),[p,v]=s(e?.delaySeconds??null),[h,y]=s(!1),[x,g]=s(null),o=i(!1),w=i(!1),E=i(e?.run);E.current=e?.run;let S=i((N)=>{let a=E.current;if(o.current||a===void 0)return;o.current=!0,y(!0),g(null),a(N).catch((r)=>{w.current=!0,o.current=!1,v(null),y(!1),g(r instanceof Error?r.message:String(r))})}),b=T?.(c),d=b===void 0&&e!==void 0&&c.retryable;return k(()=>{if(!d||l===null)return;let a=setInterval(()=>{if(w.current||o.current)return;let r=Math.max(0,Math.ceil((l-Date.now())/1000));if(v(r),r===0)S.current("automatic")},1000);return()=>clearInterval(a)},[l,d]),m(to,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:c.message}),b,d&&n(I,{variant:"outline",size:"sm",disabled:h,onClick:()=>S.current("manual"),children:p===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:p})})]}),x!==null&&n("div",{className:"text-muted-foreground mt-2 text-sm",children:x})]})}
2
- export{to,no};
1
+ import{t}from"./chunk-f9z37ptq.js";import{codexTurnError as R}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as C}from"lucide-react";import{useEffect as k,useRef as i,useState as s}from"react";import{Button as I}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as m}from"react/jsx-runtime";function oo({children:u}){return m("div",{className:"codex-error-message",role:"alert",children:[n(C,{"aria-hidden":"true"}),n("div",{className:"min-w-0 flex-1",children:u})]})}function io({error:u,retry:e}){let{t:f,turnErrorAction:T}=t(),c=R(u),[l]=s(()=>e?.delaySeconds==null?null:Date.now()+e.delaySeconds*1000),[p,v]=s(e?.delaySeconds??null),[h,y]=s(!1),[x,g]=s(null),o=i(!1),w=i(!1),E=i(e?.run);E.current=e?.run;let S=i((N)=>{let a=E.current;if(o.current||a===void 0)return;o.current=!0,y(!0),g(null),a(N).catch((r)=>{w.current=!0,o.current=!1,v(null),y(!1),g(r instanceof Error?r.message:String(r))})}),b=T?.(c),d=b===void 0&&e!==void 0&&c.retryable;return k(()=>{if(!d||l===null)return;let a=setInterval(()=>{if(w.current||o.current)return;let r=Math.max(0,Math.ceil((l-Date.now())/1000));if(v(r),r===0)S.current("automatic")},1000);return()=>clearInterval(a)},[l,d]),m(oo,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:c.message}),b,d&&n(I,{variant:"outline",size:"sm",disabled:h,onClick:()=>S.current("manual"),children:p===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:p})})]}),x!==null&&n("div",{className:"text-muted-foreground mt-2 text-sm",children:x})]})}
2
+ export{oo,io};
@@ -1,2 +1,2 @@
1
- import{qe}from"./chunk-43s8pmw9.js";function ws(r){let s=qe(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function $e(r){return ws(r).join(qe()?"":"+")}
2
- export{ws,$e};
1
+ import{He}from"./chunk-2q1xxs3t.js";function Or(r){let s=He(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function Oe(r){return Or(r).join(He()?"":"+")}
2
+ export{Or,Oe};
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-zfsbhwe1.js";import{Z,Q,J,X}from"./chunk-90mq5g5a.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function Re({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(X,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(J,{children:e(s,{className:"size-10 rounded-xl"})}),a(Q,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(Z,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
- export{Re};
1
+ import{d}from"./chunk-mcrd86tx.js";import{q,K,W,Z}from"./chunk-5d138vq3.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function Se({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(K,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(q,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
+ export{Se};
@@ -1,2 +1,2 @@
1
- import{m}from"./chunk-nxnzrbrc.js";import{cn as o}from"cn";import{motion as u}from"motion/react";import{jsx as i,jsxs as g}from"react/jsx-runtime";function Ot({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&m,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function Ca({tabs:n,view:r,onViewChange:s,onReset:a,notifications:l,trailing:p,className:d}){return g("div",{className:o("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",d),children:[i("div",{role:"tablist",className:"bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-52 flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]",children:n.map((e)=>{let t=r===e.key;return g(Ot,{role:"tab",active:t,expanded:t,highlight:!1,"aria-selected":t,title:e.title,onClick:()=>s(e.key),onDoubleClick:a&&(()=>a(e.key)),className:o("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-[18px] [&_svg]:shrink-0",t?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[t&&i(u.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-destructive pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:o("relative z-10 grid",t?"ms-1.5 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})}),p!=null&&i("div",{className:"ms-auto flex shrink-0 items-center gap-0.5",children:p})]})}
2
- export{Ot,Ca};
1
+ import{m}from"./chunk-sgbn37kz.js";import{cn as o}from"cn";import{motion as u}from"motion/react";import{jsx as i,jsxs as g}from"react/jsx-runtime";function Nt({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&m,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function va({tabs:n,view:r,onViewChange:s,onReset:a,notifications:l,trailing:p,className:d}){return g("div",{className:o("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",d),children:[i("div",{role:"tablist",className:"bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-52 flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]",children:n.map((e)=>{let t=r===e.key;return g(Nt,{role:"tab",active:t,expanded:t,highlight:!1,"aria-selected":t,title:e.title,onClick:()=>s(e.key),onDoubleClick:a&&(()=>a(e.key)),className:o("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-[18px] [&_svg]:shrink-0",t?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[t&&i(u.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-destructive pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:o("relative z-10 grid",t?"ms-1.5 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})}),p!=null&&i("div",{className:"ms-auto flex shrink-0 items-center gap-0.5",children:p})]})}
2
+ export{Nt,va};
@@ -0,0 +1,2 @@
1
+ import{L}from"./chunk-q4nx04sy.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as w,DialogFooter as P,DialogHeader as H,DialogTitle as R}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function ka({host:e,client:t,children:i}){let[r,l]=f(null);L(r!==null);let{t:u}=e;return o(S,{value:e,children:o(g,{value:t,children:d(C,{value:l,children:[i,o(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(H,{children:[o(R,{children:u("sessionList.deleteTitle")}),o(w,{children:u("sessionList.deleteDescription")})]}),d(P,{children:[o(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function Gr(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function qn(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=a();return x((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
2
+ export{ka,s,Gr,a,qn,n,h};
@@ -1,2 +1,2 @@
1
- import{fn,vo}from"./chunk-nm8245ze.js";import{Ji}from"./chunk-dps8nnde.js";import{CodexClient as p}from"@nyssance/codex-acp-v2/client";class ho extends p{applicationRegistry=new vo((t)=>this.holds(t)?this.session(t):void 0);toolSelection;constructor(t,e,n={}){let{applicationTools:i=[],...o}=e;super(t,o,n);this.toolSelection=i}applicationToolsFor(t){return typeof this.toolSelection==="function"?this.toolSelection(t):this.toolSelection}async requestContext(t,e,n){let i=(await this.applicationToolsFor({cwd:t,operation:e,options:n})).map((s)=>({...s,inputSchema:structuredClone(s.inputSchema)})),o=await super.requestContext(t,e,n),a=fn(i),r=o._meta?.alwith;if(i.length&&r?.tools!==void 0)throw Error("Application tools must be registered through the client");return{...o,...i.length?{_meta:{...o._meta,alwith:{...r,tools:a}}}:{},bind:async(s)=>{await o.bind?.(s),this.applicationRegistry.bind(s,i,a.revision)}}}acceptsPendingRequest(t){return t.method!=="_alwith/tool/call"&&super.acceptsPendingRequest(t)}handleNotification(t,e){if(t==="$/cancel_request"&&this.applicationRegistry.withdraw(e?.requestId))return!0;return super.handleNotification(t,e)}handleAgentRequest(t,e){return this.applicationRegistry.handle(t,e)||super.handleAgentRequest(t,e)}onDisconnected(){this.applicationRegistry.clear(),super.onDisconnected()}onSessionDropped(t){this.applicationRegistry.drop(t),super.onSessionDropped(t)}async cancel(t){this.applicationRegistry.cancel(t),await super.cancel(t)}async close(t){this.applicationRegistry.drop(t),await super.close(t)}async stopSession(t){this.applicationRegistry.drop(t),await super.stopSession(t)}async installedApps(t){let e=this.live(),n=await super.installedApps(t),i=await Ji((o,a)=>e.request(o,a),n.apps.map((o)=>o.id),t?.threadId);if(e!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:n.apps.map((o)=>({...o,...i.get(o.id)}))}}}
2
- export{ho};
1
+ import{Gn,Po}from"./chunk-pr36m3qx.js";import{vr}from"./chunk-qv23mh24.js";import{CodexClient as p}from"@nyssance/codex-acp-v2/client";class wo extends p{applicationRegistry=new Po((t)=>this.holds(t)?this.session(t):void 0);toolSelection;constructor(t,e,n={}){let{applicationTools:i=[],...o}=e;super(t,o,n);this.toolSelection=i}applicationToolsFor(t){return typeof this.toolSelection==="function"?this.toolSelection(t):this.toolSelection}async requestContext(t,e,n){let i=(await this.applicationToolsFor({cwd:t,operation:e,options:n})).map((s)=>({...s,inputSchema:structuredClone(s.inputSchema)})),o=await super.requestContext(t,e,n),a=Gn(i),r=o._meta?.alwith;if(i.length&&r?.tools!==void 0)throw Error("Application tools must be registered through the client");return{...o,...i.length?{_meta:{...o._meta,alwith:{...r,tools:a}}}:{},bind:async(s)=>{await o.bind?.(s),this.applicationRegistry.bind(s,i,a.revision)}}}acceptsPendingRequest(t){return t.method!=="_alwith/tool/call"&&super.acceptsPendingRequest(t)}handleNotification(t,e){if(t==="$/cancel_request"&&this.applicationRegistry.withdraw(e?.requestId))return!0;return super.handleNotification(t,e)}handleAgentRequest(t,e){return this.applicationRegistry.handle(t,e)||super.handleAgentRequest(t,e)}onDisconnected(){this.applicationRegistry.clear(),super.onDisconnected()}onSessionDropped(t){this.applicationRegistry.drop(t),super.onSessionDropped(t)}async cancel(t){this.applicationRegistry.cancel(t),await super.cancel(t)}async close(t){this.applicationRegistry.drop(t),await super.close(t)}async stopSession(t){this.applicationRegistry.drop(t),await super.stopSession(t)}async installedApps(t){let e=this.live(),n=await super.installedApps(t),i=await vr((o,a)=>e.request(o,a),n.apps.map((o)=>o.id),t?.threadId);if(e!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:n.apps.map((o)=>({...o,...i.get(o.id)}))}}}
2
+ export{wo};
@@ -1,4 +1,4 @@
1
- function gt(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 _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(`
2
2
 
3
3
  `)}}
4
- export{gt};
4
+ export{_t};
@@ -1,2 +1,2 @@
1
- import{qe}from"./chunk-43s8pmw9.js";import{useEffect as s,useState as w}from"react";function vs(){let[i,e]=w(!1);return s(()=>{let t=qe()?"Meta":"Control",o=(n)=>{if(n.key===t)e(!0)},r=(n)=>{if(n.key===t)e(!1)},d=()=>e(!1);return window.addEventListener("keydown",o),window.addEventListener("keyup",r),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",r),window.removeEventListener("blur",d)}},[]),i}
2
- export{vs};
1
+ import{He}from"./chunk-2q1xxs3t.js";import{useEffect as s,useState as w}from"react";function Fr(){let[i,e]=w(!1);return s(()=>{let t=He()?"Meta":"Control",o=(n)=>{if(n.key===t)e(!0)},r=(n)=>{if(n.key===t)e(!1)},d=()=>e(!1);return window.addEventListener("keydown",o),window.addEventListener("keyup",r),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",r),window.removeEventListener("blur",d)}},[]),i}
2
+ export{Fr};
@@ -0,0 +1,2 @@
1
+ function lr(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function fo(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function tt(t){return t.type==="array"}function En(t){return(tt(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
+ export{lr,fo,tt,En};
@@ -1,4 +1,4 @@
1
- import{et}from"./chunk-jwsgt0d9.js";import{Pr}from"./chunk-0y8pnj16.js";import{l}from"./chunk-6283nzqs.js";import{fe}from"./chunk-atdygnc5.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as st}from"cn";import{BookOpenIcon as it,FileIcon as at,SquareSlashIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as ct,useEffect as y,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as g}from"react";import{createPortal as mt}from"react-dom";import{Button as _}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as d,jsxs as T,Fragment as pt}from"react/jsx-runtime";function gr({handleRef:a,anchorRef:f,commands:q,renderSlashMenu:k,searchFiles:u,onMention:R,onSearchError:Q,fileSearchDebounceMs:M=0,bashMode:z=!1,forcedOpen:i=!1,onForcedOpenChange:c,emptyLabel:F,fileStatusLabels:L,morePlugins:N}){let D=fe(),s=D.textInput.value,[K,P]=g(0),[O,S]=g(!1),[x,B]=g(null),[E,h]=g(0),U=Z(null);y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>P(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[a]);let V=Y(()=>z&&s.startsWith("!")?null:Pr(s,K),[s,K,z]),o=V?.kind==="at"&&!u?null:V,H=`${o?.kind??"forced"}:${o?.query??""}:${i}`,[tt,nt]=g(H);if(tt!==H)nt(H),h(0);let I=Z(null);y(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=s;else if(s!==I.current)c?.(!1)},[i,s,c]);let b=o?.kind==="at"?o.query:null;y(()=>{if(b===null||!u){B(null);return}let t=!0,e=()=>{u(b).then((r)=>{if(t)B({query:b,search:u,items:r})},(r)=>{if(t)B({query:b,search:u,items:[]}),Q(r)})},n=M>0?window.setTimeout(e,M):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[b,u,M,Q]);let v=Y(()=>{if(o?.kind==="at")return x?.query===o.query&&x.search===u?x.items:[];if(k&&(o?.kind==="slash"||i))return[];if(o)return et(q,o.query);if(i)return et(q,"");return[]},[o,i,q,x,u,k]),m=o?o.kind==="slash":i;y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>S(!0),n=()=>{if(S(!1),i)c?.(!1)};return S(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[a,i,c]),y(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let p=O&&(o!==null?o.kind==="slash"||v.length>0||!!L:i);y(()=>{if(!p)return;U.current?.querySelector(`[data-idx="${E}"]`)?.scrollIntoView({block:"nearest"})},[E,p]);function A(t){let e=a.current?.getTextarea();if(!e)return;let n,r;if(o){let j=o.kind==="slash"?`${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `:`@${t.label} `;if(n=s.slice(0,o.start)+j+s.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+j.length}else if(i)n=`${s.length===0||s.endsWith(`
1
+ import{ot}from"./chunk-qdyyvd2w.js";import{Ar}from"./chunk-kbfe7gqw.js";import{l}from"./chunk-6283nzqs.js";import{he}from"./chunk-xk0dt0es.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as st}from"cn";import{BookOpenIcon as it,FileIcon as at,SquareSlashIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as ct,useEffect as y,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as g}from"react";import{createPortal as mt}from"react-dom";import{Button as _}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as d,jsxs as T,Fragment as pt}from"react/jsx-runtime";function Nr({handleRef:a,anchorRef:f,commands:q,renderSlashMenu:k,searchFiles:u,onMention:R,onSearchError:Q,fileSearchDebounceMs:M=0,bashMode:z=!1,forcedOpen:i=!1,onForcedOpenChange:c,emptyLabel:F,fileStatusLabels:L,morePlugins:N}){let D=he(),s=D.textInput.value,[K,P]=g(0),[O,S]=g(!1),[x,B]=g(null),[E,h]=g(0),U=Z(null);y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>P(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[a]);let V=Y(()=>z&&s.startsWith("!")?null:Ar(s,K),[s,K,z]),o=V?.kind==="at"&&!u?null:V,H=`${o?.kind??"forced"}:${o?.query??""}:${i}`,[tt,et]=g(H);if(tt!==H)et(H),h(0);let I=Z(null);y(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=s;else if(s!==I.current)c?.(!1)},[i,s,c]);let b=o?.kind==="at"?o.query:null;y(()=>{if(b===null||!u){B(null);return}let t=!0,e=()=>{u(b).then((r)=>{if(t)B({query:b,search:u,items:r})},(r)=>{if(t)B({query:b,search:u,items:[]}),Q(r)})},n=M>0?window.setTimeout(e,M):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[b,u,M,Q]);let v=Y(()=>{if(o?.kind==="at")return x?.query===o.query&&x.search===u?x.items:[];if(k&&(o?.kind==="slash"||i))return[];if(o)return ot(q,o.query);if(i)return ot(q,"");return[]},[o,i,q,x,u,k]),m=o?o.kind==="slash":i;y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>S(!0),n=()=>{if(S(!1),i)c?.(!1)};return S(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[a,i,c]),y(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let p=O&&(o!==null?o.kind==="slash"||v.length>0||!!L:i);y(()=>{if(!p)return;U.current?.querySelector(`[data-idx="${E}"]`)?.scrollIntoView({block:"nearest"})},[E,p]);function A(t){let e=a.current?.getTextarea();if(!e)return;let n,r;if(o){let j=o.kind==="slash"?`${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `:`@${t.label} `;if(n=s.slice(0,o.start)+j+s.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+j.length}else if(i)n=`${s.length===0||s.endsWith(`
2
2
  `)?s:`${s}
3
- `}${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `,r=n.length,c?.(!1);else return;D.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=(n)=>{if(!p||m&&k)return;if(a.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>v.length===0?0:Math.min(v.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=v[E];if(r)A(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)P(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else c?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,G]=g(null),[W,ot]=g(null),C=ct(()=>{let t=f?.current;if(!t)return;let e=t.getBoundingClientRect();G({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[f]);if(X(()=>{if(!p){G(null);return}C()},[p,C]),X(()=>{let t=f?.current;if(!p||!t||!W)return;return rt(t,W,C,{animationFrame:!0})},[p,W,f,C]),p&&m&&k)return k({query:o?.query??"",close:()=>{if(o)P(o.start),a.current?.getTextarea()?.setSelectionRange(o.start,o.start);else c?.(!1)},selectCommand:(t)=>A({key:t,label:t,payload:t}),replaceQuery:(t)=>{let e=a.current?.getTextarea();if(!e)return;let n=o?.start??e.selectionStart,r=o?.end??e.selectionEnd;D.textInput.setInput(s.slice(0,n)+s.slice(r)),c?.(!1),requestAnimationFrame(()=>{if(a.current?.getTextarea()!==e)return;e.focus(),e.setSelectionRange(n,n),t()})}});if(!p||f&&!w)return null;let J=d("div",{ref:ot,className:f?"fixed z-50":l.position,style:f&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:T("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:[T("div",{className:l.list,children:[v.length===0&&m&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:F}),v.length===0&&!m&&L&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===b&&x.search===u?L.empty:L.loading}),v.map((t,e)=>{let n=m?t.payload.startsWith("$")?it:lt:at;return T(_,{type:"button",variant:"ghost",role:"option","aria-selected":e===E,"data-idx":e,onMouseDown:(r)=>{r.preventDefault(),A(t)},onMouseEnter:()=>h(e),className:st(m?l.row:"flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===E&&l.selected),children:[d(n,{className:m?l.icon:"text-muted-foreground size-4 shrink-0"}),d("span",{className:m?l.label:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&d("span",{"data-slot":"description",className:l.description,children:t.description})]},t.key)})]}),m&&N&&d(pt,{children:T(_,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),c?.(!1),N.open()},className:l.row,children:[d(ut,{className:l.icon}),d("span",{className:l.label,children:N.label})]})})]})});return f?mt(J,document.body):J}
4
- export{gr};
3
+ `}${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `,r=n.length,c?.(!1);else return;D.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=(n)=>{if(!p||m&&k)return;if(a.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>v.length===0?0:Math.min(v.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=v[E];if(r)A(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)P(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else c?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,G]=g(null),[W,nt]=g(null),C=ct(()=>{let t=f?.current;if(!t)return;let e=t.getBoundingClientRect();G({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[f]);if(X(()=>{if(!p){G(null);return}C()},[p,C]),X(()=>{let t=f?.current;if(!p||!t||!W)return;return rt(t,W,C,{animationFrame:!0})},[p,W,f,C]),p&&m&&k)return k({query:o?.query??"",close:()=>{if(o)P(o.start),a.current?.getTextarea()?.setSelectionRange(o.start,o.start);else c?.(!1)},selectCommand:(t)=>A({key:t,label:t,payload:t}),replaceQuery:(t)=>{let e=a.current?.getTextarea();if(!e)return;let n=o?.start??e.selectionStart,r=o?.end??e.selectionEnd;D.textInput.setInput(s.slice(0,n)+s.slice(r)),c?.(!1),requestAnimationFrame(()=>{if(a.current?.getTextarea()!==e)return;e.focus(),e.setSelectionRange(n,n),t()})}});if(!p||f&&!w)return null;let J=d("div",{ref:nt,className:f?"fixed z-50":l.position,style:f&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:T("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:[T("div",{className:l.list,children:[v.length===0&&m&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:F}),v.length===0&&!m&&L&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===b&&x.search===u?L.empty:L.loading}),v.map((t,e)=>{let n=m?t.payload.startsWith("$")?it:lt:at;return T(_,{type:"button",variant:"ghost",role:"option","aria-selected":e===E,"data-idx":e,onMouseDown:(r)=>{r.preventDefault(),A(t)},onMouseEnter:()=>h(e),className:st(m?l.row:"flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===E&&l.selected),children:[d(n,{className:m?l.icon:"text-muted-foreground size-4 shrink-0"}),d("span",{className:m?l.label:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&d("span",{"data-slot":"description",className:l.description,children:t.description})]},t.key)})]}),m&&N&&d(pt,{children:T(_,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),c?.(!1),N.open()},className:l.row,children:[d(ut,{className:l.icon}),d("span",{className:l.label,children:N.label})]})})]})});return f?mt(J,document.body):J}
4
+ export{Nr};
@@ -0,0 +1,2 @@
1
+ import{C}from"./chunk-zpqj0ka8.js";import{wt}from"./chunk-tyka859b.js";import{e}from"./chunk-bshgrwe9.js";import{me,S}from"./chunk-h8r785ne.js";import{Sn,Le}from"./chunk-s3j71dbh.js";import{Re}from"./chunk-whzs7yxf.js";import{Zap as g}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function wn({snapshot:s,model:l,onChange:r,nativeModels:t,catalog:c}){let{host:u}=e(),{t:a}=u,f=[{id:C.id,name:C.name,models:t===void 0?[{api_id:"",label:C.name}]:t.map((o)=>({api_id:o.id,label:o.label??o.id}))},...(s===null?[]:me(s)).map((o)=>({id:o.id,name:o.name,models:o.models.map((i)=>({api_id:S(o.id,i.id),label:i.label??i.id}))}))],p=Le(f,c),d=p.flatMap((o)=>o.models),m=l===null?t===void 0?d[0]:{api_id:"",label:a("composer.model")}:d.find((o)=>o.api_id===l)??{api_id:l,label:l};return n(wt,{value:{...m,label:Sn(m)},models:d,modelGroups:p,header:{name:a("composer.model"),action:n(Re,{})},compactCatalog:!0,booleanOptions:[{id:"fast_mode",name:a("composer.fastMode"),currentValue:!1,disabled:!0,title:a("composer.fastModeUnsupported"),icon:n(g,{className:"size-4","aria-hidden":"true"})}],showModelList:!0,onChange:(o)=>r(o.api_id),t:(o)=>a(o)})}
2
+ export{wn};
@@ -0,0 +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};
@@ -0,0 +1,2 @@
1
+ import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function X(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function x(e,t){return e.find((n)=>n.category===t&&o(n))}function Y(e){return X(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
2
+ export{X,x,Y};
@@ -1,2 +1,2 @@
1
- import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function tn(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
2
- export{tn};
1
+ import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function ln(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
2
+ export{ln};
@@ -1,2 +1,2 @@
1
- import{isToolCallSubject as u}from"@nyssance/codex-acp-v2/client";function gn(o){let{parse:e,execute:r,...t}=o;return{...t,execute:(i,n)=>r(e(i),n)}}function fn(o){let e=new Set;if(o.length>128)throw Error("Too many application tools");let r=o.map((t)=>{if(!/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/.test(t.name)||e.has(t.name))throw Error(`Invalid or duplicate application tool: ${t.name}`);if(!t.revision.trim()||!t.description.trim()||t.inputSchema.type!=="object")throw Error(`Invalid application tool definition: ${t.name}`);return e.add(t.name),{name:t.name,description:t.description,inputSchema:structuredClone(t.inputSchema)}});return{version:1,revision:JSON.stringify(o.map((t)=>[t.name,t.revision])),definitions:r}}function m(o){if(!o||typeof o!=="object"||Array.isArray(o))throw Error("Invalid application tool call");let e=o;if(!["sessionId","turnId","toolCallId","name","toolSetRevision"].every((r)=>typeof e[r]==="string"&&e[r].length>0)||!("arguments"in e))throw Error("Invalid application tool call");return e}var g=(o)=>({success:!1,contentItems:[{type:"text",text:o instanceof Error?o.message:String(o)}]});class vo{sessions=new Map;calls=new Map;session;constructor(o){this.session=o}bind(o,e,r){this.drop(o),this.sessions.set(o,{revision:r,tools:new Map(e.map((t)=>[t.name,{...t}])),active:new Set})}cancel(o){for(let e of this.sessions.get(o)?.active??[])e.abort()}drop(o){this.cancel(o),this.sessions.delete(o)}clear(){for(let o of this.sessions.keys())this.drop(o)}attached(o){let e=this.session(o);return e?.attached&&!e.readOnly}withdraw(o){let e=this.calls.get(JSON.stringify(o));if(!e)return!1;return e.abort(),!0}handle(o,e){if(e.method==="session/request_permission"){let t=e.params,i=t._meta?.alwith?.tool,n=this.sessions.get(t.sessionId),a=this.session(t.sessionId);if(!t.subject||!u(t.subject))return!1;let s=t.subject.toolCall.toolCallId,l=a?.items.find((c)=>c.id===s),p=a&&!a.restoring&&(a.state==="running"||a.state==="requires_action")&&l?.kind==="tool"&&!l.replayed&&l.endedAt===null&&(l.status==="pending"||l.status==="in_progress")?l.name:null,d=i!==void 0?typeof i?.name==="string"&&i.toolSetRevision===n?.revision?n?.tools.get(i.name):void 0:p?.startsWith("alwith_client_")?n?.tools.get(p.slice(14)):void 0;if(!n||!d||!this.attached(t.sessionId)||!t.subject||!u(t.subject)||!t.options.some((c)=>c.optionId==="allow_once"&&c.kind==="allow_once")||!d.autoApprove?.(t.sessionId))return!1;return o.respond(e.id,{outcome:{outcome:"selected",optionId:"allow_once"}}).catch(()=>{return}),!0}if(e.method!=="_alwith/tool/call")return!1;return(async()=>{let t=m(e.params),i=t.sessionId,n=this.sessions.get(i);if(!n||!this.attached(i))throw Error("Application tool session is not attached");if(t.toolSetRevision!==n.revision)throw Error("Invalid application tool revision");let a=n.tools.get(t.name);if(!a)throw Error(`Application tool is not registered: ${t.name}`);let s=new AbortController,l=JSON.stringify(e.id);if(this.calls.has(l))throw Error("Duplicate application tool request");this.calls.set(l,s),n.active.add(s);let p=Promise.withResolvers(),d=()=>p.reject(Error("Application tool call was cancelled"));s.signal.addEventListener("abort",d,{once:!0});try{let c=await Promise.race([Promise.resolve().then(()=>(s.signal.throwIfAborted(),a.execute(t.arguments,{sessionId:i,toolCallId:t.toolCallId,turnId:t.turnId,signal:s.signal,agent:o}))),p.promise]);if(s.signal.throwIfAborted(),this.sessions.get(i)!==n||!this.attached(i))throw Error("Application tool session was replaced");return c}finally{if(s.signal.removeEventListener("abort",d),n.active.delete(s),this.calls.get(l)===s)this.calls.delete(l)}})().catch(g).then((t)=>o.respond(e.id,t)).catch(()=>{return}),!0}}
2
- export{gn,fn,vo};
1
+ import{isToolCallSubject as u}from"@nyssance/codex-acp-v2/client";function Bn(o){let{parse:e,execute:r,...t}=o;return{...t,execute:(i,n)=>r(e(i),n)}}function Gn(o){let e=new Set;if(o.length>128)throw Error("Too many application tools");let r=o.map((t)=>{if(!/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/.test(t.name)||e.has(t.name))throw Error(`Invalid or duplicate application tool: ${t.name}`);if(!t.revision.trim()||!t.description.trim()||t.inputSchema.type!=="object")throw Error(`Invalid application tool definition: ${t.name}`);return e.add(t.name),{name:t.name,description:t.description,inputSchema:structuredClone(t.inputSchema)}});return{version:1,revision:JSON.stringify(o.map((t)=>[t.name,t.revision])),definitions:r}}function m(o){if(!o||typeof o!=="object"||Array.isArray(o))throw Error("Invalid application tool call");let e=o;if(!["sessionId","turnId","toolCallId","name","toolSetRevision"].every((r)=>typeof e[r]==="string"&&e[r].length>0)||!("arguments"in e))throw Error("Invalid application tool call");return e}var g=(o)=>({success:!1,contentItems:[{type:"text",text:o instanceof Error?o.message:String(o)}]});class Po{sessions=new Map;calls=new Map;session;constructor(o){this.session=o}bind(o,e,r){this.drop(o),this.sessions.set(o,{revision:r,tools:new Map(e.map((t)=>[t.name,{...t}])),active:new Set})}cancel(o){for(let e of this.sessions.get(o)?.active??[])e.abort()}drop(o){this.cancel(o),this.sessions.delete(o)}clear(){for(let o of this.sessions.keys())this.drop(o)}attached(o){let e=this.session(o);return e?.attached&&!e.readOnly}withdraw(o){let e=this.calls.get(JSON.stringify(o));if(!e)return!1;return e.abort(),!0}handle(o,e){if(e.method==="session/request_permission"){let t=e.params,i=t._meta?.alwith?.tool,n=this.sessions.get(t.sessionId),a=this.session(t.sessionId);if(!t.subject||!u(t.subject))return!1;let s=t.subject.toolCall.toolCallId,l=a?.items.find((c)=>c.id===s),p=a&&!a.restoring&&(a.state==="running"||a.state==="requires_action")&&l?.kind==="tool"&&!l.replayed&&l.endedAt===null&&(l.status==="pending"||l.status==="in_progress")?l.name:null,d=i!==void 0?typeof i?.name==="string"&&i.toolSetRevision===n?.revision?n?.tools.get(i.name):void 0:p?.startsWith("alwith_client_")?n?.tools.get(p.slice(14)):void 0;if(!n||!d||!this.attached(t.sessionId)||!t.subject||!u(t.subject)||!t.options.some((c)=>c.optionId==="allow_once"&&c.kind==="allow_once")||!d.autoApprove?.(t.sessionId))return!1;return o.respond(e.id,{outcome:{outcome:"selected",optionId:"allow_once"}}).catch(()=>{return}),!0}if(e.method!=="_alwith/tool/call")return!1;return(async()=>{let t=m(e.params),i=t.sessionId,n=this.sessions.get(i);if(!n||!this.attached(i))throw Error("Application tool session is not attached");if(t.toolSetRevision!==n.revision)throw Error("Invalid application tool revision");let a=n.tools.get(t.name);if(!a)throw Error(`Application tool is not registered: ${t.name}`);let s=new AbortController,l=JSON.stringify(e.id);if(this.calls.has(l))throw Error("Duplicate application tool request");this.calls.set(l,s),n.active.add(s);let p=Promise.withResolvers(),d=()=>p.reject(Error("Application tool call was cancelled"));s.signal.addEventListener("abort",d,{once:!0});try{let c=await Promise.race([Promise.resolve().then(()=>(s.signal.throwIfAborted(),a.execute(t.arguments,{sessionId:i,toolCallId:t.toolCallId,turnId:t.turnId,signal:s.signal,agent:o}))),p.promise]);if(s.signal.throwIfAborted(),this.sessions.get(i)!==n||!this.attached(i))throw Error("Application tool session was replaced");return c}finally{if(s.signal.removeEventListener("abort",d),n.active.delete(s),this.calls.get(l)===s)this.calls.delete(l)}})().catch(g).then((t)=>o.respond(e.id,t)).catch(()=>{return}),!0}}
2
+ export{Bn,Gn,Po};
@@ -0,0 +1,2 @@
1
+ import{useCallback as f,useState as r}from"react";var t=new Map;function M(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
2
+ export{M};
@@ -1,2 +1,2 @@
1
- import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var Ut="group/trailing";function at({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function Bt({content:n,actions:e,className:r}){if(n==null&&e==null)return null;return s("span",{className:i("group/swap relative flex min-h-5 min-w-5 shrink-0 items-center justify-end",r),children:[n!=null&&t("span",{className:i("flex items-center justify-end",e!=null&&"group-focus-within/trailing:hidden group-hover/trailing:hidden group-has-[[data-popup-open]]/swap:hidden"),children:n}),e!=null&&t("span",{className:"absolute inset-y-0 end-0 hidden w-max items-center justify-end gap-0.5 group-focus-within/trailing:flex group-hover/trailing:flex has-[[data-popup-open]]:flex",onClick:(a)=>a.stopPropagation(),onKeyDown:(a)=>a.stopPropagation(),children:e})]})}
2
- export{Ut,at,Bt};
1
+ import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var Et="group/trailing";function rt({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function Rt({content:n,actions:e,className:r}){if(n==null&&e==null)return null;return s("span",{className:i("group/swap relative flex min-h-5 min-w-5 shrink-0 items-center justify-end",r),children:[n!=null&&t("span",{className:i("flex items-center justify-end",e!=null&&"group-focus-within/trailing:hidden group-hover/trailing:hidden group-has-[[data-popup-open]]/swap:hidden"),children:n}),e!=null&&t("span",{className:"absolute inset-y-0 end-0 hidden w-max items-center justify-end gap-0.5 group-focus-within/trailing:flex group-hover/trailing:flex has-[[data-popup-open]]:flex",onClick:(a)=>a.stopPropagation(),onKeyDown:(a)=>a.stopPropagation(),children:e})]})}
2
+ export{Et,rt,Rt};
@@ -1,2 +1,2 @@
1
- import{createContext as o,useContext as n,useEffect as r}from"react";var Cs=o(null);function O(t){let e=n(Cs);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
- export{Cs,O};
1
+ import{createContext as o,useContext as n,useEffect as r}from"react";var zr=o(null);function L(t){let e=n(zr);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
+ export{zr,L};
@@ -0,0 +1,2 @@
1
+ import{Ae}from"./chunk-ffs5nkt0.js";function rn(t){return Ae(t.absPath)}function sn(t){return t.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??t}function an(t){return sn(t.absPath)}
2
+ export{rn,sn,an};
@@ -1,3 +1,3 @@
1
- import{rs,Rt}from"./chunk-z0z3xfn3.js";import{t,v}from"./chunk-xdrwsxqy.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 Vt(e){c.setState({request:{path:e.path,patch:Xo(e.patch,e.path)}})}function Xo(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 jt(){let{t:e,theme:a}=t(),n=v(c,(o)=>o.request),s=n===null?null:rs(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(Rt,{patch:n.patch,theme:a})})]})})}
3
- export{Vt,Xo,jt};
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,2 +1,2 @@
1
- import{Po,vt}from"./chunk-2w0grrzz.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function et(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=Po(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function tl(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return vt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{et,tl};
1
+ import{To,It}from"./chunk-6cjjwry2.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function ot(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=To(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function el(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return It(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
+ export{ot,el};
@@ -1,2 +1,2 @@
1
- import{$n}from"./chunk-thxz5zm6.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function ha({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a($n,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
- export{ha};
1
+ import{zn}from"./chunk-7cab9zy0.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function sa({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(zn,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
+ export{sa};
@@ -1,2 +1,2 @@
1
- import{ScrollArea as r}from"@base-ui/react/scroll-area";import{cn as o}from"cn";import{useState as v}from"react";import{jsx as e,jsxs as u}from"react/jsx-runtime";function I({nativeScroll:f=!1,className:t,viewportClassName:n,viewportRef:i,onScroll:s,viewportProps:a,children:c,...m}){let[p,l]=v(!1);if(f)return e("div",{className:o("relative flex min-h-0 flex-1",t),...m,children:e("div",{ref:i,onScroll:s,...a,className:o("min-h-0 min-w-0 flex-1 overflow-y-auto outline-none",n,a?.className),children:c})});return u(r.Root,{"data-slot":"scroll-area",className:o("relative min-h-0 flex-1 pe-[var(--app-scrollbar-track-size)]",t),...m,children:[e(r.Viewport,{ref:i,onScroll:s,"data-slot":"scroll-area-viewport",...a,className:o("size-full rounded-[inherit] pe-2 outline-none",n,a?.className),children:c}),e(r.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":"vertical",orientation:"vertical","data-dragging":p?"":void 0,onPointerDownCapture:(d)=>{if(d.button===0)l(!0)},onPointerUpCapture:()=>l(!1),onPointerCancelCapture:()=>l(!1),onLostPointerCapture:()=>l(!1),className:"flex h-full w-[var(--app-scrollbar-track-size)] touch-none px-[var(--app-scrollbar-edge-gap)] select-none",children:e(r.Thumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})}),e(r.Corner,{})]})}
2
- export{I};
1
+ import{ScrollArea as r}from"@base-ui/react/scroll-area";import{cn as o}from"cn";import{useState as v}from"react";import{jsx as e,jsxs as u}from"react/jsx-runtime";function k({nativeScroll:f=!1,className:t,viewportClassName:n,viewportRef:i,onScroll:s,viewportProps:a,children:c,...m}){let[p,l]=v(!1);if(f)return e("div",{className:o("relative flex min-h-0 flex-1",t),...m,children:e("div",{ref:i,onScroll:s,...a,className:o("min-h-0 min-w-0 flex-1 overflow-y-auto outline-none",n,a?.className),children:c})});return u(r.Root,{"data-slot":"scroll-area",className:o("relative min-h-0 flex-1 pe-[var(--app-scrollbar-track-size)]",t),...m,children:[e(r.Viewport,{ref:i,onScroll:s,"data-slot":"scroll-area-viewport",...a,className:o("size-full rounded-[inherit] pe-2 outline-none",n,a?.className),children:c}),e(r.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":"vertical",orientation:"vertical","data-dragging":p?"":void 0,onPointerDownCapture:(d)=>{if(d.button===0)l(!0)},onPointerUpCapture:()=>l(!1),onPointerCancelCapture:()=>l(!1),onLostPointerCapture:()=>l(!1),className:"flex h-full w-[var(--app-scrollbar-track-size)] touch-none px-[var(--app-scrollbar-edge-gap)] select-none",children:e(r.Thumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})}),e(r.Corner,{})]})}
2
+ export{k};
@@ -0,0 +1,2 @@
1
+ import{wt}from"./chunk-tyka859b.js";import{o}from"./chunk-f9z37ptq.js";import{e,b}from"./chunk-bshgrwe9.js";import{X,x,Y}from"./chunk-p8cm3xw1.js";import{isBooleanOption as U,isGroupedSelect as q,isSelectOption as A}from"@nyssance/codex-acp-v2/client";import{Zap as Z}from"lucide-react";import{memo as D,useRef as F}from"react";import{jsx as w}from"react/jsx-runtime";function H({sessionId:l,options:u,disabled:B,onModelChange:h,onConfigChange:C,defaultGroup:G={id:"models",name:"Models"},catalog:I=(c)=>c,headerAction:L}){let{host:c,client:N}=e(),{t:i}=c,P=o((n)=>Boolean(n.configPending[l])),p=F({sessionId:l,model:!0}),O=P&&(p.current.sessionId!==l||p.current.model),k=o((n)=>{let r=n.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=x(u,"model"),a=x(u,"thought_level"),v=u.filter((n)=>n.configId!=="collaboration_mode"&&(n.category==="model_config"||n.category!=="mode"&&n!==t&&n!==a)),_=v.filter(A),m=v.filter(U);if(!t&&!a&&_.length===0&&m.length===0)return null;let f=(n,r)=>{if(r===n.currentValue)return Promise.resolve();p.current={sessionId:l,model:n===t};let d=C?C(n.configId,r):N.setConfig(l,n.configId,r);return b(c,d),d},g=a?X(a):[],z=g.reduce((n,r)=>r.name.length>=n.length?r.name:n,""),R=t?Y(t):i("composer.model"),S=(n)=>({api_id:n.value,label:n.name}),V=I(t&&q(t.options)?t.options.map((n)=>({id:n.groupId,name:n.name,models:n.options.map(S)})):[{...G,models:t?X(t).map(S):[]}]),y=V.flatMap((n)=>n.models),M=y.find((n)=>n.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:R},s=m.find((n)=>n.configId==="fast_mode"||n.configId==="fast-mode");return w(wt,{disabled:B||O||k,switching:O,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:y,showModelList:Boolean(t),onChange:(n)=>{if(n.api_id===t?.currentValue)return;if(h)h(n.api_id);else if(t)f(t,n.api_id)},header:{name:t?.name??i("composer.model"),action:L},modelGroups:V,t:i,effortConfig:a&&g.length>0?{name:"Effort",value:a.currentValue,levels:g,sizer:z,onChange:(n)=>f(a,n)}:void 0,selectOptions:_.map((n)=>({id:n.configId,name:n.name,value:n.currentValue,options:X(n).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>f(n,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:w(Z,{className:"size-4","aria-hidden":"true"})},...m.filter((n)=>n!==s).map((n)=>({id:n.configId,name:n.name,currentValue:n.currentValue}))],onBooleanChange:(n,r)=>{let d=n==="fast_mode"?s:m.find((E)=>E.configId===n);if(!d)throw Error(`Unknown boolean config: ${n}`);f(d,r)}})}var fn=D(H);
2
+ export{fn};
@@ -1,2 +1,2 @@
1
- async function Ji(e,t,i){let o=new Map;for(let a=0;a<t.length;a+=100){let r=await e("_codex/apps_read",{appIds:t.slice(a,a+100),...i?{threadId:i}:{},includeTools:!1});if(!r||typeof r!=="object"||!("apps"in r)||!Array.isArray(r.apps))throw Error("Invalid application metadata response");for(let n of r.apps){if(!n||typeof n.id!=="string"||n.iconUrl!==null&&typeof n.iconUrl!=="string"||n.iconUrlDark!==null&&typeof n.iconUrlDark!=="string")throw Error("Invalid application icon metadata");o.set(n.id,{iconUrl:n.iconUrl,iconUrlDark:n.iconUrlDark})}}return o}
2
- export{Ji};
1
+ async function vr(e,t,i){let o=new Map;for(let a=0;a<t.length;a+=100){let r=await e("_codex/apps_read",{appIds:t.slice(a,a+100),...i?{threadId:i}:{},includeTools:!1});if(!r||typeof r!=="object"||!("apps"in r)||!Array.isArray(r.apps))throw Error("Invalid application metadata response");for(let n of r.apps){if(!n||typeof n.id!=="string"||n.iconUrl!==null&&typeof n.iconUrl!=="string"||n.iconUrlDark!==null&&typeof n.iconUrlDark!=="string")throw Error("Invalid application icon metadata");o.set(n.id,{iconUrl:n.iconUrl,iconUrlDark:n.iconUrlDark})}}return o}
2
+ export{vr};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-tac30kkh.js";import{Tn,Mn}from"./chunk-6cks2gn2.js";import{T}from"./chunk-1dkd8jt0.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Xs({providers:n,store:l}){let{t:m}=e().host,d=Tn(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=T(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Mn(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
- export{Xs};
1
+ import{e}from"./chunk-bshgrwe9.js";import{qt,Kt}from"./chunk-81hv0s07.js";import{S}from"./chunk-h8r785ne.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ns({providers:n,store:l}){let{t:m}=e().host,d=qt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=S(s.id,o.api_id);return t(w,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function w({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Kt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
+ export{Ns};
@@ -0,0 +1,2 @@
1
+ import{_t}from"./chunk-nh56sb8e.js";var hr={persistConfig:!1,nativeTools:{},applicationContext:()=>_t(null),parseConfig(t){if(Object.keys(t).length)throw Error("Chat input config must be empty");return{}},routePrompt(t){return t.native()}};
2
+ export{hr};
@@ -1,2 +1,2 @@
1
- import{Xi,Xe,yo,Yi,er,tr}from"./chunk-484wg46e.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 Ri=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(()=>Xi({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=Xe({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return yo({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=Xe({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=tr({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=Xe({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=Yi({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=er({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=Xe({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:yo({anchorKey:e,layout:i,previousRange:M}))??Xe({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{Ri};
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};
@@ -0,0 +1,2 @@
1
+ import{Gr}from"./chunk-n9jaz2pd.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function Ks({host:o,children:t}){return s(n,{value:o,children:t})}function N(){let o=i(n),e={...Gr(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function Ki(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function pe(){let o=N();return(t)=>Ki(o,t)}function Wi(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
+ export{Ks,N,Ki,pe,Wi};
@@ -1,2 +1,2 @@
1
- function pe(n){if(typeof n!=="object"||n===null)return!1;let e=n,t=e.reason??e.message;return e.code===-32000&&typeof t==="string"&&/^Authentication required(?:$|:)/.test(t)}function cn(n){if(typeof n!=="object"||n===null)return!1;let e=n,t=typeof e.data==="object"&&e.data!==null?e.data.details:e.data;return[e.message,e.reason,t].some((o)=>typeof o==="string"&&["The selected provider connection or model is unavailable","The selected model connection is unavailable","The selected ALwith account model is unavailable","The ALwith account changed"].some((a)=>o.includes(a)))}function js(n,e){if(!(n instanceof Error))return n;let t=n.data,o=typeof t==="string"?t:typeof t==="object"&&t!==null?t.details:void 0;if(typeof o!=="string"||o.trim()==="")return n;return n.message=`${e}: ${o}`,n}
2
- export{pe,cn,js};
1
+ function ge(n){if(typeof n!=="object"||n===null)return!1;let e=n,t=e.reason??e.message;return e.code===-32000&&typeof t==="string"&&/^Authentication required(?:$|:)/.test(t)}function Fn(n){if(typeof n!=="object"||n===null)return!1;let e=n,t=typeof e.data==="object"&&e.data!==null?e.data.details:e.data;return[e.message,e.reason,t].some((o)=>typeof o==="string"&&["The selected provider connection or model is unavailable","The selected model connection is unavailable","The selected ALwith account model is unavailable","The ALwith account changed"].some((a)=>o.includes(a)))}function oa(n,e){if(!(n instanceof Error))return n;let t=n.data,o=typeof t==="string"?t:typeof t==="object"&&t!==null?t.details:void 0;if(typeof o!=="string"||o.trim()==="")return n;return n.message=`${e}: ${o}`,n}
2
+ export{ge,Fn,oa};
@@ -1,2 +1,2 @@
1
- var a=(e)=>String(e).padStart(2,"0");function dt(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{dt};
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,2 +1,2 @@
1
- import{Nt}from"./chunk-t3enrsnt.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function Rr({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Nt({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
2
- export{Rr};
1
+ import{Ft}from"./chunk-26w51q10.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function es({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Ft({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
2
+ export{es};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-f9z37ptq.js";import{e}from"./chunk-bshgrwe9.js";import{x,Y}from"./chunk-p8cm3xw1.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:Y(t)}function et(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:et(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 hn=W(_);
2
+ export{et,hn};
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-tzr6phth.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function je(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>je(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!je(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Qo(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Sa(t){u.get(t)?.set(v(t))}function ne(t){let n=Qo(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function Ce(){return Qo(a()).set}function _a(){let t=ne((e)=>e.view),n=Ce();return[t,(e)=>n({view:e})]}
2
- export{je,Qo,Sa,ne,Ce,_a};
1
+ import{a}from"./chunk-n9jaz2pd.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function je(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>je(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!je(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Lo(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Ca(t){u.get(t)?.set(v(t))}function te(t){let n=Lo(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ye(){return Lo(a()).set}function wa(){let t=te((e)=>e.view),n=ye();return[t,(e)=>n({view:e})]}
2
+ export{je,Lo,Ca,te,ye,wa};
@@ -1,2 +1,2 @@
1
- var r=new Map,i=new Map,m=new Map;function Vi(e,t){if(i.has(e))throw Error("An attachment writer is already registered for this session");return i.set(e,t),()=>{if(i.get(e)===t)i.delete(e)}}function q(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),i.get(e)?.(n)}function on(e,t){m.set(e,t),t.finally(()=>{if(m.get(e)===t)m.delete(e)})}async function Bs(e){for(;;){let n=r.get(e)?.attachments.flatMap((p)=>{let c=m.get(p.id);return c?[c]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let p=await fetch(n.url);if(!p.ok)throw Error("Cannot read draft image");let c=await p.blob(),f=await new Promise((l,g)=>{let a=new FileReader;a.onload=()=>l(a.result),a.onerror=()=>g(a.error),a.readAsDataURL(c)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function Gs(e,t){if(t===null)r.delete(e);else r.set(e,t)}var s=new Map;function rn(e,t){if(s.has(e))throw Error("A composer is already registered for this session");return s.set(e,t),()=>{if(s.get(e)===t)s.delete(e)}}function zs(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=s.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}
2
- export{r,Vi,q,on,Bs,Gs,rn,zs};
1
+ var r=new Map,i=new Map,m=new Map;function Vi(e,t){if(i.has(e))throw Error("An attachment writer is already registered for this session");return i.set(e,t),()=>{if(i.get(e)===t)i.delete(e)}}function J(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),i.get(e)?.(n)}function mn(e,t){m.set(e,t),t.finally(()=>{if(m.get(e)===t)m.delete(e)})}async function Vs(e){for(;;){let n=r.get(e)?.attachments.flatMap((p)=>{let c=m.get(p.id);return c?[c]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let p=await fetch(n.url);if(!p.ok)throw Error("Cannot read draft image");let c=await p.blob(),f=await new Promise((l,g)=>{let a=new FileReader;a.onload=()=>l(a.result),a.onerror=()=>g(a.error),a.readAsDataURL(c)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function js(e,t){if(t===null)r.delete(e);else r.set(e,t)}var s=new Map;function gn(e,t){if(s.has(e))throw Error("A composer is already registered for this session");return s.set(e,t),()=>{if(s.get(e)===t)s.delete(e)}}function $s(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=s.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}
2
+ export{r,Vi,J,mn,Vs,js,gn,$s};