@alwith/module-chat 0.6.17 → 0.6.18

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 (552) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/application-client.d.ts +30 -0
  3. package/dist/agent/application-client.js +1 -0
  4. package/dist/agent/client.d.ts +125 -0
  5. package/dist/agent/client.js +1 -0
  6. package/dist/agent/custom-model-effort.d.ts +4 -0
  7. package/dist/agent/custom-model-effort.js +1 -0
  8. package/dist/agent/fork-title.d.ts +1 -0
  9. package/dist/agent/fork-title.js +1 -0
  10. package/dist/agent/image-request.d.ts +6 -0
  11. package/dist/agent/image-request.js +1 -0
  12. package/dist/agent/image-tools.d.ts +9 -0
  13. package/dist/agent/image-tools.js +1 -0
  14. package/dist/agent/input-config.d.ts +17 -0
  15. package/dist/agent/input-config.js +1 -0
  16. package/dist/agent/input-modes/chat.d.ts +10 -0
  17. package/dist/agent/input-modes/chat.js +1 -0
  18. package/dist/agent/input-modes/execution-meta.d.ts +1 -0
  19. package/dist/agent/input-modes/execution-meta.js +1 -0
  20. package/dist/agent/input-modes/image-context.d.ts +1 -0
  21. package/dist/agent/input-modes/image-context.js +1 -0
  22. package/dist/agent/input-modes/image.d.ts +14 -0
  23. package/dist/agent/input-modes/image.js +1 -0
  24. package/dist/agent/input-modes/index.d.ts +46 -0
  25. package/dist/agent/input-modes/index.js +1 -0
  26. package/dist/agent/project-path.d.ts +2 -0
  27. package/dist/agent/project-path.js +1 -0
  28. package/dist/agent/request-error.d.ts +3 -0
  29. package/dist/agent/request-error.js +1 -0
  30. package/dist/agent/session-list-refresh.d.ts +2 -0
  31. package/dist/agent/session-list-refresh.js +1 -0
  32. package/dist/app-reference.js +1 -1
  33. package/dist/application-tools.d.ts +1 -1
  34. package/dist/application-tools.js +1 -1
  35. package/dist/approval/choice-elicitation-form.js +1 -1
  36. package/dist/approval/choice-schema.js +1 -1
  37. package/dist/approval/permission-options.js +1 -1
  38. package/dist/approval/permission-view.js +1 -1
  39. package/dist/approval/schema-elicitation-form.js +1 -1
  40. package/dist/approval/url-elicitation-card.js +1 -1
  41. package/dist/{chunk-zq18ffn0.js → chunk-04c5k3qr.js} +2 -2
  42. package/dist/chunk-04frqm59.js +2 -0
  43. package/dist/chunk-0rnh8mhs.js +2 -0
  44. package/dist/chunk-0rte5dh6.js +2 -0
  45. package/dist/{chunk-11cbk1je.js → chunk-16db8fh2.js} +2 -2
  46. package/dist/chunk-1a56svgj.js +2 -0
  47. package/dist/{chunk-2ss8m0ja.js → chunk-1gv49jt9.js} +4 -4
  48. package/dist/chunk-1hmt6w4w.js +2 -0
  49. package/dist/chunk-1qjhvkg0.js +2 -0
  50. package/dist/{chunk-4qghztvg.js → chunk-1r4y3pfg.js} +2 -2
  51. package/dist/{chunk-11z072sz.js → chunk-1vtvcar6.js} +2 -2
  52. package/dist/{chunk-veb90k24.js → chunk-1ycyexae.js} +2 -2
  53. package/dist/{chunk-bnpwhf5c.js → chunk-23r426sm.js} +2 -2
  54. package/dist/{chunk-97tgc9ym.js → chunk-26w51q10.js} +2 -2
  55. package/dist/chunk-29s4mnfw.js +2 -0
  56. package/dist/{chunk-y1fpm5r2.js → chunk-2a4pq98d.js} +2 -2
  57. package/dist/chunk-2c2a1wvg.js +2 -0
  58. package/dist/{chunk-pvd09dx5.js → chunk-2cfhvb3k.js} +2 -2
  59. package/dist/{chunk-9xhw5zmq.js → chunk-2dm51ksz.js} +2 -2
  60. package/dist/{chunk-x0h0g1ma.js → chunk-2easwd1n.js} +2 -2
  61. package/dist/chunk-2ee48v0d.js +3 -0
  62. package/dist/{chunk-0yqb54zg.js → chunk-2nb1475h.js} +2 -2
  63. package/dist/{chunk-qtft8hnb.js → chunk-2zy75522.js} +2 -2
  64. package/dist/{chunk-t96rf4pg.js → chunk-38bpmgjd.js} +2 -2
  65. package/dist/chunk-38hvm5ca.js +2 -0
  66. package/dist/{chunk-9eme3n5c.js → chunk-3a3ecayr.js} +2 -2
  67. package/dist/{chunk-tz8wmvs9.js → chunk-3chhwwwy.js} +2 -2
  68. package/dist/chunk-3g9qb7vq.js +2 -0
  69. package/dist/chunk-3gnn1v68.js +2 -0
  70. package/dist/{chunk-sct2h2dm.js → chunk-3hjcpcnv.js} +2 -2
  71. package/dist/{chunk-ehmdmfs5.js → chunk-3rmwcar7.js} +2 -2
  72. package/dist/chunk-41yz7txv.js +2 -0
  73. package/dist/{chunk-hqykt9hr.js → chunk-4p0zk3mj.js} +2 -2
  74. package/dist/{chunk-620q6hmz.js → chunk-56rx2rmj.js} +2 -2
  75. package/dist/{chunk-9072bnjm.js → chunk-5aqqqsa3.js} +2 -2
  76. package/dist/chunk-5bmxngnx.js +2 -0
  77. package/dist/chunk-5hk3k14h.js +2 -0
  78. package/dist/{chunk-7919s3et.js → chunk-5s85tvas.js} +2 -2
  79. package/dist/chunk-61awcdaq.js +7 -0
  80. package/dist/{chunk-4gq7ye1a.js → chunk-62qtrk0p.js} +2 -2
  81. package/dist/chunk-6c18ag8t.js +2 -0
  82. package/dist/chunk-6dnb0t84.js +2 -0
  83. package/dist/chunk-6ehhap9k.js +2 -0
  84. package/dist/{chunk-5ymq8y72.js → chunk-6my4ybpw.js} +3 -3
  85. package/dist/chunk-6tj5e7fc.js +2 -0
  86. package/dist/chunk-6w5gfh01.js +2 -0
  87. package/dist/chunk-6wkcqhkk.js +2 -0
  88. package/dist/{chunk-8weq6t3q.js → chunk-6xap6hvz.js} +2 -2
  89. package/dist/{chunk-hn6f6yrp.js → chunk-78vckhxt.js} +2 -2
  90. package/dist/chunk-7ac4g54f.js +3 -0
  91. package/dist/chunk-7jk8s061.js +2 -0
  92. package/dist/chunk-7sp1yqfg.js +2 -0
  93. package/dist/chunk-814h2ja2.js +3 -0
  94. package/dist/chunk-81jejgvs.js +2 -0
  95. package/dist/{chunk-7cv512vy.js → chunk-85tzkdsj.js} +2 -2
  96. package/dist/{chunk-5ygdb72w.js → chunk-86821qec.js} +2 -2
  97. package/dist/{chunk-vextf7ba.js → chunk-86r89vrt.js} +2 -2
  98. package/dist/{chunk-aaqk0jrt.js → chunk-8hygfx41.js} +2 -2
  99. package/dist/{chunk-3yq0a0f1.js → chunk-8kd74ng1.js} +2 -2
  100. package/dist/chunk-8ngg5vs4.js +4 -0
  101. package/dist/{chunk-4hz2ax5w.js → chunk-8q9hq3mg.js} +2 -2
  102. package/dist/{chunk-82xjggwn.js → chunk-8v53bkyr.js} +2 -2
  103. package/dist/{chunk-m2x1s408.js → chunk-8y60kexq.js} +2 -2
  104. package/dist/{chunk-5wsyenq9.js → chunk-8y706gz3.js} +2 -2
  105. package/dist/{chunk-dcevaazr.js → chunk-933h9gnv.js} +2 -2
  106. package/dist/{chunk-bsra0akd.js → chunk-9q6hz47j.js} +2 -2
  107. package/dist/chunk-a71j2n86.js +2 -0
  108. package/dist/chunk-abgdqy92.js +2 -0
  109. package/dist/{chunk-adc8e01w.js → chunk-ase4ejxz.js} +2 -2
  110. package/dist/{chunk-gbc31gbf.js → chunk-at75m9hq.js} +2 -2
  111. package/dist/chunk-ayademz2.js +2 -0
  112. package/dist/{chunk-x6f51rt2.js → chunk-ayhxrzsq.js} +2 -2
  113. package/dist/chunk-b42vv8f2.js +2 -0
  114. package/dist/{chunk-2pahy4hs.js → chunk-b4kh5nns.js} +2 -2
  115. package/dist/{chunk-trh02gwn.js → chunk-bane0xc8.js} +2 -2
  116. package/dist/{chunk-ha5xrc0a.js → chunk-bej9z041.js} +2 -2
  117. package/dist/chunk-bfwft1b8.js +2 -0
  118. package/dist/chunk-bv14x0e8.js +6 -0
  119. package/dist/chunk-bydxp3zj.js +7 -0
  120. package/dist/chunk-c0mpr4dh.js +2 -0
  121. package/dist/{chunk-y7n8m9st.js → chunk-c1pvvk0x.js} +2 -2
  122. package/dist/chunk-c8wdf20g.js +2 -0
  123. package/dist/chunk-ckjq6690.js +4 -0
  124. package/dist/{chunk-4dabfz24.js → chunk-csfqkzmr.js} +3 -3
  125. package/dist/{chunk-segftqt4.js → chunk-cvx7r35k.js} +2 -2
  126. package/dist/chunk-d2m4xmt4.js +2 -0
  127. package/dist/{chunk-vkc8ssbv.js → chunk-d8f6avcz.js} +2 -2
  128. package/dist/{chunk-wv127h6d.js → chunk-df9aqj1m.js} +2 -2
  129. package/dist/chunk-djd3sjp9.js +2 -0
  130. package/dist/{chunk-3174p320.js → chunk-dtgbgwby.js} +2 -2
  131. package/dist/{chunk-00z352ph.js → chunk-dxsjz3re.js} +2 -2
  132. package/dist/{chunk-qnbr2cmg.js → chunk-e04g26qm.js} +2 -2
  133. package/dist/chunk-e2qjbqq2.js +2 -0
  134. package/dist/{chunk-3karja82.js → chunk-e7ndpy02.js} +2 -2
  135. package/dist/{chunk-tjfjvzv5.js → chunk-easm0z49.js} +2 -2
  136. package/dist/chunk-ecaedwda.js +2 -0
  137. package/dist/{chunk-9hmqa3cs.js → chunk-ecdjjnbb.js} +2 -2
  138. package/dist/chunk-een4e2tr.js +2 -0
  139. package/dist/chunk-ehpaw624.js +4 -0
  140. package/dist/chunk-evygj5ka.js +2 -0
  141. package/dist/{chunk-netp71kb.js → chunk-f4h84pav.js} +2 -2
  142. package/dist/{chunk-05eg5p11.js → chunk-f6zpqrg3.js} +2 -2
  143. package/dist/{chunk-1e7gk302.js → chunk-f73x23f9.js} +2 -2
  144. package/dist/chunk-f7m5zdkp.js +2 -0
  145. package/dist/chunk-f89s462k.js +3 -0
  146. package/dist/{chunk-7nehhgej.js → chunk-ffs5nkt0.js} +2 -2
  147. package/dist/chunk-fhjk81r9.js +2 -0
  148. package/dist/{chunk-3h3cmjh2.js → chunk-g61xf0ma.js} +2 -2
  149. package/dist/{chunk-2ptyqcf3.js → chunk-g7cc7gdn.js} +2 -2
  150. package/dist/chunk-g8w06bdx.js +2 -0
  151. package/dist/{chunk-fvz27k62.js → chunk-gawrkkbf.js} +2 -2
  152. package/dist/{chunk-41v0g6sw.js → chunk-gdavg2hq.js} +2 -2
  153. package/dist/{chunk-gxjg94y5.js → chunk-gea1q14z.js} +2 -2
  154. package/dist/chunk-ggddhx5x.js +2 -0
  155. package/dist/chunk-gnctm097.js +2 -0
  156. package/dist/{chunk-kcra1mgf.js → chunk-gvqvw7ms.js} +2 -2
  157. package/dist/{chunk-twx75z08.js → chunk-gy4h86mw.js} +2 -2
  158. package/dist/chunk-gyw21vnb.js +2 -0
  159. package/dist/{chunk-ex20n22v.js → chunk-heqa4swe.js} +2 -2
  160. package/dist/{chunk-b9q9d2jh.js → chunk-hygvdjq6.js} +3 -3
  161. package/dist/{chunk-c05dxz9x.js → chunk-hzhcajx1.js} +2 -2
  162. package/dist/{chunk-vqkwvrxc.js → chunk-jca8s47n.js} +2 -2
  163. package/dist/{chunk-fzze5xcw.js → chunk-jg4c3zg4.js} +2 -2
  164. package/dist/{chunk-hwvr7b0j.js → chunk-jm6y0edw.js} +2 -2
  165. package/dist/chunk-jq6qs3s6.js +2 -0
  166. package/dist/{chunk-qdgsg6v4.js → chunk-k4xsxxy7.js} +2 -2
  167. package/dist/chunk-k99r1r38.js +2 -0
  168. package/dist/{chunk-64wzvf7k.js → chunk-kh3af9mq.js} +2 -2
  169. package/dist/{chunk-k86843av.js → chunk-kj3a1k2q.js} +2 -2
  170. package/dist/chunk-kj3t4mqf.js +2 -0
  171. package/dist/{chunk-8djjctdj.js → chunk-kk9dbwd1.js} +2 -2
  172. package/dist/chunk-kv1w4jx4.js +2 -0
  173. package/dist/chunk-kztrgv9y.js +2 -0
  174. package/dist/{chunk-6es8tgxc.js → chunk-m8pkmbtf.js} +2 -2
  175. package/dist/{chunk-tkbs5ev1.js → chunk-m944rgn9.js} +2 -2
  176. package/dist/{chunk-9pcx42v8.js → chunk-mg7kraha.js} +2 -2
  177. package/dist/chunk-mhv75thj.js +0 -0
  178. package/dist/chunk-mqpkm974.js +2 -0
  179. package/dist/chunk-mr2wcd24.js +2 -0
  180. package/dist/{chunk-nszq1xrj.js → chunk-ms0h8x63.js} +2 -2
  181. package/dist/{chunk-a1k3ffay.js → chunk-n0q8e6sq.js} +2 -2
  182. package/dist/{chunk-fd72zzqm.js → chunk-n3sm0834.js} +3 -3
  183. package/dist/chunk-n6dqwdg5.js +2 -0
  184. package/dist/{chunk-p0d6rr6q.js → chunk-n8v6cdq3.js} +2 -2
  185. package/dist/chunk-nh56sb8e.js +4 -0
  186. package/dist/{chunk-twbeapwa.js → chunk-nmd5x501.js} +2 -2
  187. package/dist/chunk-npvcy4tw.js +2 -0
  188. package/dist/{chunk-j6r44m9g.js → chunk-nrzkzvr0.js} +2 -2
  189. package/dist/{chunk-ct0xqakr.js → chunk-p14j9ckg.js} +2 -2
  190. package/dist/chunk-p2tm6tv8.js +1 -0
  191. package/dist/chunk-p781sb6h.js +2 -0
  192. package/dist/chunk-pdmayjan.js +2 -0
  193. package/dist/chunk-pk931bpm.js +2 -0
  194. package/dist/{chunk-1xaskqdj.js → chunk-pxv38ttf.js} +2 -2
  195. package/dist/{chunk-yaxsff9s.js → chunk-q01vmp9m.js} +2 -2
  196. package/dist/{chunk-wyndwb68.js → chunk-q46z21zs.js} +2 -2
  197. package/dist/{chunk-qwtmwj5m.js → chunk-q5qqhqw4.js} +2 -2
  198. package/dist/chunk-q9mh8x4r.js +2 -0
  199. package/dist/chunk-q9y0wjwp.js +2 -0
  200. package/dist/{chunk-gk0tq3n9.js → chunk-qdcznn2t.js} +2 -2
  201. package/dist/chunk-qejm75d7.js +2 -0
  202. package/dist/{chunk-d924by6g.js → chunk-qk1yqepm.js} +2 -2
  203. package/dist/chunk-r6c9r5yy.js +2 -0
  204. package/dist/chunk-r6ns1457.js +2 -0
  205. package/dist/chunk-r8expjyy.js +4 -0
  206. package/dist/{chunk-mgsxsaj1.js → chunk-r8pm74zf.js} +2 -2
  207. package/dist/{chunk-f2jc13bq.js → chunk-rb4p3h5b.js} +2 -2
  208. package/dist/{chunk-j5njgy7p.js → chunk-rh2yx0xq.js} +2 -2
  209. package/dist/{chunk-n13y99dj.js → chunk-rkejggyx.js} +2 -2
  210. package/dist/{chunk-t94rfs41.js → chunk-rr9kc3n8.js} +2 -2
  211. package/dist/{chunk-q2z9w661.js → chunk-rtbpfasb.js} +2 -2
  212. package/dist/chunk-rx84h0c2.js +2 -0
  213. package/dist/chunk-s2706gae.js +2 -0
  214. package/dist/chunk-s6b28p84.js +2 -0
  215. package/dist/{chunk-qm1z1zcw.js → chunk-s6y31dcb.js} +2 -2
  216. package/dist/{chunk-wdacgfwp.js → chunk-s88eyv24.js} +2 -2
  217. package/dist/{chunk-ev9tkjgy.js → chunk-s8djv2dy.js} +3 -3
  218. package/dist/chunk-sgbn37kz.js +2 -0
  219. package/dist/{chunk-vypkwd0x.js → chunk-swt6dntp.js} +2 -2
  220. package/dist/{chunk-xtwpbvdx.js → chunk-t9xkg3pk.js} +2 -2
  221. package/dist/{chunk-xbp4r3n4.js → chunk-tc3t2sgb.js} +3 -3
  222. package/dist/chunk-tcs1a1hk.js +2 -0
  223. package/dist/{chunk-9z9jffth.js → chunk-tec9yhsm.js} +2 -2
  224. package/dist/{chunk-csgkwny6.js → chunk-tj4b0s68.js} +2 -2
  225. package/dist/{chunk-mhxgws9c.js → chunk-tzczzqde.js} +2 -2
  226. package/dist/chunk-v8x5atmn.js +2 -0
  227. package/dist/chunk-vbbndjfd.js +2 -0
  228. package/dist/{chunk-7h3f7s97.js → chunk-vgscp6dr.js} +5 -5
  229. package/dist/{chunk-bqbpded2.js → chunk-vhxr0c4c.js} +2 -2
  230. package/dist/chunk-vvkp0jqa.js +2 -0
  231. package/dist/{chunk-gee5kh24.js → chunk-w1yrsbw1.js} +2 -2
  232. package/dist/chunk-wf7kfk3p.js +2 -0
  233. package/dist/{chunk-h3xn4d48.js → chunk-wjd2hpnd.js} +2 -2
  234. package/dist/chunk-wkrnbk0p.js +2 -0
  235. package/dist/chunk-wnydsth6.js +2 -0
  236. package/dist/{chunk-rvmbvv03.js → chunk-wxh1m3gg.js} +2 -2
  237. package/dist/chunk-x1mzrhtd.js +2 -0
  238. package/dist/{chunk-sg681jnt.js → chunk-x20dy83s.js} +4 -4
  239. package/dist/{chunk-9rf3qecr.js → chunk-xykmskka.js} +2 -2
  240. package/dist/chunk-y6p8xspr.js +2 -0
  241. package/dist/{chunk-vnr9rqs6.js → chunk-y8fmawc6.js} +3 -3
  242. package/dist/chunk-yc4cdg65.js +2 -0
  243. package/dist/{chunk-7eqtvqrn.js → chunk-ykz0h1r0.js} +2 -2
  244. package/dist/chunk-ymgc4317.js +2 -0
  245. package/dist/{chunk-z38xf1rw.js → chunk-z1qcgb6b.js} +3 -3
  246. package/dist/{chunk-d1n4w7hn.js → chunk-z6e4ydvm.js} +2 -2
  247. package/dist/chunk-ztrfygh5.js +2 -0
  248. package/dist/client.d.ts +9 -30
  249. package/dist/client.js +1 -1
  250. package/dist/codex/activity-group.js +1 -1
  251. package/dist/codex/artifact-links.d.ts +9 -0
  252. package/dist/codex/artifact-links.js +1 -0
  253. package/dist/codex/assistant-message.js +1 -1
  254. package/dist/codex/async-question-card.js +1 -1
  255. package/dist/codex/disclosure-state.js +1 -1
  256. package/dist/codex/edited-files-card.js +1 -1
  257. package/dist/codex/image-view-activity.js +1 -1
  258. package/dist/codex/markdown-renderer.js +1 -1
  259. package/dist/codex/navigation-audio.js +1 -1
  260. package/dist/codex/navigation-preview.js +1 -1
  261. package/dist/codex/navigation-rail.js +1 -1
  262. package/dist/codex/patch-view.js +1 -1
  263. package/dist/codex/plan.js +1 -1
  264. package/dist/codex/timeline-virtualizer.js +1 -1
  265. package/dist/codex/turn-activity.js +1 -1
  266. package/dist/codex/user-message.js +1 -1
  267. package/dist/codex/virtualized-turn-list.js +1 -1
  268. package/dist/collections/collection-emoji.js +1 -1
  269. package/dist/collections/collection-menu.js +1 -1
  270. package/dist/collections/collection-panel.js +1 -1
  271. package/dist/collections/collections.js +1 -1
  272. package/dist/collections/host.js +1 -1
  273. package/dist/collections/locales.js +1 -1
  274. package/dist/collections/model.js +1 -1
  275. package/dist/collections/store.js +1 -1
  276. package/dist/composer/completion-filter.js +1 -1
  277. package/dist/composer/completion-menu.js +1 -1
  278. package/dist/composer/completion-trigger.js +1 -1
  279. package/dist/composer/effort-slider.js +1 -1
  280. package/dist/composer/inline-document.js +1 -1
  281. package/dist/composer/inline-dom.js +1 -1
  282. package/dist/composer/menu-radio.js +1 -1
  283. package/dist/composer/model-select.js +1 -1
  284. package/dist/composer/permission-mode-select.js +1 -1
  285. package/dist/composer/prompt-input-attachments.js +1 -1
  286. package/dist/composer/prompt-input-clipboard.js +1 -1
  287. package/dist/composer/prompt-input-context.js +1 -1
  288. package/dist/composer/prompt-input-inline.js +1 -1
  289. package/dist/composer/prompt-input-textarea.js +1 -1
  290. package/dist/composer/prompt-input.js +1 -1
  291. package/dist/conversation/action-card.js +1 -1
  292. package/dist/conversation/composer/app-mentions.js +1 -1
  293. package/dist/conversation/composer/apps-menu.js +1 -1
  294. package/dist/conversation/composer/composer-menu.js +1 -1
  295. package/dist/conversation/composer/composer.js +1 -1
  296. package/dist/conversation/composer/config-options.js +1 -1
  297. package/dist/conversation/composer/context.js +1 -1
  298. package/dist/conversation/composer/drafts.js +1 -1
  299. package/dist/conversation/composer/file-items.js +1 -1
  300. package/dist/conversation/composer/long-text.js +1 -1
  301. package/dist/conversation/composer/mention-chips.js +1 -1
  302. package/dist/conversation/composer/mention-uri.js +1 -1
  303. package/dist/conversation/composer/model-menu.js +1 -1
  304. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  305. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  306. package/dist/conversation/composer/prediction.js +1 -1
  307. package/dist/conversation/composer/prompt-history.js +1 -1
  308. package/dist/conversation/composer/slash-command-button.js +1 -1
  309. package/dist/conversation/composer/submit-button.js +1 -1
  310. package/dist/conversation/composer/usage-meter.js +1 -1
  311. package/dist/conversation/connection-notice.js +1 -1
  312. package/dist/conversation/context.js +1 -1
  313. package/dist/conversation/conversation-body.js +1 -1
  314. package/dist/conversation/conversation-search.js +1 -1
  315. package/dist/conversation/conversation-view.js +1 -1
  316. package/dist/conversation/conversation.js +1 -1
  317. package/dist/conversation/diff-modal.js +1 -1
  318. package/dist/conversation/draft-project-picker.js +1 -1
  319. package/dist/conversation/session-actions.js +1 -1
  320. package/dist/conversation/subagent-sessions.js +1 -1
  321. package/dist/conversation/subagent-tasks.js +1 -1
  322. package/dist/conversation/types.d.ts +1 -0
  323. package/dist/desktop/desktop-composer.d.ts +13 -0
  324. package/dist/desktop/desktop-composer.js +1 -0
  325. package/dist/desktop/desktop.d.ts +7 -0
  326. package/dist/desktop/desktop.js +1 -0
  327. package/dist/desktop/draft-model-select.d.ts +10 -0
  328. package/dist/desktop/draft-model-select.js +1 -0
  329. package/dist/desktop/load-image.d.ts +1 -0
  330. package/dist/desktop/load-image.js +1 -0
  331. package/dist/desktop/model-catalog.d.ts +10 -0
  332. package/dist/desktop/model-catalog.js +1 -0
  333. package/dist/desktop/model-recovery.d.ts +10 -0
  334. package/dist/desktop/model-recovery.js +1 -0
  335. package/dist/desktop/model-settings-action.d.ts +2 -0
  336. package/dist/desktop/model-settings-action.js +1 -0
  337. package/dist/desktop/native-file-drop.d.ts +8 -0
  338. package/dist/desktop/native-file-drop.js +1 -0
  339. package/dist/generated/commands.d.ts +103 -48
  340. package/dist/generated/commands.js +1 -1
  341. package/dist/image-lightbox.js +1 -1
  342. package/dist/image-preview-dialog.js +1 -1
  343. package/dist/image.js +1 -1
  344. package/dist/lib/app-reference.js +1 -1
  345. package/dist/lib/application-metadata.js +1 -1
  346. package/dist/lib/chat-path.d.ts +4 -0
  347. package/dist/lib/chat-path.js +1 -0
  348. package/dist/lib/code-highlighter.js +1 -1
  349. package/dist/lib/file-url.js +1 -1
  350. package/dist/lib/fuzzy.js +1 -1
  351. package/dist/lib/group-blocks.js +1 -1
  352. package/dist/lib/image-encode.js +1 -1
  353. package/dist/lib/limits.js +1 -1
  354. package/dist/lib/markdown-parser.js +1 -1
  355. package/dist/lib/markdown-rules.js +1 -1
  356. package/dist/lib/model-name.js +1 -1
  357. package/dist/lib/pointer-centered-zoom.js +1 -1
  358. package/dist/lib/prepare-prompt-files.js +1 -1
  359. package/dist/lib/reference-presentation.js +1 -1
  360. package/dist/lib/stream-style.js +1 -1
  361. package/dist/lib/streaming-markdown.js +1 -1
  362. package/dist/lib/tool-artifacts.js +1 -1
  363. package/dist/locales.d.ts +210 -0
  364. package/dist/locales.js +1 -1
  365. package/dist/mermaid/diagram.d.ts +3 -0
  366. package/dist/mermaid/diagram.js +1 -0
  367. package/dist/mermaid/export.d.ts +6 -0
  368. package/dist/mermaid/export.js +1 -0
  369. package/dist/mermaid/index.d.ts +1 -0
  370. package/dist/mermaid/index.js +1 -0
  371. package/dist/mermaid/preview.d.ts +11 -0
  372. package/dist/mermaid/preview.js +1 -0
  373. package/dist/oauth/claude-login.js +1 -1
  374. package/dist/oauth.js +1 -1
  375. package/dist/plugins/catalog-header.js +1 -1
  376. package/dist/plugins/catalog-skeleton.js +1 -1
  377. package/dist/plugins/host.js +1 -1
  378. package/dist/plugins/locales.js +1 -1
  379. package/dist/plugins/new-chat-directory.js +1 -1
  380. package/dist/plugins/pane.js +1 -1
  381. package/dist/plugins/panel-item.js +1 -1
  382. package/dist/plugins/plugin-detail-page.js +1 -1
  383. package/dist/plugins/plugin-icon.js +1 -1
  384. package/dist/plugins/plugin-icons.js +1 -1
  385. package/dist/plugins/plugins-page.js +1 -1
  386. package/dist/plugins/plugins.js +1 -1
  387. package/dist/plugins/read-skill-document.js +1 -1
  388. package/dist/plugins/skill-document.js +1 -1
  389. package/dist/plugins/skills-tab.js +1 -1
  390. package/dist/plugins/store.js +1 -1
  391. package/dist/plugins/toolbox-layout.js +1 -1
  392. package/dist/reference-projection.js +1 -1
  393. package/dist/search/chat-search.js +1 -1
  394. package/dist/search/codex-source-matches.js +1 -1
  395. package/dist/search/dom-matches.js +1 -1
  396. package/dist/search/find-bar.js +1 -1
  397. package/dist/search/literal-matches.js +1 -1
  398. package/dist/session-list/account-menu.js +1 -1
  399. package/dist/session-list/activity-list.js +1 -1
  400. package/dist/session-list/archived-sessions.js +1 -1
  401. package/dist/session-list/help-menu.js +1 -1
  402. package/dist/session-list/highlight.js +1 -1
  403. package/dist/session-list/host.js +1 -1
  404. package/dist/session-list/hover-info-card.js +1 -1
  405. package/dist/session-list/locales.js +1 -1
  406. package/dist/session-list/navigation-controls.js +1 -1
  407. package/dist/session-list/navigation-header.js +1 -1
  408. package/dist/session-list/navigation-store.js +1 -1
  409. package/dist/session-list/navigation-tabs.js +1 -1
  410. package/dist/session-list/navigation.js +1 -1
  411. package/dist/session-list/overflow-marquee.js +1 -1
  412. package/dist/session-list/platform.js +1 -1
  413. package/dist/session-list/row-stop-button.js +1 -1
  414. package/dist/session-list/session-groups.js +1 -1
  415. package/dist/session-list/session-info-card.js +1 -1
  416. package/dist/session-list/session-list.js +1 -1
  417. package/dist/session-list/session-row.js +1 -1
  418. package/dist/session-list/session-state-dot.js +1 -1
  419. package/dist/session-list/session-state-menu.js +1 -1
  420. package/dist/session-list/shortcut-hint.js +1 -1
  421. package/dist/session-list/shortcut.js +1 -1
  422. package/dist/session-list/sidebar-overlay.js +1 -1
  423. package/dist/session-list/trailing-swap.js +1 -1
  424. package/dist/session-list/use-activity-notification.js +1 -1
  425. package/dist/session-list/use-activity-preview.js +1 -1
  426. package/dist/session-list/use-cmd-held.js +1 -1
  427. package/dist/session-list/use-project-sessions.js +1 -1
  428. package/dist/session-list/virtual-session-rows.js +1 -1
  429. package/dist/session-timeline/activity-group.js +1 -1
  430. package/dist/session-timeline/activity-projection.js +1 -1
  431. package/dist/session-timeline/assistant-content.js +1 -1
  432. package/dist/session-timeline/assistant-image-references.js +1 -1
  433. package/dist/session-timeline/assistant-turn.js +1 -1
  434. package/dist/session-timeline/async-questions.js +1 -1
  435. package/dist/session-timeline/edited-files-card.js +1 -1
  436. package/dist/session-timeline/history-timeline.js +1 -1
  437. package/dist/session-timeline/host.d.ts +3 -0
  438. package/dist/session-timeline/host.js +1 -1
  439. package/dist/session-timeline/image-generation-progress.js +1 -1
  440. package/dist/session-timeline/navigation-rail.js +1 -1
  441. package/dist/session-timeline/plan.js +1 -1
  442. package/dist/session-timeline/question-reply.js +1 -1
  443. package/dist/session-timeline/resource-content.d.ts +1 -0
  444. package/dist/session-timeline/resource-content.js +1 -1
  445. package/dist/session-timeline/session-timeline.js +1 -1
  446. package/dist/session-timeline/timeline-registry.js +1 -1
  447. package/dist/session-timeline/turn-activity.js +1 -1
  448. package/dist/session-timeline/turn-error.js +1 -1
  449. package/dist/session-timeline/turn-retry.js +1 -1
  450. package/dist/session-timeline/turn-time.js +1 -1
  451. package/dist/session-timeline/turns.js +1 -1
  452. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  453. package/dist/session-timeline/user-message.js +1 -1
  454. package/dist/settings/codex-account-card.js +1 -1
  455. package/dist/settings/login-card.js +1 -1
  456. package/dist/settings/model-alias-settings.js +1 -1
  457. package/dist/settings/model-aliases.js +1 -1
  458. package/dist/settings/provider-logos.d.ts +4 -0
  459. package/dist/settings/provider-logos.js +1 -1
  460. package/dist/settings/provider-section.js +1 -1
  461. package/dist/settings/providers-port.js +1 -1
  462. package/dist/settings/providers.d.ts +1 -1
  463. package/dist/settings/providers.js +1 -1
  464. package/dist/settings/settings-bridge.js +1 -1
  465. package/dist/settings/settings.js +1 -1
  466. package/native/darwin-arm64/THIRD_PARTY_NOTICES.md +8 -8
  467. package/native/darwin-arm64/artifact.json +1 -1
  468. package/native/darwin-arm64/libalwith_native_chat.dylib +0 -0
  469. package/native/win32-x64/THIRD_PARTY_NOTICES.md +7 -7
  470. package/native/win32-x64/alwith_native_chat.dll +0 -0
  471. package/native/win32-x64/artifact.json +1 -1
  472. package/package.json +10 -4
  473. package/dist/chunk-0307kp7e.js +0 -2
  474. package/dist/chunk-04vnhbvc.js +0 -2
  475. package/dist/chunk-1renytb3.js +0 -3
  476. package/dist/chunk-2drcx544.js +0 -2
  477. package/dist/chunk-2sxxr6j8.js +0 -2
  478. package/dist/chunk-2tc9kn50.js +0 -2
  479. package/dist/chunk-3t5cksae.js +0 -2
  480. package/dist/chunk-4h07zyxp.js +0 -2
  481. package/dist/chunk-4jy404m1.js +0 -2
  482. package/dist/chunk-4n4gap45.js +0 -2
  483. package/dist/chunk-4zz6dnqa.js +0 -2
  484. package/dist/chunk-5m45z6qm.js +0 -4
  485. package/dist/chunk-6xds0dkq.js +0 -2
  486. package/dist/chunk-7hwg9r4y.js +0 -2
  487. package/dist/chunk-856bck34.js +0 -2
  488. package/dist/chunk-95n1cpnj.js +0 -2
  489. package/dist/chunk-9h77fcpn.js +0 -2
  490. package/dist/chunk-9rvf1am9.js +0 -2
  491. package/dist/chunk-f0kgxjp1.js +0 -2
  492. package/dist/chunk-fjk1g303.js +0 -2
  493. package/dist/chunk-fjseqvmx.js +0 -1
  494. package/dist/chunk-gez0k8zs.js +0 -7
  495. package/dist/chunk-gjfhvaxn.js +0 -2
  496. package/dist/chunk-h4xxyhpn.js +0 -4
  497. package/dist/chunk-hmet2d96.js +0 -2
  498. package/dist/chunk-hwmpcj3y.js +0 -2
  499. package/dist/chunk-j9snfndd.js +0 -2
  500. package/dist/chunk-jz6zecb7.js +0 -2
  501. package/dist/chunk-kp7qa98m.js +0 -2
  502. package/dist/chunk-ncwf6pjj.js +0 -3
  503. package/dist/chunk-nh9gk065.js +0 -2
  504. package/dist/chunk-nxj8m5bm.js +0 -2
  505. package/dist/chunk-pn5ghg65.js +0 -2
  506. package/dist/chunk-pwcw4zp2.js +0 -2
  507. package/dist/chunk-q3vvg0de.js +0 -2
  508. package/dist/chunk-qkw2nhsr.js +0 -4
  509. package/dist/chunk-rncx5gxz.js +0 -2
  510. package/dist/chunk-s5c2ha8t.js +0 -2
  511. package/dist/chunk-sp411z4y.js +0 -7
  512. package/dist/chunk-sqm2vsf5.js +0 -2
  513. package/dist/chunk-t4dsmqdq.js +0 -2
  514. package/dist/chunk-thhtbvj1.js +0 -2
  515. package/dist/chunk-tvbgjmtw.js +0 -3
  516. package/dist/chunk-v0y5fepf.js +0 -3
  517. package/dist/chunk-vctq22tq.js +0 -2
  518. package/dist/chunk-vepv6ktb.js +0 -2
  519. package/dist/chunk-vet6snkp.js +0 -4
  520. package/dist/chunk-vjmgh1q9.js +0 -2
  521. package/dist/chunk-vmg3evhm.js +0 -2
  522. package/dist/chunk-w22ch68s.js +0 -2
  523. package/dist/chunk-xmks1g9y.js +0 -2
  524. package/dist/chunk-xmpaqxer.js +0 -2
  525. package/dist/chunk-xqwbn2ph.js +0 -2
  526. package/dist/chunk-y6kxhkjm.js +0 -2
  527. package/dist/chunk-yy1pm240.js +0 -2
  528. package/dist/chunk-z7ehwkcq.js +0 -2
  529. package/dist/chunk-zah0npdy.js +0 -2
  530. package/dist/chunk-zah37d5q.js +0 -2
  531. package/dist/chunk-zcwsc0gx.js +0 -2
  532. /package/native/darwin-arm64/licenses/{bumpalo-3.20.3 → bumpalo-3.20.4}/LICENSE-APACHE +0 -0
  533. /package/native/darwin-arm64/licenses/{bumpalo-3.20.3 → bumpalo-3.20.4}/LICENSE-MIT +0 -0
  534. /package/native/darwin-arm64/licenses/{cc-1.11.1 → cc-1.11.2}/LICENSE-APACHE +0 -0
  535. /package/native/darwin-arm64/licenses/{cc-1.11.1 → cc-1.11.2}/LICENSE-MIT +0 -0
  536. /package/native/darwin-arm64/licenses/{mio-1.2.4 → mio-1.2.5}/LICENSE +0 -0
  537. /package/native/darwin-arm64/licenses/{nix-0.31.3 → nix-0.32.0}/LICENSE +0 -0
  538. /package/native/darwin-arm64/licenses/{opencode-ai-models-0.0.124 → opencode-ai-models-0.0.136}/LICENSE +0 -0
  539. /package/native/darwin-arm64/licenses/{rand-0.10.3 → rand-0.10.4}/LICENSE-APACHE +0 -0
  540. /package/native/darwin-arm64/licenses/{rand-0.10.3 → rand-0.10.4}/LICENSE-MIT +0 -0
  541. /package/native/darwin-arm64/licenses/{rustls-webpki-0.103.16 → rustls-webpki-0.103.17}/LICENSE +0 -0
  542. /package/native/darwin-arm64/licenses/{zip-9.5.1 → zip-9.6.0}/LICENSE +0 -0
  543. /package/native/win32-x64/licenses/{bumpalo-3.20.3 → bumpalo-3.20.4}/LICENSE-APACHE +0 -0
  544. /package/native/win32-x64/licenses/{bumpalo-3.20.3 → bumpalo-3.20.4}/LICENSE-MIT +0 -0
  545. /package/native/win32-x64/licenses/{cc-1.11.1 → cc-1.11.2}/LICENSE-APACHE +0 -0
  546. /package/native/win32-x64/licenses/{cc-1.11.1 → cc-1.11.2}/LICENSE-MIT +0 -0
  547. /package/native/win32-x64/licenses/{mio-1.2.4 → mio-1.2.5}/LICENSE +0 -0
  548. /package/native/win32-x64/licenses/{opencode-ai-models-0.0.124 → opencode-ai-models-0.0.136}/LICENSE +0 -0
  549. /package/native/win32-x64/licenses/{rand-0.10.3 → rand-0.10.4}/LICENSE-APACHE +0 -0
  550. /package/native/win32-x64/licenses/{rand-0.10.3 → rand-0.10.4}/LICENSE-MIT +0 -0
  551. /package/native/win32-x64/licenses/{rustls-webpki-0.103.16 → rustls-webpki-0.103.17}/LICENSE +0 -0
  552. /package/native/win32-x64/licenses/{zip-9.5.1 → zip-9.6.0}/LICENSE +0 -0
