@alwith/module-chat 0.6.30 → 0.6.31

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 (447) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/client.js +1 -1
  3. package/dist/agent/custom-model-effort.js +1 -1
  4. package/dist/agent/fork-title.js +1 -1
  5. package/dist/agent/image-request.js +1 -1
  6. package/dist/agent/image-tools.js +1 -1
  7. package/dist/agent/input-config.js +1 -1
  8. package/dist/agent/input-modes/chat.js +1 -1
  9. package/dist/agent/input-modes/execution-meta.js +1 -1
  10. package/dist/agent/input-modes/image-context.js +1 -1
  11. package/dist/agent/input-modes/image.js +1 -1
  12. package/dist/agent/input-modes/index.js +1 -1
  13. package/dist/agent/project-path.js +1 -1
  14. package/dist/agent/request-error.js +1 -1
  15. package/dist/agent/session-list-refresh.js +1 -1
  16. package/dist/app-reference.js +1 -1
  17. package/dist/application-tools.js +1 -1
  18. package/dist/approval/choice-elicitation-form.js +1 -1
  19. package/dist/approval/choice-schema.js +1 -1
  20. package/dist/approval/permission-options.js +1 -1
  21. package/dist/approval/permission-view.js +1 -1
  22. package/dist/approval/schema-elicitation-form.js +1 -1
  23. package/dist/approval/url-elicitation-card.js +1 -1
  24. package/dist/{chunk-704h27t9.js → chunk-0c0txenw.js} +2 -2
  25. package/dist/chunk-0f00j53n.js +2 -0
  26. package/dist/{chunk-1y5zgya3.js → chunk-0ga1y5v1.js} +2 -2
  27. package/dist/chunk-0mc30tx9.js +2 -0
  28. package/dist/chunk-0pmacxae.js +2 -0
  29. package/dist/{chunk-9pm3vzgx.js → chunk-0pxeark7.js} +3 -3
  30. package/dist/chunk-138xvdrk.js +2 -0
  31. package/dist/chunk-189aq7st.js +2 -0
  32. package/dist/{chunk-b89bzpce.js → chunk-18gxawh7.js} +2 -2
  33. package/dist/{chunk-w2z3sxdq.js → chunk-19jh646d.js} +2 -2
  34. package/dist/{chunk-mahky9ad.js → chunk-1bvgs2t1.js} +2 -2
  35. package/dist/{chunk-7d8xet8s.js → chunk-1jsjn8ga.js} +2 -2
  36. package/dist/{chunk-sqqa7t1n.js → chunk-1vf301b7.js} +3 -3
  37. package/dist/{chunk-k3h77wtz.js → chunk-1xrdp5kw.js} +2 -2
  38. package/dist/{chunk-ma6ycen5.js → chunk-239gtn3z.js} +2 -2
  39. package/dist/chunk-29wxdp28.js +2 -0
  40. package/dist/{chunk-x4bzkzbt.js → chunk-2c7a0zdc.js} +2 -2
  41. package/dist/{chunk-rhptdqpp.js → chunk-2d8msv4h.js} +2 -2
  42. package/dist/{chunk-1jznzjzn.js → chunk-2dq1epq4.js} +2 -2
  43. package/dist/chunk-2f5cbah7.js +2 -0
  44. package/dist/{chunk-5t2ge7gg.js → chunk-2sc2z6g5.js} +2 -2
  45. package/dist/{chunk-a0qy1r02.js → chunk-32zzqeyf.js} +2 -2
  46. package/dist/{chunk-vqqafkcx.js → chunk-36j9fer8.js} +2 -2
  47. package/dist/{chunk-yx3eqj75.js → chunk-38geb5gj.js} +2 -2
  48. package/dist/{chunk-7n3z2bay.js → chunk-3942tdd5.js} +2 -2
  49. package/dist/{chunk-awrz081w.js → chunk-3btheq4v.js} +2 -2
  50. package/dist/{chunk-ggxdrm0c.js → chunk-3qwmf9qd.js} +2 -2
  51. package/dist/{chunk-bnzpnsh1.js → chunk-4115mzgp.js} +3 -3
  52. package/dist/{chunk-f84mdhkx.js → chunk-413sz7fx.js} +2 -2
  53. package/dist/{chunk-zhf7403q.js → chunk-42dfq7ze.js} +2 -2
  54. package/dist/{chunk-5hjk7xnq.js → chunk-46j8adkj.js} +2 -2
  55. package/dist/{chunk-yw927w3q.js → chunk-483jakc1.js} +2 -2
  56. package/dist/chunk-48zgp33j.js +2 -0
  57. package/dist/{chunk-xxmzqazr.js → chunk-4d2khkms.js} +2 -2
  58. package/dist/{chunk-re34mbpa.js → chunk-4mca4p7m.js} +2 -2
  59. package/dist/{chunk-chg6j0zg.js → chunk-4p1z0b21.js} +2 -2
  60. package/dist/chunk-4p3ekttc.js +2 -0
  61. package/dist/{chunk-5f7t16kj.js → chunk-4sj3t6mk.js} +2 -2
  62. package/dist/{chunk-kdcde4s5.js → chunk-4w0x1hdt.js} +2 -2
  63. package/dist/{chunk-51s7qck0.js → chunk-54awxpw2.js} +2 -2
  64. package/dist/{chunk-xckysrk7.js → chunk-5cas0xvp.js} +2 -2
  65. package/dist/{chunk-12bfnfbk.js → chunk-5dtpfpq5.js} +2 -2
  66. package/dist/{chunk-3vdx0cme.js → chunk-5dxzfdd1.js} +2 -2
  67. package/dist/{chunk-ypdh88cj.js → chunk-5dygcexv.js} +2 -2
  68. package/dist/chunk-5fcp7haj.js +4 -0
  69. package/dist/chunk-5g32hx9d.js +2 -0
  70. package/dist/{chunk-p9226dye.js → chunk-5h8h4sas.js} +2 -2
  71. package/dist/chunk-5ny4ped8.js +2 -0
  72. package/dist/chunk-5wed639g.js +2 -0
  73. package/dist/{chunk-zwpv75f4.js → chunk-6hxz5cpc.js} +2 -2
  74. package/dist/{chunk-n96z8etk.js → chunk-6ja6pt5x.js} +2 -2
  75. package/dist/{chunk-b7ze9dje.js → chunk-6kyq5zxt.js} +2 -2
  76. package/dist/chunk-6m9frvzj.js +2 -0
  77. package/dist/chunk-6xzf444w.js +2 -0
  78. package/dist/{chunk-82e3194f.js → chunk-70ks1y6v.js} +2 -2
  79. package/dist/{chunk-rayhzb8p.js → chunk-7393tva2.js} +2 -2
  80. package/dist/{chunk-18ea0dty.js → chunk-7dy4z3r8.js} +2 -2
  81. package/dist/{chunk-fbrv2v3t.js → chunk-7egc2x4q.js} +1 -1
  82. package/dist/{chunk-y47sn7w2.js → chunk-7g0cbkbp.js} +2 -2
  83. package/dist/{chunk-3y9az4b9.js → chunk-7n1v87h0.js} +2 -2
  84. package/dist/{chunk-cy5kh1yr.js → chunk-7rqryntm.js} +2 -2
  85. package/dist/{chunk-zmr5pwhd.js → chunk-7vby3f2v.js} +2 -2
  86. package/dist/{chunk-f8bx4etj.js → chunk-8477q09c.js} +2 -2
  87. package/dist/{chunk-jhaf3qtt.js → chunk-8f8dma9e.js} +2 -2
  88. package/dist/{chunk-py2q899w.js → chunk-8ktb3g8c.js} +2 -2
  89. package/dist/{chunk-w1h28vvd.js → chunk-8zy4az1y.js} +2 -2
  90. package/dist/{chunk-wkbxdz82.js → chunk-9162ez1n.js} +2 -2
  91. package/dist/{chunk-6yx869ht.js → chunk-91jmmkd3.js} +2 -2
  92. package/dist/{chunk-vcj2jfnz.js → chunk-964fwwsg.js} +2 -2
  93. package/dist/{chunk-egbb5295.js → chunk-9cfmet6r.js} +2 -2
  94. package/dist/{chunk-tszqev50.js → chunk-9sag90th.js} +2 -2
  95. package/dist/{chunk-rsbced6k.js → chunk-a6vp2dmt.js} +2 -2
  96. package/dist/{chunk-m8243rnx.js → chunk-a74zcp1j.js} +2 -2
  97. package/dist/{chunk-xcx9g1wb.js → chunk-aa2xhwh2.js} +2 -2
  98. package/dist/{chunk-r8gfcyeb.js → chunk-abxsr9d1.js} +2 -2
  99. package/dist/{chunk-ky3n1mza.js → chunk-afnnrn6z.js} +2 -2
  100. package/dist/{chunk-srz8hnnx.js → chunk-afypqn52.js} +3 -3
  101. package/dist/{chunk-7a806p3q.js → chunk-ansfap1a.js} +3 -3
  102. package/dist/{chunk-9qqxdv6f.js → chunk-avq6x733.js} +2 -2
  103. package/dist/{chunk-jftxq3se.js → chunk-axz2rr58.js} +2 -2
  104. package/dist/{chunk-8tnx3p86.js → chunk-b0p2j2ab.js} +1 -1
  105. package/dist/{chunk-0zncrzar.js → chunk-b4qe4xnp.js} +2 -2
  106. package/dist/{chunk-p9x6rya1.js → chunk-b4wh6k5s.js} +2 -2
  107. package/dist/{chunk-hj8nkk6a.js → chunk-b64hyshj.js} +2 -2
  108. package/dist/{chunk-abbpbnjj.js → chunk-bajn7ssf.js} +2 -2
  109. package/dist/{chunk-xg6ayxsy.js → chunk-batckcj8.js} +2 -2
  110. package/dist/{chunk-j9f4mh66.js → chunk-bbfzm39y.js} +2 -2
  111. package/dist/{chunk-gh1rtwrb.js → chunk-bj3sacn1.js} +2 -2
  112. package/dist/{chunk-h3geg09z.js → chunk-bmeych5s.js} +2 -2
  113. package/dist/{chunk-x4brdfv3.js → chunk-bsqe29dh.js} +2 -2
  114. package/dist/{chunk-m6yg0dc9.js → chunk-cxhyh0w9.js} +2 -2
  115. package/dist/chunk-cz31f4gr.js +2 -0
  116. package/dist/{chunk-1pnbntv2.js → chunk-d336k00a.js} +2 -2
  117. package/dist/{chunk-9n8cds8p.js → chunk-d5pn8932.js} +2 -2
  118. package/dist/{chunk-016v1nnv.js → chunk-dakt7k9q.js} +4 -4
  119. package/dist/{chunk-j4w2hbbe.js → chunk-darm80tf.js} +2 -2
  120. package/dist/chunk-dhda1jhs.js +2 -0
  121. package/dist/{chunk-rrzz41z1.js → chunk-djppmswk.js} +2 -2
  122. package/dist/{chunk-5fyxge7c.js → chunk-drs741zm.js} +2 -2
  123. package/dist/{chunk-pd5yrdg6.js → chunk-dzw6vqqf.js} +2 -2
  124. package/dist/{chunk-cj99j82f.js → chunk-e0t3cpx3.js} +2 -2
  125. package/dist/{chunk-3dvxhfcr.js → chunk-e8mxwqxy.js} +2 -2
  126. package/dist/{chunk-jfyz3rx6.js → chunk-edqxxx93.js} +2 -2
  127. package/dist/chunk-eedgav4q.js +2 -0
  128. package/dist/{chunk-4hasepkm.js → chunk-eexn5mmk.js} +2 -2
  129. package/dist/chunk-eg00mvca.js +2 -0
  130. package/dist/{chunk-3a8qwbgh.js → chunk-esxjnj1y.js} +3 -3
  131. package/dist/{chunk-yjm613ey.js → chunk-et01n220.js} +2 -2
  132. package/dist/{chunk-5jvpeww3.js → chunk-ezaypwps.js} +2 -2
  133. package/dist/{chunk-c4rptwfx.js → chunk-f0gq9f1f.js} +3 -3
  134. package/dist/{chunk-bf7sgpzq.js → chunk-f9zpep12.js} +2 -2
  135. package/dist/{chunk-3d3z6dam.js → chunk-ftsqd7n5.js} +2 -2
  136. package/dist/{chunk-544g9fky.js → chunk-fz9y067h.js} +2 -2
  137. package/dist/{chunk-t4twdrdg.js → chunk-g23ktesb.js} +2 -2
  138. package/dist/{chunk-kvwyryw2.js → chunk-g9426ns9.js} +2 -2
  139. package/dist/{chunk-spqfmr4z.js → chunk-gt50nb3j.js} +2 -2
  140. package/dist/{chunk-7k2z2nvy.js → chunk-gtyrc6cd.js} +2 -2
  141. package/dist/{chunk-wbjf9maj.js → chunk-gvqvw7ms.js} +2 -2
  142. package/dist/chunk-h1t76wws.js +2 -0
  143. package/dist/{chunk-fdfftrzj.js → chunk-hfh3yen9.js} +3 -3
  144. package/dist/{chunk-znafsq0a.js → chunk-hm7f1vsx.js} +2 -2
  145. package/dist/chunk-hmtsavm4.js +2 -0
  146. package/dist/chunk-hqfhb4ng.js +2 -0
  147. package/dist/{chunk-06mvwewp.js → chunk-hz8yrg2t.js} +2 -2
  148. package/dist/{chunk-8q5zwkry.js → chunk-hzhcajx1.js} +2 -2
  149. package/dist/{chunk-mfrg4vze.js → chunk-j1kf4cj2.js} +5 -5
  150. package/dist/{chunk-nqt9gyz9.js → chunk-jkqh03w4.js} +2 -2
  151. package/dist/chunk-jtcccqpp.js +2 -0
  152. package/dist/{chunk-j29d8rts.js → chunk-jtnjd3ec.js} +2 -2
  153. package/dist/{chunk-pyqhwz2d.js → chunk-jv1db7gt.js} +2 -2
  154. package/dist/{chunk-qm0zd4wj.js → chunk-jx0djwvd.js} +2 -2
  155. package/dist/{chunk-nf7q3crw.js → chunk-jytat3j5.js} +3 -3
  156. package/dist/{chunk-7z1k4s4f.js → chunk-k1atcess.js} +2 -2
  157. package/dist/{chunk-cr0pb6g0.js → chunk-kcgc9915.js} +2 -2
  158. package/dist/chunk-m0skv5q0.js +2 -0
  159. package/dist/{chunk-a1wbf348.js → chunk-m395aw24.js} +3 -3
  160. package/dist/chunk-m3a6paxj.js +2 -0
  161. package/dist/{chunk-qmx3t5he.js → chunk-m7tj6194.js} +2 -2
  162. package/dist/{chunk-23r2z6bp.js → chunk-m9rbb04n.js} +2 -2
  163. package/dist/{chunk-11kv54bx.js → chunk-me230xjh.js} +3 -3
  164. package/dist/chunk-mjfc1dyv.js +2 -0
  165. package/dist/{chunk-wbnmcagf.js → chunk-mnz33drf.js} +3 -3
  166. package/dist/{chunk-kagkszdc.js → chunk-mtcxr3ns.js} +2 -2
  167. package/dist/{chunk-pe79c1re.js → chunk-mzqfa37p.js} +2 -2
  168. package/dist/chunk-n7pyzjq1.js +2 -0
  169. package/dist/{chunk-rfkgks0a.js → chunk-nabyjzn5.js} +2 -2
  170. package/dist/{chunk-c3nn4h2q.js → chunk-nfkfgz2s.js} +2 -2
  171. package/dist/{chunk-p6ffd8yn.js → chunk-nn8pmwqz.js} +2 -2
  172. package/dist/{chunk-9ecgnmtx.js → chunk-npkbsc1k.js} +3 -3
  173. package/dist/{chunk-wvm8srp7.js → chunk-p474fn4q.js} +2 -2
  174. package/dist/chunk-p781sb6h.js +2 -0
  175. package/dist/{chunk-9h9vtcwk.js → chunk-paxthe5v.js} +2 -2
  176. package/dist/{chunk-93bqj8az.js → chunk-pbx1417n.js} +2 -2
  177. package/dist/{chunk-djqexpgf.js → chunk-pqw5qz4e.js} +2 -2
  178. package/dist/{chunk-n8b9yg4q.js → chunk-pqz2471h.js} +2 -2
  179. package/dist/chunk-pv7t4hw8.js +2 -0
  180. package/dist/{chunk-46bgwhx8.js → chunk-pxv16edc.js} +2 -2
  181. package/dist/{chunk-4z6gyvy3.js → chunk-pyx2n7yx.js} +2 -2
  182. package/dist/{chunk-3915ad7f.js → chunk-qbxdgkk9.js} +2 -2
  183. package/dist/chunk-qecs9e31.js +2 -0
  184. package/dist/{chunk-jnpkpe5t.js → chunk-qt16accq.js} +2 -2
  185. package/dist/{chunk-enc99kvz.js → chunk-r013w7yb.js} +2 -2
  186. package/dist/{chunk-kx9nnmwb.js → chunk-r3s28905.js} +3 -3
  187. package/dist/chunk-r7n16m8h.js +2 -0
  188. package/dist/{chunk-af0e5epn.js → chunk-r7z3mvej.js} +2 -2
  189. package/dist/chunk-rak4mkgh.js +2 -0
  190. package/dist/{chunk-zyermn00.js → chunk-rkejggyx.js} +2 -2
  191. package/dist/{chunk-xb6x221t.js → chunk-rtjf5haf.js} +2 -2
  192. package/dist/{chunk-ay699evt.js → chunk-s0mrsrb0.js} +3 -3
  193. package/dist/{chunk-tftgnw1w.js → chunk-sjqhtpzr.js} +2 -2
  194. package/dist/{chunk-askwff3a.js → chunk-smd9rszw.js} +3 -3
  195. package/dist/{chunk-036wyz4n.js → chunk-swmxz9q0.js} +2 -2
  196. package/dist/{chunk-2d4zb2ac.js → chunk-t56ncd8f.js} +2 -2
  197. package/dist/{chunk-5p53j8mf.js → chunk-t9ktp4sf.js} +2 -2
  198. package/dist/{chunk-v6x7x69b.js → chunk-tdw7k1df.js} +2 -2
  199. package/dist/{chunk-705j0x4q.js → chunk-tjc0ntnh.js} +2 -2
  200. package/dist/{chunk-tzb4b5ve.js → chunk-tnmghaap.js} +2 -2
  201. package/dist/chunk-ts7h148j.js +2 -0
  202. package/dist/{chunk-h4cx5xr4.js → chunk-v5m2qx8b.js} +4 -4
  203. package/dist/{chunk-4vfrxhj4.js → chunk-vazspetj.js} +2 -2
  204. package/dist/{chunk-pwk7epmy.js → chunk-vbbndjfd.js} +2 -2
  205. package/dist/chunk-vchbk4h5.js +2 -0
  206. package/dist/{chunk-15m908ph.js → chunk-vhxr0c4c.js} +2 -2
  207. package/dist/{chunk-z5n4zqeg.js → chunk-vw6546pp.js} +2 -2
  208. package/dist/{chunk-mfmh7ztq.js → chunk-vzm88w2r.js} +2 -2
  209. package/dist/{chunk-7r3k37ys.js → chunk-wdxxr1xk.js} +2 -2
  210. package/dist/{chunk-9m36e0yq.js → chunk-wf4z9w5x.js} +2 -2
  211. package/dist/{chunk-fy8dmpv3.js → chunk-wwywmqh8.js} +2 -2
  212. package/dist/{chunk-mq32437t.js → chunk-wy4rtebz.js} +2 -2
  213. package/dist/chunk-x0m4ctqf.js +2 -0
  214. package/dist/chunk-xpts50f0.js +2 -0
  215. package/dist/{chunk-c531krny.js → chunk-xq4xeksc.js} +3 -3
  216. package/dist/{chunk-q988bycf.js → chunk-yfb5hj4w.js} +2 -2
  217. package/dist/{chunk-nec3tcjh.js → chunk-ymgc4317.js} +2 -2
  218. package/dist/{chunk-cjj5bxdb.js → chunk-yvmjh230.js} +2 -2
  219. package/dist/{chunk-r84xcy0d.js → chunk-ywax4zad.js} +2 -2
  220. package/dist/{chunk-cfj92m1y.js → chunk-z930082m.js} +2 -2
  221. package/dist/chunk-zd1fk347.js +2 -0
  222. package/dist/client.js +1 -1
  223. package/dist/codex/activity-group.js +1 -1
  224. package/dist/codex/artifact-links.js +1 -1
  225. package/dist/codex/assistant-message.js +1 -1
  226. package/dist/codex/async-question-card.js +1 -1
  227. package/dist/codex/edited-files-card.js +1 -1
  228. package/dist/codex/image-view-activity.js +1 -1
  229. package/dist/codex/markdown-renderer.js +1 -1
  230. package/dist/codex/navigation-audio.js +1 -1
  231. package/dist/codex/navigation-preview.js +1 -1
  232. package/dist/codex/navigation-rail.js +1 -1
  233. package/dist/codex/patch-view.js +1 -1
  234. package/dist/codex/plan.js +1 -1
  235. package/dist/codex/timeline-virtualizer.js +1 -1
  236. package/dist/codex/turn-activity.js +1 -1
  237. package/dist/codex/user-message.js +1 -1
  238. package/dist/codex/virtualized-turn-list.js +1 -1
  239. package/dist/collections/collection-emoji.js +1 -1
  240. package/dist/collections/collection-menu.js +1 -1
  241. package/dist/collections/collection-panel.js +1 -1
  242. package/dist/collections/collections.js +1 -1
  243. package/dist/collections/host.js +1 -1
  244. package/dist/collections/model.js +1 -1
  245. package/dist/collections/store.js +1 -1
  246. package/dist/composer/completion-filter.js +1 -1
  247. package/dist/composer/completion-menu.js +1 -1
  248. package/dist/composer/completion-trigger.js +1 -1
  249. package/dist/composer/effort-slider.js +1 -1
  250. package/dist/composer/inline-document.js +1 -1
  251. package/dist/composer/inline-dom.js +1 -1
  252. package/dist/composer/menu-radio.js +1 -1
  253. package/dist/composer/model-select.js +1 -1
  254. package/dist/composer/permission-mode-select.js +1 -1
  255. package/dist/composer/prompt-input-attachments.js +1 -1
  256. package/dist/composer/prompt-input-clipboard.js +1 -1
  257. package/dist/composer/prompt-input-context.js +1 -1
  258. package/dist/composer/prompt-input-inline.js +1 -1
  259. package/dist/composer/prompt-input-textarea.js +1 -1
  260. package/dist/composer/prompt-input.js +1 -1
  261. package/dist/conversation/action-card.js +1 -1
  262. package/dist/conversation/composer/app-mentions.js +1 -1
  263. package/dist/conversation/composer/apps-menu.js +1 -1
  264. package/dist/conversation/composer/composer-menu.js +1 -1
  265. package/dist/conversation/composer/composer.js +1 -1
  266. package/dist/conversation/composer/config-options.js +1 -1
  267. package/dist/conversation/composer/context.js +1 -1
  268. package/dist/conversation/composer/drafts.js +1 -1
  269. package/dist/conversation/composer/file-items.js +1 -1
  270. package/dist/conversation/composer/long-text.js +1 -1
  271. package/dist/conversation/composer/mention-chips.js +1 -1
  272. package/dist/conversation/composer/mention-uri.js +1 -1
  273. package/dist/conversation/composer/model-menu.js +1 -1
  274. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  275. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  276. package/dist/conversation/composer/prediction.js +1 -1
  277. package/dist/conversation/composer/prompt-history.js +1 -1
  278. package/dist/conversation/composer/slash-command-button.js +1 -1
  279. package/dist/conversation/composer/submit-button.js +1 -1
  280. package/dist/conversation/composer/usage-meter.js +1 -1
  281. package/dist/conversation/connection-notice.js +1 -1
  282. package/dist/conversation/context.js +1 -1
  283. package/dist/conversation/conversation-body.js +1 -1
  284. package/dist/conversation/conversation-search.js +1 -1
  285. package/dist/conversation/conversation-view.js +1 -1
  286. package/dist/conversation/conversation.js +1 -1
  287. package/dist/conversation/diff-modal.js +1 -1
  288. package/dist/conversation/draft-project-picker.js +1 -1
  289. package/dist/conversation/session-actions.js +1 -1
  290. package/dist/conversation/subagent-sessions.js +1 -1
  291. package/dist/conversation/subagent-tasks.js +1 -1
  292. package/dist/desktop/desktop-composer.js +1 -1
  293. package/dist/desktop/desktop.js +1 -1
  294. package/dist/desktop/draft-model-select.js +1 -1
  295. package/dist/desktop/load-image.js +1 -1
  296. package/dist/desktop/model-catalog.js +1 -1
  297. package/dist/desktop/model-recovery.js +1 -1
  298. package/dist/desktop/model-settings-action.js +1 -1
  299. package/dist/desktop/native-file-drop.js +1 -1
  300. package/dist/generated/commands.js +1 -1
  301. package/dist/image-lightbox.js +1 -1
  302. package/dist/image-preview-dialog.js +1 -1
  303. package/dist/image.js +1 -1
  304. package/dist/lib/app-reference.js +1 -1
  305. package/dist/lib/application-metadata.js +1 -1
  306. package/dist/lib/chat-path.js +1 -1
  307. package/dist/lib/code-highlighter.js +1 -1
  308. package/dist/lib/file-url.js +1 -1
  309. package/dist/lib/fuzzy.js +1 -1
  310. package/dist/lib/group-blocks.js +1 -1
  311. package/dist/lib/image-encode.js +1 -1
  312. package/dist/lib/limits.js +1 -1
  313. package/dist/lib/markdown-parser.js +1 -1
  314. package/dist/lib/markdown-rules.js +1 -1
  315. package/dist/lib/model-name.js +1 -1
  316. package/dist/lib/prepare-prompt-files.js +1 -1
  317. package/dist/lib/reference-presentation.js +1 -1
  318. package/dist/lib/stream-style.js +1 -1
  319. package/dist/lib/streaming-markdown.js +1 -1
  320. package/dist/lib/tool-artifacts.js +1 -1
  321. package/dist/mermaid/diagram.js +1 -1
  322. package/dist/mermaid/export.js +1 -1
  323. package/dist/mermaid/index.js +1 -1
  324. package/dist/mermaid/preview.js +1 -1
  325. package/dist/oauth/claude-login.js +1 -1
  326. package/dist/oauth.js +1 -1
  327. package/dist/plugins/catalog-header.js +1 -1
  328. package/dist/plugins/catalog-skeleton.js +1 -1
  329. package/dist/plugins/host.js +1 -1
  330. package/dist/plugins/new-chat-directory.js +1 -1
  331. package/dist/plugins/panel-item.js +1 -1
  332. package/dist/plugins/plugin-detail-page.js +1 -1
  333. package/dist/plugins/plugin-icon.js +1 -1
  334. package/dist/plugins/plugin-icons.js +1 -1
  335. package/dist/plugins/plugins-page.js +1 -1
  336. package/dist/plugins/plugins.js +1 -1
  337. package/dist/plugins/read-skill-document.js +1 -1
  338. package/dist/plugins/skill-document.js +1 -1
  339. package/dist/plugins/skills-tab.js +1 -1
  340. package/dist/plugins/store.js +1 -1
  341. package/dist/plugins/toolbox-layout.js +1 -1
  342. package/dist/reference-projection.js +1 -1
  343. package/dist/search/chat-search.js +1 -1
  344. package/dist/search/codex-source-matches.js +1 -1
  345. package/dist/search/dom-matches.js +1 -1
  346. package/dist/search/find-bar.js +1 -1
  347. package/dist/search/literal-matches.js +1 -1
  348. package/dist/session-list/account-menu.js +1 -1
  349. package/dist/session-list/activity-list.js +1 -1
  350. package/dist/session-list/archived-sessions.js +1 -1
  351. package/dist/session-list/help-menu.js +1 -1
  352. package/dist/session-list/highlight.js +1 -1
  353. package/dist/session-list/host.js +1 -1
  354. package/dist/session-list/hover-info-card.js +1 -1
  355. package/dist/session-list/navigation-controls.js +1 -1
  356. package/dist/session-list/navigation-header.js +1 -1
  357. package/dist/session-list/navigation-store.js +1 -1
  358. package/dist/session-list/navigation-tabs.js +1 -1
  359. package/dist/session-list/navigation.js +1 -1
  360. package/dist/session-list/platform.js +1 -1
  361. package/dist/session-list/row-stop-button.js +1 -1
  362. package/dist/session-list/session-groups.js +1 -1
  363. package/dist/session-list/session-info-card.js +1 -1
  364. package/dist/session-list/session-list.js +1 -1
  365. package/dist/session-list/session-row.js +1 -1
  366. package/dist/session-list/session-state-dot.js +1 -1
  367. package/dist/session-list/session-state-menu.js +1 -1
  368. package/dist/session-list/shortcut-hint.js +1 -1
  369. package/dist/session-list/shortcut.js +1 -1
  370. package/dist/session-list/sidebar-overlay.js +1 -1
  371. package/dist/session-list/trailing-swap.js +1 -1
  372. package/dist/session-list/use-activity-notification.js +1 -1
  373. package/dist/session-list/use-activity-preview.js +1 -1
  374. package/dist/session-list/use-cmd-held.js +1 -1
  375. package/dist/session-list/use-project-sessions.js +1 -1
  376. package/dist/session-list/virtual-session-rows.js +1 -1
  377. package/dist/session-timeline/activity-group.js +1 -1
  378. package/dist/session-timeline/activity-projection.js +1 -1
  379. package/dist/session-timeline/assistant-content.js +1 -1
  380. package/dist/session-timeline/assistant-image-references.js +1 -1
  381. package/dist/session-timeline/assistant-turn.js +1 -1
  382. package/dist/session-timeline/async-questions.js +1 -1
  383. package/dist/session-timeline/edited-files-card.js +1 -1
  384. package/dist/session-timeline/history-timeline.js +1 -1
  385. package/dist/session-timeline/host.js +1 -1
  386. package/dist/session-timeline/image-generation-progress.js +1 -1
  387. package/dist/session-timeline/navigation-rail.js +1 -1
  388. package/dist/session-timeline/plan.js +1 -1
  389. package/dist/session-timeline/question-reply.js +1 -1
  390. package/dist/session-timeline/resource-content.js +1 -1
  391. package/dist/session-timeline/session-timeline.js +1 -1
  392. package/dist/session-timeline/timeline-registry.js +1 -1
  393. package/dist/session-timeline/turn-activity.js +1 -1
  394. package/dist/session-timeline/turn-error.js +1 -1
  395. package/dist/session-timeline/turn-retry.js +1 -1
  396. package/dist/session-timeline/turn-time.js +1 -1
  397. package/dist/session-timeline/turns.js +1 -1
  398. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  399. package/dist/session-timeline/user-message.js +1 -1
  400. package/dist/settings/codex-account-card.js +1 -1
  401. package/dist/settings/login-card.js +1 -1
  402. package/dist/settings/model-alias-settings.js +1 -1
  403. package/dist/settings/model-aliases.js +1 -1
  404. package/dist/settings/provider-logos.js +1 -1
  405. package/dist/settings/provider-section.js +1 -1
  406. package/dist/settings/providers-port.js +1 -1
  407. package/dist/settings/providers.js +1 -1
  408. package/dist/settings/settings-bridge.js +1 -1
  409. package/dist/settings/settings.js +1 -1
  410. package/package.json +1 -1
  411. package/dist/chunk-0vtxfvdj.js +0 -2
  412. package/dist/chunk-1h3f538q.js +0 -2
  413. package/dist/chunk-2qa3c571.js +0 -2
  414. package/dist/chunk-2w3c4tg8.js +0 -2
  415. package/dist/chunk-5e575zvm.js +0 -2
  416. package/dist/chunk-6ewv4vns.js +0 -2
  417. package/dist/chunk-6wsr59dr.js +0 -2
  418. package/dist/chunk-7gv27b1c.js +0 -2
  419. package/dist/chunk-9dm7j0c9.js +0 -4
  420. package/dist/chunk-b5g055qp.js +0 -2
  421. package/dist/chunk-c4mm4fzg.js +0 -2
  422. package/dist/chunk-d9q9qgm1.js +0 -2
  423. package/dist/chunk-eb78ebxa.js +0 -2
  424. package/dist/chunk-et3nrp9v.js +0 -2
  425. package/dist/chunk-fer4r3b8.js +0 -2
  426. package/dist/chunk-hjbq9ez1.js +0 -2
  427. package/dist/chunk-hwppy236.js +0 -2
  428. package/dist/chunk-hzcerz8j.js +0 -2
  429. package/dist/chunk-jp2s1xsa.js +0 -2
  430. package/dist/chunk-jzarxwap.js +0 -2
  431. package/dist/chunk-ky4j58wz.js +0 -2
  432. package/dist/chunk-mdzng667.js +0 -2
  433. package/dist/chunk-mgs3dhdm.js +0 -2
  434. package/dist/chunk-p0v9d7e1.js +0 -2
  435. package/dist/chunk-qj87dxrr.js +0 -2
  436. package/dist/chunk-qth2ames.js +0 -2
  437. package/dist/chunk-qyfkwznx.js +0 -2
  438. package/dist/chunk-rkqptd9w.js +0 -2
  439. package/dist/chunk-srqs8z90.js +0 -2
  440. package/dist/chunk-v92wj4tv.js +0 -2
  441. package/dist/chunk-vsm89jmx.js +0 -2
  442. package/dist/chunk-wg223rq3.js +0 -2
  443. package/dist/chunk-wv6ntscn.js +0 -2
  444. package/dist/chunk-x03z0hme.js +0 -2
  445. package/dist/chunk-x072jj4c.js +0 -2
  446. package/dist/chunk-y3kn2w77.js +0 -2
  447. package/dist/chunk-zdqjjwx0.js +0 -2
