@alwith/module-chat 0.5.24 → 0.5.25

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 (314) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/approval/choice-elicitation-form.js +1 -1
  3. package/dist/approval/choice-schema.js +1 -1
  4. package/dist/approval/permission-options.js +1 -1
  5. package/dist/approval/permission-view.js +1 -1
  6. package/dist/approval/schema-elicitation-form.js +1 -1
  7. package/dist/approval/url-elicitation-card.js +1 -1
  8. package/dist/{chunk-f5gsffbv.js → chunk-03x33m2h.js} +2 -2
  9. package/dist/chunk-04xjj6q3.js +2 -0
  10. package/dist/{chunk-855w49k0.js → chunk-09zfz3ap.js} +2 -2
  11. package/dist/{chunk-pz0v5f2k.js → chunk-0kb39fpp.js} +2 -2
  12. package/dist/{chunk-qwfw4xpn.js → chunk-0kdemqjf.js} +2 -2
  13. package/dist/{chunk-vnsgjnp3.js → chunk-0kvfbr22.js} +2 -2
  14. package/dist/{chunk-95mynf7q.js → chunk-10emnq39.js} +2 -2
  15. package/dist/{chunk-9j9rx57q.js → chunk-1fr9rhkn.js} +2 -2
  16. package/dist/{chunk-wb8sf2ww.js → chunk-1fxadr5w.js} +2 -2
  17. package/dist/{chunk-kmdag4vy.js → chunk-1zh28e39.js} +2 -2
  18. package/dist/{chunk-fmjez7xp.js → chunk-22tg663v.js} +2 -2
  19. package/dist/{chunk-nj9y0bwb.js → chunk-2ac213n3.js} +2 -2
  20. package/dist/{chunk-wm0jty6e.js → chunk-2apyrry0.js} +2 -2
  21. package/dist/{chunk-99fh3f1v.js → chunk-2djv6s3a.js} +2 -2
  22. package/dist/{chunk-3bsk6xcf.js → chunk-2dvryx1q.js} +2 -2
  23. package/dist/{chunk-ececn091.js → chunk-2gg3gcmb.js} +1 -1
  24. package/dist/{chunk-7absxkjt.js → chunk-2hzdkgrk.js} +2 -2
  25. package/dist/{chunk-kz1kjzmq.js → chunk-33tyec6w.js} +2 -2
  26. package/dist/{chunk-f1x483c9.js → chunk-3fm507f7.js} +2 -2
  27. package/dist/{chunk-mnzqtg7h.js → chunk-3k33zp9m.js} +1 -1
  28. package/dist/{chunk-ypk1gwzc.js → chunk-3p9g44yz.js} +5 -5
  29. package/dist/chunk-3v3bd582.js +2 -0
  30. package/dist/{chunk-vt6cyes7.js → chunk-46phvpzh.js} +2 -2
  31. package/dist/{chunk-8dbx6g7q.js → chunk-4hwtb6yn.js} +1 -1
  32. package/dist/{chunk-gsfgdnfp.js → chunk-4jghs8rf.js} +2 -2
  33. package/dist/{chunk-jgd6dcgy.js → chunk-4qp43adx.js} +2 -2
  34. package/dist/{chunk-pbf73n1s.js → chunk-4vk86bbk.js} +2 -2
  35. package/dist/{chunk-tgskd2p2.js → chunk-517bhxvr.js} +2 -2
  36. package/dist/{chunk-0wa9yjg3.js → chunk-5c5z2b48.js} +2 -2
  37. package/dist/chunk-5dkj3ntx.js +5 -0
  38. package/dist/{chunk-j322kgxf.js → chunk-5r081sme.js} +2 -2
  39. package/dist/{chunk-5ap6fvrp.js → chunk-6fefnp6e.js} +1 -1
  40. package/dist/{chunk-36m8zstj.js → chunk-6g7btgsr.js} +2 -2
  41. package/dist/{chunk-drhzcs6e.js → chunk-6rgyckw8.js} +2 -2
  42. package/dist/{chunk-2rkrmpa7.js → chunk-6wmdpam5.js} +2 -2
  43. package/dist/{chunk-jxntqarp.js → chunk-725wv6ca.js} +2 -2
  44. package/dist/{chunk-azfmr99x.js → chunk-77cd8tev.js} +2 -2
  45. package/dist/{chunk-rbv1scqm.js → chunk-7a668qzy.js} +2 -2
  46. package/dist/{chunk-1e0e41vw.js → chunk-7e1wvb6e.js} +1 -1
  47. package/dist/{chunk-8hf11jas.js → chunk-7p80b5jc.js} +2 -2
  48. package/dist/{chunk-mvs2dzyt.js → chunk-81r1geaz.js} +2 -2
  49. package/dist/{chunk-qmzb07jg.js → chunk-8e5ytb0f.js} +2 -2
  50. package/dist/{chunk-yg3xhn5m.js → chunk-8xdak312.js} +2 -2
  51. package/dist/{chunk-k7ye738q.js → chunk-8zrfdjy4.js} +2 -2
  52. package/dist/{chunk-sqjgh9e2.js → chunk-9183jr6z.js} +3 -3
  53. package/dist/{chunk-ckyat78p.js → chunk-96tcqne6.js} +2 -2
  54. package/dist/chunk-99ftqpgg.js +4 -0
  55. package/dist/{chunk-7k64wn19.js → chunk-9jep8zjg.js} +3 -3
  56. package/dist/{chunk-1kbxsxft.js → chunk-9n2vrkkh.js} +2 -2
  57. package/dist/{chunk-btanfat4.js → chunk-9zth7avc.js} +1 -1
  58. package/dist/{chunk-g44hhdha.js → chunk-a5htm58g.js} +2 -2
  59. package/dist/{chunk-6t5war9h.js → chunk-ap6sr2c6.js} +2 -2
  60. package/dist/{chunk-r19q0w11.js → chunk-awfvvmjt.js} +2 -2
  61. package/dist/{chunk-bnbc6q4p.js → chunk-b9y436vs.js} +3 -3
  62. package/dist/{chunk-qd1z91fm.js → chunk-bfcswk98.js} +2 -2
  63. package/dist/{chunk-7170hbdr.js → chunk-bg0cf6kz.js} +2 -2
  64. package/dist/{chunk-3yxjh7b1.js → chunk-ce3wg766.js} +2 -2
  65. package/dist/{chunk-3s94ekrs.js → chunk-chq163r8.js} +2 -2
  66. package/dist/{chunk-agqnt7xq.js → chunk-cpe2b276.js} +2 -2
  67. package/dist/{chunk-pwjz3yxb.js → chunk-crx8p5zx.js} +2 -2
  68. package/dist/{chunk-3e6wcamp.js → chunk-dfcks9g4.js} +2 -2
  69. package/dist/{chunk-cw76pj9b.js → chunk-dv4d6mrb.js} +2 -2
  70. package/dist/{chunk-tpbqg729.js → chunk-dx745syv.js} +1 -1
  71. package/dist/chunk-e24jv7zb.js +2 -0
  72. package/dist/{chunk-rr36dnn9.js → chunk-e5twctz7.js} +2 -2
  73. package/dist/{chunk-jhzs9ab0.js → chunk-ef99py8a.js} +2 -2
  74. package/dist/{chunk-988sgbn9.js → chunk-ewvb59ye.js} +2 -2
  75. package/dist/{chunk-bg03czcx.js → chunk-f06zyvek.js} +2 -2
  76. package/dist/chunk-f50rww1k.js +2 -0
  77. package/dist/{chunk-kc56dhwd.js → chunk-f7ggbprz.js} +2 -2
  78. package/dist/{chunk-rjw63t34.js → chunk-fgk4f0jq.js} +2 -2
  79. package/dist/chunk-fprj3wy4.js +2 -0
  80. package/dist/{chunk-4r7j0ymq.js → chunk-g93wzhsv.js} +2 -2
  81. package/dist/{chunk-ddv00vjf.js → chunk-g9gktxv9.js} +2 -2
  82. package/dist/{chunk-cqnqwa54.js → chunk-gnwa39me.js} +2 -2
  83. package/dist/{chunk-dte0n4kf.js → chunk-h09ez7fc.js} +2 -2
  84. package/dist/{chunk-hdw3mwmb.js → chunk-h9m4z5dk.js} +3 -3
  85. package/dist/chunk-hq06m42h.js +2 -0
  86. package/dist/{chunk-t6vcdf4j.js → chunk-hswtp9wv.js} +1 -1
  87. package/dist/{chunk-vfhxerxt.js → chunk-hza92pfj.js} +2 -2
  88. package/dist/{chunk-qtp1xer1.js → chunk-jamq0frz.js} +1 -1
  89. package/dist/{chunk-1vf83jdk.js → chunk-jsabvejp.js} +2 -2
  90. package/dist/{chunk-1rg3nab3.js → chunk-jst7n5r4.js} +1 -1
  91. package/dist/chunk-k0dnnn77.js +2 -0
  92. package/dist/{chunk-j0m35s05.js → chunk-k1vkc88d.js} +1 -1
  93. package/dist/{chunk-m0834n5y.js → chunk-k2gwmccn.js} +2 -2
  94. package/dist/{chunk-n625g0h1.js → chunk-k727wnh1.js} +1 -1
  95. package/dist/{chunk-3cssygmg.js → chunk-kbbq3y2j.js} +2 -2
  96. package/dist/{chunk-9tp0z23q.js → chunk-kwp1fere.js} +2 -2
  97. package/dist/{chunk-pmkk6e5x.js → chunk-kz8zf6y0.js} +2 -2
  98. package/dist/chunk-mttcvwhx.js +2 -0
  99. package/dist/{chunk-g2qcyqc6.js → chunk-n5dkkw01.js} +2 -2
  100. package/dist/{chunk-x3y5htkt.js → chunk-n7qcezk8.js} +2 -2
  101. package/dist/{chunk-z3nybrbb.js → chunk-n8yww1mr.js} +2 -2
  102. package/dist/{chunk-509kwzxq.js → chunk-nr3spt0n.js} +2 -2
  103. package/dist/{chunk-f2w2sct6.js → chunk-nsb0d92p.js} +1 -1
  104. package/dist/{chunk-4bb6dzzs.js → chunk-p0s2pg33.js} +1 -1
  105. package/dist/chunk-p272qmbv.js +2 -0
  106. package/dist/{chunk-acb8t4jt.js → chunk-p3hxcpfy.js} +2 -2
  107. package/dist/{chunk-apyfztsv.js → chunk-p58e9z34.js} +2 -2
  108. package/dist/{chunk-n2e3a7n4.js → chunk-pf5655kt.js} +1 -1
  109. package/dist/{chunk-ttqy9d4r.js → chunk-pncx4r2c.js} +1 -1
  110. package/dist/{chunk-60neqgfx.js → chunk-ps722b9k.js} +2 -2
  111. package/dist/{chunk-pprt7ntb.js → chunk-pv5g85k0.js} +4 -4
  112. package/dist/{chunk-1mn2t6ga.js → chunk-pw1pws10.js} +2 -2
  113. package/dist/{chunk-qdg5zphd.js → chunk-pyznxtyg.js} +1 -1
  114. package/dist/chunk-q0fhp33b.js +2 -0
  115. package/dist/{chunk-7z4gtfkd.js → chunk-qjrgbqhy.js} +2 -2
  116. package/dist/{chunk-f1gj3yzt.js → chunk-qn2jfxff.js} +2 -2
  117. package/dist/chunk-qn4zvgc9.js +2 -0
  118. package/dist/{chunk-6trv0snh.js → chunk-qqqcqvrv.js} +2 -2
  119. package/dist/{chunk-9tn2n7xv.js → chunk-r1as1cra.js} +1 -1
  120. package/dist/{chunk-a4apcx3e.js → chunk-r4vfytjv.js} +3 -3
  121. package/dist/{chunk-ar4a6nyv.js → chunk-rb0cqdjg.js} +1 -1
  122. package/dist/{chunk-mj7094yh.js → chunk-rezwwmw7.js} +2 -2
  123. package/dist/{chunk-wgrmjfyp.js → chunk-rsp574n3.js} +2 -2
  124. package/dist/chunk-s2w7e9pg.js +2 -0
  125. package/dist/{chunk-4a46cpnm.js → chunk-s7yzvpmc.js} +3 -3
  126. package/dist/{chunk-pzjag1mt.js → chunk-sdf73s05.js} +3 -3
  127. package/dist/{chunk-74qvpvzv.js → chunk-syhh17rh.js} +2 -2
  128. package/dist/{chunk-x2jd9bpn.js → chunk-tdn5g8xd.js} +3 -3
  129. package/dist/chunk-v0p94epn.js +2 -0
  130. package/dist/{chunk-wvry7t79.js → chunk-vgrjqwbq.js} +2 -2
  131. package/dist/{chunk-48fj5m0p.js → chunk-vr0dfq9w.js} +2 -2
  132. package/dist/{chunk-1qyxrh0n.js → chunk-w233xc7k.js} +3 -3
  133. package/dist/{chunk-ddk8v2g9.js → chunk-w8qn76a1.js} +3 -3
  134. package/dist/{chunk-yakar0e2.js → chunk-wnn9r2r6.js} +2 -2
  135. package/dist/chunk-wsbh4n9e.js +2 -0
  136. package/dist/{chunk-g2zznfan.js → chunk-wtf1eyzy.js} +1 -1
  137. package/dist/{chunk-76a04a6j.js → chunk-x2nemdjf.js} +2 -2
  138. package/dist/chunk-x68b6rmk.js +2 -0
  139. package/dist/{chunk-0pzyavch.js → chunk-xdvbb3av.js} +2 -2
  140. package/dist/{chunk-5a6xc345.js → chunk-y7ngqt59.js} +2 -2
  141. package/dist/{chunk-3ka3bt0t.js → chunk-yez26qfc.js} +2 -2
  142. package/dist/chunk-ymy8d3hp.js +4 -0
  143. package/dist/{chunk-m271yxxm.js → chunk-yyba5e1c.js} +2 -2
  144. package/dist/{chunk-h9v3pks1.js → chunk-z18fvy7d.js} +1 -1
  145. package/dist/{chunk-swpy2b9a.js → chunk-z1aqmqgc.js} +2 -2
  146. package/dist/{chunk-mz8a6292.js → chunk-zacep5bq.js} +2 -2
  147. package/dist/{chunk-3vkkmyjm.js → chunk-zp8rq8nh.js} +2 -2
  148. package/dist/{chunk-jm6zxy9h.js → chunk-zyvvk8b2.js} +1 -1
  149. package/dist/codex/activity-group.js +1 -1
  150. package/dist/codex/assistant-message.js +1 -1
  151. package/dist/codex/async-question-card.js +1 -1
  152. package/dist/codex/edited-files-card.js +1 -1
  153. package/dist/codex/image-view-activity.js +1 -1
  154. package/dist/codex/markdown-renderer.js +1 -1
  155. package/dist/codex/navigation-audio.js +1 -1
  156. package/dist/codex/navigation-preview.js +1 -1
  157. package/dist/codex/navigation-rail.js +1 -1
  158. package/dist/codex/patch-view.js +1 -1
  159. package/dist/codex/plan.js +1 -1
  160. package/dist/codex/timeline-virtualizer.js +1 -1
  161. package/dist/codex/turn-activity.js +1 -1
  162. package/dist/codex/user-message.js +1 -1
  163. package/dist/codex/virtualized-turn-list.js +1 -1
  164. package/dist/collections/collection-emoji.js +1 -1
  165. package/dist/collections/collection-menu.js +1 -1
  166. package/dist/collections/collection-panel.js +1 -1
  167. package/dist/collections/collections.js +1 -1
  168. package/dist/collections/host.js +1 -1
  169. package/dist/collections/model.js +1 -1
  170. package/dist/collections/store.js +1 -1
  171. package/dist/composer/completion-filter.js +1 -1
  172. package/dist/composer/completion-menu.js +1 -1
  173. package/dist/composer/effort-slider.js +1 -1
  174. package/dist/composer/model-select.js +1 -1
  175. package/dist/composer/permission-mode-select.js +1 -1
  176. package/dist/composer/prompt-input-attachments.js +1 -1
  177. package/dist/composer/prompt-input-clipboard.js +1 -1
  178. package/dist/composer/prompt-input-context.js +1 -1
  179. package/dist/composer/prompt-input-textarea.d.ts +1 -1
  180. package/dist/composer/prompt-input-textarea.js +1 -1
  181. package/dist/composer/prompt-input.js +1 -1
  182. package/dist/conversation/action-card.js +1 -1
  183. package/dist/conversation/composer/composer.js +1 -1
  184. package/dist/conversation/composer/context.js +1 -1
  185. package/dist/conversation/composer/drafts.js +1 -1
  186. package/dist/conversation/composer/file-items.js +1 -1
  187. package/dist/conversation/composer/long-text.js +1 -1
  188. package/dist/conversation/composer/mention-chips.js +1 -1
  189. package/dist/conversation/composer/mention-uri.js +1 -1
  190. package/dist/conversation/composer/model-menu.d.ts +3 -1
  191. package/dist/conversation/composer/model-menu.js +1 -1
  192. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  193. package/dist/conversation/composer/permission-mode-menu.d.ts +3 -1
  194. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  195. package/dist/conversation/composer/prediction.js +1 -1
  196. package/dist/conversation/composer/prompt-history.d.ts +3 -0
  197. package/dist/conversation/composer/prompt-history.js +1 -0
  198. package/dist/conversation/composer/slash-command-button.js +1 -1
  199. package/dist/conversation/composer/submit-button.js +1 -1
  200. package/dist/conversation/composer/usage-meter.d.ts +3 -1
  201. package/dist/conversation/composer/usage-meter.js +1 -1
  202. package/dist/conversation/connection-notice.js +1 -1
  203. package/dist/conversation/context.js +1 -1
  204. package/dist/conversation/conversation-body.js +1 -1
  205. package/dist/conversation/conversation-search.js +1 -1
  206. package/dist/conversation/conversation-view.js +1 -1
  207. package/dist/conversation/conversation.js +1 -1
  208. package/dist/conversation/diff-modal.js +1 -1
  209. package/dist/conversation/draft-project-picker.js +1 -1
  210. package/dist/conversation/session-actions.js +1 -1
  211. package/dist/conversation/subagent-sessions.js +1 -1
  212. package/dist/image-lightbox.js +1 -1
  213. package/dist/image-preview-dialog.js +1 -1
  214. package/dist/lib/code-highlighter.js +1 -1
  215. package/dist/lib/fuzzy.js +1 -1
  216. package/dist/lib/group-blocks.js +1 -1
  217. package/dist/lib/image-encode.js +1 -1
  218. package/dist/lib/limits.js +1 -1
  219. package/dist/lib/markdown-parser.js +1 -1
  220. package/dist/lib/markdown-rules.js +1 -1
  221. package/dist/lib/model-name.js +1 -1
  222. package/dist/lib/pointer-centered-zoom.js +1 -1
  223. package/dist/lib/prepare-prompt-files.js +1 -1
  224. package/dist/lib/stream-style.js +1 -1
  225. package/dist/lib/streaming-markdown.js +1 -1
  226. package/dist/plugins/catalog-skeleton.js +1 -1
  227. package/dist/plugins/host.js +1 -1
  228. package/dist/plugins/panel-item.js +1 -1
  229. package/dist/plugins/plugin-detail-page.js +1 -1
  230. package/dist/plugins/plugin-icon.js +1 -1
  231. package/dist/plugins/plugin-icons.js +1 -1
  232. package/dist/plugins/plugins-page.js +1 -1
  233. package/dist/plugins/plugins.js +1 -1
  234. package/dist/plugins/read-skill-document.js +1 -1
  235. package/dist/plugins/skill-document.js +1 -1
  236. package/dist/plugins/skills-tab.js +1 -1
  237. package/dist/plugins/store.js +1 -1
  238. package/dist/search/chat-search.js +1 -1
  239. package/dist/search/codex-source-matches.js +1 -1
  240. package/dist/search/dom-matches.js +1 -1
  241. package/dist/search/find-bar.js +1 -1
  242. package/dist/search/literal-matches.js +1 -1
  243. package/dist/session-list/account-menu.js +1 -1
  244. package/dist/session-list/activity-list.js +1 -1
  245. package/dist/session-list/archived-sessions.js +1 -1
  246. package/dist/session-list/help-menu.js +1 -1
  247. package/dist/session-list/host.js +1 -1
  248. package/dist/session-list/navigation-header.js +1 -1
  249. package/dist/session-list/navigation-store.js +1 -1
  250. package/dist/session-list/navigation-tabs.js +1 -1
  251. package/dist/session-list/navigation.js +1 -1
  252. package/dist/session-list/platform.js +1 -1
  253. package/dist/session-list/row-stop-button.js +1 -1
  254. package/dist/session-list/session-groups.js +1 -1
  255. package/dist/session-list/session-info-card.js +1 -1
  256. package/dist/session-list/session-list.js +1 -1
  257. package/dist/session-list/session-row.js +1 -1
  258. package/dist/session-list/session-state-menu.js +1 -1
  259. package/dist/session-list/shortcut-hint.js +1 -1
  260. package/dist/session-list/shortcut.js +1 -1
  261. package/dist/session-list/use-activity-notification.js +1 -1
  262. package/dist/session-list/use-activity-preview.js +1 -1
  263. package/dist/session-list/use-cmd-held.js +1 -1
  264. package/dist/session-list/use-project-sessions.js +1 -1
  265. package/dist/session-list/virtual-session-rows.js +1 -1
  266. package/dist/session-timeline/activity-group.js +1 -1
  267. package/dist/session-timeline/activity-projection.js +1 -1
  268. package/dist/session-timeline/assistant-content.js +1 -1
  269. package/dist/session-timeline/assistant-turn.js +1 -1
  270. package/dist/session-timeline/async-questions.js +1 -1
  271. package/dist/session-timeline/edited-files-card.js +1 -1
  272. package/dist/session-timeline/history-timeline.js +1 -1
  273. package/dist/session-timeline/host.js +1 -1
  274. package/dist/session-timeline/navigation-rail.js +1 -1
  275. package/dist/session-timeline/plan.js +1 -1
  276. package/dist/session-timeline/question-reply.js +1 -1
  277. package/dist/session-timeline/resource-content.js +1 -1
  278. package/dist/session-timeline/session-timeline.js +1 -1
  279. package/dist/session-timeline/timeline-registry.js +1 -1
  280. package/dist/session-timeline/turn-activity.js +1 -1
  281. package/dist/session-timeline/turn-error.js +1 -1
  282. package/dist/session-timeline/turn-retry.js +1 -1
  283. package/dist/session-timeline/turns.js +1 -1
  284. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  285. package/dist/session-timeline/user-message.js +1 -1
  286. package/dist/settings/codex-account-card.js +1 -1
  287. package/dist/settings/login-card.js +1 -1
  288. package/dist/settings/model-alias-settings.js +1 -1
  289. package/dist/settings/model-aliases.js +1 -1
  290. package/dist/settings/provider-logos.js +1 -1
  291. package/dist/settings/provider-section.js +1 -1
  292. package/dist/settings/providers-port.js +1 -1
  293. package/dist/settings/providers.js +1 -1
  294. package/dist/settings/settings-bridge.js +1 -1
  295. package/dist/settings/settings.js +1 -1
  296. package/package.json +1 -1
  297. package/dist/chunk-0p6y2t9b.js +0 -2
  298. package/dist/chunk-6dbswsek.js +0 -2
  299. package/dist/chunk-b13pahat.js +0 -2
  300. package/dist/chunk-bmey8et5.js +0 -2
  301. package/dist/chunk-c32z3wjq.js +0 -2
  302. package/dist/chunk-d8q2qv1m.js +0 -2
  303. package/dist/chunk-dy92pv7q.js +0 -2
  304. package/dist/chunk-fnpf84rf.js +0 -4
  305. package/dist/chunk-hxtxrtpm.js +0 -2
  306. package/dist/chunk-jmb8r6aj.js +0 -2
  307. package/dist/chunk-jwt7q6yx.js +0 -4
  308. package/dist/chunk-nwtambg5.js +0 -2
  309. package/dist/chunk-pk2rvqd0.js +0 -2
  310. package/dist/chunk-q9zawfn1.js +0 -2
  311. package/dist/chunk-qn6ppn0r.js +0 -2
  312. package/dist/chunk-z7sswh39.js +0 -2
  313. package/dist/chunk-zxp0mb14.js +0 -2
  314. /package/dist/{chunk-a1czzft3.js → chunk-py0zbgaj.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{To,xe}from"./chunk-dy92pv7q.js";import{Io}from"./chunk-swpy2b9a.js";import{ln,cn,qe,Ze,dn}from"./chunk-rbv1scqm.js";import{InputGroup as ge,InputGroupAddon as Z,InputGroupButton as ee}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as P}from"cn";import{ArrowUpIcon as be,Loader2Icon as ve,SquareIcon as he,XIcon as Pe}from"lucide-react";import{Children as V,useCallback as h,useEffect as F,useMemo as Ie,useRef as M,useState as ye}from"react";import{flushSync as Le}from"react-dom";import{jsx as a,jsxs as Te}from"react/jsx-runtime";function Y(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Co=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:te,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:re,children:oe,...se})=>{let s=Ze(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ae,D]=ye([]),c=l?s.attachments.files:ae,U=M(c);U.current=c;let ue=h(()=>{x.current?.click()},[]),B=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),O=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((i)=>B(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let K=[];for(let T of _){let Q=I?.sourcePath(T);K.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:O(T),filename:T.name,size:T.size,lastModified:T.lastModified,...Q===void 0?{}:{sourcePath:Q}})}return[...i,...K]})},[I,O,B,z,H,b]),pe=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=l?s.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(To(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${xe}MB.`});return}}W(r)},[c,W,b]),G=l?s.attachments.remove:pe,N=l?s.attachments.clear:me,j=l?s.attachments.openFileDialog:ue;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(R&&x.current&&c.length===0)x.current.value=""},[c,R]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of U.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},q=Ie(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:G,clear:N,openFileDialog:j,fileInputRef:x}),[c,L,G,N,j]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let X=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Y(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Y(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Io(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await re({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},de=(e)=>{e.preventDefault(),X(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)Le(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),J=a(cn.Provider,{value:()=>X(null),children:Te(ln.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:te,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(ge,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return l?a(qe.Provider,{value:q,children:J}):a(dn.Provider,{value:q,children:J})};function wo({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function ko({className:u,...o}){return a(Z,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function So({className:u,...o}){return a(Z,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function _o({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var ne=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||V.count(y.children)<=1?"icon-xs":"xs";return a(ee,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||V.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Po=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(be,{className:"size-4"});if(d==="submitted")g=a(ve,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(he,{className:"size-3 fill-current"});else if(d==="error")g=a(Pe,{className:"size-4"});return a(ee,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
2
- export{Co,wo,ko,So,_o,ne,Po};
1
+ import{Io,xe}from"./chunk-s2w7e9pg.js";import{No}from"./chunk-z1aqmqgc.js";import{cn,dn,qe,Ze,un}from"./chunk-7a668qzy.js";import{InputGroup as ge,InputGroupAddon as Z,InputGroupButton as ee}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as P}from"cn";import{ArrowUpIcon as be,Loader2Icon as ve,SquareIcon as he,XIcon as Pe}from"lucide-react";import{Children as V,useCallback as h,useEffect as F,useMemo as Ie,useRef as M,useState as ye}from"react";import{flushSync as Le}from"react-dom";import{jsx as a,jsxs as Te}from"react/jsx-runtime";function Y(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var wo=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:te,globalDrop:C,syncHiddenInput:R,maxFiles:z,maxFileSize:H,onError:b,onSubmit:re,children:oe,...se})=>{let s=Ze(),l=!!s,ie=o&&l&&s.textInput.value.startsWith("!"),x=M(null),A=M(null),k=M(!1),[ae,D]=ye([]),c=l?s.attachments.files:ae,U=M(c);U.current=c;let ue=h(()=>{x.current?.click()},[]),B=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),O=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),le=h((e)=>{let r=[...e],t=r.filter((i)=>B(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>H?i.size<=H:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}D((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof z==="number"?Math.max(0,z-i.length):void 0,_=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let K=[];for(let T of _){let Q=I?.sourcePath(T);K.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:O(T),filename:T.name,size:T.size,lastModified:T.lastModified,...Q===void 0?{}:{sourcePath:Q}})}return[...i,...K]})},[I,O,B,z,H,b]),pe=h((e)=>D((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),me=h(()=>D((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),W=l?s.attachments.add:le,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Io(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${xe}MB.`});return}}W(r)},[c,W,b]),G=l?s.attachments.remove:pe,N=l?s.attachments.clear:me,j=l?s.attachments.openFileDialog:ue;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(R&&x.current&&c.length===0)x.current.value=""},[c,R]),F(()=>{let e=A.current;if(!e)return;if(C)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,C]),F(()=>{if(!C)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,C]),F(()=>()=>{if(!l){for(let e of U.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ce=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},q=Ie(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:G,clear:N,openFileDialog:j,fileInputRef:x}),[c,L,G,N,j]),w=M({controller:s,files:c,canSubmit:f});w.current={controller:s,files:c,canSubmit:f};let S=M(!0);F(()=>(S.current=!0,()=>{S.current=!1}),[]);let X=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(k.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=A.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:Y(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!S.current)return;let p=w.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(Y(t)===n)t.reset();N()};k.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await No(i),_=w.current.canSubmit===void 0?!0:w.current.canSubmit();if(_!==!0)return{status:"blocked",reason:_};if(!S.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await re({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{k.current=!1}},de=(e)=>{e.preventDefault(),X(e).catch(y)},fe=h((e)=>{if(!e.trim())return;if(l&&s)Le(()=>{s.textInput.setInput(e)});A.current?.requestSubmit()},[s,l]),J=a(dn.Provider,{value:()=>X(null),children:Te(cn.Provider,{value:fe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:te,onChange:ce,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:de,ref:A,"data-tour":"chat-input",...se,children:a(ge,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",ie&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:oe})})]})});return l?a(qe.Provider,{value:q,children:J}):a(un.Provider,{value:q,children:J})};function ko({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function So({className:u,...o}){return a(Z,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function _o({className:u,...o}){return a(Z,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Po({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var ne=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||V.count(y.children)<=1?"icon-xs":"xs";return a(ee,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||V.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},To=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(be,{className:"size-4"});if(d==="submitted")g=a(ve,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(he,{className:"size-3 fill-current"});else if(d==="error")g=a(Pe,{className:"size-4"});return a(ee,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};
2
+ export{wo,ko,So,_o,Po,ne,To};
@@ -1,2 +1,2 @@
1
- import{pe}from"./chunk-yg3xhn5m.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function Yn({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:pe(t)}):null}function Xn({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(Yn,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Tt({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(Xn,{label:t,shortcut:o}):t})]})}
1
+ import{me}from"./chunk-8xdak312.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function Yn({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:me(t)}):null}function Xn({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(Yn,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function Tt({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(Xn,{label:t,shortcut:o}):t})]})}
2
2
  export{Yn,Xn,Tt};
@@ -1,2 +1,2 @@
1
- import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function xi({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
- export{xi};
1
+ import{createPortal as n}from"react-dom";import{jsx as t}from"react/jsx-runtime";function si({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}})}),document.body)}
2
+ export{si};
@@ -1,2 +1,2 @@
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
+ function yo({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{yo};
@@ -1,2 +1,2 @@
1
- import{Mn}from"./chunk-f2w2sct6.js";import{Ai}from"./chunk-cw76pj9b.js";import{Q}from"./chunk-jm6zxy9h.js";import{De,Hi}from"./chunk-6trv0snh.js";import{e}from"./chunk-j0m35s05.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function Er(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function Qt({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=Q(De,(r)=>r),w=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),y=s((r)=>u.sessionId===t?Mn(u.turns,r,u.terminals):[],[u,t]),S=s((r,i)=>Hi(t,r,i),[t]),b=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,g=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(Ai,{placement:"body",getViewport:w,findSourceMatches:y,revealTurn:S,prepareSource:b,subscribeOpen:g,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
2
- export{Er,Qt};
1
+ import{Mn}from"./chunk-nsb0d92p.js";import{Ei}from"./chunk-dv4d6mrb.js";import{Q}from"./chunk-zyvvk8b2.js";import{De,Oi}from"./chunk-qqqcqvrv.js";import{e}from"./chunk-k1vkc88d.js";import{useCallback as s}from"react";import"@alwith/module-chat/search.css";import{jsx as m}from"react/jsx-runtime";var h="alwith-chat:find";function Lr(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function Qt({sessionId:t,rootRef:p}){let{host:v,client:a}=e(),{t:l}=v,u=Q(De,(r)=>r),w=s(()=>p.current?.querySelector("[data-chat-scroll]")??null,[p]),y=s((r)=>u.sessionId===t?Mn(u.turns,r,u.terminals):[],[u,t]),S=s((r,i)=>Oi(t,r,i),[t]),b=s(async(r)=>{await a.loadHistoryNavigation(t);let i=a.state.historyNavigation[t];for(let n of i?.turns??[]){if(r.aborted)return;if(!a.state.historyNavigation[t]?.loadedTurnIds.includes(n.turnId))await a.loadHistoryTurn(t,n.turnId)}let c=new Set;while(!r.aborted){let n=a.state.historyPages[t]?.cursor;if(n==null)return;if(c.has(n))throw Error("Chat history pagination returned a repeated cursor");c.add(n),await a.loadOlderHistory(t)}},[a,t]),{subscribeSearch:f,shouldOpenSearch:d}=v,g=s((r)=>{let i=(o)=>{if((o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="f"){if(d&&!d(o))return;o.preventDefault(),r()}},c=(o)=>{if(o.detail===t)r()};window.addEventListener("keydown",i),window.addEventListener(h,c);let n=f?.(r);return()=>{window.removeEventListener("keydown",i),window.removeEventListener(h,c),n?.()}},[f,d,t]);return m("div",{className:"absolute inset-x-0 top-0 z-30",children:m(Ei,{placement:"body",getViewport:w,findSourceMatches:y,revealTurn:S,prepareSource:b,subscribeOpen:g,labels:{search:l("conversation.search.label"),placeholder:l("conversation.search.placeholder"),previous:l("conversation.search.previous"),next:l("conversation.search.next")}},t)})}
2
+ export{Lr,Qt};
@@ -1,2 +1,2 @@
1
- import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function zi(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function Vi(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function ji(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
- export{zi,Vi,ji};
1
+ import{hasAccount as x}from"@nyssance/codex-acp-v2/client";import{useEffect as R,useState as S}from"react";var f="main",p="settings",y="settings:request-agent",w="settings:agent",E="settings:auth-request",A="settings:auth-result",T="settings:request-account",h="settings:account",P="settings:account-error",v=(t)=>t instanceof Error?t.message:String(t);function Vi(t){return{agent:()=>{let n=t.state.agent;if(t.state.connection!=="ready"||!n?.info)return null;return{name:n.info.title??n.info.name,version:n.info.version,authMethods:n.authMethods??[],actions:t.state.actions.filter((o)=>o.sessionId===null)}},subscribe:(n)=>t.store.subscribe(n),logout:()=>t.logout(),login:(n,o)=>t.login(n,o),respond:(n,o)=>t.respond(n,o),account:async()=>{if(t.state.connection!=="ready"||!x(t.state.agent))return null;let[n,o]=await Promise.all([t.readAccount(),t.readRateLimits().catch(()=>null)]);return{account:n,rateLimits:o}},onRateLimits:(n)=>t.onRateLimits(n)}}function ji(t,n){let{listen:o,emitTo:u}=n,g=t.agent(),l=()=>{let s=t.agent();if(u(p,w,s),g===null!==(s===null))c();g=s},i=null,r=0,a=!1,c=async()=>{let s=++r;try{let d=await t.account();if(a||s!==r)return;i=d,await u(p,h,i)}catch(d){if(a||s!==r)return;await u(p,P,v(d))}},e=t.subscribe(l),m=t.onRateLimits((s)=>{if(i===null)return;i={...i,rateLimits:s},u(p,h,i)}),b=Promise.all([o(y,l),o(T,()=>void c()),o(E,({payload:s})=>void(async()=>{try{switch(s.action){case"login":await t.login(s.methodId,s.extra),await c();break;case"logout":await t.logout(),await c();break;case"respond":t.respond(s.actionId,s.answer);break}await u(p,A,{id:s.id,error:null})}catch(d){await u(p,A,{id:s.id,error:v(d)})}})())]);return()=>{a=!0,r++,e(),m(),b.then((s)=>{for(let d of s)d()})}}function $i(t,n=console.error){let{listen:o,emitTo:u}=t,g;async function l(i){let r,a=new Promise((e)=>{r=e}),c=await o(A,(e)=>{if(e.payload.id===i.id)r(e.payload)});try{await u(f,E,i);let{error:e}=await a;if(e!==null)throw Error(e)}finally{c()}}return{useSettingsAccount(){let[i,r]=S(()=>g);return R(()=>{let a=!1,c=Promise.all([o(h,(e)=>{if(a)return;g=e.payload,r(e.payload)}),o(P,(e)=>{if(a)return;if(g===void 0)r(null),n(e.payload);else console.error("Account refresh failed",e.payload)})]);return c.then(()=>{if(!a)return u(f,T)}),()=>{a=!0,c.then((e)=>{for(let m of e)m()})}},[]),i},useSettingsAgent(){let[i,r]=S(void 0);return R(()=>{let a=!1,c=o(w,(e)=>{if(!a)r(e.payload)});return c.then(()=>{if(!a)return u(f,y)}),()=>{a=!0,c.then((e)=>e())}},[]),i},requestSignOut:()=>l({id:crypto.randomUUID(),action:"logout"}),requestSignIn:(i,r)=>l({id:crypto.randomUUID(),action:"login",methodId:i,extra:r}),requestActionResponse:(i,r)=>l({id:crypto.randomUUID(),action:"respond",actionId:i,answer:r})}}
2
+ export{Vi,ji,$i};
@@ -1,2 +1,2 @@
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};
1
+ import{ii}from"./chunk-09zfz3ap.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function oi(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 ii(a,r)}
2
+ export{oi};
@@ -1,2 +1,2 @@
1
- import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),ln=d(null);function ea(){return i(ln)}var cn=d(null);function ta(){return i(cn)}var qe=d(null);function We(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Ze=()=>i(C);function na(){let r=i(qe);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(qe);function Eo({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,attachments:y,onAttachmentsChange:U,children:B}){let L=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),S=A!==void 0,[G,J]=z(r),p=A??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,S)R?.(t);else J(t)},[S,R]),g=n(()=>P(""),[P]),x=y!==void 0,[K,N]=z([]),v=y??K,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)U?.(e);else N(e)},[x,U]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:L(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[f,L,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let k=n(()=>{w.current?.()},[]),b=q(()=>({files:v,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[v,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:W,clearSubmitted:c??g},attachments:b,__registerFileInput:H}),[p,P,g,W,c,b,H]);return D(C.Provider,{value:Q,children:D(qe.Provider,{value:b,children:B})})}var dn=d(null);function T(){let r=X(),l=i(dn),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
- export{ln,ea,cn,ta,qe,We,Ze,na,Eo,dn,T};
1
+ import{createContext as d,useCallback as n,useContext as i,useEffect as V,useMemo as q,useRef as I,useState as z}from"react";import{jsx as D}from"react/jsx-runtime";var C=d(null),cn=d(null);function ta(){return i(cn)}var dn=d(null);function na(){return i(dn)}var qe=d(null);function We(){let r=i(C);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return r}var Ze=()=>i(C);function oa(){let r=i(qe);if(!r)throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return r}var X=()=>i(qe);function Lo({initialInput:r="",revision:l,onSubmittedClear:c,onRemoveAttachment:F,attachmentPolicy:f,value:A,onValueChange:R,attachments:y,onAttachmentsChange:U,children:B}){let L=n((t)=>{if(t.type)return t.type;let e=(t.name||"").toLowerCase();if(e.endsWith(".png"))return"image/png";if(e.endsWith(".jpg")||e.endsWith(".jpeg"))return"image/jpeg";if(e.endsWith(".webp"))return"image/webp";if(e.endsWith(".gif"))return"image/gif";if(e.endsWith(".bmp"))return"image/bmp";if(e.endsWith(".svg"))return"image/svg+xml";return""},[]),S=A!==void 0,[G,J]=z(r),p=A??G,o=I({value:p,external:l,revision:0});if(o.current.value!==p||o.current.external!==l)o.current={value:p,external:l,revision:o.current.revision+1};let W=n(()=>o.current.revision,[]),P=n((t)=>{if(o.current.value=t,o.current.revision++,S)R?.(t);else J(t)},[S,R]),g=n(()=>P(""),[P]),x=y!==void 0,[K,N]=z([]),v=y??K,h=I(v);h.current=v;let s=n((t)=>{let e=typeof t==="function"?t(h.current):t;if(x)U?.(e);else N(e)},[x,U]),j=I(null),w=I(()=>{}),O=n((t)=>{let e=[...t];if(e.length===0)return;s((a)=>{let m=f===void 0?e:f.uniqueFiles(e,a);return[...a,...m.map((u)=>{let _=f?.sourcePath(u);return{id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(u),mediaType:L(u),filename:u.name,size:u.size,lastModified:u.lastModified,..._===void 0?{}:{sourcePath:_}}})]})},[f,L,s]),M=n((t)=>{s((e)=>{let a=e.find((m)=>m.id===t);if(a?.url)URL.revokeObjectURL(a.url);return e.filter((m)=>m.id!==t)}),F?.()},[F,s]),E=n(()=>{s((t)=>{for(let e of t)if(e.url)URL.revokeObjectURL(e.url);return[]})},[s]);V(()=>{if(x)return;return()=>{for(let t of h.current)if(t.url)URL.revokeObjectURL(t.url)}},[x]);let k=n(()=>{w.current?.()},[]),b=q(()=>({files:v,add:O,remove:M,clear:E,openFileDialog:k,fileInputRef:j}),[v,O,M,E,k]),H=n((t,e)=>{j.current=t.current,w.current=e},[]),Q=q(()=>({textInput:{value:p,setInput:P,clear:g,getRevision:W,clearSubmitted:c??g},attachments:b,__registerFileInput:H}),[p,P,g,W,c,b,H]);return D(C.Provider,{value:Q,children:D(qe.Provider,{value:b,children:B})})}var un=d(null);function T(){let r=X(),l=i(un),c=r??l;if(!c)throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return c}
2
+ export{cn,ta,dn,na,qe,We,Ze,oa,Lo,un,T};
@@ -1,2 +1,2 @@
1
- import{l,i}from"./chunk-g2zznfan.js";import{L,R,Y,F,D,ce}from"./chunk-h9v3pks1.js";import{re}from"./chunk-mnzqtg7h.js";import{f}from"./chunk-1k21j77z.js";import{le}from"./chunk-7170hbdr.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 Q,DialogDescription as W,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(Y,{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(Q,{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(W,{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]})]})})})]})}
1
+ import{l,i}from"./chunk-wtf1eyzy.js";import{L,R,Y,F,D,ce}from"./chunk-z18fvy7d.js";import{re}from"./chunk-3k33zp9m.js";import{f}from"./chunk-1k21j77z.js";import{le}from"./chunk-bg0cf6kz.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 Q,DialogDescription as W,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(Y,{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(Q,{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(W,{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
2
  export{st};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-j0m35s05.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function ft({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
2
- export{ft};
1
+ import{e}from"./chunk-k1vkc88d.js";import{useState as d}from"react";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as v,DialogContent as C,DialogDescription as k,DialogFooter as I,DialogHeader as K,DialogTitle as E}from"@nyssance/shadcn/vega/components/ui/dialog";import{Empty as F,EmptyDescription as b,EmptyHeader as T,EmptyTitle as x}from"@nyssance/shadcn/vega/components/ui/empty";import{Field as w,FieldGroup as A,FieldLabel as L}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Spinner as H}from"@nyssance/shadcn/vega/components/ui/spinner";import{jsx as t,jsxs as i}from"react/jsx-runtime";function P(r,a){switch(r.methodId){case"chat-gpt":return a("connection.signIn");case"chat-gpt-device-code":return a("connection.signInDevice");case"api-key":return a("connection.signInApiKey");default:return r.name}}function vt({methods:r,signIn:a}){let{host:g}=e(),{t:o}=g,[p,u]=d(null),[f,l]=d(!1),[c,h]=d(""),y=async(n,s={})=>{u(n);try{await a(n,s)}catch(D){g.reportError?.(D)}finally{u(null)}};return i(F,{children:[i(T,{children:[t(x,{children:o("connection.signIn")}),t(b,{children:o("connection.signInHint")})]}),t("div",{className:"flex flex-wrap justify-center gap-2",children:r.map((n,s)=>i(m,{variant:s===0?"default":"outline",disabled:p!==null,onClick:()=>n.methodId==="api-key"?l(!0):void y(n.methodId),children:[p===n.methodId&&t(H,{"data-icon":"inline-start"}),P(n,o)]},n.methodId))}),t(v,{open:f,onOpenChange:l,children:i(C,{children:[i(K,{children:[t(E,{children:o("connection.apiKeyTitle")}),t(k,{children:o("connection.signInApiKey")})]}),t(A,{children:i(w,{children:[t(L,{htmlFor:"codex-api-key",children:o("connection.apiKeyTitle")}),t(B,{id:"codex-api-key",type:"password",autoComplete:"off",placeholder:o("connection.apiKeyPlaceholder"),value:c,onChange:(n)=>h(n.target.value)})]})}),i(I,{children:[t(m,{variant:"outline",onClick:()=>l(!1),children:o("actions.cancel")}),t(m,{disabled:c.trim().length===0||p!==null,onClick:()=>{l(!1),y("api-key",{"api-key":{apiKey:c.trim()}})},children:o("actions.submit")})]})]})})]})}
2
+ export{vt};
@@ -1,2 +1,2 @@
1
- class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function ii(i,e){return n??=new s,n.connect(i,e)}
2
- export{ii};
1
+ class s{worker=new Worker(new URL("@alwith/module-chat/code-highlighter.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(i)=>{let e=this.active,t=i.data;if(t.clientId!==e?.clientId||t.revision!==e.revision){this.fail(Error("Code highlighting worker returned an unexpected request"));return}if(this.active=null,!t.ok){this.fail(Error(t.error));return}let r=this.clients.get(e.clientId);if(r?.revision===e.revision)r.onResult({code:e.code,language:e.language,html:t.html});this.dispatch()},this.worker.onerror=(i)=>this.fail(Error(i.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize code highlighting result"))}fail(i){this.failure=i,this.worker.terminate(),this.pending.clear(),this.active=null;for(let e of this.clients.values())e.onError(i)}dispatch(){if(this.active!==null||this.pending.size===0)return;let i=this.pending.values().next().value;this.pending.delete(i.clientId),this.active=i;try{this.worker.postMessage(i)}catch(e){this.fail(e instanceof Error?e:Error(String(e)))}}connect(i,e){if(this.failure!==null)throw this.failure;let t=++this.nextClientId,r={revision:0,onResult:i,onError:e};return this.clients.set(t,r),{update:(o,l)=>{if(this.failure!==null)throw this.failure;r.revision+=1,this.pending.set(t,{clientId:t,revision:r.revision,code:o,language:l}),this.dispatch()},dispose:()=>{if(this.clients.delete(t),this.pending.delete(t),this.clients.size===0)this.worker.terminate(),n=void 0}}}}var n;function vi(i,e){return n??=new s,n.connect(i,e)}
2
+ export{vi};
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-92xxp77d.js";import{cn as a}from"cn";import{motion as g}from"motion/react";import{jsx as i,jsxs as u}from"react/jsx-runtime";function no({active:t,expanded:r=!1,highlight:s=!0,className:o,...l}){return i("button",{type:"button","data-active":t?"":void 0,"aria-current":t?"page":void 0,className:a(s&&d,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height)] min-w-[var(--navigation-row-height)]":"size-[var(--navigation-row-height)]",o),...l})}function lr({tabs:t,view:r,onViewChange:s,onReset:o,notifications:l,className:p}){return i("div",{className:a("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",p),children:i("div",{role:"tablist",className:`${d} bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-full flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]`,children:t.map((e)=>{let n=r===e.key;return u(no,{role:"tab",active:n,expanded:n,highlight:!1,"aria-selected":n,title:e.title,onClick:()=>s(e.key),onDoubleClick:o&&(()=>o(e.key)),className:a("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-4 [&_svg]:shrink-0",n?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[n&&i(g.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-blue-500 pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:a("relative z-10 grid",n?"ms-2 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})})})}
2
- export{no,lr};
1
+ import{d}from"./chunk-92xxp77d.js";import{cn as a}from"cn";import{motion as g}from"motion/react";import{jsx as i,jsxs as u}from"react/jsx-runtime";function no({active:t,expanded:r=!1,highlight:s=!0,className:o,...l}){return i("button",{type:"button","data-active":t?"":void 0,"aria-current":t?"page":void 0,className:a(s&&d,"focus-visible:outline-foreground/10 flex shrink-0 items-center justify-center rounded-[10px] outline-hidden [corner-shape:superellipse(1.5)] focus-visible:outline-2 focus-visible:outline-offset-2 [&_svg]:size-4",r?"h-[var(--navigation-row-height)] min-w-[var(--navigation-row-height)]":"size-[var(--navigation-row-height)]",o),...l})}function ur({tabs:t,view:r,onViewChange:s,onReset:o,notifications:l,className:p}){return i("div",{className:a("relative mb-2 flex h-[var(--navigation-row-height,30px)] shrink-0 items-center gap-0.5",p),children:i("div",{role:"tablist",className:`${d} bg-foreground/5 flex h-[var(--navigation-row-height,30px)] w-full flex-none items-center gap-0.5 rounded-[10px] [corner-shape:superellipse(1.5)]`,children:t.map((e)=>{let n=r===e.key;return u(no,{role:"tab",active:n,expanded:n,highlight:!1,"aria-selected":n,title:e.title,onClick:()=>s(e.key),onDoubleClick:o&&(()=>o(e.key)),className:a("relative isolate h-[var(--navigation-row-height,30px)] min-w-[var(--navigation-row-height,30px)] justify-start rounded-[10px] px-[6px] text-sm [corner-shape:superellipse(1.5)] [&_svg]:relative [&_svg]:z-10 [&_svg]:size-4 [&_svg]:shrink-0",n?"grow transition-[flex-grow] duration-200 ease-out":"grow-0 duration-0"),children:[n&&i(g.span,{layoutId:"navigation-selected-pill","aria-hidden":"true",className:"bg-foreground/8 pointer-events-none absolute inset-0 -z-10 rounded-[10px] [corner-shape:superellipse(1.5)]",transition:{duration:0.2,ease:[0.22,1,0.36,1]}}),e.icon,l?.has(e.key)&&i("span",{"data-activity-notification":!0,"aria-hidden":"true",className:"bg-blue-500 pointer-events-none absolute top-1 right-1 z-20 size-1.5 rounded-full motion-safe:animate-[activity-notification-pulse_2s_ease-in-out_infinite]"}),i("span",{className:a("relative z-10 grid",n?"ms-2 grid-cols-[1fr] transition-[grid-template-columns,margin-inline-start] duration-200 ease-out":"ms-0 grid-cols-[0fr] duration-0"),children:i("span",{className:"min-w-0 overflow-hidden whitespace-nowrap",children:e.title})})]},e.key)})})})}
2
+ export{no,ur};
@@ -1,2 +1,2 @@
1
- import{ge}from"./chunk-jmb8r6aj.js";function Jn(r){let s=ge(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function pe(r){return Jn(r).join(ge()?"":"+")}
2
- export{Jn,pe};
1
+ import{fe}from"./chunk-fprj3wy4.js";function Jn(r){let s=fe(),c=r.split("|").map((e)=>e.trim()).filter(Boolean),o=c.reduce((e,t)=>t.split("+").length>e.split("+").length?t:e,c[0]??r),a=[];for(let e of o.split("+").map((t)=>t.trim()))switch(e.toLowerCase()){case"commandorcontrol":case"cmdorctrl":a.push(s?"⌘":"Ctrl");break;case"command":case"meta":case"cmd":a.push(s?"⌘":"Win");break;case"control":case"ctrl":a.push(s?"⌃":"Ctrl");break;case"shift":a.push(s?"⇧":"Shift");break;case"alt":case"option":a.push(s?"⌥":"Alt");break;case"enter":case"return":a.push(s?"↩":"Enter");break;case"tab":a.push(s?"⇥":"Tab");break;case"backspace":case"delete":a.push(s?"⌫":"Backspace");break;case"escape":case"esc":a.push(s?"⎋":"Esc");break;case"space":a.push(s?"␣":"Space");break;case"fn":a.push("fn");break;case"arrowleft":a.push("←");break;case"arrowright":a.push("→");break;case"arrowup":a.push("↑");break;case"arrowdown":a.push("↓");break;default:a.push(e.toUpperCase())}return a}function me(r){return Jn(r).join(fe()?"":"+")}
2
+ export{Jn,me};
@@ -1,2 +1,2 @@
1
- import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Nn(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Ni(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Nn(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
- export{Nn,Ni};
1
+ import{terminalOf as u,textOf as p}from"@nyssance/codex-acp-v2/client";function Nn(n){if(n.kind!=="tool")return!1;let t=n._meta?.codex;return typeof t==="object"&&t!==null&&"commandSource"in t&&t.commandSource==="userShell"}function Ai(n,t,r){if(n.kind!=="tool"){let o=p(n.content),d=/^\s*\*\*([^\n]*?)\*\*\s*$/.exec(o);return{type:"thinking",id:n.id,thinking:d?d[1]:o,isComplete:!r}}if(n.name==="subagent"){let o=s(n.rawInput,n.id);return{type:"subagent",id:n.id,name:g(o.agentPath,n.id),threadId:f(o.agentThreadId,"agentThreadId",n.id),activity:y(o.activity,n.id),model:l(o.model,"model",n.id),reasoningEffort:l(o.reasoningEffort,"reasoningEffort",n.id),status:n.status??"pending",blocks:[]}}if(n.name==="collab"){let o=s(s(s(n._meta,n.id).codex,n.id).collaboration,n.id);if(typeof o.tool!=="string"||!Array.isArray(o.agents))throw Error(`Collaboration call ${n.id} lacks codex-acp-v2 agent metadata`);return{type:"collab",id:n.id,tool:o.tool,status:n.status??"pending",prompt:l(s(n.rawInput,n.id).prompt,"prompt",n.id),agents:o.agents}}let a=typeof n.rawInput==="object"&&n.rawInput!==null&&!Array.isArray(n.rawInput)?{...n.rawInput}:{},i=u(n,t);if(Array.isArray(a.command))a.command=a.command.map(String).join(" ");if(n.toolKind==="execute"&&n.name!=="mcp"&&n.name!=="dynamic_tool"&&typeof a.command!=="string"){let o=i?.command??n.title;if(o!==null)a.command=o}let e=n.rawOutput;if(typeof e==="object"&&e!==null&&"output"in e&&typeof e.output==="string")e=e.output;if(i!==null&&i.output.length>0)e=i.output;let c=i?.exitStatus?.exitCode;return{type:"tool_use",id:n.id,name:n.name??"",title:n.title??n.name??"",kind:n.toolKind??"other",status:n.status??"pending",content:n.content,locations:n.locations,rawInput:a,rawOutput:e,...Nn(n)?{userShell:!0}:{},...typeof c==="number"?{exitCode:c}:{}}}function s(n,t){if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`Tool call ${t} is missing an object codex-acp-v2 always sends`);return n}function l(n,t,r){if(n===null||typeof n==="string")return n;throw Error(`Tool call ${r} has a non-string ${t}`)}function g(n,t){let r=typeof n==="string"?n.split("/").findLast(Boolean):void 0;if(r===void 0)throw Error(`Subagent ${t} has no agent path`);return r}function f(n,t,r){if(typeof n==="string")return n;throw Error(`Tool call ${r} has no ${t}`)}function y(n,t){if(n==="started"||n==="interacted"||n==="interrupted"||n==="completed")return n;throw Error(`Subagent ${t} has an unknown activity ${String(n)}`)}
2
+ export{Nn,Ai};
@@ -1,3 +1,3 @@
1
- import{s,r,o}from"./chunk-1mn2t6ga.js";import{Ne,ee,q}from"./chunk-b13pahat.js";import{Alert as j,AlertDescription as P}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as de,DialogContent as ue,DialogDescription as me,DialogFooter as pe,DialogHeader as he,DialogTitle as fe}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as ve}from"@nyssance/shadcn/vega/components/ui/input";import{Select as U,SelectContent as ge,SelectItem as x,SelectTrigger as _,SelectValue as R}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as W}from"@nyssance/shadcn/vega/components/ui/spinner";import{sessionGroup as T}from"@nyssance/codex-acp-v2/client";import{cn as xe}from"cn";import{ArchiveIcon as Se,FolderIcon as J,ListFilterIcon as ye,SearchIcon as Le,Trash2Icon as M}from"lucide-react";import{useEffect as Ce,useRef as we,useState as d}from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";function X({className:u,...i}){return t(ge,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:xe("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function De({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function dr({Scroll:u=De}){let{t:i,i18n:A}=s(),m=r(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,Y]=d(""),[y,Z]=d("all"),[p,te]=d("all"),[se,ie]=d(0),[z,F]=d(!0),[I,V]=d(null),[H,O]=d(null),[C,w]=d(!1),h=we(!1),[D,f]=d(null),[G,b]=d(null),[ne,K]=d(!1);Ce(()=>{if(N!=="ready")return;let e=!1;F(!0),V(null);async function c(){try{await m.listArchived({reset:!0});let a=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(a.has(v))throw Error("Archive pagination returned a repeated cursor");a.add(v),await m.listArchived()}}catch(a){if(!e)V(E(a))}finally{if(!e)F(!1)}}return c(),()=>{e=!0}},[m,N,se]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!z&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ae=[...new Set(S.filter((e)=>l&&T(l,e).id!==q).map((e)=>l?T(l,e).id:e.cwd))].toSorted(),re=B.trim().toLocaleLowerCase(A.language),Q=S.filter((e)=>{let c=l?T(l,e).id:null,a=c===q;return L(e).toLocaleLowerCase(A.language).includes(re)&&(y==="all"||(y==="quick"?a:!a))&&(p==="all"||(p==="quick"?a:c===p))}),le=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function oe(e){if(h.current)return;h.current=!0,w(!0),O(null);try{await m.unarchive(e.sessionId)}catch(c){O(E(c))}finally{h.current=!1,w(!1)}}async function ce(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let a of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===a.sessionId))continue;try{await m.delete(a.sessionId)}catch(v){e.push(a),c.push(`${L(a)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
- `));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),K(!0),f([...S])},children:[t(M,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(Le,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(ve,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>Y(e.target.value),className:"rounded-md ps-9"})]}),n(U,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Z(e)},children:[n(_,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ye,{"aria-hidden":"true"}),t(R,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(U,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");te(e)},children:[n(_,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(J,{"aria-hidden":"true"}),t(R,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):ee(p,l??void 0)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ae.map((e)=>t(x,{value:e,title:e,children:ee(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):z?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(W,{}),i("sessionList.archives.loading")]}):I?t(j,{variant:"destructive",children:n(P,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>ie((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(Se,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):Q.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Ne(Q,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===q?void 0:e,children:[t(J,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===q?i("sessionList.archives.noProject"):ee(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((a)=>n("article",{"aria-label":L(a),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(a),children:L(a)}),a.updatedAt!==null&&t("time",{dateTime:a.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:le.format(new Date(a.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),K(!1),f([a])},children:t(M,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void oe(a),children:i("sessionList.archives.unarchive")})]})]},a.sessionId))})]},e)),H&&t(j,{variant:"destructive",children:t(P,{children:H})})]})]}),t(de,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ue,{showCloseButton:!C,children:[n(he,{children:[t(fe,{children:i("sessionList.archives.deleteTitle")}),t(me,{children:i(ne?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),G&&t(j,{variant:"destructive",children:t(P,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:G})}),n(pe,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void ce(),children:[C&&t(W,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
- export{dr};
1
+ import{s,r,o}from"./chunk-pw1pws10.js";import{Ne,te,q}from"./chunk-v0p94epn.js";import{Alert as j,AlertDescription as P}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Dialog as de,DialogContent as ue,DialogDescription as me,DialogFooter as pe,DialogHeader as he,DialogTitle as fe}from"@nyssance/shadcn/vega/components/ui/dialog";import{Input as ve}from"@nyssance/shadcn/vega/components/ui/input";import{Select as U,SelectContent as ge,SelectItem as x,SelectTrigger as _,SelectValue as R}from"@nyssance/shadcn/vega/components/ui/select";import{Spinner as W}from"@nyssance/shadcn/vega/components/ui/spinner";import{sessionGroup as T}from"@nyssance/codex-acp-v2/client";import{cn as xe}from"cn";import{ArchiveIcon as Se,FolderIcon as J,ListFilterIcon as ye,SearchIcon as Le,Trash2Icon as M}from"lucide-react";import{useEffect as Ce,useRef as we,useState as d}from"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";function X({className:u,...i}){return t(ge,{align:"start",alignItemWithTrigger:!1,sideOffset:6,...i,className:xe("max-w-(--available-width) min-w-0 p-1",u)})}function E(u){return u instanceof Error?u.message:String(u)}function De({children:u}){return t("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t("div",{className:"flex flex-col gap-8",children:u})})}function mr({Scroll:u=De}){let{t:i,i18n:A}=s(),m=r(),S=o((e)=>e.archivedSessions),N=o((e)=>e.connection),[B,Y]=d(""),[y,Z]=d("all"),[p,ee]=d("all"),[se,ie]=d(0),[z,F]=d(!0),[I,V]=d(null),[H,O]=d(null),[C,w]=d(!1),h=we(!1),[D,f]=d(null),[G,b]=d(null),[ne,K]=d(!1);Ce(()=>{if(N!=="ready")return;let e=!1;F(!0),V(null);async function c(){try{await m.listArchived({reset:!0});let a=new Set;while(!e&&m.state.archivedCursor!==null){let v=m.state.archivedCursor;if(a.has(v))throw Error("Archive pagination returned a repeated cursor");a.add(v),await m.listArchived()}}catch(a){if(!e)V(E(a))}finally{if(!e)F(!1)}}return c(),()=>{e=!0}},[m,N,se]);let l=o((e)=>e.projectContext),k=!(l!==null&&N==="ready"&&!z&&I===null)||C,L=(e)=>e.title??i("sessionList.untitled"),ae=[...new Set(S.filter((e)=>l&&T(l,e).id!==q).map((e)=>l?T(l,e).id:e.cwd))].toSorted(),re=B.trim().toLocaleLowerCase(A.language),Q=S.filter((e)=>{let c=l?T(l,e).id:null,a=c===q;return L(e).toLocaleLowerCase(A.language).includes(re)&&(y==="all"||(y==="quick"?a:!a))&&(p==="all"||(p==="quick"?a:c===p))}),le=new Intl.DateTimeFormat(A.language,{dateStyle:"medium",timeStyle:"short"});async function oe(e){if(h.current)return;h.current=!0,w(!0),O(null);try{await m.unarchive(e.sessionId)}catch(c){O(E(c))}finally{h.current=!1,w(!1)}}async function ce(){if(h.current||!D)return;h.current=!0,w(!0),b(null);let e=[],c=[];try{for(let a of D){if(!m.state.archivedSessions.some((v)=>v.sessionId===a.sessionId))continue;try{await m.delete(a.sessionId)}catch(v){e.push(a),c.push(`${L(a)}: ${E(v)}`)}}if(e.length)f(e),b(c.join(`
2
+ `));else f(null)}finally{h.current=!1,w(!1)}}return n("section",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","aria-label":i("sessionList.archives.title"),children:[n("div",{className:"mx-auto flex min-h-0 w-full max-w-5xl flex-1 flex-col gap-8 px-6 pt-8 pb-10 lg:pb-14",children:[n("header",{className:"flex min-h-9 shrink-0 flex-wrap items-center justify-between gap-3",children:[t("h1",{className:"text-2xl leading-9 font-semibold tracking-tight",children:i("sessionList.archives.title")}),n(g,{size:"sm",variant:"destructive",className:"h-[30px] text-sm font-normal",disabled:k||S.length===0,onClick:()=>{b(null),K(!0),f([...S])},children:[t(M,{className:"size-4","aria-hidden":"true"}),i("sessionList.archives.deleteAll")]})]}),n("div",{className:"flex shrink-0 flex-wrap gap-3",children:[n("div",{className:"relative min-w-48 flex-1",children:[t(Le,{"aria-hidden":"true",className:"text-muted-foreground pointer-events-none absolute start-3 top-2.5 size-4"}),t(ve,{"aria-label":i("sessionList.archives.search"),placeholder:i("sessionList.archives.search"),value:B,onChange:(e)=>Y(e.target.value),className:"rounded-md ps-9"})]}),n(U,{value:y,onValueChange:(e)=>{if(e===null)throw Error("Archive chat type cannot be empty");Z(e)},children:[n(_,{"aria-label":i("sessionList.archives.chatType"),className:"w-40 rounded-md",children:[t(ye,{"aria-hidden":"true"}),t(R,{children:i(`sessionList.archives.${y==="all"?"allChats":y==="quick"?"quickChats":"projectChats"}`)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allChats")}),t(x,{value:"quick",children:i("sessionList.archives.quickChats")}),t(x,{value:"project",children:i("sessionList.archives.projectChats")})]})]}),n(U,{value:p,onValueChange:(e)=>{if(e===null)throw Error("Archive project filter cannot be empty");ee(e)},children:[n(_,{"aria-label":i("sessionList.archives.project"),className:"w-48 rounded-md",children:[t(J,{"aria-hidden":"true"}),t(R,{className:"truncate",children:p==="all"?i("sessionList.archives.allProjects"):p==="quick"?i("sessionList.archives.noProject"):te(p,l??void 0)})]}),n(X,{children:[t(x,{value:"all",children:i("sessionList.archives.allProjects")}),t(x,{value:"quick",children:i("sessionList.archives.noProject")}),ae.map((e)=>t(x,{value:e,title:e,children:te(e,l??void 0)},e))]})]})]}),n(u,{children:[N!=="ready"?t("p",{role:"status",className:"text-muted-foreground",children:i("sessionList.archives.connecting")}):z?n("div",{role:"status",className:"text-muted-foreground flex items-center gap-2",children:[t(W,{}),i("sessionList.archives.loading")]}):I?t(j,{variant:"destructive",children:n(P,{className:"flex items-center justify-between gap-4",children:[t("span",{children:I}),t(g,{variant:"outline",onClick:()=>ie((e)=>e+1),children:i("sessionList.archives.retry")})]})}):S.length===0?n("div",{className:"text-muted-foreground flex flex-col items-center gap-3 py-16",children:[t(Se,{"aria-hidden":"true",className:"size-8"}),t("p",{children:i("sessionList.archives.empty")})]}):Q.length===0?t("p",{className:"text-muted-foreground py-12 text-center",children:i("sessionList.archives.noResults")}):(l?Ne(Q,l):[]).filter(([,e])=>e.length>0).map(([e,c])=>n("section",{className:"flex flex-col gap-3",children:[n("div",{className:"flex items-center justify-between gap-3",children:[n("h2",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",title:e===q?void 0:e,children:[t(J,{"aria-hidden":"true",className:"size-4 shrink-0"}),t("span",{className:"truncate",children:e===q?i("sessionList.archives.noProject"):te(e,l??void 0)})]}),t("span",{className:"text-muted-foreground shrink-0 text-sm",children:i("sessionList.archives.count",{count:c.length})})]}),t("div",{className:"divide-border divide-y overflow-hidden rounded-lg border",children:c.map((a)=>n("article",{"aria-label":L(a),className:"flex flex-wrap items-center gap-4 px-4 py-3",children:[n("div",{className:"min-w-0 flex-1 basis-40",children:[t("h3",{className:"truncate text-sm font-medium",title:L(a),children:L(a)}),a.updatedAt!==null&&t("time",{dateTime:a.updatedAt,title:i("sessionList.archives.updatedAt"),className:"text-muted-foreground text-xs",children:le.format(new Date(a.updatedAt))})]}),n("div",{className:"flex shrink-0 items-center gap-2",children:[t(g,{variant:"ghost",size:"icon-sm","aria-label":i("sessionList.delete"),title:i("sessionList.delete"),disabled:k,className:"text-muted-foreground hover:text-destructive",onClick:()=>{b(null),K(!1),f([a])},children:t(M,{"aria-hidden":"true"})}),t(g,{variant:"secondary",size:"sm",disabled:k,onClick:()=>void oe(a),children:i("sessionList.archives.unarchive")})]})]},a.sessionId))})]},e)),H&&t(j,{variant:"destructive",children:t(P,{children:H})})]})]}),t(de,{open:D!==null,onOpenChange:(e)=>{if(!e&&!h.current)f(null)},children:n(ue,{showCloseButton:!C,children:[n(he,{children:[t(fe,{children:i("sessionList.archives.deleteTitle")}),t(me,{children:i(ne?"sessionList.archives.deleteAllDescription":"sessionList.archives.deleteDescription",{count:D?.length??0})})]}),G&&t(j,{variant:"destructive",children:t(P,{className:"max-h-40 overflow-auto whitespace-pre-wrap",children:G})}),n(pe,{children:[t(g,{variant:"outline",disabled:C,onClick:()=>f(null),children:i("sessionList.cancel")}),n(g,{variant:"destructive",className:"text-sm font-normal",disabled:k,onClick:()=>void ce(),children:[C&&t(W,{}),i("sessionList.archives.confirmDelete")]})]})]})})]})}
3
+ export{mr};
@@ -1,2 +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};
1
+ import{ln}from"./chunk-chq163r8.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 xo({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(ln,{...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(ln,{...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{xo};
@@ -0,0 +1,4 @@
1
+ import{an}from"./chunk-0kdemqjf.js";import{mo}from"./chunk-n66yy1m1.js";import{We}from"./chunk-7a668qzy.js";import{autoUpdate as ot}from"@floating-ui/dom";import{cn as G}from"cn";import{BookOpenTextIcon as rt,FileIcon as st,StoreIcon as it}from"lucide-react";import{useCallback as lt,useEffect as d,useLayoutEffect as J,useMemo as X,useRef as Y,useState as v}from"react";import{createPortal as ut}from"react-dom";import{Button as Z}from"@nyssance/shadcn/vega/components/ui/button";import{Separator as at}from"@nyssance/shadcn/vega/components/ui/separator";import{jsx as m,jsxs as w,Fragment as ct}from"react/jsx-runtime";function po({handleRef:l,anchorRef:a,commands:T,searchFiles:u,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=Y(null);d(()=>{let t=l.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)}},[l]);let U=X(()=>H&&i.startsWith("!")?null:mo(i,j),[i,j,H]),o=U?.kind==="at"&&!u?null:U,P=`${o?.kind??"forced"}:${o?.query??""}:${s}`,[F,O]=v(P);if(F!==P)O(P),h(0);let L=Y(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||!u){D(null);return}let t=!0,e=()=>{u(y).then((r)=>{if(t)D({query:y,search:u,items:r})},(r)=>{if(t)D({query:y,search:u,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,u,C,B]);let f=X(()=>{if(o?.kind==="at")return g?.query===o.query&&g.search===u?g.items:[];if(o)return an(T,o.query);if(s)return an(T,"");return[]},[o,s,T,g,u]),[tt,q]=v(!1);d(()=>{let t=l.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)}},[l,s,p]),d(()=>{if(s)l.current?.getTextarea()?.focus()},[s,l]);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=l.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=l.current?.getTextarea();if(!t)return;let e=(n)=>{if(!c)return;if(l.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=lt(()=>{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(J(()=>{if(!c){W(null);return}I()},[c,I]),J(()=>{let t=a?.current;if(!c||!t||!N)return;return ot(t,N,I,{animationFrame:!0})},[c,N,a,I]),!c||a&&!b)return null;let k=o?o.kind==="slash":s,nt=k?rt:st,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===u?E.empty:E.loading}),f.map((t,e)=>w(Z,{type:"button",variant:"ghost",role:"option","aria-selected":e===x,"data-idx":e,onMouseDown:(n)=>{n.preventDefault(),V(t)},onMouseEnter:()=>h(e),className:G("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:G("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(at,{}),w(Z,{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(it,{"data-icon":"inline-start"}),M.label]})]})]})});return a?ut(Q,document.body):Q}
4
+ export{po};
@@ -1,4 +1,4 @@
1
- import{yi}from"./chunk-vt6cyes7.js";import{t}from"./chunk-jm6zxy9h.js";import{Zo,Qo}from"./chunk-jgd6dcgy.js";import{Z}from"./chunk-x3y5htkt.js";import{oe}from"./chunk-f1gj3yzt.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}
1
+ import{ai}from"./chunk-46phvpzh.js";import{t}from"./chunk-zyvvk8b2.js";import{li,ci}from"./chunk-4qp43adx.js";import{Z}from"./chunk-n7qcezk8.js";import{ie}from"./chunk-qn2jfxff.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 ri=p(function({item:s,messageTime:c}){let l=t(),o=ci(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
2
2
  ${e.text}`).join(`
3
- `):oe(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};
3
+ `):ie(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=li(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(ai,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
4
+ export{ri};
@@ -1,2 +1,2 @@
1
- import{r}from"./chunk-1mn2t6ga.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function fe(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let a=t.filter((s)=>fe(e,s)),S=new Set(a),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!fe(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")a.push(s)}return a.length===t.length&&a.every((s,i)=>s===t[i])?t:a}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function on(t){let n=u.get(t);if(n)return n;let e=v(t),a=new Set,S=(i)=>{e={...e,...i};for(let o of a)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(a.add(i),()=>a.delete(i))};return u.set(t,s),s}function pr(t){u.get(t)?.set(v(t))}function O(t){let n=on(r());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function te(){return on(r()).set}function mr(){let t=O((e)=>e.view),n=te();return[t,(e)=>n({view:e})]}
2
- export{fe,on,pr,O,te,mr};
1
+ import{r}from"./chunk-pw1pws10.js";import{runStateSource as l}from"@nyssance/codex-acp-v2/client";import{useSyncExternalStore as f}from"react";function pe(t,n){let e=t.runStates[n];return e!==void 0&&(!e.reusableDraft||t.drafts[n]!==void 0)}function d(t,n,e){let a=t.filter((s)=>pe(e,s)),S=new Set(a),c=e.runStates!==n.runStates&&l(e.runStates)==="event";for(let[s,i]of Object.entries(e.runStates)){if(S.has(s)||!pe(e,s))continue;let o=n.runStates[s],g=!o||i.state!==o.state||i.since!==o.since||i.lastActivityAt!==o.lastActivityAt||i.interruption!==o.interruption;if(i.reusableDraft&&e.drafts[s]!==void 0||c&&g&&(!o||i.state!=="idle")&&i.interruption!=="runtime restarted")a.push(s)}return a.length===t.length&&a.every((s,i)=>s===t[i])?t:a}var u=new WeakMap;function v(t){return{view:"sessions",activityOrder:d([],t.state,t.state),activitySeen:new Map,activityCollapsedGroups:new Set}}function on(t){let n=u.get(t);if(n)return n;let e=v(t),a=new Set,S=(i)=>{e={...e,...i};for(let o of a)o()},c=t.state;t.store.subscribe(()=>{let i=t.store.getState(),o=d(e.activityOrder,c,i);if(c=i,o!==e.activityOrder)S({activityOrder:o})});let s={get:()=>e,set:S,subscribe:(i)=>(a.add(i),()=>a.delete(i))};return u.set(t,s),s}function cr(t){u.get(t)?.set(v(t))}function O(t){let n=on(r());return f(n.subscribe,()=>t(n.get()),()=>t(n.get()))}function ee(){return on(r()).set}function dr(){let t=O((e)=>e.view),n=ee();return[t,(e)=>n({view:e})]}
2
+ export{pe,on,cr,O,ee,dr};
@@ -1,2 +1,2 @@
1
- import{n}from"./chunk-jm6zxy9h.js";import{e}from"./chunk-j0m35s05.js";import{Le,Ye,be}from"./chunk-9j9rx57q.js";import{Qe}from"./chunk-ttqy9d4r.js";import{inSessionTree as c}from"@nyssance/codex-acp-v2/client";import{jsx as o,jsxs as u,Fragment as x}from"react/jsx-runtime";var p=[];function Rt({sessionId:s}){let i=n((t)=>t.sessions),{host:f}=e(),a=n((t)=>t.actions),d=a.some((t)=>c(i,s,t.sessionId))?a.filter((t)=>c(i,s,t.sessionId)):p,r=d.filter(Le).filter((t)=>{if(t.sessionId!==s||i[s]?.subagent!==void 0)return!0;let l=t.params._meta?.codex;return!(typeof l==="object"&&l!==null&&("delivery"in l)&&l.delivery==="async")}),m=d.filter((t)=>!Le(t));return u(x,{children:[o("div",{className:"mx-auto max-h-[50vh] w-full max-w-3xl shrink-0 overflow-y-auto px-3","data-subagent-shelf":!0,children:o(Qe,{sessionId:s})}),m.length>0&&o("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((t)=>u("div",{children:[t.sessionId!==s&&o("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:t.sessionId===null?"":i[t.sessionId]?.title??f.t("subagents.untitled")}),o(be,{action:t})]},t.id))}),r[0]!==void 0&&o(Ye,{action:r[0],total:r.length},r[0].id)]})}
1
+ import{n}from"./chunk-zyvvk8b2.js";import{e}from"./chunk-k1vkc88d.js";import{Le,Ye,be}from"./chunk-1fr9rhkn.js";import{Qe}from"./chunk-pncx4r2c.js";import{inSessionTree as c}from"@nyssance/codex-acp-v2/client";import{jsx as o,jsxs as u,Fragment as x}from"react/jsx-runtime";var p=[];function Rt({sessionId:s}){let i=n((t)=>t.sessions),{host:f}=e(),a=n((t)=>t.actions),d=a.some((t)=>c(i,s,t.sessionId))?a.filter((t)=>c(i,s,t.sessionId)):p,r=d.filter(Le).filter((t)=>{if(t.sessionId!==s||i[s]?.subagent!==void 0)return!0;let l=t.params._meta?.codex;return!(typeof l==="object"&&l!==null&&("delivery"in l)&&l.delivery==="async")}),m=d.filter((t)=>!Le(t));return u(x,{children:[o("div",{className:"mx-auto max-h-[50vh] w-full max-w-3xl shrink-0 overflow-y-auto px-3","data-subagent-shelf":!0,children:o(Qe,{sessionId:s})}),m.length>0&&o("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((t)=>u("div",{children:[t.sessionId!==s&&o("p",{className:"text-muted-foreground mb-1 truncate text-xs",children:t.sessionId===null?"":i[t.sessionId]?.title??f.t("subagents.untitled")}),o(be,{action:t})]},t.id))}),r[0]!==void 0&&o(Ye,{action:r[0],total:r.length},r[0].id)]})}
2
2
  export{Rt};
@@ -1,2 +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};
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 dt(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,dt};
@@ -1,2 +1,2 @@
1
- import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function nn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
- export{nn};
1
+ import{useCallback as S,useLayoutEffect as C,useRef as I,useState as h}from"react";import{jsx as b}from"react/jsx-runtime";var y=30,i=32,g=6;function tn({sessionRows:t,viewport:r,renderRow:u}){let o=I(null),[c,m]=h({start:0,end:g}),[d,R]=h(()=>new Set),[E,M]=h(null),v=S((e,n)=>{R((a)=>{if(a.has(e)===n)return a;let l=new Set(a);if(n)l.add(e);else l.delete(e);return l})},[]),f=S(()=>{if(o.current===null||r===null)return;let e=r.getBoundingClientRect().top+r.clientTop-o.current.getBoundingClientRect().top,n=Math.max(0,Math.min(t.length,Math.floor(e/i)-g)),a=Math.max(n,Math.min(t.length,Math.ceil((e+r.clientHeight)/i)+g));m((l)=>l.start===n&&l.end===a?l:{start:n,end:a})},[t.length,r]);C(()=>f()),C(()=>{if(r===null)return;let e,n=()=>{if(e!==void 0)return;e=requestAnimationFrame(()=>{e=void 0,f()})},a=new ResizeObserver(n);if(a.observe(r),r.firstElementChild)a.observe(r.firstElementChild);return r.addEventListener("scroll",n,{passive:!0}),()=>{if(a.disconnect(),r.removeEventListener("scroll",n),e!==void 0)cancelAnimationFrame(e)}},[f,r]);let s=new Set;for(let e=c.start;e<Math.min(c.end,t.length);e++)s.add(e);if(t.length>0)s.add(0),s.add(t.length-1);if(t.forEach((e,n)=>{if(d.has(e.sessionId))s.add(n);if(E===e.sessionId)for(let a=Math.max(0,n-1);a<=Math.min(t.length-1,n+1);a++)s.add(a)}),t.length===0)return null;return b("div",{ref:o,"data-slot":"virtual-session-rows","data-count":t.length,className:"relative w-full",style:{height:t.length*i-(i-y)},children:[...s].toSorted((e,n)=>e-n).map((e)=>{let n=t[e];return b(T,{sessionRow:n,index:e,retainCard:v,onFocus:M,renderRow:u},n.sessionId)})})}function T({sessionRow:t,index:r,retainCard:u,onFocus:o,renderRow:c}){let m=S((d)=>u(t.sessionId,d),[u,t.sessionId]);return b("div",{"data-slot":"virtual-session-row",className:"absolute inset-x-0",style:{top:r*i,height:y},onFocusCapture:()=>o(t.sessionId),onBlurCapture:(d)=>{if(!d.currentTarget.contains(d.relatedTarget))o(null)},children:c(t,m)})}
2
+ export{tn};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-j0m35s05.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
+ import{e}from"./chunk-k1vkc88d.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 Fr({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{Fr};