@alwith/module-chat 0.5.18 → 0.5.20

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 (555) hide show
  1. package/README.md +240 -1
  2. package/THIRD_PARTY_NOTICES.md +13 -0
  3. package/assets/catalogs/alwith/models.json +72 -0
  4. package/assets/catalogs/custom/models.json +604 -0
  5. package/assets/catalogs/custom/sources.json +168 -0
  6. package/assets/catalogs/deepseek/models.json +139 -0
  7. package/assets/catalogs/openrouter/models.json +231 -0
  8. package/assets/catalogs/qwen/models.json +253 -0
  9. package/assets/catalogs/xai/models.json +129 -0
  10. package/assets/provider-catalog.json +127 -0
  11. package/dist/activity-host.js +1 -1
  12. package/dist/approval/choice-elicitation-form.js +1 -1
  13. package/dist/approval/choice-schema.js +1 -1
  14. package/dist/approval/permission-options.js +1 -1
  15. package/dist/approval/permission-view.js +1 -1
  16. package/dist/approval/schema-elicitation-form.js +1 -1
  17. package/dist/approval/url-elicitation-card.js +1 -1
  18. package/dist/chunk-0643swd4.js +2 -0
  19. package/dist/chunk-06zh85wp.js +3 -0
  20. package/dist/chunk-0p6y2t9b.js +2 -0
  21. package/dist/{chunk-fexvhys2.js → chunk-0wa9yjg3.js} +2 -2
  22. package/dist/chunk-0whxm2f0.js +2 -0
  23. package/dist/chunk-11484wvv.js +2 -0
  24. package/dist/{chunk-s55n9cby.js → chunk-1fggcrvs.js} +2 -2
  25. package/dist/chunk-1k21j77z.js +2 -0
  26. package/dist/chunk-1k697ncv.js +2 -0
  27. package/dist/chunk-1mn2t6ga.js +2 -0
  28. package/dist/{chunk-kzq1797a.js → chunk-1qyxrh0n.js} +3 -3
  29. package/dist/chunk-1r25anvg.js +2 -0
  30. package/dist/chunk-1rg3nab3.js +2 -0
  31. package/dist/chunk-20k9syde.js +1 -0
  32. package/dist/chunk-28f3zv6v.js +2 -0
  33. package/dist/{chunk-djmnmbm2.js → chunk-2f9vjmxz.js} +2 -2
  34. package/dist/chunk-2t9j90mw.js +2 -0
  35. package/dist/{chunk-qp7aywgn.js → chunk-36m8zstj.js} +2 -2
  36. package/dist/chunk-3gk86w24.js +2 -0
  37. package/dist/chunk-3ka3bt0t.js +2 -0
  38. package/dist/{chunk-65m4bm74.js → chunk-3s94ekrs.js} +2 -2
  39. package/dist/chunk-3vsc49pt.js +2 -0
  40. package/dist/{chunk-mzh48e09.js → chunk-3yxjh7b1.js} +2 -2
  41. package/dist/{chunk-2pj3pcc7.js → chunk-42atrgm1.js} +2 -2
  42. package/dist/{chunk-as1cvbzm.js → chunk-48fj5m0p.js} +2 -2
  43. package/dist/chunk-4bb6dzzs.js +2 -0
  44. package/dist/chunk-4d853988.js +2 -0
  45. package/dist/chunk-4gyd9hx9.js +2 -0
  46. package/dist/chunk-4p6svs37.js +2 -0
  47. package/dist/chunk-4ygyb91q.js +2 -0
  48. package/dist/chunk-581e33tz.js +2 -0
  49. package/dist/{chunk-hfaarm10.js → chunk-5a6xc345.js} +2 -2
  50. package/dist/chunk-5ap6fvrp.js +2 -0
  51. package/dist/chunk-5m7vc4s6.js +2 -0
  52. package/dist/chunk-615a0yhh.js +2 -0
  53. package/dist/chunk-62jm1gct.js +2 -0
  54. package/dist/{chunk-ykp85wc1.js → chunk-667z0pac.js} +2 -2
  55. package/dist/chunk-6syhjege.js +2 -0
  56. package/dist/{chunk-m9en74e3.js → chunk-6t5war9h.js} +2 -2
  57. package/dist/chunk-7z4gtfkd.js +2 -0
  58. package/dist/{chunk-4z4tec0p.js → chunk-855w49k0.js} +2 -2
  59. package/dist/chunk-8akwfgkq.js +2 -0
  60. package/dist/chunk-8c8ncw1m.js +2 -0
  61. package/dist/chunk-8mgypdap.js +2 -0
  62. package/dist/chunk-95mynf7q.js +1289 -0
  63. package/dist/{chunk-01denvg2.js → chunk-9jp5t3qq.js} +5 -5
  64. package/dist/chunk-9mky3b7v.js +2 -0
  65. package/dist/chunk-a63k8tht.js +2 -0
  66. package/dist/chunk-acb8t4jt.js +2 -0
  67. package/dist/chunk-adk7aeyt.js +2 -0
  68. package/dist/{chunk-rvr6zj7p.js → chunk-agqnt7xq.js} +2 -2
  69. package/dist/chunk-annzfgfq.js +4 -0
  70. package/dist/{chunk-qz8gpb9j.js → chunk-azfmr99x.js} +2 -2
  71. package/dist/chunk-b12v22de.js +2 -0
  72. package/dist/{chunk-w390ewja.js → chunk-b18zr059.js} +2 -2
  73. package/dist/chunk-bbyscgdd.js +2 -0
  74. package/dist/chunk-bfhfbrzt.js +2 -0
  75. package/dist/{chunk-5x4an3fb.js → chunk-bg03czcx.js} +2 -2
  76. package/dist/chunk-bvgqsaey.js +2 -0
  77. package/dist/chunk-c32z3wjq.js +2 -0
  78. package/dist/chunk-ckyat78p.js +2 -0
  79. package/dist/chunk-cvz3k5gk.js +2 -0
  80. package/dist/chunk-d0vhdr07.js +2 -0
  81. package/dist/chunk-d257n8gj.js +2 -0
  82. package/dist/chunk-dfgak1md.js +2 -0
  83. package/dist/{chunk-d7gjvz8z.js → chunk-drhzcs6e.js} +2 -2
  84. package/dist/{chunk-2qhbm5y9.js → chunk-dte0n4kf.js} +2 -2
  85. package/dist/chunk-erjscd1r.js +4 -0
  86. package/dist/chunk-f1x483c9.js +2 -0
  87. package/dist/chunk-f2w2sct6.js +2 -0
  88. package/dist/{chunk-6nnwmqqp.js → chunk-f5gsffbv.js} +2 -2
  89. package/dist/chunk-feg5rp9g.js +2 -0
  90. package/dist/chunk-ffspd86m.js +2 -0
  91. package/dist/chunk-fh3pjhe6.js +2 -0
  92. package/dist/chunk-fnpf84rf.js +4 -0
  93. package/dist/chunk-g2qcyqc6.js +2 -0
  94. package/dist/chunk-g44hhdha.js +2 -0
  95. package/dist/chunk-g9t2d8hg.js +2 -0
  96. package/dist/chunk-g9yg36dh.js +3 -0
  97. package/dist/{chunk-m4dgha79.js → chunk-gha517v4.js} +2 -2
  98. package/dist/chunk-grr1k5zn.js +2 -0
  99. package/dist/{chunk-4zzhckab.js → chunk-gsfgdnfp.js} +2 -2
  100. package/dist/chunk-h491shsg.js +2 -0
  101. package/dist/chunk-ha46rhzj.js +2 -0
  102. package/dist/{chunk-39sbgvd3.js → chunk-hd7bk591.js} +2 -2
  103. package/dist/chunk-heyqzkxq.js +2 -0
  104. package/dist/chunk-hp4a0e8c.js +2 -0
  105. package/dist/chunk-j69t1f4a.js +2 -0
  106. package/dist/chunk-j8v3sfpv.js +2 -0
  107. package/dist/{chunk-1wpdb17m.js → chunk-jgd6dcgy.js} +2 -2
  108. package/dist/chunk-jmb8r6aj.js +2 -0
  109. package/dist/chunk-jwt7q6yx.js +4 -0
  110. package/dist/chunk-jxntqarp.js +2 -0
  111. package/dist/chunk-k64wvbbc.js +2 -0
  112. package/dist/{chunk-n56csv51.js → chunk-k7ye738q.js} +2 -2
  113. package/dist/chunk-kbeme4w0.js +3 -0
  114. package/dist/{chunk-wrkwz65x.js → chunk-kc56dhwd.js} +2 -2
  115. package/dist/{chunk-2g8targj.js → chunk-kmdag4vy.js} +2 -2
  116. package/dist/chunk-kq48hbd5.js +2 -0
  117. package/dist/chunk-ktvh4yb5.js +2 -0
  118. package/dist/chunk-kz1kjzmq.js +2 -0
  119. package/dist/chunk-m271yxxm.js +2 -0
  120. package/dist/chunk-mj7094yh.js +2 -0
  121. package/dist/chunk-mr6k70s4.js +2 -0
  122. package/dist/chunk-mv51zgj1.js +2 -0
  123. package/dist/{chunk-dnsmr5nf.js → chunk-mvs2dzyt.js} +2 -2
  124. package/dist/chunk-mz8a6292.js +2 -0
  125. package/dist/chunk-n5v1h0sk.js +2 -0
  126. package/dist/{chunk-w38vbf7h.js → chunk-n66yy1m1.js} +2 -2
  127. package/dist/chunk-n9gq2wbz.js +3 -0
  128. package/dist/chunk-nxyrrmz8.js +2 -0
  129. package/dist/chunk-p7dd93e5.js +2 -0
  130. package/dist/chunk-p8g927x6.js +2 -0
  131. package/dist/chunk-pk2rvqd0.js +2 -0
  132. package/dist/{chunk-c2bkhrcc.js → chunk-pprt7ntb.js} +4 -4
  133. package/dist/{chunk-kv0tnq8g.js → chunk-pwjz3yxb.js} +2 -2
  134. package/dist/{chunk-yy4tw3nj.js → chunk-px1ehzwc.js} +2 -2
  135. package/dist/chunk-pzjag1mt.js +4 -0
  136. package/dist/chunk-q2gfd4jk.js +2 -0
  137. package/dist/{chunk-jp73gpbp.js → chunk-q9ef9n7b.js} +2 -2
  138. package/dist/chunk-q9zawfn1.js +2 -0
  139. package/dist/chunk-qd1z91fm.js +2 -0
  140. package/dist/chunk-qdg5zphd.js +2 -0
  141. package/dist/chunk-qn6ppn0r.js +2 -0
  142. package/dist/{chunk-ahtyazfy.js → chunk-qwfw4xpn.js} +2 -2
  143. package/dist/chunk-r7s7kx38.js +3 -0
  144. package/dist/chunk-r9sweaq4.js +2 -0
  145. package/dist/{chunk-cazdmcwd.js → chunk-rbv1scqm.js} +2 -2
  146. package/dist/{chunk-fydcbjsx.js → chunk-rjkpe1fw.js} +3 -3
  147. package/dist/{chunk-yh9qdb2k.js → chunk-rjw63t34.js} +3 -3
  148. package/dist/chunk-rkfq0c0p.js +2 -0
  149. package/dist/chunk-rq5e0922.js +2 -0
  150. package/dist/chunk-s4wjckd1.js +7 -0
  151. package/dist/chunk-s8s65pj2.js +2 -0
  152. package/dist/chunk-ssxbxanb.js +2 -0
  153. package/dist/{chunk-d5w1nvrz.js → chunk-swpy2b9a.js} +2 -2
  154. package/dist/{chunk-2r3sfmyf.js → chunk-t7drk9ja.js} +2 -2
  155. package/dist/chunk-tpbqg729.js +2 -0
  156. package/dist/chunk-ttn8ss6b.js +2 -0
  157. package/dist/chunk-tv0fwt2g.js +2 -0
  158. package/dist/chunk-v5pbaf9x.js +2 -0
  159. package/dist/chunk-vbab9hc4.js +2 -0
  160. package/dist/{chunk-nxk65z2e.js → chunk-vfhxerxt.js} +2 -2
  161. package/dist/chunk-vnsgjnp3.js +2 -0
  162. package/dist/{chunk-0mze2qnw.js → chunk-vt6cyes7.js} +2 -2
  163. package/dist/chunk-vzgv360q.js +2 -0
  164. package/dist/{chunk-01dqjas2.js → chunk-wccx911q.js} +2 -2
  165. package/dist/{chunk-rf9yxbes.js → chunk-wgrmjfyp.js} +2 -2
  166. package/dist/chunk-wvry7t79.js +2 -0
  167. package/dist/chunk-x2nemdjf.js +2 -0
  168. package/dist/{chunk-7g79m27w.js → chunk-x99fyd88.js} +2 -2
  169. package/dist/chunk-xdm2are3.js +2 -0
  170. package/dist/chunk-xft0s40a.js +3 -0
  171. package/dist/chunk-y0q6jwq4.js +2 -0
  172. package/dist/chunk-y6kzbbya.js +2 -0
  173. package/dist/{chunk-2swp3nfs.js → chunk-y97ne5kj.js} +2 -2
  174. package/dist/chunk-yakar0e2.js +2 -0
  175. package/dist/chunk-yg3xhn5m.js +2 -0
  176. package/dist/{chunk-txn8v2yc.js → chunk-z3nybrbb.js} +2 -2
  177. package/dist/codex/activity-group.js +1 -1
  178. package/dist/codex/assistant-message.js +1 -1
  179. package/dist/codex/async-question-card.js +1 -1
  180. package/dist/codex/disclosure-state.js +1 -1
  181. package/dist/codex/edited-files-card.js +1 -1
  182. package/dist/codex/image-view-activity.js +1 -1
  183. package/dist/codex/markdown-renderer.js +1 -1
  184. package/dist/codex/navigation-audio.js +1 -1
  185. package/dist/codex/navigation-preview.js +1 -1
  186. package/dist/codex/navigation-rail.js +1 -1
  187. package/dist/codex/patch-view.js +1 -1
  188. package/dist/codex/plan.js +1 -1
  189. package/dist/codex/styles.css +2 -1
  190. package/dist/codex/timeline-virtualizer.js +1 -1
  191. package/dist/codex/turn-activity.js +1 -1
  192. package/dist/codex/user-message.js +1 -1
  193. package/dist/codex/virtualized-turn-list.js +1 -1
  194. package/dist/collections/collection-emoji.d.ts +4 -0
  195. package/dist/collections/collection-emoji.js +1 -0
  196. package/dist/collections/collection-menu.d.ts +15 -0
  197. package/dist/collections/collection-menu.js +1 -0
  198. package/dist/collections/collection-panel.d.ts +11 -0
  199. package/dist/collections/collection-panel.js +1 -0
  200. package/dist/collections/collections.d.ts +6 -0
  201. package/dist/collections/collections.js +1 -0
  202. package/dist/collections/host.d.ts +19 -0
  203. package/dist/collections/host.js +1 -0
  204. package/dist/collections/locales.d.ts +71 -0
  205. package/dist/collections/locales.js +1 -0
  206. package/dist/collections/model.d.ts +95 -0
  207. package/dist/collections/model.js +1 -0
  208. package/dist/collections/store.d.ts +30 -0
  209. package/dist/collections/store.js +1 -0
  210. package/dist/composer/completion-filter.js +1 -1
  211. package/dist/composer/completion-menu.js +1 -1
  212. package/dist/composer/completion-trigger.js +1 -1
  213. package/dist/composer/effort-slider.js +1 -1
  214. package/dist/composer/menu-radio.js +1 -1
  215. package/dist/composer/model-select.d.ts +1 -1
  216. package/dist/composer/model-select.js +1 -1
  217. package/dist/composer/permission-mode-select.js +1 -1
  218. package/dist/composer/prompt-input-attachments.js +1 -1
  219. package/dist/composer/prompt-input-clipboard.js +1 -1
  220. package/dist/composer/prompt-input-context.js +1 -1
  221. package/dist/composer/prompt-input-textarea.d.ts +1 -1
  222. package/dist/composer/prompt-input-textarea.js +1 -1
  223. package/dist/composer/prompt-input.d.ts +1 -1
  224. package/dist/composer/prompt-input.js +1 -1
  225. package/dist/conversation/action-card.js +1 -1
  226. package/dist/conversation/composer/composer.js +1 -1
  227. package/dist/conversation/composer/config-options.js +1 -1
  228. package/dist/conversation/composer/context.js +1 -1
  229. package/dist/conversation/composer/drafts.js +1 -1
  230. package/dist/conversation/composer/file-items.js +1 -1
  231. package/dist/conversation/composer/long-text.js +1 -1
  232. package/dist/conversation/composer/mention-chips.js +1 -1
  233. package/dist/conversation/composer/mention-uri.js +1 -1
  234. package/dist/conversation/composer/model-menu.js +1 -1
  235. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  236. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  237. package/dist/conversation/composer/prediction.js +1 -1
  238. package/dist/conversation/composer/slash-command-button.js +1 -1
  239. package/dist/conversation/composer/submit-button.js +1 -1
  240. package/dist/conversation/composer/usage-meter.js +1 -1
  241. package/dist/conversation/connection-notice.d.ts +8 -0
  242. package/dist/conversation/connection-notice.js +1 -0
  243. package/dist/conversation/context.js +1 -1
  244. package/dist/conversation/conversation-body.js +1 -1
  245. package/dist/conversation/conversation-search.d.ts +8 -0
  246. package/dist/conversation/conversation-search.js +1 -0
  247. package/dist/conversation/conversation-view.d.ts +1 -0
  248. package/dist/conversation/conversation-view.js +1 -1
  249. package/dist/conversation/conversation.d.ts +3 -0
  250. package/dist/conversation/conversation.js +1 -1
  251. package/dist/conversation/diff-modal.js +1 -1
  252. package/dist/conversation/draft-project-picker.d.ts +7 -0
  253. package/dist/conversation/draft-project-picker.js +1 -0
  254. package/dist/conversation/session-actions.js +1 -1
  255. package/dist/conversation/subagent-sessions.js +1 -1
  256. package/dist/conversation/types.d.ts +6 -1
  257. package/dist/image-lightbox.js +1 -1
  258. package/dist/image-preview-dialog.js +1 -1
  259. package/dist/lib/code-highlighter.js +1 -1
  260. package/dist/lib/fuzzy.js +1 -1
  261. package/dist/lib/group-blocks.js +1 -1
  262. package/dist/lib/image-encode.js +1 -1
  263. package/dist/lib/limits.js +1 -1
  264. package/dist/lib/markdown-parser.js +1 -1
  265. package/dist/lib/markdown-rules.js +1 -1
  266. package/dist/lib/model-name.js +1 -1
  267. package/dist/lib/pointer-centered-zoom.js +1 -1
  268. package/dist/lib/prepare-prompt-files.js +1 -1
  269. package/dist/lib/stream-style.js +1 -1
  270. package/dist/lib/streaming-markdown.js +1 -1
  271. package/dist/locales.d.ts +1914 -0
  272. package/dist/locales.js +1 -1
  273. package/dist/plugins/catalog-header.d.ts +6 -0
  274. package/dist/plugins/catalog-header.js +1 -0
  275. package/dist/plugins/catalog-skeleton.d.ts +3 -0
  276. package/dist/plugins/catalog-skeleton.js +1 -0
  277. package/dist/plugins/host.d.ts +49 -0
  278. package/dist/plugins/host.js +1 -0
  279. package/dist/plugins/locales.d.ts +1136 -0
  280. package/dist/plugins/locales.js +1 -0
  281. package/dist/plugins/new-chat-directory.d.ts +2 -0
  282. package/dist/plugins/new-chat-directory.js +1 -0
  283. package/dist/plugins/pane.d.ts +12 -0
  284. package/dist/plugins/pane.js +1 -0
  285. package/dist/plugins/panel-item.d.ts +8 -0
  286. package/dist/plugins/panel-item.js +1 -0
  287. package/dist/plugins/plugin-detail-page.d.ts +5 -0
  288. package/dist/plugins/plugin-detail-page.js +1 -0
  289. package/dist/plugins/plugin-icon.d.ts +7 -0
  290. package/dist/plugins/plugin-icon.js +1 -0
  291. package/dist/plugins/plugin-icons.d.ts +1 -0
  292. package/dist/plugins/plugin-icons.js +1 -0
  293. package/dist/plugins/plugins-page.d.ts +12 -0
  294. package/dist/plugins/plugins-page.js +1 -0
  295. package/dist/plugins/plugins.css +199 -0
  296. package/dist/plugins/plugins.d.ts +14 -0
  297. package/dist/plugins/plugins.js +1 -0
  298. package/dist/plugins/read-skill-document.d.ts +2 -0
  299. package/dist/plugins/read-skill-document.js +1 -0
  300. package/dist/plugins/skill-document.d.ts +7 -0
  301. package/dist/plugins/skill-document.js +1 -0
  302. package/dist/plugins/skills-tab.d.ts +6 -0
  303. package/dist/plugins/skills-tab.js +1 -0
  304. package/dist/plugins/store.d.ts +62 -0
  305. package/dist/plugins/store.js +1 -0
  306. package/dist/plugins/toolbox-layout.d.ts +7 -0
  307. package/dist/plugins/toolbox-layout.js +1 -0
  308. package/dist/search/chat-search.css +9 -0
  309. package/dist/search/chat-search.d.ts +1 -0
  310. package/dist/search/chat-search.js +1 -1
  311. package/dist/search/codex-source-matches.d.ts +4 -0
  312. package/dist/search/codex-source-matches.js +1 -0
  313. package/dist/search/dom-matches.js +1 -1
  314. package/dist/search/find-bar.js +1 -1
  315. package/dist/search/literal-matches.js +1 -1
  316. package/dist/session-list/account-menu.d.ts +26 -0
  317. package/dist/session-list/account-menu.js +1 -0
  318. package/dist/session-list/activity-list.d.ts +11 -0
  319. package/dist/session-list/activity-list.js +1 -0
  320. package/dist/session-list/archived-sessions.js +1 -1
  321. package/dist/session-list/help-menu.d.ts +5 -0
  322. package/dist/session-list/help-menu.js +1 -0
  323. package/dist/session-list/highlight.js +1 -1
  324. package/dist/session-list/host.d.ts +2 -0
  325. package/dist/session-list/host.js +1 -1
  326. package/dist/session-list/hover-info-card.js +1 -1
  327. package/dist/session-list/locales.d.ts +91 -0
  328. package/dist/session-list/locales.js +1 -1
  329. package/dist/session-list/navigation-header.d.ts +14 -0
  330. package/dist/session-list/navigation-header.js +1 -0
  331. package/dist/session-list/navigation-store.d.ts +19 -0
  332. package/dist/session-list/navigation-store.js +1 -0
  333. package/dist/session-list/navigation-tabs.d.ts +20 -0
  334. package/dist/session-list/navigation-tabs.js +1 -0
  335. package/dist/session-list/navigation.js +1 -1
  336. package/dist/session-list/overflow-marquee.js +1 -1
  337. package/dist/session-list/platform.d.ts +2 -0
  338. package/dist/session-list/platform.js +1 -0
  339. package/dist/session-list/row-stop-button.js +1 -1
  340. package/dist/session-list/session-groups.js +1 -1
  341. package/dist/session-list/session-info-card.js +1 -1
  342. package/dist/session-list/session-list.d.ts +10 -0
  343. package/dist/session-list/session-list.js +1 -1
  344. package/dist/session-list/session-row.js +1 -1
  345. package/dist/session-list/session-state-dot.js +1 -1
  346. package/dist/session-list/session-state-menu.js +1 -1
  347. package/dist/session-list/shortcut-hint.d.ts +14 -0
  348. package/dist/session-list/shortcut-hint.js +1 -0
  349. package/dist/session-list/shortcut.d.ts +2 -0
  350. package/dist/session-list/shortcut.js +1 -0
  351. package/dist/session-list/sidebar-overlay.js +1 -1
  352. package/dist/session-list/trailing-swap.js +1 -1
  353. package/dist/session-list/use-activity-notification.d.ts +1 -0
  354. package/dist/session-list/use-activity-notification.js +1 -0
  355. package/dist/session-list/use-activity-preview.js +1 -1
  356. package/dist/session-list/use-cmd-held.d.ts +1 -0
  357. package/dist/session-list/use-cmd-held.js +1 -0
  358. package/dist/session-list/use-project-sessions.js +1 -1
  359. package/dist/session-list/virtual-session-rows.js +1 -1
  360. package/dist/session-timeline/activity-group.js +1 -1
  361. package/dist/session-timeline/activity-projection.js +1 -1
  362. package/dist/session-timeline/assistant-content.js +1 -1
  363. package/dist/session-timeline/assistant-turn.js +1 -1
  364. package/dist/session-timeline/async-questions.js +1 -1
  365. package/dist/session-timeline/edited-files-card.js +1 -1
  366. package/dist/session-timeline/history-timeline.js +1 -1
  367. package/dist/session-timeline/host.js +1 -1
  368. package/dist/session-timeline/navigation-rail.js +1 -1
  369. package/dist/session-timeline/plan.js +1 -1
  370. package/dist/session-timeline/question-reply.js +1 -1
  371. package/dist/session-timeline/resource-content.js +1 -1
  372. package/dist/session-timeline/session-timeline.js +1 -1
  373. package/dist/session-timeline/timeline-registry.js +1 -1
  374. package/dist/session-timeline/turn-activity.js +1 -1
  375. package/dist/session-timeline/turn-error.js +1 -1
  376. package/dist/session-timeline/turn-retry.js +1 -1
  377. package/dist/session-timeline/turn-time.js +1 -1
  378. package/dist/session-timeline/turns.js +1 -1
  379. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  380. package/dist/session-timeline/user-message.js +1 -1
  381. package/dist/settings/codex-account-card.d.ts +18 -0
  382. package/dist/settings/codex-account-card.js +1 -0
  383. package/dist/settings/login-card.d.ts +6 -0
  384. package/dist/settings/login-card.js +1 -0
  385. package/dist/settings/model-alias-settings.d.ts +6 -0
  386. package/dist/settings/model-alias-settings.js +1 -0
  387. package/dist/settings/model-aliases.d.ts +17 -0
  388. package/dist/settings/model-aliases.js +1 -0
  389. package/dist/settings/provider-logos.d.ts +5 -0
  390. package/dist/settings/provider-logos.js +1 -0
  391. package/dist/settings/provider-section.d.ts +52 -0
  392. package/dist/settings/provider-section.js +1 -0
  393. package/dist/settings/providers-port.d.ts +32 -0
  394. package/dist/settings/providers-port.js +1 -0
  395. package/dist/settings/providers.d.ts +92 -0
  396. package/dist/settings/providers.js +1 -0
  397. package/dist/settings/settings-bridge.d.ts +39 -0
  398. package/dist/settings/settings-bridge.js +1 -0
  399. package/dist/settings/settings.d.ts +9 -0
  400. package/dist/settings/settings.js +1 -0
  401. package/dist/stage.d.ts +1 -0
  402. package/dist/stage.js +1 -1
  403. package/emojibase/LICENSE +21 -0
  404. package/emojibase/en/data.json +51183 -0
  405. package/emojibase/en/messages.json +124 -0
  406. package/emojibase/zh/data.json +48992 -0
  407. package/emojibase/zh/messages.json +124 -0
  408. package/licenses/_dnd-kit_core-LICENSE +21 -0
  409. package/licenses/_dnd-kit_sortable-LICENSE +21 -0
  410. package/licenses/_dnd-kit_utilities-LICENSE +21 -0
  411. package/licenses/_solar-icons_react-LICENSE +11 -0
  412. package/licenses/_solar-icons_react-LICENSE-THIRD-PARTY +14 -0
  413. package/licenses/frimousse-LICENSE +21 -0
  414. package/package.json +41 -7
  415. package/rust/Cargo.lock +3844 -0
  416. package/rust/Cargo.toml +29 -0
  417. package/rust/build.rs +16 -0
  418. package/rust/permissions/autogenerated/reference.md +296 -0
  419. package/rust/permissions/default.toml +20 -0
  420. package/rust/permissions/schemas/schema.json +292 -0
  421. package/rust/src/lib.rs +79 -0
  422. package/rust/src/providers/managed.rs +801 -0
  423. package/rust/src/providers/tests.rs +681 -0
  424. package/rust/src/providers.rs +984 -0
  425. package/rust/src/skills.rs +130 -0
  426. package/dist/chunk-074x98ak.js +0 -2
  427. package/dist/chunk-0c8fy456.js +0 -4
  428. package/dist/chunk-0dnwqm94.js +0 -2
  429. package/dist/chunk-0nkvfecf.js +0 -1
  430. package/dist/chunk-0ss92kxr.js +0 -2
  431. package/dist/chunk-12fcr66z.js +0 -2
  432. package/dist/chunk-14r2ktqe.js +0 -3
  433. package/dist/chunk-180zvfd6.js +0 -2
  434. package/dist/chunk-1fm5vx1n.js +0 -1
  435. package/dist/chunk-2a3tezgr.js +0 -1
  436. package/dist/chunk-2rperg04.js +0 -1
  437. package/dist/chunk-3919sqde.js +0 -2
  438. package/dist/chunk-3dckftt6.js +0 -2
  439. package/dist/chunk-3k5n3809.js +0 -2
  440. package/dist/chunk-3z6rx5qv.js +0 -4
  441. package/dist/chunk-4s1rhts0.js +0 -1
  442. package/dist/chunk-58wt406v.js +0 -1
  443. package/dist/chunk-59g9h4v1.js +0 -2
  444. package/dist/chunk-59j0p8hy.js +0 -2
  445. package/dist/chunk-6s7z09b0.js +0 -2
  446. package/dist/chunk-6t3tgzps.js +0 -2
  447. package/dist/chunk-6wqbetcx.js +0 -1
  448. package/dist/chunk-75zcgcqm.js +0 -2
  449. package/dist/chunk-7ap638hx.js +0 -2
  450. package/dist/chunk-7jdjdnh6.js +0 -2
  451. package/dist/chunk-7wyrcphh.js +0 -1
  452. package/dist/chunk-83sz9mv9.js +0 -3
  453. package/dist/chunk-88cfz41t.js +0 -2
  454. package/dist/chunk-8bfnjqkg.js +0 -2
  455. package/dist/chunk-8g09jrj1.js +0 -2
  456. package/dist/chunk-8v1bjdgv.js +0 -2
  457. package/dist/chunk-90wm9rxz.js +0 -2
  458. package/dist/chunk-91h14q3y.js +0 -2
  459. package/dist/chunk-96x0d2vd.js +0 -1
  460. package/dist/chunk-9gv1zffv.js +0 -1
  461. package/dist/chunk-9j609g4n.js +0 -1
  462. package/dist/chunk-afd3bq7v.js +0 -2
  463. package/dist/chunk-bew4srqj.js +0 -2
  464. package/dist/chunk-bj5ma2sv.js +0 -2
  465. package/dist/chunk-bv4adcrd.js +0 -2
  466. package/dist/chunk-c1vavp0q.js +0 -2
  467. package/dist/chunk-c26vy827.js +0 -2
  468. package/dist/chunk-cc0tan75.js +0 -2
  469. package/dist/chunk-d5ga13n0.js +0 -1
  470. package/dist/chunk-d94rmh12.js +0 -2
  471. package/dist/chunk-da4m33bg.js +0 -2
  472. package/dist/chunk-da6d6wze.js +0 -1
  473. package/dist/chunk-e99sdapw.js +0 -2
  474. package/dist/chunk-ea3582qy.js +0 -1
  475. package/dist/chunk-ebmbz9tg.js +0 -2
  476. package/dist/chunk-frbeen15.js +0 -2
  477. package/dist/chunk-ftcydsbs.js +0 -2
  478. package/dist/chunk-gdpa9dp5.js +0 -1
  479. package/dist/chunk-gz7adphb.js +0 -2
  480. package/dist/chunk-gzeg6bqp.js +0 -2
  481. package/dist/chunk-h68f23r0.js +0 -1
  482. package/dist/chunk-h99fy0g3.js +0 -4
  483. package/dist/chunk-jdjk6tf4.js +0 -1
  484. package/dist/chunk-jjnmq2zj.js +0 -3
  485. package/dist/chunk-khj3ye94.js +0 -7
  486. package/dist/chunk-kjtd3wc3.js +0 -1
  487. package/dist/chunk-kmhwwzga.js +0 -2
  488. package/dist/chunk-mr1azhef.js +0 -1
  489. package/dist/chunk-n0xzhjdg.js +0 -2
  490. package/dist/chunk-n1tjf64a.js +0 -2
  491. package/dist/chunk-n5xqjct2.js +0 -1
  492. package/dist/chunk-nqv69z6n.js +0 -2
  493. package/dist/chunk-pv35kspb.js +0 -1
  494. package/dist/chunk-pw6p654f.js +0 -3
  495. package/dist/chunk-q6km9nha.js +0 -2
  496. package/dist/chunk-qca5mhqd.js +0 -2
  497. package/dist/chunk-qxabrz98.js +0 -2
  498. package/dist/chunk-r1988zpy.js +0 -2
  499. package/dist/chunk-s0ef3h7b.js +0 -2
  500. package/dist/chunk-sespfp7t.js +0 -4
  501. package/dist/chunk-sf6ze845.js +0 -2
  502. package/dist/chunk-sxgc25gz.js +0 -2
  503. package/dist/chunk-tq6ekz3s.js +0 -2
  504. package/dist/chunk-vp8fb7r8.js +0 -2
  505. package/dist/chunk-w1awbykg.js +0 -2
  506. package/dist/chunk-wpdn3rx8.js +0 -1
  507. package/dist/chunk-x1xh8y2s.js +0 -2
  508. package/dist/chunk-x8kxqtva.js +0 -2
  509. package/dist/chunk-xfx689xm.js +0 -3
  510. package/dist/chunk-y6afvrnv.js +0 -2
  511. package/dist/chunk-zb4mqy8f.js +0 -2
  512. package/dist/ui/alert.d.ts +0 -10
  513. package/dist/ui/alert.js +0 -1
  514. package/dist/ui/badge.d.ts +0 -7
  515. package/dist/ui/badge.js +0 -1
  516. package/dist/ui/button.d.ts +0 -8
  517. package/dist/ui/button.js +0 -1
  518. package/dist/ui/card.d.ts +0 -11
  519. package/dist/ui/card.js +0 -1
  520. package/dist/ui/checkbox.d.ts +0 -3
  521. package/dist/ui/checkbox.js +0 -1
  522. package/dist/ui/dialog.d.ts +0 -17
  523. package/dist/ui/dialog.js +0 -1
  524. package/dist/ui/dropdown-menu.d.ts +0 -29
  525. package/dist/ui/dropdown-menu.js +0 -1
  526. package/dist/ui/empty.d.ts +0 -11
  527. package/dist/ui/empty.js +0 -1
  528. package/dist/ui/field.d.ts +0 -24
  529. package/dist/ui/field.js +0 -1
  530. package/dist/ui/hover-card.d.ts +0 -5
  531. package/dist/ui/hover-card.js +0 -1
  532. package/dist/ui/input-group.d.ts +0 -18
  533. package/dist/ui/input-group.js +0 -1
  534. package/dist/ui/input.d.ts +0 -3
  535. package/dist/ui/input.js +0 -1
  536. package/dist/ui/kbd.d.ts +0 -3
  537. package/dist/ui/kbd.js +0 -1
  538. package/dist/ui/label.d.ts +0 -3
  539. package/dist/ui/label.js +0 -1
  540. package/dist/ui/radio-group.d.ts +0 -5
  541. package/dist/ui/radio-group.js +0 -1
  542. package/dist/ui/select.d.ts +0 -15
  543. package/dist/ui/select.js +0 -1
  544. package/dist/ui/separator.d.ts +0 -3
  545. package/dist/ui/separator.js +0 -1
  546. package/dist/ui/skeleton.d.ts +0 -2
  547. package/dist/ui/skeleton.js +0 -1
  548. package/dist/ui/spinner.d.ts +0 -2
  549. package/dist/ui/spinner.js +0 -1
  550. package/dist/ui/switch.d.ts +0 -5
  551. package/dist/ui/switch.js +0 -1
  552. package/dist/ui/textarea.d.ts +0 -3
  553. package/dist/ui/textarea.js +0 -1
  554. package/dist/ui/tooltip.d.ts +0 -6
  555. package/dist/ui/tooltip.js +0 -1
