@alwith/module-chat 0.5.23 → 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 (325) 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-cgk9mtky.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-n45a05jx.js → chunk-1fr9rhkn.js} +3 -3
  16. package/dist/{chunk-ttn8ss6b.js → chunk-1fxadr5w.js} +2 -2
  17. package/dist/{chunk-kmdag4vy.js → chunk-1zh28e39.js} +2 -2
  18. package/dist/{chunk-y0q6jwq4.js → chunk-22tg663v.js} +2 -2
  19. package/dist/{chunk-mztwft71.js → chunk-2ac213n3.js} +2 -2
  20. package/dist/{chunk-wm0jty6e.js → chunk-2apyrry0.js} +2 -2
  21. package/dist/chunk-2djv6s3a.js +2 -0
  22. package/dist/{chunk-y97ne5kj.js → chunk-2dvryx1q.js} +2 -2
  23. package/dist/{chunk-2388yq9z.js → chunk-2gg3gcmb.js} +1 -1
  24. package/dist/{chunk-a42211a1.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-kg5hcf28.js → chunk-3k33zp9m.js} +1 -1
  28. package/dist/{chunk-eg9hemqa.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-vvtbtx09.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-6179zrn1.js → chunk-4vk86bbk.js} +2 -2
  35. package/dist/{chunk-bbnhytn3.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-e3pfvwhd.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-zheyzqcq.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-m8hb96f5.js → chunk-7e1wvb6e.js} +1 -1
  47. package/dist/{chunk-nsf0e6gj.js → chunk-7p80b5jc.js} +2 -2
  48. package/dist/{chunk-mvs2dzyt.js → chunk-81r1geaz.js} +2 -2
  49. package/dist/{chunk-28f3zv6v.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-raye7hnk.js → chunk-9183jr6z.js} +3 -3
  53. package/dist/{chunk-d257n8gj.js → chunk-92xxp77d.js} +2 -2
  54. package/dist/{chunk-ckyat78p.js → chunk-96tcqne6.js} +2 -2
  55. package/dist/chunk-99ftqpgg.js +4 -0
  56. package/dist/{chunk-658njfx1.js → chunk-9jep8zjg.js} +3 -3
  57. package/dist/chunk-9n2vrkkh.js +2 -0
  58. package/dist/{chunk-4jfynrgh.js → chunk-9zth7avc.js} +1 -1
  59. package/dist/{chunk-g44hhdha.js → chunk-a5htm58g.js} +2 -2
  60. package/dist/{chunk-6t5war9h.js → chunk-ap6sr2c6.js} +2 -2
  61. package/dist/{chunk-cz4k8aad.js → chunk-awfvvmjt.js} +2 -2
  62. package/dist/{chunk-t9f2cw75.js → chunk-b9y436vs.js} +3 -3
  63. package/dist/{chunk-qd1z91fm.js → chunk-bfcswk98.js} +2 -2
  64. package/dist/{chunk-bfhfbrzt.js → chunk-bg0cf6kz.js} +2 -2
  65. package/dist/{chunk-3yxjh7b1.js → chunk-ce3wg766.js} +2 -2
  66. package/dist/{chunk-3s94ekrs.js → chunk-chq163r8.js} +2 -2
  67. package/dist/{chunk-agqnt7xq.js → chunk-cpe2b276.js} +2 -2
  68. package/dist/{chunk-pwjz3yxb.js → chunk-crx8p5zx.js} +2 -2
  69. package/dist/{chunk-3e6wcamp.js → chunk-dfcks9g4.js} +2 -2
  70. package/dist/{chunk-cw76pj9b.js → chunk-dv4d6mrb.js} +2 -2
  71. package/dist/{chunk-tpbqg729.js → chunk-dx745syv.js} +1 -1
  72. package/dist/chunk-e24jv7zb.js +2 -0
  73. package/dist/{chunk-c723sswh.js → chunk-e5twctz7.js} +2 -2
  74. package/dist/{chunk-ah4pgmqr.js → chunk-ef99py8a.js} +2 -2
  75. package/dist/{chunk-hac9xtfv.js → chunk-ewvb59ye.js} +2 -2
  76. package/dist/{chunk-bg03czcx.js → chunk-f06zyvek.js} +2 -2
  77. package/dist/chunk-f50rww1k.js +2 -0
  78. package/dist/{chunk-kc56dhwd.js → chunk-f7ggbprz.js} +2 -2
  79. package/dist/{chunk-rjw63t34.js → chunk-fgk4f0jq.js} +2 -2
  80. package/dist/chunk-fprj3wy4.js +2 -0
  81. package/dist/{chunk-g8w3emvn.js → chunk-g93wzhsv.js} +2 -2
  82. package/dist/{chunk-tz1kzpzp.js → chunk-g9gktxv9.js} +2 -2
  83. package/dist/{chunk-rq5e0922.js → chunk-gnwa39me.js} +2 -2
  84. package/dist/{chunk-dte0n4kf.js → chunk-h09ez7fc.js} +2 -2
  85. package/dist/{chunk-sjs9484n.js → chunk-h9m4z5dk.js} +3 -3
  86. package/dist/chunk-hq06m42h.js +2 -0
  87. package/dist/{chunk-t6vcdf4j.js → chunk-hswtp9wv.js} +1 -1
  88. package/dist/{chunk-vfhxerxt.js → chunk-hza92pfj.js} +2 -2
  89. package/dist/{chunk-9wasxr1v.js → chunk-jamq0frz.js} +1 -1
  90. package/dist/{chunk-g9t2d8hg.js → chunk-jsabvejp.js} +2 -2
  91. package/dist/{chunk-1rg3nab3.js → chunk-jst7n5r4.js} +1 -1
  92. package/dist/chunk-k0dnnn77.js +2 -0
  93. package/dist/{chunk-4fk0vjh5.js → chunk-k1vkc88d.js} +1 -1
  94. package/dist/{chunk-wccx911q.js → chunk-k2gwmccn.js} +2 -2
  95. package/dist/{chunk-4gyd9hx9.js → chunk-k727wnh1.js} +1 -1
  96. package/dist/{chunk-nn2hmwzd.js → chunk-kbbq3y2j.js} +2 -2
  97. package/dist/{chunk-9tp0z23q.js → chunk-kwp1fere.js} +2 -2
  98. package/dist/{chunk-0mmcy6k7.js → chunk-kz8zf6y0.js} +2 -2
  99. package/dist/chunk-mttcvwhx.js +2 -0
  100. package/dist/{chunk-g2qcyqc6.js → chunk-n5dkkw01.js} +2 -2
  101. package/dist/{chunk-ce1qr37c.js → chunk-n7qcezk8.js} +2 -2
  102. package/dist/{chunk-z3nybrbb.js → chunk-n8yww1mr.js} +2 -2
  103. package/dist/chunk-nr3spt0n.js +2 -0
  104. package/dist/{chunk-f2w2sct6.js → chunk-nsb0d92p.js} +1 -1
  105. package/dist/{chunk-4bb6dzzs.js → chunk-p0s2pg33.js} +1 -1
  106. package/dist/chunk-p272qmbv.js +2 -0
  107. package/dist/{chunk-acb8t4jt.js → chunk-p3hxcpfy.js} +2 -2
  108. package/dist/{chunk-vbab9hc4.js → chunk-p58e9z34.js} +2 -2
  109. package/dist/{chunk-d8ytdk0x.js → chunk-pf5655kt.js} +2 -2
  110. package/dist/{chunk-pw8b9brz.js → chunk-pncx4r2c.js} +1 -1
  111. package/dist/{chunk-k2k5tt5x.js → chunk-ps722b9k.js} +2 -2
  112. package/dist/{chunk-pprt7ntb.js → chunk-pv5g85k0.js} +4 -4
  113. package/dist/{chunk-1mn2t6ga.js → chunk-pw1pws10.js} +2 -2
  114. package/dist/{chunk-1k697ncv.js → chunk-py0zbgaj.js} +2 -2
  115. package/dist/{chunk-qdg5zphd.js → chunk-pyznxtyg.js} +1 -1
  116. package/dist/chunk-q0fhp33b.js +2 -0
  117. package/dist/{chunk-7z4gtfkd.js → chunk-qjrgbqhy.js} +2 -2
  118. package/dist/{chunk-f1gj3yzt.js → chunk-qn2jfxff.js} +2 -2
  119. package/dist/chunk-qn4zvgc9.js +2 -0
  120. package/dist/{chunk-6trv0snh.js → chunk-qqqcqvrv.js} +2 -2
  121. package/dist/{chunk-cvz3k5gk.js → chunk-r1as1cra.js} +1 -1
  122. package/dist/{chunk-4wa7tehh.js → chunk-r4vfytjv.js} +3 -3
  123. package/dist/{chunk-n0acc2tb.js → chunk-rb0cqdjg.js} +1 -1
  124. package/dist/{chunk-mj7094yh.js → chunk-rezwwmw7.js} +2 -2
  125. package/dist/{chunk-wgrmjfyp.js → chunk-rsp574n3.js} +2 -2
  126. package/dist/chunk-s2w7e9pg.js +2 -0
  127. package/dist/{chunk-rjkpe1fw.js → chunk-s7yzvpmc.js} +3 -3
  128. package/dist/{chunk-pzjag1mt.js → chunk-sdf73s05.js} +3 -3
  129. package/dist/{chunk-kfy7yvke.js → chunk-syhh17rh.js} +2 -2
  130. package/dist/{chunk-1fggcrvs.js → chunk-t2q8cxnh.js} +2 -2
  131. package/dist/{chunk-f2rq6nj6.js → chunk-tdn5g8xd.js} +3 -3
  132. package/dist/chunk-v0p94epn.js +2 -0
  133. package/dist/{chunk-p8g927x6.js → chunk-v5mzxjzc.js} +2 -2
  134. package/dist/{chunk-wvry7t79.js → chunk-vgrjqwbq.js} +2 -2
  135. package/dist/{chunk-48fj5m0p.js → chunk-vr0dfq9w.js} +2 -2
  136. package/dist/{chunk-1qyxrh0n.js → chunk-w233xc7k.js} +3 -3
  137. package/dist/{chunk-asyfpv8n.js → chunk-w8qn76a1.js} +3 -3
  138. package/dist/{chunk-yakar0e2.js → chunk-wnn9r2r6.js} +2 -2
  139. package/dist/chunk-wsbh4n9e.js +2 -0
  140. package/dist/chunk-wtf1eyzy.js +2 -0
  141. package/dist/{chunk-76a04a6j.js → chunk-x2nemdjf.js} +2 -2
  142. package/dist/chunk-x68b6rmk.js +2 -0
  143. package/dist/{chunk-0whxm2f0.js → chunk-xdvbb3av.js} +2 -2
  144. package/dist/{chunk-5a6xc345.js → chunk-y7ngqt59.js} +2 -2
  145. package/dist/{chunk-3ka3bt0t.js → chunk-yez26qfc.js} +2 -2
  146. package/dist/chunk-ymy8d3hp.js +4 -0
  147. package/dist/{chunk-m271yxxm.js → chunk-yyba5e1c.js} +2 -2
  148. package/dist/{chunk-6cmttr4w.js → chunk-z18fvy7d.js} +1 -1
  149. package/dist/{chunk-swpy2b9a.js → chunk-z1aqmqgc.js} +2 -2
  150. package/dist/{chunk-mz8a6292.js → chunk-zacep5bq.js} +2 -2
  151. package/dist/{chunk-4ddkzbm0.js → chunk-zp8rq8nh.js} +2 -2
  152. package/dist/{chunk-sz3vcbp5.js → chunk-zyvvk8b2.js} +2 -2
  153. package/dist/codex/activity-group.js +1 -1
  154. package/dist/codex/assistant-message.js +1 -1
  155. package/dist/codex/async-question-card.js +1 -1
  156. package/dist/codex/disclosure-state.js +1 -1
  157. package/dist/codex/edited-files-card.js +1 -1
  158. package/dist/codex/image-view-activity.js +1 -1
  159. package/dist/codex/markdown-renderer.js +1 -1
  160. package/dist/codex/navigation-audio.js +1 -1
  161. package/dist/codex/navigation-preview.js +1 -1
  162. package/dist/codex/navigation-rail.js +1 -1
  163. package/dist/codex/patch-view.js +1 -1
  164. package/dist/codex/plan.js +1 -1
  165. package/dist/codex/timeline-virtualizer.js +1 -1
  166. package/dist/codex/turn-activity.js +1 -1
  167. package/dist/codex/user-message.js +1 -1
  168. package/dist/codex/virtualized-turn-list.js +1 -1
  169. package/dist/collections/collection-emoji.js +1 -1
  170. package/dist/collections/collection-menu.js +1 -1
  171. package/dist/collections/collection-panel.js +1 -1
  172. package/dist/collections/collections.js +1 -1
  173. package/dist/collections/host.js +1 -1
  174. package/dist/collections/model.js +1 -1
  175. package/dist/collections/store.js +1 -1
  176. package/dist/composer/completion-filter.js +1 -1
  177. package/dist/composer/completion-menu.js +1 -1
  178. package/dist/composer/effort-slider.js +1 -1
  179. package/dist/composer/model-select.js +1 -1
  180. package/dist/composer/permission-mode-select.js +1 -1
  181. package/dist/composer/prompt-input-attachments.js +1 -1
  182. package/dist/composer/prompt-input-clipboard.js +1 -1
  183. package/dist/composer/prompt-input-context.js +1 -1
  184. package/dist/composer/prompt-input-textarea.d.ts +1 -1
  185. package/dist/composer/prompt-input-textarea.js +1 -1
  186. package/dist/composer/prompt-input.js +1 -1
  187. package/dist/conversation/action-card.js +1 -1
  188. package/dist/conversation/composer/composer.js +1 -1
  189. package/dist/conversation/composer/config-options.js +1 -1
  190. package/dist/conversation/composer/context.js +1 -1
  191. package/dist/conversation/composer/drafts.js +1 -1
  192. package/dist/conversation/composer/file-items.js +1 -1
  193. package/dist/conversation/composer/long-text.js +1 -1
  194. package/dist/conversation/composer/mention-chips.js +1 -1
  195. package/dist/conversation/composer/mention-uri.js +1 -1
  196. package/dist/conversation/composer/model-menu.d.ts +3 -1
  197. package/dist/conversation/composer/model-menu.js +1 -1
  198. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  199. package/dist/conversation/composer/permission-mode-menu.d.ts +3 -1
  200. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  201. package/dist/conversation/composer/prediction.js +1 -1
  202. package/dist/conversation/composer/prompt-history.d.ts +3 -0
  203. package/dist/conversation/composer/prompt-history.js +1 -0
  204. package/dist/conversation/composer/slash-command-button.js +1 -1
  205. package/dist/conversation/composer/submit-button.js +1 -1
  206. package/dist/conversation/composer/usage-meter.d.ts +3 -1
  207. package/dist/conversation/composer/usage-meter.js +1 -1
  208. package/dist/conversation/connection-notice.js +1 -1
  209. package/dist/conversation/context.js +1 -1
  210. package/dist/conversation/conversation-body.js +1 -1
  211. package/dist/conversation/conversation-search.js +1 -1
  212. package/dist/conversation/conversation-view.js +1 -1
  213. package/dist/conversation/conversation.js +1 -1
  214. package/dist/conversation/diff-modal.js +1 -1
  215. package/dist/conversation/draft-project-picker.js +1 -1
  216. package/dist/conversation/session-actions.js +1 -1
  217. package/dist/conversation/subagent-sessions.js +1 -1
  218. package/dist/image-lightbox.js +1 -1
  219. package/dist/image-preview-dialog.js +1 -1
  220. package/dist/lib/code-highlighter.js +1 -1
  221. package/dist/lib/fuzzy.js +1 -1
  222. package/dist/lib/group-blocks.js +1 -1
  223. package/dist/lib/image-encode.js +1 -1
  224. package/dist/lib/limits.js +1 -1
  225. package/dist/lib/markdown-parser.js +1 -1
  226. package/dist/lib/markdown-rules.js +1 -1
  227. package/dist/lib/model-name.js +1 -1
  228. package/dist/lib/pointer-centered-zoom.js +1 -1
  229. package/dist/lib/prepare-prompt-files.js +1 -1
  230. package/dist/lib/stream-style.js +1 -1
  231. package/dist/lib/streaming-markdown.js +1 -1
  232. package/dist/plugins/catalog-skeleton.js +1 -1
  233. package/dist/plugins/host.js +1 -1
  234. package/dist/plugins/panel-item.js +1 -1
  235. package/dist/plugins/plugin-detail-page.js +1 -1
  236. package/dist/plugins/plugin-icon.js +1 -1
  237. package/dist/plugins/plugin-icons.js +1 -1
  238. package/dist/plugins/plugins-page.js +1 -1
  239. package/dist/plugins/plugins.js +1 -1
  240. package/dist/plugins/read-skill-document.js +1 -1
  241. package/dist/plugins/skill-document.js +1 -1
  242. package/dist/plugins/skills-tab.js +1 -1
  243. package/dist/plugins/store.js +1 -1
  244. package/dist/search/chat-search.js +1 -1
  245. package/dist/search/codex-source-matches.js +1 -1
  246. package/dist/search/dom-matches.js +1 -1
  247. package/dist/search/find-bar.js +1 -1
  248. package/dist/search/literal-matches.js +1 -1
  249. package/dist/session-list/account-menu.js +1 -1
  250. package/dist/session-list/activity-list.js +1 -1
  251. package/dist/session-list/archived-sessions.js +1 -1
  252. package/dist/session-list/help-menu.js +1 -1
  253. package/dist/session-list/highlight.js +1 -1
  254. package/dist/session-list/host.js +1 -1
  255. package/dist/session-list/navigation-header.js +1 -1
  256. package/dist/session-list/navigation-store.d.ts +1 -1
  257. package/dist/session-list/navigation-store.js +1 -1
  258. package/dist/session-list/navigation-tabs.js +1 -1
  259. package/dist/session-list/navigation.js +1 -1
  260. package/dist/session-list/platform.js +1 -1
  261. package/dist/session-list/row-stop-button.js +1 -1
  262. package/dist/session-list/session-groups.js +1 -1
  263. package/dist/session-list/session-info-card.js +1 -1
  264. package/dist/session-list/session-list.js +1 -1
  265. package/dist/session-list/session-row.js +1 -1
  266. package/dist/session-list/session-state-menu.js +1 -1
  267. package/dist/session-list/shortcut-hint.js +1 -1
  268. package/dist/session-list/shortcut.js +1 -1
  269. package/dist/session-list/use-activity-notification.js +1 -1
  270. package/dist/session-list/use-activity-preview.js +1 -1
  271. package/dist/session-list/use-cmd-held.js +1 -1
  272. package/dist/session-list/use-project-sessions.js +1 -1
  273. package/dist/session-list/virtual-session-rows.js +1 -1
  274. package/dist/session-timeline/activity-group.js +1 -1
  275. package/dist/session-timeline/activity-projection.js +1 -1
  276. package/dist/session-timeline/assistant-content.js +1 -1
  277. package/dist/session-timeline/assistant-turn.js +1 -1
  278. package/dist/session-timeline/async-questions.js +1 -1
  279. package/dist/session-timeline/edited-files-card.js +1 -1
  280. package/dist/session-timeline/history-timeline.js +1 -1
  281. package/dist/session-timeline/host.js +1 -1
  282. package/dist/session-timeline/navigation-rail.js +1 -1
  283. package/dist/session-timeline/plan.js +1 -1
  284. package/dist/session-timeline/question-reply.js +1 -1
  285. package/dist/session-timeline/resource-content.js +1 -1
  286. package/dist/session-timeline/session-timeline.js +1 -1
  287. package/dist/session-timeline/timeline-registry.js +1 -1
  288. package/dist/session-timeline/turn-activity.js +1 -1
  289. package/dist/session-timeline/turn-error.js +1 -1
  290. package/dist/session-timeline/turn-retry.js +1 -1
  291. package/dist/session-timeline/turns.js +1 -1
  292. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  293. package/dist/session-timeline/user-message.js +1 -1
  294. package/dist/settings/codex-account-card.js +1 -1
  295. package/dist/settings/login-card.js +1 -1
  296. package/dist/settings/model-alias-settings.js +1 -1
  297. package/dist/settings/model-aliases.js +1 -1
  298. package/dist/settings/provider-logos.js +1 -1
  299. package/dist/settings/provider-section.js +1 -1
  300. package/dist/settings/providers-port.js +1 -1
  301. package/dist/settings/providers.js +1 -1
  302. package/dist/settings/settings-bridge.js +1 -1
  303. package/dist/settings/settings.js +1 -1
  304. package/package.json +1 -1
  305. package/dist/chunk-0p6y2t9b.js +0 -2
  306. package/dist/chunk-3bzqcxq2.js +0 -2
  307. package/dist/chunk-4p6svs37.js +0 -2
  308. package/dist/chunk-8c8ncw1m.js +0 -2
  309. package/dist/chunk-awmra30d.js +0 -2
  310. package/dist/chunk-bmey8et5.js +0 -2
  311. package/dist/chunk-c32z3wjq.js +0 -2
  312. package/dist/chunk-e5qk8b1f.js +0 -2
  313. package/dist/chunk-fh3pjhe6.js +0 -2
  314. package/dist/chunk-fnpf84rf.js +0 -4
  315. package/dist/chunk-jmb8r6aj.js +0 -2
  316. package/dist/chunk-jwt7q6yx.js +0 -4
  317. package/dist/chunk-mxfvakya.js +0 -2
  318. package/dist/chunk-n5v1h0sk.js +0 -2
  319. package/dist/chunk-nv6s8x9f.js +0 -2
  320. package/dist/chunk-pk2rvqd0.js +0 -2
  321. package/dist/chunk-pqa37epj.js +0 -2
  322. package/dist/chunk-pzyradqt.js +0 -2
  323. package/dist/chunk-q9zawfn1.js +0 -2
  324. package/dist/chunk-qn6ppn0r.js +0 -2
  325. package/dist/chunk-r5z08bp6.js +0 -2
