@alwith/module-chat 0.6.26 → 0.6.28

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 (463) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/client.d.ts +1 -4
  3. package/dist/agent/client.js +1 -1
  4. package/dist/agent/custom-model-effort.js +1 -1
  5. package/dist/agent/fork-title.js +1 -1
  6. package/dist/agent/image-request.js +1 -1
  7. package/dist/agent/image-tools.js +1 -1
  8. package/dist/agent/input-config.js +1 -1
  9. package/dist/agent/input-modes/chat.js +1 -1
  10. package/dist/agent/input-modes/execution-meta.js +1 -1
  11. package/dist/agent/input-modes/image-context.js +1 -1
  12. package/dist/agent/input-modes/image.js +1 -1
  13. package/dist/agent/input-modes/index.js +1 -1
  14. package/dist/agent/project-path.js +1 -1
  15. package/dist/agent/request-error.js +1 -1
  16. package/dist/agent/session-list-refresh.js +1 -1
  17. package/dist/app-reference.js +1 -1
  18. package/dist/application-tools.d.ts +3 -8
  19. package/dist/application-tools.js +1 -1
  20. package/dist/approval/choice-elicitation-form.js +1 -1
  21. package/dist/approval/choice-schema.js +1 -1
  22. package/dist/approval/permission-options.js +1 -1
  23. package/dist/approval/permission-view.js +1 -1
  24. package/dist/approval/schema-elicitation-form.js +1 -1
  25. package/dist/approval/url-elicitation-card.js +1 -1
  26. package/dist/{chunk-v96vkrw2.js → chunk-064vpdm9.js} +2 -2
  27. package/dist/{chunk-7ng6qs9c.js → chunk-0aeq7qy7.js} +2 -2
  28. package/dist/chunk-0fqp48tv.js +2 -0
  29. package/dist/{chunk-4g1s7gdh.js → chunk-0fs2k5fe.js} +2 -2
  30. package/dist/{chunk-1wr1ef9x.js → chunk-0q22f9vw.js} +2 -2
  31. package/dist/{chunk-fwghjmd1.js → chunk-0xshzqb6.js} +2 -2
  32. package/dist/{chunk-qceex4vv.js → chunk-17gs9pbn.js} +2 -2
  33. package/dist/chunk-1a56svgj.js +2 -0
  34. package/dist/{chunk-7zww33h8.js → chunk-1fda3013.js} +2 -2
  35. package/dist/{chunk-qzerhkyb.js → chunk-1ffpsz44.js} +3 -3
  36. package/dist/{chunk-m68t534g.js → chunk-1gtmvxdr.js} +2 -2
  37. package/dist/chunk-2c2a1wvg.js +2 -0
  38. package/dist/{chunk-4vayk46h.js → chunk-2cfhvb3k.js} +2 -2
  39. package/dist/{chunk-jvy6p83k.js → chunk-2e1tg69n.js} +3 -3
  40. package/dist/{chunk-84ncszbf.js → chunk-2fck5sy2.js} +2 -2
  41. package/dist/{chunk-xwwjj45a.js → chunk-2sc2z6g5.js} +2 -2
  42. package/dist/{chunk-eynwjzqp.js → chunk-2v531sbv.js} +2 -2
  43. package/dist/{chunk-h5mdgrq6.js → chunk-2zy75522.js} +2 -2
  44. package/dist/chunk-36ttr22w.js +2 -0
  45. package/dist/{chunk-ha9n1k24.js → chunk-38bpmgjd.js} +2 -2
  46. package/dist/{chunk-bbrx6m7n.js → chunk-38psn07c.js} +2 -2
  47. package/dist/{chunk-z6x70w62.js → chunk-3a3ecayr.js} +2 -2
  48. package/dist/chunk-3kn94cpp.js +2 -0
  49. package/dist/{chunk-7rtwekkz.js → chunk-3nbpd0jt.js} +2 -2
  50. package/dist/{chunk-53r6pr16.js → chunk-3qqd9x6x.js} +2 -2
  51. package/dist/chunk-3r57tgvf.js +2 -0
  52. package/dist/{chunk-axvjn527.js → chunk-42ebtw00.js} +2 -2
  53. package/dist/chunk-4cbfgsg7.js +2 -0
  54. package/dist/{chunk-gdtpwbqn.js → chunk-5d138vq3.js} +1 -1
  55. package/dist/{chunk-yryg27yy.js → chunk-5dtpfpq5.js} +2 -2
  56. package/dist/{chunk-exrd2xzz.js → chunk-5hk14ksr.js} +2 -2
  57. package/dist/{chunk-3z86hy2s.js → chunk-5k4ec37x.js} +2 -2
  58. package/dist/chunk-5mnjkjjr.js +2 -0
  59. package/dist/{chunk-masqfje4.js → chunk-5vajeawb.js} +2 -2
  60. package/dist/{chunk-xnbvdqnt.js → chunk-62kt6f1d.js} +2 -2
  61. package/dist/{chunk-0e5dx357.js → chunk-6bhfdsyz.js} +2 -2
  62. package/dist/{chunk-pebkk426.js → chunk-6cxvfwpe.js} +2 -2
  63. package/dist/{chunk-7s7cevjh.js → chunk-6pwssh9v.js} +2 -2
  64. package/dist/chunk-6tj5e7fc.js +2 -0
  65. package/dist/chunk-6tr1bch8.js +4 -0
  66. package/dist/{chunk-j4w2hbbe.js → chunk-6xap6hvz.js} +2 -2
  67. package/dist/{chunk-ag2t01q7.js → chunk-6yaxjcnj.js} +3 -3
  68. package/dist/{chunk-88ysxbdh.js → chunk-78vckhxt.js} +2 -2
  69. package/dist/{chunk-64apxzn7.js → chunk-7rgcj1w2.js} +2 -2
  70. package/dist/{chunk-3hsft68c.js → chunk-7sr8weqn.js} +2 -2
  71. package/dist/{chunk-4a4awnss.js → chunk-7zafb413.js} +2 -2
  72. package/dist/{chunk-bgnxw313.js → chunk-81hv0s07.js} +2 -2
  73. package/dist/chunk-8qzq9yq1.js +2 -0
  74. package/dist/{chunk-ne4b53kn.js → chunk-8v53bkyr.js} +2 -2
  75. package/dist/chunk-8y838se4.js +2 -0
  76. package/dist/{chunk-ma6ycen5.js → chunk-9kz3pxt9.js} +2 -2
  77. package/dist/{chunk-x49qjrbk.js → chunk-9q6hz47j.js} +2 -2
  78. package/dist/{chunk-h1kvdf3t.js → chunk-a4y4bsve.js} +2 -2
  79. package/dist/{chunk-qa9p0a64.js → chunk-a73hd95m.js} +3 -3
  80. package/dist/chunk-aepfqfad.js +2 -0
  81. package/dist/chunk-agx111cv.js +2 -0
  82. package/dist/{chunk-vmfhnkxj.js → chunk-aq1j5vqn.js} +2 -2
  83. package/dist/{chunk-xqb4thy8.js → chunk-at75m9hq.js} +2 -2
  84. package/dist/{chunk-tr0bmqn9.js → chunk-ayhxrzsq.js} +2 -2
  85. package/dist/{chunk-30nre2gw.js → chunk-b2vtrd8n.js} +2 -2
  86. package/dist/{chunk-gpv1dc5y.js → chunk-b30n56t8.js} +2 -2
  87. package/dist/chunk-b42vv8f2.js +2 -0
  88. package/dist/chunk-b6p0y68h.js +2 -0
  89. package/dist/{chunk-6e84zbgs.js → chunk-b8x98hyd.js} +2 -2
  90. package/dist/chunk-bx11qvn9.js +2 -0
  91. package/dist/{chunk-8wk3e4z7.js → chunk-c4awmmwt.js} +2 -2
  92. package/dist/{chunk-3q8vw3wb.js → chunk-ccxsf02q.js} +2 -2
  93. package/dist/{chunk-dx5hh359.js → chunk-cf7cw2tj.js} +3 -3
  94. package/dist/{chunk-erp1g3as.js → chunk-ckja1ppp.js} +2 -2
  95. package/dist/{chunk-tgnftxyb.js → chunk-cpe6vtpe.js} +2 -2
  96. package/dist/{chunk-dd9k5bbt.js → chunk-cpy7x31t.js} +2 -2
  97. package/dist/{chunk-syjt7y4v.js → chunk-cvn9zbbc.js} +2 -2
  98. package/dist/chunk-dd0f44xb.js +2 -0
  99. package/dist/{chunk-brv52tgj.js → chunk-djd3sjp9.js} +2 -2
  100. package/dist/{chunk-vqby71fp.js → chunk-dmq2fx7g.js} +2 -2
  101. package/dist/{chunk-vdt7cp6c.js → chunk-dnh1e01b.js} +2 -2
  102. package/dist/chunk-dpfjxym1.js +2 -0
  103. package/dist/{chunk-ps408sxd.js → chunk-dyks7e24.js} +2 -2
  104. package/dist/{chunk-5bhp61sd.js → chunk-dzpbbys1.js} +2 -2
  105. package/dist/{chunk-pqz2471h.js → chunk-e04g26qm.js} +2 -2
  106. package/dist/chunk-e27d47yd.js +2 -0
  107. package/dist/{chunk-cans04tz.js → chunk-eavqh5fb.js} +3 -3
  108. package/dist/{chunk-55m88zbv.js → chunk-ec4q4rw7.js} +2 -2
  109. package/dist/chunk-ep9vq47f.js +2 -0
  110. package/dist/{chunk-d582db8v.js → chunk-evethx5n.js} +2 -2
  111. package/dist/{chunk-q3s59jyn.js → chunk-evsyhxz1.js} +2 -2
  112. package/dist/{chunk-r5f77gtx.js → chunk-f4h84pav.js} +2 -2
  113. package/dist/{chunk-dheg4bs2.js → chunk-ffs5nkt0.js} +2 -2
  114. package/dist/chunk-fjrghy92.js +2 -0
  115. package/dist/{chunk-84p483n0.js → chunk-fqdtx7tp.js} +2 -2
  116. package/dist/{chunk-0jg7hgp5.js → chunk-ga265p00.js} +2 -2
  117. package/dist/{chunk-95ywdfe0.js → chunk-gds55pjg.js} +2 -2
  118. package/dist/{chunk-wpacvdsv.js → chunk-gea1q14z.js} +2 -2
  119. package/dist/{chunk-v9weanq6.js → chunk-gnd32zkx.js} +2 -2
  120. package/dist/{chunk-jp4xjks0.js → chunk-gvqvw7ms.js} +2 -2
  121. package/dist/{chunk-z6dx6dnt.js → chunk-gya560n0.js} +2 -2
  122. package/dist/chunk-gyw21vnb.js +2 -0
  123. package/dist/{chunk-w562jf57.js → chunk-gzc704c3.js} +2 -2
  124. package/dist/{chunk-nqt9gyz9.js → chunk-heqa4swe.js} +2 -2
  125. package/dist/{chunk-vev9q4t4.js → chunk-hygvdjq6.js} +3 -3
  126. package/dist/{chunk-cp4wxmh5.js → chunk-hyr8yww9.js} +2 -2
  127. package/dist/chunk-j8ehajmt.js +2 -0
  128. package/dist/{chunk-rn54592t.js → chunk-jca8s47n.js} +2 -2
  129. package/dist/{chunk-wde0m4pf.js → chunk-jf2bxzee.js} +3 -3
  130. package/dist/{chunk-3qedn07q.js → chunk-jfrj2qg1.js} +2 -2
  131. package/dist/{chunk-3tvq6xr2.js → chunk-jg4c3zg4.js} +2 -2
  132. package/dist/{chunk-p96vgnxw.js → chunk-jggts370.js} +2 -2
  133. package/dist/{chunk-75dr7tyz.js → chunk-jra2q5cx.js} +2 -2
  134. package/dist/{chunk-3nawfa7b.js → chunk-jz7dnk88.js} +2 -2
  135. package/dist/chunk-k44dkkpg.js +2 -0
  136. package/dist/{chunk-zzz6kmh8.js → chunk-k7h34p5z.js} +2 -2
  137. package/dist/{chunk-jmc7ddz8.js → chunk-kfgy61cg.js} +3 -3
  138. package/dist/{chunk-bapn03er.js → chunk-kfm1sz3q.js} +2 -2
  139. package/dist/{chunk-k5nd3vyq.js → chunk-kj3a1k2q.js} +2 -2
  140. package/dist/{chunk-4d9sajzj.js → chunk-kj3t4mqf.js} +2 -2
  141. package/dist/{chunk-84zzf0ys.js → chunk-kk9dbwd1.js} +2 -2
  142. package/dist/{chunk-je27hf3t.js → chunk-kqekfj3v.js} +3 -3
  143. package/dist/{chunk-grfrfh7s.js → chunk-kvnbmt00.js} +2 -2
  144. package/dist/{chunk-ncgwbdmj.js → chunk-m8pkmbtf.js} +2 -2
  145. package/dist/{chunk-swqbbw8q.js → chunk-m8tt5bf9.js} +2 -2
  146. package/dist/{chunk-fwb6tf7m.js → chunk-mdf155e1.js} +2 -2
  147. package/dist/chunk-mhzqhd85.js +2 -0
  148. package/dist/{chunk-gjtxked2.js → chunk-ms0h8x63.js} +2 -2
  149. package/dist/chunk-mz90kcyd.js +2 -0
  150. package/dist/chunk-mzd9qfmj.js +2 -0
  151. package/dist/{chunk-0bv3tw1m.js → chunk-n0q8e6sq.js} +2 -2
  152. package/dist/{chunk-why9g2kd.js → chunk-n8mexbh4.js} +2 -2
  153. package/dist/{chunk-18kdsdmy.js → chunk-ndfyste3.js} +2 -2
  154. package/dist/{chunk-cv0qbty5.js → chunk-ngvdcqmt.js} +3 -3
  155. package/dist/{chunk-etvdqkvb.js → chunk-nh56sb8e.js} +2 -2
  156. package/dist/{chunk-2yvj9k42.js → chunk-nzgjcp8w.js} +2 -2
  157. package/dist/{chunk-m2n6sxf8.js → chunk-p79keq5q.js} +2 -2
  158. package/dist/{chunk-n4wp3h3j.js → chunk-p83pk7ff.js} +2 -2
  159. package/dist/chunk-p8cm3xw1.js +2 -0
  160. package/dist/{chunk-h3mwzf3d.js → chunk-pccwq2dd.js} +3 -3
  161. package/dist/{chunk-e3nccytb.js → chunk-phsvgv0f.js} +1 -1
  162. package/dist/{chunk-hf5bpahd.js → chunk-pk931bpm.js} +2 -2
  163. package/dist/{chunk-gbsn1qep.js → chunk-pqs039wv.js} +3 -3
  164. package/dist/{chunk-jgqt7k0h.js → chunk-q01vmp9m.js} +2 -2
  165. package/dist/{chunk-bf7sgpzq.js → chunk-q46z21zs.js} +2 -2
  166. package/dist/{chunk-p3gawvqr.js → chunk-q5qqhqw4.js} +2 -2
  167. package/dist/chunk-q73jne25.js +2 -0
  168. package/dist/{chunk-5mjs63fv.js → chunk-qqphgn9b.js} +2 -2
  169. package/dist/{chunk-747qe35q.js → chunk-r06hycq5.js} +2 -2
  170. package/dist/{chunk-e00dz09f.js → chunk-r1sj7c91.js} +2 -2
  171. package/dist/{chunk-zyn0ys4m.js → chunk-r4nz54dh.js} +2 -2
  172. package/dist/{chunk-7tw7rn0m.js → chunk-r7paw6ba.js} +2 -2
  173. package/dist/{chunk-ermc9p1p.js → chunk-r8pm74zf.js} +2 -2
  174. package/dist/{chunk-ftsnryz8.js → chunk-rb4p3h5b.js} +2 -2
  175. package/dist/chunk-rerm6x2f.js +2 -0
  176. package/dist/{chunk-pxr5snwm.js → chunk-rkejggyx.js} +2 -2
  177. package/dist/{chunk-cgnzqmqd.js → chunk-rkks48gw.js} +2 -2
  178. package/dist/{chunk-fnm2xznx.js → chunk-rncvy5pp.js} +2 -2
  179. package/dist/{chunk-w5zvy4ex.js → chunk-rt1c2p25.js} +2 -2
  180. package/dist/{chunk-d71nz1je.js → chunk-s81m6yx7.js} +2 -2
  181. package/dist/{chunk-j8zpjnf8.js → chunk-s89p3zgn.js} +2 -2
  182. package/dist/chunk-sgbn37kz.js +2 -0
  183. package/dist/{chunk-nrpgmawz.js → chunk-sjqhtpzr.js} +2 -2
  184. package/dist/{chunk-qkn0y5wx.js → chunk-smf7c649.js} +2 -2
  185. package/dist/{chunk-v32jvbgx.js → chunk-snxpc6yr.js} +2 -2
  186. package/dist/{chunk-v2pa8yak.js → chunk-sy1rf5m0.js} +3 -3
  187. package/dist/{chunk-j2ffde9c.js → chunk-t50b1s7h.js} +5 -5
  188. package/dist/chunk-t7xbh36h.js +2 -0
  189. package/dist/{chunk-b2n5sj31.js → chunk-t9xkg3pk.js} +2 -2
  190. package/dist/{chunk-c13rnm7b.js → chunk-tftfggte.js} +2 -2
  191. package/dist/{chunk-0enb3f4n.js → chunk-tghj342y.js} +2 -2
  192. package/dist/{chunk-dxwbgg69.js → chunk-tj4b0s68.js} +2 -2
  193. package/dist/{chunk-zw4ehzza.js → chunk-tk66t919.js} +4 -4
  194. package/dist/{chunk-v0wmy9b3.js → chunk-tky568fy.js} +2 -2
  195. package/dist/{chunk-bzzx1y15.js → chunk-tm5w5srq.js} +2 -2
  196. package/dist/{chunk-9neb2f30.js → chunk-tmec4by7.js} +2 -2
  197. package/dist/{chunk-ypdh88cj.js → chunk-tnzz1j83.js} +2 -2
  198. package/dist/{chunk-zypgrbd9.js → chunk-tpdyjp90.js} +2 -2
  199. package/dist/{chunk-16dyzkha.js → chunk-trxf8c70.js} +2 -2
  200. package/dist/{chunk-sjm9p42x.js → chunk-ty2cd00p.js} +2 -2
  201. package/dist/{chunk-y8gz9rsc.js → chunk-ty9sa6we.js} +2 -2
  202. package/dist/{chunk-y3mx5sf0.js → chunk-tzczzqde.js} +2 -2
  203. package/dist/chunk-v042t2he.js +2 -0
  204. package/dist/{chunk-e9nvbe3j.js → chunk-v9v1v41p.js} +2 -2
  205. package/dist/{chunk-zv3bm3np.js → chunk-vbbndjfd.js} +2 -2
  206. package/dist/{chunk-jdwd4ta9.js → chunk-vbk36ptt.js} +3 -3
  207. package/dist/{chunk-g3y0r56h.js → chunk-vnh0jnr4.js} +2 -2
  208. package/dist/{chunk-mfmh7ztq.js → chunk-vzm88w2r.js} +2 -2
  209. package/dist/chunk-w368gk92.js +2 -0
  210. package/dist/chunk-x1mzrhtd.js +2 -0
  211. package/dist/{chunk-y8yawx3d.js → chunk-xhbxpk0z.js} +2 -2
  212. package/dist/chunk-xk6f2raz.js +4 -0
  213. package/dist/{chunk-0m4s668v.js → chunk-xsn2g4kk.js} +2 -2
  214. package/dist/chunk-y6p8xspr.js +2 -0
  215. package/dist/chunk-y85askf9.js +2 -0
  216. package/dist/{chunk-c22xq7a3.js → chunk-y8fmawc6.js} +3 -3
  217. package/dist/{chunk-xe7ep70k.js → chunk-yc47rq4m.js} +2 -2
  218. package/dist/{chunk-64cbt3ym.js → chunk-ykz0h1r0.js} +2 -2
  219. package/dist/{chunk-52wrk1mh.js → chunk-ymgc4317.js} +2 -2
  220. package/dist/{chunk-1gr60c40.js → chunk-ypgvt8ky.js} +2 -2
  221. package/dist/{chunk-4sfxcw58.js → chunk-z4jv8svx.js} +3 -3
  222. package/dist/chunk-z6zsmpyz.js +2 -0
  223. package/dist/chunk-zpcd9w2t.js +2 -0
  224. package/dist/{chunk-c7qzvt21.js → chunk-zr8yk5np.js} +3 -3
  225. package/dist/chunk-ztm4agfw.js +3 -0
  226. package/dist/client.js +1 -1
  227. package/dist/codex/activity-group.js +1 -1
  228. package/dist/codex/artifact-links.js +1 -1
  229. package/dist/codex/assistant-message.js +1 -1
  230. package/dist/codex/async-question-card.js +1 -1
  231. package/dist/codex/edited-files-card.js +1 -1
  232. package/dist/codex/image-view-activity.js +1 -1
  233. package/dist/codex/markdown-renderer.js +1 -1
  234. package/dist/codex/navigation-audio.js +1 -1
  235. package/dist/codex/navigation-preview.js +1 -1
  236. package/dist/codex/navigation-rail.js +1 -1
  237. package/dist/codex/patch-view.js +1 -1
  238. package/dist/codex/plan.js +1 -1
  239. package/dist/codex/timeline-virtualizer.js +1 -1
  240. package/dist/codex/turn-activity.js +1 -1
  241. package/dist/codex/user-message.js +1 -1
  242. package/dist/codex/virtualized-turn-list.js +1 -1
  243. package/dist/collections/collection-emoji.js +1 -1
  244. package/dist/collections/collection-menu.js +1 -1
  245. package/dist/collections/collection-panel.js +1 -1
  246. package/dist/collections/collections.js +1 -1
  247. package/dist/collections/host.js +1 -1
  248. package/dist/collections/locales.js +1 -1
  249. package/dist/collections/model.js +1 -1
  250. package/dist/collections/store.js +1 -1
  251. package/dist/composer/completion-filter.js +1 -1
  252. package/dist/composer/completion-menu.js +1 -1
  253. package/dist/composer/completion-trigger.js +1 -1
  254. package/dist/composer/effort-slider.js +1 -1
  255. package/dist/composer/inline-document.js +1 -1
  256. package/dist/composer/inline-dom.js +1 -1
  257. package/dist/composer/menu-radio.js +1 -1
  258. package/dist/composer/model-select.js +1 -1
  259. package/dist/composer/permission-mode-select.js +1 -1
  260. package/dist/composer/prompt-input-attachments.js +1 -1
  261. package/dist/composer/prompt-input-clipboard.js +1 -1
  262. package/dist/composer/prompt-input-context.js +1 -1
  263. package/dist/composer/prompt-input-inline.js +1 -1
  264. package/dist/composer/prompt-input-textarea.js +1 -1
  265. package/dist/composer/prompt-input.js +1 -1
  266. package/dist/conversation/action-card.js +1 -1
  267. package/dist/conversation/composer/app-mentions.js +1 -1
  268. package/dist/conversation/composer/apps-menu.js +1 -1
  269. package/dist/conversation/composer/composer-menu.js +1 -1
  270. package/dist/conversation/composer/composer.js +1 -1
  271. package/dist/conversation/composer/config-options.js +1 -1
  272. package/dist/conversation/composer/context.js +1 -1
  273. package/dist/conversation/composer/drafts.d.ts +2 -1
  274. package/dist/conversation/composer/drafts.js +1 -1
  275. package/dist/conversation/composer/file-items.js +1 -1
  276. package/dist/conversation/composer/long-text.js +1 -1
  277. package/dist/conversation/composer/mention-chips.js +1 -1
  278. package/dist/conversation/composer/mention-uri.js +1 -1
  279. package/dist/conversation/composer/model-menu.js +1 -1
  280. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  281. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  282. package/dist/conversation/composer/prediction.js +1 -1
  283. package/dist/conversation/composer/prompt-history.js +1 -1
  284. package/dist/conversation/composer/slash-command-button.js +1 -1
  285. package/dist/conversation/composer/submit-button.js +1 -1
  286. package/dist/conversation/composer/usage-meter.js +1 -1
  287. package/dist/conversation/connection-notice.js +1 -1
  288. package/dist/conversation/context.js +1 -1
  289. package/dist/conversation/conversation-body.js +1 -1
  290. package/dist/conversation/conversation-search.js +1 -1
  291. package/dist/conversation/conversation-view.js +1 -1
  292. package/dist/conversation/conversation.d.ts +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.js +1 -1
  311. package/dist/lib/app-reference.js +1 -1
  312. package/dist/lib/application-metadata.js +1 -1
  313. package/dist/lib/chat-path.js +1 -1
  314. package/dist/lib/code-highlighter.js +1 -1
  315. package/dist/lib/file-url.js +1 -1
  316. package/dist/lib/fuzzy.js +1 -1
  317. package/dist/lib/group-blocks.js +1 -1
  318. package/dist/lib/image-encode.js +1 -1
  319. package/dist/lib/limits.js +1 -1
  320. package/dist/lib/markdown-parser.js +1 -1
  321. package/dist/lib/markdown-rules.js +1 -1
  322. package/dist/lib/model-name.js +1 -1
  323. package/dist/lib/prepare-prompt-files.js +1 -1
  324. package/dist/lib/reference-presentation.js +1 -1
  325. package/dist/lib/stream-style.js +1 -1
  326. package/dist/lib/streaming-markdown.js +1 -1
  327. package/dist/lib/tool-artifacts.js +1 -1
  328. package/dist/locales.js +1 -1
  329. package/dist/mermaid/diagram.js +1 -1
  330. package/dist/mermaid/export.js +1 -1
  331. package/dist/mermaid/index.js +1 -1
  332. package/dist/mermaid/preview.js +1 -1
  333. package/dist/oauth/claude-login.js +1 -1
  334. package/dist/oauth.js +1 -1
  335. package/dist/plugins/catalog-header.js +1 -1
  336. package/dist/plugins/catalog-skeleton.js +1 -1
  337. package/dist/plugins/host.js +1 -1
  338. package/dist/plugins/new-chat-directory.js +1 -1
  339. package/dist/plugins/panel-item.js +1 -1
  340. package/dist/plugins/plugin-detail-page.js +1 -1
  341. package/dist/plugins/plugin-icon.js +1 -1
  342. package/dist/plugins/plugin-icons.js +1 -1
  343. package/dist/plugins/plugins-page.js +1 -1
  344. package/dist/plugins/plugins.js +1 -1
  345. package/dist/plugins/read-skill-document.js +1 -1
  346. package/dist/plugins/skill-document.js +1 -1
  347. package/dist/plugins/skills-tab.js +1 -1
  348. package/dist/plugins/store.js +1 -1
  349. package/dist/plugins/toolbox-layout.js +1 -1
  350. package/dist/reference-projection.js +1 -1
  351. package/dist/search/chat-search.js +1 -1
  352. package/dist/search/codex-source-matches.js +1 -1
  353. package/dist/search/dom-matches.js +1 -1
  354. package/dist/search/find-bar.js +1 -1
  355. package/dist/search/literal-matches.js +1 -1
  356. package/dist/session-list/account-menu.js +1 -1
  357. package/dist/session-list/activity-list.js +1 -1
  358. package/dist/session-list/archived-sessions.js +1 -1
  359. package/dist/session-list/help-menu.js +1 -1
  360. package/dist/session-list/highlight.js +1 -1
  361. package/dist/session-list/host.js +1 -1
  362. package/dist/session-list/hover-info-card.js +1 -1
  363. package/dist/session-list/locales.js +1 -1
  364. package/dist/session-list/navigation-controls.js +1 -1
  365. package/dist/session-list/navigation-header.js +1 -1
  366. package/dist/session-list/navigation-store.js +1 -1
  367. package/dist/session-list/navigation-tabs.js +1 -1
  368. package/dist/session-list/navigation.js +1 -1
  369. package/dist/session-list/platform.js +1 -1
  370. package/dist/session-list/row-stop-button.js +1 -1
  371. package/dist/session-list/session-groups.js +1 -1
  372. package/dist/session-list/session-info-card.js +1 -1
  373. package/dist/session-list/session-list.js +1 -1
  374. package/dist/session-list/session-row.js +1 -1
  375. package/dist/session-list/session-state-dot.js +1 -1
  376. package/dist/session-list/session-state-menu.js +1 -1
  377. package/dist/session-list/shortcut-hint.js +1 -1
  378. package/dist/session-list/shortcut.js +1 -1
  379. package/dist/session-list/sidebar-overlay.js +1 -1
  380. package/dist/session-list/trailing-swap.js +1 -1
  381. package/dist/session-list/use-activity-notification.js +1 -1
  382. package/dist/session-list/use-activity-preview.js +1 -1
  383. package/dist/session-list/use-cmd-held.js +1 -1
  384. package/dist/session-list/use-project-sessions.js +1 -1
  385. package/dist/session-list/virtual-session-rows.js +1 -1
  386. package/dist/session-timeline/activity-group.js +1 -1
  387. package/dist/session-timeline/activity-projection.js +1 -1
  388. package/dist/session-timeline/assistant-content.js +1 -1
  389. package/dist/session-timeline/assistant-image-references.js +1 -1
  390. package/dist/session-timeline/assistant-turn.js +1 -1
  391. package/dist/session-timeline/async-questions.js +1 -1
  392. package/dist/session-timeline/edited-files-card.js +1 -1
  393. package/dist/session-timeline/history-timeline.js +1 -1
  394. package/dist/session-timeline/host.js +1 -1
  395. package/dist/session-timeline/image-generation-progress.js +1 -1
  396. package/dist/session-timeline/navigation-rail.js +1 -1
  397. package/dist/session-timeline/plan.js +1 -1
  398. package/dist/session-timeline/question-reply.js +1 -1
  399. package/dist/session-timeline/resource-content.js +1 -1
  400. package/dist/session-timeline/session-timeline.js +1 -1
  401. package/dist/session-timeline/timeline-registry.js +1 -1
  402. package/dist/session-timeline/turn-activity.js +1 -1
  403. package/dist/session-timeline/turn-error.js +1 -1
  404. package/dist/session-timeline/turn-retry.js +1 -1
  405. package/dist/session-timeline/turn-time.js +1 -1
  406. package/dist/session-timeline/turns.js +1 -1
  407. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  408. package/dist/session-timeline/user-message.js +1 -1
  409. package/dist/settings/codex-account-card.js +1 -1
  410. package/dist/settings/login-card.js +1 -1
  411. package/dist/settings/model-alias-settings.js +1 -1
  412. package/dist/settings/model-aliases.js +1 -1
  413. package/dist/settings/provider-logos.js +1 -1
  414. package/dist/settings/provider-section.js +1 -1
  415. package/dist/settings/providers-port.js +1 -1
  416. package/dist/settings/providers.js +1 -1
  417. package/dist/settings/settings-bridge.js +1 -1
  418. package/dist/settings/settings.js +1 -1
  419. package/native/win32-x64/alwith_native_chat.dll +0 -0
  420. package/native/win32-x64/artifact.json +1 -1
  421. package/package.json +2 -2
  422. package/dist/chunk-24y0mvqf.js +0 -2
  423. package/dist/chunk-2bbdgf43.js +0 -2
  424. package/dist/chunk-2f8s5gtn.js +0 -2
  425. package/dist/chunk-317w17va.js +0 -2
  426. package/dist/chunk-51xk5tw2.js +0 -2
  427. package/dist/chunk-5x5n3b15.js +0 -2
  428. package/dist/chunk-6ym1a5wa.js +0 -2
  429. package/dist/chunk-81838qem.js +0 -2
  430. package/dist/chunk-8gt8yn8k.js +0 -4
  431. package/dist/chunk-94m77zyn.js +0 -2
  432. package/dist/chunk-9nbkggqn.js +0 -2
  433. package/dist/chunk-9wc4emwt.js +0 -2
  434. package/dist/chunk-a11wvd8e.js +0 -2
  435. package/dist/chunk-acf4sdp7.js +0 -2
  436. package/dist/chunk-aht6f6tf.js +0 -2
  437. package/dist/chunk-amf0m4tb.js +0 -2
  438. package/dist/chunk-ax7c2kam.js +0 -2
  439. package/dist/chunk-bztkz3dz.js +0 -2
  440. package/dist/chunk-chn1mkv0.js +0 -2
  441. package/dist/chunk-e1fzfaqj.js +0 -2
  442. package/dist/chunk-g1tbd3pd.js +0 -2
  443. package/dist/chunk-hd11bfmp.js +0 -2
  444. package/dist/chunk-j62heyzq.js +0 -2
  445. package/dist/chunk-k2nbrerw.js +0 -2
  446. package/dist/chunk-knrc6kks.js +0 -2
  447. package/dist/chunk-kqwfwck2.js +0 -2
  448. package/dist/chunk-mckz9qv5.js +0 -2
  449. package/dist/chunk-njqan8zg.js +0 -2
  450. package/dist/chunk-pg9gckmw.js +0 -2
  451. package/dist/chunk-qzn6qtmy.js +0 -2
  452. package/dist/chunk-rkwq0grt.js +0 -2
  453. package/dist/chunk-rv3k0kfr.js +0 -2
  454. package/dist/chunk-s1nfyggb.js +0 -2
  455. package/dist/chunk-s8cj6aw6.js +0 -2
  456. package/dist/chunk-stv8pr4v.js +0 -2
  457. package/dist/chunk-t9t53gsj.js +0 -3
  458. package/dist/chunk-vd6eqshg.js +0 -2
  459. package/dist/chunk-vzgn8exd.js +0 -2
  460. package/dist/chunk-w5q2ygsa.js +0 -2
  461. package/dist/chunk-y4tj08c1.js +0 -2
  462. package/dist/chunk-zft4afb8.js +0 -2
  463. package/dist/chunk-zm0j9nw3.js +0 -2