@@ -1,5 +1,5 @@
1
- import{en}from"./chunk-kzq1797a.js";import{t}from"./chunk-q6km9nha.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function zr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
- `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Ur(o){let s=new Map,e=null;for(let n of o.split(`
3
- `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function $r(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Ur(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?zr(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
- ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function zo({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(en,{files:$r(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
- export{zr,Ur,$r,zo};
1
+ import{yn}from"./chunk-1qyxrh0n.js";import{t}from"./chunk-mv51zgj1.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as g,Fragment as h}from"react/jsx-runtime";function jr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
+ `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function $r(o){let s=new Map,e=null;for(let n of o.split(`
3
+ `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Kr(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?$r(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let d=u(i,r),f=n.patch?jr(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=d.additions,l.deletions+=d.deletions,l.patch=l.patch?`${l.patch}
4
+ ${f}`:f;else s.set(r,{path:r,patch:f,...d})}}return[...s.values()]}function ui({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return c(yn,{files:Kr(o),actions:s.EditedFilesActions?c(s.EditedFilesActions,{items:o}):void 0,onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[c(n,{path:i.path,className:"codex-edited-file-icon"}),c("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
+ export{jr,$r,Kr,ui};
@@ -0,0 +1,2 @@
1
+ var y={ar:{untitled:"دردشة جديدة",signOut:"تسجيل الخروج",help:"مساعدة",language:"اللغة",foreground:"المقدمة",background:"الخلفية",chats:"الدردشات",activity:"نشاط",quickChats:"دردشات سريعة",retry:"إعادة المحاولة",stop:"إيقاف",rename:"إعادة تسمية",fork:"إنشاء فرع",archive:"أرشفة",unarchive:"استعادة",delete:"حذف",deleteTitle:"حذف هذه الدردشة؟",deleteDescription:"ستُحذف هذه الدردشة نهائيًا. لا يمكن التراجع عن هذا الإجراء.",cancel:"إلغاء",archived:"مؤرشفة"},de:{untitled:"Neuer Chat",signOut:"Abmelden",help:"Hilfe",language:"Sprache",foreground:"Vordergrund",background:"Hintergrund",chats:"Chats",activity:"Aktivität",quickChats:"Schnelle Chats",retry:"Wiederholen",stop:"Stopp",rename:"Umbenennen",fork:"Verzweigen",archive:"Archivieren",unarchive:"Wiederherstellen",delete:"Löschen",deleteTitle:"Diesen Chat löschen?",deleteDescription:"Dieser Chat wird dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.",cancel:"Abbrechen",archived:"Archiviert"},en:{states:{title:"Session status",requires_action:"Needs attention",running:"Running",done:"Unread",idle:"Idle",empty:"No sessions"},untitled:"New chat",signOut:"Sign out",help:"Help",language:"Language",foreground:"Foreground",background:"Background",chats:"Chats",activity:"Activity",quickChats:"Quick chats",showAll:"Show all",retry:"Retry",stop:"Stop",rename:"Rename",fork:"Fork",archive:"Archive",unarchive:"Restore",delete:"Delete",deleteTitle:"Delete this chat?",deleteDescription:"This chat will be permanently deleted. This cannot be undone.",cancel:"Cancel",archived:"Archived",archives:{title:"Archived chats",deleteAll:"Delete all",search:"Search archived chats",chatType:"Chat type",allChats:"All chats",quickChats:"Quick chats",projectChats:"Project chats",project:"Project",allProjects:"All projects",noProject:"No project",count:"{{count}} chats",updatedAt:"Last updated",connecting:"Connect to Codex to view archived chats.",loading:"Loading archived chats…",retry:"Retry",empty:"No archived chats",noResults:"No matching archived chats",deleteTitle:"Delete archived chats?",deleteAllDescription:"Permanently delete these {{count}} archived chats? This cannot be undone. Deleting all includes chats hidden by the current filters.",deleteDescription:"Permanently delete this archived chat? This cannot be undone.",unarchive:"Unarchive",confirmDelete:"Delete permanently"}},es:{untitled:"Nuevo chat",signOut:"Cerrar sesión",help:"Ayuda",language:"Idioma",foreground:"Primer plano",background:"Fondo",chats:"Chats",activity:"Actividad",quickChats:"Chats rápidos",retry:"Reintentar",stop:"Detener",rename:"Renombrar",fork:"Crear rama",archive:"Archivar",unarchive:"Restaurar",delete:"Eliminar",deleteTitle:"¿Eliminar este chat?",deleteDescription:"Este chat se eliminará permanentemente. Esta acción no se puede deshacer.",cancel:"Cancelar",archived:"Archivados"},fr:{untitled:"Nouveau chat",signOut:"Se déconnecter",help:"Aide",language:"Langue",foreground:"Premier plan",background:"Arrière-plan",chats:"Discussions",activity:"Activité",quickChats:"Discussions rapides",retry:"Réessayer",stop:"Arrêter",rename:"Renommer",fork:"Créer une branche",archive:"Archiver",unarchive:"Restaurer",delete:"Supprimer",deleteTitle:"Supprimer cette discussion ?",deleteDescription:"Cette discussion sera définitivement supprimée. Cette action est irréversible.",cancel:"Annuler",archived:"Archivées"},hi:{untitled:"नई चैट",signOut:"साइन आउट",help:"सहायता",language:"भाषा",foreground:"अग्रभूमि",background:"पृष्ठभूमि",chats:"चैट",activity:"गतिविधि",quickChats:"त्वरित चैट",retry:"फिर से कोशिश करें",stop:"रोकें",rename:"नाम बदलें",fork:"शाखा बनाएँ",archive:"संग्रहित करें",unarchive:"रीस्टोर करें",delete:"हटाएं",deleteTitle:"यह चैट हटाएँ?",deleteDescription:"यह चैट स्थायी रूप से हटा दी जाएगी। इसे पूर्ववत नहीं किया जा सकता।",cancel:"रद्द करें",archived:"संग्रहीत"},id:{untitled:"Obrolan baru",signOut:"Keluar",help:"Bantuan",language:"Bahasa",foreground:"Depan",background:"Latar",chats:"Obrolan",activity:"Aktivitas",quickChats:"Chat cepat",retry:"Coba lagi",stop:"Hentikan",rename:"Ganti nama",fork:"Buat cabang",archive:"Arsipkan",unarchive:"Pulihkan",delete:"Hapus",deleteTitle:"Hapus obrolan ini?",deleteDescription:"Obrolan ini akan dihapus permanen. Tindakan ini tidak dapat dibatalkan.",cancel:"Batal",archived:"Diarsipkan"},it:{untitled:"Nuova chat",signOut:"Esci",help:"Aiuto",language:"Lingua",foreground:"Primo piano",background:"Sfondo",chats:"Chat",activity:"Attività",quickChats:"Chat rapide",retry:"Riprova",stop:"Interrompi",rename:"Rinomina",fork:"Crea un ramo",archive:"Archivia",unarchive:"Ripristina",delete:"Elimina",deleteTitle:"Eliminare questa chat?",deleteDescription:"Questa chat verrà eliminata definitivamente. L’azione non può essere annullata.",cancel:"Annulla",archived:"Archiviate"},ja:{untitled:"新しいチャット",signOut:"サインアウト",help:"ヘルプ",language:"言語",foreground:"フォアグラウンド",background:"背景",chats:"チャット",activity:"アクティビティ",quickChats:"クイックチャット",retry:"再試行",stop:"停止",rename:"名前を変更",fork:"分岐を作成",archive:"アーカイブ",unarchive:"復元",delete:"削除",deleteTitle:"このチャットを削除しますか?",deleteDescription:"このチャットは完全に削除されます。この操作は取り消せません。",cancel:"キャンセル",archived:"アーカイブ済み"},ko:{untitled:"새 채팅",signOut:"로그아웃",help:"도움말",language:"언어",foreground:"포그라운드",background:"배경",chats:"채팅",activity:"활동",quickChats:"빠른 채팅",retry:"다시 시도",stop:"중지",rename:"이름 바꾸기",fork:"분기 만들기",archive:"보관",unarchive:"복원",delete:"삭제",deleteTitle:"이 채팅을 삭제할까요?",deleteDescription:"이 채팅은 영구적으로 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",cancel:"취소",archived:"보관됨"},"pt-BR":{untitled:"Novo chat",signOut:"Sair",help:"Ajuda",language:"Idioma",foreground:"Primeiro plano",background:"Fundo",chats:"Chats",activity:"Atividade",quickChats:"Chats rápidos",retry:"Tentar novamente",stop:"Parar",rename:"Renomear",fork:"Criar ramificação",archive:"Arquivar",unarchive:"Restaurar",delete:"Excluir",deleteTitle:"Excluir esta conversa?",deleteDescription:"Esta conversa será excluída permanentemente. Esta ação não pode ser desfeita.",cancel:"Cancelar",archived:"Arquivadas"},ru:{untitled:"Новый чат",signOut:"Выйти",help:"Справка",language:"Язык",foreground:"Передний план",background:"Фон",chats:"Чаты",activity:"Активность",quickChats:"Быстрые чаты",retry:"Повторить",stop:"Остановить",rename:"Переименовать",fork:"Создать ветку",archive:"Архивировать",unarchive:"Восстановить",delete:"Удалить",deleteTitle:"Удалить этот чат?",deleteDescription:"Этот чат будет удалён навсегда. Это действие нельзя отменить.",cancel:"Отмена",archived:"В архиве"},"zh-CN":{states:{title:"会话状态",requires_action:"待处理",running:"运行中",done:"完成未读",idle:"空闲",empty:"暂无会话"},untitled:"新聊天",signOut:"退出登录",help:"帮助",language:"语言",foreground:"前台",background:"后台",chats:"聊天",activity:"活动",quickChats:"随聊",showAll:"展开显示",retry:"重试",stop:"停止",rename:"重命名",fork:"分叉",archive:"归档",unarchive:"恢复",delete:"删除",deleteTitle:"删除这个聊天?",deleteDescription:"该聊天将被永久删除。此操作不可撤销。",cancel:"取消",archived:"已归档",archives:{title:"已归档的聊天",deleteAll:"全部删除",search:"搜索已归档的聊天",chatType:"聊天类型",allChats:"全部聊天",quickChats:"快捷聊天",projectChats:"项目聊天",project:"项目",allProjects:"所有项目",noProject:"无项目",count:"{{count}} 个聊天",updatedAt:"最后更新时间",connecting:"连接 Codex 后查看已归档的聊天。",loading:"正在加载已归档的聊天…",retry:"重试",empty:"暂无已归档的聊天",noResults:"没有符合条件的已归档聊天",deleteTitle:"删除已归档的聊天?",deleteAllDescription:"永久删除这 {{count}} 个已归档的聊天?此操作无法撤销。全部删除包含被当前筛选条件隐藏的聊天。",deleteDescription:"永久删除这个已归档的聊天?此操作无法撤销。",unarchive:"取消归档",confirmDelete:"永久删除"}}};
2
+ export{y};
@@ -0,0 +1,2 @@
1
+ var v={ar:{},de:{},en:{defaultFavorites:"Favorites",addTo:"Favorite",addToNamedCollection:"Save to {{name}}",collectionName:"Collection name",clearCollection:"Clear collection",deleteCollection:"Delete collection",confirmCollectionChange:"Remove the records in “{{name}}”? Conversation content and records in other collections will be kept.",favorite:"Add to default collection",removeFromAll:"Remove from all collections",newCollection:"Create Collection",defaultName:"New collection",closeChat:"Close chat",remove:"Remove",addToCollection:"Favorite",moveTo:"Move to",removeFromGroup:"Remove from group",openSideBySide:"Open side by side",newChat:"New chat",defaultChatTitle:"New chat",title:"Collections",confirm:"Confirm",cancel:"Cancel",emoji:"Emoji",more:"More actions for {{name}}",unavailable:"Chat unavailable",retry:"Retry",rename:"Rename"},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},"pt-BR":{},ru:{},"zh-CN":{defaultFavorites:"收藏夹",addTo:"收藏",addToNamedCollection:"收藏到{{name}}",collectionName:"集合名称",clearCollection:"清空集合",deleteCollection:"删除集合",confirmCollectionChange:"移除“{{name}}”中的记录?对话内容和其他集合中的记录将保留。",favorite:"添加到默认集合",removeFromAll:"从所有集合移除",newCollection:"创建集合",defaultName:"新集合",closeChat:"关闭对话",remove:"移除",addToCollection:"收藏",moveTo:"移动到",removeFromGroup:"移出分组",openSideBySide:"并排打开",newChat:"新对话",defaultChatTitle:"新对话",title:"收藏",confirm:"确认",cancel:"取消",emoji:"表情",more:"{{name}}的更多操作",unavailable:"会话不可用",retry:"重试",rename:"重命名"}};
2
+ export{v};
@@ -0,0 +1,2 @@
1
+ import{Tt}from"./chunk-5ap6fvrp.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function ir({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5 ps-1","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(Tt,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
+ export{ir};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-y6kzbbya.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function Rr({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
+ export{Rr};
@@ -1,2 +1,2 @@
1
- async function Qn(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
- export{Qn};
1
+ async function No(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
+ export{No};
@@ -0,0 +1,4 @@
1
+ import{e}from"./chunk-y6kzbbya.js";import{gt}from"./chunk-rkfq0c0p.js";import{H,Be,V,bt}from"./chunk-vbab9hc4.js";import{yt,xt}from"./chunk-0whxm2f0.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as J}from"cn";import{ChevronDownIcon as se,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as j,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as D,FieldDescription as de,FieldLabel as O}from"@nyssance/shadcn/vega/components/ui/field";import{Input as ee}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as q,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as Q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as X}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Z(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function Dn({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,j(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),j(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function $i({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=xt(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(H[0]?.id??""),[F,B]=y(0),[U,A]=y({}),_=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(H[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await yt(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=H.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return j(()=>{if(!c||x==="new"||P||E)return;k(H[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(gt,{bridge:d})]}),C&&t(Dn,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(Hn,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),H.map((o)=>t("div",{hidden:x!==o.id,children:t(Un,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>_(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Xt,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Xt,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function Hn({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[H.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(te,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:J("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function te({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:J("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:J("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function On({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(On,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function Un({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(V(s,d?.region)?.id),[U,A]=y(d?.base_url??""),_=s.logo,I=d!==null,T=c.trim(),z=bt(s,F),K=F!==V(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");j(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(V(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?V(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(_,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(X,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(O,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(q,{children:[t(Q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(D,{className:"gap-2",children:[t(O,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(q,{children:t(Q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:V(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Xt({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,_]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
2
+ { "label": "My Model", "api_id": "model-id" }
3
+ ]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),M=(m)=>{if(!m)try{_(Be(I)),K(null)}catch(G){K(W(G));return}U(m)},L=async()=>{let m;try{m=Be(I),K(null)}catch(g){K(W(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(X,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[t(O,{htmlFor:E,children:n("provider.name")}),t(ee,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:o,children:n("provider.baseUrl")}),t(ee,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:r,children:n("provider.apiKey")}),i(q,{children:[t(Q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(X,{}),i(re,{open:B,onOpenChange:M,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(se,{className:J("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:A.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(D,{className:"gap-2","data-invalid":z!==null,children:[t(O,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:J("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void L(),children:[u&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
4
+ export{Dn,$i,Hn,On,Un,Xt};
@@ -1,2 +1,2 @@
1
- import{jo}from"./chunk-4z4tec0p.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function Go(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return jo(a,r)}
2
- export{Go};
1
+ import{vi}from"./chunk-855w49k0.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function hi(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return vi(a,r)}
2
+ export{hi};
@@ -0,0 +1,2 @@
1
+ import{DropdownMenuRadioGroup as l,DropdownMenuRadioItem as r}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{cn as s}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function w({value:i,onValueChange:n,options:o,itemClassName:d}){return t(l,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(r,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:s("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
2
+ export{w};
@@ -1,2 +1,2 @@
1
- import{St}from"./chunk-nqv69z6n.js";async function pn(i,c){let s=new WeakSet;while(!c.aborted){let r=Array.from(i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')).filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function je(i,c){if(!c)return[];let s=[],r="",e=[],o=()=>{let t=0,n=0;for(let{start:a,end:l}of St(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<l)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,l-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let l=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+l.length}),r+=l;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){o();return}if(t.tagName==="BR"){o();return}let n=m.has(t.tagName);if(n)o();for(let a of t.childNodes)u(a);if(n)o()};return u(i),o(),s}
2
- export{pn,je};
1
+ import{An}from"./chunk-mz8a6292.js";async function Ei(i,c){let s=new WeakSet;while(!c.aborted){let r=Array.from(i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')).filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function it(i,c){if(!c)return[];let s=[],r="",e=[],o=()=>{let t=0,n=0;for(let{start:a,end:l}of An(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<l)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,l-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let l=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+l.length}),r+=l;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){o();return}if(t.tagName==="BR"){o();return}let n=m.has(t.tagName);if(n)o();for(let a of t.childNodes)u(a);if(n)o()};return u(i),o(),s}
2
+ export{Ei,it};
@@ -0,0 +1,2 @@
1
+ import{We}from"./chunk-rbv1scqm.js";import{te,Po}from"./chunk-ktvh4yb5.js";import{t}from"./chunk-mv51zgj1.js";import{Kbd as d}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as b,TooltipContent as f,TooltipTrigger as h}from"@nyssance/shadcn/vega/components/ui/tooltip";import{cn as I}from"cn";import{SquareIcon as T}from"lucide-react";import{jsx as o,jsxs as n,Fragment as P}from"react/jsx-runtime";var v=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function xo({active:a,sending:r,ready:p,hasMentions:m=!1,onStop:c}){let{t:e}=t(),s=We(),u=m||s.textInput.value.trim().length>0||s.attachments.files.length>0,l=!p||r||!u,i=a?e("composer.steer"):e("composer.send");return n(P,{children:[a&&o(te,{"aria-label":e("composer.stop"),title:e("composer.stop"),className:"border-border size-7 rounded-full border",onClick:c,children:o(T,{className:"size-3 fill-current"})}),o("div",{className:I(l&&"cursor-not-allowed"),children:n(b,{children:[o(h,{render:o(Po,{"aria-label":i,disabled:l,"aria-busy":r,status:r?"submitted":"ready"})}),n(f,{role:"tooltip",children:[o("span",{className:"min-w-0",children:i}),o(d,{className:"shrink-0",children:v?"↩":"Enter"})]})]})})]})}
2
+ export{xo};
@@ -0,0 +1,2 @@
1
+ import{et}from"./chunk-pprt7ntb.js";import{l,_e}from"./chunk-4p6svs37.js";import{f}from"./chunk-1k21j77z.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}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 En(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 le({path:n,renderHeader:i,description:t}){let e=l(),{t:r}=e,d=e.readFile,[u,v]=p(null),[w,k]=p(null),[M,N]=p(0);D(()=>{let s=!1;return v(null),k(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!s)v(m)},(m)=>{if(!s)k(String(m))}),()=>{s=!0}},[n,t,M,d]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:a(P,{children:[o(z,{render:o(h,{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 _e(e,e.openPath(n)),children:r("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void _e(e,e.revealPath(n)),children:r("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:u===null,onClick:()=>{if(u!==null)_e(e,e.copyText(u))},children:r("plugins.skills.document.copy")})]})]});return a(F,{children:[i?i(x):o("div",{className:"flex justify-end",children:x}),o(f,{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:w?a("div",{role:"alert",className:"space-y-3",children:[a("p",{className:"text-destructive text-sm break-words",children:[r("plugins.skills.document.error"),": ",w]}),o(h,{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(et,{text:En(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
+ export{En,le};
@@ -1,2 +1,2 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function Ro({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
- export{Ro};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function ei({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
+ export{ei};
@@ -0,0 +1,2 @@
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";function at({title:t,badge:a,children:i}){return e("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[e("div",{className:"flex min-h-9 items-center gap-2",children:[r("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:t}),a]}),i]})}
2
+ export{at};
@@ -0,0 +1,2 @@
1
+ var Tr={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Uo(e){return[...e].toSorted((o,n)=>(Tr[o.kind]??99)-(Tr[n.kind]??99))}function oa(e){return e==="allow_once"||e==="allow_always"}function ia(e){return e==="allow_always"||e==="reject_always"}
2
+ export{Tr,Uo,oa,ia};
@@ -0,0 +1,2 @@
1
+ import{pn}from"./chunk-3s94ekrs.js";import{w}from"./chunk-b12v22de.js";import{Button as A}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as W,DropdownMenuCheckboxItem as Z,DropdownMenuContent as q,DropdownMenuGroup as y,DropdownMenuItem as k,DropdownMenuLabel as L,DropdownMenuSeparator as u,DropdownMenuSub as C,DropdownMenuSubContent as T,DropdownMenuSubTrigger as O,DropdownMenuTrigger as H}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as ue}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as J,TooltipContent as K,TooltipTrigger as Q}from"@nyssance/shadcn/vega/components/ui/tooltip";import{cn as r}from"cn";import{ArrowUpRight as pe,ChevronUp as X,Loader2Icon as Y,Zap as E}from"lucide-react";import{Fragment as ce,useState as ee}from"react";import{jsx as e,jsxs as a,Fragment as p}from"react/jsx-runtime";function Do({value:c,onChange:ne,models:v,modelGroups:V,compactCatalog:t,effortPresentation:j="slider",unavailableEffort:N,providerMenu:h,header:g,className:B,condensed:z,stripLabelPrefix:_,showDescription:ae,showModelList:se=!0,loading:ie,switching:G,isLoading:oe,effortConfig:s,booleanOptions:f,onBooleanChange:R,selectOptions:te=[],t:m,...d}){let[le,de]=ee(!1),[re,me]=ee(!1),l=f?.find((n)=>n.id==="fast_mode"),I=t?f?.filter((n)=>n!==l):f,P=(n)=>_&&n.startsWith(_)?n.slice(_.length):n;if(ie)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(A,{variant:"ghost",disabled:!0,className:r("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(Y,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:m("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&a(W,{open:le,onOpenChange:de,children:[a(J,{children:[e(Q,{render:e(H,{render:a(A,{"data-testid":"provider-trigger",variant:"ghost",disabled:d.disabled,className:r("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,e(X,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(K,{children:m("model.switchProvider")})]}),a(q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((n,o)=>a(ce,{children:[o>0&&n.length>0&&e(u,{}),e(w,{value:h.value,onValueChange:h.onChange,options:n})]},o)),h.moreAction&&a(p,{children:[e(u,{}),a(k,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(W,{open:re,onOpenChange:me,children:[a(J,{children:[e(Q,{render:e(H,{render:a(A,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:r("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",z&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,f?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(E,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",z&&"text-[11px]"),children:P(c.label)||m("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,o)=>o.name.length>n.length?o.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(Y,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(X,{className:r("size-3 shrink-0",z&&"size-2.5")})]})})}),e(K,{children:m("model.switchModel")})]}),a(q,{side:"top",align:"end",sideOffset:4,className:r("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",t&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[t&&a(p,{children:[a(y,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(pn,{...s,disabled:d.disabled})}):a(C,{children:[a(O,{disabled:d.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(w,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):N?a(k,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:N.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:N.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:g?.name}),l&&e(Z,{"aria-label":l.name,title:l.title??l.name,disabled:d.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>R?.(l.id,n),className:r("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(E,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),g&&!t&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[g.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:g.name}),g.action]}),e(u,{})]}),a(y,{"data-model-menu-list":t?"":void 0,className:t?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[se&&(oe?e(k,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):v.length===0?e(k,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=v.filter((i)=>!i.more),o=v.filter((i)=>i.more),F=n.length>0&&o.length>0,M=(i,b)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:b?.noDescription?void 0:ae?i.description:void 0}),D=(i)=>{let b=v.find((S)=>S.api_id===i);if(b)ne(b)};if(t)return e(w,{value:c.api_id,onValueChange:D,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:v.map((i)=>M(i))});return a(p,{children:[V?V.map((i)=>{let b=i.models.filter((x)=>!x.more),S=i.models.filter((x)=>x.more),U=b.length>0&&S.length>0;return a(y,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(U?b:i.models).map((x)=>M(x))}),U&&a(C,{children:[e(O,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:S.map((x)=>M(x,{noDescription:!0}))})})]})]},i.id)}):e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:(F?n:v).map((i)=>M(i))}),!V&&F&&a(C,{children:[e(O,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(w,{value:c.api_id,onValueChange:D,itemClassName:"font-medium whitespace-nowrap",options:o.map((i)=>M(i,{noDescription:!0}))})})]})]})})()),!t&&s&&a(p,{children:[e(u,{}),j==="menu"?a(C,{children:[a(O,{disabled:d.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(w,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(pn,{...s,disabled:d.disabled})]}),!t&&!s&&N&&a(p,{children:[e(u,{}),a(k,{disabled:!0,children:[e("span",{className:"flex-1",children:N.name}),e("span",{children:N.label})]})]}),te.map((n)=>a(y,{children:[e(u,{}),e(L,{children:n.name}),e(w,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),I&&I.length>0&&a(p,{children:[!s&&e(u,{}),I.map((n)=>t?a(Z,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(o)=>R?.(n.id,o),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:r("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:r("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:r("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(ue,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(o)=>R?.(n.id,o)})]},n.id))]})]}),t&&g?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(y,{"data-model-menu-footer":!0,className:"shrink-0",children:g.action})]})]})]})]})}
2
+ export{Do};
@@ -0,0 +1,2 @@
1
+ import{l,i}from"./chunk-4p6svs37.js";import{f}from"./chunk-1k21j77z.js";import{I}from"./chunk-wvry7t79.js";import{le}from"./chunk-bfhfbrzt.js";import{E,ae,se}from"./chunk-tv0fwt2g.js";import{ExternalLinkIcon as W,PlusIcon as _}from"lucide-react";import{useEffect as q,useState as y}from"react";import{Badge as O}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as v}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as F,DialogContent as G,DialogDescription as J,DialogHeader as K,DialogTitle as Q}from"@nyssance/shadcn/vega/components/ui/dialog";import{Spinner as S}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as X}from"@nyssance/shadcn/vega/components/ui/switch";import{jsx as e,jsxs as n,Fragment as T}from"react/jsx-runtime";function lt({entry:r,onBack:p}){let u=l(),{t}=u,P=i((a)=>a.readPlugin),C=i((a)=>a.installed.find(({plugin:g})=>g.id===r.plugin.id)),x=i((a)=>a.busyIds[r.plugin.id]),H=i((a)=>a.install),V=i((a)=>a.uninstall),j=i((a)=>a.setPluginEnabled),[o,B]=y(null),[D,U]=y(null),[R,M]=y(0),[c,z]=y(null);q(()=>{let a=!0;return U(null),B(null),P(r).then((g)=>{if(a)B(g)},(g)=>{if(a)U(g instanceof Error?g.message:String(g))}),()=>{a=!1}},[r,P,R]);let d=o?.summary??r.plugin,m=C?.plugin??d,s=d.interface,b=s?.displayName??d.name,k=m.availability!=="AVAILABLE"||m.installPolicy==="NOT_AVAILABLE",A=s?.longDescription??o?.description??s?.shortDescription,L=[...u.assetUrl?s?.screenshots.map((a)=>u.assetUrl(a))??[]:[],...s?.screenshotUrls??[]];return n("div",{className:"toolbox-surface flex min-h-0 flex-1 flex-col overflow-hidden",children:[e(se,{children:n("header",{className:"flex min-w-0 flex-col gap-4",children:[n("nav",{"aria-label":t("plugins.detail.root"),className:"flex min-w-0 items-center gap-2 text-[13px]",children:[e(v,{variant:"link",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 hover:no-underline",onClick:p,children:t("plugins.detail.root")}),e("span",{"aria-hidden":"true",className:"text-muted-foreground/50 text-sm",children:"/"}),e("span",{"aria-current":"page",className:"truncate",children:b})]}),n("div",{className:"flex min-h-9 flex-wrap items-center justify-between gap-4",children:[n("div",{className:"flex min-w-0 items-center gap-3",children:[e(I,{name:d.name,className:"size-9 shrink-0 rounded-lg"}),e("h1",{className:"min-w-0 text-2xl leading-8 font-semibold break-words",children:b})]}),e("div",{className:"flex shrink-0 items-center gap-3",children:C?n(T,{children:[e(X,{checked:m.enabled,disabled:!!x||k,"aria-label":t(m.enabled?"plugins.card.disable":"plugins.card.enable",{pluginName:b}),onCheckedChange:(a)=>void j(m,a)}),e(v,{variant:"outline",size:"sm",disabled:!!x,onClick:()=>void V(m),children:x?e(S,{}):t("plugins.detail.uninstall")})]}):e(v,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0","aria-label":t(k?"plugins.detail.unavailable":"plugins.detail.install"),title:t(k?"plugins.detail.unavailable":"plugins.detail.install"),disabled:!!x||k,onClick:()=>void H({...r,plugin:d}).catch(()=>{}),children:x?e(S,{"aria-hidden":"true"}):e(_,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})})]})]})}),e(f,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${E} pt-2`,children:[s?.shortDescription&&e("p",{className:"text-muted-foreground text-sm leading-6",children:s.shortDescription}),d.keywords.length>0&&e("div",{className:"mt-3 flex flex-wrap gap-2",children:[...new Set(d.keywords)].map((a)=>e(O,{variant:"secondary",className:"text-xs font-normal",children:a},a))}),n("div",{className:"mt-6 flex items-stretch overflow-x-auto border-y py-4",children:[s?.developerName&&e(N,{label:t("plugins.detail.developer"),children:s.developerName}),s?.category&&e(N,{label:t("plugins.detail.category"),children:s.category}),(m.localVersion??m.version)&&e(N,{label:t("plugins.detail.version"),children:m.localVersion??m.version}),e(N,{label:t("plugins.headings.marketplace"),children:r.marketplace.interface?.displayName??r.marketplace.name}),s?.websiteUrl&&e(N,{label:t("plugins.detail.website"),children:e(w,{url:s.websiteUrl,label:t("plugins.detail.website")})})]}),!o&&!D&&n("div",{role:"status",className:"text-muted-foreground mt-8 flex items-center gap-2 text-sm",children:[e(S,{}),t("plugins.detail.loading")]}),D&&n("div",{role:"alert",className:"mt-8 space-y-2",children:[n("p",{className:"text-destructive text-sm",children:[t("plugins.detail.errorTitle"),": ",D]}),e(v,{variant:"outline",size:"sm",className:"h-9",onClick:()=>M((a)=>a+1),children:t("plugins.loadError.retry")})]}),A&&e("p",{className:"mt-8 text-sm leading-6 whitespace-pre-wrap",children:A}),L.length>0&&e("div",{className:"mt-6 flex gap-3 overflow-x-auto",children:[...new Set(L)].map((a)=>e("img",{src:a,alt:b,loading:"lazy",className:"max-h-72 max-w-full rounded-xl border object-contain"},a))}),s&&s.capabilities.length>0&&e(h,{label:t("plugins.detail.capabilities"),count:s.capabilities.length,children:s.capabilities.map((a)=>e(O,{variant:"secondary",className:"me-2",children:a},a))}),o&&o.mcpServers.length>0&&e(h,{label:t("plugins.detail.mcpServers"),count:o.mcpServers.length,children:o.mcpServers.map((a)=>n("div",{className:"flex items-center gap-3 py-1",children:[e(I,{name:d.name,className:"size-6 rounded-md"}),e("span",{className:"text-sm font-medium",children:a})]},a))}),o&&o.skills.length>0&&e(h,{label:t("plugins.detail.skills"),count:o.skills.length,children:o.skills.map((a)=>n(v,{variant:"ghost",className:"h-auto w-full justify-start gap-3 rounded-xl px-3 py-3 text-start whitespace-normal",onClick:()=>z(a),children:[e(I,{name:a.name,className:"size-8"}),n("span",{className:"min-w-0 flex-1",children:[e("span",{className:"block text-sm font-medium",children:a.interface?.displayName??a.name}),e("span",{className:"text-muted-foreground mt-1 block truncate text-[13px] leading-5 font-normal",children:a.interface?.shortDescription??a.shortDescription??a.description})]})]},a.path??a.name))}),o&&o.apps.length>0&&e(h,{label:t("plugins.detail.apps"),count:o.apps.length,children:o.apps.map((a)=>n("div",{className:"rounded-xl px-3 py-3",children:[e("div",{className:"text-sm font-medium",children:a.name}),a.description&&e("p",{className:"text-muted-foreground mt-1 text-[13px] leading-5",children:a.description}),a.installUrl&&e(w,{url:a.installUrl,label:t("plugins.installModal.connect")})]},a.id))}),o&&o.hooks.length>0&&e(h,{label:t("plugins.detail.hooks"),count:o.hooks.length,children:o.hooks.map((a)=>e("p",{className:"text-sm",children:a.eventName},a.key))}),(s?.privacyPolicyUrl||s?.termsOfServiceUrl)&&n("div",{className:"mt-10 flex flex-wrap gap-4 border-t pt-4",children:[s.privacyPolicyUrl&&e(w,{url:s.privacyPolicyUrl,label:t("plugins.detail.privacyPolicy")}),s.termsOfServiceUrl&&e(w,{url:s.termsOfServiceUrl,label:t("plugins.detail.termsOfService")})]})]})}),e(F,{open:c!==null,onOpenChange:(a)=>{if(!a)z(null)},children:e(G,{className:ae,children:c&&n(T,{children:[e("div",{className:"shrink-0 pr-8",children:e(I,{name:c.name,className:"size-10"})}),n("div",{className:"min-h-0 space-y-6 overflow-y-auto overscroll-contain",children:[n(K,{className:"gap-3",children:[e(Q,{className:"text-2xl leading-8 font-semibold break-words",children:c.interface?.displayName??c.name}),e(J,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:c.description})]}),e(le,{path:c.path,description:c.description},c.path??c.name)]})]})})})]})}function N({label:r,children:p}){return n("div",{className:"flex min-w-28 shrink-0 flex-col items-center justify-between gap-1.5 border-e px-6 first:ps-2 last:border-e-0",children:[e("span",{className:"text-muted-foreground text-xs",children:r}),e("span",{className:"flex items-center text-sm font-normal",children:p})]})}function h({label:r,count:p,children:u}){return n("section",{className:"mt-8",children:[n("h2",{className:"text-base font-medium",children:[r," ",e("span",{className:"text-muted-foreground font-normal",children:p})]}),e("div",{className:"mt-3 flex flex-col gap-2",children:u})]})}function w({url:r,label:p}){let{openLink:u}=l();if(!/^https?:\/\//i.test(r))return null;return n(v,{variant:"link",className:"text-muted-foreground h-auto p-0 text-xs",title:r,onClick:()=>u(r),children:[p,e(W,{className:"size-3.5"})]})}
2
+ export{lt};
@@ -0,0 +1,2 @@
1
+ import{l,i}from"./chunk-4p6svs37.js";import{L,R,Q,F,D,ce}from"./chunk-20k9syde.js";import{re}from"./chunk-mr6k70s4.js";import{f}from"./chunk-1k21j77z.js";import{le}from"./chunk-bfhfbrzt.js";import{E,ae}from"./chunk-tv0fwt2g.js";import{CheckIcon as U,SparklesIcon as V,XIcon as X}from"lucide-react";import{useDeferredValue as _,useState as v}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as J,DialogClose as K,DialogContent as W,DialogDescription as Y,DialogHeader as Z,DialogTitle as ee}from"@nyssance/shadcn/vega/components/ui/dialog";import{ItemTitle as te}from"@nyssance/shadcn/vega/components/ui/item";import{Spinner as se}from"@nyssance/shadcn/vega/components/ui/spinner";import{Switch as ne}from"@nyssance/shadcn/vega/components/ui/switch";import{Tabs as ie,TabsContent as oe,TabsList as pe,TabsTrigger as me}from"@nyssance/shadcn/vega/components/ui/tabs";import{jsx as t,jsxs as n,Fragment as S}from"react/jsx-runtime";function P({skill:c}){let{assetUrl:m}=l(),[u,s]=v(!1),o=c.interface?.iconSmall,b=o&&m?m(o):c.interface?.iconSmallUrl;return t("div",{className:"bg-muted flex size-10 shrink-0 items-center justify-center rounded-xl",children:b&&!u?t("img",{src:b,alt:"",onError:()=>s(!0),className:"size-6 rounded object-contain"}):t(V,{className:"text-muted-foreground size-6"})})}function de({skill:c}){let{t:m}=l(),u=i((o)=>o.setSkillEnabled),s=i((o)=>(c.path in o.busySkills));return n("div",{className:"flex items-center gap-2",children:[s&&t(se,{className:"text-muted-foreground size-3.5"}),t(ne,{checked:c.enabled,disabled:s,"aria-label":`${m(c.enabled?"plugins.skills.disable":"plugins.skills.enable")}: ${c.interface?.displayName??c.name}`,onCheckedChange:(o)=>void u(c,o)})]})}function st({query:c,ready:m,onOpenPlugin:u}){let{t:s}=l(),o=i((e)=>e.skills),b=i((e)=>e.skillErrors),j=i((e)=>e.loading)||!m,z=i((e)=>e.installed),M=i((e)=>e.skillProjects),[B,H]=v(null),[k,G]=v(!1),[O,C]=v(null),x=_(c.trim().toLowerCase()),r=o.find((e)=>e.path===O),N=z.find(({plugin:e})=>e.id===r?.pluginId),p=o.filter((e)=>[e.name,e.interface?.displayName,e.description,e.shortDescription,e.interface?.shortDescription,e.pluginId].filter(Boolean).join(" ").toLowerCase().includes(x)).toSorted((e,a)=>(e.interface?.displayName??e.name).localeCompare(a.interface?.displayName??a.name)),d=[...["user","system","admin"].flatMap((e)=>{let a=o.filter((h)=>h.scope===e);return a.length?[{id:e,label:s(e==="user"?"plugins.catalog.personal":`plugins.skills.scope.${e}`),paths:new Set(a.map((h)=>h.path)),path:null}]:[]}),...Object.entries(M).flatMap(([e,a])=>{if(!o.some((T)=>T.scope==="repo"&&a.includes(T.path)))return[];let h=e.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||e;return[{id:`project:${e}`,label:h,paths:new Set(a),path:e}]})],q=d.map((e)=>e.label);for(let e of d)if(e.path&&q.filter((a)=>a===e.label).length>1)e.label=e.path;let g=d.find((e)=>e.id===B)??d[0],w=g?p.filter((e)=>g.paths.has(e.path)):[],A=k||x?p:p.slice(0,6),I=(e)=>t(D,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:e.map((a)=>n(ce,{className:"toolbox-row relative [contain-intrinsic-size:auto_80px] [content-visibility:auto]",children:[t(y,{variant:"ghost",className:"absolute inset-0 z-0 size-full","aria-label":a.interface?.displayName??a.name,onClick:()=>C(a.path)}),t(F,{className:"pointer-events-none relative translate-none! self-center!",children:t(P,{skill:a})}),n(R,{className:"pointer-events-none relative min-w-0",children:[t(te,{className:"block truncate",children:a.interface?.displayName??a.name}),t(Q,{className:"line-clamp-1",title:a.interface?.shortDescription??a.shortDescription??a.description,children:a.interface?.shortDescription??a.shortDescription??a.description})]}),t(L,{className:"text-muted-foreground pointer-events-none relative",children:a.enabled?t(U,{className:"size-4","aria-label":s("plugins.skills.enabledStatus")}):t("span",{className:"text-xs",children:s("plugins.skills.disabledBadge")})})]},a.path))});return n("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[t(f,{className:"pe-0",viewportClassName:"pe-0",children:n("div",{className:`${E} space-y-8 pt-6`,children:[b.map((e)=>n("p",{role:"alert",className:"text-destructive text-xs break-words",children:[e.path,": ",e.message]},e.path)),j?t(re,{skills:!0}):n(S,{children:[n("section",{"aria-label":s("plugins.skills.installed"),children:[n("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t("h2",{className:"text-base font-medium",children:s("plugins.skills.installed")}),t("span",{role:"status",className:"text-muted-foreground text-xs",children:s("plugins.catalog.skillCount",{count:p.length})})]}),p.length?I(A):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s(x?"plugins.skills.filteredEmpty":"plugins.skills.empty")}),!x&&p.length>6&&t(y,{variant:"ghost",className:"text-muted-foreground mt-3 max-w-full justify-start","aria-expanded":k,onClick:()=>G((e)=>!e),children:k?s("plugins.sections.showLess"):s("plugins.catalog.showMore",{count:p.length-6})})]}),g&&n(ie,{value:g.id,onValueChange:(e)=>{if(typeof e==="string")H(e)},className:"gap-6",children:[t(pe,{"aria-label":s("plugins.catalog.scope"),className:"h-auto max-w-full flex-wrap justify-start gap-2 bg-transparent",children:d.map((e)=>t(me,{value:e.id,title:e.path??e.label,className:"data-active:bg-muted! h-8 flex-none rounded-lg px-3 text-[13px] font-medium shadow-none! after:hidden dark:data-active:border-transparent",children:e.label},e.id))}),d.map((e)=>t(oe,{value:e.id,children:e.id===g.id&&(w.length?I(w):t("p",{className:"text-muted-foreground px-2 py-8 text-sm",children:s("plugins.skills.filteredEmpty")}))},e.id))]})]})]})}),t(J,{open:!!r,onOpenChange:(e)=>{if(!e)C(null)},children:t(W,{showCloseButton:!1,className:ae,children:r&&n(S,{children:[t(le,{path:r.path,renderHeader:(e)=>n(S,{children:[n("div",{className:"flex items-center justify-between gap-4",children:[t(P,{skill:r}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(de,{skill:r}),e,t(K,{render:t(y,{variant:"ghost",size:"icon-sm","aria-label":s("plugins.close")}),children:t(X,{})})]})]}),n(Z,{className:"gap-3",children:[t(ee,{className:"text-2xl leading-8 font-semibold break-words",children:r.interface?.displayName??r.name}),t(Y,{className:"text-sm leading-6 break-words whitespace-pre-wrap",children:r.description})]})]})},r.path),r.pluginId&&n("div",{className:"text-sm",children:[n("span",{className:"text-muted-foreground",children:[s("plugins.catalog.fromPlugin")," "]}),N?t(y,{variant:"link",className:"h-auto p-0",onClick:()=>{C(null),u(N)},children:N.plugin.interface?.displayName??N.plugin.name}):r.pluginId]})]})})})]})}
2
+ export{st};
@@ -0,0 +1,2 @@
1
+ var ve="chrome-hover hover:bg-foreground/8 data-[active=true]:bg-foreground/5",d="chrome-hover hover:bg-foreground/8 data-active:bg-foreground/5";
2
+ export{ve,d};
@@ -0,0 +1,2 @@
1
+ import{Fo}from"./chunk-f1x483c9.js";import{e,g}from"./chunk-y6kzbbya.js";import{U,m}from"./chunk-p8g927x6.js";import{createLucideIcon as w,HandIcon as y,ShieldAlertIcon as S,ShieldCheckIcon as c}from"lucide-react";import{jsx as t}from"react/jsx-runtime";var O=w("ApprovalShield",[["path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11",key:"shield"}],["path",{d:"m8 8 3 3-3 3M13 15h3",key:"terminal"}]]),d={"read-only":y,"workspace-write":c,agent:O,"agent-full-access":S},b={"read-only":"readOnly","workspace-write":"workspaceAccess",agent:"agent","agent-full-access":"fullAccess"};function $t({sessionId:u,options:f,disabled:h,onConfigChange:r}){let{host:l,client:I}=e(),{t:a}=l,o=m(f,"mode");if(!o)return null;let s=o.currentValue,p=U(o).map((n)=>{let i=b[n.value];return i?{...n,name:a(`permissionModes.${i}.name`),description:a(`permissionModes.${i}.description`)}:n}),M=p.find((n)=>n.value===s),v=d[s]??c,C=(n)=>{if(n===s)return;g(l,r?r(o.configId,n):I.setConfig(u,o.configId,n))};return t(Fo,{value:s,warning:s==="agent-full-access",currentName:M?.name??s,icon:t(v,{className:"size-3.5 shrink-0"}),header:a("permissionModes.heading"),disabled:h,label:a("composer.switchPermissionMode"),onValueChange:C,options:p.map((n)=>{let i=d[n.value]??c,k=n.value==="agent-full-access";return{value:n.value,label:t("span",{"data-permission-warning":k?"":void 0,children:n.name}),description:n.description?t("span",{className:"whitespace-normal",children:n.description}):void 0,icon:t(i,{className:"size-3.5 shrink-0"})}})})}
2
+ export{$t};
@@ -1,2 +1,2 @@
1
- function Mn({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{Mn};
1
+ function vo({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{vo};
@@ -1,2 +1,2 @@
1
- import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function bo(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
2
- export{bo};
1
+ import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function qo(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
2
+ export{qo};
@@ -0,0 +1,4 @@
1
+ import{yi}from"./chunk-vt6cyes7.js";import{t}from"./chunk-mv51zgj1.js";import{Zo,Qo}from"./chunk-jgd6dcgy.js";import{Z}from"./chunk-j69t1f4a.js";import{ne}from"./chunk-1r25anvg.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var Wo=p(function({item:s,messageTime:c}){let l=t(),o=Qo(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
2
+ ${e.text}`).join(`
3
+ `):ne(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=Zo(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(Z,{block:e},`${s.id}:${n}`))}),r(yi,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
4
+ export{Wo};
@@ -0,0 +1,2 @@
1
+ import{w}from"./chunk-b12v22de.js";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as f,DropdownMenuContent as x,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{useState as M}from"react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function Fo({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]=M(!1);return o(f,{open:m,onOpenChange:c,children:[e(b,{render:o(g,{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(w,{value:a,onValueChange:s,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:p})]})]})}
2
+ export{Fo};
@@ -0,0 +1,2 @@
1
+ import{Ri}from"./chunk-mz8a6292.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Mn(t,r,e={}){let o=r.trim();if(o.length===0)return[];return Ri(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
+ export{Mn};
@@ -1,2 +1,2 @@
1
- import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Eo(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function Ti(){c()}function Ao(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function Lo(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return wr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function Si(e,n,t,i,o,a){if(a==="none")return;_(o,[wr(e,n,t,i,a)])}function wr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Fr(t,i);return kr(e,n)}function Fr(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function kr(e,n){return y+Or(e,n)}function Ii(e,n){return D(kr(e,n))}function Or(e,n){if(n<=l)return Br(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Br(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function Pi(){return r.context?.state}function Ni(e){return g(e).ready}
2
- export{Eo,Ti,Ao,Lo,Si,wr,Fr,kr,Ii,Or,Br,Pi,Ni};
1
+ import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function ti(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function aa(){c()}function ni(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function oi(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Nr(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function sa(e,n,t,i,o,a){if(a==="none")return;_(o,[Nr(e,n,t,i,a)])}function Nr(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Gr(t,i);return Mr(e,n)}function Gr(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function Mr(e,n){return y+zr(e,n)}function la(e,n){return D(Mr(e,n))}function zr(e,n){if(n<=l)return Vr(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Vr(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function ca(){return r.context?.state}function da(e){return g(e).ready}
2
+ export{ti,aa,ni,oi,sa,Nr,Gr,Mr,la,zr,Vr,ca,da};
@@ -0,0 +1,2 @@
1
+ import{io}from"./chunk-1mn2t6ga.js";import{createContext as r,useContext as i}from"react";import{jsx as s}from"react/jsx-runtime";var n=r(null);function or({host:o,children:t}){return s(n,{value:o,children:t})}function x(){let o=i(n),e={...io(),...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 Zn(o,t){t.catch((e)=>{if(o.reportError)o.reportError(e);else console.error(e)})}function X(){let o=x();return(t)=>Zn(o,t)}function Qn(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}
2
+ export{or,x,Zn,X,Qn};
@@ -0,0 +1,2 @@
1
+ import{d}from"./chunk-d257n8gj.js";import{r,o}from"./chunk-1mn2t6ga.js";import{b,_,p,W}from"./chunk-1k697ncv.js";import{x,X,Qn}from"./chunk-feg5rp9g.js";import{ze}from"./chunk-11484wvv.js";import{N,j}from"./chunk-y0q6jwq4.js";import{de,Y}from"./chunk-r9sweaq4.js";import{closestCorners as fe,DndContext as Ce,KeyboardSensor as ye,PointerSensor as Se,useSensor as Z,useSensors as De}from"@dnd-kit/core";import{SortableContext as ee,sortableKeyboardCoordinates as we,useSortable as ae,verticalListSortingStrategy as oe}from"@dnd-kit/sortable";import{CSS as ce}from"@dnd-kit/utilities";import{cn as F}from"cn";import{BrushCleaningIcon as ve,MessageSquareIcon as Ne,MoreHorizontalIcon as Ie,PencilIcon as he,PlusIcon as me,StarIcon as be,Trash2Icon as pe}from"lucide-react";import{useEffect as xe,useMemo as Me,useState as R}from"react";import{Button as D}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as te,DialogContent as ne,DialogDescription as ie,DialogFooter as le,DialogHeader as re,DialogTitle as se}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as Ee,DropdownMenuContent as ke,DropdownMenuGroup as Le,DropdownMenuItem as H,DropdownMenuTrigger as Re}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as Pe}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a,Fragment as Ke}from"react/jsx-runtime";function Te({collectionId:l,sessionId:C,children:M}){let{attributes:w,listeners:v,setNodeRef:i,transform:u,transition:g,isDragging:E}=ae({id:JSON.stringify([l,C]),data:{type:"session",collectionId:l,sessionId:C}});return e("div",{ref:i,style:{transform:ce.Transform.toString(u),transition:g},className:F("w-full min-w-0",E&&"opacity-50"),...w,...v,role:"group",children:M})}function Be({collection:l,children:C,onEdit:M,onConfirm:w,onNewChat:v}){let{t:i}=x(),u=Y(),g=X(),{attributes:E,listeners:m,setNodeRef:I,transform:P,transition:T,isDragging:z}=ae({id:l.id,disabled:{draggable:l.id===N,droppable:!1},data:{type:"collection"}});return e("div",{ref:I,style:{transform:ce.Transform.toString(P),transition:T},className:F("w-full min-w-0",z&&"opacity-50"),children:e(W,{open:!l.collapsed,onOpenChange:(c)=>g(u({type:"collapse",id:l.id,collapsed:!c})),label:j(l,i),count:l.sessionIds.length,leading:l.id===N?e(be,{className:"size-3.5"}):e(ze,{emoji:l.emoji,onChange:(c)=>g(u({type:"emoji",id:l.id,emoji:c}))}),wrapHeader:(c)=>e("div",{...E,...m,role:"group",children:c}),actions:a(Ee,{children:[e(Re,{onClick:(c)=>c.stopPropagation(),onPointerDown:(c)=>c.stopPropagation(),render:e(D,{variant:"ghost",size:"icon",className:"size-5","aria-label":i("collection.more",{name:j(l,i)}),children:e(Ie,{className:"size-3.5"})})}),e(ke,{children:a(Le,{children:[l.id!==N&&a(H,{onClick:M,children:[e(he,{}),i("collection.rename")]}),a(H,{onClick:v,children:[e(me,{}),i("collection.newChat")]}),a(H,{onClick:()=>w("clear"),children:[e(ve,{}),i("collection.clearCollection")]}),l.id!==N&&a(H,{variant:"destructive",onClick:()=>w("delete"),children:[e(pe,{}),i("collection.deleteCollection")]})]})})]}),children:C})})}function He({children:l}){return e("div",{className:"min-h-0 flex-1 overflow-y-auto ps-2 pe-0 pb-1",children:l})}function Xi({renderRow:l,onSelect:C,onNewChat:M,Scroll:w=He}){let v=x(),{t:i}=v,u=Y(),g=X(),E=r(),{collections:m,order:I}=de(),P=o((t)=>t.sessionList),T=o((t)=>t.archivedSessions),z=o((t)=>t.sessionListLoaded),c=o((t)=>t.sessionListError),U=Me(()=>new Map([...T,...P].map((t)=>[t.sessionId,t])),[T,P]),q=v.isMac??Qn(),[y,k]=R(null),[L,K]=R(""),[J,O]=R(""),[S,B]=R(null),[f,A]=R(!1),ue=De(Z(Se,{activationConstraint:{distance:5}}),Z(ye,{coordinateGetter:we})),G=I.flatMap((t)=>m[t].collapsed?[]:m[t].sessionIds.flatMap((n)=>{let s=U.get(n);return s&&!s.archived?[s]:[]}));xe(()=>{let t=(n)=>{if(n.defaultPrevented||n.isComposing||n.repeat||n.shiftKey||n.altKey)return;if(q?!n.metaKey||n.ctrlKey:!n.ctrlKey||n.metaKey)return;if(document.querySelector('[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]'))return;if(n.target instanceof HTMLElement&&(n.target.isContentEditable||n.target.closest("input,textarea,[role=dialog],[role=menu]")))return;let s=Number(n.key)-1;if(!Number.isInteger(s)||s<0||s>8||!G[s])return;n.preventDefault(),C(G[s])};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[G,q,C]);let ge=({active:t,over:n})=>{if(n===null)return;let s=t.data.current,h=n.data.current;if(s?.type==="session"&&h!==void 0){let V=h.type==="session"?String(h.collectionId):String(n.id);g(u({type:"move",sourceCollectionId:String(s.collectionId),collectionId:V,sessionId:String(s.sessionId),index:h.type==="session"?m[V].sessionIds.indexOf(String(h.sessionId)):void 0}))}else if(s?.type==="collection"&&h?.type==="collection"&&String(n.id)!==N)g(u({type:"reorder",id:String(t.id),index:I.indexOf(String(n.id))}))},Q=(t,n)=>{A(!0),g(t.then(n).finally(()=>A(!1)))};return a(Ke,{children:[e(w,{children:a(b,{children:[a(p,{className:F(d,"font-normal"),onClick:()=>{k("new"),K(""),O("")},children:[e(_,{children:e(me,{})}),e("span",{children:i("collection.newCollection")})]}),c&&a("div",{className:"text-muted-foreground px-2 text-sm",children:[e("p",{role:"alert",children:c}),e(D,{variant:"ghost",onClick:()=>g(E.listSessions({reset:!0})),children:i("collection.retry")})]}),e(Ce,{sensors:ue,collisionDetection:fe,onDragEnd:ge,children:e(ee,{items:I,strategy:oe,children:e(b,{children:I.map((t)=>e(Be,{collection:m[t],onNewChat:()=>M(t),onEdit:()=>{k(t),K(m[t].name),O(m[t].emoji??"")},onConfirm:(n)=>B({id:t,type:n}),children:e(ee,{items:m[t].sessionIds.map((n)=>JSON.stringify([t,n])),strategy:oe,children:m[t].sessionIds.map((n)=>{let s=U.get(n);if(s?.archived)return null;if(!s)return z?a("div",{className:"text-muted-foreground flex h-[var(--navigation-row-height)] w-full items-center gap-1 rounded-[10px] ps-1 pe-1.5 text-sm font-normal",children:[e(_,{children:e(Ne,{className:"size-3.5"})}),e("span",{className:"min-w-0 flex-1 truncate",children:i("collection.unavailable")}),e(D,{variant:"ghost",size:"icon",className:"size-5 [&_svg]:size-3.5","aria-label":i("collection.removeFromGroup"),onClick:()=>g(u({type:"remove",sessionId:n,collectionId:t})),children:e(pe,{})})]},n):null;return e(Te,{collectionId:t,sessionId:n,children:l(s,()=>{},t)},n)})})},t))})})})]})}),e(te,{open:y!==null,onOpenChange:(t)=>{if(!t&&!f)k(null)},children:a(ne,{children:[a(re,{children:[e(se,{children:i(y==="new"?"collection.newCollection":"collection.rename")}),e(ie,{children:i("collection.collectionName")})]}),a("form",{onSubmit:(t)=>{if(t.preventDefault(),y===null||!L.trim()||f)return;let n=y==="new"?`collection-${crypto.randomUUID()}`:y;Q(u([y==="new"?{type:"create",id:n,name:L}:{type:"rename",id:n,name:L},{type:"emoji",id:n,emoji:J}]),()=>k(null))},className:"flex flex-col gap-3",children:[e(Pe,{autoFocus:!0,"aria-label":i("collection.collectionName"),value:L,onChange:(t)=>K(t.target.value),disabled:f}),y!=="new"&&e(ze,{emoji:J,onChange:O}),a(le,{children:[e(D,{type:"button",variant:"outline",disabled:f,onClick:()=>k(null),children:i("collection.cancel")}),e(D,{type:"submit",disabled:f||!L.trim(),children:i("collection.confirm")})]})]})]})}),e(te,{open:S!==null,onOpenChange:(t)=>{if(!t&&!f)B(null)},children:a(ne,{children:[a(re,{children:[e(se,{children:i(S?.type==="delete"?"collection.deleteCollection":"collection.clearCollection")}),e(ie,{children:i("collection.confirmCollectionChange",{name:S===null?"":j(m[S.id],i)})})]}),a(le,{children:[e(D,{variant:"outline",disabled:f,onClick:()=>B(null),children:i("collection.cancel")}),e(D,{disabled:f,onClick:()=>{if(S!==null)Q(u({type:S.type,id:S.id}),()=>B(null))},children:i("collection.confirm")})]})]})})]})}
2
+ export{Xi};
@@ -0,0 +1,2 @@
1
+ import{a,O,Bt}from"./chunk-y97ne5kj.js";var Ao=5000;function Ee(t){return"pastedText"in t}function Hr(t){return`file://${encodeURI(t).replaceAll("#","%23").replaceAll("?","%3F")}`}function Ke(t,e,o){let n=(r,s)=>{for(let[i,x]of a){if(!x.attachments.some((p)=>p.id===e.id))continue;O(i,(p)=>p.map((d)=>d.id===e.id?{...e,url:s===void 0?"":Hr(s),pastedText:{text:e.pastedText.text,status:r}}:d))}};if(!a.get(t)?.attachments.some((r)=>r.id===e.id))return;n("pending"),Bt(e.id,o("pasted-text.txt",e.pastedText.text).then((r)=>n("ready",r)).catch(()=>n("error")))}function Ot(t,e,o,n){if(t.defaultPrevented||t.currentTarget.disabled)return;if([...t.clipboardData.items].some((i)=>i.kind==="file"&&i.type.startsWith("image/")))return;let r=t.clipboardData.getData("text/plain");if(r.length<Ao)return;t.preventDefault(),t.stopPropagation();let s={id:crypto.randomUUID(),type:"file",mediaType:"text/plain",filename:o,url:"",pastedText:{text:r,status:"pending"}};O(e,(i)=>[...i,s]),Ke(e,s,n)}
2
+ export{Ao,Ee,Hr,Ke,Ot};
@@ -0,0 +1,4 @@
1
+ import{an}from"./chunk-qwfw4xpn.js";import{mo}from"./chunk-n66yy1m1.js";import{We}from"./chunk-rbv1scqm.js";import{Button as G}from"@nyssance/shadcn/vega/components/ui/button";import{Separator as ot}from"@nyssance/shadcn/vega/components/ui/separator";import{autoUpdate as rt}from"@floating-ui/dom";import{cn as J}from"cn";import{BookOpenTextIcon as st,FileIcon as it,StoreIcon as lt}from"lucide-react";import{useCallback as ut,useEffect as d,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as v}from"react";import{createPortal as at}from"react-dom";import{jsx as m,jsxs as w,Fragment as ct}from"react/jsx-runtime";function po({handleRef:u,anchorRef:a,commands:T,searchFiles:l,onMention:_,onSearchError:B,fileSearchDebounceMs:C=0,bashMode:H=!1,forcedOpen:s=!1,onForcedOpenChange:p,emptyLabel:R,fileStatusLabels:E,morePlugins:M}){let A=We(),i=A.textInput.value,[j,z]=v(0),[g,D]=v(null),[x,h]=v(0),K=Z(null);d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=()=>z(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}});let U=Y(()=>H&&i.startsWith("!")?null:mo(i,j),[i,j,H]),o=U?.kind==="at"&&!l?null:U,P=`${o?.kind??"forced"}:${o?.query??""}:${s}`,[F,O]=v(P);if(F!==P)O(P),h(0);let L=Z(null);d(()=>{if(!s){L.current=null;return}if(L.current===null)L.current=i;else if(i!==L.current)p?.(!1)},[s,i,p]);let y=o?.kind==="at"?o.query:null;d(()=>{if(y===null||!l){D(null);return}let t=!0,e=()=>{l(y).then((r)=>{if(t)D({query:y,search:l,items:r})},(r)=>{if(t)D({query:y,search:l,items:[]}),B(r)})},n=C>0?window.setTimeout(e,C):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[y,l,C,B]);let f=Y(()=>{if(o?.kind==="at")return g?.query===o.query&&g.search===l?g.items:[];if(o)return an(T,o.query);if(s)return an(T,"");return[]},[o,s,T,g,l]),[tt,q]=v(!1);d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=()=>q(!0),n=()=>{if(q(!1),s)p?.(!1)};return q(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[u,s,p]),d(()=>{if(s)u.current?.getTextarea()?.focus()},[s,u]);let c=tt&&(o!==null?o.kind==="slash"||f.length>0||!!E:s);d(()=>{if(!c)return;K.current?.querySelector(`[data-idx="${x}"]`)?.scrollIntoView({block:"nearest"})},[x,c]);function V(t){let e=u.current?.getTextarea();if(!e)return;let n,r;if(o){let S=o.kind==="slash"?`/${t.payload} `:`@${t.label} `;if(n=i.slice(0,o.start)+S+i.slice(o.end),o.kind==="at")_?.(t.payload);r=o.start+S.length}else if(s)n=`${i.length===0||i.endsWith(`
2
+ `)?i:`${i}
3
+ `}/${t.payload} `,r=n.length,p?.(!1);else return;A.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}d(()=>{let t=u.current?.getTextarea();if(!t)return;let e=(n)=>{if(!c)return;if(u.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>f.length===0?0:Math.min(f.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=f[x];if(r)V(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)z(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else p?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[b,W]=v(null),[N,et]=v(null),I=ut(()=>{let t=a?.current;if(!t)return;let e=t.getBoundingClientRect();W({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[a]);if(X(()=>{if(!c){W(null);return}I()},[c,I]),X(()=>{let t=a?.current;if(!c||!t||!N)return;return rt(t,N,I,{animationFrame:!0})},[c,N,a,I]),!c||a&&!b)return null;let k=o?o.kind==="slash":s,nt=k?st:it,Q=m("div",{ref:et,className:a?"fixed z-50":"absolute inset-x-0 bottom-full z-50 mb-2",style:a&&b?{left:b.left,width:b.width,bottom:b.bottom}:void 0,children:w("div",{ref:K,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:"bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto w-full overflow-hidden rounded-lg p-1 shadow-md ring-1 outline-hidden",children:[w("div",{className:"max-h-72 overflow-y-auto",children:[f.length===0&&k&&m("div",{className:"text-muted-foreground px-2 py-3 text-xs",children:R}),f.length===0&&!k&&E&&m("div",{role:"status",className:"text-muted-foreground px-2 py-3 text-xs",children:g?.query===y&&g.search===l?E.empty:E.loading}),f.map((t,e)=>w(G,{type:"button",variant:"ghost",role:"option","aria-selected":e===x,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),V(t)},onMouseEnter:()=>h(e),className:J("flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===x&&"bg-muted"),children:[m(nt,{className:J("size-4 shrink-0",k?"text-blue-500":"text-muted-foreground")}),m("span",{className:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&m("span",{className:"text-muted-foreground min-w-0 flex-1 truncate text-xs",children:t.description})]},t.key))]}),k&&M&&w(ct,{children:[m(ot,{}),w(G,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),p?.(!1),M.open()},className:"h-auto w-full justify-start px-2.5 py-2",children:[m(lt,{"data-icon":"inline-start"}),M.label]})]})]})});return a?at(Q,document.body):Q}
4
+ export{po};
@@ -0,0 +1,2 @@
1
+ import{C}from"./chunk-heyqzkxq.js";import{s}from"./chunk-1mn2t6ga.js";import{CircleHelpIcon as m}from"lucide-react";import{useRef as c,useState as p}from"react";import{Button as f}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as h,DropdownMenuContent as g,DropdownMenuTrigger as w}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as M}from"react/jsx-runtime";function ar({children:l}){let{t:n}=s(),[o,u]=p(!1),r=c(null),[a,d]=p();return C(o),M(h,{open:o,onOpenChange:(t)=>{if(t){let i=r.current?.parentElement;if(!i)throw Error("Help trigger must be mounted in its footer row");d(i.clientWidth)}u(t)},children:[e(w,{render:e(f,{ref:r,variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] shrink-0 rounded-[10px] p-0 [corner-shape:superellipse(1.5)]","aria-label":n("sessionList.help"),title:n("sessionList.help")}),children:e(m,{className:"size-4 shrink-0"})}),e(g,{side:"top",align:"end",sideOffset:8,style:{width:a},children:l})]})}
2
+ export{ar};
@@ -0,0 +1,2 @@
1
+ import{createStore as M}from"@alwith/api/client";function k(a){return a instanceof Error?a.message:String(a)}function E(a){return a.interface?.displayName??a.name}function I(a){let u={},n=new Map,l=new Map;for(let p of a.data){for(let o of p.skills)if(n.set(o.path,o),o.scope==="repo"){let m=u[p.cwd]??[];if(!m.includes(o.path))m.push(o.path);u[p.cwd]=m}for(let o of p.errors)l.set(o.path,o)}return{skills:[...n.values()],errors:[...l.values()],projects:u}}function v(a){let u=[];for(let n of a.marketplaces)for(let l of n.plugins)if(l.installed)u.push({plugin:l,marketplace:n});return u.toSorted((n,l)=>(l.plugin.installedAt??0)-(n.plugin.installedAt??0))}function Fn(a){let{plugin:u,marketplace:n}=a;return{installAttemptId:crypto.randomUUID(),pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function A(a){let{plugin:u,marketplace:n}=a;return{pluginName:n.path===null?u.remotePluginId??u.name:u.name,...n.path===null?{remoteMarketplaceName:n.name}:{marketplacePath:n.path}}}function ut(a,u){let n=u??{t:(e)=>e},l=(e,r)=>n.t(e,r),p=(e)=>n.notify?.(e),o=(e)=>{if(n.reportError)n.reportError(Error(e));else console.error(e)},m=null,b=null,d=(e)=>S.setState(e),P=()=>S.getState(),y=async(e=!1)=>{if(await P().refresh(void 0,{forceRefetch:e,background:!0}),P().error)throw Error(l("plugins.toast.syncError",{message:P().error}))},f=(e,r)=>d((s)=>{let t={...s.busyIds};if(r===null)delete t[e];else t[e]=r;return{busyIds:t}}),h=(e,r)=>d((s)=>{let t={...s.busyMarketplaces};if(r)t[e]=!0;else delete t[e];return{busyMarketplaces:t}}),w=M({loading:!1,loadedScope:null,upgrading:!1,error:null,cwds:[],marketplaces:[],marketplaceLoadErrors:[],featuredPluginIds:[],installed:[],skills:[],skillProjects:{},skillErrors:[],busyIds:{},busySkills:{},busyMarketplaces:{},refresh:(e=P().cwds,r={})=>{if(m={cwds:e,forceRefetch:r.forceRefetch===!0||m?.forceRefetch===!0},d({cwds:e,...!r.background?{loading:!0}:{}}),b)return b;return b=(async()=>{while(m){let s=m;m=null,d({error:null});try{let[t,i,g]=await Promise.all([a.listSkills(s.cwds,s.forceRefetch),a.listPlugins({...s.cwds.length>0?{cwds:s.cwds}:{},...s.forceRefetch?{forceRefetch:!0}:{}}),a.installedPlugins(s.cwds)]);if(m)continue;let c=I(t);d({loadedScope:JSON.stringify(s.cwds),skills:c.skills,skillProjects:c.projects,skillErrors:c.errors,marketplaces:i.marketplaces,marketplaceLoadErrors:i.marketplaceLoadErrors,featuredPluginIds:i.featuredPluginIds,installed:v(g)})}catch(t){if(!m)d({error:k(t)})}}})().finally(()=>{b=null,d({loading:!1})}),b},install:async(e)=>{if(e.plugin.id in P().busyIds)throw Error("Plugin operation already in progress");let r=E(e.plugin);f(e.plugin.id,"installing");try{let s=await a.installPlugin(Fn(e));return await y(),f(e.plugin.id,null),p(l("plugins.toast.installed",{pluginName:r})),s}catch(s){throw o(`${l("plugins.toast.installError")}: ${k(s)}`),s}finally{f(e.plugin.id,null)}},setPluginEnabled:async(e,r)=>{if(e.id in P().busyIds)return;f(e.id,"toggling");let s=(i)=>d((g)=>({installed:g.installed.map((c)=>c.plugin.id===e.id?{...c,plugin:{...c.plugin,enabled:i}}:c)}));s(r);let t=e.enabled;try{let i=e.source.type==="remote"?e.remotePluginId:void 0;if(i===null)throw Error("Remote plugin ID is missing");let g=await a.setPluginEnabled(e.id,r,i);t=g.enabled,s(g.enabled),await y();let c=P().installed.find((R)=>R.plugin.id===e.id);if(c)t=c.plugin.enabled;if(!c||t!==r)throw Error(l("plugins.toast.toggleNotApplied"));f(e.id,null),p(l(r?"plugins.toast.enabled":"plugins.toast.disabled",{pluginName:E(e)}))}catch(i){s(t),o(`${l("plugins.toast.toggleError")}: ${k(i)}`)}finally{f(e.id,null)}},uninstall:async(e)=>{if(e.id in P().busyIds)return;let r=E(e);f(e.id,"uninstalling");try{let s=e.source.type==="remote"?e.remotePluginId:e.id;if(!s)throw Error("Remote plugin ID is missing");if(await a.uninstallPlugin(s),await y(),P().installed.some((t)=>t.plugin.id===e.id))throw Error(l("plugins.toast.uninstallNotApplied"));f(e.id,null),p(l("plugins.toast.uninstalled",{pluginName:r}))}catch(s){o(`${l("plugins.toast.uninstallError")}: ${k(s)}`)}finally{f(e.id,null)}},readPlugin:async(e)=>(await a.readPlugin(A(e))).plugin,setSkillEnabled:async(e,r)=>{if(e.path in P().busySkills)return;d((t)=>({busySkills:{...t.busySkills,[e.path]:!0}})),d((t)=>({skills:t.skills.map((i)=>i.path===e.path?{...i,enabled:r}:i)}));let s=e.interface?.displayName??e.name;try{let t=await a.setSkillEnabled({path:e.path,enabled:r});if(d((i)=>({skills:i.skills.map((g)=>g.path===e.path?{...g,enabled:t.effectiveEnabled}:g)})),t.effectiveEnabled!==r){o(l("plugins.catalog.toggleNotApplied"));return}p(l(r?"plugins.skills.enabledToast":"plugins.skills.disabledToast",{skillName:s}))}catch(t){d((i)=>({skills:i.skills.map((g)=>g.path===e.path?{...g,enabled:e.enabled}:g)})),o(`${l("plugins.skills.toggleError")}: ${k(t)}`)}finally{d((t)=>{let i={...t.busySkills};return delete i[e.path],{busySkills:i}})}},addMarketplace:async(e)=>{let r=await a.addMarketplace(e);return await y(!0),p(r.alreadyAdded?l("plugins.marketplace.alreadyAdded",{marketplaceName:r.marketplaceName}):l("plugins.marketplace.added",{marketplaceName:r.marketplaceName})),r},removeMarketplace:async(e)=>{h(e,!0);try{await a.removeMarketplace(e),await y(),h(e,!1),p(l("plugins.marketplace.removed",{marketplaceName:e}))}catch(r){o(`${l("plugins.marketplace.removeError")}: ${k(r)}`)}finally{h(e,!1)}},upgradeMarketplace:async(e)=>{h(e,!0);try{let r=await a.upgradeMarketplaces(e);if(await y(!0),h(e,!1),r.errors.length>0)o(`${l("plugins.marketplace.upgradeError")}: ${r.errors.map((s)=>s.message).join("; ")}`);else p(l("plugins.marketplace.upgraded",{marketplaceName:e}))}catch(r){o(`${l("plugins.marketplace.upgradeError")}: ${k(r)}`)}finally{h(e,!1)}},upgradeAll:async()=>{if(P().upgrading)return;d({upgrading:!0});try{let e=await a.upgradeMarketplaces();if(await y(!0),d({upgrading:!1}),e.errors.length>0)o(l("plugins.marketplace.upgradeAllError"));else p(l("plugins.marketplace.upgradedAll"))}catch(e){o(`${l("plugins.marketplace.upgradeAllRequestError")}: ${k(e)}`)}finally{d({upgrading:!1})}}}),S=Object.assign(w,{bindHost:(e)=>{n=e}});return S}
2
+ export{Fn,ut};
@@ -0,0 +1,2 @@
1
+ import{c}from"./chunk-mj7094yh.js";import{G}from"./chunk-1fggcrvs.js";import{isContentEntry as k,isImage as b,isResourceLink as N}from"@nyssance/codex-acp-v2/client";import{ChevronRightIcon as w,ImageIcon as C,LoaderCircleIcon as S,RefreshCwIcon as A}from"lucide-react";import{useEffect as R,useState as h}from"react";import{jsx as s,jsxs as y}from"react/jsx-runtime";function Fe(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function B(e){let n=[];for(let[r,l]of e.content.entries()){if(!k(l))continue;let i=l.content;if(b(i))n.push({key:`${e.id}:${r}`,src:`data:${i.mimeType};base64,${i.data}`,alt:e.title??""});if(N(i))n.push({key:`${e.id}:${r}`,path:i.uri,alt:i.name})}if(n.length)return n;let a=e.rawInput;if(a!==null&&typeof a==="object"&&"path"in a&&typeof a.path==="string")return[{key:e.id,path:a.path,alt:a.path.split(/[\\/]/).at(-1)??a.path}];throw Error(`Image view ${e.id} has no image source`)}function T({images:e}){let{loadImage:n,openImageGallery:a,openImage:r,t:l}=c(),[i,g]=h({}),[v,x]=h(0),f=JSON.stringify(e);R(()=>{let t=!0,u=JSON.parse(f);g({});for(let o of u)(o.src!==void 0?Promise.resolve(o.src):o.path!==void 0&&n?n(o.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(t)g((p)=>({...p,[o.key]:{src:d}}))},()=>{if(t)g((d)=>({...d,[o.key]:{error:!0}}))});return()=>{t=!1}},[f,n,v]);let I=e.flatMap((t)=>{let u=i[t.key];return u&&"src"in u?[{src:u.src,alt:t.alt}]:[]});return s("div",{className:"codex-image-thumbnails",children:e.map((t,u)=>{let o=i[t.key];if(!o)return s("div",{className:"codex-image-thumbnail",role:"status","aria-label":l("stream.codex.imageLoading"),children:s(S,{className:"motion-safe:animate-spin","aria-hidden":"true"})},t.key);if("error"in o)return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,"aria-label":l("stream.codex.imageFailed"),onClick:()=>x((m)=>m+1),children:s(A,{"aria-hidden":"true"})},t.key);return s("button",{type:"button",className:"codex-image-thumbnail",title:t.alt,onClick:()=>{let m=e.slice(0,u).filter((d)=>{let p=i[d.key];return p&&"src"in p}).length;if(a)a(I,m);else r?.(o.src)},children:s("img",{src:o.src,alt:t.alt,draggable:!1})},t.key)})})}function gi({blocks:e}){let{t:n}=c(),a=e.flatMap(B),[r,l]=G(`image-view:${e[0].id}`,!1);return y("div",{className:"codex-activity-item",children:[y("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":r,onClick:()=>l((i)=>!i),children:[y("span",{className:"codex-activity-label",children:[s(C,{className:"codex-activity-icon","aria-hidden":"true"}),s("span",{className:"codex-activity-leading",children:n("stream.codex.viewedImages",{count:a.length})})]}),s(w,{className:r?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"})]}),r&&s(T,{images:a})]})}
2
+ export{Fe,gi};
@@ -0,0 +1,3 @@
1
+ import{d}from"./chunk-d257n8gj.js";import{b,p}from"./chunk-1k697ncv.js";import{at}from"./chunk-bvgqsaey.js";import{ke,l,Se,Oe,i}from"./chunk-4p6svs37.js";import{L,R,Q,F,D,ce,dt}from"./chunk-20k9syde.js";import{re}from"./chunk-mr6k70s4.js";import{He}from"./chunk-p7dd93e5.js";import{f}from"./chunk-1k21j77z.js";import{ct,I}from"./chunk-wvry7t79.js";import{E,se}from"./chunk-tv0fwt2g.js";import{lt}from"./chunk-cvz3k5gk.js";import{st}from"./chunk-d0vhdr07.js";import{hasPluginStore as te}from"@nyssance/codex-acp-v2/client";import{BlocksIcon as ae,BookOpenIcon as ne,CheckIcon as ie,CircleArrowUpIcon as le,MoreVerticalIcon as oe,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 U,useState as S}from"react";import{Button as k}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as xe,DialogContent as he,DialogDescription as Ne,DialogHeader as ye,DialogTitle as be,DialogTrigger as Pe}from"@nyssance/shadcn/vega/components/ui/dialog";import{DropdownMenu as we,DropdownMenuContent as Ce,DropdownMenuItem as Ie,DropdownMenuTrigger as De}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as X}from"@nyssance/shadcn/vega/components/ui/input";import{Label as Me}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 Ee({plugin:t,marketplace:c}){let{t:u}=l(),g=i((n)=>(t.id in n.busyIds)),a=i((n)=>n.installed.some((x)=>x.plugin.id===t.id)),v=i((n)=>n.install),m=t.availability!=="AVAILABLE"||t.installPolicy==="NOT_AVAILABLE",r=u(g?"plugins.card.installing":a?"plugins.sections.installed":"plugins.card.install");if(a&&!g)return e(ie,{className:"text-muted-foreground size-4 shrink-0","aria-label":r});return e(k,{size:"icon-sm",variant:"ghost",className:"text-foreground shrink-0 rounded-full",disabled:g||a||m,"aria-label":r,title:m?u("plugins.disabledReason.unknown"):r,onClick:()=>void v({plugin:t,marketplace:c}).catch(()=>{}),children:g?e(B,{"aria-hidden":"true"}):e(W,{className:"size-5",strokeWidth:2,"aria-hidden":"true"})})}function ze({plugin:t,marketplace:c,actions:u,onOpen:g}){let a=Z(t),v=t.interface?.developerName,m=t.localVersion??t.version,r=[v,m?`v${m}`:null].filter(Boolean).join(" · ");return s(ce,{className:"toolbox-row relative",children:[e(k,{variant:"ghost",className:"absolute inset-0 z-0 size-full","data-hover-background":"none","aria-label":T(t),onClick:()=>g({plugin:t,marketplace:c})}),e(F,{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(I,{name:t.name})})}),s(R,{className:"pointer-events-none relative min-w-0",children:[e(dt,{className:"mb-0.5",children:T(t)}),e(Q,{className:"line-clamp-1",title:a,children:a||c.interface?.displayName||c.name}),r&&e(Q,{"data-toolbox-metadata":"",children:r})]}),e(L,{className:"relative w-8 shrink-0 justify-center",children:u})]})}function q(){return Oe((t)=>t.connection==="ready"&&te(t.agent))}var z=48;function Be({marketplace:t,plugins:c,onOpen:u}){let{t:g}=l(),a=i((n)=>n.removeMarketplace),[v,m]=S(0),r=Math.min(v,Math.max(0,Math.ceil(c.length/z)-1));if(c.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:c.length}),t.path!==null&&s(we,{children:[e(De,{render:e(k,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground ms-auto","aria-label":g("plugins.pageActions")}),children:e(oe,{})}),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(D,{className:"grid grid-cols-1 gap-x-8 gap-y-2 px-0 @min-[700px]:grid-cols-2",children:c.slice(r*z,(r+1)*z).map((n)=>e(ze,{onOpen:u,plugin:n,marketplace:t,actions:e(Ee,{plugin:n,marketplace:t})},n.remotePluginId??n.id))}),c.length>z&&s("div",{className:"flex items-center justify-end gap-2 px-2",children:[e(k,{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(c.length/z)]}),e(k,{variant:"outline",size:"sm",className:"h-9",disabled:(r+1)*z>=c.length,onClick:()=>m(r+1),children:g("plugins.nextPage")})]})]},t.name)}var Te=fe(function({query:c,onOpen:u}){let{t:g}=l(),a=i((n)=>n.marketplaces),v=i((n)=>n.featuredPluginIds),m=U(()=>a.map((n)=>({marketplace:n,entries:n.plugins.map((x)=>({plugin:x,text:[x.name,T(x),Z(x),x.interface?.developerName??"",...x.keywords].join(`
2
+ `).toLowerCase()}))})),[a]),r=U(()=>{let n=new Set(v);return m.map(({marketplace:x,entries:h})=>({marketplace:x,plugins:h.filter(({plugin:y,text:P})=>c===""?x.path!==null||n.has(y.id):P.includes(c)).map(({plugin:y})=>y)}))},[m,v,c]);return s(Y,{children:[r.map(({marketplace:n,plugins:x})=>e(Be,{marketplace:n,plugins:x,onOpen:u},JSON.stringify([n.name,n.path,c]))),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(),c=q(),u=i((N)=>N.addMarketplace),g=i((N)=>N.upgradeAll),a=i((N)=>N.upgrading),[v,m]=S(""),[r,n]=S(!1),[x,h]=S(!1),[y,P]=S(null),A=async()=>{let N=v.trim();if(!N||r)return;n(!0),P(null);try{await u({source:N}),m(""),h(!1)}catch(M){P(M instanceof Error?M.message:String(M))}finally{n(!1)}};return s("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c||a,"aria-busy":a,onClick:()=>void g(),children:[a?e(B,{}):e(le,{"data-icon":"inline-start"}),t("plugins.marketplace.upgradeAll")]}),s(xe,{open:x,onOpenChange:(N)=>{if(!r)h(N)},children:[s(Pe,{render:e(k,{size:"sm",className:"h-9",variant:"outline",disabled:!c}),children:[e(W,{"data-icon":"inline-start"}),t("plugins.addMarketplace")]}),s(he,{children:[s(ye,{children:[e(be,{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(Me,{htmlFor:"marketplace-source",children:t("plugins.marketplace.sourceLabel")}),e(X,{id:"marketplace-source",value:v,disabled:r,onChange:(N)=>m(N.target.value),placeholder:t("plugins.marketplace.sourcePlaceholder")}),y&&e("p",{role:"alert",className:"text-destructive text-sm",children:y}),s("div",{className:"flex justify-end gap-2",children:[e(k,{type:"button",variant:"ghost",disabled:r,onClick:()=>h(!1),children:t("plugins.marketplace.addCancel")}),s(k,{type:"submit",disabled:r||v.trim()==="",children:[r&&e(B,{}),t("plugins.marketplace.addSubmit")]})]})]})]})]})]})}function Le({onOpen:t,query:c}){let u=q(),g=i((m)=>m.marketplaceLoadErrors),a=i((m)=>m.loading)||!u,v=ve(c.trim().toLowerCase());return e(f,{className:"pe-0",viewportClassName:"pe-0",children:s("div",{className:`${E} 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(re,{}):e(Te,{query:v,onOpen:t})]})})}function Ui({cwd:t,active:c,extensions:u,onOpenCatalog:g}){let{t:a}=l(),v=Se(),m=ke(v),r=i((o)=>o.refresh),n=i((o)=>o.loading),x=i((o)=>o.error),[h,y]=S("plugins"),[P,A]=S({plugins:"",skills:""}),N=h==="skills"?P.skills:P.plugins,M=(o)=>A((O)=>({...O,[h]:o})),ee=Oe((o)=>JSON.stringify([...new Set(o.sessionList.map((O)=>He(O.cwd,o.projectContext)).filter((O)=>O!==null))].toSorted())),H=JSON.stringify([...new Set([He(t,v.state.projectContext),...JSON.parse(ee)].filter((o)=>o!==null))].toSorted()),j=i((o)=>o.installed),V=a(h==="skills"?"plugins.skills.search":"plugins.search"),[w,G]=S(null),C=q();K(()=>{if(!c||!C)return;if(m.getState().loadedScope!==H)r(JSON.parse(H))},[c,C,r,H,m]),K(()=>{if(!C)return;return v.onSkillsChanged(()=>void r(void 0,{background:!0}))},[C,r,v]);let J=(o)=>{g?.(),y("plugins"),G(o)},_=(o)=>{g?.(),y(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(ct,{}),s("aside",{className:"bg-sidebar/40 flex w-44 shrink-0 flex-col border-e sm:w-60","aria-label":a("plugins.catalog.navigation"),children:[e("div",{className:"shrink-0 px-3 pt-3",children:e("div",{className:"flex h-9 items-center","data-plugin-sidebar-header":"",children:e("h2",{className:"text-sm leading-8 font-semibold",children:a("plugins.catalog.customize")})})}),s("nav",{"aria-label":a("plugins.manageTabs.aria"),className:"flex shrink-0 flex-col gap-1 px-2 pb-1",children:[u&&s(p,{className:`${d} h-8 gap-2 px-2`,active:u.active,onClick:u.onOpen,children:[e(ae,{className:"size-4"}),e("span",{children:a("plugins.extensions")})]}),["plugins","skills"].map((o)=>s(p,{className:`${d} h-8 gap-2 px-2`,active:!u?.active&&h===o&&w===null,onClick:()=>_(o),children:[o==="plugins"?e(de,{className:"size-4"}):e(ne,{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(f,{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(b,{children:!C||n&&j.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")]}):j.length===0?e("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:a("plugins.sections.installedEmpty")}):j.map((o)=>s(p,{title:T(o.plugin),className:`${d} gap-2 px-2`,active:!u?.active&&w?.plugin.id===o.plugin.id,onClick:()=>J(o),children:[e(I,{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:u?.active?u.content:s(Y,{children:[w&&e(lt,{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(se,{children:e(at,{title:a(`plugins.headings.${h}`),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)=>M(o.target.value),placeholder:V}),N&&e(k,{className:"toolbox-search-clear absolute end-1 top-1/2 -translate-y-1/2",variant:"ghost",size:"icon-xs","aria-label":a("plugins.catalog.clearSearch"),onClick:()=>M(""),children:e(ge,{})})]}),e(k,{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,{})}),h==="plugins"&&e(Ae,{})]})})}),(h==="plugins"||x)&&s("div",{className:"toolbox-content flex shrink-0 flex-col gap-4 pt-2 pb-6",children:[h==="plugins"&&e("p",{className:"text-muted-foreground text-sm",children:a("plugins.catalog.description")}),x&&s("div",{role:"alert",className:"text-destructive flex items-center justify-between gap-2 text-sm",children:[s("p",{children:[a("plugins.loadError.title"),": ",x]}),e(k,{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:h!=="plugins",className:h==="plugins"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(Le,{query:P.plugins,onOpen:J})}),e("div",{hidden:h!=="skills",className:h==="skills"?"flex min-h-0 flex-1 flex-col":"hidden",children:e(st,{query:P.skills,ready:C,onOpenPlugin:J})})]})]})]})})]})}
3
+ export{Ui};
@@ -1,2 +1,2 @@
1
- var a=(e)=>String(e).padStart(2,"0");function Ve(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
- export{Ve};
1
+ var a=(e)=>String(e).padStart(2,"0");function ot(e,l="user"){let r=e.replayed||e.items.some((t)=>t._meta?.codex&&typeof t._meta.codex==="object"&&("historyReplay"in t._meta.codex)&&t._meta.codex.historyReplay===!0),n=l==="user"?s(e.user?._meta,"messageSentAt")??(!r?e.user?.at??null:null):s(e.final.at(-1)?._meta,"messageCompletedAt")??e.items.map((t)=>s(t._meta,"turnCompletedAt")).find((t)=>t!==null)??(!r&&e.final.length>0?e.endedAt:null);if(n===null)return null;let o=new Date(n),u=o.toDateString()===new Date().toDateString();return{short:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",...u?{}:{month:"short",day:"numeric"}}).format(o),full:`${o.getFullYear()}-${a(o.getMonth()+1)}-${a(o.getDate())} ${a(o.getHours())}:${a(o.getMinutes())}`}}function s(e,l){let r=e?.codex;if(typeof r!=="object"||r===null)return null;let n=r[l];return typeof n==="number"&&Number.isFinite(n)&&Math.abs(n)<=8640000000000000?n:null}
2
+ export{ot};
@@ -0,0 +1,2 @@
1
+ import{te}from"./chunk-ktvh4yb5.js";import{t}from"./chunk-mv51zgj1.js";import{SquareSlashIcon as s}from"lucide-react";import{useRef as l}from"react";import{jsx as r}from"react/jsx-runtime";function bo({textareaRef:a,onOpenChange:p,menuOpen:e,disabled:m}){let{t:o}=t(),n=l(!1);return r(te,{"aria-label":o("composer.commands"),title:o("composer.commands"),disabled:m,"aria-pressed":e,onPointerDown:()=>{n.current=e},onClick:()=>{p(!n.current),a.current?.getTextarea()?.focus()},children:r(s,{className:"size-4"})})}
2
+ export{bo};
@@ -1,2 +1,2 @@
1
- var ki=280;function ho({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function be({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function Kt({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function vo({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function xo({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function yo({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
- export{ki,ho,be,Kt,vo,xo,yo};
1
+ var ra=280;function Vo({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function Re({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function mn({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function jo({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function $o({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function Ko({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
+ export{ra,Vo,Re,mn,jo,$o,Ko};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-y6kzbbya.js";import{ht,vt}from"./chunk-3ka3bt0t.js";import{Ge}from"./chunk-vbab9hc4.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ki({providers:n,store:l}){let{t:m}=e().host,d=ht(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=Ge(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await vt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
+ export{Ki};
@@ -0,0 +1,2 @@
1
+ import{n}from"./chunk-mv51zgj1.js";import{e}from"./chunk-y6kzbbya.js";import{Le,Ye,xe}from"./chunk-06zh85wp.js";import{Qe}from"./chunk-8mgypdap.js";import{inSessionTree as d}from"@nyssance/codex-acp-v2/client";import{jsx as t,jsxs as c,Fragment as p}from"react/jsx-runtime";var u=[];function Rt({sessionId:o}){let l=n((s)=>s.sessions),{host:f}=e(),a=n((s)=>s.actions),r=a.some((s)=>d(l,o,s.sessionId))?a.filter((s)=>d(l,o,s.sessionId)):u,i=r.filter(Le),m=r.filter((s)=>!Le(s));return c(p,{children:[t("div",{className:"mx-auto max-h-[50vh] w-full max-w-3xl shrink-0 overflow-y-auto px-3","data-subagent-shelf":!0,children:t(Qe,{sessionId:o})}),m.length>0&&t("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-3 px-6 pb-3","data-session-actions":!0,children:m.map((s)=>c("div",{children:[s.sessionId!==o&&t("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:s.sessionId===null?"":l[s.sessionId]?.title??f.t("subagents.untitled")}),t(xe,{action:s})]},s.id))}),i[0]!==void 0&&t(Ye,{action:i[0],total:i.length},i[0].id)]})}
2
+ export{Rt};
@@ -1,2 +1,2 @@
1
- import{x}from"./chunk-qxabrz98.js";import{t}from"./chunk-q6km9nha.js";import{B}from"./chunk-y6afvrnv.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(x,{text:e.text,streaming:o})})}if(i.isImage(e))return n(B,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(B,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function oe({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
2
- export{oe};
1
+ import{S}from"./chunk-mj7094yh.js";import{t}from"./chunk-mv51zgj1.js";import{Z}from"./chunk-j69t1f4a.js";import{ContentBlock as i}from"@agentclientprotocol/sdk/experimental/v2/unstable";import{isEmbeddedResource as m,isResourceLink as u}from"@nyssance/codex-acp-v2/client";import{jsx as n}from"react/jsx-runtime";function d({block:e,streaming:o}){let r=t();if(i.isText(e)){if(e.text.length===0)return null;return n("div",{className:"codex-assistant-message",children:n(S,{text:e.text,streaming:o})})}if(i.isImage(e))return n(Z,{block:e,generated:!0});if(i.isAudio(e))return n("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});if(u(e)||m(e))return n(Z,{block:e,generated:!0});return n("div",{className:"text-muted-foreground",children:r.t("timeline.unsupportedContent",{type:e.type})})}function be({content:e,messageId:o,streaming:r}){return e.map((s,a)=>n(d,{block:s,streaming:r},`${o}:${a}`))}
2
+ export{be};
@@ -0,0 +1,2 @@
1
+ import{createContext as o,useContext as n,useEffect as r}from"react";var ro=o(null);function C(t){let e=n(ro);r(()=>{if(t&&e!==null)return e()},[t,e])}
2
+ export{ro,C};
@@ -0,0 +1,2 @@
1
+ import{M}from"./chunk-667z0pac.js";import{fe}from"./chunk-1k697ncv.js";import{x,X}from"./chunk-feg5rp9g.js";import{N,j}from"./chunk-y0q6jwq4.js";import{de,Y}from"./chunk-r9sweaq4.js";import{cn as S}from"cn";import{BoxIcon as U,ChevronRightIcon as E,PlusIcon as z,StarIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as y}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as L,DropdownMenuContent as _,DropdownMenuGroup as k,DropdownMenuItem as O,DropdownMenuRadioGroup as K,DropdownMenuRadioItem as q,DropdownMenuSeparator as J,DropdownMenuTrigger as Q}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Input as V}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as e,jsxs as a}from"react/jsx-runtime";function qn({sessionId:l,trigger:f,favorite:n=!1,hoverBackground:R=n?"none":void 0,allowRemove:B=!0,submenu:g=!1,className:A,onOpenChange:T}){let{t}=x(),c=Y(),H=X(),P=fe(),{collections:s,order:C}=de(),i=C.find((o)=>s[o].sessionIds.includes(l)),[F,G]=d(!1),[w,D]=d(!1),[m,b]=d(""),[r,h]=d(!1),v=(o)=>{if(G(o),P(o),T?.(o),!o)D(!1),b("")},p=(o)=>{h(!0),H(o.then(()=>{v(!1)}).finally(()=>h(!1)))};return a(L,{modal:!1,open:F,onOpenChange:(o,I)=>{if(!o&&w&&I.reason==="trigger-hover"){I.cancel();return}v(o)},children:[e(Q,{disabled:r,"data-hover-background":R,openOnHover:n||g,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),onMouseDown:(o)=>{if(n)o.preventBaseUIHandler()},onClick:(o)=>{if(!n)return;o.preventBaseUIHandler(),p(c({type:"favorite",sessionId:l}))},render:f??e(y,{variant:"ghost",size:"icon-sm",className:A,"aria-label":t(n&&i!==void 0?"collection.removeFromAll":"collection.addTo"),children:e(u,{className:S(i!==void 0&&"fill-current")})})}),a(_,{className:"w-56 font-normal",side:g?"inline-end":"bottom",align:g?"start":"end",sideOffset:4,children:[e(k,{children:e(K,{value:i??null,children:C.map((o)=>a(q,{value:o,disabled:r||i===o,closeOnClick:!1,onClick:()=>p(c({type:"add",collectionId:o,sessionId:l})),children:[o===N?e(u,{}):s[o].emoji?e("span",{className:"flex size-4 shrink-0 items-center justify-center text-sm","aria-hidden":"true",children:s[o].emoji}):e(U,{}),e("span",{className:"min-w-0 flex-1 truncate",children:j(s[o],t)})]},o))})}),e(J,{}),a(k,{children:[a(O,{disabled:r,closeOnClick:!1,onClick:()=>D(!0),children:[e(z,{}),t("collection.newCollection")]}),B&&i!==void 0&&a(O,{disabled:r,closeOnClick:!1,onClick:()=>p(c({type:"remove",sessionId:l})),children:[e(u,{}),t("collection.removeFromAll")]})]}),w&&a("form",{className:"flex items-center gap-1 px-2 py-1.5",onSubmit:(o)=>{if(o.preventDefault(),o.stopPropagation(),!m.trim()||r)return;p(c({type:"create",id:`collection-${crypto.randomUUID()}`,name:m,sessionId:l}))},children:[e(V,{autoFocus:!0,"aria-label":t("collection.collectionName"),placeholder:t("collection.collectionName"),value:m,disabled:r,onChange:(o)=>b(o.target.value),onKeyDown:(o)=>o.stopPropagation(),className:"h-7 min-w-0"}),e(y,{size:"xs",type:"submit",disabled:r||!m.trim(),children:t("collection.confirm")})]})]})]})}function Ji({sessionId:l,allowRemove:f=!0}){let{t:n}=x();return e(qn,{sessionId:l,allowRemove:f,submenu:!0,trigger:e(M,{icon:e(u,{}),label:n("collection.addTo"),trailing:e(E,{className:"rtl:rotate-180"})})})}
2
+ export{qn,Ji};
@@ -0,0 +1,2 @@
1
+ import{t,rt}from"./chunk-mv51zgj1.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{isEmbeddedResource as B,isImage as h,isResourceLink as E}from"@nyssance/codex-acp-v2/client";import{DownloadIcon as T,FileIcon as N,ImageOffIcon as L,LoaderCircleIcon as F}from"lucide-react";import{useState as y}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";function Ar(e){let s=e.split(/[\\/]/).at(-1)??e;if(e.startsWith("file:")||/^https?:/.test(e))s=new URL(e).pathname.split("/").at(-1)??"";try{return decodeURIComponent(s)||"attachment"}catch(a){if(a instanceof URIError)return s||"attachment";throw a}}function U(e,s){let a=document.createElement("a");a.href=s,a.download=e,a.click()}function Z({block:e,generated:s=!1}){let a=t(),[p,d]=y(!1),[I,C]=y(null);if(E(e)){if(e.uri==="codex-image:unavailable")return o("span",{className:"text-muted-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[n(L,{className:"size-4"}),a.t("timeline.imageUnavailable")]});let c=Ar(e.uri);return o(u,{variant:"outline",className:"h-auto max-w-full min-w-0 justify-start gap-3 overflow-hidden p-3","aria-label":e.title??e.name,title:e.uri,onClick:()=>a.openLink(e.uri),children:[n(N,{}),o("span",{className:"min-w-0 flex-1 text-start",children:[n("span",{className:"block truncate",children:e.title??e.name}),o("span",{className:"text-muted-foreground block truncate text-xs",children:[(e.title??e.name)!==c&&`${c} · `,e.mimeType??c.split(".").at(-1)?.toUpperCase()]})]})]})}if(!B(e)&&!h(e))return null;let i=h(e)?{uri:e.uri??`image.${e.mimeType.split("/")[1]??"png"}`,mimeType:e.mimeType,blob:e.data}:e.resource,r=Ar(i.uri);if("text"in i)return o("div",{className:"min-w-0",children:[n("pre",{className:"overflow-x-auto whitespace-pre-wrap",children:i.text}),o(u,{variant:"link",size:"sm",className:"max-w-full min-w-0",title:i.uri,onClick:()=>a.openLink(i.uri),children:[n(N,{}),n("span",{className:"truncate",children:r})]})]});let l=`data:${i.mimeType??"application/octet-stream"};base64,${i.blob}`,f=i.mimeType?.toLowerCase().startsWith("image/")&&I!==l,{openImage:g,openImageGallery:w}=a,x=w?()=>w([{src:l,alt:r,uri:i.uri}],0):g&&(()=>g(l)),m=s&&f,R=async()=>{d(!0);try{if(a.saveFile)await a.saveFile(r,i.blob);else U(r,l)}catch(c){rt(a,c)}finally{d(!1)}},v=n("img",{src:l,alt:"",className:s?"max-h-[40rem] max-w-full object-contain":"max-h-96 max-w-full rounded object-contain",onError:()=>C(l)});return o("div",{className:m?"codex-generated-image":"flex max-w-full min-w-0 flex-col items-start gap-1",children:[f&&(x===void 0?v:n(u,{variant:"ghost",className:s?"codex-generated-image-preview h-auto max-w-full p-0":"h-auto max-w-full p-0","aria-label":a.t("timeline.viewImage"),onClick:x,children:v})),o(u,{variant:m?"secondary":"link",size:m?"icon":"sm",className:m?"codex-generated-image-download":"max-w-full min-w-0",disabled:p,title:a.t("timeline.download",{name:r}),"aria-label":a.t("timeline.download",{name:r}),onClick:()=>{R()},children:[p?n(F,{className:"motion-safe:animate-spin"}):n(T,{}),!m&&n("span",{className:"truncate",children:r})]})]})}
2
+ export{Ar,Z};