@@ -1,2 +1,2 @@
1
- import{T}from"./chunk-vctq22tq.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function ot({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=T();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
- export{ot};
1
+ import{N}from"./chunk-een4e2tr.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as x,PopoverContent as f,PopoverTrigger as b}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function ht({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=N();return n(x,{open:m,onOpenChange:r,children:[o(b,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(f,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
+ export{ht};
@@ -1,2 +1,2 @@
1
- import{L,wt}from"./chunk-pvd09dx5.js";import{BlocksIcon as l,BookOpenIcon as m,SquareSlashIcon as d}from"lucide-react";import{createContext as p,useContext as i}from"react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var yn=p({names:[]});function co({kind:n,name:r}){let{icon:c}=i(yn),s=n==="skill"?c?.(r):void 0;return f("span",{className:wt,children:[s?o("img",{src:s,alt:"","aria-hidden":"true",className:"size-3.5 shrink-0 self-center object-contain"}):o(n==="skill"?m:n==="command"?d:l,{className:"size-3.5 shrink-0 self-center","aria-hidden":"true"}),o("span",{children:r})]})}function xr({text:n,children:r}){let{names:c}=i(yn),s=L(n,c);if(!s.length)return r;let t=[],a=0;for(let e of s)t.push(n.slice(a,e.start)),t.push(o("span",{"data-skill-reference":e.kind==="skill"?e.name:void 0,"data-command-reference":e.kind==="command"?e.name:void 0,children:o(co,{kind:e.kind,name:e.name.slice(1)})},e.start)),a=e.end;return t.push(n.slice(a)),t}
2
- export{yn,co,xr};
1
+ import{U,Ht}from"./chunk-2cfhvb3k.js";import{BlocksIcon as l,BookOpenIcon as m,SquareSlashIcon as d}from"lucide-react";import{createContext as p,useContext as i}from"react";import{jsx as o,jsxs as f}from"react/jsx-runtime";var Wn=p({names:[]});function Go({kind:n,name:r}){let{icon:c}=i(Wn),s=n==="skill"?c?.(r):void 0;return f("span",{className:Ht,children:[s?o("img",{src:s,alt:"","aria-hidden":"true",className:"size-3.5 shrink-0 self-center object-contain"}):o(n==="skill"?m:n==="command"?d:l,{className:"size-3.5 shrink-0 self-center","aria-hidden":"true"}),o("span",{children:r})]})}function is({text:n,children:r}){let{names:c}=i(Wn),s=U(n,c);if(!s.length)return r;let t=[],a=0;for(let e of s)t.push(n.slice(a,e.start)),t.push(o("span",{"data-skill-reference":e.kind==="skill"?e.name:void 0,"data-command-reference":e.kind==="command"?e.name:void 0,children:o(Go,{kind:e.kind,name:e.name.slice(1)})},e.start)),a=e.end;return t.push(n.slice(a)),t}
2
+ export{Wn,Go,is};
@@ -1,2 +1,2 @@
1
- import{ce}from"./chunk-5ygdb72w.js";import{U,pi}from"./chunk-5wsyenq9.js";import{t}from"./chunk-xqwbn2ph.js";import{cn as d}from"cn";import{SquareIcon as b}from"lucide-react";import{Kbd as f}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as h,TooltipContent as I,TooltipTrigger as T}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as o,jsxs as n,Fragment as P}from"react/jsx-runtime";var v=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function zo({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=ce(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(P,{children:[a&&o(U,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(b,{className:"size-3 fill-current"})}),o("div",{className:d(l&&"cursor-not-allowed"),children:n(h,{children:[o(T,{render:o(pi,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(I,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(f,{className:"shrink-0",children:v?"↩":"Enter"})]})]})})]})}
2
- export{zo};
1
+ import{fe}from"./chunk-86821qec.js";import{z,_r}from"./chunk-8y706gz3.js";import{t}from"./chunk-pdmayjan.js";import{cn as d}from"cn";import{SquareIcon as b}from"lucide-react";import{Kbd as f}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as h,TooltipContent as I,TooltipTrigger as T}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as o,jsxs as n,Fragment as P}from"react/jsx-runtime";var v=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Ui({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=fe(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(P,{children:[a&&o(z,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(b,{className:"size-3 fill-current"})}),o("div",{className:d(l&&"cursor-not-allowed"),children:n(h,{children:[o(T,{render:o(_r,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(I,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(f,{className:"shrink-0",children:v?"↩":"Enter"})]})]})})]})}
2
+ export{Ui};
@@ -1,2 +1,2 @@
1
- function xi({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
- export{xi};
1
+ function Ft({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
+ export{Ft};
@@ -0,0 +1,2 @@
1
+ function me(n){if(typeof n!=="object"||n===null)return!1;let e=n,t=e.reason??e.message;return e.code===-32000&&typeof t==="string"&&/^Authentication required(?:$|:)/.test(t)}function Dn(n){if(typeof n!=="object"||n===null)return!1;let e=n,t=typeof e.data==="object"&&e.data!==null?e.data.details:e.data;return[e.message,e.reason,t].some((o)=>typeof o==="string"&&["The selected provider connection or model is unavailable","The selected model connection is unavailable","The selected ALwith account model is unavailable","The ALwith account changed"].some((a)=>o.includes(a)))}function oa(n,e){if(!(n instanceof Error))return n;let t=n.data,o=typeof t==="string"?t:typeof t==="object"&&t!==null?t.details:void 0;if(typeof o!=="string"||o.trim()==="")return n;return n.message=`${e}: ${o}`,n}
2
+ export{me,Dn,oa};
@@ -1,2 +1,2 @@
1
- import{Ti,$e,$n,Ni,Mi,Ai}from"./chunk-twbeapwa.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var Ii=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>Ti({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=$e({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return $n({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=$e({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=Ai({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=$e({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Ni({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=Mi({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=$e({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:$n({anchorKey:e,layout:i,previousRange:M}))??$e({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
2
- export{Ii};
1
+ import{bs,at,Qo,Cs,ws,ks}from"./chunk-nmd5x501.js";import{forwardRef as ye,useCallback as K,useEffect as ge,useImperativeHandle as ve,useLayoutEffect as w,useMemo as ne,useRef as s,useState as F}from"react";import{jsx as R,jsxs as re}from"react/jsx-runtime";var pe=12,X=2,V=800,he=new Map;function Re({turnKey:q,heightPx:x,placeholder:W=!1,deferUntilReady:n=!1,observe:b,onReady:L,children:z}){let h=s(null),[H,_]=F(!1),U=K((m)=>{h.current=m,b(q,m)},[b,q]);return w(()=>{let m=h.current;if(m===null)throw Error("Codex turn element is missing");let T=()=>{L(m),_(!0)};if(m.querySelector("[data-markdown-pending]")===null){T();return}let d=new MutationObserver(()=>{if(m.querySelector("[data-markdown-pending]")!==null)return;d.disconnect(),T()});return d.observe(m,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-markdown-pending"]}),()=>d.disconnect()},[L]),re("div",{style:H?void 0:{position:"relative",height:x,overflow:"hidden"},children:[R("div",{ref:U,className:"[&_[data-virtualized-turn-content]]:[content-visibility:visible]","data-turn-key":q,"aria-busy":!H||void 0,style:!H&&!W&&n?{visibility:"hidden"}:void 0,"data-turn-ready":H?"":void 0,children:z}),!H&&!W&&n&&R("div",{"aria-hidden":"true",className:"codex-turn-loading",children:re("div",{className:"codex-turn-loading-lines",children:[R("span",{}),R("span",{}),R("span",{})]})})]})}var xs=ye(function({entries:x,renderTurn:W,scrollElement:n,sessionKey:b,leadingContent:L,leadingInsetPx:z=0,preserveViewport:h=!1},H){let _=s(null),[U,m]=F(z),T=L!==void 0&&L!==null;w(()=>{let e=_.current;if(e===null)return;let t=()=>m(e.getBoundingClientRect().height);t();let o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[T]);let d=ne(()=>he.get(b),[b]),[j,J]=F(()=>d?.turnHeightsByKey??{}),i=ne(()=>bs({entries:x,gapPx:pe,measuredHeightsByKey:j,leadingInsetPx:T?U:z}),[x,j,T,U,z]),me=ne(()=>{let e=at({distanceFromBottomPx:d?.distanceFromBottomPx??0,layout:i,overscanCount:X,viewportHeightPx:V}),t=d?.renderedWindow;if(t===void 0||t===null)return e;return Qo({anchorKey:t.anchorKey,layout:i,previousRange:{startIndex:0,endIndex:Math.min(t.count,e.endIndex-e.startIndex)}})??e},[d,i]),[M,ie]=F(me),[y,oe]=F(V),[c,ue]=F(null),N=s(d?.distanceFromBottomPx??0),k=s(M),ae=s(i.turnKeys),l=s(j),S=s(i),se=s(i),P=s(new Map),v=s(null),C=s(null),E=s(null),D=s(new Map),Q=s(!1),ce=s(()=>{}),O=s(null),de=K(()=>{if(!h||n===null||v.current!==null||O.current!==null)return;let e=n.getBoundingClientRect();if(e.height<=0)return;let t=[...P.current].filter(([,r])=>r.hasAttribute("data-turn-ready")).map(([r,u])=>{let a=u.getBoundingClientRect(),g=S.current.turnIndexByKey.get(r),B=g===void 0?a.height:S.current.heightsPx[g];return{key:r,element:u,rect:a,bottom:a.top+B}}).filter(({rect:r,bottom:u})=>u>e.top&&r.top<e.bottom).toSorted((r,u)=>r.rect.top-u.rect.top),o=t.flatMap((r)=>[...r.element.querySelectorAll("[data-user-message-bubble], .codex-markdown-root > *")].filter((u)=>!u.closest('[aria-hidden="true"], [inert]')).map((u)=>({key:r.key,element:u,rect:u.getBoundingClientRect()})).filter(({rect:u})=>u.height>0&&u.top>=e.top&&u.top<e.bottom)).toSorted((r,u)=>r.rect.top-u.rect.top)[0]??t[0];if(o)O.current={key:o.key,element:o.element,top:o.rect.top-e.top,scrollTop:n.scrollTop}},[h,n]),Y=s(de);Y.current=de;let p=K((e,t)=>{let o=Math.min(e,i.totalHeightPx),r=at({distanceFromBottomPx:o,layout:i,overscanCount:X,viewportHeightPx:t}),u=k.current,a=u.startIndex<=r.startIndex&&u.endIndex>=r.endIndex?u:r;if(N.current=o,k.current=a,ae.current=i.turnKeys,oe(t),a!==u)ie(a)},[i]),A=K((e)=>{let t=Math.max(0,e.scrollHeight-i.totalHeightPx);return Math.max(0,e.scrollHeight-e.clientHeight-e.scrollTop-t)},[i.totalHeightPx]),fe=K((e)=>{let t=e.dataset.turnKey;if(t===void 0)throw Error("Codex measured turn is missing its key");let o=Math.max(1,e.getBoundingClientRect().height);if(l.current[t]===o)return;Y.current();let r={...l.current,[t]:o};l.current=r,J(r)},[]),Z=K(()=>{if(C.current!==null)return C.current;return C.current=new ResizeObserver((e)=>{for(let t of e){let o=t.target;if(!("turnReady"in o.dataset)&&o.querySelector("[data-markdown-pending]")!==null)continue;let r=o.dataset.turnKey;if(r===void 0)throw Error("Codex measured turn is missing its key");let u=Math.max(1,t.borderBoxSize[0]?.blockSize??t.contentRect.height);D.current.set(r,u)}if(E.current!==null||D.current.size===0)return;E.current=requestAnimationFrame(()=>{E.current=null;let t=[...D.current].filter(([r,u])=>l.current[r]!==u);if(D.current.clear(),t.length===0)return;Y.current();let o={...l.current,...Object.fromEntries(t)};l.current=o,J(o)})}),C.current},[]),xe=K((e,t)=>{let o=P.current.get(e);if(o!==void 0)Z().unobserve(o),P.current.delete(e);if(t===null)return;if(t.dataset.turnKey!==e)throw Error(`Codex turn key does not match its element: ${e}`);P.current.set(e,t),Z().observe(t)},[Z]);ge(()=>()=>{if(C.current?.disconnect(),E.current!==null)cancelAnimationFrame(E.current);D.current.clear(),C.current=null,P.current.clear()},[]),w(()=>{ce.current=()=>{if(n===null)return;let e=A(n);if(v.current!==null){N.current=e,oe(n.clientHeight||V);return}p(e,n.clientHeight||V)}},[A,n,p]),w(()=>{if(n===null)return;if(!Q.current){Q.current=!0;let o=d?.distanceFromBottomPx??0;n.scrollTo({behavior:"instant",top:Math.max(0,o>0?S.current.totalHeightPx-n.clientHeight-o:n.scrollHeight-n.clientHeight)})}let e=()=>ce.current();e(),n.addEventListener("scroll",e,{passive:!0});let t=new ResizeObserver(e);return t.observe(n),()=>{n.removeEventListener("scroll",e),t.disconnect()}},[d,n]),w(()=>{if(n===null||c===null)return;let e=P.current.get(c.turnKey);if(e?.querySelector("[data-markdown-pending]")!==null)return;let t=e.offsetHeight;if(t<=0)return;if(l.current[c.turnKey]!==t){let g={...l.current,[c.turnKey]:t};l.current=g,J(g);return}let o=c.getTargetElement(e)??e,r=e.getBoundingClientRect(),u=o.getBoundingClientRect(),a=ks({align:c.align,layout:i,targetHeightPx:u.height,targetOffsetPx:u.top-r.top,turnKey:c.turnKey,viewportHeightPx:n.clientHeight});if(a===null)throw Error(`Codex virtual turn is missing: ${c.turnKey}`);n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-a)}),p(a,n.clientHeight||V),queueMicrotask(()=>{if(v.current!==c)return;c.complete(),v.current=null,ue(null)})},[i,c,n,p]),w(()=>{let e=se.current;if(se.current=i,S.current=i,n===null||c!==null){O.current=null;return}let t=O.current;O.current=null;let o=t===null?void 0:n.contains(t.element)?t.element:P.current.get(t.key);if(h&&e!==i&&t!==null&&o!==void 0){let u=o.getBoundingClientRect().top-n.getBoundingClientRect().top,a=n.scrollTop-t.scrollTop;n.scrollTop+=u-t.top+a,p(A(n),n.clientHeight);return}let r=N.current;if(h&&e!==i&&Q.current)r=Math.max(0,e.totalHeightPx-n.clientHeight-n.scrollTop);if((r>24||h)&&e!==i){let u=A(n);if(u<=96&&!h){p(u,y);return}let a=at({distanceFromBottomPx:r,layout:e,overscanCount:0,viewportHeightPx:y}),g=e.turnKeys.slice(a.startIndex,a.endIndex).filter((f)=>i.turnIndexByKey.has(f)),B=g.find((f)=>l.current[f]!==void 0)??g[0];if(B!==void 0){let f=Cs({anchorKey:B,distanceFromBottomPx:r,nextLayout:i,previousLayout:e});if(f===null)throw Error(`Codex viewport anchor is missing: ${B}`);r=f,n.scrollTo({behavior:"instant",top:Math.max(0,i.totalHeightPx-n.clientHeight-r)})}}p(r,y)},[i,c,A,n,p,y,h]),w(()=>{k.current=M},[M]),ge(()=>()=>{v.current?.complete(),v.current=null;let e=k.current,o=S.current.turnKeys[e.startIndex];he.set(b,{distanceFromBottomPx:N.current,renderedWindow:o===void 0?null:{anchorKey:o,count:e.endIndex-e.startIndex},turnHeightsByKey:l.current})},[b]),ve(H,()=>({scrollToKey(e,t=(r)=>r,o={align:"center"}){v.current?.complete();let r=i.turnIndexByKey.get(e);if(r===void 0)throw Error(`Codex virtual turn is missing: ${e}`);let u=i.turnKeys[r],a=ws({layout:i,turnKey:e,viewportHeightPx:y});if(a===null)throw Error(`Codex virtual turn is missing: ${e}`);let g=at({distanceFromBottomPx:a,layout:i,overscanCount:X,viewportHeightPx:y});return k.current=g,ie(g),new Promise((B)=>{let f={align:o.align,complete:B,getTargetElement:t,turnKey:u};v.current=f,ue(f)})}}),[i,y]);let I=M,G=ae.current;if(!(G===i.turnKeys||G.length===i.turnKeys.length&&G.every((e,t)=>e===i.turnKeys[t]))){let e=G[M.startIndex];I=(e===void 0?null:Qo({anchorKey:e,layout:i,previousRange:M}))??at({distanceFromBottomPx:N.current,layout:i,overscanCount:X,viewportHeightPx:y})}let ee=x.length-1,le=x[ee],te=x.slice(I.startIndex,Math.min(I.endIndex,ee)).map((e,t)=>({entry:e,index:I.startIndex+t}));if(le!==void 0)te.push({entry:le,index:ee});return re("div",{"data-codex-timeline":!0,"data-codex-virtualized-pending-key":c?.turnKey,"data-codex-virtualized-range":`${I.startIndex}:${I.endIndex}`,"data-codex-virtualized-total-count":x.length,"data-codex-virtualized-turn-count":te.length,className:"relative shrink-0",style:{height:i.totalHeightPx},children:[T&&R("div",{ref:_,"data-codex-timeline-leading":!0,className:"absolute inset-x-0 top-0",children:L}),te.map(({entry:e,index:t})=>R("div",{className:"absolute inset-x-0",style:{top:i.topOffsetsPx[t]??0},children:R(Re,{turnKey:e.turnKey,heightPx:i.heightsPx[t],placeholder:e.placeholder,deferUntilReady:e.deferUntilReady,observe:xe,onReady:fe,children:W(e,t)})},e.turnKey))]})});
2
+ export{xs};
@@ -0,0 +1,2 @@
1
+ import{u}from"./chunk-kj3t4mqf.js";async function Qs(a){let e=await u.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
+ export{Qs};
@@ -1,2 +1,2 @@
1
- function L(i,t){let e=new Set(t.map((n)=>n.startsWith("$")?n:`/${n}`));return[...i.matchAll(/[$/][^\s]+/g)].flatMap((n)=>e.has(n[0])&&(n.index===0||/[\s\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i[n.index-1]))?[{start:n.index,end:n.index+n[0].length,name:n[0],kind:n[0].startsWith("$")?"skill":"command"}]:[])}function Ba(i,t){return L(i,t).filter((e)=>e.kind==="skill").map(({start:e,end:n,name:r})=>({start:e,end:n,name:r}))}var wt="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",br={command:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9"}]],skill:[["path",{d:"M12 5v16"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"}]],app:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1"}]]};
2
- export{L,Ba,wt,br};
1
+ function U(i,t){let e=new Set(t.map((n)=>n.startsWith("$")?n:`/${n}`));return[...i.matchAll(/[$/][^\s]+/g)].flatMap((n)=>e.has(n[0])&&(n.index===0||/[\s\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i[n.index-1]))?[{start:n.index,end:n.index+n[0].length,name:n[0],kind:n[0].startsWith("$")?"skill":"command"}]:[])}function za(i,t){return U(i,t).filter((e)=>e.kind==="skill").map(({start:e,end:n,name:r})=>({start:e,end:n,name:r}))}var Ht="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",rs={command:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9"}]],skill:[["path",{d:"M12 5v16"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"}]],app:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1"}]]};
2
+ export{U,za,Ht,rs};
@@ -1,2 +1,2 @@
1
- import{Oi}from"./chunk-gbc31gbf.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function Hi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Oi(a,r)}
2
- export{Hi};
1
+ import{Wr}from"./chunk-at75m9hq.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function bi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Wr(a,r)}
2
+ export{bi};
@@ -1,2 +1,2 @@
1
- import{useId as c}from"react";import{jsx as l,jsxs as t}from"react/jsx-runtime";function Eo(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Claude"}),l("path",{fill:"#D97757",fillRule:"nonzero",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})]})}function Ot(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"DeepSeek"}),l("path",{fill:"#4D6BFE",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]})}function Ut(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Grok"}),l("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})]})}function Bt(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"OpenRouter"}),l("path",{d:"M2 7h3.5c1.6 0 2.6.5 3.6 1.7l3 3.6c1 1.2 2 1.7 3.6 1.7H20"}),l("path",{d:"M2 17h3.5c1.6 0 2.6-.5 3.6-1.7l3-3.6c1-1.2 2-1.7 3.6-1.7H20"}),l("path",{d:"M17.5 4.5L21 7l-3.5 2.5M17.5 14.5L21 17l-3.5 2.5"})]})}var r="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z";function Gt(e){let o=c().replaceAll(":","");return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Qwen"}),l("path",{d:r,fill:`url(#${o})`,fillRule:"nonzero"}),l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[l("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),l("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]})}
2
- export{Eo,Ot,Ut,Bt,Gt};
1
+ import{useId as a}from"react";import{jsx as l,jsxs as t}from"react/jsx-runtime";function Yi(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Claude"}),l("path",{fill:"#D97757",fillRule:"nonzero",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})]})}function In(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"DeepSeek"}),l("path",{fill:"#4D6BFE",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]})}function Tn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",fillRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Grok"}),l("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})]})}function Mn(e){return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"OpenRouter"}),l("path",{d:"M2 7h3.5c1.6 0 2.6.5 3.6 1.7l3 3.6c1 1.2 2 1.7 3.6 1.7H20"}),l("path",{d:"M2 17h3.5c1.6 0 2.6-.5 3.6-1.7l3-3.6c1-1.2 2-1.7 3.6-1.7H20"}),l("path",{d:"M17.5 4.5L21 7l-3.5 2.5M17.5 14.5L21 17l-3.5 2.5"})]})}var r="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z";function Nn(e){let o=a().replaceAll(":","");return t("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",...e,children:[l("title",{children:"Qwen"}),l("path",{d:r,fill:`url(#${o})`,fillRule:"nonzero"}),l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[l("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:".84"}),l("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:".84"})]})})]})}function er(e){return l("svg",{viewBox:"-3 -3 30 30",fill:"currentColor",...e,children:l("path",{d:"M1.5 1.5h21v21h-7v-7h-7v-7h-7zM1.5 15.5h7v7h-7z"})})}function tr(e){return l("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:l("path",{d:"M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z"})})}function nr(e){let o=a();return t("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:[l("defs",{children:t("linearGradient",{id:o,x1:"0%",x2:"100.182%",y1:"50.057%",y2:"50.057%",children:[l("stop",{offset:"0%",stopColor:"#E2167E"}),l("stop",{offset:"100%",stopColor:"#FE603C"})]})}),l("path",{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z",fill:`url(#${o})`,fillRule:"nonzero"})]})}function or(e){return t("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",...e,children:[l("path",{d:"M19.44 10.153l-2.936 11.586a.215.215 0 00.214.261h5.87a.215.215 0 00.214-.261l-2.95-11.586a.214.214 0 00-.412 0zM3.28 12.778l-2.275 8.96A.214.214 0 001.22 22h4.532a.212.212 0 00.214-.165.214.214 0 000-.097l-2.276-8.96a.214.214 0 00-.41 0z",fill:"#00E5E5"}),l("path",{d:"M7.29 5.359L3.148 21.738a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.358a.214.214 0 00-.41 0z",fill:"#006EFF"}),l("path",{d:"M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.216.216 0 00.171-.078.214.214 0 00.044-.183L14.439.15z",fill:"#006EFF"}),l("path",{d:"M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.215.215 0 00.214-.264L10.688 7.741a.214.214 0 00-.41 0z",fill:"#00E5E5"})]})}
2
+ export{Yi,In,Tn,Mn,Nn,er,tr,nr,or};
@@ -0,0 +1,3 @@
1
+ import{m}from"./chunk-sgbn37kz.js";import{R,f}from"./chunk-6tj5e7fc.js";import{Jt}from"./chunk-hzhcajx1.js";import{We,d,Ze,ut,i}from"./chunk-0rte5dh6.js";import{q,K,le,W,Z,_e,en}from"./chunk-p2tm6tv8.js";import{Se}from"./chunk-p14j9ckg.js";import{pt}from"./chunk-8v53bkyr.js";import{k}from"./chunk-qk1yqepm.js";import{Xt,B}from"./chunk-nrzkzvr0.js";import{Q,Ie}from"./chunk-e04g26qm.js";import{Qt}from"./chunk-z6e4ydvm.js";import{Yt}from"./chunk-6w5gfh01.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as _,PuzzleIcon as oe,RefreshCwIcon as re,SearchIcon as ce,Trash2Icon as de,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as V,useMemo as G,useState as C}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ke,DropdownMenuContent as ye,DropdownMenuItem as be,DropdownMenuTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as U}from"@nyssance/shadcn/vega/components/ui/input";import{Label as we}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as M}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function E(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function Ce({plugin:t,marketplace:r}){let{t:u}=d(),p=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=u(p?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!p)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(N,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:p||a||c,"aria-label":o,title:c?u("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:p?e(M,{"aria-hidden":"true"}):e(_,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function De({plugin:t,marketplace:r,actions:u,onOpen:p}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(_e,{className:"toolbox-row relative",children:[e(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":E(t),onClick:()=>p({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(B,{name:t.name})})}),s(K,{className:"pointer-events-none relative min-w-0",children:[e(en,{className:"mb-0.5",children:E(t)}),e(le,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(le,{"data-toolbox-metadata":"",children:o})]}),e(q,{className:"relative w-8 shrink-0 justify-center",children:u})]})}function L(){return ut((t)=>t.connection==="ready"&&ee(t.agent))}var S=48;function Me({marketplace:t,plugins:r,onOpen:u}){let{t:p}=d(),a=i((n)=>n.removeMarketplace),[g,c]=C(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/S)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ke,{children:[e(Pe,{render:e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":p("plugins.pageActions")}),children:e(ie,{})}),e(ye,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(be,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(de,{className:"size-3.5"}),p("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*S,(o+1)*S).map((n)=>e(De,{onOpen:u,plugin:n,marketplace:t,actions:e(Ce,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>S&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(N,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:p("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/S)]}),e(N,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*S>=r.length,onClick:()=>c(o+1),children:p("plugins.nextPage")})]})]},t.name)}var Ee=ue(function({query:r,onOpen:u}){let{t:p}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=G(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,E(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),o=G(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:y,text:b})=>r===""?v.path!==null||n.has(y.id):b.includes(r)).map(({plugin:y})=>y)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(Me,{marketplace:n,plugins:v,onOpen:u},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:p("plugins.empty")})]})});function ze(){let{t}=d(),r=L(),u=i((h)=>h.addMarketplace),p=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=C(""),[o,n]=C(!1),[v,x]=C(!1),[y,b]=C(null),z=async()=>{let h=g.trim();if(!h||o)return;n(!0),b(null);try{await u({source:h}),c(""),x(!1)}catch(I){b(I instanceof Error?I.message:String(I))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void p(),children:[a?e(M,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(_,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),z()},children:[e(we,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(U,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(N,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(N,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(M,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Oe({onOpen:t,query:r}){let u=L(),p=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!u,g=pe(r.trim().toLowerCase());return e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[p.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(Se,{}):e(Ee,{query:g,onOpen:t})]})})}function Ls({cwd:t,active:r,extensions:u,onOpenCatalog:p}){let{t:a}=d(),g=Ze(),c=We(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,y]=C("plugins"),[b,z]=C({plugins:"",skills:""}),h=x==="skills"?b.skills:b.plugins,I=(l)=>z((D)=>({...D,[x]:l})),Y=ut((l)=>JSON.stringify([...new Set(l.sessionList.map((D)=>pt(D.cwd,l.projectContext)).filter((D)=>D!==null))].toSorted())),O=JSON.stringify([...new Set([pt(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),T=i((l)=>l.installed),H=a(x==="skills"?"plugins.skills.search":"plugins.search"),[P,j]=C(null),w=L();V(()=>{if(!r||!w)return;if(c.getState().loadedScope!==O)o(JSON.parse(O))},[r,w,o,O,c]),V(()=>{if(!w)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0}))},[w,o,g]);let A=(l)=>{p?.(),y("plugins"),j(l)},J=(l)=>{p?.(),y(l),j(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(Xt,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[u&&s(f,{className:`${m} h-8 gap-2 px-2`,active:u.active,onClick:u.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${m} h-8 gap-2 px-2`,active:!u?.active&&x===l&&P===null,onClick:()=>J(l),children:[l==="plugins"?e(oe,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(k,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(R,{children:!w||n&&T.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(M,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):T.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):T.map((l)=>s(f,{title:E(l.plugin),className:`${m} gap-2 px-2`,active:!u?.active&&P?.plugin.id===l.plugin.id,onClick:()=>A(l),children:[e(B,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:E(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:u?.active?u.content:s(X,{children:[P&&e(Qt,{entry:P,onBack:()=>J("plugins")},JSON.stringify([P.marketplace.name,P.marketplace.path,P.plugin.id,t])),s("div",{hidden:P!==null,className:P?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(Ie,{children:e(Jt,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(ce,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(U,{className:"h-9 rounded-full ps-9 pe-9","aria-label":H,value:h,onChange:(l)=>I(l.target.value),placeholder:H}),h&&e(N,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>I(""),children:e(me,{})})]}),e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!w||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(M,{}):e(re,{})}),x==="plugins"&&e(ze,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(N,{size:"sm",className:"h-9",variant:"outline",disabled:n||!w,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Oe,{query:b.plugins,onOpen:A})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Yt,{query:b.skills,ready:w,onOpenPlugin:A})})]})]})]})})]})}
3
+ export{Ls};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-xqwbn2ph.js";import{e}from"./chunk-pwcw4zp2.js";import{v,Q}from"./chunk-xmks1g9y.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=v(a.configOptions,"model");return t===void 0?void 0:Q(t)}function ze(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=v(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((y)=>y.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,h=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||h+k+g+w,R=h+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(h)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],N=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[N!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:N,children:N})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,y])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:y})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:ze(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var un=W(_);
2
- export{ze,un};
1
+ import{o}from"./chunk-pdmayjan.js";import{e}from"./chunk-abgdqy92.js";import{y,Y}from"./chunk-p781sb6h.js";import{hasAccount as D,isGroupedSelect as L}from"@nyssance/codex-acp-v2/client";import{cn as H}from"cn";import{memo as W,useEffect as T,useState as F}from"react";import{HoverCard as z,HoverCardContent as O,HoverCardTrigger as U}from"@nyssance/shadcn/vega/components/ui/hover-card";import{jsx as r,jsxs as u}from"react/jsx-runtime";var d=new Intl.NumberFormat("en-US",{maximumFractionDigits:0}),A=new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:1}),I=new Intl.NumberFormat("en-US",{maximumFractionDigits:1});function f(a){return typeof a==="number"&&!Number.isNaN(a)?Math.max(0,a):0}function V(a,t){let n=Math.min(100,a/t*100),p=n>=90?"text-destructive":n>=70?"text-foreground":"text-muted-foreground";return{pct:n,className:p}}function G(a){let t=y(a.configOptions,"model");return t===void 0?void 0:Y(t)}function et(a,t){let n=a.windowDurationMins;if(n===null)return t("usage.usage");if(n%1440===0)return t("usage.windowDays",{count:n/1440});return t("usage.windowHours",{count:Math.round(n/60)})}function P(a){let{client:t}=e(),n=o((s)=>a&&s.connection==="ready"&&D(s.agent)),[p,c]=F(null);return T(()=>{if(!n){c(null);return}let s=!0;t.readRateLimits().then((m)=>{if(s)c(m)},()=>{return});let l=t.onRateLimits((m)=>{if(s)c(m)});return()=>{s=!1,l()}},[n,t]),n?p:null}function _({session:a}){let{t}=e().host,n=y(a.configOptions,"model"),p=n!==void 0&&(L(n.options)?n.options.some((i)=>i.groupId==="chatgpt"&&i.options.some((v)=>v.value===n.currentValue)):!n.currentValue.startsWith("gateway:")&&n.options.some((i)=>i.value===n.currentValue)),c=P(p),{usage:s,lastTurnUsage:l}=a;if(s===null&&l===null)return null;let m=s&&s.size>0?V(s.used,s.size):null,x=7,b=2*Math.PI*x,h=f(l?.inputTokens),k=f(l?.outputTokens),g=f(l?.cachedReadTokens),w=f(l?.cachedWriteTokens),S=f(l?.totalTokens)||h+k+g+w,R=h+g,C=R>0?A.format(g/R):t("tokens.notAvailable"),M=[[t("tokens.input"),d.format(h)],[t("tokens.output"),d.format(k)],[t("tokens.cachedRead"),d.format(g)],[t("tokens.cachedWrite"),d.format(w)],[t("tokens.cacheHitRate"),C],[t("tokens.total"),d.format(S)]],N=G(a);return u(z,{children:[r(U,{delay:100,closeDelay:100,render:u("button",{type:"button",className:H("hover:text-foreground flex h-7 items-center gap-1.5 rounded-md px-1.5 text-xs tabular-nums",m?.className??"text-muted-foreground"),"aria-label":t("tokens.openDetails"),children:[u("svg",{viewBox:"0 0 18 18",className:"size-4","aria-hidden":"true",children:[r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeOpacity:"0.2",strokeWidth:"2"}),m!==null&&r("circle",{cx:"9",cy:"9",r:x,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:b*(1-m.pct/100),transform:"rotate(-90 9 9)"})]}),m!==null&&u("span",{children:[Math.round(m.pct),"%"]})]})}),u(O,{align:"end",side:"top",sideOffset:8,className:"w-56 p-0",children:[N!==void 0&&r("div",{className:"border-b px-3 py-2",children:r("p",{className:"text-foreground truncate text-xs font-semibold",title:N,children:N})}),u("div",{className:"flex flex-col gap-3 p-3",children:[l!==null&&u("div",{className:"flex flex-col gap-1.5",children:[r("p",{className:"text-xs font-medium",children:t("tokens.openDetails")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:M.map(([i,v])=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:i}),r("dd",{className:"text-end tabular-nums",children:v})]},i))})]}),s!==null&&s.size>0&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("tokens.context")}),r("p",{className:"text-muted-foreground text-xs tabular-nums",children:t("tokens.contextSummary",{used:d.format(s.used),limit:d.format(s.size),percent:I.format(s.used/s.size*100)})})]}),c!==null&&(c.primary!==null||c.secondary!==null)&&u("div",{className:"flex flex-col gap-1.5 border-t pt-2",children:[r("p",{className:"text-xs font-medium",children:t("usage.limits")}),r("dl",{className:"grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 text-xs",children:[c.primary,c.secondary].filter((i)=>i!==null).map((i)=>u("div",{className:"contents",children:[r("dt",{className:"text-muted-foreground",children:et(i,t)}),r("dd",{className:"text-end tabular-nums",children:t("usage.used",{percent:Math.round(Math.min(100,Math.max(0,i.usedPercent)))})})]},`${i.windowDurationMins??"window"}`))})]})]})]})]})}var fn=W(_);
2
+ export{et,fn};
@@ -1,2 +1,2 @@
1
- import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Ji(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function ns(){c()}function Yi(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function Xi(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Ca(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function os(e,n,t,i,o,a){if(a==="none")return;_(o,[Ca(e,n,t,i,a)])}function Ca(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Da(t,i);return wa(e,n)}function Da(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function wa(e,n){return y+Ha(e,n)}function is(e,n){return D(wa(e,n))}function Ha(e,n){if(n<=l)return Oa(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Oa(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function rs(){return r.context?.state}function as(e){return g(e).ready}
2
- export{Ji,ns,Yi,Xi,os,Ca,Da,wa,is,Ha,Oa,rs,as};
1
+ import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function zr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function il(){c()}function Vr(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function jr(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Sa(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function rl(e,n,t,i,o,a){if(a==="none")return;_(o,[Sa(e,n,t,i,a)])}function Sa(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ua(t,i);return _a(e,n)}function Ua(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function _a(e,n){return y+Ba(e,n)}function sl(e,n){return D(_a(e,n))}function Ba(e,n){if(n<=l)return Ga(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Ga(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function al(){return r.context?.state}function ll(e){return g(e).ready}
2
+ export{zr,il,Vr,jr,rl,Sa,Ua,_a,sl,Ba,Ga,al,ll};
@@ -1,2 +1,2 @@
1
- import{Bi}from"./chunk-b9q9d2jh.js";function Ri(t,o){if(Bi(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
- export{Ri};
1
+ import{ms}from"./chunk-hygvdjq6.js";function ls(t,o){if(ms(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
+ export{ls};
@@ -0,0 +1,2 @@
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{gi}from"./chunk-hn6f6yrp.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 mi(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 gi(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{mi};
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 uo(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{uo};
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};
@@ -0,0 +1,2 @@
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{A}from"./chunk-ev9tkjgy.js";import{codexMessageError as v,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Ua(t){return t.kind==="tool"&&t.name==="mcp_startup"}function E(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 lr(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 j(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(e),i=e._meta?.codex,d=A(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(A(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 cr(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)=>!Ua(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)=>_({...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&&K(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(io),items:a},M=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>j(x,c,b<M,a[b-1])),x})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function io(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function ue(t){return S(t.content)}function xt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function ro(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function dr(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 ur(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 pr(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(!ur(t,e[n-1],o))break;n--}return e[n]?.key}function mr(t,e,n){let o=n,s=n;while(o>0&&ur(t,e[o-1],e[o]))o--;while(s+1<e.length&&ur(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{Ua,lr,cr,io,ue,xt,ro,dr,ur,pr,mr};
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{o}from"./chunk-xqwbn2ph.js";import{pn,e,y}from"./chunk-pwcw4zp2.js";import{Yt}from"./chunk-h4xxyhpn.js";import{dn}from"./chunk-ha5xrc0a.js";import{Jt}from"./chunk-q3vvg0de.js";import{Wt,Zt}from"./chunk-v0y5fepf.js";import{Qt}from"./chunk-zq18ffn0.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function ca({host:t,client:c,...s}){let m=O(()=>t.openDiff?t:{...t,openDiff:Wt},[t]);return i(pn,{host:m,client:c,children:[r(I,{...s}),!t.openDiff&&r(Zt,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),u=()=>y(d,R.open(t.id,t.cwd)),x=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!x&&r(Jt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:u,children:n("conversation.reconnect")})})]})}),x?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(dn,{session:t,timeline:m}),r(Qt,{sessionId:t.id}),t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:u,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Yt,{session:t})]}),T]})}
2
- export{ca};
1
+ import{o}from"./chunk-pdmayjan.js";import{wn,e,x}from"./chunk-abgdqy92.js";import{Ne}from"./chunk-ehpaw624.js";import{Bt}from"./chunk-bej9z041.js";import{Gt}from"./chunk-04frqm59.js";import{zt,Vt}from"./chunk-7ac4g54f.js";import{jt}from"./chunk-04c5k3qr.js";import{LockIcon as H,UnplugIcon as k}from"lucide-react";import{useMemo as O,useRef as S}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as M,EmptyDescription as P,EmptyHeader as z,EmptyTitle as B}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as r,jsxs as i}from"react/jsx-runtime";function _s({host:t,client:c,...s}){let m=O(()=>t.openDiff?t:{...t,openDiff:zt},[t]);return i(wn,{host:m,client:c,children:[r(I,{...s}),!t.openDiff&&r(Vt,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=S(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:n}=d,f=o((a)=>a.connection==="ready"),v=o((a)=>a.historyPages[t.id]?.error),y=()=>x(d,R.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return i("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,i("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&r(Gt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&r("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:i(C,{children:[r(k,{}),r(h,{children:n("conversation.stopped")}),r(N,{children:r(w,{size:"sm",variant:"outline",onClick:y,children:n("conversation.reconnect")})})]})}),u?E??r(M,{className:"flex-1",children:i(z,{children:[r(B,{className:"text-[28px] font-normal",children:n("conversation.welcomeTitle")}),r(P,{children:n("conversation.welcomeDescription")})]})}):r(Bt,{session:t,timeline:m}),r(jt,{sessionId:t.id}),t.readOnly?r("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:i(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[i("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[r(H,{"aria-hidden":"true",className:"size-4 shrink-0"}),i("div",{className:"min-w-0 space-y-1",children:[r(h,{children:n("conversation.readOnlyTitle")}),r(N,{children:n("conversation.readOnlyDescription")}),v&&r("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),i("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[r(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:n(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??r(Ne,{session:t})]}),T]})}
2
+ export{_s};
@@ -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{s,n}from"./chunk-3t5cksae.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Nt(e,o){let a=s(),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 a.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)}},[a,e,c,f,r,o]),r?u:p??u}
2
- export{Nt};
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{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 me(){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 ao(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{me,ao};
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-pwcw4zp2.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 ha({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{ha};
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};
@@ -0,0 +1,2 @@
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};
@@ -0,0 +1,2 @@
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 $i(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{$i};
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};