@alwith/module-chat 0.6.18 → 0.6.19

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 (460) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/application-client.js +1 -1
  3. package/dist/agent/client.js +1 -1
  4. package/dist/agent/custom-model-effort.js +1 -1
  5. package/dist/agent/fork-title.js +1 -1
  6. package/dist/agent/image-request.js +1 -1
  7. package/dist/agent/image-tools.js +1 -1
  8. package/dist/agent/input-config.js +1 -1
  9. package/dist/agent/input-modes/chat.js +1 -1
  10. package/dist/agent/input-modes/execution-meta.js +1 -1
  11. package/dist/agent/input-modes/image-context.js +1 -1
  12. package/dist/agent/input-modes/image.js +1 -1
  13. package/dist/agent/input-modes/index.js +1 -1
  14. package/dist/agent/project-path.js +1 -1
  15. package/dist/agent/request-error.js +1 -1
  16. package/dist/agent/session-list-refresh.js +1 -1
  17. package/dist/app-reference.js +1 -1
  18. package/dist/application-tools.js +1 -1
  19. package/dist/approval/choice-elicitation-form.js +1 -1
  20. package/dist/approval/choice-schema.js +1 -1
  21. package/dist/approval/permission-options.js +1 -1
  22. package/dist/approval/permission-view.js +1 -1
  23. package/dist/approval/schema-elicitation-form.js +1 -1
  24. package/dist/approval/url-elicitation-card.js +1 -1
  25. package/dist/{chunk-s88eyv24.js → chunk-02qwd1yq.js} +2 -2
  26. package/dist/chunk-052wfeys.js +2 -0
  27. package/dist/chunk-06wtwk7b.js +2 -0
  28. package/dist/{chunk-6w5gfh01.js → chunk-0jpzztpz.js} +2 -2
  29. package/dist/chunk-0z7gy762.js +2 -0
  30. package/dist/{chunk-g61xf0ma.js → chunk-113maskf.js} +2 -2
  31. package/dist/{chunk-vhxr0c4c.js → chunk-15m908ph.js} +2 -2
  32. package/dist/{chunk-wxh1m3gg.js → chunk-1d29gnb2.js} +2 -2
  33. package/dist/{chunk-wf7kfk3p.js → chunk-1fadxh2z.js} +2 -2
  34. package/dist/{chunk-933h9gnv.js → chunk-1gr60c40.js} +2 -2
  35. package/dist/chunk-1npqxk6m.js +2 -0
  36. package/dist/{chunk-04c5k3qr.js → chunk-2aw505xv.js} +2 -2
  37. package/dist/{chunk-nmd5x501.js → chunk-2gwegefd.js} +2 -2
  38. package/dist/chunk-2hkj5qxh.js +2 -0
  39. package/dist/{chunk-c1pvvk0x.js → chunk-2ncdext6.js} +2 -2
  40. package/dist/chunk-30a5fgk9.js +2 -0
  41. package/dist/{chunk-gnctm097.js → chunk-337hq36y.js} +2 -2
  42. package/dist/{chunk-b4kh5nns.js → chunk-34mq2dbm.js} +2 -2
  43. package/dist/{chunk-dtgbgwby.js → chunk-3g9n4bk2.js} +2 -2
  44. package/dist/chunk-3tp8fe70.js +2 -0
  45. package/dist/{chunk-jg4c3zg4.js → chunk-3tvq6xr2.js} +2 -2
  46. package/dist/chunk-3tzh25vq.js +2 -0
  47. package/dist/{chunk-f4h84pav.js → chunk-44r55va6.js} +2 -2
  48. package/dist/{chunk-k4xsxxy7.js → chunk-4jp1d558.js} +2 -2
  49. package/dist/chunk-4sa0m3w5.js +2 -0
  50. package/dist/{chunk-bv14x0e8.js → chunk-4sfxcw58.js} +3 -3
  51. package/dist/{chunk-m8pkmbtf.js → chunk-4wm5emgf.js} +2 -2
  52. package/dist/{chunk-ayhxrzsq.js → chunk-51x80v4h.js} +2 -2
  53. package/dist/{chunk-pk931bpm.js → chunk-5c42mfat.js} +2 -2
  54. package/dist/{chunk-nrzkzvr0.js → chunk-5gn8xw58.js} +2 -2
  55. package/dist/chunk-5jq3xg3q.js +2 -0
  56. package/dist/{chunk-tec9yhsm.js → chunk-64apxzn7.js} +2 -2
  57. package/dist/{chunk-bane0xc8.js → chunk-6e84zbgs.js} +2 -2
  58. package/dist/{chunk-ztrfygh5.js → chunk-6f06hbsk.js} +2 -2
  59. package/dist/{chunk-ggddhx5x.js → chunk-6g553fkh.js} +2 -2
  60. package/dist/{chunk-wjd2hpnd.js → chunk-6j1x3gny.js} +2 -2
  61. package/dist/{chunk-pdmayjan.js → chunk-73e9vpm9.js} +2 -2
  62. package/dist/{chunk-gy4h86mw.js → chunk-74b70n1g.js} +2 -2
  63. package/dist/chunk-7b5ryhwh.js +2 -0
  64. package/dist/{chunk-3hjcpcnv.js → chunk-7d1wnjw5.js} +2 -2
  65. package/dist/{chunk-814h2ja2.js → chunk-7evd34gw.js} +3 -3
  66. package/dist/{chunk-n3sm0834.js → chunk-7g11pcm4.js} +3 -3
  67. package/dist/{chunk-p14j9ckg.js → chunk-7p7fxgdb.js} +2 -2
  68. package/dist/chunk-7pwdjhg8.js +2 -0
  69. package/dist/{chunk-c8wdf20g.js → chunk-80sbwjrr.js} +2 -2
  70. package/dist/chunk-816tez3v.js +2 -0
  71. package/dist/{chunk-swt6dntp.js → chunk-81n37a11.js} +2 -2
  72. package/dist/{chunk-16db8fh2.js → chunk-84p483n0.js} +2 -2
  73. package/dist/{chunk-kk9dbwd1.js → chunk-84zzf0ys.js} +2 -2
  74. package/dist/{chunk-78vckhxt.js → chunk-88ysxbdh.js} +2 -2
  75. package/dist/{chunk-hzhcajx1.js → chunk-8q5zwkry.js} +2 -2
  76. package/dist/{chunk-a71j2n86.js → chunk-8rb896tq.js} +2 -2
  77. package/dist/{chunk-5aqqqsa3.js → chunk-90847w64.js} +2 -2
  78. package/dist/{chunk-bej9z041.js → chunk-97pn8v17.js} +2 -2
  79. package/dist/{chunk-ymgc4317.js → chunk-9k58vckd.js} +2 -2
  80. package/dist/chunk-9x08kyf6.js +2 -0
  81. package/dist/{chunk-hygvdjq6.js → chunk-agdkhyaj.js} +3 -3
  82. package/dist/chunk-ajp19sh9.js +2 -0
  83. package/dist/{chunk-evygj5ka.js → chunk-ak196z4y.js} +2 -2
  84. package/dist/{chunk-v8x5atmn.js → chunk-ane53rqa.js} +2 -2
  85. package/dist/{chunk-s6y31dcb.js → chunk-arm9x6kc.js} +2 -2
  86. package/dist/{chunk-1ycyexae.js → chunk-ath5nv2w.js} +2 -2
  87. package/dist/{chunk-6c18ag8t.js → chunk-bba9qej8.js} +2 -2
  88. package/dist/{chunk-q46z21zs.js → chunk-bf7sgpzq.js} +2 -2
  89. package/dist/{chunk-5hk3k14h.js → chunk-bg0vkt53.js} +2 -2
  90. package/dist/{chunk-tj4b0s68.js → chunk-bqhbksy2.js} +2 -2
  91. package/dist/{chunk-djd3sjp9.js → chunk-brv52tgj.js} +2 -2
  92. package/dist/chunk-bve6cykn.js +2 -0
  93. package/dist/{chunk-e2qjbqq2.js → chunk-bw3bpr6m.js} +2 -2
  94. package/dist/{chunk-bydxp3zj.js → chunk-c2h4wr7g.js} +4 -4
  95. package/dist/{chunk-qdcznn2t.js → chunk-ch8e8a32.js} +2 -2
  96. package/dist/{chunk-4p0zk3mj.js → chunk-cydnp9mm.js} +2 -2
  97. package/dist/{chunk-62qtrk0p.js → chunk-d0s10qy5.js} +2 -2
  98. package/dist/chunk-d6cfxqzx.js +2 -0
  99. package/dist/{chunk-f73x23f9.js → chunk-d9mj74pb.js} +1 -1
  100. package/dist/{chunk-2easwd1n.js → chunk-dd9k5bbt.js} +2 -2
  101. package/dist/{chunk-ffs5nkt0.js → chunk-dheg4bs2.js} +2 -2
  102. package/dist/{chunk-56rx2rmj.js → chunk-dr5swvaa.js} +2 -2
  103. package/dist/{chunk-61awcdaq.js → chunk-dsf2x63w.js} +4 -4
  104. package/dist/chunk-e1fzfaqj.js +2 -0
  105. package/dist/{chunk-23r426sm.js → chunk-e1zsnc8z.js} +2 -2
  106. package/dist/{chunk-m944rgn9.js → chunk-er5wxkt2.js} +2 -2
  107. package/dist/{chunk-abgdqy92.js → chunk-esbgn8q0.js} +2 -2
  108. package/dist/{chunk-nh56sb8e.js → chunk-etvdqkvb.js} +2 -2
  109. package/dist/{chunk-cvx7r35k.js → chunk-evpjxbzm.js} +2 -2
  110. package/dist/{chunk-g7cc7gdn.js → chunk-ex063jn9.js} +2 -2
  111. package/dist/{chunk-r6ns1457.js → chunk-eynwjzqp.js} +2 -2
  112. package/dist/{chunk-f6zpqrg3.js → chunk-f78jd8xh.js} +2 -2
  113. package/dist/chunk-f9xtcxfb.js +2 -0
  114. package/dist/{chunk-z6e4ydvm.js → chunk-fdmbfq9g.js} +2 -2
  115. package/dist/{chunk-04frqm59.js → chunk-fkkk1fza.js} +2 -2
  116. package/dist/{chunk-rb4p3h5b.js → chunk-ftsnryz8.js} +2 -2
  117. package/dist/{chunk-8y60kexq.js → chunk-fvxxzgrc.js} +2 -2
  118. package/dist/{chunk-fhjk81r9.js → chunk-fwqpwbd8.js} +2 -2
  119. package/dist/{chunk-ykz0h1r0.js → chunk-fyxetwxv.js} +2 -2
  120. package/dist/{chunk-rtbpfasb.js → chunk-g1nck6pp.js} +2 -2
  121. package/dist/{chunk-5s85tvas.js → chunk-gpv1dc5y.js} +2 -2
  122. package/dist/chunk-gs0b02g2.js +2 -0
  123. package/dist/{chunk-y8fmawc6.js → chunk-gttw4rmx.js} +3 -3
  124. package/dist/{chunk-29s4mnfw.js → chunk-gwskdhaw.js} +2 -2
  125. package/dist/{chunk-npvcy4tw.js → chunk-h7xjw0p4.js} +2 -2
  126. package/dist/{chunk-rh2yx0xq.js → chunk-h82jte5p.js} +2 -2
  127. package/dist/{chunk-jm6y0edw.js → chunk-hfghqddp.js} +2 -2
  128. package/dist/{chunk-86r89vrt.js → chunk-hj05zh7h.js} +2 -2
  129. package/dist/chunk-hnkde8me.js +2 -0
  130. package/dist/{chunk-8y706gz3.js → chunk-hqt5j789.js} +2 -2
  131. package/dist/{chunk-s6b28p84.js → chunk-j39bhfsp.js} +2 -2
  132. package/dist/{chunk-rkejggyx.js → chunk-j3g21ext.js} +2 -2
  133. package/dist/{chunk-ecaedwda.js → chunk-j6000jts.js} +2 -2
  134. package/dist/{chunk-vgscp6dr.js → chunk-j78kgyff.js} +5 -5
  135. package/dist/{chunk-q01vmp9m.js → chunk-jgqt7k0h.js} +2 -2
  136. package/dist/chunk-jpr2y0y3.js +2 -0
  137. package/dist/{chunk-3chhwwwy.js → chunk-jpr5ewnh.js} +2 -2
  138. package/dist/{chunk-dxsjz3re.js → chunk-k4a3p16c.js} +2 -2
  139. package/dist/{chunk-kj3a1k2q.js → chunk-k5nd3vyq.js} +2 -2
  140. package/dist/{chunk-g8w06bdx.js → chunk-k883x8fv.js} +2 -2
  141. package/dist/{chunk-38bpmgjd.js → chunk-kj2zk46g.js} +2 -2
  142. package/dist/chunk-kkqrxb9w.js +3 -0
  143. package/dist/{chunk-2zy75522.js → chunk-kn792h8n.js} +2 -2
  144. package/dist/chunk-kqvgmkvr.js +2 -0
  145. package/dist/{chunk-7ac4g54f.js → chunk-m087n233.js} +3 -3
  146. package/dist/{chunk-ase4ejxz.js → chunk-ma6ycen5.js} +2 -2
  147. package/dist/{chunk-8q9hq3mg.js → chunk-ma7thf1j.js} +2 -2
  148. package/dist/{chunk-rr9kc3n8.js → chunk-mahb3t97.js} +2 -2
  149. package/dist/{chunk-f89s462k.js → chunk-mf0k3xd4.js} +3 -3
  150. package/dist/{chunk-ckjq6690.js → chunk-n811d65m.js} +3 -3
  151. package/dist/{chunk-kj3t4mqf.js → chunk-n96z8etk.js} +2 -2
  152. package/dist/{chunk-ecdjjnbb.js → chunk-nbgw51b6.js} +2 -2
  153. package/dist/{chunk-8v53bkyr.js → chunk-ne4b53kn.js} +2 -2
  154. package/dist/{chunk-p2tm6tv8.js → chunk-nhkm2gr7.js} +1 -1
  155. package/dist/{chunk-e7ndpy02.js → chunk-nn30qzhx.js} +2 -2
  156. package/dist/{chunk-heqa4swe.js → chunk-nqt9gyz9.js} +2 -2
  157. package/dist/{chunk-q5qqhqw4.js → chunk-p3gawvqr.js} +2 -2
  158. package/dist/{chunk-vvkp0jqa.js → chunk-p5hk14fk.js} +2 -2
  159. package/dist/{chunk-s8djv2dy.js → chunk-pc11a2w0.js} +3 -3
  160. package/dist/chunk-ph7srp7q.js +2 -0
  161. package/dist/{chunk-kv1w4jx4.js → chunk-phee3jn9.js} +2 -2
  162. package/dist/{chunk-e04g26qm.js → chunk-pqz2471h.js} +2 -2
  163. package/dist/{chunk-5bmxngnx.js → chunk-psndz2rs.js} +2 -2
  164. package/dist/{chunk-df9aqj1m.js → chunk-pxzj3ae7.js} +2 -2
  165. package/dist/{chunk-xykmskka.js → chunk-q1yz3t9z.js} +2 -2
  166. package/dist/{chunk-mr2wcd24.js → chunk-q4c6f84f.js} +2 -2
  167. package/dist/{chunk-vbbndjfd.js → chunk-q7rq46qc.js} +2 -2
  168. package/dist/{chunk-6my4ybpw.js → chunk-qma11tpm.js} +3 -3
  169. package/dist/chunk-qmcr5f9k.js +2 -0
  170. package/dist/{chunk-0rnh8mhs.js → chunk-r7hwgk2v.js} +2 -2
  171. package/dist/{chunk-8kd74ng1.js → chunk-rg9ckzpr.js} +2 -2
  172. package/dist/{chunk-gdavg2hq.js → chunk-rhe4w638.js} +2 -2
  173. package/dist/chunk-rkqptd9w.js +2 -0
  174. package/dist/{chunk-n8v6cdq3.js → chunk-rp7tnbss.js} +2 -2
  175. package/dist/chunk-rv3k0kfr.js +2 -0
  176. package/dist/{chunk-1qjhvkg0.js → chunk-rz9fnphz.js} +2 -2
  177. package/dist/chunk-s6medm3z.js +2 -0
  178. package/dist/{chunk-1r4y3pfg.js → chunk-s9mejb9v.js} +2 -2
  179. package/dist/{chunk-z1qcgb6b.js → chunk-scdj02m8.js} +3 -3
  180. package/dist/chunk-sfgegn3p.js +2 -0
  181. package/dist/chunk-sjb5stzq.js +2 -0
  182. package/dist/{chunk-kztrgv9y.js → chunk-sp2ny9ak.js} +2 -2
  183. package/dist/chunk-stv8pr4v.js +2 -0
  184. package/dist/chunk-swkcmtme.js +2 -0
  185. package/dist/chunk-sz993t5e.js +2 -0
  186. package/dist/{chunk-ms0h8x63.js → chunk-t5ff3cn7.js} +2 -2
  187. package/dist/{chunk-tc3t2sgb.js → chunk-ta6rbxh5.js} +3 -3
  188. package/dist/chunk-tc6d0v1y.js +2 -0
  189. package/dist/{chunk-38hvm5ca.js → chunk-tdvx2n5m.js} +2 -2
  190. package/dist/{chunk-6wkcqhkk.js → chunk-tftgnw1w.js} +2 -2
  191. package/dist/{chunk-1vtvcar6.js → chunk-thaa1n4f.js} +2 -2
  192. package/dist/chunk-tyrzaz6c.js +2 -0
  193. package/dist/{chunk-csfqkzmr.js → chunk-vg1y693r.js} +3 -3
  194. package/dist/{chunk-q9mh8x4r.js → chunk-vg9p0hvk.js} +2 -2
  195. package/dist/{chunk-3g9qb7vq.js → chunk-vm81n2c0.js} +2 -2
  196. package/dist/chunk-vt7dkgtx.js +2 -0
  197. package/dist/{chunk-wkrnbk0p.js → chunk-w1wr14da.js} +2 -2
  198. package/dist/{chunk-gvqvw7ms.js → chunk-wbjf9maj.js} +2 -2
  199. package/dist/{chunk-2a4pq98d.js → chunk-wew3t005.js} +2 -2
  200. package/dist/{chunk-gea1q14z.js → chunk-wpacvdsv.js} +2 -2
  201. package/dist/{chunk-jca8s47n.js → chunk-wq47c4ws.js} +2 -2
  202. package/dist/{chunk-easm0z49.js → chunk-x2wcwpw3.js} +2 -2
  203. package/dist/chunk-x3v10a71.js +2 -0
  204. package/dist/{chunk-9q6hz47j.js → chunk-x49qjrbk.js} +2 -2
  205. package/dist/{chunk-r8expjyy.js → chunk-x4jm2eh9.js} +4 -4
  206. package/dist/{chunk-gawrkkbf.js → chunk-xfzmxq3g.js} +2 -2
  207. package/dist/{chunk-n0q8e6sq.js → chunk-xnc0175v.js} +2 -2
  208. package/dist/chunk-xnx8p8c0.js +4 -0
  209. package/dist/{chunk-at75m9hq.js → chunk-xqb4thy8.js} +2 -2
  210. package/dist/{chunk-2cfhvb3k.js → chunk-xspnhgq6.js} +2 -2
  211. package/dist/{chunk-7jk8s061.js → chunk-xwwjj45a.js} +2 -2
  212. package/dist/{chunk-8ngg5vs4.js → chunk-xx29efrs.js} +3 -3
  213. package/dist/{chunk-d8f6avcz.js → chunk-xx7t8r87.js} +2 -2
  214. package/dist/{chunk-d2m4xmt4.js → chunk-xyffk47k.js} +2 -2
  215. package/dist/{chunk-tzczzqde.js → chunk-y3mx5sf0.js} +2 -2
  216. package/dist/{chunk-t9xkg3pk.js → chunk-yb5yhh8t.js} +2 -2
  217. package/dist/chunk-ye7ecnej.js +2 -0
  218. package/dist/{chunk-x20dy83s.js → chunk-ynxb5xqz.js} +3 -3
  219. package/dist/{chunk-6xap6hvz.js → chunk-z107z7dt.js} +2 -2
  220. package/dist/{chunk-3a3ecayr.js → chunk-z6x70w62.js} +2 -2
  221. package/dist/{chunk-1gv49jt9.js → chunk-zjk12jjm.js} +3 -3
  222. package/dist/{chunk-kh3af9mq.js → chunk-zw2x5ztr.js} +2 -2
  223. package/dist/{chunk-r8pm74zf.js → chunk-zxfx7psd.js} +2 -2
  224. package/dist/{chunk-2dm51ksz.js → chunk-zyn0ys4m.js} +2 -2
  225. package/dist/{chunk-86821qec.js → chunk-zzjth6f2.js} +2 -2
  226. package/dist/client.js +1 -1
  227. package/dist/codex/activity-group.js +1 -1
  228. package/dist/codex/artifact-links.js +1 -1
  229. package/dist/codex/assistant-message.js +1 -1
  230. package/dist/codex/async-question-card.js +1 -1
  231. package/dist/codex/edited-files-card.js +1 -1
  232. package/dist/codex/image-view-activity.js +1 -1
  233. package/dist/codex/markdown-renderer.js +1 -1
  234. package/dist/codex/navigation-audio.js +1 -1
  235. package/dist/codex/navigation-preview.js +1 -1
  236. package/dist/codex/navigation-rail.js +1 -1
  237. package/dist/codex/patch-view.js +1 -1
  238. package/dist/codex/plan.js +1 -1
  239. package/dist/codex/timeline-virtualizer.js +1 -1
  240. package/dist/codex/turn-activity.js +1 -1
  241. package/dist/codex/user-message.js +1 -1
  242. package/dist/codex/virtualized-turn-list.js +1 -1
  243. package/dist/collections/collection-emoji.js +1 -1
  244. package/dist/collections/collection-menu.js +1 -1
  245. package/dist/collections/collection-panel.js +1 -1
  246. package/dist/collections/collections.js +1 -1
  247. package/dist/collections/host.js +1 -1
  248. package/dist/collections/locales.js +1 -1
  249. package/dist/collections/model.js +1 -1
  250. package/dist/collections/store.js +1 -1
  251. package/dist/composer/completion-filter.js +1 -1
  252. package/dist/composer/completion-menu.js +1 -1
  253. package/dist/composer/completion-trigger.js +1 -1
  254. package/dist/composer/effort-slider.js +1 -1
  255. package/dist/composer/inline-document.js +1 -1
  256. package/dist/composer/inline-dom.js +1 -1
  257. package/dist/composer/menu-radio.js +1 -1
  258. package/dist/composer/model-select.js +1 -1
  259. package/dist/composer/permission-mode-select.js +1 -1
  260. package/dist/composer/prompt-input-attachments.js +1 -1
  261. package/dist/composer/prompt-input-clipboard.js +1 -1
  262. package/dist/composer/prompt-input-context.js +1 -1
  263. package/dist/composer/prompt-input-inline.js +1 -1
  264. package/dist/composer/prompt-input-textarea.js +1 -1
  265. package/dist/composer/prompt-input.js +1 -1
  266. package/dist/conversation/action-card.js +1 -1
  267. package/dist/conversation/composer/app-mentions.js +1 -1
  268. package/dist/conversation/composer/apps-menu.js +1 -1
  269. package/dist/conversation/composer/composer-menu.js +1 -1
  270. package/dist/conversation/composer/composer.js +1 -1
  271. package/dist/conversation/composer/config-options.js +1 -1
  272. package/dist/conversation/composer/context.js +1 -1
  273. package/dist/conversation/composer/drafts.js +1 -1
  274. package/dist/conversation/composer/file-items.js +1 -1
  275. package/dist/conversation/composer/long-text.js +1 -1
  276. package/dist/conversation/composer/mention-chips.js +1 -1
  277. package/dist/conversation/composer/mention-uri.js +1 -1
  278. package/dist/conversation/composer/model-menu.js +1 -1
  279. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  280. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  281. package/dist/conversation/composer/prediction.js +1 -1
  282. package/dist/conversation/composer/prompt-history.js +1 -1
  283. package/dist/conversation/composer/slash-command-button.js +1 -1
  284. package/dist/conversation/composer/submit-button.js +1 -1
  285. package/dist/conversation/composer/usage-meter.js +1 -1
  286. package/dist/conversation/connection-notice.js +1 -1
  287. package/dist/conversation/context.js +1 -1
  288. package/dist/conversation/conversation-body.js +1 -1
  289. package/dist/conversation/conversation-search.js +1 -1
  290. package/dist/conversation/conversation-view.js +1 -1
  291. package/dist/conversation/conversation.js +1 -1
  292. package/dist/conversation/diff-modal.js +1 -1
  293. package/dist/conversation/draft-project-picker.js +1 -1
  294. package/dist/conversation/session-actions.js +1 -1
  295. package/dist/conversation/subagent-sessions.js +1 -1
  296. package/dist/conversation/subagent-tasks.js +1 -1
  297. package/dist/desktop/desktop-composer.js +1 -1
  298. package/dist/desktop/desktop.js +1 -1
  299. package/dist/desktop/draft-model-select.js +1 -1
  300. package/dist/desktop/load-image.js +1 -1
  301. package/dist/desktop/model-catalog.js +1 -1
  302. package/dist/desktop/model-recovery.js +1 -1
  303. package/dist/desktop/model-settings-action.js +1 -1
  304. package/dist/desktop/native-file-drop.js +1 -1
  305. package/dist/generated/commands.js +1 -1
  306. package/dist/image-lightbox.js +1 -1
  307. package/dist/image-preview-dialog.js +1 -1
  308. package/dist/image.js +1 -1
  309. package/dist/lib/app-reference.js +1 -1
  310. package/dist/lib/application-metadata.js +1 -1
  311. package/dist/lib/chat-path.js +1 -1
  312. package/dist/lib/code-highlighter.js +1 -1
  313. package/dist/lib/file-url.js +1 -1
  314. package/dist/lib/fuzzy.js +1 -1
  315. package/dist/lib/group-blocks.js +1 -1
  316. package/dist/lib/image-encode.js +1 -1
  317. package/dist/lib/limits.js +1 -1
  318. package/dist/lib/markdown-parser.js +1 -1
  319. package/dist/lib/markdown-rules.js +1 -1
  320. package/dist/lib/model-name.js +1 -1
  321. package/dist/lib/prepare-prompt-files.js +1 -1
  322. package/dist/lib/reference-presentation.js +1 -1
  323. package/dist/lib/stream-style.js +1 -1
  324. package/dist/lib/streaming-markdown.js +1 -1
  325. package/dist/lib/tool-artifacts.js +1 -1
  326. package/dist/locales.js +1 -1
  327. package/dist/mermaid/diagram.js +1 -1
  328. package/dist/mermaid/export.js +1 -1
  329. package/dist/mermaid/index.js +1 -1
  330. package/dist/mermaid/preview.js +1 -1
  331. package/dist/oauth/claude-login.js +1 -1
  332. package/dist/oauth.js +1 -1
  333. package/dist/plugins/catalog-header.js +1 -1
  334. package/dist/plugins/catalog-skeleton.js +1 -1
  335. package/dist/plugins/host.js +1 -1
  336. package/dist/plugins/new-chat-directory.js +1 -1
  337. package/dist/plugins/panel-item.js +1 -1
  338. package/dist/plugins/plugin-detail-page.js +1 -1
  339. package/dist/plugins/plugin-icon.js +1 -1
  340. package/dist/plugins/plugin-icons.js +1 -1
  341. package/dist/plugins/plugins-page.js +1 -1
  342. package/dist/plugins/plugins.js +1 -1
  343. package/dist/plugins/read-skill-document.js +1 -1
  344. package/dist/plugins/skill-document.js +1 -1
  345. package/dist/plugins/skills-tab.js +1 -1
  346. package/dist/plugins/store.d.ts +1 -0
  347. package/dist/plugins/store.js +1 -1
  348. package/dist/plugins/toolbox-layout.js +1 -1
  349. package/dist/reference-projection.js +1 -1
  350. package/dist/search/chat-search.js +1 -1
  351. package/dist/search/codex-source-matches.js +1 -1
  352. package/dist/search/dom-matches.js +1 -1
  353. package/dist/search/find-bar.js +1 -1
  354. package/dist/search/literal-matches.js +1 -1
  355. package/dist/session-list/account-menu.js +1 -1
  356. package/dist/session-list/activity-list.js +1 -1
  357. package/dist/session-list/archived-sessions.js +1 -1
  358. package/dist/session-list/help-menu.js +1 -1
  359. package/dist/session-list/highlight.js +1 -1
  360. package/dist/session-list/host.js +1 -1
  361. package/dist/session-list/hover-info-card.js +1 -1
  362. package/dist/session-list/locales.js +1 -1
  363. package/dist/session-list/navigation-controls.js +1 -1
  364. package/dist/session-list/navigation-header.js +1 -1
  365. package/dist/session-list/navigation-store.js +1 -1
  366. package/dist/session-list/navigation-tabs.js +1 -1
  367. package/dist/session-list/navigation.js +1 -1
  368. package/dist/session-list/platform.js +1 -1
  369. package/dist/session-list/row-stop-button.js +1 -1
  370. package/dist/session-list/session-groups.js +1 -1
  371. package/dist/session-list/session-info-card.js +1 -1
  372. package/dist/session-list/session-list.js +1 -1
  373. package/dist/session-list/session-row.js +1 -1
  374. package/dist/session-list/session-state-dot.js +1 -1
  375. package/dist/session-list/session-state-menu.js +1 -1
  376. package/dist/session-list/shortcut-hint.js +1 -1
  377. package/dist/session-list/shortcut.js +1 -1
  378. package/dist/session-list/sidebar-overlay.js +1 -1
  379. package/dist/session-list/trailing-swap.js +1 -1
  380. package/dist/session-list/use-activity-notification.js +1 -1
  381. package/dist/session-list/use-activity-preview.js +1 -1
  382. package/dist/session-list/use-cmd-held.js +1 -1
  383. package/dist/session-list/use-project-sessions.js +1 -1
  384. package/dist/session-list/virtual-session-rows.js +1 -1
  385. package/dist/session-timeline/activity-group.js +1 -1
  386. package/dist/session-timeline/activity-projection.js +1 -1
  387. package/dist/session-timeline/assistant-content.js +1 -1
  388. package/dist/session-timeline/assistant-image-references.js +1 -1
  389. package/dist/session-timeline/assistant-turn.js +1 -1
  390. package/dist/session-timeline/async-questions.js +1 -1
  391. package/dist/session-timeline/edited-files-card.js +1 -1
  392. package/dist/session-timeline/history-timeline.js +1 -1
  393. package/dist/session-timeline/host.js +1 -1
  394. package/dist/session-timeline/image-generation-progress.js +1 -1
  395. package/dist/session-timeline/navigation-rail.js +1 -1
  396. package/dist/session-timeline/plan.js +1 -1
  397. package/dist/session-timeline/question-reply.js +1 -1
  398. package/dist/session-timeline/resource-content.js +1 -1
  399. package/dist/session-timeline/session-timeline.js +1 -1
  400. package/dist/session-timeline/timeline-registry.js +1 -1
  401. package/dist/session-timeline/turn-activity.js +1 -1
  402. package/dist/session-timeline/turn-error.js +1 -1
  403. package/dist/session-timeline/turn-retry.js +1 -1
  404. package/dist/session-timeline/turn-time.js +1 -1
  405. package/dist/session-timeline/turns.js +1 -1
  406. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  407. package/dist/session-timeline/user-message.js +1 -1
  408. package/dist/settings/codex-account-card.js +1 -1
  409. package/dist/settings/login-card.js +1 -1
  410. package/dist/settings/model-alias-settings.js +1 -1
  411. package/dist/settings/model-aliases.js +1 -1
  412. package/dist/settings/provider-logos.js +1 -1
  413. package/dist/settings/provider-section.js +1 -1
  414. package/dist/settings/providers-port.js +1 -1
  415. package/dist/settings/providers.js +1 -1
  416. package/dist/settings/settings-bridge.js +1 -1
  417. package/dist/settings/settings.js +1 -1
  418. package/native/win32-x64/alwith_native_chat.dll +0 -0
  419. package/native/win32-x64/artifact.json +1 -1
  420. package/package.json +1 -1
  421. package/dist/chunk-0rte5dh6.js +0 -2
  422. package/dist/chunk-1a56svgj.js +0 -2
  423. package/dist/chunk-1hmt6w4w.js +0 -2
  424. package/dist/chunk-2c2a1wvg.js +0 -2
  425. package/dist/chunk-2ee48v0d.js +0 -3
  426. package/dist/chunk-2nb1475h.js +0 -2
  427. package/dist/chunk-3gnn1v68.js +0 -2
  428. package/dist/chunk-3rmwcar7.js +0 -2
  429. package/dist/chunk-41yz7txv.js +0 -2
  430. package/dist/chunk-6dnb0t84.js +0 -2
  431. package/dist/chunk-6ehhap9k.js +0 -2
  432. package/dist/chunk-6tj5e7fc.js +0 -2
  433. package/dist/chunk-7sp1yqfg.js +0 -2
  434. package/dist/chunk-81jejgvs.js +0 -2
  435. package/dist/chunk-85tzkdsj.js +0 -2
  436. package/dist/chunk-ayademz2.js +0 -2
  437. package/dist/chunk-b42vv8f2.js +0 -2
  438. package/dist/chunk-bfwft1b8.js +0 -2
  439. package/dist/chunk-c0mpr4dh.js +0 -2
  440. package/dist/chunk-een4e2tr.js +0 -2
  441. package/dist/chunk-ehpaw624.js +0 -4
  442. package/dist/chunk-f7m5zdkp.js +0 -2
  443. package/dist/chunk-gyw21vnb.js +0 -2
  444. package/dist/chunk-jq6qs3s6.js +0 -2
  445. package/dist/chunk-k99r1r38.js +0 -2
  446. package/dist/chunk-mg7kraha.js +0 -2
  447. package/dist/chunk-mqpkm974.js +0 -2
  448. package/dist/chunk-n6dqwdg5.js +0 -2
  449. package/dist/chunk-p781sb6h.js +0 -2
  450. package/dist/chunk-q9y0wjwp.js +0 -2
  451. package/dist/chunk-qejm75d7.js +0 -2
  452. package/dist/chunk-r6c9r5yy.js +0 -2
  453. package/dist/chunk-rx84h0c2.js +0 -2
  454. package/dist/chunk-s2706gae.js +0 -2
  455. package/dist/chunk-sgbn37kz.js +0 -2
  456. package/dist/chunk-tcs1a1hk.js +0 -2
  457. package/dist/chunk-wnydsth6.js +0 -2
  458. package/dist/chunk-x1mzrhtd.js +0 -2
  459. package/dist/chunk-y6p8xspr.js +0 -2
  460. package/dist/chunk-yc4cdg65.js +0 -2
