@alwith/module-chat 0.6.35 → 0.6.36

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 (395) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/agent/client.js +1 -1
  3. package/dist/agent/fork-title.js +1 -1
  4. package/dist/agent/image-request.js +1 -1
  5. package/dist/agent/image-tools.js +1 -1
  6. package/dist/agent/input-config.js +1 -1
  7. package/dist/agent/input-modes/chat.js +1 -1
  8. package/dist/agent/input-modes/execution-meta.js +1 -1
  9. package/dist/agent/input-modes/image.js +1 -1
  10. package/dist/agent/input-modes/index.js +1 -1
  11. package/dist/agent/project-path.js +1 -1
  12. package/dist/agent/request-error.js +1 -1
  13. package/dist/agent/session-list-refresh.js +1 -1
  14. package/dist/app-reference.js +1 -1
  15. package/dist/application-tools.js +1 -1
  16. package/dist/approval/choice-elicitation-form.js +1 -1
  17. package/dist/approval/choice-schema.js +1 -1
  18. package/dist/approval/permission-options.js +1 -1
  19. package/dist/approval/permission-view.js +1 -1
  20. package/dist/approval/schema-elicitation-form.js +1 -1
  21. package/dist/approval/url-elicitation-card.js +1 -1
  22. package/dist/{chunk-rntrfb49.js → chunk-05n5eyp9.js} +2 -2
  23. package/dist/{chunk-th5vv83g.js → chunk-0ck2zpaa.js} +2 -2
  24. package/dist/{chunk-eevfr0tx.js → chunk-0kpapqak.js} +2 -2
  25. package/dist/{chunk-enkrqfqq.js → chunk-0qrd3jvc.js} +1 -1
  26. package/dist/{chunk-3sq2k9ca.js → chunk-0xgnhbn4.js} +2 -2
  27. package/dist/{chunk-95f0wens.js → chunk-13jj645z.js} +1 -1
  28. package/dist/{chunk-zjzzqtaj.js → chunk-13sxt6bc.js} +2 -2
  29. package/dist/{chunk-whax282d.js → chunk-1byvdggd.js} +2 -2
  30. package/dist/{chunk-epqqzh99.js → chunk-1dtg361q.js} +2 -2
  31. package/dist/chunk-1rfxfqek.js +2 -0
  32. package/dist/{chunk-qvzxzzw8.js → chunk-21mp4gww.js} +2 -2
  33. package/dist/{chunk-gy446wcz.js → chunk-22teksk6.js} +2 -2
  34. package/dist/{chunk-b8tx1n1a.js → chunk-268b0xhk.js} +1 -1
  35. package/dist/{chunk-2nv5ebq1.js → chunk-27s3z9q6.js} +2 -2
  36. package/dist/{chunk-rms7wj04.js → chunk-2bsxqh9p.js} +2 -2
  37. package/dist/{chunk-8be6eq9r.js → chunk-2kb4rtw7.js} +2 -2
  38. package/dist/{chunk-hfjttc7r.js → chunk-2segzfjp.js} +2 -2
  39. package/dist/{chunk-vyvsm4v9.js → chunk-3q3n1n1m.js} +2 -2
  40. package/dist/{chunk-pnx0f495.js → chunk-41yp708e.js} +2 -2
  41. package/dist/{chunk-8pb726d6.js → chunk-467091s6.js} +2 -2
  42. package/dist/{chunk-prr551k0.js → chunk-4ezsy9sc.js} +1 -1
  43. package/dist/{chunk-bt42z99s.js → chunk-4t2a903d.js} +2 -2
  44. package/dist/{chunk-7tgfj1zb.js → chunk-514abcnn.js} +2 -2
  45. package/dist/{chunk-wrxj79ct.js → chunk-5axg9jdz.js} +2 -2
  46. package/dist/{chunk-pvm6d77q.js → chunk-5k46n3e8.js} +2 -2
  47. package/dist/{chunk-7naym98x.js → chunk-5t2e22f6.js} +2 -2
  48. package/dist/{chunk-rb6mjycp.js → chunk-61bnywk9.js} +2 -2
  49. package/dist/chunk-62qf6t7x.js +2 -0
  50. package/dist/{chunk-0xztk729.js → chunk-68w4f5q0.js} +2 -2
  51. package/dist/{chunk-d0zazfrq.js → chunk-6e952n0r.js} +2 -2
  52. package/dist/{chunk-hwhyyaen.js → chunk-6kvrdgjn.js} +2 -2
  53. package/dist/{chunk-z53fd30n.js → chunk-6m7bnj0g.js} +2 -2
  54. package/dist/{chunk-eyw05qyj.js → chunk-6ve41ce0.js} +3 -3
  55. package/dist/chunk-6w7js8qd.js +2 -0
  56. package/dist/{chunk-qbpy0aqe.js → chunk-6wstx1k6.js} +2 -2
  57. package/dist/{chunk-r2b234a7.js → chunk-7a3q5976.js} +2 -2
  58. package/dist/{chunk-mgwkmr8g.js → chunk-7ecymeg2.js} +1 -1
  59. package/dist/{chunk-9nz4c647.js → chunk-7nfbzajq.js} +2 -2
  60. package/dist/{chunk-b0zzq2ky.js → chunk-7pfkx9a2.js} +2 -2
  61. package/dist/{chunk-8x7a5n2w.js → chunk-7rdf7eeh.js} +2 -2
  62. package/dist/{chunk-k1w3acq7.js → chunk-7vhhtb2a.js} +2 -2
  63. package/dist/{chunk-p2bn8ypc.js → chunk-80nnn15f.js} +1 -1
  64. package/dist/{chunk-sfd0pp49.js → chunk-81ka3rnv.js} +3 -3
  65. package/dist/{chunk-3t3n8nfy.js → chunk-82apcrn6.js} +2 -2
  66. package/dist/{chunk-ccner90h.js → chunk-82ytwr57.js} +2 -2
  67. package/dist/{chunk-d84xx4bh.js → chunk-85yqchzc.js} +2 -2
  68. package/dist/chunk-89jwjv3m.js +2 -0
  69. package/dist/{chunk-qgrd5xre.js → chunk-8e9h60we.js} +2 -2
  70. package/dist/{chunk-fvmnj6bg.js → chunk-8fzg0pmc.js} +2 -2
  71. package/dist/{chunk-fzfwftqs.js → chunk-8ncatcr7.js} +2 -2
  72. package/dist/{chunk-xjf2zkrg.js → chunk-8p2b77ta.js} +2 -2
  73. package/dist/{chunk-e99t3sk5.js → chunk-94fwccyb.js} +2 -2
  74. package/dist/{chunk-ymdhz3x0.js → chunk-986yknqs.js} +2 -2
  75. package/dist/chunk-98k8jwbn.js +2 -0
  76. package/dist/{chunk-ztrkk6sp.js → chunk-9v4r1cr6.js} +2 -2
  77. package/dist/{chunk-y72y3j24.js → chunk-a779rnge.js} +2 -2
  78. package/dist/{chunk-vq060dnz.js → chunk-a9mbtd12.js} +2 -2
  79. package/dist/{chunk-ytkcpeq2.js → chunk-abt670s7.js} +1 -1
  80. package/dist/{chunk-s170cg6j.js → chunk-b1yfr8gv.js} +2 -2
  81. package/dist/{chunk-aj0z9a5r.js → chunk-bb2s9nb6.js} +2 -2
  82. package/dist/{chunk-q2ykvjrz.js → chunk-beraaxpx.js} +2 -2
  83. package/dist/{chunk-j1t1fnew.js → chunk-bz890a7b.js} +2 -2
  84. package/dist/{chunk-ck70ewc8.js → chunk-ca7kgbwx.js} +1 -1
  85. package/dist/{chunk-npt6at4f.js → chunk-ckgww50b.js} +2 -2
  86. package/dist/{chunk-cgpnhrm5.js → chunk-cn9hc5xr.js} +3 -3
  87. package/dist/{chunk-ha1s3jbc.js → chunk-d564jqyw.js} +3 -3
  88. package/dist/{chunk-epqyjwrh.js → chunk-dhj0vkek.js} +2 -2
  89. package/dist/{chunk-d607659a.js → chunk-dqyfe90s.js} +2 -2
  90. package/dist/{chunk-mkawbqx5.js → chunk-dvaxrrss.js} +2 -2
  91. package/dist/{chunk-qkddvxjr.js → chunk-dxjwdfra.js} +1 -1
  92. package/dist/{chunk-qvdfrmpb.js → chunk-epqzypsa.js} +2 -2
  93. package/dist/{chunk-54jfqcd1.js → chunk-etnfpzpv.js} +2 -2
  94. package/dist/{chunk-fqchnswc.js → chunk-f4dz7xen.js} +1 -1
  95. package/dist/{chunk-23kvszfc.js → chunk-f6wp23k0.js} +1 -1
  96. package/dist/{chunk-dhx1sd4s.js → chunk-f6y0xqz9.js} +2 -2
  97. package/dist/{chunk-6xap6hvz.js → chunk-fe83mqnb.js} +2 -2
  98. package/dist/{chunk-veef1avy.js → chunk-fg7za6sb.js} +2 -2
  99. package/dist/{chunk-ged1nyhk.js → chunk-fkzvbhfw.js} +3 -3
  100. package/dist/{chunk-nfnejf16.js → chunk-fm35s6dq.js} +2 -2
  101. package/dist/{chunk-9ghxym50.js → chunk-ft9b1d3f.js} +1 -1
  102. package/dist/chunk-fwejeh0a.js +2 -0
  103. package/dist/{chunk-njw6x85v.js → chunk-g2pjvjym.js} +2 -2
  104. package/dist/{chunk-jtws1jg5.js → chunk-g31pwmy2.js} +2 -2
  105. package/dist/{chunk-1vwece23.js → chunk-g551brtp.js} +3 -3
  106. package/dist/{chunk-s1w3j9p9.js → chunk-gq2gckvv.js} +2 -2
  107. package/dist/chunk-gxn9pp4b.js +2 -0
  108. package/dist/{chunk-ppcwcrdz.js → chunk-gxvkgcs0.js} +2 -2
  109. package/dist/{chunk-y8aeahf2.js → chunk-h12xxave.js} +2 -2
  110. package/dist/{chunk-pxbww0j1.js → chunk-hd5zm7tc.js} +2 -2
  111. package/dist/chunk-hdksy68d.js +2 -0
  112. package/dist/{chunk-q8c4k6qh.js → chunk-hqfmwbq5.js} +2 -2
  113. package/dist/{chunk-9hts7x5n.js → chunk-hwccdg3k.js} +2 -2
  114. package/dist/{chunk-gk7nn747.js → chunk-hxstf6c4.js} +2 -2
  115. package/dist/{chunk-7ywnza68.js → chunk-j14fa32z.js} +2 -2
  116. package/dist/{chunk-aj6yxm6d.js → chunk-jfp8yj9p.js} +2 -2
  117. package/dist/{chunk-0sb0c014.js → chunk-jj0bpzkq.js} +2 -2
  118. package/dist/{chunk-60yk0ye9.js → chunk-jmanx88h.js} +2 -2
  119. package/dist/{chunk-ebkz1sy2.js → chunk-jpzjh400.js} +2 -2
  120. package/dist/{chunk-n4rep234.js → chunk-jra95vzv.js} +2 -2
  121. package/dist/{chunk-6br4568a.js → chunk-jreyzbd6.js} +2 -2
  122. package/dist/{chunk-db8hae9d.js → chunk-jsnt49t5.js} +2 -2
  123. package/dist/chunk-jyrpyjt3.js +2 -0
  124. package/dist/{chunk-jne0bc79.js → chunk-k7dp9ead.js} +2 -2
  125. package/dist/{chunk-sk9rm826.js → chunk-keh9cbwe.js} +1 -1
  126. package/dist/{chunk-b6kn9ack.js → chunk-keyttjc9.js} +2 -2
  127. package/dist/{chunk-ddaz4j9s.js → chunk-kg363yzh.js} +2 -2
  128. package/dist/{chunk-482segb0.js → chunk-kv22b8h2.js} +2 -2
  129. package/dist/chunk-kvmd0mhe.js +2 -0
  130. package/dist/{chunk-22nybrkv.js → chunk-m31z2z11.js} +3 -3
  131. package/dist/{chunk-g9v0jr0f.js → chunk-m9b9dzjh.js} +3 -3
  132. package/dist/{chunk-y5qzgfsd.js → chunk-md3d3pby.js} +2 -2
  133. package/dist/{chunk-hqc5c3nz.js → chunk-mf3dn22w.js} +3 -3
  134. package/dist/chunk-mnktrf2v.js +2 -0
  135. package/dist/{chunk-5mxh7h57.js → chunk-mphkyhy8.js} +2 -2
  136. package/dist/{chunk-2nq204hz.js → chunk-mqdbs8jj.js} +2 -2
  137. package/dist/{chunk-jz7mckdp.js → chunk-mywbsrxq.js} +2 -2
  138. package/dist/{chunk-kgx0jj22.js → chunk-n4rapj4e.js} +3 -3
  139. package/dist/{chunk-bdea3k6b.js → chunk-nd0d4qr4.js} +2 -2
  140. package/dist/{chunk-w2p1g8rp.js → chunk-njrvhvy4.js} +2 -2
  141. package/dist/{chunk-nebke41s.js → chunk-nrt1zx5c.js} +2 -2
  142. package/dist/{chunk-5zf3px9y.js → chunk-nxfwgbny.js} +2 -2
  143. package/dist/{chunk-dzncwejn.js → chunk-nypm3ef8.js} +2 -2
  144. package/dist/{chunk-gmns080g.js → chunk-q54ca1am.js} +2 -2
  145. package/dist/{chunk-1b3frq9c.js → chunk-q8mw16nx.js} +3 -3
  146. package/dist/chunk-qa29z7wk.js +4 -0
  147. package/dist/{chunk-k0h18sme.js → chunk-qp4b32gm.js} +2 -2
  148. package/dist/{chunk-symaxskd.js → chunk-qt4gdwcw.js} +2 -2
  149. package/dist/{chunk-3kytka7m.js → chunk-r14byyqy.js} +3 -3
  150. package/dist/{chunk-5qaa4atv.js → chunk-r7tpt9zy.js} +2 -2
  151. package/dist/{chunk-b3mja7d9.js → chunk-rcj2df96.js} +2 -2
  152. package/dist/{chunk-8eyw37rv.js → chunk-re9ryzrv.js} +2 -2
  153. package/dist/{chunk-ygake3bx.js → chunk-rf8agwdk.js} +2 -2
  154. package/dist/{chunk-rcynxrkk.js → chunk-rgsf9xkw.js} +3 -3
  155. package/dist/chunk-rkqptd9w.js +2 -0
  156. package/dist/{chunk-t6ddgvkm.js → chunk-rmdf5jhd.js} +2 -2
  157. package/dist/{chunk-jygp7479.js → chunk-rp7qt6hm.js} +2 -2
  158. package/dist/chunk-rp87rhya.js +4 -0
  159. package/dist/{chunk-w4537026.js → chunk-rq4nw301.js} +1 -1
  160. package/dist/{chunk-7nfv27hz.js → chunk-s15zgqkg.js} +2 -2
  161. package/dist/{chunk-fggwwmzc.js → chunk-s7396jw0.js} +3 -3
  162. package/dist/{chunk-xqrhfxct.js → chunk-s953r0cw.js} +2 -2
  163. package/dist/chunk-sbcgvk9a.js +2 -0
  164. package/dist/{chunk-bm457bsd.js → chunk-sd6sd4r8.js} +2 -2
  165. package/dist/{chunk-6v0r7m92.js → chunk-sjh2sz62.js} +2 -2
  166. package/dist/{chunk-9ns2xh84.js → chunk-ssrhst9t.js} +2 -2
  167. package/dist/{chunk-q8y2a23c.js → chunk-tdmz20zc.js} +2 -2
  168. package/dist/{chunk-wf4z9w5x.js → chunk-tfkz3bae.js} +2 -2
  169. package/dist/{chunk-s11mgwyh.js → chunk-va5f2mdb.js} +2 -2
  170. package/dist/{chunk-ry5phnnk.js → chunk-vc6yxjs3.js} +2 -2
  171. package/dist/{chunk-bysgsnph.js → chunk-vn7159fh.js} +2 -2
  172. package/dist/{chunk-gw4zbw0m.js → chunk-w1ndngnh.js} +2 -2
  173. package/dist/{chunk-mg9a4t04.js → chunk-w86ckd6d.js} +2 -2
  174. package/dist/{chunk-shzj5zf0.js → chunk-w9z2zezn.js} +2 -2
  175. package/dist/{chunk-20dc4fm0.js → chunk-wf5tt5t4.js} +2 -2
  176. package/dist/{chunk-c0czkyzh.js → chunk-wrqmbvv2.js} +2 -2
  177. package/dist/{chunk-6ea6q6dj.js → chunk-wv501ppg.js} +1 -1
  178. package/dist/{chunk-mgve4dcw.js → chunk-ww4tmz88.js} +2 -2
  179. package/dist/{chunk-h71pkpwg.js → chunk-wy7rkpqe.js} +2 -2
  180. package/dist/{chunk-1a46v4cy.js → chunk-x0m0ebq0.js} +1 -1
  181. package/dist/{chunk-4g2412p5.js → chunk-x2xwfwcx.js} +2 -2
  182. package/dist/{chunk-aq3hemsb.js → chunk-x8j184pq.js} +3 -3
  183. package/dist/chunk-xb28q0sm.js +2 -0
  184. package/dist/{chunk-a4ebhcsy.js → chunk-xkv1qwkh.js} +2 -2
  185. package/dist/{chunk-qbmgsd3h.js → chunk-xvf85xre.js} +2 -2
  186. package/dist/chunk-xxaj040w.js +2 -0
  187. package/dist/{chunk-rxj5619b.js → chunk-y6ac70r7.js} +2 -2
  188. package/dist/{chunk-xanfp0nh.js → chunk-y6b3mjjn.js} +1 -1
  189. package/dist/{chunk-9hwqfjc1.js → chunk-ya8e4rt0.js} +2 -2
  190. package/dist/{chunk-aeccrrg1.js → chunk-yde0ncgz.js} +1 -1
  191. package/dist/{chunk-nvadhyne.js → chunk-yekcndnq.js} +2 -2
  192. package/dist/{chunk-8yetzgqb.js → chunk-yn6pz38m.js} +2 -2
  193. package/dist/{chunk-vjfxm73q.js → chunk-yqzpxk5y.js} +2 -2
  194. package/dist/{chunk-aemtk0r5.js → chunk-z26j4tt7.js} +2 -2
  195. package/dist/{chunk-359pf448.js → chunk-z29anjt1.js} +2 -2
  196. package/dist/{chunk-rbs3079t.js → chunk-z6swkqb1.js} +2 -2
  197. package/dist/{chunk-wf0ytnh9.js → chunk-zetd8vk4.js} +1 -1
  198. package/dist/{chunk-k5065dzv.js → chunk-zsd44z1c.js} +2 -2
  199. package/dist/{chunk-z27pxeqg.js → chunk-zssbsc1f.js} +2 -2
  200. package/dist/{chunk-18gcnf2a.js → chunk-zxa4jnpe.js} +2 -2
  201. package/dist/{chunk-tj4b0s68.js → chunk-zz582m73.js} +2 -2
  202. package/dist/client.js +1 -1
  203. package/dist/codex/activity-group.js +1 -1
  204. package/dist/codex/artifact-links.js +1 -1
  205. package/dist/codex/assistant-message.js +1 -1
  206. package/dist/codex/async-question-card.js +1 -1
  207. package/dist/codex/edited-files-card.js +1 -1
  208. package/dist/codex/image-view-activity.js +1 -1
  209. package/dist/codex/markdown-renderer.js +1 -1
  210. package/dist/codex/navigation-audio.js +1 -1
  211. package/dist/codex/navigation-preview.js +1 -1
  212. package/dist/codex/navigation-rail.js +1 -1
  213. package/dist/codex/patch-view.js +1 -1
  214. package/dist/codex/timeline-virtualizer.js +1 -1
  215. package/dist/codex/turn-activity.js +1 -1
  216. package/dist/codex/user-message.js +1 -1
  217. package/dist/codex/virtualized-turn-list.js +1 -1
  218. package/dist/collections/collection-emoji.js +1 -1
  219. package/dist/collections/collection-menu.js +1 -1
  220. package/dist/collections/collection-panel.js +1 -1
  221. package/dist/collections/collections.js +1 -1
  222. package/dist/collections/host.js +1 -1
  223. package/dist/collections/model.js +1 -1
  224. package/dist/collections/store.js +1 -1
  225. package/dist/composer/completion-filter.js +1 -1
  226. package/dist/composer/completion-menu.js +1 -1
  227. package/dist/composer/completion-trigger.js +1 -1
  228. package/dist/composer/effort-slider.js +1 -1
  229. package/dist/composer/inline-document.js +1 -1
  230. package/dist/composer/inline-dom.js +1 -1
  231. package/dist/composer/model-select.js +1 -1
  232. package/dist/composer/permission-mode-select.js +1 -1
  233. package/dist/composer/prompt-input-attachments.js +1 -1
  234. package/dist/composer/prompt-input-clipboard.js +1 -1
  235. package/dist/composer/prompt-input-context.js +1 -1
  236. package/dist/composer/prompt-input-inline.js +1 -1
  237. package/dist/composer/prompt-input-textarea.js +1 -1
  238. package/dist/composer/prompt-input.js +1 -1
  239. package/dist/conversation/action-card.js +1 -1
  240. package/dist/conversation/composer/app-mentions.js +1 -1
  241. package/dist/conversation/composer/apps-menu.js +1 -1
  242. package/dist/conversation/composer/composer-menu.js +1 -1
  243. package/dist/conversation/composer/composer.js +1 -1
  244. package/dist/conversation/composer/config-options.js +1 -1
  245. package/dist/conversation/composer/context.js +1 -1
  246. package/dist/conversation/composer/drafts.js +1 -1
  247. package/dist/conversation/composer/long-text.js +1 -1
  248. package/dist/conversation/composer/mention-chips.js +1 -1
  249. package/dist/conversation/composer/mention-uri.js +1 -1
  250. package/dist/conversation/composer/model-menu.js +1 -1
  251. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  252. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  253. package/dist/conversation/composer/prompt-history.js +1 -1
  254. package/dist/conversation/composer/slash-command-button.js +1 -1
  255. package/dist/conversation/composer/submit-button.js +1 -1
  256. package/dist/conversation/composer/usage-meter.js +1 -1
  257. package/dist/conversation/connection-notice.js +1 -1
  258. package/dist/conversation/context.js +1 -1
  259. package/dist/conversation/conversation-body.js +1 -1
  260. package/dist/conversation/conversation-search.js +1 -1
  261. package/dist/conversation/conversation-view.js +1 -1
  262. package/dist/conversation/conversation.js +1 -1
  263. package/dist/conversation/diff-modal.js +1 -1
  264. package/dist/conversation/draft-project-picker.js +1 -1
  265. package/dist/conversation/session-actions.js +1 -1
  266. package/dist/conversation/subagent-sessions.js +1 -1
  267. package/dist/conversation/subagent-tasks.js +1 -1
  268. package/dist/desktop/desktop-composer.d.ts +2 -1
  269. package/dist/desktop/desktop-composer.js +1 -1
  270. package/dist/desktop/desktop.js +1 -1
  271. package/dist/desktop/draft-model-select.js +1 -1
  272. package/dist/desktop/load-image.js +1 -1
  273. package/dist/desktop/model-catalog.js +1 -1
  274. package/dist/desktop/model-recovery.js +1 -1
  275. package/dist/desktop/model-settings-action.js +1 -1
  276. package/dist/desktop/native-file-drop.d.ts +2 -1
  277. package/dist/desktop/native-file-drop.js +1 -1
  278. package/dist/generated/commands.d.ts +3 -0
  279. package/dist/generated/commands.js +1 -1
  280. package/dist/generated-image-storage.js +1 -1
  281. package/dist/image-lightbox.js +1 -1
  282. package/dist/image-preview-dialog.js +1 -1
  283. package/dist/image.js +1 -1
  284. package/dist/lib/app-reference.js +1 -1
  285. package/dist/lib/application-metadata.js +1 -1
  286. package/dist/lib/chat-path.js +1 -1
  287. package/dist/lib/code-highlighter.js +1 -1
  288. package/dist/lib/file-url.js +1 -1
  289. package/dist/lib/fuzzy.js +1 -1
  290. package/dist/lib/group-blocks.js +1 -1
  291. package/dist/lib/image-encode.js +1 -1
  292. package/dist/lib/markdown-parser.js +1 -1
  293. package/dist/lib/markdown-rules.js +1 -1
  294. package/dist/lib/model-name.js +1 -1
  295. package/dist/lib/prepare-prompt-files.js +1 -1
  296. package/dist/lib/reference-presentation.js +1 -1
  297. package/dist/lib/stream-style.js +1 -1
  298. package/dist/lib/streaming-markdown.js +1 -1
  299. package/dist/mermaid/diagram.js +1 -1
  300. package/dist/mermaid/export.js +1 -1
  301. package/dist/mermaid/index.js +1 -1
  302. package/dist/mermaid/preview.js +1 -1
  303. package/dist/oauth/claude-login.js +1 -1
  304. package/dist/oauth.js +1 -1
  305. package/dist/plugins/catalog-skeleton.js +1 -1
  306. package/dist/plugins/host.js +1 -1
  307. package/dist/plugins/plugin-detail-page.js +1 -1
  308. package/dist/plugins/plugin-icon.js +1 -1
  309. package/dist/plugins/plugin-icons.js +1 -1
  310. package/dist/plugins/plugins-page.js +1 -1
  311. package/dist/plugins/plugins.js +1 -1
  312. package/dist/plugins/read-skill-document.js +1 -1
  313. package/dist/plugins/skill-document.js +1 -1
  314. package/dist/plugins/skills-tab.js +1 -1
  315. package/dist/plugins/store.js +1 -1
  316. package/dist/reference-projection.js +1 -1
  317. package/dist/search/chat-search.js +1 -1
  318. package/dist/search/codex-source-matches.js +1 -1
  319. package/dist/search/dom-matches.js +1 -1
  320. package/dist/search/find-bar.js +1 -1
  321. package/dist/search/literal-matches.js +1 -1
  322. package/dist/session-list/account-menu.js +1 -1
  323. package/dist/session-list/activity-list.js +1 -1
  324. package/dist/session-list/archived-sessions.js +1 -1
  325. package/dist/session-list/help-menu.js +1 -1
  326. package/dist/session-list/host.js +1 -1
  327. package/dist/session-list/navigation-controls.js +1 -1
  328. package/dist/session-list/navigation-header.js +1 -1
  329. package/dist/session-list/navigation-store.js +1 -1
  330. package/dist/session-list/navigation-tabs.js +1 -1
  331. package/dist/session-list/navigation.js +1 -1
  332. package/dist/session-list/platform.js +1 -1
  333. package/dist/session-list/session-groups.js +1 -1
  334. package/dist/session-list/session-info-card.js +1 -1
  335. package/dist/session-list/session-list.js +1 -1
  336. package/dist/session-list/session-row.js +1 -1
  337. package/dist/session-list/session-state-dot.js +1 -1
  338. package/dist/session-list/session-state-menu.js +1 -1
  339. package/dist/session-list/shortcut-hint.js +1 -1
  340. package/dist/session-list/shortcut.js +1 -1
  341. package/dist/session-list/sidebar-overlay.js +1 -1
  342. package/dist/session-list/use-activity-notification.js +1 -1
  343. package/dist/session-list/use-activity-preview.js +1 -1
  344. package/dist/session-list/use-cmd-held.js +1 -1
  345. package/dist/session-list/use-project-sessions.js +1 -1
  346. package/dist/session-list/virtual-session-rows.js +1 -1
  347. package/dist/session-timeline/activity-group.js +1 -1
  348. package/dist/session-timeline/activity-projection.js +1 -1
  349. package/dist/session-timeline/assistant-content.js +1 -1
  350. package/dist/session-timeline/assistant-image-references.js +1 -1
  351. package/dist/session-timeline/assistant-turn.js +1 -1
  352. package/dist/session-timeline/async-questions.js +1 -1
  353. package/dist/session-timeline/edited-files-card.js +1 -1
  354. package/dist/session-timeline/history-timeline.js +1 -1
  355. package/dist/session-timeline/host.js +1 -1
  356. package/dist/session-timeline/image-generation-progress.js +1 -1
  357. package/dist/session-timeline/navigation-rail.js +1 -1
  358. package/dist/session-timeline/plan.js +1 -1
  359. package/dist/session-timeline/question-reply.js +1 -1
  360. package/dist/session-timeline/resource-content.js +1 -1
  361. package/dist/session-timeline/session-timeline.js +1 -1
  362. package/dist/session-timeline/timeline-registry.js +1 -1
  363. package/dist/session-timeline/turn-activity.js +1 -1
  364. package/dist/session-timeline/turn-error.js +1 -1
  365. package/dist/session-timeline/turn-retry.js +1 -1
  366. package/dist/session-timeline/turns.js +1 -1
  367. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  368. package/dist/session-timeline/user-message.js +1 -1
  369. package/dist/settings/codex-account-card.js +1 -1
  370. package/dist/settings/login-card.js +1 -1
  371. package/dist/settings/model-alias-settings.js +1 -1
  372. package/dist/settings/provider-logos.js +1 -1
  373. package/dist/settings/provider-section.js +1 -1
  374. package/dist/settings/providers-port.js +1 -1
  375. package/dist/settings/providers.js +1 -1
  376. package/dist/settings/settings-bridge.js +1 -1
  377. package/dist/settings/settings.js +1 -1
  378. package/package.json +2 -2
  379. package/dist/chunk-33fxyn5r.js +0 -2
  380. package/dist/chunk-63kwbtgs.js +0 -2
  381. package/dist/chunk-by7k0ypx.js +0 -4
  382. package/dist/chunk-c70a2esc.js +0 -2
  383. package/dist/chunk-fxzh4f7c.js +0 -4
  384. package/dist/chunk-j2bp0zbe.js +0 -2
  385. package/dist/chunk-k97dpdcj.js +0 -2
  386. package/dist/chunk-khd2r3jh.js +0 -2
  387. package/dist/chunk-kvgn4b2n.js +0 -2
  388. package/dist/chunk-mybye5t2.js +0 -2
  389. package/dist/chunk-nrfyvzmk.js +0 -2
  390. package/dist/chunk-pz5d0vgv.js +0 -2
  391. package/dist/chunk-qv61ef2y.js +0 -2
  392. package/dist/chunk-svxnx1c7.js +0 -2
  393. package/dist/chunk-t3rv7vat.js +0 -2
  394. package/dist/chunk-wexhc7rb.js +0 -2
  395. package/dist/chunk-zpm0t5ye.js +0 -2
