@alwith/module-chat 0.6.34 → 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 (490) hide show
  1. package/dist/activity-host.d.ts +2 -0
  2. package/dist/activity-host.js +1 -1
  3. package/dist/agent/client.d.ts +2 -0
  4. package/dist/agent/client.js +1 -1
  5. package/dist/agent/custom-model-effort.js +1 -1
  6. package/dist/agent/fork-title.js +1 -1
  7. package/dist/agent/image-request.js +1 -1
  8. package/dist/agent/image-tools.d.ts +3 -1
  9. package/dist/agent/image-tools.js +1 -1
  10. package/dist/agent/input-config.js +1 -1
  11. package/dist/agent/input-modes/chat.js +1 -1
  12. package/dist/agent/input-modes/execution-meta.js +1 -1
  13. package/dist/agent/input-modes/image-context.js +1 -1
  14. package/dist/agent/input-modes/image.js +1 -1
  15. package/dist/agent/input-modes/index.js +1 -1
  16. package/dist/agent/project-path.js +1 -1
  17. package/dist/agent/request-error.js +1 -1
  18. package/dist/agent/session-list-refresh.js +1 -1
  19. package/dist/app-reference.js +1 -1
  20. package/dist/application-tools.js +1 -1
  21. package/dist/approval/choice-elicitation-form.js +1 -1
  22. package/dist/approval/choice-schema.js +1 -1
  23. package/dist/approval/permission-options.js +1 -1
  24. package/dist/approval/permission-view.js +1 -1
  25. package/dist/approval/schema-elicitation-form.js +1 -1
  26. package/dist/approval/url-elicitation-card.js +1 -1
  27. package/dist/{chunk-0a3tr9ws.js → chunk-0sb0c014.js} +2 -2
  28. package/dist/{chunk-ks22p0wq.js → chunk-0xztk729.js} +2 -2
  29. package/dist/chunk-18gcnf2a.js +2 -0
  30. package/dist/{chunk-p216frcj.js → chunk-1a46v4cy.js} +2 -2
  31. package/dist/chunk-1b3frq9c.js +3 -0
  32. package/dist/{chunk-nhz4egjh.js → chunk-1vwece23.js} +6 -6
  33. package/dist/{chunk-wvm6ppb3.js → chunk-20dc4fm0.js} +2 -2
  34. package/dist/{chunk-45yrj0e1.js → chunk-22nybrkv.js} +5 -5
  35. package/dist/{chunk-vab1ysnz.js → chunk-23kvszfc.js} +2 -2
  36. package/dist/chunk-2nq204hz.js +2 -0
  37. package/dist/{chunk-dcvmc9hn.js → chunk-2nv5ebq1.js} +2 -2
  38. package/dist/chunk-33fxyn5r.js +2 -0
  39. package/dist/chunk-359pf448.js +2 -0
  40. package/dist/{chunk-n8b9yg4q.js → chunk-3knw8e0x.js} +2 -2
  41. package/dist/{chunk-2eceheqt.js → chunk-3kytka7m.js} +3 -3
  42. package/dist/{chunk-mq0npf36.js → chunk-3sq2k9ca.js} +2 -2
  43. package/dist/{chunk-vgea7ggq.js → chunk-3t3n8nfy.js} +2 -2
  44. package/dist/{chunk-9n8cds8p.js → chunk-3tvq6xr2.js} +2 -2
  45. package/dist/{chunk-gktjkghg.js → chunk-482segb0.js} +2 -2
  46. package/dist/{chunk-19jh646d.js → chunk-4chmr87g.js} +2 -2
  47. package/dist/chunk-4g2412p5.js +2 -0
  48. package/dist/chunk-4ma6bmcm.js +2 -0
  49. package/dist/{chunk-103z8myv.js → chunk-54jfqcd1.js} +2 -2
  50. package/dist/chunk-5mxh7h57.js +2 -0
  51. package/dist/{chunk-tjt1s9qs.js → chunk-5qaa4atv.js} +2 -2
  52. package/dist/{chunk-qwjz3jsz.js → chunk-5zf3px9y.js} +2 -2
  53. package/dist/chunk-60yk0ye9.js +2 -0
  54. package/dist/chunk-63kwbtgs.js +2 -0
  55. package/dist/{chunk-sgmh6sa8.js → chunk-67fn9pq0.js} +2 -2
  56. package/dist/{chunk-84p483n0.js → chunk-6br4568a.js} +2 -2
  57. package/dist/{chunk-4jza4wwy.js → chunk-6c7q2rz8.js} +2 -2
  58. package/dist/{chunk-7m8hw6gh.js → chunk-6ea6q6dj.js} +2 -2
  59. package/dist/{chunk-88ysxbdh.js → chunk-6v0r7m92.js} +2 -2
  60. package/dist/{chunk-kbzsn9xw.js → chunk-6xap6hvz.js} +2 -2
  61. package/dist/{chunk-re4vc51w.js → chunk-7naym98x.js} +2 -2
  62. package/dist/{chunk-r5q65gf3.js → chunk-7nfv27hz.js} +2 -2
  63. package/dist/{chunk-masqfje4.js → chunk-7tgfj1zb.js} +2 -2
  64. package/dist/{chunk-gfkx1z04.js → chunk-7ywnza68.js} +2 -2
  65. package/dist/{chunk-r8sq654w.js → chunk-8be6eq9r.js} +2 -2
  66. package/dist/chunk-8eyw37rv.js +2 -0
  67. package/dist/{chunk-eqa6cd7b.js → chunk-8pb726d6.js} +2 -2
  68. package/dist/{chunk-zv3bm3np.js → chunk-8x7a5n2w.js} +2 -2
  69. package/dist/{chunk-x2x9g6vk.js → chunk-8yetzgqb.js} +2 -2
  70. package/dist/{chunk-tj0530fn.js → chunk-8zkn8x2j.js} +2 -2
  71. package/dist/chunk-95f0wens.js +2 -0
  72. package/dist/{chunk-g1de763m.js → chunk-9ghxym50.js} +2 -2
  73. package/dist/{chunk-n8fe2njr.js → chunk-9hts7x5n.js} +2 -2
  74. package/dist/{chunk-8sa6xn88.js → chunk-9hwqfjc1.js} +2 -2
  75. package/dist/{chunk-zqpcrtde.js → chunk-9ns2xh84.js} +2 -2
  76. package/dist/{chunk-y8p2dmw3.js → chunk-9nz4c647.js} +2 -2
  77. package/dist/{chunk-tz1gzwas.js → chunk-a2tkhes5.js} +2 -2
  78. package/dist/{chunk-zy6qme7n.js → chunk-a4ebhcsy.js} +2 -2
  79. package/dist/{chunk-mhhtcbh9.js → chunk-aeccrrg1.js} +2 -2
  80. package/dist/{chunk-arr0hypp.js → chunk-aemtk0r5.js} +2 -2
  81. package/dist/{chunk-r7g85s0a.js → chunk-afnnrn6z.js} +2 -2
  82. package/dist/chunk-aj0z9a5r.js +2 -0
  83. package/dist/{chunk-x49qjrbk.js → chunk-aj6yxm6d.js} +2 -2
  84. package/dist/{chunk-rt9dn0b3.js → chunk-aq3hemsb.js} +3 -3
  85. package/dist/{chunk-zk395v8p.js → chunk-b0zzq2ky.js} +2 -2
  86. package/dist/{chunk-f6cexkjm.js → chunk-b3mja7d9.js} +3 -3
  87. package/dist/{chunk-8w08gd0y.js → chunk-b6kn9ack.js} +3 -3
  88. package/dist/{chunk-mfkrs2at.js → chunk-b8tx1n1a.js} +2 -2
  89. package/dist/chunk-bdea3k6b.js +2 -0
  90. package/dist/{chunk-52wrk1mh.js → chunk-bm457bsd.js} +2 -2
  91. package/dist/{chunk-bhajnmtf.js → chunk-bt42z99s.js} +2 -2
  92. package/dist/{chunk-2016dacx.js → chunk-by7k0ypx.js} +2 -2
  93. package/dist/{chunk-wpacvdsv.js → chunk-bysgsnph.js} +2 -2
  94. package/dist/{chunk-bq31dzpj.js → chunk-c0czkyzh.js} +2 -2
  95. package/dist/chunk-c70a2esc.js +2 -0
  96. package/dist/{chunk-xqqk85kd.js → chunk-ccner90h.js} +2 -2
  97. package/dist/{chunk-e84mhse2.js → chunk-cgpnhrm5.js} +3 -3
  98. package/dist/{chunk-kj3a1k2q.js → chunk-chjt1pct.js} +2 -2
  99. package/dist/{chunk-pr7xj1fn.js → chunk-ck70ewc8.js} +2 -2
  100. package/dist/{chunk-fpsn6fmf.js → chunk-ckft9abb.js} +2 -2
  101. package/dist/{chunk-6nbqbjnb.js → chunk-d0zazfrq.js} +3 -3
  102. package/dist/{chunk-q78ng7mn.js → chunk-d607659a.js} +2 -2
  103. package/dist/{chunk-zyn0ys4m.js → chunk-d84xx4bh.js} +2 -2
  104. package/dist/{chunk-vys8kfkp.js → chunk-db8hae9d.js} +2 -2
  105. package/dist/chunk-ddaz4j9s.js +2 -0
  106. package/dist/{chunk-r0dg1bjd.js → chunk-dhx1sd4s.js} +2 -2
  107. package/dist/{chunk-at25g15n.js → chunk-dzncwejn.js} +2 -2
  108. package/dist/chunk-e99t3sk5.js +2 -0
  109. package/dist/{chunk-ske5z0gp.js → chunk-ebkz1sy2.js} +2 -2
  110. package/dist/chunk-eevfr0tx.js +2 -0
  111. package/dist/{chunk-89gyxwmd.js → chunk-enkrqfqq.js} +2 -2
  112. package/dist/{chunk-z8b3nz7t.js → chunk-epqqzh99.js} +2 -2
  113. package/dist/{chunk-prwzyc7q.js → chunk-epqyjwrh.js} +2 -2
  114. package/dist/{chunk-0bc7gfq4.js → chunk-evgfpd16.js} +2 -2
  115. package/dist/chunk-eyw05qyj.js +4 -0
  116. package/dist/{chunk-15m908ph.js → chunk-f2h074g0.js} +2 -2
  117. package/dist/{chunk-zg0tv3sj.js → chunk-fggwwmzc.js} +3 -3
  118. package/dist/{chunk-a18avvt2.js → chunk-fqchnswc.js} +2 -2
  119. package/dist/{chunk-sbyp6k8w.js → chunk-fvmnj6bg.js} +2 -2
  120. package/dist/chunk-fxzh4f7c.js +4 -0
  121. package/dist/chunk-fzfwftqs.js +2 -0
  122. package/dist/{chunk-qd9s7wmj.js → chunk-g9v0jr0f.js} +3 -3
  123. package/dist/{chunk-28nsjq3w.js → chunk-ged1nyhk.js} +5 -5
  124. package/dist/chunk-gk7nn747.js +2 -0
  125. package/dist/chunk-gmns080g.js +2 -0
  126. package/dist/chunk-gw4zbw0m.js +2 -0
  127. package/dist/{chunk-cef598jy.js → chunk-gy446wcz.js} +2 -2
  128. package/dist/chunk-h71pkpwg.js +2 -0
  129. package/dist/{chunk-bsb08p49.js → chunk-ha1s3jbc.js} +3 -3
  130. package/dist/{chunk-k3fwyr6s.js → chunk-hfjttc7r.js} +2 -2
  131. package/dist/{chunk-vedvkp9e.js → chunk-hqc5c3nz.js} +3 -3
  132. package/dist/{chunk-5x2aqmhm.js → chunk-hwhyyaen.js} +2 -2
  133. package/dist/{chunk-z6tw9cf9.js → chunk-j1t1fnew.js} +2 -2
  134. package/dist/chunk-j2bp0zbe.js +2 -0
  135. package/dist/{chunk-y0rnvmrw.js → chunk-jne0bc79.js} +2 -2
  136. package/dist/chunk-jtws1jg5.js +2 -0
  137. package/dist/{chunk-1md5vq9g.js → chunk-jygp7479.js} +2 -2
  138. package/dist/{chunk-b9v0vew6.js → chunk-jz7mckdp.js} +2 -2
  139. package/dist/{chunk-8hm3nkrk.js → chunk-k014w2jg.js} +2 -2
  140. package/dist/{chunk-m6sdmcpj.js → chunk-k0h18sme.js} +2 -2
  141. package/dist/{chunk-vb9mn75j.js → chunk-k1w3acq7.js} +2 -2
  142. package/dist/{chunk-as2j0yp0.js → chunk-k5065dzv.js} +2 -2
  143. package/dist/chunk-k97dpdcj.js +2 -0
  144. package/dist/{chunk-v4tznge3.js → chunk-kgx0jj22.js} +3 -3
  145. package/dist/chunk-khd2r3jh.js +2 -0
  146. package/dist/{chunk-1gb1vwvy.js → chunk-kk9dbwd1.js} +2 -2
  147. package/dist/chunk-kvgn4b2n.js +2 -0
  148. package/dist/{chunk-w83nb5a8.js → chunk-mg9a4t04.js} +2 -2
  149. package/dist/{chunk-6h10jana.js → chunk-mgve4dcw.js} +2 -2
  150. package/dist/{chunk-dhn9f10w.js → chunk-mgwkmr8g.js} +2 -2
  151. package/dist/{chunk-qk1yqepm.js → chunk-mhrn3e8j.js} +2 -2
  152. package/dist/{chunk-fwn521m5.js → chunk-mkawbqx5.js} +2 -2
  153. package/dist/chunk-mp5f940y.js +1 -0
  154. package/dist/chunk-mybye5t2.js +2 -0
  155. package/dist/{chunk-9x70f7zv.js → chunk-n4rep234.js} +2 -2
  156. package/dist/{chunk-k5kzw2px.js → chunk-nebke41s.js} +3 -3
  157. package/dist/{chunk-5h49mv0e.js → chunk-newkrtrj.js} +2 -2
  158. package/dist/{chunk-9jth6sk7.js → chunk-nfnejf16.js} +2 -2
  159. package/dist/{chunk-zyyn9t8n.js → chunk-njw6x85v.js} +3 -3
  160. package/dist/{chunk-1d29gnb2.js → chunk-npt6at4f.js} +2 -2
  161. package/dist/chunk-nrfyvzmk.js +2 -0
  162. package/dist/{chunk-86tpa1nn.js → chunk-nvadhyne.js} +2 -2
  163. package/dist/{chunk-rd51rvde.js → chunk-p2bn8ypc.js} +2 -2
  164. package/dist/chunk-pnx0f495.js +2 -0
  165. package/dist/{chunk-7p0d3rz7.js → chunk-ppcwcrdz.js} +2 -2
  166. package/dist/chunk-prr551k0.js +2 -0
  167. package/dist/chunk-pvm6d77q.js +2 -0
  168. package/dist/{chunk-0b50jg23.js → chunk-pxbww0j1.js} +2 -2
  169. package/dist/{chunk-g947bnqx.js → chunk-pz5d0vgv.js} +2 -2
  170. package/dist/chunk-q2ykvjrz.js +2 -0
  171. package/dist/chunk-q8c4k6qh.js +2 -0
  172. package/dist/{chunk-vnd6smsp.js → chunk-q8y2a23c.js} +2 -2
  173. package/dist/{chunk-11kkxd6v.js → chunk-qbmgsd3h.js} +2 -2
  174. package/dist/{chunk-965sngjd.js → chunk-qbpy0aqe.js} +2 -2
  175. package/dist/chunk-qgrd5xre.js +2 -0
  176. package/dist/{chunk-r8gnmyb1.js → chunk-qkddvxjr.js} +2 -2
  177. package/dist/chunk-qv61ef2y.js +2 -0
  178. package/dist/{chunk-9t672hzm.js → chunk-qvdfrmpb.js} +2 -2
  179. package/dist/chunk-qvzxzzw8.js +2 -0
  180. package/dist/{chunk-b6sb3akb.js → chunk-r2b234a7.js} +2 -2
  181. package/dist/{chunk-0t4fcgge.js → chunk-ra52dqfb.js} +2 -2
  182. package/dist/{chunk-68afy8mk.js → chunk-rb6mjycp.js} +2 -2
  183. package/dist/{chunk-dqjhmzjy.js → chunk-rbs3079t.js} +2 -2
  184. package/dist/chunk-rcynxrkk.js +4 -0
  185. package/dist/{chunk-75xtk0a3.js → chunk-rms7wj04.js} +2 -2
  186. package/dist/{chunk-pr6qwqpj.js → chunk-rntrfb49.js} +2 -2
  187. package/dist/{chunk-h4xx90s4.js → chunk-rxj5619b.js} +2 -2
  188. package/dist/{chunk-72xm1tz1.js → chunk-ry5phnnk.js} +2 -2
  189. package/dist/{chunk-z0q7ghbg.js → chunk-s11mgwyh.js} +2 -2
  190. package/dist/{chunk-4wm5emgf.js → chunk-s170cg6j.js} +2 -2
  191. package/dist/{chunk-8gas4q2s.js → chunk-s1w3j9p9.js} +2 -2
  192. package/dist/{chunk-2dnzdsrv.js → chunk-sfd0pp49.js} +3 -3
  193. package/dist/chunk-shzj5zf0.js +2 -0
  194. package/dist/chunk-sk9rm826.js +2 -0
  195. package/dist/chunk-svxnx1c7.js +2 -0
  196. package/dist/chunk-symaxskd.js +2 -0
  197. package/dist/chunk-t3rv7vat.js +2 -0
  198. package/dist/{chunk-yq4wz4n8.js → chunk-t6ddgvkm.js} +2 -2
  199. package/dist/{chunk-g7dxg38a.js → chunk-th5vv83g.js} +2 -2
  200. package/dist/{chunk-dxwbgg69.js → chunk-tj4b0s68.js} +2 -2
  201. package/dist/chunk-veef1avy.js +2 -0
  202. package/dist/chunk-vgxvtmja.js +2 -0
  203. package/dist/{chunk-ad53zbdb.js → chunk-vjfxm73q.js} +2 -2
  204. package/dist/chunk-vnxa4qe2.js +2 -0
  205. package/dist/{chunk-9y0fxq8e.js → chunk-vq060dnz.js} +2 -2
  206. package/dist/{chunk-ckbqdg1s.js → chunk-vyvsm4v9.js} +2 -2
  207. package/dist/{chunk-8w5bt0nc.js → chunk-w1yrsbw1.js} +2 -2
  208. package/dist/{chunk-64apxzn7.js → chunk-w2p1g8rp.js} +2 -2
  209. package/dist/{chunk-rr5ek064.js → chunk-w4537026.js} +2 -2
  210. package/dist/chunk-wexhc7rb.js +2 -0
  211. package/dist/{chunk-nef7y6mg.js → chunk-wf0ytnh9.js} +2 -2
  212. package/dist/{chunk-xqb4thy8.js → chunk-wf4z9w5x.js} +2 -2
  213. package/dist/{chunk-j4ejwthn.js → chunk-whax282d.js} +2 -2
  214. package/dist/{chunk-x6spt0mc.js → chunk-wrxj79ct.js} +2 -2
  215. package/dist/{chunk-mt01qph9.js → chunk-xanfp0nh.js} +2 -2
  216. package/dist/{chunk-jaghs2z5.js → chunk-xjf2zkrg.js} +2 -2
  217. package/dist/{chunk-dwxmgsg8.js → chunk-xqrhfxct.js} +2 -2
  218. package/dist/{chunk-ksq9a3pf.js → chunk-xxwevgqr.js} +2 -2
  219. package/dist/{chunk-x2wcwpw3.js → chunk-y5qzgfsd.js} +2 -2
  220. package/dist/chunk-y72y3j24.js +2 -0
  221. package/dist/{chunk-81xwn9e5.js → chunk-y8aeahf2.js} +3 -3
  222. package/dist/chunk-ygake3bx.js +2 -0
  223. package/dist/{chunk-zb0m2cqy.js → chunk-ymdhz3x0.js} +2 -2
  224. package/dist/{chunk-erdrx47j.js → chunk-ytkcpeq2.js} +2 -2
  225. package/dist/{chunk-69tgmjdb.js → chunk-z27pxeqg.js} +2 -2
  226. package/dist/{chunk-mrwawq46.js → chunk-z53fd30n.js} +2 -2
  227. package/dist/{chunk-54j6xftt.js → chunk-zjzzqtaj.js} +2 -2
  228. package/dist/{chunk-mmrwaa9h.js → chunk-zpetyx45.js} +2 -2
  229. package/dist/chunk-zpm0t5ye.js +2 -0
  230. package/dist/chunk-ztrkk6sp.js +2 -0
  231. package/dist/client.js +1 -1
  232. package/dist/codex/activity-group.js +1 -1
  233. package/dist/codex/artifact-links.js +1 -1
  234. package/dist/codex/assistant-message.js +1 -1
  235. package/dist/codex/async-question-card.js +1 -1
  236. package/dist/codex/disclosure-state.js +1 -1
  237. package/dist/codex/edited-files-card.js +1 -1
  238. package/dist/codex/image-view-activity.js +1 -1
  239. package/dist/codex/markdown-renderer.js +1 -1
  240. package/dist/codex/navigation-audio.js +1 -1
  241. package/dist/codex/navigation-preview.js +1 -1
  242. package/dist/codex/navigation-rail.js +1 -1
  243. package/dist/codex/patch-view.js +1 -1
  244. package/dist/codex/plan.js +1 -1
  245. package/dist/codex/timeline-virtualizer.js +1 -1
  246. package/dist/codex/turn-activity.js +1 -1
  247. package/dist/codex/user-message.js +1 -1
  248. package/dist/codex/virtualized-turn-list.js +1 -1
  249. package/dist/collections/collection-emoji.js +1 -1
  250. package/dist/collections/collection-menu.js +1 -1
  251. package/dist/collections/collection-panel.js +1 -1
  252. package/dist/collections/collections.js +1 -1
  253. package/dist/collections/host.js +1 -1
  254. package/dist/collections/locales.js +1 -1
  255. package/dist/collections/model.js +1 -1
  256. package/dist/collections/store.js +1 -1
  257. package/dist/composer/completion-filter.js +1 -1
  258. package/dist/composer/completion-menu.js +1 -1
  259. package/dist/composer/completion-trigger.js +1 -1
  260. package/dist/composer/effort-slider.js +1 -1
  261. package/dist/composer/inline-document.js +1 -1
  262. package/dist/composer/inline-dom.js +1 -1
  263. package/dist/composer/menu-radio.js +1 -1
  264. package/dist/composer/model-select.js +1 -1
  265. package/dist/composer/permission-mode-select.js +1 -1
  266. package/dist/composer/prompt-input-attachments.js +1 -1
  267. package/dist/composer/prompt-input-clipboard.js +1 -1
  268. package/dist/composer/prompt-input-context.d.ts +9 -0
  269. package/dist/composer/prompt-input-context.js +1 -1
  270. package/dist/composer/prompt-input-inline.js +1 -1
  271. package/dist/composer/prompt-input-textarea.js +1 -1
  272. package/dist/composer/prompt-input.js +1 -1
  273. package/dist/conversation/action-card.js +1 -1
  274. package/dist/conversation/composer/app-mentions.js +1 -1
  275. package/dist/conversation/composer/apps-menu.js +1 -1
  276. package/dist/conversation/composer/composer-menu.js +1 -1
  277. package/dist/conversation/composer/composer.js +1 -1
  278. package/dist/conversation/composer/config-options.js +1 -1
  279. package/dist/conversation/composer/context.js +1 -1
  280. package/dist/conversation/composer/drafts.js +1 -1
  281. package/dist/conversation/composer/file-items.js +1 -1
  282. package/dist/conversation/composer/long-text.js +1 -1
  283. package/dist/conversation/composer/mention-chips.js +1 -1
  284. package/dist/conversation/composer/mention-uri.js +1 -1
  285. package/dist/conversation/composer/model-menu.js +1 -1
  286. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  287. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  288. package/dist/conversation/composer/prediction.js +1 -1
  289. package/dist/conversation/composer/prompt-history.js +1 -1
  290. package/dist/conversation/composer/slash-command-button.js +1 -1
  291. package/dist/conversation/composer/submit-button.js +1 -1
  292. package/dist/conversation/composer/usage-meter.js +1 -1
  293. package/dist/conversation/connection-notice.js +1 -1
  294. package/dist/conversation/context.js +1 -1
  295. package/dist/conversation/conversation-body.js +1 -1
  296. package/dist/conversation/conversation-search.js +1 -1
  297. package/dist/conversation/conversation-view.js +1 -1
  298. package/dist/conversation/conversation.js +1 -1
  299. package/dist/conversation/diff-modal.js +1 -1
  300. package/dist/conversation/draft-project-picker.js +1 -1
  301. package/dist/conversation/session-actions.js +1 -1
  302. package/dist/conversation/subagent-sessions.js +1 -1
  303. package/dist/conversation/subagent-tasks.js +1 -1
  304. package/dist/desktop/desktop-composer.d.ts +2 -1
  305. package/dist/desktop/desktop-composer.js +1 -1
  306. package/dist/desktop/desktop.js +1 -1
  307. package/dist/desktop/draft-model-select.js +1 -1
  308. package/dist/desktop/load-image.js +1 -1
  309. package/dist/desktop/model-catalog.js +1 -1
  310. package/dist/desktop/model-recovery.js +1 -1
  311. package/dist/desktop/model-settings-action.js +1 -1
  312. package/dist/desktop/native-file-drop.d.ts +3 -1
  313. package/dist/desktop/native-file-drop.js +1 -1
  314. package/dist/generated/commands.d.ts +1 -0
  315. package/dist/generated/commands.js +1 -1
  316. package/dist/generated-image-storage.d.ts +11 -0
  317. package/dist/generated-image-storage.js +1 -0
  318. package/dist/image-lightbox.js +1 -1
  319. package/dist/image-preview-dialog.js +1 -1
  320. package/dist/image.d.ts +5 -1
  321. package/dist/image.js +1 -1
  322. package/dist/lib/app-reference.js +1 -1
  323. package/dist/lib/application-metadata.js +1 -1
  324. package/dist/lib/chat-path.js +1 -1
  325. package/dist/lib/code-highlighter.js +1 -1
  326. package/dist/lib/file-url.js +1 -1
  327. package/dist/lib/fuzzy.js +1 -1
  328. package/dist/lib/group-blocks.js +1 -1
  329. package/dist/lib/image-encode.js +1 -1
  330. package/dist/lib/limits.js +1 -1
  331. package/dist/lib/markdown-parser.js +1 -1
  332. package/dist/lib/markdown-rules.js +1 -1
  333. package/dist/lib/model-name.js +1 -1
  334. package/dist/lib/pointer-centered-zoom.js +1 -1
  335. package/dist/lib/prepare-prompt-files.d.ts +2 -2
  336. package/dist/lib/prepare-prompt-files.js +1 -1
  337. package/dist/lib/reference-presentation.js +1 -1
  338. package/dist/lib/stream-style.js +1 -1
  339. package/dist/lib/streaming-markdown.js +1 -1
  340. package/dist/lib/tool-artifacts.js +1 -1
  341. package/dist/locales.js +1 -1
  342. package/dist/mermaid/diagram.js +1 -1
  343. package/dist/mermaid/export.js +1 -1
  344. package/dist/mermaid/index.js +1 -1
  345. package/dist/mermaid/preview.js +1 -1
  346. package/dist/oauth/claude-login.js +1 -1
  347. package/dist/oauth.js +1 -1
  348. package/dist/plugins/catalog-header.js +1 -1
  349. package/dist/plugins/catalog-skeleton.js +1 -1
  350. package/dist/plugins/host.js +1 -1
  351. package/dist/plugins/locales.js +1 -1
  352. package/dist/plugins/new-chat-directory.js +1 -1
  353. package/dist/plugins/pane.js +1 -1
  354. package/dist/plugins/panel-item.js +1 -1
  355. package/dist/plugins/plugin-detail-page.js +1 -1
  356. package/dist/plugins/plugin-icon.js +1 -1
  357. package/dist/plugins/plugin-icons.js +1 -1
  358. package/dist/plugins/plugins-page.js +1 -1
  359. package/dist/plugins/plugins.js +1 -1
  360. package/dist/plugins/read-skill-document.js +1 -1
  361. package/dist/plugins/skill-document.js +1 -1
  362. package/dist/plugins/skills-tab.js +1 -1
  363. package/dist/plugins/store.js +1 -1
  364. package/dist/plugins/toolbox-layout.js +1 -1
  365. package/dist/reference-projection.js +1 -1
  366. package/dist/search/chat-search.js +1 -1
  367. package/dist/search/codex-source-matches.js +1 -1
  368. package/dist/search/dom-matches.js +1 -1
  369. package/dist/search/find-bar.js +1 -1
  370. package/dist/search/literal-matches.js +1 -1
  371. package/dist/session-list/account-menu.js +1 -1
  372. package/dist/session-list/activity-list.js +1 -1
  373. package/dist/session-list/archived-sessions.js +1 -1
  374. package/dist/session-list/help-menu.js +1 -1
  375. package/dist/session-list/highlight.js +1 -1
  376. package/dist/session-list/host.js +1 -1
  377. package/dist/session-list/hover-info-card.js +1 -1
  378. package/dist/session-list/locales.js +1 -1
  379. package/dist/session-list/navigation-controls.js +1 -1
  380. package/dist/session-list/navigation-header.js +1 -1
  381. package/dist/session-list/navigation-store.js +1 -1
  382. package/dist/session-list/navigation-tabs.js +1 -1
  383. package/dist/session-list/navigation.js +1 -1
  384. package/dist/session-list/platform.js +1 -1
  385. package/dist/session-list/row-stop-button.js +1 -1
  386. package/dist/session-list/session-groups.js +1 -1
  387. package/dist/session-list/session-info-card.js +1 -1
  388. package/dist/session-list/session-list.js +1 -1
  389. package/dist/session-list/session-row.js +1 -1
  390. package/dist/session-list/session-state-dot.js +1 -1
  391. package/dist/session-list/session-state-menu.js +1 -1
  392. package/dist/session-list/shortcut-hint.js +1 -1
  393. package/dist/session-list/shortcut.js +1 -1
  394. package/dist/session-list/sidebar-overlay.js +1 -1
  395. package/dist/session-list/trailing-swap.js +1 -1
  396. package/dist/session-list/use-activity-notification.js +1 -1
  397. package/dist/session-list/use-activity-preview.js +1 -1
  398. package/dist/session-list/use-cmd-held.js +1 -1
  399. package/dist/session-list/use-project-sessions.js +1 -1
  400. package/dist/session-list/virtual-session-rows.js +1 -1
  401. package/dist/session-timeline/activity-group.js +1 -1
  402. package/dist/session-timeline/activity-projection.js +1 -1
  403. package/dist/session-timeline/assistant-content.js +1 -1
  404. package/dist/session-timeline/assistant-image-references.js +1 -1
  405. package/dist/session-timeline/assistant-turn.js +1 -1
  406. package/dist/session-timeline/async-questions.js +1 -1
  407. package/dist/session-timeline/edited-files-card.js +1 -1
  408. package/dist/session-timeline/history-timeline.js +1 -1
  409. package/dist/session-timeline/host.js +1 -1
  410. package/dist/session-timeline/image-generation-progress.js +1 -1
  411. package/dist/session-timeline/navigation-rail.js +1 -1
  412. package/dist/session-timeline/plan.js +1 -1
  413. package/dist/session-timeline/question-reply.js +1 -1
  414. package/dist/session-timeline/resource-content.js +1 -1
  415. package/dist/session-timeline/session-timeline.js +1 -1
  416. package/dist/session-timeline/timeline-registry.js +1 -1
  417. package/dist/session-timeline/turn-activity.js +1 -1
  418. package/dist/session-timeline/turn-error.js +1 -1
  419. package/dist/session-timeline/turn-retry.js +1 -1
  420. package/dist/session-timeline/turn-time.js +1 -1
  421. package/dist/session-timeline/turns.js +1 -1
  422. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  423. package/dist/session-timeline/user-message.js +1 -1
  424. package/dist/settings/codex-account-card.js +1 -1
  425. package/dist/settings/login-card.js +1 -1
  426. package/dist/settings/model-alias-settings.js +1 -1
  427. package/dist/settings/model-aliases.js +1 -1
  428. package/dist/settings/provider-logos.js +1 -1
  429. package/dist/settings/provider-section.js +1 -1
  430. package/dist/settings/providers-port.js +1 -1
  431. package/dist/settings/providers.js +1 -1
  432. package/dist/settings/settings-bridge.js +1 -1
  433. package/dist/settings/settings.js +1 -1
  434. package/native/win32-x64/alwith_native_chat.dll +0 -0
  435. package/native/win32-x64/artifact.json +1 -1
  436. package/package.json +3 -3
  437. package/dist/chunk-0kaa9dja.js +0 -2
  438. package/dist/chunk-0myfs71s.js +0 -2
  439. package/dist/chunk-19jwgexv.js +0 -4
  440. package/dist/chunk-1p3ekdt4.js +0 -2
  441. package/dist/chunk-1xgm6fpr.js +0 -2
  442. package/dist/chunk-2rjg9fs9.js +0 -2
  443. package/dist/chunk-2s0jckfr.js +0 -2
  444. package/dist/chunk-3272z6sv.js +0 -2
  445. package/dist/chunk-38eckxjk.js +0 -2
  446. package/dist/chunk-56jqg70p.js +0 -2
  447. package/dist/chunk-5rzy2287.js +0 -2
  448. package/dist/chunk-6cedp3k2.js +0 -2
  449. package/dist/chunk-6eg26dz5.js +0 -4
  450. package/dist/chunk-7hhc8y2n.js +0 -2
  451. package/dist/chunk-7xsrqwvt.js +0 -2
  452. package/dist/chunk-9s8ht9xe.js +0 -2
  453. package/dist/chunk-b5g055qp.js +0 -2
  454. package/dist/chunk-bqbyjazm.js +0 -2
  455. package/dist/chunk-cmfcnze3.js +0 -4
  456. package/dist/chunk-d4jkh19p.js +0 -2
  457. package/dist/chunk-dn8xcv31.js +0 -2
  458. package/dist/chunk-dwv3z2sk.js +0 -2
  459. package/dist/chunk-e4ws15tg.js +0 -2
  460. package/dist/chunk-e8bazy7m.js +0 -2
  461. package/dist/chunk-eaxevj9t.js +0 -2
  462. package/dist/chunk-f0hb6t2w.js +0 -2
  463. package/dist/chunk-f67e77e6.js +0 -2
  464. package/dist/chunk-fcy6mh2e.js +0 -2
  465. package/dist/chunk-gs0b02g2.js +0 -2
  466. package/dist/chunk-hs98zk6m.js +0 -2
  467. package/dist/chunk-jf7em132.js +0 -1
  468. package/dist/chunk-k2xs8svj.js +0 -2
  469. package/dist/chunk-kv3hsfyk.js +0 -2
  470. package/dist/chunk-kyqf7cqh.js +0 -2
  471. package/dist/chunk-m4ds8kjc.js +0 -2
  472. package/dist/chunk-m6yg0dc9.js +0 -2
  473. package/dist/chunk-n88j8hsd.js +0 -2
  474. package/dist/chunk-nvsws1yg.js +0 -2
  475. package/dist/chunk-p02bdewy.js +0 -2
  476. package/dist/chunk-pae2hjvq.js +0 -2
  477. package/dist/chunk-ptdx40ae.js +0 -2
  478. package/dist/chunk-q61xz251.js +0 -2
  479. package/dist/chunk-rkqptd9w.js +0 -2
  480. package/dist/chunk-t1qj0vqe.js +0 -2
  481. package/dist/chunk-t2ej667n.js +0 -2
  482. package/dist/chunk-tab23kkx.js +0 -2
  483. package/dist/chunk-w1ga47ww.js +0 -2
  484. package/dist/chunk-w2bgfpdh.js +0 -2
  485. package/dist/chunk-wj9s8331.js +0 -2
  486. package/dist/chunk-wjgrrfq9.js +0 -2
  487. package/dist/chunk-ygaqqwmb.js +0 -2
  488. package/dist/chunk-yvzkb5p5.js +0 -2
  489. package/dist/chunk-z6x70w62.js +0 -2
  490. package/dist/chunk-zea1chz7.js +0 -3