@@ -1,4 +1,4 @@
1
- import{e}from"./chunk-4fk0vjh5.js";import{gt}from"./chunk-nn2hmwzd.js";import{H,Be,V,bt}from"./chunk-vbab9hc4.js";import{yt,xt}from"./chunk-0whxm2f0.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as J}from"cn";import{ChevronDownIcon as se,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as j,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as D,FieldDescription as de,FieldLabel as O}from"@nyssance/shadcn/vega/components/ui/field";import{Input as ee}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as q,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as Q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as X}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Z(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function Dn({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,j(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),j(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function $i({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=xt(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(H[0]?.id??""),[F,B]=y(0),[U,A]=y({}),_=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(H[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await yt(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=H.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return j(()=>{if(!c||x==="new"||P||E)return;k(H[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(gt,{bridge:d})]}),C&&t(Dn,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(Hn,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),H.map((o)=>t("div",{hidden:x!==o.id,children:t(Un,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>_(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Xt,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Xt,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function Hn({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[H.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(te,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:J("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function te({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:J("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:J("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function On({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(On,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function Un({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(V(s,d?.region)?.id),[U,A]=y(d?.base_url??""),_=s.logo,I=d!==null,T=c.trim(),z=bt(s,F),K=F!==V(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");j(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(V(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?V(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(_,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(X,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(O,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(q,{children:[t(Q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(D,{className:"gap-2",children:[t(O,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(q,{children:t(Q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:V(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Xt({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,_]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
1
+ import{e}from"./chunk-k1vkc88d.js";import{ht}from"./chunk-kbbq3y2j.js";import{H,Ue,j,yt}from"./chunk-p58e9z34.js";import{mt,gt}from"./chunk-xdvbb3av.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as J}from"cn";import{ChevronDownIcon as se,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as V,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as D,FieldDescription as de,FieldLabel as O}from"@nyssance/shadcn/vega/components/ui/field";import{Input as ee}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as q,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as Q}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as X}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function W(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Z(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(W(d));if(s.reportError)s.reportError(u);else console.error(u)}}function Hn({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,V(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),V(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(W(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function Ki({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=gt(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(H[0]?.id??""),[F,B]=y(0),[U,A]=y({}),_=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(H[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await mt(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=H.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return V(()=>{if(!c||x==="new"||P||E)return;k(H[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(ht,{bridge:d})]}),C&&t(Hn,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(On,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),H.map((o)=>t("div",{hidden:x!==o.id,children:t(Bn,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>_(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Jt,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Jt,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function On({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[H.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(te,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:J("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function te({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:J("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:J("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function Un({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(Un,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function Bn({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(j(s,d?.region)?.id),[U,A]=y(d?.base_url??""),_=s.logo,I=d!==null,T=c.trim(),z=yt(s,F),K=F!==j(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");V(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(j(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?j(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(_,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(X,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(O,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(q,{children:[t(Q,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(D,{className:"gap-2",children:[t(O,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(q,{children:t(Q,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:j(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Jt({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,_]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
2
2
  { "label": "My Model", "api_id": "model-id" }
3
- ]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),M=(m)=>{if(!m)try{_(Be(I)),K(null)}catch(G){K(W(G));return}U(m)},L=async()=>{let m;try{m=Be(I),K(null)}catch(g){K(W(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(X,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[t(O,{htmlFor:E,children:n("provider.name")}),t(ee,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:o,children:n("provider.baseUrl")}),t(ee,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:r,children:n("provider.apiKey")}),i(q,{children:[t(Q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(X,{}),i(re,{open:B,onOpenChange:M,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(se,{className:J("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:A.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(D,{className:"gap-2","data-invalid":z!==null,children:[t(O,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:J("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void L(),children:[u&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
4
- export{Dn,$i,Hn,On,Un,Xt};
3
+ ]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),M=(m)=>{if(!m)try{_(Ue(I)),K(null)}catch(G){K(W(G));return}U(m)},L=async()=>{let m;try{m=Ue(I),K(null)}catch(g){K(W(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(X,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[t(O,{htmlFor:E,children:n("provider.name")}),t(ee,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:o,children:n("provider.baseUrl")}),t(ee,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:r,children:n("provider.apiKey")}),i(q,{children:[t(Q,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(X,{}),i(re,{open:B,onOpenChange:M,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(se,{className:J("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:A.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(D,{className:"gap-2","data-invalid":z!==null,children:[t(O,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:J("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void L(),children:[u&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
4
+ export{Hn,Ki,On,Un,Bn,Jt};
@@ -1,2 +1,2 @@
1
- import{A}from"./chunk-2f9vjmxz.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function xr({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(A,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(A,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
2
- export{xr};
1
+ import{A}from"./chunk-2f9vjmxz.js";import{Button as u}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as d,DropdownMenuContent as m,DropdownMenuGroup as w,DropdownMenuItem as i,DropdownMenuLabel as S,DropdownMenuTrigger as c}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as e,jsxs as a}from"react/jsx-runtime";var M=["requires_action","running","done","idle"];function br({sessions:l,onSelect:p,t:n}){return e("div",{className:"flex shrink-0 items-center gap-0.5",role:"group","aria-label":n("sessionList.states.title"),children:M.map((o)=>{let s=l.filter((t)=>t.state===o),r=n(`sessionList.states.${o}`);return a(d,{children:[a(c,{render:e(u,{variant:"ghost",size:"xs"}),"aria-label":`${r}: ${s.length}`,children:[e(A,{state:o,pulse:!1}),e("span",{className:"tabular-nums",children:s.length})]}),e(m,{"aria-label":r,className:"w-72 max-w-[calc(100vw-1rem)]",children:a(w,{children:[e(S,{children:r}),s.length===0?e(i,{disabled:!0,children:n("sessionList.states.empty")}):s.map((t)=>a(i,{onClick:()=>p(t),children:[e(A,{state:t.state,pulse:!1}),e("span",{className:"min-w-0 flex-1 truncate",children:t.title||n("sessionList.untitled")})]},t.sessionId))]})})]},o)})})}
2
+ export{br};
@@ -1,2 +1,2 @@
1
- import{et}from"./chunk-pprt7ntb.js";import{l,_e}from"./chunk-4p6svs37.js";import{f}from"./chunk-1k21j77z.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as c}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as a,Fragment as F}from"react/jsx-runtime";function En(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let i=n.replaceAll("\\","/"),t=i.lastIndexOf("/");return t<=0?"/":i.slice(0,t)}function I(n){let i=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(i.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${i.replace(/\/$/,"")}/${t.join("/")}`}function le({path:n,renderHeader:i,description:t}){let e=l(),{t:r}=e,d=e.readFile,[u,v]=p(null),[w,k]=p(null),[M,N]=p(0);D(()=>{let s=!1;return v(null),k(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!s)v(m)},(m)=>{if(!s)k(String(m))}),()=>{s=!0}},[n,t,M,d]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:a(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":r("plugins.card.moreActions")}),children:o(y,{})}),a(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void _e(e,e.openPath(n)),children:r("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void _e(e,e.revealPath(n)),children:r("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:u===null,onClick:()=>{if(u!==null)_e(e,e.copyText(u))},children:r("plugins.skills.document.copy")})]})]});return a(F,{children:[i?i(x):o("div",{className:"flex justify-end",children:x}),o(f,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":r("plugins.skills.document.content")},children:w?a("div",{role:"alert",className:"space-y-3",children:[a("p",{className:"text-destructive text-sm break-words",children:[r("plugins.skills.document.error"),": ",w]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((s)=>s+1),children:r("plugins.loadError.retry")})]}):u===null?a("div",{role:"status","aria-label":r("plugins.skills.loading"),className:"space-y-3",children:[o(c,{className:"h-6 w-1/3"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-2/3"})]}):o(et,{text:En(u),host:{theme:e.theme,copyLabel:r("plugins.copy"),openLink:(s)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(s)||n===null?s:I(`${C(n)}/${s}`))}})})]})}
2
- export{En,le};
1
+ import{tt}from"./chunk-pv5g85k0.js";import{l,Pe}from"./chunk-wtf1eyzy.js";import{f}from"./chunk-1k21j77z.js";import{MoreHorizontalIcon as y}from"lucide-react";import{useEffect as D,useState as p}from"react";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as P,DropdownMenuContent as b,DropdownMenuItem as g,DropdownMenuTrigger as z}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as c}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as a,Fragment as F}from"react/jsx-runtime";function Rn(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function C(n){let i=n.replaceAll("\\","/"),t=i.lastIndexOf("/");return t<=0?"/":i.slice(0,t)}function I(n){let i=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(i.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${i.replace(/\/$/,"")}/${t.join("/")}`}function le({path:n,renderHeader:i,description:t}){let e=l(),{t:r}=e,d=e.readFile,[u,v]=p(null),[w,k]=p(null),[M,N]=p(0);D(()=>{let s=!1;return v(null),k(null),(n===null||!d?Promise.resolve(t??""):d(n)).then((m)=>{if(!s)v(m)},(m)=>{if(!s)k(String(m))}),()=>{s=!0}},[n,t,M,d]);let x=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:a(P,{children:[o(z,{render:o(h,{variant:"ghost",size:"icon-sm","aria-label":r("plugins.card.moreActions")}),children:o(y,{})}),a(b,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Pe(e,e.openPath(n)),children:r("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Pe(e,e.revealPath(n)),children:r("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:u===null,onClick:()=>{if(u!==null)Pe(e,e.copyText(u))},children:r("plugins.skills.document.copy")})]})]});return a(F,{children:[i?i(x):o("div",{className:"flex justify-end",children:x}),o(f,{className:"skill-document bg-muted/50 h-[45dvh] min-h-32 min-w-0 flex-none rounded-xl pe-0",viewportClassName:"overscroll-contain p-5 text-sm leading-6",viewportProps:{role:"region",tabIndex:0,"aria-label":r("plugins.skills.document.content")},children:w?a("div",{role:"alert",className:"space-y-3",children:[a("p",{className:"text-destructive text-sm break-words",children:[r("plugins.skills.document.error"),": ",w]}),o(h,{variant:"outline",size:"sm",onClick:()=>N((s)=>s+1),children:r("plugins.loadError.retry")})]}):u===null?a("div",{role:"status","aria-label":r("plugins.skills.loading"),className:"space-y-3",children:[o(c,{className:"h-6 w-1/3"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-full"}),o(c,{className:"h-4 w-2/3"})]}):o(tt,{text:Rn(u),host:{theme:e.theme,copyLabel:r("plugins.copy"),openLink:(s)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(s)||n===null?s:I(`${C(n)}/${s}`))}})})]})}
2
+ export{Rn,le};
@@ -1,2 +1,2 @@
1
- function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function Ut(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
- export{Ut};
1
+ function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function Bt(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
+ export{Bt};
@@ -1,2 +1,2 @@
1
- import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function pn({name:p,value:M,levels:h,disabled:c,onChange:P}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},f=100,r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
- export{pn};
1
+ import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function ln({name:p,value:M,levels:h,disabled:c,onChange:P}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},f=100,r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
+ export{ln};
@@ -1,2 +1,2 @@
1
- async function No(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
- export{No};
1
+ async function Mo(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
+ export{Mo};
@@ -1,2 +1,2 @@
1
- function bn(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
2
- export{bn};
1
+ function yn(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
2
+ export{yn};
@@ -1,2 +1,2 @@
1
- import{isArrayProperty as x,isBooleanProperty as k,isNumberProperty as O,isStringProperty as w}from"@nyssance/codex-acp-v2/client";import{useEffect as D,useMemo as S,useState as A}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as C}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Dialog as E,DialogContent as N,DialogDescription as V,DialogFooter as R,DialogHeader as q,DialogTitle as P}from"@nyssance/shadcn/vega/components/ui/dialog";import{Field as L,FieldDescription as f,FieldGroup as G,FieldLabel as I,FieldLegend as v,FieldSet as h}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Label as K}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as T,RadioGroupItem as j}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Switch as H}from"@nyssance/shadcn/vega/components/ui/switch";import{Textarea as M}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as r,jsxs as s}from"react/jsx-runtime";function _(n){if(!w(n))return null;if(n.oneOf&&n.oneOf.length>0)return n.oneOf.map((e)=>({value:e.const,label:e.title??e.const,...e.description?{description:e.description}:{}}));if(n.enum&&n.enum.length>0)return n.enum.map((e)=>({value:e,label:e}));return null}function z(n){let e=n,i=e._meta?.alwith?.options;if(Array.isArray(i)&&Array.isArray(e.enum))return i.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));if(Array.isArray(e.enum))return e.enum.map((t)=>({value:String(t),label:String(t)}));if(Array.isArray(e.oneOf))return e.oneOf.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));return null}function Or(n){let e=new Set(n.required??[]);return Object.entries(n.properties??{}).map(([i,t])=>({key:i,property:t,title:t.title??i,description:t.description??null,required:e.has(i),options:_(t),multiOptions:x(t)?z(t.items):null}))}function Ir(n){let e={};for(let i of n){let t=i.property.default;if(t!==void 0&&t!==null)e[i.key]=t;else if(i.options)e[i.key]=i.options[0].value;else if(k(i.property))e[i.key]=!1;else if(x(i.property))e[i.key]=[]}return e}function Ur(n,e){if(n.multiOptions)return Array.isArray(e)&&e.length>0;if(!n.required)return!0;return e!==void 0&&e!==""&&!(Array.isArray(e)&&e.length===0)}function b({id:n,label:e,description:i,control:t}){return s("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[t,s(K,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[r("div",{className:"text-foreground text-sm",children:e}),i&&r("div",{className:"text-muted-foreground text-xs",children:i})]})]})}function J({id:n,field:e,value:i,onChange:t}){if(e.multiOptions){let o=new Set(Array.isArray(i)?i:[]);return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r("div",{className:"flex flex-col gap-1",children:e.multiOptions.map((l)=>{let c=`${n}:${l.value}`;return r(b,{id:c,...l,control:r(C,{id:c,checked:o.has(l.value),onCheckedChange:(m)=>{let u=new Set(o);if(m)u.add(l.value);else u.delete(l.value);t([...u])}})},l.value)})})]})}if(e.options)return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r(T,{value:typeof i==="string"?i:"",onValueChange:(o)=>t(String(o)),className:"flex flex-col gap-1",children:e.options.map((o)=>{let l=`${n}:${o.value}`;return r(b,{id:l,...o,control:r(j,{value:o.value,id:l})},o.value)})})]});return s(L,{children:[r(I,{htmlFor:n,children:e.title}),k(e.property)?r(H,{id:n,checked:i===!0,onCheckedChange:(o)=>t(o)}):O(e.property)?r(B,{id:n,type:"number",required:e.required,value:typeof i==="number"?i:"",onChange:(o)=>t(o.target.value===""?void 0:Number(o.target.value))}):r(M,{id:n,rows:2,required:e.required,value:typeof i==="string"?i:"",onChange:(o)=>t(o.target.value)}),e.description&&r(f,{children:e.description})]})}function Bo({requestId:n,schema:e,message:i,total:t,t:o,onRespond:l}){let c=S(()=>Or(e),[e]),[m,u]=A(()=>Ir(c));D(()=>u(Ir(c)),[n,c]);let g=c.every((a)=>Ur(a,m[a.key])),y=()=>{if(!g)return;let a={};for(let[p,d]of Object.entries(m))if(d!==void 0)a[p]=d;l({action:"accept",content:a})};return r(E,{open:!0,onOpenChange:(a)=>!a&&l({action:"cancel"}),children:s(N,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(a)=>{if(a.key==="Enter"&&(a.metaKey||a.ctrlKey))a.preventDefault(),y()},children:[s(q,{children:[s("div",{className:"flex items-center justify-between gap-2 pe-8",children:[r(P,{children:e.title??o("approval.needed")}),t>1&&r("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${t}`})]}),r(V,{children:i})]}),r("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r(G,{children:c.map((a)=>r(J,{id:`${n}:${a.key}`,field:a,value:m[a.key],onChange:(p)=>u((d)=>({...d,[a.key]:p}))},a.key))})}),s(R,{children:[r(F,{variant:"ghost",onClick:()=>l({action:"decline"}),children:o("actions.decline")}),r(F,{disabled:!g,onClick:y,children:o("actions.submit")})]})]})})}
2
- export{Or,Ir,Ur,Bo};
1
+ import{isArrayProperty as x,isBooleanProperty as k,isNumberProperty as O,isStringProperty as w}from"@nyssance/codex-acp-v2/client";import{useEffect as D,useMemo as S,useState as A}from"react";import{Button as F}from"@nyssance/shadcn/vega/components/ui/button";import{Checkbox as C}from"@nyssance/shadcn/vega/components/ui/checkbox";import{Dialog as E,DialogContent as N,DialogDescription as V,DialogFooter as R,DialogHeader as q,DialogTitle as P}from"@nyssance/shadcn/vega/components/ui/dialog";import{Field as L,FieldDescription as f,FieldGroup as G,FieldLabel as I,FieldLegend as v,FieldSet as h}from"@nyssance/shadcn/vega/components/ui/field";import{Input as B}from"@nyssance/shadcn/vega/components/ui/input";import{Label as K}from"@nyssance/shadcn/vega/components/ui/label";import{RadioGroup as T,RadioGroupItem as j}from"@nyssance/shadcn/vega/components/ui/radio-group";import{Switch as H}from"@nyssance/shadcn/vega/components/ui/switch";import{Textarea as M}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as r,jsxs as s}from"react/jsx-runtime";function _(n){if(!w(n))return null;if(n.oneOf&&n.oneOf.length>0)return n.oneOf.map((e)=>({value:e.const,label:e.title??e.const,...e.description?{description:e.description}:{}}));if(n.enum&&n.enum.length>0)return n.enum.map((e)=>({value:e,label:e}));return null}function z(n){let e=n,i=e._meta?.alwith?.options;if(Array.isArray(i)&&Array.isArray(e.enum))return i.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));if(Array.isArray(e.enum))return e.enum.map((t)=>({value:String(t),label:String(t)}));if(Array.isArray(e.oneOf))return e.oneOf.map((t)=>({value:t.const,label:t.title,...t.description?{description:t.description}:{}}));return null}function Ur(n){let e=new Set(n.required??[]);return Object.entries(n.properties??{}).map(([i,t])=>({key:i,property:t,title:t.title??i,description:t.description??null,required:e.has(i),options:_(t),multiOptions:x(t)?z(t.items):null}))}function Nr(n){let e={};for(let i of n){let t=i.property.default;if(t!==void 0&&t!==null)e[i.key]=t;else if(i.options)e[i.key]=i.options[0].value;else if(k(i.property))e[i.key]=!1;else if(x(i.property))e[i.key]=[]}return e}function Br(n,e){if(n.multiOptions)return Array.isArray(e)&&e.length>0;if(!n.required)return!0;return e!==void 0&&e!==""&&!(Array.isArray(e)&&e.length===0)}function b({id:n,label:e,description:i,control:t}){return s("div",{className:"hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",children:[t,s(K,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[r("div",{className:"text-foreground text-sm",children:e}),i&&r("div",{className:"text-muted-foreground text-xs",children:i})]})]})}function J({id:n,field:e,value:i,onChange:t}){if(e.multiOptions){let o=new Set(Array.isArray(i)?i:[]);return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r("div",{className:"flex flex-col gap-1",children:e.multiOptions.map((l)=>{let c=`${n}:${l.value}`;return r(b,{id:c,...l,control:r(C,{id:c,checked:o.has(l.value),onCheckedChange:(m)=>{let u=new Set(o);if(m)u.add(l.value);else u.delete(l.value);t([...u])}})},l.value)})})]})}if(e.options)return s(h,{children:[r(v,{variant:"label",children:e.title}),e.description&&r(f,{children:e.description}),r(T,{value:typeof i==="string"?i:"",onValueChange:(o)=>t(String(o)),className:"flex flex-col gap-1",children:e.options.map((o)=>{let l=`${n}:${o.value}`;return r(b,{id:l,...o,control:r(j,{value:o.value,id:l})},o.value)})})]});return s(L,{children:[r(I,{htmlFor:n,children:e.title}),k(e.property)?r(H,{id:n,checked:i===!0,onCheckedChange:(o)=>t(o)}):O(e.property)?r(B,{id:n,type:"number",required:e.required,value:typeof i==="number"?i:"",onChange:(o)=>t(o.target.value===""?void 0:Number(o.target.value))}):r(M,{id:n,rows:2,required:e.required,value:typeof i==="string"?i:"",onChange:(o)=>t(o.target.value)}),e.description&&r(f,{children:e.description})]})}function Go({requestId:n,schema:e,message:i,total:t,t:o,onRespond:l}){let c=S(()=>Ur(e),[e]),[m,u]=A(()=>Nr(c));D(()=>u(Nr(c)),[n,c]);let g=c.every((a)=>Br(a,m[a.key])),y=()=>{if(!g)return;let a={};for(let[p,d]of Object.entries(m))if(d!==void 0)a[p]=d;l({action:"accept",content:a})};return r(E,{open:!0,onOpenChange:(a)=>!a&&l({action:"cancel"}),children:s(N,{className:"flex max-h-[80vh] flex-col gap-4 sm:max-w-lg",onKeyDown:(a)=>{if(a.key==="Enter"&&(a.metaKey||a.ctrlKey))a.preventDefault(),y()},children:[s(q,{children:[s("div",{className:"flex items-center justify-between gap-2 pe-8",children:[r(P,{children:e.title??o("approval.needed")}),t>1&&r("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${t}`})]}),r(V,{children:i})]}),r("div",{className:"min-h-0 flex-1 overflow-y-auto",children:r(G,{children:c.map((a)=>r(J,{id:`${n}:${a.key}`,field:a,value:m[a.key],onChange:(p)=>u((d)=>({...d,[a.key]:p}))},a.key))})}),s(R,{children:[r(F,{variant:"ghost",onClick:()=>l({action:"decline"}),children:o("actions.decline")}),r(F,{disabled:!g,onClick:y,children:o("actions.submit")})]})]})})}
2
+ export{Ur,Nr,Br,Go};
@@ -1,2 +1,2 @@
1
- import{Li}from"./chunk-kz1kjzmq.js";import{Ei,it}from"./chunk-wm0jty6e.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as st}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function ga(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function Lr(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;Lr(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function Ai({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await Ei(d,t),t.aborted)return;if(!l)Lr(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=it(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=it(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(st,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(Li,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
2
- export{ga,Lr,Ai};
1
+ import{Ri}from"./chunk-33tyec6w.js";import{Li,it}from"./chunk-2apyrry0.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as st}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function fa(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function Rr(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;Rr(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function Ei({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await Li(d,t),t.aborted)return;if(!l)Rr(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=it(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=it(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(st,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(Ri,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
2
+ export{fa,Rr,Ei};
@@ -1,2 +1,2 @@
1
- import{r,o}from"./chunk-1mn2t6ga.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Nt(e,s){let a=r(),c=o((t)=>t.connection),i=o((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=o((t)=>v(t.sessions[e]?.items)),f=o((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await a.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(s==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[a,e,c,f,i,s]),i?u:p??u}
1
+ import{r,o}from"./chunk-pw1pws10.js";import{latestAssistantReply as v}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useState as g}from"react";function Nt(e,s){let a=r(),c=o((t)=>t.connection),i=o((t)=>Boolean(t.sessions[e]?.attached)&&!t.sessions[e]?.restoring),u=o((t)=>v(t.sessions[e]?.items)),f=o((t)=>Boolean(t.runStates[e]?.reusableDraft)),[p,y]=g();return S(()=>{if(c!=="ready"||f||i)return;let t=!1,l,n=0,m=async()=>{try{let d=await a.activityReply(e);if(n=0,!t)y(d??void 0)}catch{n++}finally{if(!t&&(s==="running"||n>0&&n<3))l=setTimeout(()=>void m(),5000)}};return m(),()=>{t=!0,clearTimeout(l)}},[a,e,c,f,i,s]),i?u:p??u}
2
2
  export{Nt};
@@ -0,0 +1,2 @@
1
+ import{xo}from"./chunk-96tcqne6.js";import{n}from"./chunk-zyvvk8b2.js";import{e,g}from"./chunk-k1vkc88d.js";import{B,m,G}from"./chunk-v5mzxjzc.js";import{isBooleanOption as A,isGroupedSelect as Z,isSelectOption as D}from"@nyssance/codex-acp-v2/client";import{Zap as F}from"lucide-react";import{memo as H,useRef as J}from"react";import{jsx as I}from"react/jsx-runtime";function K({sessionId:l,options:p,disabled:x,onModelChange:b,onConfigChange:O,defaultGroup:L={id:"models",name:"Models"},catalog:N=(c)=>c,headerAction:P}){let{host:c,client:k}=e(),{t:i}=c,z=n((o)=>Boolean(o.configPending[l])),M=J({sessionId:l,model:!0}),v=z&&(M.current.sessionId!==l||M.current.model),R=n((o)=>{let r=o.sessions[l];return r?.state==="running"||r?.state==="requires_action"}),t=m(p,"model"),a=m(p,"thought_level"),_=p.filter((o)=>o.configId!=="collaboration_mode"&&(o.category==="model_config"||o.category!=="mode"&&o!==t&&o!==a)),S=_.filter(D),f=_.filter(A);if(!t&&!a&&S.length===0&&f.length===0)return null;let u=(o,r)=>{if(r===o.currentValue)return Promise.resolve();M.current={sessionId:l,model:o===t};let d=O?O(o.configId,r):k.setConfig(l,o.configId,r);return g(c,d),d},h=a?B(a):[],E=h.reduce((o,r)=>r.name.length>=o.length?r.name:o,""),U=t?G(t):i("composer.model"),V=(o)=>({api_id:o.value,label:o.name}),y=N(t&&Z(t.options)?t.options.map((o)=>({id:o.groupId,name:o.name,models:o.options.map(V)})):[{...L,models:t?B(t).map(V):[]}]),w=y.flatMap((o)=>o.models),C=w.find((o)=>o.api_id===t?.currentValue)??{api_id:t?.currentValue??"",label:U},s=f.find((o)=>o.configId==="fast_mode"||o.configId==="fast-mode");return I(xo,{disabled:x||v||R,switching:v,value:{...C,label:C.shortLabel??C.label},compactCatalog:!0,models:w,showModelList:Boolean(t),onChange:(o)=>{if(o.api_id===t?.currentValue)return;if(b)b(o.api_id);else if(t)u(t,o.api_id)},header:{name:t?.name??i("composer.model"),action:P},modelGroups:y,t:i,effortConfig:a&&h.length>0?{name:"Effort",value:a.currentValue,levels:h,sizer:E,onChange:(o)=>u(a,o)}:void 0,selectOptions:S.map((o)=>({id:o.configId,name:o.name,value:o.currentValue,options:B(o).map((r)=>({value:r.value,label:r.name})),onChange:(r)=>u(o,r)})),booleanOptions:[{id:"fast_mode",name:i("composer.fastMode"),currentValue:s?.currentValue??!1,disabled:!s,title:!s?i("composer.fastModeUnsupported"):void 0,icon:I(F,{className:"size-4","aria-hidden":"true"})},...f.filter((o)=>o!==s).map((o)=>({id:o.configId,name:o.name,currentValue:o.currentValue}))],onBooleanChange:(o,r)=>{let d=o==="fast_mode"?s:f.find((q)=>q.configId===o);if(!d)throw Error(`Unknown boolean config: ${o}`);u(d,r)}})}var Ht=H(K);
2
+ export{Ht};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-sz3vcbp5.js";import{Vt}from"./chunk-q9zawfn1.js";import{Badge as i}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{FileIcon as r,XIcon as l}from"lucide-react";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Ro({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(i,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(r,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:Vt(e)}),o(m,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:Vt(e)}),onClick:()=>n(e),children:o(l,{className:"size-3"})})]},e))})}
2
- export{Ro};
1
+ import{t}from"./chunk-zyvvk8b2.js";import{jt}from"./chunk-04xjj6q3.js";import{Badge as i}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{FileIcon as r,XIcon as l}from"lucide-react";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Fo({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(i,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(r,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:jt(e)}),o(m,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:jt(e)}),onClick:()=>n(e),children:o(l,{className:"size-3"})})]},e))})}
2
+ export{Fo};
@@ -1,2 +1,2 @@
1
- import{et}from"./chunk-pprt7ntb.js";import{ti,ni,oi}from"./chunk-f5gsffbv.js";import{Jo}from"./chunk-0wa9yjg3.js";import{t}from"./chunk-sz3vcbp5.js";import{oe}from"./chunk-f1gj3yzt.js";import{nativeTurnId as f,textOf as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function Br(i,n){return{installUnlock:n==="none"?()=>()=>{}:ni,preload:()=>{if(n!=="none")ti(i)},playSequence:(a,d,l)=>oi(a,d,l,i,n)}}function Yo(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=I(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(f).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:oe(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(et,{text:i.response,host:a})})]})}function Xo(i){return r(Jo,{...i,renderPreview:(n)=>r(T,{item:n})})}
2
- export{Br,Yo,Xo};
1
+ import{tt}from"./chunk-pv5g85k0.js";import{pi,mi,gi}from"./chunk-03x33m2h.js";import{fi}from"./chunk-5c5z2b48.js";import{t}from"./chunk-zyvvk8b2.js";import{ie}from"./chunk-qn2jfxff.js";import{nativeTurnId as f,textOf as I}from"@nyssance/codex-acp-v2/client";import{useMemo as N}from"react";import{jsx as r,jsxs as v,Fragment as y}from"react/jsx-runtime";function Kr(i,n){return{installUnlock:n==="none"?()=>()=>{}:mi,preload:()=>{if(n!=="none")pi(i)},playSequence:(a,d,l)=>gi(a,d,l,i,n)}}function di(i,n={},a){let d=[];for(let e of i){if(e.user===null)continue;let o="";for(let m of e.final){let p=I(m.content).trim();if(p.length===0)continue;o=p}let u=n[e.user.id],s=e.items.map(f).find((m)=>m!==null);d.push({id:e.user.id,turnKey:e.key,label:ie(e.user),response:o,inputTokens:u?.inputTokens??0,outputTokens:u?.outputTokens??0,...s===void 0?{}:{nativeTurnId:s}})}if(!a?.complete)return d;let l=new Map;for(let e of d){if(e.nativeTurnId===void 0)continue;let o=l.get(e.nativeTurnId)??[];o.push(e),l.set(e.nativeTurnId,o)}let c=new Set(a.turns.map((e)=>e.turnId)),g=new Set(a.loadedTurnIds);return[...a.turns.flatMap((e)=>{let o=l.get(e.turnId);if(o)return o;if(g.has(e.turnId))return[];let u=a.previews[e.turnId];return((u?.messages.length)?u.messages:[{id:"",label:"",response:""}]).map((s,m)=>({id:`history:${e.turnId}:${m===0?"0":s.id}`,messageId:s.id||void 0,turnKey:`history:${e.turnId}`,nativeTurnId:e.turnId,isLoaded:!1,previewState:u?.state??"loading",label:s.label,response:s.response,inputTokens:0,outputTokens:0}))}),...d.filter((e)=>e.nativeTurnId===void 0||!c.has(e.nativeTurnId))]}function T({item:i}){let n=t(),a=N(()=>({theme:n.theme,copyLabel:n.t("actions.copy"),openLink:()=>{},preview:!0}),[n]);if(i.previewState==="loading")return v("div",{role:"status",className:"animate-pulse space-y-2 py-1","aria-label":n.t("timeline.navigationLoading"),children:[r("div",{className:"bg-muted h-3 w-3/5 rounded"}),r("div",{className:"bg-muted h-3 rounded"}),r("div",{className:"bg-muted h-3 w-4/5 rounded"})]});return v(y,{children:[r("div",{className:"min-w-0 truncate font-medium",children:i.previewState==="unavailable"?n.t("timeline.navigationUnavailable"):i.label||n.t("timeline.navigationEmpty")}),i.response&&r("div",{className:"text-muted-foreground pointer-events-none mt-1 line-clamp-3 [&_img]:hidden [&_pre]:max-h-20 [&_table]:table-fixed","data-navigation-response":!0,children:r(tt,{text:i.response,host:a})})]})}function ui(i){return r(fi,{...i,renderPreview:(n)=>r(T,{item:n})})}
2
+ export{Kr,di,ui};
@@ -1,2 +1,2 @@
1
- import{T}from"./chunk-rbv1scqm.js";import{e}from"./chunk-4fk0vjh5.js";import{Ke}from"./chunk-fh3pjhe6.js";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Mo({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=T(),{text:c,status:n}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(r,{type:"button",variant:"ghost",disabled:n!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:n==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(n==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),n==="error"&&a.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Ke(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
2
- export{Mo};
1
+ import{T}from"./chunk-7a668qzy.js";import{e}from"./chunk-k1vkc88d.js";import{Ke}from"./chunk-2djv6s3a.js";import{Button as r}from"@nyssance/shadcn/vega/components/ui/button";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Ao({data:s,sessionId:m}){let{host:a}=e(),{t:o}=a,p=T(),{text:c,status:n}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(r,{type:"button",variant:"ghost",disabled:n!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:n==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(n==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),n==="error"&&a.writeTextAttachment&&t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Ke(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(r,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
2
+ export{Ao};
@@ -1,2 +1,2 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function ei({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
- export{ei};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function hi({open:r,onOpenChange:a,trigger:i,children:t,...n}){return d(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100}),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t})})})]})}
2
+ export{hi};
@@ -0,0 +1,2 @@
1
+ import{o}from"./chunk-pw1pws10.js";import{pe,O,ee}from"./chunk-9n2vrkkh.js";import{useEffect as S,useMemo as f}from"react";function ar(s){let c=O((i)=>i.activityOrder),a=o((i)=>{let n=Object.values(i.runStates).filter((t)=>c.includes(t.sessionId)&&(t.state==="done"||t.state==="requires_action")&&pe(i,t.sessionId)).map((t)=>[t.sessionId,JSON.stringify([t.state,t.since,t.interruption])]);return JSON.stringify(n)}),e=f(()=>new Map(JSON.parse(a)),[a]),u=O((i)=>i.activitySeen),r=ee();return S(()=>{if(s==="activity")r({activitySeen:e})},[s,e,r]),s!=="activity"&&[...e].some(([i,n])=>u.get(i)!==n)}
2
+ export{ar};
@@ -1,2 +1,2 @@
1
- import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function li(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
2
- export{li};
1
+ import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function Ti(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
2
+ export{Ti};
@@ -1,3 +1,3 @@
1
- import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function Go(e){let t=0,i=0;for(let o of e.split(`
1
+ import{html as n}from"diff2html";import{ColorSchemeType as r}from"diff2html/lib/types";import{useMemo as s}from"react";import{jsx as a}from"react/jsx-runtime";function zo(e){let t=0,i=0;for(let o of e.split(`
2
2
  `)){if(o.startsWith("+++")||o.startsWith("---"))continue;if(o.startsWith("+"))t+=1;else if(o.startsWith("-"))i+=1}return{additions:t,deletions:i}}function Xe({patch:e,theme:t}){let i=s(()=>n(e,{drawFileList:!1,outputFormat:"line-by-line",matching:"lines",colorScheme:t==="dark"?r.DARK:r.LIGHT}),[e,t]);return a("div",{className:"codex-patch-view",dangerouslySetInnerHTML:{__html:i}})}
3
- export{Go,Xe};
3
+ export{zo,Xe};
@@ -0,0 +1,2 @@
1
+ function fe(){if(typeof navigator>"u")return!1;let a=navigator.userAgentData?.platform;return/mac/i.test(a??navigator.platform)}function to(a){if(a.shiftKey||a.altKey)return!1;return fe()?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}
2
+ export{fe,to};
@@ -1,2 +1,2 @@
1
- import{n}from"./chunk-sz3vcbp5.js";import{Yt,e,g}from"./chunk-4fk0vjh5.js";import{Ft}from"./chunk-awmra30d.js";import{Wt}from"./chunk-n0acc2tb.js";import{Qt}from"./chunk-zheyzqcq.js";import{Et,Lt}from"./chunk-6179zrn1.js";import{Rt}from"./chunk-4jfynrgh.js";import{Alert as x,AlertDescription as C,AlertTitle as N}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as H,EmptyDescription as k,EmptyHeader as O,EmptyTitle as S}from"@nyssance/shadcn/vega/components/ui/empty";import{LockIcon as M,UnplugIcon as P}from"lucide-react";import{useMemo as z,useRef as B}from"react";import{jsx as o,jsxs as r}from"react/jsx-runtime";function br({host:t,client:c,...s}){let m=z(()=>t.openDiff?t:{...t,openDiff:Et},[t]);return r(Yt,{host:m,client:c,children:[o(I,{...s}),!t.openDiff&&o(Lt,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:w,readOnlyActions:D,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=B(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:i}=d,f=n((a)=>a.connection==="ready"),v=n((a)=>a.historyPages[t.id]?.error),y=()=>g(d,R.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return r("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,r("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&o(Qt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(x,{children:[o(P,{}),o(N,{children:i("conversation.stopped")}),o(C,{children:o(h,{size:"sm",variant:"outline",onClick:y,children:i("conversation.reconnect")})})]})}),u?E??o(H,{className:"flex-1",children:r(O,{children:[o(S,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(k,{children:i("conversation.welcomeDescription")})]})}):o(Wt,{session:t,timeline:m}),o(Rt,{sessionId:t.id}),t.readOnly?o("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:r(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[r("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o(M,{"aria-hidden":"true",className:"size-4 shrink-0"}),r("div",{className:"min-w-0 space-y-1",children:[o(N,{children:i("conversation.readOnlyTitle")}),o(C,{children:i("conversation.readOnlyDescription")}),v&&o("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(h,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),D]})]})}):w??o(Ft,{session:t})]}),T]})}
2
- export{br};
1
+ import{n}from"./chunk-zyvvk8b2.js";import{Yt,e,g}from"./chunk-k1vkc88d.js";import{Ft}from"./chunk-hq06m42h.js";import{Wt}from"./chunk-rb0cqdjg.js";import{Qt}from"./chunk-6wmdpam5.js";import{Et,Lt}from"./chunk-4vk86bbk.js";import{Rt}from"./chunk-9zth7avc.js";import{Alert as x,AlertDescription as C,AlertTitle as N}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as h}from"@nyssance/shadcn/vega/components/ui/button";import{Empty as H,EmptyDescription as k,EmptyHeader as O,EmptyTitle as S}from"@nyssance/shadcn/vega/components/ui/empty";import{LockIcon as M,UnplugIcon as P}from"lucide-react";import{useMemo as z,useRef as B}from"react";import{jsx as o,jsxs as r}from"react/jsx-runtime";function Cr({host:t,client:c,...s}){let m=z(()=>t.openDiff?t:{...t,openDiff:Et},[t]);return r(Yt,{host:m,client:c,children:[o(I,{...s}),!t.openDiff&&o(Lt,{})]})}function I({session:t,header:c,overlay:s,timeline:m,composer:w,readOnlyActions:D,welcome:E,children:T,rootRef:l,search:A=!0}){let{host:d,client:R}=e(),p=B(null),b=(a)=>{if(p.current=a,typeof l==="function")l(a);else if(l)l.current=a},{t:i}=d,f=n((a)=>a.connection==="ready"),v=n((a)=>a.historyPages[t.id]?.error),y=()=>g(d,R.open(t.id,t.cwd)),u=t.items.length===0&&t.attached&&!t.restoring&&t.state==="idle";return r("div",{"data-chat-drop-zone":!0,ref:b,className:"flex h-full min-h-0 flex-col",children:[c,r("div",{className:"relative flex min-h-0 flex-1 flex-col","data-chat-content":!0,children:[A&&!u&&o(Qt,{sessionId:t.id,rootRef:p}),s,f&&!t.attached&&!t.restoring&&!t.readOnly&&o("div",{className:"mx-auto my-3 w-full max-w-4xl px-4",children:r(x,{children:[o(P,{}),o(N,{children:i("conversation.stopped")}),o(C,{children:o(h,{size:"sm",variant:"outline",onClick:y,children:i("conversation.reconnect")})})]})}),u?E??o(H,{className:"flex-1",children:r(O,{children:[o(S,{className:"text-[28px] font-normal",children:i("conversation.welcomeTitle")}),o(k,{children:i("conversation.welcomeDescription")})]})}):o(Wt,{session:t,timeline:m}),o(Rt,{sessionId:t.id}),t.readOnly?o("div",{className:"mx-auto w-full max-w-3xl shrink-0 px-6 pb-5","data-readonly-composer":!0,children:r(x,{className:"flex items-center justify-between gap-4 rounded-3xl px-5 py-4",children:[r("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[o(M,{"aria-hidden":"true",className:"size-4 shrink-0"}),r("div",{className:"min-w-0 space-y-1",children:[o(N,{children:i("conversation.readOnlyTitle")}),o(C,{children:i("conversation.readOnlyDescription")}),v&&o("p",{role:"alert",className:"text-destructive break-words",children:v})]})]}),r("div",{className:"border-border flex shrink-0 items-center gap-1 border-s ps-3","data-readonly-actions":!0,children:[o(h,{size:"sm",variant:"outline",className:"text-foreground cursor-pointer disabled:cursor-not-allowed",onClick:y,disabled:!f||t.restoring,children:i(t.restoring?"conversation.restoring":"conversation.readOnlyRetry")}),D]})]})}):w??o(Ft,{session:t})]}),T]})}
2
+ export{Cr};
@@ -1,2 +1,2 @@
1
- import{Te,Pt}from"./chunk-y0q6jwq4.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function Wn(o){if(o===null||o===void 0)return Te();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function er(o,{reportError:t=console.error}={}){let e=S(Te()),r=async()=>{e.setState(Wn(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(Pt,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function tr({store:o,children:t}){return w(f,{value:o,children:t})}function en(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function de(o){let{store:t}=en(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function X(){return en().dispatch}
2
- export{Wn,er,tr,en,de,X};
1
+ import{Ie,Pt}from"./chunk-22tg663v.js";import{createStore as S}from"@alwith/api/client";import{createContext as y,useContext as h,useSyncExternalStore as x}from"react";import{jsx as w}from"react/jsx-runtime";function u(o){return typeof o==="object"&&o!==null&&!Array.isArray(o)}function Wn(o){if(o===null||o===void 0)return Ie();if(!u(o)||!u(o.collections)||!Array.isArray(o.order))throw Error("Saved collections are not in the expected format");let{collections:t,order:e}=o;for(let r of e)if(typeof r!=="string"||!u(t[r]))throw Error(`Saved collection missing: ${String(r)}`);return{collections:t,order:e,sessionMeta:{}}}function tr(o,{reportError:t=console.error}={}){let e=S(Ie()),r=async()=>{e.setState(Wn(await o.load()),!0)},i=r(),l=i.catch(t),C=()=>{let n=l.then(r);return i=n,l=n.catch(()=>{}),n},s=!1,a,c=o.subscribe?.(()=>{if(!s)C().catch(t)});if(typeof c==="function")a=c;else if(c!==void 0)c.then((n)=>{if(s)n();else a=n},t);return{store:e,getState:()=>e.getState(),ready:i,dispatch:(n)=>{let p=l.then(async()=>{await i;let d=(Array.isArray(n)?n:[n]).reduce(Pt,e.getState());await o.save({collections:d.collections,order:d.order}),e.setState(d,!0)});return l=p.catch(()=>{}),p},reload:C,dispose:()=>{s=!0,a?.()}}}var f=y(null);function nr({store:o,children:t}){return w(f,{value:o,children:t})}function en(){let o=h(f);if(o===null)throw Error("Collection store is missing; wrap the tree in CollectionProvider");return o}function de(o){let{store:t}=en(),e=()=>o?o(t.getState()):t.getState();return x((r)=>t.subscribe(r),e,e)}function X(){return en().dispatch}
2
+ export{Wn,tr,nr,en,de,X};
@@ -1,2 +1,2 @@
1
- import{C}from"./chunk-heyqzkxq.js";import{s,u}from"./chunk-1mn2t6ga.js";import{_,p}from"./chunk-1k697ncv.js";import{GlobeIcon as b,LogOutIcon as x}from"lucide-react";import{useState as M}from"react";import{Avatar as A,AvatarFallback as N,AvatarImage as y}from"@nyssance/shadcn/vega/components/ui/avatar";import{DropdownMenu as h,DropdownMenuContent as S,DropdownMenuGroup as c,DropdownMenuItem as L,DropdownMenuLabel as P,DropdownMenuRadioGroup as I,DropdownMenuRadioItem as O,DropdownMenuSeparator as d,DropdownMenuSub as G,DropdownMenuSubContent as k,DropdownMenuSubTrigger as R,DropdownMenuTrigger as T}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as n}from"react/jsx-runtime";function gr(e){return o(c,{...e})}function fr(e){return o(d,{...e})}function oo({className:e,...r}){return o(L,{className:["h-[var(--navigation-row-height,30px)] py-0 [&_svg]:text-muted-foreground",e].filter(Boolean).join(" "),...r})}function hr({languages:e,value:r,onChange:i}){let a=s();return n(G,{children:[n(R,{className:"h-[var(--navigation-row-height,30px)] py-0",children:[o(b,{className:"text-muted-foreground"}),a.t("sessionList.language")]}),o(k,{children:o(I,{value:r,onValueChange:(t)=>void u(a,Promise.resolve(i(t))),children:e.map((t)=>o(O,{value:t.code,children:t.label},t.code))})})]})}function vr({user:e,children:r,onSignOut:i,busy:a=!1}){let t=s(),{t:w}=t,[m,v]=M(!1),[D,l]=M(!1);C(m);let g=a||D,f=n(A,{className:"size-[18px] after:border-0",children:[o(y,{src:e.avatar??void 0,alt:""}),o(N,{className:"bg-primary text-primary-foreground text-xs",children:[...e.name].slice(0,2).join("").toLocaleUpperCase()})]});return n(h,{open:m,onOpenChange:v,children:[n(T,{render:o(p,{disabled:g,className:"text-muted-foreground hover:bg-foreground/8 data-popup-open:bg-foreground/5 font-normal"}),children:[o(_,{children:f}),o("span",{className:"min-w-0 truncate",children:e.name})]}),n(S,{side:"top",align:"start",sideOffset:8,className:"w-[calc(var(--anchor-width)+36px)]",children:[n(c,{children:[n(P,{className:"text-popover-foreground flex items-center gap-2 px-2 py-2 text-sm font-medium",children:[f,n("span",{className:"min-w-0 flex-1",children:[o("span",{className:"block truncate",children:e.name}),o("span",{className:"text-muted-foreground mt-0.5 block truncate text-xs font-normal",children:e.email})]})]}),o(d,{})]}),r,r!=null&&o(d,{}),o(c,{children:n(oo,{disabled:g,onClick:()=>{l(!0),u(t,i()).finally(()=>l(!1))},children:[o(x,{}),w("sessionList.signOut")]})})]})]})}
2
- export{gr,fr,oo,hr,vr};
1
+ import{C}from"./chunk-heyqzkxq.js";import{s,u}from"./chunk-pw1pws10.js";import{_,p}from"./chunk-py0zbgaj.js";import{GlobeIcon as b,LogOutIcon as x}from"lucide-react";import{useState as M}from"react";import{Avatar as A,AvatarFallback as N,AvatarImage as y}from"@nyssance/shadcn/vega/components/ui/avatar";import{DropdownMenu as h,DropdownMenuContent as S,DropdownMenuGroup as c,DropdownMenuItem as L,DropdownMenuLabel as P,DropdownMenuRadioGroup as I,DropdownMenuRadioItem as O,DropdownMenuSeparator as d,DropdownMenuSub as G,DropdownMenuSubContent as k,DropdownMenuSubTrigger as R,DropdownMenuTrigger as T}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as n}from"react/jsx-runtime";function fr(e){return o(c,{...e})}function hr(e){return o(d,{...e})}function oo({className:e,...r}){return o(L,{className:["h-[var(--navigation-row-height,30px)] py-0 [&_svg]:text-muted-foreground",e].filter(Boolean).join(" "),...r})}function vr({languages:e,value:r,onChange:i}){let a=s();return n(G,{children:[n(R,{className:"h-[var(--navigation-row-height,30px)] py-0",children:[o(b,{className:"text-muted-foreground"}),a.t("sessionList.language")]}),o(k,{children:o(I,{value:r,onValueChange:(t)=>void u(a,Promise.resolve(i(t))),children:e.map((t)=>o(O,{value:t.code,children:t.label},t.code))})})]})}function yr({user:e,children:r,onSignOut:i,busy:a=!1}){let t=s(),{t:w}=t,[m,v]=M(!1),[D,l]=M(!1);C(m);let g=a||D,f=n(A,{className:"size-[18px] after:border-0",children:[o(y,{src:e.avatar??void 0,alt:""}),o(N,{className:"bg-primary text-primary-foreground text-xs",children:[...e.name].slice(0,2).join("").toLocaleUpperCase()})]});return n(h,{open:m,onOpenChange:v,children:[n(T,{render:o(p,{disabled:g,className:"text-muted-foreground hover:bg-foreground/8 data-popup-open:bg-foreground/5 font-normal"}),children:[o(_,{children:f}),o("span",{className:"min-w-0 truncate",children:e.name})]}),n(S,{side:"top",align:"start",sideOffset:8,className:"w-[calc(var(--anchor-width)+36px)]",children:[n(c,{children:[n(P,{className:"text-popover-foreground flex items-center gap-2 px-2 py-2 text-sm font-medium",children:[f,n("span",{className:"min-w-0 flex-1",children:[o("span",{className:"block truncate",children:e.name}),o("span",{className:"text-muted-foreground mt-0.5 block truncate text-xs font-normal",children:e.email})]})]}),o(d,{})]}),r,r!=null&&o(d,{}),o(c,{children:n(oo,{disabled:g,onClick:()=>{l(!0),u(t,i()).finally(()=>l(!1))},children:[o(x,{}),w("sessionList.signOut")]})})]})]})}
2
+ export{fr,hr,oo,vr,yr};
@@ -1,2 +1,2 @@
1
- import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function qo(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
2
- export{qo};
1
+ import{codexMessageError as u,codexTurnError as a}from"@nyssance/codex-acp-v2/client";var c=[10,30,120,300];function ti(e){let n=0;for(let r=e.length-1;r>=0;r--){let o=e[r],t=o.errors.at(-1),l=t===void 0?null:u(t);if(l===null||a(l).category!=="overloaded")break;if(n++,o.user!==null)break}return c[n-1]??null}
2
+ export{ti};
@@ -1,3 +1,3 @@
1
- import{c,S}from"./chunk-mj7094yh.js";import{z}from"./chunk-rjkpe1fw.js";import{di}from"./chunk-wccx911q.js";import{ie}from"./chunk-76a04a6j.js";import{mi,tt}from"./chunk-asyfpv8n.js";import{pi}from"./chunk-1qyxrh0n.js";import{Cn}from"./chunk-vt6cyes7.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(S,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(S,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(ie,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function ua({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
- `),T=!t.streaming&&C.trim().length>0?o(hn,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=di(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&z(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(tt,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(vn,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(pi,{blocks:f}):y(f))})}function hn({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(Cn,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function vn({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(mi,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
- export{ua,hn,vn};
1
+ import{c,S}from"./chunk-rezwwmw7.js";import{V}from"./chunk-s7yzvpmc.js";import{Zo}from"./chunk-k2gwmccn.js";import{oe}from"./chunk-x2nemdjf.js";import{Xo,et}from"./chunk-w8qn76a1.js";import{Yo}from"./chunk-w233xc7k.js";import{xn}from"./chunk-46phvpzh.js";import{cn as B}from"cn";import{jsx as o,jsxs as g}from"react/jsx-runtime";var v=new WeakMap,M=1;function R(t){if(t.type==="tool_use"||t.type==="subagent"||t.type==="collab")return`${t.type}:${t.id}`;let n=v.get(t);if(n!==void 0)return`${t.type}:${n}`;let s=M++;return v.set(t,s),`${t.type}:${s}`}function w({block:t,streaming:n,actions:s}){if(t.isApiError)return o("div",{className:"codex-stream-error",children:t.text});return g("div",{className:"codex-assistant-message",children:[o(S,{text:t.text,streaming:n}),s]})}function P({block:t,streaming:n,actions:s,renderText:i}){switch(t.type){case"text":return i===void 0?o(w,{block:t,streaming:n,actions:s}):i({block:t,streaming:n,actions:s});case"thinking":return t.thinking.length>0?o(S,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(oe,{entries:t.entries});case"image":return o("img",{src:`data:${t.source.media_type};base64,${t.source.data}`,className:"max-h-64 rounded",alt:""});case"tool_use":case"subagent":case"collab":return null}}var I=new Set;function sa({message:t,isMostRecentTurn:n,hiddenTools:s=I,time:i,beforeCopy:r,afterCopy:d,providerIcon:u,renderText:A,renderEditedFiles:y}){if(t.streaming===!0&&t.content.every((e)=>e.type==="text"?e.text.length===0:e.type==="thinking"?e.thinking.length===0:!1))return o(N,{});let C=t.content.filter((e)=>e.type==="text").map((e)=>e.text).join(`
2
+ `),T=!t.streaming&&C.trim().length>0?o(gn,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=Zo(t.content,"compact"),x=l.reduce((e,a,p)=>a.kind==="codexActivityGroup"?p:e,-1),h=l.findIndex((e,a)=>a>x&&e.kind==="block"&&e.block.type==="text"),b=[...t.content].toReversed().find((e)=>e.type==="text"),f=t.content.filter((e)=>e.type==="tool_use"&&V(e).category==="edit"),k=(e)=>{if(e.kind==="codexActivityGroup"){let a=e.blocks.filter((p)=>p.type!=="tool_use"||!s.has(p.name));return a.length===0?null:o(et,{blocks:a},`activity:${R(a[0])}`)}if(e.kind!=="block")throw Error(`Codex received an incompatible grouped entry: ${e.kind}`);return o(P,{block:e.block,streaming:Boolean(t.streaming),actions:e.block===b?T:void 0,renderText:A},R(e.block))},m=x===-1?0:h===-1?l.length:h;return o(fn,{stateKey:t.id,active:Boolean(t.streaming),startedAt:t.startedAt,durationMs:t.durationMs,providerId:t.providerId,providerIcon:u,work:l.slice(0,m).map(k),answer:l.length>m?l.slice(m).map(k):null,footer:x!==-1&&f.length>0&&(y===void 0?o(Yo,{blocks:f}):y(f))})}function gn({text:t,isMostRecentTurn:n=!1,beforeCopy:s,afterCopy:i,time:r}){let d=c(),{t:u}=d;return g("div",{className:B("mt-1.5 flex h-5 w-fit -translate-x-1 items-center justify-start gap-0.5 [&_*]:transition-none",n?"opacity-100":"opacity-0 group-focus-within/am:opacity-100 group-hover/am:opacity-100"),children:[s,o(xn,{text:t,label:u("actions.copy"),host:d}),i,r&&o("span",{className:"codex-user-time ms-1",title:r.full,children:r.short})]})}function N({label:t}){let{t:n}=c();return o("div",{className:"codex-pending-message py-2",role:"status",children:o("span",{className:"codex-activity-running",children:t??n("message.thinking")})})}function fn({work:t,answer:n,footer:s,loading:i=!1,loadingLabel:r,...d}){if(i)return o(N,{label:r});return g("div",{className:"group/am codex-assistant-turn",children:[t.length>0&&o(Xo,{...d,children:t}),n!==null&&(t.length===0?n:o("div",{"data-local-conversation-final-assistant":!0,"data-testid":"codex-final-answer",className:"codex-final-answer",children:n})),s]})}
3
+ export{sa,gn,fn};
@@ -0,0 +1,2 @@
1
+ import{Lo,T}from"./chunk-7a668qzy.js";import{po}from"./chunk-99ftqpgg.js";import{xe}from"./chunk-s2w7e9pg.js";import{wo,ko,So,_o,Po,ne}from"./chunk-5r081sme.js";import{co,uo}from"./chunk-pyznxtyg.js";import{rn}from"./chunk-ymy8d3hp.js";import{t,n}from"./chunk-zyvvk8b2.js";import{e}from"./chunk-k1vkc88d.js";import{pn}from"./chunk-p272qmbv.js";import{a,Ro,U,zt}from"./chunk-2dvryx1q.js";import{Bt}from"./chunk-ce3wg766.js";import{Ee,Ut}from"./chunk-2djv6s3a.js";import{Vt,$t}from"./chunk-04xjj6q3.js";import{Fo}from"./chunk-e5twctz7.js";import{Ht}from"./chunk-e24jv7zb.js";import{Ao}from"./chunk-ewvb59ye.js";import{Kt}from"./chunk-3v3bd582.js";import{qt}from"./chunk-mttcvwhx.js";import{Ho}from"./chunk-5dkj3ntx.js";import{Co}from"./chunk-517bhxvr.js";import{bo}from"./chunk-2hzdkgrk.js";import{Ot}from"./chunk-qn4zvgc9.js";import{hasFuzzyFileSearch as Mt}from"@nyssance/codex-acp-v2/client";import{PlusIcon as Ct}from"lucide-react";import{useCallback as O,useEffect as Et,useLayoutEffect as J,useMemo as Q,useRef as Y,useState as S}from"react";import{jsx as c,jsxs as w}from"react/jsx-runtime";var Rt=["image/png","image/jpeg","image/webp","image/gif"],Z=[];async function Nt(r){let d=await(await fetch(r.url)).blob();return new Promise((l,E)=>{let I=new FileReader;I.onerror=()=>E(I.error),I.onload=()=>{let L=I.result;l(L.slice(L.indexOf(",")+1))},I.readAsDataURL(d)})}function St(r){let{t:d}=t(),l=T();return c(ne,{"aria-label":d("composer.attachImage"),title:d("composer.attachImage"),onClick:()=>l.openFileDialog(),...r,children:c(Ct,{className:"size-4"})})}function Ft({session:r,onSubmit:d,onShellCommand:l,onHandOff:E,modelSelector:I,modelMenu:L,inputHeader:tt,actions:dt,children:ut,attachmentPolicy:ft,predictions:ht=!0,disabled:gt=!1,preparing:et=!1,allowPendingInput:xt=!1}){let{host:F,client:R}=e(),{t:p}=F,k=O((o)=>{if(F.reportError)F.reportError(o);else console.error(o)},[F]),[rt,D]=S(()=>({text:a.get(r.id)?.text??"",revision:0})),{text:P}=rt,[A,yt]=S(()=>a.get(r.id)?.attachments??Z),[u,z]=S(()=>a.get(r.id)?.mentions??[]),V=A.some((o)=>Ee(o)&&o.pastedText.status!=="ready"),[M,ot]=S(!1),[H,Pt]=S(!1),[X,nt]=S(!1),f=Y(null),at=Y(null),i=Y(rt),B=O((o)=>{at.current?.(),i.current={text:o,revision:i.current.revision+1},D(i.current)},[]),bt=Ho(r,B),it=Q(()=>({read:()=>{let m=f.current?.getTextarea(),g=m===null||m===void 0?[i.current.text.length,i.current.text.length]:[m.selectionStart,m.selectionEnd];return{target:r.id,...i.current,selection:g}},compareAndSet(m,g,C){if(m.target!==r.id||m.revision!==i.current.revision)return null;i.current={text:g,revision:i.current.revision+1},D(i.current);let x=f.current?.getTextarea();if(x!==null&&x!==void 0)x.value=g,x.setSelectionRange(C[0],C[1]);return{target:r.id,...i.current,selection:C}}}),[r.id]),_=Y(null),ct=O((o)=>(_.current=o,()=>{if(_.current===o)_.current=null}),[]),K=r.state!=="idle",b=l!==void 0&&P.startsWith("!"),h=!gt&&!et&&r.attached&&!r.restoring&&!r.readOnly,N=!r.readOnly&&(xt||h),W=qt(r,h&&!M&&!H&&!V&&!X,P.length>0||A.length>0||u.length>0,ht&&!b),mt=W.invalidate;J(()=>{a.set(r.id,{text:P,attachments:A,mentions:u,modelId:a.get(r.id)?.modelId??null})},[r.id,P,A,u]),J(()=>Ro(r.id,yt),[r.id]),J(()=>zt(r.id,(o)=>{if(!N||M)throw Error("The composer cannot take text now; try again later");if(P.length||A.length||u.length)throw Error("The composer already has a draft; send or clear it first");B(o)}),[r.id,N,M,P,A,u,B]);let st=n((o)=>Mt(o.agent)),vt=Q(()=>st&&h?async(o)=>Bt((await R.fuzzyFileSearch({query:o,roots:[r.cwd]})).files):void 0,[R,st,h,r.cwd]),q=O((o)=>{z((m)=>m.includes(o)?m:[...m,o])},[]);Et(()=>{f.current?.focus()},[]);let pt=O(async({text:o,files:m})=>{let g=l!==void 0&&o.startsWith("!")?o.slice(1):null;if(g!==null){if(g.trim().length===0)return;if(m.length||u.length)throw Error("Shell commands cannot include file references or attachments");if(r.state!=="idle")throw Error("Wait for the current turn before running a shell command")}let C=o.trim();if(C.length===0&&m.length===0&&u.length===0)return;let x=_.current;ot(!0);let v=a.get(r.id),At=i.current.revision,j=null;try{let y=[];for(let s of u){let G={kind:"file",absPath:s};y.push({type:"resource_link",uri:Vt(G),name:$t(G)})}if(C.length>0)y.push({type:"text",text:C});for(let s of m)if(Ee(s)){if(s.pastedText.status!=="ready")throw Error("Text attachment is not ready");y.push({type:"resource_link",uri:s.url,name:s.filename??"pasted-text.txt"})}else y.push({type:"image",data:await Nt(s),mimeType:s.mediaType});if(i.current.revision===At&&a.get(r.id)===v)i.current={text:"",revision:i.current.revision+1},j=i.current.revision,D(i.current),z([]),U(r.id,()=>Z),a.set(r.id,{text:"",attachments:Z,mentions:[],modelId:v?.modelId??null}),f.current?.resetHeight();if(g!==null&&l)await l(g);else if(d)if(x===null)await d(y);else await d(y,(s)=>{if(x.signal.aborted||_.current!==x)return;x.accept(s),E?.(r.id,s)});else if(x===null)await R.prompt(r.id,y);else{let s=await R.prompt(r.id,y);x.accept(s)}mt();for(let s of v?.attachments??[])if(s.url.startsWith("blob:")&&!a.get(r.id)?.attachments.some((G)=>G.id===s.id))URL.revokeObjectURL(s.url)}catch(y){if(v&&j!==null&&i.current.revision===j&&a.get(r.id)?.attachments.length===0&&a.get(r.id)?.mentions.length===0)i.current={text:v.text,revision:j+1},D(i.current),z(v.mentions),a.set(r.id,v),U(r.id,()=>v.attachments);throw y}finally{ot(!1),f.current?.focus()}},[R,r.id,r.state,u,d,l,E,mt]),wt=()=>{R.cancel(r.id).catch(k)},It=O((o)=>{let m=o.code==="max_total_size"?Object.assign(Error(p("composer.imageTooLargeTitle")),{description:p("composer.imageTooLargeDescription",{mb:xe})}):Object.assign(Error(p("composer.unsupportedAttachmentTitle")),{description:p("composer.unsupportedAttachmentDescription")});k(m)},[k,p]),Tt=Q(()=>({session:r,ready:h,inputReady:N,sending:M,textareaRef:f,draft:it,interruptRef:at,observeReceipts:ct,addMention:q,setAdding:Pt,shellMode:b,handsFree:!b&&(d===void 0||E!==void 0)}),[r,h,N,M,it,ct,q,d,E,b]),lt=F.writeTextAttachment;return c(pn,{value:Tt,children:c("div",{"data-chat-drop-zone":!0,className:"mx-auto w-full max-w-3xl px-6 pb-5",children:w("div",{className:"relative",children:[tt&&c("div",{"data-chat-input-header":!0,className:"bg-sidebar dark:bg-foreground/3 relative top-1 z-0 mx-[13px] -mb-[18px] flex min-w-0 items-center gap-2 overflow-hidden rounded-t-2xl px-1.5 pt-1.5 pb-[27px]",children:tt}),w(Lo,{attachmentPolicy:ft,value:P,revision:i.current.revision,onValueChange:B,onSubmittedClear:()=>{i.current={text:"",revision:i.current.revision+1},D(i.current)},attachments:A,onAttachmentsChange:(o)=>U(r.id,()=>o),children:[c(po,{bashMode:l!==void 0,handleRef:f,commands:r.commands,searchFiles:vt,onMention:q,onSearchError:k,forcedOpen:X,onForcedOpenChange:nt,emptyLabel:p("composer.noCommands"),fileStatusLabels:{loading:p("composer.searchingFiles"),empty:p("composer.noMatchingFiles")}}),w(wo,{"data-shell-mode":b||void 0,bashMode:l!==void 0,globalDrop:!0,multiple:!0,accept:Rt.join(","),onError:It,onSubmit:pt,onSubmitAsync:pt,onSubmitError:k,canSubmit:()=>h&&!M&&!H&&!V&&(!b||!K&&P.slice(1).trim().length>0)?!0:"chat_not_ready",className:"relative z-10",children:[ut,w(So,{className:"px-3 pt-3 pb-0 empty:hidden",children:[H&&c("span",{role:"status",className:"text-muted-foreground text-xs",children:p("composer.addingFiles")}),c(Fo,{mentions:u,onRemove:(o)=>z((m)=>m.filter((g)=>g!==o))}),c(uo,{children:(o)=>Ee(o)?c(Ao,{data:o,sessionId:r.id}):c(co,{data:o,t:p})})]}),w(ko,{className:"mb-0 min-h-16 px-3 pt-4 pb-2",onKeyDownCapture:(o)=>{if(!W.text||f.current?.isComposing()||o.nativeEvent.isComposing||o.nativeEvent.keyCode===229||o.shiftKey||o.ctrlKey||o.altKey||o.metaKey||o.target!==f.current?.getTextarea())return;if(o.key==="Tab")o.preventDefault(),o.stopPropagation(),B(W.text)},children:[b&&c("span",{"data-shell-prefix":!0,"aria-hidden":"true",className:"text-destructive self-start pt-0.5 text-sm",children:"❗"}),c(rn,{className:"min-h-10 bg-transparent text-sm font-normal",ref:f,rows:2,onKeyDown:bt,bashMode:l!==void 0,disabled:!N,onPasteCapture:lt?(o)=>Ut(o,r.id,p("composer.pastedTextFilename"),lt):void 0,placeholder:b?"! command":W.text||(K?p("composer.steerPlaceholder"):p("composer.placeholder")),"aria-label":p("composer.placeholder")})]}),c(_o,{className:"chat-composer-toolbar @container/input-footer mt-0 mb-2 w-full min-w-0 p-0",children:w("div",{className:"grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-[5px] px-2",children:[w("div",{className:"flex min-w-0 items-center gap-[5px]",children:[c(St,{className:"text-foreground",disabled:!N}),c(Co,{textareaRef:f,menuOpen:X,onOpenChange:nt,disabled:!h||r.commands.length===0}),c(Kt,{sessionId:r.id,options:r.configOptions,disabled:!h})]}),w(Po,{className:"w-full min-w-0 items-center justify-end gap-1",children:[c(Ot,{session:r}),I??c(Ht,{...L,sessionId:r.id,options:r.configOptions,disabled:!h}),dt,c(bo,{active:K,sending:M||et||H,ready:h&&!V&&(!b||!K&&P.slice(1).trim().length>0),hasMentions:u.length>0,onStop:wt})]})]})})]})]})]})})})}
2
+ export{Ft};
@@ -1,2 +1,2 @@
1
- import{x}from"./chunk-9tp0z23q.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as f,PopoverContent as b,PopoverTrigger as j}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function ze({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=x();return n(f,{open:m,onOpenChange:r,children:[o(j,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(b,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
1
+ import{x}from"./chunk-kwp1fere.js";import{EmojiPicker as t}from"frimousse";import{BoxIcon as u}from"lucide-react";import{useState as d}from"react";import{Button as g}from"@nyssance/shadcn/vega/components/ui/button";import{Popover as f,PopoverContent as b,PopoverTrigger as j}from"@nyssance/shadcn/vega/components/ui/popover";import{jsx as o,jsxs as n}from"react/jsx-runtime";function ze({emoji:s,onChange:l}){let[m,r]=d(!1),{t:a,i18n:c,emojibaseUrl:p}=x();return n(f,{open:m,onOpenChange:r,children:[o(j,{onClick:(e)=>e.stopPropagation(),onPointerDown:(e)=>e.stopPropagation(),render:o(g,{variant:"ghost",size:"icon-xs",className:"relative z-10","aria-label":a("collection.emoji"),children:s||o(u,{className:"size-3.5"})})}),o(b,{align:"start",className:"w-auto p-0",children:n(t.Root,{emojibaseUrl:p,locale:c.language==="zh-CN"?"zh":"en",className:"bg-popover flex h-80 w-72 flex-col",onEmojiSelect:({emoji:e})=>{l(e),r(!1)},children:[o(t.Search,{"aria-label":a("collection.emoji"),className:"focus-visible:border-ring mx-2 mt-2 flex h-8 rounded-md border bg-transparent px-2 text-sm outline-none"}),n(t.Viewport,{className:"relative flex-1 outline-none",children:[o(t.Loading,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",children:"…"}),o(t.Empty,{className:"text-muted-foreground absolute inset-0 flex items-center justify-center text-xs"}),o(t.List,{className:"pb-1.5 select-none",components:{CategoryHeader:({category:e,...i})=>o("div",{className:"bg-popover text-muted-foreground px-3 pt-3 pb-1.5 text-xs",...i,children:e.label}),Row:({children:e,...i})=>o("div",{className:"scroll-my-1.5 px-1.5",...i,children:e}),Emoji:({emoji:e,...i})=>o("button",{type:"button",className:"data-[active]:bg-accent flex size-8 items-center justify-center rounded-md text-lg",...i,children:e.emoji})}})]})]})})]})}
2
2
  export{ze};
@@ -1,2 +1,2 @@
1
- var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function sn(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function yo(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=sn(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
- export{sn,yo};
1
+ var z=/[\\/._\- ]/;function h(r,n){if(n===0)return!0;let s=r[n-1];if(z.test(s))return!0;let c=r[n];if(s===s.toLowerCase()&&c!==c.toLowerCase())return!0;return!1}function sn(r,n){if(!n)return{score:0,indices:[]};let s=r.toLowerCase(),c=n.toLowerCase(),i=[],t=0,e=0,u=-2;for(let l of c.split("")){let o=-1;while(t<s.length){if(s[t]===l){o=t;break}t++}if(o<0)return null;if(e+=1,o===u+1)e+=4;if(h(r,o))e+=5;let f=r.lastIndexOf("/");if(f!==-1&&o>f)e+=2;i.push(o),u=o,t=o+1}if(e-=Math.floor(r.length/50),r.includes(n))e+=3;return{score:e,indices:i}}function vo(r,n,s,c=100){if(!n)return r.slice(0,c).map((t)=>({item:t,score:0,indices:[]}));let i=[];for(let t of r){let e=sn(s(t),n);if(!e)continue;i.push({item:t,score:e.score,indices:e.indices})}return i.sort((t,e)=>e.score-t.score),i.slice(0,c)}
2
+ export{sn,vo};
@@ -1,2 +1,2 @@
1
- import{zo}from"./chunk-z3nybrbb.js";import{Ce,t,we,n,rt}from"./chunk-sz3vcbp5.js";import{Ci,nt,kn,Si,_i}from"./chunk-f1gj3yzt.js";import{ot}from"./chunk-gha517v4.js";import{ci}from"./chunk-4wa7tehh.js";import{si}from"./chunk-48fj5m0p.js";import{Yo,Xo}from"./chunk-ah4pgmqr.js";import{Fi,Di}from"./chunk-6trv0snh.js";import{qo}from"./chunk-dte0n4kf.js";import{li}from"./chunk-kc56dhwd.js";import{Wo}from"./chunk-658njfx1.js";import{Button as Q}from"@nyssance/shadcn/vega/components/ui/button";import{codexExtensionCapabilities as Le,codexMessageError as Me,codexRetryNotice as ze,codexTurnError as Ve,nativeTurnId as fe}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Be}from"lucide-react";import{useCallback as z,useEffect as E,useLayoutEffect as pe,useMemo as J,useRef as h,useState as U}from"react";import{flushSync as ge}from"react-dom";import{jsx as o,jsxs as A}from"react/jsx-runtime";var ve=24;function qe(e){let d=Math.max(0,e.turnTopPx-ve),g=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),s=d-g;return{scrollTopPx:d,spacerPx:s>0?e.spacerPx+s:e.spacerPx}}function Oe({viewportRef:e,viewportProps:d,children:g}){return o("div",{ref:e,...d,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:g})}function Fe({sessionId:e,turnId:d,root:g,error:s,connected:R}){let L=h(null),b=we(),{t:H}=t(),w=z(()=>{b.loadHistoryTurn(e,d).catch(()=>{})},[b,e,d]);return E(()=>{if(!g||!L.current||!R||s)return;let V=new IntersectionObserver((v)=>{if(v.some((S)=>S.isIntersecting))V.disconnect(),w()},{root:g,rootMargin:"800px 0px"});return V.observe(L.current),()=>V.disconnect()},[g,R,s,w]),o("div",{ref:L,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":d,"data-markdown-pending":!0,children:s?A("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:s}),o(Q,{variant:"outline",size:"sm",onClick:w,disabled:!R,children:H("timeline.navigationRetry")})]}):A("div",{role:"status","aria-label":H("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function Ke(e,d){let g=h([]),s=h(null);if(s.current?.items!==e.items||s.current.state!==e.state||s.current.ended!==e.turnEndedAt||s.current.usage!==e.turnUsage||s.current.historyOrder!==d)s.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:d,turns:Ci(e,g.current,d)};let R=s.current.turns;return g.current=R,R}function Je(e){return o(Ce,{host:e.host,client:e.client,children:o(Ue,{...e})})}function Ue({session:e,leading:d,afterTurn:g,answerActions:s,turnFooter:R,renderUserMessage:L,insert:b,navigation:H,anchorNewTurn:w=!1,Viewport:V=Oe}){let v=we(),S=t(),T=n((r)=>r.historyNavigation[e.id]),c=Ke(e,T?.turns),C=c.at(-1)?.key,Te=Si(e,c),y=e.state==="running"||e.state==="requires_action",_=J(()=>si(c,T),[c,T]),Y=J(()=>_.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[_]),ye=J(()=>H===void 0?[]:Yo(c,e.turnUsage,T),[H,c,e.turnUsage,T]),Z=b&&b.afterItemId!==null?c.findIndex((r)=>r.items.some((l)=>l.id===b.afterItemId)):-1,D=h(c);D.current=c;let[a,xe]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),he=n((r)=>Le(r.agent).sessionRetry),ee=x!==void 0;E(()=>{if(P&&ee&&!e.restoring)v.loadHistoryNavigation(e.id).catch(()=>{})},[v,P,ee,e.id,e.restoring]);let[be,Re]=U(!1),O=h(null),[Se,te]=U(!1),ne=h(0),j=h({key:C,running:y});j.current={key:C,running:y};let[re,F]=U(0),N=h(0),k=h(null);N.current=re;let Pe=z(()=>{if(k.current!==null)k.current.keepTop=!1},[]),{isFollowing:M,scrollToBottom:W,stopFollowing:B,schedulePin:ie,contentResized:oe,beginLocate:ae,cancelLocation:le}=li(a,y,Pe),ue=z(()=>{if(a===null||!y)return;let r=c.at(-1)?.key;if(r===void 0)return;let l=ae(!0),u=()=>l.isCurrent()&&j.current.running&&j.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!u())return;let p=a.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(p===null)return;let m=a.scrollTop+p.getBoundingClientRect().top-a.getBoundingClientRect().top,I=qe({turnTopPx:m,scrollHeightPx:a.scrollHeight,viewportHeightPx:a.clientHeight,spacerPx:N.current});k.current=I.spacerPx>0?{element:p,heightPx:p.getBoundingClientRect().height+I.spacerPx,keepTop:!0}:null,ge(()=>F(I.spacerPx)),requestAnimationFrame(()=>{if(u())l.finish(I.scrollTopPx)})})),f=O.current;if(f===null)return;f.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(u())i()})},[ae,y,a,c]);pe(()=>{if(!w||y)return;le(),k.current=null,N.current=0,F(0)},[w,le,y]);let X=z(()=>{B(),v.loadOlderHistory(e.id).catch(()=>{})},[v,e.id,B]);E(()=>{if(a===null)return;let r=()=>{let l=a.scrollTop<600;if(Re(l),l&&!T?.complete&&P&&!e.restoring&&!M&&x?.cursor&&!x.loading&&!x.error)X()};return r(),a.addEventListener("scroll",r,{passive:!0}),()=>a.removeEventListener("scroll",r)},[P,x,M,X,a,e.restoring,T?.complete]),E(()=>{Fi({sessionId:e.id,turns:Y,api:O.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Y,B]),E(()=>()=>Di(e.id),[e.id]);let Ie=z(async(r,l)=>{let u=++ne.current;te(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await v.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((m)=>requestAnimationFrame(()=>m()));if(!l())return null;let i=D.current.find((m)=>m.user?.id===(r.messageId??r.id))??D.current.find((m)=>m.user!==null&&r.nativeTurnId!==void 0&&m.items.some((I)=>fe(I)===r.nativeTurnId));if(!i?.user)return null;let f=i.user.id,p=O.current;if(p===null)throw Error("Virtual timeline is not mounted");return await p.scrollToKey(i.key,(m)=>m.querySelector(`[data-content-search-unit-key="${CSS.escape(f)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(f)}"]`)}finally{if(ne.current===u)te(!1)}},[v,e.id]),He=z(async(r)=>{if(r.nativeTurnId!==void 0)await v.previewHistoryTurn(e.id,r.nativeTurnId)},[v,e.id]);E(()=>{if(a===null)return;let r=a.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let l=new ResizeObserver(()=>{let u=k.current,i=null;if(u!==null){let f=Math.max(0,u.heightPx-u.element.getBoundingClientRect().height);if(f!==N.current&&(f<N.current||u.keepTop)){if(N.current=f,ge(()=>F(f)),f===0)k.current=null}if(f>0&&u.keepTop)i=a.scrollTop+u.element.getBoundingClientRect().top-a.getBoundingClientRect().top-ve}oe(i)});if(l.observe(r),l.observe(a),C!==void 0){let u=a.querySelector(`[data-codex-turn="${CSS.escape(C)}"]`);if(u===null)throw Error("Latest turn is not mounted");l.observe(u)}return()=>l.disconnect()},[oe,C,a]),E(()=>{if(e.items.length===0)return;ie()},[ie,e.items]);let se=h(null);pe(()=>{if(a===null)return;let r=c.at(-1),l=se.current;if(se.current=r===void 0?null:{key:r.key,running:y},r===void 0||l===null||r.user===null||r.replayed)return;if(w){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==l.key||!l.running))k.current=null,N.current=0,F(0),ue()}else if(r.key!==l.key)W()},[ue,w,y,W,a,e.turnEndedAt,c]);let Ne=(r,l)=>{let u=r,i=u.turn;if(i===void 0){if(u.nativeTurnId===void 0)throw Error(`Turn is missing at index ${l}`);return o(Fe,{sessionId:e.id,turnId:u.nativeTurnId,root:a,error:T?.turnErrors[u.nativeTurnId],connected:P&&!M&&!Se})}let f=c.indexOf(i),p=i.key===Te,m=_i(e,c,f),I=!p&&m.continued,K=i.key===C,q=i.errors.at(-1),ce=q===void 0?null:Me(q),G=q===void 0?null:fe(q),ke=!e.subagent&&K&&!p&&P&&he&&e.attached&&!e.readOnly&&!e.restoring&&q===e.items.at(-1)&&ce!==null&&Ve(ce).category==="overloaded"&&G!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",de=R?.(i)??null,Ee=i.work.length>0||i.final.length>0||i.errors.length>0||p||de!==null||nt(i)||kn(i)||K&&(e.error!==null||e.lastStopReason==="cancelled"),me=i.user===null?null:ot(i);return A("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(L===void 0?o(Wo,{item:i.user,messageTime:me}):L(i.user,me)),Ee&&o(ci,{sessionId:e.id,turn:i,terminals:e.terminals,active:p,blocked:e.state==="requires_action",continued:I,edits:m.edits,activityItems:m.items,workStartedAt:m.startedAt,isLast:K,error:e.error,retrying:p?ze(e._meta)??void 0:void 0,retry:ke?{turnId:G,delaySeconds:qo(c),run:(Ae)=>v.retrySession(e.id,G,Ae)}:void 0,interrupted:kn(i)||!p&&K&&e.lastStopReason==="cancelled",answerActions:s?.(i),footer:de}),l===Z&&b?.node,g?.(i)]})};return A("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(V,{viewportRef:xe,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":S.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:A("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[b&&Z===-1&&b.node,o(zo,{ref:O,entries:_,renderTurn:Ne,scrollElement:a,sessionKey:e.id,preserveViewport:!M,leadingInsetPx:12,leadingContent:d===void 0?void 0:o("div",{className:"pt-3",children:d})}),w&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:re}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(Q,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{v.loadHistoryNavigation(e.id).catch(()=>{})},children:S.t("timeline.navigationRetry")})}),be&&x?.cursor&&!T?.complete&&A("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(Q,{variant:"outline",size:"sm",disabled:!P||e.restoring||x.loading,onClick:X,children:x.loading?S.t("timeline.loadingEarlier"):S.t("timeline.loadEarlier")}),x.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),H!==void 0&&o(Xo,{items:ye,audio:H.audio,scrollRoot:a,beforeReveal:B,ensureItemMounted:Ie,onPreviewItem:He,onRevealError:(r)=>rt(S,r),targetTopMarginPx:16},e.id),o("button",{type:"button",className:M?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:M?-1:void 0,onClick:W,"aria-label":S.t("timeline.scrollToBottom"),children:y?A("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Be,{})})]})}
1
+ import{Vo}from"./chunk-n8yww1mr.js";import{we,t,ke,n,rt}from"./chunk-zyvvk8b2.js";import{Ci,nt,kn,Si,_i}from"./chunk-qn2jfxff.js";import{ot}from"./chunk-gha517v4.js";import{Wo}from"./chunk-r4vfytjv.js";import{Pi}from"./chunk-vr0dfq9w.js";import{di,ui}from"./chunk-ef99py8a.js";import{Di,Hi}from"./chunk-qqqcqvrv.js";import{ti}from"./chunk-h09ez7fc.js";import{Ti}from"./chunk-f7ggbprz.js";import{ri}from"./chunk-9jep8zjg.js";import{Button as Q}from"@nyssance/shadcn/vega/components/ui/button";import{codexExtensionCapabilities as Ce,codexMessageError as Me,codexRetryNotice as ze,codexTurnError as Ve,nativeTurnId as fe}from"@nyssance/codex-acp-v2/client";import{ArrowDownIcon as Be}from"lucide-react";import{useCallback as z,useEffect as E,useLayoutEffect as pe,useMemo as J,useRef as h,useState as U}from"react";import{flushSync as ge}from"react-dom";import{jsx as o,jsxs as A}from"react/jsx-runtime";var ve=24;function qe(e){let d=Math.max(0,e.turnTopPx-ve),g=Math.max(0,e.scrollHeightPx-e.viewportHeightPx),s=d-g;return{scrollTopPx:d,spacerPx:s>0?e.spacerPx+s:e.spacerPx}}function Oe({viewportRef:e,viewportProps:d,children:g}){return o("div",{ref:e,...d,className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain outline-none",children:g})}function Fe({sessionId:e,turnId:d,root:g,error:s,connected:R}){let L=h(null),b=ke(),{t:H}=t(),w=z(()=>{b.loadHistoryTurn(e,d).catch(()=>{})},[b,e,d]);return E(()=>{if(!g||!L.current||!R||s)return;let V=new IntersectionObserver((v)=>{if(v.some((S)=>S.isIntersecting))V.disconnect(),w()},{root:g,rootMargin:"800px 0px"});return V.observe(L.current),()=>V.disconnect()},[g,R,s,w]),o("div",{ref:L,className:"flex min-h-80 flex-col justify-center gap-3 py-8","data-history-turn":d,"data-markdown-pending":!0,children:s?A("div",{className:"flex flex-col items-center gap-2",children:[o("p",{role:"alert",className:"text-destructive text-xs",children:s}),o(Q,{variant:"outline",size:"sm",onClick:w,disabled:!R,children:H("timeline.navigationRetry")})]}):A("div",{role:"status","aria-label":H("timeline.navigationLoading"),className:"space-y-3",children:[o("div",{className:"bg-muted ml-auto h-5 w-1/3 rounded"}),o("div",{className:"bg-muted h-3 w-4/5 rounded"}),o("div",{className:"bg-muted h-3 w-3/5 rounded"})]})})}function Ke(e,d){let g=h([]),s=h(null);if(s.current?.items!==e.items||s.current.state!==e.state||s.current.ended!==e.turnEndedAt||s.current.usage!==e.turnUsage||s.current.historyOrder!==d)s.current={state:e.state,items:e.items,ended:e.turnEndedAt,usage:e.turnUsage,historyOrder:d,turns:Ci(e,g.current,d)};let R=s.current.turns;return g.current=R,R}function Je(e){return o(we,{host:e.host,client:e.client,children:o(Ue,{...e})})}function Ue({session:e,leading:d,afterTurn:g,answerActions:s,turnFooter:R,renderUserMessage:L,insert:b,navigation:H,anchorNewTurn:w=!1,Viewport:V=Oe}){let v=ke(),S=t(),T=n((r)=>r.historyNavigation[e.id]),c=Ke(e,T?.turns),C=c.at(-1)?.key,Te=Si(e,c),y=e.state==="running"||e.state==="requires_action",_=J(()=>Pi(c,T),[c,T]),Y=J(()=>_.flatMap((r)=>r.turn===void 0?[]:[{...r.turn,key:r.turnKey}]),[_]),ye=J(()=>H===void 0?[]:di(c,e.turnUsage,T),[H,c,e.turnUsage,T]),Z=b&&b.afterItemId!==null?c.findIndex((r)=>r.items.some((l)=>l.id===b.afterItemId)):-1,D=h(c);D.current=c;let[a,xe]=U(null),x=n((r)=>r.historyPages[e.id]),P=n((r)=>r.connection==="ready"),he=n((r)=>Ce(r.agent).sessionRetry),ee=x!==void 0;E(()=>{if(P&&ee&&!e.restoring)v.loadHistoryNavigation(e.id).catch(()=>{})},[v,P,ee,e.id,e.restoring]);let[be,Re]=U(!1),O=h(null),[Se,te]=U(!1),ne=h(0),j=h({key:C,running:y});j.current={key:C,running:y};let[re,F]=U(0),N=h(0),k=h(null);N.current=re;let Pe=z(()=>{if(k.current!==null)k.current.keepTop=!1},[]),{isFollowing:M,scrollToBottom:W,stopFollowing:B,schedulePin:ie,contentResized:oe,beginLocate:ae,cancelLocation:le}=Ti(a,y,Pe),ue=z(()=>{if(a===null||!y)return;let r=c.at(-1)?.key;if(r===void 0)return;let l=ae(!0),u=()=>l.isCurrent()&&j.current.running&&j.current.key===r,i=()=>requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!u())return;let p=a.querySelector(`[data-codex-turn="${CSS.escape(r)}"]`);if(p===null)return;let m=a.scrollTop+p.getBoundingClientRect().top-a.getBoundingClientRect().top,I=qe({turnTopPx:m,scrollHeightPx:a.scrollHeight,viewportHeightPx:a.clientHeight,spacerPx:N.current});k.current=I.spacerPx>0?{element:p,heightPx:p.getBoundingClientRect().height+I.spacerPx,keepTop:!0}:null,ge(()=>F(I.spacerPx)),requestAnimationFrame(()=>{if(u())l.finish(I.scrollTopPx)})})),f=O.current;if(f===null)return;f.scrollToKey(r,void 0,{align:"top"}).then(()=>{if(u())i()})},[ae,y,a,c]);pe(()=>{if(!w||y)return;le(),k.current=null,N.current=0,F(0)},[w,le,y]);let X=z(()=>{B(),v.loadOlderHistory(e.id).catch(()=>{})},[v,e.id,B]);E(()=>{if(a===null)return;let r=()=>{let l=a.scrollTop<600;if(Re(l),l&&!T?.complete&&P&&!e.restoring&&!M&&x?.cursor&&!x.loading&&!x.error)X()};return r(),a.addEventListener("scroll",r,{passive:!0}),()=>a.removeEventListener("scroll",r)},[P,x,M,X,a,e.restoring,T?.complete]),E(()=>{Di({sessionId:e.id,turns:Y,api:O.current,beforeReveal:B,terminals:e.terminals})},[e.id,e.terminals,Y,B]),E(()=>()=>Hi(e.id),[e.id]);let Ie=z(async(r,l)=>{let u=++ne.current;te(!0);try{if(r.isLoaded===!1&&r.nativeTurnId!==void 0)await v.loadHistoryTurn(e.id,r.nativeTurnId),await new Promise((m)=>requestAnimationFrame(()=>m()));if(!l())return null;let i=D.current.find((m)=>m.user?.id===(r.messageId??r.id))??D.current.find((m)=>m.user!==null&&r.nativeTurnId!==void 0&&m.items.some((I)=>fe(I)===r.nativeTurnId));if(!i?.user)return null;let f=i.user.id,p=O.current;if(p===null)throw Error("Virtual timeline is not mounted");return await p.scrollToKey(i.key,(m)=>m.querySelector(`[data-content-search-unit-key="${CSS.escape(f)}"]`),{align:"top"}),document.querySelector(`[data-chat-scroll] [data-content-search-unit-key="${CSS.escape(f)}"]`)}finally{if(ne.current===u)te(!1)}},[v,e.id]),He=z(async(r)=>{if(r.nativeTurnId!==void 0)await v.previewHistoryTurn(e.id,r.nativeTurnId)},[v,e.id]);E(()=>{if(a===null)return;let r=a.querySelector("[data-codex-timeline]");if(r===null)throw Error("Timeline content element is missing");let l=new ResizeObserver(()=>{let u=k.current,i=null;if(u!==null){let f=Math.max(0,u.heightPx-u.element.getBoundingClientRect().height);if(f!==N.current&&(f<N.current||u.keepTop)){if(N.current=f,ge(()=>F(f)),f===0)k.current=null}if(f>0&&u.keepTop)i=a.scrollTop+u.element.getBoundingClientRect().top-a.getBoundingClientRect().top-ve}oe(i)});if(l.observe(r),l.observe(a),C!==void 0){let u=a.querySelector(`[data-codex-turn="${CSS.escape(C)}"]`);if(u===null)throw Error("Latest turn is not mounted");l.observe(u)}return()=>l.disconnect()},[oe,C,a]),E(()=>{if(e.items.length===0)return;ie()},[ie,e.items]);let se=h(null);pe(()=>{if(a===null)return;let r=c.at(-1),l=se.current;if(se.current=r===void 0?null:{key:r.key,running:y},r===void 0||l===null||r.user===null||r.replayed)return;if(w){if(y&&e.turnEndedAt[r.user.id]===void 0&&(r.key!==l.key||!l.running))k.current=null,N.current=0,F(0),ue()}else if(r.key!==l.key)W()},[ue,w,y,W,a,e.turnEndedAt,c]);let Ne=(r,l)=>{let u=r,i=u.turn;if(i===void 0){if(u.nativeTurnId===void 0)throw Error(`Turn is missing at index ${l}`);return o(Fe,{sessionId:e.id,turnId:u.nativeTurnId,root:a,error:T?.turnErrors[u.nativeTurnId],connected:P&&!M&&!Se})}let f=c.indexOf(i),p=i.key===Te,m=_i(e,c,f),I=!p&&m.continued,K=i.key===C,q=i.errors.at(-1),ce=q===void 0?null:Me(q),G=q===void 0?null:fe(q),Ee=!e.subagent&&K&&!p&&P&&he&&e.attached&&!e.readOnly&&!e.restoring&&q===e.items.at(-1)&&ce!==null&&Ve(ce).category==="overloaded"&&G!==null&&e.lastStopReason!=="end_turn"&&e.lastStopReason!=="cancelled",de=R?.(i)??null,Ae=i.work.length>0||i.final.length>0||i.errors.length>0||p||de!==null||nt(i)||kn(i)||K&&(e.error!==null||e.lastStopReason==="cancelled"),me=i.user===null?null:ot(i);return A("div",{"data-virtualized-turn-content":!0,"data-codex-turn":i.key,className:"flex flex-col gap-1.5",children:[i.user!==null&&(L===void 0?o(ri,{item:i.user,messageTime:me}):L(i.user,me)),Ae&&o(Wo,{sessionId:e.id,turn:i,terminals:e.terminals,active:p,blocked:e.state==="requires_action",continued:I,edits:m.edits,activityItems:m.items,workStartedAt:m.startedAt,isLast:K,error:e.error,retrying:p?ze(e._meta)??void 0:void 0,retry:Ee?{turnId:G,delaySeconds:ti(c),run:(Le)=>v.retrySession(e.id,G,Le)}:void 0,interrupted:kn(i)||!p&&K&&e.lastStopReason==="cancelled",answerActions:s?.(i),footer:de}),l===Z&&b?.node,g?.(i)]})};return A("div",{className:"relative flex min-h-0 flex-1 flex-col","data-stream-style":"codexUI",children:[o(V,{viewportRef:xe,viewportProps:{"data-chat-scroll":"",style:{overflowAnchor:"none"},tabIndex:0,role:"log","aria-label":S.t("timeline.label")},children:o("div",{className:"codex-timeline-content flex min-h-full w-full flex-col",children:A("div",{"data-timeline-user-message-navigation-content":!0,className:"mx-auto flex w-full max-w-3xl shrink-0 flex-col",children:[b&&Z===-1&&b.node,o(Vo,{ref:O,entries:_,renderTurn:Ne,scrollElement:a,sessionKey:e.id,preserveViewport:!M,leadingInsetPx:12,leadingContent:d===void 0?void 0:o("div",{className:"pt-3",children:d})}),w&&o("div",{"aria-hidden":"true","data-turn-anchor-spacer":!0,className:"shrink-0",style:{height:re}}),o("div",{"aria-hidden":"true",className:"h-6 shrink-0"})]})})}),o("div",{"aria-hidden":"true",className:"codex-timeline-bottom-fade"}),T?.error&&o("div",{className:"absolute inset-x-0 top-2 z-10 flex justify-center",children:o(Q,{variant:"outline",size:"sm",disabled:!P,title:T.error,onClick:()=>{v.loadHistoryNavigation(e.id).catch(()=>{})},children:S.t("timeline.navigationRetry")})}),be&&x?.cursor&&!T?.complete&&A("div",{className:"absolute inset-x-0 top-2 z-10 flex flex-col items-center gap-1","data-history-loader":!0,children:[o(Q,{variant:"outline",size:"sm",disabled:!P||e.restoring||x.loading,onClick:X,children:x.loading?S.t("timeline.loadingEarlier"):S.t("timeline.loadEarlier")}),x.error&&o("p",{role:"alert",className:"bg-background text-destructive max-w-md rounded px-2 py-1 text-xs",children:x.error})]}),H!==void 0&&o(ui,{items:ye,audio:H.audio,scrollRoot:a,beforeReveal:B,ensureItemMounted:Ie,onPreviewItem:He,onRevealError:(r)=>rt(S,r),targetTopMarginPx:16},e.id),o("button",{type:"button",className:M?"codex-scroll-to-bottom codex-scroll-to-bottom-hidden":"codex-scroll-to-bottom",tabIndex:M?-1:void 0,onClick:W,"aria-label":S.t("timeline.scrollToBottom"),children:y?A("span",{className:"codex-scroll-to-bottom-dots","aria-hidden":"true",children:[o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"}),o("span",{className:"codex-wave-dot"})]}):o(Be,{})})]})}
2
2
  export{Je};