@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,7 +0,0 @@
1
- import{p,E}from"./chunk-f0kgxjp1.js";import{Yn}from"./chunk-vkc8ssbv.js";import{J}from"./chunk-b9q9d2jh.js";import{_}from"./chunk-1xaskqdj.js";import{Ke,Gi}from"./chunk-vepv6ktb.js";import{de}from"./chunk-bqbpded2.js";import{cn as v}from"cn";import{BotIcon as me,CheckIcon as pe,CopyIcon as ge}from"lucide-react";import{Fragment as fe,memo as xe,useEffect as P,useRef as O,useState as S}from"react";import{jsx as n,jsxs as m,Fragment as D}from"react/jsx-runtime";function H(e,t){let[a,o]=S(()=>({key:e,mounted:t})),i=t||a.key===e&&a.mounted;if(a.key!==e||a.mounted!==i)o({key:e,mounted:i});return i}var G=new WeakMap,q=1;function L(e){if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return`${e.type}:${e.id}`;if(e.type==="thinking"&&e.id!==void 0)return`thinking:${e.id}`;let t=G.get(e);if(t!==void 0)return`${e.type}:${t}`;let a=q;return q+=1,G.set(e,a),`${e.type}:${a}`}function N(e){switch(e){case"pending":case"in_progress":return!0;case"completed":case"failed":case"cancelled":case"interrupted":return!1;default:throw Error(`Unknown ACP tool status: ${e}`)}}function V(e,t){let a=Math.max(0,Math.round(e/1000)),o=Math.floor(a/3600),i=Math.floor(a%3600/60),r=a%60;if(r>=60)i+=Math.floor(r/60),r%=60;if(i>=60)o+=Math.floor(i/60),i%=60;let l=Intl.DurationFormat;if(l)try{return new l(t,{style:"narrow"}).format({hours:o,minutes:i,seconds:o>0?0:r})}catch{}if(o>0)return i>0?`${o}h ${i}m`:`${o}h`;if(i>0)return r>0?`${i}m ${r}s`:`${i}m`;return`${r}s`}var Ce="M7.52925 3.7793C7.75652 3.55203 8.10803 3.52383 8.36616 3.69434L8.47065 3.7793L14.2207 9.5293C14.4804 9.789 14.4804 10.211 14.2207 10.4707L8.47065 16.2207C8.21095 16.4804 7.78895 16.4804 7.52925 16.2207C7.26955 15.961 7.26955 15.539 7.52925 15.2793L12.8085 10L7.52925 4.7207L7.44429 4.61621C7.27378 4.35808 7.30198 4.00657 7.52925 3.7793Z";function B({expanded:e,className:t}){return n("svg",{className:v("codex-activity-disclosure",e&&"codex-activity-disclosure-expanded",t),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:Ce})})}function ye(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.3965 5.01128C16.3963 4.93399 16.3489 4.87691 16.293 4.85406L16.2354 4.84332C13.9306 4.91764 12.5622 5.32101 10.665 6.34722V16.3716C11.3851 15.9994 12.0688 15.7115 12.7861 15.5015C13.8286 15.1965 14.9113 15.0633 16.2402 15.0435L16.2979 15.0308C16.353 15.0063 16.3965 14.9483 16.3965 14.8755V5.01128ZM3.54492 14.8765C3.54492 14.9725 3.62159 15.0422 3.70117 15.0435L4.19629 15.0562C5.94062 15.1247 7.26036 15.4201 8.65918 16.0484C8.05544 15.1706 7.14706 14.436 6.17871 14.1109V14.1099C5.56757 13.9045 5.16816 13.3314 5.16797 12.6988V4.98882C4.86679 4.93786 4.60268 4.8999 4.28223 4.87457L3.72754 4.84429C3.62093 4.84079 3.54505 4.92417 3.54492 5.01226V14.8765ZM17.7266 14.8755C17.7266 15.6314 17.1607 16.2751 16.4121 16.3628L16.2598 16.3736C15.0122 16.3922 14.0555 16.5159 13.1602 16.7779C12.2629 17.0404 11.3966 17.4508 10.3369 18.0738C10.129 18.1959 9.87099 18.1958 9.66309 18.0738C7.71455 16.9283 6.31974 16.4689 4.12988 16.3853L3.68164 16.3736C2.85966 16.3614 2.21484 15.6838 2.21484 14.8765V5.01226C2.21497 4.15391 2.93263 3.4871 3.77246 3.51519L4.39844 3.54937C4.67996 3.57191 4.92258 3.60421 5.16797 3.64214V2.51031C5.16797 1.44939 6.29018 0.645615 7.31055 1.15679L7.31152 1.15582C8.78675 1.89511 10.0656 3.33006 10.5352 4.91461C12.3595 3.98907 13.8688 3.58817 16.1924 3.51324L16.3506 3.51714C17.1285 3.5741 17.7264 4.23496 17.7266 5.01128V14.8755ZM6.49805 12.6988C6.49824 12.7723 6.5442 12.8296 6.60254 12.8492L6.96289 12.9859C7.85245 13.3586 8.68125 13.9846 9.33496 14.7496V5.5816C9.08794 4.37762 8.13648 3.1566 6.95801 2.47613L6.71582 2.34527C6.67779 2.32617 6.6337 2.32502 6.58301 2.35796C6.52946 2.39279 6.49805 2.44863 6.49805 2.51031V12.6988Z"})})}function ve(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M7.33057 1.98535C10.2484 1.98535 12.6136 4.3508 12.6138 7.26855C12.6138 8.58031 12.1346 9.77942 11.3433 10.7031L13.9897 13.3496C14.1655 13.5253 14.1655 13.8106 13.9897 13.9863C13.814 14.1621 13.5288 14.1621 13.353 13.9863L10.7017 11.335C9.78678 12.0942 8.61243 12.5518 7.33057 12.5518C4.41281 12.5516 2.04736 10.1864 2.04736 7.26855C2.04754 4.35091 4.41292 1.98553 7.33057 1.98535ZM7.33057 2.88574C4.90998 2.88592 2.94793 4.84796 2.94775 7.26855C2.94775 9.68929 4.90987 11.6522 7.33057 11.6523C9.75141 11.6523 11.7144 9.6894 11.7144 7.26855C11.7142 4.84786 9.75131 2.88574 7.33057 2.88574Z"})})}function he(){return m("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[n("path",{d:"M6.19629 7.86231C6.42357 7.63534 6.7752 7.60692 7.0332 7.77734L7.1377 7.86231L8.80371 9.5293C9.06329 9.78889 9.06307 10.21 8.80371 10.4697L7.1377 12.1367C6.878 12.3964 6.45599 12.3964 6.19629 12.1367C5.93686 11.8771 5.93697 11.456 6.19629 11.1963L7.39258 9.99902L6.19629 8.80371L6.11133 8.69922C5.94087 8.4411 5.96904 8.08955 6.19629 7.86231Z"}),n("path",{d:"M13.4668 11.0156C13.7699 11.0776 13.998 11.3456 13.998 11.667C13.9979 11.9883 13.7698 12.2564 13.4668 12.3184L13.333 12.332H10.833C10.466 12.3319 10.1682 12.034 10.168 11.667C10.168 11.2998 10.4659 11.0021 10.833 11.002H13.333L13.4668 11.0156Z"}),n("path",{d:"M12.6602 2.66504C13.3492 2.66504 13.9062 2.66439 14.3564 2.70117C14.8142 2.73859 15.2201 2.81796 15.5967 3.00977C16.1922 3.31321 16.677 3.79805 16.9805 4.39356C17.1722 4.77014 17.2517 5.17604 17.2891 5.63379C17.3258 6.08402 17.3252 6.64102 17.3252 7.33008V12.6602C17.3252 13.3492 17.3258 13.9062 17.2891 14.3564C17.2516 14.8142 17.1723 15.2201 16.9805 15.5967C16.677 16.1922 16.1922 16.677 15.5967 16.9805C15.2201 17.1723 14.8142 17.2516 14.3564 17.2891C13.9062 17.3258 13.3492 17.3252 12.6602 17.3252H7.33008C6.64102 17.3252 6.08402 17.3258 5.63379 17.2891C5.17604 17.2517 4.77014 17.1722 4.39356 16.9805C3.79805 16.677 3.31321 16.1922 3.00977 15.5967C2.81796 15.2201 2.73859 14.8142 2.70117 14.3564C2.66439 13.9062 2.66504 13.3492 2.66504 12.6602V7.33008C2.66504 6.64101 2.66439 6.08402 2.70117 5.63379C2.73858 5.17601 2.81797 4.77016 3.00977 4.39356C3.31321 3.79802 3.79802 3.31321 4.39356 3.00977C4.77016 2.81797 5.17601 2.73858 5.63379 2.70117C6.08402 2.66439 6.64101 2.66504 7.33008 2.66504H12.6602ZM7.33008 3.99512C6.61907 3.99512 6.1257 3.99601 5.74219 4.02734C5.3665 4.05804 5.15508 4.11481 4.99707 4.19531C4.65183 4.37124 4.37124 4.65183 4.19531 4.99707C4.11481 5.15508 4.05805 5.3665 4.02734 5.74219C3.99601 6.1257 3.99512 6.61908 3.99512 7.33008V12.6602C3.99512 13.3711 3.99601 13.8646 4.02734 14.248C4.05805 14.6237 4.11481 14.8352 4.19531 14.9932C4.37124 15.3384 4.65186 15.619 4.99707 15.7949C5.15507 15.8754 5.36654 15.9322 5.74219 15.9629C6.1257 15.9942 6.61908 15.9951 7.33008 15.9951H12.6602C13.3711 15.9951 13.8646 15.9942 14.248 15.9629C14.6237 15.9322 14.8352 15.8754 14.9932 15.7949C15.3384 15.619 15.619 15.3384 15.7949 14.9932C15.8754 14.8352 15.9322 14.6237 15.9629 14.248C15.9942 13.8646 15.9951 13.3711 15.9951 12.6602V7.33008C15.9951 6.61908 15.9942 6.1257 15.9629 5.74219C15.9322 5.36654 15.8754 5.15507 15.7949 4.99707C15.619 4.65186 15.3384 4.37124 14.9932 4.19531C14.8352 4.11481 14.6237 4.05805 14.248 4.02734C13.8646 3.99601 13.3711 3.99512 12.6602 3.99512H7.33008Z"})]})}function we(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M11.3312 4.20472C12.7488 2.92391 14.9377 2.96644 16.3039 4.33265L16.4318 4.46742C17.6713 5.8393 17.6713 7.93343 16.4318 9.30531L16.3039 9.44007L10.0119 15.7311C9.68839 16.0546 9.45384 16.2917 9.22185 16.4821L8.98748 16.6588C8.78233 16.799 8.56429 16.9196 8.33709 17.0192L8.10759 17.1119C7.92582 17.1785 7.73843 17.2266 7.52166 17.2711L6.75701 17.4069L4.36345 17.8053C4.22059 17.8291 4.06914 17.8552 3.9406 17.8649C3.84183 17.8723 3.70833 17.875 3.56267 17.8395L3.41423 17.7907C3.19121 17.695 3.00747 17.5271 2.89177 17.316L2.84588 17.2223C2.75958 17.0209 2.76174 16.8276 2.77166 16.6959C2.78136 16.5674 2.80742 16.4159 2.83123 16.2731L3.22966 13.8795L3.36443 13.1149C3.40899 12.898 3.45795 12.7108 3.52459 12.5289L3.61736 12.2985C3.71691 12.0715 3.83772 11.854 3.97771 11.6491L4.15349 11.4147C4.34392 11.1825 4.58171 10.9484 4.90545 10.6246L11.1965 4.33265L11.3312 4.20472ZM5.84588 11.5651C5.49671 11.9142 5.31258 12.0998 5.1867 12.2526L5.07537 12.3991C4.98194 12.5358 4.90157 12.6812 4.83513 12.8327L4.77361 12.9869C4.73328 13.0971 4.70248 13.2125 4.66814 13.3815L4.54119 14.0983L4.14275 16.4918L4.14177 16.4938H4.1447L6.53826 16.0944L7.25505 15.9684C7.42406 15.9341 7.53946 15.9033 7.64959 15.8629L7.80291 15.8014C7.95461 15.7349 8.09953 15.6538 8.2365 15.5602L8.38396 15.4498C8.53674 15.3239 8.72231 15.1398 9.07146 14.7907L14.0588 9.80238L10.8332 6.57679L5.84588 11.5651ZM15.3635 5.27308C14.5281 4.43776 13.2058 4.38573 12.3097 5.11683L12.1369 5.27308L11.7736 5.63636L15.0002 8.86195L15.3635 8.49964L15.5197 8.32581C16.2015 7.48961 16.2015 6.28311 15.5197 5.44691L15.3635 5.27308Z"})})}function z(){return n("svg",{className:"codex-activity-icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:n("path",{d:"M16.8347 7.91699C16.8347 7.76279 16.8266 7.61021 16.8123 7.45996L15.4705 8.80371C14.2903 9.98388 12.3762 9.98388 11.1961 8.80371C10.016 7.62352 10.0159 5.70942 11.1961 4.5293L12.5378 3.18652C12.3885 3.17238 12.237 3.16505 12.0837 3.16504C9.45947 3.16504 7.33179 5.29272 7.33179 7.91699C7.33184 8.56608 7.46162 9.18329 7.69605 9.74512C7.79981 9.9939 7.74311 10.2811 7.5525 10.4717L3.59547 14.4287C3.0498 14.9744 3.04991 15.8586 3.59547 16.4043L3.70191 16.501C4.25076 16.9483 5.05957 16.9158 5.57105 16.4043L9.52906 12.4473L9.60426 12.3828C9.79018 12.2455 10.0369 12.2131 10.2546 12.3037C10.8166 12.5382 11.4345 12.668 12.0837 12.668C14.7078 12.6678 16.8345 10.541 16.8347 7.91699ZM18.1648 7.91699C18.1646 11.2755 15.4423 13.9979 12.0837 13.998C11.4151 13.998 10.7708 13.8886 10.1677 13.6885L6.51246 17.3457C5.51389 18.3443 3.93332 18.406 2.86207 17.5322L2.65504 17.3457C1.58992 16.2806 1.58992 14.5534 2.65504 13.4883L6.31031 9.83203C6.1104 9.22921 6.00175 8.58526 6.00172 7.91699C6.00172 4.55818 8.72494 1.83496 12.0837 1.83496C12.7838 1.835 13.458 1.95316 14.0857 2.17188L14.1638 2.20508C14.3404 2.29325 14.4697 2.45713 14.5144 2.65234C14.5653 2.87533 14.4984 3.10876 14.3367 3.27051L12.1375 5.4707C11.4767 6.13148 11.4767 7.20251 12.1375 7.86328C12.7983 8.52373 13.8694 8.52395 14.53 7.86328L16.7293 5.66309L16.7937 5.60742C16.9499 5.48687 17.1532 5.44067 17.3484 5.48535C17.5714 5.53648 17.7526 5.69898 17.8279 5.91504C18.0466 6.54272 18.1648 7.21689 18.1648 7.91699Z"})})}function ee({block:e}){if(e.type!=="tool_use")return null;if(U(e))return n(z,{});let t=J(e).category;if(t==="read")return n(ye,{});if(t==="search"||t==="fetch")return n(ve,{});if(t==="execute")return n(he,{});if(t==="edit")return n(we,{});return n(z,{})}function A(e,t){let a=e.rawInput[t];return typeof a==="string"&&a.length>0?a:void 0}function Le(e){return J(e).target}function W(e){return e.name==="mcp"||e.name.startsWith("mcp__")||e.name.startsWith("mcp_")}function U(e){return W(e)||e.name==="dynamic_tool"}function te(e,t){let{category:a}=J(e),o=Le(e),i=N(e.status);if(U(e))return{leading:e.title};if(a==="execute"){let r=A(e,"command")?.split(`
2
- `)[0]??o;return r?{leading:t(i?"stream.codex.running":"stream.codex.ran"),trailing:r}:{leading:t(i?"stream.codex.runningCommand":"stream.codex.ranCommandGeneric")}}if(a==="search"){let r=A(e,"pattern")??A(e,"query")??o;return r?{leading:t(i?"stream.codex.searching":"stream.codex.searched"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingFiles":"stream.codex.searchedFiles")}}if(a==="fetch"){let r=A(e,"query")??A(e,"url")??o;return r?{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb"),trailing:t("stream.codex.forDetail",{detail:r})}:{leading:t(i?"stream.codex.searchingWeb":"stream.codex.searchedWeb")}}if(a==="read")return o?{leading:t("stream.codex.readLabel"),trailing:o}:{leading:t("stream.codex.readFiles")};if(a==="edit")return o?{leading:t(i?"stream.codex.editingLabel":"stream.codex.editedLabel"),trailing:o}:{leading:t(i?"stream.codex.editingFiles":"stream.codex.editedFiles")};if(a==="delete")return o?{leading:t(i?"stream.codex.deletingLabel":"stream.codex.deletedLabel"),trailing:o}:{leading:t(i?"stream.codex.deletingFiles":"stream.codex.deletedFiles")};if(a==="move")return o?{leading:t(i?"stream.codex.movingLabel":"stream.codex.movedLabel"),trailing:o}:{leading:t(i?"stream.codex.movingFiles":"stream.codex.movedFiles")};return{leading:e.title}}function Ne(e,t){let a=te(e,t);return a.trailing===void 0?a.leading:`${a.leading} ${a.trailing}`}function be(e){return e.map((t)=>{if(t.type!=="content")return"";let a=t.content;return a.type==="text"?a.text:""}).filter(Boolean).join(`
3
- `).trim()}function Te(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="image"?[{data:a.data,mimeType:a.mimeType}]:[]})}function $e(e){return e.flatMap((t)=>{if(t.type!=="content")return[];let a=t.content;return a.type==="audio"?[{data:a.data,mimeType:a.mimeType}]:[]})}function ke(e){if(typeof e==="string"&&e.length>0)return e;return}function Ae(e){return e.type==="diff"}function Be(e){let t=e.content.find(Ae);if(t===void 0)return;return t.changes.map((a)=>`${a.operation} ${a.path}`).join(`
4
- `)}function ne(e){let t=ke(e.rawOutput);if(t!==void 0)return t;let a=be(e.content);if(a.length>0)return a;return Be(e)}function K({block:e,command:t}){let{t:a,Output:o,commandStatus:i}=p(),[r,l]=S(!1),[d,c]=S(!1),u=ne(e),s=i===void 0?e.exitCode===void 0?void 0:a("stream.codex.exitCode",{code:e.exitCode}):i(e),g=()=>{navigator.clipboard.writeText([`$ ${t}`,u].filter((f)=>f!==void 0).join(`
5
- `)),l(!0),setTimeout(()=>l(!1),1500)};return n("div",{className:"codex-command-details",children:m("div",{className:"codex-command-card",children:[m("div",{className:"codex-command-line-row",children:[n("span",{className:"codex-command-prompt","aria-hidden":"true",children:"$"}),n("button",{type:"button",className:v("codex-command-line",!d&&"codex-command-line-clamped"),"data-codex-disclosure":"","aria-expanded":d,onClick:()=>c((f)=>!f),children:t}),n("button",{type:"button",className:"codex-command-copy","aria-label":a("actions.copy"),onClick:g,children:r?n(pe,{}):n(ge,{})})]}),u!==void 0&&(o===void 0?n("pre",{className:"codex-command-output",children:u}):n(o,{text:u})),s!==void 0&&n("div",{className:"codex-command-footer",children:n("span",{className:"codex-command-status",children:s})})]})})}function ae({block:e}){let{t,openLink:a,Patch:o,openImage:i,commandStatus:r,expandToolOutput:l=!1}=p(),d=ne(e),c=o===void 0?void 0:e.content.flatMap((x)=>{if(x.type!=="diff")return[];let k=x;return k.patch?.text?[k.patch.text]:[]}).join(`
6
- `),u=Te(e.content),s=$e(e.content),[g,f]=_(`tool:${e.id}`,!1),C=H(`tool:${e.id}`,g),h=J(e),w=h.category,y=te(e,t),b=w==="execute"?A(e,"command"):void 0;if(e.userShell&&b!==void 0)return n(K,{block:e,command:b});let T=b!==void 0||U(e)||u.length>0||s.length>0||Boolean(c)||l&&d!==void 0,I=!T&&!N(e.status)?h.filePath:void 0;if(w==="execute"&&!N(e.status)&&e.status!=="completed"){let x=r?.(e);if(x)y={...y,leading:x}}if(w==="read"&&N(e.status))return null;let M=m("span",{className:"codex-activity-label",children:[n(ee,{block:e}),n("span",{className:"min-w-0 flex-1 truncate",children:N(e.status)?n("span",{className:"codex-activity-running",children:y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`}):m(D,{children:[n("span",{className:"codex-activity-leading",children:y.leading}),y.trailing!==void 0&&(I!==void 0?m(D,{children:[" ",n("button",{type:"button",className:"codex-activity-trailing codex-activity-file-link",title:I,onClick:()=>a(I),children:y.trailing})]}):m("span",{className:"codex-activity-trailing",children:[" ",y.trailing]}))]})})]});return m("div",{className:"codex-activity-item",children:[T?m("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-label":y.trailing===void 0?y.leading:`${y.leading} ${y.trailing}`,"aria-expanded":g,onClick:()=>f((x)=>!x),children:[M,n(B,{expanded:g})]}):n("div",{className:"codex-activity-header codex-activity-header-static",children:M}),n("div",{className:v("codex-activity-details-grid",g&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:C&&m(D,{children:[b!==void 0?n(K,{block:e,command:b}):o!==void 0&&c?n(o,{patch:c}):d!==void 0&&n("pre",{className:"codex-activity-details",children:d}),u.length>0&&n("div",{className:"codex-activity-media",children:u.map((x)=>{let k=`data:${x.mimeType};base64,${x.data}`,j=n("img",{src:k,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},`${x.mimeType}:${x.data.slice(0,32)}`);return i===void 0?j:n("button",{type:"button",className:"cursor-pointer",onClick:()=>i(k),children:j},k)})}),s.map((x)=>n("audio",{className:"mt-1 w-full","aria-label":t("stream.codex.audioOutput"),controls:!0,src:`data:${x.mimeType};base64,${x.data}`},`${x.mimeType}:${x.data.slice(0,32)}`))]})})})]})}var oe=xe(function({block:t}){if(t.type==="tool_use")return n(ae,{block:t});if(t.type==="thinking")return n(ue,{block:t});if(t.type==="collab")return n(le,{block:t});return n(ie,{block:t})});function ie({block:e}){let{t,openSession:a}=p(),o=N(e.status),[i,r]=_(`subagent:${e.id}`,o),l=O(o);P(()=>{if(o)r(!0);if(l.current&&!o)r(!1);l.current=o},[o,r]);let d=`${Se(e.activity,o,e.name,t)}${re(e.model,e.reasoningEffort,t)}`,c=e.threadId??"",u=e.blocks.length>0;return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:v("codex-activity-header",!u&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":u?i:void 0,disabled:!u,onClick:()=>r((s)=>!s),children:[m("span",{className:"codex-activity-label",children:[n(Ee,{seed:e.threadId??e.id}),n("span",{className:"min-w-0 flex-1 truncate",children:a===void 0||e.threadId===null?o?n("span",{className:"codex-activity-running",children:d}):d:n("span",{role:"link",tabIndex:0,className:v("codex-agent-link",o&&"codex-activity-running"),"aria-label":t("stream.codex.subagentOpen",{name:e.name}),onClick:(s)=>{s.stopPropagation(),a(c,e.name)},onKeyDown:(s)=>{if(s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),a(c,e.name)},children:d})})]}),u&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:e.blocks.map((s)=>{if(s.type==="tool_use")return n(ae,{block:s},s.id);if(s.type==="thinking")return n(ue,{block:s},L(s));if(s.type==="subagent")return n(ie,{block:s},s.id);if(s.type==="collab")return n(le,{block:s},s.id);if(s.type==="text")return n("div",{className:"codex-reasoning-details",children:n(E,{text:s.text,streaming:!1})},L(s));if(s.type==="plan")return n(de,{entries:s.entries},L(s));if(s.type==="image")return n("img",{src:`data:${s.source.media_type};base64,${s.source.data}`,className:"max-h-48 max-w-full rounded-lg object-contain",alt:""},L(s));return null})})})})]})}var Ie=8;function Me(e){let t=0;for(let a=0;a<e.length;a+=1)t=(t*31+e.charCodeAt(a))%2147483647;return t%Ie}function Ee({seed:e}){return n("span",{className:"codex-agent-avatar","data-hue":Me(e),"aria-hidden":"true"})}function Se(e,t,a,o){switch(e){case"started":return o(t?"stream.codex.subagentWorking":"stream.codex.subagentFinished",{name:a});case"interacted":return o("stream.codex.subagentMessaged",{name:a});case"interrupted":return o("stream.codex.subagentInterrupted",{name:a});case"completed":return o("stream.codex.subagentFinished",{name:a})}}var _e=new Set(["none","minimal","low","medium","high","xhigh","max","ultra","persistent"]);function re(e,t,a){if(e===null)return"";if(t===null)return` · ${Yn(e)}`;let o=_e.has(t)?a(`stream.codex.reasoningEffort.${t}`):t;return` · ${Yn(e)} · ${o}`}var Re={spawnAgent:"spawn",sendInput:"message",sendMessage:"message",followupTask:"message",interruptAgent:"interrupt",listAgents:"list",resumeAgent:"resume",closeAgent:"close"};function se(e){switch(e){case"pending":case"in_progress":return"inProgress";case"completed":return"completed";case"failed":return"failed";case"cancelled":case"interrupted":return"interrupted";default:throw Error(`Unknown ACP tool status: ${e}`)}}function Z(e,t,a){if(e.tool==="wait")throw Error("Codex does not present wait calls");let o=se(e.status);if(o==="interrupted")return a("stream.codex.collab.interrupted");return a(`stream.codex.collab.${t}.${Re[e.tool]}.${o}`)}function Fe(e){return e.agents.filter((t)=>t.nickname!==null)}function ce(e,t){let a=e.agents.length>0?e.agents.length:1;return`${Z(e,"header",t)}${t("stream.codex.collab.agentCount",{count:a})}`}var R="\x01";function F(e,t,a,o){let i=Object.fromEntries(Object.keys(o).map((r)=>[r,`${R}${r}${R}`]));return e(t,{...a,...i}).split(new RegExp(`${R}(\\w+)${R}`,"u")).map((r,l)=>n(fe,{children:l%2===1?o[r]:r},`${l}:${r}`))}function De({agent:e,showModel:t}){let{t:a,openSession:o}=p(),i=e.nickname??"",r=o===void 0?n("span",{className:"font-medium",children:i}):n("button",{type:"button",className:"codex-agent-link font-medium","aria-label":a("stream.codex.subagentOpen",{name:i}),onClick:()=>o(e.threadId,i),children:i});return m("span",{children:[r,e.role!==null&&` (${e.role})`,t&&re(e.model,e.reasoningEffort,a)]})}function Q({prompt:e}){return n("span",{className:"codex-collab-prompt",title:e,children:e})}function Pe(e,t){let a=e.prompt?.trim()?e.prompt:null,o=se(e.status),i=e.tool==="spawnAgent"&&o==="completed"&&a!==null,r=(e.tool==="sendInput"||e.tool==="sendMessage"||e.tool==="followupTask")&&a!==null,l=Fe(e),d=[];if(l.length===0)d.push({key:"generic",node:Z(e,"row",t)});for(let c of l){let u=n(De,{agent:c,showModel:e.tool==="spawnAgent"});if(i)d.push({key:c.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.createdWithInstructions",{},{agent:u,instructions:n(Q,{prompt:a})})})});else if(r)d.push({key:c.threadId,node:n("span",{className:"codex-collab-line",children:F(t,"stream.codex.collab.messagedWithPrompt",{action:o==="interrupted"?t("stream.codex.collab.interrupted"):t(`stream.codex.collab.messaged.${o}`)},{agent:u,prompt:n(Q,{prompt:a})})})});else{let g=e.tool!=="closeAgent"&&e.tool!=="resumeAgent"&&c.state!==null&&c.state!==null?c.state.message?.trim()?t("stream.codex.collab.stateWithMessage",{state:t(`stream.codex.collab.state.${c.state.status}`),message:c.state.message}):t("stream.codex.collab.stateOnly",{state:t(`stream.codex.collab.state.${c.state.status}`)}):"";d.push({key:c.threadId,node:F(t,"stream.codex.collab.agentRow",{action:Z(e,"row",t),state:g},{agent:u})})}}if(!i&&!r&&a!==null)d.push({key:"input",node:F(t,"stream.codex.collab.input",{},{prompt:n("span",{className:"codex-collab-input",children:a})})});return d}function le({block:e}){let{t}=p(),[a,o]=_(`collab:${e.id}`,!1);if(e.tool==="wait")return null;let i=N(e.status),r=ce(e,t);return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":a,onClick:()=>o((l)=>!l),children:[m("span",{className:"codex-activity-label",children:[n(me,{className:"size-4 shrink-0","aria-hidden":"true"}),n("span",{className:"min-w-0 flex-1 truncate",children:i?n("span",{className:"codex-activity-running",children:r}):r})]}),n(B,{expanded:a})]}),n("div",{className:v("codex-activity-details-grid",a&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-subagent-details",children:Pe(e,t).map((l)=>n("div",{className:"codex-collab-row",children:l.node},l.key))})})})]})}function ue({block:e}){let{t,i18n:a}=p(),o=Boolean(e.isComplete),[i,r]=_(`thinking:${L(e)}`,!1),l=O(null),d=e.thinking.trim().length>0;P(()=>{if(o||!d)return;let s=l.current;if(s===null)throw Error("Thinking details are not mounted");let g=new ResizeObserver(()=>{s.scrollTop=s.scrollHeight}),f=null,C=()=>{let w=s.firstElementChild;if(w===f)return;if(f!==null)g.unobserve(f);if(f=w,f!==null)g.observe(f)},h=new MutationObserver(C);return h.observe(s,{childList:!0}),C(),()=>{h.disconnect(),g.disconnect()}},[d,o]);let c=o?e.durationMs!==void 0?t("stream.codex.thoughtFor",{duration:V(e.durationMs,a.language)}):t("stream.codex.thought"):t("message.thinking"),u=e.thinking.trimStart().replace(/^\*\*[^\n]*?\*\*\s*/,"");return m("div",{className:"codex-activity-item",children:[m("button",{type:"button",className:v("codex-activity-header",!d&&"codex-activity-header-static"),"data-codex-disclosure":"","aria-expanded":d?i:void 0,disabled:!d,onClick:()=>r((s)=>!s),children:[n("span",{className:"codex-activity-label",children:n("span",{className:"codex-reasoning-label min-w-0 flex-1 truncate",children:o?c:n("span",{className:"codex-activity-running",children:c})})}),d&&n(B,{expanded:i})]}),n("div",{className:v("codex-activity-details-grid",i&&"codex-activity-details-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:d&&n("div",{ref:l,className:"codex-reasoning-details",role:"region","aria-label":c,"aria-hidden":!i,tabIndex:0,inert:!i,children:n(E,{text:u,streaming:!o})})})})]})}function Oe(e){if(W(e))return"mcp";let t=J(e).category;return t==="think"||t==="switch_mode"?"other":t}function Ue(e,t,a,o){return o(`stream.codex.summary.${e}.${a?"leading":"following"}`,{count:t})}function Ve(e,t,a){let o=new Map,i=[],r=new Set;for(let d of e){if(W(d)&&typeof d.rawInput.server==="string"){if(r.size===0)i.push({kind:"integrations"});r.add(d.rawInput.server);continue}if(U(d)){if(!i.some((u)=>u.kind==="named"&&u.title===d.title))i.push({kind:"named",title:d.title});continue}let c=Oe(d);if(!o.has(c))i.push({kind:"category",category:c});o.set(c,(o.get(c)??0)+1)}let l=i.map((d,c)=>{if(d.kind==="named")return d.title;if(d.kind==="integrations")return t(`stream.codex.summary.integrations.${c===0?"leading":"following"}`,{count:r.size,sources:new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format([...r])});return Ue(d.category,o.get(d.category),c===0,t)});if(a.startsWith("zh"))return l.join("");return new Intl.ListFormat(a,{style:"long",type:"conjunction"}).format(l)}function Ui({stateKey:e,durationMs:t,durationKind:a="work",active:o,defaultExpanded:i=o,startedAt:r,providerId:l,providerIcon:d,children:c}){let{t:u,i18n:s}=p(),[g,f]=_(`work:${e}`,i,!0),C=H(`work:${e}`,g||o),h=O(null),[w,y]=S(0);P(()=>{if(!o||t!==void 0){h.current=null;return}h.current=r??Date.now();let T=()=>{let M=h.current;if(M===null)throw Error("Codex work section is ticking without a start time");y(Date.now()-M)};T();let I=window.setInterval(T,1000);return()=>window.clearInterval(I)},[o,r,t]);let b=t!==void 0?u(a==="total"?"stream.codex.totalDuration":"stream.codex.workedFor",{duration:V(t,s.language)}):o&&w>=1000?u("stream.codex.workingFor",{duration:V(w,s.language)}):u(o?"stream.codex.working":"stream.codex.worked");return m("section",{className:"codex-work-section",children:[m("button",{type:"button",className:"codex-work-trigger","data-codex-disclosure":"","aria-expanded":g,onClick:()=>f((T)=>!T),children:[l!==void 0&&n("span",{className:"codex-work-provider-icon","data-testid":"codex-work-provider-icon","data-provider-id":l,"aria-hidden":"true",children:d}),n("span",{children:b}),n(B,{expanded:g,className:"codex-work-chevron"})]}),n("div",{className:"codex-work-separator","aria-hidden":"true"}),n("div",{className:v("codex-work-grid",g&&"codex-work-grid-open"),"aria-hidden":!g,inert:!g,children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-work-body",children:C&&c})})})]})}function Ze(e,t){if(e.type==="tool_use")return Ne(e,t);if(e.type==="thinking")return t("message.thinking");if(e.type==="collab")return ce(e,t);return t("stream.codex.subagentWorking",{name:e.name})}function X(e){if(e.type==="thinking")return!e.isComplete;if(e.type==="tool_use"||e.type==="subagent"||e.type==="collab")return N(e.status);return!1}function He(e,t,a=1000){let[o,i]=S({text:e,live:t}),r=O(Date.now());return P(()=>{if(e===o.text&&t===o.live)return;let l=Date.now(),d=Math.max(0,r.current+a-l);if(d===0||t!==o.live){r.current=l,i({text:e,live:t});return}let c=window.setTimeout(()=>{r.current=Date.now(),i({text:e,live:t})},d);return()=>window.clearTimeout(c)},[o,t,a,e]),t===o.live?o.text:e}function We({blocks:e,defaultExpanded:t=!0}){let{t:a,i18n:o}=p(),i=e.some(X),r=L(e[0]),l=e.every((C)=>C.type==="tool_use"&&J(C).category==="execute"),[d,c]=_(`group:${r}`,t&&!l),u=H(`group:${r}`,d),s=e.findLast(X)??e.at(-1);if(s===void 0)throw Error("CodexActivityGroup requires at least one activity block");let g=e.filter((C)=>C.type==="tool_use"),f=He(i?Ze(s,a):Ve(g,a,o.language),i);return m("div",{className:"codex-activity-group",children:[m("button",{type:"button",className:"codex-activity-group-trigger","data-codex-disclosure":"","aria-expanded":d,onClick:()=>c((C)=>!C),children:[m("span",{className:"codex-activity-label",children:[n(ee,{block:e[0]}),n("span",{className:"truncate",children:i?n("span",{className:"codex-activity-running",children:f}):f})]}),n(B,{expanded:d})]}),n("div",{className:v("codex-activity-group-grid",d&&"codex-activity-group-grid-open"),children:n("div",{className:"min-h-0 overflow-hidden",children:n("div",{className:"codex-activity-group-body",children:u&&e.map((C)=>n(oe,{block:C},L(C)))})})})]})}function Y({blocks:e,defaultExpanded:t}){if(e.length===0)throw Error("CodexActivityGroup requires at least one activity block");if(e.length===1)return n(oe,{block:e[0]});return n(We,{blocks:e,defaultExpanded:t})}function ht({blocks:e,defaultExpanded:t}){if(!e.some(Ke))return n(Y,{blocks:e,defaultExpanded:t});let a=[];for(let o of e){let i=a.at(-1);if(i&&Ke(i[0])===Ke(o))i.push(o);else a.push([o])}return n(D,{children:a.map((o)=>Ke(o[0])?n(Gi,{blocks:o.filter(Ke)},L(o[0])):n(Y,{blocks:o,defaultExpanded:t},L(o[0])))})}
7
- export{Ui,ht};
@@ -1,2 +0,0 @@
1
- var $a=1e6,Ka=5000000;function fi(_,e){return _+e>5000000}function qa(_){return(_/1e6).toFixed(1)}var Me=5;
2
- export{$a,Ka,fi,qa,Me};
@@ -1,4 +0,0 @@
1
- import{wi}from"./chunk-5ygdb72w.js";import{oi}from"./chunk-fd72zzqm.js";import{gr}from"./chunk-9h77fcpn.js";import{u,C,lt}from"./chunk-gk0tq3n9.js";import{Me}from"./chunk-gjfhvaxn.js";import{si,li,ci,di,ui}from"./chunk-5wsyenq9.js";import{hi,vi}from"./chunk-2ptyqcf3.js";import{L}from"./chunk-pvd09dx5.js";import{Ln}from"./chunk-5m45z6qm.js";import{En}from"./chunk-2ss8m0ja.js";import{o}from"./chunk-xqwbn2ph.js";import{e}from"./chunk-pwcw4zp2.js";import{In,Wo}from"./chunk-3karja82.js";import{Tn}from"./chunk-hmet2d96.js";import{r,qo,W,cn}from"./chunk-3174p320.js";import{Xt}from"./chunk-n13y99dj.js";import{Be,sn}from"./chunk-jz6zecb7.js";import{on,an}from"./chunk-nxj8m5bm.js";import{jo}from"./chunk-41v0g6sw.js";import{nn}from"./chunk-6xds0dkq.js";import{$o}from"./chunk-hwvr7b0j.js";import{tn}from"./chunk-h3xn4d48.js";import{en}from"./chunk-q2z9w661.js";import{Vo}from"./chunk-sg681jnt.js";import{zo}from"./chunk-bnpwhf5c.js";import{un}from"./chunk-0yqb54zg.js";import{hasFuzzyFileSearch as Kt}from"@nyssance/codex-acp-v2/client";import{useCallback as T,useEffect as jt,useLayoutEffect as rt,useMemo as st,useRef as S,useState as R}from"react";import{jsx as p,jsxs as E}from"react/jsx-runtime";var qt=["image/png","image/jpeg","image/webp","image/gif"],pt=[];async function Gt(n){let w=await(await fetch(n.url)).blob();return new Promise((I,F)=>{let D=new FileReader;D.onerror=()=>F(D.error),D.onload=()=>{let G=D.result;I(G.slice(G.indexOf(",")+1))},D.readAsDataURL(w)})}function Yt({session:n,onSubmit:w,onShellCommand:I,onHandOff:F,modelSelector:D,modelMenu:G,inputHeader:mt,actions:Mt,leadingTools:Rt,agentControls:Q=!0,placeholder:Et,children:Dt,attachmentPolicy:Nt,predictions:kt=!0,disabled:St=!1,preparing:dt=!1,allowPendingInput:Ft=!1}){let{host:O,client:_}=e(),{t:g}=O,H=T((t)=>{if(O.reportError)O.reportError(t);else console.error(t)},[O]),[ut,K]=R(()=>({text:r.get(n.id)?.text??"",revision:0})),{text:v}=ut,[M,Ot]=R(()=>r.get(n.id)?.attachments??pt),[y,Y]=R(()=>r.get(n.id)?.mentions??[]),[m,U]=R(()=>r.get(n.id)?.apps??[]),[ft,j]=R(()=>(r.get(n.id)?.apps?.length??0)>0||L(v,n.commands.map((t)=>t.name)).length>0),z=S(void 0),B=S(void 0);rt(()=>{if(m.length>0)j(!0)},[m.length]);let nt=M.some((t)=>Be(t)&&t.pastedText.status!=="ready"),[N,ht]=R(!1),[V,_t]=R(!1),[ot,Lt]=R(!1),it=S(null),f=S(null),gt=S(null),c=S(ut),P=T((t)=>{gt.current?.(),c.current={text:t,revision:c.current.revision+1},K(c.current)},[]),xt=T((t)=>{let i=f.current;if(i?.insertApplication){i.insertApplication(t);return}let a=c.current.text,d=i?.getTextarea()?.selectionStart??a.length;B.current={text:a,apps:[]},z.current=d+1,j(!0),P(a),U((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:d}])},[P]),Wt=T((t)=>{let i=f.current;if(i?.insertInvocation){i.insertInvocation(t);return}let a=c.current.text,d=i?.getTextarea(),l=d?.selectionStart??a.length,h=d?.selectionEnd??l,ct=`${a.slice(0,l)}${t} ${a.slice(h)}`;B.current={text:a,apps:[]},z.current=l+t.length+1,P(ct),j(!0)},[P]),yt=T(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),$t=Vo(n,P,U,m.length>0||y.length>0||M.length>0),bt=st(()=>({read:()=>{let i=f.current?.getTextarea(),a=i===null||i===void 0?[c.current.text.length,c.current.text.length]:[i.selectionStart,i.selectionEnd];return{target:n.id,...c.current,selection:a}},compareAndSet(i,a,d){if(f.current?.isComposing())return null;if(i.target!==n.id||i.revision!==c.current.revision)return null;c.current={text:a,revision:c.current.revision+1},K(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=a,l.setSelectionRange(d[0],d[1]);return{target:n.id,...c.current,selection:d}}}),[n.id]),q=S(null),vt=T((t)=>(q.current=t,()=>{if(q.current===t)q.current=null}),[]),X=n.state!=="idle",x=I!==void 0&&m.length===0&&v.startsWith("!"),J=(ft||m.length>0)&&!x,b=!St&&!dt&&n.attached&&!n.restoring&&!n.readOnly,k=!n.readOnly&&(Ft||b),Z=en(n,b&&!N&&!V&&!nt&&!ot,v.length>0||M.length>0||y.length>0||m.length>0,kt&&!x),Pt=Z.invalidate;rt(()=>{r.set(n.id,{text:v,attachments:M,mentions:y,...m.length>0?{apps:m}:{},modelId:r.get(n.id)?.modelId??null})},[n.id,v,M,y,m]),rt(()=>qo(n.id,Ot),[n.id]),rt(()=>cn(n.id,(t)=>{if(!k||N)throw Error("The composer cannot take text now; try again later");if(v.length||M.length||y.length||m.length)throw Error("The composer already has a draft; send or clear it first");P(t)}),[n.id,k,N,v,M,y,m,P]);let It=o((t)=>Kt(t.agent)),Ut=st(()=>It&&b?async(t)=>Xt((await _.fuzzyFileSearch({query:t,roots:[n.cwd],cancellationToken:null})).files):void 0,[_,It,b,n.cwd]),at=T((t)=>{Y((i)=>i.includes(t)?i:[...i,t])},[]);jt(()=>{f.current?.focus()},[]);let At=T(async({text:t,files:i})=>{let a=I!==void 0&&m.length===0&&t.startsWith("!")?t.slice(1):null;if(a!==null){if(a.trim().length===0)return;if(i.length||y.length||m.length)throw Error("Shell commands cannot include file references or attachments");if(n.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let d=t.trim();if(d.length===0&&i.length===0&&y.length===0&&m.length===0)return;let l=q.current;ht(!0);let h=r.get(n.id),ct=c.current.revision,tt=null;try{let A=m.map((s)=>({type:"resource_link",name:s.name,uri:`app://${s.id}`}));for(let s of y){let et={kind:"file",absPath:s};A.push({type:"resource_link",uri:on(et),name:an(et)})}let Ct=gr(d,m);if(Ct.length>0)A.push({type:"text",text:Ct});for(let s of i)if(Be(s)){if(s.pastedText.status!=="ready")throw Error("Text attachment is not ready");A.push({type:"resource_link",uri:s.url,name:s.filename??"pasted-text.txt"})}else A.push({type:"image",data:await Gt(s),mimeType:s.mediaType});if(c.current.revision===ct&&r.get(n.id)===h)c.current={text:"",revision:c.current.revision+1},tt=c.current.revision,K(c.current),Y([]),U([]),z.current=void 0,B.current=void 0,W(n.id,()=>pt),r.set(n.id,{text:"",attachments:pt,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(a!==null&&I)await I(a);else if(w)if(l===null)await w(A);else await w(A,(s)=>{if(l.signal.aborted||q.current!==l)return;l.accept(s),F?.(n.id,s)});else if(l===null)await _.prompt(n.id,A);else{let s=await _.prompt(n.id,A);l.accept(s)}Pt();for(let s of h?.attachments??[])if(s.url.startsWith("blob:")&&!r.get(n.id)?.attachments.some((et)=>et.id===s.id))URL.revokeObjectURL(s.url)}catch(A){if(h&&tt!==null&&c.current.revision===tt&&r.get(n.id)?.attachments.length===0&&r.get(n.id)?.mentions.length===0&&!r.get(n.id)?.apps?.length)c.current={text:h.text,revision:tt+1},K(c.current),Y(h.mentions),U(h.apps??[]),r.set(n.id,h),W(n.id,()=>h.attachments);throw A}finally{ht(!1),f.current?.focus()}},[_,n.id,n.state,y,m,w,I,F,Pt]),zt=()=>{_.cancel(n.id).catch(H)},Bt=T((t)=>{let i=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:Me})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});H(i)},[H,g]),Ht=st(()=>({session:n,ready:b,inputReady:k,sending:N,textareaRef:f,draft:bt,interruptRef:gt,observeReceipts:vt,addMention:at,setAdding:_t,shellMode:x,handsFree:!x&&(w===void 0||F!==void 0)}),[n,b,k,N,bt,vt,at,w,F,x]),Tt=O.writeTextAttachment,wt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:$t,bashMode:I!==void 0,disabled:!k,"aria-label":g("composer.placeholder"),placeholder:x?"! command":Z.text||Et||(X?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!J&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/"))){let i=lt(t.clipboardData);if(i?.apps.length){t.preventDefault();let a=t.currentTarget,d=u(i),l=C([...a.value.slice(0,a.selectionStart).split(""),...d,...a.value.slice(a.selectionEnd).split("")]);B.current={text:v,apps:[]},z.current=a.selectionStart+d.length,j(!0),U(l.apps),P(l.text);return}}if(Tt)sn(t,n.id,g("composer.pastedTextFilename"),Tt)}};return p(Tn,{value:Ht,children:p("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:E("div",{className:"relative",children:[mt&&p("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:mt}),p(wi,{attachmentPolicy:Nt,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},K(c.current)},attachments:M,onAttachmentsChange:(t)=>W(n.id,()=>t),children:E("div",{ref:it,className:"relative",children:[Q&&!ot&&p(oi,{bashMode:I!==void 0,handleRef:f,commands:n.commands,renderSlashMenu:(t)=>p(In,{anchorRef:it,commands:n.commands,query:t.query,includeAttachment:!1,disabled:!k,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(i)=>t.replaceQuery(()=>Wt(i.startsWith("$")?i:`/${i}`)),onApp:(i)=>t.replaceQuery(()=>xt(i)),focusInput:yt}),searchFiles:Ut,onMention:at,onSearchError:H,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},J?"inline":"textarea"),E(si,{"data-shell-mode":x||void 0,bashMode:I!==void 0,globalDrop:!0,multiple:!0,accept:qt.join(","),onError:Bt,onSubmit:At,onSubmitAsync:At,onSubmitError:H,canSubmit:()=>b&&!N&&!V&&!nt&&(!x||!X&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[Dt,E(ci,{className:"px-3 pt-3 pb-0 empty:hidden",children:[V&&p("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),p(jo,{mentions:y,onRemove:(t)=>Y((i)=>i.filter((a)=>a!==t))}),p(vi,{children:(t)=>Be(t)?p($o,{data:t,sessionId:n.id}):p(hi,{data:t,t:g})})]}),E(li,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!Z.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab")t.preventDefault(),t.stopPropagation(),P(Z.text)},children:[x&&p("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),J?p(Ln,{...wt,skillIcon:O.skillIcon,skillNames:n.commands.map((t)=>t.name),applications:m,onApplicationsChange:U,initialCaret:z.current,initialUndo:B.current}):p(En,{...wt,autoFocus:ft&&x})]}),p(di,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:E("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[E("div",{className:"flex min-w-0 items-center gap-[5px]",children:[p(Wo,{anchorRef:it,commands:n.commands,disabled:!k,agentDisabled:!b||x,agentControls:Q,open:ot,onOpenChange:Lt,focusInput:yt,onCommand:(t)=>{let i=c.current.text,a=i.length===0||i.endsWith(`
2
- `)?i:`${i}
3
- `,d=t.startsWith("$")?t:`/${t}`,l=`${a}${d} `;if(!J)B.current={text:i,apps:[]},z.current=l.length,j(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:xt}),Rt,Q&&p(tn,{sessionId:n.id,options:n.configOptions,disabled:!b})]}),E(ui,{className:"w-full min-w-0 items-center justify-end gap-1",children:[Q&&p(un,{session:n}),D??p(nn,{...G,sessionId:n.id,options:n.configOptions,disabled:!b}),Mt,p(zo,{active:X,sending:N||dt||V,ready:b&&!nt&&(!x||!X&&v.slice(1).trim().length>0),hasMentions:y.length>0||m.length>0,onStop:zt})]})]})})]})]})})]})})})}
4
- export{Yt};
@@ -1,2 +0,0 @@
1
- import{createContext as t,useContext as o}from"react";var Tn=t(null);function ga(){let e=o(Tn);if(e===null)throw Error("Composer is missing");return e}
2
- export{Tn,ga};
@@ -1,2 +0,0 @@
1
- import{e}from"./chunk-pwcw4zp2.js";import{zt,Vt}from"./chunk-9rf3qecr.js";import{Xe}from"./chunk-4h07zyxp.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Wr({providers:n,store:l}){let{t:m}=e().host,d=zt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=Xe(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Vt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
- export{Wr};
@@ -1,2 +0,0 @@
1
- function ke(){if(typeof navigator>"u")return!1;let a=navigator.userAgentData?.platform;return/mac/i.test(a??navigator.platform)}function Co(a){if(a.shiftKey||a.altKey)return!1;return ke()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}
2
- export{ke,Co};
@@ -1,2 +0,0 @@
1
- import{Te}from"./chunk-7nehhgej.js";import{r,W,ln}from"./chunk-3174p320.js";var Ko=5000;function Be(t){return"pastedText"in t}function it(t,e,p){let n=(a,o)=>{for(let[i,x]of r){if(!x.attachments.some((s)=>s.id===e.id))continue;W(i,(s)=>s.map((d)=>d.id===e.id?{...e,url:o===void 0?"":Te(o),pastedText:{text:e.pastedText.text,status:a}}:d))}};if(!r.get(t)?.attachments.some((a)=>a.id===e.id))return;n("pending"),ln(e.id,p("pasted-text.txt",e.pastedText.text).then((a)=>n("ready",a)).catch(()=>n("error")))}function sn(t,e,p,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/")))return;let a=t.clipboardData.getData("text/plain");if(a.length<Ko)return;t.preventDefault(),t.stopPropagation();let o={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:p,url:"",pastedText:{text:a,status:"pending"}};W(e,(i)=>[...i,o]),it(e,o,n)}
2
- export{Ko,Be,it,sn};
@@ -1,2 +0,0 @@
1
- import{D}from"./chunk-kcra1mgf.js";import{Se}from"./chunk-4jy404m1.js";import{T,le}from"./chunk-vctq22tq.js";import{O,te}from"./chunk-p0d6rr6q.js";import{Ie,se}from"./chunk-05eg5p11.js";import{cn as S}from"cn";import{BoxIcon as U,ChevronRightIcon as E,PlusIcon as z,StarIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as L,DropdownMenuContent as j,DropdownMenuGroup as y,DropdownMenuItem as k,DropdownMenuRadioGroup as _,DropdownMenuRadioItem as K,DropdownMenuSeparator as q,DropdownMenuTrigger as J}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Q}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a}from"react/jsx-runtime";function Ro({sessionId:l,trigger:f,favorite:n=!1,hoverBackground:R=n?"none":void 0,allowRemove:x=!0,submenu:g=!1,className:B,onOpenChange:A}){let{t}=T(),c=se(),H=le(),P=Se(),{collections:s,order:C}=Ie(),i=C.find((o)=>s[o].sessionIds.includes(l)),[F,G]=d(!1),[w,b]=d(!1),[m,h]=d(""),[r,v]=d(!1),I=(o)=>{if(G(o),P(o),A?.(o),!o)b(!1),h("")},p=(o)=>{v(!0),H(o.then(()=>{I(!1)}).finally(()=>v(!1)))};return a(L,{modal:!1,open:F,onOpenChange:(o,M)=>{if(!o&&w&&M.reason==="trigger-hover"){M.cancel();return}I(o)},children:[e(J,{disabled:r,"data-hover-background":R,openOnHover:n||g,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),onMouseDown:(o)=>{if(n)o.preventBaseUIHandler()},onClick:(o)=>{if(!n)return;o.preventBaseUIHandler(),p(c({type:"favorite",sessionId:l}))},render:f??e(N,{variant:"ghost",size:"icon-sm",className:B,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),children:e(u,{className:S(i!==void 0&&"fill-current")})})}),a(j,{className:"w-56 font-normal",side:g?"inline-end":"bottom",align:g?"start":"end",sideOffset:4,children:[e(y,{children:e(_,{value:i??null,children:C.map((o)=>a(K,{value:o,disabled:r||i===o,closeOnClick:!1,onClick:()=>p(c({type:"add",collectionId:o,sessionId:l})),children:[o===O?e(u,{}):s[o].emoji?e("span",{className:"flex size-4 shrink-0 items-center justify-center text-sm","aria-hidden":"true",children:s[o].emoji}):e(U,{}),e("span",{className:"min-w-0 flex-1 truncate",children:te(s[o],t)})]},o))})}),e(q,{}),a(y,{children:[a(k,{disabled:r,closeOnClick:!1,onClick:()=>b(!0),children:[e(z,{}),t("collection.newCollection")]}),x&&i!==void 0&&a(k,{disabled:r,closeOnClick:!1,onClick:()=>p(c({type:"remove",sessionId:l})),children:[e(u,{}),t("collection.removeFromAll")]})]}),w&&a("form",{className:"flex items-center gap-1 px-2 py-1.5",onSubmit:(o)=>{if(o.preventDefault(),o.stopPropagation(),!m.trim()||r)return;p(c({type:"create",id:`collection-${crypto.randomUUID()}`,name:m,sessionId:l}))},children:[e(Q,{autoFocus:!0,"aria-label":t("collection.collectionName"),placeholder:t("collection.collectionName"),value:m,disabled:r,onChange:(o)=>h(o.target.value),onKeyDown:(o)=>o.stopPropagation(),className:"h-7 min-w-0"}),e(N,{size:"xs",type:"submit",disabled:r||!m.trim(),children:t("collection.confirm")})]})]})]})}function ta({sessionId:l,allowRemove:f=!0}){let{t:n}=T();return e(Ro,{sessionId:l,allowRemove:f,submenu:!0,trigger:e(D,{icon:e(u,{}),label:n("collection.addTo"),trailing:e(E,{className:"rtl:rotate-180"})})})}
2
- export{Ro,ta};
@@ -1,3 +0,0 @@
1
- import{p,E}from"./chunk-f0kgxjp1.js";import{J}from"./chunk-b9q9d2jh.js";import{Ri}from"./chunk-t96rf4pg.js";import{de}from"./chunk-bqbpded2.js";import{Ui,ht}from"./chunk-gez0k8zs.js";import{Di}from"./chunk-5ymq8y72.js";import{oo}from"./chunk-4qghztvg.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(E,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(E,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(de,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function Xa({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:c,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
- `),T=!t.streaming&&C.trim().length>0?o(Kn,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:c,time:i}):null,d=Ri(t.content,"compact"),x=d.reduce((e,a,l)=>a.kind==="codexActivityGroup"?l:e,-1),h=d.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&J(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((l)=>l.type!=="tool_use"||!s.has(l.name));return a.length===0?null:o(ht,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?d.length:h;return o(qn,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:d.slice(0,m).map(k),answer:d.length>m?d.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(Di,{blocks:f}):y(f))})}function Kn({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let c=p(),{t:u}=c;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(oo,{text:t,label:u("actions.copy"),host:c}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=p();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function qn({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...c}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(Ui,{...c,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
- export{Xa,Kn,qn};
@@ -1,2 +0,0 @@
1
- import{a,s,n,g}from"./chunk-3t5cksae.js";import{H}from"./chunk-7eqtvqrn.js";import{I,ee,_e}from"./chunk-4jy404m1.js";import{Ce,K,re}from"./chunk-w22ch68s.js";import{Co}from"./chunk-j9snfndd.js";import{xe}from"./chunk-ex20n22v.js";import{be}from"./chunk-y6kxhkjm.js";import{we}from"./chunk-mgsxsaj1.js";import{Nt}from"./chunk-hqykt9hr.js";import{vo}from"./chunk-x6f51rt2.js";import{ActivityIcon as O}from"lucide-react";import{useEffect as E,useMemo as C}from"react";import{Kbd as G}from"@nyssance/shadcn/vega/components/ui/kbd";import{jsx as c,jsxs as P,Fragment as q}from"react/jsx-runtime";function M(i,d){return i.find((l)=>l.sessionId===d.sessionId)??{sessionId:d.sessionId,cwd:d.cwd,title:d.title||null,updatedAt:null,archived:!1}}function Or({selectedId:i,onSelect:d,isForeground:l,onOpen:w,accessory:k,rowActions:R}){let h=a(),{t:N}=h,m=n((t)=>t.runStates),S=n((t)=>t.drafts),u=n((t)=>t.sessionList),v=K((t)=>t.activityOrder),p=C(()=>v.flatMap((t)=>{let e=m[t];return e&&Ce({runStates:m,drafts:S},t)?[{sid:t,record:e,sessionRow:M(u,e)}]:[]}),[v,m,S,u]),b=C(()=>{let t=new Map;for(let e of p){let r=e.sid===i||l?.(e.sid)?"foreground":"background",y=t.get(r)??[];y.push(e),t.set(r,y)}return["foreground","background"].filter((e)=>t.has(e)||e==="background").map((e)=>({key:e,rows:t.get(e)??[]}))},[p,i,l]),f=K((t)=>t.activityCollapsedGroups),o=re(),L=b.flatMap((t)=>t.key==="foreground"||!f.has(t.key)?t.rows:[]),x=(t)=>{if(w?.(t))return;d(t)},D=vo();E(()=>{let t=(e)=>{if(e.defaultPrevented||e.isComposing||e.repeat||!Co(e))return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;let r=Number(e.key);if(!Number.isInteger(r)||r<1||r>9)return;let y=L[r-1];if(!y)return;e.preventDefault(),x(y.sessionRow)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let A=(t)=>{let e=L.indexOf(t);return c(T,{sessionRow:t.sessionRow,state:t.record.state,interruption:t.record.interruption,active:t.sid===i,tasks:t.record.tasks,listeningPorts:t.record.listeningPorts,onOpen:()=>x(t.sessionRow),accessory:k?.(t.sid),actions:R?.(t.sessionRow),hint:e<9&&D?c(G,{children:we(`CommandOrControl+${e+1}`)}):void 0},t.sid)};return c(I,{children:b.map((t)=>t.key==="foreground"?c(I,{children:t.rows.map(A)},t.key):c(ee,{open:!f.has(t.key),onOpenChange:(e)=>{let r=new Set(f);if(e)r.delete(t.key);else r.add(t.key);o({activityCollapsedGroups:r})},leading:c(O,{className:"text-muted-foreground size-3.5 shrink-0"}),label:N("sessionList.background"),count:t.rows.length,children:t.rows.map(A)},t.key))})}function T({sessionRow:i,state:d,interruption:l,active:w,tasks:k,listeningPorts:R,accessory:h,actions:N,onOpen:m,hint:S}){let u=a(),v=s(),{t:p}=u,b=i.title??p("sessionList.untitled"),f=Nt(i.sessionId,d);return P(q,{children:[c(_e,{"data-session-id":i.sessionId,active:w,role:"button",tabIndex:0,hoverCard:c(be,{sessionRow:i,actions:N}),onClick:m,onKeyDown:(o)=>{if(o.target!==o.currentTarget)return;if(o.key==="Enter"||o.key===" ")o.preventDefault(),m()},state:d,interruption:l,title:b,preview:f,listeningPorts:R,onOpenPort:u.openLink&&((o)=>u.openLink?.(`http://localhost:${o}`)),accessory:h,hint:S,actions:c(xe,{title:p("sessionList.stop"),onStop:()=>g(u,v.stopSession(i.sessionId))})}),k.map((o)=>P("div",{className:"border-border/60 before:border-border/60 relative ms-4 flex min-h-7 items-center gap-2 border-s py-1 ps-4 pe-2 text-xs before:absolute before:start-0 before:top-3.5 before:w-2 before:border-t",children:[c(H,{state:"running"}),c("span",{className:"text-muted-foreground min-w-0 flex-1 truncate leading-5",title:o.title,children:o.title})]},o.id))]})}
2
- export{Or};
@@ -1,2 +0,0 @@
1
- import{Te}from"./chunk-7nehhgej.js";function on(t){return Te(t.absPath)}function rn(t){return t.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??t}function an(t){return rn(t.absPath)}
2
- export{on,rn,an};
@@ -1,2 +0,0 @@
1
- import{P}from"./chunk-z7ehwkcq.js";function Sr(r,n){return P.readSkillDocument({path:r,roots:n??null})}
2
- export{Sr};
@@ -1,2 +0,0 @@
1
- import{Ee}from"./chunk-xqwbn2ph.js";import{createContext as v,useContext as C,useMemo as a}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function pn({host:o,client:n,children:t}){let s=a(()=>({host:o,client:n}),[o,n]);return r(Ee,{host:o,client:n,children:r(i,{value:s,children:t})})}function e(){let o=C(i);if(o===null)throw Error("Conversation host is missing");return o}function y(o,n){n.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
2
- export{pn,e,y};
@@ -1,2 +0,0 @@
1
- import{Vn}from"./chunk-j5njgy7p.js";import{ki}from"./chunk-2pahy4hs.js";import{oe}from"./chunk-xqwbn2ph.js";import{qe,or}from"./chunk-t94rfs41.js";import{e}from"./chunk-pwcw4zp2.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function da(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function Jt({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=oe(qe,(r)=>r),w=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),y=s((r)=>u.sessionId===t?Vn(u.turns,r,u.terminals):[],[u,t]),S=s((r,i)=>or(t,r,i),[t]),b=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,g=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(ki,{placement:"body",getViewport:w,findSourceMatches:y,revealTurn:S,prepareSource:b,subscribeOpen:g,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
2
- export{da,Jt};
@@ -1,4 +0,0 @@
1
- import{yn}from"./chunk-veb90k24.js";import{pe}from"./chunk-1e7gk302.js";import{ar}from"./chunk-4qghztvg.js";import{x,bt}from"./chunk-9h77fcpn.js";import{t}from"./chunk-xqwbn2ph.js";import{Cr,wr}from"./chunk-m2x1s408.js";import{ne}from"./chunk-0307kp7e.js";import{ue}from"./chunk-sct2h2dm.js";import{isEmbeddedResource as g,isImage as R,isResourceLink as h,isText as v}from"@nyssance/codex-acp-v2/client";import{memo as y}from"react";import{jsx as i,jsxs as q}from"react/jsx-runtime";var rr=y(function({item:n,messageTime:f,skillNames:u=[]}){let p=t(),r=wr(n._meta),m=r?r.map((e)=>e.question===void 0?e.text:`${e.question}
2
- ${e.text}`).join(`
3
- `):ue(n),l=n.content.filter(R),d=new Set(bt(m).map((e)=>e.id)),o=new Map,a=n.content.filter((e)=>{if(h(e)){let s=x(e.uri);if(s!==null){if(!d.has(s))o.set(s,{id:s,name:e.title??e.name});return!1}return!0}return g(e)}),c=r??n.content.filter(v).map((e)=>{let s=Cr(e._meta);return s?{question:s.question,text:s.answer}:{text:e.text}});if(m.length===0&&l.length===0&&a.length===0&&o.size===0)return null;return q("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":n.id,children:[a.length>0&&i("div",{className:"codex-user-mentions",children:a.map((e,s)=>i(ne,{block:e},`${n.id}:${s}`))}),i(yn,{value:{names:u,icon:p.skillIcon},children:i(ar,{host:p,message:n,text:m,textParts:c.some((e)=>("question"in e))?c:void 0,applicationReferences:o.size>0?i("div",{className:"mb-1.5 flex flex-wrap gap-1.5",children:[...o.values()].map((e)=>i(pe,{app:e},e.id))}):void 0,images:l,mentions:[],messageTime:f})})]})});
4
- export{rr};
@@ -1,2 +0,0 @@
1
- import{yt}from"./chunk-sp411z4y.js";import{c,De}from"./chunk-95n1cpnj.js";import{b}from"./chunk-d924by6g.js";import{MoreHorizontalIcon as N}from"lucide-react";import{useEffect as y,useState as p}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as D,DropdownMenuContent as P,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as F}from"react/jsx-runtime";function go(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function I(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function he({path:n,renderHeader:s,description:t}){let e=c(),{t:l}=e,d=e.readFile,[a,f]=p(null),[v,w]=p(null),[h,M]=p(0);y(()=>{let r=!1;return f(null),w(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,h,d]);let k=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(D,{children:[o(z,{render:o(x,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(N,{})}),i(P,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void De(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void De(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)De(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(F,{children:[s?s(k):o("div",{className:"flex justify-end",children:k}),o(b,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(x,{variant:"outline",size:"sm",onClick:()=>M((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(yt,{text:go(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:I(`${C(n)}/${r}`))}})})]})}
2
- export{go,he};
@@ -1,2 +0,0 @@
1
- var Pe="chrome-hover hover:bg-foreground/8 data-[active=true]:bg-foreground/5",d="chrome-hover hover:bg-foreground/8 data-active:bg-foreground/5";
2
- export{Pe,d};
@@ -1,7 +0,0 @@
1
- import{xr}from"./chunk-veb90k24.js";import{pe}from"./chunk-1e7gk302.js";import{ao}from"./chunk-620q6hmz.js";import{x}from"./chunk-9h77fcpn.js";import{Zi}from"./chunk-6es8tgxc.js";import{no,Wi}from"./chunk-vextf7ba.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as C}from"entities";import ae from"katex";import{CheckIcon as U,ChevronLeftIcon as se,ChevronRightIcon as ie,CopyIcon as ce,DownloadIcon as de,FileIcon as le,LinkIcon as ue,MailIcon as me,XIcon as ge}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as fe,createElement as B,memo as D,startTransition as he,useContext as ke,useEffect as k,useLayoutEffect as X,useMemo as G,useRef as w,useState as h}from"react";import{jsx as a,jsxs as f,Fragment as re}from"react/jsx-runtime";var J=fe(null);function M(){let e=ke(J);if(e===null)throw Error("Markdown host is missing");return e}var we=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,be=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,xe=/\uE200[^\uE201]*$/,Te=4,ve=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function E(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function V(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ce(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!E(e,r)&&!V(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function ye(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!E(e,t)&&!V(e,t,n))return t;return-1}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!E(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Me(e){return Ne(e,"```")%2===1}function Z(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!E(e,t))n+=1;t+=1}return n%2===1}function Ee(e){return e.endsWith(`
2
- `)?`${e}\`\`\``:`${e}
3
- \`\`\``}function _(e,n){if(!e.includes(n)||Ce(e,n)%2===0)return e;let t=ye(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
4
- `)||Z(r))return e;return`${e}${n}`}function Le(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function Y(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Ie(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=Y(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let u=d.toLowerCase();if(u.length>Te&&!ve.has(u))return!1}return!0}function $e(e){let{path:n}=Y(e);if(Le(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Re(e){let n=e.match(H);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Ie(t)||$e(t)?e.replace(H,"$1"):`${e})`}function Pe(e){let n=e.replace(xe,"");if(n.length===0||n.includes("`")&&Z(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Me(n))return{isCodeFenceOpen:!0,markdown:Ee(n)};if(n.includes("!["))n=n.replace(be,(t,r)=>r);if(n.includes("]("))n=Re(n);return n=_(n,"**"),n=_(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function Se(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function O(e){return Se(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function Q(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))Q(t.tokens);if(!O(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!O(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
5
- `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function Fe(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?Fe(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Ae(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function He(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function _e(e){let n=He(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Oe({href:e}){let n=G(()=>_e(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?me:o?le:ue;return f("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function je({children:e,href:n,title:t}){let r=M();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:t,onClick:(o)=>Ae(o,n,r),children:f("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Oe,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function We({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=M(),i=w(null),[c,d]=h(null),[u,p]=h(null),[L,b]=h(!1);if(k(()=>{let g=Zi(d,p);return i.current=g,()=>{g.dispose(),i.current=null}},[]),k(()=>{let g=i.current;if(g===null)throw Error("Code highlighter is not mounted");g.update(e,n)},[e,n]),u!==null)throw u;let T=c!==null&&c.code===e&&c.language===n?c.html:null,l=async()=>{b(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),b(!0),window.setTimeout(()=>b(!1),2000)}catch(g){s?.(g)}};return f("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[f("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void l(),children:L?a(U,{}):a(ce,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...T===null?{children:e}:{dangerouslySetInnerHTML:{__html:T}}})})]})}function qe({code:e,language:n}){return M().preview?a("span",{children:e}):a(Ke,{code:e,language:n})}function Ke({code:e,language:n}){let t=w(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(We,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function ze(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Ue({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return f("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),f("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(se,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(de,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(ie,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(ge,{})})]})]})}function Be(e){return M().preview?a(re,{children:e.alt}):a(De,{...e})}function De({src:e,alt:n,title:t,allowWide:r}){let o=w(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return f(re,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(ze(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Ue,{preview:s,setPreview:i})})]})}function Xe({value:e,display:n}){let t=w(null);return X(()=>{if(t.current===null)throw Error("Codex math root is not mounted");ae.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Ge=150,y=null;function W(e,n){let t=y;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),u=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,u-r)},`${n}:${t.generation}:${c.start}`)),i=u}if(i<o)s.push(e.slice(i-r));return s}function ee(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function q(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
- `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,we)}function Je(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${q(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return q(e.text);default:return""}}function ne(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${ee(Je(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ne(r),s=t.get(o)??0;return t.set(o,s+1),te(r,`${n}-${o}-${s}`)})}function Ve(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return f("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?f("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(U,{}):null]}):null,m(t,n)]},n)}function Ze(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function K(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return B(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function Ye(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:f("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>K(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=ee(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>K(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function z(e,n,t){let r=N(e.href);if(!ao(r))return null;return a(Be,{src:r,alt:C(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function te(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return B(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((i)=>i.type!=="space"&&i.type!=="br"),o=r.length>0&&r.every((i)=>i.type==="image"),s=o&&r.length>1;return a("p",{className:`codex-markdown-paragraph${o?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${s?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":s?"true":void 0,"data-wide-markdown-block":o?"true":void 0,"data-wide-markdown-block-kind":o?"image":void 0,children:o?r.map((i,c)=>z(i,`${n}-image-${c}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(xr,{text:C(t.text),children:W(C(t.text),n)},n):m(t.tokens,n)}case"escape":return W(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=x(o);if(s!==null)return a(pe,{app:{id:s,name:C(t.text).replace(/^\$/,"")}},n);return ao(o)?a(je,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return z(e,n,!1);case"code":{let t=e;return a(qe,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return Ze(e,n);case"list_item":return Ve(e,n);case"table":return Ye(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Xe,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function v(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?C(n.text):n.tokens.map(v).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(v).join("");case"list":return e.items.map(v).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(v).join("")).join("")).join("")}default:return""}}function Qe({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=y;try{return y={cursor:t,runs:r,generation:o},te(e,n)}finally{y=s}}var en=D(function({result:n}){let{text:t,isStreaming:r}=n,o=G(()=>{let l=n.tokens;if(n.source.includes("!["))Q(l);P(l);let g=new Map,S=0;return l.map((I)=>{let R=ne(I),F=g.get(R)??0;g.set(R,F+1);let A=v(I),oe={token:I,tokenKey:`root-${R}-${F}`,offset:S,visibleText:A};return S+=A.length,oe})},[n]),s=o.map((l)=>l.visibleText).join(""),i=w({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),u=d?c.visibleText.length:0,p=performance.now(),L=r&&d?c.runs.filter((l)=>p-l.firstSeenAtMs<Ge):[],b=c.generation+(d?0:1),T={text:t,visibleText:s,runs:L.filter((l)=>l.start<s.length).map((l)=>({...l,end:Math.min(l.end,s.length)})),generation:b};if(r&&s.length>u)T.runs.push({start:u,end:s.length,firstSeenAtMs:p});return X(()=>{i.current=T}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((l)=>a(Qe,{token:l.token,tokenKey:l.tokenKey,offset:l.offset,runs:T.runs,generation:b},l.tokenKey))})}),nn=D(function({text:n,isStreaming:t}){let r=w(null),[o,s]=h(()=>no(n,t)),i=w(o!==null),[c,d]=h(null);if(k(()=>{let u=Wi((p)=>{if(!i.current)i.current=!0,s(p);else he(()=>s(p))},d);return r.current=u,()=>{u.dispose(),r.current=null}},[]),k(()=>{let u=r.current;if(u===null)throw Error("Markdown parser is not mounted");let p=t?Pe(n).markdown:n;u.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(en,{result:o})});function yt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(J.Provider,{value:t,children:a(nn,{text:r?o:e,isStreaming:r})})}
7
- export{yt};
@@ -1,2 +0,0 @@
1
- import{c,i}from"./chunk-95n1cpnj.js";import{B,G,ie,z,V,fe}from"./chunk-fjseqvmx.js";import{ge}from"./chunk-ct0xqakr.js";import{b}from"./chunk-d924by6g.js";import{he}from"./chunk-rncx5gxz.js";import{j,ve}from"./chunk-qnbr2cmg.js";import{CheckIcon as F,SparklesIcon as X,XIcon as _}from"lucide-react";import{useDeferredValue as J,useState as v}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as K,DialogClose as Q,DialogContent as R,DialogDescription as W,DialogHeader as Y,DialogTitle as Z}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ne,TabsList as le,TabsTrigger as oe}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function T({skill:r}){let{assetUrl:m}=c(),[u,s]=v(!1),l=r.interface?.iconSmall,h=l&&m?m(l):r.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(X,{className:"text-muted-foreground size-6"})})}function re({skill:r}){let{t:m}=c(),u=i((l)=>l.setSkillEnabled),s=i((l)=>(r.path in l.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:r.enabled,disabled:s,"aria-label":`${m(r.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${r.interface?.displayName??r.name}`,onCheckedChange:(l)=>void u(r,l)})]})}function St({query:r,ready:m,onOpenPlugin:u}){let{t:s}=c(),l=i((e)=>e.skills),h=i((e)=>e.skillErrors),P=i((e)=>e.loading)||!m,M=i((e)=>e.installed),E=i((e)=>e.skillProjects),[L,H]=v(null),[k,O]=v(!1),[q,C]=v(null),x=J(r.trim().toLowerCase()),o=l.find((e)=>e.path===q),N=M.find(({plugin:e})=>e.id===o?.pluginId),p=l.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(x)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),d=[...["user","system","admin"].flatMap((e)=>{let a=l.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(E).flatMap(([e,a])=>{if(!l.some((I)=>I.scope==="repo"&&a.includes(I.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],A=d.map((e)=>e.label);for(let e of d)if(e.path&&A.filter((a)=>a===e.label).length>1)e.label=e.path;let g=d.find((e)=>e.id===L)??d[0],D=g?p.filter((e)=>g.paths.has(e.path)):[],U=k||x?p:p.slice(0,6),w=(e)=>t(V,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(fe,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(z,{className:"pointer-events-none relative translate-none! self-center!",children:t(T,{skill:a})}),n(G,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(ie,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(B,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(F,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(b,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${j} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),P?t(ge,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:p.length})})]}),p.length?w(U):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(x?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!x&&p.length>6&&t(y,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":k,onClick:()=>O((e)=>!e),children:k?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:p.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")H(e)},className:"gap-6",children:[t(le,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:d.map((e)=>t(oe,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),d.map((e)=>t(ne,{value:e.id,children:e.id===g.id&&(D.length?w(D):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(K,{open:!!o,onOpenChange:(e)=>{if(!e)C(null)},children:t(R,{showCloseButton:!1,className:ve,children:o&&n(S,{children:[t(he,{path:o.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(T,{skill:o}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(re,{skill:o}),e,t(Q,{render:t(y,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(_,{})})]})]}),n(Y,{className:"gap-3",children:[t(Z,{className:"text-2xl leading-8 font-semibold break-words",children:o.interface?.displayName??o.name}),t(W,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:o.description})]})]})},o.path),o.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),N?t(y,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(N)},children:N.plugin.interface?.displayName??N.plugin.name}):o.pluginId]})]})})})]})}
2
- export{St};
@@ -1,2 +0,0 @@
1
- import{n}from"./chunk-3t5cksae.js";import{Ce,K,re}from"./chunk-w22ch68s.js";import{useEffect as S,useMemo as f}from"react";function Rr(s){let c=K((i)=>i.activityOrder),a=n((i)=>{let o=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&Ce(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(o)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=K((i)=>i.activitySeen),r=re();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,o])=>u.get(i)!==o)}
2
- export{Rr};
@@ -1,2 +0,0 @@
1
- import{ht}from"./chunk-gez0k8zs.js";import{zi}from"./chunk-4gq7ye1a.js";import{t}from"./chunk-xqwbn2ph.js";import{ne}from"./chunk-0307kp7e.js";import{io}from"./chunk-sct2h2dm.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as C}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(ne,{block:e.content},`${n.id}:${l}`))]})}var Jn=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(io),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...zi(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(C,{children:[s(ht,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
- export{Jn};
@@ -1,3 +0,0 @@
1
- import{a,s,n}from"./chunk-3t5cksae.js";import{He,ae,Y}from"./chunk-fjk1g303.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as de}from"cn";import{ArchiveIcon as ue,FolderIcon as Q,ListFilterIcon as me,SearchIcon as pe,Trash2Icon as U}from"lucide-react";import{useEffect as he,useRef as fe,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as r}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:de("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function Er({Scroll:u=we}){let{t:i,i18n:A}=a(),m=s(),S=n((e)=>e.archivedSessions),N=n((e)=>e.connection),[B,X]=d(""),[y,Z]=d("all"),[p,ee]=d("all"),[te,se]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=fe(!1),[D,f]=d(null),[O,b]=d(null),[ie,G]=d(!1);he(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let l=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(l.has(v))throw Error("Archive pagination returned a repeated cursor");l.add(v),await m.listArchived()}}catch(l){if(!e)F(E(l))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,te]);let o=n((e)=>e.projectContext),k=!(o!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ne=[...new Set(S.filter((e)=>o&&j(o,e).id!==Y).map((e)=>o?j(o,e).id:e.cwd))].toSorted(),re=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=o?j(o,e).id:null,l=c===Y;return L(e).toLocaleLowerCase(A.language).includes(re)&&(y==="all"||(y==="quick"?l:!l))&&(p==="all"||(p==="quick"?l:c===p))}),le=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function oe(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function ce(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let l of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===l.sessionId))continue;try{await m.delete(l.sessionId)}catch(v){e.push(l),c.push(`${L(l)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
- `));else f(null)}finally{h.current=!1,w(!1)}}return r("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[r("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[r("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),r(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),r("div",{className:"flex shrink-0 flex-wrap gap-3",children:[r("div",{className:"relative min-w-48 flex-1",children:[t(pe,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),r(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Z(e)},children:[r(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(me,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),r(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");ee(e)},children:[r(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):ae(p,o??void 0)})]}),r(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ne.map((e)=>t(x,{value:e,title:e,children:ae(e,o??void 0)},e))]})]})]}),r(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?r("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:r(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>se((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?r("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(ue,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(o?He(K,o):[]).filter(([,e])=>e.length>0).map(([e,c])=>r("section",{className:"flex flex-col gap-3",children:[r("div",{className:"flex items-center justify-between gap-3",children:[r("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===Y?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===Y?i("sessionList.archives.noProject"):ae(e,o??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((l)=>r("article",{"aria-label":L(l),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[r("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(l),children:L(l)}),l.updatedAt!==null&&t("time",{dateTime:l.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:le.format(new Date(l.updatedAt))})]}),r("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([l])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void oe(l),children:i("sessionList.archives.unarchive")})]})]},l.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(ve,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:r(ge,{showCloseButton:!C,children:[r(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(ie?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),r(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),r(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void ce(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
- export{Er};
@@ -1,3 +0,0 @@
1
- import{ti,at}from"./chunk-vnr9rqs6.js";import{t,oe}from"./chunk-xqwbn2ph.js";import{createStore as d}from"@alwith/api/client";import{Dialog as f,DialogContent as p,DialogDescription as m,DialogHeader as u,DialogTitle as h}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as i,jsxs as l}from"react/jsx-runtime";var c=d({request:null});function Wt(e){c.setState({request:{path:e.path,patch:Go(e.patch,e.path)}})}function Go(e,a){let n=e.split(/^(?=diff --git )/m).filter((o)=>o.length>0);if(n.length<=1)return e;return n.find((o)=>{let r=o.split(`
2
- `,1)[0]??"";return r.endsWith(` b/${a}`)||r.endsWith(` ${a}`)||r.includes(`/${a} `)})??e}function Zt(){let{t:e,theme:a}=t(),n=oe(c,(o)=>o.request),s=n===null?null:ti(n.patch);return i(f,{open:n!==null,onOpenChange:(o)=>!o&&c.setState({request:null}),children:l(p,{className:"flex h-[calc(100vh-2.5rem)] max-h-[900px] flex-col gap-3 sm:max-w-[min(1400px,calc(100vw-2.5rem))]",children:[l(u,{children:[i(h,{className:"truncate pe-8 font-mono text-sm font-normal",children:n?.path}),s!==null&&l(m,{children:[l("span",{className:"codex-diff-additions",children:["+",s.additions]})," ",l("span",{className:"codex-diff-deletions",children:["-",s.deletions]})," ",i("span",{children:e("conversation.changedLines")})]})]}),i("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border [&>.codex-patch-view]:h-full","data-stream-style":"codexUI",children:n!==null&&i(at,{patch:n.patch,theme:a})})]})})}
3
- export{Wt,Go,Zt};
@@ -1,2 +0,0 @@
1
- import{Uo}from"./chunk-3t5cksae.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function aa({host:o,children:t}){return s(n,{value:o,children:t})}function T(){let o=i(n),e={...Uo(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function Ho(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function le(){let o=T();return(t)=>Ho(o,t)}function Oo(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
- export{aa,T,Ho,le,Oo};
@@ -1,2 +0,0 @@
1
- import{p}from"./chunk-f0kgxjp1.js";import{_}from"./chunk-1xaskqdj.js";import{isContentEntry as k,isImage as b,isResourceLink as N}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as w,ImageIcon as C,LoaderCircleIcon as S,RefreshCwIcon as A}from"lucide-react";import{useEffect as R,useState as h}from"react";import{jsx as s,jsxs as y}from"react/jsx-runtime";function Ke(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function B(e){let n=[];for(let[r,c]of e.content.entries()){if(!k(c))continue;let i=c.content;if(b(i))n.push({key:`${e.id}:${r}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(N(i))n.push({key:`${e.id}:${r}`,path:i.uri,alt:i.name})}if(n.length)return n;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 T({images:e}){let{loadImage:n,openImageGallery:a,openImage:r,t:c}=p(),[i,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);R(()=>{let t=!0,l=JSON.parse(f);g({});for(let o of l)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&n?n(o.path):Promise.reject(Error("Image loading is unavailable"))).then((u)=>{if(t)g((m)=>({...m,[o.key]:{src:u}}))},()=>{if(t)g((u)=>({...u,[o.key]:{error:!0}}))});return()=>{t=!1}},[f,n,v]);let I=e.flatMap((t)=>{let l=i[t.key];return l&&"src"in l?[{src:l.src,alt:t.alt}]:[]});return s("div",{className:"codex-image-thumbnails",children:e.map((t,l)=>{let o=i[t.key];if(!o)return s("div",{className:"codex-image-thumbnail",role:"status","aria-label":c("stream.codex.imageLoading"),children:s(S,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":c("stream.codex.imageFailed"),onClick:()=>x((d)=>d+1),children:s(A,{"aria-hidden":"true"})},t.key);return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let d=e.slice(0,l).filter((u)=>{let m=i[u.key];return m&&"src"in m}).length;if(a)a(I,d);else r?.(o.src)},children:s("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function Gi({blocks:e}){let{t:n}=p(),a=e.flatMap(B),[r,c]=_(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":r,onClick:()=>c((i)=>!i),children:[y("span",{className:"codex-activity-label",children:[s(C,{className:"codex-activity-icon","aria-hidden":"true"}),s("span",{className:"codex-activity-leading",children:n("stream.codex.viewedImages",{count:a.length})})]}),s(w,{className:r?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),r&&s(T,{images:a})]})}
2
- export{Ke,Gi};
@@ -1,4 +0,0 @@
1
- import{e}from"./chunk-pwcw4zp2.js";import{Lt}from"./chunk-twx75z08.js";import{q,Ye,X,Dt}from"./chunk-4h07zyxp.js";import{At,Et}from"./chunk-zah37d5q.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as J}from"cn";import{ChevronDownIcon as se,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as j,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as D,FieldDescription as de,FieldLabel as O}from"@nyssance/shadcn/vega/components/ui/field";import{Input as ee}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as W,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as H}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function V(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Z(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(V(d));if(s.reportError)s.reportError(u);else console.error(u)}}function wo({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,j(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),j(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(V(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function $r({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=Et(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(q[0]?.id??""),[F,B]=y(0),[U,A]=y({}),_=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(q[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await At(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=q.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return j(()=>{if(!c||x==="new"||P||E)return;k(q[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Lt,{bridge:d})]}),C&&t(wo,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(ko,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),q.map((o)=>t("div",{hidden:x!==o.id,children:t(_o,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>_(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Sn,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Sn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function ko({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[q.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(te,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:J("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function te({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:J("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:J("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function So({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(So,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function _o({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(X(s,d?.region)?.id),[U,A]=y(d?.base_url??""),_=s.logo,I=d!==null,T=c.trim(),z=Dt(s,F),K=F!==X(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");j(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(X(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?X(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(_,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(O,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(W,{children:[t(H,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(D,{className:"gap-2",children:[t(O,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(W,{children:t(H,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:X(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Sn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,_]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
2
- { "label": "My Model", "api_id": "model-id" }
3
- ]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),M=(m)=>{if(!m)try{_(Ye(I)),K(null)}catch(G){K(V(G));return}U(m)},L=async()=>{let m;try{m=Ye(I),K(null)}catch(g){K(V(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[t(O,{htmlFor:E,children:n("provider.name")}),t(ee,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:o,children:n("provider.baseUrl")}),t(ee,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:r,children:n("provider.apiKey")}),i(W,{children:[t(H,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(Q,{}),i(re,{open:B,onOpenChange:M,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(se,{className:J("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:A.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(D,{className:"gap-2","data-invalid":z!==null,children:[t(O,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:J("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void L(),children:[u&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
4
- export{wo,$r,ko,So,_o,Sn};
@@ -1,2 +0,0 @@
1
- var va={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Xo(e){return[...e].toSorted((o,n)=>(va[o.kind]??99)-(va[n.kind]??99))}function za(e){return e==="allow_once"||e==="allow_always"}function Va(e){return e==="allow_always"||e==="reject_always"}
2
- export{va,Xo,za,Va};
@@ -1,2 +0,0 @@
1
- function Ta(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 ct(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(Ta(t,o))}return{imageFiles:n,sawNonImageFile:i}}function dt(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function fn(e){return e.replace(s,"")}function xa(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 hn(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=fn(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-xa(n,i)),r=Math.max(0,o-xa(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
2
- export{Ta,ct,dt,fn,xa,hn};
@@ -1,2 +0,0 @@
1
- import{s}from"./chunk-3t5cksae.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function Ce(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let a=t.filter((o)=>Ce(e,o)),S=new Set(a),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[o,i]of Object.entries(e.runStates)){if(S.has(o)||!Ce(e,o))continue;let r=n.runStates[o],g=!r||i.state!==r.state||i.since!==r.since||i.lastActivityAt!==r.lastActivityAt||i.interruption!==r.interruption;if(i.reusableDraft&&e.drafts[o]!==void 0||c&&g&&(!r||i.state!=="idle")&&i.interruption!=="runtime restarted")a.push(o)}return a.length===t.length&&a.every((o,i)=>o===t[i])?t:a}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function wn(t){let n=u.get(t);if(n)return n;let e=v(t),a=new Set,S=(i)=>{e={...e,...i};for(let r of a)r()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),r=d(e.activityOrder,c,i);if(c=i,r!==e.activityOrder)S({activityOrder:r})});let o={get:()=>e,set:S,subscribe:(i)=>(a.add(i),()=>a.delete(i))};return u.set(t,o),o}function Gr(t){u.get(t)?.set(v(t))}function K(t){let n=wn(s());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function re(){return wn(s()).set}function zr(){let t=K((e)=>e.view),n=re();return[t,(e)=>n({view:e})]}
2
- export{Ce,wn,Gr,K,re,zr};
@@ -1,2 +0,0 @@
1
- import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function Z(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function v(e,t){return e.find((n)=>n.category===t&&o(n))}function Q(e){return Z(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
2
- export{Z,v,Q};
@@ -1,2 +0,0 @@
1
- import{zn}from"./chunk-8weq6t3q.js";import{M}from"./chunk-fzze5xcw.js";import{cn as r}from"cn";import{ArrowUpRight as pe,ChevronUp as H,Loader2Icon as W,Zap as Z}from"lucide-react";import{Fragment as ce,useState as q}from"react";import{Button as A}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as J,DropdownMenuCheckboxItem as K,DropdownMenuContent as Q,DropdownMenuGroup as y,DropdownMenuItem as k,DropdownMenuLabel as L,DropdownMenuSeparator as u,DropdownMenuSub as T,DropdownMenuSubContent as C,DropdownMenuSubTrigger as O,DropdownMenuTrigger as X}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as he}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as Y,TooltipContent as E,TooltipTrigger as ee}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as e,jsxs as a,Fragment as p}from"react/jsx-runtime";function ii({value:c,onChange:ne,models:x,modelGroups:V,compactCatalog:o,catalogHeight:ae="fixed",effortPresentation:j="slider",unavailableEffort:v,providerMenu:h,header:w,className:B,condensed:z,stripLabelPrefix:_,showDescription:se,showModelList:ie=!0,loading:oe,switching:G,isLoading:te,effortConfig:s,booleanOptions:f,onBooleanChange:R,selectOptions:le=[],t:m,...d}){let[de,re]=q(!1),[me,ue]=q(!1),l=f?.find((n)=>n.id==="fast_mode"),I=o?f?.filter((n)=>n!==l):f,P=(n)=>_&&n.startsWith(_)?n.slice(_.length):n;if(oe)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(A,{variant:"ghost",disabled:!0,className:r("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(W,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:m("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&a(J,{open:de,onOpenChange:re,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(A,{"data-testid":"provider-trigger",variant:"ghost",disabled:d.disabled,className:r("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,e(H,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(E,{children:m("model.switchProvider")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((n,t)=>a(ce,{children:[t>0&&n.length>0&&e(u,{}),e(M,{value:h.value,onValueChange:h.onChange,options:n})]},t)),h.moreAction&&a(p,{children:[e(u,{}),a(k,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(J,{open:me,onOpenChange:ue,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(A,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:r("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",z&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,f?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(Z,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",z&&"text-[11px]"),children:P(c.label)||m("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,t)=>t.name.length>n.length?t.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(W,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(H,{className:r("size-3 shrink-0",z&&"size-2.5")})]})})}),e(E,{children:m("model.switchModel")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:r("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",o&&"flex w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5",o&&(ae==="content"?"max-h-[min(350px,var(--available-height))]":"h-[350px]")),children:[o&&a(p,{children:[a(y,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(zn,{...s,disabled:d.disabled})}):a(T,{children:[a(O,{disabled:d.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(C,{children:e(M,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):v?a(k,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:v.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:w?.name}),l&&e(K,{"aria-label":l.name,title:l.title??l.name,disabled:d.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>R?.(l.id,n),className:r("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(Z,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),w&&!o&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(u,{})]}),a(y,{"data-model-menu-list":o?"":void 0,className:o?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ie&&(te?e(k,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):x.length===0?e(k,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=x.filter((i)=>!i.more),t=x.filter((i)=>i.more),F=n.length>0&&t.length>0,N=(i,g)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:g?.noDescription?void 0:se?i.description:void 0}),D=(i)=>{let g=x.find((S)=>S.api_id===i);if(g)ne(g)};if(o)return e(M,{value:c.api_id,onValueChange:D,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((i)=>N(i))});return a(p,{children:[V?V.map((i)=>{let g=i.models.filter((b)=>!b.more),S=i.models.filter((b)=>b.more),U=g.length>0&&S.length>0;return a(y,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(M,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(U?g:i.models).map((b)=>N(b))}),U&&a(T,{children:[e(O,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(C,{children:e(M,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:S.map((b)=>N(b,{noDescription:!0}))})})]})]},i.id)}):e(M,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(F?n:x).map((i)=>N(i))}),!V&&F&&a(T,{children:[e(O,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(C,{children:e(M,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:t.map((i)=>N(i,{noDescription:!0}))})})]})]})})()),!o&&s&&a(p,{children:[e(u,{}),j==="menu"?a(T,{children:[a(O,{disabled:d.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(C,{children:e(M,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(zn,{...s,disabled:d.disabled})]}),!o&&!s&&v&&a(p,{children:[e(u,{}),a(k,{disabled:!0,children:[e("span",{className:"flex-1",children:v.name}),e("span",{children:v.label})]})]}),le.map((n)=>a(y,{children:[e(u,{}),e(L,{children:n.name}),e(M,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),I&&I.length>0&&a(p,{children:[!s&&e(u,{}),I.map((n)=>o?a(K,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(t)=>R?.(n.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:r("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:r("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:r("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(he,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(t)=>R?.(n.id,t)})]},n.id))]})]}),o&&w?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(y,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
2
- export{ii};
@@ -1,2 +0,0 @@
1
- import{kr}from"./chunk-f0kgxjp1.js";import{createContext as s,useContext as l,useSyncExternalStore as m}from"react";import{jsx as r}from"react/jsx-runtime";var c=s(null),u=s(null);function Ee({host:e,client:n,children:i}){return r(kr,{host:e,children:r(c,{value:e,children:r(u,{value:n,children:i})})})}function t(){let e=l(c);if(e===null)throw Error("Timeline host is missing");return e}function Re(){let e=l(u);if(e===null)throw Error("Timeline client is missing");return e}function oe(e,n){return m((i)=>e.subscribe(i),()=>n(e.getState()),()=>n(e.getState()))}function o(e){let n=Re();return oe(n.store,e)}function Ct(e,n){if(e.reportError)e.reportError(n);else console.error(n)}
2
- export{Ee,t,Re,oe,o,Ct};
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-3t5cksae.js";import{jt}from"./chunk-kcra1mgf.js";import{R}from"./chunk-aaqk0jrt.js";import{$t,Se}from"./chunk-4jy404m1.js";import{formatDistanceToNowStrict as x}from"date-fns";import{enUS as H,zhCN as L}from"date-fns/locale";import{ClockIcon as z,MessageSquareIcon as E}from"lucide-react";import{useEffect as g,useState as A}from"react";import{Input as D}from"@nyssance/shadcn/vega/components/ui/input";import{Separator as w}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as o,jsxs as h,Fragment as M}from"react/jsx-runtime";var S={en:H,"zh-CN":L};function Qe(t,n){let i=n==="zh-CN"?S["zh-CN"]:S.en;return x(new Date(t),{locale:i})}function be({sessionRow:t,actions:n,shortcut:i,renaming:r=!1,onRename:m}){let{t:s,i18n:C,PathAction:u}=a(),f=Se(),y=$t();g(()=>{f(r)},[r,f]);let[I,p]=A(t.title??"");g(()=>{if(r)p(t.title??"")},[r,t.title]);let d=(e)=>{let c=e.trim();m?.(c!==""&&c!==t.title?c:null)},N=t.archived?s("sessionList.archived"):t.updatedAt!==null?Qe(t.updatedAt,C.language):null,v=[];if(N!==null)v.push({icon:o(z,{className:"size-3.5"}),text:N});let l=u&&o(u,{cwd:t.cwd,onOpened:y});return o(jt,{title:r?o(D,{autoFocus:!0,value:I,className:"h-7 text-sm","aria-label":s("sessionList.rename"),onChange:(e)=>p(e.target.value),onKeyDown:(e)=>{if(e.stopPropagation(),e.key==="Enter")d(e.target.value);if(e.key==="Escape")m?.(null)},onBlur:(e)=>d(e.target.value)}):h("span",{className:"flex items-center gap-2",children:[o("span",{className:"min-w-0",children:o(R,{className:"min-w-0 flex-1",children:t.title??s("sessionList.untitled")})}),i]}),titleIcon:o(E,{className:"size-3.5"}),details:v,actions:l||n!==void 0?h(M,{children:[l,l&&n!==void 0&&o(w,{}),n]}):void 0})}
2
- export{Qe,be};
@@ -1,2 +0,0 @@
1
- function*jn(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function Pi(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of jn(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
2
- export{jn,Pi};
@@ -1,2 +0,0 @@
1
- import{invoke as r}from"@tauri-apps/api/core";import{listen as t,once as s,emit as n,emitTo as o}from"@tauri-apps/api/event";var P={providersRead:()=>r("plugin:alwith-chat|providers_read"),providersSave:(e)=>r("plugin:alwith-chat|providers_save",e),providersSaveCustom:(e)=>r("plugin:alwith-chat|providers_save_custom",e),providersRemoveCustom:(e)=>r("plugin:alwith-chat|providers_remove_custom",e),providersTest:(e)=>r("plugin:alwith-chat|providers_test",e),providersApply:()=>r("plugin:alwith-chat|providers_apply"),providersAccountBind:(e)=>r("plugin:alwith-chat|providers_account_bind",e),providersRefreshManaged:(e)=>r("plugin:alwith-chat|providers_refresh_managed",e),providersClearManaged:()=>r("plugin:alwith-chat|providers_clear_managed"),readSkillDocument:(e)=>r("plugin:alwith-chat|read_skill_document",e),sessionsList:(e)=>r("plugin:alwith-chat|sessions_list",e),sessionsCountTypes:(e)=>r("plugin:alwith-chat|sessions_count_types",e),sessionsPersonaEvidence:(e)=>r("plugin:alwith-chat|sessions_persona_evidence",e),getModelPricing:()=>r("plugin:alwith-chat|get_model_pricing"),scanSessionAggregates:(e)=>r("plugin:alwith-chat|scan_session_aggregates",e),exportWeekSessions:()=>r("plugin:alwith-chat|export_week_sessions"),dailyTokenUsage:(e)=>r("plugin:alwith-chat|daily_token_usage",e),downloadUsageJson:(e)=>r("plugin:alwith-chat|download_usage_json",e),wordCloud:(e)=>r("plugin:alwith-chat|word_cloud",e)},_n={"providers:changed":{name:"providers:changed",listen:(e)=>t("providers:changed",e),once:(e)=>s("providers:changed",e),emit:(e)=>n("providers:changed",e),emitTo:(e,i)=>o(e,"providers:changed",i)},"providers:managed-revoked":{name:"providers:managed-revoked",listen:(e)=>t("providers:managed-revoked",e),once:(e)=>s("providers:managed-revoked",e),emit:(e)=>n("providers:managed-revoked",e),emitTo:(e,i)=>o(e,"providers:managed-revoked",i)}};function _a(e){return typeof e==="object"&&e!==null&&typeof e.code==="string"&&typeof e.message==="string"}function Ga(e){if(_a(e)||e instanceof Error)return e.message;return String(e)}
2
- export{P,_n,_a,Ga};
@@ -1,2 +0,0 @@
1
- import{A,so,hr,vn,vr,lo,yr}from"./chunk-ev9tkjgy.js";import{t,Re,oe,o}from"./chunk-xqwbn2ph.js";import{Ae}from"./chunk-04vnhbvc.js";import{createStore as E}from"@alwith/api/client";import{isText as w,nativeTurnId as Q}from"@nyssance/codex-acp-v2/client";import{jsx as y}from"react/jsx-runtime";var b=E({entries:{}});function p(i,e){b.setState((n)=>({entries:{...n.entries,[i]:e}}))}function v(i,e){let n=Q(e),a=i.items.findLast((s)=>Q(s)!==null);return!e.replayed&&n!==null&&a!==void 0&&Q(a)===n}function M(i,e){for(let n of i.items){if(n.kind!=="user"||n.echo==="pending")continue;for(let a of[...lo(n._meta),...n.content.filter(w).flatMap((s)=>lo(s._meta))])if(a.questionItemId===e)return a.answer}return}function O({sessionId:i,item:e,question:n,index:a}){let s=Re(),{t:l}=t(),m=so(e.id,a),c=JSON.stringify([i,m]),u=oe(b,(r)=>r.entries[c]),d=o((r)=>r.sessions[i]),k=o((r)=>r.connection==="ready"),f=u?.draft??hr(n),x=d===void 0?u?.accepted:M(d,m)??u?.accepted,h=d!==void 0&&v(d,e),D=!d?.subagent&&k&&d?.attached&&!d.restoring&&!d.readOnly,g=x!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!h?"closed":!D?"unavailable":"pending",C=async()=>{if(b.getState().entries[c]?.pending||g!=="pending")return;let r=s.state.sessions[i];if(r===void 0||!v(r,e)||!r.attached||r.readOnly||r.restoring)return;let S=vn(n,f);if(!S.trim())return;let q={questionItemId:m,question:n.title,answer:S};p(c,{draft:f,pending:!0});try{await s.prompt(i,[{type:"text",text:vr(q),_meta:{codex:{questionReply:q}}}]),p(c,{draft:f,accepted:S})}catch(I){p(c,{draft:f,error:I instanceof Error?I.message:String(I)})}};if(g==="closed")return null;return y(yr,{question:n,draft:f,status:g,answer:x,error:g==="pending"?u?.error:void 0,t:l,onChange:(r)=>p(c,{draft:r}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{C()}})}function to({sessionId:i,item:e}){let n=o((s)=>s.sessions[i]),a=A(e._meta);if(n===void 0||n.subagent!==void 0||n.readOnly||!v(n,e))return y(Ae,{content:e.content.some((s)=>!w(s)||s.text.trim().length>0)?e.content:a.map((s)=>({type:"text",text:s.title})),messageId:e.id,streaming:!1});return y("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((s,l)=>y(O,{sessionId:i,item:e,question:s,index:l},so(e.id,l)))})}
2
- export{to};
@@ -1,2 +0,0 @@
1
- import{P,_n}from"./chunk-z7ehwkcq.js";import{Ht}from"./chunk-4h07zyxp.js";import{useEffect as p,useRef as u,useState as m}from"react";var Po="providers:changed",Io="providers:managed-revoked",i=(e)=>e;function Kr(){return{read:()=>i(P.providersRead()),save:(e,r,t)=>i(P.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(P.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(P.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>P.providersTest({providerId:e}),apply:()=>i(P.providersApply()),onChanged:(e)=>_n[Po].listen((r)=>e(r.payload))}}function qr(){return{bind:(e)=>P.providersAccountBind({account:e}),refresh:(e,r)=>i(P.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await P.providersClearManaged()},onRevoked:(e)=>_n[Io].listen((r)=>e(r.payload.sessionIds))}}async function At(e){try{return await e.apply()}catch(r){if(!Ht(r))throw r;return e.read()}}function Et(e,r=console.error){let[t,d]=m(null),a=u(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
- export{Po,Io,Kr,qr,At,Et};
@@ -1,2 +0,0 @@
1
- import{a,s,qt,n,g}from"./chunk-3t5cksae.js";import{D}from"./chunk-kcra1mgf.js";import{_e}from"./chunk-4jy404m1.js";import{xe}from"./chunk-ex20n22v.js";import{Qe,be}from"./chunk-y6kxhkjm.js";import{hasRename as F}from"@nyssance/codex-acp-v2/client";import{ArchiveIcon as x,ArchiveRestoreIcon as A,GitForkIcon as H,PencilIcon as N,Trash2Icon as R}from"lucide-react";import{useRef as B,useState as y}from"react";import{jsx as o,jsxs as b,Fragment as C}from"react/jsx-runtime";function Cn({sessionRow:e,active:p,onSelect:m,onForked:v=m,onHoverCardOpenChange:c,actions:d}){let t=a(),{t:f,i18n:S}=t,k=s(),l=n((i)=>i.runStates[e.sessionId]),h=qt(),u=()=>m(e);return o(_e,{"data-session-id":e.sessionId,role:"button",tabIndex:0,active:p,onClick:u,onKeyDown:(i)=>{if(i.key==="Enter"||i.key===" ")i.preventDefault(),u()},media:t.SessionMedia?o(t.SessionMedia,{sessionId:e.sessionId,state:l?.state}):void 0,state:l?.state,interruption:l?.interruption??null,title:e.title??f("sessionList.untitled"),onHoverCardOpenChange:c,hoverCard:o(E,{sessionRow:e,onDelete:()=>h(e),onForked:v,actions:d}),meta:e.updatedAt!==null?o("span",{className:"text-muted-foreground shrink-0 text-xs",children:Qe(e.updatedAt,S.language)}):void 0,actions:l!=null?o(xe,{title:f("sessionList.stop"),onStop:()=>g(t,k.stopSession(e.sessionId))}):void 0})}function E({sessionRow:e,onDelete:p,onForked:m,actions:v}){let c=a(),{t:d}=c,t=s(),f=n((r)=>F(r.agent)),S=n((r)=>r.connection==="ready"&&r.agent?.capabilities?.session?.fork!=null),[k,l]=y(!1),[h,u]=y(!1),i=B(!1);return o(be,{sessionRow:e,renaming:k,onRename:(r)=>{if(l(!1),r!==null)g(c,t.renameSession(e.sessionId,r))},actions:b(C,{children:[f&&o(D,{icon:o(N,{}),label:d("sessionList.rename"),onClick:()=>l(!0)}),v,e.archived?o(D,{icon:o(A,{}),label:d("sessionList.unarchive"),onClick:()=>void g(c,t.unarchive(e.sessionId))}):b(C,{children:[o(D,{icon:o(H,{}),label:d("sessionList.fork"),disabled:!S||h,onClick:()=>{if(i.current)return;i.current=!0,u(!0),g(c,t.fork(e.sessionId,e.cwd).then((r)=>{let I=t.state.sessionList.find((L)=>L.sessionId===r);if(!I)throw Error("Forked chat is missing from the session list");m(I)}).finally(()=>{i.current=!1,u(!1)}))}}),o(D,{icon:o(x,{}),label:d("sessionList.archive"),onClick:()=>void g(c,t.archive(e.sessionId))})]}),o(D,{variant:"destructive",icon:o(R,{}),label:d("sessionList.delete"),onClick:p})]})})}
2
- export{Cn};