@alwith/module-chat 0.6.34 → 0.6.35

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 (490) hide show
  1. package/dist/activity-host.d.ts +2 -0
  2. package/dist/activity-host.js +1 -1
  3. package/dist/agent/client.d.ts +2 -0
  4. package/dist/agent/client.js +1 -1
  5. package/dist/agent/custom-model-effort.js +1 -1
  6. package/dist/agent/fork-title.js +1 -1
  7. package/dist/agent/image-request.js +1 -1
  8. package/dist/agent/image-tools.d.ts +3 -1
  9. package/dist/agent/image-tools.js +1 -1
  10. package/dist/agent/input-config.js +1 -1
  11. package/dist/agent/input-modes/chat.js +1 -1
  12. package/dist/agent/input-modes/execution-meta.js +1 -1
  13. package/dist/agent/input-modes/image-context.js +1 -1
  14. package/dist/agent/input-modes/image.js +1 -1
  15. package/dist/agent/input-modes/index.js +1 -1
  16. package/dist/agent/project-path.js +1 -1
  17. package/dist/agent/request-error.js +1 -1
  18. package/dist/agent/session-list-refresh.js +1 -1
  19. package/dist/app-reference.js +1 -1
  20. package/dist/application-tools.js +1 -1
  21. package/dist/approval/choice-elicitation-form.js +1 -1
  22. package/dist/approval/choice-schema.js +1 -1
  23. package/dist/approval/permission-options.js +1 -1
  24. package/dist/approval/permission-view.js +1 -1
  25. package/dist/approval/schema-elicitation-form.js +1 -1
  26. package/dist/approval/url-elicitation-card.js +1 -1
  27. package/dist/{chunk-0a3tr9ws.js → chunk-0sb0c014.js} +2 -2
  28. package/dist/{chunk-ks22p0wq.js → chunk-0xztk729.js} +2 -2
  29. package/dist/chunk-18gcnf2a.js +2 -0
  30. package/dist/{chunk-p216frcj.js → chunk-1a46v4cy.js} +2 -2
  31. package/dist/chunk-1b3frq9c.js +3 -0
  32. package/dist/{chunk-nhz4egjh.js → chunk-1vwece23.js} +6 -6
  33. package/dist/{chunk-wvm6ppb3.js → chunk-20dc4fm0.js} +2 -2
  34. package/dist/{chunk-45yrj0e1.js → chunk-22nybrkv.js} +5 -5
  35. package/dist/{chunk-vab1ysnz.js → chunk-23kvszfc.js} +2 -2
  36. package/dist/chunk-2nq204hz.js +2 -0
  37. package/dist/{chunk-dcvmc9hn.js → chunk-2nv5ebq1.js} +2 -2
  38. package/dist/chunk-33fxyn5r.js +2 -0
  39. package/dist/chunk-359pf448.js +2 -0
  40. package/dist/{chunk-n8b9yg4q.js → chunk-3knw8e0x.js} +2 -2
  41. package/dist/{chunk-2eceheqt.js → chunk-3kytka7m.js} +3 -3
  42. package/dist/{chunk-mq0npf36.js → chunk-3sq2k9ca.js} +2 -2
  43. package/dist/{chunk-vgea7ggq.js → chunk-3t3n8nfy.js} +2 -2
  44. package/dist/{chunk-9n8cds8p.js → chunk-3tvq6xr2.js} +2 -2
  45. package/dist/{chunk-gktjkghg.js → chunk-482segb0.js} +2 -2
  46. package/dist/{chunk-19jh646d.js → chunk-4chmr87g.js} +2 -2
  47. package/dist/chunk-4g2412p5.js +2 -0
  48. package/dist/chunk-4ma6bmcm.js +2 -0
  49. package/dist/{chunk-103z8myv.js → chunk-54jfqcd1.js} +2 -2
  50. package/dist/chunk-5mxh7h57.js +2 -0
  51. package/dist/{chunk-tjt1s9qs.js → chunk-5qaa4atv.js} +2 -2
  52. package/dist/{chunk-qwjz3jsz.js → chunk-5zf3px9y.js} +2 -2
  53. package/dist/chunk-60yk0ye9.js +2 -0
  54. package/dist/chunk-63kwbtgs.js +2 -0
  55. package/dist/{chunk-sgmh6sa8.js → chunk-67fn9pq0.js} +2 -2
  56. package/dist/{chunk-84p483n0.js → chunk-6br4568a.js} +2 -2
  57. package/dist/{chunk-4jza4wwy.js → chunk-6c7q2rz8.js} +2 -2
  58. package/dist/{chunk-7m8hw6gh.js → chunk-6ea6q6dj.js} +2 -2
  59. package/dist/{chunk-88ysxbdh.js → chunk-6v0r7m92.js} +2 -2
  60. package/dist/{chunk-kbzsn9xw.js → chunk-6xap6hvz.js} +2 -2
  61. package/dist/{chunk-re4vc51w.js → chunk-7naym98x.js} +2 -2
  62. package/dist/{chunk-r5q65gf3.js → chunk-7nfv27hz.js} +2 -2
  63. package/dist/{chunk-masqfje4.js → chunk-7tgfj1zb.js} +2 -2
  64. package/dist/{chunk-gfkx1z04.js → chunk-7ywnza68.js} +2 -2
  65. package/dist/{chunk-r8sq654w.js → chunk-8be6eq9r.js} +2 -2
  66. package/dist/chunk-8eyw37rv.js +2 -0
  67. package/dist/{chunk-eqa6cd7b.js → chunk-8pb726d6.js} +2 -2
  68. package/dist/{chunk-zv3bm3np.js → chunk-8x7a5n2w.js} +2 -2
  69. package/dist/{chunk-x2x9g6vk.js → chunk-8yetzgqb.js} +2 -2
  70. package/dist/{chunk-tj0530fn.js → chunk-8zkn8x2j.js} +2 -2
  71. package/dist/chunk-95f0wens.js +2 -0
  72. package/dist/{chunk-g1de763m.js → chunk-9ghxym50.js} +2 -2
  73. package/dist/{chunk-n8fe2njr.js → chunk-9hts7x5n.js} +2 -2
  74. package/dist/{chunk-8sa6xn88.js → chunk-9hwqfjc1.js} +2 -2
  75. package/dist/{chunk-zqpcrtde.js → chunk-9ns2xh84.js} +2 -2
  76. package/dist/{chunk-y8p2dmw3.js → chunk-9nz4c647.js} +2 -2
  77. package/dist/{chunk-tz1gzwas.js → chunk-a2tkhes5.js} +2 -2
  78. package/dist/{chunk-zy6qme7n.js → chunk-a4ebhcsy.js} +2 -2
  79. package/dist/{chunk-mhhtcbh9.js → chunk-aeccrrg1.js} +2 -2
  80. package/dist/{chunk-arr0hypp.js → chunk-aemtk0r5.js} +2 -2
  81. package/dist/{chunk-r7g85s0a.js → chunk-afnnrn6z.js} +2 -2
  82. package/dist/chunk-aj0z9a5r.js +2 -0
  83. package/dist/{chunk-x49qjrbk.js → chunk-aj6yxm6d.js} +2 -2
  84. package/dist/{chunk-rt9dn0b3.js → chunk-aq3hemsb.js} +3 -3
  85. package/dist/{chunk-zk395v8p.js → chunk-b0zzq2ky.js} +2 -2
  86. package/dist/{chunk-f6cexkjm.js → chunk-b3mja7d9.js} +3 -3
  87. package/dist/{chunk-8w08gd0y.js → chunk-b6kn9ack.js} +3 -3
  88. package/dist/{chunk-mfkrs2at.js → chunk-b8tx1n1a.js} +2 -2
  89. package/dist/chunk-bdea3k6b.js +2 -0
  90. package/dist/{chunk-52wrk1mh.js → chunk-bm457bsd.js} +2 -2
  91. package/dist/{chunk-bhajnmtf.js → chunk-bt42z99s.js} +2 -2
  92. package/dist/{chunk-2016dacx.js → chunk-by7k0ypx.js} +2 -2
  93. package/dist/{chunk-wpacvdsv.js → chunk-bysgsnph.js} +2 -2
  94. package/dist/{chunk-bq31dzpj.js → chunk-c0czkyzh.js} +2 -2
  95. package/dist/chunk-c70a2esc.js +2 -0
  96. package/dist/{chunk-xqqk85kd.js → chunk-ccner90h.js} +2 -2
  97. package/dist/{chunk-e84mhse2.js → chunk-cgpnhrm5.js} +3 -3
  98. package/dist/{chunk-kj3a1k2q.js → chunk-chjt1pct.js} +2 -2
  99. package/dist/{chunk-pr7xj1fn.js → chunk-ck70ewc8.js} +2 -2
  100. package/dist/{chunk-fpsn6fmf.js → chunk-ckft9abb.js} +2 -2
  101. package/dist/{chunk-6nbqbjnb.js → chunk-d0zazfrq.js} +3 -3
  102. package/dist/{chunk-q78ng7mn.js → chunk-d607659a.js} +2 -2
  103. package/dist/{chunk-zyn0ys4m.js → chunk-d84xx4bh.js} +2 -2
  104. package/dist/{chunk-vys8kfkp.js → chunk-db8hae9d.js} +2 -2
  105. package/dist/chunk-ddaz4j9s.js +2 -0
  106. package/dist/{chunk-r0dg1bjd.js → chunk-dhx1sd4s.js} +2 -2
  107. package/dist/{chunk-at25g15n.js → chunk-dzncwejn.js} +2 -2
  108. package/dist/chunk-e99t3sk5.js +2 -0
  109. package/dist/{chunk-ske5z0gp.js → chunk-ebkz1sy2.js} +2 -2
  110. package/dist/chunk-eevfr0tx.js +2 -0
  111. package/dist/{chunk-89gyxwmd.js → chunk-enkrqfqq.js} +2 -2
  112. package/dist/{chunk-z8b3nz7t.js → chunk-epqqzh99.js} +2 -2
  113. package/dist/{chunk-prwzyc7q.js → chunk-epqyjwrh.js} +2 -2
  114. package/dist/{chunk-0bc7gfq4.js → chunk-evgfpd16.js} +2 -2
  115. package/dist/chunk-eyw05qyj.js +4 -0
  116. package/dist/{chunk-15m908ph.js → chunk-f2h074g0.js} +2 -2
  117. package/dist/{chunk-zg0tv3sj.js → chunk-fggwwmzc.js} +3 -3
  118. package/dist/{chunk-a18avvt2.js → chunk-fqchnswc.js} +2 -2
  119. package/dist/{chunk-sbyp6k8w.js → chunk-fvmnj6bg.js} +2 -2
  120. package/dist/chunk-fxzh4f7c.js +4 -0
  121. package/dist/chunk-fzfwftqs.js +2 -0
  122. package/dist/{chunk-qd9s7wmj.js → chunk-g9v0jr0f.js} +3 -3
  123. package/dist/{chunk-28nsjq3w.js → chunk-ged1nyhk.js} +5 -5
  124. package/dist/chunk-gk7nn747.js +2 -0
  125. package/dist/chunk-gmns080g.js +2 -0
  126. package/dist/chunk-gw4zbw0m.js +2 -0
  127. package/dist/{chunk-cef598jy.js → chunk-gy446wcz.js} +2 -2
  128. package/dist/chunk-h71pkpwg.js +2 -0
  129. package/dist/{chunk-bsb08p49.js → chunk-ha1s3jbc.js} +3 -3
  130. package/dist/{chunk-k3fwyr6s.js → chunk-hfjttc7r.js} +2 -2
  131. package/dist/{chunk-vedvkp9e.js → chunk-hqc5c3nz.js} +3 -3
  132. package/dist/{chunk-5x2aqmhm.js → chunk-hwhyyaen.js} +2 -2
  133. package/dist/{chunk-z6tw9cf9.js → chunk-j1t1fnew.js} +2 -2
  134. package/dist/chunk-j2bp0zbe.js +2 -0
  135. package/dist/{chunk-y0rnvmrw.js → chunk-jne0bc79.js} +2 -2
  136. package/dist/chunk-jtws1jg5.js +2 -0
  137. package/dist/{chunk-1md5vq9g.js → chunk-jygp7479.js} +2 -2
  138. package/dist/{chunk-b9v0vew6.js → chunk-jz7mckdp.js} +2 -2
  139. package/dist/{chunk-8hm3nkrk.js → chunk-k014w2jg.js} +2 -2
  140. package/dist/{chunk-m6sdmcpj.js → chunk-k0h18sme.js} +2 -2
  141. package/dist/{chunk-vb9mn75j.js → chunk-k1w3acq7.js} +2 -2
  142. package/dist/{chunk-as2j0yp0.js → chunk-k5065dzv.js} +2 -2
  143. package/dist/chunk-k97dpdcj.js +2 -0
  144. package/dist/{chunk-v4tznge3.js → chunk-kgx0jj22.js} +3 -3
  145. package/dist/chunk-khd2r3jh.js +2 -0
  146. package/dist/{chunk-1gb1vwvy.js → chunk-kk9dbwd1.js} +2 -2
  147. package/dist/chunk-kvgn4b2n.js +2 -0
  148. package/dist/{chunk-w83nb5a8.js → chunk-mg9a4t04.js} +2 -2
  149. package/dist/{chunk-6h10jana.js → chunk-mgve4dcw.js} +2 -2
  150. package/dist/{chunk-dhn9f10w.js → chunk-mgwkmr8g.js} +2 -2
  151. package/dist/{chunk-qk1yqepm.js → chunk-mhrn3e8j.js} +2 -2
  152. package/dist/{chunk-fwn521m5.js → chunk-mkawbqx5.js} +2 -2
  153. package/dist/chunk-mp5f940y.js +1 -0
  154. package/dist/chunk-mybye5t2.js +2 -0
  155. package/dist/{chunk-9x70f7zv.js → chunk-n4rep234.js} +2 -2
  156. package/dist/{chunk-k5kzw2px.js → chunk-nebke41s.js} +3 -3
  157. package/dist/{chunk-5h49mv0e.js → chunk-newkrtrj.js} +2 -2
  158. package/dist/{chunk-9jth6sk7.js → chunk-nfnejf16.js} +2 -2
  159. package/dist/{chunk-zyyn9t8n.js → chunk-njw6x85v.js} +3 -3
  160. package/dist/{chunk-1d29gnb2.js → chunk-npt6at4f.js} +2 -2
  161. package/dist/chunk-nrfyvzmk.js +2 -0
  162. package/dist/{chunk-86tpa1nn.js → chunk-nvadhyne.js} +2 -2
  163. package/dist/{chunk-rd51rvde.js → chunk-p2bn8ypc.js} +2 -2
  164. package/dist/chunk-pnx0f495.js +2 -0
  165. package/dist/{chunk-7p0d3rz7.js → chunk-ppcwcrdz.js} +2 -2
  166. package/dist/chunk-prr551k0.js +2 -0
  167. package/dist/chunk-pvm6d77q.js +2 -0
  168. package/dist/{chunk-0b50jg23.js → chunk-pxbww0j1.js} +2 -2
  169. package/dist/{chunk-g947bnqx.js → chunk-pz5d0vgv.js} +2 -2
  170. package/dist/chunk-q2ykvjrz.js +2 -0
  171. package/dist/chunk-q8c4k6qh.js +2 -0
  172. package/dist/{chunk-vnd6smsp.js → chunk-q8y2a23c.js} +2 -2
  173. package/dist/{chunk-11kkxd6v.js → chunk-qbmgsd3h.js} +2 -2
  174. package/dist/{chunk-965sngjd.js → chunk-qbpy0aqe.js} +2 -2
  175. package/dist/chunk-qgrd5xre.js +2 -0
  176. package/dist/{chunk-r8gnmyb1.js → chunk-qkddvxjr.js} +2 -2
  177. package/dist/chunk-qv61ef2y.js +2 -0
  178. package/dist/{chunk-9t672hzm.js → chunk-qvdfrmpb.js} +2 -2
  179. package/dist/chunk-qvzxzzw8.js +2 -0
  180. package/dist/{chunk-b6sb3akb.js → chunk-r2b234a7.js} +2 -2
  181. package/dist/{chunk-0t4fcgge.js → chunk-ra52dqfb.js} +2 -2
  182. package/dist/{chunk-68afy8mk.js → chunk-rb6mjycp.js} +2 -2
  183. package/dist/{chunk-dqjhmzjy.js → chunk-rbs3079t.js} +2 -2
  184. package/dist/chunk-rcynxrkk.js +4 -0
  185. package/dist/{chunk-75xtk0a3.js → chunk-rms7wj04.js} +2 -2
  186. package/dist/{chunk-pr6qwqpj.js → chunk-rntrfb49.js} +2 -2
  187. package/dist/{chunk-h4xx90s4.js → chunk-rxj5619b.js} +2 -2
  188. package/dist/{chunk-72xm1tz1.js → chunk-ry5phnnk.js} +2 -2
  189. package/dist/{chunk-z0q7ghbg.js → chunk-s11mgwyh.js} +2 -2
  190. package/dist/{chunk-4wm5emgf.js → chunk-s170cg6j.js} +2 -2
  191. package/dist/{chunk-8gas4q2s.js → chunk-s1w3j9p9.js} +2 -2
  192. package/dist/{chunk-2dnzdsrv.js → chunk-sfd0pp49.js} +3 -3
  193. package/dist/chunk-shzj5zf0.js +2 -0
  194. package/dist/chunk-sk9rm826.js +2 -0
  195. package/dist/chunk-svxnx1c7.js +2 -0
  196. package/dist/chunk-symaxskd.js +2 -0
  197. package/dist/chunk-t3rv7vat.js +2 -0
  198. package/dist/{chunk-yq4wz4n8.js → chunk-t6ddgvkm.js} +2 -2
  199. package/dist/{chunk-g7dxg38a.js → chunk-th5vv83g.js} +2 -2
  200. package/dist/{chunk-dxwbgg69.js → chunk-tj4b0s68.js} +2 -2
  201. package/dist/chunk-veef1avy.js +2 -0
  202. package/dist/chunk-vgxvtmja.js +2 -0
  203. package/dist/{chunk-ad53zbdb.js → chunk-vjfxm73q.js} +2 -2
  204. package/dist/chunk-vnxa4qe2.js +2 -0
  205. package/dist/{chunk-9y0fxq8e.js → chunk-vq060dnz.js} +2 -2
  206. package/dist/{chunk-ckbqdg1s.js → chunk-vyvsm4v9.js} +2 -2
  207. package/dist/{chunk-8w5bt0nc.js → chunk-w1yrsbw1.js} +2 -2
  208. package/dist/{chunk-64apxzn7.js → chunk-w2p1g8rp.js} +2 -2
  209. package/dist/{chunk-rr5ek064.js → chunk-w4537026.js} +2 -2
  210. package/dist/chunk-wexhc7rb.js +2 -0
  211. package/dist/{chunk-nef7y6mg.js → chunk-wf0ytnh9.js} +2 -2
  212. package/dist/{chunk-xqb4thy8.js → chunk-wf4z9w5x.js} +2 -2
  213. package/dist/{chunk-j4ejwthn.js → chunk-whax282d.js} +2 -2
  214. package/dist/{chunk-x6spt0mc.js → chunk-wrxj79ct.js} +2 -2
  215. package/dist/{chunk-mt01qph9.js → chunk-xanfp0nh.js} +2 -2
  216. package/dist/{chunk-jaghs2z5.js → chunk-xjf2zkrg.js} +2 -2
  217. package/dist/{chunk-dwxmgsg8.js → chunk-xqrhfxct.js} +2 -2
  218. package/dist/{chunk-ksq9a3pf.js → chunk-xxwevgqr.js} +2 -2
  219. package/dist/{chunk-x2wcwpw3.js → chunk-y5qzgfsd.js} +2 -2
  220. package/dist/chunk-y72y3j24.js +2 -0
  221. package/dist/{chunk-81xwn9e5.js → chunk-y8aeahf2.js} +3 -3
  222. package/dist/chunk-ygake3bx.js +2 -0
  223. package/dist/{chunk-zb0m2cqy.js → chunk-ymdhz3x0.js} +2 -2
  224. package/dist/{chunk-erdrx47j.js → chunk-ytkcpeq2.js} +2 -2
  225. package/dist/{chunk-69tgmjdb.js → chunk-z27pxeqg.js} +2 -2
  226. package/dist/{chunk-mrwawq46.js → chunk-z53fd30n.js} +2 -2
  227. package/dist/{chunk-54j6xftt.js → chunk-zjzzqtaj.js} +2 -2
  228. package/dist/{chunk-mmrwaa9h.js → chunk-zpetyx45.js} +2 -2
  229. package/dist/chunk-zpm0t5ye.js +2 -0
  230. package/dist/chunk-ztrkk6sp.js +2 -0
  231. package/dist/client.js +1 -1
  232. package/dist/codex/activity-group.js +1 -1
  233. package/dist/codex/artifact-links.js +1 -1
  234. package/dist/codex/assistant-message.js +1 -1
  235. package/dist/codex/async-question-card.js +1 -1
  236. package/dist/codex/disclosure-state.js +1 -1
  237. package/dist/codex/edited-files-card.js +1 -1
  238. package/dist/codex/image-view-activity.js +1 -1
  239. package/dist/codex/markdown-renderer.js +1 -1
  240. package/dist/codex/navigation-audio.js +1 -1
  241. package/dist/codex/navigation-preview.js +1 -1
  242. package/dist/codex/navigation-rail.js +1 -1
  243. package/dist/codex/patch-view.js +1 -1
  244. package/dist/codex/plan.js +1 -1
  245. package/dist/codex/timeline-virtualizer.js +1 -1
  246. package/dist/codex/turn-activity.js +1 -1
  247. package/dist/codex/user-message.js +1 -1
  248. package/dist/codex/virtualized-turn-list.js +1 -1
  249. package/dist/collections/collection-emoji.js +1 -1
  250. package/dist/collections/collection-menu.js +1 -1
  251. package/dist/collections/collection-panel.js +1 -1
  252. package/dist/collections/collections.js +1 -1
  253. package/dist/collections/host.js +1 -1
  254. package/dist/collections/locales.js +1 -1
  255. package/dist/collections/model.js +1 -1
  256. package/dist/collections/store.js +1 -1
  257. package/dist/composer/completion-filter.js +1 -1
  258. package/dist/composer/completion-menu.js +1 -1
  259. package/dist/composer/completion-trigger.js +1 -1
  260. package/dist/composer/effort-slider.js +1 -1
  261. package/dist/composer/inline-document.js +1 -1
  262. package/dist/composer/inline-dom.js +1 -1
  263. package/dist/composer/menu-radio.js +1 -1
  264. package/dist/composer/model-select.js +1 -1
  265. package/dist/composer/permission-mode-select.js +1 -1
  266. package/dist/composer/prompt-input-attachments.js +1 -1
  267. package/dist/composer/prompt-input-clipboard.js +1 -1
  268. package/dist/composer/prompt-input-context.d.ts +9 -0
  269. package/dist/composer/prompt-input-context.js +1 -1
  270. package/dist/composer/prompt-input-inline.js +1 -1
  271. package/dist/composer/prompt-input-textarea.js +1 -1
  272. package/dist/composer/prompt-input.js +1 -1
  273. package/dist/conversation/action-card.js +1 -1
  274. package/dist/conversation/composer/app-mentions.js +1 -1
  275. package/dist/conversation/composer/apps-menu.js +1 -1
  276. package/dist/conversation/composer/composer-menu.js +1 -1
  277. package/dist/conversation/composer/composer.js +1 -1
  278. package/dist/conversation/composer/config-options.js +1 -1
  279. package/dist/conversation/composer/context.js +1 -1
  280. package/dist/conversation/composer/drafts.js +1 -1
  281. package/dist/conversation/composer/file-items.js +1 -1
  282. package/dist/conversation/composer/long-text.js +1 -1
  283. package/dist/conversation/composer/mention-chips.js +1 -1
  284. package/dist/conversation/composer/mention-uri.js +1 -1
  285. package/dist/conversation/composer/model-menu.js +1 -1
  286. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  287. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  288. package/dist/conversation/composer/prediction.js +1 -1
  289. package/dist/conversation/composer/prompt-history.js +1 -1
  290. package/dist/conversation/composer/slash-command-button.js +1 -1
  291. package/dist/conversation/composer/submit-button.js +1 -1
  292. package/dist/conversation/composer/usage-meter.js +1 -1
  293. package/dist/conversation/connection-notice.js +1 -1
  294. package/dist/conversation/context.js +1 -1
  295. package/dist/conversation/conversation-body.js +1 -1
  296. package/dist/conversation/conversation-search.js +1 -1
  297. package/dist/conversation/conversation-view.js +1 -1
  298. package/dist/conversation/conversation.js +1 -1
  299. package/dist/conversation/diff-modal.js +1 -1
  300. package/dist/conversation/draft-project-picker.js +1 -1
  301. package/dist/conversation/session-actions.js +1 -1
  302. package/dist/conversation/subagent-sessions.js +1 -1
  303. package/dist/conversation/subagent-tasks.js +1 -1
  304. package/dist/desktop/desktop-composer.d.ts +2 -1
  305. package/dist/desktop/desktop-composer.js +1 -1
  306. package/dist/desktop/desktop.js +1 -1
  307. package/dist/desktop/draft-model-select.js +1 -1
  308. package/dist/desktop/load-image.js +1 -1
  309. package/dist/desktop/model-catalog.js +1 -1
  310. package/dist/desktop/model-recovery.js +1 -1
  311. package/dist/desktop/model-settings-action.js +1 -1
  312. package/dist/desktop/native-file-drop.d.ts +3 -1
  313. package/dist/desktop/native-file-drop.js +1 -1
  314. package/dist/generated/commands.d.ts +1 -0
  315. package/dist/generated/commands.js +1 -1
  316. package/dist/generated-image-storage.d.ts +11 -0
  317. package/dist/generated-image-storage.js +1 -0
  318. package/dist/image-lightbox.js +1 -1
  319. package/dist/image-preview-dialog.js +1 -1
  320. package/dist/image.d.ts +5 -1
  321. package/dist/image.js +1 -1
  322. package/dist/lib/app-reference.js +1 -1
  323. package/dist/lib/application-metadata.js +1 -1
  324. package/dist/lib/chat-path.js +1 -1
  325. package/dist/lib/code-highlighter.js +1 -1
  326. package/dist/lib/file-url.js +1 -1
  327. package/dist/lib/fuzzy.js +1 -1
  328. package/dist/lib/group-blocks.js +1 -1
  329. package/dist/lib/image-encode.js +1 -1
  330. package/dist/lib/limits.js +1 -1
  331. package/dist/lib/markdown-parser.js +1 -1
  332. package/dist/lib/markdown-rules.js +1 -1
  333. package/dist/lib/model-name.js +1 -1
  334. package/dist/lib/pointer-centered-zoom.js +1 -1
  335. package/dist/lib/prepare-prompt-files.d.ts +2 -2
  336. package/dist/lib/prepare-prompt-files.js +1 -1
  337. package/dist/lib/reference-presentation.js +1 -1
  338. package/dist/lib/stream-style.js +1 -1
  339. package/dist/lib/streaming-markdown.js +1 -1
  340. package/dist/lib/tool-artifacts.js +1 -1
  341. package/dist/locales.js +1 -1
  342. package/dist/mermaid/diagram.js +1 -1
  343. package/dist/mermaid/export.js +1 -1
  344. package/dist/mermaid/index.js +1 -1
  345. package/dist/mermaid/preview.js +1 -1
  346. package/dist/oauth/claude-login.js +1 -1
  347. package/dist/oauth.js +1 -1
  348. package/dist/plugins/catalog-header.js +1 -1
  349. package/dist/plugins/catalog-skeleton.js +1 -1
  350. package/dist/plugins/host.js +1 -1
  351. package/dist/plugins/locales.js +1 -1
  352. package/dist/plugins/new-chat-directory.js +1 -1
  353. package/dist/plugins/pane.js +1 -1
  354. package/dist/plugins/panel-item.js +1 -1
  355. package/dist/plugins/plugin-detail-page.js +1 -1
  356. package/dist/plugins/plugin-icon.js +1 -1
  357. package/dist/plugins/plugin-icons.js +1 -1
  358. package/dist/plugins/plugins-page.js +1 -1
  359. package/dist/plugins/plugins.js +1 -1
  360. package/dist/plugins/read-skill-document.js +1 -1
  361. package/dist/plugins/skill-document.js +1 -1
  362. package/dist/plugins/skills-tab.js +1 -1
  363. package/dist/plugins/store.js +1 -1
  364. package/dist/plugins/toolbox-layout.js +1 -1
  365. package/dist/reference-projection.js +1 -1
  366. package/dist/search/chat-search.js +1 -1
  367. package/dist/search/codex-source-matches.js +1 -1
  368. package/dist/search/dom-matches.js +1 -1
  369. package/dist/search/find-bar.js +1 -1
  370. package/dist/search/literal-matches.js +1 -1
  371. package/dist/session-list/account-menu.js +1 -1
  372. package/dist/session-list/activity-list.js +1 -1
  373. package/dist/session-list/archived-sessions.js +1 -1
  374. package/dist/session-list/help-menu.js +1 -1
  375. package/dist/session-list/highlight.js +1 -1
  376. package/dist/session-list/host.js +1 -1
  377. package/dist/session-list/hover-info-card.js +1 -1
  378. package/dist/session-list/locales.js +1 -1
  379. package/dist/session-list/navigation-controls.js +1 -1
  380. package/dist/session-list/navigation-header.js +1 -1
  381. package/dist/session-list/navigation-store.js +1 -1
  382. package/dist/session-list/navigation-tabs.js +1 -1
  383. package/dist/session-list/navigation.js +1 -1
  384. package/dist/session-list/platform.js +1 -1
  385. package/dist/session-list/row-stop-button.js +1 -1
  386. package/dist/session-list/session-groups.js +1 -1
  387. package/dist/session-list/session-info-card.js +1 -1
  388. package/dist/session-list/session-list.js +1 -1
  389. package/dist/session-list/session-row.js +1 -1
  390. package/dist/session-list/session-state-dot.js +1 -1
  391. package/dist/session-list/session-state-menu.js +1 -1
  392. package/dist/session-list/shortcut-hint.js +1 -1
  393. package/dist/session-list/shortcut.js +1 -1
  394. package/dist/session-list/sidebar-overlay.js +1 -1
  395. package/dist/session-list/trailing-swap.js +1 -1
  396. package/dist/session-list/use-activity-notification.js +1 -1
  397. package/dist/session-list/use-activity-preview.js +1 -1
  398. package/dist/session-list/use-cmd-held.js +1 -1
  399. package/dist/session-list/use-project-sessions.js +1 -1
  400. package/dist/session-list/virtual-session-rows.js +1 -1
  401. package/dist/session-timeline/activity-group.js +1 -1
  402. package/dist/session-timeline/activity-projection.js +1 -1
  403. package/dist/session-timeline/assistant-content.js +1 -1
  404. package/dist/session-timeline/assistant-image-references.js +1 -1
  405. package/dist/session-timeline/assistant-turn.js +1 -1
  406. package/dist/session-timeline/async-questions.js +1 -1
  407. package/dist/session-timeline/edited-files-card.js +1 -1
  408. package/dist/session-timeline/history-timeline.js +1 -1
  409. package/dist/session-timeline/host.js +1 -1
  410. package/dist/session-timeline/image-generation-progress.js +1 -1
  411. package/dist/session-timeline/navigation-rail.js +1 -1
  412. package/dist/session-timeline/plan.js +1 -1
  413. package/dist/session-timeline/question-reply.js +1 -1
  414. package/dist/session-timeline/resource-content.js +1 -1
  415. package/dist/session-timeline/session-timeline.js +1 -1
  416. package/dist/session-timeline/timeline-registry.js +1 -1
  417. package/dist/session-timeline/turn-activity.js +1 -1
  418. package/dist/session-timeline/turn-error.js +1 -1
  419. package/dist/session-timeline/turn-retry.js +1 -1
  420. package/dist/session-timeline/turn-time.js +1 -1
  421. package/dist/session-timeline/turns.js +1 -1
  422. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  423. package/dist/session-timeline/user-message.js +1 -1
  424. package/dist/settings/codex-account-card.js +1 -1
  425. package/dist/settings/login-card.js +1 -1
  426. package/dist/settings/model-alias-settings.js +1 -1
  427. package/dist/settings/model-aliases.js +1 -1
  428. package/dist/settings/provider-logos.js +1 -1
  429. package/dist/settings/provider-section.js +1 -1
  430. package/dist/settings/providers-port.js +1 -1
  431. package/dist/settings/providers.js +1 -1
  432. package/dist/settings/settings-bridge.js +1 -1
  433. package/dist/settings/settings.js +1 -1
  434. package/native/win32-x64/alwith_native_chat.dll +0 -0
  435. package/native/win32-x64/artifact.json +1 -1
  436. package/package.json +3 -3
  437. package/dist/chunk-0kaa9dja.js +0 -2
  438. package/dist/chunk-0myfs71s.js +0 -2
  439. package/dist/chunk-19jwgexv.js +0 -4
  440. package/dist/chunk-1p3ekdt4.js +0 -2
  441. package/dist/chunk-1xgm6fpr.js +0 -2
  442. package/dist/chunk-2rjg9fs9.js +0 -2
  443. package/dist/chunk-2s0jckfr.js +0 -2
  444. package/dist/chunk-3272z6sv.js +0 -2
  445. package/dist/chunk-38eckxjk.js +0 -2
  446. package/dist/chunk-56jqg70p.js +0 -2
  447. package/dist/chunk-5rzy2287.js +0 -2
  448. package/dist/chunk-6cedp3k2.js +0 -2
  449. package/dist/chunk-6eg26dz5.js +0 -4
  450. package/dist/chunk-7hhc8y2n.js +0 -2
  451. package/dist/chunk-7xsrqwvt.js +0 -2
  452. package/dist/chunk-9s8ht9xe.js +0 -2
  453. package/dist/chunk-b5g055qp.js +0 -2
  454. package/dist/chunk-bqbyjazm.js +0 -2
  455. package/dist/chunk-cmfcnze3.js +0 -4
  456. package/dist/chunk-d4jkh19p.js +0 -2
  457. package/dist/chunk-dn8xcv31.js +0 -2
  458. package/dist/chunk-dwv3z2sk.js +0 -2
  459. package/dist/chunk-e4ws15tg.js +0 -2
  460. package/dist/chunk-e8bazy7m.js +0 -2
  461. package/dist/chunk-eaxevj9t.js +0 -2
  462. package/dist/chunk-f0hb6t2w.js +0 -2
  463. package/dist/chunk-f67e77e6.js +0 -2
  464. package/dist/chunk-fcy6mh2e.js +0 -2
  465. package/dist/chunk-gs0b02g2.js +0 -2
  466. package/dist/chunk-hs98zk6m.js +0 -2
  467. package/dist/chunk-jf7em132.js +0 -1
  468. package/dist/chunk-k2xs8svj.js +0 -2
  469. package/dist/chunk-kv3hsfyk.js +0 -2
  470. package/dist/chunk-kyqf7cqh.js +0 -2
  471. package/dist/chunk-m4ds8kjc.js +0 -2
  472. package/dist/chunk-m6yg0dc9.js +0 -2
  473. package/dist/chunk-n88j8hsd.js +0 -2
  474. package/dist/chunk-nvsws1yg.js +0 -2
  475. package/dist/chunk-p02bdewy.js +0 -2
  476. package/dist/chunk-pae2hjvq.js +0 -2
  477. package/dist/chunk-ptdx40ae.js +0 -2
  478. package/dist/chunk-q61xz251.js +0 -2
  479. package/dist/chunk-rkqptd9w.js +0 -2
  480. package/dist/chunk-t1qj0vqe.js +0 -2
  481. package/dist/chunk-t2ej667n.js +0 -2
  482. package/dist/chunk-tab23kkx.js +0 -2
  483. package/dist/chunk-w1ga47ww.js +0 -2
  484. package/dist/chunk-w2bgfpdh.js +0 -2
  485. package/dist/chunk-wj9s8331.js +0 -2
  486. package/dist/chunk-wjgrrfq9.js +0 -2
  487. package/dist/chunk-ygaqqwmb.js +0 -2
  488. package/dist/chunk-yvzkb5p5.js +0 -2
  489. package/dist/chunk-z6x70w62.js +0 -2
  490. package/dist/chunk-zea1chz7.js +0 -3
