@alwith/module-chat 0.6.34 → 0.6.36

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 (487) hide show
  1. package/dist/activity-host.d.ts +2 -0
  2. package/dist/activity-host.js +1 -1
  3. package/dist/agent/client.d.ts +2 -0
  4. package/dist/agent/client.js +1 -1
  5. package/dist/agent/custom-model-effort.js +1 -1
  6. package/dist/agent/fork-title.js +1 -1
  7. package/dist/agent/image-request.js +1 -1
  8. package/dist/agent/image-tools.d.ts +3 -1
  9. package/dist/agent/image-tools.js +1 -1
  10. package/dist/agent/input-config.js +1 -1
  11. package/dist/agent/input-modes/chat.js +1 -1
  12. package/dist/agent/input-modes/execution-meta.js +1 -1
  13. package/dist/agent/input-modes/image-context.js +1 -1
  14. package/dist/agent/input-modes/image.js +1 -1
  15. package/dist/agent/input-modes/index.js +1 -1
  16. package/dist/agent/project-path.js +1 -1
  17. package/dist/agent/request-error.js +1 -1
  18. package/dist/agent/session-list-refresh.js +1 -1
  19. package/dist/app-reference.js +1 -1
  20. package/dist/application-tools.js +1 -1
  21. package/dist/approval/choice-elicitation-form.js +1 -1
  22. package/dist/approval/choice-schema.js +1 -1
  23. package/dist/approval/permission-options.js +1 -1
  24. package/dist/approval/permission-view.js +1 -1
  25. package/dist/approval/schema-elicitation-form.js +1 -1
  26. package/dist/approval/url-elicitation-card.js +1 -1
  27. package/dist/{chunk-pr6qwqpj.js → chunk-05n5eyp9.js} +2 -2
  28. package/dist/{chunk-g7dxg38a.js → chunk-0ck2zpaa.js} +2 -2
  29. package/dist/chunk-0kpapqak.js +2 -0
  30. package/dist/{chunk-89gyxwmd.js → chunk-0qrd3jvc.js} +2 -2
  31. package/dist/{chunk-mq0npf36.js → chunk-0xgnhbn4.js} +2 -2
  32. package/dist/chunk-13jj645z.js +2 -0
  33. package/dist/{chunk-54j6xftt.js → chunk-13sxt6bc.js} +2 -2
  34. package/dist/{chunk-j4ejwthn.js → chunk-1byvdggd.js} +2 -2
  35. package/dist/{chunk-z8b3nz7t.js → chunk-1dtg361q.js} +2 -2
  36. package/dist/{chunk-pae2hjvq.js → chunk-1rfxfqek.js} +2 -2
  37. package/dist/chunk-21mp4gww.js +2 -0
  38. package/dist/{chunk-cef598jy.js → chunk-22teksk6.js} +2 -2
  39. package/dist/{chunk-mfkrs2at.js → chunk-268b0xhk.js} +2 -2
  40. package/dist/{chunk-dcvmc9hn.js → chunk-27s3z9q6.js} +2 -2
  41. package/dist/{chunk-75xtk0a3.js → chunk-2bsxqh9p.js} +2 -2
  42. package/dist/{chunk-r8sq654w.js → chunk-2kb4rtw7.js} +2 -2
  43. package/dist/{chunk-k3fwyr6s.js → chunk-2segzfjp.js} +2 -2
  44. package/dist/{chunk-n8b9yg4q.js → chunk-3knw8e0x.js} +2 -2
  45. package/dist/{chunk-ckbqdg1s.js → chunk-3q3n1n1m.js} +2 -2
  46. package/dist/{chunk-9n8cds8p.js → chunk-3tvq6xr2.js} +2 -2
  47. package/dist/chunk-41yp708e.js +2 -0
  48. package/dist/{chunk-eqa6cd7b.js → chunk-467091s6.js} +2 -2
  49. package/dist/{chunk-19jh646d.js → chunk-4chmr87g.js} +2 -2
  50. package/dist/chunk-4ezsy9sc.js +2 -0
  51. package/dist/chunk-4ma6bmcm.js +2 -0
  52. package/dist/{chunk-bhajnmtf.js → chunk-4t2a903d.js} +2 -2
  53. package/dist/{chunk-masqfje4.js → chunk-514abcnn.js} +2 -2
  54. package/dist/{chunk-x6spt0mc.js → chunk-5axg9jdz.js} +2 -2
  55. package/dist/chunk-5k46n3e8.js +2 -0
  56. package/dist/{chunk-re4vc51w.js → chunk-5t2e22f6.js} +2 -2
  57. package/dist/{chunk-68afy8mk.js → chunk-61bnywk9.js} +2 -2
  58. package/dist/{chunk-q61xz251.js → chunk-62qf6t7x.js} +2 -2
  59. package/dist/{chunk-sgmh6sa8.js → chunk-67fn9pq0.js} +2 -2
  60. package/dist/{chunk-ks22p0wq.js → chunk-68w4f5q0.js} +2 -2
  61. package/dist/{chunk-4jza4wwy.js → chunk-6c7q2rz8.js} +2 -2
  62. package/dist/{chunk-6nbqbjnb.js → chunk-6e952n0r.js} +3 -3
  63. package/dist/{chunk-5x2aqmhm.js → chunk-6kvrdgjn.js} +2 -2
  64. package/dist/{chunk-mrwawq46.js → chunk-6m7bnj0g.js} +2 -2
  65. package/dist/chunk-6ve41ce0.js +4 -0
  66. package/dist/chunk-6w7js8qd.js +2 -0
  67. package/dist/{chunk-965sngjd.js → chunk-6wstx1k6.js} +2 -2
  68. package/dist/{chunk-b6sb3akb.js → chunk-7a3q5976.js} +2 -2
  69. package/dist/{chunk-dhn9f10w.js → chunk-7ecymeg2.js} +2 -2
  70. package/dist/{chunk-y8p2dmw3.js → chunk-7nfbzajq.js} +2 -2
  71. package/dist/{chunk-zk395v8p.js → chunk-7pfkx9a2.js} +2 -2
  72. package/dist/{chunk-zv3bm3np.js → chunk-7rdf7eeh.js} +2 -2
  73. package/dist/{chunk-vb9mn75j.js → chunk-7vhhtb2a.js} +2 -2
  74. package/dist/{chunk-rd51rvde.js → chunk-80nnn15f.js} +2 -2
  75. package/dist/{chunk-2dnzdsrv.js → chunk-81ka3rnv.js} +3 -3
  76. package/dist/{chunk-vgea7ggq.js → chunk-82apcrn6.js} +2 -2
  77. package/dist/{chunk-xqqk85kd.js → chunk-82ytwr57.js} +2 -2
  78. package/dist/{chunk-zyn0ys4m.js → chunk-85yqchzc.js} +2 -2
  79. package/dist/chunk-89jwjv3m.js +2 -0
  80. package/dist/chunk-8e9h60we.js +2 -0
  81. package/dist/{chunk-sbyp6k8w.js → chunk-8fzg0pmc.js} +2 -2
  82. package/dist/chunk-8ncatcr7.js +2 -0
  83. package/dist/{chunk-jaghs2z5.js → chunk-8p2b77ta.js} +2 -2
  84. package/dist/{chunk-tj0530fn.js → chunk-8zkn8x2j.js} +2 -2
  85. package/dist/chunk-94fwccyb.js +2 -0
  86. package/dist/{chunk-zb0m2cqy.js → chunk-986yknqs.js} +2 -2
  87. package/dist/chunk-98k8jwbn.js +2 -0
  88. package/dist/chunk-9v4r1cr6.js +2 -0
  89. package/dist/{chunk-tz1gzwas.js → chunk-a2tkhes5.js} +2 -2
  90. package/dist/chunk-a779rnge.js +2 -0
  91. package/dist/{chunk-9y0fxq8e.js → chunk-a9mbtd12.js} +2 -2
  92. package/dist/{chunk-erdrx47j.js → chunk-abt670s7.js} +2 -2
  93. package/dist/{chunk-r7g85s0a.js → chunk-afnnrn6z.js} +2 -2
  94. package/dist/{chunk-4wm5emgf.js → chunk-b1yfr8gv.js} +2 -2
  95. package/dist/chunk-bb2s9nb6.js +2 -0
  96. package/dist/chunk-beraaxpx.js +2 -0
  97. package/dist/{chunk-z6tw9cf9.js → chunk-bz890a7b.js} +2 -2
  98. package/dist/{chunk-pr7xj1fn.js → chunk-ca7kgbwx.js} +2 -2
  99. package/dist/{chunk-kj3a1k2q.js → chunk-chjt1pct.js} +2 -2
  100. package/dist/{chunk-fpsn6fmf.js → chunk-ckft9abb.js} +2 -2
  101. package/dist/{chunk-1d29gnb2.js → chunk-ckgww50b.js} +2 -2
  102. package/dist/{chunk-e84mhse2.js → chunk-cn9hc5xr.js} +3 -3
  103. package/dist/{chunk-bsb08p49.js → chunk-d564jqyw.js} +3 -3
  104. package/dist/{chunk-prwzyc7q.js → chunk-dhj0vkek.js} +2 -2
  105. package/dist/{chunk-q78ng7mn.js → chunk-dqyfe90s.js} +2 -2
  106. package/dist/{chunk-fwn521m5.js → chunk-dvaxrrss.js} +2 -2
  107. package/dist/{chunk-r8gnmyb1.js → chunk-dxjwdfra.js} +2 -2
  108. package/dist/{chunk-9t672hzm.js → chunk-epqzypsa.js} +2 -2
  109. package/dist/{chunk-103z8myv.js → chunk-etnfpzpv.js} +2 -2
  110. package/dist/{chunk-0bc7gfq4.js → chunk-evgfpd16.js} +2 -2
  111. package/dist/{chunk-15m908ph.js → chunk-f2h074g0.js} +2 -2
  112. package/dist/{chunk-a18avvt2.js → chunk-f4dz7xen.js} +2 -2
  113. package/dist/{chunk-vab1ysnz.js → chunk-f6wp23k0.js} +2 -2
  114. package/dist/{chunk-r0dg1bjd.js → chunk-f6y0xqz9.js} +2 -2
  115. package/dist/{chunk-kbzsn9xw.js → chunk-fe83mqnb.js} +2 -2
  116. package/dist/chunk-fg7za6sb.js +2 -0
  117. package/dist/{chunk-28nsjq3w.js → chunk-fkzvbhfw.js} +5 -5
  118. package/dist/{chunk-9jth6sk7.js → chunk-fm35s6dq.js} +2 -2
  119. package/dist/{chunk-g1de763m.js → chunk-ft9b1d3f.js} +2 -2
  120. package/dist/chunk-fwejeh0a.js +2 -0
  121. package/dist/{chunk-zyyn9t8n.js → chunk-g2pjvjym.js} +3 -3
  122. package/dist/chunk-g31pwmy2.js +2 -0
  123. package/dist/{chunk-nhz4egjh.js → chunk-g551brtp.js} +6 -6
  124. package/dist/{chunk-8gas4q2s.js → chunk-gq2gckvv.js} +2 -2
  125. package/dist/chunk-gxn9pp4b.js +2 -0
  126. package/dist/{chunk-7p0d3rz7.js → chunk-gxvkgcs0.js} +2 -2
  127. package/dist/{chunk-81xwn9e5.js → chunk-h12xxave.js} +3 -3
  128. package/dist/{chunk-0b50jg23.js → chunk-hd5zm7tc.js} +2 -2
  129. package/dist/chunk-hdksy68d.js +2 -0
  130. package/dist/chunk-hqfmwbq5.js +2 -0
  131. package/dist/{chunk-n8fe2njr.js → chunk-hwccdg3k.js} +2 -2
  132. package/dist/chunk-hxstf6c4.js +2 -0
  133. package/dist/{chunk-gfkx1z04.js → chunk-j14fa32z.js} +2 -2
  134. package/dist/{chunk-x49qjrbk.js → chunk-jfp8yj9p.js} +2 -2
  135. package/dist/{chunk-0a3tr9ws.js → chunk-jj0bpzkq.js} +2 -2
  136. package/dist/chunk-jmanx88h.js +2 -0
  137. package/dist/{chunk-ske5z0gp.js → chunk-jpzjh400.js} +2 -2
  138. package/dist/{chunk-9x70f7zv.js → chunk-jra95vzv.js} +2 -2
  139. package/dist/{chunk-84p483n0.js → chunk-jreyzbd6.js} +2 -2
  140. package/dist/{chunk-vys8kfkp.js → chunk-jsnt49t5.js} +2 -2
  141. package/dist/chunk-jyrpyjt3.js +2 -0
  142. package/dist/{chunk-8hm3nkrk.js → chunk-k014w2jg.js} +2 -2
  143. package/dist/{chunk-y0rnvmrw.js → chunk-k7dp9ead.js} +2 -2
  144. package/dist/chunk-keh9cbwe.js +2 -0
  145. package/dist/{chunk-8w08gd0y.js → chunk-keyttjc9.js} +3 -3
  146. package/dist/chunk-kg363yzh.js +2 -0
  147. package/dist/{chunk-1gb1vwvy.js → chunk-kk9dbwd1.js} +2 -2
  148. package/dist/{chunk-gktjkghg.js → chunk-kv22b8h2.js} +2 -2
  149. package/dist/chunk-kvmd0mhe.js +2 -0
  150. package/dist/{chunk-45yrj0e1.js → chunk-m31z2z11.js} +5 -5
  151. package/dist/{chunk-qd9s7wmj.js → chunk-m9b9dzjh.js} +3 -3
  152. package/dist/{chunk-x2wcwpw3.js → chunk-md3d3pby.js} +2 -2
  153. package/dist/{chunk-vedvkp9e.js → chunk-mf3dn22w.js} +3 -3
  154. package/dist/{chunk-qk1yqepm.js → chunk-mhrn3e8j.js} +2 -2
  155. package/dist/chunk-mnktrf2v.js +2 -0
  156. package/dist/chunk-mp5f940y.js +1 -0
  157. package/dist/chunk-mphkyhy8.js +2 -0
  158. package/dist/chunk-mqdbs8jj.js +2 -0
  159. package/dist/{chunk-b9v0vew6.js → chunk-mywbsrxq.js} +2 -2
  160. package/dist/{chunk-v4tznge3.js → chunk-n4rapj4e.js} +3 -3
  161. package/dist/chunk-nd0d4qr4.js +2 -0
  162. package/dist/{chunk-5h49mv0e.js → chunk-newkrtrj.js} +2 -2
  163. package/dist/{chunk-64apxzn7.js → chunk-njrvhvy4.js} +2 -2
  164. package/dist/{chunk-k5kzw2px.js → chunk-nrt1zx5c.js} +3 -3
  165. package/dist/{chunk-qwjz3jsz.js → chunk-nxfwgbny.js} +2 -2
  166. package/dist/{chunk-at25g15n.js → chunk-nypm3ef8.js} +2 -2
  167. package/dist/chunk-q54ca1am.js +2 -0
  168. package/dist/chunk-q8mw16nx.js +3 -0
  169. package/dist/chunk-qa29z7wk.js +4 -0
  170. package/dist/{chunk-m6sdmcpj.js → chunk-qp4b32gm.js} +2 -2
  171. package/dist/chunk-qt4gdwcw.js +2 -0
  172. package/dist/{chunk-2eceheqt.js → chunk-r14byyqy.js} +3 -3
  173. package/dist/{chunk-tjt1s9qs.js → chunk-r7tpt9zy.js} +2 -2
  174. package/dist/{chunk-0t4fcgge.js → chunk-ra52dqfb.js} +2 -2
  175. package/dist/{chunk-f6cexkjm.js → chunk-rcj2df96.js} +3 -3
  176. package/dist/chunk-re9ryzrv.js +2 -0
  177. package/dist/chunk-rf8agwdk.js +2 -0
  178. package/dist/chunk-rgsf9xkw.js +4 -0
  179. package/dist/{chunk-yq4wz4n8.js → chunk-rmdf5jhd.js} +2 -2
  180. package/dist/{chunk-1md5vq9g.js → chunk-rp7qt6hm.js} +2 -2
  181. package/dist/chunk-rp87rhya.js +4 -0
  182. package/dist/{chunk-rr5ek064.js → chunk-rq4nw301.js} +2 -2
  183. package/dist/{chunk-r5q65gf3.js → chunk-s15zgqkg.js} +2 -2
  184. package/dist/{chunk-zg0tv3sj.js → chunk-s7396jw0.js} +3 -3
  185. package/dist/{chunk-dwxmgsg8.js → chunk-s953r0cw.js} +2 -2
  186. package/dist/chunk-sbcgvk9a.js +2 -0
  187. package/dist/{chunk-52wrk1mh.js → chunk-sd6sd4r8.js} +2 -2
  188. package/dist/{chunk-88ysxbdh.js → chunk-sjh2sz62.js} +2 -2
  189. package/dist/{chunk-zqpcrtde.js → chunk-ssrhst9t.js} +2 -2
  190. package/dist/{chunk-vnd6smsp.js → chunk-tdmz20zc.js} +2 -2
  191. package/dist/{chunk-xqb4thy8.js → chunk-tfkz3bae.js} +2 -2
  192. package/dist/{chunk-z0q7ghbg.js → chunk-va5f2mdb.js} +2 -2
  193. package/dist/{chunk-72xm1tz1.js → chunk-vc6yxjs3.js} +2 -2
  194. package/dist/chunk-vgxvtmja.js +2 -0
  195. package/dist/{chunk-wpacvdsv.js → chunk-vn7159fh.js} +2 -2
  196. package/dist/chunk-vnxa4qe2.js +2 -0
  197. package/dist/chunk-w1ndngnh.js +2 -0
  198. package/dist/{chunk-8w5bt0nc.js → chunk-w1yrsbw1.js} +2 -2
  199. package/dist/{chunk-w83nb5a8.js → chunk-w86ckd6d.js} +2 -2
  200. package/dist/chunk-w9z2zezn.js +2 -0
  201. package/dist/{chunk-wvm6ppb3.js → chunk-wf5tt5t4.js} +2 -2
  202. package/dist/{chunk-bq31dzpj.js → chunk-wrqmbvv2.js} +2 -2
  203. package/dist/{chunk-7m8hw6gh.js → chunk-wv501ppg.js} +2 -2
  204. package/dist/{chunk-6h10jana.js → chunk-ww4tmz88.js} +2 -2
  205. package/dist/chunk-wy7rkpqe.js +2 -0
  206. package/dist/{chunk-p216frcj.js → chunk-x0m0ebq0.js} +2 -2
  207. package/dist/chunk-x2xwfwcx.js +2 -0
  208. package/dist/{chunk-rt9dn0b3.js → chunk-x8j184pq.js} +3 -3
  209. package/dist/chunk-xb28q0sm.js +2 -0
  210. package/dist/{chunk-zy6qme7n.js → chunk-xkv1qwkh.js} +2 -2
  211. package/dist/{chunk-11kkxd6v.js → chunk-xvf85xre.js} +2 -2
  212. package/dist/chunk-xxaj040w.js +2 -0
  213. package/dist/{chunk-ksq9a3pf.js → chunk-xxwevgqr.js} +2 -2
  214. package/dist/{chunk-h4xx90s4.js → chunk-y6ac70r7.js} +2 -2
  215. package/dist/{chunk-mt01qph9.js → chunk-y6b3mjjn.js} +2 -2
  216. package/dist/{chunk-8sa6xn88.js → chunk-ya8e4rt0.js} +2 -2
  217. package/dist/{chunk-mhhtcbh9.js → chunk-yde0ncgz.js} +2 -2
  218. package/dist/{chunk-86tpa1nn.js → chunk-yekcndnq.js} +2 -2
  219. package/dist/{chunk-x2x9g6vk.js → chunk-yn6pz38m.js} +2 -2
  220. package/dist/{chunk-ad53zbdb.js → chunk-yqzpxk5y.js} +2 -2
  221. package/dist/{chunk-arr0hypp.js → chunk-z26j4tt7.js} +2 -2
  222. package/dist/chunk-z29anjt1.js +2 -0
  223. package/dist/{chunk-dqjhmzjy.js → chunk-z6swkqb1.js} +2 -2
  224. package/dist/{chunk-nef7y6mg.js → chunk-zetd8vk4.js} +2 -2
  225. package/dist/{chunk-mmrwaa9h.js → chunk-zpetyx45.js} +2 -2
  226. package/dist/{chunk-as2j0yp0.js → chunk-zsd44z1c.js} +2 -2
  227. package/dist/{chunk-69tgmjdb.js → chunk-zssbsc1f.js} +2 -2
  228. package/dist/chunk-zxa4jnpe.js +2 -0
  229. package/dist/{chunk-dxwbgg69.js → chunk-zz582m73.js} +2 -2
  230. package/dist/client.js +1 -1
  231. package/dist/codex/activity-group.js +1 -1
  232. package/dist/codex/artifact-links.js +1 -1
  233. package/dist/codex/assistant-message.js +1 -1
  234. package/dist/codex/async-question-card.js +1 -1
  235. package/dist/codex/disclosure-state.js +1 -1
  236. package/dist/codex/edited-files-card.js +1 -1
  237. package/dist/codex/image-view-activity.js +1 -1
  238. package/dist/codex/markdown-renderer.js +1 -1
  239. package/dist/codex/navigation-audio.js +1 -1
  240. package/dist/codex/navigation-preview.js +1 -1
  241. package/dist/codex/navigation-rail.js +1 -1
  242. package/dist/codex/patch-view.js +1 -1
  243. package/dist/codex/plan.js +1 -1
  244. package/dist/codex/timeline-virtualizer.js +1 -1
  245. package/dist/codex/turn-activity.js +1 -1
  246. package/dist/codex/user-message.js +1 -1
  247. package/dist/codex/virtualized-turn-list.js +1 -1
  248. package/dist/collections/collection-emoji.js +1 -1
  249. package/dist/collections/collection-menu.js +1 -1
  250. package/dist/collections/collection-panel.js +1 -1
  251. package/dist/collections/collections.js +1 -1
  252. package/dist/collections/host.js +1 -1
  253. package/dist/collections/locales.js +1 -1
  254. package/dist/collections/model.js +1 -1
  255. package/dist/collections/store.js +1 -1
  256. package/dist/composer/completion-filter.js +1 -1
  257. package/dist/composer/completion-menu.js +1 -1
  258. package/dist/composer/completion-trigger.js +1 -1
  259. package/dist/composer/effort-slider.js +1 -1
  260. package/dist/composer/inline-document.js +1 -1
  261. package/dist/composer/inline-dom.js +1 -1
  262. package/dist/composer/menu-radio.js +1 -1
  263. package/dist/composer/model-select.js +1 -1
  264. package/dist/composer/permission-mode-select.js +1 -1
  265. package/dist/composer/prompt-input-attachments.js +1 -1
  266. package/dist/composer/prompt-input-clipboard.js +1 -1
  267. package/dist/composer/prompt-input-context.d.ts +9 -0
  268. package/dist/composer/prompt-input-context.js +1 -1
  269. package/dist/composer/prompt-input-inline.js +1 -1
  270. package/dist/composer/prompt-input-textarea.js +1 -1
  271. package/dist/composer/prompt-input.js +1 -1
  272. package/dist/conversation/action-card.js +1 -1
  273. package/dist/conversation/composer/app-mentions.js +1 -1
  274. package/dist/conversation/composer/apps-menu.js +1 -1
  275. package/dist/conversation/composer/composer-menu.js +1 -1
  276. package/dist/conversation/composer/composer.js +1 -1
  277. package/dist/conversation/composer/context.js +1 -1
  278. package/dist/conversation/composer/drafts.js +1 -1
  279. package/dist/conversation/composer/file-items.js +1 -1
  280. package/dist/conversation/composer/long-text.js +1 -1
  281. package/dist/conversation/composer/mention-chips.js +1 -1
  282. package/dist/conversation/composer/mention-uri.js +1 -1
  283. package/dist/conversation/composer/model-menu.js +1 -1
  284. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  285. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  286. package/dist/conversation/composer/prediction.js +1 -1
  287. package/dist/conversation/composer/prompt-history.js +1 -1
  288. package/dist/conversation/composer/slash-command-button.js +1 -1
  289. package/dist/conversation/composer/submit-button.js +1 -1
  290. package/dist/conversation/composer/usage-meter.js +1 -1
  291. package/dist/conversation/connection-notice.js +1 -1
  292. package/dist/conversation/context.js +1 -1
  293. package/dist/conversation/conversation-body.js +1 -1
  294. package/dist/conversation/conversation-search.js +1 -1
  295. package/dist/conversation/conversation-view.js +1 -1
  296. package/dist/conversation/conversation.js +1 -1
  297. package/dist/conversation/diff-modal.js +1 -1
  298. package/dist/conversation/draft-project-picker.js +1 -1
  299. package/dist/conversation/session-actions.js +1 -1
  300. package/dist/conversation/subagent-sessions.js +1 -1
  301. package/dist/conversation/subagent-tasks.js +1 -1
  302. package/dist/desktop/desktop-composer.d.ts +3 -1
  303. package/dist/desktop/desktop-composer.js +1 -1
  304. package/dist/desktop/desktop.js +1 -1
  305. package/dist/desktop/draft-model-select.js +1 -1
  306. package/dist/desktop/load-image.js +1 -1
  307. package/dist/desktop/model-catalog.js +1 -1
  308. package/dist/desktop/model-recovery.js +1 -1
  309. package/dist/desktop/model-settings-action.js +1 -1
  310. package/dist/desktop/native-file-drop.d.ts +4 -1
  311. package/dist/desktop/native-file-drop.js +1 -1
  312. package/dist/generated/commands.d.ts +4 -0
  313. package/dist/generated/commands.js +1 -1
  314. package/dist/generated-image-storage.d.ts +11 -0
  315. package/dist/generated-image-storage.js +1 -0
  316. package/dist/image-lightbox.js +1 -1
  317. package/dist/image-preview-dialog.js +1 -1
  318. package/dist/image.d.ts +5 -1
  319. package/dist/image.js +1 -1
  320. package/dist/lib/app-reference.js +1 -1
  321. package/dist/lib/application-metadata.js +1 -1
  322. package/dist/lib/chat-path.js +1 -1
  323. package/dist/lib/code-highlighter.js +1 -1
  324. package/dist/lib/file-url.js +1 -1
  325. package/dist/lib/fuzzy.js +1 -1
  326. package/dist/lib/group-blocks.js +1 -1
  327. package/dist/lib/image-encode.js +1 -1
  328. package/dist/lib/limits.js +1 -1
  329. package/dist/lib/markdown-parser.js +1 -1
  330. package/dist/lib/markdown-rules.js +1 -1
  331. package/dist/lib/model-name.js +1 -1
  332. package/dist/lib/pointer-centered-zoom.js +1 -1
  333. package/dist/lib/prepare-prompt-files.d.ts +2 -2
  334. package/dist/lib/prepare-prompt-files.js +1 -1
  335. package/dist/lib/reference-presentation.js +1 -1
  336. package/dist/lib/stream-style.js +1 -1
  337. package/dist/lib/streaming-markdown.js +1 -1
  338. package/dist/lib/tool-artifacts.js +1 -1
  339. package/dist/locales.js +1 -1
  340. package/dist/mermaid/diagram.js +1 -1
  341. package/dist/mermaid/export.js +1 -1
  342. package/dist/mermaid/index.js +1 -1
  343. package/dist/mermaid/preview.js +1 -1
  344. package/dist/oauth/claude-login.js +1 -1
  345. package/dist/oauth.js +1 -1
  346. package/dist/plugins/catalog-header.js +1 -1
  347. package/dist/plugins/catalog-skeleton.js +1 -1
  348. package/dist/plugins/host.js +1 -1
  349. package/dist/plugins/locales.js +1 -1
  350. package/dist/plugins/new-chat-directory.js +1 -1
  351. package/dist/plugins/pane.js +1 -1
  352. package/dist/plugins/panel-item.js +1 -1
  353. package/dist/plugins/plugin-detail-page.js +1 -1
  354. package/dist/plugins/plugin-icon.js +1 -1
  355. package/dist/plugins/plugin-icons.js +1 -1
  356. package/dist/plugins/plugins-page.js +1 -1
  357. package/dist/plugins/plugins.js +1 -1
  358. package/dist/plugins/read-skill-document.js +1 -1
  359. package/dist/plugins/skill-document.js +1 -1
  360. package/dist/plugins/skills-tab.js +1 -1
  361. package/dist/plugins/store.js +1 -1
  362. package/dist/plugins/toolbox-layout.js +1 -1
  363. package/dist/reference-projection.js +1 -1
  364. package/dist/search/chat-search.js +1 -1
  365. package/dist/search/codex-source-matches.js +1 -1
  366. package/dist/search/dom-matches.js +1 -1
  367. package/dist/search/find-bar.js +1 -1
  368. package/dist/search/literal-matches.js +1 -1
  369. package/dist/session-list/account-menu.js +1 -1
  370. package/dist/session-list/activity-list.js +1 -1
  371. package/dist/session-list/archived-sessions.js +1 -1
  372. package/dist/session-list/help-menu.js +1 -1
  373. package/dist/session-list/highlight.js +1 -1
  374. package/dist/session-list/host.js +1 -1
  375. package/dist/session-list/hover-info-card.js +1 -1
  376. package/dist/session-list/locales.js +1 -1
  377. package/dist/session-list/navigation-controls.js +1 -1
  378. package/dist/session-list/navigation-header.js +1 -1
  379. package/dist/session-list/navigation-store.js +1 -1
  380. package/dist/session-list/navigation-tabs.js +1 -1
  381. package/dist/session-list/navigation.js +1 -1
  382. package/dist/session-list/platform.js +1 -1
  383. package/dist/session-list/row-stop-button.js +1 -1
  384. package/dist/session-list/session-groups.js +1 -1
  385. package/dist/session-list/session-info-card.js +1 -1
  386. package/dist/session-list/session-list.js +1 -1
  387. package/dist/session-list/session-row.js +1 -1
  388. package/dist/session-list/session-state-dot.js +1 -1
  389. package/dist/session-list/session-state-menu.js +1 -1
  390. package/dist/session-list/shortcut-hint.js +1 -1
  391. package/dist/session-list/shortcut.js +1 -1
  392. package/dist/session-list/sidebar-overlay.js +1 -1
  393. package/dist/session-list/trailing-swap.js +1 -1
  394. package/dist/session-list/use-activity-notification.js +1 -1
  395. package/dist/session-list/use-activity-preview.js +1 -1
  396. package/dist/session-list/use-cmd-held.js +1 -1
  397. package/dist/session-list/use-project-sessions.js +1 -1
  398. package/dist/session-list/virtual-session-rows.js +1 -1
  399. package/dist/session-timeline/activity-group.js +1 -1
  400. package/dist/session-timeline/activity-projection.js +1 -1
  401. package/dist/session-timeline/assistant-content.js +1 -1
  402. package/dist/session-timeline/assistant-image-references.js +1 -1
  403. package/dist/session-timeline/assistant-turn.js +1 -1
  404. package/dist/session-timeline/async-questions.js +1 -1
  405. package/dist/session-timeline/edited-files-card.js +1 -1
  406. package/dist/session-timeline/history-timeline.js +1 -1
  407. package/dist/session-timeline/host.js +1 -1
  408. package/dist/session-timeline/image-generation-progress.js +1 -1
  409. package/dist/session-timeline/navigation-rail.js +1 -1
  410. package/dist/session-timeline/plan.js +1 -1
  411. package/dist/session-timeline/question-reply.js +1 -1
  412. package/dist/session-timeline/resource-content.js +1 -1
  413. package/dist/session-timeline/session-timeline.js +1 -1
  414. package/dist/session-timeline/timeline-registry.js +1 -1
  415. package/dist/session-timeline/turn-activity.js +1 -1
  416. package/dist/session-timeline/turn-error.js +1 -1
  417. package/dist/session-timeline/turn-retry.js +1 -1
  418. package/dist/session-timeline/turn-time.js +1 -1
  419. package/dist/session-timeline/turns.js +1 -1
  420. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  421. package/dist/session-timeline/user-message.js +1 -1
  422. package/dist/settings/codex-account-card.js +1 -1
  423. package/dist/settings/login-card.js +1 -1
  424. package/dist/settings/model-alias-settings.js +1 -1
  425. package/dist/settings/model-aliases.js +1 -1
  426. package/dist/settings/provider-logos.js +1 -1
  427. package/dist/settings/provider-section.js +1 -1
  428. package/dist/settings/providers-port.js +1 -1
  429. package/dist/settings/providers.js +1 -1
  430. package/dist/settings/settings-bridge.js +1 -1
  431. package/dist/settings/settings.js +1 -1
  432. package/native/win32-x64/alwith_native_chat.dll +0 -0
  433. package/native/win32-x64/artifact.json +1 -1
  434. package/package.json +3 -3
  435. package/dist/chunk-0kaa9dja.js +0 -2
  436. package/dist/chunk-0myfs71s.js +0 -2
  437. package/dist/chunk-19jwgexv.js +0 -4
  438. package/dist/chunk-1p3ekdt4.js +0 -2
  439. package/dist/chunk-1xgm6fpr.js +0 -2
  440. package/dist/chunk-2016dacx.js +0 -4
  441. package/dist/chunk-2rjg9fs9.js +0 -2
  442. package/dist/chunk-2s0jckfr.js +0 -2
  443. package/dist/chunk-3272z6sv.js +0 -2
  444. package/dist/chunk-38eckxjk.js +0 -2
  445. package/dist/chunk-56jqg70p.js +0 -2
  446. package/dist/chunk-5rzy2287.js +0 -2
  447. package/dist/chunk-6cedp3k2.js +0 -2
  448. package/dist/chunk-6eg26dz5.js +0 -4
  449. package/dist/chunk-7hhc8y2n.js +0 -2
  450. package/dist/chunk-7xsrqwvt.js +0 -2
  451. package/dist/chunk-9s8ht9xe.js +0 -2
  452. package/dist/chunk-b5g055qp.js +0 -2
  453. package/dist/chunk-bqbyjazm.js +0 -2
  454. package/dist/chunk-cmfcnze3.js +0 -4
  455. package/dist/chunk-d4jkh19p.js +0 -2
  456. package/dist/chunk-dn8xcv31.js +0 -2
  457. package/dist/chunk-dwv3z2sk.js +0 -2
  458. package/dist/chunk-e4ws15tg.js +0 -2
  459. package/dist/chunk-e8bazy7m.js +0 -2
  460. package/dist/chunk-eaxevj9t.js +0 -2
  461. package/dist/chunk-f0hb6t2w.js +0 -2
  462. package/dist/chunk-f67e77e6.js +0 -2
  463. package/dist/chunk-fcy6mh2e.js +0 -2
  464. package/dist/chunk-g947bnqx.js +0 -2
  465. package/dist/chunk-gs0b02g2.js +0 -2
  466. package/dist/chunk-hs98zk6m.js +0 -2
  467. package/dist/chunk-jf7em132.js +0 -1
  468. package/dist/chunk-k2xs8svj.js +0 -2
  469. package/dist/chunk-kv3hsfyk.js +0 -2
  470. package/dist/chunk-kyqf7cqh.js +0 -2
  471. package/dist/chunk-m4ds8kjc.js +0 -2
  472. package/dist/chunk-m6yg0dc9.js +0 -2
  473. package/dist/chunk-n88j8hsd.js +0 -2
  474. package/dist/chunk-nvsws1yg.js +0 -2
  475. package/dist/chunk-p02bdewy.js +0 -2
  476. package/dist/chunk-ptdx40ae.js +0 -2
  477. package/dist/chunk-t1qj0vqe.js +0 -2
  478. package/dist/chunk-t2ej667n.js +0 -2
  479. package/dist/chunk-tab23kkx.js +0 -2
  480. package/dist/chunk-w1ga47ww.js +0 -2
  481. package/dist/chunk-w2bgfpdh.js +0 -2
  482. package/dist/chunk-wj9s8331.js +0 -2
  483. package/dist/chunk-wjgrrfq9.js +0 -2
  484. package/dist/chunk-ygaqqwmb.js +0 -2
  485. package/dist/chunk-yvzkb5p5.js +0 -2
  486. package/dist/chunk-z6x70w62.js +0 -2
  487. package/dist/chunk-zea1chz7.js +0 -3