@@ -1,2 +1,2 @@
1
- import{uo}from"./chunk-f84mdhkx.js";import{$i,ne}from"./chunk-5hjk7xnq.js";import{Hi}from"./chunk-0zncrzar.js";import{so}from"./chunk-jnpkpe5t.js";import{An}from"./chunk-tftgnw1w.js";import{Bi,ao}from"./chunk-11kv54bx.js";import{Ui}from"./chunk-cjj5bxdb.js";import{Mn}from"./chunk-5p53j8mf.js";import{fe}from"./chunk-hzcerz8j.js";import{tt,Ue}from"./chunk-ky4j58wz.js";import{lo}from"./chunk-ypdh88cj.js";import{te,Nn}from"./chunk-036wyz4n.js";import{CodexClient as M,configRevisionOf as O,isBooleanOption as S,isGroupedSelect as v,isImage as R,isSelectOption as f,mergeMeta as g,runStateSource as C}from"@nyssance/codex-acp-v2/client";var x={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function d(e){let s=e.find((t)=>t.category==="model"&&t.type==="select");return s?.type==="select"&&typeof s.currentValue==="string"?s.currentValue:null}function I(e){let s=e["x-codex-turn-metadata"];if(typeof e.callId!=="string"||typeof s?.turn_id!=="string")throw Error("Codex tool call metadata is missing callId or turn_id");return{toolCallId:e.callId,turnId:s.turn_id}}class Oi extends M{applicationRegistry=new uo((e)=>this.holds(e)?this.session(e):void 0,I);toolSelection;async executeShell(e,s){let t=this.session(e);if(!t.attached||t.restoring||t.readOnly||t.state!=="idle")throw Error("The session is not ready for a shell command");await this.codexCapabilities.executeShell(e,s),this.materializeDraft(e)}modelListeners=new Set;confirmedModelListeners=new Set;savedModels={main:null,chat:null};slotModels={main:null,chat:null};slotTargets={main:null,chat:null};slotVersions={main:0,chat:0};draftDirectoryIntents=new Map;draftOperations=new Map;gatewayModels=new Map;configOwners=new Map;openingOwners=new Map;schedulingConfig=new Set;replayRepairs=new Map;accountRevocations=new Map;accountRecoveries=new Map;resolveModelOption;constructor(e,s){let{applicationTools:t=[],resolveModel:i,imageService:n,...o}=s;super(e,o,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.toolSelection=t,this.resolveModelOption=i,this.imageService=n,this.imageTool=n?Ui(n,(a)=>this.imageRequests.get(a)):void 0}imageTool;imageService;inputModes=new Map;inputSelections=new Map;async readInputConfig(e){let s=this.live(),t=await s.request("_codex/session_input_config_get",{sessionId:e});if(s!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,t)}async writeInputConfig(e,s){let t=this.live(),i=await t.request("_codex/session_input_config_set",{sessionId:e,inputConfig:s});if(t!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,i)}acceptInputConfig(e,s){let t=Mn(s,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=t.inputConfig;if(i&&tt(i.mode)){if(Ue(i.mode).parseConfig(i.config),this.inputModes.set(e,i.mode),i.mode==="image")this.inputSelections.set(e,fe.parseConfig(i.config))}return t}imageRequests=new Map;prompt(e,s,t={}){if(!this.imageService)return super.prompt(e,s,t);if(!this.inputModes.has(e))return this.imageService.inputMode(e).then((i)=>(this.inputModes.set(e,i),this.prompt(e,s,t)));return Ue(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,s,{...t,meta:g(t.meta,{alwith:{imageIntent:null,applicationContext:Ue("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,s,t)})}promptImage(e,s,t){if(!this.imageService)throw Error("Image service is not connected");ao(t.meta?.alwith?.imageAspectRatio);let i=t.meta?.alwith?.imageSelection;if(i!==void 0)ne(i);let n=i??this.inputSelections.get(e)??this.imageService.selection(),o={...this.session(e).state!=="idle"?this.imageRequests.get(e)?.selection??n:n};ne(o);let a=crypto.randomUUID();return this.promptImages.set(a,new Map(s.flatMap((r,l)=>R(r)?[[`attachment:${l}`,`data:${r.mimeType};base64,${r.data}`]]:[]))),super.prompt(e,s,{...t,meta:g(t.meta,{alwith:{imageSelection:o,imageRequestId:a,applicationContext:fe.applicationContext(t.meta?.alwith?.imageIntent??"generate",Bi),imageIntent:t.meta?.alwith?.imageIntent??"generate"}})}).finally(()=>this.promptImages.delete(a))}promptMeta(e,s){let t=s.meta?.alwith?.imageSelection;if(this.inputModes.get(e)==="image"&&t&&this.imageService&&(this.session(e).state==="idle"||!this.imageRequests.has(e))){let i=new Map($i(this.session(e)).map((o)=>[o.id,o.src]));for(let[o,a]of this.promptImages.get((s.meta?.alwith).imageRequestId)??[])i.set(o,a);let n=ao((s.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:t,references:i,...n?{aspect:n}:{}})}return lo(super.promptMeta(e,s))}promptImages=new Map;promptWithImages(e,s,t={}){return this.prompt(e,s,{...t,meta:g({alwith:{imageIntent:"generate"}},t.meta)})}async applicationToolsFor(e){let s=typeof this.toolSelection==="function"?await this.toolSelection(e):this.toolSelection,t=e.options.meta?.alwith;return[...s,...e.options.applicationTools??[],...t?.nativeTools?.imageGeneration===!1&&this.imageTool?[this.imageTool]:[]]}releaseImages(e){this.imageRequests.delete(e)}onDisconnected(){for(let e of this.imageRequests.keys())this.releaseImages(e);this.promptImages.clear(),this.applicationRegistry.clear(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),await super.cancel(e)}async close(e){this.releaseImages(e),this.applicationRegistry.drop(e),await super.close(e)}async stopSession(e){this.releaseImages(e),this.applicationRegistry.drop(e);let s=this.state.draftSessions[e];if(s===void 0)return super.stopSession(e);await this.changeDraft([s],()=>this.state.draftSessions[e]?super.close(e):super.stopSession(e))}setApp(e){this.store.setState(e)}applyRunStates(e,s="event"){let t=this.state.runStates,i=e.map((n)=>{let o=t[n.sessionId];return o&&JSON.stringify(o)===JSON.stringify(n)?o:n});if(C(t)===s&&i.length===Object.keys(t).length&&i.every((n)=>n===t[n.sessionId]))return;super.applyRunStates(i,s)}enqueueSession(e,s,t=!0){let i=!t&&!this.schedulingConfig.has(e);return super.enqueueSession(e,()=>{let n=()=>{let r=this.holds(e)?d(this.session(e).configOptions):null;return s().then(async(l)=>{if(this.holds(e)&&d(this.session(e).configOptions)!==r)await this.normalizeCustomEffort(e,!0);return l})},o=()=>{let r=i?this.normalizeCustomEffort(e,!1):void 0;return r?r.then(n):n()},a=t?void 0:this.replayRepairs.get(e)?.promise;return a?a.then(o):o()},t)}customEffortChange(e,s,t=!1,i){if(!this.holds(e))return;let n=this.session(e);if(!n.attached||n.readOnly)return;let o=d(n.configOptions),a=so(o);if(!a)return;let r=n.configOptions.find((p)=>p.category==="thought_level"&&f(p)),l,h;if(r&&f(r)){let p=v(r.options)?r.options.flatMap((c)=>c.options):r.options;if(r.currentValue===a.value||!s&&p.some((c)=>c.value===r.currentValue))return;if(!p.some((c)=>c.value===a.value))throw Error(`The model does not advertise its default effort: ${o}`);l=r.configId,h=!s&&i!==void 0&&p.some((c)=>c.value===i)?i:a.value}else{if(!a.hidden||!t||o===null)return;let p=n.configOptions.find((c)=>c.category==="model");if(!p)throw Error("The custom model has no model option");l=p.configId,h=o}return{configId:l,value:h}}normalizeCustomEffort(e,s,t=!1,i){let n=this.customEffortChange(e,s,t,i);return n?this.writeCustomEffort(e,n.configId,n.value):void 0}async writeCustomEffort(e,s,t){let i=this.live(),n=this.lifecycle.capture(e),o=await i.request("session/set_config_option",{sessionId:e,configId:s,type:"id",value:t});if(i!==this.agent||!this.lifecycle.isCurrent(n))throw Error("Effort configuration belongs to a retired session");this.publishSession({...this.session(e),configOptions:o.configOptions,configRevision:O(o)??this.session(e).configRevision})}async afterSessionCreated(e){await super.afterSessionCreated(e);try{await super.enqueueSession(e,async()=>this.normalizeCustomEffort(e,!0,!0),!1)}catch(s){try{await this.delete(e)}catch(t){throw AggregateError([s,t],"Failed to initialize and clean up the custom model session",{cause:t})}throw s}}replay(e,s,t){let i=this.replayRepairs.get(e);if(i?.cwd===s)return i.promise;let n=this.replayWithEffort(e,s,t);this.replayRepairs.set(e,{cwd:s,promise:n});let o=()=>{if(this.replayRepairs.get(e)?.promise===n)this.replayRepairs.delete(e)};return n.then(o,o),n}async replayWithEffort(e,s,t){let i=this.holds(e)?this.session(e).configOptions:[],n=i.find((r)=>r.category==="thought_level")?.currentValue,o=this.state.modelRecovery[e]??!1;try{if(await super.replay(e,s,t),!o&&this.state.modelRecovery[e]&&!this.session(e).readOnly&&!te(this.session(e).error?.error))await super.replay(e,s,t)}finally{this.accountRecoveries.delete(e)}if(this.state.modelRecovery[e]&&!this.session(e).readOnly&&!te(this.session(e).error?.error))throw Error(this.session(e).error?.error?.message??"The selected model connection is unavailable");let a=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,d(i)===d(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(r){if(this.holds(e)&&this.lifecycle.isCurrent(a))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw r}}async connect(){if(await super.connect(),this.state.projectContext===null)await this.refreshProjectContext()}async listProjectSessions(e){await this.listSessions();let s=this.projectPath(e),t=this.sessionGroup({cwd:s}).id;return this.state.sessionList.filter((i)=>this.sessionGroup(i).id===t)}async newSession(e,s=null,t="main"){if(s!==null&&typeof s==="object")return super.newSession(e,s);let i=++this.slotVersions[t],n=await this.createNativeSession(e,await this.resolveModel(s),null);return this.activateSlot(t,n,i),n}async createNativeSession(e,s,t,i="chat"){let n=await super.newSession(e,{draft:t!==null,meta:g(y(s),this.imageService||t!==null?{alwith:{...this.imageService?{inputMode:i}:{},...t===null?{}:{draft:!0}}}:void 0)});if(t!==null)this.draftDirectoryIntents.set(n,e),this.setApp((o)=>({draftSessions:{...o.draftSessions,[n]:t}}));return this.noteModel(this.session(n)),n}async open(e,s,t="main"){if(typeof t!=="string")return super.open(e,s,t);if(t==="chat"&&this.imageService&&(this.inputModes.get(e)??await this.imageService.inputMode(e))==="image")throw Error("Image conversations must be opened in the main window");this.bindSlot(t,e),++this.slotVersions[t];let i=this.holds(e)?this.session(e):void 0;if(i?.attached&&(!this.imageService||this.inputModes.has(e))&&!i.restoring&&!i.readOnly&&!this.lifecycle.operations.busy(e)&&!this.replayRepairs.has(e)){this.followModel(t,i);return}await this.replayForOwner(e,s,t)}async replayForOwner(e,s,t){this.openingOwners.set(e,t);try{await this.replay(e,s)}finally{if(this.openingOwners.get(e)===t)this.openingOwners.delete(e)}}async requestContext(e,s,t){if(this.imageService){let i=s.kind==="resume"?s.sessionId:s.kind==="fork"?s.sourceSessionId:null,n=i===null?t.meta?.alwith?.inputMode??"chat":await this.imageService.inputMode(i),o=Ue(n),a=lo(t.meta),r={...a?.alwith,nativeTools:o.nativeTools},l=await this.requestModelContext(e,s,{...t,meta:{...a,alwith:r}});return{...l,bind:async(h)=>{await l.bind?.(h),this.inputModes.set(h,n)}}}return this.requestModelContext(e,s,t)}async requestModelContext(e,s,t){if(s.kind==="resume"&&this.state.modelRecovery[s.sessionId]&&t.meta?.alwith?.model===void 0){let l=s.sessionId,h=this.accountRevocations.get(l)??0,p=await this.firstAvailableModel();if((this.accountRevocations.get(l)??0)!==h)throw Error("ALwith account changed during model selection");return this.accountRecoveries.set(l,h),this.requestToolContext(e,s,{...t,meta:g(t.meta,{alwith:{model:p,accountModelSelection:!0}})})}if(s.kind!=="resume"||t.meta?.alwith?.model!==void 0)return this.requestToolContext(e,s,t);let i=s.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?d(n.configOptions):null)??this.gatewayModels.get(i)??null,a=await this.resolveModel(o),r=o===null?null:a;return this.requestToolContext(e,s,{...t,meta:g(y(r),t.meta)})}async requestToolContext(e,s,t){let i=await this.applicationToolsFor({cwd:e,operation:s,options:t}),n=await super.requestContext(e,s,t);if(!i.length)return n;if(!this.state.agent?.capabilities?.session?.mcp?.acp)throw Error("The agent does not advertise capabilities.session.mcp.acp");let o=this.applicationRegistry.declare(this.live(),i);return{...n,mcpServers:[...n.mcpServers??[],o],bind:async(a)=>{await n.bind?.(a),this.applicationRegistry.bind(o.serverId,a)}}}async installedApps(e){let s=this.live(),t=await super.installedApps(e),i=await Hi((n,o)=>s.request(n,o),t.apps.map((n)=>n.id),e?.threadId);if(s!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:t.apps.map((n)=>({...n,...i.get(n.id)}))}}async firstAvailableModel(){let e=await this.resolveModel(null);if(e===null)throw Error("No available models. Configure a model connection and try again.");return e}async recoverReplay(e,s,t,i){let n=te(t);if(!n&&!Nn(t))return super.recoverReplay(e,s,t,i);try{await super.afterResume(e,s,i)}catch(o){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;this.setApp((a)=>({historyPages:{...a.historyPages,[e]:{cursor:null,loading:!1,error:o instanceof Error?o.message:String(o)}}}))}if(n){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:t.reason??t.message,data:t.data},meta:null}}),!0}if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.accountRevocations.set(e,(this.accountRevocations.get(e)??0)+1),this.setApp((o)=>({modelRecovery:{...o.modelRecovery,[e]:!0}})),this.publishSession({...this.session(e),cwd:s,attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:t.reason??t.message,data:t.data},meta:null}}),!0}markAccountModelsUnavailable(e){this.setApp((s)=>({modelRecovery:{...s.modelRecovery,...Object.fromEntries(e.map((t)=>[t,!0]))}}));for(let s of e){if(this.accountRevocations.set(s,(this.accountRevocations.get(s)??0)+1),!this.holds(s))continue;this.publishSession({...this.session(s),attached:!1,readOnly:this.session(s).readOnly})}}async resumeModel(e,s){let t=this.session(e);if(!this.state.modelRecovery[e]&&(t.attached||!te(t.error?.error)))throw Error("Model recovery is not required");if(!s)throw Error("Select a model before continuing");let i=this.accountRevocations.get(e)??0,n=await this.resolveModel(s);if(!n)throw Error("The selected provider connection or model is unavailable");if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");this.accountRecoveries.set(e,i);try{await this.replay(e,t.cwd,{meta:{alwith:{model:n,accountModelSelection:!0}}})}catch(a){if(this.holds(e)&&this.state.modelRecovery[e])this.publishSession({...this.session(e),attached:!1,restoring:!1});throw a}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i&&this.state.modelRecovery[e])throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((a)=>{let{[e]:r,...l}=a.modelRecovery;return{modelRecovery:l}}),this.confirmModel(this.state.sessionWindows[e]??"main",o)}setConfig(e,s,t,i="main"){this.configOwners.set(`${e}:${s}`,i),this.schedulingConfig.add(e);try{return super.setConfig(e,s,t)}finally{this.schedulingConfig.delete(e)}}onConfigChanged(e,s,t){super.onConfigChanged(e,s,t),this.noteModel(this.session(e));let i=this.configOwners.get(`${e}:${s}`)??"main";if(this.configOwners.delete(`${e}:${s}`),t.configOptions.some((n)=>n.configId===s&&n.category==="model"))this.confirmModel(i,this.session(e))}changeDraft(e,s){let t=Promise.allSettled(e.map((i)=>this.draftOperations.get(i)).filter((i)=>i!==void 0)).then(s);for(let i of e)this.draftOperations.set(i,t);return t}prepareDraft(e,s,t=null,i=!1,n="chat"){if(e==="chat"&&n!=="chat")throw Error("The floating chat only supports chat input");let o=++this.slotVersions[e];return this.changeDraft([e],async()=>{let a=s??(await this.refreshProjectContext(!0)).chatDirectory,r=Object.keys(this.state.draftSessions).find((c)=>this.state.draftSessions[c]===e);if(r)await this.lifecycle.admission.pending(r);let l=t??(r?d(this.session(r).configOptions):this.savedModels[e]??this.slotModels[e]),h=i?null:await this.resolveModel(l,t===null?"draft":"session");if(r&&(this.inputModes.get(r)??"chat")===n&&this.session(r).cwd===a&&(!this.draftDirectoryIntents.has(r)||this.draftDirectoryIntents.get(r)===s)&&!i&&!this.state.modelRecovery[r]&&(h===null?!d(this.session(r).configOptions)?.startsWith("gateway:"):d(this.session(r).configOptions)===h)){if(this.activateSlot(e,r,o),!this.session(r).attached)await this.replayForOwner(r,a,e);if(t!==null)this.confirmModel(e,this.session(r));return r}let p=await this.createNativeSession(s,h,e,n);try{if(r&&this.session(r).cwd===a)for(let c of this.session(r).configOptions){if(c.category==="model")continue;if(c.category==="thought_level"&&d(this.session(r).configOptions)!==d(this.session(p).configOptions)&&so(d(this.session(p).configOptions))!==null)continue;let u=this.session(p).configOptions.find((w)=>w.configId===c.configId);if(!u||u.currentValue===c.currentValue)continue;if(S(c)&&S(u))await this.setConfig(p,c.configId,c.currentValue);else if(f(c)&&f(u)){if((v(u.options)?u.options.flatMap((m)=>m.options):u.options).some((m)=>m.value===c.currentValue))await this.setConfig(p,c.configId,c.currentValue)}}if(r)await this.deleteEmptyDraft(r)}catch(c){throw await this.deleteEmptyDraft(p),c}if(this.activateSlot(e,p,o),t!==null||i||l!==null&&l!==h)this.confirmModel(e,this.session(p));return p})}discardDraft(e){if(e!=="main"&&e!=="chat")return super.discardDraft(e);return this.changeDraft([e],async()=>{for(let[s,t]of Object.entries(this.state.draftSessions))if(t===e)await this.deleteEmptyDraft(s)})}transferDraft(e,s){return this.changeDraft(["main","chat"],async()=>{if(s==="chat"&&this.inputModes.get(e)==="image")throw Error("Image conversations must remain in the main window");if(!this.state.draftSessions[e]||this.state.draftSessions[e]===s)return;for(let[t,i]of Object.entries(this.state.draftSessions))if(i===s)await this.deleteEmptyDraft(t);this.setApp((t)=>t.draftSessions[e]?{draftSessions:{...t.draftSessions,[e]:s}}:{})})}deleteEmptyDraft(e){return this.enqueueSession(e,async()=>{if(!this.state.draftSessions[e])return;await this.delete(e),this.gatewayModels.delete(e)})}onDraftMaterialized(e){super.onDraftMaterialized(e),this.draftDirectoryIntents.delete(e),this.setApp((s)=>{let{[e]:t,...i}=s.draftSessions;return{draftSessions:i}}),this.noteModel(this.session(e))}onSessionDropped(e){this.applicationRegistry.drop(e),super.onSessionDropped(e),this.inputModes.delete(e),this.inputSelections.delete(e),this.draftDirectoryIntents.delete(e),this.gatewayModels.delete(e),this.accountRevocations.delete(e),this.accountRecoveries.delete(e),this.setApp((s)=>{let{[e]:t,...i}=s.draftSessions,{[e]:n,...o}=s.sessionWindows,{[e]:a,...r}=s.modelRecovery;return{draftSessions:i,sessionWindows:o,modelRecovery:r}})}fork(e,s,t){let i=typeof t==="object"?t:t===void 0?{}:{lastTurnId:t};return super.fork(e,s,i)}async forkInternal(e,s,t){let n=[...(await Promise.all([this.indexSessions(),this.indexSessions(void 0,!0)])).flat(),...this.state.sessionList,...this.state.archivedSessions],o=(this.holds(e)?this.session(e).title:null)??n.find((l)=>l.sessionId===e)?.title,a=await super.forkInternal(e,s,{...t,meta:g(y(this.gatewayModels.get(e)??null),t.meta)});await super.enqueueSession(a,async()=>this.normalizeCustomEffort(a,!1,!0),!1);let r=o??this.session(a).title;if(r)await this.renameSession(a,An(r,n.flatMap((l)=>l.title?[l.title]:[])));return a}onForked(e,s){super.onForked(e,s),this.noteModel(this.session(e))}onReplayed(e,s){super.onReplayed(e,s);let t=this.accountRevocations.get(e);if(t!==void 0&&this.accountRecoveries.get(e)!==t)this.markAccountModelsUnavailable([e]);if(this.state.modelRecovery[e]&&this.accountRecoveries.get(e)===(this.accountRevocations.get(e)??0)&&this.session(e).attached&&!this.session(e).readOnly)this.accountRevocations.delete(e),this.setApp((i)=>{let{[e]:n,...o}=i.modelRecovery;return{modelRecovery:o}});this.noteModel(this.session(e))}setModelSelections(e){this.savedModels={...e},this.slotModels={...e}}onConfirmedModel(e){return this.confirmedModelListeners.add(e),()=>this.confirmedModelListeners.delete(e)}onSessionChanged(e){super.onSessionChanged(e);let s=this.accountRevocations.get(e.id);if(s!==void 0&&this.accountRecoveries.get(e.id)!==s&&e.attached){this.publishSession({...e,attached:!1});return}this.followModel("main",e),this.followModel("chat",e)}followModel(e,s){if(this.slotTargets[e]!==s.id||!s.attached||s.restoring)return;let t=d(s.configOptions);if(t!==null)this.slotModels[e]=t}activateSlot(e,s,t){if(this.slotVersions[e]!==t)return;this.bindSlot(e,s),this.followModel(e,this.session(s))}bindSlot(e,s){let t=e==="main"?"chat":"main";if(this.slotTargets[t]===s)this.slotTargets[t]=null,++this.slotVersions[t];this.slotTargets[e]=s,this.setApp((i)=>({sessionWindows:{...i.sessionWindows,[s]:e}}))}confirmModel(e,s){let t=d(s.configOptions);if(t===null)throw Error("Model selection did not return the current model");this.followModel(e,s),this.savedModels[e]=t;for(let i of this.confirmedModelListeners)i(e,t)}resolveModel(e,s="session"){return this.resolveModelOption?this.resolveModelOption(e,s):Promise.resolve(e)}onSessionModel(e){return this.modelListeners.add(e),()=>this.modelListeners.delete(e)}noteModel(e){let s=d(e.configOptions);if(s===null)return;let t=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(t&&f(t)){let o=(v(t.options)?t.options.find((a)=>a.groupId===x.id)?.options??[]:t.options.filter((a)=>!a.value.startsWith("gateway:"))).map((a)=>({id:a.value,label:a.name}));if(JSON.stringify(o)!==JSON.stringify(this.state.nativeModels))this.setApp({nativeModels:o})}let i=t!==void 0&&f(t)&&t.options.some((n)=>("groupId"in n)&&n.groupId!==x.id&&n.options.some((o)=>o.value===s));if(i)this.gatewayModels.set(e.id,s);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,s,i)}}
2
- export{x,Oi};
1
+ import{So}from"./chunk-413sz7fx.js";import{hr,te}from"./chunk-46j8adkj.js";import{gr}from"./chunk-b4qe4xnp.js";import{wo}from"./chunk-qt16accq.js";import{On}from"./chunk-sjqhtpzr.js";import{ur,bo}from"./chunk-me230xjh.js";import{dr}from"./chunk-yvmjh230.js";import{Hn}from"./chunk-t9ktp4sf.js";import{ge}from"./chunk-pv7t4hw8.js";import{et,Re}from"./chunk-ts7h148j.js";import{Co}from"./chunk-5dygcexv.js";import{ee,Fn}from"./chunk-swmxz9q0.js";import{CodexClient as M,configRevisionOf as O,isBooleanOption as S,isGroupedSelect as v,isImage as R,isSelectOption as f,mergeMeta as g,runStateSource as C}from"@nyssance/codex-acp-v2/client";var b={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function d(e){let s=e.find((t)=>t.category==="model"&&t.type==="select");return s?.type==="select"&&typeof s.currentValue==="string"?s.currentValue:null}function I(e){let s=e["x-codex-turn-metadata"];if(typeof e.callId!=="string"||typeof s?.turn_id!=="string")throw Error("Codex tool call metadata is missing callId or turn_id");return{toolCallId:e.callId,turnId:s.turn_id}}class lr extends M{applicationRegistry=new So((e)=>this.holds(e)?this.session(e):void 0,I);toolSelection;async executeShell(e,s){let t=this.session(e);if(!t.attached||t.restoring||t.readOnly||t.state!=="idle")throw Error("The session is not ready for a shell command");await this.codexCapabilities.executeShell(e,s),this.materializeDraft(e)}modelListeners=new Set;confirmedModelListeners=new Set;savedModels={main:null,chat:null};slotModels={main:null,chat:null};slotTargets={main:null,chat:null};slotVersions={main:0,chat:0};draftDirectoryIntents=new Map;draftOperations=new Map;gatewayModels=new Map;configOwners=new Map;openingOwners=new Map;schedulingConfig=new Set;replayRepairs=new Map;accountRevocations=new Map;accountRecoveries=new Map;resolveModelOption;constructor(e,s){let{applicationTools:t=[],resolveModel:i,imageService:n,...o}=s;super(e,o,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.toolSelection=t,this.resolveModelOption=i,this.imageService=n,this.imageTool=n?dr(n,(a)=>this.imageRequests.get(a)):void 0}imageTool;imageService;inputModes=new Map;inputSelections=new Map;async readInputConfig(e){let s=this.live(),t=await s.request("_codex/session_input_config_get",{sessionId:e});if(s!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,t)}async writeInputConfig(e,s){let t=this.live(),i=await t.request("_codex/session_input_config_set",{sessionId:e,inputConfig:s});if(t!==this.agent)throw Error("Session input configuration belongs to a disconnected agent");return this.acceptInputConfig(e,i)}acceptInputConfig(e,s){let t=Hn(s,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=t.inputConfig;if(i&&et(i.mode)){if(Re(i.mode).parseConfig(i.config),this.inputModes.set(e,i.mode),i.mode==="image")this.inputSelections.set(e,ge.parseConfig(i.config))}return t}imageRequests=new Map;prompt(e,s,t={}){if(!this.imageService)return super.prompt(e,s,t);if(!this.inputModes.has(e))return this.imageService.inputMode(e).then((i)=>(this.inputModes.set(e,i),this.prompt(e,s,t)));return Re(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,s,{...t,meta:g(t.meta,{alwith:{imageIntent:null,applicationContext:Re("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,s,t)})}promptImage(e,s,t){if(!this.imageService)throw Error("Image service is not connected");bo(t.meta?.alwith?.imageAspectRatio);let i=t.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 a=crypto.randomUUID();return this.promptImages.set(a,new Map(s.flatMap((r,l)=>R(r)?[[`attachment:${l}`,`data:${r.mimeType};base64,${r.data}`]]:[]))),super.prompt(e,s,{...t,meta:g(t.meta,{alwith:{imageSelection:o,imageRequestId:a,applicationContext:ge.applicationContext(t.meta?.alwith?.imageIntent??"generate",ur),imageIntent:t.meta?.alwith?.imageIntent??"generate"}})}).finally(()=>this.promptImages.delete(a))}promptMeta(e,s){let t=s.meta?.alwith?.imageSelection;if(this.inputModes.get(e)==="image"&&t&&this.imageService&&(this.session(e).state==="idle"||!this.imageRequests.has(e))){let i=new Map(hr(this.session(e)).map((o)=>[o.id,o.src]));for(let[o,a]of this.promptImages.get((s.meta?.alwith).imageRequestId)??[])i.set(o,a);let n=bo((s.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:t,references:i,...n?{aspect:n}:{}})}return Co(super.promptMeta(e,s))}promptImages=new Map;promptWithImages(e,s,t={}){return this.prompt(e,s,{...t,meta:g({alwith:{imageIntent:"generate"}},t.meta)})}async applicationToolsFor(e){let s=typeof this.toolSelection==="function"?await this.toolSelection(e):this.toolSelection,t=e.options.meta?.alwith;return[...s,...e.options.applicationTools??[],...t?.nativeTools?.imageGeneration===!1&&this.imageTool?[this.imageTool]:[]]}releaseImages(e){this.imageRequests.delete(e)}onDisconnected(){for(let e of this.imageRequests.keys())this.releaseImages(e);this.promptImages.clear(),this.applicationRegistry.clear(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),await super.cancel(e)}async close(e){this.releaseImages(e),this.applicationRegistry.drop(e),await super.close(e)}async stopSession(e){this.releaseImages(e),this.applicationRegistry.drop(e);let s=this.state.draftSessions[e];if(s===void 0)return super.stopSession(e);await this.changeDraft([s],()=>this.state.draftSessions[e]?super.close(e):super.stopSession(e))}setApp(e){this.store.setState(e)}applyRunStates(e,s="event"){let t=this.state.runStates,i=e.map((n)=>{let o=t[n.sessionId];return o&&JSON.stringify(o)===JSON.stringify(n)?o:n});if(C(t)===s&&i.length===Object.keys(t).length&&i.every((n)=>n===t[n.sessionId]))return;super.applyRunStates(i,s)}enqueueSession(e,s,t=!0){let i=!t&&!this.schedulingConfig.has(e);return super.enqueueSession(e,()=>{let n=()=>{let r=this.holds(e)?d(this.session(e).configOptions):null;return s().then(async(l)=>{if(this.holds(e)&&d(this.session(e).configOptions)!==r)await this.normalizeCustomEffort(e,!0);return l})},o=()=>{let r=i?this.normalizeCustomEffort(e,!1):void 0;return r?r.then(n):n()},a=t?void 0:this.replayRepairs.get(e)?.promise;return a?a.then(o):o()},t)}customEffortChange(e,s,t=!1,i){if(!this.holds(e))return;let n=this.session(e);if(!n.attached||n.readOnly)return;let o=d(n.configOptions),a=wo(o);if(!a)return;let r=n.configOptions.find((p)=>p.category==="thought_level"&&f(p)),l,h;if(r&&f(r)){let p=v(r.options)?r.options.flatMap((c)=>c.options):r.options;if(r.currentValue===a.value||!s&&p.some((c)=>c.value===r.currentValue))return;if(!p.some((c)=>c.value===a.value))throw Error(`The model does not advertise its default effort: ${o}`);l=r.configId,h=!s&&i!==void 0&&p.some((c)=>c.value===i)?i:a.value}else{if(!a.hidden||!t||o===null)return;let p=n.configOptions.find((c)=>c.category==="model");if(!p)throw Error("The custom model has no model option");l=p.configId,h=o}return{configId:l,value:h}}normalizeCustomEffort(e,s,t=!1,i){let n=this.customEffortChange(e,s,t,i);return n?this.writeCustomEffort(e,n.configId,n.value):void 0}async writeCustomEffort(e,s,t){let i=this.live(),n=this.lifecycle.capture(e),o=await i.request("session/set_config_option",{sessionId:e,configId:s,type:"id",value:t});if(i!==this.agent||!this.lifecycle.isCurrent(n))throw Error("Effort configuration belongs to a retired session");this.publishSession({...this.session(e),configOptions:o.configOptions,configRevision:O(o)??this.session(e).configRevision})}async afterSessionCreated(e){await super.afterSessionCreated(e);try{await super.enqueueSession(e,async()=>this.normalizeCustomEffort(e,!0,!0),!1)}catch(s){try{await this.delete(e)}catch(t){throw AggregateError([s,t],"Failed to initialize and clean up the custom model session",{cause:t})}throw s}}replay(e,s,t){let i=this.replayRepairs.get(e);if(i?.cwd===s)return i.promise;let n=this.replayWithEffort(e,s,t);this.replayRepairs.set(e,{cwd:s,promise:n});let o=()=>{if(this.replayRepairs.get(e)?.promise===n)this.replayRepairs.delete(e)};return n.then(o,o),n}async replayWithEffort(e,s,t){let i=this.holds(e)?this.session(e).configOptions:[],n=i.find((r)=>r.category==="thought_level")?.currentValue,o=this.state.modelRecovery[e]??!1;try{if(await super.replay(e,s,t),!o&&this.state.modelRecovery[e]&&!this.session(e).readOnly&&!ee(this.session(e).error?.error))await super.replay(e,s,t)}finally{this.accountRecoveries.delete(e)}if(this.state.modelRecovery[e]&&!this.session(e).readOnly&&!ee(this.session(e).error?.error))throw Error(this.session(e).error?.error?.message??"The selected model connection is unavailable");let a=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,d(i)===d(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(r){if(this.holds(e)&&this.lifecycle.isCurrent(a))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw r}}async connect(){if(await super.connect(),this.state.projectContext===null)await this.refreshProjectContext()}async listProjectSessions(e){await this.listSessions();let s=this.projectPath(e),t=this.sessionGroup({cwd:s}).id;return this.state.sessionList.filter((i)=>this.sessionGroup(i).id===t)}async newSession(e,s=null,t="main"){if(s!==null&&typeof s==="object")return super.newSession(e,s);let i=++this.slotVersions[t],n=await this.createNativeSession(e,await this.resolveModel(s),null);return this.activateSlot(t,n,i),n}async createNativeSession(e,s,t,i="chat"){let n=await super.newSession(e,{draft:t!==null,meta:g(y(s),this.imageService||t!==null?{alwith:{...this.imageService?{inputMode:i}:{},...t===null?{}:{draft:!0}}}:void 0)});if(t!==null)this.draftDirectoryIntents.set(n,e),this.setApp((o)=>({draftSessions:{...o.draftSessions,[n]:t}}));return this.noteModel(this.session(n)),n}async open(e,s,t="main"){if(typeof t!=="string")return super.open(e,s,t);if(t==="chat"&&this.imageService&&(this.inputModes.get(e)??await this.imageService.inputMode(e))==="image")throw Error("Image conversations must be opened in the main window");this.bindSlot(t,e),++this.slotVersions[t];let i=this.holds(e)?this.session(e):void 0;if(i?.attached&&(!this.imageService||this.inputModes.has(e))&&!i.restoring&&!i.readOnly&&!this.lifecycle.operations.busy(e)&&!this.replayRepairs.has(e)){this.followModel(t,i);return}await this.replayForOwner(e,s,t)}async replayForOwner(e,s,t){this.openingOwners.set(e,t);try{await this.replay(e,s)}finally{if(this.openingOwners.get(e)===t)this.openingOwners.delete(e)}}async requestContext(e,s,t){if(this.imageService){let i=s.kind==="resume"?s.sessionId:s.kind==="fork"?s.sourceSessionId:null,n=i===null?t.meta?.alwith?.inputMode??"chat":await this.imageService.inputMode(i),o=Re(n),a=Co(t.meta),r={...a?.alwith,nativeTools:o.nativeTools},l=await this.requestModelContext(e,s,{...t,meta:{...a,alwith:r}});return{...l,bind:async(h)=>{await l.bind?.(h),this.inputModes.set(h,n)}}}return this.requestModelContext(e,s,t)}async requestModelContext(e,s,t){if(s.kind==="resume"&&this.state.modelRecovery[s.sessionId]&&t.meta?.alwith?.model===void 0){let l=s.sessionId,h=this.accountRevocations.get(l)??0,p=await this.firstAvailableModel();if((this.accountRevocations.get(l)??0)!==h)throw Error("ALwith account changed during model selection");return this.accountRecoveries.set(l,h),this.requestToolContext(e,s,{...t,meta:g(t.meta,{alwith:{model:p,accountModelSelection:!0}})})}if(s.kind!=="resume"||t.meta?.alwith?.model!==void 0)return this.requestToolContext(e,s,t);let i=s.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?d(n.configOptions):null)??this.gatewayModels.get(i)??null,a=await this.resolveModel(o),r=o===null?null:a;return this.requestToolContext(e,s,{...t,meta:g(y(r),t.meta)})}async requestToolContext(e,s,t){let i=await this.applicationToolsFor({cwd:e,operation:s,options:t}),n=await super.requestContext(e,s,t);if(!i.length)return n;if(!this.state.agent?.capabilities?.session?.mcp?.acp)throw Error("The agent does not advertise capabilities.session.mcp.acp");let o=this.applicationRegistry.declare(this.live(),i);return{...n,mcpServers:[...n.mcpServers??[],o],bind:async(a)=>{await n.bind?.(a),this.applicationRegistry.bind(o.serverId,a)}}}async installedApps(e){let s=this.live(),t=await super.installedApps(e),i=await gr((n,o)=>s.request(n,o),t.apps.map((n)=>n.id),e?.threadId);if(s!==this.live())throw Error("Application metadata belongs to a disconnected agent");return{apps:t.apps.map((n)=>({...n,...i.get(n.id)}))}}async firstAvailableModel(){let e=await this.resolveModel(null);if(e===null)throw Error("No available models. Configure a model connection and try again.");return e}async recoverReplay(e,s,t,i){let n=ee(t);if(!n&&!Fn(t))return super.recoverReplay(e,s,t,i);try{await super.afterResume(e,s,i)}catch(o){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;this.setApp((a)=>({historyPages:{...a.historyPages,[e]:{cursor:null,loading:!1,error:o instanceof Error?o.message:String(o)}}}))}if(n){if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.publishSession({...this.session(e),attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:t.reason??t.message,data:t.data},meta:null}}),!0}if(i.signal.throwIfAborted(),!this.current(i)||!this.holds(e))return!0;return this.accountRevocations.set(e,(this.accountRevocations.get(e)??0)+1),this.setApp((o)=>({modelRecovery:{...o.modelRecovery,[e]:!0}})),this.publishSession({...this.session(e),cwd:s,attached:!1,restoring:!1,readOnly:!1,error:{stopReason:"error",error:{code:-32000,message:t.reason??t.message,data:t.data},meta:null}}),!0}markAccountModelsUnavailable(e){this.setApp((s)=>({modelRecovery:{...s.modelRecovery,...Object.fromEntries(e.map((t)=>[t,!0]))}}));for(let s of e){if(this.accountRevocations.set(s,(this.accountRevocations.get(s)??0)+1),!this.holds(s))continue;this.publishSession({...this.session(s),attached:!1,readOnly:this.session(s).readOnly})}}async resumeModel(e,s){let t=this.session(e);if(!this.state.modelRecovery[e]&&(t.attached||!ee(t.error?.error)))throw Error("Model recovery is not required");if(!s)throw Error("Select a model before continuing");let i=this.accountRevocations.get(e)??0,n=await this.resolveModel(s);if(!n)throw Error("The selected provider connection or model is unavailable");if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");this.accountRecoveries.set(e,i);try{await this.replay(e,t.cwd,{meta:{alwith:{model:n,accountModelSelection:!0}}})}catch(a){if(this.holds(e)&&this.state.modelRecovery[e])this.publishSession({...this.session(e),attached:!1,restoring:!1});throw a}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i&&this.state.modelRecovery[e])throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((a)=>{let{[e]:r,...l}=a.modelRecovery;return{modelRecovery:l}}),this.confirmModel(this.state.sessionWindows[e]??"main",o)}setConfig(e,s,t,i="main"){this.configOwners.set(`${e}:${s}`,i),this.schedulingConfig.add(e);try{return super.setConfig(e,s,t)}finally{this.schedulingConfig.delete(e)}}onConfigChanged(e,s,t){super.onConfigChanged(e,s,t),this.noteModel(this.session(e));let i=this.configOwners.get(`${e}:${s}`)??"main";if(this.configOwners.delete(`${e}:${s}`),t.configOptions.some((n)=>n.configId===s&&n.category==="model"))this.confirmModel(i,this.session(e))}changeDraft(e,s){let t=Promise.allSettled(e.map((i)=>this.draftOperations.get(i)).filter((i)=>i!==void 0)).then(s);for(let i of e)this.draftOperations.set(i,t);return t}prepareDraft(e,s,t=null,i=!1,n="chat"){if(e==="chat"&&n!=="chat")throw Error("The floating chat only supports chat input");let o=++this.slotVersions[e];return this.changeDraft([e],async()=>{let a=s??(await this.refreshProjectContext(!0)).chatDirectory,r=Object.keys(this.state.draftSessions).find((c)=>this.state.draftSessions[c]===e);if(r)await this.lifecycle.admission.pending(r);let l=t??(r?d(this.session(r).configOptions):this.savedModels[e]??this.slotModels[e]),h=i?null:await this.resolveModel(l,t===null?"draft":"session");if(r&&(this.inputModes.get(r)??"chat")===n&&this.session(r).cwd===a&&(!this.draftDirectoryIntents.has(r)||this.draftDirectoryIntents.get(r)===s)&&!i&&!this.state.modelRecovery[r]&&(h===null?!d(this.session(r).configOptions)?.startsWith("gateway:"):d(this.session(r).configOptions)===h)){if(this.activateSlot(e,r,o),!this.session(r).attached)await this.replayForOwner(r,a,e);if(t!==null)this.confirmModel(e,this.session(r));return r}let p=await this.createNativeSession(s,h,e,n);try{if(r&&this.session(r).cwd===a)for(let c of this.session(r).configOptions){if(c.category==="model")continue;if(c.category==="thought_level"&&d(this.session(r).configOptions)!==d(this.session(p).configOptions)&&wo(d(this.session(p).configOptions))!==null)continue;let u=this.session(p).configOptions.find((w)=>w.configId===c.configId);if(!u||u.currentValue===c.currentValue)continue;if(S(c)&&S(u))await this.setConfig(p,c.configId,c.currentValue);else if(f(c)&&f(u)){if((v(u.options)?u.options.flatMap((m)=>m.options):u.options).some((m)=>m.value===c.currentValue))await this.setConfig(p,c.configId,c.currentValue)}}if(r)await this.deleteEmptyDraft(r)}catch(c){throw await this.deleteEmptyDraft(p),c}if(this.activateSlot(e,p,o),t!==null||i||l!==null&&l!==h)this.confirmModel(e,this.session(p));return p})}discardDraft(e){if(e!=="main"&&e!=="chat")return super.discardDraft(e);return this.changeDraft([e],async()=>{for(let[s,t]of Object.entries(this.state.draftSessions))if(t===e)await this.deleteEmptyDraft(s)})}transferDraft(e,s){return this.changeDraft(["main","chat"],async()=>{if(s==="chat"&&this.inputModes.get(e)==="image")throw Error("Image conversations must remain in the main window");if(!this.state.draftSessions[e]||this.state.draftSessions[e]===s)return;for(let[t,i]of Object.entries(this.state.draftSessions))if(i===s)await this.deleteEmptyDraft(t);this.setApp((t)=>t.draftSessions[e]?{draftSessions:{...t.draftSessions,[e]:s}}:{})})}deleteEmptyDraft(e){return this.enqueueSession(e,async()=>{if(!this.state.draftSessions[e])return;await this.delete(e),this.gatewayModels.delete(e)})}onDraftMaterialized(e){super.onDraftMaterialized(e),this.draftDirectoryIntents.delete(e),this.setApp((s)=>{let{[e]:t,...i}=s.draftSessions;return{draftSessions:i}}),this.noteModel(this.session(e))}onSessionDropped(e){this.applicationRegistry.drop(e),super.onSessionDropped(e),this.inputModes.delete(e),this.inputSelections.delete(e),this.draftDirectoryIntents.delete(e),this.gatewayModels.delete(e),this.accountRevocations.delete(e),this.accountRecoveries.delete(e),this.setApp((s)=>{let{[e]:t,...i}=s.draftSessions,{[e]:n,...o}=s.sessionWindows,{[e]:a,...r}=s.modelRecovery;return{draftSessions:i,sessionWindows:o,modelRecovery:r}})}fork(e,s,t){let i=typeof t==="object"?t:t===void 0?{}:{lastTurnId:t};return super.fork(e,s,i)}async forkInternal(e,s,t){let n=[...(await Promise.all([this.indexSessions(),this.indexSessions(void 0,!0)])).flat(),...this.state.sessionList,...this.state.archivedSessions],o=(this.holds(e)?this.session(e).title:null)??n.find((l)=>l.sessionId===e)?.title,a=await super.forkInternal(e,s,{...t,meta:g(y(this.gatewayModels.get(e)??null),t.meta)});await super.enqueueSession(a,async()=>this.normalizeCustomEffort(a,!1,!0),!1);let r=o??this.session(a).title;if(r)await this.renameSession(a,On(r,n.flatMap((l)=>l.title?[l.title]:[])));return a}onForked(e,s){super.onForked(e,s),this.noteModel(this.session(e))}onReplayed(e,s){super.onReplayed(e,s);let t=this.accountRevocations.get(e);if(t!==void 0&&this.accountRecoveries.get(e)!==t)this.markAccountModelsUnavailable([e]);if(this.state.modelRecovery[e]&&this.accountRecoveries.get(e)===(this.accountRevocations.get(e)??0)&&this.session(e).attached&&!this.session(e).readOnly)this.accountRevocations.delete(e),this.setApp((i)=>{let{[e]:n,...o}=i.modelRecovery;return{modelRecovery:o}});this.noteModel(this.session(e))}setModelSelections(e){this.savedModels={...e},this.slotModels={...e}}onConfirmedModel(e){return this.confirmedModelListeners.add(e),()=>this.confirmedModelListeners.delete(e)}onSessionChanged(e){super.onSessionChanged(e);let s=this.accountRevocations.get(e.id);if(s!==void 0&&this.accountRecoveries.get(e.id)!==s&&e.attached){this.publishSession({...e,attached:!1});return}this.followModel("main",e),this.followModel("chat",e)}followModel(e,s){if(this.slotTargets[e]!==s.id||!s.attached||s.restoring)return;let t=d(s.configOptions);if(t!==null)this.slotModels[e]=t}activateSlot(e,s,t){if(this.slotVersions[e]!==t)return;this.bindSlot(e,s),this.followModel(e,this.session(s))}bindSlot(e,s){let t=e==="main"?"chat":"main";if(this.slotTargets[t]===s)this.slotTargets[t]=null,++this.slotVersions[t];this.slotTargets[e]=s,this.setApp((i)=>({sessionWindows:{...i.sessionWindows,[s]:e}}))}confirmModel(e,s){let t=d(s.configOptions);if(t===null)throw Error("Model selection did not return the current model");this.followModel(e,s),this.savedModels[e]=t;for(let i of this.confirmedModelListeners)i(e,t)}resolveModel(e,s="session"){return this.resolveModelOption?this.resolveModelOption(e,s):Promise.resolve(e)}onSessionModel(e){return this.modelListeners.add(e),()=>this.modelListeners.delete(e)}noteModel(e){let s=d(e.configOptions);if(s===null)return;let t=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(t&&f(t)){let o=(v(t.options)?t.options.find((a)=>a.groupId===b.id)?.options??[]:t.options.filter((a)=>!a.value.startsWith("gateway:"))).map((a)=>({id:a.value,label:a.name}));if(JSON.stringify(o)!==JSON.stringify(this.state.nativeModels))this.setApp({nativeModels:o})}let i=t!==void 0&&f(t)&&t.options.some((n)=>("groupId"in n)&&n.groupId!==b.id&&n.options.some((o)=>o.value===s));if(i)this.gatewayModels.set(e.id,s);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,s,i)}}
2
+ export{b,lr};
@@ -0,0 +1,2 @@
1
+ import{F}from"./chunk-hz8yrg2t.js";import{be}from"./chunk-vhxr0c4c.js";import{isPlanItems as n,isPlanMarkdown as r}from"@nyssance/codex-acp-v2/client";import{jsx as e}from"react/jsx-runtime";function fi({plan:t}){if(r(t))return e("div",{className:"codex-reasoning-details",children:e(F,{text:t.content,streaming:!1})});if(!n(t))return null;return e(be,{entries:t.entries})}
2
+ export{fi};
@@ -1,2 +1,2 @@
1
- import{Nr}from"./chunk-9m36e0yq.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function Mr(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Nr(a,r)}
2
- export{Mr};
1
+ import{Kr}from"./chunk-wf4z9w5x.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function yi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Kr(a,r)}
2
+ export{yi};
@@ -0,0 +1,2 @@
1
+ import{Ne}from"./chunk-cxhyh0w9.js";function rn(t){return Ne(t.absPath)}function sn(t){return t.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??t}function an(t){return sn(t.absPath)}
2
+ export{rn,sn,an};
@@ -1,3 +1,3 @@
1
- import{c}from"./chunk-06mvwewp.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
- `).length}function Oa(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function Tr({blocks:e}){return s(No,{files:Oa(e)})}function No({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
3
- export{Oa,Tr,No};
1
+ import{c}from"./chunk-hz8yrg2t.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
+ `).length}function Va(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function ls({blocks:e}){return s(zo,{files:Va(e)})}function zo({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
3
+ export{Va,ls,zo};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-b89bzpce.js";import{Jt,Xt}from"./chunk-ggxdrm0c.js";import{j}from"./chunk-j29d8rts.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ws({providers:n,store:l}){let{t:m}=e().host,d=Jt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=j(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Xt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
- export{Ws};
1
+ import{e}from"./chunk-18gxawh7.js";import{jt,qt}from"./chunk-3qwmf9qd.js";import{G}from"./chunk-jtnjd3ec.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ts({providers:n,store:l}){let{t:m}=e().host,d=jt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=G(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await qt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
+ export{Ts};
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-af0e5epn.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function Te(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>Te(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!Te(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Qn(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Us(t){u.get(t)?.set(v(t))}function J(t){let n=Qn(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ue(){return Qn(a()).set}function Bs(){let t=J((e)=>e.view),n=ue();return[t,(e)=>n({view:e})]}
2
- export{Te,Qn,Us,J,ue,Bs};
1
+ import{a}from"./chunk-r7z3mvej.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function ze(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let r=t.filter((s)=>ze(e,s)),S=new Set(r),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!ze(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")r.push(s)}return r.length===t.length&&r.every((s,i)=>s===t[i])?t:r}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function Ao(t){let n=u.get(t);if(n)return n;let e=v(t),r=new Set,S=(i)=>{e={...e,...i};for(let o of r)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(r.add(i),()=>r.delete(i))};return u.set(t,s),s}function Ca(t){u.get(t)?.set(v(t))}function ne(t){let n=Ao(a());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ve(){return Ao(a()).set}function wa(){let t=ne((e)=>e.view),n=ve();return[t,(e)=>n({view:e})]}
2
+ export{ze,Ao,Ca,ne,ve,wa};
@@ -1,3 +1,3 @@
1
- import{c,F}from"./chunk-06mvwewp.js";import{oe}from"./chunk-nf7q3crw.js";import{_r}from"./chunk-xg6ayxsy.js";import{ve}from"./chunk-15m908ph.js";import{Ar,Et}from"./chunk-016v1nnv.js";import{Tr}from"./chunk-3a8qwbgh.js";import{Bo}from"./chunk-zwpv75f4.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(F,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ve,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function rl({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
- `),T=!t.streaming&&C.trim().length>0?o(Io,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=_r(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&oe(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(Et,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Po,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(Tr,{blocks:f}):y(f))})}function Io({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Bo,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Po({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(Ar,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
- export{rl,Io,Po};
1
+ import{c,F}from"./chunk-hz8yrg2t.js";import{oe}from"./chunk-jytat3j5.js";import{as}from"./chunk-batckcj8.js";import{be}from"./chunk-vhxr0c4c.js";import{us,Ht}from"./chunk-dakt7k9q.js";import{ls}from"./chunk-esxjnj1y.js";import{Vo}from"./chunk-6hxz5cpc.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(F,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(be,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function cl({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
+ `),T=!t.streaming&&C.trim().length>0?o(Bo,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=as(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&oe(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(Ht,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Go,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(ls,{blocks:f}):y(f))})}function Bo({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Vo,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Go({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(us,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
+ export{cl,Bo,Go};
@@ -1,2 +1,2 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function $r({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
- export{$r};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function ss({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
+ export{ss};
@@ -1,2 +1,2 @@
1
- import{a,o}from"./chunk-af0e5epn.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Kt(e,r){let s=a(),c=o((t)=>t.connection),i=o((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=o((t)=>v(t.sessions[e]?.items)),f=o((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await s.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(r==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[s,e,c,f,i,r]),i?u:p??u}
2
- export{Kt};
1
+ import{a,o}from"./chunk-r7z3mvej.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function $n(e,r){let s=a(),c=o((t)=>t.connection),i=o((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=o((t)=>v(t.sessions[e]?.items)),f=o((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await s.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(r==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[s,e,c,f,i,r]),i?u:p??u}
2
+ export{$n};
@@ -1,2 +1,2 @@
1
- import{mo,kt}from"./chunk-cy5kh1yr.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function nt(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=mo(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Qa(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return kt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{nt,Qa};
1
+ import{_o,Pt}from"./chunk-7rqryntm.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function tt(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=_o(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function el(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Pt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
+ export{tt,el};
@@ -1,2 +1,2 @@
1
- import{s}from"./chunk-af0e5epn.js";import{Yt}from"./chunk-wbjf9maj.js";import{O}from"./chunk-kv1v7kgn.js";import{en,Ae}from"./chunk-7k2z2nvy.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as E}from"lucide-react";import{useEffect as g,useState as A}from"react";import{Input as D}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as w}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function lt(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:r})}function Pe({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:C,PathAction:u}=s(),f=Ae(),y=en();g(()=>{f(n)},[n,f]);let[I,p]=A(t.title??"");g(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?lt(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(Yt,{title:n?o(D,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(O,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(E,{className:"size-3.5"}),details:v,actions:l||a!==void 0?h(M,{children:[l,l&&a!==void 0&&o(w,{}),a]}):void 0})}
2
- export{lt,Pe};
1
+ import{s}from"./chunk-r7z3mvej.js";import{Vn}from"./chunk-gvqvw7ms.js";import{O}from"./chunk-kv1v7kgn.js";import{zn,He}from"./chunk-gtyrc6cd.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as E}from"lucide-react";import{useEffect as g,useState as A}from"react";import{Input as D}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as w}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function Nt(t,a){let r=a==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:r})}function Oe({sessionRow:t,actions:a,shortcut:r,renaming:n=!1,onRename:m}){let{t:i,i18n:C,PathAction:u}=s(),f=He(),y=zn();g(()=>{f(n)},[n,f]);let[I,p]=A(t.title??"");g(()=>{if(n)p(t.title??"")},[n,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?i("sessionList.archived"):t.updatedAt!==null?Nt(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(Vn,{title:n?o(D,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":i("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(O,{className:"min-w-0 flex-1",children:t.title??i("sessionList.untitled")})}),r]}),titleIcon:o(E,{className:"size-3.5"}),details:v,actions:l||a!==void 0?h(M,{children:[l,l&&a!==void 0&&o(w,{}),a]}):void 0})}
2
+ export{Nt,Oe};
@@ -1,2 +1,2 @@
1
- import{Dt}from"./chunk-hpv8x22r.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function Zr({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Dt({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
2
- export{Zr};
1
+ import{Dt}from"./chunk-hpv8x22r.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function Xr({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Dt({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
2
+ export{Xr};
@@ -1,2 +1,2 @@
1
- import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function rs({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
- export{rs};
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function ds({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
+ export{ds};
@@ -1,2 +1,2 @@
1
- import{Re,u}from"./chunk-b5g055qp.js";import{O}from"./chunk-kv1v7kgn.js";import{z}from"./chunk-kagkszdc.js";import{A}from"./chunk-1pnbntv2.js";import{pt,Ze,mt}from"./chunk-enc99kvz.js";import{PreviewCard as h}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as E}from"lucide-react";import{createContext as I,useContext as T,useLayoutEffect as G,useState as H}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as j}from"react/jsx-runtime";function M(o){if(o.as==="ul"){let{as:i,className:s,...a}=o;return e("ul",{className:p("flex w-full min-w-0 flex-col gap-0.5",s),...a})}let{as:t,className:n,...r}=o;return e("div",{className:p("flex w-full min-w-0 flex-col gap-0.5",n),...r})}function v({className:o,...t}){return e("span",{"data-slot":"navigation-leading",className:p("flex size-6 shrink-0 items-center justify-center [&_.lucide]:size-3.5",o),...t})}function f({active:o,className:t,...n}){return e("button",{type:"button","data-active":o?"":void 0,"aria-current":o?"page":void 0,className:p("group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",t),...n})}function re({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:C,headerChildren:g,wrapHeader:c,onHeaderClick:b,children:P}){let y=()=>{b?.(),t(!o)},x=p(pt,"relative flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-start [corner-shape:superellipse(1.5)]"),R=d(j,{children:[r!=null&&e(v,{children:r}),g??e(O,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(mt,{content:s!==void 0?e(Ze,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:C})})]}),S=g==null?d("div",{"data-active":l?"":void 0,title:n,className:p(x,u),onClick:y,onKeyDown:(m)=>{if(m.target!==m.currentTarget)return;if(m.key!=="Enter"&&m.key!==" ")return;m.preventDefault(),y()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),R]}):e("div",{"data-active":l?"":void 0,className:x,children:R});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[c===void 0?S:c(S),o&&e(M,{className:"mt-0.5",children:P})]})}var L=I(()=>{}),_=I(()=>{});function en(){return T(_)}function Ae(){return T(L)}function Ee({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:C,preview:g,listeningPorts:c,onOpenPort:b,accessory:P,meta:y,hint:x,actions:R,className:S,...m}){let k=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(pt,Re,"group/navigation-row focus-visible:outline-ring flex h-[var(--navigation-row-height,30px)] w-full items-center gap-1 overflow-hidden rounded-[10px] ps-1 pe-1.5 text-start text-sm outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]",(g||c!=null&&c.length>0)&&"h-auto min-h-[var(--navigation-row-height,30px)] py-2.5",S),...m,children:[e(v,{children:t!=null?e(z,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(O,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),C!=null&&e(O,{className:"text-muted-foreground text-xs",children:C}),g&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:g}),c!=null&&c.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:c.map((N)=>b?d("button",{type:"button",className:"underline",onPointerDown:(w)=>w.stopPropagation(),onKeyDown:(w)=>w.stopPropagation(),onClick:(w)=>{w.stopPropagation(),b(N)},children:[":",N]},N):d("span",{children:[":",N]},N))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(E,{className:"text-muted-foreground size-3"}),e(mt,{content:P!=null?e(Ze,{children:P}):y??e(Ze,{}),actions:R}),x!=null&&e("span",{className:"pointer-events-none absolute end-1 top-1/2 flex h-5 min-w-5 -translate-y-1/2 items-center justify-center",children:x})]})]});if(a==null)return k;return e(D,{row:k,onOpenChange:l,children:a})}function D({row:o,children:t,onOpenChange:n}){let[r,i]=H(!1),[s,a]=H(!1),l=r||s;return G(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(L.Provider,{value:a,children:e(_.Provider,{value:()=>{i(!1),a(!1)},children:e(q,{open:l,onOpenChange:i,trigger:o,children:t})})})}function q({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return A(o),d(h.Root,{open:o,onOpenChange:t,children:[e(h.Trigger,{render:n,delay:700,closeDelay:100}),e(h.Portal,{children:e(h.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(h.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
2
- export{M,v,f,re,en,Ae,Ee};
1
+ import{Be,m}from"./chunk-189aq7st.js";import{O}from"./chunk-kv1v7kgn.js";import{V}from"./chunk-mtcxr3ns.js";import{R}from"./chunk-d336k00a.js";import{At,ot,Et}from"./chunk-r013w7yb.js";import{PreviewCard as h}from"@base-ui/react/preview-card";import{cn as p}from"cn";import{LockIcon as z}from"lucide-react";import{createContext as T,useContext as L,useLayoutEffect as D,useState as I}from"react";import"@alwith/module-chat/session-list.css";import{jsx as e,jsxs as d,Fragment as j}from"react/jsx-runtime";function E(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 ae({open:o,onOpenChange:t,tooltip:n,leading:r,label:i,count:s,countLabel:a,active:l=!1,actions:C,headerChildren:g,wrapHeader:u,onHeaderClick:b,children:P}){let y=()=>{b?.(),t(!o)},x=p(At,"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(j,{children:[r!=null&&e(v,{children:r}),g??e(O,{className:"flex-1 text-sm opacity-70",children:i}),e("span",{className:"relative z-10 ms-auto",children:e(Et,{content:s!==void 0?e(ot,{className:p("text-muted-foreground justify-end text-xs opacity-70",a&&"w-auto"),children:e("span",{dir:"ltr",children:a??s})}):void 0,actions:C})})]}),k=g==null?d("div",{"data-active":l?"":void 0,title:n,className:p(x,m),onClick:y,onKeyDown:(c)=>{if(c.target!==c.currentTarget)return;if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault(),y()},children:[e("button",{type:"button","aria-expanded":o,"aria-label":typeof i==="string"?i:n,className:"focus-visible:outline-ring absolute inset-0 rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-[-2px]"}),S]}):e("div",{"data-active":l?"":void 0,className:x,children:S});return d("div",{className:"text-[#1a1c1f] dark:text-white",children:[u===void 0?k:u(k),o&&e(E,{className:"mt-0.5",children:P})]})}var _=T(()=>{}),G=T(()=>{});function zn(){return L(G)}function He(){return L(_)}function Ue({active:o=!1,state:t,interruption:n=null,leased:r=!1,media:i,title:s,hoverCard:a,onHoverCardOpenChange:l,subtitle:C,preview:g,listeningPorts:u,onOpenPort:b,accessory:P,meta:y,hint:x,actions:S,className:k,...c}){let H=d("div",{"data-slot":"navigation-session-item","data-active":o,className:p(At,Be,"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||u!=null&&u.length>0)&&"h-auto min-h-[var(--navigation-row-height,30px)] py-2.5",k),...c,children:[e(v,{children:t!=null?e(V,{state:t,title:n??void 0}):i}),d("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(O,{className:p("leading-none",t==="done"&&"font-semibold"),children:s}),C!=null&&e(O,{className:"text-muted-foreground text-xs",children:C}),g&&e("span",{className:"text-muted-foreground mt-1.5 line-clamp-2 text-xs leading-[18px] [overflow-wrap:anywhere] break-words",children:g}),u!=null&&u.length>0&&e("span",{className:"text-muted-foreground mt-1.5 flex flex-wrap items-center gap-2 font-mono text-xs",children:u.map((N)=>b?d("button",{type:"button",className:"underline",onPointerDown:(w)=>w.stopPropagation(),onKeyDown:(w)=>w.stopPropagation(),onClick:(w)=>{w.stopPropagation(),b(N)},children:[":",N]},N):d("span",{children:[":",N]},N))})]}),d("span",{className:"relative ms-auto flex shrink-0 items-center gap-1",children:[r&&e(z,{className:"text-muted-foreground size-3"}),e(Et,{content:P!=null?e(ot,{children:P}):y??e(ot,{}),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 H;return e(M,{row:H,onOpenChange:l,children:a})}function M({row:o,children:t,onOpenChange:n}){let[r,i]=I(!1),[s,a]=I(!1),l=r||s;return D(()=>(n?.(l),()=>n?.(!1)),[l,n]),e(_.Provider,{value:a,children:e(G.Provider,{value:()=>{i(!1),a(!1)},children:e(q,{open:l,onOpenChange:i,trigger:o,children:t})})})}function q({open:o,onOpenChange:t,trigger:n,children:r,side:i="inline-end",sideOffset:s=2,align:a="start",alignOffset:l}){return R(o),d(h.Root,{open:o,onOpenChange:t,children:[e(h.Trigger,{render:n,delay:700,closeDelay:100}),e(h.Portal,{children:e(h.Positioner,{side:i,sideOffset:s,align:a,alignOffset:l,className:"isolate z-50",children:e(h.Popup,{"data-slot":"codex-hover-card",className:"bg-popover text-popover-foreground ring-foreground/10 m-px flex w-80 max-w-[calc(100vw-1rem)] flex-col overflow-hidden rounded-md text-sm shadow-md ring-1 outline-hidden select-none",children:e("div",{className:"flex w-full min-w-0 flex-col px-0 py-1 break-words whitespace-normal",children:r})})})})]})}
2
+ export{E,v,f,ae,zn,He,Ue};
@@ -1,2 +1,2 @@
1
- import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Yt({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function G({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
2
- export{Yt,G};
1
+ import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Vn({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function j({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
2
+ export{Vn,j};
@@ -0,0 +1,2 @@
1
+ function _t(o){return o.kind==="tool"&&o.status==="completed"&&o.toolKind!=="read"&&o.toolKind!=="search"}
2
+ export{_t};
@@ -1,5 +1,5 @@
1
- import{_t,It,$n}from"./chunk-fer4r3b8.js";import{Tt,g}from"./chunk-a0qy1r02.js";import{InputGroupTextarea as w}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as K}from"cn";import{forwardRef as R,useCallback as D,useEffect as v,useImperativeHandle as M,useRef as d}from"react";import{flushSync as F}from"react-dom";import{jsx as N}from"react/jsx-runtime";var L=(i)=>!i.shiftKey,z=(i)=>i.altKey&&!i.ctrlKey&&!i.metaKey,po=R(({onChange:i,onKeyDown:x,onCompositionStart:T,onCompositionEnd:y,className:b,placeholder:E,bashMode:I=!1,isSendShortcut:C=L,isNewlineShortcut:S=z,...h},H)=>{let r=Tt(),f=g(),u=d(!1),c=d(!1),a=d(null),s=d(null),o=D(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||s.current!==null)return;s.current=requestAnimationFrame(()=>{s.current=null;let e=a.current;if(!e||u.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);v(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,n=new ResizeObserver(([l])=>{if(l&&l.contentRect.width!==t)t=l.contentRect.width,o()});return n.observe(e),o(),()=>{if(n.disconnect(),s.current!==null)cancelAnimationFrame(s.current);s.current=null}},[o]),v(o,[o,r?.textInput.value,h.value]);let p=I&&(r?.textInput.value??"").startsWith("!"),P=(e)=>{if(u.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||c.current)return;if(x?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
1
+ import{wt,kt,Dn}from"./chunk-vchbk4h5.js";import{Tt,g}from"./chunk-32zzqeyf.js";import{InputGroupTextarea as w}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as K}from"cn";import{forwardRef as R,useCallback as D,useEffect as v,useImperativeHandle as M,useRef as d}from"react";import{flushSync as F}from"react-dom";import{jsx as N}from"react/jsx-runtime";var L=(i)=>!i.shiftKey,z=(i)=>i.altKey&&!i.ctrlKey&&!i.metaKey,go=R(({onChange:i,onKeyDown:x,onCompositionStart:T,onCompositionEnd:y,className:b,placeholder:E,bashMode:I=!1,isSendShortcut:C=L,isNewlineShortcut:S=z,...h},H)=>{let r=Tt(),f=g(),u=d(!1),c=d(!1),a=d(null),s=d(null),o=D(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||s.current!==null)return;s.current=requestAnimationFrame(()=>{s.current=null;let e=a.current;if(!e||u.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);v(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,n=new ResizeObserver(([l])=>{if(l&&l.contentRect.width!==t)t=l.contentRect.width,o()});return n.observe(e),o(),()=>{if(n.disconnect(),s.current!==null)cancelAnimationFrame(s.current);s.current=null}},[o]),v(o,[o,r?.textInput.value,h.value]);let p=I&&(r?.textInput.value??"").startsWith("!"),P=(e)=>{if(u.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||c.current)return;if(x?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
2
  `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(p&&r){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),r.textInput.setInput(r.textInput.value.slice(1));return}}if(e.key==="Enter"){if(S(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:l}=t;if(r){let m=`${t.value.slice(0,n)}
3
3
  ${t.value.slice(l)}`;F(()=>r.textInput.setInput(p?`!${m}`:m)),t.setSelectionRange(n+1,n+1)}else t.setRangeText(`
4
- `,n,l,"end");o();return}if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let n=t.querySelector('button[type="submit"]');if(!n||n.disabled)return;t.requestSubmit(n)}}if(e.key==="Backspace"&&e.currentTarget.value===""){let t=f.files.at(-1);if(t&&!t.mediaType?.startsWith("image/"))e.preventDefault(),f.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:n,sawNonImageFile:l}=_t(t),m=It(t);if(n.length>0)e.preventDefault(),f.add(n);else if(l&&!m)e.preventDefault()},A=r?{value:u.current&&a.current?a.current.value:p?r.textInput.value.slice(1):r.textInput.value,onChange:(e)=>{let t=u.current?e.currentTarget.value:$n(e.currentTarget);r.textInput.setInput(p?`!${t}`:t),o(),i?.(e)}}:{onChange:(e)=>{if(!u.current)$n(e.currentTarget);o(),i?.(e)}};return M(H,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||c.current,getTextarea:()=>a.current}),[]),N(w,{"data-chat-input":!0,ref:a,rows:3,className:K("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",b),name:"message",onCompositionEnd:(e)=>{u.current=!1;let t=$n(e.currentTarget);r?.textInput.setInput(p?`!${t}`:t),o(),y?.(e),c.current=!0,requestAnimationFrame(()=>{c.current=!1})},onCompositionStart:(e)=>{c.current=!1,u.current=!0,T?.(e)},onKeyDown:P,onPaste:k,placeholder:E,...h,...A})});po.displayName="PromptInputTextarea";
5
- export{po};
4
+ `,n,l,"end");o();return}if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let n=t.querySelector('button[type="submit"]');if(!n||n.disabled)return;t.requestSubmit(n)}}if(e.key==="Backspace"&&e.currentTarget.value===""){let t=f.files.at(-1);if(t&&!t.mediaType?.startsWith("image/"))e.preventDefault(),f.remove(t.id)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:n,sawNonImageFile:l}=wt(t),m=kt(t);if(n.length>0)e.preventDefault(),f.add(n);else if(l&&!m)e.preventDefault()},A=r?{value:u.current&&a.current?a.current.value:p?r.textInput.value.slice(1):r.textInput.value,onChange:(e)=>{let t=u.current?e.currentTarget.value:Dn(e.currentTarget);r.textInput.setInput(p?`!${t}`:t),o(),i?.(e)}}:{onChange:(e)=>{if(!u.current)Dn(e.currentTarget);o(),i?.(e)}};return M(H,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>u.current||c.current,getTextarea:()=>a.current}),[]),N(w,{"data-chat-input":!0,ref:a,rows:3,className:K("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",b),name:"message",onCompositionEnd:(e)=>{u.current=!1;let t=Dn(e.currentTarget);r?.textInput.setInput(p?`!${t}`:t),o(),y?.(e),c.current=!0,requestAnimationFrame(()=>{c.current=!1})},onCompositionStart:(e)=>{c.current=!1,u.current=!0,T?.(e)},onKeyDown:P,onPaste:k,placeholder:E,...h,...A})});go.displayName="PromptInputTextarea";
5
+ export{go};
@@ -1,2 +1,2 @@
1
- import{N}from"./chunk-zdqjjwx0.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function ut({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=N();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
- export{ut};
1
+ import{M}from"./chunk-m3a6paxj.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function gt({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=M();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
+ export{gt};
@@ -0,0 +1,2 @@
1
+ import{m}from"./chunk-189aq7st.js";import{a,o}from"./chunk-r7z3mvej.js";import{E,v,f,ae}from"./chunk-gtyrc6cd.js";import{M,me,ji}from"./chunk-m3a6paxj.js";import{gt}from"./chunk-hm7f1vsx.js";import{B,ie}from"./chunk-djppmswk.js";import{Ie,pe}from"./chunk-4d2khkms.js";import{closestCorners as ge,DndContext as fe,KeyboardSensor as Ce,PointerSensor as ye,useSensor as V,useSensors as Se}from"@dnd-kit/core";import{SortableContext as W,sortableKeyboardCoordinates as De,useSortable as le,verticalListSortingStrategy as X}from"@dnd-kit/sortable";import{CSS as re}from"@dnd-kit/utilities";import{cn as F}from"cn";import{BrushCleaningIcon as we,MessageSquareIcon as ve,MoreHorizontalIcon as Ne,PencilIcon as he,PlusIcon as se,StarIcon as be,Trash2Icon as ce}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as R}from"react";import{Button as D}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as Y,DialogContent as Z,DialogDescription as ee,DialogFooter as oe,DialogHeader as te,DialogTitle as ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as z,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:b}){let{attributes:w,listeners:N,setNodeRef:i,transform:p,transition:u,isDragging:x}=le({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:re.Transform.toString(p),transition:u},className:F("w-full min-w-0",x&&"opacity-50"),...w,...N,role:"group",children:b})}function Be({collection:l,children:C,onEdit:b,onConfirm:w,onNewChat:N}){let{t:i}=M(),p=pe(),u=me(),{attributes:x,listeners:d,setNodeRef:I,transform:P,transition:T,isDragging:K}=le({id:l.id,disabled:{draggable:l.id===B,droppable:!1},data:{type:"collection"}});return e("div",{ref:I,style:{transform:re.Transform.toString(P),transition:T},className:F("w-full min-w-0",K&&"opacity-50"),children:e(ae,{open:!l.collapsed,onOpenChange:(c)=>u(p({type:"collapse",id:l.id,collapsed:!c})),label:ie(l,i),count:l.sessionIds.length,leading:l.id===B?e(be,{className:"size-3.5"}):e(gt,{emoji:l.emoji,onChange:(c)=>u(p({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...x,...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:ie(l,i)}),children:e(Ne,{className:"size-3.5"})})}),e(ke,{children:s(Le,{children:[l.id!==B&&s(z,{onClick:b,children:[e(he,{}),i("collection.rename")]}),s(z,{onClick:N,children:[e(se,{}),i("collection.newChat")]}),s(z,{onClick:()=>w("clear"),children:[e(we,{}),i("collection.clearCollection")]}),l.id!==B&&s(z,{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 Ds({renderRow:l,onSelect:C,onNewChat:b,Scroll:w=He}){let N=M(),{t:i}=N,p=pe(),u=me(),x=a(),{collections:d,order:I}=Ie(),P=o((t)=>t.sessionList),T=o((t)=>t.archivedSessions),K=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),U=Me(()=>new Map([...T,...P].map((t)=>[t.sessionId,t])),[T,P]),_=N.isMac??ji(),[y,k]=R(null),[L,O]=R(""),[q,j]=R(""),[S,H]=R(null),[g,J]=R(!1),de=Se(V(ye,{activationConstraint:{distance:5}}),V(Ce,{coordinateGetter:De})),G=I.flatMap((t)=>d[t].collapsed?[]:d[t].sessionIds.flatMap((n)=>{let r=U.get(n);return r&&!r.archived?[r]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(_?!n.metaKey||n.ctrlKey:!n.ctrlKey||n.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(n.target instanceof HTMLElement&&(n.target.isContentEditable||n.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let r=Number(n.key)-1;if(!Number.isInteger(r)||r<0||r>8||!G[r])return;n.preventDefault(),C(G[r])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,_,C]);let ue=({active:t,over:n})=>{if(n===null)return;let r=t.data.current,h=n.data.current;if(r?.type==="session"&&h!==void 0){let Q=h.type==="session"?String(h.collectionId):String(n.id);u(p({type:"move",sourceCollectionId:String(r.collectionId),collectionId:Q,sessionId:String(r.sessionId),index:h.type==="session"?d[Q].sessionIds.indexOf(String(h.sessionId)):void 0}))}else if(r?.type==="collection"&&h?.type==="collection"&&String(n.id)!==B)u(p({type:"reorder",id:String(t.id),index:I.indexOf(String(n.id))}))},A=(t,n)=>{J(!0),u(t.then(n).finally(()=>J(!1)))};return s(ze,{children:[e(w,{children:s(E,{children:[s(f,{className:F(m,"font-normal"),onClick:()=>{k("new"),O(""),j("")},children:[e(v,{children:e(se,{})}),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:()=>u(x.listSessions({reset:!0})),children:i("collection.retry")})]}),e(fe,{sensors:de,collisionDetection:ge,onDragEnd:ue,children:e(W,{items:I,strategy:X,children:e(E,{children:I.map((t)=>e(Be,{collection:d[t],onNewChat:()=>b(t),onEdit:()=>{k(t),O(d[t].name),j(d[t].emoji??"")},onConfirm:(n)=>H({id:t,type:n}),children:e(W,{items:d[t].sessionIds.map((n)=>JSON.stringify([t,n])),strategy:X,children:d[t].sessionIds.map((n)=>{let r=U.get(n);if(r?.archived)return null;if(!r)return K?s("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(v,{children:e(ve,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(D,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>u(p({type:"remove",sessionId:n,collectionId:t})),children:e(ce,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(r,()=>{},t)},n)})})},t))})})})]})}),e(Y,{open:y!==null,onOpenChange:(t)=>{if(!t&&!g)k(null)},children:s(Z,{children:[s(te,{children:[e(ne,{children:i(y==="new"?"collection.newCollection":"collection.rename")}),e(ee,{children:i("collection.collectionName")})]}),s("form",{onSubmit:(t)=>{if(t.preventDefault(),y===null||!L.trim()||g)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;A(p([y==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:q}]),()=>k(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>O(t.target.value),disabled:g}),y!=="new"&&e(gt,{emoji:q,onChange:j}),s(oe,{children:[e(D,{type:"button",variant:"outline",disabled:g,onClick:()=>k(null),children:i("collection.cancel")}),e(D,{type:"submit",disabled:g||!L.trim(),children:i("collection.confirm")})]})]})]})}),e(Y,{open:S!==null,onOpenChange:(t)=>{if(!t&&!g)H(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?"":ie(d[S.id],i)})})]}),s(oe,{children:[e(D,{variant:"outline",disabled:g,onClick:()=>H(null),children:i("collection.cancel")}),e(D,{disabled:g,onClick:()=>{if(S!==null)A(p({type:S.type,id:S.id}),()=>H(null))},children:i("collection.confirm")})]})]})})]})}
2
+ export{Ds};
@@ -0,0 +1,2 @@
1
+ import{St}from"./chunk-afnnrn6z.js";var mr={persistConfig:!1,nativeTools:{},applicationContext:()=>St(null),parseConfig(t){if(Object.keys(t).length)throw Error("Chat input config must be empty");return{}},routePrompt(t){return t.native()}};
2
+ export{mr};
@@ -1,2 +1,2 @@
1
- import{createContext as i,useContext as r}from"react";import{jsx as e}from"react/jsx-runtime";var n=i(null);function Cs({host:t,children:o}){return e(n.Provider,{value:t,children:o})}function c(){let t=r(n);if(t===null)throw Error("Activity host is missing");return t}function F(t){let{Markdown:o}=c();return e(o,{...t})}
2
- export{Cs,c,F};
1
+ import{createContext as i,useContext as r}from"react";import{jsx as e}from"react/jsx-runtime";var n=i(null);function hs({host:t,children:o}){return e(n.Provider,{value:t,children:o})}function c(){let t=r(n);if(t===null)throw Error("Activity host is missing");return t}function F(t){let{Markdown:o}=c();return e(o,{...t})}
2
+ export{hs,c,F};
@@ -1,2 +1,2 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";function Bt({title:t,badge:a,children:i}){return e("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[e("div",{className:"flex min-h-9 items-center gap-2",children:[r("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:t}),a]}),i]})}
2
- export{Bt};
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";function Jt({title:t,badge:a,children:i}){return e("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[e("div",{className:"flex min-h-9 items-center gap-2",children:[r("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:t}),a]}),i]})}
2
+ export{Jt};
@@ -1,5 +1,5 @@
1
- import{No}from"./chunk-3a8qwbgh.js";import{t}from"./chunk-rayhzb8p.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function La(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
- `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Da(o){let s=new Map,e=null;for(let n of o.split(`
3
- `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Fa(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Da(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?La(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
- ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function Pr({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(No,{files:Fa(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
- export{La,Da,Fa,Pr};
1
+ import{zo}from"./chunk-esxjnj1y.js";import{t}from"./chunk-7393tva2.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function Ta(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
+ `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Ma(o){let s=new Map,e=null;for(let n of o.split(`
3
+ `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Na(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Ma(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?Ta(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
+ ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function xi({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(zo,{files:Na(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
+ export{Ta,Ma,Na,xi};
@@ -1,2 +1,2 @@
1
- import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Ie({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
2
- export{Ie};
1
+ import{SquareIcon as l}from"lucide-react";import{useRef as u,useState as c}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Spinner as p}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as r}from"react/jsx-runtime";function Ge({title:t,onStop:i}){let[o,a]=c(!1),e=u(!1),s=async()=>{if(e.current)return;e.current=!0,a(!0);try{await i()}finally{e.current=!1,a(!1)}};return r(f,{variant:"ghost",size:"icon",className:"size-5",title:t,"aria-label":t,"aria-busy":o,disabled:o,onKeyDown:(n)=>n.stopPropagation(),onClick:(n)=>{n.stopPropagation(),s()},children:o?r(p,{className:"size-3","aria-label":t}):r(l,{className:"size-3 fill-current"})})}
2
+ export{Ge};
@@ -0,0 +1,2 @@
1
+ import{De}from"./chunk-z930082m.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 Er({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:De(t)}):null}function Rr({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(Er,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Gn({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(Rr,{label:t,shortcut:o}):t})]})}
2
+ export{Er,Rr,Gn};
@@ -1,2 +1,2 @@
1
- import{qi,On,Hn,Un,Bn}from"./chunk-wvm8srp7.js";import{Fn}from"./chunk-5t2ge7gg.js";var Rn=[{id:"litellm",source:"account",name:"ALwith",models:[{id:"deepseek-V4.1-flash",label:"DS Flash"}],catalog:"alwith/models.json",config:{}},{id:"anthropic",name:"Anthropic",apiType:"anthropic",baseUrl:"https://api.anthropic.com",keyUrl:"https://platform.claude.com/settings/keys",models:[{id:"claude-opus-5-5",label:"Opus 5.5"},{id:"claude-sonnet-5-5",label:"Sonnet 5.5"},{id:"claude-haiku-5-5",label:"Haiku 5.5"},{id:"claude-fable-5-2",label:"Fable 5.2"}],catalog:"anthropic/models.json",config:{}},{id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com/",keyUrl:"https://platform.deepseek.com/api_keys",webSearch:"deepseek",models:[{id:"deepseek-flash",label:"Flash",description:"Latest frontier agentic coding model with image input."}],catalog:"deepseek/models.json",config:{}},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",keyUrl:"https://openrouter.ai/keys",models:[{id:"moonshotai/kimi-k3",label:"Kimi K3"},{id:"minimax/minimax-m3",label:"MiniMax M3"},{id:"z-ai/glm-5.3",label:"GLM 5.3"},{id:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro"},{id:"qwen/qwen3.8-max-0902",label:"Qwen 3.8 Max"},{id:"x-ai/grok-4.6",label:"Grok 4.6"}],catalog:"openrouter/models.json"},{id:"qwen",name:"Qwen",regions:[{id:"intl",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyUrl:"https://modelstudio.console.alibabacloud.com/?tab=model#/api-key"},{id:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",keyUrl:"https://bailian.console.aliyun.com/#/api-key"}],models:[{id:"qwen4-max",label:"4 Max"},{id:"qwen3.8-max",label:"3.8 Max"},{id:"qwen3.8-flash",label:"3.8 Flash"},{id:"qwen3.7-max",label:"3.7 Max"},{id:"qwen3.7-plus",label:"3.7 Plus"},{id:"qwen3.6-flash",label:"3.6 Flash"}],catalog:"qwen/models.json"},{id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",keyUrl:"https://console.x.ai",models:[{id:"grok-4.6",label:"Grok 4.6"},{id:"grok-4.5",label:"Grok 4.5"},{id:"grok-4.3",label:"Grok 4.3"}],catalog:"xai/models.json"}];var l={"gateway:deepseek:deepseek-flash":{shortLabel:"Flash"},"gateway:litellm:deepseek-V4.1-flash":{shortLabel:"Flash",label:"DS Flash"}};var a=Rn,p={anthropic:qi,deepseek:On,openrouter:Un,qwen:Bn,xai:Hn};function c(e){let n=p[e];if(!n)throw Error(`Provider ${e} has no logo`);return n}var E=a.filter((e)=>e.source!=="account").map(({source:e,...n})=>({...n,logo:c(n.id)}));function yt(e){return e!=null&&a.some((n)=>n.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(n.id)}:`))}function xt(e){let n=JSON.parse(e);if(!Array.isArray(n)||n.length===0)throw Error("Add at least one model");let t=new Set;return n.map((i)=>{if(typeof i!=="object"||i===null||Array.isArray(i))throw Error("Each model must be an object");let o=i,s=typeof o.label==="string"?o.label.trim():"",r=typeof o.api_id==="string"?o.api_id.trim():"";if(s===""||r==="")throw Error("Model label and API ID cannot be empty");if(t.has(r))throw Error("Model IDs must be unique");if(t.add(r),o.contextWindow!==void 0&&o.contextWindow!==null&&(!Number.isSafeInteger(o.contextWindow)||o.contextWindow<=0))throw Error("Model contextWindow must be a positive integer");if(o.description!==void 0&&typeof o.description!=="string")throw Error("Model description must be a string");return{label:s,api_id:r,...o.contextWindow===void 0?{}:{contextWindow:o.contextWindow},...o.description===void 0?{}:{description:o.description}}})}function bt(e){return[...E.filter((n)=>e.providers[n.id]!==void 0).map((n)=>({id:n.id,name:n.name,models:n.models})),...[...e.customProviders,...e.managedProviders??[]].map((n)=>({id:n.id,name:n.name,models:n.models.map((t)=>({id:t.api_id,label:t.label,...t.description==null?{}:{description:t.description}}))}))]}function j(e,n){let t=e.startsWith("custom_")?`custom-${Array.from(new TextEncoder().encode(e),(i)=>i.toString(16).padStart(2,"0")).join("")}`:e;return`gateway:${encodeURIComponent(t)}:${encodeURIComponent(n)}`}function xa(e,n,t="session",i=yt){let o=bt(n).flatMap((s)=>s.models.map((r)=>j(s.id,r.id)));if(e!==null&&(!e.startsWith("gateway:")||o.includes(e)))return e;if(e!==null&&t==="session")throw Error(i(e)?"The selected ALwith account model is unavailable. Select another model before sending.":"The selected model connection is unavailable. Select another model before sending.");return o[0]??null}function ae(e,n){if(!e.regions)return null;let t=e.regions.find((i)=>i.id===n)??e.regions[0];if(!t)throw Error(`Provider ${e.id} declares no regions`);return t}function Ln(e,n){return ae(e,n)?.keyUrl??e.keyUrl??null}function Dn(e){if(typeof e==="object"&&e!==null&&"code"in e&&e.code==="pending")return!0;return(e instanceof Error?e.message:typeof e==="string"?e:typeof e==="object"&&e!==null&&("message"in e)?String(e.message):String(e)).includes("Provider settings are pending")}function ba(e){let n=e?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let t=decodeURIComponent(n[1]),i=Fn.models.find((o)=>o.slug===t);return i?{value:i.default_reasoning_level,hidden:i.supported_reasoning_levels.length===0}:null}var Ct=l;function Ca(e){return Ct[e]??{}}
2
- export{Rn,E,yt,xt,bt,j,xa,ae,Ln,Dn,ba,Ct,Ca};
1
+ import{Ji,In,Tn,Mn,Nn}from"./chunk-p474fn4q.js";import{Un}from"./chunk-2sc2z6g5.js";var Sn=[{id:"litellm",source:"account",name:"ALwith",models:[{id:"deepseek-V4.1-flash",label:"DS Flash"}],catalog:"alwith/models.json",config:{}},{id:"anthropic",name:"Anthropic",apiType:"anthropic",baseUrl:"https://api.anthropic.com",keyUrl:"https://platform.claude.com/settings/keys",models:[{id:"claude-opus-5-5",label:"Opus 5.5"},{id:"claude-sonnet-5-5",label:"Sonnet 5.5"},{id:"claude-haiku-5-5",label:"Haiku 5.5"},{id:"claude-fable-5-2",label:"Fable 5.2"}],catalog:"anthropic/models.json",config:{}},{id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com/",keyUrl:"https://platform.deepseek.com/api_keys",webSearch:"deepseek",models:[{id:"deepseek-flash",label:"Flash",description:"Latest frontier agentic coding model with image input."}],catalog:"deepseek/models.json",config:{}},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",keyUrl:"https://openrouter.ai/keys",models:[{id:"moonshotai/kimi-k3",label:"Kimi K3"},{id:"minimax/minimax-m3",label:"MiniMax M3"},{id:"z-ai/glm-5.3",label:"GLM 5.3"},{id:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro"},{id:"qwen/qwen3.8-max-0902",label:"Qwen 3.8 Max"},{id:"x-ai/grok-4.6",label:"Grok 4.6"}],catalog:"openrouter/models.json"},{id:"qwen",name:"Qwen",regions:[{id:"intl",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyUrl:"https://modelstudio.console.alibabacloud.com/?tab=model#/api-key"},{id:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",keyUrl:"https://bailian.console.aliyun.com/#/api-key"}],models:[{id:"qwen4-max",label:"4 Max"},{id:"qwen3.8-max",label:"3.8 Max"},{id:"qwen3.8-flash",label:"3.8 Flash"},{id:"qwen3.7-max",label:"3.7 Max"},{id:"qwen3.7-plus",label:"3.7 Plus"},{id:"qwen3.6-flash",label:"3.6 Flash"}],catalog:"qwen/models.json"},{id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",keyUrl:"https://console.x.ai",models:[{id:"grok-4.6",label:"Grok 4.6"},{id:"grok-4.5",label:"Grok 4.5"},{id:"grok-4.3",label:"Grok 4.3"}],catalog:"xai/models.json"}];var l={"gateway:deepseek:deepseek-flash":{shortLabel:"Flash"},"gateway:litellm:deepseek-V4.1-flash":{shortLabel:"Flash",label:"DS Flash"}};var a=Sn,p={anthropic:Ji,deepseek:In,openrouter:Mn,qwen:Nn,xai:Tn};function c(e){let n=p[e];if(!n)throw Error(`Provider ${e} has no logo`);return n}var N=a.filter((e)=>e.source!=="account").map(({source:e,...n})=>({...n,logo:c(n.id)}));function ht(e){return e!=null&&a.some((n)=>n.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(n.id)}:`))}function vt(e){let n=JSON.parse(e);if(!Array.isArray(n)||n.length===0)throw Error("Add at least one model");let t=new Set;return n.map((i)=>{if(typeof i!=="object"||i===null||Array.isArray(i))throw Error("Each model must be an object");let o=i,s=typeof o.label==="string"?o.label.trim():"",r=typeof o.api_id==="string"?o.api_id.trim():"";if(s===""||r==="")throw Error("Model label and API ID cannot be empty");if(t.has(r))throw Error("Model IDs must be unique");if(t.add(r),o.contextWindow!==void 0&&o.contextWindow!==null&&(!Number.isSafeInteger(o.contextWindow)||o.contextWindow<=0))throw Error("Model contextWindow must be a positive integer");if(o.description!==void 0&&typeof o.description!=="string")throw Error("Model description must be a string");return{label:s,api_id:r,...o.contextWindow===void 0?{}:{contextWindow:o.contextWindow},...o.description===void 0?{}:{description:o.description}}})}function yt(e){return[...N.filter((n)=>e.providers[n.id]!==void 0).map((n)=>({id:n.id,name:n.name,models:n.models})),...[...e.customProviders,...e.managedProviders??[]].map((n)=>({id:n.id,name:n.name,models:n.models.map((t)=>({id:t.api_id,label:t.label,...t.description==null?{}:{description:t.description}}))}))]}function G(e,n){let t=e.startsWith("custom_")?`custom-${Array.from(new TextEncoder().encode(e),(i)=>i.toString(16).padStart(2,"0")).join("")}`:e;return`gateway:${encodeURIComponent(t)}:${encodeURIComponent(n)}`}function Js(e,n,t="session",i=ht){let o=yt(n).flatMap((s)=>s.models.map((r)=>G(s.id,r.id)));if(e!==null&&(!e.startsWith("gateway:")||o.includes(e)))return e;if(e!==null&&t==="session")throw Error(i(e)?"The selected ALwith account model is unavailable. Select another model before sending.":"The selected model connection is unavailable. Select another model before sending.");return o[0]??null}function re(e,n){if(!e.regions)return null;let t=e.regions.find((i)=>i.id===n)??e.regions[0];if(!t)throw Error(`Provider ${e.id} declares no regions`);return t}function _n(e,n){return re(e,n)?.keyUrl??e.keyUrl??null}function Pn(e){if(typeof e==="object"&&e!==null&&"code"in e&&e.code==="pending")return!0;return(e instanceof Error?e.message:typeof e==="string"?e:typeof e==="object"&&e!==null&&("message"in e)?String(e.message):String(e)).includes("Provider settings are pending")}function Xs(e){let n=e?.match(/^gateway:custom-[^:]+:(.+)$/);if(!n)return null;let t=decodeURIComponent(n[1]),i=Un.models.find((o)=>o.slug===t);return i?{value:i.default_reasoning_level,hidden:i.supported_reasoning_levels.length===0}:null}var xt=l;function Ys(e){return xt[e]??{}}
2
+ export{Sn,N,ht,vt,yt,G,Js,re,_n,Pn,Xs,xt,Ys};
@@ -1,4 +1,4 @@
1
- import{nt}from"./chunk-544g9fky.js";import{Xi}from"./chunk-p9x6rya1.js";import{l}from"./chunk-6283nzqs.js";import{he}from"./chunk-a0qy1r02.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as st}from"cn";import{BookOpenIcon as it,FileIcon as at,SquareSlashIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as ct,useEffect as y,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as g}from"react";import{createPortal as mt}from"react-dom";import{Button as _}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as d,jsxs as T,Fragment as pt}from"react/jsx-runtime";function Ji({handleRef:a,anchorRef:f,commands:q,renderSlashMenu:k,searchFiles:u,onMention:R,onSearchError:j,fileSearchDebounceMs:M=0,bashMode:Q=!1,forcedOpen:i=!1,onForcedOpenChange:c,emptyLabel:F,fileStatusLabels:L,morePlugins:N}){let D=he(),s=D.textInput.value,[z,P]=g(0),[O,S]=g(!1),[x,B]=g(null),[E,h]=g(0),U=Z(null);y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>P(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[a]);let V=Y(()=>Q&&s.startsWith("!")?null:Xi(s,z),[s,z,Q]),o=V?.kind==="at"&&!u?null:V,H=`${o?.kind??"forced"}:${o?.query??""}:${i}`,[tt,et]=g(H);if(tt!==H)et(H),h(0);let I=Z(null);y(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=s;else if(s!==I.current)c?.(!1)},[i,s,c]);let b=o?.kind==="at"?o.query:null;y(()=>{if(b===null||!u){B(null);return}let t=!0,e=()=>{u(b).then((r)=>{if(t)B({query:b,search:u,items:r})},(r)=>{if(t)B({query:b,search:u,items:[]}),j(r)})},n=M>0?window.setTimeout(e,M):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[b,u,M,j]);let v=Y(()=>{if(o?.kind==="at")return x?.query===o.query&&x.search===u?x.items:[];if(k&&(o?.kind==="slash"||i))return[];if(o)return nt(q,o.query);if(i)return nt(q,"");return[]},[o,i,q,x,u,k]),m=o?o.kind==="slash":i;y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>S(!0),n=()=>{if(S(!1),i)c?.(!1)};return S(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[a,i,c]),y(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let p=O&&(o!==null?o.kind==="slash"||v.length>0||!!L:i);y(()=>{if(!p)return;U.current?.querySelector(`[data-idx="${E}"]`)?.scrollIntoView({block:"nearest"})},[E,p]);function A(t){let e=a.current?.getTextarea();if(!e)return;let n,r;if(o){let K=o.kind==="slash"?`${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `:`@${t.label} `;if(n=s.slice(0,o.start)+K+s.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+K.length}else if(i)n=`${s.length===0||s.endsWith(`
1
+ import{tt}from"./chunk-fz9y067h.js";import{Mr}from"./chunk-b4wh6k5s.js";import{l}from"./chunk-6283nzqs.js";import{fe}from"./chunk-32zzqeyf.js";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as st}from"cn";import{BookOpenIcon as it,FileIcon as at,SquareSlashIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as ct,useEffect as y,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as g}from"react";import{createPortal as mt}from"react-dom";import{Button as _}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as d,jsxs as T,Fragment as pt}from"react/jsx-runtime";function Tr({handleRef:a,anchorRef:f,commands:q,renderSlashMenu:k,searchFiles:u,onMention:R,onSearchError:j,fileSearchDebounceMs:M=0,bashMode:Q=!1,forcedOpen:i=!1,onForcedOpenChange:c,emptyLabel:F,fileStatusLabels:L,morePlugins:N}){let D=fe(),s=D.textInput.value,[z,P]=g(0),[O,S]=g(!1),[x,B]=g(null),[E,h]=g(0),U=Z(null);y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>P(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[a]);let V=Y(()=>Q&&s.startsWith("!")?null:Mr(s,z),[s,z,Q]),o=V?.kind==="at"&&!u?null:V,H=`${o?.kind??"forced"}:${o?.query??""}:${i}`,[et,nt]=g(H);if(et!==H)nt(H),h(0);let I=Z(null);y(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=s;else if(s!==I.current)c?.(!1)},[i,s,c]);let b=o?.kind==="at"?o.query:null;y(()=>{if(b===null||!u){B(null);return}let t=!0,e=()=>{u(b).then((r)=>{if(t)B({query:b,search:u,items:r})},(r)=>{if(t)B({query:b,search:u,items:[]}),j(r)})},n=M>0?window.setTimeout(e,M):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[b,u,M,j]);let v=Y(()=>{if(o?.kind==="at")return x?.query===o.query&&x.search===u?x.items:[];if(k&&(o?.kind==="slash"||i))return[];if(o)return tt(q,o.query);if(i)return tt(q,"");return[]},[o,i,q,x,u,k]),m=o?o.kind==="slash":i;y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>S(!0),n=()=>{if(S(!1),i)c?.(!1)};return S(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[a,i,c]),y(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let p=O&&(o!==null?o.kind==="slash"||v.length>0||!!L:i);y(()=>{if(!p)return;U.current?.querySelector(`[data-idx="${E}"]`)?.scrollIntoView({block:"nearest"})},[E,p]);function A(t){let e=a.current?.getTextarea();if(!e)return;let n,r;if(o){let K=o.kind==="slash"?`${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `:`@${t.label} `;if(n=s.slice(0,o.start)+K+s.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+K.length}else if(i)n=`${s.length===0||s.endsWith(`
2
2
  `)?s:`${s}
3
3
  `}${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `,r=n.length,c?.(!1);else return;D.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=(n)=>{if(!p||m&&k)return;if(a.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>v.length===0?0:Math.min(v.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"&&!n.shiftKey&&!n.altKey||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=v[E];if(r)A(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)P(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else c?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,G]=g(null),[W,ot]=g(null),C=ct(()=>{let t=f?.current;if(!t)return;let e=t.getBoundingClientRect();G({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[f]);if(X(()=>{if(!p){G(null);return}C()},[p,C]),X(()=>{let t=f?.current;if(!p||!t||!W)return;return rt(t,W,C,{animationFrame:!0})},[p,W,f,C]),p&&m&&k)return k({query:o?.query??"",close:()=>{if(o)P(o.start),a.current?.getTextarea()?.setSelectionRange(o.start,o.start);else c?.(!1)},selectCommand:(t)=>A({key:t,label:t,payload:t}),replaceQuery:(t)=>{let e=a.current?.getTextarea();if(!e)return;let n=o?.start??e.selectionStart,r=o?.end??e.selectionEnd;D.textInput.setInput(s.slice(0,n)+s.slice(r)),c?.(!1),requestAnimationFrame(()=>{if(a.current?.getTextarea()!==e)return;e.focus(),e.setSelectionRange(n,n),t()})}});if(!p||f&&!w)return null;let J=d("div",{ref:ot,className:f?"fixed z-50":l.position,style:f&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:T("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:[T("div",{className:l.list,children:[v.length===0&&m&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:F}),v.length===0&&!m&&L&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===b&&x.search===u?L.empty:L.loading}),v.map((t,e)=>{let n=m?t.payload.startsWith("$")?it:lt:at;return T(_,{type:"button",variant:"ghost",role:"option","aria-selected":e===E,"data-idx":e,onMouseDown:(r)=>{r.preventDefault(),A(t)},onMouseEnter:()=>h(e),className:st(m?l.row:"flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===E&&l.selected),children:[d(n,{className:m?l.icon:"text-muted-foreground size-4 shrink-0"}),d("span",{className:m?l.label:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&d("span",{"data-slot":"description",className:l.description,children:t.description})]},t.key)})]}),m&&N&&d(pt,{children:T(_,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),c?.(!1),N.open()},className:l.row,children:[d(ut,{className:l.icon}),d("span",{className:l.label,children:N.label})]})})]})});return f?mt(J,document.body):J}
4
- export{Ji};
4
+ export{Tr};
@@ -1,2 +1,2 @@
1
- import{yr}from"./chunk-6wsr59dr.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function ko(t,r,e={}){let o=r.trim();if(o.length===0)return[];return yr(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
- export{ko};
1
+ import{ei}from"./chunk-5ny4ped8.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Jn(t,r,e={}){let o=r.trim();if(o.length===0)return[];return ei(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
+ export{Jn};
@@ -1,3 +1,3 @@
1
- var sl=["full","compact","codexUI"];function Er(t){return t==="compact"||t==="codexUI"}var Ha=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function oe(t){let o=Ha.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
2
- `)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function al(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
3
- export{sl,Er,Ha,oe,al};
1
+ var dl=["full","compact","codexUI"];function ps(t){return t==="compact"||t==="codexUI"}var $a=["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"];function c(t){let o=t.split(/[/\\]/).at(-1)??"";return o===""?t:o}function oe(t){let o=$a.includes(t.kind)?t.kind:"other",i=t.rawInput,e=(a)=>{let r=i[a];return typeof r==="string"&&r.length>0?r:void 0},n=t.locations?.[0]?.path??e("file_path")??e("notebook_path"),s=n!==void 0?c(n):e("command")?.split(`
2
+ `)[0]??e("pattern")??e("url")??e("query")??e("description");return{category:o,...s===void 0?{}:{target:s},...n===void 0?{}:{filePath:n}}}function ul(t,o){if(o)return"dot-permission";switch(t){case"completed":return"dot-success";case"failed":return"dot-error";case"in_progress":return"dot-in-progress";case"pending":return"dot-pending";case"interrupted":return"dot-interrupted";default:return console.warn("[acp] unknown tool call status:",t),"dot-pending"}}
3
+ export{dl,ps,$a,oe,ul};