@@ -1,3 +1,3 @@
1
- import{u}from"./chunk-b5g055qp.js";import{M,f}from"./chunk-m4ds8kjc.js";import{$t}from"./chunk-tz1gzwas.js";import{qe,d,We,ct,i}from"./chunk-6cedp3k2.js";import{K,q,de,W,Z,we,Kt}from"./chunk-jf7em132.js";import{Ce}from"./chunk-89gyxwmd.js";import{dt}from"./chunk-19jh646d.js";import{k}from"./chunk-qk1yqepm.js";import{Wt,U}from"./chunk-mq0npf36.js";import{Q,_e}from"./chunk-n8b9yg4q.js";import{qt}from"./chunk-g1de763m.js";import{jt}from"./chunk-pr7xj1fn.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as G,PuzzleIcon as le,RefreshCwIcon as oe,SearchIcon as re,Trash2Icon as ce,XIcon as me}from"lucide-react";import{memo as ue,useDeferredValue as pe,useEffect as J,useMemo as V,useState as C}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ke,DropdownMenuContent as ye,DropdownMenuItem as be,DropdownMenuTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as _}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Ie}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function z(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function Se({plugin:t,marketplace:r}){let{t:m}=d(),p=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=m(p?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!p)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(N,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:p||a||c,"aria-label":o,title:c?m("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:p?e(E,{"aria-hidden":"true"}):e(G,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function De({plugin:t,marketplace:r,actions:m,onOpen:p}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(we,{className:"toolbox-row relative",children:[e(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":z(t),onClick:()=>p({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(U,{name:t.name})})}),s(q,{className:"pointer-events-none relative min-w-0",children:[e(Kt,{className:"mb-0.5",children:z(t)}),e(de,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(de,{"data-toolbox-metadata":"",children:o})]}),e(K,{className:"relative w-8 shrink-0 justify-center",children:m})]})}function L(){return ct((t)=>t.connection==="ready"&&ee(t.agent))}var S=48;function Me({marketplace:t,plugins:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.removeMarketplace),[g,c]=C(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/S)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ke,{children:[e(Pe,{render:e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":p("plugins.pageActions")}),children:e(ie,{})}),e(ye,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(be,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(ce,{className:"size-3.5"}),p("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*S,(o+1)*S).map((n)=>e(De,{onOpen:m,plugin:n,marketplace:t,actions:e(Se,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>S&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(N,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:p("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/S)]}),e(N,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*S>=r.length,onClick:()=>c(o+1),children:p("plugins.nextPage")})]})]},t.name)}var Ee=ue(function({query:r,onOpen:m}){let{t:p}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=V(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,z(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
- `).toLowerCase()}))})),[a]),o=V(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:y,text:b})=>r===""?v.path!==null||n.has(y.id):b.includes(r)).map(({plugin:y})=>y)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(Me,{marketplace:n,plugins:v,onOpen:m},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:p("plugins.empty")})]})});function ze(){let{t}=d(),r=L(),m=i((h)=>h.addMarketplace),p=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=C(""),[o,n]=C(!1),[v,x]=C(!1),[y,b]=C(null),O=async()=>{let h=g.trim();if(!h||o)return;n(!0),b(null);try{await m({source:h}),c(""),x(!1)}catch(I){b(I instanceof Error?I.message:String(I))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void p(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(N,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(G,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),O()},children:[e(Ie,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(_,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(N,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(N,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Oe({onOpen:t,query:r}){let m=L(),p=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!m,g=pe(r.trim().toLowerCase());return e(k,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[p.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(Ce,{}):e(Ee,{query:g,onOpen:t})]})})}function Ps({cwd:t,active:r,extensions:m,onOpenCatalog:p}){let{t:a}=d(),g=We(),c=qe(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,y]=C("plugins"),[b,O]=C({plugins:"",skills:""}),h=x==="skills"?b.skills:b.plugins,I=(l)=>O((D)=>({...D,[x]:l})),Y=ct((l)=>JSON.stringify([...new Set(l.sessionList.map((D)=>dt(D.cwd,l.projectContext)).filter((D)=>D!==null))].toSorted())),B=JSON.stringify([...new Set([dt(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),T=i((l)=>l.installed),H=a(x==="skills"?"plugins.skills.search":"plugins.search"),[P,R]=C(null),w=L();J(()=>{if(!r||!w)return;if(c.getState().loadedScope!==B)o(JSON.parse(B))},[r,w,o,B,c]),J(()=>{if(!w)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0,catalog:!1}))},[w,o,g]);let A=(l)=>{p?.(),y("plugins"),R(l)},j=(l)=>{p?.(),y(l),R(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(Wt,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[m&&s(f,{className:`${u} h-8 gap-2 px-2`,active:m.active,onClick:m.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${u} h-8 gap-2 px-2`,active:!m?.active&&x===l&&P===null,onClick:()=>j(l),children:[l==="plugins"?e(le,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(k,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(M,{children:!w||n&&T.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):T.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):T.map((l)=>s(f,{title:z(l.plugin),className:`${u} gap-2 px-2`,active:!m?.active&&P?.plugin.id===l.plugin.id,onClick:()=>A(l),children:[e(U,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:z(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:m?.active?m.content:s(X,{children:[P&&e(qt,{entry:P,onBack:()=>j("plugins")},JSON.stringify([P.marketplace.name,P.marketplace.path,P.plugin.id,t])),s("div",{hidden:P!==null,className:P?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(_e,{children:e($t,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(re,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(_,{className:"h-9 rounded-full ps-9 pe-9","aria-label":H,value:h,onChange:(l)=>I(l.target.value),placeholder:H}),h&&e(N,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>I(""),children:e(me,{})})]}),e(N,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!w||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(oe,{})}),x==="plugins"&&e(ze,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(N,{size:"sm",className:"h-9",variant:"outline",disabled:n||!w,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Oe,{query:b.plugins,onOpen:A})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(jt,{query:b.skills,ready:w,onOpenPlugin:A})})]})]})]})})]})}
3
- export{Ps};
1
+ import{p}from"./chunk-vgxvtmja.js";import{N,f}from"./chunk-95f0wens.js";import{Wt}from"./chunk-a2tkhes5.js";import{Ze,d,Qe,gt,i}from"./chunk-qvzxzzw8.js";import{K,q,pe,W,Z,_e,Qt}from"./chunk-mp5f940y.js";import{Se}from"./chunk-enkrqfqq.js";import{mt}from"./chunk-4chmr87g.js";import{S}from"./chunk-mhrn3e8j.js";import{Xt,U}from"./chunk-3sq2k9ca.js";import{Q,Te}from"./chunk-3knw8e0x.js";import{Jt}from"./chunk-9ghxym50.js";import{Zt}from"./chunk-ck70ewc8.js";import{hasPluginStore as ee}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as te,BookOpenIcon as ae,CheckIcon as ne,CircleArrowUpIcon as se,MoreVerticalIcon as ie,PlusIcon as G,PuzzleIcon as le,RefreshCwIcon as oe,SearchIcon as re,Trash2Icon as ce,XIcon as de}from"lucide-react";import{memo as me,useDeferredValue as ue,useEffect as J,useMemo as V,useState as C}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ge,DialogContent as fe,DialogDescription as ve,DialogHeader as xe,DialogTitle as he,DialogTrigger as Ne}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as ke,DropdownMenuContent as ye,DropdownMenuItem as be,DropdownMenuTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as _}from"@nyssance/shadcn/vega/components/ui/input";import{Label as we}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as E}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as X}from"react/jsx-runtime";function z(t){return t.interface?.displayName??t.name}function F(t){return t.interface?.shortDescription??""}function Ce({plugin:t,marketplace:r}){let{t:m}=d(),u=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),g=i((n)=>n.install),c=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",o=m(u?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!u)return e(ne,{className:"text-muted-foreground size-4 shrink-0","aria-label":o});return e(k,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:u||a||c,"aria-label":o,title:c?m("plugins.disabledReason.unknown"):o,onClick:()=>void g({plugin:t,marketplace:r}).catch(()=>{}),children:u?e(E,{"aria-hidden":"true"}):e(G,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Ie({plugin:t,marketplace:r,actions:m,onOpen:u}){let a=F(t),g=t.interface?.developerName,c=t.localVersion??t.version,o=[g,c?`v${c}`:null].filter(Boolean).join(" · ");return s(_e,{className:"toolbox-row relative",children:[e(k,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":z(t),onClick:()=>u({plugin:t,marketplace:r})}),e(W,{className:"pointer-events-none relative translate-none! self-center!",children:e("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:e(U,{name:t.name})})}),s(q,{className:"pointer-events-none relative min-w-0",children:[e(Qt,{className:"mb-0.5",children:z(t)}),e(pe,{className:"line-clamp-1",title:a,children:a||r.interface?.displayName||r.name}),o&&e(pe,{"data-toolbox-metadata":"",children:o})]}),e(K,{className:"relative w-8 shrink-0 justify-center",children:m})]})}function L(){return gt((t)=>t.connection==="ready"&&ee(t.agent))}var D=48;function De({marketplace:t,plugins:r,onOpen:m}){let{t:u}=d(),a=i((n)=>n.removeMarketplace),[g,c]=C(0),o=Math.min(g,Math.max(0,Math.ceil(r.length/D)-1));if(r.length===0)return null;return s("section",{className:"flex flex-col gap-4",children:[s("div",{className:"flex items-center gap-2",children:[e("h2",{className:"text-base font-medium",children:t.interface?.displayName??t.name}),e("span",{className:"text-muted-foreground text-xs",children:r.length}),t.path!==null&&s(ke,{children:[e(Pe,{render:e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":u("plugins.pageActions")}),children:e(ie,{})}),e(ye,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(be,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(ce,{className:"size-3.5"}),u("plugins.marketplace.remove")]})})]})]}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:r.slice(o*D,(o+1)*D).map((n)=>e(Ie,{onOpen:m,plugin:n,marketplace:t,actions:e(Ce,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),r.length>D&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(k,{variant:"outline",size:"sm",className:"h-9",disabled:o===0,onClick:()=>c(o-1),children:u("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[o+1," / ",Math.ceil(r.length/D)]}),e(k,{variant:"outline",size:"sm",className:"h-9",disabled:(o+1)*D>=r.length,onClick:()=>c(o+1),children:u("plugins.nextPage")})]})]},t.name)}var Me=me(function({query:r,onOpen:m}){let{t:u}=d(),a=i((n)=>n.marketplaces),g=i((n)=>n.featuredPluginIds),c=V(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,z(v),F(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),o=V(()=>{let n=new Set(g);return c.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:y,text:b})=>r===""?v.path!==null||n.has(y.id):b.includes(r)).map(({plugin:y})=>y)}))},[c,g,r]);return s(X,{children:[o.map(({marketplace:n,plugins:v})=>e(De,{marketplace:n,plugins:v,onOpen:m},JSON.stringify([n.name,n.path,r]))),o.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:u("plugins.empty")})]})});function Ee(){let{t}=d(),r=L(),m=i((h)=>h.addMarketplace),u=i((h)=>h.upgradeAll),a=i((h)=>h.upgrading),[g,c]=C(""),[o,n]=C(!1),[v,x]=C(!1),[y,b]=C(null),O=async()=>{let h=g.trim();if(!h||o)return;n(!0),b(null);try{await m({source:h}),c(""),x(!1)}catch(I){b(I instanceof Error?I.message:String(I))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(k,{size:"sm",className:"h-9",variant:"outline",disabled:!r||a,"aria-busy":a,onClick:()=>void u(),children:[a?e(E,{}):e(se,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(ge,{open:v,onOpenChange:(h)=>{if(!o)x(h)},children:[s(Ne,{render:e(k,{size:"sm",className:"h-9",variant:"outline",disabled:!r}),children:[e(G,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(fe,{children:[s(xe,{children:[e(he,{children:t("plugins.marketplace.addTitle")}),e(ve,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(h)=>{h.preventDefault(),O()},children:[e(we,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(_,{id:"marketplace-source",value:g,disabled:o,onChange:(h)=>c(h.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(k,{type:"button",variant:"ghost",disabled:o,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(k,{type:"submit",disabled:o||g.trim()==="",children:[o&&e(E,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function ze({onOpen:t,query:r}){let m=L(),u=i((c)=>c.marketplaceLoadErrors),a=i((c)=>c.loading)||!m,g=ue(r.trim().toLowerCase());return e(S,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${Q} flex flex-col gap-8`,children:[u.map((c)=>s("p",{className:"text-destructive px-2 text-xs",children:[c.marketplacePath,": ",c.message]},c.marketplacePath)),a?e(Se,{}):e(Me,{query:g,onOpen:t})]})})}function As({cwd:t,active:r,extensions:m,onOpenCatalog:u}){let{t:a}=d(),g=Qe(),c=Ze(g),o=i((l)=>l.refresh),n=i((l)=>l.loading),v=i((l)=>l.error),[x,y]=C("plugins"),[b,O]=C({plugins:"",skills:""}),h=x==="skills"?b.skills:b.plugins,I=(l)=>O((M)=>({...M,[x]:l})),Y=gt((l)=>JSON.stringify([...new Set(l.sessionList.map((M)=>mt(M.cwd,l.projectContext)).filter((M)=>M!==null))].toSorted())),B=JSON.stringify([...new Set([mt(t,g.state.projectContext),...JSON.parse(Y)].filter((l)=>l!==null))].toSorted()),T=i((l)=>l.installed),H=a(x==="skills"?"plugins.skills.search":"plugins.search"),[P,R]=C(null),w=L();J(()=>{if(!r||!w)return;if(c.getState().loadedScope!==B)o(JSON.parse(B))},[r,w,o,B,c]),J(()=>{if(!w)return;return g.onSkillsChanged(()=>void o(void 0,{background:!0,catalog:!1}))},[w,o,g]);let A=(l)=>{u?.(),y("plugins"),R(l)},j=(l)=>{u?.(),y(l),R(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(Xt,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[m&&s(f,{className:`${p} h-8 gap-2 px-2`,active:m.active,onClick:m.onOpen,children:[e(te,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((l)=>s(f,{className:`${p} h-8 gap-2 px-2`,active:!m?.active&&x===l&&P===null,onClick:()=>j(l),children:[l==="plugins"?e(le,{className:"size-4"}):e(ae,{className:"size-4"}),e("span",{children:a(`plugins.headings.${l}`)})]},l))]}),e("h3",{className:"text-muted-foreground mx-2 mt-1 mb-2 flex h-8 shrink-0 items-center px-2 text-xs font-medium",children:a("plugins.sections.installed")}),e(S,{className:"min-h-0 flex-1 pe-0",viewportClassName:"pe-0",children:e("nav",{"aria-label":a("plugins.sections.installed"),className:"px-2 pb-4",children:e(N,{children:!w||n&&T.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(E,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):T.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):T.map((l)=>s(f,{title:z(l.plugin),className:`${p} gap-2 px-2`,active:!m?.active&&P?.plugin.id===l.plugin.id,onClick:()=>A(l),children:[e(U,{name:l.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:z(l.plugin)})]},l.plugin.id))})})})]}),e("main",{className:"toolbox-surface @container flex min-h-0 min-w-0 flex-1 flex-col","aria-label":a("plugins.catalog.content"),children:m?.active?m.content:s(X,{children:[P&&e(Jt,{entry:P,onBack:()=>j("plugins")},JSON.stringify([P.marketplace.name,P.marketplace.path,P.plugin.id,t])),s("div",{hidden:P!==null,className:P?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(Te,{children:e(Wt,{title:a(`plugins.headings.${x}`),children:s("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s("div",{className:"relative w-52 max-w-full",children:[e(re,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(_,{className:"h-9 rounded-full ps-9 pe-9","aria-label":H,value:h,onChange:(l)=>I(l.target.value),placeholder:H}),h&&e(k,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>I(""),children:e(de,{})})]}),e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!w||n,onClick:()=>void o(void 0,{forceRefetch:!0}),children:n?e(E,{}):e(oe,{})}),x==="plugins"&&e(Ee,{})]})})}),(x==="plugins"||v)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[x==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),v&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",v]}),e(k,{size:"sm",className:"h-9",variant:"outline",disabled:n||!w,onClick:()=>void o(),children:a("plugins.loadError.retry")})]})]}),s("div",{className:"flex min-h-0 flex-1 flex-col",children:[e("div",{hidden:x!=="plugins",className:x==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(ze,{query:b.plugins,onOpen:A})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Zt,{query:b.skills,ready:w,onOpenPlugin:A})})]})]})]})})]})}
3
+ export{As};
@@ -1,2 +1,2 @@
1
- var I={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
- export{I};
1
+ var M={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
+ export{M};
@@ -1,2 +1,2 @@
1
- import{d,i}from"./chunk-6cedp3k2.js";import{K,q,de,W,Z,we}from"./chunk-jf7em132.js";import{Ce}from"./chunk-89gyxwmd.js";import{k}from"./chunk-qk1yqepm.js";import{ke}from"./chunk-yvzkb5p5.js";import{Q,Se}from"./chunk-n8b9yg4q.js";import{CheckIcon as O,SparklesIcon as A,XIcon as U}from"lucide-react";import{useDeferredValue as V,useState as y}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogClose as X,DialogContent as _,DialogDescription as J,DialogHeader as R,DialogTitle as Y}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ne,TabsList as le,TabsTrigger as ie}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function T({skill:r}){let{assetUrl:p}=d(),[u,s]=y(!1),l=r.interface?.iconSmall,h=l&&p?p(l):r.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(A,{className:"text-muted-foreground size-6"})})}function oe({skill:r}){let{t:p}=d(),u=i((l)=>l.setSkillEnabled),s=i((l)=>(r.path in l.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:r.enabled,disabled:s,"aria-label":`${p(r.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${r.interface?.displayName??r.name}`,onCheckedChange:(l)=>void u(r,l)})]})}function jt({query:r,ready:p,onOpenPlugin:u}){let{t:s}=d(),l=i((e)=>e.skills),h=i((e)=>e.skillErrors),P=i((e)=>e.loading)||!p,j=i((e)=>e.installed),z=i((e)=>e.skillProjects),[M,E]=y(null),[v,L]=y(!1),[B,C]=y(null),b=V(r.trim().toLowerCase()),o=l.find((e)=>e.path===B),x=j.find(({plugin:e})=>e.id===o?.pluginId),c=l.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(b)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),m=[...["user","system","admin"].flatMap((e)=>{let a=l.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(z).flatMap(([e,a])=>{if(!l.some((I)=>I.scope==="repo"&&a.includes(I.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],H=m.map((e)=>e.label);for(let e of m)if(e.path&&H.filter((a)=>a===e.label).length>1)e.label=e.path;let g=m.find((e)=>e.id===M)??m[0],D=g?c.filter((e)=>g.paths.has(e.path)):[],G=v||b?c:c.slice(0,6),w=(e)=>t(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(we,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(W,{className:"pointer-events-none relative translate-none! self-center!",children:t(T,{skill:a})}),n(q,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(de,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(K,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(O,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(k,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${Q} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),P?t(Ce,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:c.length})})]}),c.length?w(G):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(b?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!b&&c.length>6&&t(N,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":v,onClick:()=>L((e)=>!e),children:v?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:c.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")E(e)},className:"gap-6",children:[t(le,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:m.map((e)=>t(ie,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),m.map((e)=>t(ne,{value:e.id,children:e.id===g.id&&(D.length?w(D):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(F,{open:!!o,onOpenChange:(e)=>{if(!e)C(null)},children:t(_,{showCloseButton:!1,className:Se,children:o&&n(S,{children:[t(ke,{path:o.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(T,{skill:o}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(oe,{skill:o}),e,t(X,{render:t(N,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(U,{})})]})]}),n(R,{className:"gap-3",children:[t(Y,{className:"text-2xl leading-8 font-semibold break-words",children:o.interface?.displayName??o.name}),t(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:o.description})]})]})},o.path),o.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),x?t(N,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(x)},children:x.plugin.interface?.displayName??x.plugin.name}):o.pluginId]})]})})})]})}
2
- export{jt};
1
+ import{d,i}from"./chunk-qvzxzzw8.js";import{K,q,pe,W,Z,_e}from"./chunk-mp5f940y.js";import{Se}from"./chunk-enkrqfqq.js";import{S}from"./chunk-mhrn3e8j.js";import{Ie}from"./chunk-gmns080g.js";import{Q,Pe}from"./chunk-3knw8e0x.js";import{CheckIcon as O,SparklesIcon as A,XIcon as U}from"lucide-react";import{useDeferredValue as V,useState as y}from"react";import{Button as N}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogClose as X,DialogContent as _,DialogDescription as J,DialogHeader as R,DialogTitle as Y}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as ee}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as te}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ae}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as se,TabsContent as ne,TabsList as le,TabsTrigger as ie}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as C}from"react/jsx-runtime";function T({skill:r}){let{assetUrl:p}=d(),[u,s]=y(!1),l=r.interface?.iconSmall,h=l&&p?p(l):r.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:h&&!u?t("img",{src:h,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(A,{className:"text-muted-foreground size-6"})})}function oe({skill:r}){let{t:p}=d(),u=i((l)=>l.setSkillEnabled),s=i((l)=>(r.path in l.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(te,{className:"text-muted-foreground size-3.5"}),t(ae,{checked:r.enabled,disabled:s,"aria-label":`${p(r.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${r.interface?.displayName??r.name}`,onCheckedChange:(l)=>void u(r,l)})]})}function Zt({query:r,ready:p,onOpenPlugin:u}){let{t:s}=d(),l=i((e)=>e.skills),h=i((e)=>e.skillErrors),P=i((e)=>e.loading)||!p,j=i((e)=>e.installed),z=i((e)=>e.skillProjects),[M,E]=y(null),[v,L]=y(!1),[B,k]=y(null),b=V(r.trim().toLowerCase()),o=l.find((e)=>e.path===B),x=j.find(({plugin:e})=>e.id===o?.pluginId),c=l.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(b)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),m=[...["user","system","admin"].flatMap((e)=>{let a=l.filter((f)=>f.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((f)=>f.path)),path:null}]:[]}),...Object.entries(z).flatMap(([e,a])=>{if(!l.some((I)=>I.scope==="repo"&&a.includes(I.path)))return[];let f=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:f,paths:new Set(a),path:e}]})],H=m.map((e)=>e.label);for(let e of m)if(e.path&&H.filter((a)=>a===e.label).length>1)e.label=e.path;let g=m.find((e)=>e.id===M)??m[0],D=g?c.filter((e)=>g.paths.has(e.path)):[],G=v||b?c:c.slice(0,6),w=(e)=>t(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(_e,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(N,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>k(a.path)}),t(W,{className:"pointer-events-none relative translate-none! self-center!",children:t(T,{skill:a})}),n(q,{className:"pointer-events-none relative min-w-0",children:[t(ee,{className:"block truncate",children:a.interface?.displayName??a.name}),t(pe,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(K,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(O,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(S,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${Q} space-y-8 pt-6`,children:[h.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),P?t(Se,{skills:!0}):n(C,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:c.length})})]}),c.length?w(G):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(b?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!b&&c.length>6&&t(N,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":v,onClick:()=>L((e)=>!e),children:v?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:c.length-6})})]}),g&&n(se,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")E(e)},className:"gap-6",children:[t(le,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:m.map((e)=>t(ie,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),m.map((e)=>t(ne,{value:e.id,children:e.id===g.id&&(D.length?w(D):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(F,{open:!!o,onOpenChange:(e)=>{if(!e)k(null)},children:t(_,{showCloseButton:!1,className:Pe,children:o&&n(C,{children:[t(Ie,{path:o.path,renderHeader:(e)=>n(C,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(T,{skill:o}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(oe,{skill:o}),e,t(X,{render:t(N,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(U,{})})]})]}),n(R,{className:"gap-3",children:[t(Y,{className:"text-2xl leading-8 font-semibold break-words",children:o.interface?.displayName??o.name}),t(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:o.description})]})]})},o.path),o.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),x?t(N,{variant:"link",className:"h-auto p-0",onClick:()=>{k(null),u(x)},children:x.plugin.interface?.displayName??x.plugin.name}):o.pluginId]})]})})})]})}
2
+ export{Zt};
@@ -1,2 +1,2 @@
1
- import{useCallback as f,useState as r}from"react";var t=new Map;function T(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
2
- export{T};
1
+ import{useCallback as f,useState as r}from"react";var t=new Map;function I(o,e,a=!1){let[p,S]=r(()=>({key:o,expanded:t.get(o)??e})),n=p.expanded;if(p.key!==o||a&&!t.has(o)&&n!==e)n=t.get(o)??e,S({key:o,expanded:n});let k=f((c)=>{S((s)=>{let b=s.key===o?s.expanded:t.get(o)??e,d=typeof c==="function"?c(b):c;return t.set(o,d),s.key===o?{key:o,expanded:d}:s})},[o,e]);return[n,k]}
2
+ export{I};
@@ -1,3 +1,3 @@
1
- import{s,a,o}from"./chunk-0b50jg23.js";import{Qe,pe,ie}from"./chunk-e8bazy7m.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as ce}from"cn";import{ArchiveIcon as de,FolderIcon as Q,ListFilterIcon as ue,SearchIcon as me,Trash2Icon as U}from"lucide-react";import{useEffect as he,useRef as fe,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as ve,DialogContent as ge,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as n}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:ce("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function Us({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,X]=d(""),[y,Y]=d("all"),[p,Z]=d("all"),[ee,te]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=fe(!1),[D,f]=d(null),[O,b]=d(null),[se,G]=d(!1);he(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let r=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(r.has(v))throw Error("Archive pagination returned a repeated cursor");r.add(v),await m.listArchived()}}catch(r){if(!e)F(E(r))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,ee]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ne=[...new Set(S.filter((e)=>l&&j(l,e).id!==ie).map((e)=>l?j(l,e).id:e.cwd))].toSorted(),ae=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=l?j(l,e).id:null,r=c===ie;return L(e).toLocaleLowerCase(A.language).includes(ae)&&(y==="all"||(y==="quick"?r:!r))&&(p==="all"||(p==="quick"?r:c===p))}),re=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function le(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function oe(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let r of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===r.sessionId))continue;try{await m.delete(r.sessionId)}catch(v){e.push(r),c.push(`${L(r)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
- `));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(me,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),n(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Y(e)},children:[n(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ue,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");Z(e)},children:[n(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):pe(p,l??void 0)})]}),n(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ne.map((e)=>t(x,{value:e,title:e,children:pe(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:n(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>te((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(de,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Qe(K,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===ie?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===ie?i("sessionList.archives.noProject"):pe(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((r)=>n("article",{"aria-label":L(r),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(r),children:L(r)}),r.updatedAt!==null&&t("time",{dateTime:r.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:re.format(new Date(r.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([r])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void le(r),children:i("sessionList.archives.unarchive")})]})]},r.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(ve,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ge,{showCloseButton:!C,children:[n(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(se?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),n(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void oe(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
- export{Us};
1
+ import{s,a,o}from"./chunk-pxbww0j1.js";import{Xe,ge,se}from"./chunk-t3rv7vat.js";import{sessionGroup as j}from"@nyssance/codex-acp-v2/client";import{cn as ce}from"cn";import{ArchiveIcon as de,FolderIcon as Q,ListFilterIcon as ue,SearchIcon as me,Trash2Icon as U}from"lucide-react";import{useEffect as pe,useRef as he,useState as d}from"react";import{Alert as P,AlertDescription as T}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as fe,DialogContent as ve,DialogDescription as xe,DialogFooter as Se,DialogHeader as ye,DialogTitle as Le}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as Ne}from"@nyssance/shadcn/vega/components/ui/input";import{Select as _,SelectContent as Ce,SelectItem as x,SelectTrigger as R,SelectValue as W}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as J}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as n}from"react/jsx-runtime";function M({className:u,...i}){return t(Ce,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:ce("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function we({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function $s({Scroll:u=we}){let{t:i,i18n:A}=s(),m=a(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,X]=d(""),[y,Y]=d("all"),[p,Z]=d("all"),[ee,te]=d(0),[q,z]=d(!0),[I,F]=d(null),[V,H]=d(null),[C,w]=d(!1),h=he(!1),[D,f]=d(null),[O,b]=d(null),[ie,G]=d(!1);pe(()=>{if(N!=="ready")return;let e=!1;z(!0),F(null);async function c(){try{await m.listArchived({reset:!0});let r=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(r.has(v))throw Error("Archive pagination returned a repeated cursor");r.add(v),await m.listArchived()}}catch(r){if(!e)F(E(r))}finally{if(!e)z(!1)}}return c(),()=>{e=!0}},[m,N,ee]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!q&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ne=[...new Set(S.filter((e)=>l&&j(l,e).id!==se).map((e)=>l?j(l,e).id:e.cwd))].toSorted(),ae=B.trim().toLocaleLowerCase(A.language),K=S.filter((e)=>{let c=l?j(l,e).id:null,r=c===se;return L(e).toLocaleLowerCase(A.language).includes(ae)&&(y==="all"||(y==="quick"?r:!r))&&(p==="all"||(p==="quick"?r:c===p))}),re=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function le(e){if(h.current)return;h.current=!0,w(!0),H(null);try{await m.unarchive(e.sessionId)}catch(c){H(E(c))}finally{h.current=!1,w(!1)}}async function oe(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let r of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===r.sessionId))continue;try{await m.delete(r.sessionId)}catch(v){e.push(r),c.push(`${L(r)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
+ `));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),G(!0),f([...S])},children:[t(U,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(me,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(Ne,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>X(e.target.value),className:"rounded-md ps-9"})]}),n(_,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Y(e)},children:[n(R,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ue,{"aria-hidden":"true"}),t(W,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(_,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");Z(e)},children:[n(R,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(Q,{"aria-hidden":"true"}),t(W,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):ge(p,l??void 0)})]}),n(M,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ne.map((e)=>t(x,{value:e,title:e,children:ge(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):q?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(J,{}),i("sessionList.archives.loading")]}):I?t(P,{variant:"destructive",children:n(T,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>te((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(de,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):K.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Xe(K,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===se?void 0:e,children:[t(Q,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===se?i("sessionList.archives.noProject"):ge(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((r)=>n("article",{"aria-label":L(r),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(r),children:L(r)}),r.updatedAt!==null&&t("time",{dateTime:r.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:re.format(new Date(r.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),G(!1),f([r])},children:t(U,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void le(r),children:i("sessionList.archives.unarchive")})]})]},r.sessionId))})]},e)),V&&t(P,{variant:"destructive",children:t(T,{children:V})})]})]}),t(fe,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ve,{showCloseButton:!C,children:[n(ye,{children:[t(Le,{children:i("sessionList.archives.deleteTitle")}),t(xe,{children:i(ie?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),O&&t(P,{variant:"destructive",children:t(T,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:O})}),n(Se,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void oe(),children:[C&&t(J,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
+ export{$s};
@@ -1,2 +1,2 @@
1
- import{D}from"./chunk-zg0tv3sj.js";import{codexMessageError as b,nativeTurnId as y,textOf as w,turns as h}from"@nyssance/codex-acp-v2/client";function Va(t){return t.kind==="tool"&&t.name==="mcp_startup"}function v(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function g(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function as(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&g(e))}function I(t,e,n){let r=t.work.at(-1);if(r?.kind==="activity"&&r.items.at(-1)===n){r.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function T(t,e,n){if(t.kind!=="tool"){e.push(t);return}let r=n.get(t.id);if(r===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(r);for(let i of t.children)T(i,e,n)}function M(t,e,n,r){switch(e.kind){case"user":break;case"assistant":{if(b(e)!==null){let s=y(e),l=t.errors.findIndex((p)=>s!==null&&y(p)===s);if(l===-1)t.errors.push(e);else t.errors[l]=e;break}let i=v(e),u=e._meta?.codex,o=D(e._meta).length>0||typeof u==="object"&&u!==null&&"delivery"in u&&u.delivery==="async";if(D(e._meta).length>0)t.final.push(e);else if(o)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(i==="final_answer")t.final.push(e);else if(i==="commentary"||g(e)||i===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":I(t,e,r);break;case"tool":if(I(t,e,r),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function x(t){return t.kind==="user"&&(t.echo==="pending"||t.echo==="acknowledged")}function A(t,e){let n=new Set(e.map((a)=>a.turnId)),r=new Map,i=[],u=(a)=>{let d={items:[],nativeId:a};return i.push(d),d},o,s,l=[],p=0;for(let a of t){let d=y(a);if(d!==null){let f=r.get(d);if(f!==void 0){f.items.push(a);continue}let k=l[p],c=k??o,m=a.kind!=="user"&&c?.nativeId===null&&c.items.length===1&&c.items[0]?.kind==="user"&&!n.has(d)&&!Wn(a)?c:u(d);if(m===k)p++;m.nativeId=d,m.items.push(a),r.set(d,m),o=s=m;continue}if(a.kind==="user"){if(o=u(null),o.items.push(a),x(a))l.push(o);else s=o;continue}if(s===void 0)s={items:[],nativeId:null},i.unshift(s);s.items.push(a)}return i}function R(t,e){if(e.nativeId===null)return h({...t,items:e.items});let n=e.items[0],r=e.items.find((o)=>o.kind==="user");if(r===void 0)return h({...t,items:e.items});let i=r.echo==="adopted"&&r.at<n.at?[r,...e.items.filter((o)=>o!==r)]:e.items;if(!x(n))return h({...t,items:i});let u={...n,echo:null};return h({...t,items:[u,...i.slice(1)]}).map((o)=>o.prompt===u?{...o,prompt:n}:o)}function ls(t,e=[],n=[]){let r=new Map(e.map((o)=>[o.key,o])),i=new Map(t.items.filter((o)=>o.kind==="tool").map((o)=>[o.id,o])),u={...t,items:t.items.filter((o)=>!Va(o))};return A(u.items,n).flatMap((o)=>R(u,o)).map((o)=>{let s=o.prompt===null?[]:[o.prompt];for(let c of o.entries)T(c,s,i);let l=s[0];if(l===void 0)throw Error("A turn without items");let p=`turn:${l.kind}:${l.id}`,a=o.endedAt??Math.max(...s.map((c)=>c.at)),d=r.get(p);if(d!==void 0&&S(d.items,s)&&d.endedAt===a)return d;let f={key:p,user:o.prompt,work:[],final:[],errors:[],edits:[],startedAt:o.startedAt??l.at,endedAt:a,replayed:s.every(Wn),items:s},k=s.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return s.forEach((c,m)=>M(f,c,m<k,s[m-1])),f})}function S(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function Wn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function ye(t){return w(t.content)}function Gt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Vo(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function cs(t){let e=(i)=>{for(let u of t.items){let o=u._meta?.codex;if(typeof o!=="object"||o===null)continue;let s=o[i];if(typeof s==="number"&&Number.isFinite(s)&&s>=0)return s}return},n=e("workDurationMs"),r=e("turnDurationMs");return{durationMs:n??r,durationKind:n===void 0&&r!==void 0?"total":"work",startedAt:e("workStartedAt")}}function ds(t,e,n){if(n?.user==null)return!1;let r=e.items.map(y).find((u)=>u!==null),i=y(n.user);if(r!==void 0&&i!==null)return r===i;return!e.items.some((u)=>{let o=u._meta?.codex;return typeof o==="object"&&o!==null&&"turnCompletedAt"in o&&typeof o.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function us(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let r=e[n];if(r.items.some((i)=>i.kind!=="user"))break;if(!ds(t,e[n-1],r))break;n--}return e[n]?.key}function ps(t,e,n){let r=n,i=n;while(r>0&&ds(t,e[r-1],e[r]))r--;while(i+1<e.length&&ds(t,e[i],e[i+1]))i++;let u=e.slice(r,i+1),o=u.findLast((s)=>s.items.some((l)=>l.kind!=="user"))??u[0];return{continued:e[n]!==o,items:u.flatMap((s)=>s.items),edits:u.flatMap((s)=>s.edits),startedAt:u[0].startedAt}}
2
- export{Va,as,ls,Wn,ye,Gt,Vo,cs,ds,us,ps};
1
+ import{D}from"./chunk-fggwwmzc.js";import{codexMessageError as b,nativeTurnId as y,textOf as w,turns as h}from"@nyssance/codex-acp-v2/client";function Wa(t){return t.kind==="tool"&&t.name==="mcp_startup"}function v(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function g(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function ps(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&g(e))}function I(t,e,n){let r=t.work.at(-1);if(r?.kind==="activity"&&r.items.at(-1)===n){r.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function T(t,e,n){if(t.kind!=="tool"){e.push(t);return}let r=n.get(t.id);if(r===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(r);for(let i of t.children)T(i,e,n)}function M(t,e,n,r){switch(e.kind){case"user":break;case"assistant":{if(b(e)!==null){let s=y(e),l=t.errors.findIndex((p)=>s!==null&&y(p)===s);if(l===-1)t.errors.push(e);else t.errors[l]=e;break}let i=v(e),u=e._meta?.codex,o=D(e._meta).length>0||typeof u==="object"&&u!==null&&"delivery"in u&&u.delivery==="async";if(D(e._meta).length>0)t.final.push(e);else if(o)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(i==="final_answer")t.final.push(e);else if(i==="commentary"||g(e)||i===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":I(t,e,r);break;case"tool":if(I(t,e,r),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function x(t){return t.kind==="user"&&(t.echo==="pending"||t.echo==="acknowledged")}function A(t,e){let n=new Set(e.map((a)=>a.turnId)),r=new Map,i=[],u=(a)=>{let d={items:[],nativeId:a};return i.push(d),d},o,s,l=[],p=0;for(let a of t){let d=y(a);if(d!==null){let f=r.get(d);if(f!==void 0){f.items.push(a);continue}let k=l[p],c=k??o,m=a.kind!=="user"&&c?.nativeId===null&&c.items.length===1&&c.items[0]?.kind==="user"&&!n.has(d)&&!Xn(a)?c:u(d);if(m===k)p++;m.nativeId=d,m.items.push(a),r.set(d,m),o=s=m;continue}if(a.kind==="user"){if(o=u(null),o.items.push(a),x(a))l.push(o);else s=o;continue}if(s===void 0)s={items:[],nativeId:null},i.unshift(s);s.items.push(a)}return i}function R(t,e){if(e.nativeId===null)return h({...t,items:e.items});let n=e.items[0],r=e.items.find((o)=>o.kind==="user");if(r===void 0)return h({...t,items:e.items});let i=r.echo==="adopted"&&r.at<n.at?[r,...e.items.filter((o)=>o!==r)]:e.items;if(!x(n))return h({...t,items:i});let u={...n,echo:null};return h({...t,items:[u,...i.slice(1)]}).map((o)=>o.prompt===u?{...o,prompt:n}:o)}function ms(t,e=[],n=[]){let r=new Map(e.map((o)=>[o.key,o])),i=new Map(t.items.filter((o)=>o.kind==="tool").map((o)=>[o.id,o])),u={...t,items:t.items.filter((o)=>!Wa(o))};return A(u.items,n).flatMap((o)=>R(u,o)).map((o)=>{let s=o.prompt===null?[]:[o.prompt];for(let c of o.entries)T(c,s,i);let l=s[0];if(l===void 0)throw Error("A turn without items");let p=`turn:${l.kind}:${l.id}`,a=o.endedAt??Math.max(...s.map((c)=>c.at)),d=r.get(p);if(d!==void 0&&S(d.items,s)&&d.endedAt===a)return d;let f={key:p,user:o.prompt,work:[],final:[],errors:[],edits:[],startedAt:o.startedAt??l.at,endedAt:a,replayed:s.every(Xn),items:s},k=s.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return s.forEach((c,m)=>M(f,c,m<k,s[m-1])),f})}function S(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function Xn(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function be(t){return w(t.content)}function jt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Wo(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function gs(t){let e=(i)=>{for(let u of t.items){let o=u._meta?.codex;if(typeof o!=="object"||o===null)continue;let s=o[i];if(typeof s==="number"&&Number.isFinite(s)&&s>=0)return s}return},n=e("workDurationMs"),r=e("turnDurationMs");return{durationMs:n??r,durationKind:n===void 0&&r!==void 0?"total":"work",startedAt:e("workStartedAt")}}function fs(t,e,n){if(n?.user==null)return!1;let r=e.items.map(y).find((u)=>u!==null),i=y(n.user);if(r!==void 0&&i!==null)return r===i;return!e.items.some((u)=>{let o=u._meta?.codex;return typeof o==="object"&&o!==null&&"turnCompletedAt"in o&&typeof o.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function hs(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let r=e[n];if(r.items.some((i)=>i.kind!=="user"))break;if(!fs(t,e[n-1],r))break;n--}return e[n]?.key}function vs(t,e,n){let r=n,i=n;while(r>0&&fs(t,e[r-1],e[r]))r--;while(i+1<e.length&&fs(t,e[i],e[i+1]))i++;let u=e.slice(r,i+1),o=u.findLast((s)=>s.items.some((l)=>l.kind!=="user"))??u[0];return{continued:e[n]!==o,items:u.flatMap((s)=>s.items),edits:u.flatMap((s)=>s.edits),startedAt:u[0].startedAt}}
2
+ export{Wa,ps,ms,Xn,be,jt,Wo,gs,fs,hs,vs};
@@ -1,2 +1,2 @@
1
- import{Ar}from"./chunk-xqb4thy8.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function Nr(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Ar(a,r)}
2
- export{Nr};
1
+ import{Kr}from"./chunk-wf4z9w5x.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function jr(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Kr(a,r)}
2
+ export{jr};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function be(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function qo(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{be,qo};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function we(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Xo(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{we,Xo};
@@ -0,0 +1,2 @@
1
+ import{b}from"./chunk-veef1avy.js";import{At}from"./chunk-6ea6q6dj.js";import{e}from"./chunk-qgrd5xre.js";import{Pt,V}from"./chunk-th5vv83g.js";import{On,Ge}from"./chunk-359pf448.js";import{Be}from"./chunk-23kvszfc.js";import{Zap as g}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function fa({snapshot:s,model:l,onChange:r,nativeModels:t,catalog:c}){let{host:u}=e(),{t:a}=u,f=[{id:b.id,name:b.name,models:t===void 0?[{api_id:"",label:b.name}]:t.map((o)=>({api_id:o.id,label:o.label??o.id}))},...(s===null?[]:Pt(s)).map((o)=>({id:o.id,name:o.name,models:o.models.map((i)=>({api_id:V(o.id,i.id),label:i.label??i.id}))}))],p=Ge(f,c),d=p.flatMap((o)=>o.models),m=l===null?t===void 0?d[0]:{api_id:"",label:a("composer.model")}:d.find((o)=>o.api_id===l)??{api_id:l,label:l};return n(At,{value:{...m,label:On(m)},models:d,modelGroups:p,header:{name:a("composer.model"),action:n(Be,{})},compactCatalog:!0,booleanOptions:[{id:"fast_mode",name:a("composer.fastMode"),currentValue:!1,disabled:!0,title:a("composer.fastModeUnsupported"),icon:n(g,{className:"size-4","aria-hidden":"true"})}],showModelList:!0,onChange:(o)=>r(o.api_id),t:(o)=>a(o)})}
2
+ export{fa};
@@ -1,2 +1,2 @@
1
- import{createStore as I}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function w(a){return a.interface?.displayName??a.name}function v(a){let g={},i=new Map,r=new Map;for(let c of a.data){for(let o of c.skills)if(i.set(o.path,o),o.scope==="repo"){let p=g[c.cwd]??[];if(!p.includes(o.path))p.push(o.path);g[c.cwd]=p}for(let o of c.errors)r.set(o.path,o)}return{skills:[...i.values()],errors:[...r.values()],projects:g}}function A(a){let g=[];for(let i of a.marketplaces)for(let r of i.plugins)if(r.installed)g.push({plugin:r,marketplace:i});return g.toSorted((i,r)=>(r.plugin.installedAt??0)-(i.plugin.installedAt??0))}function ei(a){let{plugin:g,marketplace:i}=a;return{installAttemptId:crypto.randomUUID(),pluginName:i.path===null?g.remotePluginId??g.name:g.name,...i.path===null?{remoteMarketplaceName:i.name}:{marketplacePath:i.path}}}function N(a){let{plugin:g,marketplace:i}=a;return{pluginName:i.path===null?g.remotePluginId??g.name:g.name,...i.path===null?{remoteMarketplaceName:i.name}:{marketplacePath:i.path}}}function Zt(a,g){let i=g??{t:(e)=>e},r=(e,l)=>i.t(e,l),c=(e)=>i.notify?.(e),o=(e)=>{if(i.reportError)i.reportError(Error(e));else console.error(e)},p=null,b=null,d=(e)=>S.setState(e),m=()=>S.getState(),y=async(e=!1)=>{if(await m().refresh(void 0,{forceRefetch:e,background:!0}),m().error)throw Error(r("plugins.toast.syncError",{message:m().error}))},f=(e,l)=>d((n)=>{let s={...n.busyIds};if(l===null)delete s[e];else s[e]=l;return{busyIds:s}}),h=(e,l)=>d((n)=>{let s={...n.busyMarketplaces};if(l)s[e]=!0;else delete s[e];return{busyMarketplaces:s}}),R=I({loading:!1,loadedScope:null,upgrading:!1,error:null,cwds:[],marketplaces:[],marketplaceLoadErrors:[],featuredPluginIds:[],installed:[],skills:[],skillProjects:{},skillErrors:[],busyIds:{},busySkills:{},busyMarketplaces:{},refresh:(e=m().cwds,l={})=>{let n=l.forceRefetch===!0||p?.forceRefetch===!0,s=l.catalog!==!1||n||p?.catalog===!0;if(p={cwds:e,forceRefetch:n,catalog:s},d({cwds:e,...!l.background?{loading:!0}:{}}),b)return b;return b=(async()=>{while(p){let t=p;p=null,d({error:null});try{let[u,P,M]=await Promise.all([a.listSkills(t.cwds,t.forceRefetch),t.catalog?a.listPlugins({...t.cwds.length>0?{cwds:t.cwds}:{},...t.forceRefetch?{forceRefetch:!0}:{}}):null,a.installedPlugins(t.cwds)]);if(p)continue;let E=v(u);d({loadedScope:JSON.stringify(t.cwds),skills:E.skills,skillProjects:E.projects,skillErrors:E.errors,...P?{marketplaces:P.marketplaces,marketplaceLoadErrors:P.marketplaceLoadErrors,featuredPluginIds:P.featuredPluginIds}:{},installed:A(M)})}catch(u){if(!p)d({error:k(u)})}}})().finally(()=>{b=null,d({loading:!1})}),b},install:async(e)=>{if(e.plugin.id in m().busyIds)throw Error("Plugin operation already in progress");let l=w(e.plugin);f(e.plugin.id,"installing");try{let n=await a.installPlugin(ei(e));return await y(),f(e.plugin.id,null),c(r("plugins.toast.installed",{pluginName:l})),n}catch(n){throw o(`${r("plugins.toast.installError")}: ${k(n)}`),n}finally{f(e.plugin.id,null)}},setPluginEnabled:async(e,l)=>{if(e.id in m().busyIds)return;f(e.id,"toggling");let n=(t)=>d((u)=>({installed:u.installed.map((P)=>P.plugin.id===e.id?{...P,plugin:{...P.plugin,enabled:t}}:P)}));n(l);let s=e.enabled;try{let t=await a.setPluginEnabled(e.id,l);s=t.enabled,n(t.enabled),await y();let u=m().installed.find((P)=>P.plugin.id===e.id);if(u)s=u.plugin.enabled;if(!u||s!==l)throw Error(r("plugins.toast.toggleNotApplied"));f(e.id,null),c(r(l?"plugins.toast.enabled":"plugins.toast.disabled",{pluginName:w(e)}))}catch(t){n(s),o(`${r("plugins.toast.toggleError")}: ${k(t)}`)}finally{f(e.id,null)}},uninstall:async(e)=>{if(e.id in m().busyIds)return;let l=w(e);f(e.id,"uninstalling");try{let n=e.source.type==="remote"?e.remotePluginId:e.id;if(!n)throw Error("Remote plugin ID is missing");if(await a.uninstallPlugin(n),await y(),m().installed.some((s)=>s.plugin.id===e.id))throw Error(r("plugins.toast.uninstallNotApplied"));f(e.id,null),c(r("plugins.toast.uninstalled",{pluginName:l}))}catch(n){o(`${r("plugins.toast.uninstallError")}: ${k(n)}`)}finally{f(e.id,null)}},readPlugin:async(e)=>(await a.readPlugin(N(e))).plugin,setSkillEnabled:async(e,l)=>{if(e.path in m().busySkills)return;d((s)=>({busySkills:{...s.busySkills,[e.path]:!0}})),d((s)=>({skills:s.skills.map((t)=>t.path===e.path?{...t,enabled:l}:t)}));let n=e.interface?.displayName??e.name;try{let s=await a.setSkillEnabled({path:e.path,enabled:l});if(d((t)=>({skills:t.skills.map((u)=>u.path===e.path?{...u,enabled:s.effectiveEnabled}:u)})),s.effectiveEnabled!==l){o(r("plugins.catalog.toggleNotApplied"));return}c(r(l?"plugins.skills.enabledToast":"plugins.skills.disabledToast",{skillName:n}))}catch(s){d((t)=>({skills:t.skills.map((u)=>u.path===e.path?{...u,enabled:e.enabled}:u)})),o(`${r("plugins.skills.toggleError")}: ${k(s)}`)}finally{d((s)=>{let t={...s.busySkills};return delete t[e.path],{busySkills:t}})}},addMarketplace:async(e)=>{let l=await a.addMarketplace(e);return await y(!0),c(l.alreadyAdded?r("plugins.marketplace.alreadyAdded",{marketplaceName:l.marketplaceName}):r("plugins.marketplace.added",{marketplaceName:l.marketplaceName})),l},removeMarketplace:async(e)=>{h(e,!0);try{await a.removeMarketplace(e),await y(),h(e,!1),c(r("plugins.marketplace.removed",{marketplaceName:e}))}catch(l){o(`${r("plugins.marketplace.removeError")}: ${k(l)}`)}finally{h(e,!1)}},upgradeMarketplace:async(e)=>{h(e,!0);try{let l=await a.upgradeMarketplaces(e);if(await y(!0),h(e,!1),l.errors.length>0)o(`${r("plugins.marketplace.upgradeError")}: ${l.errors.map((n)=>n.message).join("; ")}`);else c(r("plugins.marketplace.upgraded",{marketplaceName:e}))}catch(l){o(`${r("plugins.marketplace.upgradeError")}: ${k(l)}`)}finally{h(e,!1)}},upgradeAll:async()=>{if(m().upgrading)return;d({upgrading:!0});try{let e=await a.upgradeMarketplaces();if(await y(!0),d({upgrading:!1}),e.errors.length>0)o(r("plugins.marketplace.upgradeAllError"));else c(r("plugins.marketplace.upgradedAll"))}catch(e){o(`${r("plugins.marketplace.upgradeAllRequestError")}: ${k(e)}`)}finally{d({upgrading:!1})}}}),S=Object.assign(R,{bindHost:(e)=>{i=e}});return S}
2
- export{ei,Zt};
1
+ import{createStore as I}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function w(a){return a.interface?.displayName??a.name}function v(a){let g={},i=new Map,r=new Map;for(let c of a.data){for(let o of c.skills)if(i.set(o.path,o),o.scope==="repo"){let p=g[c.cwd]??[];if(!p.includes(o.path))p.push(o.path);g[c.cwd]=p}for(let o of c.errors)r.set(o.path,o)}return{skills:[...i.values()],errors:[...r.values()],projects:g}}function A(a){let g=[];for(let i of a.marketplaces)for(let r of i.plugins)if(r.installed)g.push({plugin:r,marketplace:i});return g.toSorted((i,r)=>(r.plugin.installedAt??0)-(i.plugin.installedAt??0))}function ri(a){let{plugin:g,marketplace:i}=a;return{installAttemptId:crypto.randomUUID(),pluginName:i.path===null?g.remotePluginId??g.name:g.name,...i.path===null?{remoteMarketplaceName:i.name}:{marketplacePath:i.path}}}function N(a){let{plugin:g,marketplace:i}=a;return{pluginName:i.path===null?g.remotePluginId??g.name:g.name,...i.path===null?{remoteMarketplaceName:i.name}:{marketplacePath:i.path}}}function Yt(a,g){let i=g??{t:(e)=>e},r=(e,l)=>i.t(e,l),c=(e)=>i.notify?.(e),o=(e)=>{if(i.reportError)i.reportError(Error(e));else console.error(e)},p=null,b=null,d=(e)=>S.setState(e),m=()=>S.getState(),y=async(e=!1)=>{if(await m().refresh(void 0,{forceRefetch:e,background:!0}),m().error)throw Error(r("plugins.toast.syncError",{message:m().error}))},f=(e,l)=>d((n)=>{let s={...n.busyIds};if(l===null)delete s[e];else s[e]=l;return{busyIds:s}}),h=(e,l)=>d((n)=>{let s={...n.busyMarketplaces};if(l)s[e]=!0;else delete s[e];return{busyMarketplaces:s}}),R=I({loading:!1,loadedScope:null,upgrading:!1,error:null,cwds:[],marketplaces:[],marketplaceLoadErrors:[],featuredPluginIds:[],installed:[],skills:[],skillProjects:{},skillErrors:[],busyIds:{},busySkills:{},busyMarketplaces:{},refresh:(e=m().cwds,l={})=>{let n=l.forceRefetch===!0||p?.forceRefetch===!0,s=l.catalog!==!1||n||p?.catalog===!0;if(p={cwds:e,forceRefetch:n,catalog:s},d({cwds:e,...!l.background?{loading:!0}:{}}),b)return b;return b=(async()=>{while(p){let t=p;p=null,d({error:null});try{let[u,P,M]=await Promise.all([a.listSkills(t.cwds,t.forceRefetch),t.catalog?a.listPlugins({...t.cwds.length>0?{cwds:t.cwds}:{},...t.forceRefetch?{forceRefetch:!0}:{}}):null,a.installedPlugins(t.cwds)]);if(p)continue;let E=v(u);d({loadedScope:JSON.stringify(t.cwds),skills:E.skills,skillProjects:E.projects,skillErrors:E.errors,...P?{marketplaces:P.marketplaces,marketplaceLoadErrors:P.marketplaceLoadErrors,featuredPluginIds:P.featuredPluginIds}:{},installed:A(M)})}catch(u){if(!p)d({error:k(u)})}}})().finally(()=>{b=null,d({loading:!1})}),b},install:async(e)=>{if(e.plugin.id in m().busyIds)throw Error("Plugin operation already in progress");let l=w(e.plugin);f(e.plugin.id,"installing");try{let n=await a.installPlugin(ri(e));return await y(),f(e.plugin.id,null),c(r("plugins.toast.installed",{pluginName:l})),n}catch(n){throw o(`${r("plugins.toast.installError")}: ${k(n)}`),n}finally{f(e.plugin.id,null)}},setPluginEnabled:async(e,l)=>{if(e.id in m().busyIds)return;f(e.id,"toggling");let n=(t)=>d((u)=>({installed:u.installed.map((P)=>P.plugin.id===e.id?{...P,plugin:{...P.plugin,enabled:t}}:P)}));n(l);let s=e.enabled;try{let t=await a.setPluginEnabled(e.id,l);s=t.enabled,n(t.enabled),await y();let u=m().installed.find((P)=>P.plugin.id===e.id);if(u)s=u.plugin.enabled;if(!u||s!==l)throw Error(r("plugins.toast.toggleNotApplied"));f(e.id,null),c(r(l?"plugins.toast.enabled":"plugins.toast.disabled",{pluginName:w(e)}))}catch(t){n(s),o(`${r("plugins.toast.toggleError")}: ${k(t)}`)}finally{f(e.id,null)}},uninstall:async(e)=>{if(e.id in m().busyIds)return;let l=w(e);f(e.id,"uninstalling");try{let n=e.source.type==="remote"?e.remotePluginId:e.id;if(!n)throw Error("Remote plugin ID is missing");if(await a.uninstallPlugin(n),await y(),m().installed.some((s)=>s.plugin.id===e.id))throw Error(r("plugins.toast.uninstallNotApplied"));f(e.id,null),c(r("plugins.toast.uninstalled",{pluginName:l}))}catch(n){o(`${r("plugins.toast.uninstallError")}: ${k(n)}`)}finally{f(e.id,null)}},readPlugin:async(e)=>(await a.readPlugin(N(e))).plugin,setSkillEnabled:async(e,l)=>{if(e.path in m().busySkills)return;d((s)=>({busySkills:{...s.busySkills,[e.path]:!0}})),d((s)=>({skills:s.skills.map((t)=>t.path===e.path?{...t,enabled:l}:t)}));let n=e.interface?.displayName??e.name;try{let s=await a.setSkillEnabled({path:e.path,enabled:l});if(d((t)=>({skills:t.skills.map((u)=>u.path===e.path?{...u,enabled:s.effectiveEnabled}:u)})),s.effectiveEnabled!==l){o(r("plugins.catalog.toggleNotApplied"));return}c(r(l?"plugins.skills.enabledToast":"plugins.skills.disabledToast",{skillName:n}))}catch(s){d((t)=>({skills:t.skills.map((u)=>u.path===e.path?{...u,enabled:e.enabled}:u)})),o(`${r("plugins.skills.toggleError")}: ${k(s)}`)}finally{d((s)=>{let t={...s.busySkills};return delete t[e.path],{busySkills:t}})}},addMarketplace:async(e)=>{let l=await a.addMarketplace(e);return await y(!0),c(l.alreadyAdded?r("plugins.marketplace.alreadyAdded",{marketplaceName:l.marketplaceName}):r("plugins.marketplace.added",{marketplaceName:l.marketplaceName})),l},removeMarketplace:async(e)=>{h(e,!0);try{await a.removeMarketplace(e),await y(),h(e,!1),c(r("plugins.marketplace.removed",{marketplaceName:e}))}catch(l){o(`${r("plugins.marketplace.removeError")}: ${k(l)}`)}finally{h(e,!1)}},upgradeMarketplace:async(e)=>{h(e,!0);try{let l=await a.upgradeMarketplaces(e);if(await y(!0),h(e,!1),l.errors.length>0)o(`${r("plugins.marketplace.upgradeError")}: ${l.errors.map((n)=>n.message).join("; ")}`);else c(r("plugins.marketplace.upgraded",{marketplaceName:e}))}catch(l){o(`${r("plugins.marketplace.upgradeError")}: ${k(l)}`)}finally{h(e,!1)}},upgradeAll:async()=>{if(m().upgrading)return;d({upgrading:!0});try{let e=await a.upgradeMarketplaces();if(await y(!0),d({upgrading:!1}),e.errors.length>0)o(r("plugins.marketplace.upgradeAllError"));else c(r("plugins.marketplace.upgradedAll"))}catch(e){o(`${r("plugins.marketplace.upgradeAllRequestError")}: ${k(e)}`)}finally{d({upgrading:!1})}}}),S=Object.assign(R,{bindHost:(e)=>{i=e}});return S}
2
+ export{ri,Yt};
@@ -1,2 +1,2 @@
1
- import{Po}from"./chunk-t1qj0vqe.js";async function vr(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Rt(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Po(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
- export{vr,Rt};
1
+ import{Ao}from"./chunk-mybye5t2.js";async function xr(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Ht(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Ao(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
+ export{xr,Ht};
@@ -0,0 +1,2 @@
1
+ function Re(){if(typeof navigator>"u")return!1;let a=navigator.userAgentData?.platform;return/mac/i.test(a??navigator.platform)}function ui(a){if(a.shiftKey||a.altKey)return!1;return Re()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}
2
+ export{Re,ui};
@@ -1,2 +1,2 @@
1
- function i(n,o=0){if(o>32)throw Error("Session input config is too deeply nested");if(n===null||typeof n==="string"||typeof n==="boolean")return n;if(typeof n==="number"&&Number.isFinite(n))return n;if(Array.isArray(n))return n.map((t)=>i(t,o+1));if(n&&typeof n==="object"&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null))return Object.fromEntries(Object.keys(n).toSorted().map((t)=>[t,i(n[t],o+1)]));throw Error("Session input config must contain only JSON values")}function $i(n){if(!n||typeof n!=="object"||!("mode"in n)||typeof n.mode!=="string"||!n.mode.trim()||n.mode.length>128||/\p{Cc}/u.test(n.mode)||!("config"in n)||!n.config||typeof n.config!=="object"||Array.isArray(n.config))throw Error("Expected session input configuration with mode and config");let o=i(n.config),t={mode:n.mode,config:o};if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error("Session input config exceeds 64 KiB");return t}function Rn(n,o){if(!n||typeof n!=="object"||!("sessionId"in n)||n.sessionId!==o||!("revision"in n)||typeof n.revision!=="number"||!Number.isSafeInteger(n.revision)||n.revision<0||!("inputConfig"in n))throw Error("Invalid Codex session input snapshot");return{sessionId:o,revision:n.revision,inputConfig:n.inputConfig===null?null:$i(n.inputConfig)}}
2
- export{$i,Rn};
1
+ function i(n,o=0){if(o>32)throw Error("Session input config is too deeply nested");if(n===null||typeof n==="string"||typeof n==="boolean")return n;if(typeof n==="number"&&Number.isFinite(n))return n;if(Array.isArray(n))return n.map((t)=>i(t,o+1));if(n&&typeof n==="object"&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null))return Object.fromEntries(Object.keys(n).toSorted().map((t)=>[t,i(n[t],o+1)]));throw Error("Session input config must contain only JSON values")}function Zi(n){if(!n||typeof n!=="object"||!("mode"in n)||typeof n.mode!=="string"||!n.mode.trim()||n.mode.length>128||/\p{Cc}/u.test(n.mode)||!("config"in n)||!n.config||typeof n.config!=="object"||Array.isArray(n.config))throw Error("Expected session input configuration with mode and config");let o=i(n.config),t={mode:n.mode,config:o};if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error("Session input config exceeds 64 KiB");return t}function Hn(n,o){if(!n||typeof n!=="object"||!("sessionId"in n)||n.sessionId!==o||!("revision"in n)||typeof n.revision!=="number"||!Number.isSafeInteger(n.revision)||n.revision<0||!("inputConfig"in n))throw Error("Invalid Codex session input snapshot");return{sessionId:o,revision:n.revision,inputConfig:n.inputConfig===null?null:Zi(n.inputConfig)}}
2
+ export{Zi,Hn};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-pxbww0j1.js";import{Ae,J,me}from"./chunk-vq060dnz.js";import{useEffect as S,useMemo as f}from"react";function Ls(s){let c=J((i)=>i.activityOrder),a=o((i)=>{let n=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&Ae(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(n)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=J((i)=>i.activitySeen),r=me();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,n])=>u.get(i)!==n)}
2
+ export{Ls};
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-6cedp3k2.js";import{K,q,W,Z}from"./chunk-jf7em132.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function Ce({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(q,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(K,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
- export{Ce};
1
+ import{d}from"./chunk-qvzxzzw8.js";import{K,q,W,Z}from"./chunk-mp5f940y.js";import{Item as i}from"@nyssance/shadcn/vega/components/ui/item";import{Skeleton as s}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as e,jsxs as a}from"react/jsx-runtime";function Se({skills:l=!1}){let{t:o}=d();return a("div",{role:"status","aria-label":o(l?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(Z,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2","aria-hidden":"true",children:[1,2,3,4,5,6,7,8].map((t)=>a(i,{size:"xs",className:"toolbox-row",children:[e(W,{children:e(s,{className:"size-10 rounded-xl"})}),a(q,{className:"min-w-0 group-data-[size=xs]/item:gap-2",children:[e(s,{className:"h-4 w-2/3"}),e(s,{className:"h-3 w-full"}),e(s,{className:"h-3 w-1/3"})]}),e(K,{children:e(s,{className:"size-8 rounded-full"})})]},t))})]})}
2
+ export{Se};
@@ -1,2 +1,2 @@
1
- import{It}from"./chunk-dwxmgsg8.js";import{rt}from"./chunk-a18avvt2.js";import{l}from"./chunk-6283nzqs.js";import{g}from"./chunk-f67e77e6.js";import{j}from"./chunk-7xsrqwvt.js";import{e}from"./chunk-kyqf7cqh.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as z,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function so({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:h,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:v,host:N}=e(),{t:d}=N,G=g(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[X,U]=M(x);if(X!==x)U(x),C(null);let[F,K]=M([]),[H,T]=M("loading");z(()=>{if(!a||c||!v.installedApps)return;let t=!0;return T("loading"),K([]),v.installedApps().then(({apps:s})=>{if(!t)return;K(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,v,N]);let O=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=rt(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=It(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>G.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>h({id:t.id,name:t.runtimeName||t.id})})),status:H==="loading"?d("composer.appsLoading"):H==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(v.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(z(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"&&!n.shiftKey&&!n.altKey||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)O(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>O(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function Fi({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=g(),E=S(null),h=S(!1);return I(oe,{children:[o(j,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{h.current=i.open},onClick:()=>{if(r)k(!h.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(so,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
- export{so,Fi};
1
+ import{Nt}from"./chunk-xqrhfxct.js";import{at}from"./chunk-fqchnswc.js";import{l}from"./chunk-6283nzqs.js";import{g}from"./chunk-q8c4k6qh.js";import{j}from"./chunk-pvm6d77q.js";import{e}from"./chunk-qgrd5xre.js";import{BlocksIcon as Q,BookOpenIcon as Y,PaperclipIcon as Z,PlusIcon as q,SquareSlashIcon as ee}from"lucide-react";import{useEffect as z,useLayoutEffect as te,useRef as S,useState as M}from"react";import{createPortal as ne}from"react-dom";import{Button as se}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as I,Fragment as oe}from"react/jsx-runtime";function po({anchorRef:r,commands:k,disabled:i,agentDisabled:c,open:a,onCommand:E,onApp:h,focusInput:L,includeAttachment:f,query:y="",onClose:p,triggerRef:B}){let{client:v,host:N}=e(),{t:d}=N,G=g(),P=S(null),[D,C]=M(null),x=`${a}:${f}:${y}`,[X,U]=M(x);if(X!==x)U(x),C(null);let[F,K]=M([]),[H,T]=M("loading");z(()=>{if(!a||c||!v.installedApps)return;let t=!0;return T("loading"),K([]),v.installedApps().then(({apps:s})=>{if(!t)return;K(s.filter((u)=>u.enabled&&u.callable)),T("ready")},(s)=>{if(!t)return;T("error"),N.reportError?.(s)}),()=>{t=!1}},[a,c,v,N]);let O=(t)=>{if(t.disabled)return;p(),t.run(),L()},W=at(k,y,Number.MAX_SAFE_INTEGER),_=(t)=>({key:`command:${t.key}`,label:t.payload.startsWith("$")?t.label.slice(1):t.label,description:t.description,skillName:t.payload.startsWith("$")?t.payload.slice(1):void 0,disabled:i||c,run:()=>E(t.payload)}),V=Nt(F,y,(t)=>t.runtimeName||t.id,Number.MAX_SAFE_INTEGER).map(({item:t})=>t),R=[{id:"commands",label:d(f?"composer.attachmentsAndCommands":"composer.commands"),entries:[...f?[{key:"attachment",label:d("composer.addAttachment"),disabled:i,run:()=>G.openFileDialog()}]:[],...W.filter((t)=>!t.payload.startsWith("$")).map(_)],status:void 0},{id:"skills",label:d("composer.skills"),entries:W.filter((t)=>t.payload.startsWith("$")).map(_),status:void 0},{id:"apps",label:d("composer.apps"),entries:V.map((t)=>({key:`app:${t.id}`,label:t.runtimeName||t.id,disabled:i||c,run:()=>h({id:t.id,name:t.runtimeName||t.id})})),status:H==="loading"?d("composer.appsLoading"):H==="error"?d("composer.appsFailed"):F.length===0&&!y.trim()?d("composer.appsEmpty"):void 0}].filter((t)=>(t.id!=="apps"||!c&&Boolean(v.installedApps))&&(!y.trim()||t.entries.length>0||t.status)),m=R.flatMap((t)=>t.entries).filter((t)=>!t.disabled),b=m.some((t)=>t.key===D)?D:m[0]?.key;if(z(()=>{if(!a)return;let t=L();if(!t)throw Error("The composer input is missing");let s=(n)=>{if(n.target instanceof Node&&!P.current?.contains(n.target)&&!B?.current?.contains(n.target)&&!t.contains(n.target))p()},u=(n)=>{if(n.isComposing||n.keyCode===229)return;if(n.key==="Escape")n.preventDefault(),n.stopPropagation(),p();else if(n.key==="ArrowDown"||n.key==="ArrowUp"){n.preventDefault(),n.stopPropagation();let w=m.findIndex((J)=>J.key===b),A=Math.max(0,Math.min(m.length-1,w+(n.key==="ArrowDown"?1:-1)));if(m[A])C(m[A].key)}else if(n.key==="Enter"&&!n.shiftKey&&!n.altKey||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let w=m.find((A)=>A.key===b);if(w)O(w)}};if(t.addEventListener("keydown",u,!0),f)t.addEventListener("input",p);return t.addEventListener("blur",p),document.addEventListener("pointerdown",s,!0),()=>{t.removeEventListener("keydown",u,!0),t.removeEventListener("input",p),t.removeEventListener("blur",p),document.removeEventListener("pointerdown",s,!0)}},[a,b,m,L,p,f,B]),te(()=>{if(a)P.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})},[a,b]),!a)return null;if(!r.current)throw Error("The composer menu anchor is missing");return ne(o("div",{className:l.position,children:o("div",{ref:P,role:"listbox","aria-label":d(f?"composer.add":"composer.commands"),onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:I("div",{className:l.list,children:[R.length===0&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:d("composer.addEmpty")}),R.map((t)=>I("div",{role:"group","aria-label":t.label,children:[o("div",{className:l.group,children:t.label}),t.entries.map((s)=>{let u=s.key==="attachment"?Z:t.id==="skills"?Y:t.id==="apps"?Q:ee,n=s.skillName===void 0?void 0:N.skillIcon?.(s.skillName);return I(se,{type:"button",variant:"ghost",role:"option",disabled:s.disabled,"aria-selected":s.key===b,onMouseEnter:()=>{if(!s.disabled)C(s.key)},onClick:()=>O(s),className:`${l.row}${s.key===b?` ${l.selected}`:""}`,children:[n?o("img",{src:n,alt:"","aria-hidden":"true",className:`${l.icon} object-contain`}):o(u,{className:l.icon}),o("span",{className:l.label,children:s.label}),s.description&&o("span",{"data-slot":"description",className:l.description,children:s.description})]},s.key)}),t.status&&o("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:l.notice,children:t.status})]},t.id))]})})}),r.current)}function Gi({agentControls:r,onOpenChange:k,...i}){let{host:c}=e(),a=g(),E=S(null),h=S(!1);return I(oe,{children:[o(j,{ref:E,disabled:i.disabled,"aria-label":c.t(r?"composer.add":"composer.attachImage"),title:c.t(r?"composer.add":"composer.attachImage"),"aria-haspopup":r?"listbox":void 0,"aria-expanded":r?i.open:void 0,className:"text-foreground",onPointerDown:()=>{h.current=i.open},onClick:()=>{if(r)k(!h.current),i.focusInput();else a.openFileDialog()},children:o(q,{className:"size-4"})}),r&&i.open&&o(po,{...i,includeAttachment:!0,onClose:()=>k(!1),triggerRef:E})]})}
2
+ export{po,Gi};
@@ -1,2 +1,2 @@
1
- import{Ut}from"./chunk-8hm3nkrk.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function Qr({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Ut({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
2
- export{Qr};
1
+ import{Gt}from"./chunk-k014w2jg.js";import{Maximize2 as I,Minus as F,Plus as K}from"lucide-react";import{useCallback as O,useEffect as W,useEffectEvent as S,useLayoutEffect as B,useRef as z,useState as k}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{DialogTitle as A}from"@nyssance/shadcn/vega/components/ui/dialog";import{jsx as a,jsxs as C,Fragment as G}from"react/jsx-runtime";function Hr({image:u,actions:P,t:o}){let[n,R]=k(null),m=z(null),[d,Y]=k({width:0,height:0}),[X,E]=k(1),g=z(null),y=z(()=>{}),w=d.width&&d.height?Math.min(d.width/u.width,d.height/u.height):1,i=X??w,x=Math.min(0.1,w),M=Math.max(8,w);B(()=>{if(!n)return;let e=()=>Y({width:n.clientWidth,height:n.clientHeight});e();let r=new ResizeObserver(e);return r.observe(n),()=>r.disconnect()},[n]);let h=O((e,r)=>{if(!n||!m.current)return;let l=Math.min(M,Math.max(x,e));if(l===i)return;let s=n.getBoundingClientRect(),c=m.current.getBoundingClientRect(),f=Gt({container:n,target:m.current,clientX:r?.x??s.left+n.clientWidth/2,clientY:r?.y??s.top+n.clientHeight/2,currentScale:i,nextScale:l});g.current=f&&{...f,centerX:c.left-s.left+n.scrollLeft+c.width/2,centerY:c.top-s.top+n.scrollTop+c.height/2},E(l)},[M,x,i,n]);B(()=>{let e=g.current;if(!e||!n||!m.current)return;g.current=null;let r=n.getBoundingClientRect(),l=m.current.getBoundingClientRect();n.scrollLeft=e.left+l.left-r.left+n.scrollLeft+l.width/2-e.centerX,n.scrollTop=e.top+l.top-r.top+n.scrollTop+l.height/2-e.centerY});let L=S(()=>i),v=S((e,r)=>h(e,r));W(()=>{if(!n)return;let e=0,r=0,l=null,s=null,c={x:0,y:0},f=()=>{cancelAnimationFrame(e),e=0,r=0,l=null,s=null};y.current=f;let H=()=>{e=0,v(l??L()*Math.exp(-r/200),c),r=0,l=null},T=()=>{if(!e)e=requestAnimationFrame(H)},D=(t)=>{if(!t.ctrlKey&&!t.metaKey)return;if(t.preventDefault(),t.stopPropagation(),s!==null)return;r+=t.deltaY*(t.deltaMode===1?16:t.deltaMode===2?n.clientHeight:1),c={x:t.clientX,y:t.clientY},T()},N=(t)=>{if(!("scale"in t)||typeof t.scale!=="number"||!Number.isFinite(t.scale)||t.scale<=0)return;if(t.preventDefault(),t.stopPropagation(),t.type==="gesturestart")f(),s=L()/t.scale**2;if(s===null)return;if("clientX"in t&&typeof t.clientX==="number"&&"clientY"in t&&typeof t.clientY==="number")c={x:t.clientX,y:t.clientY};if(l=s*t.scale**2,T(),t.type==="gestureend")s=null};n.addEventListener("wheel",D,{passive:!1});for(let t of["gesturestart","gesturechange","gestureend"])n.addEventListener(t,N,{passive:!1});return()=>{f(),y.current=()=>{},n.removeEventListener("wheel",D);for(let t of["gesturestart","gesturechange","gestureend"])n.removeEventListener(t,N)}},[n]);let p=(e)=>{if(y.current(),g.current=null,E(e),n)n.scrollLeft=0,n.scrollTop=0};return C(G,{children:[a(A,{className:"sr-only",children:o("mermaid.diagram")}),a("div",{className:"flex shrink-0 items-center justify-end gap-1",children:P}),a("section",{ref:R,"aria-label":o("mermaid.preview"),tabIndex:0,className:"focus-visible:ring-ring min-h-0 min-w-0 flex-1 overflow-scroll overscroll-contain outline-none focus-visible:ring-2",onKeyDown:(e)=>{if(e.key==="+"||e.key==="=")e.preventDefault(),e.stopPropagation(),h(i*1.25);else if(e.key==="-")e.preventDefault(),e.stopPropagation(),h(i/1.25);else if(e.key==="0")e.preventDefault(),e.stopPropagation(),p(1)},children:a("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.ceil(u.width*i),height:Math.ceil(u.height*i)},children:a("img",{ref:m,src:u.src,alt:o("mermaid.diagram"),draggable:!1,onDoubleClick:()=>p(1),className:"block max-w-none select-none",style:{width:u.width*i,height:u.height*i}})})}),C("div",{className:"flex shrink-0 items-center justify-center gap-1",children:[a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomOut"),title:o("mermaid.zoomOut"),disabled:i<=x,onClick:()=>h(i/1.25),children:a(F,{})}),C(b,{variant:"ghost",className:"min-w-16 tabular-nums","aria-label":o("mermaid.actualSize"),title:o("mermaid.actualSize"),onClick:()=>p(1),children:[Math.round(i*100),"%"]}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.zoomIn"),title:o("mermaid.zoomIn"),disabled:i>=M,onClick:()=>h(i*1.25),children:a(K,{})}),a(b,{variant:"ghost",size:"icon-sm","aria-label":o("mermaid.fit"),title:o("mermaid.fit"),onClick:()=>p(null),children:a(I,{})})]})]})}
2
+ export{Hr};
@@ -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 on({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{on,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 Wo(e,n){return JSON.stringify(["request_user_input_async",e,n])}function fs(e){return{selected:e.options?.length?0:null,text:""}}function Qn(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function hs(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 Zo(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 vs({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&&Qn(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&&Qn(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,Wo,fs,Qn,hs,Zo,vs};
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{fo,It}from"./chunk-dwxmgsg8.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function rt(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=fo(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 It(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{rt,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-wj9s8331.js";function ri(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 ri(r).join(Ne()?"":"+")}
2
- export{ri,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};