@alwith/module-chat 0.6.33 → 0.6.34

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 (446) hide show
  1. package/README.md +1 -1
  2. package/assets/catalogs/deepseek/models.json +4 -66
  3. package/assets/catalogs/doubao/models.json +92 -0
  4. package/assets/catalogs/doubao-coding/models.json +92 -0
  5. package/assets/catalogs/kimi/models.json +84 -0
  6. package/assets/catalogs/minimax/models.json +79 -0
  7. package/assets/catalogs/qwen/models.json +10 -201
  8. package/assets/catalogs/xai/models.json +4 -77
  9. package/assets/catalogs/zhipu/models.json +83 -0
  10. package/assets/provider-catalog.json +130 -58
  11. package/assets/provider-models.v1.json +379 -0
  12. package/dist/activity-host.js +1 -1
  13. package/dist/agent/client.js +1 -1
  14. package/dist/agent/custom-model-effort.d.ts +1 -1
  15. package/dist/agent/custom-model-effort.js +1 -1
  16. package/dist/agent/fork-title.js +1 -1
  17. package/dist/agent/image-request.js +1 -1
  18. package/dist/agent/image-tools.js +1 -1
  19. package/dist/agent/input-config.js +1 -1
  20. package/dist/agent/input-modes/chat.js +1 -1
  21. package/dist/agent/input-modes/execution-meta.js +1 -1
  22. package/dist/agent/input-modes/image-context.js +1 -1
  23. package/dist/agent/input-modes/image.js +1 -1
  24. package/dist/agent/input-modes/index.js +1 -1
  25. package/dist/agent/project-path.js +1 -1
  26. package/dist/agent/request-error.js +1 -1
  27. package/dist/agent/session-list-refresh.js +1 -1
  28. package/dist/app-reference.js +1 -1
  29. package/dist/application-tools.js +1 -1
  30. package/dist/approval/choice-elicitation-form.js +1 -1
  31. package/dist/approval/choice-schema.js +1 -1
  32. package/dist/approval/permission-options.js +1 -1
  33. package/dist/approval/permission-view.js +1 -1
  34. package/dist/approval/schema-elicitation-form.js +1 -1
  35. package/dist/approval/url-elicitation-card.js +1 -1
  36. package/dist/{chunk-1y5zgya3.js → chunk-0a3tr9ws.js} +2 -2
  37. package/dist/{chunk-af0e5epn.js → chunk-0b50jg23.js} +2 -2
  38. package/dist/{chunk-e31s069c.js → chunk-0bc7gfq4.js} +2 -2
  39. package/dist/{chunk-23r2z6bp.js → chunk-0kaa9dja.js} +2 -2
  40. package/dist/{chunk-y2bb2ey4.js → chunk-0myfs71s.js} +2 -2
  41. package/dist/{chunk-mahky9ad.js → chunk-0t4fcgge.js} +2 -2
  42. package/dist/{chunk-9b8gnrcb.js → chunk-103z8myv.js} +2 -2
  43. package/dist/{chunk-fxdkhe0d.js → chunk-11kkxd6v.js} +2 -2
  44. package/dist/{chunk-w2z3sxdq.js → chunk-19jh646d.js} +2 -2
  45. package/dist/{chunk-b7gntaap.js → chunk-19jwgexv.js} +3 -3
  46. package/dist/{chunk-2d4zb2ac.js → chunk-1d29gnb2.js} +2 -2
  47. package/dist/{chunk-84zzf0ys.js → chunk-1gb1vwvy.js} +2 -2
  48. package/dist/{chunk-zmr5pwhd.js → chunk-1md5vq9g.js} +2 -2
  49. package/dist/chunk-1p3ekdt4.js +2 -0
  50. package/dist/chunk-1xgm6fpr.js +2 -0
  51. package/dist/{chunk-egbb5295.js → chunk-2016dacx.js} +2 -2
  52. package/dist/{chunk-mfrg4vze.js → chunk-28nsjq3w.js} +3 -3
  53. package/dist/{chunk-11kv54bx.js → chunk-2dnzdsrv.js} +3 -3
  54. package/dist/{chunk-xjbf9h6m.js → chunk-2eceheqt.js} +3 -3
  55. package/dist/{chunk-jfyz3rx6.js → chunk-2rjg9fs9.js} +2 -2
  56. package/dist/{chunk-2ay0m7xn.js → chunk-2s0jckfr.js} +2 -2
  57. package/dist/{chunk-8at9k0cn.js → chunk-3272z6sv.js} +2 -2
  58. package/dist/{chunk-ekfs7wrp.js → chunk-38eckxjk.js} +2 -2
  59. package/dist/{chunk-pe6ex52z.js → chunk-45yrj0e1.js} +4 -4
  60. package/dist/{chunk-zyermn00.js → chunk-4jza4wwy.js} +2 -2
  61. package/dist/{chunk-q988bycf.js → chunk-4wm5emgf.js} +2 -2
  62. package/dist/{chunk-nec3tcjh.js → chunk-52wrk1mh.js} +2 -2
  63. package/dist/{chunk-mfmh7ztq.js → chunk-54j6xftt.js} +2 -2
  64. package/dist/{chunk-hzcerz8j.js → chunk-56jqg70p.js} +1 -1
  65. package/dist/{chunk-nqt9gyz9.js → chunk-5h49mv0e.js} +2 -2
  66. package/dist/{chunk-06mvwewp.js → chunk-5rzy2287.js} +2 -2
  67. package/dist/{chunk-r84xcy0d.js → chunk-5x2aqmhm.js} +2 -2
  68. package/dist/{chunk-3y9az4b9.js → chunk-64apxzn7.js} +2 -2
  69. package/dist/{chunk-hj8nkk6a.js → chunk-68afy8mk.js} +2 -2
  70. package/dist/{chunk-h3geg09z.js → chunk-69tgmjdb.js} +2 -2
  71. package/dist/chunk-6cedp3k2.js +2 -0
  72. package/dist/{chunk-69965ctr.js → chunk-6eg26dz5.js} +3 -3
  73. package/dist/{chunk-kn1j4cy1.js → chunk-6h10jana.js} +2 -2
  74. package/dist/{chunk-7a806p3q.js → chunk-6nbqbjnb.js} +3 -3
  75. package/dist/{chunk-k76s8cq2.js → chunk-72xm1tz1.js} +2 -2
  76. package/dist/{chunk-m31f2m2y.js → chunk-75xtk0a3.js} +2 -2
  77. package/dist/chunk-7hhc8y2n.js +2 -0
  78. package/dist/{chunk-pd5yrdg6.js → chunk-7m8hw6gh.js} +2 -2
  79. package/dist/{chunk-k1f40yn4.js → chunk-7p0d3rz7.js} +2 -2
  80. package/dist/{chunk-h77c4pnj.js → chunk-7xsrqwvt.js} +2 -2
  81. package/dist/{chunk-askwff3a.js → chunk-81xwn9e5.js} +3 -3
  82. package/dist/{chunk-yw927w3q.js → chunk-84p483n0.js} +2 -2
  83. package/dist/{chunk-3dvxhfcr.js → chunk-86tpa1nn.js} +2 -2
  84. package/dist/{chunk-vcj2jfnz.js → chunk-88ysxbdh.js} +2 -2
  85. package/dist/{chunk-7z1k4s4f.js → chunk-89gyxwmd.js} +1 -1
  86. package/dist/{chunk-zwpv75f4.js → chunk-8gas4q2s.js} +2 -2
  87. package/dist/{chunk-hpv8x22r.js → chunk-8hm3nkrk.js} +2 -2
  88. package/dist/{chunk-basmnv1z.js → chunk-8sa6xn88.js} +2 -2
  89. package/dist/{chunk-pyqhwz2d.js → chunk-8w08gd0y.js} +3 -3
  90. package/dist/{chunk-6yx869ht.js → chunk-965sngjd.js} +2 -2
  91. package/dist/{chunk-j9f4mh66.js → chunk-9jth6sk7.js} +2 -2
  92. package/dist/chunk-9s8ht9xe.js +2 -0
  93. package/dist/{chunk-ep9z16w6.js → chunk-9t672hzm.js} +2 -2
  94. package/dist/{chunk-bf7sgpzq.js → chunk-9x70f7zv.js} +2 -2
  95. package/dist/{chunk-5jvpeww3.js → chunk-9y0fxq8e.js} +2 -2
  96. package/dist/{chunk-544g9fky.js → chunk-a18avvt2.js} +2 -2
  97. package/dist/{chunk-0zncrzar.js → chunk-ad53zbdb.js} +2 -2
  98. package/dist/{chunk-y47sn7w2.js → chunk-arr0hypp.js} +2 -2
  99. package/dist/{chunk-m8243rnx.js → chunk-as2j0yp0.js} +2 -2
  100. package/dist/{chunk-gh1rtwrb.js → chunk-at25g15n.js} +2 -2
  101. package/dist/{chunk-k3h77wtz.js → chunk-b6sb3akb.js} +2 -2
  102. package/dist/{chunk-5f7t16kj.js → chunk-b9v0vew6.js} +2 -2
  103. package/dist/chunk-bhajnmtf.js +2 -0
  104. package/dist/{chunk-ma6ycen5.js → chunk-bq31dzpj.js} +2 -2
  105. package/dist/{chunk-eb78ebxa.js → chunk-bqbyjazm.js} +2 -2
  106. package/dist/{chunk-3a8qwbgh.js → chunk-bsb08p49.js} +3 -3
  107. package/dist/{chunk-3vdx0cme.js → chunk-cef598jy.js} +2 -2
  108. package/dist/{chunk-hwppy236.js → chunk-ckbqdg1s.js} +2 -2
  109. package/dist/chunk-cmfcnze3.js +4 -0
  110. package/dist/chunk-d4jkh19p.js +2 -0
  111. package/dist/{chunk-pxbr08fz.js → chunk-dcvmc9hn.js} +2 -2
  112. package/dist/{chunk-akgjyyz8.js → chunk-dhn9f10w.js} +2 -2
  113. package/dist/{chunk-v92wj4tv.js → chunk-dn8xcv31.js} +2 -2
  114. package/dist/{chunk-rhptdqpp.js → chunk-dqjhmzjy.js} +1 -1
  115. package/dist/chunk-dwv3z2sk.js +2 -0
  116. package/dist/{chunk-cy5kh1yr.js → chunk-dwxmgsg8.js} +2 -2
  117. package/dist/{chunk-spqfmr4z.js → chunk-dxwbgg69.js} +2 -2
  118. package/dist/chunk-e4ws15tg.js +2 -0
  119. package/dist/{chunk-x0etjzy8.js → chunk-e84mhse2.js} +3 -3
  120. package/dist/chunk-e8bazy7m.js +2 -0
  121. package/dist/chunk-eaxevj9t.js +2 -0
  122. package/dist/{chunk-4z6gyvy3.js → chunk-eqa6cd7b.js} +2 -2
  123. package/dist/{chunk-02sj8dwy.js → chunk-erdrx47j.js} +1 -1
  124. package/dist/chunk-f0hb6t2w.js +2 -0
  125. package/dist/{chunk-a0qy1r02.js → chunk-f67e77e6.js} +2 -2
  126. package/dist/{chunk-nf7q3crw.js → chunk-f6cexkjm.js} +2 -2
  127. package/dist/chunk-fcy6mh2e.js +2 -0
  128. package/dist/{chunk-705j0x4q.js → chunk-fwn521m5.js} +2 -2
  129. package/dist/{chunk-3dbxzwcz.js → chunk-g1de763m.js} +2 -2
  130. package/dist/chunk-g7dxg38a.js +2 -0
  131. package/dist/{chunk-n96z8etk.js → chunk-g947bnqx.js} +2 -2
  132. package/dist/{chunk-ypdh88cj.js → chunk-gfkx1z04.js} +2 -2
  133. package/dist/{chunk-qm0zd4wj.js → chunk-gktjkghg.js} +2 -2
  134. package/dist/chunk-gs0b02g2.js +2 -0
  135. package/dist/{chunk-33bd1ey8.js → chunk-h4xx90s4.js} +2 -2
  136. package/dist/{chunk-5e575zvm.js → chunk-hs98zk6m.js} +2 -2
  137. package/dist/{chunk-036wyz4n.js → chunk-j4ejwthn.js} +2 -2
  138. package/dist/{chunk-abbpbnjj.js → chunk-jaghs2z5.js} +2 -2
  139. package/dist/{chunk-fbrv2v3t.js → chunk-jf7em132.js} +1 -1
  140. package/dist/chunk-k2xs8svj.js +2 -0
  141. package/dist/{chunk-zvfad5gd.js → chunk-k3fwyr6s.js} +2 -2
  142. package/dist/{chunk-wbnmcagf.js → chunk-k5kzw2px.js} +3 -3
  143. package/dist/{chunk-j4w2hbbe.js → chunk-kbzsn9xw.js} +2 -2
  144. package/dist/{chunk-7hfd7hnm.js → chunk-kj3a1k2q.js} +2 -2
  145. package/dist/{chunk-exrt8sd0.js → chunk-ks22p0wq.js} +2 -2
  146. package/dist/chunk-ksq9a3pf.js +2 -0
  147. package/dist/{chunk-fer4r3b8.js → chunk-kv3hsfyk.js} +2 -2
  148. package/dist/{chunk-b89bzpce.js → chunk-kyqf7cqh.js} +2 -2
  149. package/dist/{chunk-qm9c9sd7.js → chunk-m4ds8kjc.js} +2 -2
  150. package/dist/{chunk-rfkgks0a.js → chunk-m6sdmcpj.js} +2 -2
  151. package/dist/{chunk-djqexpgf.js → chunk-masqfje4.js} +2 -2
  152. package/dist/{chunk-znafsq0a.js → chunk-mfkrs2at.js} +2 -2
  153. package/dist/{chunk-3d3z6dam.js → chunk-mhhtcbh9.js} +2 -2
  154. package/dist/{chunk-ggxdrm0c.js → chunk-mmrwaa9h.js} +2 -2
  155. package/dist/{chunk-y81242w2.js → chunk-mq0npf36.js} +2 -2
  156. package/dist/{chunk-x4brdfv3.js → chunk-mrwawq46.js} +2 -2
  157. package/dist/{chunk-p72pzfww.js → chunk-mt01qph9.js} +2 -2
  158. package/dist/chunk-n88j8hsd.js +2 -0
  159. package/dist/{chunk-f84mdhkx.js → chunk-n8fe2njr.js} +2 -2
  160. package/dist/{chunk-xmesmh1h.js → chunk-nef7y6mg.js} +2 -2
  161. package/dist/{chunk-016v1nnv.js → chunk-nhz4egjh.js} +3 -3
  162. package/dist/chunk-nvsws1yg.js +2 -0
  163. package/dist/{chunk-srqs8z90.js → chunk-p02bdewy.js} +2 -2
  164. package/dist/{chunk-7r3k37ys.js → chunk-p216frcj.js} +2 -2
  165. package/dist/{chunk-cr0pb6g0.js → chunk-pae2hjvq.js} +2 -2
  166. package/dist/{chunk-8zsta2p3.js → chunk-pr6qwqpj.js} +2 -2
  167. package/dist/{chunk-3eetka54.js → chunk-pr7xj1fn.js} +2 -2
  168. package/dist/{chunk-kvwyryw2.js → chunk-prwzyc7q.js} +2 -2
  169. package/dist/{chunk-tzb4b5ve.js → chunk-ptdx40ae.js} +2 -2
  170. package/dist/{chunk-hjbq9ez1.js → chunk-q61xz251.js} +2 -2
  171. package/dist/{chunk-fy8dmpv3.js → chunk-q78ng7mn.js} +2 -2
  172. package/dist/{chunk-kx9nnmwb.js → chunk-qd9s7wmj.js} +3 -3
  173. package/dist/{chunk-f8bx4etj.js → chunk-qwjz3jsz.js} +2 -2
  174. package/dist/{chunk-4vfrxhj4.js → chunk-r0dg1bjd.js} +2 -2
  175. package/dist/{chunk-kdcde4s5.js → chunk-r5q65gf3.js} +2 -2
  176. package/dist/{chunk-ky3n1mza.js → chunk-r7g85s0a.js} +2 -2
  177. package/dist/{chunk-v6x7x69b.js → chunk-r8gnmyb1.js} +2 -2
  178. package/dist/{chunk-51s7qck0.js → chunk-r8sq654w.js} +2 -2
  179. package/dist/{chunk-g2ew3jg9.js → chunk-rd51rvde.js} +2 -2
  180. package/dist/{chunk-46bgwhx8.js → chunk-re4vc51w.js} +2 -2
  181. package/dist/{chunk-mjd3839j.js → chunk-rr5ek064.js} +2 -2
  182. package/dist/{chunk-9pm3vzgx.js → chunk-rt9dn0b3.js} +3 -3
  183. package/dist/{chunk-cfj92m1y.js → chunk-sbyp6k8w.js} +2 -2
  184. package/dist/{chunk-12bfnfbk.js → chunk-sgmh6sa8.js} +2 -2
  185. package/dist/{chunk-5p53j8mf.js → chunk-ske5z0gp.js} +2 -2
  186. package/dist/chunk-t1qj0vqe.js +2 -0
  187. package/dist/{chunk-5hjk7xnq.js → chunk-t2ej667n.js} +2 -2
  188. package/dist/{chunk-1jxvmsgm.js → chunk-tab23kkx.js} +2 -2
  189. package/dist/{chunk-enc99kvz.js → chunk-tj0530fn.js} +2 -2
  190. package/dist/{chunk-2ad4fb9z.js → chunk-tjt1s9qs.js} +2 -2
  191. package/dist/{chunk-8q5zwkry.js → chunk-tz1gzwas.js} +2 -2
  192. package/dist/{chunk-c4rptwfx.js → chunk-v4tznge3.js} +3 -3
  193. package/dist/{chunk-tszqev50.js → chunk-vab1ysnz.js} +2 -2
  194. package/dist/{chunk-xg6ayxsy.js → chunk-vb9mn75j.js} +2 -2
  195. package/dist/{chunk-e6wq8gef.js → chunk-vedvkp9e.js} +3 -3
  196. package/dist/{chunk-pe79c1re.js → chunk-vgea7ggq.js} +2 -2
  197. package/dist/{chunk-1pnbntv2.js → chunk-vnd6smsp.js} +2 -2
  198. package/dist/{chunk-x4bzkzbt.js → chunk-vys8kfkp.js} +2 -2
  199. package/dist/{chunk-twwcd2qv.js → chunk-w1ga47ww.js} +2 -2
  200. package/dist/{chunk-cjj5bxdb.js → chunk-w2bgfpdh.js} +2 -2
  201. package/dist/{chunk-1jznzjzn.js → chunk-w83nb5a8.js} +2 -2
  202. package/dist/{chunk-d9q9qgm1.js → chunk-wj9s8331.js} +2 -2
  203. package/dist/chunk-wjgrrfq9.js +2 -0
  204. package/dist/{chunk-p6ffd8yn.js → chunk-wpacvdsv.js} +2 -2
  205. package/dist/{chunk-b7ze9dje.js → chunk-wvm6ppb3.js} +2 -2
  206. package/dist/{chunk-wkbxdz82.js → chunk-x2wcwpw3.js} +2 -2
  207. package/dist/{chunk-82e3194f.js → chunk-x2x9g6vk.js} +2 -2
  208. package/dist/{chunk-p9x6rya1.js → chunk-x49qjrbk.js} +2 -2
  209. package/dist/{chunk-chg6j0zg.js → chunk-x6spt0mc.js} +2 -2
  210. package/dist/{chunk-9m36e0yq.js → chunk-xqb4thy8.js} +2 -2
  211. package/dist/{chunk-enbvjbcm.js → chunk-xqqk85kd.js} +2 -2
  212. package/dist/{chunk-tftgnw1w.js → chunk-y0rnvmrw.js} +2 -2
  213. package/dist/{chunk-vqqafkcx.js → chunk-y8p2dmw3.js} +2 -2
  214. package/dist/{chunk-7f5xngd2.js → chunk-ygaqqwmb.js} +2 -2
  215. package/dist/{chunk-r8gfcyeb.js → chunk-yq4wz4n8.js} +2 -2
  216. package/dist/{chunk-3myhs627.js → chunk-yvzkb5p5.js} +2 -2
  217. package/dist/{chunk-xckysrk7.js → chunk-z0q7ghbg.js} +2 -2
  218. package/dist/{chunk-qmx3t5he.js → chunk-z6tw9cf9.js} +2 -2
  219. package/dist/{chunk-p9226dye.js → chunk-z6x70w62.js} +2 -2
  220. package/dist/{chunk-rej2s2c0.js → chunk-z8b3nz7t.js} +2 -2
  221. package/dist/{chunk-67a3eqhg.js → chunk-zb0m2cqy.js} +2 -2
  222. package/dist/{chunk-68a1sgrr.js → chunk-zea1chz7.js} +3 -3
  223. package/dist/{chunk-c531krny.js → chunk-zg0tv3sj.js} +3 -3
  224. package/dist/{chunk-rsbced6k.js → chunk-zk395v8p.js} +2 -2
  225. package/dist/{chunk-zhf7403q.js → chunk-zqpcrtde.js} +2 -2
  226. package/dist/{chunk-pwk7epmy.js → chunk-zv3bm3np.js} +2 -2
  227. package/dist/{chunk-jhaf3qtt.js → chunk-zy6qme7n.js} +2 -2
  228. package/dist/{chunk-4hasepkm.js → chunk-zyn0ys4m.js} +2 -2
  229. package/dist/{chunk-tss25z64.js → chunk-zyyn9t8n.js} +3 -3
  230. package/dist/client.js +1 -1
  231. package/dist/codex/activity-group.js +1 -1
  232. package/dist/codex/artifact-links.js +1 -1
  233. package/dist/codex/assistant-message.js +1 -1
  234. package/dist/codex/async-question-card.js +1 -1
  235. package/dist/codex/edited-files-card.js +1 -1
  236. package/dist/codex/image-view-activity.js +1 -1
  237. package/dist/codex/markdown-renderer.js +1 -1
  238. package/dist/codex/navigation-audio.js +1 -1
  239. package/dist/codex/navigation-preview.js +1 -1
  240. package/dist/codex/navigation-rail.js +1 -1
  241. package/dist/codex/patch-view.js +1 -1
  242. package/dist/codex/timeline-virtualizer.js +1 -1
  243. package/dist/codex/turn-activity.js +1 -1
  244. package/dist/codex/user-message.js +1 -1
  245. package/dist/codex/virtualized-turn-list.js +1 -1
  246. package/dist/collections/collection-emoji.js +1 -1
  247. package/dist/collections/collection-menu.js +1 -1
  248. package/dist/collections/collection-panel.js +1 -1
  249. package/dist/collections/collections.js +1 -1
  250. package/dist/collections/host.js +1 -1
  251. package/dist/collections/locales.js +1 -1
  252. package/dist/collections/model.js +1 -1
  253. package/dist/collections/store.js +1 -1
  254. package/dist/composer/completion-filter.js +1 -1
  255. package/dist/composer/completion-menu.js +1 -1
  256. package/dist/composer/completion-trigger.js +1 -1
  257. package/dist/composer/effort-slider.js +1 -1
  258. package/dist/composer/inline-document.js +1 -1
  259. package/dist/composer/inline-dom.js +1 -1
  260. package/dist/composer/model-select.js +1 -1
  261. package/dist/composer/permission-mode-select.js +1 -1
  262. package/dist/composer/prompt-input-attachments.js +1 -1
  263. package/dist/composer/prompt-input-clipboard.js +1 -1
  264. package/dist/composer/prompt-input-context.js +1 -1
  265. package/dist/composer/prompt-input-inline.js +1 -1
  266. package/dist/composer/prompt-input-textarea.js +1 -1
  267. package/dist/composer/prompt-input.js +1 -1
  268. package/dist/conversation/action-card.js +1 -1
  269. package/dist/conversation/composer/app-mentions.js +1 -1
  270. package/dist/conversation/composer/apps-menu.js +1 -1
  271. package/dist/conversation/composer/composer-menu.js +1 -1
  272. package/dist/conversation/composer/composer.js +1 -1
  273. package/dist/conversation/composer/context.js +1 -1
  274. package/dist/conversation/composer/drafts.js +1 -1
  275. package/dist/conversation/composer/file-items.js +1 -1
  276. package/dist/conversation/composer/long-text.js +1 -1
  277. package/dist/conversation/composer/mention-chips.js +1 -1
  278. package/dist/conversation/composer/mention-uri.js +1 -1
  279. package/dist/conversation/composer/model-menu.js +1 -1
  280. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  281. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  282. package/dist/conversation/composer/prediction.js +1 -1
  283. package/dist/conversation/composer/prompt-history.js +1 -1
  284. package/dist/conversation/composer/slash-command-button.js +1 -1
  285. package/dist/conversation/composer/submit-button.js +1 -1
  286. package/dist/conversation/composer/usage-meter.js +1 -1
  287. package/dist/conversation/connection-notice.js +1 -1
  288. package/dist/conversation/context.js +1 -1
  289. package/dist/conversation/conversation-body.js +1 -1
  290. package/dist/conversation/conversation-search.js +1 -1
  291. package/dist/conversation/conversation-view.js +1 -1
  292. package/dist/conversation/conversation.js +1 -1
  293. package/dist/conversation/diff-modal.js +1 -1
  294. package/dist/conversation/draft-project-picker.js +1 -1
  295. package/dist/conversation/session-actions.js +1 -1
  296. package/dist/conversation/subagent-sessions.js +1 -1
  297. package/dist/conversation/subagent-tasks.js +1 -1
  298. package/dist/desktop/desktop-composer.js +1 -1
  299. package/dist/desktop/desktop.js +1 -1
  300. package/dist/desktop/draft-model-select.js +1 -1
  301. package/dist/desktop/load-image.js +1 -1
  302. package/dist/desktop/model-catalog.js +1 -1
  303. package/dist/desktop/model-recovery.js +1 -1
  304. package/dist/desktop/model-settings-action.js +1 -1
  305. package/dist/desktop/native-file-drop.js +1 -1
  306. package/dist/generated/commands.d.ts +65 -65
  307. package/dist/generated/commands.js +1 -1
  308. package/dist/image-lightbox.js +1 -1
  309. package/dist/image-preview-dialog.js +1 -1
  310. package/dist/image.js +1 -1
  311. package/dist/lib/app-reference.js +1 -1
  312. package/dist/lib/application-metadata.js +1 -1
  313. package/dist/lib/chat-path.js +1 -1
  314. package/dist/lib/code-highlighter.js +1 -1
  315. package/dist/lib/fuzzy.js +1 -1
  316. package/dist/lib/group-blocks.js +1 -1
  317. package/dist/lib/image-encode.js +1 -1
  318. package/dist/lib/limits.js +1 -1
  319. package/dist/lib/markdown-parser.js +1 -1
  320. package/dist/lib/markdown-rules.js +1 -1
  321. package/dist/lib/model-name.js +1 -1
  322. package/dist/lib/pointer-centered-zoom.js +1 -1
  323. package/dist/lib/prepare-prompt-files.js +1 -1
  324. package/dist/lib/reference-presentation.js +1 -1
  325. package/dist/lib/stream-style.js +1 -1
  326. package/dist/lib/streaming-markdown.js +1 -1
  327. package/dist/lib/tool-artifacts.js +1 -1
  328. package/dist/locales.js +1 -1
  329. package/dist/mermaid/diagram.js +1 -1
  330. package/dist/mermaid/export.js +1 -1
  331. package/dist/mermaid/index.js +1 -1
  332. package/dist/mermaid/preview.js +1 -1
  333. package/dist/oauth/claude-login.js +1 -1
  334. package/dist/oauth.js +1 -1
  335. package/dist/plugins/catalog-header.js +1 -1
  336. package/dist/plugins/catalog-skeleton.js +1 -1
  337. package/dist/plugins/host.js +1 -1
  338. package/dist/plugins/new-chat-directory.js +1 -1
  339. package/dist/plugins/panel-item.js +1 -1
  340. package/dist/plugins/plugin-detail-page.js +1 -1
  341. package/dist/plugins/plugin-icon.js +1 -1
  342. package/dist/plugins/plugin-icons.js +1 -1
  343. package/dist/plugins/plugins-page.js +1 -1
  344. package/dist/plugins/plugins.js +1 -1
  345. package/dist/plugins/read-skill-document.js +1 -1
  346. package/dist/plugins/skill-document.js +1 -1
  347. package/dist/plugins/skills-tab.js +1 -1
  348. package/dist/plugins/store.js +1 -1
  349. package/dist/reference-projection.js +1 -1
  350. package/dist/search/chat-search.js +1 -1
  351. package/dist/search/codex-source-matches.js +1 -1
  352. package/dist/search/dom-matches.js +1 -1
  353. package/dist/search/find-bar.js +1 -1
  354. package/dist/search/literal-matches.js +1 -1
  355. package/dist/session-list/account-menu.js +1 -1
  356. package/dist/session-list/activity-list.js +1 -1
  357. package/dist/session-list/archived-sessions.js +1 -1
  358. package/dist/session-list/help-menu.js +1 -1
  359. package/dist/session-list/host.js +1 -1
  360. package/dist/session-list/hover-info-card.js +1 -1
  361. package/dist/session-list/locales.js +1 -1
  362. package/dist/session-list/navigation-controls.js +1 -1
  363. package/dist/session-list/navigation-header.js +1 -1
  364. package/dist/session-list/navigation-store.js +1 -1
  365. package/dist/session-list/navigation-tabs.js +1 -1
  366. package/dist/session-list/navigation.js +1 -1
  367. package/dist/session-list/platform.js +1 -1
  368. package/dist/session-list/row-stop-button.js +1 -1
  369. package/dist/session-list/session-groups.js +1 -1
  370. package/dist/session-list/session-info-card.js +1 -1
  371. package/dist/session-list/session-list.js +1 -1
  372. package/dist/session-list/session-row.js +1 -1
  373. package/dist/session-list/session-state-dot.js +1 -1
  374. package/dist/session-list/session-state-menu.js +1 -1
  375. package/dist/session-list/shortcut-hint.js +1 -1
  376. package/dist/session-list/shortcut.js +1 -1
  377. package/dist/session-list/sidebar-overlay.js +1 -1
  378. package/dist/session-list/trailing-swap.js +1 -1
  379. package/dist/session-list/use-activity-notification.js +1 -1
  380. package/dist/session-list/use-activity-preview.js +1 -1
  381. package/dist/session-list/use-cmd-held.js +1 -1
  382. package/dist/session-list/use-project-sessions.js +1 -1
  383. package/dist/session-list/virtual-session-rows.js +1 -1
  384. package/dist/session-timeline/activity-group.js +1 -1
  385. package/dist/session-timeline/activity-projection.js +1 -1
  386. package/dist/session-timeline/assistant-content.js +1 -1
  387. package/dist/session-timeline/assistant-image-references.js +1 -1
  388. package/dist/session-timeline/assistant-turn.js +1 -1
  389. package/dist/session-timeline/async-questions.js +1 -1
  390. package/dist/session-timeline/edited-files-card.js +1 -1
  391. package/dist/session-timeline/history-timeline.js +1 -1
  392. package/dist/session-timeline/host.js +1 -1
  393. package/dist/session-timeline/image-generation-progress.js +1 -1
  394. package/dist/session-timeline/navigation-rail.js +1 -1
  395. package/dist/session-timeline/plan.js +1 -1
  396. package/dist/session-timeline/question-reply.js +1 -1
  397. package/dist/session-timeline/resource-content.js +1 -1
  398. package/dist/session-timeline/session-timeline.js +1 -1
  399. package/dist/session-timeline/timeline-registry.js +1 -1
  400. package/dist/session-timeline/turn-activity.js +1 -1
  401. package/dist/session-timeline/turn-error.js +1 -1
  402. package/dist/session-timeline/turn-retry.js +1 -1
  403. package/dist/session-timeline/turn-time.js +1 -1
  404. package/dist/session-timeline/turns.js +1 -1
  405. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  406. package/dist/session-timeline/user-message.js +1 -1
  407. package/dist/settings/codex-account-card.js +1 -1
  408. package/dist/settings/login-card.js +1 -1
  409. package/dist/settings/model-alias-settings.js +1 -1
  410. package/dist/settings/model-aliases.js +1 -1
  411. package/dist/settings/provider-logos.d.ts +3 -1
  412. package/dist/settings/provider-logos.js +1 -1
  413. package/dist/settings/provider-section.js +1 -1
  414. package/dist/settings/providers-port.js +1 -1
  415. package/dist/settings/providers.d.ts +2 -4
  416. package/dist/settings/providers.js +1 -1
  417. package/dist/settings/settings-bridge.js +1 -1
  418. package/dist/settings/settings.d.ts +1 -1
  419. package/dist/settings/settings.js +1 -1
  420. package/native/win32-x64/alwith_native_chat.dll +0 -0
  421. package/native/win32-x64/artifact.json +1 -1
  422. package/package.json +1 -1
  423. package/assets/catalogs/openrouter/models.json +0 -215
  424. package/dist/chunk-1wk1yw69.js +0 -2
  425. package/dist/chunk-2qa3c571.js +0 -2
  426. package/dist/chunk-2reym9jt.js +0 -4
  427. package/dist/chunk-2w3c4tg8.js +0 -2
  428. package/dist/chunk-5t2ge7gg.js +0 -2
  429. package/dist/chunk-680e6bz4.js +0 -2
  430. package/dist/chunk-6ewv4vns.js +0 -2
  431. package/dist/chunk-6wsr59dr.js +0 -2
  432. package/dist/chunk-8byhp88a.js +0 -2
  433. package/dist/chunk-c4mm4fzg.js +0 -2
  434. package/dist/chunk-jnpkpe5t.js +0 -2
  435. package/dist/chunk-jp2s1xsa.js +0 -2
  436. package/dist/chunk-ky4j58wz.js +0 -2
  437. package/dist/chunk-p0v9d7e1.js +0 -2
  438. package/dist/chunk-qj87dxrr.js +0 -2
  439. package/dist/chunk-qth2ames.js +0 -2
  440. package/dist/chunk-qyfkwznx.js +0 -2
  441. package/dist/chunk-rayhzb8p.js +0 -2
  442. package/dist/chunk-wg223rq3.js +0 -2
  443. package/dist/chunk-wv6ntscn.js +0 -2
  444. package/dist/chunk-wvm8srp7.js +0 -2
  445. package/dist/chunk-x03z0hme.js +0 -2
  446. package/dist/chunk-zdqjjwx0.js +0 -2
