@alwith/module-chat 0.6.9 → 0.6.10

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 (290) hide show
  1. package/README.md +1 -1
  2. package/assets/catalogs/anthropic/models.json +308 -0
  3. package/assets/provider-catalog.json +29 -0
  4. package/dist/activity-host.js +1 -1
  5. package/dist/approval/permission-options.js +1 -1
  6. package/dist/approval/permission-view.js +1 -1
  7. package/dist/approval/schema-elicitation-form.js +1 -1
  8. package/dist/approval/url-elicitation-card.js +1 -1
  9. package/dist/{chunk-3v39hqex.js → chunk-0aakfvnm.js} +2 -2
  10. package/dist/{chunk-8d86yqzq.js → chunk-0bqjz323.js} +1 -1
  11. package/dist/{chunk-8689y4n5.js → chunk-0e6fsbhg.js} +2 -2
  12. package/dist/{chunk-zae7p9pm.js → chunk-0f4hevya.js} +2 -2
  13. package/dist/chunk-0knwqeea.js +2 -0
  14. package/dist/{chunk-jwzwz2wr.js → chunk-118vx38k.js} +2 -2
  15. package/dist/{chunk-stzsxdpp.js → chunk-1gwv9823.js} +2 -2
  16. package/dist/{chunk-n3d2mv93.js → chunk-1jae0var.js} +3 -3
  17. package/dist/{chunk-wr5r2t2m.js → chunk-1wdq75b1.js} +2 -2
  18. package/dist/{chunk-rfahybr0.js → chunk-1zfg0nxv.js} +1 -1
  19. package/dist/{chunk-fgr2g610.js → chunk-23g1j51d.js} +3 -3
  20. package/dist/{chunk-1bfxezrb.js → chunk-2fh11ysa.js} +2 -2
  21. package/dist/{chunk-xrbydq2j.js → chunk-2kskj0w5.js} +2 -2
  22. package/dist/{chunk-fd8x014y.js → chunk-2vq4ee43.js} +2 -2
  23. package/dist/{chunk-grgq7twf.js → chunk-2wqn18x2.js} +2 -2
  24. package/dist/{chunk-fzgra242.js → chunk-2yy6y89g.js} +2 -2
  25. package/dist/{chunk-bpenajbp.js → chunk-384sh0aw.js} +2 -2
  26. package/dist/{chunk-ckhw0gr5.js → chunk-3azwj6wd.js} +2 -2
  27. package/dist/{chunk-qm649qdv.js → chunk-3b6m3wgn.js} +2 -2
  28. package/dist/{chunk-3jfkrwjq.js → chunk-3k1vzaxd.js} +2 -2
  29. package/dist/{chunk-5t8zx5e4.js → chunk-3r69g00w.js} +3 -3
  30. package/dist/{chunk-zmbf0v0n.js → chunk-3svrvg8g.js} +1 -1
  31. package/dist/{chunk-36mdfph1.js → chunk-42v3qgdq.js} +2 -2
  32. package/dist/{chunk-29jan02g.js → chunk-48fj5m0p.js} +2 -2
  33. package/dist/{chunk-wwq7d7qm.js → chunk-4bba521x.js} +3 -3
  34. package/dist/{chunk-q5fn378d.js → chunk-4jb5eb68.js} +1 -1
  35. package/dist/{chunk-gwa7hbzr.js → chunk-4pxxxt8s.js} +1 -1
  36. package/dist/{chunk-ym6h1x3a.js → chunk-4s8gw49m.js} +2 -2
  37. package/dist/{chunk-9e6rv193.js → chunk-4ytrtcdb.js} +2 -2
  38. package/dist/{chunk-zk2hwm10.js → chunk-5c1wx64d.js} +2 -2
  39. package/dist/{chunk-tqz7csrk.js → chunk-5e5hvfzj.js} +2 -2
  40. package/dist/{chunk-24kpx8fg.js → chunk-5pk4srmv.js} +2 -2
  41. package/dist/{chunk-c7p3vpyx.js → chunk-5q93tpax.js} +2 -2
  42. package/dist/{chunk-dz5ymd3t.js → chunk-67swkna1.js} +1 -1
  43. package/dist/{chunk-a8gzs651.js → chunk-6f7e67x1.js} +2 -2
  44. package/dist/{chunk-x6yxbndc.js → chunk-6k7249zb.js} +2 -2
  45. package/dist/{chunk-jg6r0ckn.js → chunk-7d7rq137.js} +1 -1
  46. package/dist/{chunk-q0bwkhpy.js → chunk-7mfkaftt.js} +2 -2
  47. package/dist/{chunk-7qwbxdyb.js → chunk-7nckaz1t.js} +2 -2
  48. package/dist/{chunk-k10kbwqc.js → chunk-7vcwgkhs.js} +2 -2
  49. package/dist/{chunk-5v8f2sbp.js → chunk-7zsa59w7.js} +2 -2
  50. package/dist/{chunk-akvpgx43.js → chunk-85nkcdqg.js} +2 -2
  51. package/dist/{chunk-xbqvb31f.js → chunk-8n1rq3xt.js} +2 -2
  52. package/dist/{chunk-70j4ee5r.js → chunk-8xtp7pxb.js} +1 -1
  53. package/dist/{chunk-1zypzzje.js → chunk-9098ssbp.js} +1 -1
  54. package/dist/{chunk-a8j61zs9.js → chunk-91ppvzvv.js} +2 -2
  55. package/dist/{chunk-jzaxy8af.js → chunk-ag4vzemv.js} +2 -2
  56. package/dist/{chunk-m1adrey8.js → chunk-ak2frpw9.js} +2 -2
  57. package/dist/{chunk-t1zw5wrq.js → chunk-as79cv4d.js} +2 -2
  58. package/dist/{chunk-ek3v1g24.js → chunk-b5jq0ken.js} +2 -2
  59. package/dist/{chunk-02jpgxy7.js → chunk-bktb5ys5.js} +1 -1
  60. package/dist/{chunk-c61yvpy3.js → chunk-c162bdr0.js} +2 -2
  61. package/dist/{chunk-f1r8wh4e.js → chunk-cbp0q0yt.js} +1 -1
  62. package/dist/{chunk-80r0jch1.js → chunk-ccmcm6sv.js} +2 -2
  63. package/dist/{chunk-5f889j6j.js → chunk-czp860hf.js} +2 -2
  64. package/dist/{chunk-84gk74hf.js → chunk-dnn1fcg8.js} +2 -2
  65. package/dist/{chunk-8an4t4kh.js → chunk-dwpx56ge.js} +1 -1
  66. package/dist/{chunk-0y1c3v1b.js → chunk-evs7bhpp.js} +1 -1
  67. package/dist/{chunk-8rpen55z.js → chunk-exkwydhf.js} +3 -3
  68. package/dist/chunk-f0g5k1d0.js +2 -0
  69. package/dist/{chunk-5f5jfr40.js → chunk-f17jdv7p.js} +1 -1
  70. package/dist/{chunk-7jmqq7b5.js → chunk-fvg2w21q.js} +3 -3
  71. package/dist/{chunk-acnqnrqb.js → chunk-gp0bxakd.js} +2 -2
  72. package/dist/{chunk-njre3ygs.js → chunk-gt343hrf.js} +2 -2
  73. package/dist/{chunk-4j6gy4me.js → chunk-h5zbmv4r.js} +2 -2
  74. package/dist/{chunk-p6gwrqjp.js → chunk-h800j36s.js} +2 -2
  75. package/dist/{chunk-hbm3sgw7.js → chunk-hpjh92s8.js} +2 -2
  76. package/dist/{chunk-pks7f314.js → chunk-jnpb9sqy.js} +5 -5
  77. package/dist/{chunk-h4adycra.js → chunk-jt54wp2c.js} +1 -1
  78. package/dist/{chunk-e0c8pmjc.js → chunk-jxgn4r9q.js} +3 -3
  79. package/dist/{chunk-0eewkw7t.js → chunk-k4dg1jep.js} +2 -2
  80. package/dist/{chunk-75ve01mr.js → chunk-k7d2y0wx.js} +2 -2
  81. package/dist/{chunk-pza08wvz.js → chunk-kc56dhwd.js} +2 -2
  82. package/dist/{chunk-z5c4njqk.js → chunk-khdjy444.js} +2 -2
  83. package/dist/chunk-km434w1k.js +2 -0
  84. package/dist/{chunk-ajjd22hb.js → chunk-ktknydpy.js} +3 -3
  85. package/dist/{chunk-2tc8kgsa.js → chunk-kvkpd69n.js} +2 -2
  86. package/dist/{chunk-s8xpf179.js → chunk-m58ryg53.js} +2 -2
  87. package/dist/{chunk-3m59n5gr.js → chunk-mma530jr.js} +1 -1
  88. package/dist/{chunk-70bm3f7n.js → chunk-mveefs0j.js} +2 -2
  89. package/dist/{chunk-v0mbfaqw.js → chunk-n14f6z0f.js} +2 -2
  90. package/dist/{chunk-9p1jvznr.js → chunk-ncs6yc8v.js} +2 -2
  91. package/dist/{chunk-g0gq72z9.js → chunk-ncsdkb8h.js} +2 -2
  92. package/dist/{chunk-xgyb00qq.js → chunk-ne804jep.js} +2 -2
  93. package/dist/{chunk-np76wm1k.js → chunk-nrz6w8rd.js} +1 -1
  94. package/dist/{chunk-j18830g5.js → chunk-ny85vn0b.js} +2 -2
  95. package/dist/{chunk-zfag3ne0.js → chunk-pj7m1bs8.js} +2 -2
  96. package/dist/chunk-pmzkz6hg.js +2 -0
  97. package/dist/{chunk-80a1fdx8.js → chunk-pnm040ke.js} +1 -1
  98. package/dist/{chunk-gfrzmgz4.js → chunk-pp1rr3jj.js} +1 -1
  99. package/dist/{chunk-m7wse5yk.js → chunk-ps3vgzbn.js} +2 -2
  100. package/dist/{chunk-2kjbas8a.js → chunk-q06r0t1d.js} +2 -2
  101. package/dist/{chunk-kxw57gdb.js → chunk-q4rad054.js} +2 -2
  102. package/dist/{chunk-v5mb5c61.js → chunk-q6ymd3n1.js} +2 -2
  103. package/dist/{chunk-yfws137b.js → chunk-qephgzb6.js} +2 -2
  104. package/dist/{chunk-p5mfv6t6.js → chunk-r5xd9p8p.js} +2 -2
  105. package/dist/{chunk-s4m2h876.js → chunk-rkww8p94.js} +1 -1
  106. package/dist/{chunk-wbhxpwm7.js → chunk-rnb0q6bt.js} +2 -2
  107. package/dist/{chunk-kctrzc57.js → chunk-rzx4tyx8.js} +1 -1
  108. package/dist/{chunk-bxmgvyfe.js → chunk-ss918bxh.js} +2 -2
  109. package/dist/{chunk-h9ywpga2.js → chunk-ts8edszy.js} +2 -2
  110. package/dist/{chunk-fbmbc4wt.js → chunk-tsfpx3fp.js} +2 -2
  111. package/dist/{chunk-8428vfp3.js → chunk-ttk7b5mr.js} +2 -2
  112. package/dist/{chunk-eq7vpgn7.js → chunk-v931rjk2.js} +2 -2
  113. package/dist/{chunk-g79y6q3f.js → chunk-v9nbx36v.js} +2 -2
  114. package/dist/{chunk-ha2f2cwz.js → chunk-va11ek5z.js} +2 -2
  115. package/dist/{chunk-958qyr8g.js → chunk-vdjhch6s.js} +2 -2
  116. package/dist/{chunk-pdrz9qs1.js → chunk-vfkhj17k.js} +2 -2
  117. package/dist/chunk-vnwb90j9.js +2 -0
  118. package/dist/{chunk-xgcwrqpw.js → chunk-vw7pqffn.js} +2 -2
  119. package/dist/{chunk-hkjj3prp.js → chunk-w89hdkar.js} +2 -2
  120. package/dist/{chunk-zjevkw68.js → chunk-wg45j5yr.js} +2 -2
  121. package/dist/{chunk-32s8dn1a.js → chunk-wjr2cjt1.js} +2 -2
  122. package/dist/{chunk-bt0t1pev.js → chunk-wq9hmwvb.js} +2 -2
  123. package/dist/chunk-wsny5ye8.js +2 -0
  124. package/dist/{chunk-6z36709h.js → chunk-wteebw32.js} +2 -2
  125. package/dist/{chunk-9wk2xp6v.js → chunk-x15sq8ff.js} +2 -2
  126. package/dist/{chunk-1fh3vvpe.js → chunk-x210arqv.js} +3 -3
  127. package/dist/{chunk-kjt77brz.js → chunk-x29s0dbq.js} +2 -2
  128. package/dist/{chunk-gkp0e28t.js → chunk-x2vms9xf.js} +2 -2
  129. package/dist/{chunk-jxgtgpa9.js → chunk-xmt5r1xe.js} +2 -2
  130. package/dist/{chunk-7egc2evj.js → chunk-xnszvze2.js} +2 -2
  131. package/dist/{chunk-nsy1ne51.js → chunk-xphfecws.js} +2 -2
  132. package/dist/{chunk-p38vws4a.js → chunk-xrsa8v3g.js} +2 -2
  133. package/dist/{chunk-1940kkcm.js → chunk-xw2zfj4c.js} +2 -2
  134. package/dist/chunk-y583je9q.js +2 -0
  135. package/dist/{chunk-nm4dtceb.js → chunk-yathdy79.js} +2 -2
  136. package/dist/{chunk-658y6xth.js → chunk-ydxrj4as.js} +2 -2
  137. package/dist/{chunk-8504eft8.js → chunk-ye7bksyy.js} +3 -3
  138. package/dist/{chunk-fnw16wjx.js → chunk-ynfp9w3s.js} +2 -2
  139. package/dist/{chunk-3zwbr9xs.js → chunk-yqnjd8mp.js} +2 -2
  140. package/dist/{chunk-18z4wmhb.js → chunk-z4jk07k1.js} +1 -1
  141. package/dist/{chunk-q9h89nv1.js → chunk-zns42kp5.js} +2 -2
  142. package/dist/{chunk-6pnsagt4.js → chunk-zx63zvpy.js} +1 -1
  143. package/dist/{chunk-brfr0m5g.js → chunk-zyjcpz4s.js} +1 -1
  144. package/dist/codex/activity-group.js +1 -1
  145. package/dist/codex/assistant-message.js +1 -1
  146. package/dist/codex/async-question-card.js +1 -1
  147. package/dist/codex/edited-files-card.js +1 -1
  148. package/dist/codex/image-view-activity.js +1 -1
  149. package/dist/codex/markdown-renderer.js +1 -1
  150. package/dist/codex/navigation-audio.js +1 -1
  151. package/dist/codex/navigation-preview.js +1 -1
  152. package/dist/codex/navigation-rail.js +1 -1
  153. package/dist/codex/patch-view.js +1 -1
  154. package/dist/codex/timeline-virtualizer.js +1 -1
  155. package/dist/codex/turn-activity.js +1 -1
  156. package/dist/codex/user-message.js +1 -1
  157. package/dist/codex/virtualized-turn-list.js +1 -1
  158. package/dist/collections/collection-emoji.js +1 -1
  159. package/dist/collections/collection-menu.js +1 -1
  160. package/dist/collections/collection-panel.js +1 -1
  161. package/dist/collections/collections.js +1 -1
  162. package/dist/collections/host.js +1 -1
  163. package/dist/collections/model.js +1 -1
  164. package/dist/collections/store.js +1 -1
  165. package/dist/composer/completion-filter.js +1 -1
  166. package/dist/composer/completion-menu.js +1 -1
  167. package/dist/composer/completion-trigger.js +1 -1
  168. package/dist/composer/model-select.js +1 -1
  169. package/dist/composer/permission-mode-select.js +1 -1
  170. package/dist/composer/prompt-input-attachments.js +1 -1
  171. package/dist/composer/prompt-input-clipboard.js +1 -1
  172. package/dist/composer/prompt-input-context.js +1 -1
  173. package/dist/composer/prompt-input-textarea.js +1 -1
  174. package/dist/composer/prompt-input.js +1 -1
  175. package/dist/conversation/action-card.js +1 -1
  176. package/dist/conversation/composer/app-mentions.js +1 -1
  177. package/dist/conversation/composer/apps-menu.js +1 -1
  178. package/dist/conversation/composer/composer.js +1 -1
  179. package/dist/conversation/composer/context.js +1 -1
  180. package/dist/conversation/composer/drafts.js +1 -1
  181. package/dist/conversation/composer/long-text.js +1 -1
  182. package/dist/conversation/composer/mention-chips.js +1 -1
  183. package/dist/conversation/composer/model-menu.js +1 -1
  184. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  185. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  186. package/dist/conversation/composer/prompt-history.js +1 -1
  187. package/dist/conversation/composer/slash-command-button.js +1 -1
  188. package/dist/conversation/composer/submit-button.js +1 -1
  189. package/dist/conversation/composer/usage-meter.js +1 -1
  190. package/dist/conversation/connection-notice.js +1 -1
  191. package/dist/conversation/context.js +1 -1
  192. package/dist/conversation/conversation-body.js +1 -1
  193. package/dist/conversation/conversation-search.js +1 -1
  194. package/dist/conversation/conversation-view.js +1 -1
  195. package/dist/conversation/conversation.js +1 -1
  196. package/dist/conversation/diff-modal.js +1 -1
  197. package/dist/conversation/draft-project-picker.js +1 -1
  198. package/dist/conversation/session-actions.js +1 -1
  199. package/dist/conversation/subagent-sessions.js +1 -1
  200. package/dist/generated/commands.js +1 -1
  201. package/dist/image-lightbox.js +1 -1
  202. package/dist/image-preview-dialog.js +1 -1
  203. package/dist/lib/code-highlighter.js +1 -1
  204. package/dist/lib/fuzzy.js +1 -1
  205. package/dist/lib/group-blocks.js +1 -1
  206. package/dist/lib/image-encode.js +1 -1
  207. package/dist/lib/limits.js +1 -1
  208. package/dist/lib/markdown-parser.js +1 -1
  209. package/dist/lib/pointer-centered-zoom.js +1 -1
  210. package/dist/lib/prepare-prompt-files.js +1 -1
  211. package/dist/lib/stream-style.js +1 -1
  212. package/dist/plugins/catalog-skeleton.js +1 -1
  213. package/dist/plugins/host.js +1 -1
  214. package/dist/plugins/plugin-detail-page.js +1 -1
  215. package/dist/plugins/plugins-page.js +1 -1
  216. package/dist/plugins/plugins.js +1 -1
  217. package/dist/plugins/read-skill-document.js +1 -1
  218. package/dist/plugins/skill-document.js +1 -1
  219. package/dist/plugins/skills-tab.js +1 -1
  220. package/dist/search/chat-search.js +1 -1
  221. package/dist/search/codex-source-matches.js +1 -1
  222. package/dist/search/dom-matches.js +1 -1
  223. package/dist/search/find-bar.js +1 -1
  224. package/dist/search/literal-matches.js +1 -1
  225. package/dist/session-list/account-menu.js +1 -1
  226. package/dist/session-list/activity-list.js +1 -1
  227. package/dist/session-list/archived-sessions.js +1 -1
  228. package/dist/session-list/help-menu.js +1 -1
  229. package/dist/session-list/host.js +1 -1
  230. package/dist/session-list/navigation-controls.js +1 -1
  231. package/dist/session-list/navigation-header.js +1 -1
  232. package/dist/session-list/navigation-store.js +1 -1
  233. package/dist/session-list/navigation-tabs.js +1 -1
  234. package/dist/session-list/navigation.js +1 -1
  235. package/dist/session-list/platform.js +1 -1
  236. package/dist/session-list/session-groups.js +1 -1
  237. package/dist/session-list/session-info-card.js +1 -1
  238. package/dist/session-list/session-list.js +1 -1
  239. package/dist/session-list/session-row.js +1 -1
  240. package/dist/session-list/session-state-dot.js +1 -1
  241. package/dist/session-list/session-state-menu.js +1 -1
  242. package/dist/session-list/shortcut-hint.js +1 -1
  243. package/dist/session-list/shortcut.js +1 -1
  244. package/dist/session-list/sidebar-overlay.js +1 -1
  245. package/dist/session-list/use-activity-notification.js +1 -1
  246. package/dist/session-list/use-activity-preview.js +1 -1
  247. package/dist/session-list/use-cmd-held.js +1 -1
  248. package/dist/session-list/use-project-sessions.js +1 -1
  249. package/dist/session-timeline/activity-group.js +1 -1
  250. package/dist/session-timeline/activity-projection.js +1 -1
  251. package/dist/session-timeline/assistant-content.js +1 -1
  252. package/dist/session-timeline/assistant-turn.js +1 -1
  253. package/dist/session-timeline/async-questions.js +1 -1
  254. package/dist/session-timeline/edited-files-card.js +1 -1
  255. package/dist/session-timeline/history-timeline.js +1 -1
  256. package/dist/session-timeline/host.js +1 -1
  257. package/dist/session-timeline/image-generation-progress.js +1 -1
  258. package/dist/session-timeline/navigation-rail.js +1 -1
  259. package/dist/session-timeline/plan.js +1 -1
  260. package/dist/session-timeline/question-reply.js +1 -1
  261. package/dist/session-timeline/resource-content.js +1 -1
  262. package/dist/session-timeline/session-timeline.js +1 -1
  263. package/dist/session-timeline/timeline-registry.js +1 -1
  264. package/dist/session-timeline/turn-activity.js +1 -1
  265. package/dist/session-timeline/turn-error.js +1 -1
  266. package/dist/session-timeline/turn-retry.js +1 -1
  267. package/dist/session-timeline/turns.js +1 -1
  268. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  269. package/dist/session-timeline/user-message.js +1 -1
  270. package/dist/settings/codex-account-card.js +1 -1
  271. package/dist/settings/login-card.js +1 -1
  272. package/dist/settings/model-alias-settings.js +1 -1
  273. package/dist/settings/provider-logos.d.ts +1 -0
  274. package/dist/settings/provider-logos.js +1 -1
  275. package/dist/settings/provider-section.js +1 -1
  276. package/dist/settings/providers-port.js +1 -1
  277. package/dist/settings/providers.d.ts +1 -0
  278. package/dist/settings/providers.js +1 -1
  279. package/dist/settings/settings-bridge.js +1 -1
  280. package/dist/settings/settings.js +1 -1
  281. package/native/win32-x64/alwith_native_chat.dll +0 -0
  282. package/native/win32-x64/artifact.json +1 -1
  283. package/package.json +2 -2
  284. package/dist/chunk-3twka9f7.js +0 -2
  285. package/dist/chunk-5yq8k08p.js +0 -2
  286. package/dist/chunk-c47xfjk4.js +0 -2
  287. package/dist/chunk-kmeccf75.js +0 -2
  288. package/dist/chunk-w65d6934.js +0 -2
  289. package/dist/chunk-yvr086m7.js +0 -2
  290. package/dist/chunk-zqe4mjgy.js +0 -2