@@ -1 +1 @@
1
- import{$s,qs,Ks}from"../chunk-3q8vw3wb.js";import"../chunk-2bbdgf43.js";import"../chunk-vdt7cp6c.js";import"../chunk-q3s59jyn.js";import"../chunk-1wr1ef9x.js";import"../chunk-c22xq7a3.js";import"../chunk-c13rnm7b.js";import"../chunk-y8gz9rsc.js";import"../chunk-acf4sdp7.js";import"../chunk-cans04tz.js";import"../chunk-w5q2ygsa.js";import"../chunk-mckz9qv5.js";import{Jt}from"../chunk-v32jvbgx.js";import{Zt,di,Qt}from"../chunk-4a4awnss.js";import{Hn,Un,Bn,Gn}from"../chunk-dd9k5bbt.js";import{R,bt,Ct,he,S,ya,se,Dn,Fn,xa,wt,ba}from"../chunk-3z86hy2s.js";import"../chunk-4d9sajzj.js";import{Di,Fi,Pn,fa,In,Ue}from"../chunk-bztkz3dz.js";import{si,Ws,ai,li,ci,Xn}from"../chunk-jmc7ddz8.js";import{pt,Xt,Yt}from"../chunk-bgnxw313.js";import{Zs}from"../chunk-0e5dx357.js";export{Qt as CodexAccountCard,di as CodexAccountSummary,Xn as CustomProviderEditor,Hn as DeepSeekLogo,Un as GrokLogo,Jt as LoginCard,pt as MODEL_ALIASES_KEY,wt as MODEL_PRESENTATION,si as ManagedProviderSection,Zs as ModelAliasSettings,Bn as OpenRouterLogo,R as PROVIDERS,Di as PROVIDERS_CHANGED,Fi as PROVIDERS_REVOKED,ci as ProviderRow,Ws as ProviderSection,ai as ProviderTabs,Gn as QwenLogo,li as TestFeedback,Zt as UsageLimitRow,In as applyProvidersWhenIdle,$s as codexSettingsBridge,fa as createManagedProvidersPort,Pn as createProvidersPort,Ks as createSettingsBridgeClient,xa as customModelEffort,S as gatewayModelId,bt as isAccountModel,Ct as parseCustomModels,ba as presentModel,Fn as providerApplicationPending,he as providerGroups,Dn as providerKeyUrl,se as providerRegion,ya as resolveSessionModel,Yt as saveModelAlias,qs as serveSettingsBridge,Xt as useModelAliases,Ue as useProviders};
1
+ import{Ns,As,Es}from"../chunk-ccxsf02q.js";import"../chunk-t7xbh36h.js";import"../chunk-dnh1e01b.js";import"../chunk-evsyhxz1.js";import"../chunk-0q22f9vw.js";import"../chunk-y8fmawc6.js";import"../chunk-tftfggte.js";import"../chunk-ty9sa6we.js";import"../chunk-3r57tgvf.js";import"../chunk-eavqh5fb.js";import"../chunk-p8cm3xw1.js";import"../chunk-zpcd9w2t.js";import{Qt}from"../chunk-snxpc6yr.js";import{Wt,si,Zt}from"../chunk-7zafb413.js";import{Tn,Mn,Nn,An}from"../chunk-cpy7x31t.js";import{A,yt,xt,me,S,Js,ie,Pn,In,Xs,bt,Ys}from"../chunk-5k4ec37x.js";import"../chunk-kj3t4mqf.js";import{Vi,ji,bn,qs,Cn,Ee}from"../chunk-v042t2he.js";import{ni,Ts,oi,ii,ri,Yn}from"../chunk-kfgy61cg.js";import{ct,qt,Kt}from"../chunk-81hv0s07.js";import{Ms}from"../chunk-6bhfdsyz.js";export{Zt as CodexAccountCard,si as CodexAccountSummary,Yn as CustomProviderEditor,Tn as DeepSeekLogo,Mn as GrokLogo,Qt as LoginCard,ct as MODEL_ALIASES_KEY,bt as MODEL_PRESENTATION,ni as ManagedProviderSection,Ms as ModelAliasSettings,Nn as OpenRouterLogo,A as PROVIDERS,Vi as PROVIDERS_CHANGED,ji as PROVIDERS_REVOKED,ri as ProviderRow,Ts as ProviderSection,oi as ProviderTabs,An as QwenLogo,ii as TestFeedback,Wt as UsageLimitRow,Cn as applyProvidersWhenIdle,Ns as codexSettingsBridge,qs as createManagedProvidersPort,bn as createProvidersPort,Es as createSettingsBridgeClient,Xs as customModelEffort,S as gatewayModelId,yt as isAccountModel,xt as parseCustomModels,Ys as presentModel,In as providerApplicationPending,me as providerGroups,Pn as providerKeyUrl,ie as providerRegion,Js as resolveSessionModel,Kt as saveModelAlias,As as serveSettingsBridge,qt as useModelAliases,Ee as useProviders};
@@ -4,5 +4,5 @@
4
4
  "abi": 1,
