@alwith/module-chat 0.6.33 → 0.6.35

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 (510) hide show
  1. package/README.md +1 -1
  2. package/assets/catalogs/deepseek/models.json +4 -66
  3. package/assets/catalogs/doubao/models.json +92 -0
  4. package/assets/catalogs/doubao-coding/models.json +92 -0
  5. package/assets/catalogs/kimi/models.json +84 -0
  6. package/assets/catalogs/minimax/models.json +79 -0
  7. package/assets/catalogs/qwen/models.json +10 -201
  8. package/assets/catalogs/xai/models.json +4 -77
  9. package/assets/catalogs/zhipu/models.json +83 -0
  10. package/assets/provider-catalog.json +130 -58
  11. package/assets/provider-models.v1.json +379 -0
  12. package/dist/activity-host.d.ts +2 -0
  13. package/dist/activity-host.js +1 -1
  14. package/dist/agent/client.d.ts +2 -0
  15. package/dist/agent/client.js +1 -1
  16. package/dist/agent/custom-model-effort.d.ts +1 -1
  17. package/dist/agent/custom-model-effort.js +1 -1
  18. package/dist/agent/fork-title.js +1 -1
  19. package/dist/agent/image-request.js +1 -1
  20. package/dist/agent/image-tools.d.ts +3 -1
  21. package/dist/agent/image-tools.js +1 -1
  22. package/dist/agent/input-config.js +1 -1
  23. package/dist/agent/input-modes/chat.js +1 -1
  24. package/dist/agent/input-modes/execution-meta.js +1 -1
  25. package/dist/agent/input-modes/image-context.js +1 -1
  26. package/dist/agent/input-modes/image.js +1 -1
  27. package/dist/agent/input-modes/index.js +1 -1
  28. package/dist/agent/project-path.js +1 -1
  29. package/dist/agent/request-error.js +1 -1
  30. package/dist/agent/session-list-refresh.js +1 -1
  31. package/dist/app-reference.js +1 -1
  32. package/dist/application-tools.js +1 -1
  33. package/dist/approval/choice-elicitation-form.js +1 -1
  34. package/dist/approval/choice-schema.js +1 -1
  35. package/dist/approval/permission-options.js +1 -1
  36. package/dist/approval/permission-view.js +1 -1
  37. package/dist/approval/schema-elicitation-form.js +1 -1
  38. package/dist/approval/url-elicitation-card.js +1 -1
  39. package/dist/{chunk-1y5zgya3.js → chunk-0sb0c014.js} +2 -2
  40. package/dist/{chunk-exrt8sd0.js → chunk-0xztk729.js} +2 -2
  41. package/dist/chunk-18gcnf2a.js +2 -0
  42. package/dist/{chunk-7r3k37ys.js → chunk-1a46v4cy.js} +2 -2
  43. package/dist/chunk-1b3frq9c.js +3 -0
  44. package/dist/{chunk-016v1nnv.js → chunk-1vwece23.js} +6 -6
  45. package/dist/{chunk-b7ze9dje.js → chunk-20dc4fm0.js} +2 -2
  46. package/dist/{chunk-pe6ex52z.js → chunk-22nybrkv.js} +5 -5
  47. package/dist/{chunk-tszqev50.js → chunk-23kvszfc.js} +1 -1
  48. package/dist/chunk-2nq204hz.js +2 -0
  49. package/dist/{chunk-pxbr08fz.js → chunk-2nv5ebq1.js} +2 -2
  50. package/dist/chunk-33fxyn5r.js +2 -0
  51. package/dist/chunk-359pf448.js +2 -0
  52. package/dist/{chunk-n8b9yg4q.js → chunk-3knw8e0x.js} +2 -2
  53. package/dist/{chunk-xjbf9h6m.js → chunk-3kytka7m.js} +3 -3
  54. package/dist/{chunk-y81242w2.js → chunk-3sq2k9ca.js} +2 -2
  55. package/dist/{chunk-pe79c1re.js → chunk-3t3n8nfy.js} +2 -2
  56. package/dist/{chunk-9n8cds8p.js → chunk-3tvq6xr2.js} +2 -2
  57. package/dist/{chunk-qm0zd4wj.js → chunk-482segb0.js} +2 -2
  58. package/dist/{chunk-w2z3sxdq.js → chunk-4chmr87g.js} +2 -2
  59. package/dist/chunk-4g2412p5.js +2 -0
  60. package/dist/chunk-4ma6bmcm.js +2 -0
  61. package/dist/{chunk-9b8gnrcb.js → chunk-54jfqcd1.js} +2 -2
  62. package/dist/chunk-5mxh7h57.js +2 -0
  63. package/dist/{chunk-2ad4fb9z.js → chunk-5qaa4atv.js} +2 -2
  64. package/dist/{chunk-f8bx4etj.js → chunk-5zf3px9y.js} +2 -2
  65. package/dist/chunk-60yk0ye9.js +2 -0
  66. package/dist/chunk-63kwbtgs.js +2 -0
  67. package/dist/{chunk-12bfnfbk.js → chunk-67fn9pq0.js} +2 -2
  68. package/dist/{chunk-yw927w3q.js → chunk-6br4568a.js} +2 -2
  69. package/dist/{chunk-zyermn00.js → chunk-6c7q2rz8.js} +2 -2
  70. package/dist/{chunk-pd5yrdg6.js → chunk-6ea6q6dj.js} +2 -2
  71. package/dist/{chunk-vcj2jfnz.js → chunk-6v0r7m92.js} +2 -2
  72. package/dist/{chunk-j4w2hbbe.js → chunk-6xap6hvz.js} +2 -2
  73. package/dist/{chunk-46bgwhx8.js → chunk-7naym98x.js} +2 -2
  74. package/dist/{chunk-kdcde4s5.js → chunk-7nfv27hz.js} +2 -2
  75. package/dist/{chunk-djqexpgf.js → chunk-7tgfj1zb.js} +2 -2
  76. package/dist/{chunk-ypdh88cj.js → chunk-7ywnza68.js} +2 -2
  77. package/dist/{chunk-51s7qck0.js → chunk-8be6eq9r.js} +2 -2
  78. package/dist/chunk-8eyw37rv.js +2 -0
  79. package/dist/{chunk-4z6gyvy3.js → chunk-8pb726d6.js} +2 -2
  80. package/dist/{chunk-pwk7epmy.js → chunk-8x7a5n2w.js} +2 -2
  81. package/dist/{chunk-82e3194f.js → chunk-8yetzgqb.js} +2 -2
  82. package/dist/{chunk-enc99kvz.js → chunk-8zkn8x2j.js} +2 -2
  83. package/dist/chunk-95f0wens.js +2 -0
  84. package/dist/{chunk-3dbxzwcz.js → chunk-9ghxym50.js} +2 -2
  85. package/dist/{chunk-f84mdhkx.js → chunk-9hts7x5n.js} +2 -2
  86. package/dist/{chunk-basmnv1z.js → chunk-9hwqfjc1.js} +2 -2
  87. package/dist/{chunk-zhf7403q.js → chunk-9ns2xh84.js} +2 -2
  88. package/dist/{chunk-vqqafkcx.js → chunk-9nz4c647.js} +2 -2
  89. package/dist/{chunk-8q5zwkry.js → chunk-a2tkhes5.js} +2 -2
  90. package/dist/{chunk-jhaf3qtt.js → chunk-a4ebhcsy.js} +2 -2
  91. package/dist/{chunk-3d3z6dam.js → chunk-aeccrrg1.js} +2 -2
  92. package/dist/{chunk-y47sn7w2.js → chunk-aemtk0r5.js} +2 -2
  93. package/dist/{chunk-ky3n1mza.js → chunk-afnnrn6z.js} +2 -2
  94. package/dist/chunk-aj0z9a5r.js +2 -0
  95. package/dist/{chunk-p9x6rya1.js → chunk-aj6yxm6d.js} +2 -2
  96. package/dist/{chunk-9pm3vzgx.js → chunk-aq3hemsb.js} +3 -3
  97. package/dist/{chunk-rsbced6k.js → chunk-b0zzq2ky.js} +2 -2
  98. package/dist/{chunk-nf7q3crw.js → chunk-b3mja7d9.js} +3 -3
  99. package/dist/{chunk-pyqhwz2d.js → chunk-b6kn9ack.js} +3 -3
  100. package/dist/{chunk-znafsq0a.js → chunk-b8tx1n1a.js} +2 -2
  101. package/dist/chunk-bdea3k6b.js +2 -0
  102. package/dist/{chunk-nec3tcjh.js → chunk-bm457bsd.js} +2 -2
  103. package/dist/chunk-bt42z99s.js +2 -0
  104. package/dist/{chunk-egbb5295.js → chunk-by7k0ypx.js} +2 -2
  105. package/dist/{chunk-p6ffd8yn.js → chunk-bysgsnph.js} +2 -2
  106. package/dist/{chunk-ma6ycen5.js → chunk-c0czkyzh.js} +2 -2
  107. package/dist/chunk-c70a2esc.js +2 -0
  108. package/dist/{chunk-enbvjbcm.js → chunk-ccner90h.js} +2 -2
  109. package/dist/{chunk-x0etjzy8.js → chunk-cgpnhrm5.js} +3 -3
  110. package/dist/{chunk-7hfd7hnm.js → chunk-chjt1pct.js} +2 -2
  111. package/dist/{chunk-3eetka54.js → chunk-ck70ewc8.js} +2 -2
  112. package/dist/{chunk-fpsn6fmf.js → chunk-ckft9abb.js} +2 -2
  113. package/dist/{chunk-7a806p3q.js → chunk-d0zazfrq.js} +3 -3
  114. package/dist/{chunk-fy8dmpv3.js → chunk-d607659a.js} +2 -2
  115. package/dist/{chunk-4hasepkm.js → chunk-d84xx4bh.js} +2 -2
  116. package/dist/{chunk-x4bzkzbt.js → chunk-db8hae9d.js} +2 -2
  117. package/dist/chunk-ddaz4j9s.js +2 -0
  118. package/dist/{chunk-4vfrxhj4.js → chunk-dhx1sd4s.js} +2 -2
  119. package/dist/{chunk-gh1rtwrb.js → chunk-dzncwejn.js} +2 -2
  120. package/dist/chunk-e99t3sk5.js +2 -0
  121. package/dist/{chunk-5p53j8mf.js → chunk-ebkz1sy2.js} +2 -2
  122. package/dist/chunk-eevfr0tx.js +2 -0
  123. package/dist/{chunk-7z1k4s4f.js → chunk-enkrqfqq.js} +2 -2
  124. package/dist/{chunk-rej2s2c0.js → chunk-epqqzh99.js} +2 -2
  125. package/dist/{chunk-kvwyryw2.js → chunk-epqyjwrh.js} +2 -2
  126. package/dist/{chunk-e31s069c.js → chunk-evgfpd16.js} +2 -2
  127. package/dist/chunk-eyw05qyj.js +4 -0
  128. package/dist/{chunk-15m908ph.js → chunk-f2h074g0.js} +2 -2
  129. package/dist/{chunk-c531krny.js → chunk-fggwwmzc.js} +3 -3
  130. package/dist/{chunk-544g9fky.js → chunk-fqchnswc.js} +2 -2
  131. package/dist/{chunk-cfj92m1y.js → chunk-fvmnj6bg.js} +2 -2
  132. package/dist/chunk-fxzh4f7c.js +4 -0
  133. package/dist/chunk-fzfwftqs.js +2 -0
  134. package/dist/{chunk-kx9nnmwb.js → chunk-g9v0jr0f.js} +3 -3
  135. package/dist/{chunk-mfrg4vze.js → chunk-ged1nyhk.js} +5 -5
  136. package/dist/chunk-gk7nn747.js +2 -0
  137. package/dist/chunk-gmns080g.js +2 -0
  138. package/dist/chunk-gw4zbw0m.js +2 -0
  139. package/dist/{chunk-3vdx0cme.js → chunk-gy446wcz.js} +2 -2
  140. package/dist/chunk-h71pkpwg.js +2 -0
  141. package/dist/{chunk-3a8qwbgh.js → chunk-ha1s3jbc.js} +3 -3
  142. package/dist/{chunk-zvfad5gd.js → chunk-hfjttc7r.js} +2 -2
  143. package/dist/{chunk-e6wq8gef.js → chunk-hqc5c3nz.js} +3 -3
  144. package/dist/{chunk-r84xcy0d.js → chunk-hwhyyaen.js} +2 -2
  145. package/dist/{chunk-qmx3t5he.js → chunk-j1t1fnew.js} +2 -2
  146. package/dist/chunk-j2bp0zbe.js +2 -0
  147. package/dist/{chunk-tftgnw1w.js → chunk-jne0bc79.js} +2 -2
  148. package/dist/chunk-jtws1jg5.js +2 -0
  149. package/dist/{chunk-zmr5pwhd.js → chunk-jygp7479.js} +2 -2
  150. package/dist/{chunk-5f7t16kj.js → chunk-jz7mckdp.js} +2 -2
  151. package/dist/{chunk-hpv8x22r.js → chunk-k014w2jg.js} +2 -2
  152. package/dist/{chunk-rfkgks0a.js → chunk-k0h18sme.js} +2 -2
  153. package/dist/{chunk-xg6ayxsy.js → chunk-k1w3acq7.js} +2 -2
  154. package/dist/{chunk-m8243rnx.js → chunk-k5065dzv.js} +2 -2
  155. package/dist/chunk-k97dpdcj.js +2 -0
  156. package/dist/{chunk-c4rptwfx.js → chunk-kgx0jj22.js} +3 -3
  157. package/dist/chunk-khd2r3jh.js +2 -0
  158. package/dist/{chunk-84zzf0ys.js → chunk-kk9dbwd1.js} +2 -2
  159. package/dist/chunk-kvgn4b2n.js +2 -0
  160. package/dist/{chunk-1jznzjzn.js → chunk-mg9a4t04.js} +2 -2
  161. package/dist/{chunk-kn1j4cy1.js → chunk-mgve4dcw.js} +2 -2
  162. package/dist/{chunk-akgjyyz8.js → chunk-mgwkmr8g.js} +2 -2
  163. package/dist/{chunk-qk1yqepm.js → chunk-mhrn3e8j.js} +2 -2
  164. package/dist/{chunk-705j0x4q.js → chunk-mkawbqx5.js} +2 -2
  165. package/dist/chunk-mp5f940y.js +1 -0
  166. package/dist/chunk-mybye5t2.js +2 -0
  167. package/dist/{chunk-bf7sgpzq.js → chunk-n4rep234.js} +2 -2
  168. package/dist/{chunk-wbnmcagf.js → chunk-nebke41s.js} +3 -3
  169. package/dist/{chunk-nqt9gyz9.js → chunk-newkrtrj.js} +2 -2
  170. package/dist/{chunk-j9f4mh66.js → chunk-nfnejf16.js} +2 -2
  171. package/dist/{chunk-tss25z64.js → chunk-njw6x85v.js} +3 -3
  172. package/dist/{chunk-2d4zb2ac.js → chunk-npt6at4f.js} +2 -2
  173. package/dist/chunk-nrfyvzmk.js +2 -0
  174. package/dist/{chunk-3dvxhfcr.js → chunk-nvadhyne.js} +2 -2
  175. package/dist/{chunk-g2ew3jg9.js → chunk-p2bn8ypc.js} +2 -2
  176. package/dist/chunk-pnx0f495.js +2 -0
  177. package/dist/{chunk-k1f40yn4.js → chunk-ppcwcrdz.js} +2 -2
  178. package/dist/chunk-prr551k0.js +2 -0
  179. package/dist/chunk-pvm6d77q.js +2 -0
  180. package/dist/{chunk-af0e5epn.js → chunk-pxbww0j1.js} +2 -2
  181. package/dist/{chunk-n96z8etk.js → chunk-pz5d0vgv.js} +2 -2
  182. package/dist/chunk-q2ykvjrz.js +2 -0
  183. package/dist/chunk-q8c4k6qh.js +2 -0
  184. package/dist/{chunk-1pnbntv2.js → chunk-q8y2a23c.js} +2 -2
  185. package/dist/{chunk-fxdkhe0d.js → chunk-qbmgsd3h.js} +2 -2
  186. package/dist/{chunk-6yx869ht.js → chunk-qbpy0aqe.js} +2 -2
  187. package/dist/chunk-qgrd5xre.js +2 -0
  188. package/dist/{chunk-v6x7x69b.js → chunk-qkddvxjr.js} +2 -2
  189. package/dist/chunk-qv61ef2y.js +2 -0
  190. package/dist/{chunk-ep9z16w6.js → chunk-qvdfrmpb.js} +2 -2
  191. package/dist/chunk-qvzxzzw8.js +2 -0
  192. package/dist/{chunk-k3h77wtz.js → chunk-r2b234a7.js} +2 -2
  193. package/dist/{chunk-mahky9ad.js → chunk-ra52dqfb.js} +2 -2
  194. package/dist/{chunk-hj8nkk6a.js → chunk-rb6mjycp.js} +2 -2
  195. package/dist/{chunk-rhptdqpp.js → chunk-rbs3079t.js} +2 -2
  196. package/dist/chunk-rcynxrkk.js +4 -0
  197. package/dist/{chunk-m31f2m2y.js → chunk-rms7wj04.js} +2 -2
  198. package/dist/{chunk-8zsta2p3.js → chunk-rntrfb49.js} +2 -2
  199. package/dist/{chunk-33bd1ey8.js → chunk-rxj5619b.js} +2 -2
  200. package/dist/{chunk-k76s8cq2.js → chunk-ry5phnnk.js} +2 -2
  201. package/dist/{chunk-xckysrk7.js → chunk-s11mgwyh.js} +2 -2
  202. package/dist/{chunk-q988bycf.js → chunk-s170cg6j.js} +2 -2
  203. package/dist/{chunk-zwpv75f4.js → chunk-s1w3j9p9.js} +2 -2
  204. package/dist/{chunk-11kv54bx.js → chunk-sfd0pp49.js} +3 -3
  205. package/dist/chunk-shzj5zf0.js +2 -0
  206. package/dist/chunk-sk9rm826.js +2 -0
  207. package/dist/chunk-svxnx1c7.js +2 -0
  208. package/dist/chunk-symaxskd.js +2 -0
  209. package/dist/chunk-t3rv7vat.js +2 -0
  210. package/dist/{chunk-r8gfcyeb.js → chunk-t6ddgvkm.js} +2 -2
  211. package/dist/chunk-th5vv83g.js +2 -0
  212. package/dist/{chunk-spqfmr4z.js → chunk-tj4b0s68.js} +2 -2
  213. package/dist/chunk-veef1avy.js +2 -0
  214. package/dist/chunk-vgxvtmja.js +2 -0
  215. package/dist/{chunk-0zncrzar.js → chunk-vjfxm73q.js} +2 -2
  216. package/dist/chunk-vnxa4qe2.js +2 -0
  217. package/dist/{chunk-5jvpeww3.js → chunk-vq060dnz.js} +2 -2
  218. package/dist/{chunk-hwppy236.js → chunk-vyvsm4v9.js} +2 -2
  219. package/dist/{chunk-8w5bt0nc.js → chunk-w1yrsbw1.js} +2 -2
  220. package/dist/{chunk-3y9az4b9.js → chunk-w2p1g8rp.js} +2 -2
  221. package/dist/{chunk-mjd3839j.js → chunk-w4537026.js} +2 -2
  222. package/dist/chunk-wexhc7rb.js +2 -0
  223. package/dist/{chunk-xmesmh1h.js → chunk-wf0ytnh9.js} +2 -2
  224. package/dist/{chunk-9m36e0yq.js → chunk-wf4z9w5x.js} +2 -2
  225. package/dist/{chunk-036wyz4n.js → chunk-whax282d.js} +2 -2
  226. package/dist/{chunk-chg6j0zg.js → chunk-wrxj79ct.js} +2 -2
  227. package/dist/{chunk-p72pzfww.js → chunk-xanfp0nh.js} +2 -2
  228. package/dist/{chunk-abbpbnjj.js → chunk-xjf2zkrg.js} +2 -2
  229. package/dist/{chunk-cy5kh1yr.js → chunk-xqrhfxct.js} +2 -2
  230. package/dist/chunk-xxwevgqr.js +2 -0
  231. package/dist/{chunk-wkbxdz82.js → chunk-y5qzgfsd.js} +2 -2
  232. package/dist/chunk-y72y3j24.js +2 -0
  233. package/dist/{chunk-askwff3a.js → chunk-y8aeahf2.js} +3 -3
  234. package/dist/chunk-ygake3bx.js +2 -0
  235. package/dist/{chunk-67a3eqhg.js → chunk-ymdhz3x0.js} +2 -2
  236. package/dist/{chunk-02sj8dwy.js → chunk-ytkcpeq2.js} +2 -2
  237. package/dist/{chunk-h3geg09z.js → chunk-z27pxeqg.js} +2 -2
  238. package/dist/{chunk-x4brdfv3.js → chunk-z53fd30n.js} +2 -2
  239. package/dist/{chunk-mfmh7ztq.js → chunk-zjzzqtaj.js} +2 -2
  240. package/dist/{chunk-ggxdrm0c.js → chunk-zpetyx45.js} +2 -2
  241. package/dist/chunk-zpm0t5ye.js +2 -0
  242. package/dist/chunk-ztrkk6sp.js +2 -0
  243. package/dist/client.js +1 -1
  244. package/dist/codex/activity-group.js +1 -1
  245. package/dist/codex/artifact-links.js +1 -1
  246. package/dist/codex/assistant-message.js +1 -1
  247. package/dist/codex/async-question-card.js +1 -1
  248. package/dist/codex/disclosure-state.js +1 -1
  249. package/dist/codex/edited-files-card.js +1 -1
  250. package/dist/codex/image-view-activity.js +1 -1
  251. package/dist/codex/markdown-renderer.js +1 -1
  252. package/dist/codex/navigation-audio.js +1 -1
  253. package/dist/codex/navigation-preview.js +1 -1
  254. package/dist/codex/navigation-rail.js +1 -1
  255. package/dist/codex/patch-view.js +1 -1
  256. package/dist/codex/plan.js +1 -1
  257. package/dist/codex/timeline-virtualizer.js +1 -1
  258. package/dist/codex/turn-activity.js +1 -1
  259. package/dist/codex/user-message.js +1 -1
  260. package/dist/codex/virtualized-turn-list.js +1 -1
  261. package/dist/collections/collection-emoji.js +1 -1
  262. package/dist/collections/collection-menu.js +1 -1
  263. package/dist/collections/collection-panel.js +1 -1
  264. package/dist/collections/collections.js +1 -1
  265. package/dist/collections/host.js +1 -1
  266. package/dist/collections/locales.js +1 -1
  267. package/dist/collections/model.js +1 -1
  268. package/dist/collections/store.js +1 -1
  269. package/dist/composer/completion-filter.js +1 -1
  270. package/dist/composer/completion-menu.js +1 -1
  271. package/dist/composer/completion-trigger.js +1 -1
  272. package/dist/composer/effort-slider.js +1 -1
  273. package/dist/composer/inline-document.js +1 -1
  274. package/dist/composer/inline-dom.js +1 -1
  275. package/dist/composer/menu-radio.js +1 -1
  276. package/dist/composer/model-select.js +1 -1
  277. package/dist/composer/permission-mode-select.js +1 -1
  278. package/dist/composer/prompt-input-attachments.js +1 -1
  279. package/dist/composer/prompt-input-clipboard.js +1 -1
  280. package/dist/composer/prompt-input-context.d.ts +9 -0
  281. package/dist/composer/prompt-input-context.js +1 -1
  282. package/dist/composer/prompt-input-inline.js +1 -1
  283. package/dist/composer/prompt-input-textarea.js +1 -1
  284. package/dist/composer/prompt-input.js +1 -1
  285. package/dist/conversation/action-card.js +1 -1
  286. package/dist/conversation/composer/app-mentions.js +1 -1
  287. package/dist/conversation/composer/apps-menu.js +1 -1
  288. package/dist/conversation/composer/composer-menu.js +1 -1
  289. package/dist/conversation/composer/composer.js +1 -1
  290. package/dist/conversation/composer/config-options.js +1 -1
  291. package/dist/conversation/composer/context.js +1 -1
  292. package/dist/conversation/composer/drafts.js +1 -1
  293. package/dist/conversation/composer/file-items.js +1 -1
  294. package/dist/conversation/composer/long-text.js +1 -1
  295. package/dist/conversation/composer/mention-chips.js +1 -1
  296. package/dist/conversation/composer/mention-uri.js +1 -1
  297. package/dist/conversation/composer/model-menu.js +1 -1
  298. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  299. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  300. package/dist/conversation/composer/prediction.js +1 -1
  301. package/dist/conversation/composer/prompt-history.js +1 -1
  302. package/dist/conversation/composer/slash-command-button.js +1 -1
  303. package/dist/conversation/composer/submit-button.js +1 -1
  304. package/dist/conversation/composer/usage-meter.js +1 -1
  305. package/dist/conversation/connection-notice.js +1 -1
  306. package/dist/conversation/context.js +1 -1
  307. package/dist/conversation/conversation-body.js +1 -1
  308. package/dist/conversation/conversation-search.js +1 -1
  309. package/dist/conversation/conversation-view.js +1 -1
  310. package/dist/conversation/conversation.js +1 -1
  311. package/dist/conversation/diff-modal.js +1 -1
  312. package/dist/conversation/draft-project-picker.js +1 -1
  313. package/dist/conversation/session-actions.js +1 -1
  314. package/dist/conversation/subagent-sessions.js +1 -1
  315. package/dist/conversation/subagent-tasks.js +1 -1
  316. package/dist/desktop/desktop-composer.d.ts +2 -1
  317. package/dist/desktop/desktop-composer.js +1 -1
  318. package/dist/desktop/desktop.js +1 -1
  319. package/dist/desktop/draft-model-select.js +1 -1
  320. package/dist/desktop/load-image.js +1 -1
  321. package/dist/desktop/model-catalog.js +1 -1
  322. package/dist/desktop/model-recovery.js +1 -1
  323. package/dist/desktop/model-settings-action.js +1 -1
  324. package/dist/desktop/native-file-drop.d.ts +3 -1
  325. package/dist/desktop/native-file-drop.js +1 -1
  326. package/dist/generated/commands.d.ts +66 -65
  327. package/dist/generated/commands.js +1 -1
  328. package/dist/generated-image-storage.d.ts +11 -0
  329. package/dist/generated-image-storage.js +1 -0
  330. package/dist/image-lightbox.js +1 -1
  331. package/dist/image-preview-dialog.js +1 -1
  332. package/dist/image.d.ts +5 -1
  333. package/dist/image.js +1 -1
  334. package/dist/lib/app-reference.js +1 -1
  335. package/dist/lib/application-metadata.js +1 -1
  336. package/dist/lib/chat-path.js +1 -1
  337. package/dist/lib/code-highlighter.js +1 -1
  338. package/dist/lib/file-url.js +1 -1
  339. package/dist/lib/fuzzy.js +1 -1
  340. package/dist/lib/group-blocks.js +1 -1
  341. package/dist/lib/image-encode.js +1 -1
  342. package/dist/lib/limits.js +1 -1
  343. package/dist/lib/markdown-parser.js +1 -1
  344. package/dist/lib/markdown-rules.js +1 -1
  345. package/dist/lib/model-name.js +1 -1
  346. package/dist/lib/pointer-centered-zoom.js +1 -1
  347. package/dist/lib/prepare-prompt-files.d.ts +2 -2
  348. package/dist/lib/prepare-prompt-files.js +1 -1
  349. package/dist/lib/reference-presentation.js +1 -1
  350. package/dist/lib/stream-style.js +1 -1
  351. package/dist/lib/streaming-markdown.js +1 -1
  352. package/dist/lib/tool-artifacts.js +1 -1
  353. package/dist/locales.js +1 -1
  354. package/dist/mermaid/diagram.js +1 -1
  355. package/dist/mermaid/export.js +1 -1
  356. package/dist/mermaid/index.js +1 -1
  357. package/dist/mermaid/preview.js +1 -1
  358. package/dist/oauth/claude-login.js +1 -1
  359. package/dist/oauth.js +1 -1
  360. package/dist/plugins/catalog-header.js +1 -1
  361. package/dist/plugins/catalog-skeleton.js +1 -1
  362. package/dist/plugins/host.js +1 -1
  363. package/dist/plugins/locales.js +1 -1
  364. package/dist/plugins/new-chat-directory.js +1 -1
  365. package/dist/plugins/pane.js +1 -1
  366. package/dist/plugins/panel-item.js +1 -1
  367. package/dist/plugins/plugin-detail-page.js +1 -1
  368. package/dist/plugins/plugin-icon.js +1 -1
  369. package/dist/plugins/plugin-icons.js +1 -1
  370. package/dist/plugins/plugins-page.js +1 -1
  371. package/dist/plugins/plugins.js +1 -1
  372. package/dist/plugins/read-skill-document.js +1 -1
  373. package/dist/plugins/skill-document.js +1 -1
  374. package/dist/plugins/skills-tab.js +1 -1
  375. package/dist/plugins/store.js +1 -1
  376. package/dist/plugins/toolbox-layout.js +1 -1
  377. package/dist/reference-projection.js +1 -1
  378. package/dist/search/chat-search.js +1 -1
  379. package/dist/search/codex-source-matches.js +1 -1
  380. package/dist/search/dom-matches.js +1 -1
  381. package/dist/search/find-bar.js +1 -1
  382. package/dist/search/literal-matches.js +1 -1
  383. package/dist/session-list/account-menu.js +1 -1
  384. package/dist/session-list/activity-list.js +1 -1
  385. package/dist/session-list/archived-sessions.js +1 -1
  386. package/dist/session-list/help-menu.js +1 -1
  387. package/dist/session-list/highlight.js +1 -1
  388. package/dist/session-list/host.js +1 -1
  389. package/dist/session-list/hover-info-card.js +1 -1
  390. package/dist/session-list/locales.js +1 -1
  391. package/dist/session-list/navigation-controls.js +1 -1
  392. package/dist/session-list/navigation-header.js +1 -1
  393. package/dist/session-list/navigation-store.js +1 -1
  394. package/dist/session-list/navigation-tabs.js +1 -1
  395. package/dist/session-list/navigation.js +1 -1
  396. package/dist/session-list/platform.js +1 -1
  397. package/dist/session-list/row-stop-button.js +1 -1
  398. package/dist/session-list/session-groups.js +1 -1
  399. package/dist/session-list/session-info-card.js +1 -1
  400. package/dist/session-list/session-list.js +1 -1
  401. package/dist/session-list/session-row.js +1 -1
  402. package/dist/session-list/session-state-dot.js +1 -1
  403. package/dist/session-list/session-state-menu.js +1 -1
  404. package/dist/session-list/shortcut-hint.js +1 -1
  405. package/dist/session-list/shortcut.js +1 -1
  406. package/dist/session-list/sidebar-overlay.js +1 -1
  407. package/dist/session-list/trailing-swap.js +1 -1
  408. package/dist/session-list/use-activity-notification.js +1 -1
  409. package/dist/session-list/use-activity-preview.js +1 -1
  410. package/dist/session-list/use-cmd-held.js +1 -1
  411. package/dist/session-list/use-project-sessions.js +1 -1
  412. package/dist/session-list/virtual-session-rows.js +1 -1
  413. package/dist/session-timeline/activity-group.js +1 -1
  414. package/dist/session-timeline/activity-projection.js +1 -1
  415. package/dist/session-timeline/assistant-content.js +1 -1
  416. package/dist/session-timeline/assistant-image-references.js +1 -1
  417. package/dist/session-timeline/assistant-turn.js +1 -1
  418. package/dist/session-timeline/async-questions.js +1 -1
  419. package/dist/session-timeline/edited-files-card.js +1 -1
  420. package/dist/session-timeline/history-timeline.js +1 -1
  421. package/dist/session-timeline/host.js +1 -1
  422. package/dist/session-timeline/image-generation-progress.js +1 -1
  423. package/dist/session-timeline/navigation-rail.js +1 -1
  424. package/dist/session-timeline/plan.js +1 -1
  425. package/dist/session-timeline/question-reply.js +1 -1
  426. package/dist/session-timeline/resource-content.js +1 -1
  427. package/dist/session-timeline/session-timeline.js +1 -1
  428. package/dist/session-timeline/timeline-registry.js +1 -1
  429. package/dist/session-timeline/turn-activity.js +1 -1
  430. package/dist/session-timeline/turn-error.js +1 -1
  431. package/dist/session-timeline/turn-retry.js +1 -1
  432. package/dist/session-timeline/turn-time.js +1 -1
  433. package/dist/session-timeline/turns.js +1 -1
  434. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  435. package/dist/session-timeline/user-message.js +1 -1
  436. package/dist/settings/codex-account-card.js +1 -1
  437. package/dist/settings/login-card.js +1 -1
  438. package/dist/settings/model-alias-settings.js +1 -1
  439. package/dist/settings/model-aliases.js +1 -1
  440. package/dist/settings/provider-logos.d.ts +3 -1
  441. package/dist/settings/provider-logos.js +1 -1
  442. package/dist/settings/provider-section.js +1 -1
  443. package/dist/settings/providers-port.js +1 -1
  444. package/dist/settings/providers.d.ts +2 -4
  445. package/dist/settings/providers.js +1 -1
  446. package/dist/settings/settings-bridge.js +1 -1
  447. package/dist/settings/settings.d.ts +1 -1
  448. package/dist/settings/settings.js +1 -1
  449. package/native/win32-x64/alwith_native_chat.dll +0 -0
  450. package/native/win32-x64/artifact.json +1 -1
  451. package/package.json +3 -3
  452. package/assets/catalogs/openrouter/models.json +0 -215
  453. package/dist/chunk-06mvwewp.js +0 -2
  454. package/dist/chunk-1jxvmsgm.js +0 -2
  455. package/dist/chunk-1wk1yw69.js +0 -2
  456. package/dist/chunk-23r2z6bp.js +0 -2
  457. package/dist/chunk-2ay0m7xn.js +0 -2
  458. package/dist/chunk-2qa3c571.js +0 -2
  459. package/dist/chunk-2reym9jt.js +0 -4
  460. package/dist/chunk-2w3c4tg8.js +0 -2
  461. package/dist/chunk-3myhs627.js +0 -2
  462. package/dist/chunk-5e575zvm.js +0 -2
  463. package/dist/chunk-5hjk7xnq.js +0 -2
  464. package/dist/chunk-5t2ge7gg.js +0 -2
  465. package/dist/chunk-680e6bz4.js +0 -2
  466. package/dist/chunk-68a1sgrr.js +0 -3
  467. package/dist/chunk-69965ctr.js +0 -4
  468. package/dist/chunk-6ewv4vns.js +0 -2
  469. package/dist/chunk-6wsr59dr.js +0 -2
  470. package/dist/chunk-7f5xngd2.js +0 -2
  471. package/dist/chunk-8at9k0cn.js +0 -2
  472. package/dist/chunk-8byhp88a.js +0 -2
  473. package/dist/chunk-a0qy1r02.js +0 -2
  474. package/dist/chunk-b5g055qp.js +0 -2
  475. package/dist/chunk-b7gntaap.js +0 -4
  476. package/dist/chunk-b89bzpce.js +0 -2
  477. package/dist/chunk-c4mm4fzg.js +0 -2
  478. package/dist/chunk-cjj5bxdb.js +0 -2
  479. package/dist/chunk-cr0pb6g0.js +0 -2
  480. package/dist/chunk-d9q9qgm1.js +0 -2
  481. package/dist/chunk-eb78ebxa.js +0 -2
  482. package/dist/chunk-ekfs7wrp.js +0 -2
  483. package/dist/chunk-fbrv2v3t.js +0 -1
  484. package/dist/chunk-fer4r3b8.js +0 -2
  485. package/dist/chunk-h77c4pnj.js +0 -2
  486. package/dist/chunk-hjbq9ez1.js +0 -2
  487. package/dist/chunk-hzcerz8j.js +0 -2
  488. package/dist/chunk-jfyz3rx6.js +0 -2
  489. package/dist/chunk-jnpkpe5t.js +0 -2
  490. package/dist/chunk-jp2s1xsa.js +0 -2
  491. package/dist/chunk-ky4j58wz.js +0 -2
  492. package/dist/chunk-m6yg0dc9.js +0 -2
  493. package/dist/chunk-p0v9d7e1.js +0 -2
  494. package/dist/chunk-p9226dye.js +0 -2
  495. package/dist/chunk-qj87dxrr.js +0 -2
  496. package/dist/chunk-qm9c9sd7.js +0 -2
  497. package/dist/chunk-qth2ames.js +0 -2
  498. package/dist/chunk-qyfkwznx.js +0 -2
  499. package/dist/chunk-rayhzb8p.js +0 -2
  500. package/dist/chunk-rkqptd9w.js +0 -2
  501. package/dist/chunk-srqs8z90.js +0 -2
  502. package/dist/chunk-twwcd2qv.js +0 -2
  503. package/dist/chunk-tzb4b5ve.js +0 -2
  504. package/dist/chunk-v92wj4tv.js +0 -2
  505. package/dist/chunk-wg223rq3.js +0 -2
  506. package/dist/chunk-wv6ntscn.js +0 -2
  507. package/dist/chunk-wvm8srp7.js +0 -2
  508. package/dist/chunk-x03z0hme.js +0 -2
  509. package/dist/chunk-y2bb2ey4.js +0 -2
  510. package/dist/chunk-zdqjjwx0.js +0 -2
