@alwith/module-chat 0.6.19 → 0.6.20

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 (458) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/application-client.js +1 -1
  3. package/dist/agent/client.js +1 -1
  4. package/dist/agent/custom-model-effort.js +1 -1
  5. package/dist/agent/fork-title.js +1 -1
  6. package/dist/agent/image-request.js +1 -1
  7. package/dist/agent/image-tools.js +1 -1
  8. package/dist/agent/input-config.js +1 -1
  9. package/dist/agent/input-modes/chat.js +1 -1
  10. package/dist/agent/input-modes/execution-meta.js +1 -1
  11. package/dist/agent/input-modes/image-context.js +1 -1
  12. package/dist/agent/input-modes/image.js +1 -1
  13. package/dist/agent/input-modes/index.js +1 -1
  14. package/dist/agent/project-path.js +1 -1
  15. package/dist/agent/request-error.js +1 -1
  16. package/dist/agent/session-list-refresh.js +1 -1
  17. package/dist/app-reference.js +1 -1
  18. package/dist/application-tools.js +1 -1
  19. package/dist/approval/choice-elicitation-form.js +1 -1
  20. package/dist/approval/choice-schema.js +1 -1
  21. package/dist/approval/permission-options.js +1 -1
  22. package/dist/approval/permission-view.js +1 -1
  23. package/dist/approval/schema-elicitation-form.js +1 -1
  24. package/dist/approval/url-elicitation-card.js +1 -1
  25. package/dist/{chunk-2aw505xv.js → chunk-04c5k3qr.js} +2 -2
  26. package/dist/{chunk-fkkk1fza.js → chunk-04frqm59.js} +2 -2
  27. package/dist/{chunk-r7hwgk2v.js → chunk-0rnh8mhs.js} +2 -2
  28. package/dist/{chunk-84p483n0.js → chunk-16db8fh2.js} +2 -2
  29. package/dist/chunk-1a56svgj.js +2 -0
  30. package/dist/{chunk-zjk12jjm.js → chunk-1gv49jt9.js} +3 -3
  31. package/dist/chunk-1hmt6w4w.js +2 -0
  32. package/dist/{chunk-rz9fnphz.js → chunk-1qjhvkg0.js} +2 -2
  33. package/dist/{chunk-s9mejb9v.js → chunk-1r4y3pfg.js} +2 -2
  34. package/dist/{chunk-thaa1n4f.js → chunk-1vtvcar6.js} +2 -2
  35. package/dist/{chunk-ath5nv2w.js → chunk-1ycyexae.js} +2 -2
  36. package/dist/{chunk-e1zsnc8z.js → chunk-23r426sm.js} +2 -2
  37. package/dist/{chunk-gwskdhaw.js → chunk-29s4mnfw.js} +2 -2
  38. package/dist/{chunk-wew3t005.js → chunk-2a4pq98d.js} +2 -2
  39. package/dist/chunk-2c2a1wvg.js +2 -0
  40. package/dist/{chunk-xspnhgq6.js → chunk-2cfhvb3k.js} +2 -2
  41. package/dist/{chunk-zyn0ys4m.js → chunk-2dm51ksz.js} +2 -2
  42. package/dist/{chunk-dd9k5bbt.js → chunk-2easwd1n.js} +2 -2
  43. package/dist/chunk-2nb1475h.js +2 -0
  44. package/dist/{chunk-kn792h8n.js → chunk-2zy75522.js} +2 -2
  45. package/dist/{chunk-kj2zk46g.js → chunk-38bpmgjd.js} +2 -2
  46. package/dist/{chunk-tdvx2n5m.js → chunk-38hvm5ca.js} +2 -2
  47. package/dist/{chunk-z6x70w62.js → chunk-3a3ecayr.js} +2 -2
  48. package/dist/{chunk-jpr5ewnh.js → chunk-3chhwwwy.js} +2 -2
  49. package/dist/{chunk-vm81n2c0.js → chunk-3g9qb7vq.js} +2 -2
  50. package/dist/chunk-3gnn1v68.js +2 -0
  51. package/dist/{chunk-7d1wnjw5.js → chunk-3hjcpcnv.js} +2 -2
  52. package/dist/{chunk-fdmbfq9g.js → chunk-3tvct295.js} +2 -2
  53. package/dist/chunk-3w6dv0nx.js +2 -0
  54. package/dist/chunk-41yz7txv.js +2 -0
  55. package/dist/{chunk-cydnp9mm.js → chunk-4p0zk3mj.js} +2 -2
  56. package/dist/{chunk-xyffk47k.js → chunk-55ya3102.js} +2 -2
  57. package/dist/{chunk-dr5swvaa.js → chunk-56rx2rmj.js} +2 -2
  58. package/dist/{chunk-90847w64.js → chunk-5aqqqsa3.js} +2 -2
  59. package/dist/{chunk-psndz2rs.js → chunk-5bmxngnx.js} +2 -2
  60. package/dist/{chunk-bg0vkt53.js → chunk-5hk3k14h.js} +2 -2
  61. package/dist/{chunk-gpv1dc5y.js → chunk-5s85tvas.js} +2 -2
  62. package/dist/{chunk-dsf2x63w.js → chunk-61awcdaq.js} +4 -4
  63. package/dist/{chunk-d0s10qy5.js → chunk-62qtrk0p.js} +2 -2
  64. package/dist/{chunk-7p7fxgdb.js → chunk-62wxvxsg.js} +2 -2
  65. package/dist/{chunk-bba9qej8.js → chunk-6c18ag8t.js} +2 -2
  66. package/dist/chunk-6dnb0t84.js +2 -0
  67. package/dist/chunk-6ehhap9k.js +2 -0
  68. package/dist/{chunk-qma11tpm.js → chunk-6my4ybpw.js} +3 -3
  69. package/dist/chunk-6tj5e7fc.js +2 -0
  70. package/dist/{chunk-tftgnw1w.js → chunk-6wkcqhkk.js} +2 -2
  71. package/dist/{chunk-z107z7dt.js → chunk-6xap6hvz.js} +2 -2
  72. package/dist/{chunk-88ysxbdh.js → chunk-78vckhxt.js} +2 -2
  73. package/dist/{chunk-m087n233.js → chunk-7ac4g54f.js} +3 -3
  74. package/dist/{chunk-xwwjj45a.js → chunk-7jk8s061.js} +2 -2
  75. package/dist/chunk-7sp1yqfg.js +2 -0
  76. package/dist/{chunk-7evd34gw.js → chunk-814h2ja2.js} +3 -3
  77. package/dist/chunk-81jejgvs.js +2 -0
  78. package/dist/chunk-85tzkdsj.js +2 -0
  79. package/dist/{chunk-zzjth6f2.js → chunk-86821qec.js} +2 -2
  80. package/dist/{chunk-hj05zh7h.js → chunk-86r89vrt.js} +2 -2
  81. package/dist/{chunk-rg9ckzpr.js → chunk-8kd74ng1.js} +2 -2
  82. package/dist/{chunk-xx29efrs.js → chunk-8ngg5vs4.js} +3 -3
  83. package/dist/{chunk-ma7thf1j.js → chunk-8q9hq3mg.js} +2 -2
  84. package/dist/{chunk-ne4b53kn.js → chunk-8v53bkyr.js} +2 -2
  85. package/dist/{chunk-fvxxzgrc.js → chunk-8y60kexq.js} +2 -2
  86. package/dist/{chunk-hqt5j789.js → chunk-8y706gz3.js} +2 -2
  87. package/dist/{chunk-1gr60c40.js → chunk-933h9gnv.js} +2 -2
  88. package/dist/{chunk-x49qjrbk.js → chunk-9q6hz47j.js} +2 -2
  89. package/dist/{chunk-8rb896tq.js → chunk-a71j2n86.js} +2 -2
  90. package/dist/{chunk-esbgn8q0.js → chunk-abgdqy92.js} +2 -2
  91. package/dist/{chunk-ma6ycen5.js → chunk-ase4ejxz.js} +2 -2
  92. package/dist/{chunk-xqb4thy8.js → chunk-at75m9hq.js} +2 -2
  93. package/dist/chunk-ayademz2.js +2 -0
  94. package/dist/{chunk-51x80v4h.js → chunk-ayhxrzsq.js} +2 -2
  95. package/dist/chunk-b42vv8f2.js +2 -0
  96. package/dist/{chunk-34mq2dbm.js → chunk-b4kh5nns.js} +2 -2
  97. package/dist/{chunk-6e84zbgs.js → chunk-bane0xc8.js} +2 -2
  98. package/dist/chunk-bcdw682e.js +4 -0
  99. package/dist/{chunk-97pn8v17.js → chunk-bej9z041.js} +2 -2
  100. package/dist/chunk-bfwft1b8.js +2 -0
  101. package/dist/{chunk-4sfxcw58.js → chunk-bv14x0e8.js} +3 -3
  102. package/dist/{chunk-c2h4wr7g.js → chunk-bydxp3zj.js} +4 -4
  103. package/dist/chunk-c0mpr4dh.js +2 -0
  104. package/dist/{chunk-2ncdext6.js → chunk-c1pvvk0x.js} +2 -2
  105. package/dist/{chunk-80sbwjrr.js → chunk-c8wdf20g.js} +2 -2
  106. package/dist/{chunk-n811d65m.js → chunk-ckjq6690.js} +3 -3
  107. package/dist/{chunk-vg1y693r.js → chunk-csfqkzmr.js} +3 -3
  108. package/dist/{chunk-evpjxbzm.js → chunk-cvx7r35k.js} +2 -2
  109. package/dist/{chunk-xx7t8r87.js → chunk-d8f6avcz.js} +2 -2
  110. package/dist/{chunk-pxzj3ae7.js → chunk-df9aqj1m.js} +2 -2
  111. package/dist/{chunk-brv52tgj.js → chunk-djd3sjp9.js} +2 -2
  112. package/dist/{chunk-3g9n4bk2.js → chunk-dtgbgwby.js} +2 -2
  113. package/dist/{chunk-k4a3p16c.js → chunk-dxsjz3re.js} +2 -2
  114. package/dist/{chunk-pqz2471h.js → chunk-e04g26qm.js} +2 -2
  115. package/dist/{chunk-bw3bpr6m.js → chunk-e2qjbqq2.js} +2 -2
  116. package/dist/{chunk-0jpzztpz.js → chunk-e7me5e6n.js} +2 -2
  117. package/dist/{chunk-nn30qzhx.js → chunk-e7ndpy02.js} +2 -2
  118. package/dist/{chunk-x2wcwpw3.js → chunk-easm0z49.js} +2 -2
  119. package/dist/{chunk-j6000jts.js → chunk-ecaedwda.js} +2 -2
  120. package/dist/{chunk-nbgw51b6.js → chunk-ecdjjnbb.js} +2 -2
  121. package/dist/chunk-een4e2tr.js +2 -0
  122. package/dist/{chunk-ak196z4y.js → chunk-evygj5ka.js} +2 -2
  123. package/dist/{chunk-44r55va6.js → chunk-f4h84pav.js} +2 -2
  124. package/dist/{chunk-f78jd8xh.js → chunk-f6zpqrg3.js} +2 -2
  125. package/dist/{chunk-d9mj74pb.js → chunk-f73x23f9.js} +1 -1
  126. package/dist/{chunk-mf0k3xd4.js → chunk-f89s462k.js} +3 -3
  127. package/dist/{chunk-dheg4bs2.js → chunk-ffs5nkt0.js} +2 -2
  128. package/dist/{chunk-fwqpwbd8.js → chunk-fhjk81r9.js} +2 -2
  129. package/dist/chunk-fvwrc97h.js +2 -0
  130. package/dist/{chunk-113maskf.js → chunk-g61xf0ma.js} +2 -2
  131. package/dist/{chunk-ex063jn9.js → chunk-g7cc7gdn.js} +2 -2
  132. package/dist/{chunk-k883x8fv.js → chunk-g8w06bdx.js} +2 -2
  133. package/dist/{chunk-xfzmxq3g.js → chunk-gawrkkbf.js} +2 -2
  134. package/dist/{chunk-rhe4w638.js → chunk-gdavg2hq.js} +2 -2
  135. package/dist/{chunk-wpacvdsv.js → chunk-gea1q14z.js} +2 -2
  136. package/dist/{chunk-6g553fkh.js → chunk-ggddhx5x.js} +2 -2
  137. package/dist/{chunk-337hq36y.js → chunk-gnctm097.js} +2 -2
  138. package/dist/{chunk-wbjf9maj.js → chunk-gvqvw7ms.js} +2 -2
  139. package/dist/{chunk-74b70n1g.js → chunk-gy4h86mw.js} +2 -2
  140. package/dist/chunk-gyw21vnb.js +2 -0
  141. package/dist/{chunk-nqt9gyz9.js → chunk-heqa4swe.js} +2 -2
  142. package/dist/{chunk-agdkhyaj.js → chunk-hygvdjq6.js} +3 -3
  143. package/dist/{chunk-8q5zwkry.js → chunk-hzhcajx1.js} +2 -2
  144. package/dist/{chunk-wq47c4ws.js → chunk-jca8s47n.js} +2 -2
  145. package/dist/{chunk-3tvq6xr2.js → chunk-jg4c3zg4.js} +2 -2
  146. package/dist/{chunk-hfghqddp.js → chunk-jm6y0edw.js} +2 -2
  147. package/dist/chunk-jq6qs3s6.js +2 -0
  148. package/dist/{chunk-4jp1d558.js → chunk-k4xsxxy7.js} +2 -2
  149. package/dist/chunk-k99r1r38.js +2 -0
  150. package/dist/{chunk-zw2x5ztr.js → chunk-kh3af9mq.js} +2 -2
  151. package/dist/{chunk-k5nd3vyq.js → chunk-kj3a1k2q.js} +2 -2
  152. package/dist/{chunk-n96z8etk.js → chunk-kj3t4mqf.js} +2 -2
  153. package/dist/{chunk-84zzf0ys.js → chunk-kk9dbwd1.js} +2 -2
  154. package/dist/{chunk-phee3jn9.js → chunk-kv1w4jx4.js} +2 -2
  155. package/dist/{chunk-sp2ny9ak.js → chunk-kztrgv9y.js} +2 -2
  156. package/dist/{chunk-4wm5emgf.js → chunk-m8pkmbtf.js} +2 -2
  157. package/dist/{chunk-er5wxkt2.js → chunk-m944rgn9.js} +2 -2
  158. package/dist/chunk-mqpkm974.js +2 -0
  159. package/dist/{chunk-q4c6f84f.js → chunk-mr2wcd24.js} +2 -2
  160. package/dist/{chunk-t5ff3cn7.js → chunk-ms0h8x63.js} +2 -2
  161. package/dist/{chunk-xnc0175v.js → chunk-n0q8e6sq.js} +2 -2
  162. package/dist/{chunk-7g11pcm4.js → chunk-n3sm0834.js} +3 -3
  163. package/dist/chunk-n6dqwdg5.js +2 -0
  164. package/dist/{chunk-rp7tnbss.js → chunk-n8v6cdq3.js} +2 -2
  165. package/dist/{chunk-etvdqkvb.js → chunk-nh56sb8e.js} +2 -2
  166. package/dist/{chunk-2gwegefd.js → chunk-nmd5x501.js} +2 -2
  167. package/dist/{chunk-h7xjw0p4.js → chunk-npvcy4tw.js} +2 -2
  168. package/dist/{chunk-5gn8xw58.js → chunk-nrzkzvr0.js} +2 -2
  169. package/dist/{chunk-nhkm2gr7.js → chunk-p2tm6tv8.js} +1 -1
  170. package/dist/chunk-p781sb6h.js +2 -0
  171. package/dist/{chunk-73e9vpm9.js → chunk-pdmayjan.js} +2 -2
  172. package/dist/{chunk-5c42mfat.js → chunk-pk931bpm.js} +2 -2
  173. package/dist/{chunk-jgqt7k0h.js → chunk-q01vmp9m.js} +2 -2
  174. package/dist/{chunk-bf7sgpzq.js → chunk-q46z21zs.js} +2 -2
  175. package/dist/{chunk-p3gawvqr.js → chunk-q5qqhqw4.js} +2 -2
  176. package/dist/{chunk-vg9p0hvk.js → chunk-q9mh8x4r.js} +2 -2
  177. package/dist/chunk-q9y0wjwp.js +2 -0
  178. package/dist/{chunk-ch8e8a32.js → chunk-qdcznn2t.js} +2 -2
  179. package/dist/chunk-qejm75d7.js +2 -0
  180. package/dist/chunk-r6c9r5yy.js +2 -0
  181. package/dist/{chunk-eynwjzqp.js → chunk-r6ns1457.js} +2 -2
  182. package/dist/{chunk-x4jm2eh9.js → chunk-r8expjyy.js} +4 -4
  183. package/dist/{chunk-zxfx7psd.js → chunk-r8pm74zf.js} +2 -2
  184. package/dist/{chunk-ftsnryz8.js → chunk-rb4p3h5b.js} +2 -2
  185. package/dist/{chunk-h82jte5p.js → chunk-rh2yx0xq.js} +2 -2
  186. package/dist/{chunk-j3g21ext.js → chunk-rkejggyx.js} +2 -2
  187. package/dist/{chunk-mahb3t97.js → chunk-rr9kc3n8.js} +2 -2
  188. package/dist/{chunk-g1nck6pp.js → chunk-rtbpfasb.js} +2 -2
  189. package/dist/chunk-rx84h0c2.js +2 -0
  190. package/dist/chunk-s2706gae.js +2 -0
  191. package/dist/{chunk-j39bhfsp.js → chunk-s6b28p84.js} +2 -2
  192. package/dist/{chunk-arm9x6kc.js → chunk-s6y31dcb.js} +2 -2
  193. package/dist/{chunk-02qwd1yq.js → chunk-s88eyv24.js} +2 -2
  194. package/dist/{chunk-pc11a2w0.js → chunk-s8djv2dy.js} +3 -3
  195. package/dist/chunk-sgbn37kz.js +2 -0
  196. package/dist/{chunk-7b5ryhwh.js → chunk-sjtfxn55.js} +2 -2
  197. package/dist/{chunk-81n37a11.js → chunk-swt6dntp.js} +2 -2
  198. package/dist/chunk-t9e1sj53.js +3 -0
  199. package/dist/{chunk-yb5yhh8t.js → chunk-t9xkg3pk.js} +2 -2
  200. package/dist/{chunk-ta6rbxh5.js → chunk-tc3t2sgb.js} +3 -3
  201. package/dist/chunk-tcs1a1hk.js +2 -0
  202. package/dist/{chunk-64apxzn7.js → chunk-tec9yhsm.js} +2 -2
  203. package/dist/{chunk-bqhbksy2.js → chunk-tj4b0s68.js} +2 -2
  204. package/dist/{chunk-y3mx5sf0.js → chunk-tzczzqde.js} +2 -2
  205. package/dist/chunk-v4qzxq4v.js +2 -0
  206. package/dist/{chunk-ane53rqa.js → chunk-v8x5atmn.js} +2 -2
  207. package/dist/{chunk-q7rq46qc.js → chunk-vbbndjfd.js} +2 -2
  208. package/dist/{chunk-j78kgyff.js → chunk-vgscp6dr.js} +5 -5
  209. package/dist/{chunk-15m908ph.js → chunk-vhxr0c4c.js} +2 -2
  210. package/dist/{chunk-p5hk14fk.js → chunk-vvkp0jqa.js} +2 -2
  211. package/dist/{chunk-1fadxh2z.js → chunk-wf7kfk3p.js} +2 -2
  212. package/dist/{chunk-6j1x3gny.js → chunk-wjd2hpnd.js} +2 -2
  213. package/dist/{chunk-w1wr14da.js → chunk-wkrnbk0p.js} +2 -2
  214. package/dist/chunk-wnydsth6.js +2 -0
  215. package/dist/{chunk-1d29gnb2.js → chunk-wxh1m3gg.js} +2 -2
  216. package/dist/chunk-x1mzrhtd.js +2 -0
  217. package/dist/{chunk-ynxb5xqz.js → chunk-x20dy83s.js} +3 -3
  218. package/dist/{chunk-q1yz3t9z.js → chunk-xykmskka.js} +2 -2
  219. package/dist/chunk-y6p8xspr.js +2 -0
  220. package/dist/{chunk-gttw4rmx.js → chunk-y8fmawc6.js} +3 -3
  221. package/dist/chunk-yc4cdg65.js +2 -0
  222. package/dist/{chunk-fyxetwxv.js → chunk-ykz0h1r0.js} +2 -2
  223. package/dist/{chunk-9k58vckd.js → chunk-ymgc4317.js} +2 -2
  224. package/dist/{chunk-scdj02m8.js → chunk-z1qcgb6b.js} +3 -3
  225. package/dist/{chunk-6f06hbsk.js → chunk-ztrfygh5.js} +2 -2
  226. package/dist/client.js +1 -1
  227. package/dist/codex/activity-group.js +1 -1
  228. package/dist/codex/artifact-links.js +1 -1
  229. package/dist/codex/assistant-message.js +1 -1
  230. package/dist/codex/async-question-card.js +1 -1
  231. package/dist/codex/edited-files-card.js +1 -1
  232. package/dist/codex/image-view-activity.js +1 -1
  233. package/dist/codex/markdown-renderer.js +1 -1
  234. package/dist/codex/navigation-audio.js +1 -1
  235. package/dist/codex/navigation-preview.js +1 -1
  236. package/dist/codex/navigation-rail.js +1 -1
  237. package/dist/codex/patch-view.js +1 -1
  238. package/dist/codex/plan.js +1 -1
  239. package/dist/codex/timeline-virtualizer.js +1 -1
  240. package/dist/codex/turn-activity.js +1 -1
  241. package/dist/codex/user-message.js +1 -1
  242. package/dist/codex/virtualized-turn-list.js +1 -1
  243. package/dist/collections/collection-emoji.js +1 -1
  244. package/dist/collections/collection-menu.js +1 -1
  245. package/dist/collections/collection-panel.js +1 -1
  246. package/dist/collections/collections.js +1 -1
  247. package/dist/collections/host.js +1 -1
  248. package/dist/collections/locales.js +1 -1
  249. package/dist/collections/model.js +1 -1
  250. package/dist/collections/store.js +1 -1
  251. package/dist/composer/completion-filter.js +1 -1
  252. package/dist/composer/completion-menu.js +1 -1
  253. package/dist/composer/completion-trigger.js +1 -1
  254. package/dist/composer/effort-slider.js +1 -1
  255. package/dist/composer/inline-document.js +1 -1
  256. package/dist/composer/inline-dom.js +1 -1
  257. package/dist/composer/menu-radio.js +1 -1
  258. package/dist/composer/model-select.js +1 -1
  259. package/dist/composer/permission-mode-select.js +1 -1
  260. package/dist/composer/prompt-input-attachments.js +1 -1
  261. package/dist/composer/prompt-input-clipboard.js +1 -1
  262. package/dist/composer/prompt-input-context.js +1 -1
  263. package/dist/composer/prompt-input-inline.js +1 -1
  264. package/dist/composer/prompt-input-textarea.js +1 -1
  265. package/dist/composer/prompt-input.js +1 -1
  266. package/dist/conversation/action-card.js +1 -1
  267. package/dist/conversation/composer/app-mentions.js +1 -1
  268. package/dist/conversation/composer/apps-menu.js +1 -1
  269. package/dist/conversation/composer/composer-menu.js +1 -1
  270. package/dist/conversation/composer/composer.js +1 -1
  271. package/dist/conversation/composer/config-options.js +1 -1
  272. package/dist/conversation/composer/context.js +1 -1
  273. package/dist/conversation/composer/drafts.js +1 -1
  274. package/dist/conversation/composer/file-items.js +1 -1
  275. package/dist/conversation/composer/long-text.js +1 -1
  276. package/dist/conversation/composer/mention-chips.js +1 -1
  277. package/dist/conversation/composer/mention-uri.js +1 -1
  278. package/dist/conversation/composer/model-menu.js +1 -1
  279. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  280. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  281. package/dist/conversation/composer/prediction.js +1 -1
  282. package/dist/conversation/composer/prompt-history.js +1 -1
  283. package/dist/conversation/composer/slash-command-button.js +1 -1
  284. package/dist/conversation/composer/submit-button.js +1 -1
  285. package/dist/conversation/composer/usage-meter.js +1 -1
  286. package/dist/conversation/connection-notice.js +1 -1
  287. package/dist/conversation/context.js +1 -1
  288. package/dist/conversation/conversation-body.js +1 -1
  289. package/dist/conversation/conversation-search.js +1 -1
  290. package/dist/conversation/conversation-view.js +1 -1
  291. package/dist/conversation/conversation.js +1 -1
  292. package/dist/conversation/diff-modal.js +1 -1
  293. package/dist/conversation/draft-project-picker.js +1 -1
  294. package/dist/conversation/session-actions.js +1 -1
  295. package/dist/conversation/subagent-sessions.js +1 -1
  296. package/dist/conversation/subagent-tasks.js +1 -1
  297. package/dist/desktop/desktop-composer.js +1 -1
  298. package/dist/desktop/desktop.js +1 -1
  299. package/dist/desktop/draft-model-select.js +1 -1
  300. package/dist/desktop/load-image.js +1 -1
  301. package/dist/desktop/model-catalog.js +1 -1
  302. package/dist/desktop/model-recovery.js +1 -1
  303. package/dist/desktop/model-settings-action.js +1 -1
  304. package/dist/desktop/native-file-drop.js +1 -1
  305. package/dist/generated/commands.js +1 -1
  306. package/dist/image-lightbox.js +1 -1
  307. package/dist/image-preview-dialog.js +1 -1
  308. package/dist/image.js +1 -1
  309. package/dist/lib/app-reference.js +1 -1
  310. package/dist/lib/application-metadata.js +1 -1
  311. package/dist/lib/chat-path.js +1 -1
  312. package/dist/lib/code-highlighter.js +1 -1
  313. package/dist/lib/file-url.js +1 -1
  314. package/dist/lib/fuzzy.js +1 -1
  315. package/dist/lib/group-blocks.js +1 -1
  316. package/dist/lib/image-encode.js +1 -1
  317. package/dist/lib/limits.js +1 -1
  318. package/dist/lib/markdown-parser.js +1 -1
  319. package/dist/lib/markdown-rules.js +1 -1
  320. package/dist/lib/model-name.js +1 -1
  321. package/dist/lib/prepare-prompt-files.js +1 -1
  322. package/dist/lib/reference-presentation.js +1 -1
  323. package/dist/lib/stream-style.js +1 -1
  324. package/dist/lib/streaming-markdown.js +1 -1
  325. package/dist/lib/tool-artifacts.js +1 -1
  326. package/dist/locales.js +1 -1
  327. package/dist/mermaid/diagram.js +1 -1
  328. package/dist/mermaid/export.js +1 -1
  329. package/dist/mermaid/index.js +1 -1
  330. package/dist/mermaid/preview.js +1 -1
  331. package/dist/oauth/claude-login.js +1 -1
  332. package/dist/oauth.js +1 -1
  333. package/dist/plugins/catalog-header.js +1 -1
  334. package/dist/plugins/catalog-skeleton.js +1 -1
  335. package/dist/plugins/host.js +1 -1
  336. package/dist/plugins/new-chat-directory.js +1 -1
  337. package/dist/plugins/panel-item.js +1 -1
  338. package/dist/plugins/plugin-detail-page.js +1 -1
  339. package/dist/plugins/plugin-icon.js +1 -1
  340. package/dist/plugins/plugin-icons.js +1 -1
  341. package/dist/plugins/plugins-page.js +1 -1
  342. package/dist/plugins/plugins.js +1 -1
  343. package/dist/plugins/read-skill-document.js +1 -1
  344. package/dist/plugins/skill-document.js +1 -1
  345. package/dist/plugins/skills-tab.js +1 -1
  346. package/dist/plugins/store.js +1 -1
  347. package/dist/plugins/toolbox-layout.js +1 -1
  348. package/dist/reference-projection.js +1 -1
  349. package/dist/search/chat-search.js +1 -1
  350. package/dist/search/codex-source-matches.js +1 -1
  351. package/dist/search/dom-matches.js +1 -1
  352. package/dist/search/find-bar.js +1 -1
  353. package/dist/search/literal-matches.js +1 -1
  354. package/dist/session-list/account-menu.js +1 -1
  355. package/dist/session-list/activity-list.js +1 -1
  356. package/dist/session-list/archived-sessions.js +1 -1
  357. package/dist/session-list/help-menu.js +1 -1
  358. package/dist/session-list/highlight.js +1 -1
  359. package/dist/session-list/host.js +1 -1
  360. package/dist/session-list/hover-info-card.js +1 -1
  361. package/dist/session-list/locales.js +1 -1
  362. package/dist/session-list/navigation-controls.js +1 -1
  363. package/dist/session-list/navigation-header.js +1 -1
  364. package/dist/session-list/navigation-store.js +1 -1
  365. package/dist/session-list/navigation-tabs.js +1 -1
  366. package/dist/session-list/navigation.js +1 -1
  367. package/dist/session-list/platform.js +1 -1
  368. package/dist/session-list/row-stop-button.js +1 -1
  369. package/dist/session-list/session-groups.js +1 -1
  370. package/dist/session-list/session-info-card.js +1 -1
  371. package/dist/session-list/session-list.js +1 -1
  372. package/dist/session-list/session-row.js +1 -1
  373. package/dist/session-list/session-state-dot.js +1 -1
  374. package/dist/session-list/session-state-menu.js +1 -1
  375. package/dist/session-list/shortcut-hint.js +1 -1
  376. package/dist/session-list/shortcut.js +1 -1
  377. package/dist/session-list/sidebar-overlay.js +1 -1
  378. package/dist/session-list/trailing-swap.js +1 -1
  379. package/dist/session-list/use-activity-notification.js +1 -1
  380. package/dist/session-list/use-activity-preview.js +1 -1
  381. package/dist/session-list/use-cmd-held.js +1 -1
  382. package/dist/session-list/use-project-sessions.js +1 -1
  383. package/dist/session-list/virtual-session-rows.js +1 -1
  384. package/dist/session-timeline/activity-group.js +1 -1
  385. package/dist/session-timeline/activity-projection.js +1 -1
  386. package/dist/session-timeline/assistant-content.js +1 -1
  387. package/dist/session-timeline/assistant-image-references.js +1 -1
  388. package/dist/session-timeline/assistant-turn.js +1 -1
  389. package/dist/session-timeline/async-questions.js +1 -1
  390. package/dist/session-timeline/edited-files-card.js +1 -1
  391. package/dist/session-timeline/history-timeline.js +1 -1
  392. package/dist/session-timeline/host.js +1 -1
  393. package/dist/session-timeline/image-generation-progress.js +1 -1
  394. package/dist/session-timeline/navigation-rail.js +1 -1
  395. package/dist/session-timeline/plan.js +1 -1
  396. package/dist/session-timeline/question-reply.js +1 -1
  397. package/dist/session-timeline/resource-content.js +1 -1
  398. package/dist/session-timeline/session-timeline.js +1 -1
  399. package/dist/session-timeline/timeline-registry.js +1 -1
  400. package/dist/session-timeline/turn-activity.js +1 -1
  401. package/dist/session-timeline/turn-error.js +1 -1
  402. package/dist/session-timeline/turn-retry.js +1 -1
  403. package/dist/session-timeline/turn-time.js +1 -1
  404. package/dist/session-timeline/turns.js +1 -1
  405. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  406. package/dist/session-timeline/user-message.js +1 -1
  407. package/dist/settings/codex-account-card.js +1 -1
  408. package/dist/settings/login-card.js +1 -1
  409. package/dist/settings/model-alias-settings.js +1 -1
  410. package/dist/settings/model-aliases.js +1 -1
  411. package/dist/settings/provider-logos.js +1 -1
  412. package/dist/settings/provider-section.js +1 -1
  413. package/dist/settings/providers-port.js +1 -1
  414. package/dist/settings/providers.js +1 -1
  415. package/dist/settings/settings-bridge.js +1 -1
  416. package/dist/settings/settings.js +1 -1
  417. package/native/win32-x64/alwith_native_chat.dll +0 -0
  418. package/native/win32-x64/artifact.json +1 -1
  419. package/package.json +1 -1
  420. package/dist/chunk-052wfeys.js +0 -2
  421. package/dist/chunk-06wtwk7b.js +0 -2
  422. package/dist/chunk-0z7gy762.js +0 -2
  423. package/dist/chunk-1npqxk6m.js +0 -2
  424. package/dist/chunk-2hkj5qxh.js +0 -2
  425. package/dist/chunk-30a5fgk9.js +0 -2
  426. package/dist/chunk-3tp8fe70.js +0 -2
  427. package/dist/chunk-3tzh25vq.js +0 -2
  428. package/dist/chunk-4sa0m3w5.js +0 -2
  429. package/dist/chunk-5jq3xg3q.js +0 -2
  430. package/dist/chunk-7pwdjhg8.js +0 -2
  431. package/dist/chunk-816tez3v.js +0 -2
  432. package/dist/chunk-9x08kyf6.js +0 -2
  433. package/dist/chunk-ajp19sh9.js +0 -2
  434. package/dist/chunk-bve6cykn.js +0 -2
  435. package/dist/chunk-d6cfxqzx.js +0 -2
  436. package/dist/chunk-e1fzfaqj.js +0 -2
  437. package/dist/chunk-f9xtcxfb.js +0 -2
  438. package/dist/chunk-gs0b02g2.js +0 -2
  439. package/dist/chunk-hnkde8me.js +0 -2
  440. package/dist/chunk-jpr2y0y3.js +0 -2
  441. package/dist/chunk-kkqrxb9w.js +0 -3
  442. package/dist/chunk-kqvgmkvr.js +0 -2
  443. package/dist/chunk-ph7srp7q.js +0 -2
  444. package/dist/chunk-qmcr5f9k.js +0 -2
  445. package/dist/chunk-rkqptd9w.js +0 -2
  446. package/dist/chunk-rv3k0kfr.js +0 -2
  447. package/dist/chunk-s6medm3z.js +0 -2
  448. package/dist/chunk-sfgegn3p.js +0 -2
  449. package/dist/chunk-sjb5stzq.js +0 -2
  450. package/dist/chunk-stv8pr4v.js +0 -2
  451. package/dist/chunk-swkcmtme.js +0 -2
  452. package/dist/chunk-sz993t5e.js +0 -2
  453. package/dist/chunk-tc6d0v1y.js +0 -2
  454. package/dist/chunk-tyrzaz6c.js +0 -2
  455. package/dist/chunk-vt7dkgtx.js +0 -2
  456. package/dist/chunk-x3v10a71.js +0 -2
  457. package/dist/chunk-xnx8p8c0.js +0 -4
  458. package/dist/chunk-ye7ecnej.js +0 -2