@@ -1,2 +1,2 @@
1
- import{ki}from"./chunk-6ewv4vns.js";import{autoUpdate as K}from"@floating-ui/dom";import{cn as k}from"cn";import{CheckCheckIcon as L,CheckIcon as I,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as h,useId as S,useLayoutEffect as N,useRef as T,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as w}from"react/jsx-runtime";var U={allow_once:{icon:I},allow_always:{icon:L},reject_once:{icon:F},reject_always:{icon:V}};function Ci({requestId:u,options:E,title:_,children:D,total:v=1,alwaysLabel:P="always",autoFocus:y="always",anchorRef:o,onRespond:l}){let c=S(),[r,b]=f(0),[s,x]=f(null),[d,j]=f(null),p=T(null),a=ki(E);h(()=>{b(0)},[u]),h(()=>{let e=document.activeElement,t=p.current?.closest("[data-session-actions]")?.closest("[data-chat-drop-zone]"),n=e?.matches("[data-chat-input]")&&t?.contains(e);if(y==="always"||e===null||e===document.body||n)p.current?.focus({preventScroll:!0})},[u,d,y]);let m=H(()=>{let e=o?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let n=Math.min(640,window.innerWidth*0.9);x({left:(window.innerWidth-n)/2,width:n,bottom:24});return}x({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[o]);if(N(()=>{if(!o)return;let e=0,t=()=>{if(o.current)m();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[u,o,m]),N(()=>{let e=o?.current;if(!e||!d)return;return K(e,d,m,{animationFrame:!0})},[o,d,m]),o&&!s)return null;let g=w("div",{ref:j,"data-overlay":"permission-request",className:k("bg-card border-border flex min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border",o&&"fixed z-50"),style:o&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[i("div",{"data-permission-header":!0,className:"shrink-0 px-3 pt-2",children:w("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:c,className:"text-foreground text-sm font-medium",children:_}),v>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${v}`})]})}),i("div",{"data-permission-content":!0,className:"min-h-0 flex-1 overflow-auto overscroll-contain px-3 pb-2",children:D}),i("div",{role:"listbox","aria-labelledby":c,"aria-activedescendant":a[r]?`${c}-option-${r}`:void 0,tabIndex:0,ref:p,onKeyDown:(e)=>{if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=a.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),b((n)=>e.key==="ArrowDown"?(n+1)%t:(n-1+t)%t);else if(e.key==="Enter"){e.preventDefault();let n=a[r];if(n&&!e.repeat)l(n.optionId)}else if(e.key==="Escape")e.preventDefault(),l(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),l(a[Number(e.key)-1].optionId)},className:"border-border shrink-0 border-t outline-none",children:a.map((e,t)=>{let n=e.kind??"allow_once",C=U[n]?.icon??I,A=n==="allow_always"||n==="reject_always",M=n==="reject_once"||n==="reject_always";return w("div",{id:`${c}-option-${t}`,role:"option",onMouseDown:(O)=>O.preventDefault(),"aria-selected":t===r,title:e.description,onClick:()=>void l(e.optionId),className:k("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===r?"bg-ring text-accent-foreground":"text-foreground",M&&t!==r&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),A&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:P})]},e.optionId)})})]});return o?z(g,document.body):g}
2
- export{Ci};
1
+ import{_i}from"./chunk-1xgm6fpr.js";import{autoUpdate as K}from"@floating-ui/dom";import{cn as k}from"cn";import{CheckCheckIcon as L,CheckIcon as I,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as h,useId as S,useLayoutEffect as N,useRef as T,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as w}from"react/jsx-runtime";var U={allow_once:{icon:I},allow_always:{icon:L},reject_once:{icon:F},reject_always:{icon:V}};function ki({requestId:u,options:E,title:_,children:D,total:v=1,alwaysLabel:P="always",autoFocus:y="always",anchorRef:o,onRespond:l}){let c=S(),[r,b]=f(0),[s,x]=f(null),[d,j]=f(null),p=T(null),a=_i(E);h(()=>{b(0)},[u]),h(()=>{let e=document.activeElement,t=p.current?.closest("[data-session-actions]")?.closest("[data-chat-drop-zone]"),n=e?.matches("[data-chat-input]")&&t?.contains(e);if(y==="always"||e===null||e===document.body||n)p.current?.focus({preventScroll:!0})},[u,d,y]);let m=H(()=>{let e=o?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let n=Math.min(640,window.innerWidth*0.9);x({left:(window.innerWidth-n)/2,width:n,bottom:24});return}x({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[o]);if(N(()=>{if(!o)return;let e=0,t=()=>{if(o.current)m();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[u,o,m]),N(()=>{let e=o?.current;if(!e||!d)return;return K(e,d,m,{animationFrame:!0})},[o,d,m]),o&&!s)return null;let g=w("div",{ref:j,"data-overlay":"permission-request",className:k("bg-card border-border flex min-h-0 min-w-0 flex-col overflow-hidden rounded-lg border",o&&"fixed z-50"),style:o&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[i("div",{"data-permission-header":!0,className:"shrink-0 px-3 pt-2",children:w("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:c,className:"text-foreground text-sm font-medium",children:_}),v>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${v}`})]})}),i("div",{"data-permission-content":!0,className:"min-h-0 flex-1 overflow-auto overscroll-contain px-3 pb-2",children:D}),i("div",{role:"listbox","aria-labelledby":c,"aria-activedescendant":a[r]?`${c}-option-${r}`:void 0,tabIndex:0,ref:p,onKeyDown:(e)=>{if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=a.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),b((n)=>e.key==="ArrowDown"?(n+1)%t:(n-1+t)%t);else if(e.key==="Enter"){e.preventDefault();let n=a[r];if(n&&!e.repeat)l(n.optionId)}else if(e.key==="Escape")e.preventDefault(),l(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),l(a[Number(e.key)-1].optionId)},className:"border-border shrink-0 border-t outline-none",children:a.map((e,t)=>{let n=e.kind??"allow_once",C=U[n]?.icon??I,A=n==="allow_always"||n==="reject_always",M=n==="reject_once"||n==="reject_always";return w("div",{id:`${c}-option-${t}`,role:"option",onMouseDown:(O)=>O.preventDefault(),"aria-selected":t===r,title:e.description,onClick:()=>void l(e.optionId),className:k("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===r?"bg-ring text-accent-foreground":"text-foreground",M&&t!==r&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),A&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:P})]},e.optionId)})})]});return o?z(g,document.body):g}
2
+ export{ki};
@@ -0,0 +1,2 @@
1
+ import{Oe}from"./chunk-m6yg0dc9.js";function Sn(t){return Oe(t.absPath)}function _n(t){return t.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??t}function Pn(t){return _n(t.absPath)}
2
+ export{Sn,_n,Pn};
@@ -1,2 +1,2 @@
1
- import{t,ce}from"./chunk-rayhzb8p.js";import{zo}from"./chunk-ekfs7wrp.js";import{Ho,Qr}from"./chunk-zmr5pwhd.js";import{Zr}from"./chunk-kvwyryw2.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 Oo({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:Ho(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 Qr(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){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(Zr,{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{Oo};
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,2 +1,2 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function $r({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
- export{$r};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function jr({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
+ export{jr};
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-af0e5epn.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function Te(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>Te(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!Te(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Qn(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Us(t){u.get(t)?.set(v(t))}function J(t){let n=Qn(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ue(){return Qn(a()).set}function Bs(){let t=J((e)=>e.view),n=ue();return[t,(e)=>n({view:e})]}
2
- export{Te,Qn,Us,J,ue,Bs};
1
+ import{a}from"./chunk-0b50jg23.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function Te(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>Te(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!Te(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Yn(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Bs(t){u.get(t)?.set(v(t))}function J(t){let n=Yn(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ue(){return Yn(a()).set}function Gs(){let t=J((e)=>e.view),n=ue();return[t,(e)=>n({view:e})]}
2
+ export{Te,Yn,Bs,J,ue,Gs};
@@ -1,2 +1,2 @@
1
- import{mo,kt}from"./chunk-cy5kh1yr.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function nt(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=mo(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Qa(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return kt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{nt,Qa};
1
+ import{fo,It}from"./chunk-dwxmgsg8.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function rt(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=fo(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Qa(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return It(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
+ export{rt,Qa};
@@ -1,2 +1,2 @@
1
- async function Hi(e,t,i){let o=new Map;for(let a=0;a<t.length;a+=100){let r=await e("_codex/apps_read",{appIds:t.slice(a,a+100),...i?{threadId:i}:{},includeTools:!1});if(!r||typeof r!=="object"||!("apps"in r)||!Array.isArray(r.apps))throw Error("Invalid application metadata response");for(let n of r.apps){if(!n||typeof n.id!=="string"||n.iconUrl!==null&&typeof n.iconUrl!=="string"||n.iconUrlDark!==null&&typeof n.iconUrlDark!=="string")throw Error("Invalid application icon metadata");o.set(n.id,{iconUrl:n.iconUrl,iconUrlDark:n.iconUrlDark})}}return o}
2
- export{Hi};
1
+ async function Bi(e,t,i){let o=new Map;for(let a=0;a<t.length;a+=100){let r=await e("_codex/apps_read",{appIds:t.slice(a,a+100),...i?{threadId:i}:{},includeTools:!1});if(!r||typeof r!=="object"||!("apps"in r)||!Array.isArray(r.apps))throw Error("Invalid application metadata response");for(let n of r.apps){if(!n||typeof n.id!=="string"||n.iconUrl!==null&&typeof n.iconUrl!=="string"||n.iconUrlDark!==null&&typeof n.iconUrlDark!=="string")throw Error("Invalid application icon metadata");o.set(n.id,{iconUrl:n.iconUrl,iconUrlDark:n.iconUrlDark})}}return o}
2
+ export{Bi};
@@ -1,2 +1,2 @@
1
- import{Ne}from"./chunk-d9q9qgm1.js";import{useEffect as s,useState as w}from"react";function ei(){let[i,e]=w(!1);return s(()=>{let t=Ne()?"Meta":"Control",o=(n)=>{if(n.key===t)e(!0)},r=(n)=>{if(n.key===t)e(!1)},d=()=>e(!1);return window.addEventListener("keydown",o),window.addEventListener("keyup",r),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",r),window.removeEventListener("blur",d)}},[]),i}
2
- export{ei};
1
+ import{Ne}from"./chunk-wj9s8331.js";import{useEffect as s,useState as w}from"react";function ni(){let[i,e]=w(!1);return s(()=>{let t=Ne()?"Meta":"Control",o=(n)=>{if(n.key===t)e(!0)},r=(n)=>{if(n.key===t)e(!1)},d=()=>e(!1);return window.addEventListener("keydown",o),window.addEventListener("keyup",r),window.addEventListener("blur",d),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",r),window.removeEventListener("blur",d)}},[]),i}
2
+ export{ni};
@@ -1,2 +1,2 @@
1
- import{ko}from"./chunk-qm0zd4wj.js";import{fr}from"./chunk-kdcde4s5.js";import{w}from"./chunk-rayhzb8p.js";import{rt,ts}from"./chunk-6yx869ht.js";import{e}from"./chunk-b89bzpce.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function ra(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function sn({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=w(rt,(r)=>r),y=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),S=s((r)=>u.sessionId===t?ko(u.turns,r,u.terminals):[],[u,t]),b=s((r,i)=>ts(t,r,i),[t]),g=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,E=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(fr,{placement:"body",getViewport:y,findSourceMatches:S,revealTurn:b,prepareSource:g,subscribeOpen:E,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
2
- export{ra,sn};
1
+ import{_o}from"./chunk-gktjkghg.js";import{hr}from"./chunk-r5q65gf3.js";import{w}from"./chunk-e4ws15tg.js";import{lt,ns}from"./chunk-965sngjd.js";import{e}from"./chunk-kyqf7cqh.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function sa(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function dn({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=w(lt,(r)=>r),y=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),S=s((r)=>u.sessionId===t?_o(u.turns,r,u.terminals):[],[u,t]),b=s((r,i)=>ns(t,r,i),[t]),g=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,E=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(hr,{placement:"body",getViewport:y,findSourceMatches:S,revealTurn:b,prepareSource:g,subscribeOpen:E,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
2
+ export{sa,dn};
@@ -1,2 +1,2 @@
1
- import{So}from"./chunk-6wsr59dr.js";async function hr(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Mt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of So(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
- export{hr,Mt};
1
+ import{Po}from"./chunk-t1qj0vqe.js";async function vr(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Rt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Po(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
+ export{vr,Rt};
@@ -1,2 +1,2 @@
1
- import{w}from"./chunk-rayhzb8p.js";import{e}from"./chunk-b89bzpce.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 Pn({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{Pn};
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,2 +1,2 @@
1
- var t=new Map;var a=0;function Fo(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Fo(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function qr(e,n){return d??=new l,d.connect(e,n)}
2
- export{Fo,qr};
1
+ var t=new Map;var a=0;function Ho(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Ho(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function qr(e,n){return d??=new l,d.connect(e,n)}
2
+ export{Ho,qr};
@@ -0,0 +1,2 @@
1
+ import{useId as o}from"react";import{jsx as l,jsxs as e}from"react/jsx-runtime";function Wi(t){return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"Claude"}),l("path",{fill:"#D97757",fillRule:"nonzero",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})]})}function Un(t){return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"DeepSeek"}),l("path",{fill:"#4D6BFE",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]})}function Bn(t){return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"Grok"}),l("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})]})}var c="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z";function Gn(t){let a=o().replaceAll(":","");return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"Qwen"}),l("path",{d:c,fill:`url(#${a})`,fillRule:"nonzero"}),l("defs",{children:e("linearGradient",{id:a,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[l("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),l("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]})}function Zi(t){return l("svg",{viewBox:"-3 -3 30 30",fill:"currentColor",...t,children:l("path",{d:"M1.5 1.5h21v21h-7v-7h-7v-7h-7zM1.5 15.5h7v7h-7z"})})}function Qi(t){return l("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",viewBox:"0 0 24 24",width:"1em",...t,children:l("path",{d:"M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z"})})}function Ge(t){let a=o();return e("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...t,children:[l("defs",{children:e("linearGradient",{id:a,x1:"0%",x2:"100.182%",y1:"50.057%",y2:"50.057%",children:[l("stop",{offset:"0%",stopColor:"#E2167E"}),l("stop",{offset:"100%",stopColor:"#FE603C"})]})}),l("path",{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z",fill:`url(#${a})`,fillRule:"nonzero"})]})}function Ji(t){return e("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...t,children:[l("path",{d:"M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z",fill:"#00E5E5"}),l("path",{d:"M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z",fill:"#006EFF"}),l("path",{d:"M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z",fill:"#006EFF"}),l("path",{d:"M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z",fill:"#00E5E5"})]})}function _t(t){return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"Doubao"}),l("path",{d:"M5.31 15.756c.172-3.75 1.883-5.999 2.549-6.739-3.26 2.058-5.425 5.658-6.358 8.308v1.12C1.501 21.513 4.226 24 7.59 24a6.59 6.59 0 002.2-.375c.353-.12.7-.248 1.039-.378.913-.899 1.65-1.91 2.243-2.992-4.877 2.431-7.974.072-7.763-4.5l.002.001z",fill:"#1E37FC"}),l("path",{d:"M22.57 10.283c-1.212-.901-4.109-2.404-7.397-2.8.295 3.792.093 8.766-2.1 12.773a12.782 12.782 0 01-2.244 2.992c3.764-1.448 6.746-3.457 8.596-5.219 2.82-2.683 3.353-5.178 3.361-6.66a2.737 2.737 0 00-.216-1.084v-.002z",fill:"#37E1BE"}),l("path",{d:"M14.303 1.867C12.955.7 11.248 0 9.39 0 7.532 0 5.883.677 4.545 1.807 2.791 3.29 1.627 5.557 1.5 8.125v9.201c.932-2.65 3.097-6.25 6.357-8.307.5-.318 1.025-.595 1.569-.829 1.883-.801 3.878-.932 5.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z",fill:"#A569FF"}),l("path",{d:"M17.305 4.961a199.47 199.47 0 01-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648 2.786.869 5.617 3.288.395 6.185 1.898 7.396 2.8-1.306-1.275-3.475-3.487-5.266-5.323z",fill:"#1E37FC"})]})}function zn(t){return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"Kimi"}),l("rect",{width:"24",height:"24",rx:"5",fill:"#000"}),l("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z",fill:"#1783FF"}),l("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z",fill:"#fff"})]})}function Vn(t){let a=o();return e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...t,children:[l("title",{children:"Zhipu"}),l("defs",{children:e("linearGradient",{id:a,x1:"-18.756%",x2:"70.894%",y1:"49.371%",y2:"90.944%",children:[l("stop",{offset:"0%",stopColor:"#504AF4"}),l("stop",{offset:"100%",stopColor:"#3485FF"})]})}),l("path",{d:"M9.917 2c4.906 0 10.178 3.947 8.93 10.58-.014.07-.037.14-.057.21l-.003-.277c-.083-3-1.534-8.934-8.87-8.934-3.393 0-8.137 3.054-7.93 8.158-.04 4.778 3.555 8.4 7.95 8.332l.073-.001c1.2-.033 2.763-.429 3.1-1.657.063-.031.26.534.268.598.048.256.112.369.192.34.981-.348 2.286-1.222 1.952-2.38-.176-.61-1.775-.147-1.921-.347.418-.979 2.234-.926 3.153-.716.443.102.657.38 1.012.442.29.052.981-.2.96.242-1.5 3.042-4.893 5.41-8.808 5.41C3.654 22 0 16.574 0 11.737 0 5.947 4.959 2 9.917 2zM9.9 5.3c.484 0 1.125.225 1.38.585 3.669.145 4.313 2.686 4.694 5.444.255 1.838.315 2.3.182 1.387l.083.59c.068.448.554.737.982.516.144-.075.254-.231.328-.47a.2.2 0 01.258-.13l.625.22a.2.2 0 01.124.238 2.172 2.172 0 01-.51.92c-.878.917-2.757.664-3.08-.62-.14-.554-.055-.626-.345-1.242-.292-.621-1.238-.709-1.69-.295-.345.315-.407.805-.406 1.282L12.6 15.9a.9.9 0 01-.9.9h-1.4a.9.9 0 01-.9-.9v-.65a1.15 1.15 0 10-2.3 0v.65a.9.9 0 01-.9.9H4.8a.9.9 0 01-.9-.9l.035-3.239c.012-1.884.356-3.658 2.47-4.134.2-.045.252.13.29.342.025.154.043.252.053.294.701 3.058 1.75 4.299 3.144 3.722l.66-.331.254-.13c.158-.082.25-.131.276-.15.012-.01-.165-.206-.407-.464l-1.012-1.067a8.925 8.925 0 01-.199-.216c-.047-.034-.116.068-.208.306-.074.157-.251.252-.272.326-.013.058.108.298.362.72.164.288.22.508-.31.343-1.04-.8-1.518-2.273-1.684-3.725-.004-.035-.162-1.913-.162-1.913a1.2 1.2 0 011.113-1.281L9.9 5.3zm12.994 8.68c.037.697-.403.704-1.213.591l-1.783-.276c-.265-.053-.385-.099-.313-.147.47-.315 3.268-.93 3.31-.168zm-.915-.083l-.926.042c-.85.077-1.452.24.338.336l.103.003c.815.012 1.264-.359.485-.381zm1.667-3.601h.01c.79.398.067 1.03-.65 1.393-.14.07-.491.176-1.052.315-.241.04-.457.092-.333.16l.01.005c1.952.958-3.123 1.534-2.495 1.285l.38-.148c.68-.266 1.614-.682 1.666-1.337.038-.48 1.253-.442 1.493-.968.048-.106 0-.236-.144-.389-.05-.047-.094-.094-.107-.148-.073-.305.7-.431 1.222-.168zm-2.568-.474c-.135 1.198-2.479 4.192-1.949 2.863l.017-.042c.298-.717.376-2.221 1.337-3.221.25-.26.636.035.595.4zm-7.976-.253c.02-.694 1.002-.968 1.346-.347.01-1.274-1.941-.768-1.346.347z",fill:`url(#${a})`,fillRule:"evenodd"})]})}
2
+ export{Wi,Un,Bn,Gn,Zi,Qi,Ge,Ji,_t,zn,Vn};
@@ -1,2 +1,2 @@
1
- import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Jn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
- export{Jn};
1
+ import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function eo({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
+ export{eo};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-af0e5epn.js";import{Te,J,ue}from"./chunk-5jvpeww3.js";import{useEffect as S,useMemo as f}from"react";function Ts(s){let c=J((i)=>i.activityOrder),a=o((i)=>{let n=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&Te(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(n)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=J((i)=>i.activitySeen),r=ue();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,n])=>u.get(i)!==n)}
2
- export{Ts};
1
+ import{o}from"./chunk-0b50jg23.js";import{Te,J,ue}from"./chunk-9y0fxq8e.js";import{useEffect as S,useMemo as f}from"react";function Ms(s){let c=J((i)=>i.activityOrder),a=o((i)=>{let n=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&Te(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(n)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=J((i)=>i.activitySeen),r=ue();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,n])=>u.get(i)!==n)}
2
+ export{Ms};
@@ -1,3 +1,3 @@
1
- import{c}from"./chunk-06mvwewp.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
- `).length}function Oa(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function Tr({blocks:e}){return s(No,{files:Oa(e)})}function No({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
3
- export{Oa,Tr,No};
1
+ import{c}from"./chunk-5rzy2287.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
+ `).length}function Oa(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function Mr({blocks:e}){return s(Eo,{files:Oa(e)})}function Eo({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
3
+ export{Oa,Mr,Eo};
@@ -1,2 +1,2 @@
1
- import{nativeTurnId as p}from"@nyssance/codex-acp-v2/client";function Or(d,u){let f=new Set,i=(e)=>{let t=e.items.map(p).find((o)=>o!==null),r=e.items.every((o)=>o.replayed);if(t===void 0||f.has(t))return{turnKey:e.key,turn:e,deferUntilReady:r};return f.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:r}};if(!u?.complete)return d.map(i);let a=new Map;for(let e of d){let t=e.items.map(p).find((o)=>o!==null);if(t===void 0)continue;let r=a.get(t)??[];r.push(e),a.set(t,r)}let c=new Set(u.turns.map((e)=>e.turnId)),T=new Set(u.loadedTurnIds),y=new Map,l=new Map,s,n=[];for(let e of d){if(!e.items.some((t)=>c.has(p(t)??""))){n.push(e);continue}if(n.length>0){if(s)l.set(s,n);else y.set(e,n);n=[]}s=e}if(s&&n.length>0)l.set(s,n),n=[];return[...u.turns.flatMap((e)=>{let t=a.get(e.turnId);if(t)return t.flatMap((r)=>[...(y.get(r)??[]).map(i),i(r),...(l.get(r)??[]).map(i)]);return T.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...n.map(i)]}
2
- export{Or};
1
+ import{nativeTurnId as p}from"@nyssance/codex-acp-v2/client";function Hr(d,u){let f=new Set,i=(e)=>{let t=e.items.map(p).find((o)=>o!==null),r=e.items.every((o)=>o.replayed);if(t===void 0||f.has(t))return{turnKey:e.key,turn:e,deferUntilReady:r};return f.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:r}};if(!u?.complete)return d.map(i);let a=new Map;for(let e of d){let t=e.items.map(p).find((o)=>o!==null);if(t===void 0)continue;let r=a.get(t)??[];r.push(e),a.set(t,r)}let c=new Set(u.turns.map((e)=>e.turnId)),T=new Set(u.loadedTurnIds),y=new Map,l=new Map,s,n=[];for(let e of d){if(!e.items.some((t)=>c.has(p(t)??""))){n.push(e);continue}if(n.length>0){if(s)l.set(s,n);else y.set(e,n);n=[]}s=e}if(s&&n.length>0)l.set(s,n),n=[];return[...u.turns.flatMap((e)=>{let t=a.get(e.turnId);if(t)return t.flatMap((r)=>[...(y.get(r)??[]).map(i),i(r),...(l.get(r)??[]).map(i)]);return T.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...n.map(i)]}
2
+ export{Hr};
@@ -1,2 +1,2 @@
1
- import{n}from"./chunk-rayhzb8p.js";import{e}from"./chunk-b89bzpce.js";import{y,ee}from"./chunk-rkqptd9w.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let o=Math.min(100,a/t*100),p=o>=90?"text-destructive":o>=70?"text-foreground":"text-muted-foreground";return{pct:o,className:p}}function G(a){let t=y(a.configOptions,"model");return t===void 0?void 0:ee(t)}function et(a,t){let o=a.windowDurationMins;if(o===null)return t("usage.usage");if(o%1440===0)return t("usage.windowDays",{count:o/1440});return t("usage.windowHours",{count:Math.round(o/60)})}function P(a){let{client:t}=e(),o=n((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!o){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[o,t]),o?p:null}function _({session:a}){let{t}=e().host,o=y(a.configOptions,"model"),p=o!==void 0&&(L(o.options)?o.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((v)=>v.value===o.currentValue)):!o.currentValue.startsWith("gateway:")&&o.options.some((i)=>i.value===o.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,h=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||h+k+g+w,R=h+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(h)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],N=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[N!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:N,children:N})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,v])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:v})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:et(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var xn=W(_);
2
- export{et,xn};
1
+ import{n}from"./chunk-e4ws15tg.js";import{e}from"./chunk-kyqf7cqh.js";import{y,ee}from"./chunk-rkqptd9w.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let o=Math.min(100,a/t*100),p=o>=90?"text-destructive":o>=70?"text-foreground":"text-muted-foreground";return{pct:o,className:p}}function G(a){let t=y(a.configOptions,"model");return t===void 0?void 0:ee(t)}function nt(a,t){let o=a.windowDurationMins;if(o===null)return t("usage.usage");if(o%1440===0)return t("usage.windowDays",{count:o/1440});return t("usage.windowHours",{count:Math.round(o/60)})}function P(a){let{client:t}=e(),o=n((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!o){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[o,t]),o?p:null}function _({session:a}){let{t}=e().host,o=y(a.configOptions,"model"),p=o!==void 0&&(L(o.options)?o.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((v)=>v.value===o.currentValue)):!o.currentValue.startsWith("gateway:")&&o.options.some((i)=>i.value===o.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,h=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||h+k+g+w,R=h+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(h)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],N=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[N!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:N,children:N})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,v])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:v})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:nt(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var kn=W(_);
2
+ export{nt,kn};
@@ -0,0 +1,4 @@
1
+ import{fr}from"./chunk-f67e77e6.js";import{Xi}from"./chunk-8w08gd0y.js";import{ms}from"./chunk-wjgrrfq9.js";import{m,S,Tt}from"./chunk-x2x9g6vk.js";import{Ve}from"./chunk-gs0b02g2.js";import{tr,nr,or,ir,rr}from"./chunk-7xsrqwvt.js";import{dr,ur}from"./chunk-jaghs2z5.js";import{H}from"./chunk-k3fwyr6s.js";import{ho}from"./chunk-6eg26dz5.js";import{go}from"./chunk-vedvkp9e.js";import{n}from"./chunk-e4ws15tg.js";import{e}from"./chunk-kyqf7cqh.js";import{so,Fi}from"./chunk-z8b3nz7t.js";import{ao}from"./chunk-f0hb6t2w.js";import{r,Di,X,Cn}from"./chunk-2016dacx.js";import{vn}from"./chunk-4jza4wwy.js";import{tt,xn}from"./chunk-hs98zk6m.js";import{Sn,Pn}from"./chunk-9s8ht9xe.js";import{Ei}from"./chunk-vgea7ggq.js";import{Tn}from"./chunk-q61xz251.js";import{Ri}from"./chunk-zy6qme7n.js";import{In}from"./chunk-pae2hjvq.js";import{yn}from"./chunk-sgmh6sa8.js";import{Ai}from"./chunk-qd9s7wmj.js";import{Oi}from"./chunk-rr5ek064.js";import{kn}from"./chunk-ckbqdg1s.js";import{hasFuzzyFileSearch as jt}from"@nyssance/codex-acp-v2/client";import{useCallback as w,useEffect as qt,useLayoutEffect as nt,useMemo as pt,useRef as N,useState as M}from"react";import{jsx as s,jsxs as R}from"react/jsx-runtime";var Gt=["image/png","image/jpeg","image/webp","image/gif"],st=[];async function Qt(o){let T=await(await fetch(o.url)).blob();return new Promise((I,F)=>{let E=new FileReader;E.onerror=()=>F(E.error),E.onload=()=>{let q=E.result;I(q.slice(q.indexOf(",")+1))},E.readAsDataURL(T)})}function Fe({session:o,onSubmit:T,onShellCommand:I,onHandOff:F,modelSelector:E,modelMenu:q,inputHeader:mt,actions:Et,leadingTools:kt,agentControls:G=!0,placeholder:Dt,children:Nt,attachmentPolicy:dt,predictions:St=!0,disabled:Ft=!1,preparing:ut=!1,allowPendingInput:Ot=!1}){let{host:O,client:_}=e(),{t:g}=O,z=w((t)=>{if(O.reportError)O.reportError(t);else console.error(t)},[O]),[ft,B]=M(()=>({text:r.get(o.id)?.text??"",revision:0})),{text:v}=ft,[C,_t]=M(()=>r.get(o.id)?.attachments??st),[y,Q]=M(()=>r.get(o.id)?.mentions??[]),[d,L]=M(()=>r.get(o.id)?.apps??[]),[ht,K]=M(()=>(r.get(o.id)?.apps?.length??0)>0||H(v,o.commands.map((t)=>t.name)).length>0),W=N(void 0),U=N(void 0);nt(()=>{if(d.length>0)K(!0)},[d.length]);let ot=C.some((t)=>tt(t)&&t.pastedText.status!=="ready"),[k,gt]=M(!1),[Y,Lt]=M(!1),[it,Wt]=M(!1),at=N(null),f=N(null),xt=N(null),c=N(ft),P=w((t)=>{xt.current?.(),c.current={text:t,revision:c.current.revision+1},B(c.current)},[]),yt=w((t)=>{let i=f.current;if(i?.insertApplication){i.insertApplication(t);return}let a=c.current.text,u=i?.getTextarea()?.selectionStart??a.length;U.current={text:a,apps:[]},W.current=u+1,K(!0),P(a),L((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:u}])},[P]),$t=w((t)=>{let i=f.current;if(i?.insertInvocation){i.insertInvocation(t);return}let a=c.current.text,u=i?.getTextarea(),l=u?.selectionStart??a.length,h=u?.selectionEnd??l,lt=`${a.slice(0,l)}${t} ${a.slice(h)}`;U.current={text:a,apps:[]},W.current=l+t.length+1,P(lt),K(!0)},[P]),bt=w(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),Ut=Ai(o,P,L,d.length>0||y.length>0||C.length>0),vt=pt(()=>({read:()=>{let i=f.current?.getTextarea(),a=i===null||i===void 0?[c.current.text.length,c.current.text.length]:[i.selectionStart,i.selectionEnd];return{target:o.id,...c.current,selection:a}},compareAndSet(i,a,u){if(f.current?.isComposing())return null;if(i.target!==o.id||i.revision!==c.current.revision)return null;c.current={text:a,revision:c.current.revision+1},B(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=a,l.setSelectionRange(u[0],u[1]);return{target:o.id,...c.current,selection:u}}}),[o.id]),j=N(null),Pt=w((t)=>(j.current=t,()=>{if(j.current===t)j.current=null}),[]),V=o.state!=="idle",x=I!==void 0&&d.length===0&&v.startsWith("!"),J=(ht||d.length>0)&&!x,b=!Ft&&!ut&&o.attached&&!o.restoring&&!o.readOnly,D=!o.readOnly&&(Ot||b),Z=yn(o,b&&!k&&!Y&&!ot&&!it,v.length>0||C.length>0||y.length>0||d.length>0,St&&!x),It=Z.invalidate;nt(()=>{r.set(o.id,{text:v,attachments:C,mentions:y,...d.length>0?{apps:d}:{},modelId:r.get(o.id)?.modelId??null})},[o.id,v,C,y,d]),nt(()=>Di(o.id,_t),[o.id]),nt(()=>Cn(o.id,(t,i)=>{if(!D||k)throw Error("The composer cannot take text now; try again later");if(i!=="append"&&(v.length||C.length||y.length||d.length))throw Error("The composer already has a draft; send or clear it first");P(t)}),[o.id,D,k,v,C,y,d,P]);let At=n((t)=>jt(t.agent)),zt=pt(()=>At&&b?async(t)=>vn((await _.fuzzyFileSearch({query:t,roots:[o.cwd],cancellationToken:null})).files):void 0,[_,At,b,o.cwd]),ct=w((t)=>{Q((i)=>i.includes(t)?i:[...i,t])},[]);qt(()=>{f.current?.focus()},[]);let wt=w(async({text:t,files:i})=>{let a=I!==void 0&&d.length===0&&t.startsWith("!")?t.slice(1):null;if(a!==null){if(a.trim().length===0)return;if(i.length||y.length||d.length)throw Error("Shell commands cannot include file references or attachments");if(o.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let u=t.trim();if(u.length===0&&i.length===0&&y.length===0&&d.length===0)return;let l=j.current;gt(!0);let h=r.get(o.id),lt=c.current.revision,et=null;try{let A=d.map((p)=>({type:"resource_link",name:p.name,uri:`app://${p.id}`}));for(let p of y){let rt={kind:"file",absPath:p};A.push({type:"resource_link",uri:Sn(rt),name:Pn(rt)})}let Rt=ms(u,d);if(Rt.length>0)A.push({type:"text",text:Rt});for(let p of i)if(tt(p)){if(p.pastedText.status!=="ready")throw Error("Text attachment is not ready");A.push({type:"resource_link",uri:p.url,name:p.filename??"pasted-text.txt"})}else A.push({type:"image",data:await Qt(p),mimeType:p.mediaType});if(c.current.revision===lt&&r.get(o.id)===h)c.current={text:"",revision:c.current.revision+1},et=c.current.revision,B(c.current),Q([]),L([]),W.current=void 0,U.current=void 0,X(o.id,()=>st),r.set(o.id,{text:"",attachments:st,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(a!==null&&I)await I(a);else if(T)if(l===null)await T(A);else await T(A,(p)=>{if(l.signal.aborted||j.current!==l)return;l.accept(p),F?.(o.id,p)});else if(l===null)await _.prompt(o.id,A);else{let p=await _.prompt(o.id,A);l.accept(p)}It();for(let p of h?.attachments??[])if(p.url.startsWith("blob:")&&!r.get(o.id)?.attachments.some((rt)=>rt.id===p.id))URL.revokeObjectURL(p.url)}catch(A){if(h&&et!==null&&c.current.revision===et&&r.get(o.id)?.attachments.length===0&&r.get(o.id)?.mentions.length===0&&!r.get(o.id)?.apps?.length)c.current={text:h.text,revision:et+1},B(c.current),Q(h.mentions),L(h.apps??[]),r.set(o.id,h),X(o.id,()=>h.attachments);throw A}finally{gt(!1),f.current?.focus()}},[_,o.id,o.state,y,d,T,I,F,It]),Bt=()=>{_.cancel(o.id).catch(z)},Ht=w((t)=>{let i=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:Ve})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});z(i)},[z,g]),Kt=pt(()=>({session:o,ready:b,inputReady:D,sending:k,textareaRef:f,draft:vt,interruptRef:xt,observeReceipts:Pt,addMention:ct,setAdding:Lt,shellMode:x,handsFree:!x&&(T===void 0||F!==void 0)}),[o,b,D,k,vt,Pt,ct,T,F,x]),Ct=O.writeTextAttachment,Mt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:Ut,bashMode:I!==void 0,disabled:!D,"aria-label":g("composer.placeholder"),placeholder:x?"! command":Z.text||Dt||(V?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!J&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/"))){let i=Tt(t.clipboardData);if(i?.apps.length){t.preventDefault();let a=t.currentTarget,u=m(i),l=S([...a.value.slice(0,a.selectionStart).split(""),...u,...a.value.slice(a.selectionEnd).split("")]);U.current={text:v,apps:[]},W.current=a.selectionStart+u.length,K(!0),L(l.apps),P(l.text);return}}if(Ct)xn(t,o.id,g("composer.pastedTextFilename"),Ct)}};return s(ao,{value:Kt,children:s("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:R("div",{className:"relative",children:[mt&&s("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:mt}),s(fr,{attachmentPolicy:dt,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},B(c.current)},attachments:C,onAttachmentsChange:(t)=>X(o.id,()=>t),children:R("div",{ref:at,className:"relative",children:[G&&!it&&s(Xi,{bashMode:I!==void 0,handleRef:f,commands:o.commands,renderSlashMenu:(t)=>s(so,{anchorRef:at,commands:o.commands,query:t.query,includeAttachment:!1,disabled:!D,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(i)=>t.replaceQuery(()=>$t(i.startsWith("$")?i:`/${i}`)),onApp:(i)=>t.replaceQuery(()=>yt(i)),focusInput:bt}),searchFiles:zt,onMention:ct,onSearchError:z,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},J?"inline":"textarea"),R(tr,{attachmentPolicy:dt,"data-shell-mode":x||void 0,bashMode:I!==void 0,globalDrop:!0,multiple:!0,accept:Gt.join(","),onError:Ht,onSubmit:wt,onSubmitAsync:wt,onSubmitError:z,canSubmit:()=>b&&!k&&!Y&&!ot&&(!x||!V&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[Nt,R(or,{className:"px-3 pt-3 pb-0 empty:hidden",children:[Y&&s("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),s(Ei,{mentions:y,onRemove:(t)=>Q((i)=>i.filter((a)=>a!==t))}),s(ur,{children:(t)=>tt(t)?s(Ri,{data:t,sessionId:o.id}):s(dr,{data:t,t:g})})]}),R(nr,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!Z.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab"||t.key==="ArrowRight"||t.key==="Enter")t.preventDefault(),t.stopPropagation(),P(Z.text)},children:[x&&s("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),J?s(ho,{...Mt,skillIcon:O.skillIcon,skillNames:o.commands.map((t)=>t.name),applications:d,onApplicationsChange:L,initialCaret:W.current,initialUndo:U.current}):s(go,{...Mt,autoFocus:ht&&x})]}),s(ir,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:R("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[R("div",{className:"flex min-w-0 items-center gap-[5px]",children:[s(Fi,{anchorRef:at,commands:o.commands,disabled:!D,agentDisabled:!b||x,agentControls:G,open:it,onOpenChange:Wt,focusInput:bt,onCommand:(t)=>{let i=c.current.text,a=i.length===0||i.endsWith(`
2
+ `)?i:`${i}
3
+ `,u=t.startsWith("$")?t:`/${t}`,l=`${a}${u} `;if(!J)U.current={text:i,apps:[]},W.current=l.length,K(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:yt}),kt,G&&s(In,{sessionId:o.id,options:o.configOptions,disabled:!b})]}),R(rr,{className:"w-full min-w-0 items-center justify-end gap-1",children:[G&&s(kn,{session:o}),E??s(Tn,{...q,sessionId:o.id,options:o.configOptions,disabled:!b}),Et,s(Oi,{active:V,sending:k||ut||Y,ready:b&&!ot&&(!x||!V&&v.slice(1).trim().length>0),hasMentions:y.length>0||d.length>0,onStop:Bt})]})]})})]})]})})]})})})}
4
+ export{Fe};
@@ -0,0 +1,2 @@
1
+ import{yi}from"./chunk-0b50jg23.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function ta({host:o,children:t}){return s(n,{value:o,children:t})}function N(){let o=i(n),e={...yi(),...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 hi(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function ge(){let o=N();return(t)=>hi(o,t)}function vi(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
+ export{ta,N,hi,ge,vi};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-rayhzb8p.js";import{Et}from"./chunk-016v1nnv.js";import{Lr}from"./chunk-r84xcy0d.js";import{L}from"./chunk-ekfs7wrp.js";import{jn}from"./chunk-fy8dmpv3.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as C}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(L,{block:e.content},`${n.id}:${l}`))]})}var Ao=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(jn),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...Lr(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(C,{children:[s(Et,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
- export{Ao};
1
+ import{t}from"./chunk-e4ws15tg.js";import{Ft}from"./chunk-nhz4egjh.js";import{Dr}from"./chunk-5x2aqmhm.js";import{L}from"./chunk-38eckxjk.js";import{Wn}from"./chunk-q78ng7mn.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as C}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(L,{block:e.content},`${n.id}:${l}`))]})}var Ro=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(Wn),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...Dr(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(C,{children:[s(Ft,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
+ export{Ro};
@@ -1,2 +1,2 @@
1
- import{F}from"./chunk-06mvwewp.js";import{t}from"./chunk-rayhzb8p.js";import{L}from"./chunk-ekfs7wrp.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(F,{text:e.text,streaming:o})})}if(i.isImage(e))return n(L,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(L,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function ze({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
2
- export{ze};
1
+ import{F}from"./chunk-5rzy2287.js";import{t}from"./chunk-e4ws15tg.js";import{L}from"./chunk-38eckxjk.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(F,{text:e.text,streaming:o})})}if(i.isImage(e))return n(L,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(L,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function $e({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
2
+ export{$e};
@@ -1,2 +1,2 @@
1
- import{p}from"./chunk-n96z8etk.js";async function da(a){let e=await p.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
- export{da};
1
+ import{p}from"./chunk-g947bnqx.js";async function ua(a){let e=await p.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
+ export{ua};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-rayhzb8p.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})}
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
2
  export{Ra,Ir};
@@ -0,0 +1,2 @@
1
+ import{Be}from"./chunk-ksq9a3pf.js";import{x}from"./chunk-2rjg9fs9.js";import{Zi,Qi,Ge,Ji}from"./chunk-bhajnmtf.js";import{E,Ct,V,St}from"./chunk-g7dxg38a.js";import{Bot as p}from"lucide-react";import{jsx as l}from"react/jsx-runtime";var r={"alwith-account":Zi,chatgpt:Qi,minimax:Ge,seedream:Ji};function Hi({provider:o,className:i,...a}){let e=Object.hasOwn(r,o)?r[o]:E.find((n)=>n.id===o)?.logo??p;return l(e,{"aria-hidden":"true",...a,className:["size-4 shrink-0",i].filter(Boolean).join(" ")})}var s=new Map(Be.filter((o)=>o.source==="account").flatMap((o)=>o.models.map((i)=>[V(o.id,i.id),i.label]))),d=new Map([...Be.map((o)=>[o.id,o.source==="account"?1:2]),[x.id,0]]);function En(o){return o.shortLabel??o.label}function He(o,i={}){return o.toSorted((e,n)=>(d.get(e.id)??3)-(d.get(n.id)??3)).map((e)=>{let n=e.id===x.id;return{...e,models:e.models.map((t)=>({...t,label:s.get(t.api_id)??t.label,shortLabel:t.shortLabel??St[t.api_id]?.shortLabel,icon:i.providerIcon?.(e.id,t.api_id)??l(Hi,{provider:n?"chatgpt":e.id==="litellm"||e.id==="alwith-managed-litellm"||Ct(t.api_id)?"alwith-account":e.id})}))}})}
2
+ export{Hi,En,He};
@@ -1,2 +1,2 @@
1
- var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function mo(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function kt(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=mo(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
- export{mo,kt};
1
+ var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function fo(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function It(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=fo(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
+ export{fo,It};
@@ -1,2 +1,2 @@
1
- import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function rs({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
- export{rs};
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function ss({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
+ export{ss};
@@ -0,0 +1,2 @@
1
+ import{ws}from"./chunk-5rzy2287.js";import{createContext as s,useContext as o,useSyncExternalStore as m}from"react";import{jsx as l}from"react/jsx-runtime";var u=s(null),c=s(null),jo=s(null);function le(){return o(jo)}function je({host:e,client:i,children:r}){return l(ws,{host:e,children:l(u,{value:e,children:l(c,{value:i,children:r})})})}function t(){let e=o(u);if(e===null)throw Error("Timeline host is missing");return e}function Ke(){let e=o(c);if(e===null)throw Error("Timeline client is missing");return e}function w(e,i){return m((r)=>e.subscribe(r),()=>i(e.getState()),()=>i(e.getState()))}function n(e){let i=Ke();return w(i.store,e)}function Ko(){return o(u)!==null}function ce(e,i){if(e.reportError)e.reportError(i);else console.error(i)}
2
+ export{jo,le,je,t,Ke,w,n,Ko,ce};
@@ -1,3 +1,3 @@
1
- import{u}from"./chunk-b5g055qp.js";import{M,f}from"./chunk-qm9c9sd7.js";import{Bt}from"./chunk-8q5zwkry.js";import{je,d,qe,st,i}from"./chunk-2w3c4tg8.js";import{q,K,de,W,Z,we,zt}from"./chunk-fbrv2v3t.js";import{Ce}from"./chunk-7z1k4s4f.js";import{at}from"./chunk-w2z3sxdq.js";import{k}from"./chunk-qk1yqepm.js";import{$t,U}from"./chunk-y81242w2.js";import{Q,_e}from"./chunk-n8b9yg4q.js";import{Vt}from"./chunk-3dbxzwcz.js";import{Gt}from"./chunk-3eetka54.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as G,PuzzleIcon as le,RefreshCwIcon as oe,SearchIcon as re,Trash2Icon as ce,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as J,useMemo as V,useState as C}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ke,DropdownMenuContent as ye,DropdownMenuItem as be,DropdownMenuTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as _}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Ie}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function z(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function Se({plugin:t,marketplace:r}){let{t:m}=d(),p=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=m(p?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!p)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(N,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:p||a||c,"aria-label":o,title:c?m("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:p?e(E,{"aria-hidden":"true"}):e(G,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function De({plugin:t,marketplace:r,actions:m,onOpen:p}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(we,{className:"toolbox-row relative",children:[e(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":z(t),onClick:()=>p({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(U,{name:t.name})})}),s(K,{className:"pointer-events-none relative min-w-0",children:[e(zt,{className:"mb-0.5",children:z(t)}),e(de,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(de,{"data-toolbox-metadata":"",children:o})]}),e(q,{className:"relative w-8 shrink-0 justify-center",children:m})]})}function L(){return st((t)=>t.connection==="ready"&&ee(t.agent))}var S=48;function Me({marketplace:t,plugins:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.removeMarketplace),[g,c]=C(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/S)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ke,{children:[e(Pe,{render:e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":p("plugins.pageActions")}),children:e(ie,{})}),e(ye,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(be,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(ce,{className:"size-3.5"}),p("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*S,(o+1)*S).map((n)=>e(De,{onOpen:m,plugin:n,marketplace:t,actions:e(Se,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>S&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(N,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:p("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/S)]}),e(N,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*S>=r.length,onClick:()=>c(o+1),children:p("plugins.nextPage")})]})]},t.name)}var Ee=ue(function({query:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=V(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,z(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
- `).toLowerCase()}))})),[a]),o=V(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:y,text:b})=>r===""?v.path!==null||n.has(y.id):b.includes(r)).map(({plugin:y})=>y)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(Me,{marketplace:n,plugins:v,onOpen:m},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:p("plugins.empty")})]})});function ze(){let{t}=d(),r=L(),m=i((h)=>h.addMarketplace),p=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=C(""),[o,n]=C(!1),[v,x]=C(!1),[y,b]=C(null),O=async()=>{let h=g.trim();if(!h||o)return;n(!0),b(null);try{await m({source:h}),c(""),x(!1)}catch(I){b(I instanceof Error?I.message:String(I))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void p(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(G,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),O()},children:[e(Ie,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(_,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(N,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(N,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Oe({onOpen:t,query:r}){let m=L(),p=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!m,g=pe(r.trim().toLowerCase());return e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[p.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(Ce,{}):e(Ee,{query:g,onOpen:t})]})})}function _s({cwd:t,active:r,extensions:m,onOpenCatalog:p}){let{t:a}=d(),g=qe(),c=je(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,y]=C("plugins"),[b,O]=C({plugins:"",skills:""}),h=x==="skills"?b.skills:b.plugins,I=(l)=>O((D)=>({...D,[x]:l})),Y=st((l)=>JSON.stringify([...new Set(l.sessionList.map((D)=>at(D.cwd,l.projectContext)).filter((D)=>D!==null))].toSorted())),B=JSON.stringify([...new Set([at(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),T=i((l)=>l.installed),H=a(x==="skills"?"plugins.skills.search":"plugins.search"),[P,R]=C(null),w=L();J(()=>{if(!r||!w)return;if(c.getState().loadedScope!==B)o(JSON.parse(B))},[r,w,o,B,c]),J(()=>{if(!w)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0,catalog:!1}))},[w,o,g]);let A=(l)=>{p?.(),y("plugins"),R(l)},j=(l)=>{p?.(),y(l),R(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e($t,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[m&&s(f,{className:`${u} h-8 gap-2 px-2`,active:m.active,onClick:m.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${u} h-8 gap-2 px-2`,active:!m?.active&&x===l&&P===null,onClick:()=>j(l),children:[l==="plugins"?e(le,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(k,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(M,{children:!w||n&&T.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):T.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):T.map((l)=>s(f,{title:z(l.plugin),className:`${u} gap-2 px-2`,active:!m?.active&&P?.plugin.id===l.plugin.id,onClick:()=>A(l),children:[e(U,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:z(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:m?.active?m.content:s(X,{children:[P&&e(Vt,{entry:P,onBack:()=>j("plugins")},JSON.stringify([P.marketplace.name,P.marketplace.path,P.plugin.id,t])),s("div",{hidden:P!==null,className:P?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(_e,{children:e(Bt,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(re,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(_,{className:"h-9 rounded-full ps-9 pe-9","aria-label":H,value:h,onChange:(l)=>I(l.target.value),placeholder:H}),h&&e(N,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>I(""),children:e(me,{})})]}),e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!w||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(oe,{})}),x==="plugins"&&e(ze,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(N,{size:"sm",className:"h-9",variant:"outline",disabled:n||!w,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Oe,{query:b.plugins,onOpen:A})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Gt,{query:b.skills,ready:w,onOpenPlugin:A})})]})]})]})})]})}
3
- export{_s};
1
+ import{u}from"./chunk-b5g055qp.js";import{M,f}from"./chunk-m4ds8kjc.js";import{$t}from"./chunk-tz1gzwas.js";import{qe,d,We,ct,i}from"./chunk-6cedp3k2.js";import{K,q,de,W,Z,we,Kt}from"./chunk-jf7em132.js";import{Ce}from"./chunk-89gyxwmd.js";import{dt}from"./chunk-19jh646d.js";import{k}from"./chunk-qk1yqepm.js";import{Wt,U}from"./chunk-mq0npf36.js";import{Q,_e}from"./chunk-n8b9yg4q.js";import{qt}from"./chunk-g1de763m.js";import{jt}from"./chunk-pr7xj1fn.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as G,PuzzleIcon as le,RefreshCwIcon as oe,SearchIcon as re,Trash2Icon as ce,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as J,useMemo as V,useState as C}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ke,DropdownMenuContent as ye,DropdownMenuItem as be,DropdownMenuTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as _}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Ie}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function z(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function Se({plugin:t,marketplace:r}){let{t:m}=d(),p=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=m(p?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!p)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(N,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:p||a||c,"aria-label":o,title:c?m("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:p?e(E,{"aria-hidden":"true"}):e(G,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function De({plugin:t,marketplace:r,actions:m,onOpen:p}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(we,{className:"toolbox-row relative",children:[e(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":z(t),onClick:()=>p({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(U,{name:t.name})})}),s(q,{className:"pointer-events-none relative min-w-0",children:[e(Kt,{className:"mb-0.5",children:z(t)}),e(de,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(de,{"data-toolbox-metadata":"",children:o})]}),e(K,{className:"relative w-8 shrink-0 justify-center",children:m})]})}function L(){return ct((t)=>t.connection==="ready"&&ee(t.agent))}var S=48;function Me({marketplace:t,plugins:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.removeMarketplace),[g,c]=C(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/S)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ke,{children:[e(Pe,{render:e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":p("plugins.pageActions")}),children:e(ie,{})}),e(ye,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(be,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(ce,{className:"size-3.5"}),p("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*S,(o+1)*S).map((n)=>e(De,{onOpen:m,plugin:n,marketplace:t,actions:e(Se,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>S&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(N,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:p("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/S)]}),e(N,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*S>=r.length,onClick:()=>c(o+1),children:p("plugins.nextPage")})]})]},t.name)}var Ee=ue(function({query:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=V(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,z(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),o=V(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:y,text:b})=>r===""?v.path!==null||n.has(y.id):b.includes(r)).map(({plugin:y})=>y)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(Me,{marketplace:n,plugins:v,onOpen:m},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:p("plugins.empty")})]})});function ze(){let{t}=d(),r=L(),m=i((h)=>h.addMarketplace),p=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=C(""),[o,n]=C(!1),[v,x]=C(!1),[y,b]=C(null),O=async()=>{let h=g.trim();if(!h||o)return;n(!0),b(null);try{await m({source:h}),c(""),x(!1)}catch(I){b(I instanceof Error?I.message:String(I))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void p(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(G,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),O()},children:[e(Ie,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(_,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(N,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(N,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Oe({onOpen:t,query:r}){let m=L(),p=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!m,g=pe(r.trim().toLowerCase());return e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[p.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(Ce,{}):e(Ee,{query:g,onOpen:t})]})})}function Ps({cwd:t,active:r,extensions:m,onOpenCatalog:p}){let{t:a}=d(),g=We(),c=qe(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,y]=C("plugins"),[b,O]=C({plugins:"",skills:""}),h=x==="skills"?b.skills:b.plugins,I=(l)=>O((D)=>({...D,[x]:l})),Y=ct((l)=>JSON.stringify([...new Set(l.sessionList.map((D)=>dt(D.cwd,l.projectContext)).filter((D)=>D!==null))].toSorted())),B=JSON.stringify([...new Set([dt(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),T=i((l)=>l.installed),H=a(x==="skills"?"plugins.skills.search":"plugins.search"),[P,R]=C(null),w=L();J(()=>{if(!r||!w)return;if(c.getState().loadedScope!==B)o(JSON.parse(B))},[r,w,o,B,c]),J(()=>{if(!w)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0,catalog:!1}))},[w,o,g]);let A=(l)=>{p?.(),y("plugins"),R(l)},j=(l)=>{p?.(),y(l),R(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(Wt,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[m&&s(f,{className:`${u} h-8 gap-2 px-2`,active:m.active,onClick:m.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${u} h-8 gap-2 px-2`,active:!m?.active&&x===l&&P===null,onClick:()=>j(l),children:[l==="plugins"?e(le,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(k,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(M,{children:!w||n&&T.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):T.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):T.map((l)=>s(f,{title:z(l.plugin),className:`${u} gap-2 px-2`,active:!m?.active&&P?.plugin.id===l.plugin.id,onClick:()=>A(l),children:[e(U,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:z(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:m?.active?m.content:s(X,{children:[P&&e(qt,{entry:P,onBack:()=>j("plugins")},JSON.stringify([P.marketplace.name,P.marketplace.path,P.plugin.id,t])),s("div",{hidden:P!==null,className:P?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(_e,{children:e($t,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(re,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(_,{className:"h-9 rounded-full ps-9 pe-9","aria-label":H,value:h,onChange:(l)=>I(l.target.value),placeholder:H}),h&&e(N,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>I(""),children:e(me,{})})]}),e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!w||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(oe,{})}),x==="plugins"&&e(ze,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(N,{size:"sm",className:"h-9",variant:"outline",disabled:n||!w,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Oe,{query:b.plugins,onOpen:A})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(jt,{query:b.skills,ready:w,onOpenPlugin:A})})]})]})]})})]})}
3
+ export{Ps};
@@ -0,0 +1,2 @@
1
+ import{groupSessions as Qe,projectName as pe,isQuickChatDirectory as zs,QUICK_CHATS_GROUP as ie}from"@nyssance/codex-acp-v2/client";
2
+ export{Qe,pe,zs,ie};
@@ -0,0 +1,2 @@
1
+ import{p}from"./chunk-g947bnqx.js";function _s(r,n){return p.readSkillDocument({path:r,roots:n??null})}
2
+ export{_s};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-rayhzb8p.js";import{codexTurnError as R}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as C}from"lucide-react";import{useEffect as k,useRef as i,useState as s}from"react";import{Button as I}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as m}from"react/jsx-runtime";function To({children:u}){return m("div",{className:"codex-error-message",role:"alert",children:[n(C,{"aria-hidden":"true"}),n("div",{className:"min-w-0 flex-1",children:u})]})}function Mo({error:u,retry:e}){let{t:f,turnErrorAction:T}=t(),c=R(u),[l]=s(()=>e?.delaySeconds==null?null:Date.now()+e.delaySeconds*1000),[p,v]=s(e?.delaySeconds??null),[h,y]=s(!1),[x,g]=s(null),o=i(!1),w=i(!1),E=i(e?.run);E.current=e?.run;let S=i((N)=>{let a=E.current;if(o.current||a===void 0)return;o.current=!0,y(!0),g(null),a(N).catch((r)=>{w.current=!0,o.current=!1,v(null),y(!1),g(r instanceof Error?r.message:String(r))})}),b=T?.(c),d=b===void 0&&e!==void 0&&c.retryable;return k(()=>{if(!d||l===null)return;let a=setInterval(()=>{if(w.current||o.current)return;let r=Math.max(0,Math.ceil((l-Date.now())/1000));if(v(r),r===0)S.current("automatic")},1000);return()=>clearInterval(a)},[l,d]),m(To,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:c.message}),b,d&&n(I,{variant:"outline",size:"sm",disabled:h,onClick:()=>S.current("manual"),children:p===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:p})})]}),x!==null&&n("div",{className:"text-muted-foreground mt-2 text-sm",children:x})]})}
2
- export{To,Mo};
1
+ import{t}from"./chunk-e4ws15tg.js";import{codexTurnError as R}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as C}from"lucide-react";import{useEffect as k,useRef as i,useState as s}from"react";import{Button as I}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as m}from"react/jsx-runtime";function No({children:u}){return m("div",{className:"codex-error-message",role:"alert",children:[n(C,{"aria-hidden":"true"}),n("div",{className:"min-w-0 flex-1",children:u})]})}function Ao({error:u,retry:e}){let{t:f,turnErrorAction:T}=t(),c=R(u),[l]=s(()=>e?.delaySeconds==null?null:Date.now()+e.delaySeconds*1000),[p,v]=s(e?.delaySeconds??null),[h,y]=s(!1),[x,g]=s(null),o=i(!1),w=i(!1),E=i(e?.run);E.current=e?.run;let S=i((N)=>{let a=E.current;if(o.current||a===void 0)return;o.current=!0,y(!0),g(null),a(N).catch((r)=>{w.current=!0,o.current=!1,v(null),y(!1),g(r instanceof Error?r.message:String(r))})}),b=T?.(c),d=b===void 0&&e!==void 0&&c.retryable;return k(()=>{if(!d||l===null)return;let a=setInterval(()=>{if(w.current||o.current)return;let r=Math.max(0,Math.ceil((l-Date.now())/1000));if(v(r),r===0)S.current("automatic")},1000);return()=>clearInterval(a)},[l,d]),m(No,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:c.message}),b,d&&n(I,{variant:"outline",size:"sm",disabled:h,onClick:()=>S.current("manual"),children:p===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:p})})]}),x!==null&&n("div",{className:"text-muted-foreground mt-2 text-sm",children:x})]})}
2
+ export{No,Ao};
@@ -1,2 +1,2 @@
1
- import{Wo}from"./chunk-k76s8cq2.js";import{XIcon as i}from"lucide-react";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as o}from"react/jsx-runtime";function xe({app:a,remove:e}){return o("span",{"data-app-reference":a.id,title:a.name,className:"inline-flex max-w-full items-baseline gap-1 align-baseline",children:[n(Wo,{kind:"app",name:a.name}),e&&n(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4 shrink-0","aria-label":e.label,disabled:e.disabled,onClick:e.onClick,children:n(i,{className:"size-3","aria-hidden":"true"})})]})}
1
+ import{Qo}from"./chunk-72xm1tz1.js";import{XIcon as i}from"lucide-react";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as o}from"react/jsx-runtime";function xe({app:a,remove:e}){return o("span",{"data-app-reference":a.id,title:a.name,className:"inline-flex max-w-full items-baseline gap-1 align-baseline",children:[n(Qo,{kind:"app",name:a.name}),e&&n(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4 shrink-0","aria-label":e.label,disabled:e.disabled,onClick:e.onClick,children:n(i,{className:"size-3","aria-hidden":"true"})})]})}
2
2
  export{xe};
@@ -0,0 +1,2 @@
1
+ import{createContext as t,useContext as o}from"react";var ao=t(null);function wn(){let e=o(ao);if(e===null)throw Error("Composer is missing");return e}
2
+ export{ao,wn};
@@ -1,2 +1,2 @@
1
- import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),xo=d(null);function el(){return i(xo)}var bo=d(null);function tl(){return i(bo)}var Pt=d(null);function he(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Tt=()=>i(C);function nl(){let r=i(Pt);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(Pt);function gr({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:A,attachmentPolicy:f,value:R,onValueChange:y,attachments:U,onAttachmentsChange:L,children:B}){let S=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""},[]),T=R!==void 0,[G,J]=z(r),p=R??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,T)y?.(t);else J(t)},[T,y]),h=n(()=>P(""),[P]),v=U!==void 0,[K,N]=z([]),x=U??K,b=I(x);b.current=x;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)L?.(e);else N(e)},[v,L]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:S(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[f,S,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),A?.()},[A,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(v)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[v]);let k=n(()=>{w.current?.()},[]),F=q(()=>({files:x,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[x,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:h,getRevision:W,clearSubmitted:c??h},attachments:F,__registerFileInput:H}),[p,P,h,W,c,F,H]);return D(C.Provider,{value:Q,children:D(Pt.Provider,{value:F,children:B})})}var Co=d(null);function g(){let r=X(),l=i(Co),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
- export{xo,el,bo,tl,Pt,he,Tt,nl,gr,Co,g};
1
+ import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),Co=d(null);function el(){return i(Co)}var wo=d(null);function tl(){return i(wo)}var At=d(null);function he(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Et=()=>i(C);function nl(){let r=i(At);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(At);function fr({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:A,attachmentPolicy:f,value:R,onValueChange:y,attachments:U,onAttachmentsChange:L,children:B}){let S=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""},[]),T=R!==void 0,[G,J]=z(r),p=R??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,T)y?.(t);else J(t)},[T,y]),h=n(()=>P(""),[P]),v=U!==void 0,[K,N]=z([]),x=U??K,b=I(x);b.current=x;let s=n((t)=>{let e=typeof t==="function"?t(b.current):t;if(v)L?.(e);else N(e)},[v,L]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:S(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[f,S,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),A?.()},[A,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(v)return;return()=>{for(let t of b.current)if(t.url)URL.revokeObjectURL(t.url)}},[v]);let k=n(()=>{w.current?.()},[]),F=q(()=>({files:x,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[x,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:h,getRevision:W,clearSubmitted:c??h},attachments:F,__registerFileInput:H}),[p,P,h,W,c,F,H]);return D(C.Provider,{value:Q,children:D(At.Provider,{value:F,children:B})})}var ko=d(null);function g(){let r=X(),l=i(ko),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
+ export{Co,el,wo,tl,At,he,Et,nl,fr,ko,g};
@@ -1,3 +1,3 @@
1
- var sl=["full","compact","codexUI"];function Er(t){return t==="compact"||t==="codexUI"}var Ha=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function oe(t){let o=Ha.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
1
+ var sl=["full","compact","codexUI"];function Rr(t){return t==="compact"||t==="codexUI"}var Ha=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function oe(t){let o=Ha.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
2
2
  `)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function al(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
3
- export{sl,Er,Ha,oe,al};
3
+ export{sl,Rr,Ha,oe,al};
@@ -0,0 +1,2 @@
1
+ import{bt}from"./chunk-r7g85s0a.js";var qi={persistConfig:!1,nativeTools:{},applicationContext:()=>bt(null),parseConfig(t){if(Object.keys(t).length)throw Error("Chat input config must be empty");return{}},routePrompt(t){return t.native()}};
2
+ export{qi};
@@ -1,2 +1,2 @@
1
- var il=280;function br({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function ot({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function _o({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function Cr({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function wr({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function kr({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
- export{il,br,ot,_o,Cr,wr,kr};
1
+ var il=280;function Cr({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function st({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function Io({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function wr({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function kr({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function Sr({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
+ export{il,Cr,st,Io,wr,kr,Sr};