@@ -1,2 +1,2 @@
1
- import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function Yt({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function B({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
2
- export{Yt,B};
1
+ import{cn as f}from"cn";import{jsx as e,jsxs as a,Fragment as v}from"react/jsx-runtime";function ln({title:r,titleIcon:t,body:o,rows:d,details:n,actions:s}){return a("div",{"data-slot":"hover-info-card",className:"flex flex-col gap-1.5",children:[a("div",{"data-slot":"hover-info-card-summary",className:"flex min-w-0 flex-col gap-1",children:[a("div",{"data-slot":"hover-info-card-title-row",className:"flex min-w-0 items-center gap-1.5",children:[t!=null&&e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t}),e("div",{"data-slot":"hover-info-card-title",className:"text-foreground line-clamp-2 min-w-0 flex-1 text-sm break-words",children:r})]}),o!=null&&e("div",{"data-slot":"hover-info-card-body",className:"text-muted-foreground line-clamp-2 text-xs break-words",children:o}),e(i,{rows:d})]}),n!=null&&n.length>0&&e("div",{"data-slot":"hover-info-card-details",className:"flex min-w-0 flex-col gap-1.5",children:e(i,{rows:n})}),s!=null&&a(v,{children:[e("div",{"data-slot":"hover-info-card-separator",className:"bg-border -mx-3 mt-1.5 h-px"}),e("div",{"data-slot":"hover-info-card-actions",className:"-mx-1 flex flex-col",children:s})]})]})}function i({rows:r}){return r?.map((t,o)=>a("div",{"data-slot":"hover-info-card-row",className:"text-muted-foreground flex items-start gap-1.5 text-xs",children:[e("span",{"data-slot":"hover-info-card-icon",className:"flex h-5 w-4 shrink-0 items-center justify-center",children:t.icon}),e("span",{className:"min-w-0 break-all",children:t.text})]},o))}function B({icon:r,label:t,trailing:o,disabled:d,onClick:n,variant:s="default",className:l,...c}){return a("button",{...c,"data-slot":"hover-info-card-action","data-variant":s,type:"button",disabled:d,onClick:n,className:f("text-foreground hover:bg-foreground/5 active:bg-foreground/10 flex h-8 w-full items-center gap-2 rounded-sm px-2 text-start text-sm font-normal disabled:pointer-events-none disabled:opacity-50","[&_svg]:size-4 [&_svg]:shrink-0",s==="destructive"?"text-destructive [&_svg]:text-destructive":"[&_svg]:text-muted-foreground",l),children:[r,e("span",{className:"min-w-0 flex-1 truncate",children:t}),o]})}
2
+ export{ln,B};
@@ -0,0 +1,4 @@
1
+ import{no}from"./chunk-ry5phnnk.js";import{Ce}from"./chunk-ytkcpeq2.js";import{ds}from"./chunk-s1w3j9p9.js";import{w,Kt}from"./chunk-4g2412p5.js";import{t}from"./chunk-aj0z9a5r.js";import{_s,Is}from"./chunk-7tgfj1zb.js";import{C}from"./chunk-q2ykvjrz.js";import{be}from"./chunk-d607659a.js";import{isEmbeddedResource as g,isImage as x,isResourceLink as R,isText as h}from"@nyssance/codex-acp-v2/client";import{memo as v}from"react";import{jsx as i,jsxs as y}from"react/jsx-runtime";var cs=v(function({item:n,messageTime:f,skillNames:u=[]}){let p=t(),r=Is(n._meta),m=r?r.map((e)=>e.question===void 0?e.text:`${e.question}
2
+ ${e.text}`).join(`
3
+ `):be(n),l=n.content.filter(x),d=new Set(Kt(m).map((e)=>e.id)),o=new Map,a=n.content.filter((e)=>{if(R(e)){let s=w(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(h).map((e)=>{let s=_s(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 y("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(C,{block:e},`${n.id}:${s}`))}),i(no,{value:{names:u,icon:p.skillIcon},children:i(ds,{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(Ce,{app:e},e.id))}):void 0,images:l,mentions:[],messageTime:f})})]})});
4
+ export{cs};
@@ -1,2 +1,2 @@
1
- import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function ve({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
- export{ve};
1
+ import{CheckCircleIcon as c,CircleIcon as o,LoaderIcon as i}from"lucide-react";import{jsx as n,jsxs as e}from"react/jsx-runtime";function xe({entries:s}){let d=s.filter((a)=>a.status==="completed").length,t=s.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[d,"/",s.length]}),t!==void 0&&e("span",{className:"codex-plan-active",children:["· ",t.content]})]}),n("div",{className:"codex-plan-entries",children:s.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&n(c,{"aria-hidden":"true"}),a.status==="in_progress"&&n(i,{className:"codex-plan-spinner","aria-hidden":"true"}),a.status==="pending"&&n(o,{"aria-hidden":"true"}),n("span",{children:a.content})]},a.content))})]})}
2
+ export{xe};
@@ -1,4 +1,4 @@
1
- import{Questionnaire as r}from"@shadcn/react/questionnaire";import{useEffect as N,useId as v,useRef as b}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Textarea as R}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as i,jsxs as c,Fragment as S}from"react/jsx-runtime";function p(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function D(e){if(!p(e)||!p(e.codex))return[];let n=e.codex,o=n.questions;if(n.delivery!=="async"||!Array.isArray(o))return[];if(!o.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((m)=>typeof m==="string"))))return[];return o}function qo(e,n){return JSON.stringify(["request_user_input_async",e,n])}function gs(e){return{selected:e.options?.length?0:null,text:""}}function Kn(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function fs(e){return`<send_user_message_question_reply>
1
+ import{Questionnaire as r}from"@shadcn/react/questionnaire";import{useEffect as N,useId as v,useRef as b}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Textarea as R}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as i,jsxs as c,Fragment as S}from"react/jsx-runtime";function p(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function D(e){if(!p(e)||!p(e.codex))return[];let n=e.codex,o=n.questions;if(n.delivery!=="async"||!Array.isArray(o))return[];if(!o.every((t)=>p(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((m)=>typeof m==="string"))))return[];return o}function Yo(e,n){return JSON.stringify(["request_user_input_async",e,n])}function bs(e){return{selected:e.options?.length?0:null,text:""}}function eo(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function Cs(e){return`<send_user_message_question_reply>
2
2
  ${JSON.stringify([e])}
3
- </send_user_message_question_reply>`}function Ko(e){if(!p(e)||!p(e.codex))return[];let n=e.codex;return(Array.isArray(n.questionReplyParts)?n.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[n.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:m,answer:y})=>({questionItemId:t,question:m,answer:y}))}function hs({question:e,draft:n,status:o,answer:t,error:m,onChange:y,onSubmit:x,onSkip:C,t:u}){let g=v(),h=b(!1),a=b(null);N(()=>()=>{if(a.current!==null)cancelAnimationFrame(a.current)},[]);let l=o==="pending",A=o==="answered"||o==="skipped",f=e.options??[],w=l&&Kn(e,n).trim().length>0,Q="flex cursor-pointer items-start gap-2 text-sm in-data-readonly:cursor-default in-data-readonly:opacity-50";return i("section",{"aria-labelledby":`${g}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:A?c(S,{children:[i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:e.title}),i("p",{className:"text-sm whitespace-pre-wrap",children:o==="answered"?t:u("asyncQuestion.skipped")})]}):c(r.Root,{items:f.length>0?[{name:"answer",choices:[...f.map((s,d)=>({value:String(d)})),{value:"other"}]}]:void 0,shortcuts:"letters",noValidate:!0,className:"flex min-w-0 flex-col gap-3",onSubmit:(s)=>{if(s.preventDefault(),w)x()},children:[c(r.Item,{name:"answer",className:"m-0 flex min-w-0 flex-col gap-3 border-0 p-0",children:[i(r.Title,{render:i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap"}),children:e.title}),f.length>0&&c(r.Choices,{className:"flex flex-col gap-2","aria-disabled":!l||void 0,"data-readonly":!l||void 0,children:[f.map((s,d)=>c(r.Choice,{value:String(d),checked:n.selected===d,onChange:()=>l&&y({...n,selected:d}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{className:"whitespace-pre-wrap",children:s})]},d)),c(r.Choice,{value:"other",checked:n.selected===null,onChange:()=>l&&y({...n,selected:null}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{children:u("asyncQuestion.other")})]})]}),i(r.Input,{render:i(R,{rows:1,className:"min-h-0 resize-none"}),onCompositionStart:()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null,h.current=!0},onCompositionEnd:()=>{if(h.current=!1,a.current!==null)cancelAnimationFrame(a.current);a.current=requestAnimationFrame(()=>{a.current=null})},onKeyDown:(s)=>{if(s.key==="Enter")s.stopPropagation();if(s.key!=="Enter"||s.shiftKey||s.altKey||s.ctrlKey||s.metaKey||h.current||a.current!==null||s.nativeEvent.isComposing||s.nativeEvent.keyCode===229)return;if(s.preventDefault(),l&&Kn(e,{...n,text:s.currentTarget.value}).trim().length>0)x()},"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:n.text,readOnly:!l,onChange:(s)=>y({selected:null,text:s.target.value})}),m&&i("p",{role:"alert",className:"text-destructive text-sm",children:m})]}),c("div",{className:"flex flex-wrap items-center gap-2",children:[i(r.Submit,{render:i(k,{size:"sm"}),disabled:!w,children:u(o==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),i(r.Skip,{render:i(k,{size:"sm",variant:"ghost"}),disabled:!l,onClick:C,children:u("asyncQuestion.skip")}),(o==="closed"||o==="unavailable")&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${o}`)})]})]})})}
4
- export{D,qo,gs,Kn,fs,Ko,hs};
3
+ </send_user_message_question_reply>`}function ei(e){if(!p(e)||!p(e.codex))return[];let n=e.codex;return(Array.isArray(n.questionReplyParts)?n.questionReplyParts.map((t)=>p(t)?{...t,answer:t.text}:t):[n.questionReply]).filter((t)=>p(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:m,answer:y})=>({questionItemId:t,question:m,answer:y}))}function ws({question:e,draft:n,status:o,answer:t,error:m,onChange:y,onSubmit:x,onSkip:C,t:u}){let g=v(),h=b(!1),a=b(null);N(()=>()=>{if(a.current!==null)cancelAnimationFrame(a.current)},[]);let l=o==="pending",A=o==="answered"||o==="skipped",f=e.options??[],w=l&&eo(e,n).trim().length>0,Q="flex cursor-pointer items-start gap-2 text-sm in-data-readonly:cursor-default in-data-readonly:opacity-50";return i("section",{"aria-labelledby":`${g}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:A?c(S,{children:[i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:e.title}),i("p",{className:"text-sm whitespace-pre-wrap",children:o==="answered"?t:u("asyncQuestion.skipped")})]}):c(r.Root,{items:f.length>0?[{name:"answer",choices:[...f.map((s,d)=>({value:String(d)})),{value:"other"}]}]:void 0,shortcuts:"letters",noValidate:!0,className:"flex min-w-0 flex-col gap-3",onSubmit:(s)=>{if(s.preventDefault(),w)x()},children:[c(r.Item,{name:"answer",className:"m-0 flex min-w-0 flex-col gap-3 border-0 p-0",children:[i(r.Title,{render:i("h3",{id:`${g}-title`,className:"text-sm font-medium whitespace-pre-wrap"}),children:e.title}),f.length>0&&c(r.Choices,{className:"flex flex-col gap-2","aria-disabled":!l||void 0,"data-readonly":!l||void 0,children:[f.map((s,d)=>c(r.Choice,{value:String(d),checked:n.selected===d,onChange:()=>l&&y({...n,selected:d}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{className:"whitespace-pre-wrap",children:s})]},d)),c(r.Choice,{value:"other",checked:n.selected===null,onChange:()=>l&&y({...n,selected:null}),className:Q,children:[i(r.ChoiceInput,{className:"accent-primary mt-0.5 size-4 shrink-0"}),i(r.ChoiceShortcut,{className:"text-muted-foreground w-4 shrink-0 font-mono text-xs uppercase"}),i(r.ChoiceLabel,{children:u("asyncQuestion.other")})]})]}),i(r.Input,{render:i(R,{rows:1,className:"min-h-0 resize-none"}),onCompositionStart:()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null,h.current=!0},onCompositionEnd:()=>{if(h.current=!1,a.current!==null)cancelAnimationFrame(a.current);a.current=requestAnimationFrame(()=>{a.current=null})},onKeyDown:(s)=>{if(s.key==="Enter")s.stopPropagation();if(s.key!=="Enter"||s.shiftKey||s.altKey||s.ctrlKey||s.metaKey||h.current||a.current!==null||s.nativeEvent.isComposing||s.nativeEvent.keyCode===229)return;if(s.preventDefault(),l&&eo(e,{...n,text:s.currentTarget.value}).trim().length>0)x()},"aria-label":u("asyncQuestion.answer"),placeholder:u("asyncQuestion.answer"),value:n.text,readOnly:!l,onChange:(s)=>y({selected:null,text:s.target.value})}),m&&i("p",{role:"alert",className:"text-destructive text-sm",children:m})]}),c("div",{className:"flex flex-wrap items-center gap-2",children:[i(r.Submit,{render:i(k,{size:"sm"}),disabled:!w,children:u(o==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),i(r.Skip,{render:i(k,{size:"sm",variant:"ghost"}),disabled:!l,onClick:C,children:u("asyncQuestion.skip")}),(o==="closed"||o==="unavailable")&&i("span",{role:"status",className:"text-muted-foreground text-xs",children:u(`asyncQuestion.${o}`)})]})]})})}
4
+ export{D,Yo,bs,eo,Cs,ei,ws};
@@ -1,2 +1,2 @@
1
- import{mo,kt}from"./chunk-cy5kh1yr.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function nt(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=mo(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Qa(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return kt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{nt,Qa};
1
+ import{xo,Nt}from"./chunk-xqrhfxct.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function at(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=xo(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function Ya(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Nt(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
+ export{at,Ya};
@@ -1,2 +1,2 @@
1
- import{Ne}from"./chunk-d9q9qgm1.js";function oi(r){let s=Ne(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function Me(r){return oi(r).join(Ne()?"":"+")}
2
- export{oi,Me};
1
+ import{Re}from"./chunk-e99t3sk5.js";function di(r){let s=Re(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function Ee(r){return di(r).join(Re()?"":"+")}
2
+ export{di,Ee};
@@ -0,0 +1,4 @@
1
+ import{yr}from"./chunk-q8c4k6qh.js";import{tr}from"./chunk-b6kn9ack.js";import{ys}from"./chunk-4g2412p5.js";import{m,_,Rt}from"./chunk-8yetzgqb.js";import{oe}from"./chunk-vnxa4qe2.js";import{rr,sr,ar,lr,cr}from"./chunk-pvm6d77q.js";import{mr,gr}from"./chunk-xjf2zkrg.js";import{H}from"./chunk-hfjttc7r.js";import{wo}from"./chunk-rcynxrkk.js";import{Co}from"./chunk-hqc5c3nz.js";import{Y}from"./chunk-h71pkpwg.js";import{n}from"./chunk-aj0z9a5r.js";import{e}from"./chunk-qgrd5xre.js";import{po,Gi}from"./chunk-epqqzh99.js";import{mo}from"./chunk-kvgn4b2n.js";import{r,Bi,X,In}from"./chunk-by7k0ypx.js";import{Cn}from"./chunk-6c7q2rz8.js";import{ot,Sn}from"./chunk-c70a2esc.js";import{Mn,An}from"./chunk-svxnx1c7.js";import{Oi}from"./chunk-3t3n8nfy.js";import{kn}from"./chunk-khd2r3jh.js";import{Hi}from"./chunk-a4ebhcsy.js";import{En}from"./chunk-zpm0t5ye.js";import{wn}from"./chunk-67fn9pq0.js";import{Fi}from"./chunk-g9v0jr0f.js";import{zi}from"./chunk-w4537026.js";import{Tn}from"./chunk-vyvsm4v9.js";import{hasFuzzyFileSearch as Gt}from"@nyssance/codex-acp-v2/client";import{useCallback as A,useEffect as Qt,useLayoutEffect as nt,useMemo as st,useRef as N,useState as M}from"react";import{jsx as s,jsxs as R}from"react/jsx-runtime";var Yt=["image/png","image/jpeg","image/webp","image/gif"],mt=[];async function kt(o){let T=await(await fetch(o.url)).blob();return new Promise((w,S)=>{let E=new FileReader;E.onerror=()=>S(E.error),E.onload=()=>{let q=E.result;w(q.slice(q.indexOf(",")+1))},E.readAsDataURL(T)})}function Ue({session:o,onSubmit:T,onShellCommand:w,onHandOff:S,modelSelector:E,modelMenu:q,inputHeader:dt,actions:Dt,leadingTools:Nt,agentControls:G=!0,placeholder:St,children:Ft,attachmentPolicy:ut,predictions:Ot=!0,disabled:_t=!1,preparing:ft=!1,allowPendingInput:Lt=!1}){let{host:F,client:O}=e(),{t:g}=F,z=A((t)=>{if(F.reportError)F.reportError(t);else console.error(t)},[F]),[ht,B]=M(()=>({text:r.get(o.id)?.text??"",revision:0})),{text:v}=ht,[C,Ut]=M(()=>r.get(o.id)?.attachments??mt),[y,Q]=M(()=>r.get(o.id)?.mentions??[]),[d,L]=M(()=>r.get(o.id)?.apps??[]),[gt,K]=M(()=>(r.get(o.id)?.apps?.length??0)>0||H(v,o.commands.map((t)=>t.name)).length>0),U=N(void 0),W=N(void 0);nt(()=>{if(d.length>0)K(!0)},[d.length]);let at=C.some((t)=>ot(t)&&t.pastedText.status!=="ready"),[k,xt]=M(!1),[V,Wt]=M(!1),[it,$t]=M(!1),ct=N(null),f=N(null),yt=N(null),c=N(ht),P=A((t)=>{yt.current?.(),c.current={text:t,revision:c.current.revision+1},B(c.current)},[]),bt=A((t)=>{let a=f.current;if(a?.insertApplication){a.insertApplication(t);return}let i=c.current.text,u=a?.getTextarea()?.selectionStart??i.length;W.current={text:i,apps:[]},U.current=u+1,K(!0),P(i),L((l)=>l.some((h)=>h.id===t.id)?l:[...l,{...t,offset:u}])},[P]),zt=A((t)=>{let a=f.current;if(a?.insertInvocation){a.insertInvocation(t);return}let i=c.current.text,u=a?.getTextarea(),l=u?.selectionStart??i.length,h=u?.selectionEnd??l,pt=`${i.slice(0,l)}${t} ${i.slice(h)}`;W.current={text:i,apps:[]},U.current=l+t.length+1,P(pt),K(!0)},[P]),vt=A(()=>(f.current?.focus(),f.current?.getTextarea()??null),[]),Bt=Fi(o,P,L,d.length>0||y.length>0||C.length>0),Pt=st(()=>({read:()=>{let a=f.current?.getTextarea(),i=a===null||a===void 0?[c.current.text.length,c.current.text.length]:[a.selectionStart,a.selectionEnd];return{target:o.id,...c.current,selection:i}},compareAndSet(a,i,u){if(f.current?.isComposing())return null;if(a.target!==o.id||a.revision!==c.current.revision)return null;c.current={text:i,revision:c.current.revision+1},B(c.current);let l=f.current?.getTextarea();if(l!==null&&l!==void 0)l.value=i,l.setSelectionRange(u[0],u[1]);return{target:o.id,...c.current,selection:u}}}),[o.id]),j=N(null),It=A((t)=>(j.current=t,()=>{if(j.current===t)j.current=null}),[]),J=o.state!=="idle",x=w!==void 0&&d.length===0&&v.startsWith("!"),Z=(gt||d.length>0)&&!x,b=!_t&&!ft&&o.attached&&!o.restoring&&!o.readOnly,D=!o.readOnly&&(Lt||b),tt=wn(o,b&&!k&&!V&&!at&&!it,v.length>0||C.length>0||y.length>0||d.length>0,Ot&&!x),wt=tt.invalidate;nt(()=>{r.set(o.id,{text:v,attachments:C,mentions:y,...d.length>0?{apps:d}:{},modelId:r.get(o.id)?.modelId??null})},[o.id,v,C,y,d]),nt(()=>Bi(o.id,Ut),[o.id]),nt(()=>In(o.id,(t,a)=>{if(!D||k)throw Error("The composer cannot take text now; try again later");if(a!=="append"&&(v.length||C.length||y.length||d.length))throw Error("The composer already has a draft; send or clear it first");P(t)}),[o.id,D,k,v,C,y,d,P]);let At=n((t)=>Gt(t.agent)),Ht=st(()=>At&&b?async(t)=>Cn((await O.fuzzyFileSearch({query:t,roots:[o.cwd],cancellationToken:null})).files):void 0,[O,At,b,o.cwd]),lt=A((t)=>{Q((a)=>a.includes(t)?a:[...a,t])},[]);Qt(()=>{f.current?.focus()},[]);let Tt=A(async({text:t,files:a})=>{let i=w!==void 0&&d.length===0&&t.startsWith("!")?t.slice(1):null;if(i!==null){if(i.trim().length===0)return;if(a.length||y.length||d.length)throw Error("Shell commands cannot include file references or attachments");if(o.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let u=t.trim();if(u.length===0&&a.length===0&&y.length===0&&d.length===0)return;let l=j.current;xt(!0);let h=r.get(o.id),pt=c.current.revision,et=null;try{let I=d.map((p)=>({type:"resource_link",name:p.name,uri:`app://${p.id}`}));for(let p of y){let rt={kind:"file",absPath:p};I.push({type:"resource_link",uri:Mn(rt),name:An(rt)})}let Et=ys(u,d);if(Et.length>0)I.push({type:"text",text:Et});for(let p of a)if(ot(p)){if(p.pastedText.status!=="ready")throw Error("Text attachment is not ready");I.push({type:"resource_link",uri:p.url,name:p.filename??"pasted-text.txt"})}else if(p.localImage){if(!p.sourcePath)throw Error("Local image requires a file path");I.push({type:"image",uri:Y(p.sourcePath),mimeType:p.mediaType,data:p.url?await kt(p):"",_meta:{"alwith.localImage":!0}})}else I.push({type:"image",data:await kt(p),mimeType:p.mediaType});if(c.current.revision===pt&&r.get(o.id)===h)c.current={text:"",revision:c.current.revision+1},et=c.current.revision,B(c.current),Q([]),L([]),U.current=void 0,W.current=void 0,X(o.id,()=>mt),r.set(o.id,{text:"",attachments:mt,mentions:[],apps:[],modelId:h?.modelId??null}),f.current?.resetHeight();if(i!==null&&w)await w(i);else if(T)if(l===null)await T(I);else await T(I,(p)=>{if(l.signal.aborted||j.current!==l)return;l.accept(p),S?.(o.id,p)});else if(l===null)await O.prompt(o.id,I);else{let p=await O.prompt(o.id,I);l.accept(p)}wt();for(let p of h?.attachments??[])if(p.url.startsWith("blob:")&&!r.get(o.id)?.attachments.some((rt)=>rt.id===p.id))URL.revokeObjectURL(p.url)}catch(I){if(h&&et!==null&&c.current.revision===et&&r.get(o.id)?.attachments.length===0&&r.get(o.id)?.mentions.length===0&&!r.get(o.id)?.apps?.length)c.current={text:h.text,revision:et+1},B(c.current),Q(h.mentions),L(h.apps??[]),r.set(o.id,h),X(o.id,()=>h.attachments);throw I}finally{xt(!1),f.current?.focus()}},[O,o.id,o.state,y,d,T,w,S,wt]),Kt=()=>{O.cancel(o.id).catch(z)},jt=A((t)=>{let a=t.code==="max_total_size"?Object.assign(Error(g("composer.imageTooLargeTitle")),{description:g("composer.imageTooLargeDescription",{mb:oe})}):Object.assign(Error(g("composer.unsupportedAttachmentTitle")),{description:g("composer.unsupportedAttachmentDescription")});z(a)},[z,g]),qt=st(()=>({session:o,ready:b,inputReady:D,sending:k,textareaRef:f,draft:Pt,interruptRef:yt,observeReceipts:It,addMention:lt,setAdding:Wt,shellMode:x,handsFree:!x&&(T===void 0||S!==void 0)}),[o,b,D,k,Pt,It,lt,T,S,x]),Ct=F.writeTextAttachment,Mt={className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:Bt,bashMode:w!==void 0,disabled:!D,"aria-label":g("composer.placeholder"),placeholder:x?"! command":tt.text||St||(J?g("composer.steerPlaceholder"):g("composer.placeholder")),onPasteCapture:(t)=>{if(!Z&&!x&&!t.currentTarget.disabled&&![...t.clipboardData.items].some((a)=>a.kind==="file"&&a.type.startsWith("image/"))){let a=Rt(t.clipboardData);if(a?.apps.length){t.preventDefault();let i=t.currentTarget,u=m(a),l=_([...i.value.slice(0,i.selectionStart).split(""),...u,...i.value.slice(i.selectionEnd).split("")]);W.current={text:v,apps:[]},U.current=i.selectionStart+u.length,K(!0),L(l.apps),P(l.text);return}}if(Ct)Sn(t,o.id,g("composer.pastedTextFilename"),Ct)}};return s(mo,{value:qt,children:s("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:R("div",{className:"relative",children:[dt&&s("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:dt}),s(yr,{attachmentPolicy:ut,value:v,revision:c.current.revision,onValueChange:P,onSubmittedClear:()=>{c.current={text:"",revision:c.current.revision+1},B(c.current)},attachments:C,onAttachmentsChange:(t)=>X(o.id,()=>t),children:R("div",{ref:ct,className:"relative",children:[G&&!it&&s(tr,{bashMode:w!==void 0,handleRef:f,commands:o.commands,renderSlashMenu:(t)=>s(po,{anchorRef:ct,commands:o.commands,query:t.query,includeAttachment:!1,disabled:!D,agentDisabled:!b||x,open:!0,onClose:t.close,onCommand:(a)=>t.replaceQuery(()=>zt(a.startsWith("$")?a:`/${a}`)),onApp:(a)=>t.replaceQuery(()=>bt(a)),focusInput:vt}),searchFiles:Ht,onMention:lt,onSearchError:z,emptyLabel:g("composer.noCommands"),fileStatusLabels:{loading:g("composer.searchingFiles"),empty:g("composer.noMatchingFiles")}},Z?"inline":"textarea"),R(rr,{attachmentPolicy:ut,"data-shell-mode":x||void 0,bashMode:w!==void 0,globalDrop:!0,multiple:!0,accept:Yt.join(","),onError:jt,onSubmit:Tt,onSubmitAsync:Tt,onSubmitError:z,canSubmit:()=>b&&!k&&!V&&!at&&(!x||!J&&v.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[Ft,R(ar,{className:"px-3 pt-3 pb-0 empty:hidden",children:[V&&s("span",{role:"status",className:"text-muted-foreground text-xs",children:g("composer.addingFiles")}),s(Oi,{mentions:y,onRemove:(t)=>Q((a)=>a.filter((i)=>i!==t))}),s(gr,{children:(t)=>ot(t)?s(Hi,{data:t,sessionId:o.id}):s(mr,{data:t,t:g})})]}),R(sr,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(t)=>{if(!tt.text||f.current?.isComposing()||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.shiftKey||t.ctrlKey||t.altKey||t.metaKey||t.target!==f.current?.getTextarea())return;if(t.key==="Tab"||t.key==="ArrowRight"||t.key==="Enter")t.preventDefault(),t.stopPropagation(),P(tt.text)},children:[x&&s("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),Z?s(wo,{...Mt,skillIcon:F.skillIcon,skillNames:o.commands.map((t)=>t.name),applications:d,onApplicationsChange:L,initialCaret:U.current,initialUndo:W.current}):s(Co,{...Mt,autoFocus:gt&&x})]}),s(lr,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:R("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[R("div",{className:"flex min-w-0 items-center gap-[5px]",children:[s(Gi,{anchorRef:ct,commands:o.commands,disabled:!D,agentDisabled:!b||x,agentControls:G,open:it,onOpenChange:$t,focusInput:vt,onCommand:(t)=>{let a=c.current.text,i=a.length===0||a.endsWith(`
2
+ `)?a:`${a}
3
+ `,u=t.startsWith("$")?t:`/${t}`,l=`${i}${u} `;if(!Z)W.current={text:a,apps:[]},U.current=l.length,K(!0);P(l),requestAnimationFrame(()=>{let h=f.current?.getTextarea();h?.focus(),h?.setSelectionRange(l.length,l.length)})},onApp:bt}),Nt,G&&s(En,{sessionId:o.id,options:o.configOptions,disabled:!b})]}),R(cr,{className:"w-full min-w-0 items-center justify-end gap-1",children:[G&&s(Tn,{session:o}),E??s(kn,{...q,sessionId:o.id,options:o.configOptions,disabled:!b}),Dt,s(zi,{active:J,sending:k||ft||V,ready:b&&!at&&(!x||!J&&v.slice(1).trim().length>0),hasMentions:y.length>0||d.length>0,onStop:Kt})]})]})})]})]})})]})})})}
4
+ export{Ue};
@@ -0,0 +1,2 @@
1
+ import{ke}from"./chunk-33fxyn5r.js";import{ut}from"./chunk-4ma6bmcm.js";import{isContentEntry as d,isImage as l,isText as p}from"@nyssance/codex-acp-v2/client";var Aa="generate_image",qa=[{id:"MiniMax-H3-Image",label:"MiniMax H3 Image",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"MiniMax-H3-Image-Highspeed",label:"MiniMax H3 Image Highspeed",provider:"minimax",sizes:["1K","2K","4K"],maxReferences:16},{id:"wham",label:"ChatGPT Images",provider:"chatgpt",sizes:["auto"],maxReferences:16},{id:"doubao-seedream-4-5-251128",label:"Seedream 4.5",provider:"seedream",sizes:["2K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-lite-260128",label:"Seedream 5.0 Lite",provider:"seedream",sizes:["2K","3K","4K"],maxReferences:14},{id:"doubao-seedream-5-0-pro-260628",label:"Seedream 5.0 Pro",provider:"seedream",sizes:["1K","2K"],maxReferences:10}],hl={model:"wham",size:"auto"},Yr={name:Aa,description:"Generate or edit images using the user's selected image model. Use this tool for image creation and editing. For edits, supply reference IDs returned by earlier calls or the current image request; do not read credentials or call image services yourself. Return the generated image to the user. The host controls model selection.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Complete image generation or editing instructions"},references:{type:"array",items:{type:"string"},description:"Image reference IDs supplied by the host or previous image results"}},required:["prompt"],additionalProperties:!1},annotations:{readOnlyHint:!0}};function je(r){let e=r.content.filter(d).map((n)=>n.content);if(e.length)return e;let o=r.rawOutput?.result;return Array.isArray(o?.content)?o.content:[]}function dt(r){let e=r.rawInput;return e?.server==="alwith"&&e.tool===Aa}function es(r){return r.items.flatMap((e)=>{if(!ut(e)||!dt(e))return[];return je(e).flatMap((o,n)=>{let s=ke(o);return s===null?[]:[[`${e.id}:${n}`,s]]})})}function ts(r){return r.items.flatMap((e)=>{if(!ut(e))return[];let o=e.rawInput,n=je(e),s={};for(let i of n){if(!p(i)||!i.text.startsWith("{"))continue;try{let t=JSON.parse(i.text);if(t&&typeof t==="object"&&"kind"in t&&t.kind==="alwith.image")s={..."model"in t&&typeof t.model==="string"?{model:t.model}:{},..."size"in t&&typeof t.size==="string"?{size:t.size}:{}}}catch(t){if(!(t instanceof SyntaxError))throw t}}return n.flatMap((i,t)=>{if(!l(i))return[];let{mimeType:a,data:m}=i;return[{id:`${e.id}:${t}`,toolId:e.id,...s,...typeof o?.arguments?.prompt==="string"?{prompt:o.arguments.prompt}:{},mimeType:a,data:m,src:`data:${a};base64,${m}`}]})})}function re(r){let e=qa.find((o)=>o.id===r.model);if(!e||!e.sizes.includes(r.size))throw Error("Invalid image model or size");return e}function vl(r,e,o){let n=re(r);if(n.provider!=="seedream")throw Error("Expected a Seedream model");if(o.length>n.maxReferences)throw Error(`This model accepts at most ${n.maxReferences} reference images`);return{model:n.id,prompt:e,size:r.size,response_format:"b64_json",watermark:!1,...o.length?{image:o}:{},...n.id==="doubao-seedream-4-5-251128"?{}:{output_format:"png"}}}
2
+ export{Aa,qa,hl,Yr,je,dt,es,ts,re,vl};
@@ -1,5 +1,5 @@
1
- import{C,ms}from"./chunk-c4mm4fzg.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Mi(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
1
+ import{w,xs}from"./chunk-4g2412p5.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Fi(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
2
2
  `):n.value.slice(n.selectionEnd).includes(`
3
3
  `))return;if(!e){if(!s||n.value!==""||y)return;let u=o.items.flatMap((a)=>{if(a.kind!=="user")return[];let f=a.content.filter(v).map((l)=>l.text).join(`
4
- `),p=a.content.filter(g).flatMap((l)=>{let d=C(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:ms(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
- export{Mi};
4
+ `),p=a.content.filter(g).flatMap((l)=>{let d=w(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:xs(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
+ export{Fi};
@@ -1,5 +1,5 @@
1
- import{No}from"./chunk-3a8qwbgh.js";import{t}from"./chunk-rayhzb8p.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function La(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
- `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Da(o){let s=new Map,e=null;for(let n of o.split(`
3
- `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Fa(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Da(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?La(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
- ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function Pr({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(No,{files:Fa(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
- export{La,Da,Fa,Pr};
1
+ import{Bo}from"./chunk-ha1s3jbc.js";import{t}from"./chunk-aj0z9a5r.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function za(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
+ `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Va(o){let s=new Map,e=null;for(let n of o.split(`
3
+ `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function $a(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Va(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?za(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
+ ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function Vr({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(Bo,{files:$a(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
+ export{za,Va,$a,Vr};
@@ -0,0 +1,2 @@
1
+ import{createContext as r,useContext as i}from"react";import{jsx as n}from"react/jsx-runtime";var o=r(null);function Ps({host:t,children:e}){return n(o.Provider,{value:t,children:e})}function c(){let t=i(o);if(t===null)throw Error("Activity host is missing");return t}function F(t){let{Markdown:e}=c();return n(e,{...t})}
2
+ export{Ps,c,F};
@@ -0,0 +1,2 @@
1
+ import{Bt}from"./chunk-22nybrkv.js";import{d,Je}from"./chunk-qvzxzzw8.js";import{S}from"./chunk-mhrn3e8j.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 b}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 I}from"react/jsx-runtime";function ii(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function z(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function C(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 Ie({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=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||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,h,c]);let k=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(D,{children:[o(b,{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 Je(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Je(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Je(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(I,{children:[s?s(k):o("div",{className:"flex justify-end",children:k}),o(S,{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(Bt,{text:ii(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:C(`${z(n)}/${r}`))}})})]})}
2
+ export{ii,Ie};
@@ -0,0 +1,2 @@
1
+ function Fa(e,n){if(e.type||!n.type)return e;let i=n.type.split("/")[1],o=i!==void 0&&i!==""?`pasted-${Date.now()}.${i==="jpeg"?"jpg":i}`:"";return new File([e],e.name||o||`pasted-${Date.now()}`,{type:n.type})}function Lt(e){let n=[],i=!1;for(let o of e){if(o.kind!=="file")continue;let t=o.getAsFile();if(!t)continue;if(!(t.type||o.type).startsWith("image/")){i=!0;continue}n.push(Fa(t,o))}return{imageFiles:n,sawNonImageFile:i}}function Dt(e){return[...e].some((n)=>n.kind==="string")}var s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g;function Qn(e){return e.replace(s,"")}function Ta(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 Jn(e){let{value:n,selectionStart:i,selectionEnd:o}=e,t=Qn(n);if(t===n)return t;if(e.value=t,i!==null&&o!==null){let a=Math.max(0,i-Ta(n,i)),r=Math.max(0,o-Ta(n,o));requestAnimationFrame(()=>{e.setSelectionRange(a,r)})}return t}
2
+ export{Fa,Lt,Dt,Qn,Ta,Jn};
@@ -1,2 +1,2 @@
1
- import{nativeTurnId as p}from"@nyssance/codex-acp-v2/client";function Or(d,u){let f=new Set,i=(e)=>{let t=e.items.map(p).find((o)=>o!==null),r=e.items.every((o)=>o.replayed);if(t===void 0||f.has(t))return{turnKey:e.key,turn:e,deferUntilReady:r};return f.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:r}};if(!u?.complete)return d.map(i);let a=new Map;for(let e of d){let t=e.items.map(p).find((o)=>o!==null);if(t===void 0)continue;let r=a.get(t)??[];r.push(e),a.set(t,r)}let c=new Set(u.turns.map((e)=>e.turnId)),T=new Set(u.loadedTurnIds),y=new Map,l=new Map,s,n=[];for(let e of d){if(!e.items.some((t)=>c.has(p(t)??""))){n.push(e);continue}if(n.length>0){if(s)l.set(s,n);else y.set(e,n);n=[]}s=e}if(s&&n.length>0)l.set(s,n),n=[];return[...u.turns.flatMap((e)=>{let t=a.get(e.turnId);if(t)return t.flatMap((r)=>[...(y.get(r)??[]).map(i),i(r),...(l.get(r)??[]).map(i)]);return T.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...n.map(i)]}
2
- export{Or};
1
+ import{nativeTurnId as p}from"@nyssance/codex-acp-v2/client";function is(d,u){let f=new Set,i=(e)=>{let t=e.items.map(p).find((o)=>o!==null),r=e.items.every((o)=>o.replayed);if(t===void 0||f.has(t))return{turnKey:e.key,turn:e,deferUntilReady:r};return f.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:r}};if(!u?.complete)return d.map(i);let a=new Map;for(let e of d){let t=e.items.map(p).find((o)=>o!==null);if(t===void 0)continue;let r=a.get(t)??[];r.push(e),a.set(t,r)}let c=new Set(u.turns.map((e)=>e.turnId)),T=new Set(u.loadedTurnIds),y=new Map,l=new Map,s,n=[];for(let e of d){if(!e.items.some((t)=>c.has(p(t)??""))){n.push(e);continue}if(n.length>0){if(s)l.set(s,n);else y.set(e,n);n=[]}s=e}if(s&&n.length>0)l.set(s,n),n=[];return[...u.turns.flatMap((e)=>{let t=a.get(e.turnId);if(t)return t.flatMap((r)=>[...(y.get(r)??[]).map(i),i(r),...(l.get(r)??[]).map(i)]);return T.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...n.map(i)]}
2
+ export{is};
@@ -0,0 +1,2 @@
1
+ function Y(e){if(e.startsWith("\\\\?\\UNC\\"))e="\\\\"+e.slice(8);else if(e.startsWith("\\\\?\\"))e=e.slice(4);if(/^[a-z]:[\\/]/i.test(e))e="/"+e.replaceAll("\\","/");else if(e.startsWith("\\\\"))e=e.replaceAll("\\","/");if(!e.startsWith("/"))throw Error("File URLs require an absolute path");let i=encodeURI(e).replaceAll(/[?#]/g,encodeURIComponent);return e.startsWith("//")?`file:${i}`:`file://${i}`}
2
+ export{Y};
@@ -1,3 +1,3 @@
1
- import{c}from"./chunk-06mvwewp.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
- `).length}function Oa(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function Tr({blocks:e}){return s(No,{files:Oa(e)})}function No({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
3
- export{Oa,Tr,No};
1
+ import{c}from"./chunk-gk7nn747.js";import{ChevronDownIcon as b,ChevronUpIcon as C,FileDiffIcon as k}from"lucide-react";import{useState as m}from"react";import{jsx as s,jsxs as o}from"react/jsx-runtime";function x(e){if(e===null||e.length===0)return 0;return e.split(`
2
+ `).length}function ja(e){let a=new Map;for(let r of e)for(let u of r.content){if(u.type!=="diff")continue;let d=u,f=d._meta?.alwith?.hunks??[],l=f.reduce((n,i)=>n+x(i.newText),0),h=f.reduce((n,i)=>n+x(i.oldText),0);for(let n of d.changes){let i=a.get(n.path);if(i)i.additions+=l,i.deletions+=h;else a.set(n.path,{path:n.path,additions:l,deletions:h})}}return[...a.values()]}function $r({blocks:e}){return s(Bo,{files:ja(e)})}function Bo({files:e,onOpen:a,renderPath:r,actions:u}){let{t:d,openLink:f}=c(),[l,h]=m(!0),[n,i]=m(!1);if(e.length===0)return null;let g=e.reduce((t,p)=>t+p.additions,0),v=e.reduce((t,p)=>t+p.deletions,0);return o("section",{className:"codex-edited-files-card",children:[o("div",{className:"codex-edited-files-header",children:[s("div",{className:"codex-edited-files-icon","aria-hidden":"true",children:s(k,{})}),o("div",{className:"codex-edited-files-summary",children:[s("strong",{children:d("stream.codex.editedFilesCount",{count:e.length})}),s("button",{type:"button","data-codex-disclosure":"",onClick:()=>{h((t)=>!t),i(!1)},"aria-expanded":l,children:d(l?"stream.codex.hideChanges":"stream.codex.viewChanges")})]}),u,o("div",{className:"codex-edited-files-total",title:d("stream.codex.changedLines"),children:[o("span",{className:"codex-diff-additions",children:["+",g]}),o("span",{className:"codex-diff-deletions",children:["-",v]})]})]}),l&&o("div",{className:"codex-edited-files-list",children:[(n?e:e.slice(0,3)).map((t)=>o("div",{className:"codex-edited-file-row",children:[s("button",{type:"button",className:"codex-edited-file-path",title:t.path,onClick:()=>a===void 0?f(t.path):a(t),children:r===void 0?t.path:r(t)}),o("span",{className:"codex-edited-file-counts",children:[o("span",{className:"codex-diff-additions",children:["+",t.additions]}),o("span",{className:"codex-diff-deletions",children:["-",t.deletions]})]})]},t.path)),e.length>3&&o("button",{type:"button",className:"codex-edited-files-more","aria-expanded":n,onClick:()=>i((t)=>!t),children:[d(n?"stream.codex.showFewerFiles":"stream.codex.showMoreFiles",{count:e.length-3}),n?s(C,{size:16,"aria-hidden":"true"}):s(b,{size:16,"aria-hidden":"true"})]})]})]})}
3
+ export{ja,$r,Bo};
@@ -1,2 +1,2 @@
1
- function H(i,t){let e=new Set(t.map((n)=>n.startsWith("$")?n:`/${n}`));return[...i.matchAll(/[$/][^\s]+/g)].flatMap((n)=>e.has(n[0])&&(n.index===0||/[\s\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i[n.index-1]))?[{start:n.index,end:n.index+n[0].length,name:n[0],kind:n[0].startsWith("$")?"skill":"command"}]:[])}function $a(i,t){return H(i,t).filter((e)=>e.kind==="skill").map(({start:e,end:n,name:r})=>({start:e,end:n,name:r}))}var Ut="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",ys={command:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9"}]],skill:[["path",{d:"M12 5v16"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"}]],app:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1"}]]};
2
- export{H,$a,Ut,ys};
1
+ function H(i,t){let e=new Set(t.map((n)=>n.startsWith("$")?n:`/${n}`));return[...i.matchAll(/[$/][^\s]+/g)].flatMap((n)=>e.has(n[0])&&(n.index===0||/[\s\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i[n.index-1]))?[{start:n.index,end:n.index+n[0].length,name:n[0],kind:n[0].startsWith("$")?"skill":"command"}]:[])}function Za(i,t){return H(i,t).filter((e)=>e.kind==="skill").map(({start:e,end:n,name:r})=>({start:e,end:n,name:r}))}var qt="inline-flex items-baseline gap-1 align-baseline whitespace-nowrap leading-[inherit] font-normal text-[color:var(--app-reference-foreground,var(--link))] select-all",Ss={command:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9"}]],skill:[["path",{d:"M12 5v16"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z"}]],app:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1"}]]};
2
+ export{H,Za,qt,Ss};
@@ -1,5 +1,5 @@
1
- import{_t,It,$n}from"./chunk-fer4r3b8.js";import{Tt,g}from"./chunk-a0qy1r02.js";import{InputGroupTextarea as A}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as K}from"cn";import{forwardRef as R,useCallback as D,useEffect as h,useImperativeHandle as M,useRef as d}from"react";import{flushSync as F}from"react-dom";import{jsx as N}from"react/jsx-runtime";var L=(u)=>!u.shiftKey,z=(u)=>u.altKey&&!u.ctrlKey&&!u.metaKey,po=R(({onChange:u,onKeyDown:v,onCompositionStart:x,onCompositionEnd:T,className:b,placeholder:y,bashMode:E=!1,isSendShortcut:I=L,isNewlineShortcut:C=z,...f},S)=>{let r=Tt(),H=g(),i=d(!1),c=d(!1),a=d(null),s=d(null),o=D(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||s.current!==null)return;s.current=requestAnimationFrame(()=>{s.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);h(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,n=new ResizeObserver(([l])=>{if(l&&l.contentRect.width!==t)t=l.contentRect.width,o()});return n.observe(e),o(),()=>{if(n.disconnect(),s.current!==null)cancelAnimationFrame(s.current);s.current=null}},[o]),h(o,[o,r?.textInput.value,f.value]);let p=E&&(r?.textInput.value??"").startsWith("!"),P=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||c.current)return;if(v?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
1
+ import{Lt,Dt,Jn}from"./chunk-gw4zbw0m.js";import{Ot,g}from"./chunk-q8c4k6qh.js";import{InputGroupTextarea as A}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as K}from"cn";import{forwardRef as R,useCallback as D,useEffect as h,useImperativeHandle as M,useRef as d}from"react";import{flushSync as F}from"react-dom";import{jsx as N}from"react/jsx-runtime";var L=(u)=>!u.shiftKey,z=(u)=>u.altKey&&!u.ctrlKey&&!u.metaKey,Co=R(({onChange:u,onKeyDown:v,onCompositionStart:x,onCompositionEnd:T,className:b,placeholder:y,bashMode:E=!1,isSendShortcut:I=L,isNewlineShortcut:C=z,...f},S)=>{let r=Ot(),H=g(),i=d(!1),c=d(!1),a=d(null),s=d(null),o=D(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||s.current!==null)return;s.current=requestAnimationFrame(()=>{s.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);h(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,n=new ResizeObserver(([l])=>{if(l&&l.contentRect.width!==t)t=l.contentRect.width,o()});return n.observe(e),o(),()=>{if(n.disconnect(),s.current!==null)cancelAnimationFrame(s.current);s.current=null}},[o]),h(o,[o,r?.textInput.value,f.value]);let p=E&&(r?.textInput.value??"").startsWith("!"),P=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||c.current)return;if(v?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
2
  `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(p&&r){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),r.textInput.setInput(r.textInput.value.slice(1));return}}if(e.key==="Enter"){if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:l}=t;if(r){let m=`${t.value.slice(0,n)}
3
3
  ${t.value.slice(l)}`;F(()=>r.textInput.setInput(p?`!${m}`:m)),t.setSelectionRange(n+1,n+1)}else t.setRangeText(`
4
- `,n,l,"end");o();return}if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let n=t.querySelector('button[type="submit"]');if(!n||n.disabled)return;t.requestSubmit(n)}}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:n,sawNonImageFile:l}=_t(t),m=It(t);if(n.length>0)e.preventDefault(),H.add(n);else if(l&&!m)e.preventDefault()},w=r?{value:i.current&&a.current?a.current.value:p?r.textInput.value.slice(1):r.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:$n(e.currentTarget);r.textInput.setInput(p?`!${t}`:t),o(),u?.(e)}}:{onChange:(e)=>{if(!i.current)$n(e.currentTarget);o(),u?.(e)}};return M(S,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||c.current,getTextarea:()=>a.current}),[]),N(A,{"data-chat-input":!0,ref:a,rows:3,className:K("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",b),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=$n(e.currentTarget);r?.textInput.setInput(p?`!${t}`:t),o(),T?.(e),c.current=!0,requestAnimationFrame(()=>{c.current=!1})},onCompositionStart:(e)=>{c.current=!1,i.current=!0,x?.(e)},onKeyDown:P,onPaste:k,placeholder:y,...f,...w})});po.displayName="PromptInputTextarea";
5
- export{po};
4
+ `,n,l,"end");o();return}if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let n=t.querySelector('button[type="submit"]');if(!n||n.disabled)return;t.requestSubmit(n)}}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:n,sawNonImageFile:l}=Lt(t),m=Dt(t);if(n.length>0)e.preventDefault(),H.add(n);else if(l&&!m)e.preventDefault()},w=r?{value:i.current&&a.current?a.current.value:p?r.textInput.value.slice(1):r.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:Jn(e.currentTarget);r.textInput.setInput(p?`!${t}`:t),o(),u?.(e)}}:{onChange:(e)=>{if(!i.current)Jn(e.currentTarget);o(),u?.(e)}};return M(S,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||c.current,getTextarea:()=>a.current}),[]),N(A,{"data-chat-input":!0,ref:a,rows:3,className:K("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",b),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=Jn(e.currentTarget);r?.textInput.setInput(p?`!${t}`:t),o(),T?.(e),c.current=!0,requestAnimationFrame(()=>{c.current=!1})},onCompositionStart:(e)=>{c.current=!1,i.current=!0,x?.(e)},onKeyDown:P,onPaste:k,placeholder:y,...f,...w})});Co.displayName="PromptInputTextarea";
5
+ export{Co};
@@ -1,2 +1,2 @@
1
- import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Ro(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Lr(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Ro(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
- export{Ro,Lr};
1
+ import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function $o(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Xr(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...$o(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
+ export{$o,Xr};
@@ -1,2 +1,2 @@
1
- import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function $s(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function js(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function qs(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
- export{$s,js,qs};
1
+ import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function Js(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function Xs(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function Ys(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
+ export{Js,Xs,Ys};
@@ -0,0 +1,2 @@
1
+ import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function ee(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function y(e,t){return e.find((n)=>n.category===t&&o(n))}function te(e){return ee(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
2
+ export{ee,y,te};
@@ -1,2 +1,2 @@
1
- function An(n,r){let i=new Set(r);i.add(n);let t=/^(.*?)\s*\((\d+)\)$/.exec(n),s=t?t[1].trimEnd():n,e=t?BigInt(t[2])+1n:2n;while(i.has(`${s} (${e})`))e++;return`${s} (${e})`}
2
- export{An};
1
+ function Bn(n,r){let i=new Set(r);i.add(n);let t=/^(.*?)\s*\((\d+)\)$/.exec(n),s=t?t[1].trimEnd():n,e=t?BigInt(t[2])+1n:2n;while(i.has(`${s} (${e})`))e++;return`${s} (${e})`}
2
+ export{Bn};
@@ -0,0 +1,2 @@
1
+ import{n}from"./chunk-aj0z9a5r.js";import{Fn,e,x}from"./chunk-qgrd5xre.js";import{Ue}from"./chunk-fxzh4f7c.js";import{vn}from"./chunk-xanfp0nh.js";import{hn}from"./chunk-k5065dzv.js";import{mn,gn}from"./chunk-aq3hemsb.js";import{fn}from"./chunk-1a46v4cy.js";import{LockIcon as k,UnplugIcon as O}from"lucide-react";import{useMemo as S,useRef as M}from"react";import{Alert as C,AlertDescription as N,AlertTitle as h}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as w}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as P,EmptyDescription as z,EmptyHeader as B,EmptyTitle as I}from"@nyssance/shadcn/vega/components/ui/empty";import{jsx as o,jsxs as r}from"react/jsx-runtime";function da({host:t,client:c,...s}){let m=S(()=>t.openDiff?t:{...t,openDiff:mn},[t]);return r(Fn,{host:m,client:c,children:[o(L,{...s}),!t.openDiff&&o(gn,{})]})}function L({session:t,header:c,overlay:s,timeline:m,composer:D,readOnlyActions:g,recovery:E,welcome:R,children:T,rootRef:l,search:A=!0}){let{host:d,client:b}=e(),p=M(null),H=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:i}=d,f=n((a)=>a.connection==="ready"),v=n((a)=>a.historyPages[t.id]?.error),y=()=>x(d,b.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return r("div",{"data-chat-drop-zone":!0,ref:H,className:"flex h-full min-h-0 flex-col",children:[c,r("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&o(hn,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(C,{children:[o(O,{}),o(h,{children:i("conversation.stopped")}),o(N,{children:o(w,{size:"sm",variant:"outline",onClick:y,children:i("conversation.reconnect")})})]})}),u?R??o(P,{className:"flex-1",children:r(B,{children:[o(I,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(z,{children:i("conversation.welcomeDescription")})]})}):o(vn,{session:t,timeline:m}),o(fn,{sessionId:t.id}),E??(t.readOnly?o("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:r(C,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[r("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o(k,{"aria-hidden":"true",className:"size-4 shrink-0"}),r("div",{className:"min-w-0 space-y-1",children:[o(h,{children:i("conversation.readOnlyTitle")}),o(N,{children:i("conversation.readOnlyDescription")}),v&&o("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(w,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),g]})]})}):D??o(Ue,{session:t}))]}),T]})}
2
+ export{da};
@@ -1,2 +1,2 @@
1
- function Ho(o){let t=new DOMParser().parseFromString(o,"image/svg+xml").documentElement,e=t.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number);if(t.localName!=="svg"||e?.length!==4||!e.every(Number.isFinite)||e[2]<=0||e[3]<=0)throw Error("Mermaid SVG has no valid viewBox");let[,,a,i]=e;return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width",String(a)),t.setAttribute("height",String(i)),t.style.removeProperty("max-width"),{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(t))}`,width:a,height:i}}async function Qr(o,s){await document.fonts.ready;let{src:t,width:e,height:a}=Ho(o),i=new Image;await new Promise((h,c)=>{i.onload=()=>h(),i.onerror=()=>c(Error("Could not load the Mermaid diagram")),i.src=t});let g=Math.min(2,8192/e,8192/a,Math.sqrt(16777216/(e*a))),r=document.createElement("canvas");r.width=Math.max(1,Math.ceil(e*g)),r.height=Math.max(1,Math.ceil(a*g));let n=r.getContext("2d");if(!n)throw Error("Could not create the PNG canvas");n.fillStyle=s,n.fillRect(0,0,r.width,r.height),n.drawImage(i,0,0,r.width,r.height);let m=r.toDataURL("image/png");if(!m.startsWith("data:image/png;base64,"))throw Error("PNG export failed");return m.slice(22)}
2
- export{Ho,Qr};
1
+ function Do(o){let t=new DOMParser().parseFromString(o,"image/svg+xml").documentElement,e=t.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number);if(t.localName!=="svg"||e?.length!==4||!e.every(Number.isFinite)||e[2]<=0||e[3]<=0)throw Error("Mermaid SVG has no valid viewBox");let[,,a,i]=e;return t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width",String(a)),t.setAttribute("height",String(i)),t.style.removeProperty("max-width"),{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(t))}`,width:a,height:i}}async function Ur(o,s){await document.fonts.ready;let{src:t,width:e,height:a}=Do(o),i=new Image;await new Promise((h,c)=>{i.onload=()=>h(),i.onerror=()=>c(Error("Could not load the Mermaid diagram")),i.src=t});let g=Math.min(2,8192/e,8192/a,Math.sqrt(16777216/(e*a))),r=document.createElement("canvas");r.width=Math.max(1,Math.ceil(e*g)),r.height=Math.max(1,Math.ceil(a*g));let n=r.getContext("2d");if(!n)throw Error("Could not create the PNG canvas");n.fillStyle=s,n.fillRect(0,0,r.width,r.height),n.drawImage(i,0,0,r.width,r.height);let m=r.toDataURL("image/png");if(!m.startsWith("data:image/png;base64,"))throw Error("PNG export failed");return m.slice(22)}
2
+ export{Do,Ur};
@@ -1,2 +1,2 @@
1
- var t=new Map;var a=0;function Fo(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Fo(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function qr(e,n){return d??=new l,d.connect(e,n)}
2
- export{Fo,qr};
1
+ var t=new Map;var a=0;function Ro(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Ro(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Dr(e,n){return d??=new l,d.connect(e,n)}
2
+ export{Ro,Dr};
@@ -1,2 +1,2 @@
1
- function Dt({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
- export{Dt};
1
+ function Gt({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
+ export{Gt};
@@ -1,2 +1,2 @@
1
- import{R}from"./chunk-9n8cds8p.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function Yi({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(R,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
- export{Yi};
1
+ import{L}from"./chunk-3tvq6xr2.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function or({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(L,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
+ export{or};
@@ -1,2 +1,2 @@
1
- import{Er}from"./chunk-nf7q3crw.js";function _r(t,o){if(Er(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
- export{_r};
1
+ import{Wr}from"./chunk-b3mja7d9.js";function Gr(t,o){if(Wr(o))return y(t);return t.map((e)=>({kind:"block",block:e}))}function i(t){return t.type==="thinking"||t.type==="tool_use"||t.type==="subagent"||t.type==="collab"}function c(t){return t.type==="tool_use"&&t.kind!=="think"}function y(t){let o=[],e=[],r=()=>{if(e.length===0)return;o.push({kind:"codexActivityGroup",blocks:e}),e=[]};for(let n of t){if(i(n)&&c(n)){e.push(n);continue}if(r(),i(n)){o.push({kind:"codexActivityGroup",blocks:[n]});continue}o.push({kind:"block",block:n})}return r(),o}
2
+ export{Gr};
@@ -1,2 +1,2 @@
1
- import{ko}from"./chunk-qm0zd4wj.js";import{fr}from"./chunk-kdcde4s5.js";import{w}from"./chunk-rayhzb8p.js";import{rt,ts}from"./chunk-6yx869ht.js";import{e}from"./chunk-b89bzpce.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 ra(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function sn({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=w(rt,(r)=>r),y=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),S=s((r)=>u.sessionId===t?ko(u.turns,r,u.terminals):[],[u,t]),b=s((r,i)=>ts(t,r,i),[t]),g=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,E=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(fr,{placement:"body",getViewport:y,findSourceMatches:S,revealTurn:b,prepareSource:g,subscribeOpen:E,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
2
- export{ra,sn};
1
+ import{No}from"./chunk-482segb0.js";import{ir}from"./chunk-7nfv27hz.js";import{k}from"./chunk-aj0z9a5r.js";import{pt,as}from"./chunk-qbpy0aqe.js";import{e}from"./chunk-qgrd5xre.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 ua(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function hn({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=k(pt,(r)=>r),w=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),y=s((r)=>u.sessionId===t?No(u.turns,r,u.terminals):[],[u,t]),S=s((r,i)=>as(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(ir,{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{ua,hn};
@@ -0,0 +1,2 @@
1
+ import{g}from"./chunk-q8c4k6qh.js";import{e}from"./chunk-qgrd5xre.js";import{u}from"./chunk-pz5d0vgv.js";import{isTauri as N}from"@tauri-apps/api/core";import{getCurrentWebview as U}from"@tauri-apps/api/webview";import{useEffect as _,useLayoutEffect as G,useRef as X}from"react";import{flushSync as F}from"react-dom";var H=33554432,x=new WeakMap,q=new WeakSet,W={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"};async function J(o){let{image:s}=await u.readDroppedFile({path:o,localImage:null});if(s===null)throw Error("Cannot load the original image");return{url:`data:${s.mimeType};base64,${s.data}`,mediaType:s.mimeType,bytes:s.data.length*3/4-(s.data.endsWith("==")?2:s.data.endsWith("=")?1:0)}}function K(o){return o.split(/[/\\]/).findLast((s)=>s!=="")??o}var Rn={sourcePath:(o)=>x.get(o),isLocalImage:(o)=>q.has(o),loadInlineImage:J,uniqueFiles(o,s){let p=new Set(s.map((f)=>f.sourcePath));return o.filter((f)=>{let w=x.get(f);if(w===void 0)return!0;if(p.has(w))return!1;return p.add(w),!0})}};function Ln({sessionId:o,imagesOnly:s=!1,picker:p,openPicker:f,pickFilePaths:w,enabled:O,onMention:S,onBusyChange:C}){let D=g(),{host:j}=e(),i=X({sessionId:o,attachments:D,enabled:O,onMention:S,onBusyChange:C,host:j,imagesOnly:s,pickFilePaths:w});return G(()=>{i.current={sessionId:o,attachments:D,enabled:O,onMention:S,onBusyChange:C,host:j,imagesOnly:s,pickFilePaths:w}}),_(()=>{if(!N())return;let d=!1,R,k=Promise.resolve(),I=0,h=()=>!d&&i.current.sessionId===o&&i.current.enabled,v=(n)=>{let{host:a}=i.current;if(a.reportError)a.reportError(n);else console.error(n)},E=()=>v(Error(i.current.host.t("composer.dropUnavailable")));i.current.onBusyChange(!1);let A=(n)=>{I++,F(()=>i.current.onBusyChange(!0)),k=k.then(async()=>{try{let a=new Set(i.current.attachments.files.map((t)=>t.sourcePath));for(let t of new Set(await n())){let l=typeof t==="string"?t:t.name;if(!h())return;try{let c=i.current.pickFilePaths!==void 0&&!i.current.imagesOnly,b=typeof t==="string"?void 0:W[t.type];if(typeof t!=="string"&&t.type.startsWith("image/")&&(!c||!b)){F(()=>i.current.attachments.add([t]));continue}if(typeof t!=="string"&&t.size>H)throw Error("Pasted file exceeds the 32 MiB limit");let P=typeof t==="string"?t:await u.writePastedFile({name:b&&!/\.(png|jpe?g|webp|gif)$/i.test(t.name)?`${t.name||"image"}.${b}`:t.name,data:[...new Uint8Array(await t.arrayBuffer())]});if(!h())return;let m=await u.readDroppedFile({path:P,localImage:c||null});if(!h())return;if(m.image===null){if(i.current.imagesOnly)throw Error(i.current.host.t("composer.unsupportedAttachmentTitle"));F(()=>i.current.onMention(m.path))}else if(!a.has(m.path)){let T=Uint8Array.from(atob(m.image.data),(y)=>y.charCodeAt(0)),r=new File([T],m.name,{type:m.image.mimeType});if(x.set(r,m.path),c)q.add(r);a.add(m.path),F(()=>i.current.attachments.add([r]))}}catch(c){if(!d)v(Object.assign(Error(i.current.host.t("composer.dropFailed",{name:K(l)})),{description:c instanceof Error?c.message:String(c)}))}}}finally{if(I--,!d)F(()=>i.current.onBusyChange(I>0))}}).catch((a)=>{if(!d)v(a)})},L=(n)=>{if(!h()){E();return}if(i.current.imagesOnly&&n.some((a)=>!a.type.startsWith("image/"))){v(Error(i.current.host.t("composer.unsupportedAttachmentTitle")));return}A(()=>Promise.resolve(n))};if(p)p.current=L;let M=()=>{let n=i.current.pickFilePaths;if(!n)throw Error("The native file picker is unavailable");if(!h()){E();return}A(n)};if(f)f.current=M;let z=U().onDragDropEvent((n)=>{if(d||n.payload.type!=="drop")return;let{paths:a,position:t}=n.payload,l=document.elementFromPoint(t.x/window.devicePixelRatio,t.y/window.devicePixelRatio);if(!l?.closest("[data-chat-drop-zone]")||l.closest('[role="dialog"]'))return;if(!h()){E();return}A(()=>Promise.resolve(a))}),B=(n)=>{let a=n.target;if(!(a instanceof Element)||!a.matches("[data-chat-input]"))return;if(!a.closest("[data-chat-drop-zone]")||a.closest('[role="dialog"]'))return;let t=n.clipboardData;if(!t)return;let l=[...t.files??[]],c=[...t.items??[]],b=i.current.pickFilePaths!==void 0&&!i.current.imagesOnly,P=b?c.flatMap((r)=>{if(r.kind!=="file"||!W[r.type])return[];let y=r.getAsFile();return y?[y]:[]}):[];if(!(t.types.includes("Files")&&!l.length&&!c.some((r)=>r.type.startsWith("image/")))&&!P.length&&!(b&&l.some((r)=>W[r.type]))&&!l.some((r)=>!r.type.startsWith("image/"))&&!c.some((r)=>r.kind==="file"&&!r.type.startsWith("image/"))&&!["text/uri-list","x-special/gnome-copied-files"].some((r)=>t.types.includes(r)&&/^file:\/\//m.test(t.getData(r))))return;if(n.preventDefault(),n.stopPropagation(),!h()){E();return}let T=u.clipboardFilePaths().then((r)=>({value:r}),(r)=>({error:r}));A(async()=>{let r=await T;if("error"in r)throw r.error;let y=r.value;if(y.length)return y;if(l.length)return l;if(P.length)return P;throw Error("The clipboard contains no readable local files")})};return document.addEventListener("paste",B,!0),z.then((n)=>{if(d)n();else R=n}).catch((n)=>{if(!d)v(n)}),()=>{if(d=!0,p?.current===L)p.current=null;if(f?.current===M)f.current=null;document.removeEventListener("paste",B,!0),R?.()}},[o,p,f]),null}
2
+ export{Rn,Ln};
@@ -1,3 +1,3 @@
1
- import{c,F}from"./chunk-06mvwewp.js";import{oe}from"./chunk-nf7q3crw.js";import{_r}from"./chunk-xg6ayxsy.js";import{ve}from"./chunk-15m908ph.js";import{Ar,Et}from"./chunk-016v1nnv.js";import{Tr}from"./chunk-3a8qwbgh.js";import{Bo}from"./chunk-zwpv75f4.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(F,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ve,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function rl({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
- `),T=!t.streaming&&C.trim().length>0?o(Io,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=_r(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&oe(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(Et,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Po,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(Tr,{blocks:f}):y(f))})}function Io({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Bo,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Po({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(Ar,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
- export{rl,Io,Po};
1
+ import{c,F}from"./chunk-gk7nn747.js";import{ie}from"./chunk-b3mja7d9.js";import{Gr}from"./chunk-k1w3acq7.js";import{xe}from"./chunk-f2h074g0.js";import{qr,zt}from"./chunk-1vwece23.js";import{$r}from"./chunk-ha1s3jbc.js";import{qo}from"./chunk-s1w3j9p9.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(F,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(xe,{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 ml({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
+ `),T=!t.streaming&&C.trim().length>0?o(Fo,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=Gr(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&ie(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(zt,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(Oo,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o($r,{blocks:f}):y(f))})}function Fo({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(qo,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function Oo({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(qr,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
+ export{ml,Fo,Oo};
@@ -0,0 +1,2 @@
1
+ import{At}from"./chunk-6ea6q6dj.js";import{n}from"./chunk-aj0z9a5r.js";import{e,x}from"./chunk-qgrd5xre.js";import{ee,y,te}from"./chunk-j2bp0zbe.js";import{isBooleanOption as U,isGroupedSelect as q,isSelectOption as A}from"@nyssance/codex-acp-v2/client";import{Zap as Z}from"lucide-react";import{memo as D,useRef as F}from"react";import{jsx as w}from"react/jsx-runtime";function H({sessionId:l,options:u,disabled:B,onModelChange:h,onConfigChange:C,defaultGroup:G={id:"models",name:"Models"},catalog:I=(c)=>c,headerAction:L}){let{host:c,client:N}=e(),{t:i}=c,P=n((o)=>Boolean(o.configPending[l])),p=F({sessionId:l,model:!0}),b=P&&(p.current.sessionId!==l||p.current.model),k=n((o)=>{let r=o.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=y(u,"model"),a=y(u,"thought_level"),O=u.filter((o)=>o.configId!=="collaboration_mode"&&(o.category==="model_config"||o.category!=="mode"&&o!==t&&o!==a)),v=O.filter(A),m=O.filter(U);if(!t&&!a&&v.length===0&&m.length===0)return null;let f=(o,r)=>{if(r===o.currentValue)return Promise.resolve();p.current={sessionId:l,model:o===t};let d=C?C(o.configId,r):N.setConfig(l,o.configId,r);return x(c,d),d},g=a?ee(a):[],z=g.reduce((o,r)=>r.name.length>=o.length?r.name:o,""),R=t?te(t):i("composer.model"),_=(o)=>({api_id:o.value,label:o.name}),S=I(t&&q(t.options)?t.options.map((o)=>({id:o.groupId,name:o.name,models:o.options.map(_)})):[{...G,models:t?ee(t).map(_):[]}]),V=S.flatMap((o)=>o.models),M=V.find((o)=>o.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:R},s=m.find((o)=>o.configId==="fast_mode"||o.configId==="fast-mode");return w(At,{disabled:B||b||k,switching:b,value:{...M,label:M.shortLabel??M.label},compactCatalog:!0,models:V,showModelList:Boolean(t),onChange:(o)=>{if(o.api_id===t?.currentValue)return;if(h)h(o.api_id);else if(t)f(t,o.api_id)},header:{name:t?.name??i("composer.model"),action:L},modelGroups:S,t:i,effortConfig:a&&g.length>0?{name:"Effort",value:a.currentValue,levels:g,sizer:z,onChange:(o)=>f(a,o)}:void 0,selectOptions:v.map((o)=>({id:o.configId,name:o.name,value:o.currentValue,options:ee(o).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>f(o,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:w(Z,{className:"size-4","aria-hidden":"true"})},...m.filter((o)=>o!==s).map((o)=>({id:o.configId,name:o.name,currentValue:o.currentValue}))],onBooleanChange:(o,r)=>{let d=o==="fast_mode"?s:m.find((E)=>E.configId===o);if(!d)throw Error(`Unknown boolean config: ${o}`);f(d,r)}})}var kn=D(H);
2
+ export{kn};
@@ -1,2 +1,2 @@
1
- var I={ar:{untitled:"دردشة جديدة",signOut:"تسجيل الخروج",help:"مساعدة",language:"اللغة",foreground:"المقدمة",background:"الخلفية",chats:"الدردشات",activity:"نشاط",quickChats:"دردشات سريعة",retry:"إعادة المحاولة",stop:"إيقاف",rename:"إعادة تسمية",fork:"إنشاء فرع",archive:"أرشفة",unarchive:"استعادة",delete:"حذف",deleteTitle:"حذف هذه الدردشة؟",deleteDescription:"ستُحذف هذه الدردشة نهائيًا. لا يمكن التراجع عن هذا الإجراء.",cancel:"إلغاء",archived:"مؤرشفة",filter:"تصفية",collapseAllGroups:"طي كل المجموعات",openLeading:"فتح الشاشة ‎-1",backToMain:"العودة إلى الشاشة الرئيسية"},de:{untitled:"Neuer Chat",signOut:"Abmelden",help:"Hilfe",language:"Sprache",foreground:"Vordergrund",background:"Hintergrund",chats:"Chats",activity:"Aktivität",quickChats:"Schnelle Chats",retry:"Wiederholen",stop:"Stopp",rename:"Umbenennen",fork:"Verzweigen",archive:"Archivieren",unarchive:"Wiederherstellen",delete:"Löschen",deleteTitle:"Diesen Chat löschen?",deleteDescription:"Dieser Chat wird dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",archived:"Archiviert",filter:"Filtern",collapseAllGroups:"Alle Gruppen einklappen",openLeading:"Bildschirm -1 öffnen",backToMain:"Zurück zum Hauptbildschirm"},en:{states:{title:"Session status",requires_action:"Needs attention",running:"Running",done:"Unread",idle:"Idle",empty:"No sessions"},untitled:"New chat",signOut:"Sign out",help:"Help",language:"Language",foreground:"Foreground",background:"Background",chats:"Chats",activity:"Activity",quickChats:"Quick chats",showAll:"Show all",retry:"Retry",stop:"Stop",rename:"Rename",fork:"Fork",archive:"Archive",unarchive:"Restore",delete:"Delete",deleteTitle:"Delete this chat?",deleteDescription:"This chat will be permanently deleted. This cannot be undone.",cancel:"Cancel",archived:"Archived",archives:{title:"Archived chats",deleteAll:"Delete all",search:"Search archived chats",chatType:"Chat type",allChats:"All chats",quickChats:"Quick chats",projectChats:"Project chats",project:"Project",allProjects:"All projects",noProject:"No project",count:"{{count}} chats",updatedAt:"Last updated",connecting:"Connect to Codex to view archived chats.",loading:"Loading archived chats…",retry:"Retry",empty:"No archived chats",noResults:"No matching archived chats",deleteTitle:"Delete archived chats?",deleteAllDescription:"Permanently delete these {{count}} archived chats? This cannot be undone. Deleting all includes chats hidden by the current filters.",deleteDescription:"Permanently delete this archived chat? This cannot be undone.",unarchive:"Unarchive",confirmDelete:"Delete permanently"},filter:"Filter",collapseAllGroups:"Collapse all groups",openLeading:"Open -1 screen",backToMain:"Back to main screen"},es:{untitled:"Nuevo chat",signOut:"Cerrar sesión",help:"Ayuda",language:"Idioma",foreground:"Primer plano",background:"Fondo",chats:"Chats",activity:"Actividad",quickChats:"Chats rápidos",retry:"Reintentar",stop:"Detener",rename:"Renombrar",fork:"Crear rama",archive:"Archivar",unarchive:"Restaurar",delete:"Eliminar",deleteTitle:"¿Eliminar este chat?",deleteDescription:"Este chat se eliminará permanentemente. Esta acción no se puede deshacer.",cancel:"Cancelar",archived:"Archivados",filter:"Filtrar",collapseAllGroups:"Contraer todos los grupos",openLeading:"Abrir la pantalla -1",backToMain:"Volver a la pantalla principal"},fr:{untitled:"Nouveau chat",signOut:"Se déconnecter",help:"Aide",language:"Langue",foreground:"Premier plan",background:"Arrière-plan",chats:"Discussions",activity:"Activité",quickChats:"Discussions rapides",retry:"Réessayer",stop:"Arrêter",rename:"Renommer",fork:"Créer une branche",archive:"Archiver",unarchive:"Restaurer",delete:"Supprimer",deleteTitle:"Supprimer cette discussion ?",deleteDescription:"Cette discussion sera définitivement supprimée. Cette action est irréversible.",cancel:"Annuler",archived:"Archivées",filter:"Filtrer",collapseAllGroups:"Réduire tous les groupes",openLeading:"Ouvrir l’écran -1",backToMain:"Revenir à l’écran principal"},hi:{untitled:"नई चैट",signOut:"साइन आउट",help:"सहायता",language:"भाषा",foreground:"अग्रभूमि",background:"पृष्ठभूमि",chats:"चैट",activity:"गतिविधि",quickChats:"त्वरित चैट",retry:"फिर से कोशिश करें",stop:"रोकें",rename:"नाम बदलें",fork:"शाखा बनाएँ",archive:"संग्रहित करें",unarchive:"रीस्टोर करें",delete:"हटाएं",deleteTitle:"यह चैट हटाएँ?",deleteDescription:"यह चैट स्थायी रूप से हटा दी जाएगी। इसे पूर्ववत नहीं किया जा सकता।",cancel:"रद्द करें",archived:"संग्रहीत",filter:"फ़िल्टर",collapseAllGroups:"सभी समूह संक्षिप्त करें",openLeading:"-1 स्क्रीन खोलें",backToMain:"मुख्य स्क्रीन पर लौटें"},id:{untitled:"Obrolan baru",signOut:"Keluar",help:"Bantuan",language:"Bahasa",foreground:"Depan",background:"Latar",chats:"Obrolan",activity:"Aktivitas",quickChats:"Chat cepat",retry:"Coba lagi",stop:"Hentikan",rename:"Ganti nama",fork:"Buat cabang",archive:"Arsipkan",unarchive:"Pulihkan",delete:"Hapus",deleteTitle:"Hapus obrolan ini?",deleteDescription:"Obrolan ini akan dihapus permanen. Tindakan ini tidak dapat dibatalkan.",cancel:"Batal",archived:"Diarsipkan",filter:"Filter",collapseAllGroups:"Ciutkan semua grup",openLeading:"Buka layar -1",backToMain:"Kembali ke layar utama"},it:{untitled:"Nuova chat",signOut:"Esci",help:"Aiuto",language:"Lingua",foreground:"Primo piano",background:"Sfondo",chats:"Chat",activity:"Attività",quickChats:"Chat rapide",retry:"Riprova",stop:"Interrompi",rename:"Rinomina",fork:"Crea un ramo",archive:"Archivia",unarchive:"Ripristina",delete:"Elimina",deleteTitle:"Eliminare questa chat?",deleteDescription:"Questa chat verrà eliminata definitivamente. L’azione non può essere annullata.",cancel:"Annulla",archived:"Archiviate",filter:"Filtra",collapseAllGroups:"Comprimi tutti i gruppi",openLeading:"Apri la schermata -1",backToMain:"Torna alla schermata principale"},ja:{untitled:"新しいチャット",signOut:"サインアウト",help:"ヘルプ",language:"言語",foreground:"フォアグラウンド",background:"背景",chats:"チャット",activity:"アクティビティ",quickChats:"クイックチャット",retry:"再試行",stop:"停止",rename:"名前を変更",fork:"分岐を作成",archive:"アーカイブ",unarchive:"復元",delete:"削除",deleteTitle:"このチャットを削除しますか?",deleteDescription:"このチャットは完全に削除されます。この操作は取り消せません。",cancel:"キャンセル",archived:"アーカイブ済み",filter:"フィルター",collapseAllGroups:"すべてのグループを折りたたむ",openLeading:"-1 画面を開く",backToMain:"メイン画面に戻る"},ko:{untitled:"새 채팅",signOut:"로그아웃",help:"도움말",language:"언어",foreground:"포그라운드",background:"배경",chats:"채팅",activity:"활동",quickChats:"빠른 채팅",retry:"다시 시도",stop:"중지",rename:"이름 바꾸기",fork:"분기 만들기",archive:"보관",unarchive:"복원",delete:"삭제",deleteTitle:"이 채팅을 삭제할까요?",deleteDescription:"이 채팅은 영구적으로 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",cancel:"취소",archived:"보관됨",filter:"필터",collapseAllGroups:"모든 그룹 접기",openLeading:"-1 화면 열기",backToMain:"메인 화면으로 돌아가기"},"pt-BR":{untitled:"Novo chat",signOut:"Sair",help:"Ajuda",language:"Idioma",foreground:"Primeiro plano",background:"Fundo",chats:"Chats",activity:"Atividade",quickChats:"Chats rápidos",retry:"Tentar novamente",stop:"Parar",rename:"Renomear",fork:"Criar ramificação",archive:"Arquivar",unarchive:"Restaurar",delete:"Excluir",deleteTitle:"Excluir esta conversa?",deleteDescription:"Esta conversa será excluída permanentemente. Esta ação não pode ser desfeita.",cancel:"Cancelar",archived:"Arquivadas",filter:"Filtrar",collapseAllGroups:"Recolher todos os grupos",openLeading:"Abrir a tela -1",backToMain:"Voltar à tela principal"},ru:{untitled:"Новый чат",signOut:"Выйти",help:"Справка",language:"Язык",foreground:"Передний план",background:"Фон",chats:"Чаты",activity:"Активность",quickChats:"Быстрые чаты",retry:"Повторить",stop:"Остановить",rename:"Переименовать",fork:"Создать ветку",archive:"Архивировать",unarchive:"Восстановить",delete:"Удалить",deleteTitle:"Удалить этот чат?",deleteDescription:"Этот чат будет удалён навсегда. Это действие нельзя отменить.",cancel:"Отмена",archived:"В архиве",filter:"Фильтр",collapseAllGroups:"Свернуть все группы",openLeading:"Открыть экран -1",backToMain:"На главный экран"},"zh-CN":{states:{title:"会话状态",requires_action:"待处理",running:"运行中",done:"完成未读",idle:"空闲",empty:"暂无会话"},untitled:"新聊天",signOut:"退出登录",help:"帮助",language:"语言",foreground:"前台",background:"后台",chats:"聊天",activity:"活动",quickChats:"随聊",showAll:"展开显示",retry:"重试",stop:"停止",rename:"重命名",fork:"分叉",archive:"归档",unarchive:"恢复",delete:"删除",deleteTitle:"删除这个聊天?",deleteDescription:"该聊天将被永久删除。此操作不可撤销。",cancel:"取消",archived:"已归档",archives:{title:"已归档的聊天",deleteAll:"全部删除",search:"搜索已归档的聊天",chatType:"聊天类型",allChats:"全部聊天",quickChats:"快捷聊天",projectChats:"项目聊天",project:"项目",allProjects:"所有项目",noProject:"无项目",count:"{{count}} 个聊天",updatedAt:"最后更新时间",connecting:"连接 Codex 后查看已归档的聊天。",loading:"正在加载已归档的聊天…",retry:"重试",empty:"暂无已归档的聊天",noResults:"没有符合条件的已归档聊天",deleteTitle:"删除已归档的聊天?",deleteAllDescription:"永久删除这 {{count}} 个已归档的聊天?此操作无法撤销。全部删除包含被当前筛选条件隐藏的聊天。",deleteDescription:"永久删除这个已归档的聊天?此操作无法撤销。",unarchive:"取消归档",confirmDelete:"永久删除"},filter:"筛选",collapseAllGroups:"折叠全部分组",openLeading:"进入 -1 屏",backToMain:"返回主屏"}};
2
- export{I};
1
+ var T={ar:{untitled:"دردشة جديدة",signOut:"تسجيل الخروج",help:"مساعدة",language:"اللغة",foreground:"المقدمة",background:"الخلفية",chats:"الدردشات",activity:"نشاط",quickChats:"دردشات سريعة",retry:"إعادة المحاولة",stop:"إيقاف",rename:"إعادة تسمية",fork:"إنشاء فرع",archive:"أرشفة",unarchive:"استعادة",delete:"حذف",deleteTitle:"حذف هذه الدردشة؟",deleteDescription:"ستُحذف هذه الدردشة نهائيًا. لا يمكن التراجع عن هذا الإجراء.",cancel:"إلغاء",archived:"مؤرشفة",filter:"تصفية",collapseAllGroups:"طي كل المجموعات",openLeading:"فتح الشاشة ‎-1",backToMain:"العودة إلى الشاشة الرئيسية"},de:{untitled:"Neuer Chat",signOut:"Abmelden",help:"Hilfe",language:"Sprache",foreground:"Vordergrund",background:"Hintergrund",chats:"Chats",activity:"Aktivität",quickChats:"Schnelle Chats",retry:"Wiederholen",stop:"Stopp",rename:"Umbenennen",fork:"Verzweigen",archive:"Archivieren",unarchive:"Wiederherstellen",delete:"Löschen",deleteTitle:"Diesen Chat löschen?",deleteDescription:"Dieser Chat wird dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",archived:"Archiviert",filter:"Filtern",collapseAllGroups:"Alle Gruppen einklappen",openLeading:"Bildschirm -1 öffnen",backToMain:"Zurück zum Hauptbildschirm"},en:{states:{title:"Session status",requires_action:"Needs attention",running:"Running",done:"Unread",idle:"Idle",empty:"No sessions"},untitled:"New chat",signOut:"Sign out",help:"Help",language:"Language",foreground:"Foreground",background:"Background",chats:"Chats",activity:"Activity",quickChats:"Quick chats",showAll:"Show all",retry:"Retry",stop:"Stop",rename:"Rename",fork:"Fork",archive:"Archive",unarchive:"Restore",delete:"Delete",deleteTitle:"Delete this chat?",deleteDescription:"This chat will be permanently deleted. This cannot be undone.",cancel:"Cancel",archived:"Archived",archives:{title:"Archived chats",deleteAll:"Delete all",search:"Search archived chats",chatType:"Chat type",allChats:"All chats",quickChats:"Quick chats",projectChats:"Project chats",project:"Project",allProjects:"All projects",noProject:"No project",count:"{{count}} chats",updatedAt:"Last updated",connecting:"Connect to Codex to view archived chats.",loading:"Loading archived chats…",retry:"Retry",empty:"No archived chats",noResults:"No matching archived chats",deleteTitle:"Delete archived chats?",deleteAllDescription:"Permanently delete these {{count}} archived chats? This cannot be undone. Deleting all includes chats hidden by the current filters.",deleteDescription:"Permanently delete this archived chat? This cannot be undone.",unarchive:"Unarchive",confirmDelete:"Delete permanently"},filter:"Filter",collapseAllGroups:"Collapse all groups",openLeading:"Open -1 screen",backToMain:"Back to main screen"},es:{untitled:"Nuevo chat",signOut:"Cerrar sesión",help:"Ayuda",language:"Idioma",foreground:"Primer plano",background:"Fondo",chats:"Chats",activity:"Actividad",quickChats:"Chats rápidos",retry:"Reintentar",stop:"Detener",rename:"Renombrar",fork:"Crear rama",archive:"Archivar",unarchive:"Restaurar",delete:"Eliminar",deleteTitle:"¿Eliminar este chat?",deleteDescription:"Este chat se eliminará permanentemente. Esta acción no se puede deshacer.",cancel:"Cancelar",archived:"Archivados",filter:"Filtrar",collapseAllGroups:"Contraer todos los grupos",openLeading:"Abrir la pantalla -1",backToMain:"Volver a la pantalla principal"},fr:{untitled:"Nouveau chat",signOut:"Se déconnecter",help:"Aide",language:"Langue",foreground:"Premier plan",background:"Arrière-plan",chats:"Discussions",activity:"Activité",quickChats:"Discussions rapides",retry:"Réessayer",stop:"Arrêter",rename:"Renommer",fork:"Créer une branche",archive:"Archiver",unarchive:"Restaurer",delete:"Supprimer",deleteTitle:"Supprimer cette discussion ?",deleteDescription:"Cette discussion sera définitivement supprimée. Cette action est irréversible.",cancel:"Annuler",archived:"Archivées",filter:"Filtrer",collapseAllGroups:"Réduire tous les groupes",openLeading:"Ouvrir l’écran -1",backToMain:"Revenir à l’écran principal"},hi:{untitled:"नई चैट",signOut:"साइन आउट",help:"सहायता",language:"भाषा",foreground:"अग्रभूमि",background:"पृष्ठभूमि",chats:"चैट",activity:"गतिविधि",quickChats:"त्वरित चैट",retry:"फिर से कोशिश करें",stop:"रोकें",rename:"नाम बदलें",fork:"शाखा बनाएँ",archive:"संग्रहित करें",unarchive:"रीस्टोर करें",delete:"हटाएं",deleteTitle:"यह चैट हटाएँ?",deleteDescription:"यह चैट स्थायी रूप से हटा दी जाएगी। इसे पूर्ववत नहीं किया जा सकता।",cancel:"रद्द करें",archived:"संग्रहीत",filter:"फ़िल्टर",collapseAllGroups:"सभी समूह संक्षिप्त करें",openLeading:"-1 स्क्रीन खोलें",backToMain:"मुख्य स्क्रीन पर लौटें"},id:{untitled:"Obrolan baru",signOut:"Keluar",help:"Bantuan",language:"Bahasa",foreground:"Depan",background:"Latar",chats:"Obrolan",activity:"Aktivitas",quickChats:"Chat cepat",retry:"Coba lagi",stop:"Hentikan",rename:"Ganti nama",fork:"Buat cabang",archive:"Arsipkan",unarchive:"Pulihkan",delete:"Hapus",deleteTitle:"Hapus obrolan ini?",deleteDescription:"Obrolan ini akan dihapus permanen. Tindakan ini tidak dapat dibatalkan.",cancel:"Batal",archived:"Diarsipkan",filter:"Filter",collapseAllGroups:"Ciutkan semua grup",openLeading:"Buka layar -1",backToMain:"Kembali ke layar utama"},it:{untitled:"Nuova chat",signOut:"Esci",help:"Aiuto",language:"Lingua",foreground:"Primo piano",background:"Sfondo",chats:"Chat",activity:"Attività",quickChats:"Chat rapide",retry:"Riprova",stop:"Interrompi",rename:"Rinomina",fork:"Crea un ramo",archive:"Archivia",unarchive:"Ripristina",delete:"Elimina",deleteTitle:"Eliminare questa chat?",deleteDescription:"Questa chat verrà eliminata definitivamente. L’azione non può essere annullata.",cancel:"Annulla",archived:"Archiviate",filter:"Filtra",collapseAllGroups:"Comprimi tutti i gruppi",openLeading:"Apri la schermata -1",backToMain:"Torna alla schermata principale"},ja:{untitled:"新しいチャット",signOut:"サインアウト",help:"ヘルプ",language:"言語",foreground:"フォアグラウンド",background:"背景",chats:"チャット",activity:"アクティビティ",quickChats:"クイックチャット",retry:"再試行",stop:"停止",rename:"名前を変更",fork:"分岐を作成",archive:"アーカイブ",unarchive:"復元",delete:"削除",deleteTitle:"このチャットを削除しますか?",deleteDescription:"このチャットは完全に削除されます。この操作は取り消せません。",cancel:"キャンセル",archived:"アーカイブ済み",filter:"フィルター",collapseAllGroups:"すべてのグループを折りたたむ",openLeading:"-1 画面を開く",backToMain:"メイン画面に戻る"},ko:{untitled:"새 채팅",signOut:"로그아웃",help:"도움말",language:"언어",foreground:"포그라운드",background:"배경",chats:"채팅",activity:"활동",quickChats:"빠른 채팅",retry:"다시 시도",stop:"중지",rename:"이름 바꾸기",fork:"분기 만들기",archive:"보관",unarchive:"복원",delete:"삭제",deleteTitle:"이 채팅을 삭제할까요?",deleteDescription:"이 채팅은 영구적으로 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",cancel:"취소",archived:"보관됨",filter:"필터",collapseAllGroups:"모든 그룹 접기",openLeading:"-1 화면 열기",backToMain:"메인 화면으로 돌아가기"},"pt-BR":{untitled:"Novo chat",signOut:"Sair",help:"Ajuda",language:"Idioma",foreground:"Primeiro plano",background:"Fundo",chats:"Chats",activity:"Atividade",quickChats:"Chats rápidos",retry:"Tentar novamente",stop:"Parar",rename:"Renomear",fork:"Criar ramificação",archive:"Arquivar",unarchive:"Restaurar",delete:"Excluir",deleteTitle:"Excluir esta conversa?",deleteDescription:"Esta conversa será excluída permanentemente. Esta ação não pode ser desfeita.",cancel:"Cancelar",archived:"Arquivadas",filter:"Filtrar",collapseAllGroups:"Recolher todos os grupos",openLeading:"Abrir a tela -1",backToMain:"Voltar à tela principal"},ru:{untitled:"Новый чат",signOut:"Выйти",help:"Справка",language:"Язык",foreground:"Передний план",background:"Фон",chats:"Чаты",activity:"Активность",quickChats:"Быстрые чаты",retry:"Повторить",stop:"Остановить",rename:"Переименовать",fork:"Создать ветку",archive:"Архивировать",unarchive:"Восстановить",delete:"Удалить",deleteTitle:"Удалить этот чат?",deleteDescription:"Этот чат будет удалён навсегда. Это действие нельзя отменить.",cancel:"Отмена",archived:"В архиве",filter:"Фильтр",collapseAllGroups:"Свернуть все группы",openLeading:"Открыть экран -1",backToMain:"На главный экран"},"zh-CN":{states:{title:"会话状态",requires_action:"待处理",running:"运行中",done:"完成未读",idle:"空闲",empty:"暂无会话"},untitled:"新聊天",signOut:"退出登录",help:"帮助",language:"语言",foreground:"前台",background:"后台",chats:"聊天",activity:"活动",quickChats:"随聊",showAll:"展开显示",retry:"重试",stop:"停止",rename:"重命名",fork:"分叉",archive:"归档",unarchive:"恢复",delete:"删除",deleteTitle:"删除这个聊天?",deleteDescription:"该聊天将被永久删除。此操作不可撤销。",cancel:"取消",archived:"已归档",archives:{title:"已归档的聊天",deleteAll:"全部删除",search:"搜索已归档的聊天",chatType:"聊天类型",allChats:"全部聊天",quickChats:"快捷聊天",projectChats:"项目聊天",project:"项目",allProjects:"所有项目",noProject:"无项目",count:"{{count}} 个聊天",updatedAt:"最后更新时间",connecting:"连接 Codex 后查看已归档的聊天。",loading:"正在加载已归档的聊天…",retry:"重试",empty:"暂无已归档的聊天",noResults:"没有符合条件的已归档聊天",deleteTitle:"删除已归档的聊天?",deleteAllDescription:"永久删除这 {{count}} 个已归档的聊天?此操作无法撤销。全部删除包含被当前筛选条件隐藏的聊天。",deleteDescription:"永久删除这个已归档的聊天?此操作无法撤销。",unarchive:"取消归档",confirmDelete:"永久删除"},filter:"筛选",collapseAllGroups:"折叠全部分组",openLeading:"进入 -1 屏",backToMain:"返回主屏"}};
2
+ export{T};
@@ -0,0 +1,2 @@
1
+ import{createContext as t,useContext as o}from"react";var mo=t(null);function Pn(){let e=o(mo);if(e===null)throw Error("Composer is missing");return e}
2
+ export{mo,Pn};
@@ -1,2 +1,2 @@
1
- import{inSessionTree as _,nativeTurnId as k}from"@nyssance/codex-acp-v2/client";function a(i){return i!==null&&typeof i==="object"&&!Array.isArray(i)?i:null}function r(i){return typeof i==="string"&&i.length>0?i:null}function R(i){switch(i){case"completed":return"completed";case"errored":return"failed";case"interrupted":case"shutdown":return"interrupted";default:return"unknown"}}function no(i,l,p,S,b=p[i]){let f=b?.items??l.items,I=new Set(l.items.map(k).filter((t)=>t!==null)),A=new Set([...I].filter((t)=>{let n=f.find((e)=>e.kind==="user"&&k(e)===t)??f.find((e)=>k(e)===t);return l.items.some((e)=>e.kind===n?.kind&&e.id===n.id)})),T=Object.values(p).filter((t)=>t.subagent?.parentId===i),u=new Map,h=new Set,x=new Set(l.items.map((t)=>t.id)),y=(t,n,e,s)=>{if(h.add(t),!x.has(s))return;if(!u.has(t))u.set(t,{key:t,threadId:t,title:n,description:e,status:"unknown",originItemId:s})};for(let t of f){if(t.kind!=="tool")continue;let n=a(t._meta?.codex),e=a(n?.subagent),s=a(t.rawInput);if(e?.activity==="started"||s?.activity==="started"){let c=r(e?.threadId)??r(s?.agentThreadId),d=r(e?.path)??r(s?.agentPath);if(c)y(c,d?.split("/").findLast(Boolean)??null,null,t.id)}let o=a(n?.collaboration);if(o?.tool==="spawnAgent"||t.title==="spawnAgent"){let c=o?.receiverThreadIds??s?.receiverThreadIds,d=Array.isArray(o?.agents)?o.agents.map(a):[];if(Array.isArray(c))for(let g of c){let m=r(g);if(!m)continue;let w=d.find((v)=>v?.threadId===m);y(m,r(w?.nickname)??r(w?.role),r(s?.prompt),t.id)}}}for(let t of T){let n=a(t.subagent?._meta?.codex),e=r(n?.threadId),s=r(n?.parentTurnId),o=e===null?void 0:u.get(e);if(!o&&(e!==null&&h.has(e)||s===null||!A.has(s)))continue;let c=e??t.id;u.set(c,{...o,key:c,threadId:e,title:t.title,description:t.subagent?.description??null,session:t,status:"unknown"})}for(let t of f){if(t.kind!=="tool")continue;let n=a(t._meta?.codex),e=a(n?.collaboration);if(Array.isArray(e?.agents))for(let c of e.agents){let d=a(c),g=u.get(r(d?.threadId)??"");if(g)g.status=R(a(d?.state)?.status)}let s=a(n?.subagent),o=u.get(r(s?.threadId)??"");if(o&&s?.activity==="completed")o.status="completed";if(o&&s?.activity==="interrupted")o.status="interrupted"}for(let t of u.values()){let n=t.session;if(!n)continue;if(S.some((e)=>_(p,n.id,e.sessionId))||n.state==="requires_action")t.status="requires_action";else if(n.attached&&n.state==="running")t.status="running";else if(n.error||n.lastStopReason==="error")t.status="failed";else if(n.lastStopReason==="cancelled")t.status="interrupted";else if(n.lastStopReason==="end_turn")t.status="completed";else if(t.status==="unknown")t.status=!n.attached?"detached":n.state}return[...u.values()]}
2
- export{no};
1
+ import{inSessionTree as _,nativeTurnId as k}from"@nyssance/codex-acp-v2/client";function a(i){return i!==null&&typeof i==="object"&&!Array.isArray(i)?i:null}function r(i){return typeof i==="string"&&i.length>0?i:null}function R(i){switch(i){case"completed":return"completed";case"errored":return"failed";case"interrupted":case"shutdown":return"interrupted";default:return"unknown"}}function uo(i,l,p,S,b=p[i]){let f=b?.items??l.items,I=new Set(l.items.map(k).filter((t)=>t!==null)),A=new Set([...I].filter((t)=>{let n=f.find((e)=>e.kind==="user"&&k(e)===t)??f.find((e)=>k(e)===t);return l.items.some((e)=>e.kind===n?.kind&&e.id===n.id)})),T=Object.values(p).filter((t)=>t.subagent?.parentId===i),u=new Map,h=new Set,x=new Set(l.items.map((t)=>t.id)),y=(t,n,e,s)=>{if(h.add(t),!x.has(s))return;if(!u.has(t))u.set(t,{key:t,threadId:t,title:n,description:e,status:"unknown",originItemId:s})};for(let t of f){if(t.kind!=="tool")continue;let n=a(t._meta?.codex),e=a(n?.subagent),s=a(t.rawInput);if(e?.activity==="started"||s?.activity==="started"){let c=r(e?.threadId)??r(s?.agentThreadId),d=r(e?.path)??r(s?.agentPath);if(c)y(c,d?.split("/").findLast(Boolean)??null,null,t.id)}let o=a(n?.collaboration);if(o?.tool==="spawnAgent"||t.title==="spawnAgent"){let c=o?.receiverThreadIds??s?.receiverThreadIds,d=Array.isArray(o?.agents)?o.agents.map(a):[];if(Array.isArray(c))for(let g of c){let m=r(g);if(!m)continue;let w=d.find((v)=>v?.threadId===m);y(m,r(w?.nickname)??r(w?.role),r(s?.prompt),t.id)}}}for(let t of T){let n=a(t.subagent?._meta?.codex),e=r(n?.threadId),s=r(n?.parentTurnId),o=e===null?void 0:u.get(e);if(!o&&(e!==null&&h.has(e)||s===null||!A.has(s)))continue;let c=e??t.id;u.set(c,{...o,key:c,threadId:e,title:t.title,description:t.subagent?.description??null,session:t,status:"unknown"})}for(let t of f){if(t.kind!=="tool")continue;let n=a(t._meta?.codex),e=a(n?.collaboration);if(Array.isArray(e?.agents))for(let c of e.agents){let d=a(c),g=u.get(r(d?.threadId)??"");if(g)g.status=R(a(d?.state)?.status)}let s=a(n?.subagent),o=u.get(r(s?.threadId)??"");if(o&&s?.activity==="completed")o.status="completed";if(o&&s?.activity==="interrupted")o.status="interrupted"}for(let t of u.values()){let n=t.session;if(!n)continue;if(S.some((e)=>_(p,n.id,e.sessionId))||n.state==="requires_action")t.status="requires_action";else if(n.attached&&n.state==="running")t.status="running";else if(n.error||n.lastStopReason==="error")t.status="failed";else if(n.lastStopReason==="cancelled")t.status="interrupted";else if(n.lastStopReason==="end_turn")t.status="completed";else if(t.status==="unknown")t.status=!n.attached?"detached":n.state}return[...u.values()]}
2
+ export{uo};