@@ -1,2 +1,2 @@
1
- import{Ki,Hn,Un,Bn,Gn}from"./chunk-dd9k5bbt.js";import{On}from"./chunk-xwwjj45a.js";var Ln=[{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:"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=Ln,p={anthropic:Ki,deepseek:Hn,openrouter:Bn,qwen:Gn,xai:Un};function c(e){let n=p[e];if(!n)throw Error(`Provider ${e} has no logo`);return n}var R=a.filter((e)=>e.source!=="account").map(({source:e,...n})=>({...n,logo:c(n.id)}));function bt(e){return e!=null&&a.some((n)=>n.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(n.id)}:`))}function Ct(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 fe(e){return[...R.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 S(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=bt){let o=fe(n).flatMap((s)=>s.models.map((r)=>S(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 se(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 Dn(e,n){return se(e,n)?.keyUrl??e.keyUrl??null}function Fn(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=On.models.find((o)=>o.slug===t);return i?{value:i.default_reasoning_level,hidden:i.supported_reasoning_levels.length===0}:null}var wt=l;function Ca(e){return wt[e]??{}}
2
- export{Ln,R,bt,Ct,fe,S,xa,se,Dn,Fn,ba,wt,Ca};
1
+ import{Yi,In,Tn,Mn,Nn}from"./chunk-2easwd1n.js";import{Hn}from"./chunk-7jk8s061.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:"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:Yi,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 A=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 pe(e){return[...A.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 S(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=yt){let o=pe(n).flatMap((s)=>s.models.map((r)=>S(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 ie(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 ie(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=Hn.models.find((o)=>o.slug===t);return i?{value:i.default_reasoning_level,hidden:i.supported_reasoning_levels.length===0}:null}var bt=l;function Ys(e){return bt[e]??{}}
2
+ export{Sn,A,yt,xt,pe,S,Js,ie,_n,Pn,Xs,bt,Ys};
@@ -1,2 +1,2 @@
1
- import{lr}from"./chunk-88ysxbdh.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function ar(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await lr(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
- export{ar};
1
+ import{Ir}from"./chunk-78vckhxt.js";async function m(r){try{let i=await(await fetch(r)).blob();if(typeof createImageBitmap==="function")return(await createImageBitmap(i)).close(),!0;return await new Promise((a)=>{let o=new Image;o.onload=()=>a(!0),o.onerror=()=>a(!1),o.src=r})}catch{return!1}}async function Pr(r){let n=await Promise.all(r.map(async({id:a,lastModified:o,sourcePath:p,...t})=>{let e=t.url;if(t.url.startsWith("blob:")){let s=await Ir(t.url,t.mediaType);if(s===null)return null;e=s}let l=t.mediaType.toLowerCase().startsWith("image/"),c=e.startsWith("data:image/");if(l&&c&&!await m(e))return null;let u=e.startsWith("data:")?e.slice(5,e.indexOf(";")):t.mediaType;return{...t,url:e,mediaType:u}})),i=n.filter((a)=>a!==null);return{files:i,rejectedCount:n.length-i.length}}
2
+ export{Pr};
@@ -1,2 +1,2 @@
1
- async function Vi(e,t,i){let o=new Map;for(let a=0;a<t.length;a+=100){let r=await e("_codex/apps_read",{appIds:t.slice(a,a+100),...i?{threadId:i}:{},includeTools:!1});if(!r||typeof r!=="object"||!("apps"in r)||!Array.isArray(r.apps))throw Error("Invalid application metadata response");for(let n of r.apps){if(!n||typeof n.id!=="string"||n.iconUrl!==null&&typeof n.iconUrl!=="string"||n.iconUrlDark!==null&&typeof n.iconUrlDark!=="string")throw Error("Invalid application icon metadata");o.set(n.id,{iconUrl:n.iconUrl,iconUrlDark:n.iconUrlDark})}}return o}
2
- export{Vi};
1
+ async function hr(e,t,i){let o=new Map;for(let a=0;a<t.length;a+=100){let r=await e("_codex/apps_read",{appIds:t.slice(a,a+100),...i?{threadId:i}:{},includeTools:!1});if(!r||typeof r!=="object"||!("apps"in r)||!Array.isArray(r.apps))throw Error("Invalid application metadata response");for(let n of r.apps){if(!n||typeof n.id!=="string"||n.iconUrl!==null&&typeof n.iconUrl!=="string"||n.iconUrlDark!==null&&typeof n.iconUrlDark!=="string")throw Error("Invalid application icon metadata");o.set(n.id,{iconUrl:n.iconUrl,iconUrlDark:n.iconUrlDark})}}return o}
2
+ export{hr};
@@ -1,2 +1,2 @@
1
- import{$i,te}from"./chunk-fwqpwbd8.js";import{lo}from"./chunk-j6000jts.js";import{so}from"./chunk-eynwjzqp.js";import{An}from"./chunk-tftgnw1w.js";import{Gi,ao}from"./chunk-4sfxcw58.js";import{Bi}from"./chunk-vg9p0hvk.js";import{Mn}from"./chunk-sp2ny9ak.js";import{ge}from"./chunk-30a5fgk9.js";import{ot,Ge}from"./chunk-tc6d0v1y.js";import{co}from"./chunk-bw3bpr6m.js";import{me,Nn}from"./chunk-gwskdhaw.js";import{configRevisionOf as M,isBooleanOption as S,isGroupedSelect as v,isImage as O,isSelectOption as g,mergeMeta as f,runStateSource as R}from"@nyssance/codex-acp-v2/client";var x={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function h(e){let s=e.find((t)=>t.category==="model"&&t.type==="select");return s?.type==="select"&&typeof s.currentValue==="string"?s.currentValue:null}class Ui extends lo{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{resolveModel:t,imageService:i,...n}=s;super(e,n,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.resolveModelOption=t,this.imageService=i,this.imageTool=i?Bi(i,(o)=>this.imageRequests.get(o)):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&&ot(i.mode)){if(Ge(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 Ge(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,s,{...t,meta:f(t.meta,{alwith:{imageIntent:null,applicationContext:Ge("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)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,c)=>O(r)?[[`attachment:${c}`,`data:${r.mimeType};base64,${r.data}`]]:[]))),super.prompt(e,s,{...t,meta:f(t.meta,{alwith:{imageSelection:o,imageRequestId:a,applicationContext:ge.applicationContext(t.meta?.alwith?.imageIntent??"generate",Gi),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 co(super.promptMeta(e,s))}promptImages=new Map;promptWithImages(e,s,t={}){return this.prompt(e,s,{...t,meta:f({alwith:{imageIntent:"generate"}},t.meta)})}async applicationToolsFor(e){let s=await super.applicationToolsFor(e),t=e.options.meta?.alwith;return[...s,...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(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),await super.cancel(e)}async close(e){this.releaseImages(e),await super.close(e)}async stopSession(e){this.releaseImages(e),await 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(R(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)?h(this.session(e).configOptions):null;return s().then(async(c)=>{if(this.holds(e)&&h(this.session(e).configOptions)!==r)await this.normalizeCustomEffort(e,!0);return c})},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=h(n.configOptions),a=so(o);if(!a)return;let r=n.configOptions.find((p)=>p.category==="thought_level"&&g(p)),c,d;if(r&&g(r)){let p=v(r.options)?r.options.flatMap((l)=>l.options):r.options;if(r.currentValue===a.value||!s&&p.some((l)=>l.value===r.currentValue))return;if(!p.some((l)=>l.value===a.value))throw Error(`The model does not advertise its default effort: ${o}`);c=r.configId,d=!s&&i!==void 0&&p.some((l)=>l.value===i)?i:a.value}else{if(!a.hidden||!t||o===null)return;let p=n.configOptions.find((l)=>l.category==="model");if(!p)throw Error("The custom model has no model option");c=p.configId,d=o}return{configId:c,value:d}}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:M(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((a)=>a.category==="thought_level")?.currentValue;await super.replay(e,s,t);let o=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,h(i)===h(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(a){if(this.holds(e)&&this.lifecycle.isCurrent(o))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw a}}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:f(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=Ge(n),a=co(t.meta),r={...a?.alwith,nativeTools:o.nativeTools};delete r.tools;let c=await this.requestModelContext(e,s,{...t,meta:{...a,alwith:r}});return{...c,bind:async(d)=>{await c.bind?.(d),this.inputModes.set(d,n)}}}return this.requestModelContext(e,s,t)}async requestModelContext(e,s,t){if(s.kind!=="resume"||t.meta?.alwith?.model!==void 0)return super.requestContext(e,s,t);let i=s.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?h(n.configOptions):null)??this.gatewayModels.get(i)??null,a=await this.resolveModel(o),r=o===null?null:a;return super.requestContext(e,s,{...t,meta:f(y(r),t.meta)})}async recoverReplay(e,s,t,i){let n=me(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:!0}),!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:!0})}}async resumeModel(e,s){let t=this.session(e);if(!this.state.modelRecovery[e]&&(t.attached||!me(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,readOnly:!0});throw a}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((a)=>{let{[e]:r,...c}=a.modelRecovery;return{modelRecovery:c}}),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((l)=>this.state.draftSessions[l]===e);if(r)await this.lifecycle.admission.pending(r);let c=t??(r?h(this.session(r).configOptions):this.savedModels[e]??this.slotModels[e]),d=i?null:await this.resolveModel(c,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]&&(d===null?!h(this.session(r).configOptions)?.startsWith("gateway:"):h(this.session(r).configOptions)===d)){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,d,e,n);try{if(r&&this.session(r).cwd===a)for(let l of this.session(r).configOptions){if(l.category==="model")continue;if(l.category==="thought_level"&&h(this.session(r).configOptions)!==h(this.session(p).configOptions)&&so(h(this.session(p).configOptions))!==null)continue;let u=this.session(p).configOptions.find((w)=>w.configId===l.configId);if(!u||u.currentValue===l.currentValue)continue;if(S(l)&&S(u))await this.setConfig(p,l.configId,l.currentValue);else if(g(l)&&g(u)){if((v(u.options)?u.options.flatMap((m)=>m.options):u.options).some((m)=>m.value===l.currentValue))await this.setConfig(p,l.configId,l.currentValue)}}if(r)await this.deleteEmptyDraft(r)}catch(l){throw await this.deleteEmptyDraft(p),l}if(this.activateSlot(e,p,o),t!==null||i||c!==null&&c!==d)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){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((c)=>c.sessionId===e)?.title,a=await super.forkInternal(e,s,{...t,meta:f(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((c)=>c.title?[c.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]);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||!e.readOnly)){this.publishSession({...e,attached:!1,readOnly:!0});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=h(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=h(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=h(e.configOptions);if(s===null)return;let t=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(t&&g(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&&g(t)&&t.options.some((n)=>("groupId"in n)&&n.groupId!==x.id&&n.options.some((o)=>o.value===s));if(i)this.gatewayModels.set(e.id,s);else this.gatewayModels.delete(e.id);if(!this.state.draftSessions[e.id])for(let n of this.modelListeners)n(e.id,s,i)}}
2
- export{x,Ui};
1
+ import{vr,ee}from"./chunk-fhjk81r9.js";import{Co}from"./chunk-ecaedwda.js";import{So}from"./chunk-r6ns1457.js";import{Fn}from"./chunk-6wkcqhkk.js";import{mr,wo}from"./chunk-bv14x0e8.js";import{pr}from"./chunk-q9mh8x4r.js";import{On}from"./chunk-kztrgv9y.js";import{ge}from"./chunk-q9y0wjwp.js";import{nt,De}from"./chunk-r6c9r5yy.js";import{ko}from"./chunk-e2qjbqq2.js";import{me,Dn}from"./chunk-29s4mnfw.js";import{configRevisionOf as M,isBooleanOption as S,isGroupedSelect as v,isImage as O,isSelectOption as g,mergeMeta as f,runStateSource as R}from"@nyssance/codex-acp-v2/client";var b={id:"chatgpt",name:"ChatGPT"};function y(e){return e===null?void 0:{alwith:{model:e}}}function h(e){let s=e.find((t)=>t.category==="model"&&t.type==="select");return s?.type==="select"&&typeof s.currentValue==="string"?s.currentValue:null}class dr extends Co{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{resolveModel:t,imageService:i,...n}=s;super(e,n,{sessionWindows:{},draftSessions:{},modelRecovery:{},nativeModels:[]});this.resolveModelOption=t,this.imageService=i,this.imageTool=i?pr(i,(o)=>this.imageRequests.get(o)):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=On(s,e);this.inputModes.delete(e),this.inputSelections.delete(e);let i=t.inputConfig;if(i&&nt(i.mode)){if(De(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 De(this.inputModes.get(e)).routePrompt({native:()=>super.prompt(e,s,{...t,meta:f(t.meta,{alwith:{imageIntent:null,applicationContext:De("chat").applicationContext(null)}})}),image:()=>this.promptImage(e,s,t)})}promptImage(e,s,t){if(!this.imageService)throw Error("Image service is not connected");wo(t.meta?.alwith?.imageAspectRatio);let i=t.meta?.alwith?.imageSelection;if(i!==void 0)ee(i);let n=i??this.inputSelections.get(e)??this.imageService.selection(),o={...this.session(e).state!=="idle"?this.imageRequests.get(e)?.selection??n:n};ee(o);let a=crypto.randomUUID();return this.promptImages.set(a,new Map(s.flatMap((r,c)=>O(r)?[[`attachment:${c}`,`data:${r.mimeType};base64,${r.data}`]]:[]))),super.prompt(e,s,{...t,meta:f(t.meta,{alwith:{imageSelection:o,imageRequestId:a,applicationContext:ge.applicationContext(t.meta?.alwith?.imageIntent??"generate",mr),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(vr(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=wo((s.meta?.alwith).imageAspectRatio);this.imageRequests.set(e,{selection:t,references:i,...n?{aspect:n}:{}})}return ko(super.promptMeta(e,s))}promptImages=new Map;promptWithImages(e,s,t={}){return this.prompt(e,s,{...t,meta:f({alwith:{imageIntent:"generate"}},t.meta)})}async applicationToolsFor(e){let s=await super.applicationToolsFor(e),t=e.options.meta?.alwith;return[...s,...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(),super.onDisconnected(),this.setApp({nativeModels:[]})}async cancel(e){this.releaseImages(e),await super.cancel(e)}async close(e){this.releaseImages(e),await super.close(e)}async stopSession(e){this.releaseImages(e),await 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(R(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)?h(this.session(e).configOptions):null;return s().then(async(c)=>{if(this.holds(e)&&h(this.session(e).configOptions)!==r)await this.normalizeCustomEffort(e,!0);return c})},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=h(n.configOptions),a=So(o);if(!a)return;let r=n.configOptions.find((p)=>p.category==="thought_level"&&g(p)),c,d;if(r&&g(r)){let p=v(r.options)?r.options.flatMap((l)=>l.options):r.options;if(r.currentValue===a.value||!s&&p.some((l)=>l.value===r.currentValue))return;if(!p.some((l)=>l.value===a.value))throw Error(`The model does not advertise its default effort: ${o}`);c=r.configId,d=!s&&i!==void 0&&p.some((l)=>l.value===i)?i:a.value}else{if(!a.hidden||!t||o===null)return;let p=n.configOptions.find((l)=>l.category==="model");if(!p)throw Error("The custom model has no model option");c=p.configId,d=o}return{configId:c,value:d}}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:M(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((a)=>a.category==="thought_level")?.currentValue;await super.replay(e,s,t);let o=this.lifecycle.capture(e);try{await this.normalizeCustomEffort(e,!1,!0,h(i)===h(this.session(e).configOptions)&&typeof n==="string"?n:void 0)}catch(a){if(this.holds(e)&&this.lifecycle.isCurrent(o))this.publishSession({...this.session(e),attached:!1,restoring:!1});throw a}}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:f(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=De(n),a=ko(t.meta),r={...a?.alwith,nativeTools:o.nativeTools};delete r.tools;let c=await this.requestModelContext(e,s,{...t,meta:{...a,alwith:r}});return{...c,bind:async(d)=>{await c.bind?.(d),this.inputModes.set(d,n)}}}return this.requestModelContext(e,s,t)}async requestModelContext(e,s,t){if(s.kind!=="resume"||t.meta?.alwith?.model!==void 0)return super.requestContext(e,s,t);let i=s.sessionId,n=this.holds(i)?this.session(i):void 0,o=(n?h(n.configOptions):null)??this.gatewayModels.get(i)??null,a=await this.resolveModel(o),r=o===null?null:a;return super.requestContext(e,s,{...t,meta:f(y(r),t.meta)})}async recoverReplay(e,s,t,i){let n=me(t);if(!n&&!Dn(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:!0}),!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:!0})}}async resumeModel(e,s){let t=this.session(e);if(!this.state.modelRecovery[e]&&(t.attached||!me(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,readOnly:!0});throw a}finally{this.accountRecoveries.delete(e)}if((this.accountRevocations.get(e)??0)!==i)throw Error("ALwith account changed during model selection");let o=this.session(e);if(!o.attached||o.readOnly)throw Error(o.error?.error?.message??"Cannot resume this conversation");this.accountRevocations.delete(e),this.setApp((a)=>{let{[e]:r,...c}=a.modelRecovery;return{modelRecovery:c}}),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((l)=>this.state.draftSessions[l]===e);if(r)await this.lifecycle.admission.pending(r);let c=t??(r?h(this.session(r).configOptions):this.savedModels[e]??this.slotModels[e]),d=i?null:await this.resolveModel(c,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]&&(d===null?!h(this.session(r).configOptions)?.startsWith("gateway:"):h(this.session(r).configOptions)===d)){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,d,e,n);try{if(r&&this.session(r).cwd===a)for(let l of this.session(r).configOptions){if(l.category==="model")continue;if(l.category==="thought_level"&&h(this.session(r).configOptions)!==h(this.session(p).configOptions)&&So(h(this.session(p).configOptions))!==null)continue;let u=this.session(p).configOptions.find((w)=>w.configId===l.configId);if(!u||u.currentValue===l.currentValue)continue;if(S(l)&&S(u))await this.setConfig(p,l.configId,l.currentValue);else if(g(l)&&g(u)){if((v(u.options)?u.options.flatMap((m)=>m.options):u.options).some((m)=>m.value===l.currentValue))await this.setConfig(p,l.configId,l.currentValue)}}if(r)await this.deleteEmptyDraft(r)}catch(l){throw await this.deleteEmptyDraft(p),l}if(this.activateSlot(e,p,o),t!==null||i||c!==null&&c!==d)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){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((c)=>c.sessionId===e)?.title,a=await super.forkInternal(e,s,{...t,meta:f(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,Fn(r,n.flatMap((c)=>c.title?[c.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]);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||!e.readOnly)){this.publishSession({...e,attached:!1,readOnly:!0});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=h(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=h(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=h(e.configOptions);if(s===null)return;let t=e.configOptions.find((n)=>n.category==="model"&&n.type==="select");if(t&&g(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&&g(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,dr};
@@ -0,0 +1,2 @@
1
+ import{u,po}from"./chunk-kj3t4mqf.js";import{Pn}from"./chunk-38hvm5ca.js";import{useEffect as p,useRef as P,useState as m}from"react";var ji="providers:changed",$i="providers:managed-revoked",i=(e)=>e;function xn(){return{read:()=>i(u.providersRead()),save:(e,r,t)=>i(u.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(u.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(u.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>u.providersTest({providerId:e}),apply:()=>i(u.providersApply()),onChanged:(e)=>po[ji].listen((r)=>e(r.payload))}}function qs(){return{bind:(e)=>u.providersAccountBind({account:e}),refresh:(e,r)=>i(u.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await u.providersClearManaged()},onRevoked:(e)=>po[$i].listen((r)=>e(r.payload.sessionIds))}}async function bn(e){try{return await e.apply()}catch(r){if(!Pn(r))throw r;return e.read()}}function Ee(e,r=console.error){let[t,d]=m(null),a=P(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
+ export{ji,$i,xn,qs,bn,Ee};
@@ -1,2 +1,2 @@
1
- import{F}from"./chunk-pc11a2w0.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function Va(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function ls(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=F(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(F(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function cs(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Va(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(zo),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function zo(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function ye(t){return A(t.content)}function Ot(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Vo(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function ds(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function us(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function ps(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!us(t,e[n-1],o))break;n--}return e[n]?.key}function ms(t,e,n){let o=n,s=n;while(o>0&&us(t,e[o-1],e[o]))o--;while(s+1<e.length&&us(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
- export{Va,ls,cs,zo,ye,Ot,Vo,ds,us,ps,ms};
1
+ import{D}from"./chunk-s8djv2dy.js";import{codexMessageError as v,nativeTurnId as m,textOf as A,turns as S}from"@nyssance/codex-acp-v2/client";function Ea(t){return t.kind==="tool"&&t.name==="mcp_startup"}function _(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function T(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function Ti(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&T(e))}function g(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function w(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)w(s,e,n)}function E(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(v(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=_(e),i=e._meta?.codex,d=D(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(D(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||T(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":g(t,e,o);break;case"tool":if(g(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function Mi(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Ea(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>S({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)w(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&j(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(ro),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>E(x,c,b<M,a[b-1])),x})}function j(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function ro(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function ce(t){return A(t.content)}function ft(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function so(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function Ni(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function Ai(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function Ei(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!Ai(t,e[n-1],o))break;n--}return e[n]?.key}function Ri(t,e,n){let o=n,s=n;while(o>0&&Ai(t,e[o-1],e[o]))o--;while(s+1<e.length&&Ai(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
+ export{Ea,Ti,Mi,ro,ce,ft,so,Ni,Ai,Ei,Ri};
@@ -1,2 +1,2 @@
1
- import{d,i}from"./chunk-kqvgmkvr.js";import{k}from"./chunk-qk1yqepm.js";import{B}from"./chunk-5gn8xw58.js";import{Se}from"./chunk-xyffk47k.js";import{Q,_e,Pe}from"./chunk-pqz2471h.js";import{ExternalLinkIcon as M,PlusIcon as W}from"lucide-react";import{useEffect as _,useState as y}from"react";import{Badge as L}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as q,DialogContent as F,DialogDescription as G,DialogHeader as J,DialogTitle as K}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as s,Fragment as O}from"react/jsx-runtime";function Vt({entry:o,onBack:p}){let u=d(),{t:l}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===o.plugin.id)),v=i((a)=>a.busyIds[o.plugin.id]),T=i((a)=>a.install),H=i((a)=>a.uninstall),V=i((a)=>a.setPluginEnabled),[n,U]=y(null),[D,I]=y(null),[j,R]=y(0),[r,z]=y(null);_(()=>{let a=!0;return I(null),U(null),P(o).then((g)=>{if(a)U(g)},(g)=>{if(a)I(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[o,P,j]);let m=n?.summary??o.plugin,c=C?.plugin??m,t=m.interface,h=t?.displayName??m.name,b=c.availability!=="AVAILABLE"||c.installPolicy==="NOT_AVAILABLE",E=t?.longDescription??n?.description??t?.shortDescription,A=[...u.assetUrl?t?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...t?.screenshotUrls??[]];return s("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(Pe,{children:s("header",{className:"flex min-w-0 flex-col gap-4",children:[s("nav",{"aria-label":l("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(f,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:l("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:h})]}),s("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[s("div",{className:"flex min-w-0 items-center gap-3",children:[e(B,{name:m.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:h})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?s(O,{children:[e(X,{checked:c.enabled,disabled:!!v||b,"aria-label":l(c.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:h}),onCheckedChange:(a)=>void V(c,a)}),e(f,{variant:"outline",size:"sm",disabled:!!v,onClick:()=>void H(c),children:v?e(S,{}):l("plugins.detail.uninstall")})]}):e(f,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":l(b?"plugins.detail.unavailable":"plugins.detail.install"),title:l(b?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!v||b,onClick:()=>void T({...o,plugin:m}).catch(()=>{}),children:v?e(S,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} pt-2`,children:[t?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:t.shortDescription}),m.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(m.keywords)].map((a)=>e(L,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),s("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[t?.developerName&&e(x,{label:l("plugins.detail.developer"),children:t.developerName}),t?.category&&e(x,{label:l("plugins.detail.category"),children:t.category}),(c.localVersion??c.version)&&e(x,{label:l("plugins.detail.version"),children:c.localVersion??c.version}),e(x,{label:l("plugins.headings.marketplace"),children:o.marketplace.interface?.displayName??o.marketplace.name}),t?.websiteUrl&&e(x,{label:l("plugins.detail.website"),children:e(w,{url:t.websiteUrl,label:l("plugins.detail.website")})})]}),!n&&!D&&s("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),l("plugins.detail.loading")]}),D&&s("div",{role:"alert",className:"mt-8 space-y-2",children:[s("p",{className:"text-destructive text-sm",children:[l("plugins.detail.errorTitle"),": ",D]}),e(f,{variant:"outline",size:"sm",className:"h-9",onClick:()=>R((a)=>a+1),children:l("plugins.loadError.retry")})]}),E&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:E}),A.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(A)].map((a)=>e("img",{src:a,alt:h,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),t&&t.capabilities.length>0&&e(N,{label:l("plugins.detail.capabilities"),count:t.capabilities.length,children:t.capabilities.map((a)=>e(L,{variant:"secondary",className:"me-2",children:a},a))}),n&&n.mcpServers.length>0&&e(N,{label:l("plugins.detail.mcpServers"),count:n.mcpServers.length,children:n.mcpServers.map((a)=>s("div",{className:"flex items-center gap-3 py-1",children:[e(B,{name:m.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),n&&n.skills.length>0&&e(N,{label:l("plugins.detail.skills"),count:n.skills.length,children:n.skills.map((a)=>s(f,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(B,{name:a.name,className:"size-8"}),s("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),n&&n.apps.length>0&&e(N,{label:l("plugins.detail.apps"),count:n.apps.length,children:n.apps.map((a)=>s("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:l("plugins.installModal.connect")})]},a.id))}),n&&n.hooks.length>0&&e(N,{label:l("plugins.detail.hooks"),count:n.hooks.length,children:n.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(t?.privacyPolicyUrl||t?.termsOfServiceUrl)&&s("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[t.privacyPolicyUrl&&e(w,{url:t.privacyPolicyUrl,label:l("plugins.detail.privacyPolicy")}),t.termsOfServiceUrl&&e(w,{url:t.termsOfServiceUrl,label:l("plugins.detail.termsOfService")})]})]})}),e(q,{open:r!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(F,{className:_e,children:r&&s(O,{children:[e("div",{className:"shrink-0 pr-8",children:e(B,{name:r.name,className:"size-10"})}),s("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[s(J,{className:"gap-3",children:[e(K,{className:"text-2xl leading-8 font-semibold break-words",children:r.interface?.displayName??r.name}),e(G,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:r.description})]}),e(Se,{path:r.path,description:r.description},r.path??r.name)]})]})})})]})}function x({label:o,children:p}){return s("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:o}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function N({label:o,count:p,children:u}){return s("section",{className:"mt-8",children:[s("h2",{className:"text-base font-medium",children:[o," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:o,label:p}){let{openLink:u}=d();if(!/^https?:\/\//i.test(o))return null;return s(f,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:o,onClick:()=>u(o),children:[p,e(M,{className:"size-3.5"})]})}
2
- export{Vt};
1
+ import{d,i}from"./chunk-3w6dv0nx.js";import{k}from"./chunk-qk1yqepm.js";import{B}from"./chunk-nrzkzvr0.js";import{ke}from"./chunk-55ya3102.js";import{Q,Pe,Ie}from"./chunk-e04g26qm.js";import{ExternalLinkIcon as M,PlusIcon as W}from"lucide-react";import{useEffect as _,useState as y}from"react";import{Badge as L}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as q,DialogContent as F,DialogDescription as G,DialogHeader as J,DialogTitle as K}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as s,Fragment as O}from"react/jsx-runtime";function Qt({entry:o,onBack:p}){let u=d(),{t:l}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===o.plugin.id)),v=i((a)=>a.busyIds[o.plugin.id]),T=i((a)=>a.install),H=i((a)=>a.uninstall),V=i((a)=>a.setPluginEnabled),[n,U]=y(null),[D,I]=y(null),[j,R]=y(0),[r,z]=y(null);_(()=>{let a=!0;return I(null),U(null),P(o).then((g)=>{if(a)U(g)},(g)=>{if(a)I(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[o,P,j]);let m=n?.summary??o.plugin,c=C?.plugin??m,t=m.interface,h=t?.displayName??m.name,b=c.availability!=="AVAILABLE"||c.installPolicy==="NOT_AVAILABLE",E=t?.longDescription??n?.description??t?.shortDescription,A=[...u.assetUrl?t?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...t?.screenshotUrls??[]];return s("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(Ie,{children:s("header",{className:"flex min-w-0 flex-col gap-4",children:[s("nav",{"aria-label":l("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(f,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:l("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:h})]}),s("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[s("div",{className:"flex min-w-0 items-center gap-3",children:[e(B,{name:m.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:h})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?s(O,{children:[e(X,{checked:c.enabled,disabled:!!v||b,"aria-label":l(c.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:h}),onCheckedChange:(a)=>void V(c,a)}),e(f,{variant:"outline",size:"sm",disabled:!!v,onClick:()=>void H(c),children:v?e(S,{}):l("plugins.detail.uninstall")})]}):e(f,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":l(b?"plugins.detail.unavailable":"plugins.detail.install"),title:l(b?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!v||b,onClick:()=>void T({...o,plugin:m}).catch(()=>{}),children:v?e(S,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} pt-2`,children:[t?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:t.shortDescription}),m.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(m.keywords)].map((a)=>e(L,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),s("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[t?.developerName&&e(x,{label:l("plugins.detail.developer"),children:t.developerName}),t?.category&&e(x,{label:l("plugins.detail.category"),children:t.category}),(c.localVersion??c.version)&&e(x,{label:l("plugins.detail.version"),children:c.localVersion??c.version}),e(x,{label:l("plugins.headings.marketplace"),children:o.marketplace.interface?.displayName??o.marketplace.name}),t?.websiteUrl&&e(x,{label:l("plugins.detail.website"),children:e(w,{url:t.websiteUrl,label:l("plugins.detail.website")})})]}),!n&&!D&&s("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),l("plugins.detail.loading")]}),D&&s("div",{role:"alert",className:"mt-8 space-y-2",children:[s("p",{className:"text-destructive text-sm",children:[l("plugins.detail.errorTitle"),": ",D]}),e(f,{variant:"outline",size:"sm",className:"h-9",onClick:()=>R((a)=>a+1),children:l("plugins.loadError.retry")})]}),E&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:E}),A.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(A)].map((a)=>e("img",{src:a,alt:h,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),t&&t.capabilities.length>0&&e(N,{label:l("plugins.detail.capabilities"),count:t.capabilities.length,children:t.capabilities.map((a)=>e(L,{variant:"secondary",className:"me-2",children:a},a))}),n&&n.mcpServers.length>0&&e(N,{label:l("plugins.detail.mcpServers"),count:n.mcpServers.length,children:n.mcpServers.map((a)=>s("div",{className:"flex items-center gap-3 py-1",children:[e(B,{name:m.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),n&&n.skills.length>0&&e(N,{label:l("plugins.detail.skills"),count:n.skills.length,children:n.skills.map((a)=>s(f,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(B,{name:a.name,className:"size-8"}),s("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),n&&n.apps.length>0&&e(N,{label:l("plugins.detail.apps"),count:n.apps.length,children:n.apps.map((a)=>s("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:l("plugins.installModal.connect")})]},a.id))}),n&&n.hooks.length>0&&e(N,{label:l("plugins.detail.hooks"),count:n.hooks.length,children:n.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(t?.privacyPolicyUrl||t?.termsOfServiceUrl)&&s("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[t.privacyPolicyUrl&&e(w,{url:t.privacyPolicyUrl,label:l("plugins.detail.privacyPolicy")}),t.termsOfServiceUrl&&e(w,{url:t.termsOfServiceUrl,label:l("plugins.detail.termsOfService")})]})]})}),e(q,{open:r!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(F,{className:Pe,children:r&&s(O,{children:[e("div",{className:"shrink-0 pr-8",children:e(B,{name:r.name,className:"size-10"})}),s("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[s(J,{className:"gap-3",children:[e(K,{className:"text-2xl leading-8 font-semibold break-words",children:r.interface?.displayName??r.name}),e(G,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:r.description})]}),e(ke,{path:r.path,description:r.description},r.path??r.name)]})]})})})]})}function x({label:o,children:p}){return s("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:o}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function N({label:o,count:p,children:u}){return s("section",{className:"mt-8",children:[s("h2",{className:"text-base font-medium",children:[o," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:o,label:p}){let{openLink:u}=d();if(!/^https?:\/\//i.test(o))return null;return s(f,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:o,onClick:()=>u(o),children:[p,e(M,{className:"size-3.5"})]})}
2
+ export{Qt};
@@ -0,0 +1,2 @@
1
+ import{tn}from"./chunk-sjtfxn55.js";import{createContext as l,useContext as a,useEffect as p,useSyncExternalStore as u}from"react";import{jsx as o}from"react/jsx-runtime";var g=l(null),P=l(null),r=new WeakMap;function We(e){let t=r.get(e);if(!t)t=tn(e),r.set(e,t);return t}function Ds({host:e,client:t,children:n}){let s=We(t);return s.bindHost(e),p(()=>s.bindHost(e),[s,e]),o(g,{value:e,children:o(P,{value:t,children:n})})}function d(){let e=a(g);if(e===null)throw Error("Plugins host is missing");return e}function Ze(){let e=a(P);if(e===null)throw Error("Plugins client is missing");return e}function ut(e){let t=Ze();return u((n)=>t.store.subscribe(n),()=>e(t.store.getState()),()=>e(t.store.getState()))}function i(e){let t=We(Ze());return u((n)=>t.subscribe(n),()=>e(t.getState()),()=>e(t.getState()))}function Qe(e,t){return t.then(()=>{},(n)=>{if(e.reportError)e.reportError(n);else console.error(n)})}
2
+ export{We,Ds,d,Ze,ut,i,Qe};
@@ -0,0 +1,2 @@
1
+ function Fa(e,n){if(e.type||!n.type)return e;let i=n.type.split("/")[1],o=i!==void 0&&i!==""?`pasted-${Date.now()}.${i==="jpeg"?"jpg":i}`:"";return new File([e],e.name||o||`pasted-${Date.now()}`,{type:n.type})}function kt(e){let n=[],i=!1;for(let o of e){if(o.kind!=="file")continue;let t=o.getAsFile();if(!t)continue;if(!(t.type||o.type).startsWith("image/")){i=!0;continue}n.push(Fa(t,o))}return{imageFiles:n,sawNonImageFile:i}}function St(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Rn(e){return e.replace(s,"")}function ea(e,n){let i=0;for(let o=0;o<n;o++){let t=e.charCodeAt(o);if(t>=0&&t<=8||t===11||t===12||t>=14&&t<=31||t===127)i++}return i}function Ln(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=Rn(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-ea(n,i)),r=Math.max(0,o-ea(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
2
+ export{Fa,kt,St,Rn,ea,Ln};
@@ -1,2 +1,2 @@
1
- import{a,n}from"./chunk-bba9qej8.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Kt(e,o){let s=a(),c=n((t)=>t.connection),r=n((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=n((t)=>v(t.sessions[e]?.items)),f=n((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||r)return;let t=!1,l,i=0,m=async()=>{try{let d=await s.activityReply(e);if(i=0,!t)y(d??void 0)}catch{i++}finally{if(!t&&(o==="running"||i>0&&i<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[s,e,c,f,r,o]),r?u:p??u}
2
- export{Kt};
1
+ import{a,n}from"./chunk-6c18ag8t.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function jn(e,o){let s=a(),c=n((t)=>t.connection),r=n((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=n((t)=>v(t.sessions[e]?.items)),f=n((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||r)return;let t=!1,l,i=0,m=async()=>{try{let d=await s.activityReply(e);if(i=0,!t)y(d??void 0)}catch{i++}finally{if(!t&&(o==="running"||i>0&&i<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[s,e,c,f,r,o]),r?u:p??u}
2
+ export{jn};
@@ -1,2 +1,2 @@
1
- import{Dt}from"./chunk-c2h4wr7g.js";import{d,Ze}from"./chunk-kqvgmkvr.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function Yo(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function Se({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ze(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ze(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Ze(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:Yo(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
- export{Yo,Se};
1
+ import{Dt}from"./chunk-bydxp3zj.js";import{d,Qe}from"./chunk-3w6dv0nx.js";import{k}from"./chunk-qk1yqepm.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function ci(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function ke({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,M,c]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(y,{})}),i(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Qe(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Qe(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Qe(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(x):o("div",{className:"flex justify-end",children:x}),o(k,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Dt,{text:ci(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
+ export{ci,ke};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function Ce(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ko(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{Ce,Ko};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function ye(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Bo(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{ye,Bo};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-esbgn8q0.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function ra({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
- export{ra};
1
+ import{e}from"./chunk-abgdqy92.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Is({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
+ export{Is};
@@ -1,2 +1,2 @@
1
- import{a,n}from"./chunk-bba9qej8.js";import{QUICK_CHATS_GROUP as m,sessionGroup as l}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function Us(i){let t=a(),e=n((s)=>s.projectContext),c=i===null?m:e?l(e,{cwd:t.projectPath(i)}).id:null,u=n((s)=>s.sessionList),d=n((s)=>s.connection),r=n((s)=>s.sessionListLoaded),o=n((s)=>s.sessionListError),f=()=>t.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(d==="ready"&&!r&&o===null)t.listSessions().catch(()=>{return})},[t,d,r,o]),{result:L(()=>{if(r&&e)return{status:"ready",sessionRows:u.filter((s)=>l(e,{...s,cwd:t.projectPath(s.cwd)}).id===c).toSorted((s,p)=>(p.updatedAt??"").localeCompare(s.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[t,u,r,o,c,e]),retry:f}}
2
- export{Us};
1
+ import{a,n}from"./chunk-6c18ag8t.js";import{QUICK_CHATS_GROUP as m,sessionGroup as l}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function aa(i){let t=a(),e=n((s)=>s.projectContext),c=i===null?m:e?l(e,{cwd:t.projectPath(i)}).id:null,u=n((s)=>s.sessionList),d=n((s)=>s.connection),r=n((s)=>s.sessionListLoaded),o=n((s)=>s.sessionListError),f=()=>t.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(d==="ready"&&!r&&o===null)t.listSessions().catch(()=>{return})},[t,d,r,o]),{result:L(()=>{if(r&&e)return{status:"ready",sessionRows:u.filter((s)=>l(e,{...s,cwd:t.projectPath(s.cwd)}).id===c).toSorted((s,p)=>(p.updatedAt??"").localeCompare(s.updatedAt??""))};if(o!==null)return{status:"failed",error:o};return{status:"loading"}},[t,u,r,o,c,e]),retry:f}}
2
+ export{aa};
@@ -1,2 +1,2 @@
1
- import{c}from"./chunk-1fadxh2z.js";import{es}from"./chunk-k883x8fv.js";import{be}from"./chunk-73e9vpm9.js";import{M}from"./chunk-pxv38ttf.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as T,useState as v}from"react";import{jsx as r,jsxs as f}from"react/jsx-runtime";function st(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function B(e){let s=[];for(let[n,l]of e.content.entries()){if(!b(l))continue;let i=l.content;if(N(i))s.push({key:`${e.id}:${n}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(w(i))s.push({key:`${e.id}:${n}`,path:i.uri,alt:i.name})}if(s.length)return s;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:s,openImageGallery:a,openImage:n,t:l}=c(),i=be(),[g,y]=v({}),[x,I]=v(0),h=JSON.stringify(e);T(()=>{let t=!0,m=JSON.parse(h);y({});for(let o of m)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&s?s(es(o.path,i)):Promise.reject(Error("Image loading is unavailable"))).then((u)=>{if(t)y((p)=>({...p,[o.key]:{src:u}}))},()=>{if(t)y((u)=>({...u,[o.key]:{error:!0}}))});return()=>{t=!1}},[h,s,i,x]);let k=e.flatMap((t)=>{let m=g[t.key];return m&&"src"in m?[{src:m.src,alt:t.alt}]:[]});return r("div",{className:"codex-image-thumbnails",children:e.map((t,m)=>{let o=g[t.key];if(!o)return r("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:r(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return r("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>I((d)=>d+1),children:r(R,{"aria-hidden":"true"})},t.key);return r("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let d=e.slice(0,m).filter((u)=>{let p=g[u.key];return p&&"src"in p}).length;if(a)a(k,d);else n?.(o.src)},children:r("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function Lr({blocks:e}){let{t:s}=c(),a=e.flatMap(B),[n,l]=M(`image-view:${e[0].id}`,!1);return f("div",{className:"codex-activity-item",children:[f("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":n,onClick:()=>l((i)=>!i),children:[f("span",{className:"codex-activity-label",children:[r(S,{className:"codex-activity-icon","aria-hidden":"true"}),r("span",{className:"codex-activity-leading",children:s("stream.codex.viewedImages",{count:a.length})})]}),r(C,{className:n?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),n&&r(E,{images:a})]})}
2
- export{st,Lr};
1
+ import{c}from"./chunk-wf7kfk3p.js";import{vs}from"./chunk-g8w06bdx.js";import{Ce}from"./chunk-pdmayjan.js";import{M}from"./chunk-pxv38ttf.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as T,useState as v}from"react";import{jsx as r,jsxs as f}from"react/jsx-runtime";function st(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function B(e){let s=[];for(let[n,l]of e.content.entries()){if(!b(l))continue;let i=l.content;if(N(i))s.push({key:`${e.id}:${n}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(w(i))s.push({key:`${e.id}:${n}`,path:i.uri,alt:i.name})}if(s.length)return s;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:s,openImageGallery:a,openImage:n,t:l}=c(),i=Ce(),[g,y]=v({}),[x,I]=v(0),h=JSON.stringify(e);T(()=>{let t=!0,m=JSON.parse(h);y({});for(let o of m)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&s?s(vs(o.path,i)):Promise.reject(Error("Image loading is unavailable"))).then((u)=>{if(t)y((p)=>({...p,[o.key]:{src:u}}))},()=>{if(t)y((u)=>({...u,[o.key]:{error:!0}}))});return()=>{t=!1}},[h,s,i,x]);let k=e.flatMap((t)=>{let m=g[t.key];return m&&"src"in m?[{src:m.src,alt:t.alt}]:[]});return r("div",{className:"codex-image-thumbnails",children:e.map((t,m)=>{let o=g[t.key];if(!o)return r("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:r(A,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return r("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>I((d)=>d+1),children:r(R,{"aria-hidden":"true"})},t.key);return r("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let d=e.slice(0,m).filter((u)=>{let p=g[u.key];return p&&"src"in p}).length;if(a)a(k,d);else n?.(o.src)},children:r("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function gs({blocks:e}){let{t:s}=c(),a=e.flatMap(B),[n,l]=M(`image-view:${e[0].id}`,!1);return f("div",{className:"codex-activity-item",children:[f("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":n,onClick:()=>l((i)=>!i),children:[f("span",{className:"codex-activity-label",children:[r(S,{className:"codex-activity-icon","aria-hidden":"true"}),r("span",{className:"codex-activity-leading",children:s("stream.codex.viewedImages",{count:a.length})})]}),r(C,{className:n?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),n&&r(E,{images:a})]})}
2
+ export{st,gs};
@@ -1,2 +1,2 @@
1
- import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function Hr(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
2
- export{Hr};
1
+ import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function Fi(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
2
+ export{Fi};
@@ -1,7 +1,7 @@
1
- import{c,O}from"./chunk-1fadxh2z.js";import{Ro}from"./chunk-xx7t8r87.js";import{ne}from"./chunk-agdkhyaj.js";import{M}from"./chunk-pxv38ttf.js";import{st,Lr}from"./chunk-bg0vkt53.js";import{ve}from"./chunk-15m908ph.js";import{cn as v}from"cn";import{BotIcon as ue,CheckIcon as me,CopyIcon as pe}from"lucide-react";import{Fragment as ge,memo as fe,useEffect as D,useRef as P,useState as E}from"react";import{jsx as n,jsxs as p,Fragment as R}from"react/jsx-runtime";function xe(e,t){if(e.status==="pending"||e.status==="in_progress")return;if(e.status==="cancelled"||e.status==="interrupted")return t("stream.codex.commandStopped");if(e.exitCode!==void 0&&e.exitCode!==0)return t("stream.codex.exitCode",{code:e.exitCode});if(e.status==="completed"&&e.exitCode===void 0)return;return t(e.status==="failed"?"stream.codex.commandFailed":"stream.codex.commandSucceeded")}function H(e,t){let[a,o]=E(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var G=new WeakMap,q=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=G.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=q;return q+=1,G.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function V(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var Ce="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function B({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:Ce})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function he(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function we(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function Le(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function z(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function Y({block:e}){if(e.type!=="tool_use")return null;if(U(e))return n(z,{});let t=ne(e).category;if(t==="read")return n(ye,{});if(t==="search"||t==="fetch")return n(he,{});if(t==="execute")return n(we,{});if(t==="edit")return n(Le,{});return n(z,{})}function k(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Ne(e){return ne(e).target}function W(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function U(e){return W(e)||e.name==="dynamic_tool"}function ee(e,t){let{category:a}=ne(e),o=Ne(e),i=N(e.status);if(U(e))return{leading:e.title};if(a==="execute"){let r=k(e,"command")?.split(`
2
- `)[0]??o;return r?{leading:t(i?"stream.codex.running":"stream.codex.ran"),trailing:r}:{leading:t(i?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let r=k(e,"pattern")??k(e,"query")??o;return r?{leading:t(i?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let r=k(e,"query")??k(e,"url")??o;return r?{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return o?{leading:t("stream.codex.readLabel"),trailing:o}:{leading:t("stream.codex.readFiles")};if(a==="edit")return o?{leading:t(i?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:o}:{leading:t(i?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return o?{leading:t(i?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:o}:{leading:t(i?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return o?{leading:t(i?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:o}:{leading:t(i?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function be(e,t){let a=ee(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function Te(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
1
+ import{c,O}from"./chunk-wf7kfk3p.js";import{qo}from"./chunk-d8f6avcz.js";import{ne}from"./chunk-hygvdjq6.js";import{M}from"./chunk-pxv38ttf.js";import{st,gs}from"./chunk-5hk3k14h.js";import{be}from"./chunk-vhxr0c4c.js";import{cn as v}from"cn";import{BotIcon as ue,CheckIcon as me,CopyIcon as pe}from"lucide-react";import{Fragment as ge,memo as fe,useEffect as D,useRef as P,useState as E}from"react";import{jsx as n,jsxs as p,Fragment as R}from"react/jsx-runtime";function xe(e,t){if(e.status==="pending"||e.status==="in_progress")return;if(e.status==="cancelled"||e.status==="interrupted")return t("stream.codex.commandStopped");if(e.exitCode!==void 0&&e.exitCode!==0)return t("stream.codex.exitCode",{code:e.exitCode});if(e.status==="completed"&&e.exitCode===void 0)return;return t(e.status==="failed"?"stream.codex.commandFailed":"stream.codex.commandSucceeded")}function H(e,t){let[a,o]=E(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var G=new WeakMap,q=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=G.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=q;return q+=1,G.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function V(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let u=Intl.DurationFormat;if(u)try{return new u(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var Ce="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function B({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:Ce})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function ve(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function he(){return p("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function we(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function z(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function Y({block:e}){if(e.type!=="tool_use")return null;if(U(e))return n(z,{});let t=ne(e).category;if(t==="read")return n(ye,{});if(t==="search"||t==="fetch")return n(ve,{});if(t==="execute")return n(he,{});if(t==="edit")return n(we,{});return n(z,{})}function k(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Le(e){return ne(e).target}function W(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function U(e){return W(e)||e.name==="dynamic_tool"}function ee(e,t){let{category:a}=ne(e),o=Le(e),i=N(e.status);if(U(e))return{leading:e.title};if(a==="execute"){let r=k(e,"command")?.split(`
2
+ `)[0]??o;return r?{leading:t(i?"stream.codex.running":"stream.codex.ran"),trailing:r}:{leading:t(i?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let r=k(e,"pattern")??k(e,"query")??o;return r?{leading:t(i?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let r=k(e,"query")??k(e,"url")??o;return r?{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return o?{leading:t("stream.codex.readLabel"),trailing:o}:{leading:t("stream.codex.readFiles")};if(a==="edit")return o?{leading:t(i?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:o}:{leading:t(i?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return o?{leading:t(i?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:o}:{leading:t(i?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return o?{leading:t(i?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:o}:{leading:t(i?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Ne(e,t){let a=ee(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function Te(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
3
3
  `).trim()}function $e(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="image"?[{data:a.data,mimeType:a.mimeType}]:[]})}function Ae(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="audio"?[{data:a.data,mimeType:a.mimeType}]:[]})}function ke(e){if(typeof e==="string"&&e.length>0)return e;return}function Be(e){return e.type==="diff"}function Ie(e){let t=e.content.find(Be);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
4
  `)}function te(e){let t=ke(e.rawOutput);if(t!==void 0)return t;let a=Te(e.content);if(a.length>0)return a;return Ie(e)}function K({block:e,command:t}){let{t:a,Output:o,commandStatus:i}=c(),[r,u]=E(!1),[d,l]=E(!1),m=te(e),s=i===void 0?xe(e,a):i(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,m].filter((f)=>f!==void 0).join(`
5
5
  `)),u(!0),setTimeout(()=>u(!1),1500)};return n("div",{className:"codex-command-details",children:p("div",{className:"codex-command-card",children:[p("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:v("codex-command-line",!d&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:g,children:r?n(me,{}):n(pe,{})})]}),m!==void 0&&(o===void 0?n("pre",{className:"codex-command-output",children:m}):n(o,{text:m})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ae({block:e}){let{t,openLink:a,Patch:o,openImage:i,commandStatus:r,expandToolOutput:u=!1}=c(),d=te(e),l=o===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let A=x;return A.patch?.text?[A.patch.text]:[]}).join(`
6
- `),m=$e(e.content),s=Ae(e.content),[g,f]=M(`tool:${e.id}`,!1),C=H(`tool:${e.id}`,g),h=ne(e),w=h.category,y=ee(e,t),b=w==="execute"?k(e,"command"):void 0;if(e.userShell&&b!==void 0)return n(K,{block:e,command:b});let T=b!==void 0||U(e)||m.length>0||s.length>0||Boolean(l)||u&&d!==void 0,I=!T&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(Y,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):p(R,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(I!==void 0?p(R,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:I,onClick:()=>a(I),children:y.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[T?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[S,n(B,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&p(R,{children:[b!==void 0?n(K,{block:e,command:b}):o!==void 0&&l?n(o,{patch:l}):d!==void 0&&n("pre",{className:"codex-activity-details",children:d}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let A=`data:${x.mimeType};base64,${x.data}`,j=n("img",{src:A,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?j:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(A),children:j},A)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}var oe=fe(function({block:t}){if(t.type==="tool_use")return n(ae,{block:t});if(t.type==="thinking")return n(le,{block:t});if(t.type==="collab")return n(ce,{block:t});return n(ie,{block:t})});function ie({block:e}){let{t,openSession:a}=c(),o=N(e.status),[i,r]=M(`subagent:${e.id}`,o),u=P(o);D(()=>{if(o)r(!0);if(u.current&&!o)r(!1);u.current=o},[o,r]);let d=`${_e(e.activity,o,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?i:void 0,disabled:!m,onClick:()=>r((s)=>!s),children:[p("span",{className:"codex-activity-label",children:[n(Ee,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:d}):d:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:d})})]}),m&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ae,{block:s},s.id);if(s.type==="thinking")return n(le,{block:s},L(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(ce,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(O,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(ve,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Me=8;function Se(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Me}function Ee({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Se(e),"aria-hidden":"true"})}function _e(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var Fe=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${Ro(e)}`;let o=Fe.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${Ro(e)} · ${o}`}var Re={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function se(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=se(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Re[e.tool]}.${o}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function de(e,t){let a=e.agents.length>0?e.agents.length:1;return`${Z(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var _="\x01";function F(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${_}${r}${_}`]));return e(t,{...a,...i}).split(new RegExp(`${_}(\\w+)${_}`,"u")).map((r,u)=>n(ge,{children:u%2===1?o[r]:r},`${u}:${r}`))}function Pe({agent:e,showModel:t}){let{t:a,openSession:o}=c(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return p("span",{children:[r,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function J({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,t){let a=e.prompt?.trim()?e.prompt:null,o=se(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,u=De(e),d=[];if(u.length===0)d.push({key:"generic",node:Z(e,"row",t)});for(let l of u){let m=n(Pe,{agent:l,showModel:e.tool==="spawnAgent"});if(i)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(J,{prompt:a})})})});else if(r)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:m,prompt:n(J,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";d.push({key:l.threadId,node:F(t,"stream.codex.collab.agentRow",{action:Z(e,"row",t),state:g},{agent:m})})}}if(!i&&!r&&a!==null)d.push({key:"input",node:F(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return d}function ce({block:e}){let{t}=c(),[a,o]=M(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=de(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(ue,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(B,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Ue(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function le({block:e}){let{t,i18n:a}=c(),o=Boolean(e.isComplete),[i,r]=M(`thinking:${L(e)}`,!1),u=P(null),d=e.thinking.trim().length>0;D(()=>{if(o||!d)return;let s=u.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[d,o]);let l=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:V(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!d&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":d?i:void 0,disabled:!d,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?l:n("span",{className:"codex-activity-running",children:l})})}),d&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:d&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(O,{text:m,streaming:!o})})})})]})}function Oe(e){if(W(e))return"mcp";let t=ne(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ve(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ze(e,t,a){let o=new Map,i=[],r=new Set;for(let d of e){if(W(d)&&typeof d.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(d.rawInput.server);continue}if(U(d)){if(!i.some((m)=>m.kind==="named"&&m.title===d.title))i.push({kind:"named",title:d.title});continue}let l=Oe(d);if(!o.has(l))i.push({kind:"category",category:l});o.set(l,(o.get(l)??0)+1)}let u=i.map((d,l)=>{if(d.kind==="named")return d.title;if(d.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ve(d.category,o.get(d.category),l===0,t)});if(a.startsWith("zh"))return u.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(u)}function Er({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:u,providerIcon:d,children:l}){let{t:m,i18n:s}=c(),[g,f]=M(`work:${e}`,i,!0),C=H(`work:${e}`,g||o),h=P(null),[w,y]=E(0);D(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let T=()=>{let S=h.current;if(S===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-S)};T();let I=window.setInterval(T,1000);return()=>window.clearInterval(I)},[o,r,t]);let b=t!==void 0?m(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:V(t,s.language)}):o&&w>=1000?m("stream.codex.workingFor",{duration:V(w,s.language)}):m(o?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((T)=>!T),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:d}),n("span",{children:b}),n(B,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&l})})})]})}function He(e,t){if(e.type==="tool_use")return be(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return de(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function Q(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function We(e,t,a=1000){let[o,i]=E({text:e,live:t}),r=P(Date.now());return D(()=>{if(e===o.text&&t===o.live)return;let u=Date.now(),d=Math.max(0,r.current+a-u);if(d===0||t!==o.live){r.current=u,i({text:e,live:t});return}let l=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},d);return()=>window.clearTimeout(l)},[o,t,a,e]),t===o.live?o.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=c(),i=e.some(Q),r=L(e[0]),u=e.every((C)=>C.type==="tool_use"&&ne(C).category==="execute"),[d,l]=M(`group:${r}`,t&&!u),m=H(`group:${r}`,d),s=e.findLast(Q)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=We(i?He(s,a):Ze(g,a,o.language),i);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((C)=>!C),children:[p("span",{className:"codex-activity-label",children:[n(Y,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(B,{expanded:d})]}),n("div",{className:v("codex-activity-group-grid",d&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((C)=>n(oe,{block:C},L(C)))})})})]})}function X({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function Rt({blocks:e,defaultExpanded:t}){if(!e.some(st))return n(X,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&st(i[0])===st(o))i.push(o);else a.push([o])}return n(R,{children:a.map((o)=>st(o[0])?n(Lr,{blocks:o.filter(st)},L(o[0])):n(X,{blocks:o,defaultExpanded:t},L(o[0])))})}
7
- export{Er,Rt};
6
+ `),m=$e(e.content),s=Ae(e.content),[g,f]=M(`tool:${e.id}`,!1),C=H(`tool:${e.id}`,g),h=ne(e),w=h.category,y=ee(e,t),b=w==="execute"?k(e,"command"):void 0;if(e.userShell&&b!==void 0)return n(K,{block:e,command:b});let T=b!==void 0||U(e)||m.length>0||s.length>0||Boolean(l)||u&&d!==void 0,I=!T&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let S=p("span",{className:"codex-activity-label",children:[n(Y,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):p(R,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(I!==void 0?p(R,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:I,onClick:()=>a(I),children:y.trailing})]}):p("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return p("div",{className:"codex-activity-item",children:[T?p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[S,n(B,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:S}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&p(R,{children:[b!==void 0?n(K,{block:e,command:b}):o!==void 0&&l?n(o,{patch:l}):d!==void 0&&n("pre",{className:"codex-activity-details",children:d}),m.length>0&&n("div",{className:"codex-activity-media",children:m.map((x)=>{let A=`data:${x.mimeType};base64,${x.data}`,j=n("img",{src:A,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?j:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(A),children:j},A)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}var oe=fe(function({block:t}){if(t.type==="tool_use")return n(ae,{block:t});if(t.type==="thinking")return n(le,{block:t});if(t.type==="collab")return n(ce,{block:t});return n(ie,{block:t})});function ie({block:e}){let{t,openSession:a}=c(),o=N(e.status),[i,r]=M(`subagent:${e.id}`,o),u=P(o);D(()=>{if(o)r(!0);if(u.current&&!o)r(!1);u.current=o},[o,r]);let d=`${_e(e.activity,o,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,l=e.threadId??"",m=e.blocks.length>0;return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!m&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":m?i:void 0,disabled:!m,onClick:()=>r((s)=>!s),children:[p("span",{className:"codex-activity-label",children:[n(Ee,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:d}):d:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(l,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(l,e.name)},children:d})})]}),m&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ae,{block:s},s.id);if(s.type==="thinking")return n(le,{block:s},L(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(ce,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(O,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(be,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Me=8;function Se(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Me}function Ee({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Se(e),"aria-hidden":"true"})}function _e(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var Fe=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${qo(e)}`;let o=Fe.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${qo(e)} · ${o}`}var Re={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function se(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=se(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Re[e.tool]}.${o}`)}function De(e){return e.agents.filter((t)=>t.nickname!==null)}function de(e,t){let a=e.agents.length>0?e.agents.length:1;return`${Z(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var _="\x01";function F(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${_}${r}${_}`]));return e(t,{...a,...i}).split(new RegExp(`${_}(\\w+)${_}`,"u")).map((r,u)=>n(ge,{children:u%2===1?o[r]:r},`${u}:${r}`))}function Pe({agent:e,showModel:t}){let{t:a,openSession:o}=c(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return p("span",{children:[r,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function J({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Ue(e,t){let a=e.prompt?.trim()?e.prompt:null,o=se(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,u=De(e),d=[];if(u.length===0)d.push({key:"generic",node:Z(e,"row",t)});for(let l of u){let m=n(Pe,{agent:l,showModel:e.tool==="spawnAgent"});if(i)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.createdWithInstructions",{},{agent:m,instructions:n(J,{prompt:a})})})});else if(r)d.push({key:l.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:m,prompt:n(J,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&l.state!==null&&l.state!==null?l.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${l.state.status}`),message:l.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${l.state.status}`)}):"";d.push({key:l.threadId,node:F(t,"stream.codex.collab.agentRow",{action:Z(e,"row",t),state:g},{agent:m})})}}if(!i&&!r&&a!==null)d.push({key:"input",node:F(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return d}function ce({block:e}){let{t}=c(),[a,o]=M(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=de(e,t);return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((u)=>!u),children:[p("span",{className:"codex-activity-label",children:[n(ue,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(B,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Ue(e,t).map((u)=>n("div",{className:"codex-collab-row",children:u.node},u.key))})})})]})}function le({block:e}){let{t,i18n:a}=c(),o=Boolean(e.isComplete),[i,r]=M(`thinking:${L(e)}`,!1),u=P(null),d=e.thinking.trim().length>0;D(()=>{if(o||!d)return;let s=u.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[d,o]);let l=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:V(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),m=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return p("div",{className:"codex-activity-item",children:[p("button",{type:"button",className:v("codex-activity-header",!d&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":d?i:void 0,disabled:!d,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?l:n("span",{className:"codex-activity-running",children:l})})}),d&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:d&&n("div",{ref:u,className:"codex-reasoning-details",role:"region","aria-label":l,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(O,{text:m,streaming:!o})})})})]})}function Oe(e){if(W(e))return"mcp";let t=ne(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ve(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ze(e,t,a){let o=new Map,i=[],r=new Set;for(let d of e){if(W(d)&&typeof d.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(d.rawInput.server);continue}if(U(d)){if(!i.some((m)=>m.kind==="named"&&m.title===d.title))i.push({kind:"named",title:d.title});continue}let l=Oe(d);if(!o.has(l))i.push({kind:"category",category:l});o.set(l,(o.get(l)??0)+1)}let u=i.map((d,l)=>{if(d.kind==="named")return d.title;if(d.kind==="integrations")return t(`stream.codex.summary.integrations.${l===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ve(d.category,o.get(d.category),l===0,t)});if(a.startsWith("zh"))return u.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(u)}function ps({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:u,providerIcon:d,children:l}){let{t:m,i18n:s}=c(),[g,f]=M(`work:${e}`,i,!0),C=H(`work:${e}`,g||o),h=P(null),[w,y]=E(0);D(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let T=()=>{let S=h.current;if(S===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-S)};T();let I=window.setInterval(T,1000);return()=>window.clearInterval(I)},[o,r,t]);let b=t!==void 0?m(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:V(t,s.language)}):o&&w>=1000?m("stream.codex.workingFor",{duration:V(w,s.language)}):m(o?"stream.codex.working":"stream.codex.worked");return p("section",{className:"codex-work-section",children:[p("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((T)=>!T),children:[u!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":u,"aria-hidden":"true",children:d}),n("span",{children:b}),n(B,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&l})})})]})}function He(e,t){if(e.type==="tool_use")return Ne(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return de(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function Q(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function We(e,t,a=1000){let[o,i]=E({text:e,live:t}),r=P(Date.now());return D(()=>{if(e===o.text&&t===o.live)return;let u=Date.now(),d=Math.max(0,r.current+a-u);if(d===0||t!==o.live){r.current=u,i({text:e,live:t});return}let l=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},d);return()=>window.clearTimeout(l)},[o,t,a,e]),t===o.live?o.text:e}function je({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=c(),i=e.some(Q),r=L(e[0]),u=e.every((C)=>C.type==="tool_use"&&ne(C).category==="execute"),[d,l]=M(`group:${r}`,t&&!u),m=H(`group:${r}`,d),s=e.findLast(Q)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=We(i?He(s,a):Ze(g,a,o.language),i);return p("div",{className:"codex-activity-group",children:[p("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":d,onClick:()=>l((C)=>!C),children:[p("span",{className:"codex-activity-label",children:[n(Y,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(B,{expanded:d})]}),n("div",{className:v("codex-activity-group-grid",d&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:m&&e.map((C)=>n(oe,{block:C},L(C)))})})})]})}function X({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(je,{blocks:e,defaultExpanded:t})}function Ut({blocks:e,defaultExpanded:t}){if(!e.some(st))return n(X,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&st(i[0])===st(o))i.push(o);else a.push([o])}return n(R,{children:a.map((o)=>st(o[0])?n(gs,{blocks:o.filter(st)},L(o[0])):n(X,{blocks:o,defaultExpanded:t},L(o[0])))})}
7
+ export{ps,Ut};
@@ -1,2 +1,2 @@
1
- import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Lo(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Dr(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Lo(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
- export{Lo,Dr};
1
+ import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function io(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function xi(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...io(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
+ export{io,xi};
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-kqvgmkvr.js";import{q,K,W,Z}from"./chunk-nhkm2gr7.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function we({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(K,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(q,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
- export{we};
1
+ import{d}from"./chunk-3w6dv0nx.js";import{q,K,W,Z}from"./chunk-p2tm6tv8.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function Se({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(K,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(q,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
+ export{Se};
@@ -1,2 +1,2 @@
1
- import{E}from"./chunk-44r55va6.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as L,DialogFooter as w,DialogHeader as P,DialogTitle as H}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function oa({host:e,client:t,children:i}){let[r,l]=f(null);E(r!==null);let{t:u}=e;return o(S,{value:e,children:o(g,{value:t,children:d(C,{value:l,children:[i,o(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(P,{children:[o(H,{children:u("sessionList.deleteTitle")}),o(L,{children:u("sessionList.deleteDescription")})]}),d(w,{children:[o(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function yi(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function nn(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=a();return x((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
2
- export{oa,s,yi,a,nn,n,h};
1
+ import{L}from"./chunk-f4h84pav.js";import{createContext as c,useContext as p,useState as f,useSyncExternalStore as x}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as y,DialogContent as D,DialogDescription as w,DialogFooter as P,DialogHeader as H,DialogTitle as R}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as o,jsxs as d}from"react/jsx-runtime";var S=c(null),g=c(null),C=c(null);function ka({host:e,client:t,children:i}){let[r,l]=f(null);L(r!==null);let{t:u}=e;return o(S,{value:e,children:o(g,{value:t,children:d(C,{value:l,children:[i,o(y,{open:r!==null,onOpenChange:(v)=>!v&&l(null),children:d(D,{children:[d(H,{children:[o(R,{children:u("sessionList.deleteTitle")}),o(w,{children:u("sessionList.deleteDescription")})]}),d(P,{children:[o(m,{variant:"outline",onClick:()=>l(null),children:u("sessionList.cancel")}),o(m,{onClick:()=>{if(r)h(e,t.delete(r.sessionId));l(null)},children:u("sessionList.delete")})]})]})})]})})})}function s(){let e=p(S);if(e===null)throw Error("Session list host is missing");return e}function Br(){return p(S)}function a(){let e=p(g);if(e===null)throw Error("Session list client is missing");return e}function $n(){let e=p(C);if(e===null)throw Error("Session list provider is missing");return e}function n(e){let t=a();return x((i)=>t.store.subscribe(i),()=>e(t.store.getState()),()=>e(t.store.getState()))}function h(e,t){return t.then(()=>{},(i)=>{if(e.reportError)e.reportError(i);else console.error(i)})}
2
+ export{ka,s,Br,a,$n,n,h};