@alwith/module-chat 0.6.24 → 0.6.26

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 (480) hide show
  1. package/README.md +26 -34
  2. package/dist/activity-host.js +1 -1
  3. package/dist/agent/client.d.ts +25 -9
  4. package/dist/agent/client.js +1 -1
  5. package/dist/agent/custom-model-effort.js +1 -1
  6. package/dist/agent/fork-title.js +1 -1
  7. package/dist/agent/image-request.js +1 -1
  8. package/dist/agent/image-tools.js +1 -1
  9. package/dist/agent/input-config.js +1 -1
  10. package/dist/agent/input-modes/chat.js +1 -1
  11. package/dist/agent/input-modes/execution-meta.js +1 -1
  12. package/dist/agent/input-modes/image-context.js +1 -1
  13. package/dist/agent/input-modes/image.js +1 -1
  14. package/dist/agent/input-modes/index.js +1 -1
  15. package/dist/agent/project-path.js +1 -1
  16. package/dist/agent/request-error.js +1 -1
  17. package/dist/agent/session-list-refresh.js +1 -1
  18. package/dist/app-reference.js +1 -1
  19. package/dist/application-tools.d.ts +27 -13
  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-n0q8e6sq.js → chunk-0bv3tw1m.js} +2 -2
  28. package/dist/{chunk-qvw0kyse.js → chunk-0e5dx357.js} +2 -2
  29. package/dist/{chunk-6cjjwry2.js → chunk-0enb3f4n.js} +2 -2
  30. package/dist/{chunk-t3m57q06.js → chunk-0jg7hgp5.js} +2 -2
  31. package/dist/{chunk-m6080rsp.js → chunk-0m4s668v.js} +2 -2
  32. package/dist/{chunk-7a70nd7e.js → chunk-16dyzkha.js} +2 -2
  33. package/dist/{chunk-g751pxzk.js → chunk-18kdsdmy.js} +2 -2
  34. package/dist/{chunk-ck2ax5f6.js → chunk-1gr60c40.js} +2 -2
  35. package/dist/{chunk-az3g3a94.js → chunk-1wr1ef9x.js} +2 -2
  36. package/dist/chunk-24y0mvqf.js +2 -0
  37. package/dist/chunk-2bbdgf43.js +2 -0
  38. package/dist/chunk-2f8s5gtn.js +2 -0
  39. package/dist/{chunk-znagg8v9.js → chunk-2yvj9k42.js} +2 -2
  40. package/dist/{chunk-7wpcdwan.js → chunk-30nre2gw.js} +2 -2
  41. package/dist/chunk-317w17va.js +2 -0
  42. package/dist/{chunk-mtn6vdf8.js → chunk-3hsft68c.js} +2 -2
  43. package/dist/{chunk-rqa21qrv.js → chunk-3nawfa7b.js} +2 -2
  44. package/dist/{chunk-dxsjz3re.js → chunk-3q8vw3wb.js} +2 -2
  45. package/dist/{chunk-a6ysp1fp.js → chunk-3qedn07q.js} +2 -2
  46. package/dist/{chunk-jg4c3zg4.js → chunk-3tvq6xr2.js} +2 -2
  47. package/dist/{chunk-h8r785ne.js → chunk-3z86hy2s.js} +2 -2
  48. package/dist/{chunk-1pb43y89.js → chunk-4a4awnss.js} +2 -2
  49. package/dist/{chunk-jydhbkm8.js → chunk-4d9sajzj.js} +2 -2
  50. package/dist/{chunk-8h4e3654.js → chunk-4g1s7gdh.js} +2 -2
  51. package/dist/{chunk-v581r9vt.js → chunk-4sfxcw58.js} +3 -3
  52. package/dist/{chunk-542c9tpr.js → chunk-4vayk46h.js} +2 -2
  53. package/dist/chunk-51xk5tw2.js +2 -0
  54. package/dist/{chunk-ymgc4317.js → chunk-52wrk1mh.js} +2 -2
  55. package/dist/chunk-53r6pr16.js +2 -0
  56. package/dist/{chunk-s05ftq29.js → chunk-55m88zbv.js} +2 -2
  57. package/dist/{chunk-79ayc6qy.js → chunk-5bhp61sd.js} +2 -2
  58. package/dist/chunk-5mjs63fv.js +2 -0
  59. package/dist/chunk-5x5n3b15.js +2 -0
  60. package/dist/{chunk-5xe89qwh.js → chunk-64apxzn7.js} +2 -2
  61. package/dist/{chunk-z8sheg2r.js → chunk-64cbt3ym.js} +2 -2
  62. package/dist/{chunk-bane0xc8.js → chunk-6e84zbgs.js} +2 -2
  63. package/dist/chunk-6ym1a5wa.js +2 -0
  64. package/dist/{chunk-7wd0kfqr.js → chunk-747qe35q.js} +2 -2
  65. package/dist/{chunk-11vn501z.js → chunk-75dr7tyz.js} +2 -2
  66. package/dist/{chunk-73541c5k.js → chunk-7ng6qs9c.js} +2 -2
  67. package/dist/{chunk-1e83qr49.js → chunk-7rtwekkz.js} +2 -2
  68. package/dist/{chunk-mfn37eme.js → chunk-7s7cevjh.js} +2 -2
  69. package/dist/{chunk-r7paw6ba.js → chunk-7tw7rn0m.js} +2 -2
  70. package/dist/chunk-7zww33h8.js +2 -0
  71. package/dist/chunk-81838qem.js +2 -0
  72. package/dist/chunk-84ncszbf.js +2 -0
  73. package/dist/{chunk-gec6q1jb.js → chunk-84p483n0.js} +2 -2
  74. package/dist/{chunk-kk9dbwd1.js → chunk-84zzf0ys.js} +2 -2
  75. package/dist/{chunk-8ew2e3y7.js → chunk-88ysxbdh.js} +2 -2
  76. package/dist/chunk-8gt8yn8k.js +4 -0
  77. package/dist/{chunk-zm6b6zyr.js → chunk-8wk3e4z7.js} +2 -2
  78. package/dist/chunk-94m77zyn.js +2 -0
  79. package/dist/{chunk-vx6shb4g.js → chunk-95ywdfe0.js} +2 -2
  80. package/dist/chunk-9nbkggqn.js +2 -0
  81. package/dist/chunk-9neb2f30.js +2 -0
  82. package/dist/chunk-9wc4emwt.js +2 -0
  83. package/dist/chunk-a11wvd8e.js +2 -0
  84. package/dist/chunk-acf4sdp7.js +2 -0
  85. package/dist/{chunk-0ne2mz2q.js → chunk-ag2t01q7.js} +3 -3
  86. package/dist/chunk-aht6f6tf.js +2 -0
  87. package/dist/chunk-amf0m4tb.js +2 -0
  88. package/dist/chunk-ax7c2kam.js +2 -0
  89. package/dist/{chunk-zwyd2bhy.js → chunk-axvjn527.js} +2 -2
  90. package/dist/{chunk-mc40zb3c.js → chunk-b2n5sj31.js} +2 -2
  91. package/dist/chunk-bapn03er.js +2 -0
  92. package/dist/{chunk-jw1c8r97.js → chunk-bbrx6m7n.js} +2 -2
  93. package/dist/{chunk-x621s275.js → chunk-bf7sgpzq.js} +2 -2
  94. package/dist/{chunk-81hv0s07.js → chunk-bgnxw313.js} +2 -2
  95. package/dist/{chunk-rff6c87z.js → chunk-brv52tgj.js} +2 -2
  96. package/dist/chunk-bztkz3dz.js +2 -0
  97. package/dist/{chunk-6tvq472s.js → chunk-bzzx1y15.js} +2 -2
  98. package/dist/{chunk-wf7kfk3p.js → chunk-c13rnm7b.js} +2 -2
  99. package/dist/{chunk-dypeezvv.js → chunk-c22xq7a3.js} +3 -3
  100. package/dist/{chunk-4fmn1kk4.js → chunk-c7qzvt21.js} +3 -3
  101. package/dist/chunk-cans04tz.js +3 -0
  102. package/dist/{chunk-geh3wyxw.js → chunk-cgnzqmqd.js} +2 -2
  103. package/dist/chunk-chn1mkv0.js +2 -0
  104. package/dist/{chunk-qdyyvd2w.js → chunk-cp4wxmh5.js} +2 -2
  105. package/dist/chunk-cv0qbty5.js +3 -0
  106. package/dist/{chunk-zzqbe5r0.js → chunk-d582db8v.js} +2 -2
  107. package/dist/{chunk-2cc8d35c.js → chunk-d71nz1je.js} +2 -2
  108. package/dist/{chunk-5pmr5dby.js → chunk-dd9k5bbt.js} +2 -2
  109. package/dist/{chunk-ffs5nkt0.js → chunk-dheg4bs2.js} +2 -2
  110. package/dist/{chunk-tknyjndw.js → chunk-dx5hh359.js} +3 -3
  111. package/dist/{chunk-zz582m73.js → chunk-dxwbgg69.js} +2 -2
  112. package/dist/{chunk-gak8579e.js → chunk-e00dz09f.js} +2 -2
  113. package/dist/chunk-e1fzfaqj.js +2 -0
  114. package/dist/{chunk-x4enakra.js → chunk-e3nccytb.js} +1 -1
  115. package/dist/{chunk-qxssxzws.js → chunk-e9nvbe3j.js} +2 -2
  116. package/dist/{chunk-mgmv8kap.js → chunk-ermc9p1p.js} +2 -2
  117. package/dist/{chunk-xadfbbwt.js → chunk-erp1g3as.js} +2 -2
  118. package/dist/{chunk-nh56sb8e.js → chunk-etvdqkvb.js} +2 -2
  119. package/dist/{chunk-zsrjzx7g.js → chunk-exrd2xzz.js} +2 -2
  120. package/dist/{chunk-mbsmb8jn.js → chunk-eynwjzqp.js} +2 -2
  121. package/dist/chunk-fnm2xznx.js +2 -0
  122. package/dist/{chunk-rb4p3h5b.js → chunk-ftsnryz8.js} +2 -2
  123. package/dist/{chunk-4ntxjy8v.js → chunk-fwb6tf7m.js} +2 -2
  124. package/dist/{chunk-0xshzqb6.js → chunk-fwghjmd1.js} +2 -2
  125. package/dist/chunk-g1tbd3pd.js +2 -0
  126. package/dist/{chunk-5kje89r8.js → chunk-g3y0r56h.js} +2 -2
  127. package/dist/{chunk-ym6jphs4.js → chunk-gbsn1qep.js} +3 -3
  128. package/dist/{chunk-5d138vq3.js → chunk-gdtpwbqn.js} +1 -1
  129. package/dist/{chunk-wsyfhh7y.js → chunk-gjtxked2.js} +2 -2
  130. package/dist/{chunk-js3nhatr.js → chunk-gpv1dc5y.js} +2 -2
  131. package/dist/{chunk-d5gt1x0n.js → chunk-grfrfh7s.js} +2 -2
  132. package/dist/chunk-h1kvdf3t.js +2 -0
  133. package/dist/{chunk-mdercwm8.js → chunk-h3mwzf3d.js} +3 -3
  134. package/dist/{chunk-4h9ee02f.js → chunk-h5mdgrq6.js} +2 -2
  135. package/dist/{chunk-bdrcreqs.js → chunk-ha9n1k24.js} +2 -2
  136. package/dist/chunk-hd11bfmp.js +2 -0
  137. package/dist/{chunk-tyka859b.js → chunk-hf5bpahd.js} +2 -2
  138. package/dist/{chunk-wyxa2tfm.js → chunk-j2ffde9c.js} +5 -5
  139. package/dist/{chunk-fe83mqnb.js → chunk-j4w2hbbe.js} +2 -2
  140. package/dist/chunk-j62heyzq.js +2 -0
  141. package/dist/{chunk-h0k80cxs.js → chunk-j8zpjnf8.js} +2 -2
  142. package/dist/{chunk-q7ka46hb.js → chunk-jdwd4ta9.js} +3 -3
  143. package/dist/{chunk-ww3f6z4x.js → chunk-je27hf3t.js} +3 -3
  144. package/dist/{chunk-q01vmp9m.js → chunk-jgqt7k0h.js} +2 -2
  145. package/dist/{chunk-csbv8m51.js → chunk-jmc7ddz8.js} +3 -3
  146. package/dist/{chunk-jcyv1q0x.js → chunk-jp4xjks0.js} +2 -2
  147. package/dist/{chunk-nypr6qtz.js → chunk-jvy6p83k.js} +3 -3
  148. package/dist/chunk-k2nbrerw.js +2 -0
  149. package/dist/{chunk-kj3a1k2q.js → chunk-k5nd3vyq.js} +2 -2
  150. package/dist/chunk-knrc6kks.js +2 -0
  151. package/dist/chunk-kqwfwck2.js +2 -0
  152. package/dist/{chunk-vsh9vh4s.js → chunk-m2n6sxf8.js} +2 -2
  153. package/dist/{chunk-3z5zyra7.js → chunk-m68t534g.js} +2 -2
  154. package/dist/{chunk-w4bye56s.js → chunk-ma6ycen5.js} +2 -2
  155. package/dist/{chunk-hcat58sr.js → chunk-masqfje4.js} +2 -2
  156. package/dist/chunk-mckz9qv5.js +2 -0
  157. package/dist/{chunk-79pvfyd0.js → chunk-mfmh7ztq.js} +2 -2
  158. package/dist/{chunk-d6ke5e80.js → chunk-n4wp3h3j.js} +2 -2
  159. package/dist/{chunk-6r5nzsw8.js → chunk-ncgwbdmj.js} +2 -2
  160. package/dist/{chunk-8v53bkyr.js → chunk-ne4b53kn.js} +2 -2
  161. package/dist/chunk-njqan8zg.js +2 -0
  162. package/dist/{chunk-heqa4swe.js → chunk-nqt9gyz9.js} +2 -2
  163. package/dist/{chunk-sjqhtpzr.js → chunk-nrpgmawz.js} +2 -2
  164. package/dist/{chunk-m9ttf96p.js → chunk-p3gawvqr.js} +2 -2
  165. package/dist/{chunk-et2pdaz7.js → chunk-p96vgnxw.js} +2 -2
  166. package/dist/{chunk-84eye2j0.js → chunk-pebkk426.js} +2 -2
  167. package/dist/chunk-pg9gckmw.js +2 -0
  168. package/dist/{chunk-e04g26qm.js → chunk-pqz2471h.js} +2 -2
  169. package/dist/chunk-ps408sxd.js +2 -0
  170. package/dist/{chunk-j3g21ext.js → chunk-pxr5snwm.js} +2 -2
  171. package/dist/{chunk-2fx3qhyb.js → chunk-q3s59jyn.js} +2 -2
  172. package/dist/{chunk-w2xjhfm2.js → chunk-qa9p0a64.js} +3 -3
  173. package/dist/{chunk-7v7wc7k5.js → chunk-qceex4vv.js} +2 -2
  174. package/dist/chunk-qkn0y5wx.js +2 -0
  175. package/dist/{chunk-76smt4zv.js → chunk-qzerhkyb.js} +3 -3
  176. package/dist/chunk-qzn6qtmy.js +2 -0
  177. package/dist/{chunk-q4nx04sy.js → chunk-r5f77gtx.js} +2 -2
  178. package/dist/{chunk-rzxnxj25.js → chunk-rkwq0grt.js} +2 -2
  179. package/dist/{chunk-qghq84r4.js → chunk-rn54592t.js} +2 -2
  180. package/dist/chunk-rv3k0kfr.js +2 -0
  181. package/dist/chunk-s1nfyggb.js +2 -0
  182. package/dist/chunk-s8cj6aw6.js +2 -0
  183. package/dist/{chunk-76c0cx40.js → chunk-sjm9p42x.js} +2 -2
  184. package/dist/chunk-stv8pr4v.js +2 -0
  185. package/dist/{chunk-m8tt5bf9.js → chunk-swqbbw8q.js} +2 -2
  186. package/dist/{chunk-stc4ctrx.js → chunk-syjt7y4v.js} +2 -2
  187. package/dist/chunk-t9t53gsj.js +3 -0
  188. package/dist/{chunk-xk0dt0es.js → chunk-tgnftxyb.js} +2 -2
  189. package/dist/{chunk-nhstvqjy.js → chunk-tr0bmqn9.js} +2 -2
  190. package/dist/{chunk-t686zwxk.js → chunk-v0wmy9b3.js} +2 -2
  191. package/dist/{chunk-vkj5fznh.js → chunk-v2pa8yak.js} +3 -3
  192. package/dist/{chunk-tctdn4kk.js → chunk-v32jvbgx.js} +2 -2
  193. package/dist/{chunk-6vdayg6w.js → chunk-v96vkrw2.js} +2 -2
  194. package/dist/{chunk-qv23mh24.js → chunk-v9weanq6.js} +2 -2
  195. package/dist/chunk-vd6eqshg.js +2 -0
  196. package/dist/{chunk-9ts08sma.js → chunk-vdt7cp6c.js} +2 -2
  197. package/dist/{chunk-wz6765xb.js → chunk-vev9q4t4.js} +3 -3
  198. package/dist/{chunk-whzs7yxf.js → chunk-vmfhnkxj.js} +2 -2
  199. package/dist/{chunk-7s3f142h.js → chunk-vqby71fp.js} +2 -2
  200. package/dist/chunk-vzgn8exd.js +2 -0
  201. package/dist/{chunk-e5m9kg1w.js → chunk-w562jf57.js} +2 -2
  202. package/dist/chunk-w5q2ygsa.js +2 -0
  203. package/dist/{chunk-bcnh0z8e.js → chunk-w5zvy4ex.js} +2 -2
  204. package/dist/{chunk-50eym2q3.js → chunk-wde0m4pf.js} +3 -3
  205. package/dist/{chunk-xdcp8tj9.js → chunk-why9g2kd.js} +2 -2
  206. package/dist/{chunk-whb8ttdy.js → chunk-wpacvdsv.js} +2 -2
  207. package/dist/{chunk-kbfe7gqw.js → chunk-x49qjrbk.js} +2 -2
  208. package/dist/{chunk-4r0ffb0s.js → chunk-xe7ep70k.js} +2 -2
  209. package/dist/{chunk-8mzbkjhk.js → chunk-xnbvdqnt.js} +2 -2
  210. package/dist/{chunk-e641842r.js → chunk-xqb4thy8.js} +2 -2
  211. package/dist/{chunk-2sc2z6g5.js → chunk-xwwjj45a.js} +2 -2
  212. package/dist/{chunk-2qs1ss40.js → chunk-y3mx5sf0.js} +2 -2
  213. package/dist/chunk-y4tj08c1.js +2 -0
  214. package/dist/chunk-y8gz9rsc.js +2 -0
  215. package/dist/{chunk-bfb8bpwc.js → chunk-y8yawx3d.js} +2 -2
  216. package/dist/{chunk-3a5sn0v8.js → chunk-ypdh88cj.js} +2 -2
  217. package/dist/{chunk-pnh5t6pc.js → chunk-yryg27yy.js} +2 -2
  218. package/dist/{chunk-1rwkdezk.js → chunk-z6dx6dnt.js} +2 -2
  219. package/dist/{chunk-859359n0.js → chunk-z6x70w62.js} +2 -2
  220. package/dist/chunk-zft4afb8.js +2 -0
  221. package/dist/chunk-zm0j9nw3.js +2 -0
  222. package/dist/{chunk-vbbndjfd.js → chunk-zv3bm3np.js} +2 -2
  223. package/dist/{chunk-3zae491f.js → chunk-zw4ehzza.js} +3 -3
  224. package/dist/{chunk-wwj743gm.js → chunk-zyn0ys4m.js} +2 -2
  225. package/dist/{chunk-6w8p1hwb.js → chunk-zypgrbd9.js} +2 -2
  226. package/dist/chunk-zzz6kmh8.js +2 -0
  227. package/dist/client.d.ts +2 -3
  228. package/dist/client.js +1 -1
  229. package/dist/codex/activity-group.js +1 -1
  230. package/dist/codex/artifact-links.js +1 -1
  231. package/dist/codex/assistant-message.js +1 -1
  232. package/dist/codex/async-question-card.js +1 -1
  233. package/dist/codex/edited-files-card.js +1 -1
  234. package/dist/codex/image-view-activity.js +1 -1
  235. package/dist/codex/markdown-renderer.js +1 -1
  236. package/dist/codex/navigation-audio.js +1 -1
  237. package/dist/codex/navigation-preview.js +1 -1
  238. package/dist/codex/navigation-rail.js +1 -1
  239. package/dist/codex/patch-view.js +1 -1
  240. package/dist/codex/plan.js +1 -1
  241. package/dist/codex/timeline-virtualizer.js +1 -1
  242. package/dist/codex/turn-activity.js +1 -1
  243. package/dist/codex/user-message.js +1 -1
  244. package/dist/codex/virtualized-turn-list.js +1 -1
  245. package/dist/collections/collection-emoji.js +1 -1
  246. package/dist/collections/collection-menu.js +1 -1
  247. package/dist/collections/collection-panel.js +1 -1
  248. package/dist/collections/collections.js +1 -1
  249. package/dist/collections/host.js +1 -1
  250. package/dist/collections/locales.js +1 -1
  251. package/dist/collections/model.js +1 -1
  252. package/dist/collections/store.js +1 -1
  253. package/dist/composer/completion-filter.js +1 -1
  254. package/dist/composer/completion-menu.js +1 -1
  255. package/dist/composer/completion-trigger.js +1 -1
  256. package/dist/composer/effort-slider.js +1 -1
  257. package/dist/composer/inline-document.js +1 -1
  258. package/dist/composer/inline-dom.js +1 -1
  259. package/dist/composer/menu-radio.js +1 -1
  260. package/dist/composer/model-select.js +1 -1
  261. package/dist/composer/permission-mode-select.js +1 -1
  262. package/dist/composer/prompt-input-attachments.js +1 -1
  263. package/dist/composer/prompt-input-clipboard.js +1 -1
  264. package/dist/composer/prompt-input-context.js +1 -1
  265. package/dist/composer/prompt-input-inline.js +1 -1
  266. package/dist/composer/prompt-input-textarea.js +1 -1
  267. package/dist/composer/prompt-input.js +1 -1
  268. package/dist/conversation/action-card.js +1 -1
  269. package/dist/conversation/composer/app-mentions.js +1 -1
  270. package/dist/conversation/composer/apps-menu.js +1 -1
  271. package/dist/conversation/composer/composer-menu.js +1 -1
  272. package/dist/conversation/composer/composer.js +1 -1
  273. package/dist/conversation/composer/config-options.js +1 -1
  274. package/dist/conversation/composer/context.js +1 -1
  275. package/dist/conversation/composer/drafts.js +1 -1
  276. package/dist/conversation/composer/file-items.js +1 -1
  277. package/dist/conversation/composer/long-text.js +1 -1
  278. package/dist/conversation/composer/mention-chips.js +1 -1
  279. package/dist/conversation/composer/mention-uri.js +1 -1
  280. package/dist/conversation/composer/model-menu.js +1 -1
  281. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  282. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  283. package/dist/conversation/composer/prediction.js +1 -1
  284. package/dist/conversation/composer/prompt-history.js +1 -1
  285. package/dist/conversation/composer/slash-command-button.js +1 -1
  286. package/dist/conversation/composer/submit-button.js +1 -1
  287. package/dist/conversation/composer/usage-meter.js +1 -1
  288. package/dist/conversation/connection-notice.js +1 -1
  289. package/dist/conversation/context.js +1 -1
  290. package/dist/conversation/conversation-body.js +1 -1
  291. package/dist/conversation/conversation-search.js +1 -1
  292. package/dist/conversation/conversation-view.js +1 -1
  293. package/dist/conversation/conversation.js +1 -1
  294. package/dist/conversation/diff-modal.js +1 -1
  295. package/dist/conversation/draft-project-picker.js +1 -1
  296. package/dist/conversation/session-actions.js +1 -1
  297. package/dist/conversation/subagent-sessions.js +1 -1
  298. package/dist/conversation/subagent-tasks.js +1 -1
  299. package/dist/desktop/desktop-composer.js +1 -1
  300. package/dist/desktop/desktop.js +1 -1
  301. package/dist/desktop/draft-model-select.js +1 -1
  302. package/dist/desktop/load-image.js +1 -1
  303. package/dist/desktop/model-catalog.js +1 -1
  304. package/dist/desktop/model-recovery.js +1 -1
  305. package/dist/desktop/model-settings-action.js +1 -1
  306. package/dist/desktop/native-file-drop.js +1 -1
  307. package/dist/generated/commands.js +1 -1
  308. package/dist/image-lightbox.js +1 -1
  309. package/dist/image-preview-dialog.js +1 -1
  310. package/dist/image.d.ts +20 -21
  311. package/dist/image.js +1 -1
  312. package/dist/lib/app-reference.js +1 -1
  313. package/dist/lib/application-metadata.js +1 -1
  314. package/dist/lib/chat-path.js +1 -1
  315. package/dist/lib/code-highlighter.js +1 -1
  316. package/dist/lib/file-url.js +1 -1
  317. package/dist/lib/fuzzy.js +1 -1
  318. package/dist/lib/group-blocks.js +1 -1
  319. package/dist/lib/image-encode.js +1 -1
  320. package/dist/lib/limits.js +1 -1
  321. package/dist/lib/markdown-parser.js +1 -1
  322. package/dist/lib/markdown-rules.js +1 -1
  323. package/dist/lib/model-name.js +1 -1
  324. package/dist/lib/prepare-prompt-files.js +1 -1
  325. package/dist/lib/reference-presentation.js +1 -1
  326. package/dist/lib/stream-style.js +1 -1
  327. package/dist/lib/streaming-markdown.js +1 -1
  328. package/dist/lib/tool-artifacts.js +1 -1
  329. package/dist/locales.js +1 -1
  330. package/dist/mermaid/diagram.js +1 -1
  331. package/dist/mermaid/export.js +1 -1
  332. package/dist/mermaid/index.js +1 -1
  333. package/dist/mermaid/preview.js +1 -1
  334. package/dist/oauth/claude-login.js +1 -1
  335. package/dist/oauth.js +1 -1
  336. package/dist/plugins/catalog-header.js +1 -1
  337. package/dist/plugins/catalog-skeleton.js +1 -1
  338. package/dist/plugins/host.js +1 -1
  339. package/dist/plugins/new-chat-directory.js +1 -1
  340. package/dist/plugins/panel-item.js +1 -1
  341. package/dist/plugins/plugin-detail-page.js +1 -1
  342. package/dist/plugins/plugin-icon.js +1 -1
  343. package/dist/plugins/plugin-icons.js +1 -1
  344. package/dist/plugins/plugins-page.js +1 -1
  345. package/dist/plugins/plugins.js +1 -1
  346. package/dist/plugins/read-skill-document.js +1 -1
  347. package/dist/plugins/skill-document.js +1 -1
  348. package/dist/plugins/skills-tab.js +1 -1
  349. package/dist/plugins/store.js +1 -1
  350. package/dist/plugins/toolbox-layout.js +1 -1
  351. package/dist/reference-projection.js +1 -1
  352. package/dist/search/chat-search.js +1 -1
  353. package/dist/search/codex-source-matches.js +1 -1
  354. package/dist/search/dom-matches.js +1 -1
  355. package/dist/search/find-bar.js +1 -1
  356. package/dist/search/literal-matches.js +1 -1
  357. package/dist/session-list/account-menu.js +1 -1
  358. package/dist/session-list/activity-list.js +1 -1
  359. package/dist/session-list/archived-sessions.js +1 -1
  360. package/dist/session-list/help-menu.js +1 -1
  361. package/dist/session-list/highlight.js +1 -1
  362. package/dist/session-list/host.js +1 -1
  363. package/dist/session-list/hover-info-card.js +1 -1
  364. package/dist/session-list/locales.js +1 -1
  365. package/dist/session-list/navigation-controls.js +1 -1
  366. package/dist/session-list/navigation-header.js +1 -1
  367. package/dist/session-list/navigation-store.js +1 -1
  368. package/dist/session-list/navigation-tabs.js +1 -1
  369. package/dist/session-list/navigation.js +1 -1
  370. package/dist/session-list/platform.js +1 -1
  371. package/dist/session-list/row-stop-button.js +1 -1
  372. package/dist/session-list/session-groups.js +1 -1
  373. package/dist/session-list/session-info-card.js +1 -1
  374. package/dist/session-list/session-list.js +1 -1
  375. package/dist/session-list/session-row.js +1 -1
  376. package/dist/session-list/session-state-dot.js +1 -1
  377. package/dist/session-list/session-state-menu.js +1 -1
  378. package/dist/session-list/shortcut-hint.js +1 -1
  379. package/dist/session-list/shortcut.js +1 -1
  380. package/dist/session-list/sidebar-overlay.js +1 -1
  381. package/dist/session-list/trailing-swap.js +1 -1
  382. package/dist/session-list/use-activity-notification.js +1 -1
  383. package/dist/session-list/use-activity-preview.js +1 -1
  384. package/dist/session-list/use-cmd-held.js +1 -1
  385. package/dist/session-list/use-project-sessions.js +1 -1
  386. package/dist/session-list/virtual-session-rows.js +1 -1
  387. package/dist/session-timeline/activity-group.js +1 -1
  388. package/dist/session-timeline/activity-projection.js +1 -1
  389. package/dist/session-timeline/assistant-content.js +1 -1
  390. package/dist/session-timeline/assistant-image-references.js +1 -1
  391. package/dist/session-timeline/assistant-turn.js +1 -1
  392. package/dist/session-timeline/async-questions.js +1 -1
  393. package/dist/session-timeline/edited-files-card.js +1 -1
  394. package/dist/session-timeline/history-timeline.js +1 -1
  395. package/dist/session-timeline/host.js +1 -1
  396. package/dist/session-timeline/image-generation-progress.js +1 -1
  397. package/dist/session-timeline/navigation-rail.js +1 -1
  398. package/dist/session-timeline/plan.js +1 -1
  399. package/dist/session-timeline/question-reply.js +1 -1
  400. package/dist/session-timeline/resource-content.js +1 -1
  401. package/dist/session-timeline/session-timeline.js +1 -1
  402. package/dist/session-timeline/timeline-registry.js +1 -1
  403. package/dist/session-timeline/turn-activity.js +1 -1
  404. package/dist/session-timeline/turn-error.js +1 -1
  405. package/dist/session-timeline/turn-retry.js +1 -1
  406. package/dist/session-timeline/turn-time.js +1 -1
  407. package/dist/session-timeline/turns.js +1 -1
  408. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  409. package/dist/session-timeline/user-message.js +1 -1
  410. package/dist/settings/codex-account-card.js +1 -1
  411. package/dist/settings/login-card.js +1 -1
  412. package/dist/settings/model-alias-settings.js +1 -1
  413. package/dist/settings/model-aliases.js +1 -1
  414. package/dist/settings/provider-logos.js +1 -1
  415. package/dist/settings/provider-section.js +1 -1
  416. package/dist/settings/providers-port.js +1 -1
  417. package/dist/settings/providers.js +1 -1
  418. package/dist/settings/settings-bridge.js +1 -1
  419. package/dist/settings/settings.js +1 -1
  420. package/native/win32-x64/alwith_native_chat.dll +0 -0
  421. package/native/win32-x64/artifact.json +1 -1
  422. package/package.json +4 -3
  423. package/dist/agent/application-client.d.ts +0 -30
  424. package/dist/agent/application-client.js +0 -1
  425. package/dist/chunk-0myf2ak0.js +0 -2
  426. package/dist/chunk-1smyy9mt.js +0 -2
  427. package/dist/chunk-2q1xxs3t.js +0 -2
  428. package/dist/chunk-36ttr22w.js +0 -2
  429. package/dist/chunk-3mm1d99e.js +0 -2
  430. package/dist/chunk-3qwtda21.js +0 -3
  431. package/dist/chunk-4gxpna3p.js +0 -2
  432. package/dist/chunk-5ryfm4ka.js +0 -4
  433. package/dist/chunk-7cab9zy0.js +0 -2
  434. package/dist/chunk-7xvrsw7x.js +0 -2
  435. package/dist/chunk-9hjfc08t.js +0 -2
  436. package/dist/chunk-a8r3mggj.js +0 -2
  437. package/dist/chunk-a9grdyep.js +0 -3
  438. package/dist/chunk-ayt0bzr9.js +0 -2
  439. package/dist/chunk-b42vv8f2.js +0 -2
  440. package/dist/chunk-b61qhh61.js +0 -2
  441. package/dist/chunk-bgav9cq2.js +0 -2
  442. package/dist/chunk-bh0h7fz7.js +0 -2
  443. package/dist/chunk-bshgrwe9.js +0 -2
  444. package/dist/chunk-bsnmj69j.js +0 -2
  445. package/dist/chunk-capkej8s.js +0 -2
  446. package/dist/chunk-cer4dxas.js +0 -2
  447. package/dist/chunk-cq7bbgcg.js +0 -2
  448. package/dist/chunk-d29xbf16.js +0 -2
  449. package/dist/chunk-dp1nnwk2.js +0 -2
  450. package/dist/chunk-dpfjxym1.js +0 -2
  451. package/dist/chunk-eqbp85f3.js +0 -2
  452. package/dist/chunk-f9z37ptq.js +0 -2
  453. package/dist/chunk-fn68kh69.js +0 -2
  454. package/dist/chunk-gkyvgjyx.js +0 -2
  455. package/dist/chunk-gpcsb4tg.js +0 -3
  456. package/dist/chunk-j2cdjycf.js +0 -2
  457. package/dist/chunk-jjgwfpmp.js +0 -2
  458. package/dist/chunk-mcrd86tx.js +0 -2
  459. package/dist/chunk-n9jaz2pd.js +0 -2
  460. package/dist/chunk-nbaxn7jx.js +0 -2
  461. package/dist/chunk-nvgnan7w.js +0 -2
  462. package/dist/chunk-p1tcxky2.js +0 -2
  463. package/dist/chunk-p811gdar.js +0 -2
  464. package/dist/chunk-p8cm3xw1.js +0 -2
  465. package/dist/chunk-pr36m3qx.js +0 -2
  466. package/dist/chunk-q73jne25.js +0 -2
  467. package/dist/chunk-qm2jq2bq.js +0 -2
  468. package/dist/chunk-qwet39v5.js +0 -2
  469. package/dist/chunk-r3hsjwjn.js +0 -2
  470. package/dist/chunk-rg8kj085.js +0 -2
  471. package/dist/chunk-s2k0g1hc.js +0 -2
  472. package/dist/chunk-s3j71dbh.js +0 -2
  473. package/dist/chunk-sdv06e2k.js +0 -2
  474. package/dist/chunk-sgbn37kz.js +0 -2
  475. package/dist/chunk-tfj6v7y4.js +0 -2
  476. package/dist/chunk-tsdb5jnj.js +0 -2
  477. package/dist/chunk-v3dq3hx2.js +0 -2
  478. package/dist/chunk-xk306vq1.js +0 -2
  479. package/dist/chunk-ymk7ampx.js +0 -2
  480. package/dist/chunk-zpqj0ka8.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{O}from"./chunk-c13rnm7b.js";import{ye}from"./chunk-swqbbw8q.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(O,{text:t.content,streaming:!1})});if(!n(t))return null;return e(ye,{entries:t.entries})}