@@ -1 +1 @@
1
- import{E,Ct,wt,kt,V,ba,ae,On,Hn,St,Ca}from"../chunk-g7dxg38a.js";import{it}from"../chunk-ksq9a3pf.js";import"../chunk-bhajnmtf.js";export{St as MODEL_PRESENTATION,E as PROVIDERS,it as customModelEffort,V as gatewayModelId,Ct as isAccountModel,wt as parseCustomModels,Ca as presentModel,Hn as providerApplicationPending,kt as providerGroups,On as providerKeyUrl,ae as providerRegion,ba as resolveSessionModel};
1
+ import{R,_t,It,Pt,V,_a,ce,Vn,$n,Tt,Ia}from"../chunk-0ck2zpaa.js";import{st}from"../chunk-xxwevgqr.js";import"../chunk-4t2a903d.js";export{Tt as MODEL_PRESENTATION,R as PROVIDERS,st as customModelEffort,V as gatewayModelId,_t as isAccountModel,It as parseCustomModels,Ia as presentModel,$n as providerApplicationPending,Pt as providerGroups,Vn as providerKeyUrl,ce as providerRegion,_a as resolveSessionModel};
@@ -1 +1 @@
1
- import{js,Ks,qs}from"../chunk-z6tw9cf9.js";export{js as codexSettingsBridge,qs as createSettingsBridgeClient,Ks as serveSettingsBridge};
1
+ import{Xs,Ys,ea}from"../chunk-bz890a7b.js";export{Xs as codexSettingsBridge,ea as createSettingsBridgeClient,Ys as serveSettingsBridge};
@@ -1 +1 @@
1
- import{js,Ks,qs}from"../chunk-z6tw9cf9.js";import"../chunk-1xgm6fpr.js";import"../chunk-9jth6sk7.js";import"../chunk-mrwawq46.js";import"../chunk-x2wcwpw3.js";import"../chunk-81xwn9e5.js";import"../chunk-5rzy2287.js";import"../chunk-e4ws15tg.js";import"../chunk-kyqf7cqh.js";import"../chunk-k5kzw2px.js";import"../chunk-rkqptd9w.js";import"../chunk-ckbqdg1s.js";import{en}from"../chunk-r8gnmyb1.js";import{Xt,ui,Yt}from"../chunk-qwjz3jsz.js";import{Un,Bn,Gn,Ge,_t,zn,Vn}from"../chunk-bhajnmtf.js";import{it}from"../chunk-ksq9a3pf.js";import{E,Ct,wt,kt,V,ba,ae,On,Hn,St,Ca}from"../chunk-g7dxg38a.js";import"../chunk-g947bnqx.js";import{Mi,Ni,gn,ma,fn,hn}from"../chunk-ygaqqwmb.js";import{ai,Ws,li,ci,di,to}from"../chunk-zyyn9t8n.js";import{mt,tn,nn}from"../chunk-mmrwaa9h.js";import{Zs}from"../chunk-103z8myv.js";export{Yt as CodexAccountCard,ui as CodexAccountSummary,to as CustomProviderEditor,Un as DeepSeekLogo,_t as DoubaoLogo,Bn as GrokLogo,zn as KimiLogo,en as LoginCard,mt as MODEL_ALIASES_KEY,St as MODEL_PRESENTATION,ai as ManagedProviderSection,Ge as MiniMaxLogo,Zs as ModelAliasSettings,E as PROVIDERS,Mi as PROVIDERS_CHANGED,Ni as PROVIDERS_REVOKED,di as ProviderRow,Ws as ProviderSection,li as ProviderTabs,Gn as QwenLogo,ci as TestFeedback,Xt as UsageLimitRow,Vn as ZhipuLogo,fn as applyProvidersWhenIdle,js as codexSettingsBridge,ma as createManagedProvidersPort,gn as createProvidersPort,qs as createSettingsBridgeClient,it as customModelEffort,V as gatewayModelId,Ct as isAccountModel,wt as parseCustomModels,Ca as presentModel,Hn as providerApplicationPending,kt as providerGroups,On as providerKeyUrl,ae as providerRegion,ba as resolveSessionModel,nn as saveModelAlias,Ks as serveSettingsBridge,tn as useModelAliases,hn as useProviders};
1
+ import{Xs,Ys,ea}from"../chunk-bz890a7b.js";import"../chunk-mnktrf2v.js";import"../chunk-fm35s6dq.js";import"../chunk-6m7bnj0g.js";import"../chunk-md3d3pby.js";import"../chunk-h12xxave.js";import"../chunk-hxstf6c4.js";import"../chunk-bb2s9nb6.js";import"../chunk-8e9h60we.js";import"../chunk-nrt1zx5c.js";import"../chunk-rkqptd9w.js";import"../chunk-3q3n1n1m.js";import{an}from"../chunk-dxjwdfra.js";import{rn,vi,sn}from"../chunk-nxfwgbny.js";import{jn,Kn,qn,$e,Mt,Wn,Zn}from"../chunk-4t2a903d.js";import{st}from"../chunk-xxwevgqr.js";import{R,_t,It,Pt,V,_a,ce,Vn,$n,Tt,Ia}from"../chunk-0ck2zpaa.js";import"../chunk-89jwjv3m.js";import{Di,Fi,yn,xa,xn,bn}from"../chunk-nd0d4qr4.js";import{mi,ta,gi,fi,hi,ao}from"../chunk-g2pjvjym.js";import{vt,nn,on}from"../chunk-zpetyx45.js";import{Js}from"../chunk-etnfpzpv.js";export{sn as CodexAccountCard,vi as CodexAccountSummary,ao as CustomProviderEditor,jn as DeepSeekLogo,Mt as DoubaoLogo,Kn as GrokLogo,Wn as KimiLogo,an as LoginCard,vt as MODEL_ALIASES_KEY,Tt as MODEL_PRESENTATION,mi as ManagedProviderSection,$e as MiniMaxLogo,Js as ModelAliasSettings,R as PROVIDERS,Di as PROVIDERS_CHANGED,Fi as PROVIDERS_REVOKED,hi as ProviderRow,ta as ProviderSection,gi as ProviderTabs,qn as QwenLogo,fi as TestFeedback,rn as UsageLimitRow,Zn as ZhipuLogo,xn as applyProvidersWhenIdle,Xs as codexSettingsBridge,xa as createManagedProvidersPort,yn as createProvidersPort,ea as createSettingsBridgeClient,st as customModelEffort,V as gatewayModelId,_t as isAccountModel,It as parseCustomModels,Ia as presentModel,$n as providerApplicationPending,Pt as providerGroups,Vn as providerKeyUrl,ce as providerRegion,_a as resolveSessionModel,on as saveModelAlias,Ys as serveSettingsBridge,nn as useModelAliases,bn as useProviders};
@@ -4,5 +4,5 @@
4
4
  "abi": 1,