@@ -14,6 +14,35 @@
14
14
  "web_search": "disabled"
15
15
  }
16
16
  },
17
+ {
18
+ "id": "anthropic",
19
+ "name": "Anthropic",
20
+ "apiType": "anthropic",
21
+ "baseUrl": "https://api.anthropic.com",
22
+ "keyUrl": "https://platform.claude.com/settings/keys",
23
+ "models": [
24
+ {
25
+ "id": "claude-opus-5-5",
26
+ "label": "Opus 5.5"
27
+ },
28
+ {
29
+ "id": "claude-sonnet-5-5",
30
+ "label": "Sonnet 5.5"
31
+ },
32
+ {
33
+ "id": "claude-haiku-5-5",
34
+ "label": "Haiku 5.5"
35
+ },
36
+ {
37
+ "id": "claude-fable-5-2",
38
+ "label": "Fable 5.2"
39
+ }
40
+ ],
41
+ "catalog": "anthropic/models.json",
42
+ "config": {
43
+ "web_search": "disabled"
44
+ }
45
+ },
17
46
  {
18
47
  "id": "deepseek",
19
48
  "name": "DeepSeek",
@@ -1 +1 @@
1
- import{Qi,d,T}from"./chunk-32s8dn1a.js";export{Qi as ActivityHostProvider,T as ActivityMarkdown,d as useActivityHost};
1
+ import{Yi,d,T}from"./chunk-wjr2cjt1.js";export{Yi as ActivityHostProvider,T as ActivityMarkdown,d as useActivityHost};
@@ -1 +1 @@
1
- import{Vr,Yo,xa,ba}from"../chunk-3twka9f7.js";export{Vr as PERMISSION_KIND_GROUP_ORDER,xa as isAllowKind,ba as isAlwaysKind,Yo as sortPermissionOptions};
1
+ import{jr,Xo,ba,Ca}from"../chunk-wsny5ye8.js";export{jr as PERMISSION_KIND_GROUP_ORDER,ba as isAllowKind,Ca as isAlwaysKind,Xo as sortPermissionOptions};
@@ -1 +1 @@
1
- import{Qo}from"../chunk-qm649qdv.js";import"../chunk-3twka9f7.js";export{Qo as PermissionView};
1
+ import{Yo}from"../chunk-3b6m3wgn.js";import"../chunk-wsny5ye8.js";export{Yo as PermissionView};
@@ -1 +1 @@
1
- import{Xr,zr,Jr,Wo}from"../chunk-x6yxbndc.js";export{Wo as SchemaElicitationForm,Xr as elicitationFields,zr as initialValues,Jr as isAnswered};
1
+ import{Jr,Vr,ea,Zo}from"../chunk-6k7249zb.js";export{Zo as SchemaElicitationForm,Jr as elicitationFields,Vr as initialValues,ea as isAnswered};
@@ -1 +1 @@
1
- import{Zo}from"../chunk-bt0t1pev.js";export{Zo as UrlElicitationCard};
1
+ import{Qo}from"../chunk-wq9hmwvb.js";export{Qo as UrlElicitationCard};
@@ -1,2 +1,2 @@
1
- import{_}from"./chunk-4jh2wk80.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function qo({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(_,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
- export{qo};
1
+ import{_}from"./chunk-4jh2wk80.js";import{useState as g}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as w,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as o}from"react/jsx-runtime";function Wo({value:a,currentName:n,icon:r,options:p,label:i,header:t,onValueChange:s,showLabel:d=!1,disabled:l=!1,warning:u=!1}){let[m,c]=g(!1);return o(w,{open:m,onOpenChange:c,children:[e(b,{render:o(f,{disabled:l,"data-permission-warning":u?"":void 0,variant:"ghost","aria-label":`${i}: ${n}`,title:n,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[r,e("span",{className:d?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:n})]})}),o(x,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[t&&e("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:e("span",{children:t})}),e(_,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
+ export{Wo};
@@ -1,2 +1,2 @@
1
- import{rt}from"./chunk-8504eft8.js";import{l,Ie}from"./chunk-g79y6q3f.js";import{h}from"./chunk-9cqpn67f.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as c}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as a,Fragment as F}from"react/jsx-runtime";function zn(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let i=n.replaceAll("\\","/"),t=i.lastIndexOf("/");return t<=0?"/":i.slice(0,t)}function I(n){let i=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(i.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${i.replace(/\/$/,"")}/${t.join("/")}`}function de({path:n,renderHeader:i,description:t}){let e=l(),{t:r}=e,d=e.readFile,[u,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let s=!1;return f(null),w(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!s)f(m)},(m)=>{if(!s)w(String(m))}),()=>{s=!0}},[n,t,M,d]);let k=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:a(P,{children:[o(z,{render:o(x,{variant:"ghost",size:"icon-sm","aria-label":r("plugins.card.moreActions")}),children:o(y,{})}),a(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ie(e,e.openPath(n)),children:r("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ie(e,e.revealPath(n)),children:r("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:u===null,onClick:()=>{if(u!==null)Ie(e,e.copyText(u))},children:r("plugins.skills.document.copy")})]})]});return a(F,{children:[i?i(k):o("div",{className:"flex justify-end",children:k}),o(h,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":r("plugins.skills.document.content")},children:v?a("div",{role:"alert",className:"space-y-3",children:[a("p",{className:"text-destructive text-sm break-words",children:[r("plugins.skills.document.error"),": ",v]}),o(x,{variant:"outline",size:"sm",onClick:()=>N((s)=>s+1),children:r("plugins.loadError.retry")})]}):u===null?a("div",{role:"status","aria-label":r("plugins.skills.loading"),className:"space-y-3",children:[o(c,{className:"h-6 w-1/3"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-2/3"})]}):o(rt,{text:zn(u),host:{theme:e.theme,copyLabel:r("plugins.copy"),openLink:(s)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(s)||n===null?s:I(`${C(n)}/${s}`))}})})]})}
1
+ import{rt}from"./chunk-ye7bksyy.js";import{l,Ie}from"./chunk-v9nbx36v.js";import{h}from"./chunk-9cqpn67f.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as c}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as a,Fragment as F}from"react/jsx-runtime";function zn(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let i=n.replaceAll("\\","/"),t=i.lastIndexOf("/");return t<=0?"/":i.slice(0,t)}function I(n){let i=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(i.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${i.replace(/\/$/,"")}/${t.join("/")}`}function de({path:n,renderHeader:i,description:t}){let e=l(),{t:r}=e,d=e.readFile,[u,f]=p(null),[v,w]=p(null),[M,N]=p(0);D(()=>{let s=!1;return f(null),w(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!s)f(m)},(m)=>{if(!s)w(String(m))}),()=>{s=!0}},[n,t,M,d]);let k=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:a(P,{children:[o(z,{render:o(x,{variant:"ghost",size:"icon-sm","aria-label":r("plugins.card.moreActions")}),children:o(y,{})}),a(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Ie(e,e.openPath(n)),children:r("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Ie(e,e.revealPath(n)),children:r("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:u===null,onClick:()=>{if(u!==null)Ie(e,e.copyText(u))},children:r("plugins.skills.document.copy")})]})]});return a(F,{children:[i?i(k):o("div",{className:"flex justify-end",children:k}),o(h,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":r("plugins.skills.document.content")},children:v?a("div",{role:"alert",className:"space-y-3",children:[a("p",{className:"text-destructive text-sm break-words",children:[r("plugins.skills.document.error"),": ",v]}),o(x,{variant:"outline",size:"sm",onClick:()=>N((s)=>s+1),children:r("plugins.loadError.retry")})]}):u===null?a("div",{role:"status","aria-label":r("plugins.skills.loading"),className:"space-y-3",children:[o(c,{className:"h-6 w-1/3"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-2/3"})]}):o(rt,{text:zn(u),host:{theme:e.theme,copyLabel:r("plugins.copy"),openLink:(s)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(s)||n===null?s:I(`${C(n)}/${s}`))}})})]})}
2
2
  export{zn,de};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-f1r8wh4e.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function ra(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function fi({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=ra(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
2
- export{ra,fi};
1
+ import{t}from"./chunk-cbp0q0yt.js";import{useLayoutEffect as b,useRef as g,useState as h}from"react";import{jsx as x}from"react/jsx-runtime";var d=[[0,3],[0.1,25],[0.55,58],[0.85,88],[1,90]];function aa(a,u){let e=Math.max(0,(u-a)/45000);for(let n=1;n<d.length;n+=1){let[c,r]=d[n-1],[s,l]=d[n];if(e<=s){let o=(e-c)/(s-c);return Math.floor(r+o*(l-r))}}return Math.min(99,Math.floor(90+10*(1-Math.exp(-1.5*(e-1)))))}function hi({startedAt:a}){let{t:u}=t(),e=g(null),[n,c]=h(3);b(()=>{let s=e.current.ownerDocument,l=!1,o,m=()=>{clearInterval(o),o=void 0},f=()=>{let i=aa(a,Date.now());if(c(i),i===99)m();return i},p=()=>{if(m(),l&&!s.hidden&&f()<99)o=setInterval(f,500)};f();let v=new IntersectionObserver(([i])=>{l=i.isIntersecting,p()});return v.observe(e.current),s.addEventListener("visibilitychange",p),()=>{v.disconnect(),s.removeEventListener("visibilitychange",p),m()}},[a]);let r=u("timeline.imageProgressPercent",{percent:n});return x("span",{ref:e,role:"status",title:r,"aria-label":r,className:"text-xs tabular-nums",children:r})}
2
+ export{aa,hi};
@@ -1,2 +1,2 @@
1
- function _o({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
- export{_o};
1
+ function Po({container:i,target:f,clientX:e,clientY:n,currentScale:r,nextScale:s}){if(r<=0||s<=0)return null;let o=i.getBoundingClientRect(),t=f.getBoundingClientRect();if(t.width===0||t.height===0)return null;let h=e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom,l=h?(e-t.left)/t.width:0.5,a=h?(n-t.top)/t.height:0.5,c=t.width/r,g=t.height/r,m=c*s,u=g*s,d=e-o.left,p=n-o.top,P=i.scrollLeft+(t.left-o.left)+t.width/2,b=i.scrollTop+(t.top-o.top)+t.height/2,C=(l-0.5)*m,x=(a-0.5)*u;return{left:Math.max(0,P+C-d),top:Math.max(0,b+x-p)}}
2
+ export{Po};
@@ -0,0 +1,2 @@
1
+ import{mo}from"./chunk-6f7e67x1.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function hr({host:o,children:t}){return s(n,{value:o,children:t})}function w(){let o=i(n),e={...mo(),...o};if(e.t===void 0||e.i18n===void 0)throw Error("Collection host is missing; mount collections inside SessionListProvider or CollectionHostProvider");return e}function io(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function te(){let o=w();return(t)=>io(o,t)}function ro(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
+ export{hr,w,io,te,ro};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-f1r8wh4e.js";import{Zt}from"./chunk-9rt2pfsm.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Ko({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:Zt(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:Zt(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
2
- export{Ko};
1
+ import{t}from"./chunk-cbp0q0yt.js";import{Zt}from"./chunk-9rt2pfsm.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function qo({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:Zt(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:Zt(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
2
+ export{qo};
@@ -1,2 +1,2 @@
1
- import{o}from"./chunk-f1r8wh4e.js";import{e,f}from"./chunk-6pnsagt4.js";import{QUICK_CHATS_GROUP as I,sessionGroup as z}from"@nyssance/codex-acp-v2/client";import{cn as j}from"cn";import{FolderClosedIcon as g,FolderPlusIcon as G,XIcon as x}from"lucide-react";import{useEffect as O,useMemo as R,useState as S}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as A,DropdownMenuContent as F,DropdownMenuGroup as T,DropdownMenuItem as k,DropdownMenuRadioGroup as B,DropdownMenuRadioItem as E,DropdownMenuSeparator as U,DropdownMenuTrigger as _}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as s,Fragment as H}from"react/jsx-runtime";function M(n){return n.replaceAll("\\","/").replace(/\/+$/,"").split("/").pop()||n}function Gr({cwd:n,onChange:u,preparing:b=!1,recentProjects:w}){let{host:i,client:p}=e(),{t:l}=i,v=o((r)=>r.projectContext),h=o((r)=>r.sessionList),y=R(()=>w??[...new Set([...h].toSorted((r,m)=>(m.updatedAt??"").localeCompare(r.updatedAt??"")).map((r)=>r.cwd))],[w,h]),[c,N]=S(null);O(()=>{if(!p.refreshProjectContext)return;let r=!0;return f(i,p.refreshProjectContext(!0).then((m)=>{if(r)N(m.chatDirectory)})),()=>{r=!1}},[i,p]);let D=[...n!==null?[n]:[],...y.filter((r)=>r!==n)].filter((r)=>r!==c&&(!v||z(v,{cwd:r}).id!==I)),a=n!==null&&n!==c,P=()=>{if(c===null)throw Error("The default draft directory is not ready");u(null)},d=i.chooseFolder;return s(A,{children:[s("div",{"aria-busy":b,className:j("chat-project-picker group/project inline-flex h-7 max-w-full min-w-0 items-center gap-1.5 rounded-full",a?"text-foreground ps-2":"text-foreground/65"),children:[a&&s(C,{variant:"ghost",size:"icon-xs",className:"relative size-4 rounded-full p-0 hover:bg-transparent dark:hover:bg-transparent","aria-label":l("conversation.draft.workOutsideProject"),title:l("conversation.draft.workOutsideProject"),disabled:c===null,onClick:P,children:[t(g,{className:"size-4 group-hover/project:opacity-0"}),t("span",{className:"bg-muted-foreground text-background absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/project:opacity-100",children:t(x,{className:"size-3"})})]}),s(_,{render:t(C,{variant:"ghost",size:"sm",className:j("h-7 min-w-0 shrink gap-1.5 rounded-full py-0 text-sm font-normal text-inherit hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent",a?"ps-0 pe-2":"px-2")}),children:[!a&&t(g,{className:"size-4"}),t("span",{className:"truncate",children:a?M(n):l("conversation.draft.selectProject")})]})]}),s(F,{side:"top",align:"start",className:"w-72 overflow-hidden",children:[D.length>0&&s(H,{children:[t("div",{className:"max-h-64 overflow-y-auto",children:t(B,{value:n??"",onValueChange:u,children:D.map((r)=>s(E,{value:r,title:r,closeOnClick:!0,children:[t(g,{}),t("span",{className:"truncate",children:M(r)})]},r))})}),(d!==void 0||a)&&t(U,{})]}),(d!==void 0||a)&&s(T,{children:[d&&s(k,{onClick:()=>{f(i,d(n).then((r)=>{if(r!==null)u(r)}))},children:[t(G,{}),l("conversation.draft.newProject")]}),c!==null&&a&&s(k,{onClick:P,children:[t(x,{}),l("conversation.draft.workOutsideProject")]})]})]})]})}
2
- export{Gr};
1
+ import{o}from"./chunk-cbp0q0yt.js";import{e,f}from"./chunk-zx63zvpy.js";import{QUICK_CHATS_GROUP as I,sessionGroup as z}from"@nyssance/codex-acp-v2/client";import{cn as j}from"cn";import{FolderClosedIcon as g,FolderPlusIcon as G,XIcon as x}from"lucide-react";import{useEffect as O,useMemo as R,useState as S}from"react";import{Button as C}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as A,DropdownMenuContent as F,DropdownMenuGroup as T,DropdownMenuItem as k,DropdownMenuRadioGroup as B,DropdownMenuRadioItem as E,DropdownMenuSeparator as U,DropdownMenuTrigger as _}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as s,Fragment as H}from"react/jsx-runtime";function M(n){return n.replaceAll("\\","/").replace(/\/+$/,"").split("/").pop()||n}function zr({cwd:n,onChange:u,preparing:b=!1,recentProjects:w}){let{host:i,client:p}=e(),{t:l}=i,v=o((r)=>r.projectContext),h=o((r)=>r.sessionList),y=R(()=>w??[...new Set([...h].toSorted((r,m)=>(m.updatedAt??"").localeCompare(r.updatedAt??"")).map((r)=>r.cwd))],[w,h]),[c,N]=S(null);O(()=>{if(!p.refreshProjectContext)return;let r=!0;return f(i,p.refreshProjectContext(!0).then((m)=>{if(r)N(m.chatDirectory)})),()=>{r=!1}},[i,p]);let D=[...n!==null?[n]:[],...y.filter((r)=>r!==n)].filter((r)=>r!==c&&(!v||z(v,{cwd:r}).id!==I)),a=n!==null&&n!==c,P=()=>{if(c===null)throw Error("The default draft directory is not ready");u(null)},d=i.chooseFolder;return s(A,{children:[s("div",{"aria-busy":b,className:j("chat-project-picker group/project inline-flex h-7 max-w-full min-w-0 items-center gap-1.5 rounded-full",a?"text-foreground ps-2":"text-foreground/65"),children:[a&&s(C,{variant:"ghost",size:"icon-xs",className:"relative size-4 rounded-full p-0 hover:bg-transparent dark:hover:bg-transparent","aria-label":l("conversation.draft.workOutsideProject"),title:l("conversation.draft.workOutsideProject"),disabled:c===null,onClick:P,children:[t(g,{className:"size-4 group-hover/project:opacity-0"}),t("span",{className:"bg-muted-foreground text-background absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/project:opacity-100",children:t(x,{className:"size-3"})})]}),s(_,{render:t(C,{variant:"ghost",size:"sm",className:j("h-7 min-w-0 shrink gap-1.5 rounded-full py-0 text-sm font-normal text-inherit hover:bg-transparent aria-expanded:bg-transparent dark:hover:bg-transparent",a?"ps-0 pe-2":"px-2")}),children:[!a&&t(g,{className:"size-4"}),t("span",{className:"truncate",children:a?M(n):l("conversation.draft.selectProject")})]})]}),s(F,{side:"top",align:"start",className:"w-72 overflow-hidden",children:[D.length>0&&s(H,{children:[t("div",{className:"max-h-64 overflow-y-auto",children:t(B,{value:n??"",onValueChange:u,children:D.map((r)=>s(E,{value:r,title:r,closeOnClick:!0,children:[t(g,{}),t("span",{className:"truncate",children:M(r)})]},r))})}),(d!==void 0||a)&&t(U,{})]}),(d!==void 0||a)&&s(T,{children:[d&&s(k,{onClick:()=>{f(i,d(n).then((r)=>{if(r!==null)u(r)}))},children:[t(G,{}),l("conversation.draft.newProject")]}),c!==null&&a&&s(k,{onClick:P,children:[t(x,{}),l("conversation.draft.workOutsideProject")]})]})]})]})}
2
+ export{zr};
@@ -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 P(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 Fn(e,n){return JSON.stringify(["request_user_input_async",e,n])}function Bi(e){return{selected:e.options?.length?0:null,text:""}}function Jt(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function Gi(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 P(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 Fn(e,n){return JSON.stringify(["request_user_input_async",e,n])}function Gi(e){return{selected:e.options?.length?0:null,text:""}}function Jt(e,n){return n.selected===null?n.text:e.options?.[n.selected]??""}function zi(e){return`<send_user_message_question_reply>
2
2
  ${JSON.stringify([e])}
3
- </send_user_message_question_reply>`}function Dn(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 zi({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&&Jt(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&&Jt(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{P,Fn,Bi,Jt,Gi,Dn,zi};
3
+ </send_user_message_question_reply>`}function Dn(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 Vi({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&&Jt(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&&Jt(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{P,Fn,Gi,Jt,zi,Dn,Vi};
@@ -1,2 +1,2 @@
1
- import{ge}from"./chunk-akvpgx43.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function ro({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:ge(t)}):null}function ao({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(ro,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function At({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(ao,{label:t,shortcut:o}):t})]})}
2
- export{ro,ao,At};
1
+ import{ge}from"./chunk-85nkcdqg.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function ao({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:ge(t)}):null}function so({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(ao,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function At({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(so,{label:t,shortcut:o}):t})]})}
2
+ export{ao,so,At};
@@ -1,2 +1,2 @@
1
- import{l}from"./chunk-g79y6q3f.js";import{F,D,H,O}from"./chunk-w7p443ya.js";import{Item as m}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 ae({skills:o=!1}){let{t}=l();return a("div",{role:"status","aria-label":t(o?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(O,{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((i)=>a(m,{size:"xs",className:"toolbox-row",children:[e(H,{children:e(s,{className:"size-10 rounded-xl"})}),a(D,{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(F,{children:e(s,{className:"size-8 rounded-full"})})]},i))})]})}
1
+ import{l}from"./chunk-v9nbx36v.js";import{F,D,H,O}from"./chunk-w7p443ya.js";import{Item as m}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 ae({skills:o=!1}){let{t}=l();return a("div",{role:"status","aria-label":t(o?"plugins.skills.loading":"plugins.loading"),className:"my-3 flex flex-col gap-4",children:[e(s,{className:"h-4 w-36"}),e(O,{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((i)=>a(m,{size:"xs",className:"toolbox-row",children:[e(H,{children:e(s,{className:"size-10 rounded-xl"})}),a(D,{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(F,{children:e(s,{className:"size-8 rounded-full"})})]},i))})]})}
2
2
  export{ae};
@@ -1,3 +1,3 @@
1
- import{bn,Cn}from"./chunk-ajjd22hb.js";import{P}from"./chunk-n3d2mv93.js";import{nt}from"./chunk-jkyepwr1.js";import{Nn}from"./chunk-kxw57gdb.js";import{t}from"./chunk-f1r8wh4e.js";import{Ri,re,st,Di}from"./chunk-658y6xth.js";import{wn}from"./chunk-0y1c3v1b.js";import{ke}from"./chunk-gwa7hbzr.js";import{Sn}from"./chunk-fqgz93sy.js";import{In}from"./chunk-zmbf0v0n.js";import{mi}from"./chunk-pks7f314.js";import{fi}from"./chunk-8689y4n5.js";import{vi}from"./chunk-acnqnrqb.js";import{yi}from"./chunk-ha2f2cwz.js";import{Pn,Tn}from"./chunk-np76wm1k.js";import{it}from"./chunk-tv1frh1m.js";import{codexMessageError as q,codexTurnError as z,isContentEntry as le,isEmbeddedResource as Z,isImage as ee,isResourceLink as de,isText as ce,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{SparklesIcon as ue}from"lucide-react";import{Fragment as X,memo as pe,useEffect as fe,useState as ye}from"react";import{jsx as i,jsxs as m,Fragment as A}from"react/jsx-runtime";function Y(s){if(ee(s))return`${s.mimeType.toLowerCase()}:${s.data}`;if(Z(s)&&"blob"in s.resource&&s.resource.mimeType?.toLowerCase().startsWith("image/"))return`${s.resource.mimeType.toLowerCase()}:${s.resource.blob}`;return null}function he({item:s}){let{t:n}=t(),l=s.status==="in_progress",[o,g]=ye(()=>Date.now()-s.at>=1e4);return fe(()=>{if(!l)return;let a=Math.max(0,s.at+1e4-Date.now());if(g(a===0),a===0)return;let h=setTimeout(()=>g(!0),a);return()=>clearTimeout(h)},[s.id,s.at,l]),m("div",{className:"codex-context-compaction",children:[i(ue,{"aria-hidden":"true"}),i("span",{children:s.status==="completed"?n("stream.codex.contextCompacted"):s.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:s,entry:n,terminals:l,streaming:o,streamingThoughtId:g}){let{t:a}=t();switch(n.kind){case"activity":return i(wn,{sessionId:s,items:n.items,terminals:l,streamingThoughtId:g});case"text":return P(n.item._meta).length>0?i(In,{sessionId:s,item:n.item}):i(ke,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return i(vi,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(Pn,{children:[i("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&i("div",{children:n.item.error})]});return i(he,{item:n.item})}}function xe({sessionId:s,turn:n,terminals:l,active:o,blocked:g=!1,continued:a=!1,edits:h=n.edits,activityItems:M=n.items,workStartedAt:te=n.startedAt,isLast:F,error:k,interrupted:L,retry:G,retrying:p,extraWork:d=null,answerActions:O,footer:ne}){let{t:c}=t(),b=n.errors.map((e)=>{let r=q(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let E=G?.turnId===ge(e)?G:void 0;return i(Tn,{error:r,retry:E},`${e.id}:${E?.delaySeconds??"manual"}`)});if(F&&k!==null&&!n.errors.some((e)=>{let r=q(e);return r!==null&&r.stopReason===k.stopReason&&z(r).message===z(k).message}))b.push(i(Tn,{error:k},"current-run-error"));let x=b.length>0?i("div",{className:"codex-turn-errors",children:b}):null,C=n.items.filter(Nn);if(d===null&&C.length>0&&C.length===n.items.length)return m(A,{children:[i(wn,{sessionId:s,items:C,terminals:l,streamingThoughtId:null}),x]});let T=n.work,w=T.length>0&&T.every((e)=>e.kind==="compaction");if(d===null&&(Ri(n)||w&&n.final.length===0))return m(A,{children:[i("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),x]});let W=st(n),D=n.final.filter((e)=>P(e._meta).length===0).map((e)=>re({...e,content:Sn(e.content,n.items)})).join(`
2
- `),I=o?null:it(n,"assistant"),B=n.items.filter((e)=>e.kind==="tool"&&(e.name==="image_generation"||e.name==="alwith_client_generate_image"||e.name==="generate_image"||e.name?.endsWith(".generate_image"))&&(e.status==="pending"||e.status==="in_progress")),H=new Set(n.final.flatMap((e)=>e.content.map(Y).filter((r)=>r!==null))),f=n.items.flatMap((e)=>{if(!nt(e))return[];return e.content.filter(le).flatMap((r,E)=>{let u=r.content,ae=ee(u),me=de(u)||Z(u)&&"blob"in u.resource;if(!ae&&!me)return[];let S=Y(u);if(S!==null){if(H.has(S))return[];H.add(S)}return[{key:`${e.id}:${E}`,block:u}]})}),K=n.final.some((e)=>P(e._meta).length===0&&e.content.some((r)=>!ce(r)||r.text.trim().length>0)),ie=B.length>0||f.length>0||w||K||n.final.some((e)=>P(e._meta).length>0),v=n.items.findIndex((e)=>n.final.includes(e)),R=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),Q=T.filter((e)=>v===-1||R(e)<v),se=T.filter((e)=>v!==-1&&R(e)>v),oe=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...se.map((e)=>({kind:"work",entry:e,index:R(e)}))].toSorted((e,r)=>e.index-r.index),V=!o&&!a&&(D.trim().length>0?i(bn,{text:D,isMostRecentTurn:F,time:I,afterCopy:O}):m("div",{className:"flex items-center gap-0.5",children:[O,I&&i("span",{className:"codex-user-time ms-1",title:I.full,children:I.short})]})),y=yi({...n,items:M},{running:o,blocked:g,retrying:p!==void 0}),j=y.kind==="reasoning"?y.ownerKey??null:null,J=y.kind==="thinking",_=Di({...n,items:M}),U=o&&!K||d?.active===!0;return m(A,{children:[i(Cn,{stateKey:JSON.stringify([s,n.replayed?"history":"live",n.key]),active:U,defaultExpanded:U||d?.defaultExpanded===!0||!n.replayed&&(L||W),..._,durationMs:d?.active?void 0:_.durationMs,startedAt:_.startedAt??te,loading:(J||y.kind==="working")&&n.work.length===0&&d===null,loadingLabel:y.kind==="working"?c("stream.codex.working"):void 0,work:[...a||w?[]:Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:o,streamingThoughtId:j},e.key)),...d===null?[]:[i(X,{children:d.content},"additional-work")]],answer:ie||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||w)&&Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),oe.map((e)=>{if(e.kind==="work")return i(N,{sessionId:s,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:j},e.entry.key);let r=e.item;return m(X,{children:[P(r._meta).length>0?i(In,{sessionId:s,item:r}):i(ke,{content:Sn(r.content,n.items),messageId:r.id,streaming:o}),r===n.final.at(-1)&&f.length===0&&V]},r.id)}),B.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":c(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[i("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&i(fi,{startedAt:e.at}),!o&&c("timeline.imageStopped")]})]},e.id)),f.length>0&&i("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:f.map((e)=>i(ke,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),(n.final.length===0||f.length>0)&&V]}):null,footer:m(A,{children:[J&&n.work.length>0&&i("div",{className:"codex-pending-message py-2",role:"status",children:i("span",{className:"codex-activity-running",children:c("message.thinking")})}),ne,h.length>0&&!o&&!a&&i(mi,{items:h}),L&&!W&&i("div",{className:"codex-interrupted-turn",role:"status",children:c("timeline.interrupted")}),!o&&x]})}),o&&p!==void 0&&i("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return e===void 0?c("timeline.capacityReconnecting"):c("timeline.capacityReconnectingProgress",{progress:e})})():p.message}),o&&x]})}var li=pe(xe);
3
- export{li};
1
+ import{bn,Cn}from"./chunk-ktknydpy.js";import{P}from"./chunk-1jae0var.js";import{nt}from"./chunk-jkyepwr1.js";import{Nn}from"./chunk-q4rad054.js";import{t}from"./chunk-cbp0q0yt.js";import{Fi,re,st,Hi}from"./chunk-ydxrj4as.js";import{wn}from"./chunk-evs7bhpp.js";import{ke}from"./chunk-4pxxxt8s.js";import{Sn}from"./chunk-fqgz93sy.js";import{In}from"./chunk-3svrvg8g.js";import{gi}from"./chunk-jnpb9sqy.js";import{hi}from"./chunk-0e6fsbhg.js";import{yi}from"./chunk-gp0bxakd.js";import{xi}from"./chunk-va11ek5z.js";import{Pn,Tn}from"./chunk-nrz6w8rd.js";import{it}from"./chunk-tv1frh1m.js";import{codexMessageError as q,codexTurnError as z,isContentEntry as le,isEmbeddedResource as Z,isImage as ee,isResourceLink as de,isText as ce,nativeTurnId as ge}from"@nyssance/codex-acp-v2/client";import{SparklesIcon as ue}from"lucide-react";import{Fragment as X,memo as pe,useEffect as fe,useState as ye}from"react";import{jsx as i,jsxs as m,Fragment as A}from"react/jsx-runtime";function Y(s){if(ee(s))return`${s.mimeType.toLowerCase()}:${s.data}`;if(Z(s)&&"blob"in s.resource&&s.resource.mimeType?.toLowerCase().startsWith("image/"))return`${s.resource.mimeType.toLowerCase()}:${s.resource.blob}`;return null}function he({item:s}){let{t:n}=t(),l=s.status==="in_progress",[o,g]=ye(()=>Date.now()-s.at>=1e4);return fe(()=>{if(!l)return;let a=Math.max(0,s.at+1e4-Date.now());if(g(a===0),a===0)return;let h=setTimeout(()=>g(!0),a);return()=>clearTimeout(h)},[s.id,s.at,l]),m("div",{className:"codex-context-compaction",children:[i(ue,{"aria-hidden":"true"}),i("span",{children:s.status==="completed"?n("stream.codex.contextCompacted"):s.status==="cancelled"?n("timeline.interrupted"):n(o?"timeline.compactingWithDelayNotice":"timeline.compacting")})]})}function N({sessionId:s,entry:n,terminals:l,streaming:o,streamingThoughtId:g}){let{t:a}=t();switch(n.kind){case"activity":return i(wn,{sessionId:s,items:n.items,terminals:l,streamingThoughtId:g});case"text":return P(n.item._meta).length>0?i(In,{sessionId:s,item:n.item}):i(ke,{content:n.item.content,messageId:n.item.id,streaming:o});case"plan":return i(yi,{plan:n.item.plan});case"compaction":if(n.item.status==="failed")return m(Pn,{children:[i("div",{children:a("timeline.compactionFailed")}),n.item.error!==null&&i("div",{children:n.item.error})]});return i(he,{item:n.item})}}function xe({sessionId:s,turn:n,terminals:l,active:o,blocked:g=!1,continued:a=!1,edits:h=n.edits,activityItems:M=n.items,workStartedAt:te=n.startedAt,isLast:F,error:k,interrupted:L,retry:G,retrying:p,extraWork:d=null,answerActions:O,footer:ne}){let{t:c}=t(),b=n.errors.map((e)=>{let r=q(e);if(r===null)throw Error("Turn error item is missing its diagnostics");let E=G?.turnId===ge(e)?G:void 0;return i(Tn,{error:r,retry:E},`${e.id}:${E?.delaySeconds??"manual"}`)});if(F&&k!==null&&!n.errors.some((e)=>{let r=q(e);return r!==null&&r.stopReason===k.stopReason&&z(r).message===z(k).message}))b.push(i(Tn,{error:k},"current-run-error"));let x=b.length>0?i("div",{className:"codex-turn-errors",children:b}):null,C=n.items.filter(Nn);if(d===null&&C.length>0&&C.length===n.items.length)return m(A,{children:[i(wn,{sessionId:s,items:C,terminals:l,streamingThoughtId:null}),x]});let T=n.work,w=T.length>0&&T.every((e)=>e.kind==="compaction");if(d===null&&(Fi(n)||w&&n.final.length===0))return m(A,{children:[i("div",{role:"status",className:"text-muted-foreground flex min-w-0 flex-col gap-2 py-2 text-sm",children:n.work.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key))}),x]});let W=st(n),D=n.final.filter((e)=>P(e._meta).length===0).map((e)=>re({...e,content:Sn(e.content,n.items)})).join(`
2
+ `),I=o?null:it(n,"assistant"),B=n.items.filter((e)=>e.kind==="tool"&&(e.name==="image_generation"||e.name==="alwith_client_generate_image"||e.name==="generate_image"||e.name?.endsWith(".generate_image"))&&(e.status==="pending"||e.status==="in_progress")),H=new Set(n.final.flatMap((e)=>e.content.map(Y).filter((r)=>r!==null))),f=n.items.flatMap((e)=>{if(!nt(e))return[];return e.content.filter(le).flatMap((r,E)=>{let u=r.content,ae=ee(u),me=de(u)||Z(u)&&"blob"in u.resource;if(!ae&&!me)return[];let S=Y(u);if(S!==null){if(H.has(S))return[];H.add(S)}return[{key:`${e.id}:${E}`,block:u}]})}),K=n.final.some((e)=>P(e._meta).length===0&&e.content.some((r)=>!ce(r)||r.text.trim().length>0)),ie=B.length>0||f.length>0||w||K||n.final.some((e)=>P(e._meta).length>0),v=n.items.findIndex((e)=>n.final.includes(e)),R=(e)=>n.items.indexOf(e.kind==="activity"?e.items[0]:e.item),Q=T.filter((e)=>v===-1||R(e)<v),se=T.filter((e)=>v!==-1&&R(e)>v),oe=[...n.final.map((e)=>({kind:"answer",item:e,index:n.items.indexOf(e)})),...se.map((e)=>({kind:"work",entry:e,index:R(e)}))].toSorted((e,r)=>e.index-r.index),V=!o&&!a&&(D.trim().length>0?i(bn,{text:D,isMostRecentTurn:F,time:I,afterCopy:O}):m("div",{className:"flex items-center gap-0.5",children:[O,I&&i("span",{className:"codex-user-time ms-1",title:I.full,children:I.short})]})),y=xi({...n,items:M},{running:o,blocked:g,retrying:p!==void 0}),j=y.kind==="reasoning"?y.ownerKey??null:null,J=y.kind==="thinking",_=Hi({...n,items:M}),U=o&&!K||d?.active===!0;return m(A,{children:[i(Cn,{stateKey:JSON.stringify([s,n.replayed?"history":"live",n.key]),active:U,defaultExpanded:U||d?.defaultExpanded===!0||!n.replayed&&(L||W),..._,durationMs:d?.active?void 0:_.durationMs,startedAt:_.startedAt??te,loading:(J||y.kind==="working")&&n.work.length===0&&d===null,loadingLabel:y.kind==="working"?c("stream.codex.working"):void 0,work:[...a||w?[]:Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:o,streamingThoughtId:j},e.key)),...d===null?[]:[i(X,{children:d.content},"additional-work")]],answer:ie||a?m("div",{className:"flex min-w-0 flex-col gap-3",children:[(a||w)&&Q.map((e)=>i(N,{sessionId:s,entry:e,terminals:l,streaming:!1,streamingThoughtId:null},e.key)),oe.map((e)=>{if(e.kind==="work")return i(N,{sessionId:s,entry:e.entry,terminals:l,streaming:o,streamingThoughtId:j},e.entry.key);let r=e.item;return m(X,{children:[P(r._meta).length>0?i(In,{sessionId:s,item:r}):i(ke,{content:Sn(r.content,n.items),messageId:r.id,streaming:o}),r===n.final.at(-1)&&f.length===0&&V]},r.id)}),B.map((e)=>m("div",{className:"codex-image-generation",role:"status","aria-label":c(o?"timeline.imageGenerating":"timeline.imageStopped"),"aria-busy":o,children:[i("div",{className:"codex-image-generation-texture","aria-hidden":"true"}),m("span",{className:"codex-image-generation-status",children:[o&&i(hi,{startedAt:e.at}),!o&&c("timeline.imageStopped")]})]},e.id)),f.length>0&&i("div",{className:"codex-reply-artifacts flex min-w-0 flex-col gap-3",children:f.map((e)=>i(ke,{content:[e.block],messageId:e.key,streaming:!1},e.key))}),(n.final.length===0||f.length>0)&&V]}):null,footer:m(A,{children:[J&&n.work.length>0&&i("div",{className:"codex-pending-message py-2",role:"status",children:i("span",{className:"codex-activity-running",children:c("message.thinking")})}),ne,h.length>0&&!o&&!a&&i(gi,{items:h}),L&&!W&&i("div",{className:"codex-interrupted-turn",role:"status",children:c("timeline.interrupted")}),!o&&x]})}),o&&p!==void 0&&i("div",{className:"text-muted-foreground py-2 text-sm",role:"status",children:p.capacity?(()=>{let e=/Reconnecting(?:\.\.\.)?\s+(\d+\/\d+)/.exec(p.message)?.[1];return e===void 0?c("timeline.capacityReconnecting"):c("timeline.capacityReconnectingProgress",{progress:e})})():p.message}),o&&x]})}var ci=pe(xe);
3
+ export{ci};
@@ -1,2 +1,2 @@
1
- import{R}from"./chunk-p38vws4a.js";import{e}from"./chunk-6pnsagt4.js";import{jo}from"./chunk-nm4dtceb.js";import{BlocksIcon as I}from"lucide-react";import{useRef as h,useState as a}from"react";import{DropdownMenu as k,DropdownMenuContent as A,DropdownMenuGroup as C,DropdownMenuItem as i,DropdownMenuTrigger as v}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as B}from"react/jsx-runtime";function Io({disabled:b,onSelect:w}){let{client:l,host:r}=e(),[M,D]=a(!1),[d,y]=a([]),[u,t]=a("loading"),p=h(0),m=l.installedApps?.bind(l);if(!m)return null;let c=(n)=>{D(n);let f=++p.current;if(!n)return;t("loading"),m().then(({apps:s})=>{if(f!==p.current)return;y(s.filter((g)=>g.enabled&&g.callable)),t("ready")},(s)=>{if(f!==p.current)return;t("error"),r.reportError?.(s)})};return B(k,{open:M,onOpenChange:c,children:[o(v,{render:o(R,{disabled:b,"aria-label":r.t("composer.apps"),title:r.t("composer.apps"),children:o(I,{})})}),o(A,{align:"start",side:"top",className:"max-h-72 min-w-48 overflow-y-auto",children:o(C,{children:u!=="ready"?o(i,{disabled:!0,children:r.t(u==="loading"?"composer.appsLoading":"composer.appsFailed")}):d.length===0?o(i,{disabled:!0,children:r.t("composer.appsEmpty")}):d.map((n)=>o(i,{onClick:()=>{w(jo(n)),c(!1)},children:n.runtimeName||n.id},n.id))})})]})}
2
- export{Io};
1
+ import{R}from"./chunk-xrsa8v3g.js";import{e}from"./chunk-zx63zvpy.js";import{$o}from"./chunk-yathdy79.js";import{BlocksIcon as I}from"lucide-react";import{useRef as h,useState as a}from"react";import{DropdownMenu as k,DropdownMenuContent as A,DropdownMenuGroup as C,DropdownMenuItem as i,DropdownMenuTrigger as v}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as B}from"react/jsx-runtime";function No({disabled:b,onSelect:w}){let{client:l,host:r}=e(),[M,D]=a(!1),[d,y]=a([]),[u,t]=a("loading"),p=h(0),m=l.installedApps?.bind(l);if(!m)return null;let c=(n)=>{D(n);let f=++p.current;if(!n)return;t("loading"),m().then(({apps:s})=>{if(f!==p.current)return;y(s.filter((g)=>g.enabled&&g.callable)),t("ready")},(s)=>{if(f!==p.current)return;t("error"),r.reportError?.(s)})};return B(k,{open:M,onOpenChange:c,children:[o(v,{render:o(R,{disabled:b,"aria-label":r.t("composer.apps"),title:r.t("composer.apps"),children:o(I,{})})}),o(A,{align:"start",side:"top",className:"max-h-72 min-w-48 overflow-y-auto",children:o(C,{children:u!=="ready"?o(i,{disabled:!0,children:r.t(u==="loading"?"composer.appsLoading":"composer.appsFailed")}):d.length===0?o(i,{disabled:!0,children:r.t("composer.appsEmpty")}):d.map((n)=>o(i,{onClick:()=>{w($o(n)),c(!1)},children:n.runtimeName||n.id},n.id))})})]})}
2
+ export{No};
@@ -1,2 +1,2 @@
1
- var s=new Map,a=new Map,f=new Map;function Vo(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function z(t,r){let n=s.get(t);if(!n)return;let e=r(n.attachments);s.set(t,{...n,attachments:e}),a.get(t)?.(e)}function Kt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function Hr(t){for(;;){let e=s.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=s.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function Or(t,r){if(r===null)s.delete(t);else s.set(t,r)}var i=new Map;function qt(t,r){if(i.has(t))throw Error("A composer is already registered for this session");return i.set(t,r),()=>{if(i.get(t)===r)i.delete(t)}}function Ur(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=i.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=s.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),s.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
2
- export{s,Vo,z,Kt,Hr,Or,qt,Ur};
1
+ var s=new Map,a=new Map,f=new Map;function jo(t,r){if(a.has(t))throw Error("An attachment writer is already registered for this session");return a.set(t,r),()=>{if(a.get(t)===r)a.delete(t)}}function z(t,r){let n=s.get(t);if(!n)return;let e=r(n.attachments);s.set(t,{...n,attachments:e}),a.get(t)?.(e)}function Kt(t,r){f.set(t,r),r.finally(()=>{if(f.get(t)===r)f.delete(t)})}async function Or(t){for(;;){let e=s.get(t)?.attachments.flatMap((c)=>{let m=f.get(c.id);return m?[m]:[]})??[];if(!e.length)break;await Promise.all(e)}let r=s.get(t);if(!r)return null;let n=await Promise.all(r.attachments.map(async(e)=>{if(!e.url.startsWith("blob:"))return e;let c=await fetch(e.url);if(!c.ok)throw Error("Cannot read draft image");let m=await c.blob(),l=await new Promise((g,p)=>{let o=new FileReader;o.onload=()=>g(o.result),o.onerror=()=>p(o.error),o.readAsDataURL(m)});return{...e,url:l}}));return{text:r.text,mentions:[...r.mentions],attachments:n,modelId:r.modelId}}function Ur(t,r){if(r===null)s.delete(t);else s.set(t,r)}var i=new Map;function qt(t,r){if(i.has(t))throw Error("A composer is already registered for this session");return i.set(t,r),()=>{if(i.get(t)===r)i.delete(t)}}function Br(t,r){if(typeof r!=="string"||!r.trim())throw Error("The draft is empty");let n=i.get(t);if(!n)throw Error("The session's composer is not open; open the session first");let e=s.get(t);if(e&&(e.text.length||e.attachments.length||e.mentions.length))throw Error("The composer already has a draft; send or clear it first");n(r),s.set(t,{text:r,attachments:[],mentions:[],modelId:e?.modelId??null})}
2
+ export{s,jo,z,Kt,Or,Ur,qt,Br};
@@ -1,3 +1,3 @@
1
- import{Qo}from"./chunk-qm649qdv.js";import{Wo}from"./chunk-x6yxbndc.js";import{Zo}from"./chunk-bt0t1pev.js";import{et}from"./chunk-a8j61zs9.js";import{o}from"./chunk-f1r8wh4e.js";import{e}from"./chunk-6pnsagt4.js";import{isContentEntry as f,isDiffEntry as g,isFormElicitation as x,isText as h,isToolCallSubject as b,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as a,jsxs as m}from"react/jsx-runtime";function Fe(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let n=t._meta?.codex;if(typeof n!=="object"||n===null)return null;let s=n.description;return typeof s==="string"?s:null}function A(t){let n=t.rawInput;if(typeof n!=="object"||n===null)return null;let s=n.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let n of t.content??[])if(g(n)&&n.patch&&n.patch.text.length>0)return n.patch.text;return null}function R(t){return(t.content??[]).filter(f).map((n)=>h(n.content)?n.content.text:"").filter((n)=>n.length>0).join(`
2
- `)}function T({subject:t,requestTitle:n}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==n&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(et,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,n){let{host:s,client:r}=e();return(l)=>{try{if(n)n(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(Qo,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:n,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function Je({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=o((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(Wo,{requestId:t.id,schema:t.params.requestedSchema,message:i?.subagent?`${i.title??r.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:n,t:r.t,onRespond:l})}function we({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s);if(t.kind==="permission")return a(C,{action:t,total:n,onRespond:s});if(Fe(t))return a(Je,{action:t,total:n??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(Zo,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
1
+ import{Yo}from"./chunk-3b6m3wgn.js";import{Zo}from"./chunk-6k7249zb.js";import{Qo}from"./chunk-wq9hmwvb.js";import{et}from"./chunk-91ppvzvv.js";import{o}from"./chunk-cbp0q0yt.js";import{e}from"./chunk-zx63zvpy.js";import{isContentEntry as f,isDiffEntry as g,isFormElicitation as x,isText as h,isToolCallSubject as b,isUrlElicitation as w}from"@nyssance/codex-acp-v2/client";import{jsx as a,jsxs as m}from"react/jsx-runtime";function Fe(t){return t.kind==="elicitation"&&x(t.params)}function y(t){let n=t._meta?.codex;if(typeof n!=="object"||n===null)return null;let s=n.description;return typeof s==="string"?s:null}function A(t){let n=t.rawInput;if(typeof n!=="object"||n===null)return null;let s=n.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let n of t.content??[])if(g(n)&&n.patch&&n.patch.text.length>0)return n.patch.text;return null}function R(t){return(t.content??[]).filter(f).map((n)=>h(n.content)?n.content.text:"").filter((n)=>n.length>0).join(`
2
+ `)}function T({subject:t,requestTitle:n}){let{host:s}=e();if(!b(t))return null;let r=t.toolCall,l=A(r),i=v(r),c=R(r),p=s.toolTitle?.(r)??r.title;return m("div",{className:"flex flex-col gap-2",children:[p&&p!==n&&l===null&&a("div",{className:"text-sm font-medium",children:p}),l!==null&&m("pre",{className:"bg-muted overflow-x-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[a("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),i!==null&&a("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:a(et,{patch:i,theme:s.theme})}),i===null&&l===null&&c.length>0&&a("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:c}),(r.locations??[]).length>0&&a("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(r.locations??[]).map((u)=>a("li",{className:"truncate font-mono",children:u.path},`${u.path}:${u.line??""}`))})]})}function d(t,n){let{host:s,client:r}=e();return(l)=>{try{if(n)n(t.id,l);else r.respond(t.id,l)}catch(i){if(s.reportError)s.reportError(i);else console.error(i)}}}function C({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=t.params,c=r.permissionTitle?.(i)??i.title;return m(Yo,{requestId:t.id,title:c,alwaysLabel:r.t("approval.always"),autoFocus:"if-idle",total:n,options:i.options.map((p)=>({...p,description:y(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[i.description&&a("div",{className:"text-muted-foreground mt-0.5 text-xs",children:i.description}),i.subject&&a(T,{subject:i.subject,requestTitle:c})]})}function Je({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s),i=o((c)=>t.sessionId===null?void 0:c.sessions[t.sessionId]);return a(Zo,{requestId:t.id,schema:t.params.requestedSchema,message:i?.subagent?`${i.title??r.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:n,t:r.t,onRespond:l})}function we({action:t,total:n,onRespond:s}){let{host:r}=e(),l=d(t,s);if(t.kind==="permission")return a(C,{action:t,total:n,onRespond:s});if(Fe(t))return a(Je,{action:t,total:n??1,onRespond:s});let i=t.params;if(!w(i))throw Error("Unsupported elicitation mode");return a(Qo,{message:i.message,url:i.url,t:r.t,onOpen:r.openLink,onRespond:(c)=>l(c==="cancel"?{action:"cancel"}:{action:"decline"})})}
3
3
  export{Fe,Je,we};
@@ -1,2 +1,2 @@
1
- function ki(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Si(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
- export{ki,Si};
1
+ function Si(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function _i(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
+ export{Si,_i};
@@ -1,2 +1,2 @@
1
- import{c}from"./chunk-k7y6dqf2.js";import{r}from"./chunk-a8gzs651.js";import{m,u}from"./chunk-3m59n5gr.js";import{We}from"./chunk-fbmbc4wt.js";import{cn as s}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as p}from"lucide-react";import{DropdownMenu as d,DropdownMenuContent as g,DropdownMenuItem as f,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as L}from"react/jsx-runtime";function Mr({onCollapseAll:i}){let{t:n}=r();return L(d,{children:[o(w,{render:o(We,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(p,{})}),o(g,{align:"end",className:"w-52",children:o(f,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Ar({screen:i,onSwitch:n}){let{t:e}=r(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(u,{className:s(c,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(m,{children:i==="main"?o(a,{}):o(l,{})})})}
2
- export{Mr,Ar};
1
+ import{c}from"./chunk-k7y6dqf2.js";import{r}from"./chunk-6f7e67x1.js";import{m,u}from"./chunk-mma530jr.js";import{We}from"./chunk-tsfpx3fp.js";import{cn as s}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as p}from"lucide-react";import{DropdownMenu as d,DropdownMenuContent as g,DropdownMenuItem as f,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as L}from"react/jsx-runtime";function Ar({onCollapseAll:i}){let{t:n}=r();return L(d,{children:[o(w,{render:o(We,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(p,{})}),o(g,{align:"end",className:"w-52",children:o(f,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Er({screen:i,onSwitch:n}){let{t:e}=r(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(u,{className:s(c,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(m,{children:i==="main"?o(a,{}):o(l,{})})})}
2
+ export{Ar,Er};
@@ -1,2 +1,2 @@
1
- import{C,rn}from"./chunk-70bm3f7n.js";import{bt}from"./chunk-84gk74hf.js";import{useEffect as p,useRef as P,useState as u}from"react";var Zn="providers:changed",Qn="providers:managed-revoked",i=(e)=>e;function rr(){return{read:()=>i(C.providersRead()),save:(e,r,t)=>i(C.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(C.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(C.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>C.providersTest({providerId:e}),apply:()=>i(C.providersApply()),onChanged:(e)=>rn[Zn].listen((r)=>e(r.payload))}}function ar(){return{bind:(e)=>C.providersAccountBind({account:e}),refresh:(e,r)=>i(C.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await C.providersClearManaged()},onRevoked:(e)=>rn[Qn].listen((r)=>e(r.payload.sessionIds))}}async function vt(e){try{return await e.apply()}catch(r){if(!bt(r))throw r;return e.read()}}function yt(e,r=console.error){let[t,d]=u(null),a=P(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
- export{Zn,Qn,rr,ar,vt,yt};
1
+ import{C,rn}from"./chunk-mveefs0j.js";import{bt}from"./chunk-dnn1fcg8.js";import{useEffect as p,useRef as P,useState as u}from"react";var Zn="providers:changed",Qn="providers:managed-revoked",i=(e)=>e;function ar(){return{read:()=>i(C.providersRead()),save:(e,r,t)=>i(C.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(C.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(C.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>C.providersTest({providerId:e}),apply:()=>i(C.providersApply()),onChanged:(e)=>rn[Zn].listen((r)=>e(r.payload))}}function sr(){return{bind:(e)=>C.providersAccountBind({account:e}),refresh:(e,r)=>i(C.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await C.providersClearManaged()},onRevoked:(e)=>rn[Qn].listen((r)=>e(r.payload.sessionIds))}}async function vt(e){try{return await e.apply()}catch(r){if(!bt(r))throw r;return e.read()}}function yt(e,r=console.error){let[t,d]=u(null),a=P(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
+ export{Zn,Qn,ar,sr,vt,yt};
@@ -1,5 +1,5 @@
1
- import{isText as f}from"@nyssance/codex-acp-v2/client";import{useRef as p}from"react";function To(l,c){let i=p(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==l.id||e.value!==n.value))i.current=null,e=null;let u=t.key==="ArrowUp";if(u?n.value.slice(0,n.selectionStart).includes(`
1
+ import{isText as f}from"@nyssance/codex-acp-v2/client";import{useRef as p}from"react";function Io(l,c){let i=p(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==l.id||e.value!==n.value))i.current=null,e=null;let u=t.key==="ArrowUp";if(u?n.value.slice(0,n.selectionStart).includes(`
2
2
  `):n.value.slice(n.selectionEnd).includes(`
3
3
  `))return;if(!e){if(!u||n.value!=="")return;let s=l.items.flatMap((o)=>{if(o.kind!=="user")return[];let a=o.content.filter(f).map((d)=>d.text).join(`
4
4
  `);return a.trim()?[a]:[]});if(!s.length)return;e={sessionId:l.id,entries:s,index:s.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(u?-1:1)));let r=e.entries[e.index]??"";if(e.value=r,c(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
- export{To};
5
+ export{Io};
@@ -1,2 +1,2 @@
1
- import{Yo}from"./chunk-3twka9f7.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function Qo({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=Yo(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}
2
- export{Qo};
1
+ import{Xo}from"./chunk-wsny5ye8.js";import{autoUpdate as L}from"@floating-ui/dom";import{cn as I}from"cn";import{CheckCheckIcon as M,CheckIcon as h,ShieldXIcon as V,XIcon as F}from"lucide-react";import{useCallback as H,useEffect as N,useId as T,useLayoutEffect as _,useRef as S,useState as f}from"react";import{createPortal as z}from"react-dom";import{jsx as i,jsxs as u}from"react/jsx-runtime";var U={allow_once:{icon:h},allow_always:{icon:M},reject_once:{icon:F},reject_always:{icon:V}};function Yo({requestId:p,options:D,title:E,children:P,total:w=1,alwaysLabel:j="always",autoFocus:y="always",anchorRef:n,onRespond:r}){let b=T(),[a,g]=f(0),[s,v]=f(null),[l,A]=f(null),x=S(null),c=Xo(D);N(()=>{g(0)},[p]),N(()=>{let e=document.activeElement;if(y==="always"||e===null||e===document.body)x.current?.focus()},[p,l,y]);let d=H(()=>{let e=n?.current;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0){let o=Math.min(640,window.innerWidth*0.9);v({left:(window.innerWidth-o)/2,width:o,bottom:24});return}v({left:t.left,width:t.width,bottom:window.innerHeight-t.bottom+20})},[n]);if(_(()=>{if(!n)return;let e=0,t=()=>{if(n.current)d();else e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)},[p,n,d]),_(()=>{let e=n?.current;if(!e||!l)return;return L(e,l,d,{animationFrame:!0})},[n,l,d]),n&&!s)return null;let k=u("div",{ref:A,"data-overlay":"permission-request",className:I("bg-card border-border overflow-hidden rounded-lg border",n&&"fixed z-50"),style:n&&s?{left:s.left,width:s.width,bottom:s.bottom}:void 0,children:[u("div",{className:"border-border border-b px-3 py-2",children:[u("div",{className:"flex items-center justify-between gap-2",children:[i("div",{id:b,className:"text-foreground text-sm font-medium",children:E}),w>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${w}`})]}),P]}),i("div",{role:"listbox","aria-labelledby":b,tabIndex:0,ref:x,onKeyDown:(e)=>{let t=c.length;if(t===0&&e.key!=="Escape")return;if(e.key==="ArrowDown"||e.key==="ArrowUp")e.preventDefault(),g((o)=>e.key==="ArrowDown"?(o+1)%t:(o-1+t)%t);else if(e.key==="Enter")e.preventDefault(),r(c[a].optionId);else if(e.key==="Escape")e.preventDefault(),r(null);else if(/^[1-9]$/.test(e.key)&&Number(e.key)<=t)e.preventDefault(),r(c[Number(e.key)-1].optionId)},className:"outline-none",children:c.map((e,t)=>{let o=e.kind??"allow_once",C=U[o]?.icon??h,K=o==="allow_always"||o==="reject_always",O=o==="reject_once"||o==="reject_always";return u("div",{role:"option",tabIndex:-1,"aria-selected":t===a,title:e.description,onClick:()=>void r(e.optionId),onKeyDown:(m)=>{if(m.key==="Enter"||m.key===" ")m.preventDefault(),m.stopPropagation(),r(e.optionId)},className:I("flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm select-none",t===a?"bg-ring text-accent-foreground":"text-foreground",O&&t!==a&&"text-muted-foreground"),children:[i("span",{className:"min-w-3 text-xs opacity-70",children:t+1}),i(C,{className:"size-3.5 shrink-0 opacity-80"}),i("span",{className:"min-w-0 flex-1 truncate",children:e.name}),K&&i("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[10px] tracking-wide uppercase",children:j})]},e.optionId)})})]});return n?z(k,document.body):k}
2
+ export{Yo};
@@ -1,2 +1,2 @@
1
- import{Ii}from"./chunk-1940kkcm.js";import{useCallback as xe,useEffect as P,useLayoutEffect as ye,useMemo as X,useRef as I,useState as E}from"react";import"@alwith/module-chat/navigation-rail.css";import{jsx as T,jsxs as Ne,Fragment as ke}from"react/jsx-runtime";var Se=4,ge=10;function we(h,x){let v=new Map(x.flatMap((c)=>c.itemIds.map((S)=>[S,c.key]))),p=Array(h.length),C;for(let c=h.length-1;c>=0;c--)C=v.get(h[c])??C,p[c]=C;let A=Math.max(-1,...x.map((c)=>c.key))+1,B=new Set,n=[];for(let[c,S]of h.entries()){let w=v.get(S),m=n.at(-1);if(!m||w!==void 0&&w!==m.key||w===void 0&&m.itemIds.length>=64&&p[c]!==m.key){let y=w!==void 0&&!B.has(w)?w:A++;m={key:y,startIndex:c,itemIds:[]},n.push(m),B.add(y)}m.itemIds.push(S)}return n}function fe(h,x){if(h.size!==x.size)return!1;for(let v of h)if(!x.has(v))return!1;return!0}function Ti({audio:h,beforeReveal:x,ensureItemMounted:v,items:p,onPreviewItem:C,renderPreview:A,onRevealError:B,scrollRoot:n,targetTopMarginPx:c=16}){let[S,w]=E(()=>{let e=p.at(-1);return new Set(e===void 0?[]:[e.id])}),[m,y]=E(null),[_,O]=E(null),[Z,R]=E(!1),[j,pe]=E(()=>new Set),[ve,be]=E(!0),[Ie,F]=E(null),{installUnlock:ee,preload:te,playSequence:ne}=h,K=I(null),M=I(null),U=I(!1),H=I(null),L=I(0),G=I(null),k=I(null),V=I(new Set),z=X(()=>p.map((e)=>e.id).join("\x00"),[p]),J=I(p);J.current=p;let ie=I(j),re=I(S),se=I({itemIdsKey:z,scrollRoot:n});if(se.current.scrollRoot!==n)L.current+=1,se.current={itemIdsKey:z,scrollRoot:n};let g=X(()=>v===void 0?p.filter((e)=>j.has(e.id)):p,[v,p,j]),ae=X(()=>g.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[g]),D=I({ids:"",groups:[]}),oe=g.map((e)=>e.id).join("\x00");if(D.current.ids!==oe)D.current={ids:oe,groups:we(g.map((e)=>e.id),D.current.groups)};P(()=>ee(),[ee]),P(()=>()=>{if(L.current+=1,G.current?.cancel(),k.current!==null)clearTimeout(k.current)},[]),P(()=>{y(null),R(!1),O(null),M.current=null,U.current=!1,H.current=null,F(null),V.current.clear()},[n]),P(()=>{te()},[te]),P(()=>{if(n===null)return;let e=new Set,t=new Map,i=new Set(J.current.map((s)=>s.id)),r=()=>{let s=new Set(t.values()),d=J.current.filter((f)=>s.has(f.id)).map((f)=>f.id),o=d.findIndex((f)=>e.has(f));if(o===-1)return;let b=o;for(let f=o+1;f<d.length;f++)if(e.has(d[f]))b=f;let N=new Set(d.slice(o,b+1));if(fe(re.current,N))return;re.current=N,w(N)},a=new IntersectionObserver((s)=>{for(let d of s){let o=t.get(d.target);if(d.isIntersecting)e.add(o);else e.delete(o)}r()},{root:n,rootMargin:`-${c}px 0px 0px 0px`}),u=()=>{let s=new Set,d=new Set;for(let o of n.querySelectorAll("[data-content-search-unit-key]")){let b=o.dataset.contentSearchUnitKey;if(b===void 0||!i.has(b)||s.has(b))continue;s.add(b);let N=o.closest("[data-turn-key]"),f=N===null||d.has(N)?o:N;if(d.add(f),t.has(f))continue;t.set(f,b),a.observe(f)}for(let o of t.keys()){if(d.has(o))continue;a.unobserve(o),e.delete(t.get(o)),t.delete(o)}if(r(),fe(ie.current,s))return;ie.current=s,pe(s)};u();let l=new MutationObserver((s)=>{if(s.some((o)=>[...o.addedNodes,...o.removedNodes].some((b)=>b instanceof Element&&(b.matches("[data-turn-key], [data-content-search-unit-key]")||b.querySelector("[data-turn-key], [data-content-search-unit-key]")!==null))))u()});return l.observe(n,{childList:!0,subtree:!0}),()=>{l.disconnect(),a.disconnect()}},[z,n,c]);let Y=g.find((e)=>S.has(e.id))?.id??g.at(-1)?.id;ye(()=>{let e=K.current;if(e===null||M.current!==null||Y===void 0)return;let t=e.querySelector(`[data-timeline-user-message-navigation-item-id="${CSS.escape(Y)}"]`);if(t===null)return;let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<i.top)e.scrollTop+=r.top-i.top;else if(r.bottom>i.bottom)e.scrollTop+=r.bottom-i.bottom+1},[Y,z]),P(()=>{let e=n?.querySelector("[data-timeline-user-message-navigation-content]");if(!n||!e)return;let t=()=>{let r=n.getBoundingClientRect(),a=e.getBoundingClientRect();if(r.width===0||a.width===0)return;let u=n.offsetWidth>0?r.width/n.offsetWidth:1;be((a.left-r.left)/u>=48)},i=new ResizeObserver(t);return i.observe(n),i.observe(e),t(),()=>i.disconnect()},[n]);let he=xe(async(e,t="smooth")=>{if(n===null)throw Error("Thread user-message navigation scroll root is missing");let i=L.current+1;L.current=i,x();let r=()=>n.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`),a=r(),u=a!==null&&n.clientHeight>0&&a.closest("[data-turn-key]")!==null&&Math.abs(a.getBoundingClientRect().top-n.getBoundingClientRect().top)>n.clientHeight*2;if((a===null||u)&&v!==void 0){if(t==="instant"&&e.isLoaded===!1)return;a=await v(e,()=>L.current===i)??r(),t="instant"}if(L.current!==i)return;if(a===null)return;let l=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;a.scrollIntoView({behavior:l?"instant":t,block:"start"});let s=a.querySelector("[data-user-message-bubble], [data-composer-attachment-pill]");if(G.current?.cancel(),G.current=null,s===null)return;let d=getComputedStyle(s).backgroundColor,o=`color-mix(in srgb, var(--foreground) 14%, ${d})`;G.current=s.animate?.([{backgroundColor:o},{backgroundColor:o,offset:0.35},{backgroundColor:d}],{duration:l?0:1000,easing:"cubic-bezier(0.23, 1, 0.32, 1)"})??null},[x,v,n]);if(g.length<Se||!ve)return null;let Q=()=>{if(k.current!==null)clearTimeout(k.current);k.current=null},ue=(e,t=!1)=>{if(Q(),C===void 0||e.isLoaded!==!1||V.current.has(e.turnKey))return;let i=()=>{k.current=null,V.current.add(e.turnKey),C(e).catch(()=>V.current.delete(e.turnKey))};if(t)i();else k.current=setTimeout(i,150)},q=m===null?null:g.find((e)=>e.id===m.item.id)??g.find((e)=>e.nativeTurnId!==void 0&&e.nativeTurnId===m.item.nativeTurnId)??m.item,le=(e,t="smooth")=>{he(e,t).catch((i)=>{if(B)B(i);else throw i})},de=g.findIndex((e)=>e.id===(_??Ie)),ce=K.current,Te=m===null||!ce?.contains(m.button)?0:Me(ce,m.button),me=(e)=>{let t=e?.closest("[data-timeline-user-message-navigation-item-id]"),i=K.current;if(t===void 0||t===null||!i.contains(t))return null;let r=t.dataset.timelineUserMessageNavigationItemId,a=g.findIndex((u)=>u.id===r);return{button:t,item:g[a],index:a}},W=(e)=>{let t=M.current;if(t?.pointerId!==e.pointerId)return;if(M.current=null,O(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return T("nav",{"aria-label":"User messages",className:"timeline-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:T(Ii,{open:Z,onOpenChange:R,side:"inline-end",sideOffset:0,align:"center",alignOffset:Te,trigger:T("div",{ref:K,"data-timeline-user-message-navigation-rail-list":!0,"data-scrubbing":_===null?void 0:"",className:"timeline-user-message-navigation-rail-list",onPointerEnter:()=>{H.current=null},onPointerDown:(e)=>{if(e.button!==0)return;Q();let t=me(e.target instanceof Element?e.target:null);if(t===null)return;U.current=!1,M.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),O(t.item.id),y(t),R(!0)},onPointerMove:(e)=>{let t=M.current;if(t===null){let l=me(e.target instanceof Element?e.target:null);if(l!==null){F(l.item.id);let s=H.current;if(s!==null&&s!==l.index)ne(s,l.index,ae);H.current=l.index,y((d)=>d?.item.id===l.item.id?d:l),ue(l.item)}return}if(t.pointerId!==e.pointerId)return;if((e.buttons&1)===0){W(e);return}let i=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(g.length-1,Math.floor((e.clientY-i.top+e.currentTarget.scrollTop)/ge))),u={button:e.currentTarget.querySelectorAll("[data-timeline-user-message-navigation-item-id]")[r],item:g[r],index:r};if(u.item.id===t.itemId)return;ne(t.itemIndex,u.index,ae),H.current=u.index,M.current={...t,itemId:u.item.id,itemIndex:u.index},U.current=!0,O(u.item.id),y(u),le(u.item,"instant")},onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,onPointerLeave:()=>{if(Q(),F(null),H.current=null,M.current===null&&!Z)y(null)},children:T("div",{className:"flex flex-col",children:D.current.groups.map((e)=>T("div",{className:"flex w-9 shrink-0 flex-col [content-visibility:auto]",style:{height:e.itemIds.length*ge},children:g.slice(e.startIndex,e.startIndex+e.itemIds.length).map((t,i)=>{let r=e.startIndex+i,a=Math.abs(r-de),u=de===-1||a>3?void 0:[1,0.7,0.4,0.2][a];return T("button",{type:"button","data-timeline-user-message-navigation-item-id":t.id,"data-scrub-target":_===t.id?"":void 0,"aria-current":S.has(t.id)?"true":void 0,"aria-label":`Jump to user message ${r+1}`,className:"timeline-user-message-navigation-row",onClick:(l)=>{if(U.current){U.current=!1;return}let s={button:l.currentTarget,item:t,index:r};y(s),R(!0),le(t)},onFocus:(l)=>{ue(t,!0),y({button:l.currentTarget,item:t,index:r}),R(!0)},children:T("span",{className:"flex h-0.5 w-[30px] items-center",children:T("span",{className:"timeline-user-message-navigation-marker",style:u===void 0?void 0:{"--marker-progress":u}})})},t.id)})},e.key))})}),children:q!==null&&T("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:A?A(q):Ne(ke,{children:[T("div",{className:"min-w-0 truncate font-medium",children:q.label}),q.response.length>0&&T("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:q.response})]})})})})}function Me(h,x){let v=h.getBoundingClientRect(),p=x.getBoundingClientRect();return p.top+p.height/2-(v.top+v.height/2)}
2
- export{Ti};
1
+ import{Ni}from"./chunk-xw2zfj4c.js";import{useCallback as xe,useEffect as P,useLayoutEffect as ye,useMemo as X,useRef as I,useState as E}from"react";import"@alwith/module-chat/navigation-rail.css";import{jsx as T,jsxs as Ne,Fragment as ke}from"react/jsx-runtime";var Se=4,ge=10;function we(h,x){let v=new Map(x.flatMap((c)=>c.itemIds.map((S)=>[S,c.key]))),p=Array(h.length),C;for(let c=h.length-1;c>=0;c--)C=v.get(h[c])??C,p[c]=C;let A=Math.max(-1,...x.map((c)=>c.key))+1,B=new Set,n=[];for(let[c,S]of h.entries()){let w=v.get(S),m=n.at(-1);if(!m||w!==void 0&&w!==m.key||w===void 0&&m.itemIds.length>=64&&p[c]!==m.key){let y=w!==void 0&&!B.has(w)?w:A++;m={key:y,startIndex:c,itemIds:[]},n.push(m),B.add(y)}m.itemIds.push(S)}return n}function fe(h,x){if(h.size!==x.size)return!1;for(let v of h)if(!x.has(v))return!1;return!0}function Ii({audio:h,beforeReveal:x,ensureItemMounted:v,items:p,onPreviewItem:C,renderPreview:A,onRevealError:B,scrollRoot:n,targetTopMarginPx:c=16}){let[S,w]=E(()=>{let e=p.at(-1);return new Set(e===void 0?[]:[e.id])}),[m,y]=E(null),[_,O]=E(null),[Z,R]=E(!1),[j,pe]=E(()=>new Set),[ve,be]=E(!0),[Ie,F]=E(null),{installUnlock:ee,preload:te,playSequence:ne}=h,K=I(null),M=I(null),U=I(!1),H=I(null),L=I(0),G=I(null),k=I(null),V=I(new Set),z=X(()=>p.map((e)=>e.id).join("\x00"),[p]),J=I(p);J.current=p;let ie=I(j),re=I(S),se=I({itemIdsKey:z,scrollRoot:n});if(se.current.scrollRoot!==n)L.current+=1,se.current={itemIdsKey:z,scrollRoot:n};let g=X(()=>v===void 0?p.filter((e)=>j.has(e.id)):p,[v,p,j]),ae=X(()=>g.map((e)=>({inputTokens:e.inputTokens,outputTokens:e.outputTokens})),[g]),D=I({ids:"",groups:[]}),oe=g.map((e)=>e.id).join("\x00");if(D.current.ids!==oe)D.current={ids:oe,groups:we(g.map((e)=>e.id),D.current.groups)};P(()=>ee(),[ee]),P(()=>()=>{if(L.current+=1,G.current?.cancel(),k.current!==null)clearTimeout(k.current)},[]),P(()=>{y(null),R(!1),O(null),M.current=null,U.current=!1,H.current=null,F(null),V.current.clear()},[n]),P(()=>{te()},[te]),P(()=>{if(n===null)return;let e=new Set,t=new Map,i=new Set(J.current.map((s)=>s.id)),r=()=>{let s=new Set(t.values()),d=J.current.filter((f)=>s.has(f.id)).map((f)=>f.id),o=d.findIndex((f)=>e.has(f));if(o===-1)return;let b=o;for(let f=o+1;f<d.length;f++)if(e.has(d[f]))b=f;let N=new Set(d.slice(o,b+1));if(fe(re.current,N))return;re.current=N,w(N)},a=new IntersectionObserver((s)=>{for(let d of s){let o=t.get(d.target);if(d.isIntersecting)e.add(o);else e.delete(o)}r()},{root:n,rootMargin:`-${c}px 0px 0px 0px`}),u=()=>{let s=new Set,d=new Set;for(let o of n.querySelectorAll("[data-content-search-unit-key]")){let b=o.dataset.contentSearchUnitKey;if(b===void 0||!i.has(b)||s.has(b))continue;s.add(b);let N=o.closest("[data-turn-key]"),f=N===null||d.has(N)?o:N;if(d.add(f),t.has(f))continue;t.set(f,b),a.observe(f)}for(let o of t.keys()){if(d.has(o))continue;a.unobserve(o),e.delete(t.get(o)),t.delete(o)}if(r(),fe(ie.current,s))return;ie.current=s,pe(s)};u();let l=new MutationObserver((s)=>{if(s.some((o)=>[...o.addedNodes,...o.removedNodes].some((b)=>b instanceof Element&&(b.matches("[data-turn-key], [data-content-search-unit-key]")||b.querySelector("[data-turn-key], [data-content-search-unit-key]")!==null))))u()});return l.observe(n,{childList:!0,subtree:!0}),()=>{l.disconnect(),a.disconnect()}},[z,n,c]);let Y=g.find((e)=>S.has(e.id))?.id??g.at(-1)?.id;ye(()=>{let e=K.current;if(e===null||M.current!==null||Y===void 0)return;let t=e.querySelector(`[data-timeline-user-message-navigation-item-id="${CSS.escape(Y)}"]`);if(t===null)return;let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(r.top<i.top)e.scrollTop+=r.top-i.top;else if(r.bottom>i.bottom)e.scrollTop+=r.bottom-i.bottom+1},[Y,z]),P(()=>{let e=n?.querySelector("[data-timeline-user-message-navigation-content]");if(!n||!e)return;let t=()=>{let r=n.getBoundingClientRect(),a=e.getBoundingClientRect();if(r.width===0||a.width===0)return;let u=n.offsetWidth>0?r.width/n.offsetWidth:1;be((a.left-r.left)/u>=48)},i=new ResizeObserver(t);return i.observe(n),i.observe(e),t(),()=>i.disconnect()},[n]);let he=xe(async(e,t="smooth")=>{if(n===null)throw Error("Thread user-message navigation scroll root is missing");let i=L.current+1;L.current=i,x();let r=()=>n.querySelector(`[data-content-search-unit-key="${CSS.escape(e.id)}"]`),a=r(),u=a!==null&&n.clientHeight>0&&a.closest("[data-turn-key]")!==null&&Math.abs(a.getBoundingClientRect().top-n.getBoundingClientRect().top)>n.clientHeight*2;if((a===null||u)&&v!==void 0){if(t==="instant"&&e.isLoaded===!1)return;a=await v(e,()=>L.current===i)??r(),t="instant"}if(L.current!==i)return;if(a===null)return;let l=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;a.scrollIntoView({behavior:l?"instant":t,block:"start"});let s=a.querySelector("[data-user-message-bubble], [data-composer-attachment-pill]");if(G.current?.cancel(),G.current=null,s===null)return;let d=getComputedStyle(s).backgroundColor,o=`color-mix(in srgb, var(--foreground) 14%, ${d})`;G.current=s.animate?.([{backgroundColor:o},{backgroundColor:o,offset:0.35},{backgroundColor:d}],{duration:l?0:1000,easing:"cubic-bezier(0.23, 1, 0.32, 1)"})??null},[x,v,n]);if(g.length<Se||!ve)return null;let Q=()=>{if(k.current!==null)clearTimeout(k.current);k.current=null},ue=(e,t=!1)=>{if(Q(),C===void 0||e.isLoaded!==!1||V.current.has(e.turnKey))return;let i=()=>{k.current=null,V.current.add(e.turnKey),C(e).catch(()=>V.current.delete(e.turnKey))};if(t)i();else k.current=setTimeout(i,150)},q=m===null?null:g.find((e)=>e.id===m.item.id)??g.find((e)=>e.nativeTurnId!==void 0&&e.nativeTurnId===m.item.nativeTurnId)??m.item,le=(e,t="smooth")=>{he(e,t).catch((i)=>{if(B)B(i);else throw i})},de=g.findIndex((e)=>e.id===(_??Ie)),ce=K.current,Te=m===null||!ce?.contains(m.button)?0:Me(ce,m.button),me=(e)=>{let t=e?.closest("[data-timeline-user-message-navigation-item-id]"),i=K.current;if(t===void 0||t===null||!i.contains(t))return null;let r=t.dataset.timelineUserMessageNavigationItemId,a=g.findIndex((u)=>u.id===r);return{button:t,item:g[a],index:a}},W=(e)=>{let t=M.current;if(t?.pointerId!==e.pointerId)return;if(M.current=null,O(null),t.captureTarget.hasPointerCapture(e.pointerId))t.captureTarget.releasePointerCapture(e.pointerId)};return T("nav",{"aria-label":"User messages",className:"timeline-user-message-navigation absolute start-4 top-1/2 z-20 -translate-y-1/2",children:T(Ni,{open:Z,onOpenChange:R,side:"inline-end",sideOffset:0,align:"center",alignOffset:Te,trigger:T("div",{ref:K,"data-timeline-user-message-navigation-rail-list":!0,"data-scrubbing":_===null?void 0:"",className:"timeline-user-message-navigation-rail-list",onPointerEnter:()=>{H.current=null},onPointerDown:(e)=>{if(e.button!==0)return;Q();let t=me(e.target instanceof Element?e.target:null);if(t===null)return;U.current=!1,M.current={pointerId:e.pointerId,itemId:t.item.id,itemIndex:t.index,captureTarget:t.button},t.button.setPointerCapture(e.pointerId),O(t.item.id),y(t),R(!0)},onPointerMove:(e)=>{let t=M.current;if(t===null){let l=me(e.target instanceof Element?e.target:null);if(l!==null){F(l.item.id);let s=H.current;if(s!==null&&s!==l.index)ne(s,l.index,ae);H.current=l.index,y((d)=>d?.item.id===l.item.id?d:l),ue(l.item)}return}if(t.pointerId!==e.pointerId)return;if((e.buttons&1)===0){W(e);return}let i=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(g.length-1,Math.floor((e.clientY-i.top+e.currentTarget.scrollTop)/ge))),u={button:e.currentTarget.querySelectorAll("[data-timeline-user-message-navigation-item-id]")[r],item:g[r],index:r};if(u.item.id===t.itemId)return;ne(t.itemIndex,u.index,ae),H.current=u.index,M.current={...t,itemId:u.item.id,itemIndex:u.index},U.current=!0,O(u.item.id),y(u),le(u.item,"instant")},onPointerUp:W,onPointerCancel:W,onLostPointerCapture:W,onPointerLeave:()=>{if(Q(),F(null),H.current=null,M.current===null&&!Z)y(null)},children:T("div",{className:"flex flex-col",children:D.current.groups.map((e)=>T("div",{className:"flex w-9 shrink-0 flex-col [content-visibility:auto]",style:{height:e.itemIds.length*ge},children:g.slice(e.startIndex,e.startIndex+e.itemIds.length).map((t,i)=>{let r=e.startIndex+i,a=Math.abs(r-de),u=de===-1||a>3?void 0:[1,0.7,0.4,0.2][a];return T("button",{type:"button","data-timeline-user-message-navigation-item-id":t.id,"data-scrub-target":_===t.id?"":void 0,"aria-current":S.has(t.id)?"true":void 0,"aria-label":`Jump to user message ${r+1}`,className:"timeline-user-message-navigation-row",onClick:(l)=>{if(U.current){U.current=!1;return}let s={button:l.currentTarget,item:t,index:r};y(s),R(!0),le(t)},onFocus:(l)=>{ue(t,!0),y({button:l.currentTarget,item:t,index:r}),R(!0)},children:T("span",{className:"flex h-0.5 w-[30px] items-center",children:T("span",{className:"timeline-user-message-navigation-marker",style:u===void 0?void 0:{"--marker-progress":u}})})},t.id)})},e.key))})}),children:q!==null&&T("div",{className:"bg-popover/95 text-popover-foreground ring-border w-80 max-w-[calc(100vw-1rem)] overflow-hidden rounded-xl p-2 text-sm leading-5 shadow-xl ring-[0.5px] backdrop-blur-sm",children:A?A(q):Ne(ke,{children:[T("div",{className:"min-w-0 truncate font-medium",children:q.label}),q.response.length>0&&T("div",{className:"text-muted-foreground mt-1 line-clamp-3",children:q.response})]})})})})}function Me(h,x){let v=h.getBoundingClientRect(),p=x.getBoundingClientRect();return p.top+p.height/2-(v.top+v.height/2)}
2
+ export{Ii};
@@ -1,3 +1,3 @@
1
- import{c}from"./chunk-k7y6dqf2.js";import{k,u}from"./chunk-3m59n5gr.js";import{dt}from"./chunk-2kz2z86n.js";import{Pe,l,Te,Be,i}from"./chunk-g79y6q3f.js";import{F,D,J,H,O,se,pt}from"./chunk-w7p443ya.js";import{ae}from"./chunk-rfahybr0.js";import{Ue}from"./chunk-snd4q8wg.js";import{h}from"./chunk-9cqpn67f.js";import{gt,M}from"./chunk-f2a9rqfz.js";import{U,ce}from"./chunk-yftn8cw0.js";import{mt}from"./chunk-jg6r0ckn.js";import{ut}from"./chunk-dz5ymd3t.js";import{hasPluginStore as te}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as ne,BookOpenIcon as ie,CheckIcon as le,CircleArrowUpIcon as oe,MoreVerticalIcon as re,PlusIcon as W,PuzzleIcon as de,RefreshCwIcon as me,SearchIcon as ue,Trash2Icon as pe,XIcon as ge}from"lucide-react";import{memo as fe,useDeferredValue as ve,useEffect as K,useMemo as Q,useState as I}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as xe,DialogContent as he,DialogDescription as Ne,DialogHeader as ke,DialogTitle as ye,DialogTrigger as be}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as we,DropdownMenuContent as Ce,DropdownMenuItem as Ie,DropdownMenuTrigger as Se}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as X}from"@nyssance/shadcn/vega/components/ui/input";import{Label as De}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as B}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as Y}from"react/jsx-runtime";function T(t){return t.interface?.displayName??t.name}function Z(t){return t.interface?.shortDescription??""}function Me({plugin:t,marketplace:d}){let{t:p}=l(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),f=i((n)=>n.install),m=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",r=p(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(le,{className:"text-muted-foreground size-4 shrink-0","aria-label":r});return e(y,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||m,"aria-label":r,title:m?p("plugins.disabledReason.unknown"):r,onClick:()=>void f({plugin:t,marketplace:d}).catch(()=>{}),children:g?e(B,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Ee({plugin:t,marketplace:d,actions:p,onOpen:g}){let a=Z(t),f=t.interface?.developerName,m=t.localVersion??t.version,r=[f,m?`v${m}`:null].filter(Boolean).join(" · ");return s(se,{className:"toolbox-row relative",children:[e(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":T(t),onClick:()=>g({plugin:t,marketplace:d})}),e(H,{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(M,{name:t.name})})}),s(D,{className:"pointer-events-none relative min-w-0",children:[e(pt,{className:"mb-0.5",children:T(t)}),e(J,{className:"line-clamp-1",title:a,children:a||d.interface?.displayName||d.name}),r&&e(J,{"data-toolbox-metadata":"",children:r})]}),e(F,{className:"relative w-8 shrink-0 justify-center",children:p})]})}function q(){return Be((t)=>t.connection==="ready"&&te(t.agent))}var E=48;function ze({marketplace:t,plugins:d,onOpen:p}){let{t:g}=l(),a=i((n)=>n.removeMarketplace),[f,m]=I(0),r=Math.min(f,Math.max(0,Math.ceil(d.length/E)-1));if(d.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:d.length}),t.path!==null&&s(we,{children:[e(Se,{render:e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(re,{})}),e(Ce,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ie,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(pe,{className:"size-3.5"}),g("plugins.marketplace.remove")]})})]})]}),e(O,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:d.slice(r*E,(r+1)*E).map((n)=>e(Ee,{onOpen:p,plugin:n,marketplace:t,actions:e(Me,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),d.length>E&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(y,{variant:"outline",size:"sm",className:"h-9",disabled:r===0,onClick:()=>m(r-1),children:g("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",Math.ceil(d.length/E)]}),e(y,{variant:"outline",size:"sm",className:"h-9",disabled:(r+1)*E>=d.length,onClick:()=>m(r+1),children:g("plugins.nextPage")})]})]},t.name)}var Oe=fe(function({query:d,onOpen:p}){let{t:g}=l(),a=i((n)=>n.marketplaces),f=i((n)=>n.featuredPluginIds),m=Q(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,T(v),Z(v),v.interface?.developerName??"",...v.keywords].join(`
2
- `).toLowerCase()}))})),[a]),r=Q(()=>{let n=new Set(f);return m.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:b,text:P})=>d===""?v.path!==null||n.has(b.id):P.includes(d)).map(({plugin:b})=>b)}))},[m,f,d]);return s(Y,{children:[r.map(({marketplace:n,plugins:v})=>e(ze,{marketplace:n,plugins:v,onOpen:p},JSON.stringify([n.name,n.path,d]))),r.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Ae(){let{t}=l(),d=q(),p=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[f,m]=I(""),[r,n]=I(!1),[v,x]=I(!1),[b,P]=I(null),A=async()=>{let N=f.trim();if(!N||r)return;n(!0),P(null);try{await p({source:N}),m(""),x(!1)}catch(S){P(S instanceof Error?S.message:String(S))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(y,{size:"sm",className:"h-9",variant:"outline",disabled:!d||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(B,{}):e(oe,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:v,onOpenChange:(N)=>{if(!r)x(N)},children:[s(be,{render:e(y,{size:"sm",className:"h-9",variant:"outline",disabled:!d}),children:[e(W,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ke,{children:[e(ye,{children:t("plugins.marketplace.addTitle")}),e(Ne,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(N)=>{N.preventDefault(),A()},children:[e(De,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(X,{id:"marketplace-source",value:f,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),b&&e("p",{role:"alert",className:"text-destructive text-sm",children:b}),s("div",{className:"flex justify-end gap-2",children:[e(y,{type:"button",variant:"ghost",disabled:r,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(y,{type:"submit",disabled:r||f.trim()==="",children:[r&&e(B,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Le({onOpen:t,query:d}){let p=q(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!p,f=ve(d.trim().toLowerCase());return e(h,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${U} flex flex-col gap-8`,children:[g.map((m)=>s("p",{className:"text-destructive px-2 text-xs",children:[m.marketplacePath,": ",m.message]},m.marketplacePath)),a?e(ae,{}):e(Oe,{query:f,onOpen:t})]})})}function Yi({cwd:t,active:d,extensions:p,onOpenCatalog:g}){let{t:a}=l(),f=Te(),m=Pe(f),r=i((o)=>o.refresh),n=i((o)=>o.loading),v=i((o)=>o.error),[x,b]=I("plugins"),[P,A]=I({plugins:"",skills:""}),N=x==="skills"?P.skills:P.plugins,S=(o)=>A((z)=>({...z,[x]:o})),ee=Be((o)=>JSON.stringify([...new Set(o.sessionList.map((z)=>Ue(z.cwd,o.projectContext)).filter((z)=>z!==null))].toSorted())),L=JSON.stringify([...new Set([Ue(t,f.state.projectContext),...JSON.parse(ee)].filter((o)=>o!==null))].toSorted()),R=i((o)=>o.installed),V=a(x==="skills"?"plugins.skills.search":"plugins.search"),[w,G]=I(null),C=q();K(()=>{if(!d||!C)return;if(m.getState().loadedScope!==L)r(JSON.parse(L))},[d,C,r,L,m]),K(()=>{if(!C)return;return f.onSkillsChanged(()=>void r(void 0,{background:!0}))},[C,r,f]);let j=(o)=>{g?.(),b("plugins"),G(o)},_=(o)=>{g?.(),b(o),G(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(gt,{}),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:[p&&s(u,{className:`${c} h-8 gap-2 px-2`,active:p.active,onClick:p.onOpen,children:[e(ne,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((o)=>s(u,{className:`${c} h-8 gap-2 px-2`,active:!p?.active&&x===o&&w===null,onClick:()=>_(o),children:[o==="plugins"?e(de,{className:"size-4"}):e(ie,{className:"size-4"}),e("span",{children:a(`plugins.headings.${o}`)})]},o))]}),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(h,{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(k,{children:!C||n&&R.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(B,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):R.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):R.map((o)=>s(u,{title:T(o.plugin),className:`${c} gap-2 px-2`,active:!p?.active&&w?.plugin.id===o.plugin.id,onClick:()=>j(o),children:[e(M,{name:o.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:T(o.plugin)})]},o.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:p?.active?p.content:s(Y,{children:[w&&e(mt,{entry:w,onBack:()=>_("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(ce,{children:e(dt,{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(ue,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(X,{className:"h-9 rounded-full ps-9 pe-9","aria-label":V,value:N,onChange:(o)=>S(o.target.value),placeholder:V}),N&&e(y,{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:()=>S(""),children:e(ge,{})})]}),e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void r(void 0,{forceRefetch:!0}),children:n?e(B,{}):e(me,{})}),x==="plugins"&&e(Ae,{})]})})}),(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(y,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void r(),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(Le,{query:P.plugins,onOpen:j})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(ut,{query:P.skills,ready:C,onOpenPlugin:j})})]})]})]})})]})}
3
- export{Yi};
1
+ import{c}from"./chunk-k7y6dqf2.js";import{k,u}from"./chunk-mma530jr.js";import{dt}from"./chunk-2kz2z86n.js";import{Pe,l,Te,Be,i}from"./chunk-v9nbx36v.js";import{F,D,J,H,O,se,pt}from"./chunk-w7p443ya.js";import{ae}from"./chunk-1zfg0nxv.js";import{Ue}from"./chunk-snd4q8wg.js";import{h}from"./chunk-9cqpn67f.js";import{gt,M}from"./chunk-f2a9rqfz.js";import{U,ce}from"./chunk-yftn8cw0.js";import{mt}from"./chunk-7d7rq137.js";import{ut}from"./chunk-67swkna1.js";import{hasPluginStore as te}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as ne,BookOpenIcon as ie,CheckIcon as le,CircleArrowUpIcon as oe,MoreVerticalIcon as re,PlusIcon as W,PuzzleIcon as de,RefreshCwIcon as me,SearchIcon as ue,Trash2Icon as pe,XIcon as ge}from"lucide-react";import{memo as fe,useDeferredValue as ve,useEffect as K,useMemo as Q,useState as I}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as xe,DialogContent as he,DialogDescription as Ne,DialogHeader as ke,DialogTitle as ye,DialogTrigger as be}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as we,DropdownMenuContent as Ce,DropdownMenuItem as Ie,DropdownMenuTrigger as Se}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as X}from"@nyssance/shadcn/vega/components/ui/input";import{Label as De}from"@nyssance/shadcn/vega/components/ui/label";import{Spinner as B}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as e,jsxs as s,Fragment as Y}from"react/jsx-runtime";function T(t){return t.interface?.displayName??t.name}function Z(t){return t.interface?.shortDescription??""}function Me({plugin:t,marketplace:d}){let{t:p}=l(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((v)=>v.plugin.id===t.id)),f=i((n)=>n.install),m=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",r=p(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(le,{className:"text-muted-foreground size-4 shrink-0","aria-label":r});return e(y,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||m,"aria-label":r,title:m?p("plugins.disabledReason.unknown"):r,onClick:()=>void f({plugin:t,marketplace:d}).catch(()=>{}),children:g?e(B,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function Ee({plugin:t,marketplace:d,actions:p,onOpen:g}){let a=Z(t),f=t.interface?.developerName,m=t.localVersion??t.version,r=[f,m?`v${m}`:null].filter(Boolean).join(" · ");return s(se,{className:"toolbox-row relative",children:[e(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":T(t),onClick:()=>g({plugin:t,marketplace:d})}),e(H,{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(M,{name:t.name})})}),s(D,{className:"pointer-events-none relative min-w-0",children:[e(pt,{className:"mb-0.5",children:T(t)}),e(J,{className:"line-clamp-1",title:a,children:a||d.interface?.displayName||d.name}),r&&e(J,{"data-toolbox-metadata":"",children:r})]}),e(F,{className:"relative w-8 shrink-0 justify-center",children:p})]})}function q(){return Be((t)=>t.connection==="ready"&&te(t.agent))}var E=48;function ze({marketplace:t,plugins:d,onOpen:p}){let{t:g}=l(),a=i((n)=>n.removeMarketplace),[f,m]=I(0),r=Math.min(f,Math.max(0,Math.ceil(d.length/E)-1));if(d.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:d.length}),t.path!==null&&s(we,{children:[e(Se,{render:e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(re,{})}),e(Ce,{align:"end",className:"w-max min-w-[140px] whitespace-nowrap",children:s(Ie,{className:"text-destructive",onClick:()=>void a(t.name),children:[e(pe,{className:"size-3.5"}),g("plugins.marketplace.remove")]})})]})]}),e(O,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:d.slice(r*E,(r+1)*E).map((n)=>e(Ee,{onOpen:p,plugin:n,marketplace:t,actions:e(Me,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),d.length>E&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(y,{variant:"outline",size:"sm",className:"h-9",disabled:r===0,onClick:()=>m(r-1),children:g("plugins.previousPage")}),s("span",{className:"text-muted-foreground text-xs",children:[r+1," / ",Math.ceil(d.length/E)]}),e(y,{variant:"outline",size:"sm",className:"h-9",disabled:(r+1)*E>=d.length,onClick:()=>m(r+1),children:g("plugins.nextPage")})]})]},t.name)}var Oe=fe(function({query:d,onOpen:p}){let{t:g}=l(),a=i((n)=>n.marketplaces),f=i((n)=>n.featuredPluginIds),m=Q(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((v)=>({plugin:v,text:[v.name,T(v),Z(v),v.interface?.developerName??"",...v.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),r=Q(()=>{let n=new Set(f);return m.map(({marketplace:v,entries:x})=>({marketplace:v,plugins:x.filter(({plugin:b,text:P})=>d===""?v.path!==null||n.has(b.id):P.includes(d)).map(({plugin:b})=>b)}))},[m,f,d]);return s(Y,{children:[r.map(({marketplace:n,plugins:v})=>e(ze,{marketplace:n,plugins:v,onOpen:p},JSON.stringify([n.name,n.path,d]))),r.every((n)=>n.plugins.length===0)&&e("p",{className:"text-muted-foreground px-2 py-6 text-center text-sm",children:g("plugins.empty")})]})});function Ae(){let{t}=l(),d=q(),p=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[f,m]=I(""),[r,n]=I(!1),[v,x]=I(!1),[b,P]=I(null),A=async()=>{let N=f.trim();if(!N||r)return;n(!0),P(null);try{await p({source:N}),m(""),x(!1)}catch(S){P(S instanceof Error?S.message:String(S))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(y,{size:"sm",className:"h-9",variant:"outline",disabled:!d||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(B,{}):e(oe,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:v,onOpenChange:(N)=>{if(!r)x(N)},children:[s(be,{render:e(y,{size:"sm",className:"h-9",variant:"outline",disabled:!d}),children:[e(W,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ke,{children:[e(ye,{children:t("plugins.marketplace.addTitle")}),e(Ne,{children:t("plugins.catalog.sourceHelp")})]}),s("form",{className:"space-y-4",onSubmit:(N)=>{N.preventDefault(),A()},children:[e(De,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(X,{id:"marketplace-source",value:f,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),b&&e("p",{role:"alert",className:"text-destructive text-sm",children:b}),s("div",{className:"flex justify-end gap-2",children:[e(y,{type:"button",variant:"ghost",disabled:r,onClick:()=>x(!1),children:t("plugins.marketplace.addCancel")}),s(y,{type:"submit",disabled:r||f.trim()==="",children:[r&&e(B,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Le({onOpen:t,query:d}){let p=q(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!p,f=ve(d.trim().toLowerCase());return e(h,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${U} flex flex-col gap-8`,children:[g.map((m)=>s("p",{className:"text-destructive px-2 text-xs",children:[m.marketplacePath,": ",m.message]},m.marketplacePath)),a?e(ae,{}):e(Oe,{query:f,onOpen:t})]})})}function Xi({cwd:t,active:d,extensions:p,onOpenCatalog:g}){let{t:a}=l(),f=Te(),m=Pe(f),r=i((o)=>o.refresh),n=i((o)=>o.loading),v=i((o)=>o.error),[x,b]=I("plugins"),[P,A]=I({plugins:"",skills:""}),N=x==="skills"?P.skills:P.plugins,S=(o)=>A((z)=>({...z,[x]:o})),ee=Be((o)=>JSON.stringify([...new Set(o.sessionList.map((z)=>Ue(z.cwd,o.projectContext)).filter((z)=>z!==null))].toSorted())),L=JSON.stringify([...new Set([Ue(t,f.state.projectContext),...JSON.parse(ee)].filter((o)=>o!==null))].toSorted()),R=i((o)=>o.installed),V=a(x==="skills"?"plugins.skills.search":"plugins.search"),[w,G]=I(null),C=q();K(()=>{if(!d||!C)return;if(m.getState().loadedScope!==L)r(JSON.parse(L))},[d,C,r,L,m]),K(()=>{if(!C)return;return f.onSkillsChanged(()=>void r(void 0,{background:!0}))},[C,r,f]);let j=(o)=>{g?.(),b("plugins"),G(o)},_=(o)=>{g?.(),b(o),G(null)};return s("div",{className:"plugins-page @container flex h-full min-h-0 overflow-hidden [--navigation-row-height:30px] [--spacing:4px]",children:[e(gt,{}),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:[p&&s(u,{className:`${c} h-8 gap-2 px-2`,active:p.active,onClick:p.onOpen,children:[e(ne,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((o)=>s(u,{className:`${c} h-8 gap-2 px-2`,active:!p?.active&&x===o&&w===null,onClick:()=>_(o),children:[o==="plugins"?e(de,{className:"size-4"}):e(ie,{className:"size-4"}),e("span",{children:a(`plugins.headings.${o}`)})]},o))]}),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(h,{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(k,{children:!C||n&&R.length===0?s("div",{role:"status",className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-xs",children:[e(B,{className:"size-3.5",role:"presentation","aria-hidden":"true"}),a("plugins.detail.loading")]}):R.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):R.map((o)=>s(u,{title:T(o.plugin),className:`${c} gap-2 px-2`,active:!p?.active&&w?.plugin.id===o.plugin.id,onClick:()=>j(o),children:[e(M,{name:o.plugin.name,className:"size-4 shrink-0"}),e("span",{className:"truncate",children:T(o.plugin)})]},o.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:p?.active?p.content:s(Y,{children:[w&&e(mt,{entry:w,onBack:()=>_("plugins")},JSON.stringify([w.marketplace.name,w.marketplace.path,w.plugin.id,t])),s("div",{hidden:w!==null,className:w?"hidden":"flex min-h-0 flex-1 flex-col",children:[e(ce,{children:e(dt,{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(ue,{className:"text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"}),e(X,{className:"h-9 rounded-full ps-9 pe-9","aria-label":V,value:N,onChange:(o)=>S(o.target.value),placeholder:V}),N&&e(y,{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:()=>S(""),children:e(ge,{})})]}),e(y,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":a("plugins.skills.refresh"),disabled:!C||n,onClick:()=>void r(void 0,{forceRefetch:!0}),children:n?e(B,{}):e(me,{})}),x==="plugins"&&e(Ae,{})]})})}),(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(y,{size:"sm",className:"h-9",variant:"outline",disabled:n||!C,onClick:()=>void r(),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(Le,{query:P.plugins,onOpen:j})}),e("div",{hidden:x!=="skills",className:x==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(ut,{query:P.skills,ready:C,onOpenPlugin:j})})]})]})]})})]})}
3
+ export{Xi};
@@ -1,2 +1,2 @@
1
- import{P,Fn,Bi,Jt,Gi,Dn,zi}from"./chunk-n3d2mv93.js";import{t,_e,X,o}from"./chunk-f1r8wh4e.js";import{ke}from"./chunk-gwa7hbzr.js";import{createStore as C}from"@alwith/api/client";import{isText as w,nativeTurnId as Q}from"@nyssance/codex-acp-v2/client";import{jsx as y}from"react/jsx-runtime";var b=C({entries:{}});function p(i,e){b.setState((n)=>({entries:{...n.entries,[i]:e}}))}function v(i,e){let n=Q(e),a=i.items.findLast((s)=>Q(s)!==null);return!e.replayed&&n!==null&&a!==void 0&&Q(a)===n}function E(i,e){for(let n of i.items){if(n.kind!=="user"||n.echo==="pending")continue;for(let a of[...Dn(n._meta),...n.content.filter(w).flatMap((s)=>Dn(s._meta))])if(a.questionItemId===e)return a.answer}return}function M({sessionId:i,item:e,question:n,index:a}){let s=_e(),{t:l}=t(),m=Fn(e.id,a),c=JSON.stringify([i,m]),u=X(b,(r)=>r.entries[c]),d=o((r)=>r.sessions[i]),k=o((r)=>r.connection==="ready"),f=u?.draft??Bi(n),x=d===void 0?u?.accepted:E(d,m)??u?.accepted,A=d!==void 0&&v(d,e),h=!d?.subagent&&k&&d?.attached&&!d.restoring&&!d.readOnly,g=x!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!A?"closed":!h?"unavailable":"pending",D=async()=>{if(b.getState().entries[c]?.pending||g!=="pending")return;let r=s.state.sessions[i];if(r===void 0||!v(r,e)||!r.attached||r.readOnly||r.restoring)return;let S=Jt(n,f);if(!S.trim())return;let q={questionItemId:m,question:n.title,answer:S};p(c,{draft:f,pending:!0});try{await s.prompt(i,[{type:"text",text:Gi(q),_meta:{codex:{questionReply:q}}}]),p(c,{draft:f,accepted:S})}catch(I){p(c,{draft:f,error:I instanceof Error?I.message:String(I)})}};if(g==="closed")return null;return y(zi,{question:n,draft:f,status:g,answer:x,error:g==="pending"?u?.error:void 0,t:l,onChange:(r)=>p(c,{draft:r}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{D()}})}function In({sessionId:i,item:e}){let n=o((s)=>s.sessions[i]),a=P(e._meta);if(n===void 0||n.subagent!==void 0||n.readOnly||!v(n,e))return y(ke,{content:e.content.some((s)=>!w(s)||s.text.trim().length>0)?e.content:a.map((s)=>({type:"text",text:s.title})),messageId:e.id,streaming:!1});return y("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((s,l)=>y(M,{sessionId:i,item:e,question:s,index:l},Fn(e.id,l)))})}
1
+ import{P,Fn,Gi,Jt,zi,Dn,Vi}from"./chunk-1jae0var.js";import{t,_e,X,o}from"./chunk-cbp0q0yt.js";import{ke}from"./chunk-4pxxxt8s.js";import{createStore as C}from"@alwith/api/client";import{isText as w,nativeTurnId as Q}from"@nyssance/codex-acp-v2/client";import{jsx as y}from"react/jsx-runtime";var b=C({entries:{}});function p(i,e){b.setState((n)=>({entries:{...n.entries,[i]:e}}))}function v(i,e){let n=Q(e),a=i.items.findLast((s)=>Q(s)!==null);return!e.replayed&&n!==null&&a!==void 0&&Q(a)===n}function E(i,e){for(let n of i.items){if(n.kind!=="user"||n.echo==="pending")continue;for(let a of[...Dn(n._meta),...n.content.filter(w).flatMap((s)=>Dn(s._meta))])if(a.questionItemId===e)return a.answer}return}function M({sessionId:i,item:e,question:n,index:a}){let s=_e(),{t:l}=t(),m=Fn(e.id,a),c=JSON.stringify([i,m]),u=X(b,(r)=>r.entries[c]),d=o((r)=>r.sessions[i]),k=o((r)=>r.connection==="ready"),f=u?.draft??Gi(n),x=d===void 0?u?.accepted:E(d,m)??u?.accepted,A=d!==void 0&&v(d,e),h=!d?.subagent&&k&&d?.attached&&!d.restoring&&!d.readOnly,g=x!==void 0?"answered":u?.skipped?"skipped":u?.pending?"submitting":!A?"closed":!h?"unavailable":"pending",D=async()=>{if(b.getState().entries[c]?.pending||g!=="pending")return;let r=s.state.sessions[i];if(r===void 0||!v(r,e)||!r.attached||r.readOnly||r.restoring)return;let S=Jt(n,f);if(!S.trim())return;let q={questionItemId:m,question:n.title,answer:S};p(c,{draft:f,pending:!0});try{await s.prompt(i,[{type:"text",text:zi(q),_meta:{codex:{questionReply:q}}}]),p(c,{draft:f,accepted:S})}catch(I){p(c,{draft:f,error:I instanceof Error?I.message:String(I)})}};if(g==="closed")return null;return y(Vi,{question:n,draft:f,status:g,answer:x,error:g==="pending"?u?.error:void 0,t:l,onChange:(r)=>p(c,{draft:r}),onSkip:()=>p(c,{draft:f,skipped:!0}),onSubmit:()=>{D()}})}function In({sessionId:i,item:e}){let n=o((s)=>s.sessions[i]),a=P(e._meta);if(n===void 0||n.subagent!==void 0||n.readOnly||!v(n,e))return y(ke,{content:e.content.some((s)=>!w(s)||s.text.trim().length>0)?e.content:a.map((s)=>({type:"text",text:s.title})),messageId:e.id,streaming:!1});return y("div",{className:"flex min-w-0 flex-col gap-3","data-async-questions":e.id,children:a.map((s,l)=>y(M,{sessionId:i,item:e,question:s,index:l},Fn(e.id,l)))})}
2
2
  export{In};
@@ -1,2 +1,2 @@
1
- import{rt}from"./chunk-8504eft8.js";import{Ni,Mi,Ai}from"./chunk-5f889j6j.js";import{Ti}from"./chunk-3jfkrwjq.js";import{t}from"./chunk-f1r8wh4e.js";import{re}from"./chunk-658y6xth.js";import{nativeTurnId as f,textOf as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function aa(i,n){return{installUnlock:n==="none"?()=>()=>{}:Mi,preload:()=>{if(n!=="none")Ni(i)},playSequence:(a,d,l)=>Ai(a,d,l,i,n)}}function _i(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=I(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(f).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:re(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(rt,{text:i.response,host:a})})]})}function Pi(i){return r(Ti,{...i,renderPreview:(n)=>r(T,{item:n})})}
2
- export{aa,_i,Pi};
1
+ import{rt}from"./chunk-ye7bksyy.js";import{Mi,Ai,Ei}from"./chunk-czp860hf.js";import{Ii}from"./chunk-3k1vzaxd.js";import{t}from"./chunk-cbp0q0yt.js";import{re}from"./chunk-ydxrj4as.js";import{nativeTurnId as f,textOf as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function sa(i,n){return{installUnlock:n==="none"?()=>()=>{}:Ai,preload:()=>{if(n!=="none")Mi(i)},playSequence:(a,d,l)=>Ei(a,d,l,i,n)}}function Pi(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=I(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(f).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:re(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(rt,{text:i.response,host:a})})]})}function Ti(i){return r(Ii,{...i,renderPreview:(n)=>r(T,{item:n})})}
2
+ export{sa,Pi,Ti};
@@ -1,2 +1,2 @@
1
- import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function ai(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
2
- export{ai};
1
+ import{nativeTurnId as a}from"@nyssance/codex-acp-v2/client";function si(o,i){let u=new Set,s=(e)=>{let t=e.items.map(a).find((r)=>r!==null),n=e.items.every((r)=>r.replayed);if(t===void 0||u.has(t))return{turnKey:e.key,turn:e,deferUntilReady:n};return u.add(t),{turnKey:`history:${t}`,aliases:[e.key],turn:e,deferUntilReady:n}};if(!i?.complete)return o.map(s);let d=new Map;for(let e of o){let t=e.items.map(a).find((r)=>r!==null);if(t===void 0)continue;let n=d.get(t)??[];n.push(e),d.set(t,n)}let l=new Set(i.turns.map((e)=>e.turnId)),y=new Set(i.loadedTurnIds);return[...i.turns.flatMap((e)=>{let t=d.get(e.turnId);if(t)return t.map(s);return y.has(e.turnId)?[]:[{turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,estimatedHeightPx:320,placeholder:!0}]}),...o.filter((e)=>!e.items.some((t)=>l.has(a(t)??""))).map(s)]}
2
+ export{si};