2
+ export{os};
@@ -1,2 +1,2 @@
1
- var I={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
- export{I};
1
+ var T={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
+ export{T};
@@ -0,0 +1,2 @@
1
+ import{M}from"./chunk-pxv38ttf.js";import{n}from"./chunk-y8gz9rsc.js";import{At}from"./chunk-fnm2xznx.js";import{x,ee}from"./chunk-w5q2ygsa.js";import{e}from"./chunk-acf4sdp7.js";import{no}from"./chunk-6e84zbgs.js";import{ChevronDownIcon as A,ChevronRightIcon as G,GitBranchIcon as X,Loader2Icon as F,SquareIcon as Y}from"lucide-react";import{useCallback as Z,useEffect as ss,useId as J,useRef as L,useState as N}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as p,Fragment as ns}from"react/jsx-runtime";function to(s,l){let d=n((u)=>u.sessions),r=n((u)=>u.actions),[S,m]=N(()=>new Set);return(u)=>{let c=l?.(u)??null,i=no(s.id,u,d,r,s);if(i.length===0)return c;let h=`${s.id}:${u.key}`;return{active:c?.active===!0||i.some((o)=>o.status==="running"||o.status==="requires_action"),defaultExpanded:c?.defaultExpanded===!0||S.has(h),content:p(ns,{children:[t(Ci,{sessionId:s.id,turn:u,parent:s,tasks:i,onExpand:()=>m((o)=>o.has(h)?o:new Set([...o,h]))}),c?.content]})}}}function Ci({sessionId:s,turn:l,parent:d,tasks:r,onExpand:S}){let{host:m}=e(),u=n((a)=>a.sessions),c=n((a)=>a.actions),i=r??no(s,l,u,c,d),h=i.some((a)=>a.status==="running"),o=i.some((a)=>a.status==="running"||a.status==="requires_action"),[f,k]=M(`subagents:${s}:${l.key}`,o,!0),w=J();if(i.length===0)return null;let g=new Map;for(let a of i)g.set(a.status,(g.get(a.status)??0)+1);let v=[...g].map(([a,E])=>`${m.t(`subagents.${a}`)} ${E}`).join(" · ");return p("section",{"data-subagent-sessions":!0,"data-subagent-turn":l.key,"aria-label":m.t("subagents.group"),className:"my-2 min-w-0",children:[p(C,{variant:"ghost",size:"sm",className:"text-muted-foreground h-auto min-h-8 max-w-full justify-start gap-2 text-xs","aria-expanded":f,"aria-controls":w,onClick:()=>{if(!f)S?.();k(!f)},children:[f?t(A,{className:"size-3.5 shrink-0"}):t(G,{className:"size-3.5 shrink-0"}),h?t(F,{className:"size-3.5 shrink-0 motion-safe:animate-spin","aria-hidden":"true"}):t(X,{className:"size-3.5 shrink-0"}),p("span",{className:"shrink-0",children:[m.t("subagents.group")," · ",i.length]}),t("span",{className:"truncate",role:"status",children:v})]}),t("div",{id:w,hidden:!f,className:"border-border ms-3 min-w-0 border-s ps-2",children:i.map((a)=>t(es,{task:a,cwd:d?.cwd??u[s]?.cwd??"",visible:f,stateKey:`${s}:${l.key}:${a.key}`,onRead:()=>{S?.(),k(!0)}},a.key))})]})}function O(s,l){if(!l)return s;let d=new Map(s.items.map((r)=>[`${r.kind}:${r.id}`,r]));for(let r of l.items)d.set(`${r.kind}:${r.id}`,r);return{...s,...l,items:[...d.values()]}}function es({task:s,cwd:l,stateKey:d,visible:r,onRead:S}){let{client:m,host:u}=e(),{t:c}=u,i=s.session,h=n((b)=>b.connection==="ready"),[o,f]=M(`subagent:${d}`,!1),[k,w]=N(!1),[g,v]=N(null),[a,E]=N(null),[I,Q]=N(null),[R,P]=N(!1),B=L(!1),_=L(!1),j=J(),q=i&&x(i.configOptions,"model"),z=s.title??c("subagents.untitled"),W=a?O(a,i):i,U=h&&i?.attached&&i.subagent?.capabilities?.cancel!=null&&(s.status==="running"||s.status==="requires_action"),H=s.threadId,D=i?.cwd??l,T=Z(async(b)=>{if(!m.readSubagentHistory||H===null||B.current)return;_.current=!0,B.current=!0,P(!0),v(null);try{let y=await m.readSubagentHistory(H,D,b);E((K)=>K===null?y.session:O(y.session,K)),Q(y.cursor)}catch(y){v(y instanceof Error?y.message:String(y))}finally{B.current=!1,P(!1)}},[m,H,D]);ss(()=>{if(r&&o&&!_.current)T(null)},[r,o,T]);let V=async()=>{if(!i)throw Error("A live child session is required for cancellation");w(!0),v(null);try{await m.cancel(i.id)}catch(b){v(b instanceof Error?b.message:String(b))}finally{w(!1)}};return p("section",{"aria-label":z,className:"min-w-0",children:[p("div",{className:"flex min-w-0 items-center gap-1",children:[p(C,{variant:"ghost",size:"sm",className:"min-w-0 flex-1 justify-start gap-2","aria-label":`${z} · ${c(`subagents.${s.status}`)}`,"aria-expanded":o,"aria-controls":j,onClick:()=>{if(!o)S();f(!o)},children:[o?t(A,{className:"size-3.5 shrink-0"}):t(G,{className:"size-3.5 shrink-0"}),t("span",{className:"truncate",children:z}),t("span",{className:"text-muted-foreground ms-auto shrink-0 text-xs",role:"status",children:c(`subagents.${s.status}`)})]}),U&&t(C,{variant:"ghost",size:"icon-sm",disabled:k,"aria-label":c("subagents.cancel",{name:z}),onClick:()=>{V()},children:k?t(F,{className:"size-3.5 animate-spin"}):t(Y,{className:"size-3.5"})})]}),g&&!o&&t("p",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:g}),p("div",{id:j,hidden:!o,className:"min-w-0 ps-4",children:[(s.description||q)&&p("div",{className:"text-muted-foreground flex min-w-0 items-center gap-2 px-2 py-1 text-xs",children:[t("span",{className:"min-w-0 flex-1 truncate",title:s.description??void 0,children:s.description}),q&&t("span",{className:"shrink-0",children:ee(q)})]}),g&&p("div",{role:"alert",className:"text-destructive px-2 py-1 text-xs",children:[g," ",s.threadId&&t(C,{variant:"ghost",size:"sm",onClick:()=>{T(a===null?null:I)},children:c("timeline.retry")})]}),R&&t("p",{role:"status",className:"text-muted-foreground px-2 py-2 text-xs",children:c("timeline.loadingEarlier")}),I&&t(C,{variant:"ghost",size:"sm",disabled:R,onClick:()=>{T(I)},children:c("timeline.loadEarlier")}),r&&o&&(W&&W.items.length>0?t("div",{className:"flex max-h-72 min-h-0 flex-col",children:t(ts,{session:W})}):!R&&!g&&t("p",{className:"text-muted-foreground px-2 py-3 text-xs",children:c("subagents.noMessages")}))]})]})}function ts({session:s}){let{client:l,host:d}=e(),r=to(s);return t(At,{session:s,client:l,host:d,turnWork:r})}
2
+ export{to,Ci};
@@ -0,0 +1,2 @@
1
+ import{u}from"./chunk-stv8pr4v.js";import{a,o}from"./chunk-5mjs63fv.js";import{N,v,f,ie}from"./chunk-chn1mkv0.js";import{A,me,hi}from"./chunk-aht6f6tf.js";import{mt}from"./chunk-16dyzkha.js";import{V,re}from"./chunk-e00dz09f.js";import{De,pe}from"./chunk-fwb6tf7m.js";import{closestCorners as ge,DndContext as fe,KeyboardSensor as Ce,PointerSensor as ye,useSensor as Q,useSensors as Se}from"@dnd-kit/core";import{SortableContext as W,sortableKeyboardCoordinates as we,useSortable as le,verticalListSortingStrategy as X}from"@dnd-kit/sortable";import{CSS as se}from"@dnd-kit/utilities";import{cn as j}from"cn";import{BrushCleaningIcon as ve,MessageSquareIcon as Ne,MoreHorizontalIcon as Ie,PencilIcon as he,PlusIcon as ae,StarIcon as be,Trash2Icon as ce}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as L}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 Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as B,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:M}=le({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:se.Transform.toString(m),transition:p},className:j("w-full min-w-0",M&&"opacity-50"),...w,...I,role:"group",children:x})}function Be({collection:l,children:C,onEdit:x,onConfirm:w,onNewChat:I}){let{t:i}=A(),m=pe(),p=me(),{attributes:M,listeners:d,setNodeRef:h,transform:R,transition:P,isDragging:H}=le({id:l.id,disabled:{draggable:l.id===V,droppable:!1},data:{type:"collection"}});return e("div",{ref:h,style:{transform:se.Transform.toString(R),transition:P},className:j("w-full min-w-0",H&&"opacity-50"),children:e(ie,{open:!l.collapsed,onOpenChange:(c)=>p(m({type:"collapse",id:l.id,collapsed:!c})),label:re(l,i),count:l.sessionIds.length,leading:l.id===V?e(be,{className:"size-3.5"}):e(mt,{emoji:l.emoji,onChange:(c)=>p(m({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...M,...d,role:"group",children:c}),actions:s(Ee,{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:re(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:s(Le,{children:[l.id!==V&&s(B,{onClick:x,children:[e(he,{}),i("collection.rename")]}),s(B,{onClick:I,children:[e(ae,{}),i("collection.newChat")]}),s(B,{onClick:()=>w("clear"),children:[e(ve,{}),i("collection.clearCollection")]}),l.id!==V&&s(B,{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=A(),{t:i}=I,m=pe(),p=me(),M=a(),{collections:d,order:h}=De(),R=o((t)=>t.sessionList),P=o((t)=>t.archivedSessions),H=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),G=Me(()=>new Map([...P,...R].map((t)=>[t.sessionId,t])),[P,R]),F=I.isMac??hi(),[y,E]=L(null),[k,z]=L(""),[U,K]=L(""),[S,T]=L(null),[g,_]=L(!1),de=Se(Q(ye,{activationConstraint:{distance:5}}),Q(Ce,{coordinateGetter:we})),O=h.flatMap((t)=>d[t].collapsed?[]:d[t].sessionIds.flatMap((n)=>{let r=G.get(n);return r&&!r.archived?[r]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(F?!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||!O[r])return;n.preventDefault(),C(O[r])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[O,F,C]);let ue=({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 J=b.type==="session"?String(b.collectionId):String(n.id);p(m({type:"move",sourceCollectionId:String(r.collectionId),collectionId:J,sessionId:String(r.sessionId),index:b.type==="session"?d[J].sessionIds.indexOf(String(b.sessionId)):void 0}))}else if(r?.type==="collection"&&b?.type==="collection"&&String(n.id)!==V)p(m({type:"reorder",id:String(t.id),index:h.indexOf(String(n.id))}))},q=(t,n)=>{_(!0),p(t.then(n).finally(()=>_(!1)))};return s(ze,{children:[e(w,{children:s(N,{children:[s(f,{className:j(u,"font-normal"),onClick:()=>{E("new"),z(""),K("")},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(M.listSessions({reset:!0})),children:i("collection.retry")})]}),e(fe,{sensors:de,collisionDetection:ge,onDragEnd:ue,children:e(W,{items:h,strategy:X,children:e(N,{children:h.map((t)=>e(Be,{collection:d[t],onNewChat:()=>x(t),onEdit:()=>{E(t),z(d[t].name),K(d[t].emoji??"")},onConfirm:(n)=>T({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=G.get(n);if(r?.archived)return null;if(!r)return H?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(Ne,{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)E(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||!k.trim()||g)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;q(m([y==="new"?{type:"create",id:n,name:k}:{type:"rename",id:n,name:k},{type:"emoji",id:n,emoji:U}]),()=>E(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:k,onChange:(t)=>z(t.target.value),disabled:g}),y!=="new"&&e(mt,{emoji:U,onChange:K}),s(oe,{children:[e(D,{type:"button",variant:"outline",disabled:g,onClick:()=>E(null),children:i("collection.cancel")}),e(D,{type:"submit",disabled:g||!k.trim(),children:i("collection.confirm")})]})]})]})}),e(Y,{open:S!==null,onOpenChange:(t)=>{if(!t&&!g)T(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?"":re(d[S.id],i)})})]}),s(oe,{children:[e(D,{variant:"outline",disabled:g,onClick:()=>T(null),children:i("collection.cancel")}),e(D,{disabled:g,onClick:()=>{if(S!==null)q(m({type:S.type,id:S.id}),()=>T(null))},children:i("collection.confirm")})]})]})})]})}
2
+ export{Js};
@@ -1,2 +1,2 @@
1
- import{U,Ht}from"./chunk-542c9tpr.js";import{BlocksIcon as l,BookOpenIcon as m,SquareSlashIcon as d}from"lucide-react";import{createContext as p,useContext as i}from"react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var Zn=p({names:[]});function zo({kind:n,name:r}){let{icon:c}=i(Zn),s=n==="skill"?c?.(r):void 0;return f("span",{className:Ht,children:[s?o("img",{src:s,alt:"","aria-hidden":"true",className:"size-3.5 shrink-0 self-center object-contain"}):o(n==="skill"?m:n==="command"?d:l,{className:"size-3.5 shrink-0 self-center","aria-hidden":"true"}),o("span",{children:r})]})}function rs({text:n,children:r}){let{names:c}=i(Zn),s=U(n,c);if(!s.length)return r;let t=[],a=0;for(let e of s)t.push(n.slice(a,e.start)),t.push(o("span",{"data-skill-reference":e.kind==="skill"?e.name:void 0,"data-command-reference":e.kind==="command"?e.name:void 0,children:o(zo,{kind:e.kind,name:e.name.slice(1)})},e.start)),a=e.end;return t.push(n.slice(a)),t}
2
- export{Zn,zo,rs};
1
+ import{U,Bt}from"./chunk-4vayk46h.js";import{BlocksIcon as l,BookOpenIcon as m,SquareSlashIcon as d}from"lucide-react";import{createContext as p,useContext as i}from"react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var Wn=p({names:[]});function Zo({kind:n,name:r}){let{icon:c}=i(Wn),s=n==="skill"?c?.(r):void 0;return f("span",{className:Bt,children:[s?o("img",{src:s,alt:"","aria-hidden":"true",className:"size-3.5 shrink-0 self-center object-contain"}):o(n==="skill"?m:n==="command"?d:l,{className:"size-3.5 shrink-0 self-center","aria-hidden":"true"}),o("span",{children:r})]})}function ys({text:n,children:r}){let{names:c}=i(Wn),s=U(n,c);if(!s.length)return r;let t=[],a=0;for(let e of s)t.push(n.slice(a,e.start)),t.push(o("span",{"data-skill-reference":e.kind==="skill"?e.name:void 0,"data-command-reference":e.kind==="command"?e.name:void 0,children:o(Zo,{kind:e.kind,name:e.name.slice(1)})},e.start)),a=e.end;return t.push(n.slice(a)),t}
2
+ export{Wn,Zo,ys};
@@ -1,2 +1,2 @@
1
- import{pi}from"./chunk-8h4e3654.js";import{jsx as o}from"react/jsx-runtime";function Yt(){return o("svg",{"aria-hidden":"true",focusable:"false",width:0,height:0,className:"pointer-events-none absolute",dangerouslySetInnerHTML:{__html:pi}})}var n=["agent-mode","application-window","audiowave","bar-chart","block-stack-skills","book-open","briefcase","bubble-on-bubble","checkmark-circle","code","compass","components-window","credit-card","csv","document","docx","exclamationmark-bubble","figma-document","figure-text-document","file-video","flash","folder","game-controller","globe","heart","heart-bubble","heart-text-clipboard","hierarchy","jpg-document","kettlebell","ladybug","lightbulb","lightning-bolt","magnifingglass","map","mappin","microphone","ms-word-document","newspaper","paperclip","pdf-document","pencil","phone","photo","png-document","pointer","ppt-document","pptx","puzzle","radar","shield","shopping-bag","skill-creator","skill-installer","star-app","star-bookmark","template-creator","terminal","text-bubble-figure","text-document","text-document-lock","text-note-pointer","triangle-vercel","xls-document-excel","xlsx"];function ci(t){let e=0;for(let r of t)e=(e*31+r.charCodeAt(0))%997;return`#plugin-${n[e%n.length]}`}function B({name:t,className:e="size-6 shrink-0"}){return o("svg",{"aria-hidden":"true",focusable:"false",width:36,height:36,viewBox:"0 0 36 36",className:e,children:o("use",{href:ci(t)})})}
2
- export{Yt,ci,B};
1
+ import{Jo}from"./chunk-4g1s7gdh.js";import{jsx as o}from"react/jsx-runtime";function $t(){return o("svg",{"aria-hidden":"true",focusable:"false",width:0,height:0,className:"pointer-events-none absolute",dangerouslySetInnerHTML:{__html:Jo}})}var n=["agent-mode","application-window","audiowave","bar-chart","block-stack-skills","book-open","briefcase","bubble-on-bubble","checkmark-circle","code","compass","components-window","credit-card","csv","document","docx","exclamationmark-bubble","figma-document","figure-text-document","file-video","flash","folder","game-controller","globe","heart","heart-bubble","heart-text-clipboard","hierarchy","jpg-document","kettlebell","ladybug","lightbulb","lightning-bolt","magnifingglass","map","mappin","microphone","ms-word-document","newspaper","paperclip","pdf-document","pencil","phone","photo","png-document","pointer","ppt-document","pptx","puzzle","radar","shield","shopping-bag","skill-creator","skill-installer","star-app","star-bookmark","template-creator","terminal","text-bubble-figure","text-document","text-document-lock","text-note-pointer","triangle-vercel","xls-document-excel","xlsx"];function Qo(t){let e=0;for(let r of t)e=(e*31+r.charCodeAt(0))%997;return`#plugin-${n[e%n.length]}`}function B({name:t,className:e="size-6 shrink-0"}){return o("svg",{"aria-hidden":"true",focusable:"false",width:36,height:36,viewBox:"0 0 36 36",className:e,children:o("use",{href:Qo(t)})})}
2
+ export{$t,Qo,B};
@@ -1,2 +1,2 @@
1
- import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Ro({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
- export{Ro};
1
+ import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function Jn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
+ export{Jn};
@@ -1,2 +1,2 @@
1
- function gi(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function fi(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
- export{gi,fi};
1
+ function bs(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Cs(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
+ export{bs,Cs};
@@ -0,0 +1,2 @@
1
+ import{n}from"./chunk-y8gz9rsc.js";import{e}from"./chunk-acf4sdp7.js";import{x,ee}from"./chunk-w5q2ygsa.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let o=Math.min(100,a/t*100),p=o>=90?"text-destructive":o>=70?"text-foreground":"text-muted-foreground";return{pct:o,className:p}}function G(a){let t=x(a.configOptions,"model");return t===void 0?void 0:ee(t)}function nt(a,t){let o=a.windowDurationMins;if(o===null)return t("usage.usage");if(o%1440===0)return t("usage.windowDays",{count:o/1440});return t("usage.windowHours",{count:Math.round(o/60)})}function P(a){let{client:t}=e(),o=n((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!o){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[o,t]),o?p:null}function _({session:a}){let{t}=e().host,o=x(a.configOptions,"model"),p=o!==void 0&&(L(o.options)?o.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===o.currentValue)):!o.currentValue.startsWith("gateway:")&&o.options.some((i)=>i.value===o.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,h=7,b=2*Math.PI*h,N=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||N+k+g+w,R=N+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(N)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],v=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:h,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[v!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:v,children:v})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:nt(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var vn=W(_);
2
+ export{nt,vn};
@@ -1,2 +1,2 @@
1
- function Ko(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
2
- export{Ko};
1
+ function Eo(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
2
+ export{Eo};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-bshgrwe9.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Ps({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
- export{Ps};
1
+ import{e}from"./chunk-acf4sdp7.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function ia({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
+ export{ia};
@@ -1,2 +1,2 @@
1
- class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function Jr(i,e){return n??=new s,n.connect(i,e)}
2
- export{Jr};
1
+ class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function qr(i,e){return n??=new s,n.connect(i,e)}
2
+ export{qr};
@@ -1,2 +1,2 @@
1
- import{QUICK_CHATS_GROUP as r,sessionGroup as l}from"@nyssance/codex-acp-v2/client";function pt(n,t){return n!==null&&t&&l(t,{cwd:n}).id===r?null:n}
2
- export{pt};
1
+ import{QUICK_CHATS_GROUP as r,sessionGroup as l}from"@nyssance/codex-acp-v2/client";function ct(n,t){return n!==null&&t&&l(t,{cwd:n}).id===r?null:n}
2
+ export{ct};
@@ -0,0 +1,2 @@
1
+ import{qt}from"./chunk-55m88zbv.js";import{createContext as l,useContext as a,useEffect as p,useSyncExternalStore as u}from"react";import{jsx as o}from"react/jsx-runtime";var g=l(null),P=l(null),r=new WeakMap;function Ke(e){let t=r.get(e);if(!t)t=qt(e),r.set(e,t);return t}function Is({host:e,client:t,children:n}){let s=Ke(t);return s.bindHost(e),p(()=>s.bindHost(e),[s,e]),o(g,{value:e,children:o(P,{value:t,children:n})})}function d(){let e=a(g);if(e===null)throw Error("Plugins host is missing");return e}function We(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function lt(e){let t=We();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=Ke(We());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Ze(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{Ke,Is,d,We,lt,i,Ze};
@@ -1,2 +1,2 @@
1
- import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Ve({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
2
- export{Ve};
1
+ import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Ie({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
2
+ export{Ie};
@@ -1,2 +1,2 @@
1
- function On(n,r){let i=new Set(r);i.add(n);let t=/^(.*?)\s*\((\d+)\)$/.exec(n),s=t?t[1].trimEnd():n,e=t?BigInt(t[2])+1n:2n;while(i.has(`${s} (${e})`))e++;return`${s} (${e})`}
2
- export{On};
1
+ function En(n,r){let i=new Set(r);i.add(n);let t=/^(.*?)\s*\((\d+)\)$/.exec(n),s=t?t[1].trimEnd():n,e=t?BigInt(t[2])+1n:2n;while(i.has(`${s} (${e})`))e++;return`${s} (${e})`}
2
+ export{En};
@@ -1,2 +1,2 @@
1
- import{Ft}from"./chunk-26w51q10.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function xr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Ft({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
- export{xr};
1
+ import{Ft}from"./chunk-26w51q10.js";import{cn as v}from"cn";import{XIcon as E}from"lucide-react";import{useCallback as p,useEffect as D,useMemo as X,useRef as N,useState as b}from"react";import{Dialog as _,DialogClose as L,DialogContent as j,DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as F}from"react/jsx-runtime";function pr({open:l,onOpenChange:y,url:h,filename:M,scale:d,onScaleChange:f,containerRef:z,containerClassName:H,dialogContentClassName:P,imageClassName:T}){let g=p((e)=>Math.min(4,Math.max(0.25,e)),[]),[I,O]=b(1),o=g(d??I),R=N(null),s=z??R,S=N(null),[m,x]=b({width:0,height:0}),[C,W]=b({width:0,height:0}),w=p((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}O(n)},[f,g]);D(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;O(1)},[l,h,d]),D(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{x({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let Z=p(()=>{w(1)},[w]),r=X(()=>{let{width:e,height:n}=C,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,k=n*c;return{width:u*o,height:k*o}},[o,C,m]);if(!h)return null;return i(_,{open:l,onOpenChange:y,children:F(j,{className:v("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",P),showCloseButton:!1,children:[i(A,{className:"sr-only",children:M||"Image preview"}),i(L,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(E,{className:"size-5"})}),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=S.current,u=a&&c?Ft({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:v("h-full w-full scrollbar-thin overflow-auto",H),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:M||"image preview",className:v("block object-contain select-none",T),decoding:"async",draggable:!1,ref:S,onDoubleClick:Z,onLoad:(e)=>{let n=e.currentTarget;W({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))x({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h})})})})]})})}
2
+ export{pr};
@@ -1,2 +1,2 @@
1
- import{d,i}from"./chunk-mcrd86tx.js";import{q,K,ce,W,Z,_e}from"./chunk-5d138vq3.js";import{Se}from"./chunk-mtn6vdf8.js";import{k}from"./chunk-qk1yqepm.js";import{ke}from"./chunk-a6ysp1fp.js";import{Q,Pe}from"./chunk-e04g26qm.js";import{CheckIcon as O,SparklesIcon as A,XIcon as U}from"lucide-react";import{useDeferredValue as V,useState as y}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogClose as X,DialogContent as _,DialogDescription as J,DialogHeader as R,DialogTitle as Y}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ne,TabsList as le,TabsTrigger as ie}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function T({skill:r}){let{assetUrl:p}=d(),[u,s]=y(!1),l=r.interface?.iconSmall,h=l&&p?p(l):r.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(A,{className:"text-muted-foreground size-6"})})}function oe({skill:r}){let{t:p}=d(),u=i((l)=>l.setSkillEnabled),s=i((l)=>(r.path in l.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:r.enabled,disabled:s,"aria-label":`${p(r.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${r.interface?.displayName??r.name}`,onCheckedChange:(l)=>void u(r,l)})]})}function en({query:r,ready:p,onOpenPlugin:u}){let{t:s}=d(),l=i((e)=>e.skills),h=i((e)=>e.skillErrors),P=i((e)=>e.loading)||!p,j=i((e)=>e.installed),z=i((e)=>e.skillProjects),[M,E]=y(null),[v,L]=y(!1),[B,C]=y(null),b=V(r.trim().toLowerCase()),o=l.find((e)=>e.path===B),x=j.find(({plugin:e})=>e.id===o?.pluginId),c=l.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(b)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),m=[...["user","system","admin"].flatMap((e)=>{let a=l.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(z).flatMap(([e,a])=>{if(!l.some((I)=>I.scope==="repo"&&a.includes(I.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],H=m.map((e)=>e.label);for(let e of m)if(e.path&&H.filter((a)=>a===e.label).length>1)e.label=e.path;let g=m.find((e)=>e.id===M)??m[0],D=g?c.filter((e)=>g.paths.has(e.path)):[],G=v||b?c:c.slice(0,6),w=(e)=>t(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(_e,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(W,{className:"pointer-events-none relative translate-none! self-center!",children:t(T,{skill:a})}),n(K,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(ce,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(q,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(O,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(k,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${Q} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),P?t(Se,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:c.length})})]}),c.length?w(G):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(b?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!b&&c.length>6&&t(N,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":v,onClick:()=>L((e)=>!e),children:v?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:c.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")E(e)},className:"gap-6",children:[t(le,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:m.map((e)=>t(ie,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),m.map((e)=>t(ne,{value:e.id,children:e.id===g.id&&(D.length?w(D):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(F,{open:!!o,onOpenChange:(e)=>{if(!e)C(null)},children:t(_,{showCloseButton:!1,className:Pe,children:o&&n(S,{children:[t(ke,{path:o.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(T,{skill:o}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(oe,{skill:o}),e,t(X,{render:t(N,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(U,{})})]})]}),n(R,{className:"gap-3",children:[t(Y,{className:"text-2xl leading-8 font-semibold break-words",children:o.interface?.displayName??o.name}),t(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:o.description})]})]})},o.path),o.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),x?t(N,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(x)},children:x.plugin.interface?.displayName??x.plugin.name}):o.pluginId]})]})})})]})}
2
- export{en};
1
+ import{d,i}from"./chunk-njqan8zg.js";import{q,K,ce,W,Z,ke}from"./chunk-gdtpwbqn.js";import{we}from"./chunk-3hsft68c.js";import{k}from"./chunk-qk1yqepm.js";import{Se}from"./chunk-3qedn07q.js";import{Q,_e}from"./chunk-pqz2471h.js";import{CheckIcon as O,SparklesIcon as A,XIcon as U}from"lucide-react";import{useDeferredValue as V,useState as y}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogClose as X,DialogContent as _,DialogDescription as J,DialogHeader as R,DialogTitle as Y}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ne,TabsList as le,TabsTrigger as ie}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function T({skill:r}){let{assetUrl:p}=d(),[u,s]=y(!1),l=r.interface?.iconSmall,h=l&&p?p(l):r.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(A,{className:"text-muted-foreground size-6"})})}function oe({skill:r}){let{t:p}=d(),u=i((l)=>l.setSkillEnabled),s=i((l)=>(r.path in l.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:r.enabled,disabled:s,"aria-label":`${p(r.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${r.interface?.displayName??r.name}`,onCheckedChange:(l)=>void u(r,l)})]})}function zt({query:r,ready:p,onOpenPlugin:u}){let{t:s}=d(),l=i((e)=>e.skills),h=i((e)=>e.skillErrors),P=i((e)=>e.loading)||!p,j=i((e)=>e.installed),z=i((e)=>e.skillProjects),[M,E]=y(null),[v,L]=y(!1),[B,C]=y(null),b=V(r.trim().toLowerCase()),o=l.find((e)=>e.path===B),x=j.find(({plugin:e})=>e.id===o?.pluginId),c=l.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(b)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),m=[...["user","system","admin"].flatMap((e)=>{let a=l.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(z).flatMap(([e,a])=>{if(!l.some((I)=>I.scope==="repo"&&a.includes(I.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],H=m.map((e)=>e.label);for(let e of m)if(e.path&&H.filter((a)=>a===e.label).length>1)e.label=e.path;let g=m.find((e)=>e.id===M)??m[0],D=g?c.filter((e)=>g.paths.has(e.path)):[],G=v||b?c:c.slice(0,6),w=(e)=>t(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(ke,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(W,{className:"pointer-events-none relative translate-none! self-center!",children:t(T,{skill:a})}),n(K,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(ce,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(q,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(O,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(k,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${Q} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),P?t(we,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:c.length})})]}),c.length?w(G):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(b?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!b&&c.length>6&&t(N,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":v,onClick:()=>L((e)=>!e),children:v?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:c.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")E(e)},className:"gap-6",children:[t(le,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:m.map((e)=>t(ie,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),m.map((e)=>t(ne,{value:e.id,children:e.id===g.id&&(D.length?w(D):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(F,{open:!!o,onOpenChange:(e)=>{if(!e)C(null)},children:t(_,{showCloseButton:!1,className:_e,children:o&&n(S,{children:[t(Se,{path:o.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(T,{skill:o}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(oe,{skill:o}),e,t(X,{render:t(N,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(U,{})})]})]}),n(R,{className:"gap-3",children:[t(Y,{className:"text-2xl leading-8 font-semibold break-words",children:o.interface?.displayName??o.name}),t(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:o.description})]})]})},o.path),o.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),x?t(N,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(x)},children:x.plugin.interface?.displayName??x.plugin.name}):o.pluginId]})]})})})]})}
2
+ export{zt};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-f9z37ptq.js";import{Ut}from"./chunk-tknyjndw.js";import{bi}from"./chunk-vx6shb4g.js";import{F}from"./chunk-geh3wyxw.js";import{so}from"./chunk-stc4ctrx.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as C}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(F,{block:e.content},`${n.id}:${l}`))]})}var to=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(so),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...bi(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(C,{children:[s(Ut,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
- export{to};
1
+ import{t}from"./chunk-y8gz9rsc.js";import{Rt}from"./chunk-dx5hh359.js";import{Dr}from"./chunk-95ywdfe0.js";import{D}from"./chunk-cgnzqmqd.js";import{Go}from"./chunk-syjt7y4v.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as C}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(D,{block:e.content},`${n.id}:${l}`))]})}var Ao=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(Go),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...Dr(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(C,{children:[s(Rt,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
+ export{Ao};
@@ -0,0 +1,2 @@
1
+ import{b}from"./chunk-a11wvd8e.js";import{Wi,Zi,Qi,Ji}from"./chunk-dd9k5bbt.js";import{Ln,R,bt,S,wt}from"./chunk-3z86hy2s.js";import{Bot as p}from"lucide-react";import{jsx as l}from"react/jsx-runtime";var r={"alwith-account":Wi,chatgpt:Zi,minimax:Qi,seedream:Ji};function Oi({provider:o,className:i,...a}){let e=Object.hasOwn(r,o)?r[o]:R.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(Ln.filter((o)=>o.source==="account").flatMap((o)=>o.models.map((i)=>[S(o.id,i.id),i.label]))),d=new Map([...Ln.map((o)=>[o.id,o.source==="account"?1:2]),[b.id,0]]);function Mn(o){return o.shortLabel??o.label}function Be(o,i={}){return o.toSorted((e,n)=>(d.get(e.id)??3)-(d.get(n.id)??3)).map((e)=>{let n=e.id===b.id;return{...e,models:e.models.map((t)=>({...t,label:s.get(t.api_id)??t.label,shortLabel:t.shortLabel??wt[t.api_id]?.shortLabel,icon:i.providerIcon?.(e.id,t.api_id)??l(Oi,{provider:n?"chatgpt":e.id==="litellm"||e.id==="alwith-managed-litellm"||bt(t.api_id)?"alwith-account":e.id})}))}})}
2
+ export{Oi,Mn,Be};
@@ -1,2 +1,2 @@
1
- import"@alwith/module-chat/plugins.css";import{jsx as o}from"react/jsx-runtime";var Q="toolbox-content pb-8",Pe="toolbox-detail flex max-h-[85dvh] flex-col gap-6 overflow-hidden rounded-2xl p-6 sm:max-w-3xl";function Ie({children:e}){return o("div",{className:"toolbox-content shrink-0 pt-8",children:o("div",{className:"toolbox-toolbar flex min-h-9 items-center [&>header]:w-full [&>nav]:w-full","data-plugin-page-header":"",children:e})})}
2
- export{Q,Pe,Ie};
1
+ import"@alwith/module-chat/plugins.css";import{jsx as o}from"react/jsx-runtime";var Q="toolbox-content pb-8",_e="toolbox-detail flex max-h-[85dvh] flex-col gap-6 overflow-hidden rounded-2xl p-6 sm:max-w-3xl";function Pe({children:e}){return o("div",{className:"toolbox-content shrink-0 pt-8",children:o("div",{className:"toolbox-toolbar flex min-h-9 items-center [&>header]:w-full [&>nav]:w-full","data-plugin-page-header":"",children:e})})}
2
+ export{Q,_e,Pe};
@@ -0,0 +1,2 @@
1
+ import{Rn}from"./chunk-2f8s5gtn.js";import{ji,te}from"./chunk-9neb2f30.js";import{zi}from"./chunk-4sfxcw58.js";function Bi(l,p){return Rn({...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=te(t.selection);if(c.length>o.maxReferences)throw Error(`This model supports ${o.maxReferences} references`);let f=zi(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{Bi};
@@ -1,2 +1,2 @@
1
- function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function dn(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
- export{dn};
1
+ function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function un(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
+ export{un};
@@ -1,2 +1,2 @@
1
- import{isArrayProperty as x,isBooleanProperty as k,isNumberProperty as O,isStringProperty as w}from"@nyssance/codex-acp-v2/client";import{useEffect as D,useMemo as S,useState as A}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as C}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Dialog as E,DialogContent as N,DialogDescription as V,DialogFooter as R,DialogHeader as q,DialogTitle as P}from"@nyssance/shadcn/vega/components/ui/dialog";import{Field as L,FieldDescription as f,FieldGroup as G,FieldLabel as I,FieldLegend as v,FieldSet as h}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Label as K}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as T,RadioGroupItem as j}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Switch as H}from"@nyssance/shadcn/vega/components/ui/switch";import{Textarea as M}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as r,jsxs as s}from"react/jsx-runtime";function _(n){if(!w(n))return null;if(n.oneOf&&n.oneOf.length>0)return n.oneOf.map((e)=>({value:e.const,label:e.title??e.const,...e.description?{description:e.description}:{}}));if(n.enum&&n.enum.length>0)return n.enum.map((e)=>({value:e,label:e}));return null}function z(n){let e=n,i=e._meta?.alwith?.options;if(Array.isArray(i)&&Array.isArray(e.enum))return i.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));if(Array.isArray(e.enum))return e.enum.map((t)=>({value:String(t),label:String(t)}));if(Array.isArray(e.oneOf))return e.oneOf.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));return null}function Ra(n){let e=new Set(n.required??[]);return Object.entries(n.properties??{}).map(([i,t])=>({key:i,property:t,title:t.title??i,description:t.description??null,required:e.has(i),options:_(t),multiOptions:x(t)?z(t.items):null}))}function Ws(n){let e={};for(let i of n){let t=i.property.default;if(t!==void 0&&t!==null)e[i.key]=t;else if(i.options)e[i.key]=i.options[0].value;else if(k(i.property))e[i.key]=!1;else if(x(i.property))e[i.key]=[]}return e}function La(n,e){if(n.multiOptions)return Array.isArray(e)&&e.length>0;if(!n.required)return!0;return e!==void 0&&e!==""&&!(Array.isArray(e)&&e.length===0)}function b({id:n,label:e,description:i,control:t}){return s("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[t,s(K,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[r("div",{className:"text-foreground text-sm",children:e}),i&&r("div",{className:"text-muted-foreground text-xs",children:i})]})]})}function J({id:n,field:e,value:i,onChange:t}){if(e.multiOptions){let o=new Set(Array.isArray(i)?i:[]);return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r("div",{className:"flex flex-col gap-1",children:e.multiOptions.map((l)=>{let c=`${n}:${l.value}`;return r(b,{id:c,...l,control:r(C,{id:c,checked:o.has(l.value),onCheckedChange:(m)=>{let u=new Set(o);if(m)u.add(l.value);else u.delete(l.value);t([...u])}})},l.value)})})]})}if(e.options)return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r(T,{value:typeof i==="string"?i:"",onValueChange:(o)=>t(String(o)),className:"flex flex-col gap-1",children:e.options.map((o)=>{let l=`${n}:${o.value}`;return r(b,{id:l,...o,control:r(j,{value:o.value,id:l})},o.value)})})]});return s(L,{children:[r(I,{htmlFor:n,children:e.title}),k(e.property)?r(H,{id:n,checked:i===!0,onCheckedChange:(o)=>t(o)}):O(e.property)?r(B,{id:n,type:"number",required:e.required,value:typeof i==="number"?i:"",onChange:(o)=>t(o.target.value===""?void 0:Number(o.target.value))}):r(M,{id:n,rows:2,required:e.required,value:typeof i==="string"?i:"",onChange:(o)=>t(o.target.value)}),e.description&&r(f,{children:e.description})]})}function Qi({requestId:n,schema:e,message:i,total:t,t:o,onRespond:l}){let c=S(()=>Ra(e),[e]),[m,u]=A(()=>Ws(c));D(()=>u(Ws(c)),[n,c]);let g=c.every((a)=>La(a,m[a.key])),y=()=>{if(!g)return;let a={};for(let[p,d]of Object.entries(m))if(d!==void 0)a[p]=d;l({action:"accept",content:a})};return r(E,{open:!0,onOpenChange:(a)=>!a&&l({action:"cancel"}),children:s(N,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(a)=>{if(a.key==="Enter"&&(a.metaKey||a.ctrlKey))a.preventDefault(),y()},children:[s(q,{children:[s("div",{className:"flex items-center justify-between gap-2 pe-8",children:[r(P,{children:e.title??o("approval.needed")}),t>1&&r("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${t}`})]}),r(V,{children:i})]}),r("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r(G,{children:c.map((a)=>r(J,{id:`${n}:${a.key}`,field:a,value:m[a.key],onChange:(p)=>u((d)=>({...d,[a.key]:p}))},a.key))})}),s(R,{children:[r(F,{variant:"ghost",onClick:()=>l({action:"decline"}),children:o("actions.decline")}),r(F,{disabled:!g,onClick:y,children:o("actions.submit")})]})]})})}
2
- export{Ra,Ws,La,Qi};
1
+ import{isArrayProperty as x,isBooleanProperty as k,isNumberProperty as O,isStringProperty as w}from"@nyssance/codex-acp-v2/client";import{useEffect as D,useMemo as S,useState as A}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as C}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Dialog as E,DialogContent as N,DialogDescription as V,DialogFooter as R,DialogHeader as q,DialogTitle as P}from"@nyssance/shadcn/vega/components/ui/dialog";import{Field as L,FieldDescription as f,FieldGroup as G,FieldLabel as I,FieldLegend as v,FieldSet as h}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Label as K}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as T,RadioGroupItem as j}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Switch as H}from"@nyssance/shadcn/vega/components/ui/switch";import{Textarea as M}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as r,jsxs as s}from"react/jsx-runtime";function _(n){if(!w(n))return null;if(n.oneOf&&n.oneOf.length>0)return n.oneOf.map((e)=>({value:e.const,label:e.title??e.const,...e.description?{description:e.description}:{}}));if(n.enum&&n.enum.length>0)return n.enum.map((e)=>({value:e,label:e}));return null}function z(n){let e=n,i=e._meta?.alwith?.options;if(Array.isArray(i)&&Array.isArray(e.enum))return i.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));if(Array.isArray(e.enum))return e.enum.map((t)=>({value:String(t),label:String(t)}));if(Array.isArray(e.oneOf))return e.oneOf.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));return null}function Pa(n){let e=new Set(n.required??[]);return Object.entries(n.properties??{}).map(([i,t])=>({key:i,property:t,title:t.title??i,description:t.description??null,required:e.has(i),options:_(t),multiOptions:x(t)?z(t.items):null}))}function la(n){let e={};for(let i of n){let t=i.property.default;if(t!==void 0&&t!==null)e[i.key]=t;else if(i.options)e[i.key]=i.options[0].value;else if(k(i.property))e[i.key]=!1;else if(x(i.property))e[i.key]=[]}return e}function Ia(n,e){if(n.multiOptions)return Array.isArray(e)&&e.length>0;if(!n.required)return!0;return e!==void 0&&e!==""&&!(Array.isArray(e)&&e.length===0)}function b({id:n,label:e,description:i,control:t}){return s("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[t,s(K,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[r("div",{className:"text-foreground text-sm",children:e}),i&&r("div",{className:"text-muted-foreground text-xs",children:i})]})]})}function J({id:n,field:e,value:i,onChange:t}){if(e.multiOptions){let o=new Set(Array.isArray(i)?i:[]);return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r("div",{className:"flex flex-col gap-1",children:e.multiOptions.map((l)=>{let c=`${n}:${l.value}`;return r(b,{id:c,...l,control:r(C,{id:c,checked:o.has(l.value),onCheckedChange:(m)=>{let u=new Set(o);if(m)u.add(l.value);else u.delete(l.value);t([...u])}})},l.value)})})]})}if(e.options)return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r(T,{value:typeof i==="string"?i:"",onValueChange:(o)=>t(String(o)),className:"flex flex-col gap-1",children:e.options.map((o)=>{let l=`${n}:${o.value}`;return r(b,{id:l,...o,control:r(j,{value:o.value,id:l})},o.value)})})]});return s(L,{children:[r(I,{htmlFor:n,children:e.title}),k(e.property)?r(H,{id:n,checked:i===!0,onCheckedChange:(o)=>t(o)}):O(e.property)?r(B,{id:n,type:"number",required:e.required,value:typeof i==="number"?i:"",onChange:(o)=>t(o.target.value===""?void 0:Number(o.target.value))}):r(M,{id:n,rows:2,required:e.required,value:typeof i==="string"?i:"",onChange:(o)=>t(o.target.value)}),e.description&&r(f,{children:e.description})]})}function _i({requestId:n,schema:e,message:i,total:t,t:o,onRespond:l}){let c=S(()=>Pa(e),[e]),[m,u]=A(()=>la(c));D(()=>u(la(c)),[n,c]);let g=c.every((a)=>Ia(a,m[a.key])),y=()=>{if(!g)return;let a={};for(let[p,d]of Object.entries(m))if(d!==void 0)a[p]=d;l({action:"accept",content:a})};return r(E,{open:!0,onOpenChange:(a)=>!a&&l({action:"cancel"}),children:s(N,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(a)=>{if(a.key==="Enter"&&(a.metaKey||a.ctrlKey))a.preventDefault(),y()},children:[s(q,{children:[s("div",{className:"flex items-center justify-between gap-2 pe-8",children:[r(P,{children:e.title??o("approval.needed")}),t>1&&r("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${t}`})]}),r(V,{children:i})]}),r("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r(G,{children:c.map((a)=>r(J,{id:`${n}:${a.key}`,field:a,value:m[a.key],onChange:(p)=>u((d)=>({...d,[a.key]:p}))},a.key))})}),s(R,{children:[r(F,{variant:"ghost",onClick:()=>l({action:"decline"}),children:o("actions.decline")}),r(F,{disabled:!g,onClick:y,children:o("actions.submit")})]})]})})}
2
+ export{Pa,la,Ia,_i};
@@ -1,4 +1,4 @@
1
- import{kt,St,Dn}from"./chunk-36ttr22w.js";import{Mt,g}from"./chunk-xk0dt0es.js";import{InputGroupTextarea as R}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as M}from"cn";import{forwardRef as F,useCallback as K,useEffect as T,useImperativeHandle as L,useRef as d}from"react";import{jsx as q}from"react/jsx-runtime";var z=(c)=>!c.shiftKey,N=()=>!1,ho=F(({onChange:c,onKeyDown:b,onCompositionStart:y,onCompositionEnd:I,className:E,placeholder:C,bashMode:S=!1,isSendShortcut:H=z,isNewlineShortcut:P=N,...h},k)=>{let n=Mt(),p=g(),i=d(!1),s=d(!1),a=d(null),l=d(null),o=K(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);T(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,r=new ResizeObserver(([u])=>{if(u&&u.contentRect.width!==t)t=u.contentRect.width,o()});return r.observe(e),o(),()=>{if(r.disconnect(),l.current!==null)cancelAnimationFrame(l.current);l.current=null}},[o]),T(o,[o,n?.textInput.value,h.value]);let m=S&&(n?.textInput.value??"").startsWith("!"),w=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||s.current)return;if(b?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
1
+ import{Pt,It,$n}from"./chunk-9wc4emwt.js";import{Mt,g}from"./chunk-tgnftxyb.js";import{InputGroupTextarea as R}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as M}from"cn";import{forwardRef as F,useCallback as K,useEffect as T,useImperativeHandle as L,useRef as d}from"react";import{jsx as q}from"react/jsx-runtime";var z=(c)=>!c.shiftKey,N=()=>!1,po=F(({onChange:c,onKeyDown:b,onCompositionStart:y,onCompositionEnd:I,className:E,placeholder:C,bashMode:S=!1,isSendShortcut:H=z,isNewlineShortcut:P=N,...h},k)=>{let n=Mt(),p=g(),i=d(!1),s=d(!1),a=d(null),l=d(null),o=K(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||l.current!==null)return;l.current=requestAnimationFrame(()=>{l.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);T(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,r=new ResizeObserver(([u])=>{if(u&&u.contentRect.width!==t)t=u.contentRect.width,o()});return r.observe(e),o(),()=>{if(r.disconnect(),l.current!==null)cancelAnimationFrame(l.current);l.current=null}},[o]),T(o,[o,n?.textInput.value,h.value]);let m=S&&(n?.textInput.value??"").startsWith("!"),w=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||s.current)return;if(b?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
2
  `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(m&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(P(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:r,selectionEnd:u,value:f}=t,v=`${f.slice(0,r)}
3
- ${f.slice(u)}`;if(n)n.textInput.setInput(v);else t.value=v;let x=r+1;t.setSelectionRange(x,x),o();return}if(H(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let r=t.querySelector('button[type="submit"]');if(!r||r.disabled)return;t.requestSubmit(r)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&p.files.length>0){e.preventDefault();let t=p.files.at(-1);if(t)p.remove(t.id)}},A=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:u}=kt(t),f=St(t);if(r.length>0)e.preventDefault(),p.add(r);else if(u&&!f)e.preventDefault()},D=n?{value:i.current&&a.current?a.current.value:m?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:Dn(e.currentTarget);n.textInput.setInput(m?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!i.current)Dn(e.currentTarget);o(),c?.(e)}};return L(k,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||s.current,getTextarea:()=>a.current}),[]),q(R,{"data-chat-input":!0,ref:a,rows:3,className:M("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=Dn(e.currentTarget);n?.textInput.setInput(m?`!${t}`:t),o(),I?.(e),s.current=!0,requestAnimationFrame(()=>{s.current=!1})},onCompositionStart:(e)=>{s.current=!1,i.current=!0,y?.(e)},onKeyDown:w,onPaste:A,placeholder:C,...h,...D})});ho.displayName="PromptInputTextarea";
4
- export{ho};
3
+ ${f.slice(u)}`;if(n)n.textInput.setInput(v);else t.value=v;let x=r+1;t.setSelectionRange(x,x),o();return}if(H(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let r=t.querySelector('button[type="submit"]');if(!r||r.disabled)return;t.requestSubmit(r)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&p.files.length>0){e.preventDefault();let t=p.files.at(-1);if(t)p.remove(t.id)}},A=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:r,sawNonImageFile:u}=Pt(t),f=It(t);if(r.length>0)e.preventDefault(),p.add(r);else if(u&&!f)e.preventDefault()},D=n?{value:i.current&&a.current?a.current.value:m?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:$n(e.currentTarget);n.textInput.setInput(m?`!${t}`:t),o(),c?.(e)}}:{onChange:(e)=>{if(!i.current)$n(e.currentTarget);o(),c?.(e)}};return L(k,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||s.current,getTextarea:()=>a.current}),[]),q(R,{"data-chat-input":!0,ref:a,rows:3,className:M("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",E),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=$n(e.currentTarget);n?.textInput.setInput(m?`!${t}`:t),o(),I?.(e),s.current=!0,requestAnimationFrame(()=>{s.current=!1})},onCompositionStart:(e)=>{s.current=!1,i.current=!0,y?.(e)},onKeyDown:w,onPaste:A,placeholder:C,...h,...D})});po.displayName="PromptInputTextarea";
4
+ export{po};
@@ -1,2 +1,2 @@
1
- import{xe}from"./chunk-g751pxzk.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=xe();function no(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{no};
1
+ import{Ce}from"./chunk-18kdsdmy.js";import{isContentEntry as u,isImage as c,isText as s}from"@nyssance/codex-acp-v2/client";var d=Ce();function Lo(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{Lo};
@@ -0,0 +1,2 @@
1
+ import{a,o}from"./chunk-5mjs63fv.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Wt(e,r){let s=a(),c=o((t)=>t.connection),i=o((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=o((t)=>v(t.sessions[e]?.items)),f=o((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await s.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(r==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[s,e,c,f,i,r]),i?u:p??u}
2
+ export{Wt};
@@ -1,3 +1,3 @@
1
- import{s,a,n}from"./chunk-n9jaz2pd.js";import{it,ve,re}from"./chunk-dpfjxym1.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as ce}from"cn";import{ArchiveIcon as de,FolderIcon as Q,ListFilterIcon as ue,SearchIcon as me,Trash2Icon as U}from"lucide-react";import{useEffect as pe,useRef as he,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as fe,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as r}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:ce("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function fa({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=n((e)=>e.archivedSessions),N=n((e)=>e.connection),[B,X]=d(""),[y,Y]=d("all"),[p,Z]=d("all"),[ee,te]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=he(!1),[D,f]=d(null),[O,b]=d(null),[se,G]=d(!1);pe(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let l=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(l.has(v))throw Error("Archive pagination returned a repeated cursor");l.add(v),await m.listArchived()}}catch(l){if(!e)F(E(l))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,ee]);let o=n((e)=>e.projectContext),k=!(o!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ie=[...new Set(S.filter((e)=>o&&j(o,e).id!==re).map((e)=>o?j(o,e).id:e.cwd))].toSorted(),ne=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=o?j(o,e).id:null,l=c===re;return L(e).toLocaleLowerCase(A.language).includes(ne)&&(y==="all"||(y==="quick"?l:!l))&&(p==="all"||(p==="quick"?l:c===p))}),ae=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function le(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function oe(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let l of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===l.sessionId))continue;try{await m.delete(l.sessionId)}catch(v){e.push(l),c.push(`${L(l)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
- `));else f(null)}finally{h.current=!1,w(!1)}}return r("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[r("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[r("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),r(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),r("div",{className:"flex shrink-0 flex-wrap gap-3",children:[r("div",{className:"relative min-w-48 flex-1",children:[t(me,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),r(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Y(e)},children:[r(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ue,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),r(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");Z(e)},children:[r(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):ve(p,o??void 0)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ie.map((e)=>t(x,{value:e,title:e,children:ve(e,o??void 0)},e))]})]})]}),r(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?r("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:r(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>te((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?r("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(de,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(o?it(K,o):[]).filter(([,e])=>e.length>0).map(([e,c])=>r("section",{className:"flex flex-col gap-3",children:[r("div",{className:"flex items-center justify-between gap-3",children:[r("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===re?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===re?i("sessionList.archives.noProject"):ve(e,o??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((l)=>r("article",{"aria-label":L(l),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[r("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(l),children:L(l)}),l.updatedAt!==null&&t("time",{dateTime:l.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:ae.format(new Date(l.updatedAt))})]}),r("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([l])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void le(l),children:i("sessionList.archives.unarchive")})]})]},l.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(fe,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:r(ge,{showCloseButton:!C,children:[r(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(se?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),r(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),r(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void oe(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
- export{fa};
1
+ import{s,a,o}from"./chunk-5mjs63fv.js";import{Qe,ue,oe}from"./chunk-zft4afb8.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as ce}from"cn";import{ArchiveIcon as de,FolderIcon as Q,ListFilterIcon as me,SearchIcon as pe,Trash2Icon as U}from"lucide-react";import{useEffect as he,useRef as fe,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as n}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:ce("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function Us({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,X]=d(""),[y,Y]=d("all"),[p,Z]=d("all"),[ee,te]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=fe(!1),[D,f]=d(null),[O,b]=d(null),[se,G]=d(!1);he(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let r=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(r.has(v))throw Error("Archive pagination returned a repeated cursor");r.add(v),await m.listArchived()}}catch(r){if(!e)F(E(r))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,ee]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ie=[...new Set(S.filter((e)=>l&&j(l,e).id!==oe).map((e)=>l?j(l,e).id:e.cwd))].toSorted(),ne=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=l?j(l,e).id:null,r=c===oe;return L(e).toLocaleLowerCase(A.language).includes(ne)&&(y==="all"||(y==="quick"?r:!r))&&(p==="all"||(p==="quick"?r:c===p))}),ae=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function re(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function le(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let r of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===r.sessionId))continue;try{await m.delete(r.sessionId)}catch(v){e.push(r),c.push(`${L(r)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
+ `));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(pe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),n(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Y(e)},children:[n(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(me,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");Z(e)},children:[n(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):ue(p,l??void 0)})]}),n(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ie.map((e)=>t(x,{value:e,title:e,children:ue(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:n(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>te((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(de,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Qe(K,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===oe?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===oe?i("sessionList.archives.noProject"):ue(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((r)=>n("article",{"aria-label":L(r),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(r),children:L(r)}),r.updatedAt!==null&&t("time",{dateTime:r.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:ae.format(new Date(r.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([r])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void re(r),children:i("sessionList.archives.unarchive")})]})]},r.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(ve,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ge,{showCloseButton:!C,children:[n(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(se?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),n(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void le(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
+ export{Us};
@@ -0,0 +1,2 @@
1
+ import{s,a,o,h}from"./chunk-5mjs63fv.js";import{z}from"./chunk-64cbt3ym.js";import{N,ie,Re}from"./chunk-chn1mkv0.js";import{Me,J,de}from"./chunk-3nawfa7b.js";import{ri}from"./chunk-hd11bfmp.js";import{Ie}from"./chunk-nqt9gyz9.js";import{Te}from"./chunk-vqby71fp.js";import{Ne}from"./chunk-ermc9p1p.js";import{Wt}from"./chunk-qkn0y5wx.js";import{ti}from"./chunk-tr0bmqn9.js";import{ActivityIcon as O}from"lucide-react";import{useEffect as E,useMemo as C}from"react";import{Kbd as G}from"@nyssance/shadcn/vega/components/ui/kbd";import{jsx as c,jsxs as P,Fragment as H}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:L}=R,m=o((t)=>t.runStates),S=o((t)=>t.drafts),u=o((t)=>t.sessionList),v=J((t)=>t.activityOrder),p=C(()=>v.flatMap((t)=>{let e=m[t];return e&&Me({runStates:m,drafts:S},t)?[{sid:t,record:e,sessionRow:K(u,e)}]:[]}),[v,m,S,u]),g=C(()=>{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=de(),x=g.flatMap((t)=>t.key==="foreground"||!f.has(t.key)?t.rows:[]),I=(t)=>{if(b?.(t))return;d(t)},D=ti();E(()=>{let t=(e)=>{if(e.defaultPrevented||e.isComposing||e.repeat||!ri(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=x[r-1];if(!y)return;e.preventDefault(),I(y.sessionRow)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let A=(t)=>{let e=x.indexOf(t);return c(M,{sessionRow:t.sessionRow,state:t.record.state,interruption:t.record.interruption,active:t.sid===i,tasks:t.record.tasks,listeningPorts:t.record.listeningPorts,onOpen:()=>I(t.sessionRow),accessory:w?.(t.sid),actions:k?.(t.sessionRow),hint:e<9&&D?c(G,{children:Ne(`CommandOrControl+${e+1}`)}):void 0},t.sid)};return c(N,{children:g.map((t)=>t.key==="foreground"?c(N,{children:t.rows.map(A)},t.key):c(ie,{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(O,{className:"text-muted-foreground size-3.5 shrink-0"}),label:L("sessionList.background"),count:t.rows.length,children:t.rows.map(A)},t.key))})}function M({sessionRow:i,state:d,interruption:l,active:b,tasks:w,listeningPorts:k,accessory:R,actions:L,onOpen:m,hint:S}){let u=s(),v=a(),{t:p}=u,g=i.title??p("sessionList.untitled"),f=Wt(i.sessionId,d);return P(H,{children:[c(Re,{"data-session-id":i.sessionId,active:b,role:"button",tabIndex:0,hoverCard:c(Te,{sessionRow:i,actions:L}),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(Ie,{title:p("sessionList.stop"),onStop:()=>h(u,v.stopSession(i.sessionId))})}),w.map((n)=>P("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(z,{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 +1,2 @@
1
- import{createContext as o,useContext as n,useEffect as r}from"react";var zr=o(null);function L(t){let e=n(zr);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
- export{zr,L};
1
+ import{createContext as o,useContext as n,useEffect as r}from"react";var yi=o(null);function E(t){let e=n(yi);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
+ export{yi,E};
@@ -1,2 +1,2 @@
1
- var r=new Map,i=new Map,m=new Map;function Vi(e,t){if(i.has(e))throw Error("An attachment writer is already registered for this session");return i.set(e,t),()=>{if(i.get(e)===t)i.delete(e)}}function J(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),i.get(e)?.(n)}function mn(e,t){m.set(e,t),t.finally(()=>{if(m.get(e)===t)m.delete(e)})}async function Vs(e){for(;;){let n=r.get(e)?.attachments.flatMap((p)=>{let c=m.get(p.id);return c?[c]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let p=await fetch(n.url);if(!p.ok)throw Error("Cannot read draft image");let c=await p.blob(),f=await new Promise((l,g)=>{let a=new FileReader;a.onload=()=>l(a.result),a.onerror=()=>g(a.error),a.readAsDataURL(c)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function js(e,t){if(t===null)r.delete(e);else r.set(e,t)}var s=new Map;function gn(e,t){if(s.has(e))throw Error("A composer is already registered for this session");return s.set(e,t),()=>{if(s.get(e)===t)s.delete(e)}}function $s(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=s.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}
2
- export{r,Vi,J,mn,Vs,js,gn,$s};
1
+ var r=new Map,i=new Map,m=new Map;function Ei(e,t){if(i.has(e))throw Error("An attachment writer is already registered for this session");return i.set(e,t),()=>{if(i.get(e)===t)i.delete(e)}}function X(e,t){let o=r.get(e);if(!o)return;let n=t(o.attachments);r.set(e,{...o,attachments:n}),i.get(e)?.(n)}function gn(e,t){m.set(e,t),t.finally(()=>{if(m.get(e)===t)m.delete(e)})}async function pa(e){for(;;){let n=r.get(e)?.attachments.flatMap((p)=>{let c=m.get(p.id);return c?[c]:[]})??[];if(!n.length)break;await Promise.all(n)}let t=r.get(e);if(!t)return null;let o=await Promise.all(t.attachments.map(async(n)=>{if(!n.url.startsWith("blob:"))return n;let p=await fetch(n.url);if(!p.ok)throw Error("Cannot read draft image");let c=await p.blob(),f=await new Promise((l,g)=>{let a=new FileReader;a.onload=()=>l(a.result),a.onerror=()=>g(a.error),a.readAsDataURL(c)});return{...n,url:f}}));return{...t,...t.apps?{apps:t.apps.map((n)=>({...n}))}:{},text:t.text,mentions:[...t.mentions],attachments:o,modelId:t.modelId}}function ma(e,t){if(t===null)r.delete(e);else r.set(e,t)}var s=new Map;function fn(e,t){if(s.has(e))throw Error("A composer is already registered for this session");return s.set(e,t),()=>{if(s.get(e)===t)s.delete(e)}}function ga(e,t){if(typeof t!=="string"||!t.trim())throw Error("The draft is empty");let o=s.get(e);if(!o)throw Error("The session's composer is not open; open the session first");let n=r.get(e);if(n&&(n.text.length||n.attachments.length||n.mentions.length||n.apps?.length))throw Error("The composer already has a draft; send or clear it first");o(t),r.set(e,{text:t,attachments:[],mentions:[],modelId:n?.modelId??null})}
2
+ export{r,Ei,X,gn,pa,ma,fn,ga};
@@ -1,2 +1,2 @@
1
- import{zn}from"./chunk-7cab9zy0.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function sa({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(zn,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
- export{sa};
1
+ import{Kt}from"./chunk-24y0mvqf.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function Ts({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(Kt,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
+ export{Ts};
@@ -0,0 +1,2 @@
1
+ function Et(o){return o.kind==="tool"&&o.status==="completed"&&o.toolKind!=="read"&&o.toolKind!=="search"}
2
+ export{Et};
@@ -0,0 +1,2 @@
1
+ var Qa=1e6,Ja=5000000;function cr(_,e){return _+e>5000000}function Xa(_){return(_/1e6).toFixed(1)}var Ve=5;
2
+ export{Qa,Ja,cr,Xa,Ve};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-5mjs63fv.js";import{Me,J,de}from"./chunk-3nawfa7b.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")&&Me(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=de();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,2 +1,2 @@
1
- import{createStore as r}from"@alwith/api/client";var Je=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function ki(e){Je.setState({...e,terminals:e.terminals??{}})}function Si(e){if(Je.getState().sessionId===e)Je.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function _i(e,n,t){let i=Je.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
2
- export{Je,ki,Si,_i};
1
+ import{createStore as r}from"@alwith/api/client";var at=r({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}});function es(e){at.setState({...e,terminals:e.terminals??{}})}function ts(e){if(at.getState().sessionId===e)at.setState({sessionId:null,turns:[],api:null,beforeReveal:null,terminals:{}})}async function ns(e,n,t){let i=at.getState();if(t.aborted||e===null||i.sessionId!==e||i.api===null)return;if(i.beforeReveal===null)throw Error("Mounted timeline has no navigation lifecycle");i.beforeReveal(),await i.api.scrollToKey(n,void 0,{align:"top"})}
2
+ export{at,es,ts,ns};
@@ -0,0 +1,2 @@
1
+ var Le="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{Le,u};
@@ -1,2 +1,2 @@
1
- import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function Ce({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
- export{Ce};
1
+ import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function ye({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
+ export{ye};
@@ -1,2 +1,2 @@
1
- import{D}from"./chunk-50eym2q3.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function Ea(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function Mi(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=D(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(D(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function Ni(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Ea(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(so),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function so(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function de(t){return A(t.content)}function ft(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function ao(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Ai(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function Ei(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function Ri(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!Ei(t,e[n-1],o))break;n--}return e[n]?.key}function Li(t,e,n){let o=n,s=n;while(o>0&&Ei(t,e[o-1],e[o]))o--;while(s+1<e.length&&Ei(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
- export{Ea,Mi,Ni,so,de,ft,ao,Ai,Ei,Ri,Li};
1
+ import{F}from"./chunk-wde0m4pf.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function za(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function as(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=F(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(F(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function ls(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!za(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(Go),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function Go(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function xe(t){return A(t.content)}function Ht(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function zo(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function cs(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function ds(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function us(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!ds(t,e[n-1],o))break;n--}return e[n]?.key}function ps(t,e,n){let o=n,s=n;while(o>0&&ds(t,e[o-1],e[o]))o--;while(s+1<e.length&&ds(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
+ export{za,as,ls,Go,xe,Ht,zo,cs,ds,us,ps};