5
5
  "target": "x86_64-pc-windows-msvc",
6
6
  "binary": "alwith_native_chat.dll",
7
- "sha256": "597735ec4899c19c6d33b90f1a17d17dd97e0cf247aed289ffbdfaed3db86e9f"
7
+ "sha256": "515b748f182918e03b0c3ee667f1dde76d29ba62b043e20a1277ee15ff35a06a"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.6.34",
3
+ "version": "0.6.36",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -381,7 +381,7 @@
381
381
  ]
382
382
  },
383
383
  "scripts": {
384
- "test": "bun test src",
384
+ "test": "bun test --parallel=1 ./src",
385
385
  "test:rust": "cargo test --manifest-path rust/Cargo.toml",
386
386
  "build": "bun -e \"const fs = require('node:fs'); fs.rmSync('assets', { recursive: true, force: true }); fs.cpSync('rust/assets', 'assets', { recursive: true })\" && bun ../../scripts/build-npm.ts",
387
387
  "prepack": "bun run build && bun test ../../scripts/__tests__/chat-worker-distribution.test.ts && bun ../../scripts/verify-module-package.ts chat"
@@ -407,7 +407,7 @@
407
407
  "@dnd-kit/utilities": "^3.2.2",
408
408
  "@floating-ui/dom": "^1.8.0",
409
409
  "@modelcontextprotocol/server": "^2.4.0",
410
- "@nyssance/codex-acp-v2": "^0.7.82",
410
+ "@nyssance/codex-acp-v2": "^0.7.83",
411
411
  "@nyssance/shadcn": "^4.23.4",
412
412
  "@shadcn/react": "^0.3.1",
413
413
  "@solar-icons/react": "^2.6.0",
@@ -1,2 +0,0 @@
1
- import{g}from"./chunk-f67e77e6.js";import{e}from"./chunk-kyqf7cqh.js";import{p}from"./chunk-g947bnqx.js";import{isTauri as R}from"@tauri-apps/api/core";import{getCurrentWebview as M}from"@tauri-apps/api/webview";import{useEffect as j,useLayoutEffect as k,useRef as q}from"react";import{flushSync as v}from"react-dom";var z=33554432,x=new WeakMap;function U(s){return s.split(/[/\\]/).findLast((m)=>m!=="")??s}var Mn={sourcePath:(s)=>x.get(s),uniqueFiles(s,m){let u=new Set(m.map((d)=>d.sourcePath));return s.filter((d)=>{let h=x.get(d);if(h===void 0)return!0;if(u.has(h))return!1;return u.add(h),!0})}};function Nn({sessionId:s,imagesOnly:m=!1,picker:u,enabled:d,onMention:h,onBusyChange:C}){let D=g(),{host:T}=e(),o=q({sessionId:s,attachments:D,enabled:d,onMention:h,onBusyChange:C,host:T,imagesOnly:m});return k(()=>{o.current={sessionId:s,attachments:D,enabled:d,onMention:h,onBusyChange:C,host:T,imagesOnly:m}}),j(()=>{if(!R())return;let l=!1,W,S=Promise.resolve(),b=0,y=()=>!l&&o.current.sessionId===s&&o.current.enabled,w=(r)=>{let{host:i}=o.current;if(i.reportError)i.reportError(r);else console.error(r)},E=()=>w(Error(o.current.host.t("composer.dropUnavailable")));o.current.onBusyChange(!1);let F=(r)=>{b++,v(()=>o.current.onBusyChange(!0)),S=S.then(async()=>{try{let i=new Set(o.current.attachments.files.map((t)=>t.sourcePath));for(let t of new Set(await r())){let a=typeof t==="string"?t:t.name;if(!y())return;try{if(typeof t!=="string"&&t.type.startsWith("image/")){v(()=>o.current.attachments.add([t]));continue}if(typeof t!=="string"&&t.size>z)throw Error("Pasted file exceeds the 32 MiB limit");let f=typeof t==="string"?t:await p.writePastedFile({name:t.name,data:[...new Uint8Array(await t.arrayBuffer())]});if(!y())return;let c=await p.readDroppedFile({path:f});if(!y())return;if(c.image===null){if(o.current.imagesOnly)throw Error(o.current.host.t("composer.unsupportedAttachmentTitle"));v(()=>o.current.onMention(c.path))}else if(!i.has(c.path)){let A=Uint8Array.from(atob(c.image.data),(P)=>P.charCodeAt(0)),n=new File([A],c.name,{type:c.image.mimeType});x.set(n,c.path),i.add(c.path),v(()=>o.current.attachments.add([n]))}}catch(f){if(!l)w(Object.assign(Error(o.current.host.t("composer.dropFailed",{name:U(a)})),{description:f instanceof Error?f.message:String(f)}))}}}finally{if(b--,!l)v(()=>o.current.onBusyChange(b>0))}}).catch((i)=>{if(!l)w(i)})},B=(r)=>{if(!y()){E();return}if(o.current.imagesOnly&&r.some((i)=>!i.type.startsWith("image/"))){w(Error(o.current.host.t("composer.unsupportedAttachmentTitle")));return}F(()=>Promise.resolve(r))};if(u)u.current=B;let O=M().onDragDropEvent((r)=>{if(l||r.payload.type!=="drop")return;let{paths:i,position:t}=r.payload,a=document.elementFromPoint(t.x/window.devicePixelRatio,t.y/window.devicePixelRatio);if(!a?.closest("[data-chat-drop-zone]")||a.closest('[role="dialog"]'))return;if(!y()){E();return}F(()=>Promise.resolve(i))}),L=(r)=>{let i=r.target;if(!(i instanceof Element)||!i.matches("[data-chat-input]"))return;if(!i.closest("[data-chat-drop-zone]")||i.closest('[role="dialog"]'))return;let t=r.clipboardData;if(!t)return;let a=[...t.files??[]],f=[...t.items??[]];if(!(t.types.includes("Files")&&!a.length&&!f.some((n)=>n.type.startsWith("image/")))&&!a.some((n)=>!n.type.startsWith("image/"))&&!f.some((n)=>n.kind==="file"&&!n.type.startsWith("image/"))&&!["text/uri-list","x-special/gnome-copied-files"].some((n)=>t.types.includes(n)&&/^file:\/\//m.test(t.getData(n))))return;if(r.preventDefault(),r.stopPropagation(),!y()){E();return}let A=p.clipboardFilePaths().then((n)=>({value:n}),(n)=>({error:n}));F(async()=>{let n=await A;if("error"in n)throw n.error;let P=n.value;if(P.length)return P;if(a.length)return a;throw Error("The clipboard contains no readable local files")})};return document.addEventListener("paste",L,!0),O.then((r)=>{if(l)r();else W=r}).catch((r)=>{if(!l)w(r)}),()=>{if(l=!0,u?.current===B)u.current=null;document.removeEventListener("paste",L,!0),W?.()}},[s,u]),null}
2
- export{Mn,Nn};
@@ -1,2 +0,0 @@
1
- import{n}from"./chunk-e4ws15tg.js";import{$n,e,b}from"./chunk-kyqf7cqh.js";import{Fe}from"./chunk-cmfcnze3.js";import{mn}from"./chunk-mt01qph9.js";import{dn}from"./chunk-as2j0yp0.js";import{un,pn}from"./chunk-rt9dn0b3.js";import{cn}from"./chunk-p216frcj.js";import{LockIcon as k,UnplugIcon as O}from"lucide-react";import{useMemo as S,useRef as M}from"react";import{Alert as x,AlertDescription as C,AlertTitle as N}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as P,EmptyDescription as z,EmptyHeader as B,EmptyTitle as I}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as o,jsxs as r}from"react/jsx-runtime";function ra({host:t,client:c,...s}){let m=S(()=>t.openDiff?t:{...t,openDiff:un},[t]);return r($n,{host:m,client:c,children:[o(L,{...s}),!t.openDiff&&o(pn,{})]})}function L({session:t,header:c,overlay:s,timeline:m,composer:w,readOnlyActions:D,recovery:g,welcome:E,children:R,rootRef:l,search:T=!0}){let{host:d,client:A}=e(),p=M(null),H=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:i}=d,f=n((a)=>a.connection==="ready"),v=n((a)=>a.historyPages[t.id]?.error),y=()=>b(d,A.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return r("div",{"data-chat-drop-zone":!0,ref:H,className:"flex h-full min-h-0 flex-col",children:[c,r("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[T&&!u&&o(dn,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(x,{children:[o(O,{}),o(N,{children:i("conversation.stopped")}),o(C,{children:o(h,{size:"sm",variant:"outline",onClick:y,children:i("conversation.reconnect")})})]})}),u?E??o(P,{className:"flex-1",children:r(B,{children:[o(I,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(z,{children:i("conversation.welcomeDescription")})]})}):o(mn,{session:t,timeline:m}),o(cn,{sessionId:t.id}),g??(t.readOnly?o("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:r(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[r("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o(k,{"aria-hidden":"true",className:"size-4 shrink-0"}),r("div",{className:"min-w-0 space-y-1",children:[o(N,{children:i("conversation.readOnlyTitle")}),o(C,{children:i("conversation.readOnlyDescription")}),v&&o("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(h,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),D]})]})}):w??o(Fe,{session:t}))]}),R]})}
2
- export{ra};
@@ -1,4 +0,0 @@
1
- import{Jn}from"./chunk-72xm1tz1.js";import{xe}from"./chunk-erdrx47j.js";import{rs}from"./chunk-8gas4q2s.js";import{C,zt}from"./chunk-wjgrrfq9.js";import{t}from"./chunk-e4ws15tg.js";import{bs,Cs}from"./chunk-masqfje4.js";import{L}from"./chunk-38eckxjk.js";import{ye}from"./chunk-q78ng7mn.js";import{isEmbeddedResource as g,isImage as x,isResourceLink as R,isText as h}from"@nyssance/codex-acp-v2/client";import{memo as v}from"react";import{jsx as i,jsxs as y}from"react/jsx-runtime";var is=v(function({item:n,messageTime:f,skillNames:u=[]}){let p=t(),r=Cs(n._meta),m=r?r.map((e)=>e.question===void 0?e.text:`${e.question}
2
- ${e.text}`).join(`
3
- `):ye(n),l=n.content.filter(x),d=new Set(zt(m).map((e)=>e.id)),o=new Map,a=n.content.filter((e)=>{if(R(e)){let s=C(e.uri);if(s!==null){if(!d.has(s))o.set(s,{id:s,name:e.title??e.name});return!1}return!0}return g(e)}),c=r??n.content.filter(h).map((e)=>{let s=bs(e._meta);return s?{question:s.question,text:s.answer}:{text:e.text}});if(m.length===0&&l.length===0&&a.length===0&&o.size===0)return null;return y("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":n.id,children:[a.length>0&&i("div",{className:"codex-user-mentions",children:a.map((e,s)=>i(L,{block:e},`${n.id}:${s}`))}),i(Jn,{value:{names:u,icon:p.skillIcon},children:i(rs,{host:p,message:n,text:m,textParts:c.some((e)=>("question"in e))?c:void 0,applicationReferences:o.size>0?i("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:[...o.values()].map((e)=>i(xe,{app:e},e.id))}):void 0,images:l,mentions:[],messageTime:f})})]})});
4
- export{is};
@@ -1,2 +0,0 @@
1
- import{te}from"./chunk-j4ejwthn.js";import{x}from"./chunk-2rjg9fs9.js";import{w}from"./chunk-e4ws15tg.js";import{wn}from"./chunk-f0hb6t2w.js";import{Fe}from"./chunk-cmfcnze3.js";import{gn}from"./chunk-ygaqqwmb.js";import{He}from"./chunk-dwv3z2sk.js";import{An}from"./chunk-b6sb3akb.js";import{ze}from"./chunk-vab1ysnz.js";import{Mn,Nn}from"./chunk-0kaa9dja.js";import{useMemo as C,useRef as g}from"react";import{jsx as i,jsxs as m,Fragment as v}from"react/jsx-runtime";var d;function y(){return d??=gn(),d}function h({imagesOnly:r,picker:n}){let e=wn();return i(Nn,{imagesOnly:r,picker:n,sessionId:e.session.id,enabled:e.inputReady&&!e.sending&&!e.shellMode,onMention:e.addMention,onBusyChange:e.setAdding})}function pa({client:r,providers:n,catalog:e,shellCommands:a=!0,imagesOnly:s=!1,modelMenu:c,children:f,...p}){let l=g(null),u=C(()=>({...Mn,accept:s?"image/png,image/jpeg,image/webp,image/gif":void 0,onSelectFiles(o){if(!l.current)throw Error("The file picker is not ready");l.current(o)}}),[s]),{session:t}=p,P=w(r.store,(o)=>o.modelRecovery[t.id]??!1);return m(v,{children:[P&&!te(t.error?.error)&&i(An,{client:r,session:t,providers:n??y(),catalog:e},t.id),m(Fe,{modelMenu:c??{defaultGroup:x,catalog:(o)=>He(o,e),headerAction:i(ze,{})},...p,attachmentPolicy:u,onShellCommand:a?(o)=>r.executeShell(t.id,o):void 0,children:[i(h,{imagesOnly:s,picker:l}),f]})]})}
2
- export{pa};
@@ -1,2 +0,0 @@
1
- var aa={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function _i(e){return[...e].toSorted((o,n)=>(aa[o.kind]??99)-(aa[n.kind]??99))}function ja(e){return e==="allow_once"||e==="allow_always"}function Ka(e){return e==="allow_always"||e==="reject_always"}
2
- export{aa,_i,ja,Ka};
@@ -1,4 +0,0 @@
1
- var r=new Map,p=new Map,c=new Map;function Di(e,t){if(p.has(e))throw Error("An attachment writer is already registered for this session");return p.set(e,t),()=>{if(p.get(e)===t)p.delete(e)}}function X(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),p.get(e)?.(n)}function bn(e,t){c.set(e,t),t.finally(()=>{if(c.get(e)===t)c.delete(e)})}async function ga(e){for(;;){let n=r.get(e)?.attachments.flatMap((i)=>{let m=c.get(i.id);return m?[m]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let i=await fetch(n.url);if(!i.ok)throw Error("Cannot read draft image");let m=await i.blob(),f=await new Promise((l,g)=>{let s=new FileReader;s.onload=()=>l(s.result),s.onerror=()=>g(s.error),s.readAsDataURL(m)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function fa(e,t){if(t===null)r.delete(e);else r.set(e,t)}var a=new Map;function Cn(e,t){if(a.has(e))throw Error("A composer is already registered for this session");return a.set(e,t),()=>{if(a.get(e)===t)a.delete(e)}}function ha(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=a.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}function va(e,t){if(typeof t!=="string"||!t.trim())throw Error("The context is empty");let o=a.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e),i=n?.text?`${n.text}
2
-
3
- ${t}`:t;o(i,"append"),r.set(e,n?{...n,text:i}:{text:i,attachments:[],mentions:[],modelId:null})}
4
- export{r,Di,X,bn,ga,fa,Cn,ha,va};
@@ -1,2 +0,0 @@
1
- import{mo}from"./chunk-n8fe2njr.js";import{Ki,ne}from"./chunk-t2ej667n.js";import{Bi}from"./chunk-ad53zbdb.js";import{it}from"./chunk-ksq9a3pf.js";import{Dn}from"./chunk-y0rnvmrw.js";import{zi,co}from"./chunk-2dnzdsrv.js";import{Gi}from"./chunk-w2bgfpdh.js";import{Rn}from"./chunk-ske5z0gp.js";import{fe}from"./chunk-56jqg70p.js";import{ot,Ue}from"./chunk-nvsws1yg.js";import{uo}from"./chunk-gfkx1z04.js";import{te,Ln}from"./chunk-j4ejwthn.js";import{CodexClient as M,configRevisionOf as O,isBooleanOption as S,isGroupedSelect as v,isImage as R,isSelectOption as f,mergeMeta as g,runStateSource as C}from"@nyssance/codex-acp-v2/client";var x={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function d(e){let s=e.find((t)=>t.category==="model"&&t.type==="select");return s?.type==="select"&&typeof s.currentValue==="string"?s.currentValue:null}function I(e){let s=e["x-codex-turn-metadata"];if(typeof e.callId!=="string"||typeof s?.turn_id!=="string")throw Error("Codex tool call metadata is missing callId or turn_id");return{toolCallId:e.callId,turnId:s.turn_id}}class Ui extends M{applicationRegistry=new mo((e)=>this.holds(e)?this.session(e):void 0,I);toolSelection;async executeShell(e,s){let t=this.session(e);if(!t.attached||t.restoring||t.readOnly||t.state!=="idle")throw Error("The session is not ready for a shell command");await this.codexCapabilities.executeShell(e,s),this.materializeDraft(e)}modelListeners=new Set;confirmedModelListeners=new Set;savedModels={main:null,chat:null};slotModels={main:null,chat:null};slotTargets={main:null,chat:null};slotVersions={main:0,chat:0};draftDirectoryIntents=new Map;draftOperations=new Map;gatewayModels=new Map;configOwners=new Map;openingOwners=new Map;schedulingConfig=new Set;replayRepairs=new Map;accountRevocations=new Map;accountRecoveries=new Map;resolveModelOption;constructor(e,s){let{applicationTools:t=[],resolveModel:i,imageService:n,...o}=s;super(e,o,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.toolSelection=t,this.resolveModelOption=i,this.imageService=n,this.imageTool=n?Gi(n,(a)=>this.imageRequests.get(a)):void 0}imageTool;imageService;inputModes=new Map;inputSelections=new Map;async readInputConfig(e){let s=this.live(),t=await s.request("_codex/session_input_config_get",{sessionId:e});if(s!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,t)}async writeInputConfig(e,s){let t=this.live(),i=await t.request("_codex/session_input_config_set",{sessionId:e,inputConfig:s});if(t!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,i)}acceptInputConfig(e,s){let t=Rn(s,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=t.inputConfig;if(i&&ot(i.mode)){if(Ue(i.mode).parseConfig(i.config),this.inputModes.set(e,i.mode),i.mode==="image")this.inputSelections.set(e,fe.parseConfig(i.config))}return t}imageRequests=new Map;prompt(e,s,t={}){if(!this.imageService)return super.prompt(e,s,t);if(!this.inputModes.has(e))return this.imageService.inputMode(e).then((i)=>(this.inputModes.set(e,i),this.prompt(e,s,t)));return Ue(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,s,{...t,meta:g(t.meta,{alwith:{imageIntent:null,applicationContext:Ue("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,s,t)})}promptImage(e,s,t){if(!this.imageService)throw Error("Image service is not connected");co(t.meta?.alwith?.imageAspectRatio);let i=t.meta?.alwith?.imageSelection;if(i!==void 0)ne(i);let n=i??this.inputSelections.get(e)??this.imageService.selection(),o={...this.session(e).state!=="idle"?this.imageRequests.get(e)?.selection??n:n};ne(o);let a=crypto.randomUUID();return this.promptImages.set(a,new Map(s.flatMap((r,l)=>R(r)?[[`attachment:${l}`,`data:${r.mimeType};base64,${r.data}`]]:[]))),super.prompt(e,s,{...t,meta:g(t.meta,{alwith:{imageSelection:o,imageRequestId:a,applicationContext:fe.applicationContext(t.meta?.alwith?.imageIntent??"generate",zi),imageIntent:t.meta?.alwith?.imageIntent??"generate"}})}).finally(()=>this.promptImages.delete(a))}promptMeta(e,s){let t=s.meta?.alwith?.imageSelection;if(this.inputModes.get(e)==="image"&&t&&this.imageService&&(this.session(e).state==="idle"||!this.imageRequests.has(e))){let i=new Map(Ki(this.session(e)).map((o)=>[o.id,o.src]));for(let[o,a]of this.promptImages.get((s.meta?.alwith).imageRequestId)??[])i.set(o,a);let n=co((s.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:t,references:i,...n?{aspect:n}:{}})}return uo(super.promptMeta(e,s))}promptImages=new Map;promptWithImages(e,s,t={}){return this.prompt(e,s,{...t,meta:g({alwith:{imageIntent:"generate"}},t.meta)})}async applicationToolsFor(e){let s=typeof this.toolSelection==="function"?await this.toolSelection(e):this.toolSelection,t=e.options.meta?.alwith;return[...s,...e.options.applicationTools??[],...t?.nativeTools?.imageGeneration===!1&&this.imageTool?[this.imageTool]:[]]}releaseImages(e){this.imageRequests.delete(e)}onDisconnected(){for(let e of this.imageRequests.keys())this.releaseImages(e);this.promptImages.clear(),this.applicationRegistry.clear(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),await super.cancel(e)}async close(e){this.releaseImages(e),this.applicationRegistry.drop(e),await super.close(e)}async stopSession(e){this.releaseImages(e),this.applicationRegistry.drop(e);let s=this.state.draftSessions[e];if(s===void 0)return super.stopSession(e);await this.changeDraft([s],()=>this.state.draftSessions[e]?super.close(e):super.stopSession(e))}setApp(e){this.store.setState(e)}applyRunStates(e,s="event"){let t=this.state.runStates,i=e.map((n)=>{let o=t[n.sessionId];return o&&JSON.stringify(o)===JSON.stringify(n)?o:n});if(C(t)===s&&i.length===Object.keys(t).length&&i.every((n)=>n===t[n.sessionId]))return;super.applyRunStates(i,s)}enqueueSession(e,s,t=!0){let i=!t&&!this.schedulingConfig.has(e);return super.enqueueSession(e,()=>{let n=()=>{let r=this.holds(e)?d(this.session(e).configOptions):null;return s().then(async(l)=>{if(this.holds(e)&&d(this.session(e).configOptions)!==r)await this.normalizeCustomEffort(e,!0);return l})},o=()=>{let r=i?this.normalizeCustomEffort(e,!1):void 0;return r?r.then(n):n()},a=t?void 0:this.replayRepairs.get(e)?.promise;return a?a.then(o):o()},t)}customEffortChange(e,s,t=!1,i){if(!this.holds(e))return;let n=this.session(e);if(!n.attached||n.readOnly)return;let o=d(n.configOptions),a=it(o);if(!a)return;let r=n.configOptions.find((p)=>p.category==="thought_level"&&f(p)),l,h;if(r&&f(r)){let p=v(r.options)?r.options.flatMap((c)=>c.options):r.options;if(r.currentValue===a.value||!s&&p.some((c)=>c.value===r.currentValue))return;if(!p.some((c)=>c.value===a.value))throw Error(`The model does not advertise its default effort: ${o}`);l=r.configId,h=!s&&i!==void 0&&p.some((c)=>c.value===i)?i:a.value}else{if(!a.hidden||!t||o===null)return;let p=n.configOptions.find((c)=>c.category==="model");if(!p)throw Error("The custom model has no model option");l=p.configId,h=o}return{configId:l,value:h}}normalizeCustomEffort(e,s,t=!1,i){let n=this.customEffortChange(e,s,t,i);return n?this.writeCustomEffort(e,n.configId,n.value):void 0}async writeCustomEffort(e,s,t){let i=this.live(),n=this.lifecycle.capture(e),o=await i.request("session/set_config_option",{sessionId:e,configId:s,type:"id",value:t});if(i!==this.agent||!this.lifecycle.isCurrent(n))throw Error("Effort configuration belongs to a retired session");this.publishSession({...this.session(e),configOptions:o.configOptions,configRevision:O(o)??this.session(e).configRevision})}async afterSessionCreated(e){await super.afterSessionCreated(e);try{await super.enqueueSession(e,async()=>this.normalizeCustomEffort(e,!0,!0),!1)}catch(s){try{await this.delete(e)}catch(t){throw AggregateError([s,t],"Failed to initialize and clean up the custom model session",{cause:t})}throw s}}replay(e,s,t){let i=this.replayRepairs.get(e);if(i?.cwd===s)return i.promise;let n=this.replayWithEffort(e,s,t);this.replayRepairs.set(e,{cwd:s,promise:n});let o=()=>{if(this.replayRepairs.get(e)?.promise===n)this.replayRepairs.delete(e)};return n.then(o,o),n}async replayWithEffort(e,s,t){let i=this.holds(e)?this.session(e).configOptions:[],n=i.find((r)=>r.category==="thought_level")?.currentValue,o=this.state.modelRecovery[e]??!1;try{if(await super.replay(e,s,t),!o&&this.state.modelRecovery[e]&&!this.session(e).readOnly&&!te(this.session(e).error?.error))await super.replay(e,s,t)}finally{this.accountRecoveries.delete(e)}if(this.state.modelRecovery[e]&&!this.session(e).readOnly&&!te(this.session(e).error?.error))throw Error(this.session(e).error?.error?.message??"The selected model connection is unavailable");let a=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,d(i)===d(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(r){if(this.holds(e)&&this.lifecycle.isCurrent(a))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw r}}async connect(){if(await super.connect(),this.state.projectContext===null)await this.refreshProjectContext()}async listProjectSessions(e){await this.listSessions();let s=this.projectPath(e),t=this.sessionGroup({cwd:s}).id;return this.state.sessionList.filter((i)=>this.sessionGroup(i).id===t)}async newSession(e,s=null,t="main"){if(s!==null&&typeof s==="object")return super.newSession(e,s);let i=++this.slotVersions[t],n=await this.createNativeSession(e,await this.resolveModel(s),null);return this.activateSlot(t,n,i),n}async createNativeSession(e,s,t,i="chat"){let n=await super.newSession(e,{draft:t!==null,meta:g(y(s),this.imageService||t!==null?{alwith:{...this.imageService?{inputMode:i}:{},...t===null?{}:{draft:!0}}}:void 0)});if(t!==null)this.draftDirectoryIntents.set(n,e),this.setApp((o)=>({draftSessions:{...o.draftSessions,[n]:t}}));return this.noteModel(this.session(n)),n}async open(e,s,t="main"){if(typeof t!=="string")return super.open(e,s,t);if(t==="chat"&&this.imageService&&(this.inputModes.get(e)??await this.imageService.inputMode(e))==="image")throw Error("Image conversations must be opened in the main window");this.bindSlot(t,e),++this.slotVersions[t];let i=this.holds(e)?this.session(e):void 0;if(i?.attached&&(!this.imageService||this.inputModes.has(e))&&!i.restoring&&!i.readOnly&&!this.lifecycle.operations.busy(e)&&!this.replayRepairs.has(e)){this.followModel(t,i);return}await this.replayForOwner(e,s,t)}async replayForOwner(e,s,t){this.openingOwners.set(e,t);try{await this.replay(e,s)}finally{if(this.openingOwners.get(e)===t)this.openingOwners.delete(e)}}async requestContext(e,s,t){if(this.imageService){let i=s.kind==="resume"?s.sessionId:s.kind==="fork"?s.sourceSessionId:null,n=i===null?t.meta?.alwith?.inputMode??"chat":await this.imageService.inputMode(i),o=Ue(n),a=uo(t.meta),r={...a?.alwith,nativeTools:o.nativeTools},l=await this.requestModelContext(e,s,{...t,meta:{...a,alwith:r}});return{...l,bind:async(h)=>{await l.bind?.(h),this.inputModes.set(h,n)}}}return this.requestModelContext(e,s,t)}async requestModelContext(e,s,t){if(s.kind==="resume"&&this.state.modelRecovery[s.sessionId]&&t.meta?.alwith?.model===void 0){let l=s.sessionId,h=this.accountRevocations.get(l)??0,p=await this.firstAvailableModel();if((this.accountRevocations.get(l)??0)!==h)throw Error("ALwith account changed during model selection");return this.accountRecoveries.set(l,h),this.requestToolContext(e,s,{...t,meta:g(t.meta,{alwith:{model:p,accountModelSelection:!0}})})}if(s.kind!=="resume"||t.meta?.alwith?.model!==void 0)return this.requestToolContext(e,s,t);let i=s.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?d(n.configOptions):null)??this.gatewayModels.get(i)??null,a=await this.resolveModel(o),r=o===null?null:a;return this.requestToolContext(e,s,{...t,meta:g(y(r),t.meta)})}async requestToolContext(e,s,t){let i=await this.applicationToolsFor({cwd:e,operation:s,options:t}),n=await super.requestContext(e,s,t);if(!i.length)return n;if(!this.state.agent?.capabilities?.session?.mcp?.acp)throw Error("The agent does not advertise capabilities.session.mcp.acp");let o=this.applicationRegistry.declare(this.live(),i);return{...n,mcpServers:[...n.mcpServers??[],o],bind:async(a)=>{await n.bind?.(a),this.applicationRegistry.bind(o.serverId,a)}}}async installedApps(e){let s=this.live(),t=await super.installedApps(e),i=await Bi((n,o)=>s.request(n,o),t.apps.map((n)=>n.id),e?.threadId);if(s!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:t.apps.map((n)=>({...n,...i.get(n.id)}))}}async firstAvailableModel(){let e=await this.resolveModel(null);if(e===null)throw Error("No available models. Configure a model connection and try again.");return e}async recoverReplay(e,s,t,i){let n=te(t);if(!n&&!Ln(t))return super.recoverReplay(e,s,t,i);try{await super.afterResume(e,s,i)}catch(o){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;this.setApp((a)=>({historyPages:{...a.historyPages,[e]:{cursor:null,loading:!1,error:o instanceof Error?o.message:String(o)}}}))}if(n){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:t.reason??t.message,data:t.data},meta:null}}),!0}if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.accountRevocations.set(e,(this.accountRevocations.get(e)??0)+1),this.setApp((o)=>({modelRecovery:{...o.modelRecovery,[e]:!0}})),this.publishSession({...this.session(e),cwd:s,attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:t.reason??t.message,data:t.data},meta:null}}),!0}markAccountModelsUnavailable(e){this.setApp((s)=>({modelRecovery:{...s.modelRecovery,...Object.fromEntries(e.map((t)=>[t,!0]))}}));for(let s of e){if(this.accountRevocations.set(s,(this.accountRevocations.get(s)??0)+1),!this.holds(s))continue;this.publishSession({...this.session(s),attached:!1,readOnly:this.session(s).readOnly})}}async resumeModel(e,s){let t=this.session(e);if(!this.state.modelRecovery[e]&&(t.attached||!te(t.error?.error)))throw Error("Model recovery is not required");if(!s)throw Error("Select a model before continuing");let i=this.accountRevocations.get(e)??0,n=await this.resolveModel(s);if(!n)throw Error("The selected provider connection or model is unavailable");if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");this.accountRecoveries.set(e,i);try{await this.replay(e,t.cwd,{meta:{alwith:{model:n,accountModelSelection:!0}}})}catch(a){if(this.holds(e)&&this.state.modelRecovery[e])this.publishSession({...this.session(e),attached:!1,restoring:!1});throw a}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i&&this.state.modelRecovery[e])throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((a)=>{let{[e]:r,...l}=a.modelRecovery;return{modelRecovery:l}}),this.confirmModel(this.state.sessionWindows[e]??"main",o)}setConfig(e,s,t,i="main"){this.configOwners.set(`${e}:${s}`,i),this.schedulingConfig.add(e);try{return super.setConfig(e,s,t)}finally{this.schedulingConfig.delete(e)}}onConfigChanged(e,s,t){super.onConfigChanged(e,s,t),this.noteModel(this.session(e));let i=this.configOwners.get(`${e}:${s}`)??"main";if(this.configOwners.delete(`${e}:${s}`),t.configOptions.some((n)=>n.configId===s&&n.category==="model"))this.confirmModel(i,this.session(e))}changeDraft(e,s){let t=Promise.allSettled(e.map((i)=>this.draftOperations.get(i)).filter((i)=>i!==void 0)).then(s);for(let i of e)this.draftOperations.set(i,t);return t}prepareDraft(e,s,t=null,i=!1,n="chat"){if(e==="chat"&&n!=="chat")throw Error("The floating chat only supports chat input");let o=++this.slotVersions[e];return this.changeDraft([e],async()=>{let a=s??(await this.refreshProjectContext(!0)).chatDirectory,r=Object.keys(this.state.draftSessions).find((c)=>this.state.draftSessions[c]===e);if(r)await this.lifecycle.admission.pending(r);let l=t??(r?d(this.session(r).configOptions):this.savedModels[e]??this.slotModels[e]),h=i?null:await this.resolveModel(l,t===null?"draft":"session");if(r&&(this.inputModes.get(r)??"chat")===n&&this.session(r).cwd===a&&(!this.draftDirectoryIntents.has(r)||this.draftDirectoryIntents.get(r)===s)&&!i&&!this.state.modelRecovery[r]&&(h===null?!d(this.session(r).configOptions)?.startsWith("gateway:"):d(this.session(r).configOptions)===h)){if(this.activateSlot(e,r,o),!this.session(r).attached)await this.replayForOwner(r,a,e);if(t!==null)this.confirmModel(e,this.session(r));return r}let p=await this.createNativeSession(s,h,e,n);try{if(r&&this.session(r).cwd===a)for(let c of this.session(r).configOptions){if(c.category==="model")continue;if(c.category==="thought_level"&&d(this.session(r).configOptions)!==d(this.session(p).configOptions)&&it(d(this.session(p).configOptions))!==null)continue;let u=this.session(p).configOptions.find((w)=>w.configId===c.configId);if(!u||u.currentValue===c.currentValue)continue;if(S(c)&&S(u))await this.setConfig(p,c.configId,c.currentValue);else if(f(c)&&f(u)){if((v(u.options)?u.options.flatMap((m)=>m.options):u.options).some((m)=>m.value===c.currentValue))await this.setConfig(p,c.configId,c.currentValue)}}if(r)await this.deleteEmptyDraft(r)}catch(c){throw await this.deleteEmptyDraft(p),c}if(this.activateSlot(e,p,o),t!==null||i||l!==null&&l!==h)this.confirmModel(e,this.session(p));return p})}discardDraft(e){if(e!=="main"&&e!=="chat")return super.discardDraft(e);return this.changeDraft([e],async()=>{for(let[s,t]of Object.entries(this.state.draftSessions))if(t===e)await this.deleteEmptyDraft(s)})}transferDraft(e,s){return this.changeDraft(["main","chat"],async()=>{if(s==="chat"&&this.inputModes.get(e)==="image")throw Error("Image conversations must remain in the main window");if(!this.state.draftSessions[e]||this.state.draftSessions[e]===s)return;for(let[t,i]of Object.entries(this.state.draftSessions))if(i===s)await this.deleteEmptyDraft(t);this.setApp((t)=>t.draftSessions[e]?{draftSessions:{...t.draftSessions,[e]:s}}:{})})}deleteEmptyDraft(e){return this.enqueueSession(e,async()=>{if(!this.state.draftSessions[e])return;await this.delete(e),this.gatewayModels.delete(e)})}onDraftMaterialized(e){super.onDraftMaterialized(e),this.draftDirectoryIntents.delete(e),this.setApp((s)=>{let{[e]:t,...i}=s.draftSessions;return{draftSessions:i}}),this.noteModel(this.session(e))}onSessionDropped(e){this.applicationRegistry.drop(e),super.onSessionDropped(e),this.inputModes.delete(e),this.inputSelections.delete(e),this.draftDirectoryIntents.delete(e),this.gatewayModels.delete(e),this.accountRevocations.delete(e),this.accountRecoveries.delete(e),this.setApp((s)=>{let{[e]:t,...i}=s.draftSessions,{[e]:n,...o}=s.sessionWindows,{[e]:a,...r}=s.modelRecovery;return{draftSessions:i,sessionWindows:o,modelRecovery:r}})}fork(e,s,t){let i=typeof t==="object"?t:t===void 0?{}:{lastTurnId:t};return super.fork(e,s,i)}async forkInternal(e,s,t){let n=[...(await Promise.all([this.indexSessions(),this.indexSessions(void 0,!0)])).flat(),...this.state.sessionList,...this.state.archivedSessions],o=(this.holds(e)?this.session(e).title:null)??n.find((l)=>l.sessionId===e)?.title,a=await super.forkInternal(e,s,{...t,meta:g(y(this.gatewayModels.get(e)??null),t.meta)});await super.enqueueSession(a,async()=>this.normalizeCustomEffort(a,!1,!0),!1);let r=o??this.session(a).title;if(r)await this.renameSession(a,Dn(r,n.flatMap((l)=>l.title?[l.title]:[])));return a}onForked(e,s){super.onForked(e,s),this.noteModel(this.session(e))}onReplayed(e,s){super.onReplayed(e,s);let t=this.accountRevocations.get(e);if(t!==void 0&&this.accountRecoveries.get(e)!==t)this.markAccountModelsUnavailable([e]);if(this.state.modelRecovery[e]&&this.accountRecoveries.get(e)===(this.accountRevocations.get(e)??0)&&this.session(e).attached&&!this.session(e).readOnly)this.accountRevocations.delete(e),this.setApp((i)=>{let{[e]:n,...o}=i.modelRecovery;return{modelRecovery:o}});this.noteModel(this.session(e))}setModelSelections(e){this.savedModels={...e},this.slotModels={...e}}onConfirmedModel(e){return this.confirmedModelListeners.add(e),()=>this.confirmedModelListeners.delete(e)}onSessionChanged(e){super.onSessionChanged(e);let s=this.accountRevocations.get(e.id);if(s!==void 0&&this.accountRecoveries.get(e.id)!==s&&e.attached){this.publishSession({...e,attached:!1});return}this.followModel("main",e),this.followModel("chat",e)}followModel(e,s){if(this.slotTargets[e]!==s.id||!s.attached||s.restoring)return;let t=d(s.configOptions);if(t!==null)this.slotModels[e]=t}activateSlot(e,s,t){if(this.slotVersions[e]!==t)return;this.bindSlot(e,s),this.followModel(e,this.session(s))}bindSlot(e,s){let t=e==="main"?"chat":"main";if(this.slotTargets[t]===s)this.slotTargets[t]=null,++this.slotVersions[t];this.slotTargets[e]=s,this.setApp((i)=>({sessionWindows:{...i.sessionWindows,[s]:e}}))}confirmModel(e,s){let t=d(s.configOptions);if(t===null)throw Error("Model selection did not return the current model");this.followModel(e,s),this.savedModels[e]=t;for(let i of this.confirmedModelListeners)i(e,t)}resolveModel(e,s="session"){return this.resolveModelOption?this.resolveModelOption(e,s):Promise.resolve(e)}onSessionModel(e){return this.modelListeners.add(e),()=>this.modelListeners.delete(e)}noteModel(e){let s=d(e.configOptions);if(s===null)return;let t=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(t&&f(t)){let o=(v(t.options)?t.options.find((a)=>a.groupId===x.id)?.options??[]:t.options.filter((a)=>!a.value.startsWith("gateway:"))).map((a)=>({id:a.value,label:a.name}));if(JSON.stringify(o)!==JSON.stringify(this.state.nativeModels))this.setApp({nativeModels:o})}let i=t!==void 0&&f(t)&&t.options.some((n)=>("groupId"in n)&&n.groupId!==x.id&&n.options.some((o)=>o.value===s));if(i)this.gatewayModels.set(e.id,s);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,s,i)}}
2
- export{x,Ui};
@@ -1,2 +0,0 @@
1
- import{x}from"./chunk-2rjg9fs9.js";import{Pt}from"./chunk-7m8hw6gh.js";import{e}from"./chunk-kyqf7cqh.js";import{kt,V}from"./chunk-g7dxg38a.js";import{En,He}from"./chunk-dwv3z2sk.js";import{ze}from"./chunk-vab1ysnz.js";import{Zap as g}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function da({snapshot:s,model:l,onChange:r,nativeModels:t,catalog:c}){let{host:u}=e(),{t:a}=u,f=[{id:x.id,name:x.name,models:t===void 0?[{api_id:"",label:x.name}]:t.map((o)=>({api_id:o.id,label:o.label??o.id}))},...(s===null?[]:kt(s)).map((o)=>({id:o.id,name:o.name,models:o.models.map((i)=>({api_id:V(o.id,i.id),label:i.label??i.id}))}))],p=He(f,c),d=p.flatMap((o)=>o.models),m=l===null?t===void 0?d[0]:{api_id:"",label:a("composer.model")}:d.find((o)=>o.api_id===l)??{api_id:l,label:l};return n(Pt,{value:{...m,label:En(m)},models:d,modelGroups:p,header:{name:a("composer.model"),action:n(ze,{})},compactCatalog:!0,booleanOptions:[{id:"fast_mode",name:a("composer.fastMode"),currentValue:!1,disabled:!0,title:a("composer.fastModeUnsupported"),icon:n(g,{className:"size-4","aria-hidden":"true"})}],showModelList:!0,onChange:(o)=>r(o.api_id),t:(o)=>a(o)})}
2
- export{da};
@@ -1,2 +0,0 @@
1
- import{u}from"./chunk-b5g055qp.js";import{s}from"./chunk-0b50jg23.js";import{v,f}from"./chunk-m4ds8kjc.js";import{pt}from"./chunk-z0q7ghbg.js";import{cn as r}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as p}from"lucide-react";import{DropdownMenu as c,DropdownMenuContent as m,DropdownMenuItem as d,DropdownMenuTrigger as g}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as w}from"react/jsx-runtime";function Ds({onCollapseAll:i}){let{t:n}=s();return w(c,{children:[o(g,{render:o(pt,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(p,{})}),o(m,{align:"end",className:"w-52",children:o(d,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Fs({screen:i,onSwitch:n}){let{t:e}=s(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(f,{className:r(u,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(v,{children:i==="main"?o(a,{}):o(l,{})})})}
2
- export{Ds,Fs};
@@ -1,2 +0,0 @@
1
- import{xe}from"./chunk-erdrx47j.js";import{C}from"./chunk-wjgrrfq9.js";import{t,ce}from"./chunk-e4ws15tg.js";import{isEmbeddedResource as T,isImage as N,isResourceLink as F}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as U,FileIcon as y,ImageOffIcon as z,LoaderCircleIcon as j}from"lucide-react";import{useState as I}from"react";import{Button as c}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as n,jsxs as s}from"react/jsx-runtime";function Zn(e){let r=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))r=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(r)||"attachment"}catch(a){if(a instanceof URIError)return r||"attachment";throw a}}function $o(e,r){let a=document.createElement("a");a.href=r,a.download=e,a.click()}function L({block:e,generated:r=!1}){let a=t(),[d,f]=I(!1),[R,B]=I(null);if(F(e)){let p=C(e.uri);if(p!==null)return n(xe,{app:{id:p,name:e.title??e.name}});if(e.uri==="codex-image:unavailable")return s("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(z,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let u=Zn(e.uri);return s(c,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(y,{}),s("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),s("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==u&&`${u} · `,e.mimeType??u.split(".").at(-1)?.toUpperCase()]})]})]})}if(!T(e)&&!N(e))return null;let i=N(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,o=Zn(i.uri);if("text"in i)return s("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),s(c,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(y,{}),n("span",{className:"truncate",children:o})]})]});let m=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,g=i.mimeType?.toLowerCase().startsWith("image/")&&R!==m,{openImage:w,openImageGallery:x}=a,v=x?()=>x([{src:m,alt:o,uri:i.uri}],0):w&&(()=>w(m)),l=r&&g,E=async()=>{f(!0);try{if(a.saveFile)await a.saveFile(o,i.blob);else $o(o,m)}catch(p){ce(a,p)}finally{f(!1)}},h=n("img",{src:m,alt:"",className:r?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>B(m)});return s("div",{className:l?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[g&&(v===void 0?h:n(c,{variant:"ghost",className:r?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:v,children:h})),s(c,{variant:l?"secondary":"link",size:l?"icon":"sm",className:l?"codex-generated-image-download":"max-w-full min-w-0",disabled:d,title:a.t("timeline.download",{name:o}),"aria-label":a.t("timeline.download",{name:o}),onClick:()=>{E()},children:[d?n(j,{className:"motion-safe:animate-spin"}):n(U,{}),!l&&n("span",{className:"truncate",children:o})]})]})}
2
- export{Zn,$o,L};
@@ -1,2 +0,0 @@
1
- import{ne}from"./chunk-t2ej667n.js";import{bt}from"./chunk-r7g85s0a.js";var fe={persistConfig:!0,nativeTools:{imageGeneration:!1},applicationContext:bt,parseConfig(e){if(typeof e.model!=="string"||typeof e.size!=="string"||Object.keys(e).some((t)=>t!=="model"&&t!=="size"))throw Error("Invalid image input config");let o={model:e.model,size:e.size};return ne(o),o},routePrompt(e){return e.image()}};
2
- export{fe};
@@ -1,2 +0,0 @@
1
- import{createContext as i,useContext as r}from"react";import{jsx as e}from"react/jsx-runtime";var n=i(null);function ws({host:t,children:o}){return e(n.Provider,{value:t,children:o})}function c(){let t=r(n);if(t===null)throw Error("Activity host is missing");return t}function F(t){let{Markdown:o}=c();return e(o,{...t})}
2
- export{ws,c,F};
@@ -1,2 +0,0 @@
1
- import{Zt}from"./chunk-r0dg1bjd.js";import{createContext as l,useContext as a,useEffect as p,useSyncExternalStore as u}from"react";import{jsx as o}from"react/jsx-runtime";var g=l(null),P=l(null),r=new WeakMap;function qe(e){let t=r.get(e);if(!t)t=Zt(e),r.set(e,t);return t}function Is({host:e,client:t,children:n}){let s=qe(t);return s.bindHost(e),p(()=>s.bindHost(e),[s,e]),o(g,{value:e,children:o(P,{value:t,children:n})})}function d(){let e=a(g);if(e===null)throw Error("Plugins host is missing");return e}function We(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function ct(e){let t=We();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=qe(We());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Ze(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
- export{qe,Is,d,We,ct,i,Ze};
@@ -1,4 +0,0 @@
1
- import{H}from"./chunk-k3fwyr6s.js";import{xo,m,S,jn,bo,Tt}from"./chunk-x2x9g6vk.js";import{mr,vo,gr,yo}from"./chunk-2eceheqt.js";import{Mt,Nt,Kn}from"./chunk-kv3hsfyk.js";import{he,g}from"./chunk-f67e77e6.js";import{cn as q}from"cn";import{forwardRef as z,useImperativeHandle as j,useLayoutEffect as O,useRef as u}from"react";import{jsx as V}from"react/jsx-runtime";var U=(r,E)=>r.text===E.text&&JSON.stringify(r.apps)===JSON.stringify(E.apps),ho=z((r,E)=>{let I=he(),F=g(),o=u(null),K=u(null),a=u(S(m({text:I.textInput.value,apps:r.applications}))),p=u({start:r.initialCaret??m(a.current).length,end:r.initialCaret??m(a.current).length}),h=u(r.initialUndo?[{...r.initialUndo,selection:{start:Math.max(0,(r.initialCaret??1)-1),end:Math.max(0,(r.initialCaret??1)-1)}}]:[]),P=u([]),R=u(""),v=u(r.skillIcon),y=u(!1),x=u(!1),w=u(null),d=u({props:r,controller:I});d.current={props:r,controller:I};let f=()=>{if(o.current&&document.activeElement===o.current)p.current=gr(o.current,a.current.apps,p.current);return p.current},T=()=>{let e=o.current;if(!e)return;let t={...p.current};e.focus(),p.current=t,yo(e,t)},L=()=>({...a.current,selection:f()}),D=(e,t)=>{if(!o.current)return;if(mr(o.current,e,d.current.props.skillNames,d.current.props.skillIcon),v.current=d.current.props.skillIcon,R.current=JSON.stringify(d.current.props.skillNames??[]),o.current.dataset.empty=String(e.text.length===0&&e.apps.length===0),p.current=t,document.activeElement===o.current)yo(o.current,t)},C=(e,t,n=!0,s=!0)=>{if(s&&!U(a.current,e)){if(h.current.push(w.current??L()),h.current.length>100)h.current.shift();P.current=[]}if(w.current=null,a.current=e,p.current=t,n)D(e,t);d.current.props.onApplicationsChange(e.apps),d.current.controller.textInput.setInput(e.text)},b=(e)=>{let t=f(),n=m(a.current),s=m(e),i=new Set([...n.slice(0,t.start),...n.slice(t.end)].flatMap((k)=>typeof k==="string"?[]:[k.id])),c=s.filter((k)=>typeof k==="string"||!i.has(k.id)),l=S([...n.slice(0,t.start),...c,...n.slice(t.end)]),M=t.start+c.length;C(l,{start:M,end:M})},A=(e)=>{let n=(e?h.current:P.current).pop();if(!n)return;(e?P.current:h.current).push(L()),C({text:n.text,apps:n.apps},n.selection,!0,!1)},N=()=>{if(!o.current)return;let e=S(vo(o.current,a.current.apps)),t=f();if(y.current)return;let n=Kn(e.text),s=n===e.text?e:S(m({text:n,apps:e.apps}));C(s,t,n!==e.text)};O(()=>{let e=o.current;if(!e)throw Error("Inline prompt input is missing");Object.defineProperties(e,{value:{configurable:!0,get:()=>a.current.text,set:(i)=>{a.current=S(m({text:i,apps:a.current.apps})),D(a.current,p.current)}},selectionStart:{configurable:!0,get:()=>jn(m(a.current),f().start)},selectionEnd:{configurable:!0,get:()=>jn(m(a.current),f().end)},setSelectionRange:{configurable:!0,value:(i,c)=>{let l=m(a.current);p.current={start:bo(l,i),end:bo(l,c)},D(a.current,p.current),e.dispatchEvent(new Event("select"))}},disabled:{configurable:!0,get:()=>Boolean(d.current.props.disabled)},form:{configurable:!0,get:()=>e.closest("form")}}),K.current=e,D(a.current,p.current),T();let n=()=>{f()},s=(i)=>{if(d.current.props.disabled){i.preventDefault();return}if(y.current||i.isComposing)return;if(i.inputType==="historyUndo"||i.inputType==="historyRedo")i.preventDefault(),A(i.inputType==="historyUndo");else if(i.inputType==="insertParagraph"||i.inputType==="insertLineBreak")i.preventDefault(),b({text:`
2
- `,apps:[]});else w.current=L()};return e.addEventListener("beforeinput",s),e.addEventListener("change",N),document.addEventListener("selectionchange",n),()=>{e.removeEventListener("beforeinput",s),e.removeEventListener("change",N),document.removeEventListener("selectionchange",n),K.current=null}},[]),O(()=>{if(y.current)return;let e=S(m({text:I.textInput.value,apps:r.applications}));if(U(e,a.current)&&R.current===JSON.stringify(r.skillNames??[])&&v.current===r.skillIcon)return;let t=f();a.current=e,D(e,t)},[I.textInput.value,r.applications,r.skillNames,r.skillIcon]),j(E,()=>({focus:T,getTextarea:()=>K.current,isComposing:()=>y.current||x.current,resetHeight:()=>{h.current=[],P.current=[]},insertInvocation:(e)=>{T(),b({text:`${e} `,apps:[]})},insertApplication:(e)=>{if(T(),a.current.apps.some((t)=>t.id===e.id))return;b({text:"",apps:[{...e,offset:0}]})}}),[]);let J=(e)=>{if(y.current||x.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;if(d.current.props.onKeyDown?.(e),e.defaultPrevented)return;if((e.metaKey||e.ctrlKey)&&!e.altKey&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")){e.preventDefault(),A(e.key.toLowerCase()==="z"&&!e.shiftKey);return}if(e.key==="Enter"){if(e.preventDefault(),e.shiftKey||e.altKey&&!e.ctrlKey&&!e.metaKey)b({text:`
3
- `,apps:[]});else{let t=o.current?.closest("form"),n=t?.querySelector('button[type="submit"]');if(n&&!n.disabled)t?.requestSubmit(n)}return}if(e.key==="Backspace"||e.key==="Delete"){let t=f(),n=m(a.current);if(t.start!==t.end){e.preventDefault(),b({text:"",apps:[]});return}let s=jn(n,t.start),i=H(a.current.text,d.current.props.skillNames??[]).find((l)=>e.key==="Backspace"?l.end===s:l.start===s);if(i){e.preventDefault();let l=t.start-(e.key==="Backspace"?i.name.length:0);C(S([...n.slice(0,l),...n.slice(l+i.name.length)]),{start:l,end:l});return}let c=e.key==="Backspace"?t.start-1:t.start;if(c>=0&&c<n.length&&typeof n[c]!=="string")e.preventDefault(),C(S([...n.slice(0,c),...n.slice(c+1)]),{start:c,end:c})}if(e.key.length===1&&e.key.charCodeAt(0)<32)e.preventDefault()},B=(e)=>{let t=f();if(t.start===t.end)return;let n=m(a.current).slice(t.start,t.end),s=S(n);if(e.preventDefault(),e.clipboardData.setData("text/plain",n.map((i)=>typeof i==="string"?i:`${i.name} `).join("")),e.clipboardData.setData(xo,JSON.stringify({version:1,...s})),e.type==="cut"&&!r.disabled)b({text:"",apps:[]})};return V("div",{ref:o,role:"textbox","aria-multiline":"true","aria-label":r["aria-label"],"aria-disabled":r.disabled||void 0,contentEditable:!r.disabled,suppressContentEditableWarning:!0,"data-chat-input":!0,"data-inline-input":!0,"data-placeholder":r.placeholder,"data-empty":a.current.text.length===0&&a.current.apps.length===0,className:q("bg-chat-input-bg data-[empty=true]:before:text-chat-input-placeholder relative max-h-(--chat-input-max-height) min-w-0 flex-1 overflow-y-auto p-0 pe-2.5 leading-(--chat-input-line-height) break-words whitespace-pre-wrap outline-none data-[empty=true]:before:pointer-events-none data-[empty=true]:before:absolute data-[empty=true]:before:content-[attr(data-placeholder)]",r.className),onInput:N,onKeyDown:J,onCompositionStart:()=>{w.current=L(),y.current=!0,x.current=!1},onCompositionEnd:()=>{y.current=!1,N(),x.current=!0,requestAnimationFrame(()=>{x.current=!1})},onPasteCapture:(e)=>r.onPasteCapture?.(e),onPaste:(e)=>{if(e.defaultPrevented||r.disabled)return;let{imageFiles:t,sawNonImageFile:n}=Mt(e.clipboardData.items);if(e.preventDefault(),t.length){F.add(t);return}if(n&&!Nt(e.clipboardData.items))return;b(Tt(e.clipboardData)??{text:Kn(e.clipboardData.getData("text/plain")),apps:[]})},onCopy:B,onCut:B,onDrop:(e)=>{e.preventDefault()}})});ho.displayName="PromptInputInline";
4
- export{ho};
@@ -1,2 +0,0 @@
1
- function bi(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function oo(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function Ye(t){return t.type==="array"}function ln(t){return(Ye(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
- export{bi,oo,Ye,ln};
@@ -1,2 +0,0 @@
1
- import{cr,Ve}from"./chunk-gs0b02g2.js";import{ar}from"./chunk-z6x70w62.js";import{Co,wo,At,Et,ko}from"./chunk-f67e77e6.js";import{cn as P}from"cn";import{ArrowUpIcon as ge,Loader2Icon as be,SquareIcon as ve,XIcon as Ie}from"lucide-react";import{Children as Y,useCallback as h,useEffect as T,useMemo as he,useRef as S,useState as Pe}from"react";import{flushSync as xe}from"react-dom";import{InputGroup as ye,InputGroupAddon as ee,InputGroupButton as te}from"@nyssance/shadcn/vega/components/ui/input-group";import{jsx as u,jsxs as Le}from"react/jsx-runtime";function Z(l){let s=new FormData(l).get("message");return typeof s==="string"?s:""}var tr=({className:l,bashMode:s=!1,attachmentPolicy:o,onCommand:f,onSubmitError:x,canSubmit:g,onSubmitAsync:b,accept:M,multiple:re,globalDrop:E,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:v,onSubmit:ne,children:oe,...se})=>{let i=Et(),p=!!i,ie=s&&p&&i.textInput.value.startsWith("!"),y=S(null),C=S(null),k=S(!1),[ae,D]=Pe([]),d=p?i.attachments.files:ae,U=S(d);U.current=d;let ue=h(()=>{y.current?.click()},[]),B=h((e)=>{if(!M||M.trim()==="")return!0;return M.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[M]),O=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((a)=>B(a));if(r.length&&t.length===0){v?.({code:"accept",message:"No files match the accepted types."});return}let n=(a)=>H?a.size<=H:!0,c=t.filter(n);if(t.length>0&&c.length===0){v?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((a)=>{let I=o?o.uniqueFiles(c,a):c,m=typeof z==="number"?Math.max(0,z-a.length):void 0,_=typeof m==="number"?I.slice(0,m):I;if(typeof m==="number"&&I.length>m)v?.({code:"max_files",message:"Too many files. Some were not added."});let Q=[];for(let F of _){let V=o?.sourcePath(F);Q.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(F),mediaType:O(F),filename:F.name,size:F.size,lastModified:F.lastModified,...V===void 0?{}:{sourcePath:V}})}return[...a,...Q]})},[o,O,B,z,H,v]),pe=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=p?i.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((c)=>!(c.type??"").toLowerCase().startsWith("image/"));if(t.length>0){v?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((c,a)=>c+a.size,0);if(n>0){let c=d.filter((a)=>(a.mediaType??"").toLowerCase().startsWith("image/")).reduce((a,I)=>a+(I.size??0),0);if(cr(c,n)){v?.({code:"max_total_size",message:`Total image size must not exceed ${Ve}MB.`});return}}W(r)},[d,W,v]),G=p?i.attachments.remove:pe,N=p?i.attachments.clear:me,q=p?i.attachments.openFileDialog:ue;T(()=>{if(!p)return;i.__registerFileInput(y,()=>y.current?.click())},[p,i]),T(()=>{if(R&&y.current&&d.length===0)y.current.value=""},[d,R]),T(()=>{let e=C.current;if(!e)return;if(E)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)if(o?.onSelectFiles)o.onSelectFiles([...n.dataTransfer.files]);else L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,E,o]),T(()=>{if(!E)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)if(o?.onSelectFiles)o.onSelectFiles([...t.dataTransfer.files]);else L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,E,o]),T(()=>()=>{if(!p){for(let e of U.current)if(e.url)URL.revokeObjectURL(e.url)}},[p]);let ce=(e)=>{if(e.currentTarget.files)if(o?.onSelectFiles)o.onSelectFiles([...e.currentTarget.files]);else L(e.currentTarget.files);e.currentTarget.value=""},X=he(()=>({files:d.map((e)=>({...e,id:e.id})),add:L,remove:G,clear:N,openFileDialog:q,fileInputRef:y}),[d,L,G,N,q]),A=S({controller:i,files:d,canSubmit:g});A.current={controller:i,files:d,canSubmit:g};let w=S(!0);T(()=>(w.current=!0,()=>{w.current=!1}),[]);let J=async(e)=>{let r=g===void 0?!0:g();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&b===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=C.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=p?i.textInput.value:Z(t),c=i?.textInput.getRevision?.(),a=d,I=()=>{if(!w.current)return;let m=A.current;if(m.files!==a)return;if(p){if(c===void 0||m.controller===null||m.controller.textInput.getRevision?.()!==c)return;if(m.controller.textInput.clearSubmitted===void 0)m.controller.textInput.clear();else m.controller.textInput.clearSubmitted()}else if(Z(t)===n)t.reset();N()};k.current=!0;try{if(f?.(n.trim()))return I(),{status:"accepted"};let m=await ar(a),_=A.current.canSubmit===void 0?!0:A.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!w.current)return{status:"blocked",reason:"form_unmounted"};if(m.rejectedCount>0)v?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(b!==void 0)await b({text:n,files:m.files});else if(e!==null)await ne({text:n,files:m.files},e);return I(),{status:"accepted"}}finally{k.current=!1}},de=(e)=>{e.preventDefault(),J(e).catch(x)},fe=h((e)=>{if(!e.trim())return;if(p&&i)xe(()=>{i.textInput.setInput(e)});C.current?.requestSubmit()},[i,p]),K=u(wo.Provider,{value:()=>J(null),children:Le(Co.Provider,{value:fe,children:[u("input",{accept:o?.onSelectFiles?o.accept:M,"aria-label":"Upload files",className:"hidden",multiple:re,onChange:ce,ref:y,title:"Upload files",type:"file"}),u("form",{className:P("w-full",l),onSubmit:de,ref:C,"data-tour":"chat-input",...se,children:u(ye,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return p?u(At.Provider,{value:X,children:K}):u(ko.Provider,{value:X,children:K})};function nr({className:l,...s}){return u("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",l),...s})}function or({className:l,...s}){return u(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",l),...s})}function ir({className:l,...s}){return u(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",l),...s})}function rr({className:l,...s}){return u("div",{className:P("flex items-center gap-1",l),...s})}var j=({variant:l="ghost",className:s,size:o,collapsed:f=!1,...x})=>{let g=f||Y.count(x.children)<=1?"icon-xs":"xs";return u(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(f||Y.count(x.children)<=1)&&"size-7",s),size:g,type:"button",variant:l,...x})},sr=({className:l,variant:s="ghost",size:o="icon-xs",status:f,children:x,...g})=>{let b=u(ge,{className:"size-4"});if(f==="submitted")b=u(be,{className:"size-4 animate-spin"});else if(f==="streaming")b=u(ve,{className:"size-3 fill-current"});else if(f==="error")b=u(Ie,{className:"size-4"});return u(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",l),size:o,type:"submit",variant:s,...g,children:x??b})};
2
- export{tr,nr,or,ir,rr,j,sr};
@@ -1,2 +0,0 @@
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 +0,0 @@
1
- var Re="chrome-hover hover:bg-foreground/8 data-[active=true]:bg-foreground/5",u="chrome-hover hover:bg-foreground/8 data-active:bg-foreground/5";
2
- export{Re,u};
@@ -1,2 +0,0 @@
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,4 +0,0 @@
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};
@@ -1,2 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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,2 +0,0 @@
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};
@@ -1,2 +0,0 @@
1
- import{p}from"./chunk-g947bnqx.js";function _s(r,n){return p.readSkillDocument({path:r,roots:n??null})}
2
- export{_s};
@@ -1,2 +0,0 @@
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 +0,0 @@
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,2 +0,0 @@
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 +0,0 @@
1
- import{invoke as i}from"@tauri-apps/api/core";import{listen as t,once as n,emit as s,emitTo as a}from"@tauri-apps/api/event";var p={providersRead:()=>i("plugin:alwith-chat|providers_read"),providersSave:(e)=>i("plugin:alwith-chat|providers_save",e),providersSaveCustom:(e)=>i("plugin:alwith-chat|providers_save_custom",e),providersRemoveCustom:(e)=>i("plugin:alwith-chat|providers_remove_custom",e),providersTest:(e)=>i("plugin:alwith-chat|providers_test",e),providersApply:()=>i("plugin:alwith-chat|providers_apply"),providersAccountBind:(e)=>i("plugin:alwith-chat|providers_account_bind",e),providersRefreshManaged:(e)=>i("plugin:alwith-chat|providers_refresh_managed",e),providersClearManaged:()=>i("plugin:alwith-chat|providers_clear_managed"),readSkillDocument:(e)=>i("plugin:alwith-chat|read_skill_document",e),sessionsList:(e)=>i("plugin:alwith-chat|sessions_list",e),sessionsCountTypes:(e)=>i("plugin:alwith-chat|sessions_count_types",e),sessionsPersonaEvidence:(e)=>i("plugin:alwith-chat|sessions_persona_evidence",e),getModelPricing:()=>i("plugin:alwith-chat|get_model_pricing"),scanSessionAggregates:(e)=>i("plugin:alwith-chat|scan_session_aggregates",e),exportWeekSessions:()=>i("plugin:alwith-chat|export_week_sessions"),dailyTokenUsage:(e)=>i("plugin:alwith-chat|daily_token_usage",e),downloadUsageJson:(e)=>i("plugin:alwith-chat|download_usage_json",e),wordCloud:(e)=>i("plugin:alwith-chat|word_cloud",e),readDroppedFile:(e)=>i("plugin:alwith-chat|read_dropped_file",e),clipboardFilePaths:()=>i("plugin:alwith-chat|clipboard_file_paths"),writePastedFile:(e)=>i("plugin:alwith-chat|write_pasted_file",e),readImage:(e)=>i("plugin:alwith-chat|read_image",e),saveFile:(e)=>i("plugin:alwith-chat|save_file",e),writeTextAttachment:(e)=>i("plugin:alwith-chat|write_text_attachment",e),previewFile:(e)=>i("plugin:alwith-chat|preview_file",e)},lo={"providers:changed":{name:"providers:changed",listen:(e)=>t("providers:changed",e),once:(e)=>n("providers:changed",e),emit:(e)=>s("providers:changed",e),emitTo:(e,r)=>a(e,"providers:changed",r)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>t("providers:managed-revoked",e),once:(e)=>n("providers:managed-revoked",e),emit:(e)=>s("providers:managed-revoked",e),emitTo:(e,r)=>a(e,"providers:managed-revoked",r)}};function Ma(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function qa(e){if(Ma(e)||e instanceof Error)return e.message;return String(e)}
2
- export{p,lo,Ma,qa};
@@ -1,2 +0,0 @@
1
- var Ja=1e6,Xa=5000000;function cr(_,e){return _+e>5000000}function Ya(_){return(_/1e6).toFixed(1)}var Ve=5;
2
- export{Ja,Xa,cr,Ya,Ve};
@@ -1,2 +0,0 @@
1
- import{Oe}from"./chunk-m6yg0dc9.js";import{r,X,bn}from"./chunk-2016dacx.js";var Li=5000;function tt(t){return"pastedText"in t}function xt(t,e,p){let n=(a,o)=>{for(let[i,x]of r){if(!x.attachments.some((s)=>s.id===e.id))continue;X(i,(s)=>s.map((d)=>d.id===e.id?{...e,url:o===void 0?"":Oe(o),pastedText:{text:e.pastedText.text,status:a}}:d))}};if(!r.get(t)?.attachments.some((a)=>a.id===e.id))return;n("pending"),bn(e.id,p("pasted-text.txt",e.pastedText.text).then((a)=>n("ready",a)).catch(()=>n("error")))}function xn(t,e,p,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/")))return;let a=t.clipboardData.getData("text/plain");if(a.length<Li)return;t.preventDefault(),t.stopPropagation();let o={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:p,url:"",pastedText:{text:a,status:"pending"}};X(e,(i)=>[...i,o]),xt(e,o,n)}
2
- export{Li,tt,xt,xn};
@@ -1 +0,0 @@
1
- import{Re}from"./chunk-b5g055qp.js";import{O}from"./chunk-kv1v7kgn.js";import{cn as n}from"cn";import{Item as i,ItemActions as K,ItemContent as q,ItemDescription as de,ItemMedia as W,ItemTitle as a}from"@nyssance/shadcn/vega/components/ui/item";import{jsx as o}from"react/jsx-runtime";function Z({className:e,...t}){return o("div",{className:n("flex flex-col px-2",e),...t})}function we({className:e,size:t="xs",active:m,...r}){return o(i,{size:t,"data-active":m,className:n(Re,"data-[active=true]:font-medium",e),...r})}function Kt({className:e,children:t,...m}){return o(a,{className:n("w-full",e),...m,children:o(O,{children:t})})}export{K,q,de,W,Z,we,Kt};
@@ -1,2 +0,0 @@
1
- import{Me}from"./chunk-sbyp6k8w.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function oi({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:Me(t)}):null}function ii({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(oi,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Qt({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(ii,{label:t,shortcut:o}):t})]})}
2
- export{oi,ii,Qt};
@@ -1,2 +0,0 @@
1
- function Ea(e,n){if(e.type||!n.type)return e;let i=n.type.split("/")[1],o=i!==void 0&&i!==""?`pasted-${Date.now()}.${i==="jpeg"?"jpg":i}`:"";return new File([e],e.name||o||`pasted-${Date.now()}`,{type:n.type})}function Mt(e){let n=[],i=!1;for(let o of e){if(o.kind!=="file")continue;let t=o.getAsFile();if(!t)continue;if(!(t.type||o.type).startsWith("image/")){i=!0;continue}n.push(Ea(t,o))}return{imageFiles:n,sawNonImageFile:i}}function Nt(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Kn(e){return e.replace(s,"")}function wa(e,n){let i=0;for(let o=0;o<n;o++){let t=e.charCodeAt(o);if(t>=0&&t<=8||t===11||t===12||t>=14&&t<=31||t===127)i++}return i}function qn(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=Kn(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-wa(n,i)),r=Math.max(0,o-wa(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
2
- export{Ea,Mt,Nt,Kn,wa,qn};
@@ -1,2 +0,0 @@
1
- import{je}from"./chunk-e4ws15tg.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function $n({host:o,client:n,children:t}){let s=a(()=>({host:o,client:n}),[o,n]);return r(je,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function b(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
2
- export{$n,e,b};
@@ -1,2 +0,0 @@
1
- import{Re,u}from"./chunk-b5g055qp.js";import{O}from"./chunk-kv1v7kgn.js";import{G}from"./chunk-h4xx90s4.js";import{A}from"./chunk-vnd6smsp.js";import{ft,Je,ht}from"./chunk-tj0530fn.js";import{PreviewCard as h}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as E}from"lucide-react";import{createContext as I,useContext as T,useLayoutEffect as z,useState as H}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as j}from"react/jsx-runtime";function M(o){if(o.as==="ul"){let{as:i,className:s,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",s),...a})}let{as:t,className:n,...r}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...r})}function v({className:o,...t}){return e("span",{"data-slot":"navigation-leading",className:p("flex size-6 shrink-0 items-center justify-center [&_.lucide]:size-3.5",o),...t})}function f({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function re({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:C,headerChildren:g,wrapHeader:c,onHeaderClick:b,children:P}){let y=()=>{b?.(),t(!o)},x=p(ft,"relative flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),R=d(j,{children:[r!=null&&e(v,{children:r}),g??e(O,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(ht,{content:s!==void 0?e(Je,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:C})})]}),S=g==null?d("div",{"data-active":l?"":void 0,title:n,className:p(x,u),onClick:y,onKeyDown:(m)=>{if(m.target!==m.currentTarget)return;if(m.key!=="Enter"&&m.key!==" ")return;m.preventDefault(),y()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),R]}):e("div",{"data-active":l?"":void 0,className:x,children:R});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[c===void 0?S:c(S),o&&e(M,{className:"mt-0.5",children:P})]})}var L=I(()=>{}),_=I(()=>{});function rn(){return T(_)}function Ae(){return T(L)}function Ee({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:C,preview:g,listeningPorts:c,onOpenPort:b,accessory:P,meta:y,hint:x,actions:R,className:S,...m}){let k=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(ft,Re,"group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(g||c!=null&&c.length>0)&&"h-auto min-h-[var(--navigation-row-height,30px)] py-2.5",S),...m,children:[e(v,{children:t!=null?e(G,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(O,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),C!=null&&e(O,{className:"text-muted-foreground text-xs",children:C}),g&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:g}),c!=null&&c.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:c.map((N)=>b?d("button",{type:"button",className:"underline",onPointerDown:(w)=>w.stopPropagation(),onKeyDown:(w)=>w.stopPropagation(),onClick:(w)=>{w.stopPropagation(),b(N)},children:[":",N]},N):d("span",{children:[":",N]},N))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(E,{className:"text-muted-foreground size-3"}),e(ht,{content:P!=null?e(Je,{children:P}):y??e(Je,{}),actions:R}),x!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:x})]})]});if(a==null)return k;return e(D,{row:k,onOpenChange:l,children:a})}function D({row:o,children:t,onOpenChange:n}){let[r,i]=H(!1),[s,a]=H(!1),l=r||s;return z(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(L.Provider,{value:a,children:e(_.Provider,{value:()=>{i(!1),a(!1)},children:e(q,{open:l,onOpenChange:i,trigger:o,children:t})})})}function q({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return A(o),d(h.Root,{open:o,onOpenChange:t,children:[e(h.Trigger,{render:n,delay:700,closeDelay:100}),e(h.Portal,{children:e(h.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(h.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
2
- export{M,v,f,re,rn,Ae,Ee};
@@ -1,2 +0,0 @@
1
- function Oe(e){if(e.startsWith("\\\\?\\UNC\\"))e="\\\\"+e.slice(8);else if(e.startsWith("\\\\?\\"))e=e.slice(4);if(/^[a-z]:[\\/]/i.test(e))e="/"+e.replaceAll("\\","/");else if(e.startsWith("\\\\"))e=e.replaceAll("\\","/");if(!e.startsWith("/"))throw Error("File URLs require an absolute path");let i=encodeURI(e).replaceAll(/[?#]/g,encodeURIComponent);return e.startsWith("//")?`file:${i}`:`file://${i}`}
2
- export{Oe};
@@ -1,2 +0,0 @@
1
- function Dt(o){return o.kind==="tool"&&o.status==="completed"&&o.toolKind!=="read"&&o.toolKind!=="search"}
2
- export{Dt};
@@ -1,2 +0,0 @@
1
- import{qi}from"./chunk-fcy6mh2e.js";import{fe}from"./chunk-56jqg70p.js";var t={chat:qi,image:fe};function ot(n){return Object.hasOwn(t,n)}function Ue(n){if(!ot(n))throw Error(`Unsupported input mode: ${n}`);return t[n]}function xa(n){if(n===null)return"chat";let o=n.mode;if(!ot(o))throw Error(`Unsupported input mode: ${o}`);return t[o].parseConfig(n.config),o}
2
- export{ot,Ue,xa};
@@ -1,2 +0,0 @@
1
- import{F}from"./chunk-5rzy2287.js";import{ve}from"./chunk-15m908ph.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function os({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(F,{text:t.content,streaming:!1})});if(!n(t))return null;return e(ve,{entries:t.entries})}
2
- export{os};
@@ -1,2 +0,0 @@
1
- import{be}from"./chunk-vys8kfkp.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=be();function Fo(f,m){let i=new Set;for(let e of m){if(e.kind!=="tool"||e.status!=="completed")continue;let o=e.content.filter(u);if(!o.some((n)=>c(n.content)))continue;o.forEach((n,a)=>{if(c(n.content))i.add(`${e.id}:${a}`);if(!s(n.content))return;let r;try{r=JSON.parse(n.content.text)}catch(t){if(t instanceof SyntaxError)return;throw t}if(r===null||typeof r!=="object"||!("kind"in r)||r.kind!=="alwith.image"||!("images"in r)||!Array.isArray(r.images))return;for(let t of r.images)if(t!==null&&typeof t==="object"&&typeof t.reference==="string")i.add(t.reference)})}if(i.size===0)return f;return f.map((e)=>{if(!s(e)||!e.text.includes("!["))return e;let o=d.lexer(e.text).map((n)=>{if(n.type!=="paragraph"||!n.tokens)return n.raw;let a=0;return n.tokens.map((t)=>(a+=t.raw.length,t.type==="image"&&i.has(t.href)?"":t.raw)).join("")+n.raw.slice(a)}).join("");return o===e.text?e:{...e,text:o}}).filter((e)=>!s(e)||e.text.trim().length>0)}
2
- export{Fo};
@@ -1,2 +0,0 @@
1
- function*Po(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function xr(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of Po(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
2
- export{Po,xr};
@@ -1,2 +0,0 @@
1
- import{Dt}from"./chunk-n88j8hsd.js";import{isContentEntry as d,isImage as l,isText as p}from"@nyssance/codex-acp-v2/client";var Na="generate_image",Aa=[{id:"MiniMax-H3-Image",label:"MiniMax H3 Image",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"MiniMax-H3-Image-Highspeed",label:"MiniMax H3 Image Highspeed",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"wham",label:"ChatGPT Images",provider:"chatgpt",sizes:["auto"],maxReferences:16},{id:"doubao-seedream-4-5-251128",label:"Seedream 4.5",provider:"seedream",sizes:["2K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-lite-260128",label:"Seedream 5.0 Lite",provider:"seedream",sizes:["2K","3K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-pro-260628",label:"Seedream 5.0 Pro",provider:"seedream",sizes:["1K","2K"],maxReferences:10}],Wa={model:"wham",size:"auto"},ji={name:Na,description:"Generate or edit images using the user's selected image model. Use this tool for image creation and editing. For edits, supply reference IDs returned by earlier calls or the current image request; do not read credentials or call image services yourself. Return the generated image to the user. The host controls model selection.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Complete image generation or editing instructions"},references:{type:"array",items:{type:"string"},description:"Image reference IDs supplied by the host or previous image results"}},required:["prompt"],additionalProperties:!1},annotations:{readOnlyHint:!0}};function c(o){let t=o.content.filter(d).map((i)=>i.content);if(t.length)return t;let r=o.rawOutput?.result;return Array.isArray(r?.content)?r.content:[]}function Ki(o){return o.items.flatMap((t)=>{if(!Dt(t))return[];let r=t.rawInput,i=c(t),s={};for(let n of i){if(!p(n)||!n.text.startsWith("{"))continue;try{let e=JSON.parse(n.text);if(e&&typeof e==="object"&&"kind"in e&&e.kind==="alwith.image")s={..."model"in e&&typeof e.model==="string"?{model:e.model}:{},..."size"in e&&typeof e.size==="string"?{size:e.size}:{}}}catch(e){if(!(e instanceof SyntaxError))throw e}}return i.flatMap((n,e)=>{if(!l(n))return[];let{mimeType:a,data:m}=n;return[{id:`${t.id}:${e}`,toolId:t.id,...s,...typeof r?.arguments?.prompt==="string"?{prompt:r.arguments.prompt}:{},mimeType:a,data:m,src:`data:${a};base64,${m}`}]})})}function ne(o){let t=Aa.find((r)=>r.id===o.model);if(!t||!t.sizes.includes(o.size))throw Error("Invalid image model or size");return t}function Za(o,t,r){let i=ne(o);if(i.provider!=="seedream")throw Error("Expected a Seedream model");if(r.length>i.maxReferences)throw Error(`This model accepts at most ${i.maxReferences} reference images`);return{model:i.id,prompt:t,size:o.size,response_format:"b64_json",watermark:!1,...r.length?{image:r}:{},...i.id==="doubao-seedream-4-5-251128"?{}:{output_format:"png"}}}
2
- export{Na,Aa,Wa,ji,Ki,ne,Za};
@@ -1,2 +0,0 @@
1
- import{s,a,o,h}from"./chunk-0b50jg23.js";import{G}from"./chunk-h4xx90s4.js";import{M,re,Ee}from"./chunk-m4ds8kjc.js";import{Te,J,ue}from"./chunk-9y0fxq8e.js";import{si}from"./chunk-wj9s8331.js";import{Pe}from"./chunk-5h49mv0e.js";import{Ie}from"./chunk-rd51rvde.js";import{Me}from"./chunk-sbyp6k8w.js";import{Jt}from"./chunk-mhhtcbh9.js";import{ni}from"./chunk-arr0hypp.js";import{ActivityIcon as D}from"lucide-react";import{useEffect as O,useMemo as A}from"react";import{Kbd as E}from"@nyssance/shadcn/vega/components/ui/kbd";import{jsx as c,jsxs as C,Fragment as T}from"react/jsx-runtime";function K(i,d){return i.find((l)=>l.sessionId===d.sessionId)??{sessionId:d.sessionId,cwd:d.cwd,title:d.title||null,updatedAt:null,archived:!1}}function Ls({selectedId:i,onSelect:d,isForeground:l,onOpen:b,accessory:w,rowActions:k}){let R=s(),{t:N}=R,m=o((t)=>t.runStates),S=o((t)=>t.drafts),u=o((t)=>t.sessionList),v=J((t)=>t.activityOrder),p=A(()=>v.flatMap((t)=>{let e=m[t];return e&&Te({runStates:m,drafts:S},t)?[{sid:t,record:e,sessionRow:K(u,e)}]:[]}),[v,m,S,u]),g=A(()=>{let t=new Map;for(let e of p){let r=e.sid===i||l?.(e.sid)?"foreground":"background",y=t.get(r)??[];y.push(e),t.set(r,y)}return["foreground","background"].filter((e)=>t.has(e)||e==="background").map((e)=>({key:e,rows:t.get(e)??[]}))},[p,i,l]),f=J((t)=>t.activityCollapsedGroups),n=ue(),L=g.flatMap((t)=>t.key==="foreground"||!f.has(t.key)?t.rows:[]),x=(t)=>{if(b?.(t))return;d(t)},P=ni();O(()=>{let t=(e)=>{if(e.defaultPrevented||e.isComposing||e.repeat||!si(e))return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;let r=Number(e.key);if(!Number.isInteger(r)||r<1||r>9)return;let y=L[r-1];if(!y)return;e.preventDefault(),x(y.sessionRow)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let I=(t)=>{let e=L.indexOf(t);return c(H,{sessionRow:t.sessionRow,state:t.record.state,interruption:t.record.interruption,active:t.sid===i,tasks:t.record.tasks,listeningPorts:t.record.listeningPorts,onOpen:()=>x(t.sessionRow),accessory:w?.(t.sid),actions:k?.(t.sessionRow),hint:e<9&&P?c(E,{children:Me(`CommandOrControl+${e+1}`)}):void 0},t.sid)};return c(M,{children:g.map((t)=>t.key==="foreground"?c(M,{children:t.rows.map(I)},t.key):c(re,{open:!f.has(t.key),onOpenChange:(e)=>{let r=new Set(f);if(e)r.delete(t.key);else r.add(t.key);n({activityCollapsedGroups:r})},leading:c(D,{className:"text-muted-foreground size-3.5 shrink-0"}),label:N("sessionList.background"),count:t.rows.length,children:t.rows.map(I)},t.key))})}function H({sessionRow:i,state:d,interruption:l,active:b,tasks:w,listeningPorts:k,accessory:R,actions:N,onOpen:m,hint:S}){let u=s(),v=a(),{t:p}=u,g=i.title??p("sessionList.untitled"),f=Jt(i.sessionId,d);return C(T,{children:[c(Ee,{"data-session-id":i.sessionId,active:b,role:"button",tabIndex:0,hoverCard:c(Ie,{sessionRow:i,actions:N}),onClick:m,onKeyDown:(n)=>{if(n.target!==n.currentTarget)return;if(n.key==="Enter"||n.key===" ")n.preventDefault(),m()},state:d,interruption:l,title:g,preview:f,listeningPorts:k,onOpenPort:u.openLink&&((n)=>u.openLink?.(`http://localhost:${n}`)),accessory:R,hint:S,actions:c(Pe,{title:p("sessionList.stop"),onStop:()=>h(u,v.stopSession(i.sessionId))})}),w.map((n)=>C("div",{className:"border-border/60 before:border-border/60 relative ms-4 flex min-h-7 items-center gap-2 border-s py-1 ps-4 pe-2 text-xs before:absolute before:start-0 before:top-3.5 before:w-2 before:border-t",children:[c(G,{state:"running"}),c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate leading-5",title:n.title,children:n.title})]},n.id))]})}
2
- export{Ls};
@@ -1,2 +0,0 @@
1
- import{u}from"./chunk-b5g055qp.js";import{a,o}from"./chunk-0b50jg23.js";import{M,v,f,re}from"./chunk-m4ds8kjc.js";import{N,ge,vi}from"./chunk-d4jkh19p.js";import{gt}from"./chunk-mfkrs2at.js";import{z,se}from"./chunk-tjt1s9qs.js";import{Le,me}from"./chunk-7p0d3rz7.js";import{closestCorners as ue,DndContext as fe,KeyboardSensor as Ce,PointerSensor as ye,useSensor as V,useSensors as Se}from"@dnd-kit/core";import{SortableContext as W,sortableKeyboardCoordinates as De,useSortable as ie,verticalListSortingStrategy as X}from"@dnd-kit/sortable";import{CSS as le}from"@dnd-kit/utilities";import{cn as F}from"cn";import{BrushCleaningIcon as we,MessageSquareIcon as ve,MoreHorizontalIcon as Ne,PencilIcon as Ie,PlusIcon as ae,StarIcon as he,Trash2Icon as ce}from"lucide-react";import{useEffect as be,useMemo as xe,useState as R}from"react";import{Button as D}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as Y,DialogContent as Z,DialogDescription as ee,DialogFooter as oe,DialogHeader as te,DialogTitle as ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Me,DropdownMenuContent as Ee,DropdownMenuGroup as ke,DropdownMenuItem as H,DropdownMenuTrigger as Re}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Pe}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as s,Fragment as ze}from"react/jsx-runtime";function Te({collectionId:l,sessionId:C,children:x}){let{attributes:w,listeners:I,setNodeRef:i,transform:m,transition:p,isDragging:E}=ie({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:le.Transform.toString(m),transition:p},className:F("w-full min-w-0",E&&"opacity-50"),...w,...I,role:"group",children:x})}function Be({collection:l,children:C,onEdit:x,onConfirm:w,onNewChat:I}){let{t:i}=N(),m=me(),p=ge(),{attributes:E,listeners:d,setNodeRef:h,transform:P,transition:T,isDragging:K}=ie({id:l.id,disabled:{draggable:l.id===z,droppable:!1},data:{type:"collection"}});return e("div",{ref:h,style:{transform:le.Transform.toString(P),transition:T},className:F("w-full min-w-0",K&&"opacity-50"),children:e(re,{open:!l.collapsed,onOpenChange:(c)=>p(m({type:"collapse",id:l.id,collapsed:!c})),label:se(l,i),count:l.sessionIds.length,leading:l.id===z?e(he,{className:"size-3.5"}):e(gt,{emoji:l.emoji,onChange:(c)=>p(m({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...E,...d,role:"group",children:c}),actions:s(Me,{children:[e(Re,{onClick:(c)=>c.stopPropagation(),onPointerDown:(c)=>c.stopPropagation(),render:e(D,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:se(l,i)}),children:e(Ne,{className:"size-3.5"})})}),e(Ee,{children:s(ke,{children:[l.id!==z&&s(H,{onClick:x,children:[e(Ie,{}),i("collection.rename")]}),s(H,{onClick:I,children:[e(ae,{}),i("collection.newChat")]}),s(H,{onClick:()=>w("clear"),children:[e(we,{}),i("collection.clearCollection")]}),l.id!==z&&s(H,{variant:"destructive",onClick:()=>w("delete"),children:[e(ce,{}),i("collection.deleteCollection")]})]})})]}),children:C})})}function He({children:l}){return e("div",{className:"min-h-0 flex-1 overflow-y-auto ps-2 pe-0 pb-1",children:l})}function Js({renderRow:l,onSelect:C,onNewChat:x,Scroll:w=He}){let I=N(),{t:i}=I,m=me(),p=ge(),E=a(),{collections:d,order:h}=Le(),P=o((t)=>t.sessionList),T=o((t)=>t.archivedSessions),K=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),U=xe(()=>new Map([...T,...P].map((t)=>[t.sessionId,t])),[T,P]),_=I.isMac??vi(),[y,k]=R(null),[L,O]=R(""),[q,j]=R(""),[S,B]=R(null),[g,J]=R(!1),de=Se(V(ye,{activationConstraint:{distance:5}}),V(Ce,{coordinateGetter:De})),G=h.flatMap((t)=>d[t].collapsed?[]:d[t].sessionIds.flatMap((n)=>{let r=U.get(n);return r&&!r.archived?[r]:[]}));be(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(_?!n.metaKey||n.ctrlKey:!n.ctrlKey||n.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(n.target instanceof HTMLElement&&(n.target.isContentEditable||n.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let r=Number(n.key)-1;if(!Number.isInteger(r)||r<0||r>8||!G[r])return;n.preventDefault(),C(G[r])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,_,C]);let pe=({active:t,over:n})=>{if(n===null)return;let r=t.data.current,b=n.data.current;if(r?.type==="session"&&b!==void 0){let Q=b.type==="session"?String(b.collectionId):String(n.id);p(m({type:"move",sourceCollectionId:String(r.collectionId),collectionId:Q,sessionId:String(r.sessionId),index:b.type==="session"?d[Q].sessionIds.indexOf(String(b.sessionId)):void 0}))}else if(r?.type==="collection"&&b?.type==="collection"&&String(n.id)!==z)p(m({type:"reorder",id:String(t.id),index:h.indexOf(String(n.id))}))},A=(t,n)=>{J(!0),p(t.then(n).finally(()=>J(!1)))};return s(ze,{children:[e(w,{children:s(M,{children:[s(f,{className:F(u,"font-normal"),onClick:()=>{k("new"),O(""),j("")},children:[e(v,{children:e(ae,{})}),e("span",{children:i("collection.newCollection")})]}),c&&s("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:c}),e(D,{variant:"ghost",onClick:()=>p(E.listSessions({reset:!0})),children:i("collection.retry")})]}),e(fe,{sensors:de,collisionDetection:ue,onDragEnd:pe,children:e(W,{items:h,strategy:X,children:e(M,{children:h.map((t)=>e(Be,{collection:d[t],onNewChat:()=>x(t),onEdit:()=>{k(t),O(d[t].name),j(d[t].emoji??"")},onConfirm:(n)=>B({id:t,type:n}),children:e(W,{items:d[t].sessionIds.map((n)=>JSON.stringify([t,n])),strategy:X,children:d[t].sessionIds.map((n)=>{let r=U.get(n);if(r?.archived)return null;if(!r)return K?s("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(v,{children:e(ve,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(D,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>p(m({type:"remove",sessionId:n,collectionId:t})),children:e(ce,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(r,()=>{},t)},n)})})},t))})})})]})}),e(Y,{open:y!==null,onOpenChange:(t)=>{if(!t&&!g)k(null)},children:s(Z,{children:[s(te,{children:[e(ne,{children:i(y==="new"?"collection.newCollection":"collection.rename")}),e(ee,{children:i("collection.collectionName")})]}),s("form",{onSubmit:(t)=>{if(t.preventDefault(),y===null||!L.trim()||g)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;A(m([y==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:q}]),()=>k(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>O(t.target.value),disabled:g}),y!=="new"&&e(gt,{emoji:q,onChange:j}),s(oe,{children:[e(D,{type:"button",variant:"outline",disabled:g,onClick:()=>k(null),children:i("collection.cancel")}),e(D,{type:"submit",disabled:g||!L.trim(),children:i("collection.confirm")})]})]})]})}),e(Y,{open:S!==null,onOpenChange:(t)=>{if(!t&&!g)B(null)},children:s(Z,{children:[s(te,{children:[e(ne,{children:i(S?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ee,{children:i("collection.confirmCollectionChange",{name:S===null?"":se(d[S.id],i)})})]}),s(oe,{children:[e(D,{variant:"outline",disabled:g,onClick:()=>B(null),children:i("collection.cancel")}),e(D,{disabled:g,onClick:()=>{if(S!==null)A(m({type:S.type,id:S.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
2
- export{Js};
@@ -1,2 +0,0 @@
1
- import{Fn}from"./chunk-n8fe2njr.js";import{ji,ne}from"./chunk-t2ej667n.js";import{Vi}from"./chunk-2dnzdsrv.js";function Gi(l,p){return Fn({...ji,parse(s){let e=s;if(!e||typeof e!=="object"||Array.isArray(e)||typeof e.prompt!=="string"||!e.prompt.trim()||Object.keys(e).some((n)=>n!=="prompt"&&n!=="references")||e.references!==void 0&&(!Array.isArray(e.references)||e.references.some((n)=>typeof n!=="string")))throw Error("Invalid image instructions or references");return{prompt:e.prompt,references:e.references}},async execute(s,{sessionId:e,toolCallId:n,signal:a,agent:d}){let t=p(e);if(!t)throw Error("Image request is no longer active");let g=s.references,c=(g??[...t.references.keys()].filter((r)=>r.startsWith("attachment:"))).map((r)=>{let i=t.references.get(r);if(!i)throw Error(`Unknown image reference: ${r}`);return i}),o=ne(t.selection);if(c.length>o.maxReferences)throw Error(`This model supports ${o.maxReferences} references`);let f=Vi(s.prompt,t.aspect),m=o.provider==="chatgpt"?await d.request("_codex/images/generate",{prompt:f,images:c},{cancellationSignal:a}):await l.generateExternal(t.selection,f,c,a);if(a.throwIfAborted(),p(e)!==t)throw Error("Image request was cancelled or replaced");return m.images.forEach((r,i)=>t.references.set(`${String(n)}:${i+1}`,`data:${r.mimeType};base64,${r.data}`)),{content:[{type:"text",text:JSON.stringify({kind:"alwith.image",version:1,model:o.id,size:t.selection.size,displayed:!0,message:"The application already displays these images and provides downloads. Finish with the returned image reference; do not regenerate, echo image data or write files to deliver this result.",references:g??[],images:m.images.map((r,i)=>({reference:`${String(n)}:${i+1}`}))})},...m.images.map((r)=>({type:"image",...r}))]}}})}
2
- export{Gi};
@@ -1,2 +0,0 @@
1
- function Ne(){if(typeof navigator>"u")return!1;let a=navigator.userAgentData?.platform;return/mac/i.test(a??navigator.platform)}function si(a){if(a.shiftKey||a.altKey)return!1;return Ne()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}
2
- export{Ne,si};
@@ -1,2 +0,0 @@
1
- import{be}from"./chunk-vys8kfkp.js";function C(e){return/^app:\/\/([^/?#\s)]+)$/.exec(e)?.[1]??null}function zt(e){if(!e.includes("app://"))return[];let n=be(),r=new Map;return n.walkTokens(n.lexer(e),(i)=>{if(i.type!=="link")return;let p=i,t=C(p.href);if(t!==null)r.set(t,{id:t,name:p.text.replace(/^\$/,"")})}),[...r.values()]}function Pa(e){return[...new Map(e.map((n)=>[n.id,n])).values()].map((n)=>`[$${n.name.replace(/[\\`*_[\]<>]/g,"\\$&")}](app://${n.id})`).join(" ")}function ms(e,n){return[Pa(n),e.trim()].filter(Boolean).join(" ")}function gs(e,n){let r=Pa(n);if(!r)return e;if(e===r)return"";return e.startsWith(`${r} `)?e.slice(r.length+1):e}
2
- export{C,zt,Pa,ms,gs};
@@ -1,2 +0,0 @@
1
- import{p,lo}from"./chunk-g947bnqx.js";import{Hn}from"./chunk-g7dxg38a.js";import{useEffect as P,useRef as u,useState as m}from"react";var Mi="providers:changed",Ni="providers:managed-revoked",i=(e)=>e;function gn(){return{read:()=>i(p.providersRead()),save:(e,r,t)=>i(p.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(p.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(p.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>p.providersTest({providerId:e}),apply:()=>i(p.providersApply()),onChanged:(e)=>lo[Mi].listen((r)=>e(r.payload))}}function ma(){return{bind:(e)=>p.providersAccountBind({account:e}),refresh:(e,r)=>i(p.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await p.providersClearManaged()},onRevoked:(e)=>lo[Ni].listen((r)=>e(r.payload.sessionIds))}}async function fn(e){try{return await e.apply()}catch(r){if(!Hn(r))throw r;return e.read()}}function hn(e,r=console.error){let[t,d]=m(null),a=u(r);return a.current=r,P(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
- export{Mi,Ni,gn,ma,fn,hn};
@@ -1,2 +0,0 @@
1
- import{Ht}from"./chunk-45yrj0e1.js";import{d,Ze}from"./chunk-6cedp3k2.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function Yo(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function ke({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ze(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ze(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Ze(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Ht,{text:Yo(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
- export{Yo,ke};
@@ -1,2 +0,0 @@
1
- import{lr}from"./chunk-88ysxbdh.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function ar(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await lr(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
- export{ar};