@@ -1,2 +1,2 @@
1
- import{Tr,Fe}from"./chunk-gyw21vnb.js";import{Pr}from"./chunk-3a3ecayr.js";import{To,Mo,Tt,Mt,No}from"./chunk-86821qec.js";import{cn as P}from"cn";import{ArrowUpIcon as ge,Loader2Icon as be,SquareIcon as ve,XIcon as he}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as Pe,useRef as M,useState as Ie}from"react";import{flushSync as ye}from"react-dom";import{InputGroup as xe,InputGroupAddon as ee,InputGroupButton as te}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as a,jsxs as Le}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var br=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:re,globalDrop:C,syncHiddenInput:U,maxFiles:H,maxFileSize:k,onError:b,onSubmit:ne,children:oe,...se})=>{let s=Mt(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),D=M(!1),[ae,N]=Ie([]),c=l?s.attachments.files:ae,B=M(c);B.current=c;let ue=h(()=>{x.current?.click()},[]),O=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),W=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((i)=>O(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>k?i.size<=k:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}N((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof H==="number"?Math.max(0,H-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:W(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,W,O,H,k,b]),pe=h((e)=>N((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>N((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),G=l?s.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Tr(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${Fe}MB.`});return}}G(r)},[c,G,b]),j=l?s.attachments.remove:pe,R=l?s.attachments.clear:me,q=l?s.attachments.openFileDialog:ue;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(U&&x.current&&c.length===0)x.current.value=""},[c,U]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of B.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},X=Pe(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:j,clear:R,openFileDialog:q,fileInputRef:x}),[c,L,j,R,q]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let J=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(D.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();R()};D.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Pr(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ne({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{D.current=!1}},de=(e)=>{e.preventDefault(),J(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)ye(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),K=a(Mo.Provider,{value:()=>J(null),children:Le(To.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:re,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(xe,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return l?a(Tt.Provider,{value:X,children:K}):a(No.Provider,{value:X,children:K})};function Cr({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function wr({className:u,...o}){return a(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function kr({className:u,...o}){return a(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Sr({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var z=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},_r=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(ge,{className:"size-4"});if(d==="submitted")g=a(be,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(ve,{className:"size-3 fill-current"});else if(d==="error")g=a(he,{className:"size-4"});return a(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
2
- export{br,Cr,wr,kr,Sr,z,_r};
1
+ import{cr,Ve}from"./chunk-gs0b02g2.js";import{ar}from"./chunk-z6x70w62.js";import{bo,Co,Tt,Mt,wo}from"./chunk-zzjth6f2.js";import{cn as P}from"cn";import{ArrowUpIcon as ge,Loader2Icon as be,SquareIcon as ve,XIcon as he}from"lucide-react";import{Children as Y,useCallback as h,useEffect as F,useMemo as Pe,useRef as M,useState as Ie}from"react";import{flushSync as ye}from"react-dom";import{InputGroup as xe,InputGroupAddon as ee,InputGroupButton as te}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as a,jsxs as Le}from"react/jsx-runtime";function Z(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var tr=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:re,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:ne,children:oe,...se})=>{let s=Mt(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ae,D]=Ie([]),c=l?s.attachments.files:ae,U=M(c);U.current=c;let ue=h(()=>{x.current?.click()},[]),B=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),O=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((i)=>B(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let T of _){let V=I?.sourcePath(T);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:O(T),filename:T.name,size:T.size,lastModified:T.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...i,...Q]})},[I,O,B,z,H,b]),pe=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=l?s.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(cr(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${Ve}MB.`});return}}W(r)},[c,W,b]),G=l?s.attachments.remove:pe,N=l?s.attachments.clear:me,q=l?s.attachments.openFileDialog:ue;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(R&&x.current&&c.length===0)x.current.value=""},[c,R]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of U.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},X=Pe(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:G,clear:N,openFileDialog:q,fileInputRef:x}),[c,L,G,N,q]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let J=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Z(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await ar(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ne({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},de=(e)=>{e.preventDefault(),J(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)ye(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),K=a(Co.Provider,{value:()=>J(null),children:Le(bo.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:re,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(xe,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return l?a(Tt.Provider,{value:X,children:K}):a(wo.Provider,{value:X,children:K})};function nr({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function or({className:u,...o}){return a(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function ir({className:u,...o}){return a(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function rr({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var j=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||Y.count(y.children)<=1?"icon-xs":"xs";return a(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||Y.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},sr=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(ge,{className:"size-4"});if(d==="submitted")g=a(be,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(ve,{className:"size-3 fill-current"});else if(d==="error")g=a(he,{className:"size-4"});return a(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
2
+ export{tr,nr,or,ir,rr,j,sr};
@@ -1,2 +1,2 @@
1
- import{xe}from"./chunk-f73x23f9.js";import{C}from"./chunk-rx84h0c2.js";import{t,ae}from"./chunk-pdmayjan.js";import{isEmbeddedResource as T,isImage as N,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as U,FileIcon as y,ImageOffIcon as z,LoaderCircleIcon as j}from"lucide-react";import{useState as I}from"react";import{Button as c}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function Kn(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function Uo(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function F({block:e,generated:r=!1}){let a=t(),[d,f]=I(!1),[R,B]=I(null);if(L(e)){let p=C(e.uri);if(p!==null)return n(xe,{app:{id:p,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(z,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=Kn(e.uri);return s(c,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(y,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!N(e))return null;let i=N(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=Kn(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(c,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(y,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:x}=a,v=x?()=>x([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else Uo(o,m)}catch(p){ae(a,p)}finally{f(!1)}},h=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(v===void 0?h:n(c,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:v,children:h})),s(c,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(j,{className:"motion-safe:animate-spin"}):n(U,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
2
- export{Kn,Uo,F};
1
+ import{xe}from"./chunk-d9mj74pb.js";import{C}from"./chunk-swkcmtme.js";import{t,ae}from"./chunk-73e9vpm9.js";import{isEmbeddedResource as T,isImage as N,isResourceLink as L}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as F,FileIcon as y,ImageOffIcon as U,LoaderCircleIcon as z}from"lucide-react";import{useState as I}from"react";import{Button as c}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function qn(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function jo(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function D({block:e,generated:r=!1}){let a=t(),[d,f]=I(!1),[R,B]=I(null);if(L(e)){let p=C(e.uri);if(p!==null)return n(xe,{app:{id:p,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(U,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=qn(e.uri);return s(c,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(y,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!N(e))return null;let i=N(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=qn(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(c,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(y,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:x}=a,v=x?()=>x([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else jo(o,m)}catch(p){ae(a,p)}finally{f(!1)}},h=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(v===void 0?h:n(c,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:v,children:h})),s(c,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(z,{className:"motion-safe:animate-spin"}):n(F,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
2
+ export{qn,jo,D};
@@ -1,2 +1,2 @@
1
- function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function cn(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
- export{cn};
1
+ function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function dn(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
+ export{dn};
@@ -1,2 +1,2 @@
1
- import{Bn,_o}from"./chunk-cvx7r35k.js";import{hr}from"./chunk-3chhwwwy.js";import{CodexClient as p}from"@nyssance/codex-acp-v2/client";class Co extends p{applicationRegistry=new _o((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=Bn(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 hr((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{Co};
1
+ import{Rn,po}from"./chunk-evpjxbzm.js";import{Vi}from"./chunk-jpr5ewnh.js";import{CodexClient as p}from"@nyssance/codex-acp-v2/client";class lo 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=Rn(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 Vi((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{lo};
@@ -1,5 +1,5 @@
1
- import{jo}from"./chunk-6my4ybpw.js";import{t}from"./chunk-pdmayjan.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function Ta(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
- `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Ma(o){let s=new Map,e=null;for(let n of o.split(`
3
- `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Na(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Ma(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?Ta(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
- ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function Ci({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(jo,{files:Na(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
- export{Ta,Ma,Na,Ci};
1
+ import{Ao}from"./chunk-qma11tpm.js";import{t}from"./chunk-73e9vpm9.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function La(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
+ `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Da(o){let s=new Map,e=null;for(let n of o.split(`
3
+ `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Fa(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Da(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?La(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
+ ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function Tr({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(Ao,{files:Fa(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
+ export{La,Da,Fa,Tr};
@@ -1,2 +1,2 @@
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
+ import{cn as i}from"cn";import{jsx as t,jsxs as s}from"react/jsx-runtime";var gt="group/trailing";function Je({children:n,className:e}){return t("span",{className:i("flex w-5 shrink-0 items-center justify-center whitespace-nowrap",e),children:n})}function ft({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{gt,Je,ft};
@@ -0,0 +1,2 @@
1
+ var la={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function _i(e){return[...e].toSorted((o,n)=>(la[o.kind]??99)-(la[n.kind]??99))}function $a(e){return e==="allow_once"||e==="allow_always"}function qa(e){return e==="allow_always"||e==="reject_always"}
2
+ export{la,_i,$a,qa};
@@ -1,2 +1,2 @@
1
- async function hr(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{hr};
1
+ async function Vi(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{Vi};
@@ -1,2 +1,2 @@
1
- import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function As(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function Es(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function Rs(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
- export{As,Es,Rs};
1
+ import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function qs(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function Ks(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function Ws(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
+ export{qs,Ks,Ws};
@@ -1,2 +1,2 @@
1
- var I={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
- export{I};
1
+ var T={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
+ export{T};
@@ -1,2 +1,2 @@
1
- var l=/(?::\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?|#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?)$/;function s(t){return t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(String.raw`\\`)}function Ko(t,o){let e=/^[^/\\:]+:\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?$/.test(t);if(/^[a-z][a-z\d+.-]*:/i.test(t)&&!e||s(t))return t;if(t.startsWith("www."))return`https://${t}`;if(o===null)throw Error("The conversation's directory is unavailable");return`${encodeURI(o.replace(/[\\/]$/,"")).replaceAll(/[?#]/g,encodeURIComponent)}/${t}`}function fs(t,o){let e=Ko(t,o),n;if(/^file:/i.test(e)){let r=new URL(e);if(n=decodeURIComponent(r.pathname),/^\/[A-Za-z]:\//.test(n))n=n.slice(1);if(r.hostname&&r.hostname!=="localhost")n=`//${r.hostname}${n}`}else if(s(e))try{n=decodeURI(e)}catch(r){if(!(r instanceof URIError))throw r;n=e}else return null;return n.replace(l,"")}function hs(t,o){let e=(i)=>i.replaceAll("\\","/").replace(/\/+$/,""),n=e(t),r=e(o);return r===n||r.startsWith(`${n}/`)}function vs(t,o){if(/^file:/i.test(t)){let e=new URL(t),n=decodeURIComponent(e.pathname);if(/^\/[A-Za-z]:\//.test(n))n=n.slice(1);if(e.hostname&&e.hostname!=="localhost")n=`//${e.hostname}${n}`;return n}if(s(t))return t;if(o===null)throw Error("The conversation's directory is unavailable");return`${o.replace(/[\\/]$/,"")}/${t}`}
2
- export{Ko,fs,hs,vs};
1
+ var l=/(?::\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?|#L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?)$/;function s(t){return t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(String.raw`\\`)}function Bo(t,o){let e=/^[^/\\:]+:\d+(?::\d+)?(?:[-–]\d+(?::\d+)?)?$/.test(t);if(/^[a-z][a-z\d+.-]*:/i.test(t)&&!e||s(t))return t;if(t.startsWith("www."))return`https://${t}`;if(o===null)throw Error("The conversation's directory is unavailable");return`${encodeURI(o.replace(/[\\/]$/,"")).replaceAll(/[?#]/g,encodeURIComponent)}/${t}`}function Xr(t,o){let e=Bo(t,o),n;if(/^file:/i.test(e)){let r=new URL(e);if(n=decodeURIComponent(r.pathname),/^\/[A-Za-z]:\//.test(n))n=n.slice(1);if(r.hostname&&r.hostname!=="localhost")n=`//${r.hostname}${n}`}else if(s(e))try{n=decodeURI(e)}catch(r){if(!(r instanceof URIError))throw r;n=e}else return null;return n.replace(l,"")}function Yr(t,o){let e=(i)=>i.replaceAll("\\","/").replace(/\/+$/,""),n=e(t),r=e(o);return r===n||r.startsWith(`${n}/`)}function es(t,o){if(/^file:/i.test(t)){let e=new URL(t),n=decodeURIComponent(e.pathname);if(/^\/[A-Za-z]:\//.test(n))n=n.slice(1);if(e.hostname&&e.hostname!=="localhost")n=`//${e.hostname}${n}`;return n}if(s(t))return t;if(o===null)throw Error("The conversation's directory is unavailable");return`${o.replace(/[\\/]$/,"")}/${t}`}
2
+ export{Bo,Xr,Yr,es};
@@ -1,2 +1,2 @@
1
- import{ms}from"./chunk-hygvdjq6.js";function ls(t,o){if(ms(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
- export{ls};
1
+ import{Rr}from"./chunk-agdkhyaj.js";function Pr(t,o){if(Rr(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
+ export{Pr};
@@ -0,0 +1,3 @@
1
+ import{u}from"./chunk-stv8pr4v.js";import{N,f}from"./chunk-s6medm3z.js";import{Bt}from"./chunk-8q5zwkry.js";import{Ke,d,We,lt,i}from"./chunk-kqvgmkvr.js";import{q,K,le,W,Z,ke,zt}from"./chunk-nhkm2gr7.js";import{we}from"./chunk-7p7fxgdb.js";import{ct}from"./chunk-ne4b53kn.js";import{k}from"./chunk-qk1yqepm.js";import{jt,B}from"./chunk-5gn8xw58.js";import{Q,Pe}from"./chunk-pqz2471h.js";import{Vt}from"./chunk-fdmbfq9g.js";import{Gt}from"./chunk-0jpzztpz.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as _,PuzzleIcon as oe,RefreshCwIcon as re,SearchIcon as ce,Trash2Icon as de,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as V,useMemo as G,useState as I}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ye,DropdownMenuContent as be,DropdownMenuItem as Ce,DropdownMenuTrigger as Ie}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as U}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Se}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function z(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function De({plugin:t,marketplace:r}){let{t:m}=d(),p=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=m(p?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!p)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(y,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:p||a||c,"aria-label":o,title:c?m("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:p?e(E,{"aria-hidden":"true"}):e(_,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Me({plugin:t,marketplace:r,actions:m,onOpen:p}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(ke,{className:"toolbox-row relative",children:[e(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":z(t),onClick:()=>p({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(B,{name:t.name})})}),s(K,{className:"pointer-events-none relative min-w-0",children:[e(zt,{className:"mb-0.5",children:z(t)}),e(le,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(le,{"data-toolbox-metadata":"",children:o})]}),e(q,{className:"relative w-8 shrink-0 justify-center",children:m})]})}function H(){return lt((t)=>t.connection==="ready"&&ee(t.agent))}var D=48;function Ee({marketplace:t,plugins:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.removeMarketplace),[g,c]=I(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/D)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ye,{children:[e(Ie,{render:e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":p("plugins.pageActions")}),children:e(ie,{})}),e(be,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ce,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(de,{className:"size-3.5"}),p("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*D,(o+1)*D).map((n)=>e(Me,{onOpen:m,plugin:n,marketplace:t,actions:e(De,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>D&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(y,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:p("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/D)]}),e(y,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*D>=r.length,onClick:()=>c(o+1),children:p("plugins.nextPage")})]})]},t.name)}var ze=ue(function({query:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=G(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,z(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),o=G(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:b,text:P})=>r===""?v.path!==null||n.has(b.id):P.includes(r)).map(({plugin:b})=>b)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(Ee,{marketplace:n,plugins:v,onOpen:m},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:p("plugins.empty")})]})});function Oe(){let{t}=d(),r=H(),m=i((h)=>h.addMarketplace),p=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=I(""),[o,n]=I(!1),[v,x]=I(!1),[b,P]=I(null),O=async()=>{let h=g.trim();if(!h||o)return;n(!0),P(null);try{await m({source:h}),c(""),x(!1)}catch(S){P(S instanceof Error?S.message:String(S))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(y,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void p(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(y,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(_,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),O()},children:[e(Se,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(U,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),b&&e("p",{role:"alert",className:"text-destructive text-sm",children:b}),s("div",{className:"flex justify-end gap-2",children:[e(y,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(y,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Be({onOpen:t,query:r}){let m=H(),p=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!m,g=pe(r.trim().toLowerCase());return e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[p.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(we,{}):e(ze,{query:g,onOpen:t})]})})}function Is({cwd:t,active:r,extensions:m,onOpenCatalog:p}){let{t:a}=d(),g=We(),c=Ke(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,b]=I("plugins"),[P,O]=I({plugins:"",skills:""}),h=x==="skills"?P.skills:P.plugins,S=(l)=>O((M)=>({...M,[x]:l})),Y=lt((l)=>JSON.stringify([...new Set(l.sessionList.map((M)=>ct(M.cwd,l.projectContext)).filter((M)=>M!==null))].toSorted())),T=JSON.stringify([...new Set([ct(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),A=i((l)=>l.installed),R=a(x==="skills"?"plugins.skills.search":"plugins.search"),[w,j]=I(null),C=H();V(()=>{if(!r||!C)return;if(c.getState().loadedScope!==T)o(JSON.parse(T))},[r,C,o,T,c]),V(()=>{if(!C)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0,catalog:!1}))},[C,o,g]);let L=(l)=>{p?.(),b("plugins"),j(l)},J=(l)=>{p?.(),b(l),j(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(jt,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[m&&s(f,{className:`${u} h-8 gap-2 px-2`,active:m.active,onClick:m.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${u} h-8 gap-2 px-2`,active:!m?.active&&x===l&&w===null,onClick:()=>J(l),children:[l==="plugins"?e(oe,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(k,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(N,{children:!C||n&&A.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):A.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):A.map((l)=>s(f,{title:z(l.plugin),className:`${u} gap-2 px-2`,active:!m?.active&&w?.plugin.id===l.plugin.id,onClick:()=>L(l),children:[e(B,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:z(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:m?.active?m.content:s(X,{children:[w&&e(Vt,{entry:w,onBack:()=>J("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(Pe,{children:e(Bt,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(ce,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(U,{className:"h-9 rounded-full ps-9 pe-9","aria-label":R,value:h,onChange:(l)=>S(l.target.value),placeholder:R}),h&&e(y,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>S(""),children:e(me,{})})]}),e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(re,{})}),x==="plugins"&&e(Oe,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(y,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Be,{query:P.plugins,onOpen:L})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Gt,{query:P.skills,ready:C,onOpenPlugin:L})})]})]})]})})]})}
3
+ export{Is};
@@ -1,2 +1,2 @@
1
- import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function zr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function il(){c()}function Vr(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function jr(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Sa(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function rl(e,n,t,i,o,a){if(a==="none")return;_(o,[Sa(e,n,t,i,a)])}function Sa(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ua(t,i);return _a(e,n)}function Ua(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function _a(e,n){return y+Ba(e,n)}function sl(e,n){return D(_a(e,n))}function Ba(e,n){if(n<=l)return Ga(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Ga(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function al(){return r.context?.state}function ll(e){return g(e).ready}
2
- export{zr,il,Vr,jr,rl,Sa,Ua,_a,sl,Ba,Ga,al,ll};
1
+ import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function zr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function ll(){c()}function Vr(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function jr(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Sa(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function cl(e,n,t,i,o,a){if(a==="none")return;_(o,[Sa(e,n,t,i,a)])}function Sa(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ba(t,i);return _a(e,n)}function Ba(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function _a(e,n){return y+Ga(e,n)}function dl(e,n){return D(_a(e,n))}function Ga(e,n){if(n<=l)return za(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function za(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function ul(){return r.context?.state}function pl(e){return g(e).ready}
2
+ export{zr,ll,Vr,jr,cl,Sa,Ba,_a,dl,Ga,za,ul,pl};
@@ -0,0 +1,2 @@
1
+ import{$t}from"./chunk-7b5ryhwh.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 Ke(e){let t=r.get(e);if(!t)t=$t(e),r.set(e,t);return t}function Ts({host:e,client:t,children:n}){let s=Ke(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 We(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function lt(e){let t=We();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=Ke(We());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Ze(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{Ke,Ts,d,We,lt,i,Ze};
@@ -1,3 +1,3 @@
1
- import{Zr,Lt}from"./chunk-y8fmawc6.js";import{t,w}from"./chunk-pdmayjan.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:ei(e.patch,e.path)}})}function ei(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=w(c,(o)=>o.request),s=n===null?null:Zr(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,ei,Vt};
1
+ import{Ii,vt}from"./chunk-gttw4rmx.js";import{t,w}from"./chunk-73e9vpm9.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 an(e){c.setState({request:{path:e.path,patch:Ci(e.patch,e.path)}})}function Ci(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
2
+ `,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function ln(){let{t:e,theme:a}=t(),n=w(c,(o)=>o.request),s=n===null?null:Ii(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(vt,{patch:n.patch,theme:a})})]})})}
3
+ export{an,Ci,ln};
@@ -1,2 +1,2 @@
1
- import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Eo({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
- export{Eo};
1
+ import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Jn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
+ export{Jn};
@@ -1,2 +1,2 @@
1
- import{Xn}from"./chunk-ayademz2.js";async function ti(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function lt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Xn(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
- export{ti,lt};
1
+ import{_o}from"./chunk-sjb5stzq.js";async function vr(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Nt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of _o(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
+ export{vr,Nt};
@@ -1,2 +1,2 @@
1
- import{createStore as r}from"@alwith/api/client";var Je=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function wi(e){Je.setState({...e,terminals:e.terminals??{}})}function ki(e){if(Je.getState().sessionId===e)Je.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function Si(e,n,t){let i=Je.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
2
- export{Je,wi,ki,Si};
1
+ import{createStore as r}from"@alwith/api/client";var at=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function ts(e){at.setState({...e,terminals:e.terminals??{}})}function ns(e){if(at.getState().sessionId===e)at.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function os(e,n,t){let i=at.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
2
+ export{at,ts,ns,os};
@@ -1,3 +1,3 @@
1
- import{s,a,n}from"./chunk-6c18ag8t.js";import{it,he,re}from"./chunk-mqpkm974.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as ce}from"cn";import{ArchiveIcon as de,FolderIcon as Q,ListFilterIcon as ue,SearchIcon as me,Trash2Icon as U}from"lucide-react";import{useEffect as pe,useRef as fe,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as r}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:ce("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function fa({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=n((e)=>e.archivedSessions),N=n((e)=>e.connection),[B,X]=d(""),[y,Y]=d("all"),[p,Z]=d("all"),[ee,te]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=fe(!1),[D,f]=d(null),[O,b]=d(null),[se,G]=d(!1);pe(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let l=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(l.has(v))throw Error("Archive pagination returned a repeated cursor");l.add(v),await m.listArchived()}}catch(l){if(!e)F(E(l))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,ee]);let o=n((e)=>e.projectContext),k=!(o!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ie=[...new Set(S.filter((e)=>o&&j(o,e).id!==re).map((e)=>o?j(o,e).id:e.cwd))].toSorted(),ne=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=o?j(o,e).id:null,l=c===re;return L(e).toLocaleLowerCase(A.language).includes(ne)&&(y==="all"||(y==="quick"?l:!l))&&(p==="all"||(p==="quick"?l:c===p))}),ae=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function le(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function oe(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let l of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===l.sessionId))continue;try{await m.delete(l.sessionId)}catch(v){e.push(l),c.push(`${L(l)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
- `));else f(null)}finally{h.current=!1,w(!1)}}return r("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[r("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[r("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),r(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),r("div",{className:"flex shrink-0 flex-wrap gap-3",children:[r("div",{className:"relative min-w-48 flex-1",children:[t(me,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),r(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Y(e)},children:[r(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ue,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),r(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");Z(e)},children:[r(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):he(p,o??void 0)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ie.map((e)=>t(x,{value:e,title:e,children:he(e,o??void 0)},e))]})]})]}),r(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?r("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:r(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>te((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?r("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(de,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(o?it(K,o):[]).filter(([,e])=>e.length>0).map(([e,c])=>r("section",{className:"flex flex-col gap-3",children:[r("div",{className:"flex items-center justify-between gap-3",children:[r("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===re?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===re?i("sessionList.archives.noProject"):he(e,o??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((l)=>r("article",{"aria-label":L(l),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[r("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(l),children:L(l)}),l.updatedAt!==null&&t("time",{dateTime:l.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:ae.format(new Date(l.updatedAt))})]}),r("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([l])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void le(l),children:i("sessionList.archives.unarchive")})]})]},l.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(ve,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:r(ge,{showCloseButton:!C,children:[r(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(se?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),r(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),r(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void oe(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
- export{fa};
1
+ import{s,a,n}from"./chunk-bba9qej8.js";import{Qe,de,oe}from"./chunk-9x08kyf6.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as ce}from"cn";import{ArchiveIcon as ue,FolderIcon as Q,ListFilterIcon as me,SearchIcon as pe,Trash2Icon as U}from"lucide-react";import{useEffect as he,useRef as fe,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as r}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:ce("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function Bs({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=n((e)=>e.archivedSessions),N=n((e)=>e.connection),[B,X]=d(""),[y,Y]=d("all"),[p,Z]=d("all"),[ee,te]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=fe(!1),[D,f]=d(null),[O,b]=d(null),[se,G]=d(!1);he(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let l=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(l.has(v))throw Error("Archive pagination returned a repeated cursor");l.add(v),await m.listArchived()}}catch(l){if(!e)F(E(l))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,ee]);let o=n((e)=>e.projectContext),k=!(o!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ie=[...new Set(S.filter((e)=>o&&j(o,e).id!==oe).map((e)=>o?j(o,e).id:e.cwd))].toSorted(),ne=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=o?j(o,e).id:null,l=c===oe;return L(e).toLocaleLowerCase(A.language).includes(ne)&&(y==="all"||(y==="quick"?l:!l))&&(p==="all"||(p==="quick"?l:c===p))}),ae=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function re(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function le(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let l of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===l.sessionId))continue;try{await m.delete(l.sessionId)}catch(v){e.push(l),c.push(`${L(l)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
+ `));else f(null)}finally{h.current=!1,w(!1)}}return r("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[r("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[r("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),r(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),r("div",{className:"flex shrink-0 flex-wrap gap-3",children:[r("div",{className:"relative min-w-48 flex-1",children:[t(pe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),r(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Y(e)},children:[r(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(me,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),r(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");Z(e)},children:[r(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):de(p,o??void 0)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ie.map((e)=>t(x,{value:e,title:e,children:de(e,o??void 0)},e))]})]})]}),r(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?r("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:r(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>te((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?r("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(ue,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(o?Qe(K,o):[]).filter(([,e])=>e.length>0).map(([e,c])=>r("section",{className:"flex flex-col gap-3",children:[r("div",{className:"flex items-center justify-between gap-3",children:[r("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===oe?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===oe?i("sessionList.archives.noProject"):de(e,o??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((l)=>r("article",{"aria-label":L(l),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[r("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(l),children:L(l)}),l.updatedAt!==null&&t("time",{dateTime:l.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:ae.format(new Date(l.updatedAt))})]}),r("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([l])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void re(l),children:i("sessionList.archives.unarchive")})]})]},l.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(ve,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:r(ge,{showCloseButton:!C,children:[r(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(se?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),r(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),r(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void le(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
+ export{Bs};
@@ -1,4 +1,4 @@
1
- import{e}from"./chunk-abgdqy92.js";import{Wt}from"./chunk-gy4h86mw.js";import{A,xt,ie,_n}from"./chunk-38hvm5ca.js";import{bn,Ee}from"./chunk-3gnn1v68.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as se,EyeOffIcon as ne,PlusIcon as ge,ServerIcon as oe,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function oi({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ms({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=Ee(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(A[0]?.id??""),[F,B]=y(0),[U,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(A[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await bn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=A.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||E)return;k(A[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Wt,{bridge:d})]}),C&&t(oi,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(ii,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),A.map((o)=>t("div",{hidden:x!==o.id,children:t(si,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Yn,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Yn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function ii({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[A.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(oe,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function ri({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(ri,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function si({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(ie(s,d?.region)?.id),[U,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),z=_n(s,F),K=F!==ie(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(ie(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=F,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),B((g)=>g===G?ie(s,D?.region)?.id:g),M((g)=>g===U?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(se,{}):t(ne,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:ie(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>M(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Yn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
1
+ import{e}from"./chunk-esbgn8q0.js";import{Zt}from"./chunk-74b70n1g.js";import{R,Ct,se,Dn}from"./chunk-tdvx2n5m.js";import{Pn,Ue}from"./chunk-5jq3xg3q.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as j}from"cn";import{ChevronDownIcon as te,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as de,FieldLabel as _}from"@nyssance/shadcn/vega/components/ui/field";import{Input as Z}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as H,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as X}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Y(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function ai({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Y(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(F,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(F,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(X,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Zs({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Y(),h=(o)=>N.notify?.(o),c=Ue(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(R[0]?.id??""),[K,U]=y(0),[z,M]=y({}),J=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)M((L)=>{let G={...L};return delete G[r.id],G});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(M((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else M((a)=>{let L={...a};return delete L[r.id],L}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},E=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(R[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},B=async()=>{p("retry");try{let o=await Pn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=R.find((o)=>o.id===x)??null,A=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||A)return;k(R[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Zt,{bridge:d})]}),C&&t(ai,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(F,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void B(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(li,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),R.map((o)=>t("div",{hidden:x!==o.id,children:t(di,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>J(r,o,f),testResult:z[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Xn,{provider:o,revision:c.revision,busy:b!==null,testResult:z[o.id],onTest:()=>I(o.id),onRemove:()=>E(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Xn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},K)})]})})]})}function li({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[R.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(ee,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(ee,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(F,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:j("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function ee({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(F,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:j("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:j("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function ci({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(ci,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(F,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(F,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function di({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Y(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[K,U]=y(se(s,d?.region)?.id),[z,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),E=Dn(s,K),B=K!==se(s,x.saved?.region)?.id,P=z.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!B&&!P)k({saved:d,revision:u}),U(se(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,B,P]);let A=!v&&(T!==""||B||P),o=`${s.id}-api-key`,r=async(a)=>{let L=c,G=K,m=await C(x.revision,a);if(!m)return;let D=m.providers[s.id]??null;k({saved:D,revision:m.revision}),w((g)=>g===L?"":g),U((g)=>g===G?se(s,D?.region)?.id:g),M((g)=>g===z?D?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...K===void 0?{}:{region:K},...P?{baseUrl:z.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(J,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:K,onValueChange:(a)=>U(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(_,{htmlFor:o,children:n("provider.apiKey")}),E!==null&&i(F,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(E)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(H,{children:[t(q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&A)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(F,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(te,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(O,{className:"gap-2",children:[t(_,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(H,{children:t(q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:se(s,K)?.baseUrl??s.baseUrl,value:z,onChange:(a)=>M(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!A,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!A?S:void 0,children:i(F,{size:"sm",disabled:!A,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Xn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,K]=y(!1),[U,z]=y(s===null),[M,J]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
2
2
  { "label": "My Model", "api_id": "model-id" }
3
- ]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),L=(m)=>{if(!m)try{J(xt(I)),K(null)}catch(D){K(W(D));return}U(m)},G=async()=>{let m;try{m=xt(I),K(null)}catch(g){K(W(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(oe,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[t(_,{htmlFor:E,children:n("provider.name")}),t(Z,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:o,children:n("provider.baseUrl")}),t(Z,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:r,children:n("provider.apiKey")}),i(H,{children:[t(q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(se,{}):t(ne,{})})})]})]})]}),t(Q,{}),i(re,{open:B,onOpenChange:L,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(te,{className:j("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:M.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(O,{className:"gap-2","data-invalid":z!==null,children:[t(_,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:j("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void G(),children:[u&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
4
- export{oi,Ms,ii,ri,si,Yn};
3
+ ]`),[E,B]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),A=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),L=(m)=>{if(!m)try{J(Ct(I)),B(null)}catch(D){B(W(D));return}z(m)},G=async()=>{let m;try{m=Ct(I),B(null)}catch(g){B(W(g)),z(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(O,{className:"gap-2",children:[t(_,{htmlFor:A,children:n("provider.name")}),t(Z,{id:A,value:h,onChange:(m)=>c(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:o,children:n("provider.baseUrl")}),t(Z,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(O,{className:"gap-2",children:[t(_,{htmlFor:r,children:n("provider.apiKey")}),i(H,{children:[t(q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>K((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(Q,{}),i(re,{open:U,onOpenChange:L,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(F,{variant:"ghost",size:"sm"}),children:[n(U?"provider.previewModels":"provider.editModels"),t(te,{className:j("size-4",U&&"rotate-180")})]})]}),!U&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:M.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(O,{className:"gap-2","data-invalid":E!==null,children:[t(_,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":E!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),B(null)}}),t(de,{id:`${f}-description`,className:j("text-xs",E&&"text-destructive"),role:E?"alert":void 0,children:E??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(F,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void G(),children:[u&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
4
+ export{ai,Zs,li,ci,di,Xn};
@@ -1,2 +1,2 @@
1
- import{invoke as i}from"@tauri-apps/api/core";import{emit as t,emitTo as n,listen as s,once as a}from"@tauri-apps/api/event";var u={providersRead:()=>i("plugin:alwith-chat|providers_read"),providersSave:(e)=>i("plugin:alwith-chat|providers_save",e),providersSaveCustom:(e)=>i("plugin:alwith-chat|providers_save_custom",e),providersRemoveCustom:(e)=>i("plugin:alwith-chat|providers_remove_custom",e),providersTest:(e)=>i("plugin:alwith-chat|providers_test",e),providersApply:()=>i("plugin:alwith-chat|providers_apply"),providersAccountBind:(e)=>i("plugin:alwith-chat|providers_account_bind",e),providersRefreshManaged:(e)=>i("plugin:alwith-chat|providers_refresh_managed",e),providersClearManaged:()=>i("plugin:alwith-chat|providers_clear_managed"),readSkillDocument:(e)=>i("plugin:alwith-chat|read_skill_document",e),sessionsList:(e)=>i("plugin:alwith-chat|sessions_list",e),sessionsCountTypes:(e)=>i("plugin:alwith-chat|sessions_count_types",e),sessionsPersonaEvidence:(e)=>i("plugin:alwith-chat|sessions_persona_evidence",e),getModelPricing:()=>i("plugin:alwith-chat|get_model_pricing"),scanSessionAggregates:(e)=>i("plugin:alwith-chat|scan_session_aggregates",e),exportWeekSessions:()=>i("plugin:alwith-chat|export_week_sessions"),dailyTokenUsage:(e)=>i("plugin:alwith-chat|daily_token_usage",e),downloadUsageJson:(e)=>i("plugin:alwith-chat|download_usage_json",e),wordCloud:(e)=>i("plugin:alwith-chat|word_cloud",e),readDroppedFile:(e)=>i("plugin:alwith-chat|read_dropped_file",e),clipboardFilePaths:()=>i("plugin:alwith-chat|clipboard_file_paths"),writePastedFile:(e)=>i("plugin:alwith-chat|write_pasted_file",e),readImage:(e)=>i("plugin:alwith-chat|read_image",e),saveFile:(e)=>i("plugin:alwith-chat|save_file",e),writeTextAttachment:(e)=>i("plugin:alwith-chat|write_text_attachment",e),previewFile:(e)=>i("plugin:alwith-chat|preview_file",e)},po={"providers:changed":{name:"providers:changed",listen:(e)=>s("providers:changed",e),once:(e)=>a("providers:changed",e),emit:(e)=>t("providers:changed",e),emitTo:(e,r)=>n(e,"providers:changed",r)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>s("providers:managed-revoked",e),once:(e)=>a("providers:managed-revoked",e),emit:(e)=>t("providers:managed-revoked",e),emitTo:(e,r)=>n(e,"providers:managed-revoked",r)}};function Da(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function Wa(e){if(Da(e)||e instanceof Error)return e.message;return String(e)}
2
- export{u,po,Da,Wa};
1
+ import{invoke as i}from"@tauri-apps/api/core";import{emit as t,emitTo as n,listen as s,once as a}from"@tauri-apps/api/event";var p={providersRead:()=>i("plugin:alwith-chat|providers_read"),providersSave:(e)=>i("plugin:alwith-chat|providers_save",e),providersSaveCustom:(e)=>i("plugin:alwith-chat|providers_save_custom",e),providersRemoveCustom:(e)=>i("plugin:alwith-chat|providers_remove_custom",e),providersTest:(e)=>i("plugin:alwith-chat|providers_test",e),providersApply:()=>i("plugin:alwith-chat|providers_apply"),providersAccountBind:(e)=>i("plugin:alwith-chat|providers_account_bind",e),providersRefreshManaged:(e)=>i("plugin:alwith-chat|providers_refresh_managed",e),providersClearManaged:()=>i("plugin:alwith-chat|providers_clear_managed"),readSkillDocument:(e)=>i("plugin:alwith-chat|read_skill_document",e),sessionsList:(e)=>i("plugin:alwith-chat|sessions_list",e),sessionsCountTypes:(e)=>i("plugin:alwith-chat|sessions_count_types",e),sessionsPersonaEvidence:(e)=>i("plugin:alwith-chat|sessions_persona_evidence",e),getModelPricing:()=>i("plugin:alwith-chat|get_model_pricing"),scanSessionAggregates:(e)=>i("plugin:alwith-chat|scan_session_aggregates",e),exportWeekSessions:()=>i("plugin:alwith-chat|export_week_sessions"),dailyTokenUsage:(e)=>i("plugin:alwith-chat|daily_token_usage",e),downloadUsageJson:(e)=>i("plugin:alwith-chat|download_usage_json",e),wordCloud:(e)=>i("plugin:alwith-chat|word_cloud",e),readDroppedFile:(e)=>i("plugin:alwith-chat|read_dropped_file",e),clipboardFilePaths:()=>i("plugin:alwith-chat|clipboard_file_paths"),writePastedFile:(e)=>i("plugin:alwith-chat|write_pasted_file",e),readImage:(e)=>i("plugin:alwith-chat|read_image",e),saveFile:(e)=>i("plugin:alwith-chat|save_file",e),writeTextAttachment:(e)=>i("plugin:alwith-chat|write_text_attachment",e),previewFile:(e)=>i("plugin:alwith-chat|preview_file",e)},ro={"providers:changed":{name:"providers:changed",listen:(e)=>s("providers:changed",e),once:(e)=>a("providers:changed",e),emit:(e)=>t("providers:changed",e),emitTo:(e,r)=>n(e,"providers:changed",r)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>s("providers:managed-revoked",e),once:(e)=>a("providers:managed-revoked",e),emit:(e)=>t("providers:managed-revoked",e),emitTo:(e,r)=>n(e,"providers:managed-revoked",r)}};function Ma(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function Ka(e){if(Ma(e)||e instanceof Error)return e.message;return String(e)}
2
+ export{p,ro,Ma,Ka};
@@ -1,2 +1,2 @@
1
- import{L}from"./chunk-f4h84pav.js";import{s}from"./chunk-6c18ag8t.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function ga({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return L(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
2
- export{ga};
1
+ import{E}from"./chunk-44r55va6.js";import{s}from"./chunk-bba9qej8.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function $s({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return E(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
2
+ export{$s};
@@ -1,2 +1,2 @@
1
- import{QUICK_CHATS_GROUP as r,sessionGroup as l}from"@nyssance/codex-acp-v2/client";function pt(n,t){return n!==null&&t&&l(t,{cwd:n}).id===r?null:n}
2
- export{pt};
1
+ import{QUICK_CHATS_GROUP as r,sessionGroup as l}from"@nyssance/codex-acp-v2/client";function ct(n,t){return n!==null&&t&&l(t,{cwd:n}).id===r?null:n}
2
+ export{ct};
@@ -1 +1 @@
1
- import{ze}from"./chunk-sgbn37kz.js";import{H}from"./chunk-8hygfx41.js";import{cn as n}from"cn";import{Item as i,ItemActions as q,ItemContent as K,ItemDescription as le,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function _e({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(ze,"data-[active=true]:font-medium",e),...r})}function en({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(H,{children:t})})}export{q,K,le,W,Z,_e,en};
1
+ import{Le}from"./chunk-stv8pr4v.js";import{H}from"./chunk-8hygfx41.js";import{cn as n}from"cn";import{Item as i,ItemActions as q,ItemContent as K,ItemDescription as le,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function ke({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(Le,"data-[active=true]:font-medium",e),...r})}function zt({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(H,{children:t})})}export{q,K,le,W,Z,ke,zt};
@@ -1,2 +1,2 @@
1
- import{It}from"./chunk-s6y31dcb.js";import{ot}from"./chunk-df9aqj1m.js";import{l}from"./chunk-6283nzqs.js";import{g}from"./chunk-86821qec.js";import{z}from"./chunk-8y706gz3.js";import{e}from"./chunk-abgdqy92.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as j,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function uo({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:h,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:v,host:N}=e(),{t:d}=N,G=g(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[X,U]=M(x);if(X!==x)U(x),C(null);let[F,H]=M([]),[O,T]=M("loading");j(()=>{if(!a||c||!v.installedApps)return;let t=!0;return T("loading"),H([]),v.installedApps().then(({apps:s})=>{if(!t)return;H(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,v,N]);let K=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=ot(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=It(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>G.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>h({id:t.id,name:t.runtimeName||t.id})})),status:O==="loading"?d("composer.appsLoading"):O==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(v.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(j(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)K(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>K(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function Vi({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=g(),E=S(null),h=S(!1);return I(oe,{children:[o(z,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{h.current=i.open},onClick:()=>{if(r)k(!h.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(uo,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
- export{uo,Vi};
1
+ import{St}from"./chunk-arm9x6kc.js";import{it}from"./chunk-pxzj3ae7.js";import{l}from"./chunk-6283nzqs.js";import{g}from"./chunk-zzjth6f2.js";import{j}from"./chunk-hqt5j789.js";import{e}from"./chunk-esbgn8q0.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as z,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function oo({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:h,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:v,host:N}=e(),{t:d}=N,G=g(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[X,U]=M(x);if(X!==x)U(x),C(null);let[F,H]=M([]),[O,T]=M("loading");z(()=>{if(!a||c||!v.installedApps)return;let t=!0;return T("loading"),H([]),v.installedApps().then(({apps:s})=>{if(!t)return;H(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,v,N]);let K=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=it(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=St(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>G.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>h({id:t.id,name:t.runtimeName||t.id})})),status:O==="loading"?d("composer.appsLoading"):O==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(v.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(z(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)K(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>K(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function Li({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=g(),E=S(null),h=S(!1);return I(oe,{children:[o(j,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{h.current=i.open},onClick:()=>{if(r)k(!h.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(oo,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
+ export{oo,Li};
@@ -1,2 +1,2 @@
1
- import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Ve({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
2
- export{Ve};
1
+ import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Ie({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
2
+ export{Ie};