@@ -1,2 +1,2 @@
1
- import{fromMcpServer as u}from"@agentclientprotocol/sdk/experimental/mcp-server";import{Server as g}from"@modelcontextprotocol/server";function Gn(e){let{parse:o,execute:t,...s}=e;return{...s,execute:(n,i)=>t(o(n),i)}}var vo="alwith";function m(e){if(e.length>128)throw Error("Too many application tools");let o=new Map;for(let t of e){if(!/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/.test(t.name)||o.has(t.name))throw Error(`Invalid or duplicate application tool: ${t.name}`);if(!t.description.trim()||t.inputSchema.type!=="object")throw Error(`Invalid application tool definition: ${t.name}`);o.set(t.name,{...t,inputSchema:structuredClone(t.inputSchema)})}return o}var p=(e)=>({content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:!0});class yo{servers=new Map;session;identity;constructor(e,o){this.session=e,this.identity=o}declare(e,o){let t={agent:e,tools:m(o),sessionId:null};return t.mcp=u(()=>this.server(t)),t.registration=e.registerMcpServer({name:vo,handler:t.mcp.handler}),this.servers.set(t.registration.serverId,t),t.registration.declaration}bind(e,o){let t=this.servers.get(e);if(!t)throw Error(`Application tool server is not registered: ${e}`);for(let[s,n]of this.servers)if(n.sessionId===o)this.dispose(s);t.sessionId=o}drop(e){for(let[o,t]of this.servers)if(t.sessionId===e)this.dispose(o)}clear(){for(let e of this.servers.keys())this.dispose(e)}dispose(e){let o=this.servers.get(e);if(!o)return;this.servers.delete(e),o.registration.dispose().then(()=>o.mcp.close())}server(e){let o=new g({name:vo,version:"1.0.0"},{capabilities:{tools:{}}});return o.setRequestHandler("tools/list",()=>({tools:[...e.tools.values()].map((t)=>({name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description,inputSchema:structuredClone(t.inputSchema),...t.annotations===void 0?{}:{annotations:t.annotations}}))})),o.setRequestHandler("tools/call",async(t,s)=>{let n=e.tools.get(t.params.name);if(!n)return p(Error(`Application tool is not registered: ${t.params.name}`));let i=e.sessionId,l=i===null?void 0:this.session(i);if(i===null||!l?.attached||l.readOnly)return p(Error("Application tool session is not attached"));let{toolCallId:c,turnId:d}=this.identity(t.params._meta??{}),a=s.mcpReq.signal;try{let r=await n.execute(t.params.arguments??{},{sessionId:i,toolCallId:c,turnId:d,signal:a,agent:e.agent});return a.throwIfAborted(),r}catch(r){if(a.aborted)throw r;return p(r)}}),o}}
2
- export{Gn,vo,yo};
1
+ import{fromMcpServer as u}from"@agentclientprotocol/sdk/experimental/mcp-server";import{Server as g}from"@modelcontextprotocol/server";function zn(e){let{parse:o,execute:t,...s}=e;return{...s,execute:(n,i)=>t(o(n),i)}}var yo="alwith";function m(e){if(e.length>128)throw Error("Too many application tools");let o=new Map;for(let t of e){if(!/^[a-zA-Z][a-zA-Z0-9_]{0,49}$/.test(t.name)||o.has(t.name))throw Error(`Invalid or duplicate application tool: ${t.name}`);if(!t.description.trim()||t.inputSchema.type!=="object")throw Error(`Invalid application tool definition: ${t.name}`);o.set(t.name,{...t,inputSchema:structuredClone(t.inputSchema)})}return o}var p=(e)=>({content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:!0});class xo{servers=new Map;session;identity;constructor(e,o){this.session=e,this.identity=o}declare(e,o){let t={agent:e,tools:m(o),sessionId:null};return t.mcp=u(()=>this.server(t)),t.registration=e.registerMcpServer({name:yo,handler:t.mcp.handler}),this.servers.set(t.registration.serverId,t),t.registration.declaration}bind(e,o){let t=this.servers.get(e);if(!t)throw Error(`Application tool server is not registered: ${e}`);for(let[s,n]of this.servers)if(n.sessionId===o)this.dispose(s);t.sessionId=o}drop(e){for(let[o,t]of this.servers)if(t.sessionId===e)this.dispose(o)}clear(){for(let e of this.servers.keys())this.dispose(e)}dispose(e){let o=this.servers.get(e);if(!o)return;this.servers.delete(e),o.registration.dispose().then(()=>o.mcp.close())}server(e){let o=new g({name:yo,version:"1.0.0"},{capabilities:{tools:{}}});return o.setRequestHandler("tools/list",()=>({tools:[...e.tools.values()].map((t)=>({name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description,inputSchema:structuredClone(t.inputSchema),...t.annotations===void 0?{}:{annotations:t.annotations}}))})),o.setRequestHandler("tools/call",async(t,s)=>{let n=e.tools.get(t.params.name);if(!n)return p(Error(`Application tool is not registered: ${t.params.name}`));let i=e.sessionId,l=i===null?void 0:this.session(i);if(i===null||!l?.attached||l.readOnly)return p(Error("Application tool session is not attached"));let{toolCallId:c,turnId:d}=this.identity(t.params._meta??{}),a=s.mcpReq.signal;try{let r=await n.execute(t.params.arguments??{},{sessionId:i,toolCallId:c,turnId:d,signal:a,agent:e.agent});return a.throwIfAborted(),r}catch(r){if(a.aborted)throw r;return p(r)}}),o}}
2
+ export{zn,yo,xo};
@@ -1,2 +1,2 @@
1
- import{createContext as r,useContext as i}from"react";import{jsx as n}from"react/jsx-runtime";var o=r(null);function Ps({host:t,children:e}){return n(o.Provider,{value:t,children:e})}function c(){let t=i(o);if(t===null)throw Error("Activity host is missing");return t}function F(t){let{Markdown:e}=c();return n(e,{...t})}
2
- export{Ps,c,F};
1
+ import{createContext as r,useContext as i}from"react";import{jsx as n}from"react/jsx-runtime";var o=r(null);function Ts({host:t,children:e}){return n(o.Provider,{value:t,children:e})}function c(){let t=i(o);if(t===null)throw Error("Activity host is missing");return t}function F(t){let{Markdown:e}=c();return n(e,{...t})}
2
+ export{Ts,c,F};
@@ -1,2 +1,2 @@
1
- var i=new Set(["inputMode","imageIntent","imageInstructions","imageSelection","imageRequestId","imageAspectRatio"]);function ho(n){let e=n?.alwith;if(!e||typeof e!=="object"||Array.isArray(e))return n;return{...n,alwith:Object.fromEntries(Object.entries(e).filter(([t])=>!i.has(t)))}}
2
- export{ho};
1
+ var i=new Set(["inputMode","imageIntent","imageInstructions","imageSelection","imageRequestId","imageAspectRatio"]);function vo(n){let e=n?.alwith;if(!e||typeof e!=="object"||Array.isArray(e))return n;return{...n,alwith:Object.fromEntries(Object.entries(e).filter(([t])=>!i.has(t)))}}
2
+ export{vo};
@@ -1,4 +1,4 @@
1
- function nr(e,t){if(t===0)return null;let r=t-1;while(r>=0){let n=e[r];if(n===" "||n==="\t"||n===`
1
+ function or(e,t){if(t===0)return null;let r=t-1;while(r>=0){let n=e[r];if(n===" "||n==="\t"||n===`
2
2
  `)return null;if(n==="@"||n==="/"){let i=r===0?"":e[r-1],a=r===0||i===`
3
3
  `||i===" "||i==="\t",s=a||/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul},。!?:;((]/u.test(i??"");if(n==="/"?s&&!/[/\\]/.test(e.slice(r+1,t)):a)return{kind:n==="/"?"slash":"at",start:r,end:t,query:e.slice(r+1,t)}}r-=1}return null}
4
- export{nr};
4
+ export{or};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-qgrd5xre.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function ca({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
- export{ca};
1
+ import{e}from"./chunk-8e9h60we.js";import{Alert as s,AlertDescription as a,AlertTitle as p}from"@nyssance/shadcn/vega/components/ui/alert";import{Button as m}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as t,jsxs as c}from"react/jsx-runtime";function da({connection:n,error:i,onReconnect:r,className:l="mx-auto w-full max-w-3xl px-6 pt-12"}){let{t:o}=e().host;if(n!=="failed"&&n!=="disconnected")return null;return t("div",{className:l,children:c(s,{variant:"destructive",children:[t(p,{children:n==="failed"?o("connection.failed"):o("connection.disconnected")}),c(a,{className:"flex flex-wrap items-center gap-2",children:[i!==null&&t("span",{className:"font-mono",children:i}),t(m,{size:"sm",variant:"outline",onClick:r,children:o("connection.reconnect")})]})]})})}
2
+ export{da};
@@ -1,2 +1,2 @@
1
- import{p}from"./chunk-vgxvtmja.js";import{s}from"./chunk-pxbww0j1.js";import{v,f}from"./chunk-95f0wens.js";import{ht}from"./chunk-s11mgwyh.js";import{cn as r}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as c}from"lucide-react";import{DropdownMenu as m,DropdownMenuContent as u,DropdownMenuItem as d,DropdownMenuTrigger as g}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as w}from"react/jsx-runtime";function Bs({onCollapseAll:i}){let{t:n}=s();return w(m,{children:[o(g,{render:o(ht,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(c,{})}),o(u,{align:"end",className:"w-52",children:o(d,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Gs({screen:i,onSwitch:n}){let{t:e}=s(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(f,{className:r(p,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(v,{children:i==="main"?o(a,{}):o(l,{})})})}
2
- export{Bs,Gs};
1
+ import{p}from"./chunk-vgxvtmja.js";import{s}from"./chunk-hd5zm7tc.js";import{v,f}from"./chunk-13jj645z.js";import{ht}from"./chunk-va5f2mdb.js";import{cn as r}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as c}from"lucide-react";import{DropdownMenu as m,DropdownMenuContent as u,DropdownMenuItem as d,DropdownMenuTrigger as g}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as w}from"react/jsx-runtime";function Gs({onCollapseAll:i}){let{t:n}=s();return w(m,{children:[o(g,{render:o(ht,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(c,{})}),o(u,{align:"end",className:"w-52",children:o(d,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function zs({screen:i,onSwitch:n}){let{t:e}=s(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(f,{className:r(p,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(v,{children:i==="main"?o(a,{}):o(l,{})})})}
2
+ export{Gs,zs};
@@ -1,2 +1,2 @@
1
- function i(n,o=0){if(o>32)throw Error("Session input config is too deeply nested");if(n===null||typeof n==="string"||typeof n==="boolean")return n;if(typeof n==="number"&&Number.isFinite(n))return n;if(Array.isArray(n))return n.map((t)=>i(t,o+1));if(n&&typeof n==="object"&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null))return Object.fromEntries(Object.keys(n).toSorted().map((t)=>[t,i(n[t],o+1)]));throw Error("Session input config must contain only JSON values")}function Zi(n){if(!n||typeof n!=="object"||!("mode"in n)||typeof n.mode!=="string"||!n.mode.trim()||n.mode.length>128||/\p{Cc}/u.test(n.mode)||!("config"in n)||!n.config||typeof n.config!=="object"||Array.isArray(n.config))throw Error("Expected session input configuration with mode and config");let o=i(n.config),t={mode:n.mode,config:o};if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error("Session input config exceeds 64 KiB");return t}function Hn(n,o){if(!n||typeof n!=="object"||!("sessionId"in n)||n.sessionId!==o||!("revision"in n)||typeof n.revision!=="number"||!Number.isSafeInteger(n.revision)||n.revision<0||!("inputConfig"in n))throw Error("Invalid Codex session input snapshot");return{sessionId:o,revision:n.revision,inputConfig:n.inputConfig===null?null:Zi(n.inputConfig)}}
2
- export{Zi,Hn};
1
+ function i(n,o=0){if(o>32)throw Error("Session input config is too deeply nested");if(n===null||typeof n==="string"||typeof n==="boolean")return n;if(typeof n==="number"&&Number.isFinite(n))return n;if(Array.isArray(n))return n.map((t)=>i(t,o+1));if(n&&typeof n==="object"&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null))return Object.fromEntries(Object.keys(n).toSorted().map((t)=>[t,i(n[t],o+1)]));throw Error("Session input config must contain only JSON values")}function Qi(n){if(!n||typeof n!=="object"||!("mode"in n)||typeof n.mode!=="string"||!n.mode.trim()||n.mode.length>128||/\p{Cc}/u.test(n.mode)||!("config"in n)||!n.config||typeof n.config!=="object"||Array.isArray(n.config))throw Error("Expected session input configuration with mode and config");let o=i(n.config),t={mode:n.mode,config:o};if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error("Session input config exceeds 64 KiB");return t}function Un(n,o){if(!n||typeof n!=="object"||!("sessionId"in n)||n.sessionId!==o||!("revision"in n)||typeof n.revision!=="number"||!Number.isSafeInteger(n.revision)||n.revision<0||!("inputConfig"in n))throw Error("Invalid Codex session input snapshot");return{sessionId:o,revision:n.revision,inputConfig:n.inputConfig===null?null:Qi(n.inputConfig)}}
2
+ export{Qi,Un};
@@ -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 Rr({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{Rr};
1
+ import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsx as o,jsxs as d}from"react/jsx-runtime";function Lr({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{Lr};
@@ -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 os(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{os};
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 is(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{is};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function we(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Xo(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{we,Xo};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function we(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Yo(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{we,Yo};
@@ -0,0 +1,2 @@
1
+ import{u}from"./chunk-89jwjv3m.js";function As(r,n){return u.readSkillDocument({path:r,roots:n??null})}
2
+ export{As};
@@ -1,2 +1,2 @@
1
- function Bn(n,r){let i=new Set(r);i.add(n);let t=/^(.*?)\s*\((\d+)\)$/.exec(n),s=t?t[1].trimEnd():n,e=t?BigInt(t[2])+1n:2n;while(i.has(`${s} (${e})`))e++;return`${s} (${e})`}
2
- export{Bn};
1
+ function Gn(n,r){let i=new Set(r);i.add(n);let t=/^(.*?)\s*\((\d+)\)$/.exec(n),s=t?t[1].trimEnd():n,e=t?BigInt(t[2])+1n:2n;while(i.has(`${s} (${e})`))e++;return`${s} (${e})`}
2
+ export{Gn};
@@ -1,2 +1,2 @@
1
- import{re}from"./chunk-fzfwftqs.js";import{St}from"./chunk-afnnrn6z.js";var ve={persistConfig:!0,nativeTools:{imageGeneration:!1},applicationContext:St,parseConfig(e){if(typeof e.model!=="string"||typeof e.size!=="string"||Object.keys(e).some((t)=>t!=="model"&&t!=="size"))throw Error("Invalid image input config");let o={model:e.model,size:e.size};return re(o),o},routePrompt(e){return e.image()}};
1
+ import{re}from"./chunk-8ncatcr7.js";import{St}from"./chunk-afnnrn6z.js";var ve={persistConfig:!0,nativeTools:{imageGeneration:!1},applicationContext:St,parseConfig(e){if(typeof e.model!=="string"||typeof e.size!=="string"||Object.keys(e).some((t)=>t!=="model"&&t!=="size"))throw Error("Invalid image input config");let o={model:e.model,size:e.size};return re(o),o},routePrompt(e){return e.image()}};
2
2
  export{ve};
@@ -1,4 +1,4 @@
1
- import{at}from"./chunk-fqchnswc.js";import{nr}from"./chunk-aj6yxm6d.js";import{l}from"./chunk-6283nzqs.js";import{ye}from"./chunk-q8c4k6qh.js";import{autoUpdate as ot}from"@floating-ui/dom";import{cn as rt}from"cn";import{BookOpenIcon as st,FileIcon as it,SquareSlashIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as ct,useEffect as y,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as g}from"react";import{createPortal as mt}from"react-dom";import{Button as _}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as d,jsxs as T,Fragment as pt}from"react/jsx-runtime";function tr({handleRef:a,anchorRef:f,commands:q,renderSlashMenu:k,searchFiles:u,onMention:R,onSearchError:j,fileSearchDebounceMs:M=0,bashMode:Q=!1,forcedOpen:i=!1,onForcedOpenChange:c,emptyLabel:F,fileStatusLabels:L,morePlugins:N}){let D=ye(),s=D.textInput.value,[z,P]=g(0),[O,S]=g(!1),[x,B]=g(null),[E,h]=g(0),U=Z(null);y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>P(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[a]);let V=Y(()=>Q&&s.startsWith("!")?null:nr(s,z),[s,z,Q]),o=V?.kind==="at"&&!u?null:V,H=`${o?.kind??"forced"}:${o?.query??""}:${i}`,[tt,et]=g(H);if(tt!==H)et(H),h(0);let I=Z(null);y(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=s;else if(s!==I.current)c?.(!1)},[i,s,c]);let b=o?.kind==="at"?o.query:null;y(()=>{if(b===null||!u){B(null);return}let t=!0,e=()=>{u(b).then((r)=>{if(t)B({query:b,search:u,items:r})},(r)=>{if(t)B({query:b,search:u,items:[]}),j(r)})},n=M>0?window.setTimeout(e,M):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[b,u,M,j]);let v=Y(()=>{if(o?.kind==="at")return x?.query===o.query&&x.search===u?x.items:[];if(k&&(o?.kind==="slash"||i))return[];if(o)return at(q,o.query);if(i)return at(q,"");return[]},[o,i,q,x,u,k]),m=o?o.kind==="slash":i;y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>S(!0),n=()=>{if(S(!1),i)c?.(!1)};return S(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[a,i,c]),y(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let p=O&&(o!==null?o.kind==="slash"||v.length>0||!!L:i);y(()=>{if(!p)return;U.current?.querySelector(`[data-idx="${E}"]`)?.scrollIntoView({block:"nearest"})},[E,p]);function A(t){let e=a.current?.getTextarea();if(!e)return;let n,r;if(o){let K=o.kind==="slash"?`${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `:`@${t.label} `;if(n=s.slice(0,o.start)+K+s.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+K.length}else if(i)n=`${s.length===0||s.endsWith(`
1
+ import{at}from"./chunk-f4dz7xen.js";import{or}from"./chunk-jfp8yj9p.js";import{l}from"./chunk-6283nzqs.js";import{ye}from"./chunk-hqfmwbq5.js";import{autoUpdate as ot}from"@floating-ui/dom";import{cn as rt}from"cn";import{BookOpenIcon as st,FileIcon as it,SquareSlashIcon as lt,StoreIcon as ut}from"lucide-react";import{useCallback as ct,useEffect as y,useLayoutEffect as X,useMemo as Y,useRef as Z,useState as g}from"react";import{createPortal as mt}from"react-dom";import{Button as _}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as d,jsxs as T,Fragment as pt}from"react/jsx-runtime";function nr({handleRef:a,anchorRef:f,commands:q,renderSlashMenu:k,searchFiles:u,onMention:R,onSearchError:j,fileSearchDebounceMs:M=0,bashMode:Q=!1,forcedOpen:i=!1,onForcedOpenChange:c,emptyLabel:F,fileStatusLabels:L,morePlugins:N}){let D=ye(),s=D.textInput.value,[z,P]=g(0),[O,S]=g(!1),[x,B]=g(null),[E,h]=g(0),U=Z(null);y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>P(t.selectionStart??0),n=()=>{if(document.activeElement===t)e()};return t.addEventListener("keyup",e),t.addEventListener("click",e),t.addEventListener("input",e),t.addEventListener("select",e),t.addEventListener("focus",e),document.addEventListener("selectionchange",n),()=>{t.removeEventListener("keyup",e),t.removeEventListener("click",e),t.removeEventListener("input",e),t.removeEventListener("select",e),t.removeEventListener("focus",e),document.removeEventListener("selectionchange",n)}},[a]);let V=Y(()=>Q&&s.startsWith("!")?null:or(s,z),[s,z,Q]),o=V?.kind==="at"&&!u?null:V,H=`${o?.kind??"forced"}:${o?.query??""}:${i}`,[tt,et]=g(H);if(tt!==H)et(H),h(0);let I=Z(null);y(()=>{if(!i){I.current=null;return}if(I.current===null)I.current=s;else if(s!==I.current)c?.(!1)},[i,s,c]);let b=o?.kind==="at"?o.query:null;y(()=>{if(b===null||!u){B(null);return}let t=!0,e=()=>{u(b).then((r)=>{if(t)B({query:b,search:u,items:r})},(r)=>{if(t)B({query:b,search:u,items:[]}),j(r)})},n=M>0?window.setTimeout(e,M):null;if(n===null)e();return()=>{if(t=!1,n!==null)window.clearTimeout(n)}},[b,u,M,j]);let v=Y(()=>{if(o?.kind==="at")return x?.query===o.query&&x.search===u?x.items:[];if(k&&(o?.kind==="slash"||i))return[];if(o)return at(q,o.query);if(i)return at(q,"");return[]},[o,i,q,x,u,k]),m=o?o.kind==="slash":i;y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=()=>S(!0),n=()=>{if(S(!1),i)c?.(!1)};return S(document.activeElement===t),t.addEventListener("focus",e),t.addEventListener("blur",n),()=>{t.removeEventListener("focus",e),t.removeEventListener("blur",n)}},[a,i,c]),y(()=>{if(i)a.current?.getTextarea()?.focus()},[i,a]);let p=O&&(o!==null?o.kind==="slash"||v.length>0||!!L:i);y(()=>{if(!p)return;U.current?.querySelector(`[data-idx="${E}"]`)?.scrollIntoView({block:"nearest"})},[E,p]);function A(t){let e=a.current?.getTextarea();if(!e)return;let n,r;if(o){let K=o.kind==="slash"?`${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `:`@${t.label} `;if(n=s.slice(0,o.start)+K+s.slice(o.end),o.kind==="at")R?.(t.payload);r=o.start+K.length}else if(i)n=`${s.length===0||s.endsWith(`
2
2
  `)?s:`${s}
3
3
  `}${t.payload.startsWith("$")?t.payload:`/${t.payload}`} `,r=n.length,c?.(!1);else return;D.textInput.setInput(n),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})}y(()=>{let t=a.current?.getTextarea();if(!t)return;let e=(n)=>{if(!p||m&&k)return;if(a.current?.isComposing()||n.isComposing||n.keyCode===229)return;if(n.key==="ArrowDown")n.preventDefault(),n.stopPropagation(),h((r)=>v.length===0?0:Math.min(v.length-1,r+1));else if(n.key==="ArrowUp")n.preventDefault(),n.stopPropagation(),h((r)=>Math.max(0,r-1));else if(n.key==="Enter"&&!n.shiftKey&&!n.altKey||n.key==="Tab"){n.preventDefault(),n.stopPropagation();let r=v[E];if(r)A(r)}else if(n.key==="Escape")if(n.preventDefault(),n.stopPropagation(),o)P(Math.max(0,o.start-1)),t.setSelectionRange(o.start,o.start);else c?.(!1)};return t.addEventListener("keydown",e,!0),()=>t.removeEventListener("keydown",e,!0)});let[w,G]=g(null),[W,nt]=g(null),C=ct(()=>{let t=f?.current;if(!t)return;let e=t.getBoundingClientRect();G({left:e.left,width:e.width,bottom:window.innerHeight-e.top+8})},[f]);if(X(()=>{if(!p){G(null);return}C()},[p,C]),X(()=>{let t=f?.current;if(!p||!t||!W)return;return ot(t,W,C,{animationFrame:!0})},[p,W,f,C]),p&&m&&k)return k({query:o?.query??"",close:()=>{if(o)P(o.start),a.current?.getTextarea()?.setSelectionRange(o.start,o.start);else c?.(!1)},selectCommand:(t)=>A({key:t,label:t,payload:t}),replaceQuery:(t)=>{let e=a.current?.getTextarea();if(!e)return;let n=o?.start??e.selectionStart,r=o?.end??e.selectionEnd;D.textInput.setInput(s.slice(0,n)+s.slice(r)),c?.(!1),requestAnimationFrame(()=>{if(a.current?.getTextarea()!==e)return;e.focus(),e.setSelectionRange(n,n),t()})}});if(!p||f&&!w)return null;let J=d("div",{ref:nt,className:f?"fixed z-50":l.position,style:f&&w?{left:w.left,width:w.width,bottom:w.bottom}:void 0,children:T("div",{ref:U,role:"listbox",onMouseDown:(t)=>t.preventDefault(),className:l.surface,children:[T("div",{className:l.list,children:[v.length===0&&m&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:F}),v.length===0&&!m&&L&&d("div",{role:"option","aria-disabled":"true","aria-selected":"false",className:"text-muted-foreground px-2 py-3 text-xs",children:x?.query===b&&x.search===u?L.empty:L.loading}),v.map((t,e)=>{let n=m?t.payload.startsWith("$")?st:lt:it;return T(_,{type:"button",variant:"ghost",role:"option","aria-selected":e===E,"data-idx":e,onMouseDown:(r)=>{r.preventDefault(),A(t)},onMouseEnter:()=>h(e),className:rt(m?l.row:"flex h-auto w-full items-center justify-start gap-2.5 rounded-md px-2.5 py-2 text-start",e===E&&l.selected),children:[d(n,{className:m?l.icon:"text-muted-foreground size-4 shrink-0"}),d("span",{className:m?l.label:"text-foreground shrink-0 text-sm font-medium",children:t.label}),t.description&&d("span",{"data-slot":"description",className:l.description,children:t.description})]},t.key)})]}),m&&N&&d(pt,{children:T(_,{type:"button",variant:"ghost",onMouseDown:(t)=>{t.preventDefault(),c?.(!1),N.open()},className:l.row,children:[d(ut,{className:l.icon}),d("span",{className:l.label,children:N.label})]})})]})});return f?mt(J,document.body):J}
4
- export{tr};
4
+ export{nr};
@@ -1,2 +1,2 @@
1
- import{b}from"./chunk-veef1avy.js";import{At}from"./chunk-6ea6q6dj.js";import{e}from"./chunk-qgrd5xre.js";import{Pt,V}from"./chunk-th5vv83g.js";import{On,Ge}from"./chunk-359pf448.js";import{Be}from"./chunk-23kvszfc.js";import{Zap as g}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function fa({snapshot:s,model:l,onChange:r,nativeModels:t,catalog:c}){let{host:u}=e(),{t:a}=u,f=[{id:b.id,name:b.name,models:t===void 0?[{api_id:"",label:b.name}]:t.map((o)=>({api_id:o.id,label:o.label??o.id}))},...(s===null?[]:Pt(s)).map((o)=>({id:o.id,name:o.name,models:o.models.map((i)=>({api_id:V(o.id,i.id),label:i.label??i.id}))}))],p=Ge(f,c),d=p.flatMap((o)=>o.models),m=l===null?t===void 0?d[0]:{api_id:"",label:a("composer.model")}:d.find((o)=>o.api_id===l)??{api_id:l,label:l};return n(At,{value:{...m,label:On(m)},models:d,modelGroups:p,header:{name:a("composer.model"),action:n(Be,{})},compactCatalog:!0,booleanOptions:[{id:"fast_mode",name:a("composer.fastMode"),currentValue:!1,disabled:!0,title:a("composer.fastModeUnsupported"),icon:n(g,{className:"size-4","aria-hidden":"true"})}],showModelList:!0,onChange:(o)=>r(o.api_id),t:(o)=>a(o)})}
2
- export{fa};
1
+ import{b}from"./chunk-fg7za6sb.js";import{At}from"./chunk-wv501ppg.js";import{e}from"./chunk-8e9h60we.js";import{Pt,V}from"./chunk-0ck2zpaa.js";import{Hn,Ge}from"./chunk-z29anjt1.js";import{Be}from"./chunk-f6wp23k0.js";import{Zap as g}from"lucide-react";import{jsx as n}from"react/jsx-runtime";function ha({snapshot:s,model:l,onChange:r,nativeModels:t,catalog:c}){let{host:u}=e(),{t:a}=u,f=[{id:b.id,name:b.name,models:t===void 0?[{api_id:"",label:b.name}]:t.map((o)=>({api_id:o.id,label:o.label??o.id}))},...(s===null?[]:Pt(s)).map((o)=>({id:o.id,name:o.name,models:o.models.map((i)=>({api_id:V(o.id,i.id),label:i.label??i.id}))}))],p=Ge(f,c),d=p.flatMap((o)=>o.models),m=l===null?t===void 0?d[0]:{api_id:"",label:a("composer.model")}:d.find((o)=>o.api_id===l)??{api_id:l,label:l};return n(At,{value:{...m,label:Hn(m)},models:d,modelGroups:p,header:{name:a("composer.model"),action:n(Be,{})},compactCatalog:!0,booleanOptions:[{id:"fast_mode",name:a("composer.fastMode"),currentValue:!1,disabled:!0,title:a("composer.fastModeUnsupported"),icon:n(g,{className:"size-4","aria-hidden":"true"})}],showModelList:!0,onChange:(o)=>r(o.api_id),t:(o)=>a(o)})}
2
+ export{ha};
@@ -1,2 +1,2 @@
1
- import{Cr}from"./chunk-mybye5t2.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function No(t,r,e={}){let o=r.trim();if(o.length===0)return[];return Cr(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
- export{No};
1
+ import{wr}from"./chunk-6w7js8qd.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function Ao(t,r,e={}){let o=r.trim();if(o.length===0)return[];return wr(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
+ export{Ao};
@@ -0,0 +1,2 @@
1
+ import{X}from"./chunk-wy7rkpqe.js";function Pn(t){return X(t.absPath)}function Tn(t){return t.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??t}function Mn(t){return Tn(t.absPath)}
2
+ export{Pn,Tn,Mn};
@@ -1,7 +1,7 @@
1
- import{ks}from"./chunk-ry5phnnk.js";import{Ce}from"./chunk-ytkcpeq2.js";import{Xo}from"./chunk-db8hae9d.js";import{w}from"./chunk-4g2412p5.js";import{Vo,Vt}from"./chunk-b0zzq2ky.js";import{de,Jo}from"./chunk-aj0z9a5r.js";import{Lo}from"./chunk-qvdfrmpb.js";import{Fr,Or}from"./chunk-rntrfb49.js";import{Lr}from"./chunk-s170cg6j.js";import{Ro,Dr}from"./chunk-jz7mckdp.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as C}from"entities";import le from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as be,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as b,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ie}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function v(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var xe=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,Te=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ve=/\uE200[^\uE201]*$/,ye=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
1
+ import{Ss}from"./chunk-vc6yxjs3.js";import{Ce}from"./chunk-abt670s7.js";import{Yo}from"./chunk-jsnt49t5.js";import{w}from"./chunk-x2xwfwcx.js";import{$o,Vt}from"./chunk-7pfkx9a2.js";import{de,Xo}from"./chunk-bb2s9nb6.js";import{Do}from"./chunk-epqzypsa.js";import{Or,Hr}from"./chunk-05n5eyp9.js";import{Dr}from"./chunk-b1yfr8gv.js";import{Lo,Fr}from"./chunk-mywbsrxq.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as C}from"entities";import le from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as be,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as b,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ie}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function v(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var xe=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,Te=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ve=/\uE200[^\uE201]*$/,ye=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
2
2
  `)?`${e}\`\`\``:`${e}
3
3
  \`\`\``}function _(e,n){if(!e.includes(n)||Ne(e,n)%2===0)return e;let t=Le(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
4
4
  `)||ne(r))return e;return`${e}${n}`}function $e(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function te(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Pe(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=te(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let l=d.toLowerCase();if(l.length>ye&&!Me.has(l))return!1}return!0}function Se(e){let{path:n}=te(e);if($e(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ae(e){let n=e.match(H);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Pe(t)||Se(t)?e.replace(H,"$1"):`${e})`}function Fe(e){let n=e.replace(ve,"");if(n.length===0||n.includes("`")&&ne(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Ie(n))return{isCodeFenceOpen:!0,markdown:Re(n)};if(n.includes("!["))n=n.replace(Te,(t,r)=>r);if(n.includes("]("))n=Ae(n);return n=_(n,"**"),n=_(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function He(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function O(e){return He(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function re(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))re(t.tokens);if(!O(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!O(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
5
- `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=Vo(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=v(),r=Jo();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(Or,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=v(),o=de();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=v(),i=b(null),[c,d]=h(null),[l,p]=h(null),[E,x]=h(!1);if(k(()=>{let f=Lr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let T=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{x(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),x(!0),window.setTimeout(()=>x(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...T===null?{children:e}:{dangerouslySetInnerHTML:{__html:T}}})})]})}function De({code:e,language:n}){let t=v(),r=J(Y),o=Jo();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Lo,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=b(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return v().preview?a(ie,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=v(),t=de(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Vt(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=b(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ie,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=b(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");le.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
- `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,xe)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function ae(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ae(r),s=t.get(o)??0;return t.set(o,s+1),se(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!Xo(r))return null;return a(Ve,{src:r,alt:C(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function se(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(Fr))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(ks,{text:C(t.text),children:q(C(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=w(o);if(s!==null)return a(Ce,{app:{id:s,name:C(t.text).replace(/^\$/,"")}},n);return Xo(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function y(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?C(n.text):n.tokens.map(y).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(y).join("");case"list":return e.items.map(y).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(y).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},se(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=ae(I),A=f.get(R)??0;f.set(R,A+1);let F=y(I),ce={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,ce})},[n]),s=o.map((u)=>u.visibleText).join(""),i=b({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],x=c.generation+(d?0:1),T={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:x};if(r&&s.length>l)T.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=T}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:T.runs,generation:x},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=b(null),[o,s]=h(()=>Ro(n,t)),i=b(o!==null),[c,d]=h(null);if(k(()=>{let l=Dr((p)=>{if(!i.current)i.current=!0,s(p);else be(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Bt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
5
+ `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=$o(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=v(),r=Xo();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(Hr,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=v(),o=de();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=v(),i=b(null),[c,d]=h(null),[l,p]=h(null),[E,x]=h(!1);if(k(()=>{let f=Dr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let T=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{x(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),x(!0),window.setTimeout(()=>x(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...T===null?{children:e}:{dangerouslySetInnerHTML:{__html:T}}})})]})}function De({code:e,language:n}){let t=v(),r=J(Y),o=Xo();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Do,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=b(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return v().preview?a(ie,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=v(),t=de(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Vt(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=b(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ie,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=b(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");le.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
+ `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,xe)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function ae(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ae(r),s=t.get(o)??0;return t.set(o,s+1),se(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!Yo(r))return null;return a(Ve,{src:r,alt:C(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function se(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(Or))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(Ss,{text:C(t.text),children:q(C(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=w(o);if(s!==null)return a(Ce,{app:{id:s,name:C(t.text).replace(/^\$/,"")}},n);return Yo(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function y(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?C(n.text):n.tokens.map(y).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(y).join("");case"list":return e.items.map(y).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(y).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},se(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=ae(I),A=f.get(R)??0;f.set(R,A+1);let F=y(I),ce={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,ce})},[n]),s=o.map((u)=>u.visibleText).join(""),i=b({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],x=c.generation+(d?0:1),T={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:x};if(r&&s.length>l)T.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=T}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:T.runs,generation:x},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=b(null),[o,s]=h(()=>Lo(n,t)),i=b(o!==null),[c,d]=h(null);if(k(()=>{let l=Fr((p)=>{if(!i.current)i.current=!0,s(p);else be(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Bt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
7
7
  export{Bt};
@@ -1,5 +1,5 @@
1
- import{w,xs}from"./chunk-4g2412p5.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Fi(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
1
+ import{w,bs}from"./chunk-x2xwfwcx.js";import{isResourceLink as g,isText as v}from"@nyssance/codex-acp-v2/client";import{useRef as h}from"react";function Oi(o,m,x,y=!1){let i=h(null);return(t)=>{if(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.nativeEvent.isComposing||t.nativeEvent.keyCode===229||t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let e=i.current;if(e&&(e.sessionId!==o.id||e.value!==n.value))i.current=null,e=null;let s=t.key==="ArrowUp";if(s?n.value.slice(0,n.selectionStart).includes(`
2
2
  `):n.value.slice(n.selectionEnd).includes(`
3
3
  `))return;if(!e){if(!s||n.value!==""||y)return;let u=o.items.flatMap((a)=>{if(a.kind!=="user")return[];let f=a.content.filter(v).map((l)=>l.text).join(`
4
- `),p=a.content.filter(g).flatMap((l)=>{let d=w(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:xs(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
- export{Fi};
4
+ `),p=a.content.filter(g).flatMap((l)=>{let d=w(l.uri);return d===null?[]:[{id:d,name:l.name}]});return f.trim()||p.length?[{text:bs(f,p),apps:p}]:[]});if(!u.length)return;e={sessionId:o.id,entries:u,index:u.length,value:""},i.current=e}t.preventDefault(),e.index=Math.max(0,Math.min(e.entries.length,e.index+(s?-1:1)));let c=e.entries[e.index],r=c?.text??"";if(x?.(c?.apps??[]),e.value=r,m(r),n.value=r,n.setSelectionRange(r.length,r.length),e.index===e.entries.length)i.current=null}}
5
+ export{Oi};
@@ -1,2 +1,2 @@
1
- import{ExternalLinkIcon as d}from"lucide-react";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as c,CardContent as s,CardDescription as p,CardFooter as C,CardHeader as m,CardTitle as v}from"@nyssance/shadcn/vega/components/ui/card";import{jsx as a,jsxs as e}from"react/jsx-runtime";function Mi({message:r,url:t,t:i,onOpen:l,onRespond:o}){return e(c,{size:"sm",children:[e(m,{children:[a(p,{children:i("approval.needed")}),a(v,{children:r})]}),a(s,{children:e("div",{className:"flex flex-col gap-3",children:[e(n,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),e(C,{className:"flex flex-wrap gap-2",children:[a(n,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(n,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
- export{Mi};
1
+ import{ExternalLinkIcon as d}from"lucide-react";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{Card as c,CardContent as s,CardDescription as p,CardFooter as C,CardHeader as m,CardTitle as v}from"@nyssance/shadcn/vega/components/ui/card";import{jsx as a,jsxs as e}from"react/jsx-runtime";function Ni({message:r,url:t,t:i,onOpen:l,onRespond:o}){return e(c,{size:"sm",children:[e(m,{children:[a(p,{children:i("approval.needed")}),a(v,{children:r})]}),a(s,{children:e("div",{className:"flex flex-col gap-3",children:[e(n,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),e(C,{className:"flex flex-wrap gap-2",children:[a(n,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(n,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
+ export{Ni};
@@ -1,5 +1,5 @@
1
- import{Lt,Dt,Jn}from"./chunk-gw4zbw0m.js";import{Ot,g}from"./chunk-q8c4k6qh.js";import{InputGroupTextarea as A}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as K}from"cn";import{forwardRef as R,useCallback as D,useEffect as h,useImperativeHandle as M,useRef as d}from"react";import{flushSync as F}from"react-dom";import{jsx as N}from"react/jsx-runtime";var L=(u)=>!u.shiftKey,z=(u)=>u.altKey&&!u.ctrlKey&&!u.metaKey,Co=R(({onChange:u,onKeyDown:v,onCompositionStart:x,onCompositionEnd:T,className:b,placeholder:y,bashMode:E=!1,isSendShortcut:I=L,isNewlineShortcut:C=z,...f},S)=>{let r=Ot(),H=g(),i=d(!1),c=d(!1),a=d(null),s=d(null),o=D(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||s.current!==null)return;s.current=requestAnimationFrame(()=>{s.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);h(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,n=new ResizeObserver(([l])=>{if(l&&l.contentRect.width!==t)t=l.contentRect.width,o()});return n.observe(e),o(),()=>{if(n.disconnect(),s.current!==null)cancelAnimationFrame(s.current);s.current=null}},[o]),h(o,[o,r?.textInput.value,f.value]);let p=E&&(r?.textInput.value??"").startsWith("!"),P=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||c.current)return;if(v?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
1
+ import{Lt,Dt,Xn}from"./chunk-w1ndngnh.js";import{Ot,g}from"./chunk-hqfmwbq5.js";import{InputGroupTextarea as A}from"@nyssance/shadcn/vega/components/ui/input-group";import{cn as K}from"cn";import{forwardRef as R,useCallback as D,useEffect as h,useImperativeHandle as M,useRef as d}from"react";import{flushSync as F}from"react-dom";import{jsx as N}from"react/jsx-runtime";var L=(u)=>!u.shiftKey,z=(u)=>u.altKey&&!u.ctrlKey&&!u.metaKey,wo=R(({onChange:u,onKeyDown:v,onCompositionStart:x,onCompositionEnd:T,className:b,placeholder:y,bashMode:E=!1,isSendShortcut:I=L,isNewlineShortcut:C=z,...f},S)=>{let r=Ot(),H=g(),i=d(!1),c=d(!1),a=d(null),s=d(null),o=D(()=>{if(globalThis.CSS?.supports?.("field-sizing","content")||s.current!==null)return;s.current=requestAnimationFrame(()=>{s.current=null;let e=a.current;if(!e||i.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`})},[]);h(()=>{let e=a.current;if(!e||globalThis.CSS?.supports?.("field-sizing","content"))return;let t,n=new ResizeObserver(([l])=>{if(l&&l.contentRect.width!==t)t=l.contentRect.width,o()});return n.observe(e),o(),()=>{if(n.disconnect(),s.current!==null)cancelAnimationFrame(s.current);s.current=null}},[o]),h(o,[o,r?.textInput.value,f.value]);let p=E&&(r?.textInput.value??"").startsWith("!"),P=(e)=>{if(i.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||c.current)return;if(v?.(e),e.defaultPrevented)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
2
  `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(p&&r){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),r.textInput.setInput(r.textInput.value.slice(1));return}}if(e.key==="Enter"){if(C(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:n,selectionEnd:l}=t;if(r){let m=`${t.value.slice(0,n)}
3
3
  ${t.value.slice(l)}`;F(()=>r.textInput.setInput(p?`!${m}`:m)),t.setSelectionRange(n+1,n+1)}else t.setRangeText(`
4
- `,n,l,"end");o();return}if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let n=t.querySelector('button[type="submit"]');if(!n||n.disabled)return;t.requestSubmit(n)}}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:n,sawNonImageFile:l}=Lt(t),m=Dt(t);if(n.length>0)e.preventDefault(),H.add(n);else if(l&&!m)e.preventDefault()},w=r?{value:i.current&&a.current?a.current.value:p?r.textInput.value.slice(1):r.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:Jn(e.currentTarget);r.textInput.setInput(p?`!${t}`:t),o(),u?.(e)}}:{onChange:(e)=>{if(!i.current)Jn(e.currentTarget);o(),u?.(e)}};return M(S,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||c.current,getTextarea:()=>a.current}),[]),N(A,{"data-chat-input":!0,ref:a,rows:3,className:K("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",b),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=Jn(e.currentTarget);r?.textInput.setInput(p?`!${t}`:t),o(),T?.(e),c.current=!0,requestAnimationFrame(()=>{c.current=!1})},onCompositionStart:(e)=>{c.current=!1,i.current=!0,x?.(e)},onKeyDown:P,onPaste:k,placeholder:y,...f,...w})});Co.displayName="PromptInputTextarea";
5
- export{Co};
4
+ `,n,l,"end");o();return}if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let n=t.querySelector('button[type="submit"]');if(!n||n.disabled)return;t.requestSubmit(n)}}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:n,sawNonImageFile:l}=Lt(t),m=Dt(t);if(n.length>0)e.preventDefault(),H.add(n);else if(l&&!m)e.preventDefault()},w=r?{value:i.current&&a.current?a.current.value:p?r.textInput.value.slice(1):r.textInput.value,onChange:(e)=>{let t=i.current?e.currentTarget.value:Xn(e.currentTarget);r.textInput.setInput(p?`!${t}`:t),o(),u?.(e)}}:{onChange:(e)=>{if(!i.current)Xn(e.currentTarget);o(),u?.(e)}};return M(S,()=>({resetHeight:()=>{if(a.current)a.current.style.height="auto"},focus:()=>{a.current?.focus()},isComposing:()=>i.current||c.current,getTextarea:()=>a.current}),[]),N(A,{"data-chat-input":!0,ref:a,rows:3,className:K("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",b),name:"message",onCompositionEnd:(e)=>{i.current=!1;let t=Xn(e.currentTarget);r?.textInput.setInput(p?`!${t}`:t),o(),T?.(e),c.current=!0,requestAnimationFrame(()=>{c.current=!1})},onCompositionStart:(e)=>{c.current=!1,i.current=!0,x?.(e)},onKeyDown:P,onPaste:k,placeholder:y,...f,...w})});wo.displayName="PromptInputTextarea";
5
+ export{wo};
@@ -0,0 +1,2 @@
1
+ var ma={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Ai(e){return[...e].toSorted((o,n)=>(ma[o.kind]??99)-(ma[n.kind]??99))}function Qa(e){return e==="allow_once"||e==="allow_always"}function Ja(e){return e==="allow_always"||e==="reject_always"}
2
+ export{ma,Ai,Qa,Ja};
@@ -1,2 +1,2 @@
1
- function _i(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function lo(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function tt(t){return t.type==="array"}function pn(t){return(tt(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
- export{_i,lo,tt,pn};
1
+ function Ii(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function co(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function tt(t){return t.type==="array"}function pn(t){return(tt(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
+ export{Ii,co,tt,pn};
@@ -1,2 +1,2 @@
1
- import{u}from"./chunk-pz5d0vgv.js";async function ha(a){let e=await u.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
- export{ha};
1
+ import{u}from"./chunk-89jwjv3m.js";async function va(a){let e=await u.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
+ export{va};
@@ -1,2 +1,2 @@
1
- var t=new Map;var a=0;function Ro(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Ro(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Dr(e,n){return d??=new l,d.connect(e,n)}
2
- export{Ro,Dr};
1
+ var t=new Map;var a=0;function Lo(e,n){let r=n?void 0:t.get(e);if(r===void 0)return null;return t.delete(e),t.set(e,r),{...r,tokens:structuredClone(r.tokens)}}function c(e){if(e.isStreaming||e.text.length>1048576)return;if(t.delete(e.text))a-=e.text.length;t.set(e.text,{...e,tokens:structuredClone(e.tokens)}),a+=e.text.length;while(a>2097152||t.size>200){let n=t.keys().next().value;a-=n.length,t.delete(n)}}class l{worker=new Worker(new URL("@alwith/module-chat/markdown-parser.worker",import.meta.url),{type:"module"});clients=new Map;pending=new Map;active=null;failure=null;nextClientId=0;constructor(){this.worker.onmessage=(e)=>{let n=e.data,r=this.active;if(n.clientId!==r?.clientId||n.revision!==r.revision){this.fail(Error("Markdown worker returned an unexpected request"));return}if(this.active=null,!n.ok){this.fail(Error(n.error));return}let i={...r.input,tokens:n.tokens};c(i);let s=this.clients.get(r.clientId),o=this.pending.get(r.clientId),u=o!==void 0&&r.input.isStreaming&&o.input.isStreaming&&o.input.text.startsWith(r.input.text);if(s!==void 0&&(s.revision===r.revision||u))s.onResult(i);this.dispatch()},this.worker.onerror=(e)=>this.fail(Error(e.message)),this.worker.onmessageerror=()=>this.fail(Error("Cannot deserialize Markdown parsing result"))}fail(e){this.failure=e,this.worker.terminate(),this.pending.clear(),this.active=null;for(let n of this.clients.values())n.onError(e)}send(e){try{this.worker.postMessage(e)}catch(n){this.fail(n instanceof Error?n:Error(String(n)))}}dispatch(){if(this.active!==null||this.pending.size===0)return;let e=this.pending.values().next().value;this.pending.delete(e.clientId),this.active=e,this.send({type:"parse",clientId:e.clientId,revision:e.revision,source:e.input.source})}connect(e,n){if(this.failure!==null)throw this.failure;let r=++this.nextClientId,i={revision:0,onResult:e,onError:n};return this.clients.set(r,i),{update:(s)=>{if(this.failure!==null)throw this.failure;i.revision+=1;let o=Lo(s.text,s.isStreaming);if(o!==null){this.pending.delete(r),i.onResult(o);return}this.pending.set(r,{clientId:r,revision:i.revision,input:s}),this.dispatch()},dispose:()=>{if(!this.clients.delete(r))return;if(this.pending.delete(r),this.clients.size===0)this.worker.terminate(),d=void 0;else if(this.failure===null)this.send({type:"dispose",clientId:r})}}}}var d;function Fr(e,n){return d??=new l,d.connect(e,n)}
2
+ export{Lo,Fr};
@@ -1,3 +1,3 @@
1
- import{c,F}from"./chunk-gk7nn747.js";import{ie}from"./chunk-b3mja7d9.js";import{Gr}from"./chunk-k1w3acq7.js";import{xe}from"./chunk-f2h074g0.js";import{qr,zt}from"./chunk-1vwece23.js";import{$r}from"./chunk-ha1s3jbc.js";import{qo}from"./chunk-s1w3j9p9.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(F,{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(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(xe,{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 ml({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(Fo,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=Gr(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"&&ie(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(zt,{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(Oo,{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($r,{blocks:f}):y(f))})}function Fo({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(qo,{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 Oo({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(qr,{...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{ml,Fo,Oo};
1
+ import{c,F}from"./chunk-hxstf6c4.js";import{ie}from"./chunk-rcj2df96.js";import{zr}from"./chunk-7vhhtb2a.js";import{xe}from"./chunk-f2h074g0.js";import{Wr,zt}from"./chunk-g551brtp.js";import{jr}from"./chunk-d564jqyw.js";import{Wo}from"./chunk-gq2gckvv.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(F,{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(F,{text:t.thinking,streaming:!t.isComplete}):null;case"plan":return o(xe,{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 ml({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(Oo,{text:C,isMostRecentTurn:n,beforeCopy:r,afterCopy:d,time:i}):null,l=zr(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"&&ie(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(zt,{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(Ho,{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(jr,{blocks:f}):y(f))})}function Oo({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(Wo,{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 Ho({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(Wr,{...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{ml,Oo,Ho};
@@ -1,2 +1,2 @@
1
- import{u,go}from"./chunk-pz5d0vgv.js";import{Vn}from"./chunk-th5vv83g.js";import{useEffect as p,useRef as P,useState as m}from"react";var Li="providers:changed",Di="providers:managed-revoked",i=(e)=>e;function yn(){return{read:()=>i(u.providersRead()),save:(e,r,t)=>i(u.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(u.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(u.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>u.providersTest({providerId:e}),apply:()=>i(u.providersApply()),onChanged:(e)=>go[Li].listen((r)=>e(r.payload))}}function ya(){return{bind:(e)=>u.providersAccountBind({account:e}),refresh:(e,r)=>i(u.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await u.providersClearManaged()},onRevoked:(e)=>go[Di].listen((r)=>e(r.payload.sessionIds))}}async function xn(e){try{return await e.apply()}catch(r){if(!Vn(r))throw r;return e.read()}}function bn(e,r=console.error){let[t,d]=m(null),a=P(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
- export{Li,Di,yn,ya,xn,bn};
1
+ import{u,fo}from"./chunk-89jwjv3m.js";import{$n}from"./chunk-0ck2zpaa.js";import{useEffect as p,useRef as P,useState as m}from"react";var Di="providers:changed",Fi="providers:managed-revoked",i=(e)=>e;function yn(){return{read:()=>i(u.providersRead()),save:(e,r,t)=>i(u.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(u.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(u.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>u.providersTest({providerId:e}),apply:()=>i(u.providersApply()),onChanged:(e)=>fo[Di].listen((r)=>e(r.payload))}}function xa(){return{bind:(e)=>u.providersAccountBind({account:e}),refresh:(e,r)=>i(u.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await u.providersClearManaged()},onRevoked:(e)=>fo[Fi].listen((r)=>e(r.payload.sessionIds))}}async function xn(e){try{return await e.apply()}catch(r){if(!$n(r))throw r;return e.read()}}function bn(e,r=console.error){let[t,d]=m(null),a=P(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
2
+ export{Di,Fi,yn,xa,xn,bn};
@@ -1,2 +1,2 @@
1
- import{codexMessageError as u,codexTurnError as i}from"@nyssance/codex-acp-v2/client";var a=[10,30,120,300];function ns(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||i(l).kind!=="overloaded")break;if(n++,o.user!==null)break}return a[n-1]??null}
2
- export{ns};
1
+ import{codexMessageError as u,codexTurnError as i}from"@nyssance/codex-acp-v2/client";var a=[10,30,120,300];function os(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||i(l).kind!=="overloaded")break;if(n++,o.user!==null)break}return a[n-1]??null}
2
+ export{os};
@@ -1,3 +1,3 @@
1
- import{Ti}from"./chunk-nfnejf16.js";import{Ai}from"./chunk-z53fd30n.js";import{Mi}from"./chunk-y5qzgfsd.js";import{wt}from"./chunk-y8aeahf2.js";import{n}from"./chunk-aj0z9a5r.js";import{e}from"./chunk-qgrd5xre.js";import{isContentEntry as b,isDiffEntry as w,isFormElicitation as C,isText as j,isToolCallSubject as f,isUrlElicitation as y}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as m}from"react/jsx-runtime";function nt(t){return t.kind==="elicitation"&&C(t.params)}function R(t,o){if(!t.subject||!f(t.subject)||o===void 0)return t;let s={toolCallId:o.id,name:o.name,title:o.title,kind:o.toolKind,content:o.content,locations:o.locations,rawInput:o.rawInput},i=Object.fromEntries(Object.entries(t.subject.toolCall).filter(([,l])=>l!=null));return{...t,subject:{...t.subject,toolCall:{...s,...i}}}}function T(t){let o=t._meta?.codex;if(typeof o!=="object"||o===null)return null;let s=o.description;return typeof s==="string"?s:null}function A(t){let o=t.rawInput;if(typeof o!=="object"||o===null)return null;let s=o.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let o of t.content??[])if(w(o)&&o.patch&&o.patch.text.length>0)return o.patch.text;return null}function P(t){return(t.content??[]).filter(b).map((o)=>j(o.content)?o.content.text:"").filter((o)=>o.length>0).join(`
2
- `)}function I({subject:t,requestTitle:o}){let{host:s}=e();if(!f(t))return null;let i=t.toolCall,l=A(i),r=v(i),u=P(i),d=s.toolTitle?.(i)??i.title;return m("div",{className:"flex flex-col gap-2",children:[d&&d!==o&&l===null&&c("div",{className:"text-sm font-medium",children:d}),l!==null&&m("pre",{className:"bg-muted max-h-80 overflow-auto overscroll-contain rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[c("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),r!==null&&c("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:c(wt,{patch:r,theme:s.theme})}),r===null&&l===null&&u.length>0&&c("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:u}),(i.locations??[]).length>0&&c("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(i.locations??[]).map((a)=>c("li",{className:"truncate font-mono",children:a.path},`${a.path}:${a.line??""}`))})]})}function g(t,o){let{host:s,client:i}=e();return(l)=>{try{if(o)o(t.id,l);else i.respond(t.id,l)}catch(r){if(s.reportError)s.reportError(r);else console.error(r)}}}function E({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=t.params.subject,u=r&&f(r)?r.toolCall.toolCallId:null,d=n((p)=>p.sessions[t.sessionId]?.items.find((h)=>h.kind==="tool"&&h.id===u)),a=R(t.params,d),x=i.permissionTitle?.(a)??a.title;return m(Ti,{requestId:t.id,title:x,alwaysLabel:i.t("approval.always"),autoFocus:"if-idle",total:o,options:a.options.map((p)=>({...p,description:T(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[a.description&&c("div",{className:"text-muted-foreground mt-0.5 text-xs",children:a.description}),a.subject&&c(I,{subject:a.subject,requestTitle:x})]})}function Ct({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=n((u)=>t.sessionId===null?void 0:u.sessions[t.sessionId]);return c(Ai,{requestId:t.id,schema:t.params.requestedSchema,message:r?.subagent?`${r.title??i.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:o,t:i.t,onRespond:l})}function He({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s);if(t.kind==="permission")return c(E,{action:t,total:o,onRespond:s});if(nt(t))return c(Ct,{action:t,total:o??1,onRespond:s});let r=t.params;if(!y(r))throw Error("Unsupported elicitation mode");return c(Mi,{message:r.message,url:r.url,t:i.t,onOpen:i.openLink,onRespond:(u)=>l(u==="cancel"?{action:"cancel"}:{action:"decline"})})}
1
+ import{Mi}from"./chunk-fm35s6dq.js";import{Ei}from"./chunk-6m7bnj0g.js";import{Ni}from"./chunk-md3d3pby.js";import{wt}from"./chunk-h12xxave.js";import{n}from"./chunk-bb2s9nb6.js";import{e}from"./chunk-8e9h60we.js";import{isContentEntry as b,isDiffEntry as w,isFormElicitation as C,isText as j,isToolCallSubject as f,isUrlElicitation as y}from"@nyssance/codex-acp-v2/client";import{jsx as c,jsxs as m}from"react/jsx-runtime";function nt(t){return t.kind==="elicitation"&&C(t.params)}function R(t,o){if(!t.subject||!f(t.subject)||o===void 0)return t;let s={toolCallId:o.id,name:o.name,title:o.title,kind:o.toolKind,content:o.content,locations:o.locations,rawInput:o.rawInput},i=Object.fromEntries(Object.entries(t.subject.toolCall).filter(([,l])=>l!=null));return{...t,subject:{...t.subject,toolCall:{...s,...i}}}}function T(t){let o=t._meta?.codex;if(typeof o!=="object"||o===null)return null;let s=o.description;return typeof s==="string"?s:null}function A(t){let o=t.rawInput;if(typeof o!=="object"||o===null)return null;let s=o.command;if(typeof s==="string")return s;if(Array.isArray(s))return s.map(String).join(" ");return null}function v(t){for(let o of t.content??[])if(w(o)&&o.patch&&o.patch.text.length>0)return o.patch.text;return null}function P(t){return(t.content??[]).filter(b).map((o)=>j(o.content)?o.content.text:"").filter((o)=>o.length>0).join(`
2
+ `)}function I({subject:t,requestTitle:o}){let{host:s}=e();if(!f(t))return null;let i=t.toolCall,l=A(i),r=v(i),u=P(i),d=s.toolTitle?.(i)??i.title;return m("div",{className:"flex flex-col gap-2",children:[d&&d!==o&&l===null&&c("div",{className:"text-sm font-medium",children:d}),l!==null&&m("pre",{className:"bg-muted max-h-80 overflow-auto overscroll-contain rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:[c("span",{className:"text-muted-foreground select-none",children:"$ "}),l]}),r!==null&&c("div",{className:"max-h-80 overflow-auto rounded-lg border","data-stream-style":"codexUI",children:c(wt,{patch:r,theme:s.theme})}),r===null&&l===null&&u.length>0&&c("pre",{className:"bg-muted max-h-60 overflow-auto rounded-lg p-3 font-mono text-xs whitespace-pre-wrap",children:u}),(i.locations??[]).length>0&&c("ul",{className:"text-muted-foreground flex flex-col gap-0.5 text-xs",children:(i.locations??[]).map((a)=>c("li",{className:"truncate font-mono",children:a.path},`${a.path}:${a.line??""}`))})]})}function g(t,o){let{host:s,client:i}=e();return(l)=>{try{if(o)o(t.id,l);else i.respond(t.id,l)}catch(r){if(s.reportError)s.reportError(r);else console.error(r)}}}function E({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=t.params.subject,u=r&&f(r)?r.toolCall.toolCallId:null,d=n((p)=>p.sessions[t.sessionId]?.items.find((h)=>h.kind==="tool"&&h.id===u)),a=R(t.params,d),x=i.permissionTitle?.(a)??a.title;return m(Mi,{requestId:t.id,title:x,alwaysLabel:i.t("approval.always"),autoFocus:"if-idle",total:o,options:a.options.map((p)=>({...p,description:T(p)??void 0})),onRespond:(p)=>l({outcome:p===null?{outcome:"cancelled"}:{outcome:"selected",optionId:p}}),children:[a.description&&c("div",{className:"text-muted-foreground mt-0.5 text-xs",children:a.description}),a.subject&&c(I,{subject:a.subject,requestTitle:x})]})}function Ct({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s),r=n((u)=>t.sessionId===null?void 0:u.sessions[t.sessionId]);return c(Ei,{requestId:t.id,schema:t.params.requestedSchema,message:r?.subagent?`${r.title??i.t("subagents.untitled")}: ${t.params.message}`:t.params.message,total:o,t:i.t,onRespond:l})}function He({action:t,total:o,onRespond:s}){let{host:i}=e(),l=g(t,s);if(t.kind==="permission")return c(E,{action:t,total:o,onRespond:s});if(nt(t))return c(Ct,{action:t,total:o??1,onRespond:s});let r=t.params;if(!y(r))throw Error("Unsupported elicitation mode");return c(Ni,{message:r.message,url:r.url,t:i.t,onOpen:i.openLink,onRespond:(u)=>l(u==="cancel"?{action:"cancel"}:{action:"decline"})})}
3
3
  export{nt,Ct,He};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-qgrd5xre.js";import{He}from"./chunk-nebke41s.js";import{it}from"./chunk-vyvsm4v9.js";import{an}from"./chunk-qkddvxjr.js";import{format as f}from"date-fns";import{useState as y}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Skeleton as m}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as t,jsxs as u,Fragment as h}from"react/jsx-runtime";function rn({label:o,window:a,t:l}){let n=a?100-Math.round(Math.min(100,Math.max(0,a.usedPercent))):0,i=a&&a.resetsAt!==null?l("usage.resetsAt",{time:f(new Date(a.resetsAt*1000),"yyyy/MM/dd HH:mm")}):null;return u("div",{className:"space-y-1.5","aria-busy":!a,children:[u("div",{className:"grid min-h-5 grid-cols-[3.5rem_minmax(0,1fr)_5rem] items-center gap-3",children:[a?t("span",{className:"text-sm",children:o}):t(m,{className:"h-4 w-10 motion-reduce:animate-none"}),a?t("div",{className:"bg-muted h-2 overflow-hidden rounded-full",role:"progressbar","aria-label":o,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:t("div",{className:"bg-primary h-full rounded-full",style:{width:`${n}%`}})}):t(m,{className:"h-2 rounded-full motion-reduce:animate-none"}),a?t("span",{className:"text-muted-foreground text-end text-xs tabular-nums",children:l("usage.remaining",{percent:n})}):t(m,{className:"h-4 w-14 justify-self-end motion-reduce:animate-none"})]}),t("div",{className:"text-muted-foreground flex min-h-4 items-center justify-end text-xs",children:a?i:t(m,{className:"h-3 w-32 motion-reduce:animate-none"})})]})}function hi({account:o,disabled:a,onSignOut:l}){let{t:n}=e().host,i=o===void 0,r=o?.account.account??null,c=o===null?n("usage.accountUnavailable"):r===null?n("usage.notSignedIn"):r.type==="chatgpt"?[r.email,r.planType!=="unknown"?n(`usage.plan.${r.planType}`):null].filter(Boolean).join(" · "):r.type==="apiKey"?n("usage.apiKey"):n("usage.bedrock"),s=o?.rateLimits??null;return u("section",{"aria-busy":i,"aria-label":"Codex",className:"space-y-4",children:[u("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[i?t(m,{className:"h-4 w-40 max-w-[65%] motion-reduce:animate-none"}):t("span",{className:"min-w-0 text-sm break-words",children:c}),i?t(m,{className:"h-8 w-16 shrink-0 motion-reduce:animate-none"}):r!==null&&t(x,{variant:"outline",size:"sm",className:"shrink-0",disabled:a,onClick:l,children:n("connection.signOut")})]}),(i||r!==null)&&t("div",{className:"flex flex-col gap-4",children:i?t(rn,{t:n}):s===null?t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")}):u(h,{children:[s.primary!==null&&t(rn,{label:it(s.primary,n),window:s.primary,t:n}),s.secondary!==null&&t(rn,{label:it(s.secondary,n),window:s.secondary,t:n}),s.primary===null&&s.secondary===null&&t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")})]})})]})}function sn({bridge:o,className:a="rounded-xl border p-4"}){let{host:l}=e(),n=o.useSettingsAgent(),i=o.useSettingsAccount(),[r,c]=y(!1);return u("div",{className:a,children:[t(hi,{account:i,disabled:n==null||r,onSignOut:()=>{c(!0),o.requestSignOut().catch((s)=>l.reportError?.(s)).finally(()=>c(!1))}}),i!=null&&!i.account.account&&n&&t(an,{methods:n.authMethods,signIn:o.requestSignIn}),n?.actions.map((s)=>t(He,{action:s,onRespond:(d,p)=>{o.requestActionResponse(d,p).catch((g)=>l.reportError?.(g))}},s.id))]})}
2
- export{rn,hi,sn};
1
+ import{e}from"./chunk-8e9h60we.js";import{He}from"./chunk-nrt1zx5c.js";import{it}from"./chunk-3q3n1n1m.js";import{an}from"./chunk-dxjwdfra.js";import{format as f}from"date-fns";import{useState as y}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Skeleton as m}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as t,jsxs as u,Fragment as h}from"react/jsx-runtime";function rn({label:o,window:a,t:l}){let n=a?100-Math.round(Math.min(100,Math.max(0,a.usedPercent))):0,i=a&&a.resetsAt!==null?l("usage.resetsAt",{time:f(new Date(a.resetsAt*1000),"yyyy/MM/dd HH:mm")}):null;return u("div",{className:"space-y-1.5","aria-busy":!a,children:[u("div",{className:"grid min-h-5 grid-cols-[3.5rem_minmax(0,1fr)_5rem] items-center gap-3",children:[a?t("span",{className:"text-sm",children:o}):t(m,{className:"h-4 w-10 motion-reduce:animate-none"}),a?t("div",{className:"bg-muted h-2 overflow-hidden rounded-full",role:"progressbar","aria-label":o,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:t("div",{className:"bg-primary h-full rounded-full",style:{width:`${n}%`}})}):t(m,{className:"h-2 rounded-full motion-reduce:animate-none"}),a?t("span",{className:"text-muted-foreground text-end text-xs tabular-nums",children:l("usage.remaining",{percent:n})}):t(m,{className:"h-4 w-14 justify-self-end motion-reduce:animate-none"})]}),t("div",{className:"text-muted-foreground flex min-h-4 items-center justify-end text-xs",children:a?i:t(m,{className:"h-3 w-32 motion-reduce:animate-none"})})]})}function vi({account:o,disabled:a,onSignOut:l}){let{t:n}=e().host,i=o===void 0,r=o?.account.account??null,c=o===null?n("usage.accountUnavailable"):r===null?n("usage.notSignedIn"):r.type==="chatgpt"?[r.email,r.planType!=="unknown"?n(`usage.plan.${r.planType}`):null].filter(Boolean).join(" · "):r.type==="apiKey"?n("usage.apiKey"):n("usage.bedrock"),s=o?.rateLimits??null;return u("section",{"aria-busy":i,"aria-label":"Codex",className:"space-y-4",children:[u("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[i?t(m,{className:"h-4 w-40 max-w-[65%] motion-reduce:animate-none"}):t("span",{className:"min-w-0 text-sm break-words",children:c}),i?t(m,{className:"h-8 w-16 shrink-0 motion-reduce:animate-none"}):r!==null&&t(x,{variant:"outline",size:"sm",className:"shrink-0",disabled:a,onClick:l,children:n("connection.signOut")})]}),(i||r!==null)&&t("div",{className:"flex flex-col gap-4",children:i?t(rn,{t:n}):s===null?t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")}):u(h,{children:[s.primary!==null&&t(rn,{label:it(s.primary,n),window:s.primary,t:n}),s.secondary!==null&&t(rn,{label:it(s.secondary,n),window:s.secondary,t:n}),s.primary===null&&s.secondary===null&&t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")})]})})]})}function sn({bridge:o,className:a="rounded-xl border p-4"}){let{host:l}=e(),n=o.useSettingsAgent(),i=o.useSettingsAccount(),[r,c]=y(!1);return u("div",{className:a,children:[t(vi,{account:i,disabled:n==null||r,onSignOut:()=>{c(!0),o.requestSignOut().catch((s)=>l.reportError?.(s)).finally(()=>c(!1))}}),i!=null&&!i.account.account&&n&&t(an,{methods:n.authMethods,signIn:o.requestSignIn}),n?.actions.map((s)=>t(He,{action:s,onRespond:(d,p)=>{o.requestActionResponse(d,p).catch((g)=>l.reportError?.(g))}},s.id))]})}
2
+ export{rn,vi,sn};
@@ -1,2 +1,2 @@
1
- import{Ao}from"./chunk-mybye5t2.js";async function xr(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Ht(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Ao(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
- export{xr,Ht};
1
+ import{Eo}from"./chunk-6w7js8qd.js";async function br(i,c){let s=new WeakSet;while(!c.aborted){let r=[...i.querySelectorAll('[data-codex-disclosure][aria-expanded="false"]')].filter((e)=>!s.has(e)&&!e.matches(":disabled"));for(let e of r)s.add(e),e.click();if(r.length===0&&i.querySelector("[data-markdown-pending]")===null)return;await new Promise((e)=>requestAnimationFrame(()=>e()))}}function Ht(i,c){if(!c)return[];let s=[],r="",e=[],l=()=>{let t=0,n=0;for(let{start:a,end:o}of Eo(r,c)){while(t<e.length&&e[t].end<=a)t++;n=Math.max(n,t);while(n<e.length&&e[n].end<o)n++;let d=e[t],f=e[n];if(!d||!f)throw Error("Search text offset has no DOM node");let h=document.createRange();h.setStart(d.node,a-d.start),h.setEnd(f.node,o-f.start),s.push(h)}r="",e=[]},m=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DIV","DL","DT","DD","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","TD","TH","TR","UL"]),u=(t)=>{if(t.nodeType===Node.TEXT_NODE){let a=t.parentElement;if(!a||a.offsetParent===null&&a.tagName!=="BODY")return;let o=t.nodeValue??"";e.push({node:t,start:r.length,end:r.length+o.length}),r+=o;return}if(!(t instanceof Element))return;if(t.matches("script, style, [hidden], [aria-hidden='true']")){l();return}if(t.tagName==="BR"){l();return}let n=m.has(t.tagName);if(n)l();for(let a of t.childNodes)u(a);if(n)l()};return u(i),l(),s}
2
+ export{br,Ht};
@@ -1,2 +1,2 @@
1
- import{Bt}from"./chunk-22nybrkv.js";import{d,Je}from"./chunk-qvzxzzw8.js";import{S}from"./chunk-mhrn3e8j.js";import{MoreHorizontalIcon as N}from"lucide-react";import{useEffect as y,useState as p}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as D,DropdownMenuContent as P,DropdownMenuItem as g,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as I}from"react/jsx-runtime";function ii(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function z(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function C(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function Ie({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[h,M]=p(0);y(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,h,c]);let k=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(D,{children:[o(b,{render:o(x,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(N,{})}),i(P,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Je(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Je(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Je(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(I,{children:[s?s(k):o("div",{className:"flex justify-end",children:k}),o(S,{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":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(x,{variant:"outline",size:"sm",onClick:()=>M((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Bt,{text:ii(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:C(`${z(n)}/${r}`))}})})]})}
2
- export{ii,Ie};
1
+ import{Bt}from"./chunk-m31z2z11.js";import{d,Je}from"./chunk-21mp4gww.js";import{S}from"./chunk-mhrn3e8j.js";import{MoreHorizontalIcon as N}from"lucide-react";import{useEffect as y,useState as p}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as D,DropdownMenuContent as P,DropdownMenuItem as g,DropdownMenuTrigger as b}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Skeleton as u}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as o,jsxs as i,Fragment as I}from"react/jsx-runtime";function ri(n){return n.replace(/^\uFEFF?---\r?\n[\s\S]*?\r?\n(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/,"")}function z(n){let s=n.replaceAll("\\","/"),t=s.lastIndexOf("/");return t<=0?"/":s.slice(0,t)}function C(n){let s=/^(\/\/[^/]+\/[^/]+|[A-Za-z]:\/|\/)/.exec(n)?.[0]??"",t=[];for(let e of n.slice(s.length).split("/")){if(!e||e===".")continue;if(e==="..")t.pop();else t.push(e)}return`${s.replace(/\/$/,"")}/${t.join("/")}`}function Ie({path:n,renderHeader:s,description:t}){let e=d(),{t:l}=e,c=e.readFile,[a,f]=p(null),[v,w]=p(null),[h,M]=p(0);y(()=>{let r=!1;return f(null),w(null),(n===null||!c?Promise.resolve(t??""):c(n)).then((m)=>{if(!r)f(m)},(m)=>{if(!r)w(String(m))}),()=>{r=!0}},[n,t,h,c]);let k=n===null||!e.openPath&&!e.revealPath&&!e.copyText?null:i(D,{children:[o(b,{render:o(x,{variant:"ghost",size:"icon-sm","aria-label":l("plugins.card.moreActions")}),children:o(N,{})}),i(P,{align:"end",children:[e.openPath&&o(g,{onClick:()=>void Je(e,e.openPath(n)),children:l("plugins.skills.document.open")}),e.revealPath&&o(g,{onClick:()=>void Je(e,e.revealPath(n)),children:l("plugins.skills.document.reveal")}),e.copyText&&o(g,{disabled:a===null,onClick:()=>{if(a!==null)Je(e,e.copyText(a))},children:l("plugins.skills.document.copy")})]})]});return i(I,{children:[s?s(k):o("div",{className:"flex justify-end",children:k}),o(S,{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":l("plugins.skills.document.content")},children:v?i("div",{role:"alert",className:"space-y-3",children:[i("p",{className:"text-destructive text-sm break-words",children:[l("plugins.skills.document.error"),": ",v]}),o(x,{variant:"outline",size:"sm",onClick:()=>M((r)=>r+1),children:l("plugins.loadError.retry")})]}):a===null?i("div",{role:"status","aria-label":l("plugins.skills.loading"),className:"space-y-3",children:[o(u,{className:"h-6 w-1/3"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-full"}),o(u,{className:"h-4 w-2/3"})]}):o(Bt,{text:ri(a),host:{theme:e.theme,copyLabel:l("plugins.copy"),openLink:(r)=>e.openLink(/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(r)||n===null?r:C(`${z(n)}/${r}`))}})})]})}
2
+ export{ri,Ie};