@@ -1,4 +1,4 @@
1
- import{e}from"./chunk-kyqf7cqh.js";import{Yt}from"./chunk-qwjz3jsz.js";import{E,wt,ae,On}from"./chunk-g7dxg38a.js";import{fn,hn}from"./chunk-ygaqqwmb.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 ie,CollapsibleContent as re,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(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 Ws({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=hn(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(E[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(E[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 fn(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=E.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(E[0]?.id??"")},[c,x,P,A]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Yt,{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(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),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}),E.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:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(to,{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(to,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}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:[E.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 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(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 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}),[F,B]=y(ae(s,d?.region)?.id),[U,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),z=On(s,F),K=F!==ae(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(ae(s,d?.region)?.id),M(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let A=!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?ae(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"&&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(se,{}):t(ne,{})})})]})]}),i(ie,{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(re,{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:ae(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:!A,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!A?S:void 0,children:i(R,{size:"sm",disabled:!A,onClick:f,children:[v&&t(X,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function to({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-qgrd5xre.js";import{sn}from"./chunk-5zf3px9y.js";import{R,It,ce,zn}from"./chunk-th5vv83g.js";import{xn,bn}from"./chunk-bdea3k6b.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 F}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as ie,CollapsibleContent as re,CollapsibleTrigger as ae}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as O,FieldDescription as le,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 de,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 pi({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 ea({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=bn(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 xn(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(sn,{bridge:d})]}),C&&t(pi,{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(mi,{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(fi,{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(so,{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(so,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{U((r)=>r+1),k(o)},onSave:T},K)})]})})]})}function mi({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(oe,{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 gi({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(gi,{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 fi({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(ce(s,d?.region)?.id),[z,M]=y(d?.base_url??""),J=s.logo,I=d!==null,T=c.trim(),E=zn(s,K),B=K!==ce(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(ce(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?ce(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(de,{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(ie,{className:"space-y-2",children:[i(ae,{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(re,{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:ce(s,K)?.baseUrl??s.baseUrl,value:z,onChange:(a)=>M(a.target.value)})}),t(le,{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 so({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("-","")}`),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(wt(I)),K(null)}catch(D){K(W(D));return}U(m)},G=async()=>{let m;try{m=wt(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: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:()=>F((m)=>!m),children:k?t(se,{}):t(ne,{})})})]})]})]}),t(Q,{}),i(ie,{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(re,{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{ai,Ws,li,ci,di,to};
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(It(I)),B(null)}catch(D){B(W(D));return}z(m)},G=async()=>{let m;try{m=It(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(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: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(de,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>K((m)=>!m),children:k?t(se,{}):t(ne,{})})})]})]})]}),t(Q,{}),i(ie,{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(ae,{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(re,{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(le,{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{pi,ea,mi,gi,fi,so};
@@ -1,4 +1,4 @@
1
- var Xo=`<svg xmlns="http://www.w3.org/2000/svg">
1
+ var oi=`<svg xmlns="http://www.w3.org/2000/svg">
2
2
  <defs>
3
3
  <linearGradient id="plugin-agent-mode-paint0_linear_1_1034" x1="30.0398" y1="40.0728" x2="11.3112" y2="-1.39757" gradientUnits="userSpaceOnUse">
4
4
  <stop stop-color="#2BBFFF"/>
@@ -1286,4 +1286,4 @@ var Xo=`<svg xmlns="http://www.w3.org/2000/svg">
1286
1286
  </symbol>
1287
1287
  </svg>
1288
1288
  `;
1289
- export{Xo};
1289
+ export{oi};
@@ -0,0 +1,2 @@
1
+ import{ki}from"./chunk-pxbww0j1.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function sa({host:o,children:t}){return s(n,{value:o,children:t})}function A(){let o=i(n),e={...ki(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function Ci(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function he(){let o=A();return(t)=>Ci(o,t)}function wi(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
+ export{sa,A,Ci,he,wi};
@@ -1,2 +1,2 @@
1
- import{Cr,st,Io,wr,kr,Sr}from"./chunk-fwn521m5.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var br=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>Cr({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=st({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Io({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=st({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Sr({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=st({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=wr({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=kr({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=st({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Io({anchorKey:e,layout:i,previousRange:M}))??st({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
2
- export{br};
1
+ import{kr,lt,Eo,Sr,_r,Ir}from"./chunk-mkawbqx5.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var wr=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>kr({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=lt({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Eo({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=lt({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Ir({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=lt({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Sr({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=_r({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=lt({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Eo({anchorKey:e,layout:i,previousRange:M}))??lt({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
2
+ export{wr};
@@ -1,2 +1,2 @@
1
- import{s}from"./chunk-0b50jg23.js";import{on}from"./chunk-0bc7gfq4.js";import{O}from"./chunk-kv1v7kgn.js";import{rn,Ae}from"./chunk-m4ds8kjc.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as E}from"lucide-react";import{useEffect as g,useState as A}from"react";import{Input as D}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as w}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function ut(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:r})}function Ie({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:C,PathAction:u}=s(),f=Ae(),y=rn();g(()=>{f(n)},[n,f]);let[I,p]=A(t.title??"");g(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?ut(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(on,{title:n?o(D,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(O,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(E,{className:"size-3.5"}),details:v,actions:l||a!==void 0?h(M,{children:[l,l&&a!==void 0&&o(w,{}),a]}):void 0})}
2
- export{ut,Ie};
1
+ import{s}from"./chunk-pxbww0j1.js";import{ln}from"./chunk-evgfpd16.js";import{O}from"./chunk-kv1v7kgn.js";import{cn,Le}from"./chunk-95f0wens.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as E}from"lucide-react";import{useEffect as g,useState as A}from"react";import{Input as D}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as w}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function ft(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:r})}function Ne({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:C,PathAction:u}=s(),f=Le(),y=cn();g(()=>{f(n)},[n,f]);let[I,p]=A(t.title??"");g(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?ft(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(ln,{title:n?o(D,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(O,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(E,{className:"size-3.5"}),details:v,actions:l||a!==void 0?h(M,{children:[l,l&&a!==void 0&&o(w,{}),a]}):void 0})}
2
+ export{ft,Ne};
@@ -0,0 +1,2 @@
1
+ import{ke}from"./chunk-33fxyn5r.js";import{je,dt}from"./chunk-fzfwftqs.js";import{we}from"./chunk-db8hae9d.js";import{isContentEntry as u,isImage as d,isResourceLink as p,isText as m}from"@nyssance/codex-acp-v2/client";var g=we();function jo(c,l){let a=new Set;for(let e of l){if(e.kind!=="tool"||e.status!=="completed")continue;let s=dt(e),n=s?je(e):e.content.filter(u).map((t)=>t.content),f=(t)=>d(t)||s&&ke(t)!==null;if(!n.some(f))continue;n.forEach((t,i)=>{if(f(t)){if(a.add(`${e.id}:${i}`),p(t))a.add(t.uri)}if(!m(t))return;let r;try{r=JSON.parse(t.text)}catch(o){if(o instanceof SyntaxError)return;throw o}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let o of r.images)if(o!==null&&typeof o==="object"&&typeof o.reference==="string")a.add(o.reference)})}if(a.size===0)return c;return c.map((e)=>{if(!m(e)||!e.text.includes("!["))return e;let s=g.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let f=0;return n.tokens.map((i)=>(f+=i.raw.length,i.type==="image"&&a.has(i.href)?"":i.raw)).join("")+n.raw.slice(f)}).join("");return s===e.text?e:{...e,text:s}}).filter((e)=>!m(e)||e.text.trim().length>0)}
2
+ export{jo};
@@ -1,2 +1,2 @@
1
- import{Xe,sn}from"./chunk-tjt1s9qs.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function fi(o){if(o===null||o===void 0)return Xe();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function Xs(o,{reportError:t=console.error}={}){let e=S(Xe()),r=async()=>{e.setState(fi(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(sn,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function Ys({store:o,children:t}){return w(f,{value:o,children:t})}function no(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function Le(o){let{store:t}=no(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function me(){return no().dispatch}
2
- export{fi,Xs,Ys,no,Le,me};
1
+ import{et,dn}from"./chunk-5qaa4atv.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function bi(o){if(o===null||o===void 0)return et();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function oa(o,{reportError:t=console.error}={}){let e=S(et()),r=async()=>{e.setState(bi(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(dn,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function ia({store:o,children:t}){return w(f,{value:o,children:t})}function ao(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function Oe(o){let{store:t}=ao(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function fe(){return ao().dispatch}
2
+ export{bi,oa,ia,ao,Oe,fe};
@@ -0,0 +1,2 @@
1
+ import{Qi}from"./chunk-y72y3j24.js";import{ve}from"./chunk-sk9rm826.js";var t={chat:Qi,image:ve};function rt(n){return Object.hasOwn(t,n)}function ze(n){if(!rt(n))throw Error(`Unsupported input mode: ${n}`);return t[n]}function ka(n){if(n===null)return"chat";let o=n.mode;if(!rt(o))throw Error(`Unsupported input mode: ${o}`);return t[o].parseConfig(n.config),o}
2
+ export{rt,ze,ka};
@@ -0,0 +1,2 @@
1
+ import{Et,oe}from"./chunk-vnxa4qe2.js";import{ur}from"./chunk-ztrkk6sp.js";import{Po,To,Ft,Ot,Mo}from"./chunk-q8c4k6qh.js";import{cn as P}from"cn";import{ArrowUpIcon as ve,Loader2Icon as Ie,SquareIcon as xe,XIcon as he}from"lucide-react";import{Children as Z,useCallback as h,useEffect as T,useMemo as Pe,useRef as S,useState as Le}from"react";import{flushSync as ye}from"react-dom";import{InputGroup as Fe,InputGroupAddon as te,InputGroupButton as re}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as a,jsxs as Te}from"react/jsx-runtime";function ee(l){let i=new FormData(l).get("message");return typeof i==="string"?i:""}var rr=({className:l,bashMode:i=!1,attachmentPolicy:n,onCommand:f,onSubmitError:L,canSubmit:g,onSubmitAsync:b,accept:M,multiple:ne,globalDrop:E,syncHiddenInput:U,maxFiles:_,maxFileSize:H,onError:v,onSubmit:se,children:ie,...ue})=>{let u=Ot(),p=!!u,ae=i&&p&&u.textInput.value.startsWith("!"),y=S(null),C=S(null),k=S(!1),[le,D]=Le([]),d=p?u.attachments.files:le,B=S(d);B.current=d;let pe=h(()=>{y.current?.click()},[]),O=h((e)=>{if(!M||M.trim()==="")return!0;return M.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let o=t.slice(0,-1);return e.type.startsWith(o)}return e.type===t})},[M]),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""},[]),me=h((e)=>{let r=[...e],t=r.filter((s)=>O(s));if(r.length&&t.length===0){v?.({code:"accept",message:"No files match the accepted types."});return}let o=(s)=>H?s.size<=H:!0,c=t.filter(o);if(t.length>0&&c.length===0){v?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((s)=>{let I=n?n.uniqueFiles(c,s):c,m=typeof _==="number"?Math.max(0,_-s.length):void 0,z=typeof m==="number"?I.slice(0,m):I;if(typeof m==="number"&&I.length>m)v?.({code:"max_files",message:"Too many files. Some were not added."});let V=[];for(let x of z){let Y=n?.sourcePath(x),R=n?.isLocalImage?.(x);V.push({id:crypto.randomUUID(),type:"file",url:R&&x.size===0?"":URL.createObjectURL(x),mediaType:W(x),filename:x.name,size:x.size,lastModified:x.lastModified,...Y===void 0?{}:{sourcePath:Y},...R?{localImage:R}:{}})}return[...s,...V]})},[n,W,O,_,H,v]),ce=h((e)=>D((r)=>{let t=r.find((o)=>o.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((o)=>o.id!==e)}),[]),de=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),G=p?u.attachments.add:me,F=h((e)=>{let r=[...e],t=r.filter((c)=>!(c.type??"").toLowerCase().startsWith("image/"));if(t.length>0){v?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let o=r.reduce((c,s)=>c+(n?.useLocalImages&&n.isLocalImage?.(s)?0:s.size),0);if(o>0){let c=d.filter((s)=>(s.mediaType??"").toLowerCase().startsWith("image/")&&!(n?.useLocalImages&&s.localImage)).reduce((s,I)=>s+(I.size??0),0);if(Et(c,o)){v?.({code:"max_total_size",message:`Total image size must not exceed ${oe}MB.`});return}}G(r)},[d,G,v,n]),q=p?u.attachments.remove:ce,N=p?u.attachments.clear:de,X=p?u.attachments.openFileDialog:pe;T(()=>{if(!p)return;u.__registerFileInput(y,n?.openFileDialog??(()=>y.current?.click()))},[p,u,n]),T(()=>{if(U&&y.current&&d.length===0)y.current.value=""},[d,U]),T(()=>{let e=C.current;if(!e)return;if(E)return;let r=(o)=>{if(o.dataTransfer?.types?.includes("Files"))o.preventDefault()},t=(o)=>{if(o.dataTransfer?.types?.includes("Files"))o.preventDefault();if(o.dataTransfer?.files&&o.dataTransfer.files.length>0)if(n?.onSelectFiles)n.onSelectFiles([...o.dataTransfer.files]);else F(o.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[F,E,n]),T(()=>{if(!E)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)if(n?.onSelectFiles)n.onSelectFiles([...t.dataTransfer.files]);else F(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[F,E,n]),T(()=>()=>{if(!p){for(let e of B.current)if(e.url)URL.revokeObjectURL(e.url)}},[p]);let fe=(e)=>{if(e.currentTarget.files)if(n?.onSelectFiles)n.onSelectFiles([...e.currentTarget.files]);else F(e.currentTarget.files);e.currentTarget.value=""},J=Pe(()=>({files:d.map((e)=>({...e,id:e.id})),add:F,remove:q,clear:N,openFileDialog:X,fileInputRef:y}),[d,F,q,N,X]),A=S({controller:u,files:d,canSubmit:g});A.current={controller:u,files:d,canSubmit:g};let w=S(!0);T(()=>(w.current=!0,()=>{w.current=!1}),[]);let K=async(e)=>{let r=g===void 0?!0:g();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&b===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=C.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let o=p?u.textInput.value:ee(t),c=u?.textInput.getRevision?.(),s=d,I=()=>{if(!w.current)return;let m=A.current;if(m.files!==s)return;if(p){if(c===void 0||m.controller===null||m.controller.textInput.getRevision?.()!==c)return;if(m.controller.textInput.clearSubmitted===void 0)m.controller.textInput.clear();else m.controller.textInput.clearSubmitted()}else if(ee(t)===o)t.reset();N()};k.current=!0;try{if(f?.(o.trim()))return I(),{status:"accepted"};let m=await ur(s,n),z=A.current.canSubmit===void 0?!0:A.current.canSubmit();if(z!==!0)return{status:"blocked",reason:z};if(!w.current)return{status:"blocked",reason:"form_unmounted"};if(m.rejectedCount>0)v?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(b!==void 0)await b({text:o,files:m.files});else if(e!==null)await se({text:o,files:m.files},e);return I(),{status:"accepted"}}finally{k.current=!1}},ge=(e)=>{e.preventDefault(),K(e).catch(L)},be=h((e)=>{if(!e.trim())return;if(p&&u)ye(()=>{u.textInput.setInput(e)});C.current?.requestSubmit()},[u,p]),Q=a(To.Provider,{value:()=>K(null),children:Te(Po.Provider,{value:be,children:[a("input",{accept:n?.onSelectFiles?n.accept:M,"aria-label":"Upload files",className:"hidden",multiple:ne,onChange:fe,ref:y,title:"Upload files",type:"file"}),a("form",{className:P("w-full",l),onSubmit:ge,ref:C,"data-tour":"chat-input",...ue,children:a(Fe,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ae&&"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:ie})})]})});return p?a(Ft.Provider,{value:J,children:Q}):a(Mo.Provider,{value:J,children:Q})};function sr({className:l,...i}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",l),...i})}function ar({className:l,...i}){return a(te,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",l),...i})}function lr({className:l,...i}){return a(te,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",l),...i})}function cr({className:l,...i}){return a("div",{className:P("flex items-center gap-1",l),...i})}var j=({variant:l="ghost",className:i,size:n,collapsed:f=!1,...L})=>{let g=f||Z.count(L.children)<=1?"icon-xs":"xs";return a(re,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(f||Z.count(L.children)<=1)&&"size-7",i),size:g,type:"button",variant:l,...L})},dr=({className:l,variant:i="ghost",size:n="icon-xs",status:f,children:L,...g})=>{let b=a(ve,{className:"size-4"});if(f==="submitted")b=a(Ie,{className:"size-4 animate-spin"});else if(f==="streaming")b=a(xe,{className:"size-3 fill-current"});else if(f==="error")b=a(he,{className:"size-4"});return a(re,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",l),size:n,type:"submit",variant:i,...g,children:L??b})};
2
+ export{rr,sr,ar,lr,cr,j,dr};
@@ -1,2 +1,2 @@
1
- import{A}from"./chunk-vnd6smsp.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as L,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function na({host:e,client:t,children:n}){let[r,l]=f(null);A(r!==null);let{t:u}=e;return i(S,{value:e,children:i(g,{value:t,children:d(C,{value:l,children:[n,i(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(P,{children:[i(H,{children:u("sessionList.deleteTitle")}),i(L,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[i(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),i(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function yi(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function an(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function o(e){let t=a();return x((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
- export{na,s,yi,a,an,o,h};
1
+ import{E}from"./chunk-q8y2a23c.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as L,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function aa({host:e,client:t,children:n}){let[r,l]=f(null);E(r!==null);let{t:u}=e;return i(S,{value:e,children:i(g,{value:t,children:d(C,{value:l,children:[n,i(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(P,{children:[i(H,{children:u("sessionList.deleteTitle")}),i(L,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[i(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),i(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function ki(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function un(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function o(e){let t=a();return x((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{aa,s,ki,a,un,o,h};
@@ -1,2 +1,2 @@
1
- import{invoke as i}from"@tauri-apps/api/core";import{listen as t,once as n,emit as s,emitTo 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)},lo={"providers:changed":{name:"providers:changed",listen:(e)=>t("providers:changed",e),once:(e)=>n("providers:changed",e),emit:(e)=>s("providers:changed",e),emitTo:(e,r)=>a(e,"providers:changed",r)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>t("providers:managed-revoked",e),once:(e)=>n("providers:managed-revoked",e),emit:(e)=>s("providers:managed-revoked",e),emitTo:(e,r)=>a(e,"providers:managed-revoked",r)}};function Ma(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function qa(e){if(Ma(e)||e instanceof Error)return e.message;return String(e)}
2
- export{p,lo,Ma,qa};
1
+ import{invoke as i}from"@tauri-apps/api/core";import{listen as t,once as n,emit as s,emitTo 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)},go={"providers:changed":{name:"providers:changed",listen:(e)=>t("providers:changed",e),once:(e)=>n("providers:changed",e),emit:(e)=>s("providers:changed",e),emitTo:(e,r)=>a(e,"providers:changed",r)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>t("providers:managed-revoked",e),once:(e)=>n("providers:managed-revoked",e),emit:(e)=>s("providers:managed-revoked",e),emitTo:(e,r)=>a(e,"providers:managed-revoked",r)}};function Da(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function Xa(e){if(Da(e)||e instanceof Error)return e.message;return String(e)}
2
+ export{u,go,Da,Xa};
@@ -0,0 +1,2 @@
1
+ import{Ce}from"./chunk-ytkcpeq2.js";import{ke}from"./chunk-33fxyn5r.js";import{w}from"./chunk-4g2412p5.js";import{t,ue}from"./chunk-aj0z9a5r.js";import{isEmbeddedResource as U,isImage as E,isResourceLink as b}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as G,FileIcon as T,ImageOffIcon as z,LoaderCircleIcon as L}from"lucide-react";import{useEffect as S,useState as v}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function Yn(e){let i=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))i=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(i)||"attachment"}catch(a){if(a instanceof URIError)return i||"attachment";throw a}}function Zo(e,i){let a=document.createElement("a");a.href=i,a.download=e,a.click()}function j({reference:e,uri:i}){let{loadGeneratedImage:a,t:d}=t(),[m,f]=v();if(S(()=>{if(!a)return;let u=!0;return a(e).then((r)=>{if(u)f(r)},()=>{if(u)f(null)}),()=>{u=!1}},[a,e]),m===null||!a)return n(C,{block:{type:"resource_link",uri:"codex-image:unavailable",name:i}});if(m===void 0)return n("div",{role:"status","aria-busy":"true",children:n(L,{"aria-label":d("timeline.viewImage"),className:"motion-safe:animate-spin"})});return n(C,{block:{type:"image",uri:i,...m},generated:!0})}function C({block:e,generated:i=!1}){let a=t(),[d,m]=v(!1),[f,u]=v(null);if(b(e)){let p=ke(e);if(i&&p!==null)return n(j,{reference:p,uri:e.uri},p);let B=w(e.uri);if(B!==null)return n(Ce,{app:{id:B,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 x=Yn(e.uri);return s(g,{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(T,{}),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)!==x&&`${x} · `,e.mimeType??x.split(".").at(-1)?.toUpperCase()]})]})]})}if(!U(e)&&!E(e))return null;let r=E(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=Yn(r.uri);if("text"in r)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:r.text}),s(g,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:r.uri,onClick:()=>a.openLink(r.uri),children:[n(T,{}),n("span",{className:"truncate",children:o})]})]});let l=`data:${r.mimeType??"application/octet-stream"};base64,${r.blob}`,y=r.mimeType?.toLowerCase().startsWith("image/")&&f!==l,{openImage:I,openImageGallery:h}=a,N=h?()=>h([{src:l,alt:o,uri:r.uri}],0):I&&(()=>I(l)),c=i&&y,F=async()=>{m(!0);try{if(a.saveFile)await a.saveFile(o,r.blob);else Zo(o,l)}catch(p){ue(a,p)}finally{m(!1)}},R=n("img",{src:l,alt:"",className:i?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>u(l)});return s("div",{className:c?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[y&&(N===void 0?R:n(g,{variant:"ghost",className:i?"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:N,children:R})),s(g,{variant:c?"secondary":"link",size:c?"icon":"sm",className:c?"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:()=>{F()},children:[d?n(L,{className:"motion-safe:animate-spin"}):n(G,{}),!c&&n("span",{className:"truncate",children:o})]})]})}
2
+ export{Yn,Zo,C};
@@ -0,0 +1,2 @@
1
+ import{createContext as f,useCallback as n,useContext as s,useEffect as X,useMemo as _,useRef as x,useState as q}from"react";import{jsx as B}from"react/jsx-runtime";var y=f(null),Po=f(null);function il(){return s(Po)}var To=f(null);function rl(){return s(To)}var Ft=f(null);function ye(){let r=s(y);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Ot=()=>s(y);function sl(){let r=s(Ft);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var Y=()=>s(Ft);function yr({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:A,attachmentPolicy:p,value:R,onValueChange:U,attachments:L,onAttachmentsChange:S,children:G}){let T=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),W=R!==void 0,[J,K]=q(r),a=R??J,i=x({value:a,external:l,revision:0});if(i.current.value!==a||i.current.external!==l)i.current={value:a,external:l,revision:i.current.revision+1};let j=n(()=>i.current.revision,[]),P=n((t)=>{if(i.current.value=t,i.current.revision++,W)U?.(t);else K(t)},[W,U]),h=n(()=>P(""),[P]),I=L!==void 0,[N,Q]=q([]),v=L??N,b=x(v);b.current=v;let u=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(I)S?.(e);else Q(e)},[I,S]),w=x(null),O=x(()=>{}),M=n((t)=>{let e=[...t];if(e.length===0)return;u((m)=>{let d=p===void 0?e:p.uniqueFiles(e,m);return[...m,...d.map((o)=>{let H=p?.sourcePath(o),C=p?.isLocalImage?.(o);return{id:crypto.randomUUID(),type:"file",url:C&&o.size===0?"":URL.createObjectURL(o),mediaType:T(o),filename:o.name,size:o.size,lastModified:o.lastModified,...H===void 0?{}:{sourcePath:H},...C?{localImage:C}:{}}})]})},[p,T,u]),E=n((t)=>{u((e)=>{let m=e.find((d)=>d.id===t);if(m?.url)URL.revokeObjectURL(m.url);return e.filter((d)=>d.id!==t)}),A?.()},[A,u]),k=n(()=>{u((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[u]);X(()=>{if(I)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[I]);let z=n(()=>{O.current?.()},[]),F=_(()=>({files:v,add:M,remove:E,clear:k,openFileDialog:z,fileInputRef:w}),[v,M,E,k,z]),D=n((t,e)=>{w.current=t.current,O.current=e},[]),V=_(()=>({textInput:{value:a,setInput:P,clear:h,getRevision:j,clearSubmitted:c??h},attachments:F,__registerFileInput:D}),[a,P,h,j,c,F,D]);return B(y.Provider,{value:V,children:B(Ft.Provider,{value:F,children:G})})}var Mo=f(null);function g(){let r=Y(),l=s(Mo),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
+ export{Po,il,To,rl,Ft,ye,Ot,sl,yr,Mo,g};
@@ -1,2 +1,2 @@
1
- import{createContext as o,useContext as n,useEffect as r}from"react";var xi=o(null);function A(t){let e=n(xi);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
- export{xi,A};
1
+ import{createContext as o,useContext as n,useEffect as r}from"react";var Si=o(null);function E(t){let e=n(Si);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
+ export{Si,E};
@@ -1,2 +1,2 @@
1
- import{s,a,an,o,h}from"./chunk-0b50jg23.js";import{B}from"./chunk-0bc7gfq4.js";import{Ee}from"./chunk-m4ds8kjc.js";import{Pe}from"./chunk-5h49mv0e.js";import{ut,Ie}from"./chunk-rd51rvde.js";import{hasRename as F}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as D,ArchiveRestoreIcon as x,GitForkIcon as A,PencilIcon as H,Trash2Icon as N}from"lucide-react";import{useRef as R,useState as y}from"react";import{jsx as n,jsxs as b,Fragment as C}from"react/jsx-runtime";function Xn({sessionRow:e,active:p,onSelect:m,onForked:v=m,onHoverCardOpenChange:c,actions:d}){let t=s(),{t:f,i18n:S}=t,k=a(),l=o((i)=>i.runStates[e.sessionId]),I=an(),u=()=>m(e);return n(Ee,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:p,onClick:u,onKeyDown:(i)=>{if(i.key==="Enter"||i.key===" ")i.preventDefault(),u()},media:t.SessionMedia?n(t.SessionMedia,{sessionId:e.sessionId,state:l?.state}):void 0,state:l?.state,interruption:l?.interruption??null,title:e.title??f("sessionList.untitled"),onHoverCardOpenChange:c,hoverCard:n(E,{sessionRow:e,onDelete:()=>I(e),onForked:v,actions:d}),meta:e.updatedAt!==null?n("span",{className:"text-muted-foreground shrink-0 text-xs",children:ut(e.updatedAt,S.language)}):void 0,actions:l!=null?n(Pe,{title:f("sessionList.stop"),onStop:()=>h(t,k.stopSession(e.sessionId))}):void 0})}function E({sessionRow:e,onDelete:p,onForked:m,actions:v}){let c=s(),{t:d}=c,t=a(),f=o((r)=>F(r.agent)),S=o((r)=>r.connection==="ready"&&r.agent?.capabilities?.session?.fork!=null),[k,l]=y(!1),[I,u]=y(!1),i=R(!1);return n(Ie,{sessionRow:e,renaming:k,onRename:(r)=>{if(l(!1),r!==null)h(c,t.renameSession(e.sessionId,r))},actions:b(C,{children:[f&&n(B,{icon:n(H,{}),label:d("sessionList.rename"),onClick:()=>l(!0)}),v,e.archived?n(B,{icon:n(x,{}),label:d("sessionList.unarchive"),onClick:()=>void h(c,t.unarchive(e.sessionId))}):b(C,{children:[n(B,{icon:n(A,{}),label:d("sessionList.fork"),disabled:!S||I,onClick:()=>{if(i.current)return;i.current=!0,u(!0),h(c,t.fork(e.sessionId,e.cwd).then((r)=>{let g=t.state.sessionList.find((L)=>L.sessionId===r);if(!g)throw Error("Forked chat is missing from the session list");m(g)}).finally(()=>{i.current=!1,u(!1)}))}}),n(B,{icon:n(D,{}),label:d("sessionList.archive"),onClick:()=>void h(c,t.archive(e.sessionId))})]}),n(B,{variant:"destructive",icon:n(N,{}),label:d("sessionList.delete"),onClick:p})]})})}
2
- export{Xn};
1
+ import{s,a,un,o,h}from"./chunk-pxbww0j1.js";import{B}from"./chunk-evgfpd16.js";import{De}from"./chunk-95f0wens.js";import{Me}from"./chunk-newkrtrj.js";import{ft,Ne}from"./chunk-p2bn8ypc.js";import{hasRename as F}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as D,ArchiveRestoreIcon as x,GitForkIcon as A,PencilIcon as H,Trash2Icon as N}from"lucide-react";import{useRef as R,useState as y}from"react";import{jsx as n,jsxs as b,Fragment as C}from"react/jsx-runtime";function oo({sessionRow:e,active:p,onSelect:m,onForked:v=m,onHoverCardOpenChange:c,actions:d}){let t=s(),{t:f,i18n:S}=t,k=a(),l=o((i)=>i.runStates[e.sessionId]),I=un(),u=()=>m(e);return n(De,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:p,onClick:u,onKeyDown:(i)=>{if(i.key==="Enter"||i.key===" ")i.preventDefault(),u()},media:t.SessionMedia?n(t.SessionMedia,{sessionId:e.sessionId,state:l?.state}):void 0,state:l?.state,interruption:l?.interruption??null,title:e.title??f("sessionList.untitled"),onHoverCardOpenChange:c,hoverCard:n(E,{sessionRow:e,onDelete:()=>I(e),onForked:v,actions:d}),meta:e.updatedAt!==null?n("span",{className:"text-muted-foreground shrink-0 text-xs",children:ft(e.updatedAt,S.language)}):void 0,actions:l!=null?n(Me,{title:f("sessionList.stop"),onStop:()=>h(t,k.stopSession(e.sessionId))}):void 0})}function E({sessionRow:e,onDelete:p,onForked:m,actions:v}){let c=s(),{t:d}=c,t=a(),f=o((r)=>F(r.agent)),S=o((r)=>r.connection==="ready"&&r.agent?.capabilities?.session?.fork!=null),[k,l]=y(!1),[I,u]=y(!1),i=R(!1);return n(Ne,{sessionRow:e,renaming:k,onRename:(r)=>{if(l(!1),r!==null)h(c,t.renameSession(e.sessionId,r))},actions:b(C,{children:[f&&n(B,{icon:n(H,{}),label:d("sessionList.rename"),onClick:()=>l(!0)}),v,e.archived?n(B,{icon:n(x,{}),label:d("sessionList.unarchive"),onClick:()=>void h(c,t.unarchive(e.sessionId))}):b(C,{children:[n(B,{icon:n(A,{}),label:d("sessionList.fork"),disabled:!S||I,onClick:()=>{if(i.current)return;i.current=!0,u(!0),h(c,t.fork(e.sessionId,e.cwd).then((r)=>{let g=t.state.sessionList.find((L)=>L.sessionId===r);if(!g)throw Error("Forked chat is missing from the session list");m(g)}).finally(()=>{i.current=!1,u(!1)}))}}),n(B,{icon:n(D,{}),label:d("sessionList.archive"),onClick:()=>void h(c,t.archive(e.sessionId))})]}),n(B,{variant:"destructive",icon:n(N,{}),label:d("sessionList.delete"),onClick:p})]})})}
2
+ export{oo};
@@ -1,2 +1,2 @@
1
- import{createStore as r}from"@alwith/api/client";var lt=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function es(e){lt.setState({...e,terminals:e.terminals??{}})}function ts(e){if(lt.getState().sessionId===e)lt.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function ns(e,n,t){let i=lt.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{lt,es,ts,ns};
1
+ import{createStore as r}from"@alwith/api/client";var pt=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function rs(e){pt.setState({...e,terminals:e.terminals??{}})}function ss(e){if(pt.getState().sessionId===e)pt.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function as(e,n,t){let i=pt.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{pt,rs,ss,as};
@@ -0,0 +1,2 @@
1
+ import{qe}from"./chunk-aj0z9a5r.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function Fn({host:o,client:n,children:t}){let s=a(()=>({host:o,client:n}),[o,n]);return r(qe,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function x(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
2
+ export{Fn,e,x};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-kyqf7cqh.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function en({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
2
- export{en};
1
+ import{e}from"./chunk-qgrd5xre.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function an({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
2
+ export{an};
@@ -0,0 +1,2 @@
1
+ import{ne}from"./chunk-whax282d.js";import{b}from"./chunk-veef1avy.js";import{k}from"./chunk-aj0z9a5r.js";import{Pn}from"./chunk-kvgn4b2n.js";import{Ue}from"./chunk-fxzh4f7c.js";import{yn}from"./chunk-bdea3k6b.js";import{Ge}from"./chunk-359pf448.js";import{Dn}from"./chunk-r2b234a7.js";import{Be}from"./chunk-23kvszfc.js";import{Rn,Ln}from"./chunk-k97dpdcj.js";import{isTauri as y}from"@tauri-apps/api/core";import{useMemo as R,useRef as u}from"react";import{jsx as n,jsxs as P,Fragment as O}from"react/jsx-runtime";var f;function M(){return f??=yn(),f}function F({imagesOnly:r,picker:s,openPicker:t,pickFilePaths:l}){let e=Pn();return n(Ln,{imagesOnly:r,picker:s,openPicker:t,pickFilePaths:l,sessionId:e.session.id,enabled:e.inputReady&&!e.sending&&!e.shellMode,onMention:e.addMention,onBusyChange:e.setAdding})}function va({client:r,providers:s,catalog:t,shellCommands:l=!0,imagesOnly:e=!1,pickFilePaths:d,modelMenu:g,children:h,...m}){let p=u(null),a=u(null),c=!e&&d!==void 0&&y(),C=R(()=>({...Rn,useLocalImages:c,...c?{openFileDialog:()=>{if(!a.current)throw Error("The file picker is not ready");a.current()}}:{},accept:e?"image/png,image/jpeg,image/webp,image/gif":void 0,onSelectFiles(o){if(!p.current)throw Error("The file picker is not ready");p.current(o)}}),[e,c]),{session:i}=m,v=k(r.store,(o)=>o.modelRecovery[i.id]??!1);return P(O,{children:[v&&!ne(i.error?.error)&&n(Dn,{client:r,session:i,providers:s??M(),catalog:t},i.id),P(Ue,{modelMenu:g??{defaultGroup:b,catalog:(o)=>Ge(o,t),headerAction:n(Be,{})},...m,attachmentPolicy:C,onShellCommand:l?(o)=>r.executeShell(i.id,o):void 0,children:[n(F,{imagesOnly:e,picker:p,openPicker:a,pickFilePaths:d}),h]})]})}
2
+ export{va};
@@ -1,2 +1,2 @@
1
- import{t,ce}from"./chunk-e4ws15tg.js";import{$o}from"./chunk-38eckxjk.js";import{Bo,Jr}from"./chunk-1md5vq9g.js";import{Qr}from"./chunk-prwzyc7q.js";import{Code as P,Copy as I,Download as k,Eye as B,Maximize2 as L,MoreHorizontal as H,X as O}from"lucide-react";import{useEffect as R,useId as V,useMemo as _,useRef as F,useState as u}from"react";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as A,DialogClose as U,DialogContent as X}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as j,DropdownMenuContent as q,DropdownMenuItem as y,DropdownMenuTrigger as G}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as l,Fragment as K}from"react/jsx-runtime";function J(m){let r=getComputedStyle(m),e=document.createElement("canvas").getContext("2d");if(!e)throw Error("Unable to resolve diagram colors");let i=(p)=>{e.clearRect(0,0,1,1),e.fillStyle=r.backgroundColor,e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);let[n,s,d]=e.getImageData(0,0,1,1).data;return`#${[n,s,d].map((f)=>f.toString(16).padStart(2,"0")).join("")}`};return{background:i(r.backgroundColor),primaryColor:i(r.getPropertyValue("--muted").trim()),primaryTextColor:i(r.color),primaryBorderColor:i(r.getPropertyValue("--border").trim()),lineColor:i(r.getPropertyValue("--muted-foreground").trim())}}function Uo({source:m}){let r=t(),{t:e,theme:i}=r,p=`mermaid-${V().replaceAll(":","")}`,[n,s]=u(null),[d,f]=u(!1),[h,b]=u(!1),[v,C]=u(!1),[x,z]=u(!1),c=F(null),g=_(()=>n===null?null:Bo(n),[n]);R(()=>{let a=!1;return s(null),(async()=>{try{let M=await import("mermaid");if(a||c.current===null)return;let S=M.default;S.initialize({startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,theme:"base",themeVariables:{...J(c.current),darkMode:i==="dark"}});let N=await S.render(p,m);if(!a)s(N.svg)}catch{if(!a)s(null)}})(),()=>{a=!0}},[p,i,m]);let T=async()=>{try{await(r.copyText?r.copyText(m):navigator.clipboard.writeText(m))}catch(a){if(r.onCopyError)r.onCopyError(a);else ce(r,a)}},D=async()=>{if(n===null||c.current===null||v)return;C(!0);try{let a=await Jr(n,getComputedStyle(c.current).backgroundColor);if(r.saveFile)await r.saveFile("mermaid.png",a);else $o("mermaid.png",`data:image/png;base64,${a}`)}catch(a){ce(r,a)}finally{C(!1)}},E=o(w,{variant:"ghost",size:"icon-sm","aria-label":e("mermaid.downloadPng"),title:e("mermaid.downloadPng"),disabled:n===null||v,onClick:()=>void D(),children:o(k,{className:"size-4"})});return l("div",{ref:c,className:"group/mermaid bg-background relative my-3 min-w-0 rounded-lg",children:[l("div",{"data-open":x,className:"absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition-opacity group-focus-within/mermaid:opacity-100 group-hover/mermaid:opacity-100 data-[open=true]:opacity-100 [@media(hover:none)]:opacity-100",children:[l(j,{open:x,onOpenChange:z,children:[o(G,{"aria-label":e("mermaid.options"),title:e("mermaid.options"),render:o(w,{variant:"ghost",size:"icon-sm"}),children:o(H,{className:"size-4"})}),l(q,{align:"end",className:"w-40",children:[l(y,{disabled:n===null,onClick:()=>f((a)=>!a),children:[d?o(B,{}):o(P,{}),d?e("mermaid.viewDiagram"):e("mermaid.viewSource")]}),l(y,{onClick:()=>void T(),children:[o(I,{}),e("mermaid.copySource")]}),l(y,{disabled:n===null||v,onClick:()=>void D(),children:[o(k,{}),e("mermaid.downloadPng")]})]})]}),o(w,{variant:"ghost",size:"icon-sm","aria-label":e("mermaid.expand"),title:e("mermaid.expand"),disabled:n===null,onClick:()=>b(!0),children:o(L,{className:"size-4"})})]}),d||n===null?o("pre",{className:"bg-muted/30 overflow-x-auto rounded-lg p-3 pt-11 text-xs",children:o("code",{children:m})}):o("div",{className:"overflow-x-auto rounded-lg px-3 pt-10 pb-3 [&_svg]:mx-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:n}}),o(A,{open:h&&g!==null,onOpenChange:b,children:o(X,{showCloseButton:!1,className:"bg-background flex h-[calc(100dvh-clamp(1.5rem,10dvh,6rem))] w-[calc(100vw-clamp(1.5rem,10vw,8rem))] max-w-none flex-col gap-2 overflow-hidden p-2 sm:max-w-none sm:p-4",children:h&&g&&o(Qr,{image:g,t:e,actions:l(K,{children:[E,o(U,{"aria-label":e("mermaid.closePreview"),title:e("mermaid.closePreview"),render:o(w,{variant:"ghost",size:"icon-sm"}),children:o(O,{className:"size-4"})})]})},g.src)})})]})}
2
- export{Uo};
1
+ import{t,ue}from"./chunk-aj0z9a5r.js";import{Zo}from"./chunk-q2ykvjrz.js";import{Do,Ur}from"./chunk-jygp7479.js";import{Hr}from"./chunk-epqyjwrh.js";import{Code as P,Copy as I,Download as k,Eye as B,Maximize2 as L,MoreHorizontal as H,X as O}from"lucide-react";import{useEffect as R,useId as V,useMemo as _,useRef as F,useState as u}from"react";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as A,DialogClose as U,DialogContent as X}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as j,DropdownMenuContent as q,DropdownMenuItem as y,DropdownMenuTrigger as G}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as l,Fragment as K}from"react/jsx-runtime";function J(m){let r=getComputedStyle(m),e=document.createElement("canvas").getContext("2d");if(!e)throw Error("Unable to resolve diagram colors");let i=(p)=>{e.clearRect(0,0,1,1),e.fillStyle=r.backgroundColor,e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);let[n,s,d]=e.getImageData(0,0,1,1).data;return`#${[n,s,d].map((f)=>f.toString(16).padStart(2,"0")).join("")}`};return{background:i(r.backgroundColor),primaryColor:i(r.getPropertyValue("--muted").trim()),primaryTextColor:i(r.color),primaryBorderColor:i(r.getPropertyValue("--border").trim()),lineColor:i(r.getPropertyValue("--muted-foreground").trim())}}function Lo({source:m}){let r=t(),{t:e,theme:i}=r,p=`mermaid-${V().replaceAll(":","")}`,[n,s]=u(null),[d,f]=u(!1),[h,b]=u(!1),[v,C]=u(!1),[x,z]=u(!1),c=F(null),g=_(()=>n===null?null:Do(n),[n]);R(()=>{let a=!1;return s(null),(async()=>{try{let M=await import("mermaid");if(a||c.current===null)return;let S=M.default;S.initialize({startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,theme:"base",themeVariables:{...J(c.current),darkMode:i==="dark"}});let N=await S.render(p,m);if(!a)s(N.svg)}catch{if(!a)s(null)}})(),()=>{a=!0}},[p,i,m]);let T=async()=>{try{await(r.copyText?r.copyText(m):navigator.clipboard.writeText(m))}catch(a){if(r.onCopyError)r.onCopyError(a);else ue(r,a)}},D=async()=>{if(n===null||c.current===null||v)return;C(!0);try{let a=await Ur(n,getComputedStyle(c.current).backgroundColor);if(r.saveFile)await r.saveFile("mermaid.png",a);else Zo("mermaid.png",`data:image/png;base64,${a}`)}catch(a){ue(r,a)}finally{C(!1)}},E=o(w,{variant:"ghost",size:"icon-sm","aria-label":e("mermaid.downloadPng"),title:e("mermaid.downloadPng"),disabled:n===null||v,onClick:()=>void D(),children:o(k,{className:"size-4"})});return l("div",{ref:c,className:"group/mermaid bg-background relative my-3 min-w-0 rounded-lg",children:[l("div",{"data-open":x,className:"absolute top-2 right-2 z-10 flex gap-1 opacity-0 transition-opacity group-focus-within/mermaid:opacity-100 group-hover/mermaid:opacity-100 data-[open=true]:opacity-100 [@media(hover:none)]:opacity-100",children:[l(j,{open:x,onOpenChange:z,children:[o(G,{"aria-label":e("mermaid.options"),title:e("mermaid.options"),render:o(w,{variant:"ghost",size:"icon-sm"}),children:o(H,{className:"size-4"})}),l(q,{align:"end",className:"w-40",children:[l(y,{disabled:n===null,onClick:()=>f((a)=>!a),children:[d?o(B,{}):o(P,{}),d?e("mermaid.viewDiagram"):e("mermaid.viewSource")]}),l(y,{onClick:()=>void T(),children:[o(I,{}),e("mermaid.copySource")]}),l(y,{disabled:n===null||v,onClick:()=>void D(),children:[o(k,{}),e("mermaid.downloadPng")]})]})]}),o(w,{variant:"ghost",size:"icon-sm","aria-label":e("mermaid.expand"),title:e("mermaid.expand"),disabled:n===null,onClick:()=>b(!0),children:o(L,{className:"size-4"})})]}),d||n===null?o("pre",{className:"bg-muted/30 overflow-x-auto rounded-lg p-3 pt-11 text-xs",children:o("code",{children:m})}):o("div",{className:"overflow-x-auto rounded-lg px-3 pt-10 pb-3 [&_svg]:mx-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:n}}),o(A,{open:h&&g!==null,onOpenChange:b,children:o(X,{showCloseButton:!1,className:"bg-background flex h-[calc(100dvh-clamp(1.5rem,10dvh,6rem))] w-[calc(100vw-clamp(1.5rem,10vw,8rem))] max-w-none flex-col gap-2 overflow-hidden p-2 sm:max-w-none sm:p-4",children:h&&g&&o(Hr,{image:g,t:e,actions:l(K,{children:[E,o(U,{"aria-label":e("mermaid.closePreview"),title:e("mermaid.closePreview"),render:o(w,{variant:"ghost",size:"icon-sm"}),children:o(O,{className:"size-4"})})]})},g.src)})})]})}
2
+ export{Lo};
@@ -0,0 +1,2 @@
1
+ import{Yt}from"./chunk-dhx1sd4s.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 Ze(e){let t=r.get(e);if(!t)t=Yt(e),r.set(e,t);return t}function Es({host:e,client:t,children:n}){let s=Ze(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 Qe(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function gt(e){let t=Qe();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=Ze(Qe());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Je(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{Ze,Es,d,Qe,gt,i,Je};
@@ -1,2 +1,2 @@
1
- import{w}from"./chunk-e4ws15tg.js";import{e}from"./chunk-kyqf7cqh.js";import{useRef as y,useState as m}from"react";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as f}from"react/jsx-runtime";function An({client:s,session:t}){let{host:r}=e(),[a,l]=m(!1),[d,c]=m(null),i=y(!1),p=w(s.store,(o)=>o.connection==="ready"),v=a||!p||t.restoring;async function g(){if(i.current||!p||t.restoring)return;i.current=!0,c(null),l(!0);try{await s.open(t.id,t.cwd)}catch(o){c(o instanceof Error?o.message:String(o))}finally{i.current=!1,l(!1)}}return f("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 px-4 py-3 text-sm","aria-busy":a,"data-model-recovery":!0,children:[f("div",{className:"min-w-0 flex-1 basis-full",children:[n("p",{children:r.t("provider.modelUnavailable")}),d&&n("p",{role:"alert",className:"text-destructive break-words",children:d})]}),r.openSettings&&n(u,{size:"sm",variant:"outline",onClick:()=>void r.openSettings?.("provider"),children:r.t("settings.provider")}),n(u,{size:"sm",disabled:v,onClick:()=>void g(),children:r.t(t.restoring?"conversation.restoring":"provider.retry")})]})}
2
- export{An};
1
+ import{k}from"./chunk-aj0z9a5r.js";import{e}from"./chunk-qgrd5xre.js";import{useRef as y,useState as m}from"react";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as f}from"react/jsx-runtime";function Dn({client:s,session:t}){let{host:r}=e(),[a,l]=m(!1),[d,c]=m(null),i=y(!1),p=k(s.store,(o)=>o.connection==="ready"),v=a||!p||t.restoring;async function g(){if(i.current||!p||t.restoring)return;i.current=!0,c(null),l(!0);try{await s.open(t.id,t.cwd)}catch(o){c(o instanceof Error?o.message:String(o))}finally{i.current=!1,l(!1)}}return f("div",{className:"text-muted-foreground flex flex-wrap items-center gap-3 px-4 py-3 text-sm","aria-busy":a,"data-model-recovery":!0,children:[f("div",{className:"min-w-0 flex-1 basis-full",children:[n("p",{children:r.t("provider.modelUnavailable")}),d&&n("p",{role:"alert",className:"text-destructive break-words",children:d})]}),r.openSettings&&n(u,{size:"sm",variant:"outline",onClick:()=>void r.openSettings?.("provider"),children:r.t("settings.provider")}),n(u,{size:"sm",disabled:v,onClick:()=>void g(),children:r.t(t.restoring?"conversation.restoring":"provider.retry")})]})}
2
+ export{Dn};
@@ -1,2 +1,2 @@
1
- var a=(e)=>String(e).padStart(2,"0");function Ot(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
- export{Ot};
1
+ var a=(e)=>String(e).padStart(2,"0");function $t(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
+ export{$t};
@@ -1,2 +1,2 @@
1
- import{Ut}from"./chunk-8hm3nkrk.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function pr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Ut({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
- export{pr};
1
+ import{Gt}from"./chunk-k014w2jg.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function fr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Gt({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
+ export{fr};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-e4ws15tg.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function Ra(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function Ir({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=Ra(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
2
- export{Ra,Ir};
1
+ import{t}from"./chunk-aj0z9a5r.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function Ga(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function zr({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=Ga(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
2
+ export{Ga,zr};
@@ -0,0 +1,4 @@
1
+ import{H}from"./chunk-hfjttc7r.js";import{_o,m,_,Zn,Io,Rt}from"./chunk-8yetzgqb.js";import{hr,ko,vr,So}from"./chunk-3kytka7m.js";import{Lt,Dt,Qn}from"./chunk-gw4zbw0m.js";import{ye,g}from"./chunk-q8c4k6qh.js";import{cn as J}from"cn";import{forwardRef as q,useImperativeHandle as z,useLayoutEffect as M,useRef as u}from"react";import{jsx as j}from"react/jsx-runtime";var O=(r,E)=>r.text===E.text&&JSON.stringify(r.apps)===JSON.stringify(E.apps),wo=q((r,E)=>{let I=ye(),U=g(),o=u(null),N=u(null),a=u(_(m({text:I.textInput.value,apps:r.applications}))),p=u({start:r.initialCaret??m(a.current).length,end:r.initialCaret??m(a.current).length}),h=u(r.initialUndo?[{...r.initialUndo,selection:{start:Math.max(0,(r.initialCaret??1)-1),end:Math.max(0,(r.initialCaret??1)-1)}}]:[]),S=u([]),K=u(""),R=u(r.skillIcon),y=u(!1),x=u(!1),P=u(null),d=u({props:r,controller:I});d.current={props:r,controller:I};let f=()=>{if(o.current&&document.activeElement===o.current)p.current=vr(o.current,a.current.apps,p.current);return p.current},w=()=>{let e=o.current;if(!e)return;let t={...p.current};e.focus(),p.current=t,So(e,t)},T=()=>({...a.current,selection:f()}),D=(e,t)=>{if(!o.current)return;if(hr(o.current,e,d.current.props.skillNames,d.current.props.skillIcon),R.current=d.current.props.skillIcon,K.current=JSON.stringify(d.current.props.skillNames??[]),o.current.dataset.empty=String(e.text.length===0&&e.apps.length===0),p.current=t,document.activeElement===o.current)So(o.current,t)},C=(e,t,n=!0,s=!0)=>{if(s&&!O(a.current,e)){if(h.current.push(P.current??T()),h.current.length>100)h.current.shift();S.current=[]}if(P.current=null,a.current=e,p.current=t,n)D(e,t);d.current.props.onApplicationsChange(e.apps),d.current.controller.textInput.setInput(e.text)},b=(e)=>{let t=f(),n=m(a.current),s=m(e),i=new Set([...n.slice(0,t.start),...n.slice(t.end)].flatMap((k)=>typeof k==="string"?[]:[k.id])),c=s.filter((k)=>typeof k==="string"||!i.has(k.id)),l=_([...n.slice(0,t.start),...c,...n.slice(t.end)]),B=t.start+c.length;C(l,{start:B,end:B})},v=(e)=>{let n=(e?h.current:S.current).pop();if(!n)return;(e?S.current:h.current).push(T()),C({text:n.text,apps:n.apps},n.selection,!0,!1)},L=()=>{if(!o.current)return;let e=_(ko(o.current,a.current.apps)),t=f();if(y.current)return;let n=Qn(e.text),s=n===e.text?e:_(m({text:n,apps:e.apps}));C(s,t,n!==e.text)};M(()=>{let e=o.current;if(!e)throw Error("Inline prompt input is missing");Object.defineProperties(e,{value:{configurable:!0,get:()=>a.current.text,set:(i)=>{a.current=_(m({text:i,apps:a.current.apps})),D(a.current,p.current)}},selectionStart:{configurable:!0,get:()=>Zn(m(a.current),f().start)},selectionEnd:{configurable:!0,get:()=>Zn(m(a.current),f().end)},setSelectionRange:{configurable:!0,value:(i,c)=>{let l=m(a.current);p.current={start:Io(l,i),end:Io(l,c)},D(a.current,p.current),e.dispatchEvent(new Event("select"))}},disabled:{configurable:!0,get:()=>Boolean(d.current.props.disabled)},form:{configurable:!0,get:()=>e.closest("form")}}),N.current=e,D(a.current,p.current),w();let n=()=>{f()},s=(i)=>{if(d.current.props.disabled){i.preventDefault();return}if(y.current||i.isComposing)return;if(i.inputType==="historyUndo"||i.inputType==="historyRedo")i.preventDefault(),v(i.inputType==="historyUndo");else if(i.inputType==="insertParagraph"||i.inputType==="insertLineBreak")i.preventDefault(),b({text:`
2
+ `,apps:[]});else P.current=T()};return e.addEventListener("beforeinput",s),e.addEventListener("change",L),document.addEventListener("selectionchange",n),()=>{e.removeEventListener("beforeinput",s),e.removeEventListener("change",L),document.removeEventListener("selectionchange",n),N.current=null}},[]),M(()=>{if(y.current)return;let e=_(m({text:I.textInput.value,apps:r.applications}));if(O(e,a.current)&&K.current===JSON.stringify(r.skillNames??[])&&R.current===r.skillIcon)return;let t=f();a.current=e,D(e,t)},[I.textInput.value,r.applications,r.skillNames,r.skillIcon]),z(E,()=>({focus:w,getTextarea:()=>N.current,isComposing:()=>y.current||x.current,resetHeight:()=>{h.current=[],S.current=[]},insertInvocation:(e)=>{w(),b({text:`${e} `,apps:[]})},insertApplication:(e)=>{if(w(),a.current.apps.some((t)=>t.id===e.id))return;b({text:"",apps:[{...e,offset:0}]})}}),[]);let F=(e)=>{if(y.current||x.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;if(d.current.props.onKeyDown?.(e),e.defaultPrevented)return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")){e.preventDefault(),v(e.key.toLowerCase()==="z"&&!e.shiftKey);return}if(e.key==="Enter"){if(e.preventDefault(),e.shiftKey||e.altKey&&!e.ctrlKey&&!e.metaKey)b({text:`
3
+ `,apps:[]});else{let t=o.current?.closest("form"),n=t?.querySelector('button[type="submit"]');if(n&&!n.disabled)t?.requestSubmit(n)}return}if(e.key==="Backspace"||e.key==="Delete"){let t=f(),n=m(a.current);if(t.start!==t.end){e.preventDefault(),b({text:"",apps:[]});return}let s=Zn(n,t.start),i=H(a.current.text,d.current.props.skillNames??[]).find((l)=>e.key==="Backspace"?l.end===s:l.start===s);if(i){e.preventDefault();let l=t.start-(e.key==="Backspace"?i.name.length:0);C(_([...n.slice(0,l),...n.slice(l+i.name.length)]),{start:l,end:l});return}let c=e.key==="Backspace"?t.start-1:t.start;if(c>=0&&c<n.length&&typeof n[c]!=="string")e.preventDefault(),C(_([...n.slice(0,c),...n.slice(c+1)]),{start:c,end:c})}if(e.key.length===1&&e.key.charCodeAt(0)<32)e.preventDefault()},A=(e)=>{let t=f();if(t.start===t.end)return;let n=m(a.current).slice(t.start,t.end),s=_(n);if(e.preventDefault(),e.clipboardData.setData("text/plain",n.map((i)=>typeof i==="string"?i:`${i.name} `).join("")),e.clipboardData.setData(_o,JSON.stringify({version:1,...s})),e.type==="cut"&&!r.disabled)b({text:"",apps:[]})};return j("div",{ref:o,role:"textbox","aria-multiline":"true","aria-label":r["aria-label"],"aria-disabled":r.disabled||void 0,contentEditable:!r.disabled,suppressContentEditableWarning:!0,"data-chat-input":!0,"data-inline-input":!0,"data-placeholder":r.placeholder,"data-empty":a.current.text.length===0&&a.current.apps.length===0,className:J("bg-chat-input-bg data-[empty=true]:before:text-chat-input-placeholder relative max-h-(--chat-input-max-height) min-w-0 flex-1 overflow-y-auto p-0 pe-2.5 leading-(--chat-input-line-height) break-words whitespace-pre-wrap outline-none data-[empty=true]:before:pointer-events-none data-[empty=true]:before:absolute data-[empty=true]:before:content-[attr(data-placeholder)]",r.className),onInput:L,onKeyDown:F,onCompositionStart:()=>{P.current=T(),y.current=!0,x.current=!1},onCompositionEnd:()=>{y.current=!1,L(),x.current=!0,requestAnimationFrame(()=>{x.current=!1})},onPasteCapture:(e)=>r.onPasteCapture?.(e),onPaste:(e)=>{if(e.defaultPrevented||r.disabled)return;let{imageFiles:t,sawNonImageFile:n}=Lt(e.clipboardData.items);if(e.preventDefault(),t.length){U.add(t);return}if(n&&!Dt(e.clipboardData.items))return;b(Rt(e.clipboardData)??{text:Qn(e.clipboardData.getData("text/plain")),apps:[]})},onCopy:A,onCut:A,onDrop:(e)=>{e.preventDefault()}})});wo.displayName="PromptInputInline";
4
+ export{wo};
@@ -1,2 +1,2 @@
1
- import{B}from"./chunk-0bc7gfq4.js";import{Ae}from"./chunk-m4ds8kjc.js";import{N,ge}from"./chunk-d4jkh19p.js";import{z,se}from"./chunk-tjt1s9qs.js";import{Le,me}from"./chunk-7p0d3rz7.js";import{cn as G}from"cn";import{BoxIcon as S,ChevronRightIcon as U,PlusIcon as E,StarIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as M}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as L,DropdownMenuContent as j,DropdownMenuGroup as y,DropdownMenuItem as k,DropdownMenuRadioGroup as _,DropdownMenuRadioItem as K,DropdownMenuSeparator as q,DropdownMenuTrigger as J}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Q}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a}from"react/jsx-runtime";function pi({sessionId:l,trigger:f,favorite:n=!1,hoverBackground:O=n?"none":void 0,allowRemove:R=!0,submenu:g=!1,className:x,onOpenChange:A}){let{t}=N(),c=me(),T=ge(),H=Ae(),{collections:s,order:C}=Le(),i=C.find((o)=>s[o].sessionIds.includes(l)),[P,F]=d(!1),[w,D]=d(!1),[m,b]=d(""),[r,h]=d(!1),v=(o)=>{if(F(o),H(o),A?.(o),!o)D(!1),b("")},p=(o)=>{h(!0),T(o.then(()=>{v(!1)}).finally(()=>h(!1)))};return a(L,{modal:!1,open:P,onOpenChange:(o,I)=>{if(!o&&w&&I.reason==="trigger-hover"){I.cancel();return}v(o)},children:[e(J,{disabled:r,"data-hover-background":O,openOnHover:n||g,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),onMouseDown:(o)=>{if(n)o.preventBaseUIHandler()},onClick:(o)=>{if(!n)return;o.preventBaseUIHandler(),p(c({type:"favorite",sessionId:l}))},render:f??e(M,{variant:"ghost",size:"icon-sm",className:x,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),children:e(u,{className:G(i!==void 0&&"fill-current")})})}),a(j,{className:"w-56 font-normal",side:g?"inline-end":"bottom",align:g?"start":"end",sideOffset:4,children:[e(y,{children:e(_,{value:i??null,children:C.map((o)=>a(K,{value:o,disabled:r||i===o,closeOnClick:!1,onClick:()=>p(c({type:"add",collectionId:o,sessionId:l})),children:[o===z?e(u,{}):s[o].emoji?e("span",{className:"flex size-4 shrink-0 items-center justify-center text-sm","aria-hidden":"true",children:s[o].emoji}):e(S,{}),e("span",{className:"min-w-0 flex-1 truncate",children:se(s[o],t)})]},o))})}),e(q,{}),a(y,{children:[a(k,{disabled:r,closeOnClick:!1,onClick:()=>D(!0),children:[e(E,{}),t("collection.newCollection")]}),R&&i!==void 0&&a(k,{disabled:r,closeOnClick:!1,onClick:()=>p(c({type:"remove",sessionId:l})),children:[e(u,{}),t("collection.removeFromAll")]})]}),w&&a("form",{className:"flex items-center gap-1 px-2 py-1.5",onSubmit:(o)=>{if(o.preventDefault(),o.stopPropagation(),!m.trim()||r)return;p(c({type:"create",id:`collection-${crypto.randomUUID()}`,name:m,sessionId:l}))},children:[e(Q,{autoFocus:!0,"aria-label":t("collection.collectionName"),placeholder:t("collection.collectionName"),value:m,disabled:r,onChange:(o)=>b(o.target.value),onKeyDown:(o)=>o.stopPropagation(),className:"h-7 min-w-0"}),e(M,{size:"xs",type:"submit",disabled:r||!m.trim(),children:t("collection.confirm")})]})]})]})}function Qs({sessionId:l,allowRemove:f=!0}){let{t:n}=N();return e(pi,{sessionId:l,allowRemove:f,submenu:!0,trigger:e(B,{icon:e(u,{}),label:n("collection.addTo"),trailing:e(U,{className:"rtl:rotate-180"})})})}
2
- export{pi,Qs};
1
+ import{B}from"./chunk-evgfpd16.js";import{Le}from"./chunk-95f0wens.js";import{A,he}from"./chunk-nrfyvzmk.js";import{z,le}from"./chunk-5qaa4atv.js";import{Oe,fe}from"./chunk-ppcwcrdz.js";import{cn as G}from"cn";import{BoxIcon as S,ChevronRightIcon as U,PlusIcon as E,StarIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as M}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as L,DropdownMenuContent as j,DropdownMenuGroup as N,DropdownMenuItem as y,DropdownMenuRadioGroup as _,DropdownMenuRadioItem as K,DropdownMenuSeparator as q,DropdownMenuTrigger as J}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Q}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a}from"react/jsx-runtime";function vi({sessionId:l,trigger:f,favorite:n=!1,hoverBackground:k=n?"none":void 0,allowRemove:O=!0,submenu:g=!1,className:R,onOpenChange:x}){let{t}=A(),c=fe(),T=he(),H=Le(),{collections:s,order:C}=Oe(),i=C.find((o)=>s[o].sessionIds.includes(l)),[P,F]=d(!1),[w,D]=d(!1),[m,b]=d(""),[r,h]=d(!1),v=(o)=>{if(F(o),H(o),x?.(o),!o)D(!1),b("")},p=(o)=>{h(!0),T(o.then(()=>{v(!1)}).finally(()=>h(!1)))};return a(L,{modal:!1,open:P,onOpenChange:(o,I)=>{if(!o&&w&&I.reason==="trigger-hover"){I.cancel();return}v(o)},children:[e(J,{disabled:r,"data-hover-background":k,openOnHover:n||g,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),onMouseDown:(o)=>{if(n)o.preventBaseUIHandler()},onClick:(o)=>{if(!n)return;o.preventBaseUIHandler(),p(c({type:"favorite",sessionId:l}))},render:f??e(M,{variant:"ghost",size:"icon-sm",className:R,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),children:e(u,{className:G(i!==void 0&&"fill-current")})})}),a(j,{className:"w-56 font-normal",side:g?"inline-end":"bottom",align:g?"start":"end",sideOffset:4,children:[e(N,{children:e(_,{value:i??null,children:C.map((o)=>a(K,{value:o,disabled:r||i===o,closeOnClick:!1,onClick:()=>p(c({type:"add",collectionId:o,sessionId:l})),children:[o===z?e(u,{}):s[o].emoji?e("span",{className:"flex size-4 shrink-0 items-center justify-center text-sm","aria-hidden":"true",children:s[o].emoji}):e(S,{}),e("span",{className:"min-w-0 flex-1 truncate",children:le(s[o],t)})]},o))})}),e(q,{}),a(N,{children:[a(y,{disabled:r,closeOnClick:!1,onClick:()=>D(!0),children:[e(E,{}),t("collection.newCollection")]}),O&&i!==void 0&&a(y,{disabled:r,closeOnClick:!1,onClick:()=>p(c({type:"remove",sessionId:l})),children:[e(u,{}),t("collection.removeFromAll")]})]}),w&&a("form",{className:"flex items-center gap-1 px-2 py-1.5",onSubmit:(o)=>{if(o.preventDefault(),o.stopPropagation(),!m.trim()||r)return;p(c({type:"create",id:`collection-${crypto.randomUUID()}`,name:m,sessionId:l}))},children:[e(Q,{autoFocus:!0,"aria-label":t("collection.collectionName"),placeholder:t("collection.collectionName"),value:m,disabled:r,onChange:(o)=>b(o.target.value),onKeyDown:(o)=>o.stopPropagation(),className:"h-7 min-w-0"}),e(M,{size:"xs",type:"submit",disabled:r||!m.trim(),children:t("collection.confirm")})]})]})]})}function ta({sessionId:l,allowRemove:f=!0}){let{t:n}=A();return e(vi,{sessionId:l,allowRemove:f,submenu:!0,trigger:e(B,{icon:e(u,{}),label:n("collection.addTo"),trailing:e(U,{className:"rtl:rotate-180"})})})}
2
+ export{vi,ta};
@@ -1,2 +1,2 @@
1
- import{c}from"./chunk-5rzy2287.js";import{Bt,Xr}from"./chunk-zk395v8p.js";import{le}from"./chunk-e4ws15tg.js";import{Zn,L}from"./chunk-38eckxjk.js";import{useEffect as d,useState as g}from"react";import{jsx as o,jsxs as w}from"react/jsx-runtime";var l=/\.(?:png|jpe?g|gif|webp|bmp|svg|pdf|docx?|xlsx?|pptx?|csv|tsv|zip|tar|gz|mp[34]|wav|ogg|webm|mov)(?:[?#].*)?$/i,u=/\.(?:png|jpe?g|gif|webp|bmp|svg)(?:[?#].*)?$/i;function Wr(e){if(e.type!=="link"&&e.type!=="image"||e.href===void 0)return!1;let r=e.href;return!/^www\.|^\/\//i.test(r)&&!/^[a-z][a-z\d+.-]*:/i.test(r.replace(/^file:/i,""))&&l.test(r)}function h({uri:e,directory:r}){let t=c(),[i,s]=g(),n=Bt(e,r),p=n!==null&&t.loadImage!==void 0&&Xr(r,n);if(d(()=>{if(!p||n===null||t.loadImage===void 0)return;let m=!1;return t.loadImage(n).then((a)=>{let f=/^data:([^;,]+);base64,(.*)$/s.exec(a);if(!f)throw Error("The image preview is not a data URL");if(!m)s({uri:e,mimeType:f[1],data:f[2]})},(a)=>{if(!m)s({uri:e,error:a instanceof Error?a.message:String(a)})}),()=>{m=!0}},[t,n,p,e]),i?.uri!==e)return null;if("error"in i)return o("div",{role:"alert",className:"text-muted-foreground text-xs",children:i.error});return o(L,{block:{type:"image",uri:e,data:i.data,mimeType:i.mimeType}})}function Zr({links:e}){let r=le();return o("div",{className:"codex-markdown-artifacts flex min-w-0 flex-col gap-2","data-wide-markdown-block":"true",children:e.map((t,i)=>{let s=t.text||Zn(t.href);return w("div",{className:"min-w-0",children:[r!==null&&u.test(t.href)&&o(h,{uri:t.href,directory:r}),o(L,{block:{type:"resource_link",uri:t.href,name:s}})]},`${i}-${t.href}`)})})}
2
- export{Wr,Zr};
1
+ import{c}from"./chunk-gk7nn747.js";import{Vt,Qr}from"./chunk-b0zzq2ky.js";import{de}from"./chunk-aj0z9a5r.js";import{Yn,C}from"./chunk-q2ykvjrz.js";import{useEffect as d,useState as g}from"react";import{jsx as o,jsxs as w}from"react/jsx-runtime";var l=/\.(?:png|jpe?g|gif|webp|bmp|svg|pdf|docx?|xlsx?|pptx?|csv|tsv|zip|tar|gz|mp[34]|wav|ogg|webm|mov)(?:[?#].*)?$/i,u=/\.(?:png|jpe?g|gif|webp|bmp|svg)(?:[?#].*)?$/i;function Fr(e){if(e.type!=="link"&&e.type!=="image"||e.href===void 0)return!1;let r=e.href;return!/^www\.|^\/\//i.test(r)&&!/^[a-z][a-z\d+.-]*:/i.test(r.replace(/^file:/i,""))&&l.test(r)}function h({uri:e,directory:r}){let t=c(),[i,s]=g(),n=Vt(e,r),p=n!==null&&t.loadImage!==void 0&&Qr(r,n);if(d(()=>{if(!p||n===null||t.loadImage===void 0)return;let m=!1;return t.loadImage(n).then((a)=>{let f=/^data:([^;,]+);base64,(.*)$/s.exec(a);if(!f)throw Error("The image preview is not a data URL");if(!m)s({uri:e,mimeType:f[1],data:f[2]})},(a)=>{if(!m)s({uri:e,error:a instanceof Error?a.message:String(a)})}),()=>{m=!0}},[t,n,p,e]),i?.uri!==e)return null;if("error"in i)return o("div",{role:"alert",className:"text-muted-foreground text-xs",children:i.error});return o(C,{block:{type:"image",uri:e,data:i.data,mimeType:i.mimeType}})}function Or({links:e}){let r=de();return o("div",{className:"codex-markdown-artifacts flex min-w-0 flex-col gap-2","data-wide-markdown-block":"true",children:e.map((t,i)=>{let s=t.text||Yn(t.href);return w("div",{className:"min-w-0",children:[r!==null&&u.test(t.href)&&o(h,{uri:t.href,directory:r}),o(C,{block:{type:"resource_link",uri:t.href,name:s}})]},`${i}-${t.href}`)})})}
2
+ export{Fr,Or};
@@ -1,2 +1,2 @@
1
- import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var mi={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},gi={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function G({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=mi[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",gi.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
- export{mi,gi,G};
1
+ import{Ping as l}from"ldrs/react";import"ldrs/react/Ping.css";import{cn as i}from"cn";import{jsx as e,jsxs as u}from"react/jsx-runtime";var yi={requires_action:"bg-red-500",running:"bg-yellow-500",done:"bg-blue-500",idle:"bg-green-500"},xi={requires_action:"text-red-500",running:"text-yellow-500",done:"text-blue-500",idle:"text-green-500"};function G({state:n,className:t,pulse:s=!0,title:r}){if(n===void 0)return null;let o=yi[n];if(n==="running"&&s)return u("span",{title:r,className:i("relative inline-flex size-1.5 shrink-0 items-center justify-center",xi.running,t),children:[e("span",{className:"absolute inset-0 flex items-center justify-center",children:e(l,{size:"26",speed:"2",color:"currentColor"})}),e("span",{className:"relative size-1.5 rounded-full bg-current"})]});return e("span",{title:r,className:i("size-2 shrink-0 rounded-full",o,t)})}
2
+ export{yi,xi,G};
@@ -1,2 +1,2 @@
1
- import{H,Vt}from"./chunk-k3fwyr6s.js";import{BlocksIcon as l,BookOpenIcon as m,SquareSlashIcon as d}from"lucide-react";import{createContext as p,useContext as i}from"react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var Jn=p({names:[]});function Qo({kind:n,name:r}){let{icon:c}=i(Jn),s=n==="skill"?c?.(r):void 0;return f("span",{className:Vt,children:[s?o("img",{src:s,alt:"","aria-hidden":"true",className:"size-3.5 shrink-0 self-center object-contain"}):o(n==="skill"?m:n==="command"?d:l,{className:"size-3.5 shrink-0 self-center","aria-hidden":"true"}),o("span",{children:r})]})}function ys({text:n,children:r}){let{names:c}=i(Jn),s=H(n,c);if(!s.length)return r;let t=[],a=0;for(let e of s)t.push(n.slice(a,e.start)),t.push(o("span",{"data-skill-reference":e.kind==="skill"?e.name:void 0,"data-command-reference":e.kind==="command"?e.name:void 0,children:o(Qo,{kind:e.kind,name:e.name.slice(1)})},e.start)),a=e.end;return t.push(n.slice(a)),t}
2
- export{Jn,Qo,ys};
1
+ import{H,qt}from"./chunk-hfjttc7r.js";import{BlocksIcon as l,BookOpenIcon as m,SquareSlashIcon as d}from"lucide-react";import{createContext as p,useContext as i}from"react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var no=p({names:[]});function ti({kind:n,name:r}){let{icon:c}=i(no),s=n==="skill"?c?.(r):void 0;return f("span",{className:qt,children:[s?o("img",{src:s,alt:"","aria-hidden":"true",className:"size-3.5 shrink-0 self-center object-contain"}):o(n==="skill"?m:n==="command"?d:l,{className:"size-3.5 shrink-0 self-center","aria-hidden":"true"}),o("span",{children:r})]})}function ks({text:n,children:r}){let{names:c}=i(no),s=H(n,c);if(!s.length)return r;let t=[],a=0;for(let e of s)t.push(n.slice(a,e.start)),t.push(o("span",{"data-skill-reference":e.kind==="skill"?e.name:void 0,"data-command-reference":e.kind==="command"?e.name:void 0,children:o(ti,{kind:e.kind,name:e.name.slice(1)})},e.start)),a=e.end;return t.push(n.slice(a)),t}
2
+ export{no,ti,ks};
@@ -1,2 +1,2 @@
1
- import{u}from"./chunk-b5g055qp.js";import{cn as o}from"cn";import{motion as v}from"motion/react";import{jsx as i,jsxs as g}from"react/jsx-runtime";function pt({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&u,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function Vs({tabs:n,view:r,onViewChange:s,onReset:a,notifications:l,trailing:p,className:d}){return g("div",{className:o("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",d),children:[i("div",{role:"tablist",className:"bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-52 flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]",children:n.map((e)=>{let t=r===e.key;return g(pt,{role:"tab",active:t,expanded:t,highlight:!1,"aria-selected":t,title:e.title,onClick:()=>s(e.key),onDoubleClick:a&&(()=>a(e.key)),className:o("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-[18px] [&_svg]:shrink-0",t?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[t&&i(v.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-destructive pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:o("relative z-10 grid",t?"ms-1.5 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})}),p!=null&&i("div",{className:"ms-auto flex shrink-0 items-center gap-0.5",children:p})]})}
2
- export{pt,Vs};
1
+ import{p}from"./chunk-vgxvtmja.js";import{cn as o}from"cn";import{motion as v}from"motion/react";import{jsx as i,jsxs as d}from"react/jsx-runtime";function ht({active:n,expanded:r=!1,highlight:s=!0,className:a,...l}){return i("button",{type:"button","data-active":n?"":void 0,"aria-current":n?"page":void 0,className:o(s&&p,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)]":"size-[var(--navigation-row-height,30px)]",a),...l})}function Ws({tabs:n,view:r,onViewChange:s,onReset:a,notifications:l,trailing:g,className:u}){return d("div",{className:o("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",u),children:[i("div",{role:"tablist",className:"bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-52 flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]",children:n.map((e)=>{let t=r===e.key;return d(ht,{role:"tab",active:t,expanded:t,highlight:!1,"aria-selected":t,title:e.title,onClick:()=>s(e.key),onDoubleClick:a&&(()=>a(e.key)),className:o("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-[18px] [&_svg]:shrink-0",t?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[t&&i(v.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-destructive pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:o("relative z-10 grid",t?"ms-1.5 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})}),g!=null&&i("div",{className:"ms-auto flex shrink-0 items-center gap-0.5",children:g})]})}
2
+ export{ht,Ws};
@@ -1,2 +1,2 @@
1
- class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function Kr(i,e){return n??=new s,n.connect(i,e)}
2
- export{Kr};
1
+ class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function Lr(i,e){return n??=new s,n.connect(i,e)}
2
+ export{Lr};