5
5
  "target": "x86_64-pc-windows-msvc",
6
6
  "binary": "alwith_native_chat.dll",
7
- "sha256": "2a25af318eca9e2bb109edad7e363d1fc79f5119a8ba5d732b946202831d6e67"
7
+ "sha256": "7fbecc012aa5d8e3e4cb420ed2f7b63c14cc313c8d9c8ad498e1f935cd9d33ca"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.6.26",
3
+ "version": "0.6.28",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -407,7 +407,7 @@
407
407
  "@dnd-kit/utilities": "^3.2.2",
408
408
  "@floating-ui/dom": "^1.8.0",
409
409
  "@modelcontextprotocol/server": "^2.4.0",
410
- "@nyssance/codex-acp-v2": "^0.7.77",
410
+ "@nyssance/codex-acp-v2": "^0.7.78",
411
411
  "@nyssance/shadcn": "^4.23.4",
412
412
  "@shadcn/react": "^0.3.1",
413
413
  "@solar-icons/react": "^2.6.0",
@@ -1,2 +0,0 @@
1
- import{Ne}from"./chunk-ermc9p1p.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function ni({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:Ne(t)}):null}function oi({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(ni,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Kt({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(oi,{label:t,shortcut:o}):t})]})}
2
- export{ni,oi,Kt};
@@ -1,2 +0,0 @@
1
- var aa={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Si(e){return[...e].toSorted((o,n)=>(aa[o.kind]??99)-(aa[n.kind]??99))}function ja(e){return e==="allow_once"||e==="allow_always"}function $a(e){return e==="allow_always"||e==="reject_always"}
2
- export{aa,Si,ja,$a};
@@ -1,2 +0,0 @@
1
- import{fromMcpServer as I}from"@agentclientprotocol/sdk/experimental/mcp-server";import{MCP_META_CLIENT_CAPABILITIES as h,MCP_META_CLIENT_INFO as T,MCP_META_PROTOCOL_VERSION as v,MCP_PROTOCOL_VERSION as w,McpBindingErrorCode as A}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{Server as C}from"@modelcontextprotocol/server";function Rn(n){let{parse:t,execute:e,...s}=n;return{...s,execute:(o,i)=>e(t(o),i)}}var co="alwith";function S(n){if(n.length>128)throw Error("Too many application tools");let t=new Map;for(let e of n){if(!/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/.test(e.name)||t.has(e.name))throw Error(`Invalid or duplicate application tool: ${e.name}`);if(!e.description.trim()||e.inputSchema.type!=="object")throw Error(`Invalid application tool definition: ${e.name}`);t.set(e.name,{...e,inputSchema:structuredClone(e.inputSchema)})}return t}class p extends Error{code;data;constructor(n,t,e){super(t);this.code=n,this.data=e}}var m=(n)=>({content:[{type:"text",text:n instanceof Error?n.message:String(n)}],isError:!0});class uo{servers=new Map;requests=new Map;session;identity;constructor(n,t){this.session=n,this.identity=t}declare(n){let t=crypto.randomUUID(),e={tools:S(n),sessionId:null,active:new Map,calls:new Map,mcp:I(()=>this.server(e))};return this.servers.set(t,e),{type:"acp",name:co,serverId:t}}bind(n,t){let e=this.servers.get(n);if(!e)throw Error(`Application tool server is not registered: ${n}`);for(let[s,o]of this.servers)if(o.sessionId===t)this.dispose(s);e.sessionId=t}cancel(n){for(let t of this.servers.values())if(t.sessionId===n)for(let e of t.active.values())e.abort()}drop(n){for(let[t,e]of this.servers)if(e.sessionId===n)this.dispose(t)}clear(){for(let n of this.servers.keys())this.dispose(n)}dispose(n){let t=this.servers.get(n);if(!t)return;this.servers.delete(n);for(let e of t.active.values())e.abort();t.mcp.close()}withdraw(n){let t=this.requests.get(JSON.stringify(n));if(!t)return!1;return t.abort(),!0}handle(n,t){if(t.method!=="mcp/message")return!1;let e=JSON.stringify(t.id),s=new AbortController;return this.requests.set(e,s),this.message(n,t.params,s.signal).then((o)=>n.respond(t.id,o),(o)=>n.respond(t.id,void 0,o instanceof p?{code:o.code,message:o.message,...o.data===void 0?{}:{data:o.data}}:{code:A.backendFailed,message:"MCP server handler failed",data:{details:o instanceof Error?o.message:String(o)}})).finally(()=>{if(this.requests.get(e)===s)this.requests.delete(e)}).catch(()=>{return}),!0}async message(n,t,e){let s=t;if(!s||typeof s!=="object"||typeof s.serverId!=="string"||typeof s.requestId!=="string"||typeof s.method!=="string"||s.params!=null&&(typeof s.params!=="object"||Array.isArray(s.params)))throw new p(-32602,"Invalid mcp/message params");let{serverId:o,requestId:i,method:c}=s,d=s.params??void 0,r=this.servers.get(o);if(!r)throw new p(A.serverUnavailable,"MCP server registration unavailable",{serverId:o});if(r.active.has(i))throw new p(-32602,"duplicate active MCP request ID",{serverId:o,requestId:i});let a=d?._meta,u=a?.[v],g=a?.[h];if(typeof u!=="string")return{error:{code:-32602,message:`missing ${v} in params._meta`}};if(u!==w)return{error:{code:-32022,message:"Unsupported protocol version",data:{supported:[w],requested:u}}};if(!g||typeof g!=="object"||Array.isArray(g))return{error:{code:-32602,message:`missing ${h} in params._meta`}};let l=new AbortController,y=()=>l.abort();if(e.addEventListener("abort",y,{once:!0}),r.active.set(i,l),r.sessionId!==null)r.calls.set(i,{agent:n,sessionId:r.sessionId,signal:l.signal});try{let f=await r.mcp.handler({serverId:o,requestId:i,method:c,params:d,protocolVersion:u,clientCapabilities:g,clientInfo:a?.[T],envelopeMeta:s._meta,signal:l.signal,notify:async()=>{return}});return l.signal.throwIfAborted(),f}catch(f){if(l.signal.aborted)throw new p(A.requestCancelled,"MCP request was cancelled");throw f}finally{e.removeEventListener("abort",y),r.active.delete(i),r.calls.delete(i)}}server(n){let t=new C({name:co,version:"1.0.0"},{capabilities:{tools:{}}});return t.setRequestHandler("tools/list",()=>({tools:[...n.tools.values()].map((e)=>({name:e.name,...e.title===void 0?{}:{title:e.title},description:e.description,inputSchema:structuredClone(e.inputSchema),...e.annotations===void 0?{}:{annotations:e.annotations}}))})),t.setRequestHandler("tools/call",async(e,s)=>{let o=n.calls.get(String(s.mcpReq.id)),i=n.tools.get(e.params.name);if(!i)return m(Error(`Application tool is not registered: ${e.params.name}`));if(!o)return m(Error("Application tool session is not attached"));let c=this.session(o.sessionId);if(!c?.attached||c.readOnly)return m(Error("Application tool session is not attached"));let{toolCallId:d,turnId:r}=this.identity(e.params._meta??{});try{o.signal.throwIfAborted();let a=await i.execute(e.params.arguments??{},{sessionId:o.sessionId,toolCallId:d,turnId:r,signal:o.signal,agent:o.agent});return o.signal.throwIfAborted(),a}catch(a){if(o.signal.aborted)throw a;return m(a)}}),t}}
2
- export{Rn,co,uo};
@@ -1,2 +0,0 @@
1
- function*So(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function xr(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of So(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
2
- export{So,xr};
@@ -1,2 +0,0 @@
1
- import{p}from"./chunk-4d9sajzj.js";function _s(r,n){return p.readSkillDocument({path:r,roots:n??null})}
2
- export{_s};
@@ -1,2 +0,0 @@
1
- import{createContext as t,useContext as o}from"react";var io=t(null);function hn(){let e=o(io);if(e===null)throw Error("Composer is missing");return e}
2
- export{io,hn};
@@ -1,2 +0,0 @@
1
- import{te}from"./chunk-9neb2f30.js";import{xt}from"./chunk-etvdqkvb.js";var fe={persistConfig:!0,nativeTools:{imageGeneration:!1},applicationContext:xt,parseConfig(e){if(typeof e.model!=="string"||typeof e.size!=="string"||Object.keys(e).some((t)=>t!=="model"&&t!=="size"))throw Error("Invalid image input config");let o={model:e.model,size:e.size};return te(o),o},routePrompt(e){return e.image()}};
2
- export{fe};
@@ -1,2 +0,0 @@
1
- function xi(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function eo(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function Ye(t){return t.type==="array"}function rn(t){return(Ye(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
- export{xi,eo,Ye,rn};
@@ -1,4 +0,0 @@
1
- import{fr}from"./chunk-tgnftxyb.js";import{Xi}from"./chunk-jvy6p83k.js";import{ms}from"./chunk-y4tj08c1.js";import{m,_,_t}from"./chunk-75dr7tyz.js";import{Ve}from"./chunk-s1nfyggb.js";import{tr,nr,or,ir,rr}from"./chunk-g3y0r56h.js";import{dr,ur}from"./chunk-why9g2kd.js";import{U}from"./chunk-4vayk46h.js";import{go}from"./chunk-zw4ehzza.js";import{po}from"./chunk-qa9p0a64.js";import{n}from"./chunk-y8gz9rsc.js";import{e}from"./chunk-acf4sdp7.js";import{oo,Ri}from"./chunk-xnbvdqnt.js";import{io}from"./chunk-5x5n3b15.js";import{r,Ei,X,fn}from"./chunk-rkwq0grt.js";import{un}from"./chunk-pxr5snwm.js";import{tt,mn}from"./chunk-amf0m4tb.js";import{yn,bn}from"./chunk-ax7c2kam.js";import{Mi}from"./chunk-d582db8v.js";import{wn}from"./chunk-9nbkggqn.js";import{Ni}from"./chunk-d71nz1je.js";import{Cn}from"./chunk-grfrfh7s.js";import{pn}from"./chunk-yryg27yy.js";import{Ti}from"./chunk-h3mwzf3d.js";import{Li}from"./chunk-v96vkrw2.js";import{vn}from"./chunk-mckz9qv5.js";import{hasFuzzyFileSearch as jt}from"@nyssance/codex-acp-v2/client";import{useCallback as w,useEffect as qt,useLayoutEffect as nt,useMemo as pt,useRef as N,useState as M}from"react";import{jsx as s,jsxs as R}from"react/jsx-runtime";var Gt=["image/png","image/jpeg","image/webp","image/gif"],st=[];async function Qt(o){let T=await(await fetch(o.url)).blob();return new Promise((I,S)=>{let E=new FileReader;E.onerror=()=>S(E.error),E.onload=()=>{let q=E.result;I(q.slice(q.indexOf(",")+1))},E.readAsDataURL(T)})}function Oe({session:o,onSubmit:T,onShellCommand:I,onHandOff:S,modelSelector:E,modelMenu:q,inputHeader:mt,actions:Mt,leadingTools:Rt,agentControls:G=!0,placeholder:Et,children:kt,attachmentPolicy:Dt,predictions:Nt=!0,disabled:St=!1,preparing:dt=!1,allowPendingInput:Ft=!1}){let{host:F,client:O}=e(),{t:g}=F,B=w((t)=>{if(F.reportError)F.reportError(t);else console.error(t)},[F]),[ut,H]=M(()=>({text:r.get(o.id)?.text??"",revision:0})),{text:v}=ut,[C,Ot]=M(()=>r.get(o.id)?.attachments??st),[y,Q]=M(()=>r.get(o.id)?.mentions??[]),[d,L]=M(()=>r.get(o.id)?.apps??[]),[ft,K]=M(()=>(r.get(o.id)?.apps?.length??0)>0||U(v,o.commands.map((t)=>t.name)).length>0),W=N(void 0),z=N(void 0);nt(()=>{if(d.length>0)K(!0)},[d.length]);let ot=C.some((t)=>tt(t)&&t.pastedText.status!=="ready"),[k,ht]=M(!1),[Y,Lt]=M(!1),[it,Wt]=M(!1),at=N(null),f=N(null),gt=N(null),c=N(ut),P=w((t)=>{gt.current?.(),c.current={text:t,revision:c.current.revision+1},H(c.current)},[]),xt=w((t)=>{let i=f.current;if(i?.insertApplication){i.insertApplication(t);return}let a=c.current.text,u=i?.getTextarea()?.selectionStart??a.length;z.current={text:a,apps:[]},W.current=u+1,K(!0),P(a),L((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:u}])},[P]),$t=w((t)=>{let i=f.current;if(i?.insertInvocation){i.insertInvocation(t);return}let a=c.current.text,u=i?.getTextarea(),l=u?.selectionStart??a.length,h=u?.selectionEnd??l,lt=`${a.slice(0,l)}${t} ${a.slice(h)}`;z.current={text:a,apps:[]},W.current=l+t.length+1,P(lt),K(!0)},[P]),yt=w(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),Ut=Ti(o,P,L,d.length>0||y.length>0||C.length>0),bt=pt(()=>({read:()=>{let i=f.current?.getTextarea(),a=i===null||i===void 0?[c.current.text.length,c.current.text.length]:[i.selectionStart,i.selectionEnd];return{target:o.id,...c.current,selection:a}},compareAndSet(i,a,u){if(f.current?.isComposing())return null;if(i.target!==o.id||i.revision!==c.current.revision)return null;c.current={text:a,revision:c.current.revision+1},H(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=a,l.setSelectionRange(u[0],u[1]);return{target:o.id,...c.current,selection:u}}}),[o.id]),j=N(null),vt=w((t)=>(j.current=t,()=>{if(j.current===t)j.current=null}),[]),V=o.state!=="idle",x=I!==void 0&&d.length===0&&v.startsWith("!"),J=(ft||d.length>0)&&!x,b=!St&&!dt&&o.attached&&!o.restoring&&!o.readOnly,D=!o.readOnly&&(Ft||b),Z=pn(o,b&&!k&&!Y&&!ot&&!it,v.length>0||C.length>0||y.length>0||d.length>0,Nt&&!x),Pt=Z.invalidate;nt(()=>{r.set(o.id,{text:v,attachments:C,mentions:y,...d.length>0?{apps:d}:{},modelId:r.get(o.id)?.modelId??null})},[o.id,v,C,y,d]),nt(()=>Ei(o.id,Ot),[o.id]),nt(()=>fn(o.id,(t)=>{if(!D||k)throw Error("The composer cannot take text now; try again later");if(v.length||C.length||y.length||d.length)throw Error("The composer already has a draft; send or clear it first");P(t)}),[o.id,D,k,v,C,y,d,P]);let It=n((t)=>jt(t.agent)),zt=pt(()=>It&&b?async(t)=>un((await O.fuzzyFileSearch({query:t,roots:[o.cwd],cancellationToken:null})).files):void 0,[O,It,b,o.cwd]),ct=w((t)=>{Q((i)=>i.includes(t)?i:[...i,t])},[]);qt(()=>{f.current?.focus()},[]);let At=w(async({text:t,files:i})=>{let a=I!==void 0&&d.length===0&&t.startsWith("!")?t.slice(1):null;if(a!==null){if(a.trim().length===0)return;if(i.length||y.length||d.length)throw Error("Shell commands cannot include file references or attachments");if(o.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let u=t.trim();if(u.length===0&&i.length===0&&y.length===0&&d.length===0)return;let l=j.current;ht(!0);let h=r.get(o.id),lt=c.current.revision,et=null;try{let A=d.map((p)=>({type:"resource_link",name:p.name,uri:`app://${p.id}`}));for(let p of y){let rt={kind:"file",absPath:p};A.push({type:"resource_link",uri:yn(rt),name:bn(rt)})}let Ct=ms(u,d);if(Ct.length>0)A.push({type:"text",text:Ct});for(let p of i)if(tt(p)){if(p.pastedText.status!=="ready")throw Error("Text attachment is not ready");A.push({type:"resource_link",uri:p.url,name:p.filename??"pasted-text.txt"})}else A.push({type:"image",data:await Qt(p),mimeType:p.mediaType});if(c.current.revision===lt&&r.get(o.id)===h)c.current={text:"",revision:c.current.revision+1},et=c.current.revision,H(c.current),Q([]),L([]),W.current=void 0,z.current=void 0,X(o.id,()=>st),r.set(o.id,{text:"",attachments:st,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(a!==null&&I)await I(a);else if(T)if(l===null)await T(A);else await T(A,(p)=>{if(l.signal.aborted||j.current!==l)return;l.accept(p),S?.(o.id,p)});else if(l===null)await O.prompt(o.id,A);else{let p=await O.prompt(o.id,A);l.accept(p)}Pt();for(let p of h?.attachments??[])if(p.url.startsWith("blob:")&&!r.get(o.id)?.attachments.some((rt)=>rt.id===p.id))URL.revokeObjectURL(p.url)}catch(A){if(h&&et!==null&&c.current.revision===et&&r.get(o.id)?.attachments.length===0&&r.get(o.id)?.mentions.length===0&&!r.get(o.id)?.apps?.length)c.current={text:h.text,revision:et+1},H(c.current),Q(h.mentions),L(h.apps??[]),r.set(o.id,h),X(o.id,()=>h.attachments);throw A}finally{ht(!1),f.current?.focus()}},[O,o.id,o.state,y,d,T,I,S,Pt]),Bt=()=>{O.cancel(o.id).catch(B)},Ht=w((t)=>{let i=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:Ve})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});B(i)},[B,g]),Kt=pt(()=>({session:o,ready:b,inputReady:D,sending:k,textareaRef:f,draft:bt,interruptRef:gt,observeReceipts:vt,addMention:ct,setAdding:Lt,shellMode:x,handsFree:!x&&(T===void 0||S!==void 0)}),[o,b,D,k,bt,vt,ct,T,S,x]),wt=F.writeTextAttachment,Tt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:Ut,bashMode:I!==void 0,disabled:!D,"aria-label":g("composer.placeholder"),placeholder:x?"! command":Z.text||Et||(V?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!J&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/"))){let i=_t(t.clipboardData);if(i?.apps.length){t.preventDefault();let a=t.currentTarget,u=m(i),l=_([...a.value.slice(0,a.selectionStart).split(""),...u,...a.value.slice(a.selectionEnd).split("")]);z.current={text:v,apps:[]},W.current=a.selectionStart+u.length,K(!0),L(l.apps),P(l.text);return}}if(wt)mn(t,o.id,g("composer.pastedTextFilename"),wt)}};return s(io,{value:Kt,children:s("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:R("div",{className:"relative",children:[mt&&s("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:mt}),s(fr,{attachmentPolicy:Dt,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},H(c.current)},attachments:C,onAttachmentsChange:(t)=>X(o.id,()=>t),children:R("div",{ref:at,className:"relative",children:[G&&!it&&s(Xi,{bashMode:I!==void 0,handleRef:f,commands:o.commands,renderSlashMenu:(t)=>s(oo,{anchorRef:at,commands:o.commands,query:t.query,includeAttachment:!1,disabled:!D,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(i)=>t.replaceQuery(()=>$t(i.startsWith("$")?i:`/${i}`)),onApp:(i)=>t.replaceQuery(()=>xt(i)),focusInput:yt}),searchFiles:zt,onMention:ct,onSearchError:B,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},J?"inline":"textarea"),R(tr,{"data-shell-mode":x||void 0,bashMode:I!==void 0,globalDrop:!0,multiple:!0,accept:Gt.join(","),onError:Ht,onSubmit:At,onSubmitAsync:At,onSubmitError:B,canSubmit:()=>b&&!k&&!Y&&!ot&&(!x||!V&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[kt,R(or,{className:"px-3 pt-3 pb-0 empty:hidden",children:[Y&&s("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),s(Mi,{mentions:y,onRemove:(t)=>Q((i)=>i.filter((a)=>a!==t))}),s(ur,{children:(t)=>tt(t)?s(Ni,{data:t,sessionId:o.id}):s(dr,{data:t,t:g})})]}),R(nr,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!Z.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab"||t.key==="ArrowRight"||t.key==="Enter")t.preventDefault(),t.stopPropagation(),P(Z.text)},children:[x&&s("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),J?s(go,{...Tt,skillIcon:F.skillIcon,skillNames:o.commands.map((t)=>t.name),applications:d,onApplicationsChange:L,initialCaret:W.current,initialUndo:z.current}):s(po,{...Tt,autoFocus:ft&&x})]}),s(ir,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:R("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[R("div",{className:"flex min-w-0 items-center gap-[5px]",children:[s(Ri,{anchorRef:at,commands:o.commands,disabled:!D,agentDisabled:!b||x,agentControls:G,open:it,onOpenChange:Wt,focusInput:yt,onCommand:(t)=>{let i=c.current.text,a=i.length===0||i.endsWith(`
2
- `)?i:`${i}
3
- `,u=t.startsWith("$")?t:`/${t}`,l=`${a}${u} `;if(!J)z.current={text:i,apps:[]},W.current=l.length,K(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:xt}),Rt,G&&s(Cn,{sessionId:o.id,options:o.configOptions,disabled:!b})]}),R(rr,{className:"w-full min-w-0 items-center justify-end gap-1",children:[G&&s(vn,{session:o}),E??s(wn,{...q,sessionId:o.id,options:o.configOptions,disabled:!b}),Mt,s(Li,{active:V,sending:k||dt||Y,ready:b&&!ot&&(!x||!V&&v.slice(1).trim().length>0),hasMentions:y.length>0||d.length>0,onStop:Bt})]})]})})]})]})})]})})})}
4
- export{Oe};
@@ -1,2 +0,0 @@
1
- import{ge}from"./chunk-7tw7rn0m.js";import{b}from"./chunk-a11wvd8e.js";import{y}from"./chunk-y8gz9rsc.js";import{hn}from"./chunk-5x5n3b15.js";import{Oe}from"./chunk-8gt8yn8k.js";import{Pn}from"./chunk-bztkz3dz.js";import{Be}from"./chunk-pg9gckmw.js";import{ze}from"./chunk-vmfhnkxj.js";import{_n}from"./chunk-y8yawx3d.js";import{kn,Sn}from"./chunk-z6dx6dnt.js";import{jsx as t,jsxs as d,Fragment as f}from"react/jsx-runtime";var n;function C(){return n??=Pn(),n}function P(){let o=hn();return t(Sn,{sessionId:o.session.id,enabled:o.inputReady&&!o.sending&&!o.shellMode,onMention:o.addMention,onBusyChange:o.setAdding})}function ua({client:o,providers:m,catalog:i,shellCommands:p=!0,modelMenu:l,children:a,...s}){let{session:e}=s,c=y(o.store,(r)=>r.modelRecovery[e.id]??!1);return d(f,{children:[c&&!ge(e.error?.error)&&t(_n,{client:o,session:e,providers:m??C(),catalog:i},e.id),d(Oe,{modelMenu:l??{defaultGroup:b,catalog:(r)=>Be(r,i),headerAction:t(ze,{})},...s,attachmentPolicy:kn,onShellCommand:p?(r)=>o.executeShell(e.id,r):void 0,children:[t(P,{}),a]})]})}
2
- export{ua};
@@ -1,2 +0,0 @@
1
- import{kt}from"./chunk-hf5bpahd.js";import{n}from"./chunk-y8gz9rsc.js";import{e,C}from"./chunk-acf4sdp7.js";import{Y,x,ee}from"./chunk-w5q2ygsa.js";import{isBooleanOption as U,isGroupedSelect as q,isSelectOption as A}from"@nyssance/codex-acp-v2/client";import{Zap as Z}from"lucide-react";import{memo as D,useRef as F}from"react";import{jsx as w}from"react/jsx-runtime";function H({sessionId:l,options:u,disabled:B,onModelChange:h,onConfigChange:b,defaultGroup:G={id:"models",name:"Models"},catalog:I=(c)=>c,headerAction:L}){let{host:c,client:N}=e(),{t:i}=c,P=n((o)=>Boolean(o.configPending[l])),p=F({sessionId:l,model:!0}),O=P&&(p.current.sessionId!==l||p.current.model),k=n((o)=>{let r=o.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=x(u,"model"),a=x(u,"thought_level"),v=u.filter((o)=>o.configId!=="collaboration_mode"&&(o.category==="model_config"||o.category!=="mode"&&o!==t&&o!==a)),_=v.filter(A),m=v.filter(U);if(!t&&!a&&_.length===0&&m.length===0)return null;let f=(o,r)=>{if(r===o.currentValue)return Promise.resolve();p.current={sessionId:l,model:o===t};let d=b?b(o.configId,r):N.setConfig(l,o.configId,r);return C(c,d),d},g=a?Y(a):[],z=g.reduce((o,r)=>r.name.length>=o.length?r.name:o,""),R=t?ee(t):i("composer.model"),S=(o)=>({api_id:o.value,label:o.name}),V=I(t&&q(t.options)?t.options.map((o)=>({id:o.groupId,name:o.name,models:o.options.map(S)})):[{...G,models:t?Y(t).map(S):[]}]),y=V.flatMap((o)=>o.models),M=y.find((o)=>o.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:R},s=m.find((o)=>o.configId==="fast_mode"||o.configId==="fast-mode");return w(kt,{disabled:B||O||k,switching:O,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:y,showModelList:Boolean(t),onChange:(o)=>{if(o.api_id===t?.currentValue)return;if(h)h(o.api_id);else if(t)f(t,o.api_id)},header:{name:t?.name??i("composer.model"),action:L},modelGroups:V,t:i,effortConfig:a&&g.length>0?{name:"Effort",value:a.currentValue,levels:g,sizer:z,onChange:(o)=>f(a,o)}:void 0,selectOptions:_.map((o)=>({id:o.configId,name:o.name,value:o.currentValue,options:Y(o).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>f(o,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:w(Z,{className:"size-4","aria-hidden":"true"})},...m.filter((o)=>o!==s).map((o)=>({id:o.configId,name:o.name,currentValue:o.currentValue}))],onBooleanChange:(o,r)=>{let d=o==="fast_mode"?s:m.find((E)=>E.configId===o);if(!d)throw Error(`Unknown boolean config: ${o}`);f(d,r)}})}var wn=D(H);
2
- export{wn};
@@ -1,2 +0,0 @@
1
- function Aa(e,n){if(e.type||!n.type)return e;let i=n.type.split("/")[1],o=i!==void 0&&i!==""?`pasted-${Date.now()}.${i==="jpeg"?"jpg":i}`:"";return new File([e],e.name||o||`pasted-${Date.now()}`,{type:n.type})}function Pt(e){let n=[],i=!1;for(let o of e){if(o.kind!=="file")continue;let t=o.getAsFile();if(!t)continue;if(!(t.type||o.type).startsWith("image/")){i=!0;continue}n.push(Aa(t,o))}return{imageFiles:n,sawNonImageFile:i}}function It(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function jn(e){return e.replace(s,"")}function Ca(e,n){let i=0;for(let o=0;o<n;o++){let t=e.charCodeAt(o);if(t>=0&&t<=8||t===11||t===12||t>=14&&t<=31||t===127)i++}return i}function $n(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=jn(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-Ca(n,i)),r=Math.max(0,o-Ca(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
2
- export{Aa,Pt,It,jn,Ca,$n};
@@ -1,2 +0,0 @@
1
- import{uo}from"./chunk-2f8s5gtn.js";import{$i,te}from"./chunk-9neb2f30.js";import{so}from"./chunk-eynwjzqp.js";import{En}from"./chunk-nrpgmawz.js";import{Gi,ao}from"./chunk-4sfxcw58.js";import{Bi}from"./chunk-ps408sxd.js";import{Nn}from"./chunk-bbrx6m7n.js";import{fe}from"./chunk-6ym1a5wa.js";import{ot,Ge}from"./chunk-vd6eqshg.js";import{lo}from"./chunk-ypdh88cj.js";import{Ui}from"./chunk-v9weanq6.js";import{ge,An}from"./chunk-7tw7rn0m.js";import{CodexClient as M,configRevisionOf as O,isBooleanOption as S,isGroupedSelect as v,isImage as R,isSelectOption as g,mergeMeta as f,runStateSource as I}from"@nyssance/codex-acp-v2/client";var b={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function d(e){let t=e.find((s)=>s.category==="model"&&s.type==="select");return t?.type==="select"&&typeof t.currentValue==="string"?t.currentValue:null}function C(e){let t=e["x-codex-turn-metadata"];if(typeof e.callId!=="string"||typeof t?.turn_id!=="string")throw Error("Codex tool call metadata is missing callId or turn_id");return{toolCallId:e.callId,turnId:t.turn_id}}class Hi extends M{applicationRegistry=new uo((e)=>this.holds(e)?this.session(e):void 0,C);toolSelection;async executeShell(e,t){let s=this.session(e);if(!s.attached||s.restoring||s.readOnly||s.state!=="idle")throw Error("The session is not ready for a shell command");await this.codexCapabilities.executeShell(e,t),this.materializeDraft(e)}modelListeners=new Set;confirmedModelListeners=new Set;savedModels={main:null,chat:null};slotModels={main:null,chat:null};slotTargets={main:null,chat:null};slotVersions={main:0,chat:0};draftDirectoryIntents=new Map;draftOperations=new Map;gatewayModels=new Map;configOwners=new Map;openingOwners=new Map;schedulingConfig=new Set;replayRepairs=new Map;accountRevocations=new Map;accountRecoveries=new Map;resolveModelOption;constructor(e,t){let{applicationTools:s=[],resolveModel:i,imageService:n,...o}=t;super(e,o,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.toolSelection=s,this.resolveModelOption=i,this.imageService=n,this.imageTool=n?Bi(n,(r)=>this.imageRequests.get(r)):void 0}imageTool;imageService;inputModes=new Map;inputSelections=new Map;async readInputConfig(e){let t=this.live(),s=await t.request("_codex/session_input_config_get",{sessionId:e});if(t!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,s)}async writeInputConfig(e,t){let s=this.live(),i=await s.request("_codex/session_input_config_set",{sessionId:e,inputConfig:t});if(s!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,i)}acceptInputConfig(e,t){let s=Nn(t,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=s.inputConfig;if(i&&ot(i.mode)){if(Ge(i.mode).parseConfig(i.config),this.inputModes.set(e,i.mode),i.mode==="image")this.inputSelections.set(e,fe.parseConfig(i.config))}return s}imageRequests=new Map;prompt(e,t,s={}){if(!this.imageService)return super.prompt(e,t,s);if(!this.inputModes.has(e))return this.imageService.inputMode(e).then((i)=>(this.inputModes.set(e,i),this.prompt(e,t,s)));return Ge(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,t,{...s,meta:f(s.meta,{alwith:{imageIntent:null,applicationContext:Ge("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,t,s)})}promptImage(e,t,s){if(!this.imageService)throw Error("Image service is not connected");ao(s.meta?.alwith?.imageAspectRatio);let i=s.meta?.alwith?.imageSelection;if(i!==void 0)te(i);let n=i??this.inputSelections.get(e)??this.imageService.selection(),o={...this.session(e).state!=="idle"?this.imageRequests.get(e)?.selection??n:n};te(o);let r=crypto.randomUUID();return this.promptImages.set(r,new Map(t.flatMap((a,c)=>R(a)?[[`attachment:${c}`,`data:${a.mimeType};base64,${a.data}`]]:[]))),super.prompt(e,t,{...s,meta:f(s.meta,{alwith:{imageSelection:o,imageRequestId:r,applicationContext:fe.applicationContext(s.meta?.alwith?.imageIntent??"generate",Gi),imageIntent:s.meta?.alwith?.imageIntent??"generate"}})}).finally(()=>this.promptImages.delete(r))}promptMeta(e,t){let s=t.meta?.alwith?.imageSelection;if(this.inputModes.get(e)==="image"&&s&&this.imageService&&(this.session(e).state==="idle"||!this.imageRequests.has(e))){let i=new Map($i(this.session(e)).map((o)=>[o.id,o.src]));for(let[o,r]of this.promptImages.get((t.meta?.alwith).imageRequestId)??[])i.set(o,r);let n=ao((t.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:s,references:i,...n?{aspect:n}:{}})}return lo(super.promptMeta(e,t))}promptImages=new Map;promptWithImages(e,t,s={}){return this.prompt(e,t,{...s,meta:f({alwith:{imageIntent:"generate"}},s.meta)})}async applicationToolsFor(e){let t=typeof this.toolSelection==="function"?await this.toolSelection(e):this.toolSelection,s=e.options.meta?.alwith;return[...t,...e.options.applicationTools??[],...s?.nativeTools?.imageGeneration===!1&&this.imageTool?[this.imageTool]:[]]}releaseImages(e){this.imageRequests.delete(e)}onDisconnected(){for(let e of this.imageRequests.keys())this.releaseImages(e);this.promptImages.clear(),this.applicationRegistry.clear(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),this.applicationRegistry.cancel(e),await super.cancel(e)}async close(e){this.releaseImages(e),this.applicationRegistry.drop(e),await super.close(e)}async stopSession(e){this.releaseImages(e),this.applicationRegistry.drop(e);let t=this.state.draftSessions[e];if(t===void 0)return super.stopSession(e);await this.changeDraft([t],()=>this.state.draftSessions[e]?super.close(e):super.stopSession(e))}setApp(e){this.store.setState(e)}applyRunStates(e,t="event"){let s=this.state.runStates,i=e.map((n)=>{let o=s[n.sessionId];return o&&JSON.stringify(o)===JSON.stringify(n)?o:n});if(I(s)===t&&i.length===Object.keys(s).length&&i.every((n)=>n===s[n.sessionId]))return;super.applyRunStates(i,t)}enqueueSession(e,t,s=!0){let i=!s&&!this.schedulingConfig.has(e);return super.enqueueSession(e,()=>{let n=()=>{let a=this.holds(e)?d(this.session(e).configOptions):null;return t().then(async(c)=>{if(this.holds(e)&&d(this.session(e).configOptions)!==a)await this.normalizeCustomEffort(e,!0);return c})},o=()=>{let a=i?this.normalizeCustomEffort(e,!1):void 0;return a?a.then(n):n()},r=s?void 0:this.replayRepairs.get(e)?.promise;return r?r.then(o):o()},s)}customEffortChange(e,t,s=!1,i){if(!this.holds(e))return;let n=this.session(e);if(!n.attached||n.readOnly)return;let o=d(n.configOptions),r=so(o);if(!r)return;let a=n.configOptions.find((p)=>p.category==="thought_level"&&g(p)),c,u;if(a&&g(a)){let p=v(a.options)?a.options.flatMap((l)=>l.options):a.options;if(a.currentValue===r.value||!t&&p.some((l)=>l.value===a.currentValue))return;if(!p.some((l)=>l.value===r.value))throw Error(`The model does not advertise its default effort: ${o}`);c=a.configId,u=!t&&i!==void 0&&p.some((l)=>l.value===i)?i:r.value}else{if(!r.hidden||!s||o===null)return;let p=n.configOptions.find((l)=>l.category==="model");if(!p)throw Error("The custom model has no model option");c=p.configId,u=o}return{configId:c,value:u}}normalizeCustomEffort(e,t,s=!1,i){let n=this.customEffortChange(e,t,s,i);return n?this.writeCustomEffort(e,n.configId,n.value):void 0}async writeCustomEffort(e,t,s){let i=this.live(),n=this.lifecycle.capture(e),o=await i.request("session/set_config_option",{sessionId:e,configId:t,type:"id",value:s});if(i!==this.agent||!this.lifecycle.isCurrent(n))throw Error("Effort configuration belongs to a retired session");this.publishSession({...this.session(e),configOptions:o.configOptions,configRevision:O(o)??this.session(e).configRevision})}async afterSessionCreated(e){await super.afterSessionCreated(e);try{await super.enqueueSession(e,async()=>this.normalizeCustomEffort(e,!0,!0),!1)}catch(t){try{await this.delete(e)}catch(s){throw AggregateError([t,s],"Failed to initialize and clean up the custom model session",{cause:s})}throw t}}replay(e,t,s){let i=this.replayRepairs.get(e);if(i?.cwd===t)return i.promise;let n=this.replayWithEffort(e,t,s);this.replayRepairs.set(e,{cwd:t,promise:n});let o=()=>{if(this.replayRepairs.get(e)?.promise===n)this.replayRepairs.delete(e)};return n.then(o,o),n}async replayWithEffort(e,t,s){let i=this.holds(e)?this.session(e).configOptions:[],n=i.find((r)=>r.category==="thought_level")?.currentValue;await super.replay(e,t,s);let o=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,d(i)===d(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(r){if(this.holds(e)&&this.lifecycle.isCurrent(o))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw r}}async connect(){if(await super.connect(),this.state.projectContext===null)await this.refreshProjectContext()}async listProjectSessions(e){await this.listSessions();let t=this.projectPath(e),s=this.sessionGroup({cwd:t}).id;return this.state.sessionList.filter((i)=>this.sessionGroup(i).id===s)}async newSession(e,t=null,s="main"){if(t!==null&&typeof t==="object")return super.newSession(e,t);let i=++this.slotVersions[s],n=await this.createNativeSession(e,await this.resolveModel(t),null);return this.activateSlot(s,n,i),n}async createNativeSession(e,t,s,i="chat"){let n=await super.newSession(e,{draft:s!==null,meta:f(y(t),this.imageService||s!==null?{alwith:{...this.imageService?{inputMode:i}:{},...s===null?{}:{draft:!0}}}:void 0)});if(s!==null)this.draftDirectoryIntents.set(n,e),this.setApp((o)=>({draftSessions:{...o.draftSessions,[n]:s}}));return this.noteModel(this.session(n)),n}async open(e,t,s="main"){if(typeof s!=="string")return super.open(e,t,s);if(s==="chat"&&this.imageService&&(this.inputModes.get(e)??await this.imageService.inputMode(e))==="image")throw Error("Image conversations must be opened in the main window");this.bindSlot(s,e),++this.slotVersions[s];let i=this.holds(e)?this.session(e):void 0;if(i?.attached&&(!this.imageService||this.inputModes.has(e))&&!i.restoring&&!i.readOnly&&!this.lifecycle.operations.busy(e)&&!this.replayRepairs.has(e)){this.followModel(s,i);return}await this.replayForOwner(e,t,s)}async replayForOwner(e,t,s){this.openingOwners.set(e,s);try{await this.replay(e,t)}finally{if(this.openingOwners.get(e)===s)this.openingOwners.delete(e)}}async requestContext(e,t,s){if(this.imageService){let i=t.kind==="resume"?t.sessionId:t.kind==="fork"?t.sourceSessionId:null,n=i===null?s.meta?.alwith?.inputMode??"chat":await this.imageService.inputMode(i),o=Ge(n),r=lo(s.meta),a={...r?.alwith,nativeTools:o.nativeTools},c=await this.requestModelContext(e,t,{...s,meta:{...r,alwith:a}});return{...c,bind:async(u)=>{await c.bind?.(u),this.inputModes.set(u,n)}}}return this.requestModelContext(e,t,s)}async requestModelContext(e,t,s){if(t.kind!=="resume"||s.meta?.alwith?.model!==void 0)return this.requestToolContext(e,t,s);let i=t.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?d(n.configOptions):null)??this.gatewayModels.get(i)??null,r=await this.resolveModel(o),a=o===null?null:r;return this.requestToolContext(e,t,{...s,meta:f(y(a),s.meta)})}async requestToolContext(e,t,s){let i=await this.applicationToolsFor({cwd:e,operation:t,options:s}),n=await super.requestContext(e,t,s);if(!i.length)return n;if(!this.state.agent?.capabilities?.session?.mcp?.acp)throw Error("The agent does not advertise capabilities.session.mcp.acp");let o=this.applicationRegistry.declare(i);return{...n,mcpServers:[...n.mcpServers??[],o],bind:async(r)=>{await n.bind?.(r),this.applicationRegistry.bind(o.serverId,r)}}}acceptsPendingRequest(e){return e.method!=="mcp/message"&&super.acceptsPendingRequest(e)}handleNotification(e,t){if(e==="$/cancel_request"&&this.applicationRegistry.withdraw(t?.requestId))return!0;return super.handleNotification(e,t)}handleAgentRequest(e,t){return this.applicationRegistry.handle(e,t)||super.handleAgentRequest(e,t)}async installedApps(e){let t=this.live(),s=await super.installedApps(e),i=await Ui((n,o)=>t.request(n,o),s.apps.map((n)=>n.id),e?.threadId);if(t!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:s.apps.map((n)=>({...n,...i.get(n.id)}))}}async recoverReplay(e,t,s,i){let n=ge(s);if(!n&&!An(s))return super.recoverReplay(e,t,s,i);try{await super.afterResume(e,t,i)}catch(o){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;this.setApp((r)=>({historyPages:{...r.historyPages,[e]:{cursor:null,loading:!1,error:o instanceof Error?o.message:String(o)}}}))}if(n){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:s.reason??s.message,data:s.data},meta:null}}),!0}if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.accountRevocations.set(e,(this.accountRevocations.get(e)??0)+1),this.setApp((o)=>({modelRecovery:{...o.modelRecovery,[e]:!0}})),this.publishSession({...this.session(e),cwd:t,attached:!1,restoring:!1,readOnly:!0}),!0}markAccountModelsUnavailable(e){this.setApp((t)=>({modelRecovery:{...t.modelRecovery,...Object.fromEntries(e.map((s)=>[s,!0]))}}));for(let t of e){if(this.accountRevocations.set(t,(this.accountRevocations.get(t)??0)+1),!this.holds(t))continue;this.publishSession({...this.session(t),attached:!1,readOnly:!0})}}async resumeModel(e,t){let s=this.session(e);if(!this.state.modelRecovery[e]&&(s.attached||!ge(s.error?.error)))throw Error("Model recovery is not required");if(!t)throw Error("Select a model before continuing");let i=this.accountRevocations.get(e)??0,n=await this.resolveModel(t);if(!n)throw Error("The selected provider connection or model is unavailable");if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");this.accountRecoveries.set(e,i);try{await this.replay(e,s.cwd,{meta:{alwith:{model:n,accountModelSelection:!0}}})}catch(r){if(this.holds(e)&&this.state.modelRecovery[e])this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!0});throw r}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((r)=>{let{[e]:a,...c}=r.modelRecovery;return{modelRecovery:c}}),this.confirmModel(this.state.sessionWindows[e]??"main",o)}setConfig(e,t,s,i="main"){this.configOwners.set(`${e}:${t}`,i),this.schedulingConfig.add(e);try{return super.setConfig(e,t,s)}finally{this.schedulingConfig.delete(e)}}onConfigChanged(e,t,s){super.onConfigChanged(e,t,s),this.noteModel(this.session(e));let i=this.configOwners.get(`${e}:${t}`)??"main";if(this.configOwners.delete(`${e}:${t}`),s.configOptions.some((n)=>n.configId===t&&n.category==="model"))this.confirmModel(i,this.session(e))}changeDraft(e,t){let s=Promise.allSettled(e.map((i)=>this.draftOperations.get(i)).filter((i)=>i!==void 0)).then(t);for(let i of e)this.draftOperations.set(i,s);return s}prepareDraft(e,t,s=null,i=!1,n="chat"){if(e==="chat"&&n!=="chat")throw Error("The floating chat only supports chat input");let o=++this.slotVersions[e];return this.changeDraft([e],async()=>{let r=t??(await this.refreshProjectContext(!0)).chatDirectory,a=Object.keys(this.state.draftSessions).find((l)=>this.state.draftSessions[l]===e);if(a)await this.lifecycle.admission.pending(a);let c=s??(a?d(this.session(a).configOptions):this.savedModels[e]??this.slotModels[e]),u=i?null:await this.resolveModel(c,s===null?"draft":"session");if(a&&(this.inputModes.get(a)??"chat")===n&&this.session(a).cwd===r&&(!this.draftDirectoryIntents.has(a)||this.draftDirectoryIntents.get(a)===t)&&!i&&!this.state.modelRecovery[a]&&(u===null?!d(this.session(a).configOptions)?.startsWith("gateway:"):d(this.session(a).configOptions)===u)){if(this.activateSlot(e,a,o),!this.session(a).attached)await this.replayForOwner(a,r,e);if(s!==null)this.confirmModel(e,this.session(a));return a}let p=await this.createNativeSession(t,u,e,n);try{if(a&&this.session(a).cwd===r)for(let l of this.session(a).configOptions){if(l.category==="model")continue;if(l.category==="thought_level"&&d(this.session(a).configOptions)!==d(this.session(p).configOptions)&&so(d(this.session(p).configOptions))!==null)continue;let h=this.session(p).configOptions.find((w)=>w.configId===l.configId);if(!h||h.currentValue===l.currentValue)continue;if(S(l)&&S(h))await this.setConfig(p,l.configId,l.currentValue);else if(g(l)&&g(h)){if((v(h.options)?h.options.flatMap((m)=>m.options):h.options).some((m)=>m.value===l.currentValue))await this.setConfig(p,l.configId,l.currentValue)}}if(a)await this.deleteEmptyDraft(a)}catch(l){throw await this.deleteEmptyDraft(p),l}if(this.activateSlot(e,p,o),s!==null||i||c!==null&&c!==u)this.confirmModel(e,this.session(p));return p})}discardDraft(e){if(e!=="main"&&e!=="chat")return super.discardDraft(e);return this.changeDraft([e],async()=>{for(let[t,s]of Object.entries(this.state.draftSessions))if(s===e)await this.deleteEmptyDraft(t)})}transferDraft(e,t){return this.changeDraft(["main","chat"],async()=>{if(t==="chat"&&this.inputModes.get(e)==="image")throw Error("Image conversations must remain in the main window");if(!this.state.draftSessions[e]||this.state.draftSessions[e]===t)return;for(let[s,i]of Object.entries(this.state.draftSessions))if(i===t)await this.deleteEmptyDraft(s);this.setApp((s)=>s.draftSessions[e]?{draftSessions:{...s.draftSessions,[e]:t}}:{})})}deleteEmptyDraft(e){return this.enqueueSession(e,async()=>{if(!this.state.draftSessions[e])return;await this.delete(e),this.gatewayModels.delete(e)})}onDraftMaterialized(e){super.onDraftMaterialized(e),this.draftDirectoryIntents.delete(e),this.setApp((t)=>{let{[e]:s,...i}=t.draftSessions;return{draftSessions:i}}),this.noteModel(this.session(e))}onSessionDropped(e){this.applicationRegistry.drop(e),super.onSessionDropped(e),this.inputModes.delete(e),this.inputSelections.delete(e),this.draftDirectoryIntents.delete(e),this.gatewayModels.delete(e),this.accountRevocations.delete(e),this.accountRecoveries.delete(e),this.setApp((t)=>{let{[e]:s,...i}=t.draftSessions,{[e]:n,...o}=t.sessionWindows,{[e]:r,...a}=t.modelRecovery;return{draftSessions:i,sessionWindows:o,modelRecovery:a}})}fork(e,t,s){let i=typeof s==="object"?s:s===void 0?{}:{lastTurnId:s};return super.fork(e,t,i)}async forkInternal(e,t,s){let n=[...(await Promise.all([this.indexSessions(),this.indexSessions(void 0,!0)])).flat(),...this.state.sessionList,...this.state.archivedSessions],o=(this.holds(e)?this.session(e).title:null)??n.find((c)=>c.sessionId===e)?.title,r=await super.forkInternal(e,t,{...s,meta:f(y(this.gatewayModels.get(e)??null),s.meta)});await super.enqueueSession(r,async()=>this.normalizeCustomEffort(r,!1,!0),!1);let a=o??this.session(r).title;if(a)await this.renameSession(r,En(a,n.flatMap((c)=>c.title?[c.title]:[])));return r}onForked(e,t){super.onForked(e,t),this.noteModel(this.session(e))}onReplayed(e,t){super.onReplayed(e,t);let s=this.accountRevocations.get(e);if(s!==void 0&&this.accountRecoveries.get(e)!==s)this.markAccountModelsUnavailable([e]);this.noteModel(this.session(e))}setModelSelections(e){this.savedModels={...e},this.slotModels={...e}}onConfirmedModel(e){return this.confirmedModelListeners.add(e),()=>this.confirmedModelListeners.delete(e)}onSessionChanged(e){super.onSessionChanged(e);let t=this.accountRevocations.get(e.id);if(t!==void 0&&this.accountRecoveries.get(e.id)!==t&&(e.attached||!e.readOnly)){this.publishSession({...e,attached:!1,readOnly:!0});return}this.followModel("main",e),this.followModel("chat",e)}followModel(e,t){if(this.slotTargets[e]!==t.id||!t.attached||t.restoring)return;let s=d(t.configOptions);if(s!==null)this.slotModels[e]=s}activateSlot(e,t,s){if(this.slotVersions[e]!==s)return;this.bindSlot(e,t),this.followModel(e,this.session(t))}bindSlot(e,t){let s=e==="main"?"chat":"main";if(this.slotTargets[s]===t)this.slotTargets[s]=null,++this.slotVersions[s];this.slotTargets[e]=t,this.setApp((i)=>({sessionWindows:{...i.sessionWindows,[t]:e}}))}confirmModel(e,t){let s=d(t.configOptions);if(s===null)throw Error("Model selection did not return the current model");this.followModel(e,t),this.savedModels[e]=s;for(let i of this.confirmedModelListeners)i(e,s)}resolveModel(e,t="session"){return this.resolveModelOption?this.resolveModelOption(e,t):Promise.resolve(e)}onSessionModel(e){return this.modelListeners.add(e),()=>this.modelListeners.delete(e)}noteModel(e){let t=d(e.configOptions);if(t===null)return;let s=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(s&&g(s)){let o=(v(s.options)?s.options.find((r)=>r.groupId===b.id)?.options??[]:s.options.filter((r)=>!r.value.startsWith("gateway:"))).map((r)=>({id:r.value,label:r.name}));if(JSON.stringify(o)!==JSON.stringify(this.state.nativeModels))this.setApp({nativeModels:o})}let i=s!==void 0&&g(s)&&s.options.some((n)=>("groupId"in n)&&n.groupId!==b.id&&n.options.some((o)=>o.value===t));if(i)this.gatewayModels.set(e.id,t);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,t,i)}}
2
- export{b,Hi};
@@ -1,2 +0,0 @@
1
- import{$e}from"./chunk-y8gz9rsc.js";import{createContext as v,useContext as a,useMemo as l}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function zn({host:o,client:n,children:t}){let s=l(()=>({host:o,client:n}),[o,n]);return r($e,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=a(i);if(o===null)throw Error("Conversation host is missing");return o}function C(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
2
- export{zn,e,C};
@@ -1,2 +0,0 @@
1
- import{vi}from"./chunk-5mjs63fv.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function ta({host:o,children:t}){return s(n,{value:o,children:t})}function A(){let o=i(n),e={...vi(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function fi(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function me(){let o=A();return(t)=>fi(o,t)}function hi(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
- export{ta,A,fi,me,hi};
@@ -1,2 +0,0 @@
1
- import{He}from"./chunk-dheg4bs2.js";import{r,X,gn}from"./chunk-rkwq0grt.js";var Ai=5000;function tt(t){return"pastedText"in t}function yt(t,e,p){let n=(a,o)=>{for(let[i,x]of r){if(!x.attachments.some((s)=>s.id===e.id))continue;X(i,(s)=>s.map((d)=>d.id===e.id?{...e,url:o===void 0?"":He(o),pastedText:{text:e.pastedText.text,status:a}}:d))}};if(!r.get(t)?.attachments.some((a)=>a.id===e.id))return;n("pending"),gn(e.id,p("pasted-text.txt",e.pastedText.text).then((a)=>n("ready",a)).catch(()=>n("error")))}function mn(t,e,p,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/")))return;let a=t.clipboardData.getData("text/plain");if(a.length<Ai)return;t.preventDefault(),t.stopPropagation();let o={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:p,url:"",pastedText:{text:a,status:"pending"}};X(e,(i)=>[...i,o]),yt(e,o,n)}
2
- export{Ai,tt,yt,mn};
@@ -1,2 +0,0 @@
1
- import{He}from"./chunk-dheg4bs2.js";function yn(t){return He(t.absPath)}function xn(t){return t.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??t}function bn(t){return xn(t.absPath)}
2
- export{yn,xn,bn};
@@ -1,2 +0,0 @@
1
- import{p,ro}from"./chunk-4d9sajzj.js";import{Fn}from"./chunk-3z86hy2s.js";import{useEffect as P,useRef as u,useState as m}from"react";var Di="providers:changed",Fi="providers:managed-revoked",i=(e)=>e;function Pn(){return{read:()=>i(p.providersRead()),save:(e,r,t)=>i(p.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(p.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(p.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>p.providersTest({providerId:e}),apply:()=>i(p.providersApply()),onChanged:(e)=>ro[Di].listen((r)=>e(r.payload))}}function fa(){return{bind:(e)=>p.providersAccountBind({account:e}),refresh:(e,r)=>i(p.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await p.providersClearManaged()},onRevoked:(e)=>ro[Fi].listen((r)=>e(r.payload.sessionIds))}}async function In(e){try{return await e.apply()}catch(r){if(!Fn(r))throw r;return e.read()}}function Ue(e,r=console.error){let[t,d]=m(null),a=u(r);return a.current=r,P(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
- export{Di,Fi,Pn,fa,In,Ue};
@@ -1,2 +0,0 @@
1
- import{Le,u}from"./chunk-stv8pr4v.js";import{H}from"./chunk-8hygfx41.js";import{z}from"./chunk-64cbt3ym.js";import{E}from"./chunk-r5f77gtx.js";import{gt,Je,ft}from"./chunk-jgqt7k0h.js";import{PreviewCard as C}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as D}from"lucide-react";import{createContext as T,useContext as L,useLayoutEffect as M,useState as I}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as K}from"react/jsx-runtime";function N(o){if(o.as==="ul"){let{as:i,className:s,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",s),...a})}let{as:t,className:n,...r}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...r})}function v({className:o,...t}){return e("span",{"data-slot":"navigation-leading",className:p("flex size-6 shrink-0 items-center justify-center [&_.lucide]:size-3.5",o),...t})}function f({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function ie({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:b,headerChildren:g,wrapHeader:c,onHeaderClick:P,children:y}){let R=()=>{P?.(),t(!o)},x=p(gt,"relative flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),S=d(K,{children:[r!=null&&e(v,{children:r}),g??e(H,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(ft,{content:s!==void 0?e(Je,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:b})})]}),k=g==null?d("div",{"data-active":l?"":void 0,title:n,className:p(x,u),onClick:R,onKeyDown:(m)=>{if(m.target!==m.currentTarget)return;if(m.key!=="Enter"&&m.key!==" ")return;m.preventDefault(),R()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),S]}):e("div",{"data-active":l?"":void 0,className:x,children:S});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[c===void 0?k:c(k),o&&e(N,{className:"mt-0.5",children:y})]})}var _=T(()=>{}),G=T(()=>{});function tn(){return L(G)}function Ee(){return L(_)}function Re({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:b,preview:g,listeningPorts:c,onOpenPort:P,accessory:y,meta:R,hint:x,actions:S,className:k,...m}){let O=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(gt,Le,"group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(g||c!=null&&c.length>0)&&"h-auto min-h-[var(--navigation-row-height,30px)] py-2.5",k),...m,children:[e(v,{children:t!=null?e(z,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(H,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),b!=null&&e(H,{className:"text-muted-foreground text-xs",children:b}),g&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:g}),c!=null&&c.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:c.map((w)=>P?d("button",{type:"button",className:"underline",onPointerDown:(h)=>h.stopPropagation(),onKeyDown:(h)=>h.stopPropagation(),onClick:(h)=>{h.stopPropagation(),P(w)},children:[":",w]},w):d("span",{children:[":",w]},w))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(D,{className:"text-muted-foreground size-3"}),e(ft,{content:y!=null?e(Je,{children:y}):R??e(Je,{}),actions:S}),x!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:x})]})]});if(a==null)return O;return e(q,{row:O,onOpenChange:l,children:a})}function q({row:o,children:t,onOpenChange:n}){let[r,i]=I(!1),[s,a]=I(!1),l=r||s;return M(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(_.Provider,{value:a,children:e(G.Provider,{value:()=>{i(!1),a(!1)},children:e(j,{open:l,onOpenChange:i,trigger:o,children:t})})})}function j({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return E(o),d(C.Root,{open:o,onOpenChange:t,children:[e(C.Trigger,{render:n,delay:700,closeDelay:100}),e(C.Portal,{children:e(C.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(C.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
2
- export{N,v,f,ie,tn,Ee,Re};
@@ -1,2 +0,0 @@
1
- import{xt}from"./chunk-etvdqkvb.js";var qi={persistConfig:!1,nativeTools:{},applicationContext:()=>xt(null),parseConfig(t){if(Object.keys(t).length)throw Error("Chat input config must be empty");return{}},routePrompt(t){return t.native()}};
2
- export{qi};
@@ -1,2 +0,0 @@
1
- import{b}from"./chunk-a11wvd8e.js";import{kt}from"./chunk-hf5bpahd.js";import{e}from"./chunk-acf4sdp7.js";import{he,S}from"./chunk-3z86hy2s.js";import{Mn,Be}from"./chunk-pg9gckmw.js";import{ze}from"./chunk-vmfhnkxj.js";import{Zap as g}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function Tn({snapshot:s,model:l,onChange:r,nativeModels:t,catalog:c}){let{host:u}=e(),{t:a}=u,f=[{id:b.id,name:b.name,models:t===void 0?[{api_id:"",label:b.name}]:t.map((o)=>({api_id:o.id,label:o.label??o.id}))},...(s===null?[]:he(s)).map((o)=>({id:o.id,name:o.name,models:o.models.map((i)=>({api_id:S(o.id,i.id),label:i.label??i.id}))}))],p=Be(f,c),d=p.flatMap((o)=>o.models),m=l===null?t===void 0?d[0]:{api_id:"",label:a("composer.model")}:d.find((o)=>o.api_id===l)??{api_id:l,label:l};return n(kt,{value:{...m,label:Mn(m)},models:d,modelGroups:p,header:{name:a("composer.model"),action:n(ze,{})},compactCatalog:!0,booleanOptions:[{id:"fast_mode",name:a("composer.fastMode"),currentValue:!1,disabled:!0,title:a("composer.fastModeUnsupported"),icon:n(g,{className:"size-4","aria-hidden":"true"})}],showModelList:!0,onChange:(o)=>r(o.api_id),t:(o)=>a(o)})}
2
- export{Tn};
@@ -1,2 +0,0 @@
1
- function Ae(){if(typeof navigator>"u")return!1;let a=navigator.userAgentData?.platform;return/mac/i.test(a??navigator.platform)}function ri(a){if(a.shiftKey||a.altKey)return!1;return Ae()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}
2
- export{Ae,ri};
@@ -1,2 +0,0 @@
1
- import{u}from"./chunk-stv8pr4v.js";import{s}from"./chunk-5mjs63fv.js";import{v,f}from"./chunk-chn1mkv0.js";import{ut}from"./chunk-0bv3tw1m.js";import{cn as r}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as p}from"lucide-react";import{DropdownMenu as c,DropdownMenuContent as m,DropdownMenuItem as d,DropdownMenuTrigger as g}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as w}from"react/jsx-runtime";function Ds({onCollapseAll:i}){let{t:n}=s();return w(c,{children:[o(g,{render:o(ut,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(p,{})}),o(m,{align:"end",className:"w-52",children:o(d,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Fs({screen:i,onSwitch:n}){let{t:e}=s(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(f,{className:r(u,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(v,{children:i==="main"?o(a,{}):o(l,{})})})}
2
- export{Ds,Fs};
@@ -1,2 +0,0 @@
1
- import{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 +0,0 @@
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};
@@ -1,2 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
1
- function Et(o){return o.kind==="tool"&&o.status==="completed"&&o.toolKind!=="read"&&o.toolKind!=="search"}
2
- export{Et};
@@ -1,2 +0,0 @@
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};
@@ -1,2 +0,0 @@
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 +0,0 @@
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,3 +0,0 @@
1
- import{u}from"./chunk-stv8pr4v.js";import{N,f}from"./chunk-chn1mkv0.js";import{Gt}from"./chunk-fwghjmd1.js";import{Ke,d,We,lt,i}from"./chunk-njqan8zg.js";import{q,K,ce,W,Z,ke,Vt}from"./chunk-gdtpwbqn.js";import{we}from"./chunk-3hsft68c.js";import{ct}from"./chunk-ne4b53kn.js";import{k}from"./chunk-qk1yqepm.js";import{$t,B}from"./chunk-m68t534g.js";import{Q,Pe}from"./chunk-pqz2471h.js";import{jt}from"./chunk-2yvj9k42.js";import{zt}from"./chunk-p96vgnxw.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as _,PuzzleIcon as le,RefreshCwIcon as oe,SearchIcon as re,Trash2Icon as de,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as V,useMemo as G,useState as I}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ye,DropdownMenuContent as be,DropdownMenuItem as Ce,DropdownMenuTrigger as Ie}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as U}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Se}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function z(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function De({plugin:t,marketplace:r}){let{t:m}=d(),p=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=m(p?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!p)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(y,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:p||a||c,"aria-label":o,title:c?m("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:p?e(E,{"aria-hidden":"true"}):e(_,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Me({plugin:t,marketplace:r,actions:m,onOpen:p}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(ke,{className:"toolbox-row relative",children:[e(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":z(t),onClick:()=>p({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(B,{name:t.name})})}),s(K,{className:"pointer-events-none relative min-w-0",children:[e(Vt,{className:"mb-0.5",children:z(t)}),e(ce,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(ce,{"data-toolbox-metadata":"",children:o})]}),e(q,{className:"relative w-8 shrink-0 justify-center",children:m})]})}function H(){return lt((t)=>t.connection==="ready"&&ee(t.agent))}var D=48;function Ee({marketplace:t,plugins:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.removeMarketplace),[g,c]=I(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/D)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ye,{children:[e(Ie,{render:e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":p("plugins.pageActions")}),children:e(ie,{})}),e(be,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ce,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(de,{className:"size-3.5"}),p("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*D,(o+1)*D).map((n)=>e(Me,{onOpen:m,plugin:n,marketplace:t,actions:e(De,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>D&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(y,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:p("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/D)]}),e(y,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*D>=r.length,onClick:()=>c(o+1),children:p("plugins.nextPage")})]})]},t.name)}var ze=ue(function({query:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=G(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,z(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
- `).toLowerCase()}))})),[a]),o=G(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:b,text:P})=>r===""?v.path!==null||n.has(b.id):P.includes(r)).map(({plugin:b})=>b)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(Ee,{marketplace:n,plugins:v,onOpen:m},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:p("plugins.empty")})]})});function Oe(){let{t}=d(),r=H(),m=i((h)=>h.addMarketplace),p=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=I(""),[o,n]=I(!1),[v,x]=I(!1),[b,P]=I(null),O=async()=>{let h=g.trim();if(!h||o)return;n(!0),P(null);try{await m({source:h}),c(""),x(!1)}catch(S){P(S instanceof Error?S.message:String(S))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(y,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void p(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(y,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(_,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),O()},children:[e(Se,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(U,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),b&&e("p",{role:"alert",className:"text-destructive text-sm",children:b}),s("div",{className:"flex justify-end gap-2",children:[e(y,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(y,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Be({onOpen:t,query:r}){let m=H(),p=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!m,g=pe(r.trim().toLowerCase());return e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[p.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(we,{}):e(ze,{query:g,onOpen:t})]})})}function Ps({cwd:t,active:r,extensions:m,onOpenCatalog:p}){let{t:a}=d(),g=We(),c=Ke(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,b]=I("plugins"),[P,O]=I({plugins:"",skills:""}),h=x==="skills"?P.skills:P.plugins,S=(l)=>O((M)=>({...M,[x]:l})),Y=lt((l)=>JSON.stringify([...new Set(l.sessionList.map((M)=>ct(M.cwd,l.projectContext)).filter((M)=>M!==null))].toSorted())),T=JSON.stringify([...new Set([ct(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),A=i((l)=>l.installed),R=a(x==="skills"?"plugins.skills.search":"plugins.search"),[w,j]=I(null),C=H();V(()=>{if(!r||!C)return;if(c.getState().loadedScope!==T)o(JSON.parse(T))},[r,C,o,T,c]),V(()=>{if(!C)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0,catalog:!1}))},[C,o,g]);let L=(l)=>{p?.(),b("plugins"),j(l)},J=(l)=>{p?.(),b(l),j(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e($t,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[m&&s(f,{className:`${u} h-8 gap-2 px-2`,active:m.active,onClick:m.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${u} h-8 gap-2 px-2`,active:!m?.active&&x===l&&w===null,onClick:()=>J(l),children:[l==="plugins"?e(le,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(k,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(N,{children:!C||n&&A.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):A.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):A.map((l)=>s(f,{title:z(l.plugin),className:`${u} gap-2 px-2`,active:!m?.active&&w?.plugin.id===l.plugin.id,onClick:()=>L(l),children:[e(B,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:z(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:m?.active?m.content:s(X,{children:[w&&e(jt,{entry:w,onBack:()=>J("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(Pe,{children:e(Gt,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(re,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(U,{className:"h-9 rounded-full ps-9 pe-9","aria-label":R,value:h,onChange:(l)=>S(l.target.value),placeholder:R}),h&&e(y,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>S(""),children:e(me,{})})]}),e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(oe,{})}),x==="plugins"&&e(Oe,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(y,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Be,{query:P.plugins,onOpen:L})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(zt,{query:P.skills,ready:C,onOpenPlugin:L})})]})]})]})})]})}
3
- export{Ps};
@@ -1,2 +0,0 @@
1
- import{qi}from"./chunk-e1fzfaqj.js";import{fe}from"./chunk-6ym1a5wa.js";var t={chat:qi,image:fe};function ot(n){return Object.hasOwn(t,n)}function Ge(n){if(!ot(n))throw Error(`Unsupported input mode: ${n}`);return t[n]}function va(n){if(n===null)return"chat";let o=n.mode;if(!ot(o))throw Error(`Unsupported input mode: ${o}`);return t[o].parseConfig(n.config),o}
2
- export{ot,Ge,va};
@@ -1,2 +0,0 @@
1
- import{p}from"./chunk-4d9sajzj.js";async function da(a){let e=await p.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
- export{da};
@@ -1,2 +0,0 @@
1
- import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function Y(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function x(e,t){return e.find((n)=>n.category===t&&o(n))}function ee(e){return Y(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
2
- export{Y,x,ee};
@@ -1,2 +0,0 @@
1
- import{Ce}from"./chunk-18kdsdmy.js";function w(e){return/^app:\/\/([^/?#\s)]+)$/.exec(e)?.[1]??null}function Ut(e){if(!e.includes("app://"))return[];let n=Ce(),r=new Map;return n.walkTokens(n.lexer(e),(i)=>{if(i.type!=="link")return;let p=i,t=w(p.href);if(t!==null)r.set(t,{id:t,name:p.text.replace(/^\$/,"")})}),[...r.values()]}function _a(e){return[...new Map(e.map((n)=>[n.id,n])).values()].map((n)=>`[$${n.name.replace(/[\\`*_[\]<>]/g,"\\$&")}](app://${n.id})`).join(" ")}function ms(e,n){return[_a(n),e.trim()].filter(Boolean).join(" ")}function gs(e,n){let r=_a(n);if(!r)return e;if(e===r)return"";return e.startsWith(`${r} `)?e.slice(r.length+1):e}
2
- export{w,Ut,_a,ms,gs};
@@ -1,2 +0,0 @@
1
- import{groupSessions as Qe,projectName as ue,isQuickChatDirectory as zs,QUICK_CHATS_GROUP as oe}from"@nyssance/codex-acp-v2/client";
2
- export{Qe,ue,zs,oe};
@@ -1,2 +0,0 @@
1
- import{F,Ko,fs,Kn,hs,Wo,vs}from"./chunk-wde0m4pf.js";import{t,qe,y,n}from"./chunk-y8gz9rsc.js";import{je}from"./chunk-zypgrbd9.js";import{createStore as E}from"@alwith/api/client";import{isText as k,nativeTurnId as b}from"@nyssance/codex-acp-v2/client";import{jsx as m}from"react/jsx-runtime";var v=E({entries:{}});function p(r,e){v.setState((s)=>({entries:{...s.entries,[r]:e}}))}function x(r,e){let s=b(e),a=r.items.findLast((i)=>b(i)!==null);return!e.replayed&&s!==null&&a!==void 0&&b(a)===s}function M(r,e){for(let s of r.items){if(s.kind!=="user"||s.echo==="pending")continue;for(let a of[...Wo(s._meta),...s.content.filter(k).flatMap((i)=>Wo(i._meta))])if(a.questionItemId===e)return a.answer}return}function O({sessionId:r,item:e,question:s,index:a}){let i=qe(),{t:l}=t(),S=Ko(e.id,a),c=JSON.stringify([r,S]),u=y(v,(o)=>o.entries[c]),d=n((o)=>o.sessions[r]),A=n((o)=>o.connection==="ready"),f=u?.draft??fs(s),q=d===void 0?u?.accepted:M(d,S)??u?.accepted,h=d!==void 0&&x(d,e),D=!d?.subagent&&A&&d?.attached&&!d.restoring&&!d.readOnly,g=q!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!h?"closed":!D?"unavailable":"pending",C=async()=>{if(v.getState().entries[c]?.pending||g!=="pending")return;let o=i.state.sessions[r];if(o===void 0||!x(o,e)||!o.attached||o.readOnly||o.restoring)return;let I=Kn(s,f);if(!I.trim())return;let w={questionItemId:S,question:s.title,answer:I};p(c,{draft:f,pending:!0});try{await i.prompt(r,[{type:"text",text:hs(w),_meta:{codex:{questionReply:w}}}]),p(c,{draft:f,accepted:I})}catch(Q){p(c,{draft:f,error:Q instanceof Error?Q.message:String(Q)})}};if(g==="closed")return null;return m(vs,{question:s,draft:f,status:g,answer:q,error:g==="pending"?u?.error:void 0,t:l,onChange:(o)=>p(c,{draft:o}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{C()}})}function Do({sessionId:r,item:e}){let s=n((i)=>i.sessions[r]),a=F(e._meta);if(s===void 0||s.subagent!==void 0||s.readOnly||!x(s,e))return m(je,{content:e.content.some((i)=>!k(i)||i.text.trim().length>0)?e.content:a.map((i)=>({type:"text",text:i.title})),messageId:e.id,streaming:!1});return m("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((i,l)=>m(O,{sessionId:r,item:e,question:i,index:l},Ko(e.id,l)))})}
2
- export{Do};